From 6f86bc2098bca115ab0e7b2760d414dc435d0298 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Thu, 25 Apr 2024 23:55:26 +0800 Subject: [PATCH 001/282] [bgp] Add bgp_router_id in DEVICE_METADATA (#18534) --- src/sonic-yang-models/doc/Configuration.md | 3 ++- .../tests/files/sample_config_db.json | 3 ++- .../tests/device_metadata.json | 7 +++++++ .../tests_config/device_metadata.json | 18 ++++++++++++++++++ .../yang-models/sonic-device_metadata.yang | 5 +++++ 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 8558142e6b6d..9980773a74a6 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -959,7 +959,8 @@ instance is supported in SONiC. "buffer_model": "traditional", "yang_config_validation": "disable", "rack_mgmt_map": "dummy_value", - "timezome": "Europe/Kiev" + "timezome": "Europe/Kiev", + "bgp_router_id": "8.8.8.8" } } } diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index eaf110d88119..1e9ed06c2129 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -368,7 +368,8 @@ "bgp_adv_lo_prefix_as_128": "true", "yang_config_validation": "disable", "rack_mgmt_map": "dummy_value", - "timezone": "Europe/Kiev" + "timezone": "Europe/Kiev", + "bgp_router_id": "8.8.8.8" } }, "VLAN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 1542407f5f3a..226107109944 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -162,5 +162,12 @@ "DEVICE_METADATA_INVALID_CREATE_ONLY_CONFIG_DB_BUFFERS": { "desc": "Verifying invalid create_only_config_db_buffers value", "eStrKey": "InvalidValue" + }, + "DEVICE_METADATA_VALID_BGP_ROUTER_ID": { + "desc": "Verifying bgp_router_id configuration." + }, + "DEVICE_METADATA_INVALID_BGP_ROUTER_ID": { + "desc": "Verifying invalid bgp_router_id configuration.", + "eStrKey": "Pattern" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index 0c33f93b668c..cda0eef26e23 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -444,5 +444,23 @@ } } } + }, + "DEVICE_METADATA_VALID_BGP_ROUTER_ID": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "bgp_router_id": "8.8.8.8" + } + } + } + }, + "DEVICE_METADATA_INVALID_BGP_ROUTER_ID": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "bgp_router_id": "8.8.8.300" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index dce3db1541e8..02f81283cf7d 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -249,6 +249,11 @@ module sonic-device_metadata { otherwise the maximum available buffers (which are read from SAI) will be created, regardless of the CONFIG_DB buffers configuration."; } + + leaf bgp_router_id { + type inet:ipv4-address; + description "BGP Router identifier"; + } } /* end of container localhost */ } From 018b3f00c412fe7fadff927115487a221037dab6 Mon Sep 17 00:00:00 2001 From: Deepak Singhal <115033986+deepak-singhal0408@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:29:17 -0700 Subject: [PATCH 002/282] Copy .profile files to already existing hw_sku directories under device/virtual (#18803) Fix regression in sonic-swss dvs tests Microsoft ADO (number only): 27817304 How I did it Restore the .profile files back to already existing hw_sku directories under platform/virtual copy lanemap.ini file in DPU_2P hwsku --- device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/lanemap.ini | 2 ++ src/sonic-device-data/Makefile | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/lanemap.ini diff --git a/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/lanemap.ini b/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/lanemap.ini new file mode 100644 index 000000000000..0967d7eb6c14 --- /dev/null +++ b/device/virtual/x86_64-kvm_x86_64-r0/DPU-2P/lanemap.ini @@ -0,0 +1,2 @@ +eth1:0,1,2,3 +eth2:4,5,6,7 diff --git a/src/sonic-device-data/Makefile b/src/sonic-device-data/Makefile index 5473650e70ff..298f8f6303ec 100644 --- a/src/sonic-device-data/Makefile +++ b/src/sonic-device-data/Makefile @@ -18,6 +18,10 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : for d in `find -L ../../../device -maxdepth 3 -mindepth 3 -type d | grep -vE "(plugins|led-code|sonic_platform)"`; do \ # check if hwsku dir exists, if yes, then continue if [ -d device/x86_64-kvm_x86_64-r0/$$(basename $$d) ]; then \ + cp ./sai.vs_profile device/x86_64-kvm_x86_64-r0/$$(basename $$d)/sai.profile; \ + cp ./sai_mlnx.vs_profile device/x86_64-kvm_x86_64-r0/$$(basename $$d)/sai_mlnx.profile; \ + cp ./pai.vs_profile device/x86_64-kvm_x86_64-r0/$$(basename $$d)/pai.profile; \ + cp ./fabriclanemap_vs.ini device/x86_64-kvm_x86_64-r0/$$(basename $$d)/fabriclanemap.ini; \ continue; \ fi; \ cp -Lr $$d device/x86_64-kvm_x86_64-r0/ ; \ From bcc020b35ab54aeb30842de2cc3e8a0841c3db59 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:01:18 +0800 Subject: [PATCH 003/282] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18780) #### Why I did it src/sonic-platform-common ``` * 4163365 - (HEAD -> master, origin/master, origin/HEAD) Fetch firmware versions for Cmis Target FW upgrade supported cables (#455) (10 hours ago) [mihirpat1] * df6b6c6 - parse the output from the beginning of the line (#451) (2 days ago) [Kebo Liu] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-common b/src/sonic-platform-common index dff8d4867783..4163365b97a8 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit dff8d48677836b95e788c410de404d48637bb1c1 +Subproject commit 4163365b97a8a2cb80dc895dcada1a51b5347fd3 From bd35da1e983bf3808ee0e69d74a462e2855bb8a7 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:01:51 +0800 Subject: [PATCH 004/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18747) #### Why I did it src/sonic-swss ``` * 5ef73708 - (HEAD -> master, origin/master, origin/HEAD) [ACL] Remove flex counter when updating ACL rule (#3118) (3 days ago) [bingwang-ms] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 9e183a650cf3..5ef737087a15 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 9e183a650cf38e0d5af46adc1342dcde85ecb84d +Subproject commit 5ef737087a15f23d2038ca840e935f402ad92f31 From 75f0011ed895c5a975560a71a44a91974624decb Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:01:56 +0800 Subject: [PATCH 005/282] [submodule] Update submodule sonic-mgmt-framework to the latest HEAD automatically (#18746) #### Why I did it src/sonic-mgmt-framework ``` * 0a5962d - (HEAD -> master, origin/master, origin/HEAD) Bookworm migration for all dependency packages in azurepipeline for sonic-mgmt-framework (#132) (3 days ago) [amrutasali] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-mgmt-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-framework b/src/sonic-mgmt-framework index 1cd794798821..0a5962da21cd 160000 --- a/src/sonic-mgmt-framework +++ b/src/sonic-mgmt-framework @@ -1 +1 @@ -Subproject commit 1cd79479882174c14f06c73fa0613fb093a6f421 +Subproject commit 0a5962da21cdf0cf541a9198149c31e90cde5f4c From e66185ef3073de494c2dbb1fb6ec18e9eb490a6a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:02:02 +0800 Subject: [PATCH 006/282] [submodule] Update submodule sonic-mgmt-common to the latest HEAD automatically (#18745) #### Why I did it src/sonic-mgmt-common ``` * 5f1191e - (HEAD -> master, origin/master, origin/HEAD) Transformer Infra support for sonic yang structure deviations from flattened structure - sibling list to singleton container and nested list (#129) (33 hours ago) [amrutasali] * 8719034 - Bookworm migration for all dependency packages in azurepipeline for sonic-mgmt-common repo (#133) (3 days ago) [amrutasali] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-mgmt-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-common b/src/sonic-mgmt-common index 72e0df92061c..5f1191e61bef 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit 72e0df92061c794eae170f299fc8f1bba3881a94 +Subproject commit 5f1191e61bef38b66655fbeac8e94bfe2c4710b8 From ef3273861c39fb8b4300147cbdf182e889ae721d Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:02:08 +0800 Subject: [PATCH 007/282] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18738) #### Why I did it src/sonic-platform-daemons ``` * 759862e - (HEAD -> master, origin/master, origin/HEAD) [Xcvrd] Skip to get dom/threshold/pm for flat memory (#458) (4 days ago) [ChiouRung Haung] * 4533780 - [PSUd]Update predefined position_in_parent and parent_name of PSU only once (#452) (4 days ago) [PJHsieh] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 0f61e1522011..759862e6db35 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 0f61e15220113b4f5df13d0eb2bdb9a92833baf4 +Subproject commit 759862e6db350db27e772bd65c36211f9b5f246f From ffe06fbddb3e6766918be20fa380ea0db37c8a7b Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:02:14 +0800 Subject: [PATCH 008/282] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#18724) #### Why I did it src/sonic-gnmi ``` * d0ec8b0 - (HEAD -> master, origin/master, origin/HEAD) Merge pull request #216 from ranjinidn/sonic-gnmi_bookworm_migration (30 hours ago) [Saikrishna Arcot] |\ | failure_prs.log 8e3f408 - Merge branch 'master' into sonic-gnmi_bookworm_migration (6 days ago) [ranjinidn] | |\ | |/ |/| * | 3363587 - Support control character in config (#217) (8 days ago) [ganglv] / * 505bfc2 - bookworm migration of sonic-gnmi azure pipeline and go version updation for sonic-gnmi repo (10 days ago) [ranjinidn] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index 6b63a50c6816..d0ec8b0dcb1a 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit 6b63a50c68165f26cfd930a154c77efd97d85ab1 +Subproject commit d0ec8b0dcb1a546b07cda70a10ee6537ff5096fd From d9c2f9a74245bca19d0b6636d92163e83efe2d68 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:02:21 +0800 Subject: [PATCH 009/282] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#18573) #### Why I did it src/sonic-sairedis ``` * c3395e5 - (HEAD -> master, origin/master, origin/HEAD) Add support for AMD-Pensando elba DSS (#1367) (19 hours ago) [Shantanu Shrivastava] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 73ada8d57281..c3395e5d7593 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 73ada8d57281e700336ce70fb893cec005466fcd +Subproject commit c3395e5d75933d961d6aaafb695753ae7ca3fe07 From 98b1574fbd49af8bb35503ad19ccecebedab3d09 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:02:27 +0800 Subject: [PATCH 010/282] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#18475) #### Why I did it src/sonic-host-services ``` * e93494c - (HEAD -> master, origin/master, origin/HEAD) Update sonic-host-services-data.determine-reboot-cause.service (#119) (2 days ago) [Xincun Li] * 15762a5 - Fix UT test data due to timestamp break. (#117) (4 days ago) [Feng-msft] * d53f431 - [caclmgrd]Fix bfd and vxlan acl rules programming in acl table update scenario (#114) (13 days ago) [Sudharsan Dhamal Gopalarathnam] * f2dbf25 - Add unittest for caclmgrd default deny rule (#113) (2 weeks ago) [Zhijian Li] * bfa06c7 - Change dependency option to fix buildimage issue. (#110) (3 weeks ago) [Feng-msft] * ba78bdb - Fix hostcfgd crash when delete entire config table. (#106) (4 weeks ago) [Hua Liu] * 6130886 - Update ProcessStats query by using API instead of parsing ps command. (#103) (4 weeks ago) [Feng-msft] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index 6fce4781da50..e93494c9c3b1 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 6fce4781da508709f11be595e3c7048ffd3138cb +Subproject commit e93494c9c3b1fc49f998fcdc1daf7b02af8c9aba From dfd5a6b2e9552f46a45b2a5ca10ff26540b7cef8 Mon Sep 17 00:00:00 2001 From: wenyiz2021 <91497961+wenyiz2021@users.noreply.github.com> Date: Fri, 26 Apr 2024 10:00:54 -0700 Subject: [PATCH 011/282] [DNX SAI update] [master] bump DNX SAI version to SAI 10.1.13.1 (#18770) BRCM SAI ver: [10.1.13.0], OCP SAI ver: [1.13.2], SDK ver: [sdk-6.5.29] Microsoft ADO (number only): 27535691 How to verify it SAI bumped up: chassis-linecard$bcmcmd "bcmsai ver" BRCM SAI ver: [10.1.13.0], OCP SAI ver: [1.13.2], SDK ver: [sdk-6.5.29] --- platform/broadcom/sai-modules.mk | 2 +- platform/broadcom/sai.mk | 6 +++--- platform/broadcom/saibcm-modules-dnx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/broadcom/sai-modules.mk b/platform/broadcom/sai-modules.mk index 1666b9590e4d..6271942ccc44 100644 --- a/platform/broadcom/sai-modules.mk +++ b/platform/broadcom/sai-modules.mk @@ -10,7 +10,7 @@ $(BRCM_OPENNSL_KERNEL)_MACHINE = broadcom SONIC_DPKG_DEBS += $(BRCM_OPENNSL_KERNEL) # SAI bcm modules for DNX family ASIC -BRCM_DNX_OPENNSL_KERNEL_VERSION = 9.2.0.0 +BRCM_DNX_OPENNSL_KERNEL_VERSION = 10.1.13.0 BRCM_DNX_OPENNSL_KERNEL = opennsl-modules-dnx_$(BRCM_DNX_OPENNSL_KERNEL_VERSION)_amd64.deb $(BRCM_DNX_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules-dnx diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 44022326e40c..2512caad2901 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,7 +1,7 @@ LIBSAIBCM_XGS_VERSION = 10.1.7.0 -LIBSAIBCM_DNX_VERSION = 9.2.12.1 +LIBSAIBCM_DNX_VERSION = 10.1.13.0 LIBSAIBCM_XGS_BRANCH_NAME = SAI_10.1.0_GA -LIBSAIBCM_DNX_BRANCH_NAME = SAI_9.2.0.3 +LIBSAIBCM_DNX_BRANCH_NAME = SAI_10.1.0_GA LIBSAIBCM_XGS_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/$(LIBSAIBCM_XGS_BRANCH_NAME)/$(LIBSAIBCM_XGS_VERSION)/xgs" LIBSAIBCM_DNX_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/$(LIBSAIBCM_DNX_BRANCH_NAME)/$(LIBSAIBCM_DNX_VERSION)/dnx" @@ -12,7 +12,7 @@ $(eval $(call add_derived_package,$(BRCM_XGS_SAI),$(BRCM_XGS_SAI_DEV))) $(BRCM_XGS_SAI_DEV)_URL = "$(LIBSAIBCM_XGS_URL_PREFIX)/$(BRCM_XGS_SAI_DEV)" # SAI module for DNX Asic family -BRCM_DNX_SAI = libsaibcm_dnx_$(LIBSAIBCM_DNX_VERSION)_amd64.deb +BRCM_DNX_SAI = libsaibcm_$(LIBSAIBCM_DNX_VERSION)_amd64.deb $(BRCM_DNX_SAI)_URL = "$(LIBSAIBCM_DNX_URL_PREFIX)/$(BRCM_DNX_SAI)" SONIC_ONLINE_DEBS += $(BRCM_XGS_SAI) diff --git a/platform/broadcom/saibcm-modules-dnx b/platform/broadcom/saibcm-modules-dnx index 21cceea219c1..231e9683199f 160000 --- a/platform/broadcom/saibcm-modules-dnx +++ b/platform/broadcom/saibcm-modules-dnx @@ -1 +1 @@ -Subproject commit 21cceea219c117fed4dac7af834b403c6ebc827e +Subproject commit 231e9683199fec974cf71311b9ba47b3f48b6e7a From 7a26fd741d362f6a6341ad9f149e5dc6d3b0eebc Mon Sep 17 00:00:00 2001 From: Xincun Li <147451452+xincunli-sonic@users.noreply.github.com> Date: Fri, 26 Apr 2024 13:15:20 -0700 Subject: [PATCH 012/282] Rename the leaf nodes to lower case. (#18704) ### Why I did it Consolidate the `numvoq`, `coreid`, `coreportid` to be lower case which matches other leaf node convention. ### How I did it Rename to lower case. #### How to verify it No need to verify. --- .../Arista-7800R3-48CQ2-C48/port_config.ini | 2 +- .../Arista-7800R3A-36D2-C36/0/port_config.ini | 2 +- .../Arista-7800R3A-36D2-C36/1/port_config.ini | 2 +- .../Arista-7800R3A-36D2-C72/0/port_config.ini | 2 +- .../Arista-7800R3A-36D2-C72/1/port_config.ini | 2 +- .../Arista-7800R3A-36D2-D36/0/port_config.ini | 2 +- .../Arista-7800R3A-36D2-D36/1/port_config.ini | 2 +- .../Nokia-IXR7250E-36x100G/0/port_config.ini | 2 +- .../Nokia-IXR7250E-36x100G/1/port_config.ini | 2 +- .../Nokia-IXR7250E-36x400G/0/port_config.ini | 2 +- .../Nokia-IXR7250E-36x400G/1/port_config.ini | 2 +- .../cli-plugin-tests/config_db.json | 24 +++++++++---------- src/sonic-yang-models/doc/Configuration.md | 18 +++++++------- .../tests/files/sample_config_db.json | 18 +++++++------- .../yang_model_tests/tests_config/port.json | 18 +++++++------- .../yang-models/sonic-port.yang | 12 +++++----- 16 files changed, 56 insertions(+), 56 deletions(-) diff --git a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/port_config.ini b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/port_config.ini index 07a78421dd4b..3f5543738aa6 100644 --- a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/port_config.ini +++ b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreId corePortId numVoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet0 6,7 Ethernet1/1 1 Ext 100000 Eth0 0 1 8 Ethernet4 2,3 Ethernet2/1 2 Ext 100000 Eth4 0 2 8 Ethernet8 4,5 Ethernet3/1 3 Ext 100000 Eth8 0 3 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/port_config.ini index a67c9b3f7d2f..c199d4af0b47 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreId corePortId numVoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet0 72,73,74,75 Ethernet1/1 1 Ext 100000 Eth0 1 1 8 Ethernet8 80,81,82,83 Ethernet2/1 2 Ext 100000 Eth8 1 2 8 Ethernet16 88,89,90,91 Ethernet3/1 3 Ext 100000 Eth16 1 3 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/port_config.ini index e8fd3d7906e8..3cd1cc0d1493 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreId corePortId numVoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet144 72,73,74,75 Ethernet19/1 19 Ext 100000 Eth0 1 1 8 Ethernet152 80,81,82,83 Ethernet20/1 20 Ext 100000 Eth8 1 2 8 Ethernet160 88,89,90,91 Ethernet21/1 21 Ext 100000 Eth16 1 3 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/port_config.ini index f9f02ffb83a0..e38d580c72cd 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreId corePortId numVoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet0 72,73,74,75 Ethernet1/1 1 Ext 100000 Eth0 1 1 8 Ethernet4 76,77,78,79 Ethernet1/5 1 Ext 100000 Eth4 1 2 8 Ethernet8 80,81,82,83 Ethernet2/1 2 Ext 100000 Eth8 1 3 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/port_config.ini index 1366612874cb..ce3155c52751 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreId corePortId numVoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet144 72,73,74,75 Ethernet19/1 19 Ext 100000 Eth144 1 1 8 Ethernet148 76,77,78,79 Ethernet19/5 19 Ext 100000 Eth148 1 2 8 Ethernet152 80,81,82,83 Ethernet20/1 20 Ext 100000 Eth152 1 3 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/port_config.ini index d6b5da8404dd..3ba9272d43a4 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreId corePortId numVoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet0 72,73,74,75,76,77,78,79 Ethernet1/1 1 Ext 400000 Eth0 1 1 8 Ethernet8 80,81,82,83,84,85,86,87 Ethernet2/1 2 Ext 400000 Eth8 1 2 8 Ethernet16 88,89,90,91,92,93,94,95 Ethernet3/1 3 Ext 400000 Eth16 1 3 8 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/port_config.ini b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/port_config.ini index 7416fc3280fd..873c1713a309 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/port_config.ini +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreId corePortId numVoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet144 72,73,74,75,76,77,78,79 Ethernet19/1 19 Ext 400000 Eth0 1 1 8 Ethernet152 80,81,82,83,84,85,86,87 Ethernet20/1 20 Ext 400000 Eth8 1 2 8 Ethernet160 88,89,90,91,92,93,94,95 Ethernet21/1 21 Ext 400000 Eth16 1 3 8 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/port_config.ini index d9df84b6ed9a..8b4e625ec7a5 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/port_config.ini +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreid coreportid numvoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet0 72,73,74,75 Ethernet1/1 1 Ext 100000 Eth0 1 1 8 Ethernet8 80,81,82,83 Ethernet2/1 2 Ext 100000 Eth8 1 2 8 Ethernet16 88,89,90,91 Ethernet3/1 3 Ext 100000 Eth16 1 3 8 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/port_config.ini index 4d769b17db84..630e5109d077 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/port_config.ini +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreid coreportid numvoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet144 72,73,74,75 Ethernet19/1 19 Ext 100000 Eth0 1 1 8 Ethernet152 80,81,82,83 Ethernet20/1 20 Ext 100000 Eth8 1 2 8 Ethernet160 88,89,90,91 Ethernet21/1 21 Ext 100000 Eth16 1 3 8 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini index 478b5cb1ca60..18449e8cbcba 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreid coreportid numvoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet0 72,73,74,75,76,77,78,79 Ethernet1/1 1 Ext 400000 Eth0 1 1 8 Ethernet8 80,81,82,83,84,85,86,87 Ethernet2/1 2 Ext 400000 Eth8 1 2 8 Ethernet16 88,89,90,91,92,93,94,95 Ethernet3/1 3 Ext 400000 Eth16 1 3 8 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini index 92c0731ddcc5..faccc8e39def 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini @@ -1,4 +1,4 @@ -# name lanes alias index role speed asic_port_name coreid coreportid numvoq +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq Ethernet144 72,73,74,75,76,77,78,79 Ethernet19/1 19 Ext 400000 Eth0 1 1 8 Ethernet152 80,81,82,83,84,85,86,87 Ethernet20/1 20 Ext 400000 Eth8 1 2 8 Ethernet160 88,89,90,91,92,93,94,95 Ethernet21/1 21 Ext 400000 Eth16 1 3 8 diff --git a/dockers/docker-macsec/cli-plugin-tests/config_db.json b/dockers/docker-macsec/cli-plugin-tests/config_db.json index 9f4c266d4284..d145fb7c724e 100644 --- a/dockers/docker-macsec/cli-plugin-tests/config_db.json +++ b/dockers/docker-macsec/cli-plugin-tests/config_db.json @@ -11,14 +11,14 @@ "PORT|Ethernet0": { "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", - "coreid": "1", - "coreportid": "1", + "core_id": "1", + "core_port_id": "1", "description": "Ethernet1/1", "index": "1", "lanes": "72,73,74,75,76,77,78,79", "macsec": "macsec_profile", "mtu": "9100", - "numvoq": "8", + "num_voq": "8", "pfc_asym": "off", "role": "Ext", "speed": "400000", @@ -27,14 +27,14 @@ "PORT|Ethernet1": { "alias": "Ethernet2/1", "asic_port_name": "Eth0-ASIC0", - "coreid": "1", - "coreportid": "1", + "core_id": "1", + "core_port_id": "1", "description": "Ethernet2/1", "index": "1", "lanes": "72,73,74,75,76,77,78,79", "macsec": "macsec_profile", "mtu": "9100", - "numvoq": "8", + "num_voq": "8", "pfc_asym": "off", "role": "Ext", "speed": "400000", @@ -43,14 +43,14 @@ "PORT|Ethernet4": { "alias": "Ethernet5/1", "asic_port_name": "Eth0-ASIC0", - "coreid": "1", - "coreportid": "1", + "core_id": "1", + "core_port_id": "1", "description": "Ethernet5/1", "index": "1", "lanes": "72,73,74,75,76,77,78,79", "macsec": "macsec_profile", "mtu": "9100", - "numvoq": "8", + "num_voq": "8", "pfc_asym": "off", "role": "Ext", "speed": "400000", @@ -59,14 +59,14 @@ "PORT|Ethernet5": { "alias": "Ethernet6/1", "asic_port_name": "Eth0-ASIC0", - "coreid": "1", - "coreportid": "1", + "core_id": "1", + "core_port_id": "1", "description": "Ethernet6/1", "index": "1", "lanes": "72,73,74,75,76,77,78,79", "macsec": "macsec_profile", "mtu": "9100", - "numvoq": "8", + "num_voq": "8", "pfc_asym": "off", "role": "Ext", "speed": "400000", diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 9980773a74a6..bb0b2f87c630 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1828,9 +1828,9 @@ optional attributes. "laser_freq": "191300", "tx_power": "-27.3", "dom_polling": "enabled", - "coreId": "1", - "corePortId": "1", - "numVoq": "8" + "core_id": "1", + "core_port_id": "1", + "num_voq": "8" }, "Ethernet1": { "index": "1", @@ -1844,9 +1844,9 @@ optional attributes. "laser_freq": "191300", "tx_power": "-27.3", "dom_polling": "enabled", - "coreId": "0", - "corePortId": "14", - "numVoq": "8" + "core_id": "0", + "core_port_id": "14", + "num_voq": "8" }, "Ethernet63": { "index": "63", @@ -1858,9 +1858,9 @@ optional attributes. "laser_freq": "191300", "tx_power": "-27.3", "dom_polling": "disabled", - "coreId": "0", - "corePortId": "15", - "numVoq": "8" + "core_id": "0", + "core_port_id": "15", + "num_voq": "8" } } } diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 1e9ed06c2129..4cf42f535c60 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -567,9 +567,9 @@ "PORT": { "Ethernet0": { "alias": "Eth1/1", - "coreId": "1", - "corePortId": "1", - "numVoq": "8", + "core_id": "1", + "core_port_id": "1", + "num_voq": "8", "lanes": "65", "description": "", "speed": "11100", @@ -586,9 +586,9 @@ }, "Ethernet1": { "alias": "Eth1/2", - "coreId": "1", - "corePortId": "1", - "numVoq": "8", + "core_id": "1", + "core_port_id": "1", + "num_voq": "8", "lanes": "66", "description": "", "speed": "11100", @@ -604,9 +604,9 @@ }, "Ethernet2": { "alias": "Eth1/3", - "coreId": "1", - "corePortId": "1", - "numVoq": "8", + "core_id": "1", + "core_port_id": "1", + "num_voq": "8", "lanes": "67", "description": "", "speed": "11100", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json index 562aaf56c4a1..37c5606c1c33 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json @@ -285,9 +285,9 @@ { "name": "Ethernet8", "alias": "eth8", - "coreId": "1", - "corePortId": "1", - "numVoq": "8", + "core_id": "1", + "core_port_id": "1", + "num_voq": "8", "lanes": "65", "speed": 25000, "autoneg": "on", @@ -305,9 +305,9 @@ { "name": "Ethernet8", "alias": "eth8", - "coreId": "1", - "corePortId": "1", - "numVoq": "8", + "core_id": "2", + "core_port_id": "2", + "num_voq": "8", "lanes": "65", "speed": 25000, "autoneg": "on", @@ -325,9 +325,9 @@ { "name": "Ethernet8", "alias": "eth8", - "coreId": "1", - "corePortId": "1", - "numVoq": "8", + "core_id": "3", + "core_port_id": "3", + "num_voq": "8", "lanes": "65", "speed": 25000, "autoneg": "on", diff --git a/src/sonic-yang-models/yang-models/sonic-port.yang b/src/sonic-yang-models/yang-models/sonic-port.yang index 2036a1f2fdbe..163e19fc841b 100644 --- a/src/sonic-yang-models/yang-models/sonic-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-port.yang @@ -39,22 +39,22 @@ module sonic-port{ } } - leaf numVoq { - description "The number of virtual output queue supportted on this port."; + leaf core_id { + description "The ASIC core where the port belongs to."; type string { length 1..16; } } - leaf coreId { - description "The ASIC core where the port belongs to."; + leaf core_port_id { + description "The ASIC core port for this port."; type string { length 1..16; } } - leaf corePortId { - description "The ASIC core port for this port."; + leaf num_voq { + description "The number of virtual output queue supportted on this port."; type string { length 1..16; } From 489a1efddfb39e17a7bc6feb10019a000d00a999 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:44:56 -0700 Subject: [PATCH 013/282] Updated LLDP startup configuration for multi-asic (#15440) What I did: Changes in LLDP Configuration to handle this: Enable LLDP only on front panel interfaces. Why I did: This is done to free up CPU cycle as we don't see use for that in multi-asic and also for Chassis we have disable lldp docker on supervisor so there is no lldp peering even if send LLDP BPDU on backplane ports For multi-asic do not generate lldpd.conf with eth0 related configuration Why I did: In namespace lldp docker there is no need to generate eth0 configuration. It gives not needed errror message as seen here https://github.com/sonic-net/sonic-buildimage/issues/15382 How I did it: Instead of relying on DEVICE_METADTA sub_role we are using NAMESPACE_ID environmental variable (passed to all docker instance) which will be > 0 for multiasic docker instance and not define for global/host docker instance. --------- Signed-off-by: Abhishek Dosi --- dockers/docker-lldp/docker-lldp-init.sh | 2 +- dockers/docker-lldp/lldpd.conf.j2 | 2 ++ dockers/docker-lldp/lldpmgrd | 8 +++----- dockers/docker-lldp/start.sh | 1 + dockers/docker-lldp/supervisord.conf.j2 | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dockers/docker-lldp/docker-lldp-init.sh b/dockers/docker-lldp/docker-lldp-init.sh index 135ff48255d6..d9a725316ca8 100755 --- a/dockers/docker-lldp/docker-lldp-init.sh +++ b/dockers/docker-lldp/docker-lldp-init.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash #Generate supervisord.conf based on device metadata mkdir -p /etc/supervisor/conf.d/ -sonic-cfggen -d -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf +sonic-cfggen -d -a "{\"namespace_id\":\"$NAMESPACE_ID\"}" -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf exec /usr/local/bin/supervisord diff --git a/dockers/docker-lldp/lldpd.conf.j2 b/dockers/docker-lldp/lldpd.conf.j2 index 904784ef67b1..59d20f477562 100644 --- a/dockers/docker-lldp/lldpd.conf.j2 +++ b/dockers/docker-lldp/lldpd.conf.j2 @@ -8,12 +8,14 @@ {% endfor %} {% endif %} {% if mgmt_if %} +{% if not (namespace_id is defined and namespace_id|length) %} {# If MGMT port alias is available, use it for port ID subtype, otherwise use port name #} {% if MGMT_PORT and MGMT_PORT[mgmt_if.port_name] and MGMT_PORT[mgmt_if.port_name].alias %} configure ports eth0 lldp portidsubtype local {{ MGMT_PORT[mgmt_if.port_name].alias }} {% else %} configure ports eth0 lldp portidsubtype local {{ mgmt_if.port_name }} {% endif %} +{% endif %} configure system ip management pattern {{ mgmt_if.ipv4 }} {% endif %} configure system hostname {{ DEVICE_METADATA['localhost']['hostname'] }} diff --git a/dockers/docker-lldp/lldpmgrd b/dockers/docker-lldp/lldpmgrd index 2dad02f8794c..2ee9c897c45a 100755 --- a/dockers/docker-lldp/lldpmgrd +++ b/dockers/docker-lldp/lldpmgrd @@ -22,9 +22,8 @@ try: from sonic_py_common import daemon_base from swsscommon import swsscommon - from sonic_py_common.interface import inband_prefix, recirc_prefix + from sonic_py_common.interface import inband_prefix, recirc_prefix, backplane_prefix from sonic_py_common import device_info - except ImportError as err: raise ImportError("%s - required module not found" % str(err)) @@ -138,9 +137,8 @@ class LldpManager(daemon_base.DaemonBase): """ port_desc = None - # Skip recirc and inband interface prefixes. These are recycle ports exposed in PORT_TABLE for - # asic-to-asic communication in VOQ based chassis system. We do not configure LLDP on these. - if port_name.startswith(inband_prefix()) or port_name.startswith(recirc_prefix()): + # Skip special (recirc/inband) and backplane interfaces as we don't enable lldp on those interfaaces. + if any([port_name.startswith(inband_prefix()),port_name.startswith(recirc_prefix()),port_name.startswith(backplane_prefix())]): return # Get the port alias. If None or empty string, use port name instead diff --git a/dockers/docker-lldp/start.sh b/dockers/docker-lldp/start.sh index 51057ae4ec79..5295daed8a9d 100755 --- a/dockers/docker-lldp/start.sh +++ b/dockers/docker-lldp/start.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash CFGGEN_PARAMS=" \ -d \ + -a "{\"namespace_id\":\"$NAMESPACE_ID\"}" \ -t /usr/share/sonic/templates/lldpd.conf.j2 \ -y /etc/sonic/sonic_version.yml \ -t /usr/share/sonic/templates/lldpdSysDescr.conf.j2 \ diff --git a/dockers/docker-lldp/supervisord.conf.j2 b/dockers/docker-lldp/supervisord.conf.j2 index 48f0a6c91f64..b2efe00bb966 100644 --- a/dockers/docker-lldp/supervisord.conf.j2 +++ b/dockers/docker-lldp/supervisord.conf.j2 @@ -45,10 +45,10 @@ dependent_startup_wait_for=rsyslogd:running # - `-dd` means to stay in foreground, log warnings to console # - `-ddd` means to stay in foreground, log warnings and info to console # - `-dddd` means to stay in foreground, log all to console -{% if DEVICE_METADATA['localhost']['sub_role'] is defined and DEVICE_METADATA['localhost']['sub_role']|length %} -command=/usr/sbin/lldpd -d -I Ethernet* -C Ethernet* +{% if namespace_id is defined and namespace_id|length %} +command=/usr/sbin/lldpd -d -I Ethernet[0-9]* -C Ethernet[0-9]* {% else %} -command=/usr/sbin/lldpd -d -I Ethernet*,eth0 -C eth0 +command=/usr/sbin/lldpd -d -I Ethernet[0-9]*,eth0 -C eth0 {% endif %} priority=3 autostart=false From a61254d0f8b5d13f0de8feb82c74e8bc3d0f7aad Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Sat, 27 Apr 2024 06:44:44 +0800 Subject: [PATCH 014/282] [dhcp_server] Add support for customize string option include comma (#18796) * [dhcp_server] Add support for customize comma-sperated string option --- .../dhcp_utilities/dhcpservd/dhcp_cfggen.py | 2 +- .../tests/test_data/test_kea_config.conf | 3 + .../tests/test_dhcp_cfggen.py | 111 ++++++++---------- .../tests/test_dhcpservd.py | 15 ++- 4 files changed, 68 insertions(+), 63 deletions(-) create mode 100644 src/sonic-dhcp-utilities/tests/test_data/test_kea_config.conf diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index cc5bf0dba79a..af7ef82489d0 100755 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -140,7 +140,7 @@ def _parse_customized_options(self, customized_options_ipv4): always_send = config["always_send"] if "always_send" in config else "true" customized_options[option_name] = { "id": config["id"], - "value": config["value"], + "value": config["value"].replace(",", "\\\\,") if option_type == "string" else config["value"], "type": option_type, "always_send": always_send } diff --git a/src/sonic-dhcp-utilities/tests/test_data/test_kea_config.conf b/src/sonic-dhcp-utilities/tests/test_data/test_kea_config.conf new file mode 100644 index 000000000000..adacd460290d --- /dev/null +++ b/src/sonic-dhcp-utilities/tests/test_data/test_kea_config.conf @@ -0,0 +1,3 @@ +{ + "key": "dummy_value\\,dummy_value" +} diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py index 2b60a66dcd8f..4817c6cba815 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py @@ -211,61 +211,53 @@ }, "hook_lib_path": "/usr/local/lib/kea/hooks/libdhcp_run_script.so" } -tested_options_data = [ - { - "data": { - "option223": { - "id": "223", - "type": "string", - "value": "dummy_value" - } +tested_options_data = { + "data": { + "option223": { + "id": "223", + "type": "string", + "value": "dummy_value" }, - "res": True - }, - { - "data": { - "option60": { - "id": "60", - "type": "string", - "value": "dummy_value" - } + "option60": { + "id": "60", + "type": "string", + "value": "dummy_value" }, - "res": False - }, - { - "data": { - "option222": { - "id": "222", - "type": "text", - "value": "dummy_value" - } + "option222": { + "id": "222", + "type": "text", + "value": "dummy_value" }, - "res": False - }, - { - "data": { - "option219": { - "id": "219", - "type": "uint8", - "value": "259" - } + "option219": { + "id": "219", + "type": "uint8", + "value": "259" }, - "res": False - }, - { - "data": { - "option223": { - "id": "223", - "type": "string", - "value": "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + - "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + - "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + - "long_valuelong_valuelong_valuelong_valuelong_value" - } + "option218": { + "id": "218", + "type": "string", + "value": "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + + "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + + "long_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_valuelong_value" + + "long_valuelong_valuelong_valuelong_valuelong_value" + }, + "option217": { + "id": "217", + "type": "string", + "value": "dummy_value,dummy_value" }, - "res": False + "option216": { + "id": "216", + "type": "uint8", + "value": "8" + } + }, + "res": { + "option223": "dummy_value", + "option217": "dummy_value\\\\,dummy_value", + "option216": "8" } -] +} def test_parse_port_alias(mock_swsscommon_dbconnector_init, mock_get_render_template): @@ -402,24 +394,21 @@ def test_render_config(mock_swsscommon_dbconnector_init, mock_parse_port_map_ali assert json.loads(config) == expected_config if with_port_config else expected_config -@pytest.mark.parametrize("tested_options_data", tested_options_data) def test_parse_customized_options(mock_swsscommon_dbconnector_init, mock_get_render_template, - mock_parse_port_map_alias, tested_options_data): + mock_parse_port_map_alias): dhcp_db_connector = DhcpDbConnector() dhcp_cfg_generator = DhcpServCfgGenerator(dhcp_db_connector, "/usr/local/lib/kea/hooks/libdhcp_run_script.so") customized_options_ipv4 = tested_options_data["data"] customized_options = dhcp_cfg_generator._parse_customized_options(customized_options_ipv4) - if tested_options_data["res"]: - assert customized_options == { - "option223": { - "id": "223", - "value": "dummy_value", - "type": "string", - "always_send": "true" - } + expected_res = {} + for key, value in tested_options_data["res"].items(): + expected_res[key] = { + "id": customized_options_ipv4[key]["id"], + "value": value, + "type": customized_options_ipv4[key]["type"], + "always_send": "true" } - else: - assert customized_options == {} + assert customized_options == expected_res def test_parse_dpus(mock_swsscommon_dbconnector_init, mock_get_render_template, mock_parse_port_map_alias): diff --git a/src/sonic-dhcp-utilities/tests/test_dhcpservd.py b/src/sonic-dhcp-utilities/tests/test_dhcpservd.py index 17239a73439d..f11ffdbba0b5 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcpservd.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcpservd.py @@ -1,4 +1,5 @@ import pytest +import json import psutil import signal import sys @@ -18,11 +19,18 @@ "VlanMemberTableEventChecker"] +tested_config = """ +{ + "key": "dummy_value\\\\,dummy_value" +} +""" + + @pytest.mark.parametrize("enabled_checker", [None, set(PORT_MODE_CHECKER)]) def test_dump_dhcp4_config(mock_swsscommon_dbconnector_init, enabled_checker): new_enabled_checker = set(["VlanTableEventChecker"]) with patch("dhcp_utilities.dhcpservd.dhcp_cfggen.DhcpServCfgGenerator.generate", - return_value=("dummy_config", set(), set(), set(), new_enabled_checker)) as mock_generate, \ + return_value=(tested_config, set(), set(), set(), new_enabled_checker)) as mock_generate, \ patch("dhcp_utilities.dhcpservd.dhcpservd.DhcpServd._notify_kea_dhcp4_proc", MagicMock()) as mock_notify_kea_dhcp4_proc, \ patch.object(DhcpServd, "dhcp_servd_monitor", return_value=DhcpServdDbMonitor, @@ -39,6 +47,11 @@ def test_dump_dhcp4_config(mock_swsscommon_dbconnector_init, enabled_checker): dhcpservd.dump_dhcp4_config() # Verfiy whether generate() func of dhcp_cfggen is called mock_generate.assert_called_once_with() + with open("tests/test_data/test_kea_config.conf", "r") as file, \ + open("/tmp/kea-dhcp4.conf", "r") as output: + expected_content = file.read() + actual_content = output.read() + assert json.loads(expected_content) == json.loads(actual_content) # Verify whether notify func of dhcpservd is called, which is expected to call after new config generated mock_notify_kea_dhcp4_proc.assert_called_once_with() if enabled_checker is None: From 039f39e5c596cd125ab26c86bd1c177f94c76455 Mon Sep 17 00:00:00 2001 From: Wenda Chu <32250288+w1nda@users.noreply.github.com> Date: Sat, 27 Apr 2024 06:46:12 +0800 Subject: [PATCH 015/282] [dhcp_server] Append subnet_id to server config and read the id from lease file for STATE_DB updating (#18739) --- dockers/docker-dhcp-server/kea-dhcp4.conf.j2 | 1 + .../dhcp_utilities/dhcpservd/dhcp_cfggen.py | 1 + .../dhcp_utilities/dhcpservd/dhcp_lease.py | 23 +---------- .../tests/test_data/kea-lease.csv | 18 ++++----- .../tests/test_dhcp_cfggen.py | 2 +- .../tests/test_dhcp_lease.py | 38 +++++-------------- 6 files changed, 24 insertions(+), 59 deletions(-) diff --git a/dockers/docker-dhcp-server/kea-dhcp4.conf.j2 b/dockers/docker-dhcp-server/kea-dhcp4.conf.j2 index 082cbca14dd5..f5f7a9b054f0 100644 --- a/dockers/docker-dhcp-server/kea-dhcp4.conf.j2 +++ b/dockers/docker-dhcp-server/kea-dhcp4.conf.j2 @@ -42,6 +42,7 @@ {%- if add_subnet_preceding_comma.flag -%},{%- endif -%} {%- set _dummy = add_subnet_preceding_comma.update({'flag': True}) %} { + "id": {{ subnet_info["id"] }}, "subnet": "{{ subnet_info["subnet"] }}", "pools": [ {%- set add_pool_preceding_comma = { 'flag': False } %} diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index af7ef82489d0..5bc9e6cb95e2 100755 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -223,6 +223,7 @@ def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, cust client_class) }) subnet_obj = { + "id": dhcp_interface_name.replace("Vlan", ""), "subnet": str(ipaddress.ip_network(dhcp_interface_ip, strict=False)), "pools": pools, "gateway": dhcp_config["gateway"], diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py index 10ff46da85c8..6dda767287ca 100644 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py @@ -106,7 +106,6 @@ def _read(self): syslog.syslog(syslog.LOG_ERR, "Cannot find lease file: {}".format(self.lease_file)) raise err - fdb_info = self._get_fdb_info() new_lease = {} # Get newest lease information of each client while dq: @@ -119,11 +118,9 @@ def _read(self): mac_address = splits[1] valid_lifetime = splits[3] lease_end = splits[4] + subnet_id = splits[5] - if mac_address not in fdb_info: - syslog.syslog(syslog.LOG_WARNING, "Cannot not find {} in fdb table".format(mac_address)) - continue - new_key = "{}|{}".format(fdb_info[mac_address], mac_address) + new_key = "{}|{}".format("Vlan" + subnet_id, mac_address) if new_key in new_lease: continue new_lease[new_key] = { @@ -133,21 +130,5 @@ def _read(self): } return new_lease - def _get_fdb_info(self): - """ - Get fdb information, indicate that mac address comes from which dhcp interface. - Returns: - Dict of fdb information, sample: - { - "aa:bb:cc:dd:ee:ff": "Vlan1000" - } - """ - fdb_table = self.db_connector.get_state_db_table("FDB_TABLE") - ret = {} - for key in fdb_table.keys(): - splits = key.split(":", 1) - ret[splits[1]] = splits[0] - return ret - def _update_lease(self, signum, frame): self.update_lease() diff --git a/src/sonic-dhcp-utilities/tests/test_data/kea-lease.csv b/src/sonic-dhcp-utilities/tests/test_data/kea-lease.csv index 645b07b2276e..c8ebe4390b37 100644 --- a/src/sonic-dhcp-utilities/tests/test_data/kea-lease.csv +++ b/src/sonic-dhcp-utilities/tests/test_data/kea-lease.csv @@ -1,10 +1,10 @@ address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context,pool_id -192.168.0.2,10:70:fd:b6:13:00,,3600,1694000905,1,0,0,7626dced293e,0,,0 -192.168.0.131,10:70:fd:b6:13:17,,3600,1694000909,1,0,0,7626dced293e,0,,1 -192.168.0.131,10:70:fd:b6:13:17,,0,1693997309,1,0,0,7626dced293e,0,,1 -192.168.0.131,10:70:fd:b6:13:17,,0,1693997309,1,0,0,,2,,1 -192.168.0.131,10:70:fd:b6:13:17,,3600,1694000915,1,0,0,7626dced293e,0,,1 -192.168.0.2,10:70:fd:b6:13:00,,0,1693997305,1,0,0,7626dced293e,0,,0 -193.168.2.2,10:70:fd:b6:13:15,,3600,1693999305,1,0,0,7626dced293e,0,,0 -193.168.2.3,10:70:fd:b6:13:20,,3600,1693999305,1,0,0,7626dced293e,0,,0 -193.168.0.132,10:70:fd:b6:13:18,,3600,1697610805,1,0,0,7626dced293e,0,,0 \ No newline at end of file +192.168.0.2,10:70:fd:b6:13:00,,3600,1694000905,1000,0,0,7626dced293e,0,,0 +192.168.0.131,10:70:fd:b6:13:17,,3600,1694000909,1000,0,0,7626dced293e,0,,1 +192.168.0.131,10:70:fd:b6:13:17,,0,1693997309,1000,0,0,7626dced293e,0,,1 +192.168.0.131,10:70:fd:b6:13:17,,0,1693997309,1000,0,0,,2,,1 +192.168.0.131,10:70:fd:b6:13:17,,3600,1694000915,1000,0,0,7626dced293e,0,,1 +192.168.0.2,10:70:fd:b6:13:00,,0,1693997305,1000,0,0,7626dced293e,0,,0 +193.168.2.2,10:70:fd:b6:13:15,,3600,1693999305,2000,0,0,7626dced293e,0,,0 +193.168.2.3,10:70:fd:b6:13:20,,3600,1693999305,2000,0,0,7626dced293e,0,,0 +193.168.0.132,10:70:fd:b6:13:18,,3600,1697610805,1000,0,0,7626dced293e,0,,0 \ No newline at end of file diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py index 4817c6cba815..0d5edf03cb1f 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py @@ -182,7 +182,7 @@ expected_render_obj = { "subnets": [ { - "subnet": "192.168.0.0/21", + "subnet": "192.168.0.0/21", 'id': '1000', "pools": [{"range": "192.168.0.2 - 192.168.0.6", "client_class": "sonic-host:etp8"}, {"range": "192.168.0.10 - 192.168.0.10", "client_class": "sonic-host:etp8"}, {"range": "192.168.0.7 - 192.168.0.7", "client_class": "sonic-host:etp7"}], diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py b/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py index 892c5f9bcc95..a831b2ad5a11 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py @@ -24,14 +24,13 @@ "lease_start": "1693995705", "lease_end": "1693999305", "ip": "193.168.2.2" + }, + "Vlan2000|10:70:fd:b6:13:20": { + "lease_start": "1693995705", + "lease_end": "1693999305", + "ip": "193.168.2.3" } } -expected_fdb_info = { - "10:70:fd:b6:13:00": "Vlan1000", - "10:70:fd:b6:13:15": "Vlan2000", - "10:70:fd:b6:13:17": "Vlan1000", - "10:70:fd:b6:13:18": "Vlan1000" -} def test_read_kea_lease_with_file_not_found(mock_swsscommon_dbconnector_init): @@ -44,28 +43,11 @@ def test_read_kea_lease_with_file_not_found(mock_swsscommon_dbconnector_init): def test_read_kea_lease(mock_swsscommon_dbconnector_init): - tested_fdb_info = expected_fdb_info - with patch.object(KeaDhcp4LeaseHandler, "_get_fdb_info", return_value=tested_fdb_info): - db_connector = DhcpDbConnector() - kea_lease_handler = KeaDhcp4LeaseHandler(db_connector, lease_file="tests/test_data/kea-lease.csv") - # Verify whether lease information read is as expected - lease = kea_lease_handler._read() - assert lease == expected_lease - - -def test_get_fdb_info(mock_swsscommon_dbconnector_init): - mock_fdb_table = { - "Vlan2000:10:70:fd:b6:13:15": {"port": "Ethernet31", "type": "dynamic"}, - "Vlan1000:10:70:fd:b6:13:00": {"port": "Ethernet32", "type": "dynamic"}, - "Vlan1000:10:70:fd:b6:13:17": {"port": "Ethernet33", "type": "dynamic"}, - "Vlan1000:10:70:fd:b6:13:18": {"port": "Ethernet34", "type": "dynamic"} - } - with patch("dhcp_utilities.common.utils.DhcpDbConnector.get_state_db_table", return_value=mock_fdb_table): - db_connector = DhcpDbConnector() - kea_lease_handler = KeaDhcp4LeaseHandler(db_connector, lease_file="tests/test_data/kea-lease.csv") - # Verify whether lease information read is as expected - fdb_info = kea_lease_handler._get_fdb_info() - assert fdb_info == expected_fdb_info + db_connector = DhcpDbConnector() + kea_lease_handler = KeaDhcp4LeaseHandler(db_connector, lease_file="tests/test_data/kea-lease.csv") + # Verify whether lease information read is as expected + lease = kea_lease_handler._read() + assert lease == expected_lease # Cannot mock built-in/extension type function(datetime.datetime.timestamp), need to free time From 0ff9b2fa72aa10f3802bd79302c558b42bd6deee Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 27 Apr 2024 16:01:09 +0800 Subject: [PATCH 016/282] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#18735) #### Why I did it src/sonic-utilities ``` * 9b463ca5 - (HEAD -> master, origin/master, origin/HEAD) [chassis][voq] Add fabric capacity monitoring cmds (#3255) (8 hours ago) [jfeng-arista] * df94636b - Display target firmware version through CLI (#3274) (34 hours ago) [mihirpat1] * cd5c0580 - Fix db_migrate.py show error and back trace while loading configuration on Linecard (#3257) (2 days ago) [Hua Liu] * d48a8308 - Add Multi ASIC support for apply-patch (#3249) (3 days ago) [Xincun Li] * b143ea6d - [chassis][voq]Add fabric monitoring commands. (#3239) (4 days ago) [jfeng-arista] * 07d6d277 - [fast/warm-reboot] Retain TRANSCEIVER_INFO tables on fast/warm-reboot (#3240) (7 days ago) [Stepan Blyshchak] * 8e5ff74f - Revert "Revert "route_check: Skip route checks if bgp feature is not enabled"" (#3270) (7 days ago) [anamehra] * eb165f36 - Fix double hex to decimal conversion (#3267) (7 days ago) [Yuanzhe] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index ad464a9f0e70..9b463ca54b4d 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit ad464a9f0e7003fe12adafad28b61c0df0bf29fc +Subproject commit 9b463ca54b4d65cb77aa733224e2bed2ec4cd22a From c2a9a0a35ca1ba8768389bc2c788e9f3ec58f335 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Sun, 28 Apr 2024 18:15:29 +0800 Subject: [PATCH 017/282] [build] archive.debian.org in buster slave container. (#18812) Why I did it ftp.debian.org don't have buster-backports now. It is migrated to archive.debian.org. Fix buster-slave container to support submodule pipelines. Work item tracking Microsoft ADO (number only): 27822848 How I did it How to verify it --- sonic-slave-buster/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 2d582f659fb0..5b2146eedbe6 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -37,7 +37,7 @@ ARG gcc_arch=aarch64-linux-gnu ARG PYTHON_CROSS_PLATFORM=linux_aarch64 {%- endif %} -RUN echo "deb http://ftp.debian.org/debian buster-backports main" >> /etc/apt/sources.list +RUN echo "deb http://archive.debian.org/debian/ buster-backports main" >> /etc/apt/sources.list RUN dpkg --add-architecture $arch RUN apt-get update && apt-get install -y eatmydata From f1bc937db0e8d06a70268d831743c1c9bbc45bca Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Sun, 28 Apr 2024 18:19:45 -0700 Subject: [PATCH 018/282] [FRR]Upgrade FRR to 8.5.4 (#18669) Why I did it Upgrading FRR 8.5.4 to include latest fixes. Work item tracking Microsoft ADO (number only): How I did it New patches that were added: Patch FRR Pull request Issue fixed 0024-lib-use-snmp-s-large-fd-sets-for-agentx.patch FRRouting/frr#13396 FRRouting/frr#14143 0025-bgp-community-memory-leak-fix.patch FRRouting/frr#15466 FRRouting/frr#15459 0026-bgp-fib-suppress-announce-fix.patch FRRouting/frr#15634 FRRouting/frr#15626 0027-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch FRRouting/frr#15418 FRRouting/frr#14419 Removed patches: Patch Upstream FRR commit that is present in 8.5.4 0019-zebra-Abstract-dplane_ctx_route_init-to-init-route-w.patch FRRouting/frr@3f01977 0020-zebra-Fix-crash-when-dplane_fpm_nl-fails-to-process-.patch FRRouting/frr@fe5f624 0022-bgpd-Don-t-read-the-first-byte-of-ORF-header-if-we-a.patch FRRouting/frr@3515178 0023-bgpd-Make-sure-we-have-enough-data-to-read-two-bytes.patch FRRouting/frr@460ee93 0024-bgpd-Do-not-process-NLRIs-if-the-attribute-length-is.patch FRRouting/frr@f291f1e 0025-bgpd-Use-treat-as-withdraw-for-tunnel-encapsulation-.patch FRRouting/frr@8a4a88c 0026-zebra-Add-encap-type-when-building-packet-for-FPM.patch FRRouting/frr@f0f7b28 0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch FRRouting/frr@21418d6 0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch FRRouting/frr@30b5c2a 0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch FRRouting/frr@01f232c 0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch FRRouting/frr@a0c4ec2 0032-zebra-Fix-fpm-multipath-encap-addition.patch FRRouting/frr@10a9a5f Realigned patches: Old Patch New patch 0005-Add-support-of-bgp-l3vni-evpn.patch 0005-Add-support-of-bgp-l3vni-evpn.patch 0021-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch 0019-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch 0027-zebra-Fix-non-notification-of-better-admin-won.patch 0020-zebra-Fix-non-notification-of-better-admin-won.patch Disable-ipv6-src-address-test-in-pceplib.patch 0021-Disable-ipv6-src-address-test-in-pceplib.patch cross-compile-changes.patch 0022-cross-compile-changes.patch 0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch 0023-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch How to verify it Running sonic-mgmt test suite. --- rules/frr.mk | 4 +- src/sonic-frr/frr | 2 +- .../0005-Add-support-of-bgp-l3vni-evpn.patch | 49 +-- ...plane_ctx_route_init-to-init-route-w.patch | 74 ---- ...cated-nexthops-when-sending-fpm-msg.patch} | 0 ...when-dplane_fpm_nl-fails-to-process-.patch | 50 --- ...on-notification-of-better-admin-won.patch} | 42 +- ...le-ipv6-src-address-test-in-pceplib.patch} | 0 ...the-first-byte-of-ORF-header-if-we-a.patch | 27 -- ...patch => 0022-cross-compile-changes.patch} | 0 ...e-have-enough-data-to-read-two-bytes.patch | 51 --- ...ane_fpm_nl-return-path-leaks-memory.patch} | 9 +- ...ess-NLRIs-if-the-attribute-length-is.patch | 97 ----- ...-use-snmp-s-large-fd-sets-for-agentx.patch | 143 +++++++ .../0025-bgp-community-memory-leak-fix.patch | 395 ++++++++++++++++++ ...s-withdraw-for-tunnel-encapsulation-.patch | 129 ------ .../0026-bgp-fib-suppress-announce-fix.patch | 122 ++++++ ...ap-type-when-building-packet-for-FPM.patch | 50 --- ...rt-EVPN-prefixes-into-IPv4-IPv6-if-n.patch | 77 ++++ ...tory-attributes-more-carefully-for-U.patch | 112 ----- ...EACH_NLRI-malformed-packets-with-ses.patch | 118 ------ ...s-withdrawn-to-avoid-unwanted-handli.patch | 106 ----- ...ling-NLRIs-if-we-received-MP_UNREACH.patch | 88 ---- ...bra-Fix-fpm-multipath-encap-addition.patch | 58 --- src/sonic-frr/patch/series | 26 +- 25 files changed, 803 insertions(+), 1026 deletions(-) delete mode 100644 src/sonic-frr/patch/0019-zebra-Abstract-dplane_ctx_route_init-to-init-route-w.patch rename src/sonic-frr/patch/{0021-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch => 0019-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch} (100%) delete mode 100644 src/sonic-frr/patch/0020-zebra-Fix-crash-when-dplane_fpm_nl-fails-to-process-.patch rename src/sonic-frr/patch/{0027-zebra-Fix-non-notification-of-better-admin-won.patch => 0020-zebra-Fix-non-notification-of-better-admin-won.patch} (60%) rename src/sonic-frr/patch/{Disable-ipv6-src-address-test-in-pceplib.patch => 0021-Disable-ipv6-src-address-test-in-pceplib.patch} (100%) delete mode 100644 src/sonic-frr/patch/0022-bgpd-Don-t-read-the-first-byte-of-ORF-header-if-we-a.patch rename src/sonic-frr/patch/{cross-compile-changes.patch => 0022-cross-compile-changes.patch} (100%) delete mode 100644 src/sonic-frr/patch/0023-bgpd-Make-sure-we-have-enough-data-to-read-two-bytes.patch rename src/sonic-frr/patch/{0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch => 0023-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch} (86%) delete mode 100644 src/sonic-frr/patch/0024-bgpd-Do-not-process-NLRIs-if-the-attribute-length-is.patch create mode 100644 src/sonic-frr/patch/0024-lib-use-snmp-s-large-fd-sets-for-agentx.patch create mode 100644 src/sonic-frr/patch/0025-bgp-community-memory-leak-fix.patch delete mode 100644 src/sonic-frr/patch/0025-bgpd-Use-treat-as-withdraw-for-tunnel-encapsulation-.patch create mode 100644 src/sonic-frr/patch/0026-bgp-fib-suppress-announce-fix.patch delete mode 100644 src/sonic-frr/patch/0026-zebra-Add-encap-type-when-building-packet-for-FPM.patch create mode 100644 src/sonic-frr/patch/0027-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch delete mode 100644 src/sonic-frr/patch/0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch delete mode 100644 src/sonic-frr/patch/0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch delete mode 100644 src/sonic-frr/patch/0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch delete mode 100644 src/sonic-frr/patch/0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch delete mode 100644 src/sonic-frr/patch/0032-zebra-Fix-fpm-multipath-encap-addition.patch diff --git a/rules/frr.mk b/rules/frr.mk index b062016fbc09..da42179a0312 100644 --- a/rules/frr.mk +++ b/rules/frr.mk @@ -1,9 +1,9 @@ # FRRouting (frr) package -FRR_VERSION = 8.5.1 +FRR_VERSION = 8.5.4 FRR_SUBVERSION = 0 FRR_BRANCH = frr/8.5 -FRR_TAG = frr-8.5.1 +FRR_TAG = frr-8.5.4 export FRR_VERSION FRR_SUBVERSION FRR_BRANCH FRR_TAG diff --git a/src/sonic-frr/frr b/src/sonic-frr/frr index 7a2b85ae52b3..de0e358b877a 160000 --- a/src/sonic-frr/frr +++ b/src/sonic-frr/frr @@ -1 +1 @@ -Subproject commit 7a2b85ae52b354248fa9da04100efba0ec6c70c9 +Subproject commit de0e358b877ac9b595e7fb387a302c960a4c02d1 diff --git a/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch b/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch index fe2636c2e289..c2c04f0ff3dc 100644 --- a/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch +++ b/src/sonic-frr/patch/0005-Add-support-of-bgp-l3vni-evpn.patch @@ -1,8 +1,9 @@ -From f5f0018266c98ad96cdbe69ae60d501de21e5600 Mon Sep 17 00:00:00 2001 +From a0846dcf6f496bcfb51dd11c03d1a6c666d4020a Mon Sep 17 00:00:00 2001 From: Stepan Blyschak Date: Thu, 20 Oct 2022 13:19:31 +0000 -Subject: [PATCH] From 369bbb4d62aa47d5a6d5157ca6ea819c4cb80f15 Mon Sep 17 - 00:00:00 2001 Subject: [PATCH 07/13] Added support of L3VNI EVPN +Subject: [PATCH] From f5f0018266c98ad96cdbe69ae60d501de21e5600 Mon Sep 17 + 00:00:00 2001 Subject: [PATCH] From 369bbb4d62aa47d5a6d5157ca6ea819c4cb80f15 + Mon Sep 17 00:00:00 2001 Subject: [PATCH 07/13] Added support of L3VNI EVPN This is temp patch till Prefix to ARP indirection is add in neighorch @@ -10,19 +11,19 @@ Signed-off-by: Kishore Kunal Signed-off-by: Stepan Blyschak diff --git a/lib/nexthop.c b/lib/nexthop.c -index 7ebc4fefb..2f7bb0e7b 100644 +index c03d37487a..52679388fd 100644 --- a/lib/nexthop.c +++ b/lib/nexthop.c -@@ -813,6 +813,7 @@ void nexthop_copy_no_recurse(struct nexthop *copy, - memcpy(©->src, &nexthop->src, sizeof(nexthop->src)); +@@ -814,6 +814,7 @@ void nexthop_copy_no_recurse(struct nexthop *copy, memcpy(©->rmap_src, &nexthop->rmap_src, sizeof(nexthop->rmap_src)); + memcpy(©->rmac, &nexthop->rmac, sizeof(nexthop->rmac)); copy->rparent = rparent; + memcpy(©->nh_encap.encap_data.rmac, &nexthop->nh_encap.encap_data.rmac, ETH_ALEN); if (nexthop->nh_label) nexthop_add_labels(copy, nexthop->nh_label_type, nexthop->nh_label->num_labels, diff --git a/lib/nexthop.h b/lib/nexthop.h -index f1309aa52..7b4bbbafd 100644 +index f35cc5e4e2..f6fb6ec2b7 100644 --- a/lib/nexthop.h +++ b/lib/nexthop.h @@ -66,6 +66,11 @@ enum nh_encap_type { @@ -45,9 +46,9 @@ index f1309aa52..7b4bbbafd 100644 + struct vxlan_nh_encap encap_data; } nh_encap; - /* SR-TE color used for matching SR-TE policies */ + /* EVPN router's MAC. diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index 79d79d74b..325199eff 100644 +index 79d79d74be..325199eff9 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1969,6 +1969,7 @@ static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, @@ -82,32 +83,32 @@ index 79d79d74b..325199eff 100644 break; } diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c -index c0945eae2..157c33ced 100644 +index 68bb9783f8..c478f83795 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c -@@ -1605,6 +1605,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, - vtep_ip.ipa_type = IPADDR_V4; - memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4), - sizeof(struct in_addr)); +@@ -1606,6 +1606,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, + * the nexthop and associated MAC need to be installed. + */ + if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN)) { + memcpy(&(nexthop->nh_encap.encap_data.rmac), + &api_nh->rmac, ETH_ALEN); - zebra_rib_queue_evpn_route_add( - api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); -@@ -1639,6 +1641,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, - vtep_ip.ipa_type = IPADDR_V6; - memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6), - sizeof(struct in6_addr)); + nexthop->rmac = api_nh->rmac; + } +@@ -1635,6 +1637,8 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, + * the nexthop and associated MAC need to be installed. + */ + if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN)) { + memcpy(&(nexthop->nh_encap.encap_data.rmac), + &api_nh->rmac, ETH_ALEN); - zebra_rib_queue_evpn_route_add( - api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); + nexthop->rmac = api_nh->rmac; + } diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c -index f6f436f39..c8511bd28 100644 +index 639f3cd918..6f8d37e701 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c -@@ -2917,7 +2917,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, +@@ -2934,7 +2934,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, zl3vni = zl3vni_from_vrf(nexthop->vrf_id); if (zl3vni && is_l3vni_oper_up(zl3vni)) { nexthop->nh_encap_type = NET_VXLAN; diff --git a/src/sonic-frr/patch/0019-zebra-Abstract-dplane_ctx_route_init-to-init-route-w.patch b/src/sonic-frr/patch/0019-zebra-Abstract-dplane_ctx_route_init-to-init-route-w.patch deleted file mode 100644 index 583609209e71..000000000000 --- a/src/sonic-frr/patch/0019-zebra-Abstract-dplane_ctx_route_init-to-init-route-w.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 6fe32f784f57b4f10b96c9cdb938bf5ebf097fa2 Mon Sep 17 00:00:00 2001 -From: Carmine Scarpitta -Date: Fri, 7 Jul 2023 02:55:18 +0200 -Subject: [PATCH 1/2] zebra: Abstract `dplane_ctx_route_init` to init route - without copying - -The function `dplane_ctx_route_init` initializes a dplane route context -from the route object passed as an argument. Let's abstract this -function to allow initializing the dplane route context without actually -copying a route object. - -This allows us to use this function for initializing a dplane route -context when we don't have any route to copy in it. - -Signed-off-by: Carmine Scarpitta - -diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c -index 83a38c2199..ae87e4f8b6 100644 ---- a/zebra/zebra_dplane.c -+++ b/zebra/zebra_dplane.c -@@ -3257,7 +3257,7 @@ int dplane_ctx_route_init_basic(struct zebra_dplane_ctx *ctx, - { - int ret = EINVAL; - -- if (!ctx || !re) -+ if (!ctx) - return ret; - - dplane_intf_extra_list_init(&ctx->u.rinfo.intf_extra_list); -@@ -3265,6 +3265,13 @@ int dplane_ctx_route_init_basic(struct zebra_dplane_ctx *ctx, - ctx->zd_op = op; - ctx->zd_status = ZEBRA_DPLANE_REQUEST_SUCCESS; - -+ /* This function may be called to create/init a dplane context, not -+ * necessarily to copy a route object. Let's return if there is no route -+ * object to copy. -+ */ -+ if (!re) -+ return AOK; -+ - ctx->u.rinfo.zd_type = re->type; - ctx->u.rinfo.zd_old_type = re->type; - -@@ -3296,6 +3303,8 @@ int dplane_ctx_route_init_basic(struct zebra_dplane_ctx *ctx, - - /* - * Initialize a context block for a route update from zebra data structs. -+ * If the `rn` or `re` parameters are NULL, this function only initializes the -+ * dplane context without copying a route object into it. - */ - int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, - struct route_node *rn, struct route_entry *re) -@@ -3312,9 +3321,17 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, - const struct interface *ifp; - struct dplane_intf_extra *if_extra; - -- if (!ctx || !rn || !re) -+ if (!ctx) - return ret; - -+ /* -+ * Initialize the dplane context and return, if there is no route -+ * object to copy -+ */ -+ if (!re || !rn) -+ return dplane_ctx_route_init_basic(ctx, op, NULL, NULL, NULL, -+ AFI_UNSPEC, SAFI_UNSPEC); -+ - /* - * Let's grab the data from the route_node - * so that we can call a helper function --- -2.17.1 - diff --git a/src/sonic-frr/patch/0021-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch b/src/sonic-frr/patch/0019-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch similarity index 100% rename from src/sonic-frr/patch/0021-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch rename to src/sonic-frr/patch/0019-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch diff --git a/src/sonic-frr/patch/0020-zebra-Fix-crash-when-dplane_fpm_nl-fails-to-process-.patch b/src/sonic-frr/patch/0020-zebra-Fix-crash-when-dplane_fpm_nl-fails-to-process-.patch deleted file mode 100644 index f1bbf13061f2..000000000000 --- a/src/sonic-frr/patch/0020-zebra-Fix-crash-when-dplane_fpm_nl-fails-to-process-.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 6d7a251e5075a6fbced11e43fcdaa9e324c3871f Mon Sep 17 00:00:00 2001 -From: Carmine Scarpitta -Date: Fri, 7 Jul 2023 02:57:07 +0200 -Subject: [PATCH 2/2] zebra: Fix crash when `dplane_fpm_nl` fails to process - received routes - -When `dplane_fpm_nl` receives a route, it allocates memory for a dplane -context and calls `netlink_route_change_read_unicast_internal` without -initializing the `intf_extra_list` contained in the dplane context. If -`netlink_route_change_read_unicast_internal` is not able to process the -route, we call `dplane_ctx_fini` to free the dplane context. This causes -a crash because `dplane_ctx_fini` attempts to access the intf_extra_list -which is not initialized. - -To solve this issue, we can call `dplane_ctx_route_init`to initialize -the dplane route context properly, just after the dplane context -allocation. - -(gdb) bt -#0 0x0000555dd5ceae80 in dplane_intf_extra_list_pop (h=0x7fae1c007e68) at ../zebra/zebra_dplane.c:427 -#1 dplane_ctx_free_internal (ctx=0x7fae1c0074b0) at ../zebra/zebra_dplane.c:724 -#2 0x0000555dd5cebc99 in dplane_ctx_free (pctx=0x7fae2aa88c98) at ../zebra/zebra_dplane.c:869 -#3 dplane_ctx_free (pctx=0x7fae2aa88c98, pctx@entry=0x7fae2aa78c28) at ../zebra/zebra_dplane.c:855 -#4 dplane_ctx_fini (pctx=pctx@entry=0x7fae2aa88c98) at ../zebra/zebra_dplane.c:890 -#5 0x00007fae31e93f29 in fpm_read (t=) at ../zebra/dplane_fpm_nl.c:605 -#6 0x00007fae325191dd in thread_call (thread=thread@entry=0x7fae2aa98da0) at ../lib/thread.c:2006 -#7 0x00007fae324c42b8 in fpt_run (arg=0x555dd74777c0) at ../lib/frr_pthread.c:309 -#8 0x00007fae32405ea7 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 -#9 0x00007fae32325a2f in clone () from /lib/x86_64-linux-gnu/libc.so.6 - -Fixes: #13754 -Signed-off-by: Carmine Scarpitta - -diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c -index 9f38401618..caa2f988e2 100644 ---- a/zebra/dplane_fpm_nl.c -+++ b/zebra/dplane_fpm_nl.c -@@ -599,7 +599,8 @@ static void fpm_read(struct thread *t) - switch (hdr->nlmsg_type) { - case RTM_NEWROUTE: - ctx = dplane_ctx_alloc(); -- dplane_ctx_set_op(ctx, DPLANE_OP_ROUTE_NOTIFY); -+ dplane_ctx_route_init(ctx, DPLANE_OP_ROUTE_NOTIFY, NULL, -+ NULL); - if (netlink_route_change_read_unicast_internal( - hdr, 0, false, ctx) != 1) { - dplane_ctx_fini(&ctx); --- -2.17.1 - diff --git a/src/sonic-frr/patch/0027-zebra-Fix-non-notification-of-better-admin-won.patch b/src/sonic-frr/patch/0020-zebra-Fix-non-notification-of-better-admin-won.patch similarity index 60% rename from src/sonic-frr/patch/0027-zebra-Fix-non-notification-of-better-admin-won.patch rename to src/sonic-frr/patch/0020-zebra-Fix-non-notification-of-better-admin-won.patch index a1e06a7f5f21..324242a48770 100644 --- a/src/sonic-frr/patch/0027-zebra-Fix-non-notification-of-better-admin-won.patch +++ b/src/sonic-frr/patch/0020-zebra-Fix-non-notification-of-better-admin-won.patch @@ -1,23 +1,29 @@ -From 41b759505afb261211f40e386a30f6cf3870a094 Mon Sep 17 00:00:00 2001 -From: dgsudharsan -Date: Tue, 21 Nov 2023 17:55:24 +0000 -Subject: [PATCH] zebra: Fix non-notification of better admin won If there - happens to be a entry in the zebra rib that has a lower admin distance then a - newly received re, zebra would not notify the upper level protocol about this - happening. Imagine a case where there is a connected route for say a /32 and - bgp receives a route from a peer that is the same route as the connected. - Since BGP has no network statement and perceives the route as being `good` - bgp will install the route into zebra. Zebra will look at the new bgp re and - correctly identify that the re is not something that it will use and do - nothing. This change notices this and sends up a BETTER_ADMIN_WON route - notification. +From 9513d3a158e493623a6bc1e5e3e44b6ed277ac28 Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Tue, 14 Nov 2023 10:15:42 -0500 +Subject: [PATCH] zebra: Fix non-notification of better admin won +If there happens to be a entry in the zebra rib +that has a lower admin distance then a newly received +re, zebra would not notify the upper level protocol +about this happening. Imagine a case where there +is a connected route for say a /32 and bgp receives +a route from a peer that is the same route as the +connected. Since BGP has no network statement and +perceives the route as being `good` bgp will install +the route into zebra. Zebra will look at the new +bgp re and correctly identify that the re is not +something that it will use and do nothing. This +change notices this and sends up a BETTER_ADMIN_WON +route notification. + +Signed-off-by: Donald Sharp diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c -index 039c44cc09..f2f20bcf7b 100644 +index 2c3bb28d6..d37fe98f8 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c -@@ -1209,6 +1209,7 @@ static void rib_process(struct route_node *rn) +@@ -1227,6 +1227,7 @@ static void rib_process(struct route_node *rn) rib_dest_t *dest; struct zebra_vrf *zvrf = NULL; struct vrf *vrf; @@ -25,7 +31,7 @@ index 039c44cc09..f2f20bcf7b 100644 vrf_id_t vrf_id = VRF_UNKNOWN; -@@ -1278,6 +1279,7 @@ static void rib_process(struct route_node *rn) +@@ -1296,6 +1297,7 @@ static void rib_process(struct route_node *rn) * skip it. */ if (CHECK_FLAG(re->status, ROUTE_ENTRY_CHANGED)) { @@ -33,7 +39,7 @@ index 039c44cc09..f2f20bcf7b 100644 if (!nexthop_active_update(rn, re)) { const struct prefix *p; struct rib_table_info *info; -@@ -1363,6 +1365,8 @@ static void rib_process(struct route_node *rn) +@@ -1381,6 +1383,8 @@ static void rib_process(struct route_node *rn) * new_selected --- RE entry that is newly SELECTED * old_fib --- RE entry currently in kernel FIB * new_fib --- RE entry that is newly to be in kernel FIB @@ -42,7 +48,7 @@ index 039c44cc09..f2f20bcf7b 100644 * * new_selected will get SELECTED flag, and is going to be redistributed * the zclients. new_fib (which can be new_selected) will be installed -@@ -1417,6 +1421,22 @@ static void rib_process(struct route_node *rn) +@@ -1435,6 +1439,22 @@ static void rib_process(struct route_node *rn) } } diff --git a/src/sonic-frr/patch/Disable-ipv6-src-address-test-in-pceplib.patch b/src/sonic-frr/patch/0021-Disable-ipv6-src-address-test-in-pceplib.patch similarity index 100% rename from src/sonic-frr/patch/Disable-ipv6-src-address-test-in-pceplib.patch rename to src/sonic-frr/patch/0021-Disable-ipv6-src-address-test-in-pceplib.patch diff --git a/src/sonic-frr/patch/0022-bgpd-Don-t-read-the-first-byte-of-ORF-header-if-we-a.patch b/src/sonic-frr/patch/0022-bgpd-Don-t-read-the-first-byte-of-ORF-header-if-we-a.patch deleted file mode 100644 index 1ee76a180004..000000000000 --- a/src/sonic-frr/patch/0022-bgpd-Don-t-read-the-first-byte-of-ORF-header-if-we-a.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 4fcb9d0764b14463f797f2819905ab819dd770f5 Mon Sep 17 00:00:00 2001 -From: Donatas Abraitis -Date: Sun, 20 Aug 2023 22:15:27 +0300 -Subject: [PATCH] bgpd: Don't read the first byte of ORF header if we are ahead - of stream - -Reported-by: Iggy Frankovic iggyfran@amazon.com -Signed-off-by: Donatas Abraitis -(cherry picked from commit 9b855a692e68e0d16467e190b466b4ecb6853702) - -diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c -index a2959ef6e..60f1dcbcd 100644 ---- a/bgpd/bgp_packet.c -+++ b/bgpd/bgp_packet.c -@@ -2408,7 +2408,8 @@ static int bgp_route_refresh_receive(struct peer *peer, bgp_size_t size) - * and 7 bytes of ORF Address-filter entry from - * the stream - */ -- if (*p_pnt & ORF_COMMON_PART_REMOVE_ALL) { -+ if (p_pnt < p_end && -+ *p_pnt & ORF_COMMON_PART_REMOVE_ALL) { - if (bgp_debug_neighbor_events(peer)) - zlog_debug( - "%pBP rcvd Remove-All pfxlist ORF request", --- -2.17.1 - diff --git a/src/sonic-frr/patch/cross-compile-changes.patch b/src/sonic-frr/patch/0022-cross-compile-changes.patch similarity index 100% rename from src/sonic-frr/patch/cross-compile-changes.patch rename to src/sonic-frr/patch/0022-cross-compile-changes.patch diff --git a/src/sonic-frr/patch/0023-bgpd-Make-sure-we-have-enough-data-to-read-two-bytes.patch b/src/sonic-frr/patch/0023-bgpd-Make-sure-we-have-enough-data-to-read-two-bytes.patch deleted file mode 100644 index cde176c58e41..000000000000 --- a/src/sonic-frr/patch/0023-bgpd-Make-sure-we-have-enough-data-to-read-two-bytes.patch +++ /dev/null @@ -1,51 +0,0 @@ -From da62ad75f69f2e0e4ec51c7dd5e79bd810f636b6 Mon Sep 17 00:00:00 2001 -From: Donatas Abraitis -Date: Fri, 18 Aug 2023 11:28:03 +0300 -Subject: [PATCH] bgpd: Make sure we have enough data to read two bytes when - validating AIGP - -Found when fuzzing: - -``` -==3470861==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xffff77801ef7 at pc 0xaaaaba7b3dbc bp 0xffffcff0e760 sp 0xffffcff0df50 -READ of size 2 at 0xffff77801ef7 thread T0 - 0 0xaaaaba7b3db8 in __asan_memcpy (/home/ubuntu/frr_8_5_2/frr_8_5_2_fuzz_clang/bgpd/bgpd+0x363db8) (BuildId: cc710a2356e31c7f4e4a17595b54de82145a6e21) - 1 0xaaaaba81a8ac in ptr_get_be16 /home/ubuntu/frr_8_5_2/frr_8_5_2_fuzz_clang/./lib/stream.h:399:2 - 2 0xaaaaba819f2c in bgp_attr_aigp_valid /home/ubuntu/frr_8_5_2/frr_8_5_2_fuzz_clang/bgpd/bgp_attr.c:504:3 - 3 0xaaaaba808c20 in bgp_attr_aigp /home/ubuntu/frr_8_5_2/frr_8_5_2_fuzz_clang/bgpd/bgp_attr.c:3275:7 - 4 0xaaaaba7ff4e0 in bgp_attr_parse /home/ubuntu/frr_8_5_2/frr_8_5_2_fuzz_clang/bgpd/bgp_attr.c:3678:10 -``` - -Reported-by: Iggy Frankovic -Signed-off-by: Donatas Abraitis -(cherry picked from commit f96201e104892e18493f24cf67bb713678e8237b) - -diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c -index 8e66a229c..2ef50ffe5 100644 ---- a/bgpd/bgp_attr.c -+++ b/bgpd/bgp_attr.c -@@ -513,6 +513,7 @@ static bool bgp_attr_aigp_valid(uint8_t *pnt, int length) - uint8_t *data = pnt; - uint8_t tlv_type; - uint16_t tlv_length; -+ uint8_t *end = data + length; - - if (length < 3) { - zlog_err("Bad AIGP attribute length (MUST be minimum 3): %u", -@@ -521,7 +522,13 @@ static bool bgp_attr_aigp_valid(uint8_t *pnt, int length) - } - - while (length) { -+ size_t data_len = end - data; -+ - tlv_type = *data; -+ -+ if (data_len - 1 < 2) -+ return false; -+ - ptr_get_be16(data + 1, &tlv_length); - (void)data; - --- -2.17.1 - diff --git a/src/sonic-frr/patch/0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch b/src/sonic-frr/patch/0023-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch similarity index 86% rename from src/sonic-frr/patch/0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch rename to src/sonic-frr/patch/0023-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch index 00e8cc0062ca..980f1d87cdf7 100644 --- a/src/sonic-frr/patch/0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch +++ b/src/sonic-frr/patch/0023-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch @@ -1,4 +1,4 @@ -From c13964525dae96299dc54daf635609971576a09e Mon Sep 17 00:00:00 2001 +From bcb608d988b3de282ff832fd398e95080be8ad86 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 11 Dec 2023 13:41:36 -0500 Subject: [PATCH] zebra: The dplane_fpm_nl return path leaks memory @@ -8,9 +8,10 @@ entry data backup to the master pthread in zebra is being leaked. Prevent this from happening. Signed-off-by: Donald Sharp +(cherry picked from commit 7f9c5c7fa2d927033549a806fd9025a9459f22bc) diff --git a/zebra/rib.h b/zebra/rib.h -index 016106312..e99eee67c 100644 +index a02a461e8..2e62148ea 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -352,6 +352,8 @@ extern void _route_entry_dump(const char *func, union prefixconstptr pp, @@ -36,10 +37,10 @@ index 6bdc15592..fc9e8c457 100644 /* * I really don't see how this is possible diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c -index f2f20bcf7..1cefdfae7 100644 +index 2b47e229a..1ff3d9854 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c -@@ -4136,6 +4136,12 @@ struct route_entry *zebra_rib_route_entry_new(vrf_id_t vrf_id, int type, +@@ -4178,6 +4178,12 @@ struct route_entry *zebra_rib_route_entry_new(vrf_id_t vrf_id, int type, return re; } diff --git a/src/sonic-frr/patch/0024-bgpd-Do-not-process-NLRIs-if-the-attribute-length-is.patch b/src/sonic-frr/patch/0024-bgpd-Do-not-process-NLRIs-if-the-attribute-length-is.patch deleted file mode 100644 index ceac479b48a5..000000000000 --- a/src/sonic-frr/patch/0024-bgpd-Do-not-process-NLRIs-if-the-attribute-length-is.patch +++ /dev/null @@ -1,97 +0,0 @@ -From fc5cb12121cb1858c162f9ed8f6206fc61439455 Mon Sep 17 00:00:00 2001 -From: Donatas Abraitis -Date: Tue, 22 Aug 2023 22:52:04 +0300 -Subject: [PATCH] bgpd: Do not process NLRIs if the attribute length is zero - -``` -3 0x00007f423aa42476 in __GI_raise (sig=sig@entry=11) at ../sysdeps/posix/raise.c:26 -4 0x00007f423aef9740 in core_handler (signo=11, siginfo=0x7fffc414deb0, context=) at lib/sigevent.c:246 -5 -6 0x0000564dea2fc71e in route_set_aspath_prepend (rule=0x564debd66d50, prefix=0x7fffc414ea30, object=0x7fffc414e400) - at bgpd/bgp_routemap.c:2258 -7 0x00007f423aeec7e0 in route_map_apply_ext (map=, prefix=prefix@entry=0x7fffc414ea30, - match_object=match_object@entry=0x7fffc414e400, set_object=set_object@entry=0x7fffc414e400, pref=pref@entry=0x0) at lib/routemap.c:2690 -8 0x0000564dea2d277e in bgp_input_modifier (peer=peer@entry=0x7f4238f59010, p=p@entry=0x7fffc414ea30, attr=attr@entry=0x7fffc414e770, - afi=afi@entry=AFI_IP, safi=safi@entry=SAFI_UNICAST, rmap_name=rmap_name@entry=0x0, label=0x0, num_labels=0, dest=0x564debdd5130) - at bgpd/bgp_route.c:1772 -9 0x0000564dea2df762 in bgp_update (peer=peer@entry=0x7f4238f59010, p=p@entry=0x7fffc414ea30, addpath_id=addpath_id@entry=0, - attr=0x7fffc414eb50, afi=afi@entry=AFI_IP, safi=, safi@entry=SAFI_UNICAST, type=9, sub_type=0, prd=0x0, label=0x0, - num_labels=0, soft_reconfig=0, evpn=0x0) at bgpd/bgp_route.c:4374 -10 0x0000564dea2e2047 in bgp_nlri_parse_ip (peer=0x7f4238f59010, attr=attr@entry=0x7fffc414eb50, packet=0x7fffc414eaf0) - at bgpd/bgp_route.c:6249 -11 0x0000564dea2c5a58 in bgp_nlri_parse (peer=peer@entry=0x7f4238f59010, attr=attr@entry=0x7fffc414eb50, - packet=packet@entry=0x7fffc414eaf0, mp_withdraw=mp_withdraw@entry=false) at bgpd/bgp_packet.c:339 -12 0x0000564dea2c5d66 in bgp_update_receive (peer=peer@entry=0x7f4238f59010, size=size@entry=109) at bgpd/bgp_packet.c:2024 -13 0x0000564dea2c901d in bgp_process_packet (thread=) at bgpd/bgp_packet.c:2933 -14 0x00007f423af0bf71 in event_call (thread=thread@entry=0x7fffc414ee40) at lib/event.c:1995 -15 0x00007f423aebb198 in frr_run (master=0x564deb73c670) at lib/libfrr.c:1213 -16 0x0000564dea261b83 in main (argc=, argv=) at bgpd/bgp_main.c:505 -``` - -With the configuration: - -``` -frr version 9.1-dev-MyOwnFRRVersion -frr defaults traditional -hostname ip-172-31-13-140 -log file /tmp/debug.log -log syslog -service integrated-vtysh-config -! -debug bgp keepalives -debug bgp neighbor-events -debug bgp updates in -debug bgp updates out -! -router bgp 100 - bgp router-id 9.9.9.9 - no bgp ebgp-requires-policy - bgp bestpath aigp - neighbor 172.31.2.47 remote-as 200 - ! - address-family ipv4 unicast - neighbor 172.31.2.47 default-originate - neighbor 172.31.2.47 route-map RM_IN in - exit-address-family -exit -! -route-map RM_IN permit 10 - set as-path prepend 200 -exit -! -``` - -The issue is that we try to process NLRIs even if the attribute length is 0. - -Later bgp_update() will handle route-maps and a crash occurs because all the -attributes are NULL, including aspath, where we dereference. - -According to the RFC 4271: - -A value of 0 indicates that neither the Network Layer - Reachability Information field nor the Path Attribute field is - present in this UPDATE message. - -But with a fuzzed UPDATE message this can be faked. I think it's reasonable -to skip processing NLRIs if both update_len and attribute_len are 0. - -Reported-by: Iggy Frankovic -Signed-off-by: Donatas Abraitis -(cherry picked from commit 28ccc24d38df1d51ed8a563507e5d6f6171fdd38) - -diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c -index 60f1dcbcd..a02d54894 100644 ---- a/bgpd/bgp_packet.c -+++ b/bgpd/bgp_packet.c -@@ -1983,7 +1983,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size) - /* Network Layer Reachability Information. */ - update_len = end - stream_pnt(s); - -- if (update_len) { -+ if (update_len && attribute_len) { - /* Set NLRI portion to structure. */ - nlris[NLRI_UPDATE].afi = AFI_IP; - nlris[NLRI_UPDATE].safi = SAFI_UNICAST; --- -2.17.1 - diff --git a/src/sonic-frr/patch/0024-lib-use-snmp-s-large-fd-sets-for-agentx.patch b/src/sonic-frr/patch/0024-lib-use-snmp-s-large-fd-sets-for-agentx.patch new file mode 100644 index 000000000000..ad3da2a0ad2e --- /dev/null +++ b/src/sonic-frr/patch/0024-lib-use-snmp-s-large-fd-sets-for-agentx.patch @@ -0,0 +1,143 @@ +From 7e1857bf4315ae01e065fc8bc881338977c1ef87 Mon Sep 17 00:00:00 2001 +From: Edwin Brossette +Date: Fri, 8 Dec 2023 16:02:11 +0100 +Subject: [PATCH] lib: use snmp's large fd sets for agentx + +The maximum number of file descriptors in an fd set is limited by +FD_SETSIZE. This limitation is important because the libc macros +FD_SET(), FD_CLR() and FD_ISSET() will invoke a sigabort if the size of +the fd set given to them is above FD_SETSIZE. + +We ran into such a sigabort with bgpd because snmp can return an fd set +of size higher than FD_SETSIZE when calling snmp_select_info(). An +unfortunate FD_ISSET() call later causes the following abort: + +Received signal 6 at 1701115534 (si_addr 0xb94, PC 0x7ff289a16a7c); aborting... +/lib/x86_64-linux-gnu/libfrr.so.0(zlog_backtrace_sigsafe+0xb3) [0x7ff289d62bba] +/lib/x86_64-linux-gnu/libfrr.so.0(zlog_signal+0x1b4) [0x7ff289d62a1f] +/lib/x86_64-linux-gnu/libfrr.so.0(+0x102860) [0x7ff289da4860] +/lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7ff2899c2520] +/lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c) [0x7ff289a16a7c] +/lib/x86_64-linux-gnu/libc.so.6(raise+0x16) [0x7ff2899c2476] +/lib/x86_64-linux-gnu/libc.so.6(abort+0xd3) [0x7ff2899a87f3] +/lib/x86_64-linux-gnu/libc.so.6(+0x896f6) [0x7ff289a096f6] +/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x2a) [0x7ff289ab676a] +/lib/x86_64-linux-gnu/libc.so.6(+0x1350c6) [0x7ff289ab50c6] +/lib/x86_64-linux-gnu/libc.so.6(+0x1366ab) [0x7ff289ab66ab] +/lib/x86_64-linux-gnu/libfrrsnmp.so.0(+0x36f5) [0x7ff2897736f5] +/lib/x86_64-linux-gnu/libfrrsnmp.so.0(+0x3c27) [0x7ff289773c27] +/lib/x86_64-linux-gnu/libfrr.so.0(thread_call+0x1c2) [0x7ff289dbe105] +/lib/x86_64-linux-gnu/libfrr.so.0(frr_run+0x257) [0x7ff289d56e69] +/usr/bin/bgpd(main+0x4f4) [0x560965c40488] +/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7ff2899a9d90] +/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7ff2899a9e40] +/usr/bin/bgpd(_start+0x25) [0x560965c3e965] +in thread agentx_timeout scheduled from /build/make-pkg/output/_packages/cp-routing/src/lib/agentx.c:122 agentx_events_update() + +Also, the following error is logged by snmp just before the abort: +snmp[err]: Use snmp_sess_select_info2() for processing large file descriptors + +snmp uses a custom struct netsnmp_large_fd_set to work above the limit +imposed by FD_SETSIZE. It is noteworthy that, when calling +snmp_select_info() instead of snmp_select_info2(), snmp uses the same +code working with its custom, large structs, and copy/paste the result +to a regular, libc compatible fd_set. So there should be no downside +working with snmp_select_info2() instead of snmp_select_info(). + +Replace every use of the libc file descriptors sets by snmp's extended +file descriptors sets in agentx to acommodate for the high number of +file descriptors that can come out of snmp. This should prevent the +abort seen above. + +Signed-off-by: Edwin Brossette + +diff --git a/lib/agentx.c b/lib/agentx.c +index 5f6245980..be8277c53 100644 +--- a/lib/agentx.c ++++ b/lib/agentx.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #include "command.h" + #include "smux.h" +@@ -58,7 +59,7 @@ static void agentx_timeout(struct thread *t) + + static void agentx_read(struct thread *t) + { +- fd_set fds; ++ netsnmp_large_fd_set lfds; + int flags, new_flags = 0; + int nonblock = false; + struct listnode *ln = THREAD_ARG(t); +@@ -83,9 +84,9 @@ static void agentx_read(struct thread *t) + flog_err(EC_LIB_SYSTEM_CALL, "Failed to set snmp fd non blocking: %s(%d)", + strerror(errno), errno); + +- FD_ZERO(&fds); +- FD_SET(THREAD_FD(t), &fds); +- snmp_read(&fds); ++ netsnmp_large_fd_set_init(&lfds, FD_SETSIZE); ++ netsnmp_large_fd_setfd(t->u.fd, &lfds); ++ snmp_read2(&lfds); + + /* Reset the flag */ + if (!nonblock) { +@@ -100,6 +101,7 @@ static void agentx_read(struct thread *t) + + netsnmp_check_outstanding_agent_requests(); + agentx_events_update(); ++ netsnmp_large_fd_set_cleanup(&lfds); + } + + static void agentx_events_update(void) +@@ -107,15 +109,15 @@ static void agentx_events_update(void) + int maxfd = 0; + int block = 1; + struct timeval timeout = {.tv_sec = 0, .tv_usec = 0}; +- fd_set fds; ++ netsnmp_large_fd_set lfds; + struct listnode *ln; + struct thread **thr; + int fd, thr_fd; + + thread_cancel(&timeout_thr); + +- FD_ZERO(&fds); +- snmp_select_info(&maxfd, &fds, &timeout, &block); ++ netsnmp_large_fd_set_init(&lfds, FD_SETSIZE); ++ snmp_select_info2(&maxfd, &lfds, &timeout, &block); + + if (!block) { + thread_add_timer_tv(agentx_tm, agentx_timeout, NULL, &timeout, +@@ -133,7 +135,7 @@ static void agentx_events_update(void) + /* caught up */ + if (thr_fd == fd) { + struct listnode *nextln = listnextnode(ln); +- if (!FD_ISSET(fd, &fds)) { ++ if (!netsnmp_large_fd_is_set(fd, &lfds)) { + thread_cancel(thr); + XFREE(MTYPE_TMP, thr); + list_delete_node(events, ln); +@@ -143,7 +145,7 @@ static void agentx_events_update(void) + thr_fd = thr ? THREAD_FD(*thr) : -1; + } + /* need listener, but haven't hit one where it would be */ +- else if (FD_ISSET(fd, &fds)) { ++ else if (netsnmp_large_fd_is_set(fd, &lfds)) { + struct listnode *newln; + thr = XCALLOC(MTYPE_TMP, sizeof(struct thread *)); + +@@ -162,6 +164,7 @@ static void agentx_events_update(void) + list_delete_node(events, ln); + ln = nextln; + } ++ netsnmp_large_fd_set_cleanup(&lfds); + } + + /* AgentX node. */ +-- +2.17.1 + diff --git a/src/sonic-frr/patch/0025-bgp-community-memory-leak-fix.patch b/src/sonic-frr/patch/0025-bgp-community-memory-leak-fix.patch new file mode 100644 index 000000000000..f8215e07f0f8 --- /dev/null +++ b/src/sonic-frr/patch/0025-bgp-community-memory-leak-fix.patch @@ -0,0 +1,395 @@ +From 92323cf4b506c40376be74e955836da30980ae54 Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Wed, 13 Mar 2024 10:26:58 -0400 +Subject: [PATCH 1/3] bgpd: Ensure that the correct aspath is free'd + +Currently in subgroup_default_originate the attr.aspath +is set in bgp_attr_default_set, which hashs the aspath +and creates a refcount for it. If this is a withdraw +the subgroup_announce_check and bgp_adj_out_set_subgroup +is called which will intern the attribute. This will +cause the the attr.aspath to be set to a new value +finally at the bottom of the function it intentionally +uninterns the aspath which is not the one that was +created for this function. This reduces the other +aspath's refcount by 1 and if a clear bgp * is issued +fast enough the aspath for that will be removed +and the system will crash. + +Signed-off-by: Donald Sharp +--- + bgpd/bgp_updgrp_adv.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c +index de2b3206b7..dcde4263da 100644 +--- a/bgpd/bgp_updgrp_adv.c ++++ b/bgpd/bgp_updgrp_adv.c +@@ -813,6 +813,7 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) + struct bgp *bgp; + struct attr attr; + struct attr *new_attr = &attr; ++ struct aspath *aspath; + struct prefix p; + struct peer *from; + struct bgp_dest *dest; +@@ -850,6 +851,7 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) + /* make coverity happy */ + assert(attr.aspath); + ++ aspath = attr.aspath; + attr.med = 0; + attr.flag |= ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC); + +@@ -1005,7 +1007,7 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) + } + } + +- aspath_unintern(&attr.aspath); ++ aspath_unintern(&aspath); + } + + /* +-- +2.14.1 + + +From 07545c1879775f155f228c81393eed9697b699de Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Sat, 2 Mar 2024 09:42:30 -0500 +Subject: [PATCH 2/3] bgpd: Include unsuppress-map as a valid outgoing policy + +If unsuppress-map is setup for outgoing peers, consider that +policy is being applied as for RFC 8212. + +Signed-off-by: Donald Sharp +--- + bgpd/bgp_route.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c +index 473168d9be..fb14fc7f20 100644 +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -5816,10 +5816,10 @@ bool bgp_outbound_policy_exists(struct peer *peer, struct bgp_filter *filter) + if (peer->sort == BGP_PEER_IBGP) + return true; + +- if (peer->sort == BGP_PEER_EBGP +- && (ROUTE_MAP_OUT_NAME(filter) || PREFIX_LIST_OUT_NAME(filter) +- || FILTER_LIST_OUT_NAME(filter) +- || DISTRIBUTE_OUT_NAME(filter))) ++ if (peer->sort == BGP_PEER_EBGP && ++ (ROUTE_MAP_OUT_NAME(filter) || PREFIX_LIST_OUT_NAME(filter) || ++ FILTER_LIST_OUT_NAME(filter) || DISTRIBUTE_OUT_NAME(filter) || ++ UNSUPPRESS_MAP_NAME(filter))) + return true; + return false; + } +-- +2.14.1 + + +From e3493d5be0156fa9c8c522b818ae6448dbe371f2 Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Sat, 2 Mar 2024 09:50:38 -0500 +Subject: [PATCH 3/3] bgpd: Ensure community data is freed in some cases. + +Customer has this valgrind trace: + +Direct leak of 2829120 byte(s) in 70728 object(s) allocated from: + 0 in community_new ../bgpd/bgp_community.c:39 + 1 in community_uniq_sort ../bgpd/bgp_community.c:170 + 2 in route_set_community ../bgpd/bgp_routemap.c:2342 + 3 in route_map_apply_ext ../lib/routemap.c:2673 + 4 in subgroup_announce_check ../bgpd/bgp_route.c:2367 + 5 in subgroup_process_announce_selected ../bgpd/bgp_route.c:2914 + 6 in group_announce_route_walkcb ../bgpd/bgp_updgrp_adv.c:199 + 7 in hash_walk ../lib/hash.c:285 + 8 in update_group_af_walk ../bgpd/bgp_updgrp.c:2061 + 9 in group_announce_route ../bgpd/bgp_updgrp_adv.c:1059 + 10 in bgp_process_main_one ../bgpd/bgp_route.c:3221 + 11 in bgp_process_wq ../bgpd/bgp_route.c:3221 + 12 in work_queue_run ../lib/workqueue.c:282 + +The above leak detected by valgrind was from a screenshot so I copied it +by hand. Any mistakes in line numbers are purely from my transcription. +Additionally this is against a slightly modified 8.5.1 version of FRR. +Code inspection of 8.5.1 -vs- latest master shows the same problem +exists. Code should be able to be followed from there to here. + +What is happening: + +There is a route-map being applied that modifes the outgoing community +to a peer. This is saved in the attr copy created in +subgroup_process_announce_selected. This community pointer is not +interned. So the community->refcount is still 0. Normally when +a prefix is announced, the attr and the prefix are placed on a +adjency out structure where the attribute is interned. This will +cause the community to be saved in the community hash list as well. +In a non-normal operation when the decision to send is aborted after +the route-map application, the attribute is just dropped and the +pointer to the community is just dropped too, leading to situations +where the memory is leaked. The usage of bgp suppress-fib would +would be a case where the community is caused to be leaked. +Additionally the previous commit where an unsuppress-map is used +to modify the outgoing attribute but since unsuppress-map was +not considered part of outgoing policy the attribute would be dropped as +well. This pointer drop also extends to any dynamically allocated +memory saved by the attribute pointer that was not interned yet as well. + +So let's modify the return case where the decision is made to +not send the prefix to the peer to always just flush the attribute +to ensure memory is not leaked. + +Fixes: #15459 +Signed-off-by: Donald Sharp +--- + bgpd/bgp_conditional_adv.c | 5 ++-- + bgpd/bgp_route.c | 30 +++++++++++++----------- + bgpd/bgp_updgrp.h | 2 +- + bgpd/bgp_updgrp_adv.c | 58 +++++++++++++++++++++++++--------------------- + 4 files changed, 51 insertions(+), 44 deletions(-) + +diff --git a/bgpd/bgp_conditional_adv.c b/bgpd/bgp_conditional_adv.c +index 24d822a745..edb9bc8bb7 100644 +--- a/bgpd/bgp_conditional_adv.c ++++ b/bgpd/bgp_conditional_adv.c +@@ -135,8 +135,9 @@ static void bgp_conditional_adv_routes(struct peer *peer, afi_t afi, + if (update_type == UPDATE_TYPE_ADVERTISE && + subgroup_announce_check(dest, pi, subgrp, dest_p, + &attr, &advmap_attr)) { +- bgp_adj_out_set_subgroup(dest, subgrp, &attr, +- pi); ++ if (!bgp_adj_out_set_subgroup(dest, subgrp, ++ &attr, pi)) ++ bgp_attr_flush(&attr); + } else { + /* If default originate is enabled for + * the peer, do not send explicit +diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c +index fb14fc7f20..2976042dda 100644 +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -2879,7 +2879,7 @@ void subgroup_process_announce_selected(struct update_subgroup *subgrp, + { + const struct prefix *p; + struct peer *onlypeer; +- struct attr attr; ++ struct attr attr = {0}, *pattr = &attr; + afi_t afi; + safi_t safi; + struct bgp *bgp; +@@ -2900,7 +2900,7 @@ void subgroup_process_announce_selected(struct update_subgroup *subgrp, + PEER_STATUS_ORF_WAIT_REFRESH)) + return; + +- memset(&attr, 0, sizeof(attr)); ++ memset(pattr, 0, sizeof(*pattr)); + /* It's initialized in bgp_announce_check() */ + + /* Announcement to the subgroup. If the route is filtered withdraw it. +@@ -2911,32 +2911,34 @@ void subgroup_process_announce_selected(struct update_subgroup *subgrp, + advertise = bgp_check_advertise(bgp, dest); + + if (selected) { +- if (subgroup_announce_check(dest, selected, subgrp, p, &attr, ++ if (subgroup_announce_check(dest, selected, subgrp, p, pattr, + NULL)) { + /* Route is selected, if the route is already installed + * in FIB, then it is advertised + */ + if (advertise) { + if (!bgp_check_withdrawal(bgp, dest)) { +- struct attr *adv_attr = +- bgp_attr_intern(&attr); +- +- bgp_adj_out_set_subgroup(dest, subgrp, +- adv_attr, +- selected); +- } else ++ if (!bgp_adj_out_set_subgroup( ++ dest, subgrp, pattr, ++ selected)) ++ bgp_attr_flush(pattr); ++ } else { + bgp_adj_out_unset_subgroup( + dest, subgrp, 1, addpath_tx_id); +- } +- } else ++ bgp_attr_flush(pattr); ++ } ++ } else ++ bgp_attr_flush(pattr); ++ } else { + bgp_adj_out_unset_subgroup(dest, subgrp, 1, + addpath_tx_id); ++ bgp_attr_flush(pattr); ++ } + } + + /* If selected is NULL we must withdraw the path using addpath_tx_id */ +- else { ++ else + bgp_adj_out_unset_subgroup(dest, subgrp, 1, addpath_tx_id); +- } + } + + /* +diff --git a/bgpd/bgp_updgrp.h b/bgpd/bgp_updgrp.h +index e27c1e7b67..b7b6aa07e9 100644 +--- a/bgpd/bgp_updgrp.h ++++ b/bgpd/bgp_updgrp.h +@@ -458,7 +458,7 @@ extern struct bgp_adj_out *bgp_adj_out_alloc(struct update_subgroup *subgrp, + extern void bgp_adj_out_remove_subgroup(struct bgp_dest *dest, + struct bgp_adj_out *adj, + struct update_subgroup *subgrp); +-extern void bgp_adj_out_set_subgroup(struct bgp_dest *dest, ++extern bool bgp_adj_out_set_subgroup(struct bgp_dest *dest, + struct update_subgroup *subgrp, + struct attr *attr, + struct bgp_path_info *path); +diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c +index dcde4263da..7902d40bd9 100644 +--- a/bgpd/bgp_updgrp_adv.c ++++ b/bgpd/bgp_updgrp_adv.c +@@ -454,7 +454,7 @@ bgp_advertise_clean_subgroup(struct update_subgroup *subgrp, + return next; + } + +-void bgp_adj_out_set_subgroup(struct bgp_dest *dest, ++bool bgp_adj_out_set_subgroup(struct bgp_dest *dest, + struct update_subgroup *subgrp, struct attr *attr, + struct bgp_path_info *path) + { +@@ -474,7 +474,7 @@ void bgp_adj_out_set_subgroup(struct bgp_dest *dest, + bgp = SUBGRP_INST(subgrp); + + if (DISABLE_BGP_ANNOUNCE) +- return; ++ return false; + + /* Look for adjacency information. */ + adj = adj_lookup( +@@ -490,7 +490,7 @@ void bgp_adj_out_set_subgroup(struct bgp_dest *dest, + bgp_addpath_id_for_peer(peer, afi, safi, + &path->tx_addpath)); + if (!adj) +- return; ++ return false; + + subgrp->pscount++; + } +@@ -529,7 +529,7 @@ void bgp_adj_out_set_subgroup(struct bgp_dest *dest, + * will never be able to coalesce the 3rd peer down + */ + subgrp->version = MAX(subgrp->version, dest->version); +- return; ++ return false; + } + + if (adj->adv) +@@ -576,6 +576,8 @@ void bgp_adj_out_set_subgroup(struct bgp_dest *dest, + bgp_adv_fifo_add_tail(&subgrp->sync->update, adv); + + subgrp->version = MAX(subgrp->version, dest->version); ++ ++ return true; + } + + /* The only time 'withdraw' will be false is if we are sending +@@ -668,7 +670,7 @@ void subgroup_announce_table(struct update_subgroup *subgrp, + { + struct bgp_dest *dest; + struct bgp_path_info *ri; +- struct attr attr; ++ struct attr attr = {0}, *pattr = &attr; + struct peer *peer; + afi_t afi; + safi_t safi; +@@ -712,24 +714,25 @@ void subgroup_announce_table(struct update_subgroup *subgrp, + continue; + + if (subgroup_announce_check(dest, ri, subgrp, dest_p, +- &attr, NULL)) { ++ pattr, NULL)) { + /* Check if route can be advertised */ + if (advertise) { + if (!bgp_check_withdrawal(bgp, dest)) { +- struct attr *adv_attr = +- bgp_attr_intern(&attr); +- +- bgp_adj_out_set_subgroup( +- dest, subgrp, adv_attr, +- ri); +- } else ++ if (!bgp_adj_out_set_subgroup( ++ dest, subgrp, pattr, ++ ri)) ++ bgp_attr_flush(pattr); ++ } else { + bgp_adj_out_unset_subgroup( + dest, subgrp, 1, + bgp_addpath_id_for_peer( + peer, afi, + safi_rib, + &ri->tx_addpath)); +- } ++ bgp_attr_flush(pattr); ++ } ++ } else ++ bgp_attr_flush(pattr); + } else { + /* If default originate is enabled for + * the peer, do not send explicit +@@ -748,6 +751,7 @@ void subgroup_announce_table(struct update_subgroup *subgrp, + bgp_addpath_id_for_peer( + peer, afi, safi_rib, + &ri->tx_addpath)); ++ bgp_attr_flush(pattr); + } + } + } +@@ -811,7 +815,7 @@ void subgroup_announce_route(struct update_subgroup *subgrp) + void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) + { + struct bgp *bgp; +- struct attr attr; ++ struct attr attr = {0}; + struct attr *new_attr = &attr; + struct aspath *aspath; + struct prefix p; +@@ -952,18 +956,18 @@ void subgroup_default_originate(struct update_subgroup *subgrp, int withdraw) + if (dest) { + for (pi = bgp_dest_get_bgp_path_info(dest); pi; + pi = pi->next) { +- if (CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)) +- if (subgroup_announce_check( +- dest, pi, subgrp, +- bgp_dest_get_prefix(dest), +- &attr, NULL)) { +- struct attr *default_attr = +- bgp_attr_intern(&attr); +- +- bgp_adj_out_set_subgroup( +- dest, subgrp, +- default_attr, pi); +- } ++ if (!CHECK_FLAG(pi->flags, BGP_PATH_SELECTED)) ++ continue; ++ ++ if (subgroup_announce_check( ++ dest, pi, subgrp, ++ bgp_dest_get_prefix(dest), &attr, ++ NULL)) { ++ if (!bgp_adj_out_set_subgroup( ++ dest, subgrp, &attr, pi)) ++ bgp_attr_flush(&attr); ++ } else ++ bgp_attr_flush(&attr); + } + bgp_dest_unlock_node(dest); + } +-- +2.14.1 + diff --git a/src/sonic-frr/patch/0025-bgpd-Use-treat-as-withdraw-for-tunnel-encapsulation-.patch b/src/sonic-frr/patch/0025-bgpd-Use-treat-as-withdraw-for-tunnel-encapsulation-.patch deleted file mode 100644 index 6a7aae3c6c39..000000000000 --- a/src/sonic-frr/patch/0025-bgpd-Use-treat-as-withdraw-for-tunnel-encapsulation-.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 35b98f89f6a2ca5a79ed8893b4df612c0c6b4a37 Mon Sep 17 00:00:00 2001 -From: Donatas Abraitis -Date: Thu, 13 Jul 2023 22:32:03 +0300 -Subject: [PATCH] bgpd: Use treat-as-withdraw for tunnel encapsulation - attribute - -Before this path we used session reset method, which is discouraged by rfc7606. - -Handle this as rfc requires. - -Signed-off-by: Donatas Abraitis -(cherry picked from commit bcb6b58d9530173df41d3a3cbc4c600ee0b4b186) - -diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c -index 2ef50ffe5..ee20da332 100644 ---- a/bgpd/bgp_attr.c -+++ b/bgpd/bgp_attr.c -@@ -1416,6 +1416,7 @@ bgp_attr_malformed(struct bgp_attr_parser_args *args, uint8_t subcode, - case BGP_ATTR_LARGE_COMMUNITIES: - case BGP_ATTR_ORIGINATOR_ID: - case BGP_ATTR_CLUSTER_LIST: -+ case BGP_ATTR_ENCAP: - case BGP_ATTR_OTC: - return BGP_ATTR_PARSE_WITHDRAW; - case BGP_ATTR_MP_REACH_NLRI: -@@ -2644,26 +2645,21 @@ ipv6_ext_community_ignore: - } - - /* Parse Tunnel Encap attribute in an UPDATE */ --static int bgp_attr_encap(uint8_t type, struct peer *peer, /* IN */ -- bgp_size_t length, /* IN: attr's length field */ -- struct attr *attr, /* IN: caller already allocated */ -- uint8_t flag, /* IN: attr's flags field */ -- uint8_t *startp) -+static int bgp_attr_encap(struct bgp_attr_parser_args *args) - { -- bgp_size_t total; - uint16_t tunneltype = 0; -- -- total = length + (CHECK_FLAG(flag, BGP_ATTR_FLAG_EXTLEN) ? 4 : 3); -+ struct peer *const peer = args->peer; -+ struct attr *const attr = args->attr; -+ bgp_size_t length = args->length; -+ uint8_t type = args->type; -+ uint8_t flag = args->flags; - - if (!CHECK_FLAG(flag, BGP_ATTR_FLAG_TRANS) - || !CHECK_FLAG(flag, BGP_ATTR_FLAG_OPTIONAL)) { -- zlog_info( -- "Tunnel Encap attribute flag isn't optional and transitive %d", -- flag); -- bgp_notify_send_with_data(peer, BGP_NOTIFY_UPDATE_ERR, -- BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR, -- startp, total); -- return -1; -+ zlog_err("Tunnel Encap attribute flag isn't optional and transitive %d", -+ flag); -+ return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, -+ args->total); - } - - if (BGP_ATTR_ENCAP == type) { -@@ -2671,12 +2667,11 @@ static int bgp_attr_encap(uint8_t type, struct peer *peer, /* IN */ - uint16_t tlv_length; - - if (length < 4) { -- zlog_info( -+ zlog_err( - "Tunnel Encap attribute not long enough to contain outer T,L"); -- bgp_notify_send_with_data( -- peer, BGP_NOTIFY_UPDATE_ERR, -- BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, startp, total); -- return -1; -+ return bgp_attr_malformed(args, -+ BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, -+ args->total); - } - tunneltype = stream_getw(BGP_INPUT(peer)); - tlv_length = stream_getw(BGP_INPUT(peer)); -@@ -2706,13 +2701,11 @@ static int bgp_attr_encap(uint8_t type, struct peer *peer, /* IN */ - } - - if (sublength > length) { -- zlog_info( -- "Tunnel Encap attribute sub-tlv length %d exceeds remaining length %d", -- sublength, length); -- bgp_notify_send_with_data( -- peer, BGP_NOTIFY_UPDATE_ERR, -- BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, startp, total); -- return -1; -+ zlog_err("Tunnel Encap attribute sub-tlv length %d exceeds remaining length %d", -+ sublength, length); -+ return bgp_attr_malformed(args, -+ BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, -+ args->total); - } - - /* alloc and copy sub-tlv */ -@@ -2760,13 +2753,10 @@ static int bgp_attr_encap(uint8_t type, struct peer *peer, /* IN */ - - if (length) { - /* spurious leftover data */ -- zlog_info( -- "Tunnel Encap attribute length is bad: %d leftover octets", -- length); -- bgp_notify_send_with_data(peer, BGP_NOTIFY_UPDATE_ERR, -- BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, -- startp, total); -- return -1; -+ zlog_err("Tunnel Encap attribute length is bad: %d leftover octets", -+ length); -+ return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR, -+ args->total); - } - - return 0; -@@ -3718,8 +3708,7 @@ enum bgp_attr_parse_ret bgp_attr_parse(struct peer *peer, struct attr *attr, - case BGP_ATTR_VNC: - #endif - case BGP_ATTR_ENCAP: -- ret = bgp_attr_encap(type, peer, length, attr, flag, -- startp); -+ ret = bgp_attr_encap(&attr_args); - break; - case BGP_ATTR_PREFIX_SID: - ret = bgp_attr_prefix_sid(&attr_args); --- -2.17.1 - diff --git a/src/sonic-frr/patch/0026-bgp-fib-suppress-announce-fix.patch b/src/sonic-frr/patch/0026-bgp-fib-suppress-announce-fix.patch new file mode 100644 index 000000000000..a6e9d4d4633e --- /dev/null +++ b/src/sonic-frr/patch/0026-bgp-fib-suppress-announce-fix.patch @@ -0,0 +1,122 @@ +From bf292bfd8b4e2d7ba181ce6efde4e43e066d1a88 Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Thu, 28 Mar 2024 12:25:05 -0400 +Subject: [PATCH 1/2] bgpd: Note when receiving but not understanding a route + notification + +When BGP has been asked to wait for FIB installation, on route +removal a return call is likely to not have the dest since BGP +will have cleaned up the node, entirely. Let's just note that +the prefix cannot be found if debugs are turned on and move on. + +Signed-off-by: Donald Sharp +--- + bgpd/bgp_zebra.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c +index efcf497850..ff79746b4c 100644 +--- a/bgpd/bgp_zebra.c ++++ b/bgpd/bgp_zebra.c +@@ -2610,8 +2610,12 @@ static int bgp_zebra_route_notify_owner(int command, struct zclient *zclient, + /* Find the bgp route node */ + dest = bgp_afi_node_lookup(bgp->rib[afi][safi], afi, safi, &p, + &bgp->vrf_prd); +- if (!dest) ++ if (!dest) { ++ if (BGP_DEBUG(zebra, ZEBRA)) ++ zlog_debug("%s: %pFX does not exist in the BGP table, nothing to do for %u", ++ __func__, &p, note); + return -1; ++ } + + switch (note) { + case ZAPI_ROUTE_INSTALLED: +-- +2.17.1 + + +From ada2e1099373e69e0eb29f4b1f3ba79c0cacf75a Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Thu, 28 Mar 2024 12:27:38 -0400 +Subject: [PATCH 2/2] bgpd: Arrange peer notification to after zebra announce + +Currently BGP attempts to send route change information +to it's peers *before* the route is installed into zebra. +This creates a bug in suppress-fib-pending in the following +scenario: + +a) bgp suppress-fib-pending and bgp has a route with +2 way ecmp. +b) bgp receives a route withdraw from peer 1. BGP +will send the route to zebra and mark the route as +FIB_INSTALL_PENDING. +c) bgp receives a route withdraw from peer 2. BGP +will see the route has the FIB_INSTALL_PENDING and +not send the withdrawal of the route to the peer. +bgp will then send the route deletion to zebra and +clean up the bgp_path_info's. + +At this point BGP is stuck where it has not sent +a route withdrawal to downstream peers. + +Let's modify the code in bgp_process_main_one to +send the route notification to zebra first before +attempting to announce the route. The route withdrawal +will remove the FIB_INSTALL_PENDING flag from the dest +and this will allow group_announce_route to believe +it can send the route withdrawal. + +For the master branch this is ok because the recent +backpressure commits are in place and nothing is going +to change from an ordering perspective in that regards. +Ostensibly this fix is also for operators of Sonic and +will be backported to the 8.5 branch as well. This will +change the order of the send to peers to be after the +zebra installation but sonic users are using suppress-fib-pending +anyways so updates won't go out until rib ack has been +received anyways. + +Signed-off-by: Donald Sharp +--- + bgpd/bgp_route.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c +index 2976042dda..fbff57634a 100644 +--- a/bgpd/bgp_route.c ++++ b/bgpd/bgp_route.c +@@ -3297,14 +3297,6 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest, + } + #endif + +- group_announce_route(bgp, afi, safi, dest, new_select); +- +- /* unicast routes must also be annouced to labeled-unicast update-groups +- */ +- if (safi == SAFI_UNICAST) +- group_announce_route(bgp, afi, SAFI_LABELED_UNICAST, dest, +- new_select); +- + /* FIB update. */ + if (bgp_fibupd_safi(safi) && (bgp->inst_type != BGP_INSTANCE_TYPE_VIEW) + && !bgp_option_check(BGP_OPT_NO_FIB)) { +@@ -3334,6 +3326,15 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_dest *dest, + } + } + ++ group_announce_route(bgp, afi, safi, dest, new_select); ++ ++ /* unicast routes must also be annouced to labeled-unicast update-groups ++ */ ++ if (safi == SAFI_UNICAST) ++ group_announce_route(bgp, afi, SAFI_LABELED_UNICAST, dest, ++ new_select); ++ ++ + bgp_process_evpn_route_injection(bgp, afi, safi, dest, new_select, + old_select); + +-- +2.17.1 + diff --git a/src/sonic-frr/patch/0026-zebra-Add-encap-type-when-building-packet-for-FPM.patch b/src/sonic-frr/patch/0026-zebra-Add-encap-type-when-building-packet-for-FPM.patch deleted file mode 100644 index 8d7cdc34f415..000000000000 --- a/src/sonic-frr/patch/0026-zebra-Add-encap-type-when-building-packet-for-FPM.patch +++ /dev/null @@ -1,50 +0,0 @@ -From b914b0ad506649b5d341b549a37d3cb73e72b494 Mon Sep 17 00:00:00 2001 -From: Stepan Blyschak -Date: Mon, 30 Oct 2023 14:31:45 +0200 -Subject: [PATCH] zebra: Add encap type when building packet for FPM - -Signed-off-by: Donald Sharp -Signed-off-by: Stepan Blyschak ---- - zebra/rt_netlink.c | 22 ++++++++++++---------- - 1 file changed, 12 insertions(+), 10 deletions(-) - -diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index 6b9b04785..71505e037 100644 ---- a/zebra/rt_netlink.c -+++ b/zebra/rt_netlink.c -@@ -2269,19 +2269,21 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, - p, routedesc, bytelen, nexthop, - &req->n, &req->r, datalen, cmd)) - return 0; -+ -+ /* -+ * Add encapsulation information when -+ * installing via FPM. -+ */ -+ if (fpm) { -+ if (!netlink_route_nexthop_encap(&req->n, -+ datalen, -+ nexthop)) -+ return 0; -+ } -+ - nexthop_num++; - break; - } -- -- /* -- * Add encapsulation information when installing via -- * FPM. -- */ -- if (fpm) { -- if (!netlink_route_nexthop_encap( -- &req->n, datalen, nexthop)) -- return 0; -- } - } - - if (setsrc) { --- -2.17.1 - diff --git a/src/sonic-frr/patch/0027-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch b/src/sonic-frr/patch/0027-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch new file mode 100644 index 000000000000..fd9ec4608dff --- /dev/null +++ b/src/sonic-frr/patch/0027-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch @@ -0,0 +1,77 @@ +From 37204cdc64999f8215deb99d4a5aa1a4222389af Mon Sep 17 00:00:00 2001 +From: Donatas Abraitis +Date: Thu, 15 Feb 2024 12:07:43 +0200 +Subject: [PATCH] lib: Do not convert EVPN prefixes into IPv4/IPv6 if not + needed + +Convert only when this is really needed, e.g. `match ip address prefix-list ...`. + +Otherwise, we can't have mixed match clauses, like: + +``` +match ip address prefix-list p1 +match evpn route-type prefix +``` + +This won't work, because the prefix is already converted, and we can't extract +route type, vni, etc. from the original EVPN prefix. + +Signed-off-by: Donatas Abraitis +(cherry picked from commit 439b739495e86912c8b9ec36b84e55311c549ba0) + +diff --git a/lib/routemap.c b/lib/routemap.c +index 683943eb6d..ed7c4ed72c 100644 +--- a/lib/routemap.c ++++ b/lib/routemap.c +@@ -2553,7 +2553,6 @@ route_map_result_t route_map_apply_ext(struct route_map *map, + struct route_map_index *index = NULL; + struct route_map_rule *set = NULL; + bool skip_match_clause = false; +- struct prefix conv; + + if (recursion > RMAP_RECURSION_LIMIT) { + flog_warn( +@@ -2571,27 +2570,14 @@ route_map_result_t route_map_apply_ext(struct route_map *map, + + map->applied++; + +- /* +- * Handling for matching evpn_routes in the prefix table. +- * +- * We convert type2/5 prefix to ipv4/6 prefix to do longest +- * prefix matching on. +- */ + if (prefix->family == AF_EVPN) { +- if (evpn_prefix2prefix(prefix, &conv) != 0) { +- zlog_debug( +- "Unable to convert EVPN prefix %pFX into IPv4/IPv6 prefix. Falling back to non-optimized route-map lookup", +- prefix); +- } else { +- zlog_debug( +- "Converted EVPN prefix %pFX into %pFX for optimized route-map lookup", +- prefix, &conv); +- +- prefix = &conv; +- } ++ index = map->head; ++ } else { ++ skip_match_clause = true; ++ index = route_map_get_index(map, prefix, match_object, ++ &match_ret); + } + +- index = route_map_get_index(map, prefix, match_object, &match_ret); + if (index) { + index->applied++; + if (rmap_debug) +@@ -2615,7 +2601,6 @@ route_map_result_t route_map_apply_ext(struct route_map *map, + ret = RMAP_DENYMATCH; + goto route_map_apply_end; + } +- skip_match_clause = true; + + for (; index; index = index->next) { + if (!skip_match_clause) { +-- +2.17.1 + diff --git a/src/sonic-frr/patch/0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch b/src/sonic-frr/patch/0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch deleted file mode 100644 index 7dbf3a85e738..000000000000 --- a/src/sonic-frr/patch/0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch +++ /dev/null @@ -1,112 +0,0 @@ -From fcc818160be57a1304481402c08962454e1dee5b Mon Sep 17 00:00:00 2001 -From: Donatas Abraitis -Date: Mon, 23 Oct 2023 23:34:10 +0300 -Subject: [PATCH 1/4] bgpd: Check mandatory attributes more carefully for - UPDATE message - -If we send a crafted BGP UPDATE message without mandatory attributes, we do -not check if the length of the path attributes is zero or not. We only check -if attr->flag is at least set or not. Imagine we send only unknown transit -attribute, then attr->flag is always 0. Also, this is true only if graceful-restart -capability is received. - -A crash: - -``` -bgpd[7834]: [TJ23Y-GY0RH] 127.0.0.1 Unknown attribute is received (type 31, length 16) -bgpd[7834]: [PCFFM-WMARW] 127.0.0.1(donatas-pc) rcvd UPDATE wlen 0 attrlen 20 alen 17 -BGP[7834]: Received signal 11 at 1698089639 (si_addr 0x0, PC 0x55eefd375b4a); aborting... -BGP[7834]: /usr/local/lib/libfrr.so.0(zlog_backtrace_sigsafe+0x6d) [0x7f3205ca939d] -BGP[7834]: /usr/local/lib/libfrr.so.0(zlog_signal+0xf3) [0x7f3205ca9593] -BGP[7834]: /usr/local/lib/libfrr.so.0(+0xf5181) [0x7f3205cdd181] -BGP[7834]: /lib/x86_64-linux-gnu/libpthread.so.0(+0x12980) [0x7f3204ff3980] -BGP[7834]: /usr/lib/frr/bgpd(+0x18ab4a) [0x55eefd375b4a] -BGP[7834]: /usr/local/lib/libfrr.so.0(route_map_apply_ext+0x310) [0x7f3205cd1290] -BGP[7834]: /usr/lib/frr/bgpd(+0x163610) [0x55eefd34e610] -BGP[7834]: /usr/lib/frr/bgpd(bgp_update+0x9a5) [0x55eefd35c1d5] -BGP[7834]: /usr/lib/frr/bgpd(bgp_nlri_parse_ip+0xb7) [0x55eefd35e867] -BGP[7834]: /usr/lib/frr/bgpd(+0x1555e6) [0x55eefd3405e6] -BGP[7834]: /usr/lib/frr/bgpd(bgp_process_packet+0x747) [0x55eefd345597] -BGP[7834]: /usr/local/lib/libfrr.so.0(event_call+0x83) [0x7f3205cef4a3] -BGP[7834]: /usr/local/lib/libfrr.so.0(frr_run+0xc0) [0x7f3205ca10a0] -BGP[7834]: /usr/lib/frr/bgpd(main+0x409) [0x55eefd2dc979] -``` - -Sending: - -``` -import socket -import time - -OPEN = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" -b"\xff\xff\x00\x62\x01\x04\xfd\xea\x00\x5a\x0a\x00\x00\x01\x45\x02" -b"\x06\x01\x04\x00\x01\x00\x01\x02\x02\x02\x00\x02\x02\x46\x00\x02" -b"\x06\x41\x04\x00\x00\xfd\xea\x02\x02\x06\x00\x02\x06\x45\x04\x00" -b"\x01\x01\x03\x02\x0e\x49\x0c\x0a\x64\x6f\x6e\x61\x74\x61\x73\x2d" -b"\x70\x63\x00\x02\x04\x40\x02\x00\x78\x02\x09\x47\x07\x00\x01\x01" -b"\x80\x00\x00\x00") - -KEEPALIVE = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" -b"\xff\xff\xff\xff\xff\xff\x00\x13\x04") - -UPDATE = bytearray.fromhex("ffffffffffffffffffffffffffffffff003c0200000014ff1f001000040146464646460004464646464646664646f50d05800100010200ffff000000") - -s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -s.connect(('127.0.0.2', 179)) -s.send(OPEN) -data = s.recv(1024) -s.send(KEEPALIVE) -data = s.recv(1024) -s.send(UPDATE) -data = s.recv(1024) -time.sleep(1000) -s.close() -``` - -Reported-by: Iggy Frankovic -Signed-off-by: Donatas Abraitis -(cherry picked from commit d8482bf011cb2b173e85b65b4bf3d5061250cdb9) - -diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c -index ee20da3326..3a2d93ccd9 100644 ---- a/bgpd/bgp_attr.c -+++ b/bgpd/bgp_attr.c -@@ -3429,13 +3429,15 @@ bgp_attr_unknown(struct bgp_attr_parser_args *args) - } - - /* Well-known attribute check. */ --static int bgp_attr_check(struct peer *peer, struct attr *attr) -+static int bgp_attr_check(struct peer *peer, struct attr *attr, -+ bgp_size_t length) - { - uint8_t type = 0; - - /* BGP Graceful-Restart End-of-RIB for IPv4 unicast is signaled as an - * empty UPDATE. */ -- if (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV) && !attr->flag) -+ if (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV) && !attr->flag && -+ !length) - return BGP_ATTR_PARSE_PROCEED; - - /* "An UPDATE message that contains the MP_UNREACH_NLRI is not required -@@ -3487,7 +3489,7 @@ enum bgp_attr_parse_ret bgp_attr_parse(struct peer *peer, struct attr *attr, - enum bgp_attr_parse_ret ret; - uint8_t flag = 0; - uint8_t type = 0; -- bgp_size_t length; -+ bgp_size_t length = 0; - uint8_t *startp, *endp; - uint8_t *attr_endp; - uint8_t seen[BGP_ATTR_BITMAP_SIZE]; -@@ -3812,7 +3814,7 @@ enum bgp_attr_parse_ret bgp_attr_parse(struct peer *peer, struct attr *attr, - } - - /* Check all mandatory well-known attributes are present */ -- ret = bgp_attr_check(peer, attr); -+ ret = bgp_attr_check(peer, attr, length); - if (ret < 0) - goto done; - --- -2.17.1 - diff --git a/src/sonic-frr/patch/0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch b/src/sonic-frr/patch/0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch deleted file mode 100644 index a1f848f12706..000000000000 --- a/src/sonic-frr/patch/0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 971f8684efceb2453accc5dcb5cbd8e4266c906d Mon Sep 17 00:00:00 2001 -From: Donatas Abraitis -Date: Fri, 20 Oct 2023 17:49:18 +0300 -Subject: [PATCH 2/4] bgpd: Handle MP_REACH_NLRI malformed packets with session - reset - -Avoid crashing bgpd. - -``` -(gdb) -bgp_mp_reach_parse (args=, mp_update=0x7fffffffe140) at bgpd/bgp_attr.c:2341 -2341 stream_get(&attr->mp_nexthop_global, s, IPV6_MAX_BYTELEN); -(gdb) -stream_get (dst=0x7fffffffe1ac, s=0x7ffff0006e80, size=16) at lib/stream.c:320 -320 { -(gdb) -321 STREAM_VERIFY_SANE(s); -(gdb) -323 if (STREAM_READABLE(s) < size) { -(gdb) -34 return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest)); -(gdb) - -Thread 1 "bgpd" received signal SIGSEGV, Segmentation fault. -0x00005555556e37be in route_set_aspath_prepend (rule=0x555555aac0d0, prefix=0x7fffffffe050, - object=0x7fffffffdb00) at bgpd/bgp_routemap.c:2282 -2282 if (path->attr->aspath->refcnt) -(gdb) -``` - -With the configuration: - -``` - neighbor 127.0.0.1 remote-as external - neighbor 127.0.0.1 passive - neighbor 127.0.0.1 ebgp-multihop - neighbor 127.0.0.1 disable-connected-check - neighbor 127.0.0.1 update-source 127.0.0.2 - neighbor 127.0.0.1 timers 3 90 - neighbor 127.0.0.1 timers connect 1 - address-family ipv4 unicast - redistribute connected - neighbor 127.0.0.1 default-originate - neighbor 127.0.0.1 route-map RM_IN in - exit-address-family -! -route-map RM_IN permit 10 - set as-path prepend 200 -exit -``` - -Reported-by: Iggy Frankovic -Signed-off-by: Donatas Abraitis -(cherry picked from commit b08afc81c60607a4f736f418f2e3eb06087f1a35) - -diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c -index 3a2d93ccd9..a3fee07058 100644 ---- a/bgpd/bgp_attr.c -+++ b/bgpd/bgp_attr.c -@@ -2418,7 +2418,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args, - - mp_update->afi = afi; - mp_update->safi = safi; -- return BGP_ATTR_PARSE_EOR; -+ return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_MAL_ATTR, 0); - } - - mp_update->afi = afi; -@@ -3739,10 +3739,6 @@ enum bgp_attr_parse_ret bgp_attr_parse(struct peer *peer, struct attr *attr, - goto done; - } - -- if (ret == BGP_ATTR_PARSE_EOR) { -- goto done; -- } -- - if (ret == BGP_ATTR_PARSE_ERROR) { - flog_warn(EC_BGP_ATTRIBUTE_PARSE_ERROR, - "%s: Attribute %s, parse error", peer->host, -diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h -index 33283f4bf6..ba8d4fc735 100644 ---- a/bgpd/bgp_attr.h -+++ b/bgpd/bgp_attr.h -@@ -379,7 +379,6 @@ enum bgp_attr_parse_ret { - /* only used internally, send notify + convert to BGP_ATTR_PARSE_ERROR - */ - BGP_ATTR_PARSE_ERROR_NOTIFYPLS = -3, -- BGP_ATTR_PARSE_EOR = -4, - }; - - struct bpacket_attr_vec_arr; -diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c -index a02d548941..5e0312a72d 100644 ---- a/bgpd/bgp_packet.c -+++ b/bgpd/bgp_packet.c -@@ -2060,8 +2060,7 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size) - * Non-MP IPv4/Unicast EoR is a completely empty UPDATE - * and MP EoR should have only an empty MP_UNREACH - */ -- if ((!update_len && !withdraw_len && nlris[NLRI_MP_UPDATE].length == 0) -- || (attr_parse_ret == BGP_ATTR_PARSE_EOR)) { -+ if (!update_len && !withdraw_len && nlris[NLRI_MP_UPDATE].length == 0) { - afi_t afi = 0; - safi_t safi; - struct graceful_restart_info *gr_info; -@@ -2082,9 +2081,6 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size) - && nlris[NLRI_MP_WITHDRAW].length == 0) { - afi = nlris[NLRI_MP_WITHDRAW].afi; - safi = nlris[NLRI_MP_WITHDRAW].safi; -- } else if (attr_parse_ret == BGP_ATTR_PARSE_EOR) { -- afi = nlris[NLRI_MP_UPDATE].afi; -- safi = nlris[NLRI_MP_UPDATE].safi; - } - - if (afi && peer->afc[afi][safi]) { --- -2.17.1 - diff --git a/src/sonic-frr/patch/0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch b/src/sonic-frr/patch/0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch deleted file mode 100644 index 4639e8c87cd4..000000000000 --- a/src/sonic-frr/patch/0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 621f2efd64b305e96bb2941110e93bfbe5f9eda2 Mon Sep 17 00:00:00 2001 -From: Donatas Abraitis -Date: Fri, 27 Oct 2023 11:56:45 +0300 -Subject: [PATCH 3/4] bgpd: Treat EOR as withdrawn to avoid unwanted handling - of malformed attrs - -Treat-as-withdraw, otherwise if we just ignore it, we will pass it to be -processed as a normal UPDATE without mandatory attributes, that could lead -to harmful behavior. In this case, a crash for route-maps with the configuration -such as: - -``` -router bgp 65001 - no bgp ebgp-requires-policy - neighbor 127.0.0.1 remote-as external - neighbor 127.0.0.1 passive - neighbor 127.0.0.1 ebgp-multihop - neighbor 127.0.0.1 disable-connected-check - neighbor 127.0.0.1 update-source 127.0.0.2 - neighbor 127.0.0.1 timers 3 90 - neighbor 127.0.0.1 timers connect 1 - ! - address-family ipv4 unicast - neighbor 127.0.0.1 addpath-tx-all-paths - neighbor 127.0.0.1 default-originate - neighbor 127.0.0.1 route-map RM_IN in - exit-address-family -exit -! -route-map RM_IN permit 10 - set as-path prepend 200 -exit -``` - -Send a malformed optional transitive attribute: - -``` -import socket -import time - -OPEN = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" -b"\xff\xff\x00\x62\x01\x04\xfd\xea\x00\x5a\x0a\x00\x00\x01\x45\x02" -b"\x06\x01\x04\x00\x01\x00\x01\x02\x02\x02\x00\x02\x02\x46\x00\x02" -b"\x06\x41\x04\x00\x00\xfd\xea\x02\x02\x06\x00\x02\x06\x45\x04\x00" -b"\x01\x01\x03\x02\x0e\x49\x0c\x0a\x64\x6f\x6e\x61\x74\x61\x73\x2d" -b"\x70\x63\x00\x02\x04\x40\x02\x00\x78\x02\x09\x47\x07\x00\x01\x01" -b"\x80\x00\x00\x00") - -KEEPALIVE = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" -b"\xff\xff\xff\xff\xff\xff\x00\x13\x04") - -UPDATE = bytearray.fromhex("ffffffffffffffffffffffffffffffff002b0200000003c0ff00010100eb00ac100b0b001ad908ac100b0b") - -s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -s.connect(('127.0.0.2', 179)) -s.send(OPEN) -data = s.recv(1024) -s.send(KEEPALIVE) -data = s.recv(1024) -s.send(UPDATE) -data = s.recv(1024) -time.sleep(100) -s.close() -``` - -Reported-by: Iggy Frankovic -Signed-off-by: Donatas Abraitis - -diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c -index a3fee07058..bdf078e7c8 100644 ---- a/bgpd/bgp_attr.c -+++ b/bgpd/bgp_attr.c -@@ -3435,10 +3435,13 @@ static int bgp_attr_check(struct peer *peer, struct attr *attr, - uint8_t type = 0; - - /* BGP Graceful-Restart End-of-RIB for IPv4 unicast is signaled as an -- * empty UPDATE. */ -+ * empty UPDATE. Treat-as-withdraw, otherwise if we just ignore it, -+ * we will pass it to be processed as a normal UPDATE without mandatory -+ * attributes, that could lead to harmful behavior. -+ */ - if (CHECK_FLAG(peer->cap, PEER_CAP_RESTART_RCV) && !attr->flag && - !length) -- return BGP_ATTR_PARSE_PROCEED; -+ return BGP_ATTR_PARSE_WITHDRAW; - - /* "An UPDATE message that contains the MP_UNREACH_NLRI is not required - to carry any other path attributes.", though if MP_REACH_NLRI or NLRI -@@ -3866,7 +3869,13 @@ done: - aspath_unintern(&as4_path); - - transit = bgp_attr_get_transit(attr); -- if (ret != BGP_ATTR_PARSE_ERROR) { -+ /* If we received an UPDATE with mandatory attributes, then -+ * the unrecognized transitive optional attribute of that -+ * path MUST be passed. Otherwise, it's an error, and from -+ * security perspective it might be very harmful if we continue -+ * here with the unrecognized attributes. -+ */ -+ if (ret == BGP_ATTR_PARSE_PROCEED) { - /* Finally intern unknown attribute. */ - if (transit) - bgp_attr_set_transit(attr, transit_intern(transit)); --- -2.17.1 - diff --git a/src/sonic-frr/patch/0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch b/src/sonic-frr/patch/0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch deleted file mode 100644 index 12f1d909509f..000000000000 --- a/src/sonic-frr/patch/0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 4f75184ed110ffb002b0125797e0395cfa6e9ce8 Mon Sep 17 00:00:00 2001 -From: Donatas Abraitis -Date: Sun, 29 Oct 2023 22:44:45 +0200 -Subject: [PATCH 4/4] bgpd: Ignore handling NLRIs if we received - MP_UNREACH_NLRI - -If we receive MP_UNREACH_NLRI, we should stop handling remaining NLRIs if -no mandatory path attributes received. - -In other words, if MP_UNREACH_NLRI received, the remaining NLRIs should be handled -as a new data, but without mandatory attributes, it's a malformed packet. - -In normal case, this MUST not happen at all, but to avoid crashing bgpd, we MUST -handle that. - -Reported-by: Iggy Frankovic -Signed-off-by: Donatas Abraitis - -diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c -index bdf078e7c8..43a3cc91af 100644 ---- a/bgpd/bgp_attr.c -+++ b/bgpd/bgp_attr.c -@@ -3443,15 +3443,6 @@ static int bgp_attr_check(struct peer *peer, struct attr *attr, - !length) - return BGP_ATTR_PARSE_WITHDRAW; - -- /* "An UPDATE message that contains the MP_UNREACH_NLRI is not required -- to carry any other path attributes.", though if MP_REACH_NLRI or NLRI -- are present, it should. Check for any other attribute being present -- instead. -- */ -- if ((!CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI)) && -- CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MP_UNREACH_NLRI)))) -- return BGP_ATTR_PARSE_PROCEED; -- - if (!CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_ORIGIN))) - type = BGP_ATTR_ORIGIN; - -@@ -3470,6 +3461,16 @@ static int bgp_attr_check(struct peer *peer, struct attr *attr, - && !CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF))) - type = BGP_ATTR_LOCAL_PREF; - -+ /* An UPDATE message that contains the MP_UNREACH_NLRI is not required -+ * to carry any other path attributes. Though if MP_REACH_NLRI or NLRI -+ * are present, it should. Check for any other attribute being present -+ * instead. -+ */ -+ if (!CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MP_REACH_NLRI)) && -+ CHECK_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_MP_UNREACH_NLRI))) -+ return type ? BGP_ATTR_PARSE_MISSING_MANDATORY -+ : BGP_ATTR_PARSE_PROCEED; -+ - /* If any of the well-known mandatory attributes are not present - * in an UPDATE message, then "treat-as-withdraw" MUST be used. - */ -diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h -index ba8d4fc735..275965fe62 100644 ---- a/bgpd/bgp_attr.h -+++ b/bgpd/bgp_attr.h -@@ -379,6 +379,7 @@ enum bgp_attr_parse_ret { - /* only used internally, send notify + convert to BGP_ATTR_PARSE_ERROR - */ - BGP_ATTR_PARSE_ERROR_NOTIFYPLS = -3, -+ BGP_ATTR_PARSE_MISSING_MANDATORY = -4, - }; - - struct bpacket_attr_vec_arr; -diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c -index 5e0312a72d..59f895ac58 100644 ---- a/bgpd/bgp_packet.c -+++ b/bgpd/bgp_packet.c -@@ -1983,7 +1983,12 @@ static int bgp_update_receive(struct peer *peer, bgp_size_t size) - /* Network Layer Reachability Information. */ - update_len = end - stream_pnt(s); - -- if (update_len && attribute_len) { -+ /* If we received MP_UNREACH_NLRI attribute, but also NLRIs, then -+ * NLRIs should be handled as a new data. Though, if we received -+ * NLRIs without mandatory attributes, they should be ignored. -+ */ -+ if (update_len && attribute_len && -+ attr_parse_ret != BGP_ATTR_PARSE_MISSING_MANDATORY) { - /* Set NLRI portion to structure. */ - nlris[NLRI_UPDATE].afi = AFI_IP; - nlris[NLRI_UPDATE].safi = SAFI_UNICAST; --- -2.17.1 - diff --git a/src/sonic-frr/patch/0032-zebra-Fix-fpm-multipath-encap-addition.patch b/src/sonic-frr/patch/0032-zebra-Fix-fpm-multipath-encap-addition.patch deleted file mode 100644 index 5e3ce1441206..000000000000 --- a/src/sonic-frr/patch/0032-zebra-Fix-fpm-multipath-encap-addition.patch +++ /dev/null @@ -1,58 +0,0 @@ -From b7ac2397103fe7d347d0766bd9966ff2302403c5 Mon Sep 17 00:00:00 2001 -From: dgsudharsan -Date: Tue, 21 Nov 2023 01:17:24 +0000 -Subject: [PATCH] zebra: Fix fpm multipath encap addition The fpm code path in - building a ecmp route for evpn has a bug that caused it to not add the encap - attribute to the netlink message. See - #f0f7b285b99dbd971400d33feea007232c0bd4a9 for the single path case being - fixed. - - -diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c -index 71505e037a..6bdc15592c 100644 ---- a/zebra/rt_netlink.c -+++ b/zebra/rt_netlink.c -@@ -2330,6 +2330,16 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, - tag)) - return 0; - -+ /* -+ * Add encapsulation information when installing via -+ * FPM. -+ */ -+ if (fpm) { -+ if (!netlink_route_nexthop_encap( -+ &req->n, datalen, nexthop)) -+ return 0; -+ } -+ - if (!setsrc && src1) { - if (p->family == AF_INET) - src.ipv4 = src1->ipv4; -@@ -2343,23 +2353,6 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, - - nl_attr_nest_end(&req->n, nest); - -- /* -- * Add encapsulation information when installing via -- * FPM. -- */ -- if (fpm) { -- for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx), -- nexthop)) { -- if (CHECK_FLAG(nexthop->flags, -- NEXTHOP_FLAG_RECURSIVE)) -- continue; -- if (!netlink_route_nexthop_encap( -- &req->n, datalen, nexthop)) -- return 0; -- } -- } -- -- - if (setsrc) { - if (p->family == AF_INET) { - if (!nl_attr_put(&req->n, datalen, RTA_PREFSRC, --- -2.17.1 - diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index bcb29008824f..9874e27aea8a 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -4,8 +4,6 @@ 0004-frr-remove-frr-log-outchannel-to-var-log-frr.log.patch 0005-Add-support-of-bgp-l3vni-evpn.patch 0006-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch -Disable-ipv6-src-address-test-in-pceplib.patch -cross-compile-changes.patch 0007-ignore-route-from-default-table.patch 0008-Use-vrf_id-for-vrf-not-tabled_id.patch 0009-bgpd-Ensure-suppress-fib-pending-works-with-network-.patch @@ -18,18 +16,12 @@ cross-compile-changes.patch 0016-zebra-Remove-duplicate-function-for-netlink-interfac.patch 0017-zebra-Add-code-to-get-set-interface-to-pass-up-from-.patch 0018-zebra-Use-zebra-dplane-for-RTM-link-and-addr.patch -0019-zebra-Abstract-dplane_ctx_route_init-to-init-route-w.patch -0020-zebra-Fix-crash-when-dplane_fpm_nl-fails-to-process-.patch -0021-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch -0022-bgpd-Don-t-read-the-first-byte-of-ORF-header-if-we-a.patch -0023-bgpd-Make-sure-we-have-enough-data-to-read-two-bytes.patch -0024-bgpd-Do-not-process-NLRIs-if-the-attribute-length-is.patch -0025-bgpd-Use-treat-as-withdraw-for-tunnel-encapsulation-.patch -0026-zebra-Add-encap-type-when-building-packet-for-FPM.patch -0027-zebra-Fix-non-notification-of-better-admin-won.patch -0028-bgpd-Check-mandatory-attributes-more-carefully-for-U.patch -0029-bgpd-Handle-MP_REACH_NLRI-malformed-packets-with-ses.patch -0030-bgpd-Treat-EOR-as-withdrawn-to-avoid-unwanted-handli.patch -0031-bgpd-Ignore-handling-NLRIs-if-we-received-MP_UNREACH.patch -0032-zebra-Fix-fpm-multipath-encap-addition.patch -0033-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch +0019-zebra-remove-duplicated-nexthops-when-sending-fpm-msg.patch +0020-zebra-Fix-non-notification-of-better-admin-won.patch +0021-Disable-ipv6-src-address-test-in-pceplib.patch +0022-cross-compile-changes.patch +0023-zebra-The-dplane_fpm_nl-return-path-leaks-memory.patch +0024-lib-use-snmp-s-large-fd-sets-for-agentx.patch +0025-bgp-community-memory-leak-fix.patch +0026-bgp-fib-suppress-announce-fix.patch +0027-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch From 26e8b63bf189ddbfc583025d8683ea2d49e23e73 Mon Sep 17 00:00:00 2001 From: krismarvell <108510436+krismarvell@users.noreply.github.com> Date: Tue, 30 Apr 2024 02:05:04 +0530 Subject: [PATCH 019/282] [devices]: Add Marvell platform support for dbmvt9180 (#18089) This change adds new platform support for marvell dbmvt9180 board. --- .gitmodules | 3 + .../dbmvtx9180_64x100G/buffers.json.j2 | 162 ++++ .../buffers_defaults_def_lossy.j2 | 42 + .../dbmvtx9180_64x100G/buffers_defaults_t1.j2 | 162 ++++ .../config_teralynx_MVTX9180_64x100G.yaml | 773 ++++++++++++++++++ .../dbmvtx9180_64x100G/ivm.sai.config.yaml | 8 + .../ivm.sai.datapath.config.yaml | 11 + .../dbmvtx9180_64x100G/pg_profile_lookup.ini | 26 + .../dbmvtx9180_64x100G/port_config.ini | 65 ++ .../dbmvtx9180_64x100G/qos.json.j2 | 192 +++++ .../qos_defaults_def_lossy.j2 | 121 +++ .../dbmvtx9180_64x100G/qos_defaults_t1.j2 | 192 +++++ .../dbmvtx9180_64x100G/sai.profile | 1 + .../dbmvtx9180_64x100G/teralynx.MVTX9180 | 170 ++++ .../x86_64-marvell_dbmvtx9180-r0/default_sku | 1 + .../installer.conf | 4 + .../platform_asic | 1 + .../plugins/eeprom.py | 26 + .../plugins/psuutil.py | 59 ++ .../plugins/sfputil.py | 186 +++++ .../pmon_daemon_control.json | 6 + .../x86_64-marvell_dbmvtx9180-r0/topo.conf | 1 + platform/innovium/one-image.mk | 1 + platform/innovium/platform-modules-marvell.mk | 13 + platform/innovium/rules.mk | 3 +- platform/innovium/sonic-platform-marvell | 1 + 26 files changed, 2228 insertions(+), 2 deletions(-) create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers.json.j2 create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers_defaults_def_lossy.j2 create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers_defaults_t1.j2 create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/config_teralynx_MVTX9180_64x100G.yaml create mode 100755 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/ivm.sai.config.yaml create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/ivm.sai.datapath.config.yaml create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/pg_profile_lookup.ini create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/port_config.ini create mode 100755 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos.json.j2 create mode 100755 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos_defaults_def_lossy.j2 create mode 100755 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos_defaults_t1.j2 create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/sai.profile create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/teralynx.MVTX9180 create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/default_sku create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/installer.conf create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/platform_asic create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/eeprom.py create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/psuutil.py create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/sfputil.py create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/pmon_daemon_control.json create mode 100644 device/marvell/x86_64-marvell_dbmvtx9180-r0/topo.conf create mode 100644 platform/innovium/platform-modules-marvell.mk create mode 160000 platform/innovium/sonic-platform-marvell diff --git a/.gitmodules b/.gitmodules index 71cfffa1b6c1..9013bdb67021 100644 --- a/.gitmodules +++ b/.gitmodules @@ -121,3 +121,6 @@ [submodule "platform/marvell/sonic-platform-marvell"] path = platform/marvell/sonic-platform-marvell url = https://github.com/Marvell-switching/sonic-platform-arm64.git +[submodule "platform/innovium/sonic-platform-marvell"] + path = platform/innovium/sonic-platform-marvell + url = https://github.com/Marvell-switching/sonic-platform-marvell diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers.json.j2 b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers.json.j2 new file mode 100644 index 000000000000..4a2d7a65c2d0 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers.json.j2 @@ -0,0 +1,162 @@ +{# Default values which will be used if no actual configuration available #} +{% set default_cable = '40m' %} + +{# 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 is defined and 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 %} + {%- if switch_role.lower() == 'torrouter' %} + {%- for local_port in VLAN_MEMBER %} + {%- if local_port[1] == port_name %} + {%- set roles3 = switch_role + '_' + 'server' %} + {%- set roles3 = roles3 | lower %} + {%- if roles3 in ports2cable %} + {%- if cable_len.append(ports2cable[roles3]) %}{% endif %} + {%- endif %} + {%- endif %} + {%- endfor %} + {%- if cable_len -%} + {{ cable_len.0 }} + {%- else -%} + {{ default_cable }} + {%- endif %} + {%- else -%} + {{ default_cable }} + {%- endif %} + {%- endif %} +{%- endmacro %} + +{%- if DEVICE_METADATA is defined %} +{%- set switch_role = DEVICE_METADATA['localhost']['type'] %} +{%- 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 %} + } + }, + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "158630302", + "type": "ingress", + "mode": "dynamic", + "xoff": "71577600" + }, + "lossy_pool": { + "size": "56012386", + "type": "egress", + "mode": "dynamic", + "xoff": "0" + }, + "egress_lossless_pool": { + "size": "214642688", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"ingress_lossless_pool", + "xoff":"135520", + "size":"1518", + "dynamic_th":"1", + "xon_offset":"9408" + }, + "egress_lossless_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "static_th":"22798336" + }, + "ingress_lossy_profile": { + "pool":"lossy_pool", + "size":"0", + "static_th":"22798336" + }, + "egress_lossy_profile": { + "pool":"lossy_pool", + "size":"1518", + "dynamic_th":"2" + } + }, + "BUFFER_PG": { +{% for port in port_names_list %} + "{{ port }}|3-4": { + "profile" : "ingress_lossless_profile" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|0": { + "profile" : "ingress_lossy_profile" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|1-2": { + "profile" : "ingress_lossy_profile" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|5-7": { + "profile" : "ingress_lossy_profile" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + + "BUFFER_QUEUE": { +{% for port in port_names_list %} + "{{ port }}|3-4": { + "profile" : "egress_lossless_profile" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|0-2": { + "profile" : "egress_lossy_profile" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|5-7": { + "profile" : "egress_lossy_profile" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +} diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers_defaults_def_lossy.j2 b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers_defaults_def_lossy.j2 new file mode 100644 index 000000000000..336cb86a9834 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers_defaults_def_lossy.j2 @@ -0,0 +1,42 @@ +{% set port_names_list = [] %} +{% for port in PORT %} + {%- if port_names_list.append(port) %}{% endif %} +{% endfor %} +{% set port_names = port_names_list | join(',') -%} + +{ + "BUFFER_POOL": { + "lossy_pool": { + "size": "182386688", + "type": "egress", + "mode": "dynamic", + "xoff": "0" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"lossy_pool", + "size":"0", + "static_th":"22798336" + }, + "egress_lossy_profile": { + "pool":"lossy_pool", + "size":"1518", + "dynamic_th":"2" + } + }, + "BUFFER_PG": { +{% for port in port_names_list %} + "{{ port }}|0-7": { + "profile" : "ingress_lossy_profile" + }{% if not loop.last %},{% endif %} +{% endfor %} + }, + "BUFFER_QUEUE": { +{% for port in port_names_list %} + "{{ port }}|0-7": { + "profile" : "egress_lossy_profile" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +} diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers_defaults_t1.j2 b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..34e182d40c36 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/buffers_defaults_t1.j2 @@ -0,0 +1,162 @@ +{# Default values which will be used if no actual configuration available #} +{% set default_cable = '40m' %} + +{# 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 is defined and 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 %} + {%- if switch_role.lower() == 'torrouter' %} + {%- for local_port in VLAN_MEMBER %} + {%- if local_port[1] == port_name %} + {%- set roles3 = switch_role + '_' + 'server' %} + {%- set roles3 = roles3 | lower %} + {%- if roles3 in ports2cable %} + {%- if cable_len.append(ports2cable[roles3]) %}{% endif %} + {%- endif %} + {%- endif %} + {%- endfor %} + {%- if cable_len -%} + {{ cable_len.0 }} + {%- else -%} + {{ default_cable }} + {%- endif %} + {%- else -%} + {{ default_cable }} + {%- endif %} + {%- endif %} +{%- endmacro %} + +{%- if DEVICE_METADATA is defined %} +{%- set switch_role = DEVICE_METADATA['localhost']['type'] %} +{%- 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 %} + } + }, + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "158630302", + "type": "ingress", + "mode": "dynamic", + "xoff": "71577600" + }, + "lossy_pool": { + "size": "56012386", + "type": "egress", + "mode": "dynamic", + "xoff": "0" + }, + "egress_lossless_pool": { + "size": "214642688", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"ingress_lossless_pool", + "xoff":"135520", + "size":"1518", + "dynamic_th":"1", + "xon_offset":"9408" + }, + "egress_lossless_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "static_th":"22798336" + }, + "ingress_lossy_profile": { + "pool":"lossy_pool", + "size":"0", + "static_th":"22798336" + }, + "egress_lossy_profile": { + "pool":"lossy_pool", + "size":"1518", + "dynamic_th":"2" + } + }, + "BUFFER_PG": { +{% for port in port_names_list %} + "{{ port }}|3-4": { + "profile" : "ingress_lossless_profile" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|0": { + "profile" : "ingress_lossy_profile" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|1-2": { + "profile" : "ingress_lossy_profile" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|5-7": { + "profile" : "ingress_lossy_profile" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + + "BUFFER_QUEUE": { +{% for port in port_names_list %} + "{{ port }}|3-4": { + "profile" : "egress_lossless_profile" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|0-2": { + "profile" : "egress_lossy_profile" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|5-7": { + "profile" : "egress_lossy_profile" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +} diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/config_teralynx_MVTX9180_64x100G.yaml b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/config_teralynx_MVTX9180_64x100G.yaml new file mode 100644 index 000000000000..1abf66695d30 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/config_teralynx_MVTX9180_64x100G.yaml @@ -0,0 +1,773 @@ +ifcs: + options: + log_level: "error" +nodes: +- node_id: "0" + options: + sku: "configs/sku/teralynx.MVTX9180" + netdev: + - auto_create: "no" + multi_interface: "yes" + buffer_management_mode: "api_driven" + pt01: "256" + wred_cr_ip_proto_list: "17" + cr_assignment_mode: "1" + max_lossless_tc: "2" + ilpm_enable: "1" + forward_profile: "IFCS_FORWARD_PROFILE_ID_PROFILE_E" + led_cfg_sck_rate: "0x5" + led_refresh_precliff_timer: "0x18eec2" + led_refresh_cliff_timer: "0x15e" + led_cfg_pic_stream_mode: "1" + led_refresh_tmr_ctl_enable: "1" + skip_pll_check: "false" + sys_clk: "1800" + ifc_clk: "1800" + mac_clk: "1600" + txring: + - txring_id: "0" + desc_count: "1024" + prio: "1" + netdev: "true" + - txring_id: "1" + desc_count: "1024" + prio: "1" + netdev: "true" + - txring_id: "2" + desc_count: "1024" + prio: "1" + netdev: "true" + - txring_id: "3" + desc_count: "1024" + prio: "1" + netdev: "true" + rxring: + - rxring_id: "0" + desc_count: "1024" + prio: "1" + netdev: "true" + queues: "0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44" + - rxring_id: "1" + desc_count: "1024" + prio: "1" + netdev: "true" + queues: "1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45" + - rxring_id: "2" + desc_count: "1024" + prio: "1" + netdev: "true" + queues: "2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46" + - rxring_id: "3" + desc_count: "1024" + prio: "1" + netdev: "true" + queues: "3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47" + devports: + - id: "0" + sysport: "1000" + type: "cpu" + - fec: "KPFEC" + id: "489" + lanes: "0:4" + serdes_group: "61" + speed: "100G" + sysport: "489" + type: "eth" + - fec: "KPFEC" + id: "505" + lanes: "0:4" + serdes_group: "63" + speed: "100G" + sysport: "505" + type: "eth" + - fec: "KPFEC" + id: "441" + lanes: "0:4" + serdes_group: "55" + speed: "100G" + sysport: "441" + type: "eth" + - fec: "KPFEC" + id: "425" + lanes: "0:4" + serdes_group: "53" + speed: "100G" + sysport: "425" + type: "eth" + - fec: "KPFEC" + id: "41" + lanes: "0:4" + serdes_group: "5" + speed: "100G" + sysport: "41" + type: "eth" + - fec: "KPFEC" + id: "49" + lanes: "0:4" + serdes_group: "6" + speed: "100G" + sysport: "49" + type: "eth" + - fec: "KPFEC" + id: "153" + lanes: "0:4" + serdes_group: "19" + speed: "100G" + sysport: "153" + type: "eth" + - fec: "KPFEC" + id: "137" + lanes: "0:4" + serdes_group: "17" + speed: "100G" + sysport: "137" + type: "eth" + - fec: "KPFEC" + id: "1" + lanes: "0:4" + serdes_group: "0" + speed: "100G" + sysport: "1" + type: "eth" + - fec: "KPFEC" + id: "17" + lanes: "0:4" + serdes_group: "2" + speed: "100G" + sysport: "17" + type: "eth" + - fec: "KPFEC" + id: "81" + lanes: "0:4" + serdes_group: "10" + speed: "100G" + sysport: "81" + type: "eth" + - fec: "KPFEC" + id: "65" + lanes: "0:4" + serdes_group: "8" + speed: "100G" + sysport: "65" + type: "eth" + - fec: "KPFEC" + id: "97" + lanes: "0:4" + serdes_group: "12" + speed: "100G" + sysport: "97" + type: "eth" + - fec: "KPFEC" + id: "113" + lanes: "0:4" + serdes_group: "14" + speed: "100G" + sysport: "113" + type: "eth" + - fec: "KPFEC" + id: "193" + lanes: "0:4" + serdes_group: "24" + speed: "100G" + sysport: "193" + type: "eth" + - fec: "KPFEC" + id: "177" + lanes: "0:4" + serdes_group: "22" + speed: "100G" + sysport: "177" + type: "eth" + - fec: "KPFEC" + id: "33" + lanes: "0:4" + serdes_group: "4" + speed: "100G" + sysport: "33" + type: "eth" + - fec: "KPFEC" + id: "57" + lanes: "0:4" + serdes_group: "7" + speed: "100G" + sysport: "57" + type: "eth" + - fec: "KPFEC" + id: "161" + lanes: "0:4" + serdes_group: "20" + speed: "100G" + sysport: "161" + type: "eth" + - fec: "KPFEC" + id: "129" + lanes: "0:4" + serdes_group: "16" + speed: "100G" + sysport: "129" + type: "eth" + - fec: "KPFEC" + id: "217" + lanes: "0:4" + serdes_group: "27" + speed: "100G" + sysport: "217" + type: "eth" + - fec: "KPFEC" + id: "241" + lanes: "0:4" + serdes_group: "30" + speed: "100G" + sysport: "241" + type: "eth" + - fec: "KPFEC" + id: "233" + lanes: "0:4" + serdes_group: "29" + speed: "100G" + sysport: "233" + type: "eth" + - fec: "KPFEC" + id: "209" + lanes: "0:4" + serdes_group: "26" + speed: "100G" + sysport: "209" + type: "eth" + - fec: "KPFEC" + id: "105" + lanes: "0:4" + serdes_group: "13" + speed: "100G" + sysport: "105" + type: "eth" + - fec: "KPFEC" + id: "121" + lanes: "0:4" + serdes_group: "15" + speed: "100G" + sysport: "121" + type: "eth" + - fec: "KPFEC" + id: "169" + lanes: "0:4" + serdes_group: "21" + speed: "100G" + sysport: "169" + type: "eth" + - fec: "KPFEC" + id: "145" + lanes: "0:4" + serdes_group: "18" + speed: "100G" + sysport: "145" + type: "eth" + - fec: "KPFEC" + id: "265" + lanes: "0:4" + serdes_group: "33" + speed: "100G" + sysport: "265" + type: "eth" + - fec: "KPFEC" + id: "289" + lanes: "0:4" + serdes_group: "36" + speed: "100G" + sysport: "289" + type: "eth" + - fec: "KPFEC" + id: "297" + lanes: "0:4" + serdes_group: "37" + speed: "100G" + sysport: "297" + type: "eth" + - fec: "KPFEC" + id: "273" + lanes: "0:4" + serdes_group: "34" + speed: "100G" + sysport: "273" + type: "eth" + - fec: "KPFEC" + id: "225" + lanes: "0:4" + serdes_group: "28" + speed: "100G" + sysport: "225" + type: "eth" + - fec: "KPFEC" + id: "249" + lanes: "0:4" + serdes_group: "31" + speed: "100G" + sysport: "249" + type: "eth" + - fec: "KPFEC" + id: "201" + lanes: "0:4" + serdes_group: "25" + speed: "100G" + sysport: "201" + type: "eth" + - fec: "KPFEC" + id: "185" + lanes: "0:4" + serdes_group: "23" + speed: "100G" + sysport: "185" + type: "eth" + - fec: "KPFEC" + id: "393" + lanes: "0:4" + serdes_group: "49" + speed: "100G" + sysport: "393" + type: "eth" + - fec: "KPFEC" + id: "409" + lanes: "0:4" + serdes_group: "51" + speed: "100G" + sysport: "409" + type: "eth" + - fec: "KPFEC" + id: "329" + lanes: "0:4" + serdes_group: "41" + speed: "100G" + sysport: "329" + type: "eth" + - fec: "KPFEC" + id: "313" + lanes: "0:4" + serdes_group: "39" + speed: "100G" + sysport: "313" + type: "eth" + - fec: "KPFEC" + id: "257" + lanes: "0:4" + serdes_group: "32" + speed: "100G" + sysport: "257" + type: "eth" + - fec: "KPFEC" + id: "281" + lanes: "0:4" + serdes_group: "35" + speed: "100G" + sysport: "281" + type: "eth" + - fec: "KPFEC" + id: "321" + lanes: "0:4" + serdes_group: "40" + speed: "100G" + sysport: "321" + type: "eth" + - fec: "KPFEC" + id: "305" + lanes: "0:4" + serdes_group: "38" + speed: "100G" + sysport: "305" + type: "eth" + - fec: "KPFEC" + id: "457" + lanes: "0:4" + serdes_group: "57" + speed: "100G" + sysport: "457" + type: "eth" + - fec: "KPFEC" + id: "465" + lanes: "0:4" + serdes_group: "58" + speed: "100G" + sysport: "465" + type: "eth" + - fec: "KPFEC" + id: "369" + lanes: "0:4" + serdes_group: "46" + speed: "100G" + sysport: "369" + type: "eth" + - fec: "KPFEC" + id: "353" + lanes: "0:4" + serdes_group: "44" + speed: "100G" + sysport: "353" + type: "eth" + - fec: "KPFEC" + id: "385" + lanes: "0:4" + serdes_group: "48" + speed: "100G" + sysport: "385" + type: "eth" + - fec: "KPFEC" + id: "401" + lanes: "0:4" + serdes_group: "50" + speed: "100G" + sysport: "401" + type: "eth" + - fec: "KPFEC" + id: "361" + lanes: "0:4" + serdes_group: "45" + speed: "100G" + sysport: "361" + type: "eth" + - fec: "KPFEC" + id: "337" + lanes: "0:4" + serdes_group: "42" + speed: "100G" + sysport: "337" + type: "eth" + - fec: "KPFEC" + id: "481" + lanes: "0:4" + serdes_group: "60" + speed: "100G" + sysport: "481" + type: "eth" + - fec: "KPFEC" + id: "497" + lanes: "0:4" + serdes_group: "62" + speed: "100G" + sysport: "497" + type: "eth" + - fec: "KPFEC" + id: "433" + lanes: "0:4" + serdes_group: "54" + speed: "100G" + sysport: "433" + type: "eth" + - fec: "KPFEC" + id: "417" + lanes: "0:4" + serdes_group: "52" + speed: "100G" + sysport: "417" + type: "eth" + - fec: "KPFEC" + id: "449" + lanes: "0:4" + serdes_group: "56" + speed: "100G" + sysport: "449" + type: "eth" + - fec: "KPFEC" + id: "473" + lanes: "0:4" + serdes_group: "59" + speed: "100G" + sysport: "473" + type: "eth" + - fec: "KPFEC" + id: "377" + lanes: "0:4" + serdes_group: "47" + speed: "100G" + sysport: "377" + type: "eth" + - fec: "KPFEC" + id: "345" + lanes: "0:4" + serdes_group: "43" + speed: "100G" + sysport: "345" + type: "eth" + - fec: "KPFEC" + id: "9" + lanes: "0:4" + serdes_group: "1" + speed: "100G" + sysport: "9" + type: "eth" + - fec: "KPFEC" + id: "25" + lanes: "0:4" + serdes_group: "3" + speed: "100G" + sysport: "25" + type: "eth" + - fec: "KPFEC" + id: "89" + lanes: "0:4" + serdes_group: "11" + speed: "100G" + sysport: "89" + type: "eth" + - fec: "KPFEC" + id: "73" + lanes: "0:4" + serdes_group: "9" + speed: "100G" + sysport: "73" + type: "eth" + isg: + - id: "0" + lane_swap: "74563102" + rx_polarity: "11000001" + tx_polarity: "00011100" + - id: "1" + lane_swap: "74563102" + rx_polarity: "01110111" + tx_polarity: "01111100" + - id: "2" + lane_swap: "20136547" + rx_polarity: "10001110" + tx_polarity: "01110011" + - id: "3" + lane_swap: "20136547" + rx_polarity: "10001100" + tx_polarity: "00101011" + - id: "4" + lane_swap: "74563102" + rx_polarity: "11000001" + tx_polarity: "00011100" + - id: "5" + lane_swap: "47563102" + rx_polarity: "00010111" + tx_polarity: "00111101" + - id: "6" + lane_swap: "02134567" + rx_polarity: "00101110" + tx_polarity: "01000000" + - id: "7" + lane_swap: "02134567" + rx_polarity: "00101110" + tx_polarity: "10010010" + - id: "8" + lane_swap: "67451302" + rx_polarity: "10100010" + tx_polarity: "10011110" + - id: "9" + lane_swap: "67453102" + rx_polarity: "10100010" + tx_polarity: "10111010" + - id: "10" + lane_swap: "20315476" + rx_polarity: "01101101" + tx_polarity: "10010001" + - id: "11" + lane_swap: "20315476" + rx_polarity: "10111111" + tx_polarity: "11010001" + - id: "12" + lane_swap: "76543120" + rx_polarity: "10100101" + tx_polarity: "11101000" + - id: "13" + lane_swap: "76543120" + rx_polarity: "10011110" + tx_polarity: "10100010" + - id: "14" + lane_swap: "02134567" + rx_polarity: "10011110" + tx_polarity: "11110101" + - id: "15" + lane_swap: "02134567" + rx_polarity: "11010001" + tx_polarity: "01101101" + - id: "16" + lane_swap: "67451302" + rx_polarity: "00101010" + tx_polarity: "01100011" + - id: "17" + lane_swap: "54760132" + rx_polarity: "01010100" + tx_polarity: "10010101" + - id: "18" + lane_swap: "54761032" + rx_polarity: "10101011" + tx_polarity: "01011000" + - id: "19" + lane_swap: "23016745" + rx_polarity: "00100000" + tx_polarity: "11111000" + - id: "20" + lane_swap: "20315476" + rx_polarity: "10000101" + tx_polarity: "11011111" + - id: "21" + lane_swap: "23016745" + rx_polarity: "11110100" + tx_polarity: "00010111" + - id: "22" + lane_swap: "54760132" + rx_polarity: "10001011" + tx_polarity: "11010101" + - id: "23" + lane_swap: "54761032" + rx_polarity: "11110100" + tx_polarity: "01011000" + - id: "24" + lane_swap: "23016745" + rx_polarity: "01110000" + tx_polarity: "10111000" + - id: "25" + lane_swap: "23016745" + rx_polarity: "10111011" + tx_polarity: "00000111" + - id: "26" + lane_swap: "02134567" + rx_polarity: "00010101" + tx_polarity: "11001001" + - id: "27" + lane_swap: "20314576" + rx_polarity: "11010110" + tx_polarity: "10110001" + - id: "28" + lane_swap: "20314576" + rx_polarity: "11110011" + tx_polarity: "10110001" + - id: "29" + lane_swap: "76453120" + rx_polarity: "01101101" + tx_polarity: "01001000" + - id: "30" + lane_swap: "67541302" + rx_polarity: "00110111" + tx_polarity: "11110101" + - id: "31" + lane_swap: "67541302" + rx_polarity: "01100111" + tx_polarity: "01000111" + - id: "32" + lane_swap: "67543120" + rx_polarity: "00011110" + tx_polarity: "11111000" + - id: "33" + lane_swap: "67543120" + rx_polarity: "10011010" + tx_polarity: "10011000" + - id: "34" + lane_swap: "67453102" + rx_polarity: "11011001" + tx_polarity: "10100001" + - id: "35" + lane_swap: "02134576" + rx_polarity: "01010101" + tx_polarity: "00110111" + - id: "36" + lane_swap: "02134576" + rx_polarity: "10100001" + tx_polarity: "11100110" + - id: "37" + lane_swap: "20315476" + rx_polarity: "11000100" + tx_polarity: "10001010" + - id: "38" + lane_swap: "23016745" + rx_polarity: "01100101" + tx_polarity: "11101111" + - id: "39" + lane_swap: "23017645" + rx_polarity: "10000101" + tx_polarity: "11111110" + - id: "40" + lane_swap: "54761032" + rx_polarity: "11011111" + tx_polarity: "00001101" + - id: "41" + lane_swap: "54761032" + rx_polarity: "00100100" + tx_polarity: "01001000" + - id: "42" + lane_swap: "23016745" + rx_polarity: "11010101" + tx_polarity: "01000000" + - id: "43" + lane_swap: "20315476" + rx_polarity: "10101101" + tx_polarity: "00010001" + - id: "44" + lane_swap: "23017645" + rx_polarity: "11010101" + tx_polarity: "11101011" + - id: "45" + lane_swap: "54761032" + rx_polarity: "00101111" + tx_polarity: "10110010" + - id: "46" + lane_swap: "54761032" + rx_polarity: "11111011" + tx_polarity: "01011101" + - id: "47" + lane_swap: "67451302" + rx_polarity: "00111000" + tx_polarity: "00010110" + - id: "48" + lane_swap: "02134567" + rx_polarity: "00011111" + tx_polarity: "01000101" + - id: "49" + lane_swap: "02134567" + rx_polarity: "00011110" + tx_polarity: "00001111" + - id: "50" + lane_swap: "76543120" + rx_polarity: "11101011" + tx_polarity: "10110000" + - id: "51" + lane_swap: "76543120" + rx_polarity: "10100100" + tx_polarity: "11010111" + - id: "52" + lane_swap: "20314576" + rx_polarity: "01000101" + tx_polarity: "01011101" + - id: "53" + lane_swap: "20315476" + rx_polarity: "01000101" + tx_polarity: "01011111" + - id: "54" + lane_swap: "67451302" + rx_polarity: "10011101" + tx_polarity: "11101011" + - id: "55" + lane_swap: "67451302" + rx_polarity: "10110000" + tx_polarity: "11101011" + - id: "56" + lane_swap: "02134567" + rx_polarity: "11100000" + tx_polarity: "10111010" + - id: "57" + lane_swap: "02134567" + rx_polarity: "10101110" + tx_polarity: "10111010" + - id: "58" + lane_swap: "47651320" + rx_polarity: "00110110" + tx_polarity: "10101000" + - id: "59" + lane_swap: "47651320" + rx_polarity: "00110110" + tx_polarity: "10101100" + - id: "60" + lane_swap: "02315674" + rx_polarity: "11010101" + tx_polarity: "01111110" + - id: "61" + lane_swap: "02315674" + rx_polarity: "11000100" + tx_polarity: "01011110" + - id: "62" + lane_swap: "47651320" + rx_polarity: "10010000" + tx_polarity: "11101110" + - id: "63" + lane_swap: "47651320" + rx_polarity: "10010110" + tx_polarity: "10100100" diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/ivm.sai.config.yaml b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/ivm.sai.config.yaml new file mode 100755 index 000000000000..36ab56f18ac8 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/ivm.sai.config.yaml @@ -0,0 +1,8 @@ +IFCS_INIT_FILE : "/usr/share/sonic/hwsku/config_teralynx_MVTX9180_64x100G.yaml" +IFCS_SKU_FILE : "/usr/share/sonic/hwsku/teralynx.MVTX9180" +IFCS_INNO_CLI_PORT : "9999" +IFCS_TARGET : "device" +INNOVIUM_DIR : "/innovium" +PYTHONPATH : "$INNOVIUM_DIR:$INNOVIUM_DIR/cmds:$INNOVIUM_DIR/scripts:$INNOVIUM_DIR/test/:$INNOVIUM_DIR/test/utils:$INNOVIUM_DIR/utils:$INNOVIUM_DIR/pyctypes:$INNOVIUM_DIR/ifcs_cmds:$INNOVIUM_DIR/testutil" +IVM_SAI_DATAPATH_CONFIG_FILE: "/usr/share/sonic/hwsku/ivm.sai.datapath.config.yaml" +IVM_SAI_PARAM_A0008: "32" diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/ivm.sai.datapath.config.yaml b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/ivm.sai.datapath.config.yaml new file mode 100644 index 000000000000..05ea6396c4c1 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/ivm.sai.datapath.config.yaml @@ -0,0 +1,11 @@ +#Queue Type +ISAI_PARAM_A000 : "0" +ISAI_PARAM_P0_0_LS : "2304 2304 2304 2304 2304 2304 2304 2304" +ISAI_PARAM_P0_1_LS : "1728 1608 1608 1584 1584 1584 1584 1584" +ISAI_PARAM_P0_1_ALS : "192 72 72 48 48 48 48 48" +ISAI_PARAM_P1_0_LS : "768 768 768 768 768 768 768 768" +ISAI_PARAM_P1_0_LL : "1536 1536 1536 1536 1536 1536 1536 1536" +ISAI_PARAM_P1_1_LS : "1344 1224 1224 1200 1200 1200 1200 1200" +ISAI_PARAM_P1_1_LL : "3138 3138 3138 3138 3138 3138 3138 3138" +ISAI_PARAM_P1_1_ALS : "192 72 72 48 48 48 48 48" +ISAI_PARAM_P1_1_ALL : "86 86 86 86 86 86 86 86" diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/pg_profile_lookup.ini b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/pg_profile_lookup.ini new file mode 100644 index 000000000000..c09264d700c5 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/pg_profile_lookup.ini @@ -0,0 +1,26 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 25000 5m 1518 0 15680 1 9408 + 50000 5m 1518 0 21248 1 9408 + 100000 5m 1518 0 34624 1 9408 + 200000 5m 1518 0 62368 1 9408 + 400000 5m 1518 0 117536 1 9408 + 800000 5m 1518 0 197536 1 9408 + 25000 40m 1518 0 16928 1 9408 + 50000 40m 1518 0 23392 1 9408 + 100000 40m 1518 0 38816 1 9408 + 200000 40m 1518 0 71904 1 9408 + 400000 40m 1518 0 135520 1 9408 + 800000 40m 1518 0 205520 1 9408 + 25000 100m 1518 0 18848 1 9408 + 50000 100m 1518 0 27264 1 9408 + 100000 100m 1518 0 46496 1 9408 + 200000 100m 1518 0 87168 1 9408 + 400000 100m 1518 0 166688 1 9408 + 800000 100m 1518 0 236688 1 9408 + 25000 300m 1518 0 25184 1 9408 + 50000 300m 1518 0 40128 1 9408 + 100000 300m 1518 0 72384 1 9408 + 200000 300m 1518 0 138112 1 9408 + 400000 300m 1518 0 268640 1 9408 + 800000 300m 1518 0 468640 1 9408 diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/port_config.ini b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/port_config.ini new file mode 100644 index 000000000000..b260f06fe189 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/port_config.ini @@ -0,0 +1,65 @@ +# name lanes alias fec index speed +Ethernet0 489,490,491,492 Eth1 rs 1 100000 +Ethernet8 505,506,507,508 Eth2 rs 2 100000 +Ethernet16 441,442,443,444 Eth3 rs 3 100000 +Ethernet24 425,426,427,428 Eth4 rs 4 100000 +Ethernet32 41,42,43,44 Eth5 rs 5 100000 +Ethernet40 49,50,51,52 Eth6 rs 6 100000 +Ethernet48 153,154,155,156 Eth7 rs 7 100000 +Ethernet56 137,138,139,140 Eth8 rs 8 100000 +Ethernet64 1,2,3,4 Eth9 rs 9 100000 +Ethernet72 17,18,19,20 Eth10 rs 10 100000 +Ethernet80 81,82,83,84 Eth11 rs 11 100000 +Ethernet88 65,66,67,68 Eth12 rs 12 100000 +Ethernet96 97,98,99,100 Eth13 rs 13 100000 +Ethernet104 113,114,115,116 Eth14 rs 14 100000 +Ethernet112 193,194,195,196 Eth15 rs 15 100000 +Ethernet120 177,178,179,180 Eth16 rs 16 100000 +Ethernet128 33,34,35,36 Eth17 rs 17 100000 +Ethernet136 57,58,59,60 Eth18 rs 18 100000 +Ethernet144 161,162,163,164 Eth19 rs 19 100000 +Ethernet152 129,130,131,132 Eth20 rs 20 100000 +Ethernet160 217,218,219,220 Eth21 rs 21 100000 +Ethernet168 241,242,243,244 Eth22 rs 22 100000 +Ethernet176 233,234,235,236 Eth23 rs 23 100000 +Ethernet184 209,210,211,212 Eth24 rs 24 100000 +Ethernet192 105,106,107,108 Eth25 rs 25 100000 +Ethernet200 121,122,123,124 Eth26 rs 26 100000 +Ethernet208 169,170,171,172 Eth27 rs 27 100000 +Ethernet216 145,146,147,148 Eth28 rs 28 100000 +Ethernet224 265,266,267,268 Eth29 rs 29 100000 +Ethernet232 289,290,291,292 Eth30 rs 30 100000 +Ethernet240 297,298,299,300 Eth31 rs 31 100000 +Ethernet248 273,274,275,276 Eth32 rs 32 100000 +Ethernet256 225,226,227,228 Eth33 rs 33 100000 +Ethernet264 249,250,251,252 Eth34 rs 34 100000 +Ethernet272 201,202,203,204 Eth35 rs 35 100000 +Ethernet280 185,186,187,188 Eth36 rs 36 100000 +Ethernet288 393,394,395,396 Eth37 rs 37 100000 +Ethernet296 409,410,411,412 Eth38 rs 38 100000 +Ethernet304 329,330,331,332 Eth39 rs 39 100000 +Ethernet312 313,314,315,316 Eth40 rs 40 100000 +Ethernet320 257,258,259,260 Eth41 rs 41 100000 +Ethernet328 281,282,283,284 Eth42 rs 42 100000 +Ethernet336 321,322,323,324 Eth43 rs 43 100000 +Ethernet344 305,306,307,308 Eth44 rs 44 100000 +Ethernet352 457,458,459,460 Eth45 rs 45 100000 +Ethernet360 465,466,467,468 Eth46 rs 46 100000 +Ethernet368 369,370,371,372 Eth47 rs 47 100000 +Ethernet376 353,354,355,356 Eth48 rs 48 100000 +Ethernet384 385,386,387,388 Eth49 rs 49 100000 +Ethernet392 401,402,403,404 Eth50 rs 50 100000 +Ethernet400 361,362,363,364 Eth51 rs 51 100000 +Ethernet408 337,338,339,340 Eth52 rs 52 100000 +Ethernet416 481,482,483,484 Eth53 rs 53 100000 +Ethernet424 497,498,499,500 Eth54 rs 54 100000 +Ethernet432 433,434,435,436 Eth55 rs 55 100000 +Ethernet440 417,418,419,420 Eth56 rs 56 100000 +Ethernet448 449,450,451,452 Eth57 rs 57 100000 +Ethernet456 473,474,475,476 Eth58 rs 58 100000 +Ethernet464 377,378,379,380 Eth59 rs 59 100000 +Ethernet472 345,346,347,348 Eth60 rs 60 100000 +Ethernet480 9,10,11,12 Eth61 rs 61 100000 +Ethernet488 25,26,27,28 Eth62 rs 62 100000 +Ethernet496 89,90,91,92 Eth63 rs 63 100000 +Ethernet504 73,74,75,76 Eth64 rs 64 100000 diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos.json.j2 b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos.json.j2 new file mode 100755 index 000000000000..0f1ecd1106d0 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos.json.j2 @@ -0,0 +1,192 @@ +{% set port_names_list = [] %} +{% for port in PORT %} + {%- if port_names_list.append(port) %}{% endif %} +{% endfor %} +{% set port_names = port_names_list | join(',') -%} + + +{ + "TC_TO_QUEUE_MAP":{ + "AZURE":{ + "0":"0", + "1":"1", + "2":"2", + "3":"3", + "4":"4", + "5":"5", + "6":"6", + "7":"7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "0" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "1" + } + }, + "QUEUE": { +{% for port in port_names_list %} + "{{ port }}|3": { + "scheduler" : "scheduler.1", + "wred_profile" : "AZURE_LOSSLESS" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|4": { + "scheduler" : "scheduler.1", + "wred_profile" : "AZURE_LOSSLESS" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|0": { + "scheduler": "scheduler.0" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|1": { + "scheduler": "scheduler.0" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|2": { + "scheduler": "scheduler.0" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|5": { + "scheduler": "scheduler.0" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|6": { + "scheduler": "scheduler.0" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "PORT_QOS_MAP": { +{% for port in port_names_list %} + "{{ port }}": { + "tc_to_pg_map": "AZURE", + "tc_to_queue_map": "AZURE", + "dscp_to_tc_map": "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable": "3,4" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + } +} diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos_defaults_def_lossy.j2 b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos_defaults_def_lossy.j2 new file mode 100755 index 000000000000..c1170619bc6c --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos_defaults_def_lossy.j2 @@ -0,0 +1,121 @@ +{% set port_names_list = [] %} +{% for port in PORT %} + {%- if port_names_list.append(port) %}{% endif %} +{% endfor %} +{% set port_names = port_names_list | join(',') -%} + + +{ + "TC_TO_QUEUE_MAP":{ + "AZURE":{ + "0":"0", + "1":"1", + "2":"2", + "3":"3", + "4":"4", + "5":"5", + "6":"6", + "7":"7" + } + }, + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "1", + "4": "2", + "5": "0", + "6": "0", + "7": "0" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0":"0", + "1":"0", + "2":"0", + "3":"0", + "4":"0", + "5":"0", + "6":"0", + "7":"0", + "8":"0", + "9":"0", + "10":"0", + "11":"0", + "12":"0", + "13":"0", + "14":"0", + "15":"0", + "16":"0", + "17":"0", + "18":"0", + "19":"0", + "20":"0", + "21":"0", + "22":"0", + "23":"0", + "24":"0", + "25":"0", + "26":"0", + "27":"0", + "28":"0", + "29":"0", + "30":"0", + "31":"0", + "32":"0", + "33":"0", + "34":"0", + "35":"0", + "36":"0", + "37":"0", + "38":"0", + "39":"0", + "40":"0", + "41":"0", + "42":"0", + "43":"0", + "44":"0", + "45":"0", + "46":"0", + "47":"0", + "48":"0", + "49":"0", + "50":"0", + "51":"0", + "52":"0", + "53":"0", + "54":"0", + "55":"0", + "56":"0", + "57":"0", + "58":"0", + "59":"0", + "60":"0", + "61":"0", + "62":"0", + "63":"0" + } + }, + "PORT_QOS_MAP": { +{% for port in port_names_list %} + "{{ port }}": { + "tc_to_pg_map": "AZURE", + "tc_to_queue_map": "AZURE", + "dscp_to_tc_map": "AZURE" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "SCHEDULER": { + "scheduler.7": { + "type": "STRICT" + } + }, + "QUEUE": { + "{{ port_names }}|7": { + "scheduler": "[SCHEDULER|scheduler.7]" + } + } +} diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos_defaults_t1.j2 b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos_defaults_t1.j2 new file mode 100755 index 000000000000..0f1ecd1106d0 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/qos_defaults_t1.j2 @@ -0,0 +1,192 @@ +{% set port_names_list = [] %} +{% for port in PORT %} + {%- if port_names_list.append(port) %}{% endif %} +{% endfor %} +{% set port_names = port_names_list | join(',') -%} + + +{ + "TC_TO_QUEUE_MAP":{ + "AZURE":{ + "0":"0", + "1":"1", + "2":"2", + "3":"3", + "4":"4", + "5":"5", + "6":"6", + "7":"7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "0" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "1" + } + }, + "QUEUE": { +{% for port in port_names_list %} + "{{ port }}|3": { + "scheduler" : "scheduler.1", + "wred_profile" : "AZURE_LOSSLESS" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|4": { + "scheduler" : "scheduler.1", + "wred_profile" : "AZURE_LOSSLESS" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|0": { + "scheduler": "scheduler.0" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|1": { + "scheduler": "scheduler.0" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|2": { + "scheduler": "scheduler.0" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|5": { + "scheduler": "scheduler.0" + }, +{% endfor %} +{% for port in port_names_list %} + "{{ port }}|6": { + "scheduler": "scheduler.0" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "PORT_QOS_MAP": { +{% for port in port_names_list %} + "{{ port }}": { + "tc_to_pg_map": "AZURE", + "tc_to_queue_map": "AZURE", + "dscp_to_tc_map": "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable": "3,4" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + } +} diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/sai.profile b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/sai.profile new file mode 100644 index 000000000000..aba4fc81fb17 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/ivm.sai.config.yaml diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/teralynx.MVTX9180 b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/teralynx.MVTX9180 new file mode 100644 index 000000000000..e310d0be06ad --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/dbmvtx9180_64x100G/teralynx.MVTX9180 @@ -0,0 +1,170 @@ +sku: teralynx.MVTX9180 + +device_id: 0x6000 + +# Hardware constraint information +hardware: + num_ibs: 8 + ib_active: 0,1,2,3,4,5,6,7 + + ports_per_ib: 66, 66, 66, 66, 66, 66, 66, 66 + recirc_port_num: 64, 64, 64, 64, 64, 64, 64, 64 + cpu_port_num: 65 + cpu_port_ib: 0 + mgmt_port_num: 65, 65 + mgmt_port_ibs: 1,2 + + pics_per_ib: 8, 9, 9, 8, 8, 8, 8, 8 + pic_ports_per_pic: 8 + max_serdes_speed: 100 + + num_shared_pics: 0 + + isg [0-7]: + ib: 0 + pic_id: [0-7] + + isg [8-15]: + ib: 4 + pic_id: [0-7] + + isg 16: + ib: 6 + pic_id: 7 + + isg 17: + ib: 6 + pic_id: 6 + + isg 18: + ib: 6 + pic_id: 5 + + isg 19: + ib: 6 + pic_id: 4 + + isg 20: + ib: 6 + pic_id: 3 + + isg 21: + ib: 6 + pic_id: 2 + + isg 22: + ib: 6 + pic_id: 1 + + isg 23: + ib: 6 + pic_id: 0 + + isg 24: + ib: 2 + pic_id: 7 + + isg 25: + ib: 2 + pic_id: 6 + + isg 26: + ib: 2 + pic_id: 5 + + isg 27: + ib: 2 + pic_id: 4 + + isg 28: + ib: 2 + pic_id: 3 + + isg 29: + ib: 2 + pic_id: 2 + + isg 30: + ib: 2 + pic_id: 1 + + isg 31: + ib: 2 + pic_id: 0 + + isg [32-39]: + ib: 3 + pic_id: [0-7] + + isg [40-47]: + ib: 7 + pic_id: [0-7] + + isg 48: + ib: 5 + pic_id: 7 + + isg 49: + ib: 5 + pic_id: 6 + + isg 50: + ib: 5 + pic_id: 5 + + isg 51: + ib: 5 + pic_id: 4 + + isg 52: + ib: 5 + pic_id: 3 + + isg 53: + ib: 5 + pic_id: 2 + + isg 54: + ib: 5 + pic_id: 1 + + isg 55: + ib: 5 + pic_id: 0 + + isg 56: + ib: 1 + pic_id: 7 + + isg 57: + ib: 1 + pic_id: 6 + + isg 58: + ib: 1 + pic_id: 5 + + isg 59: + ib: 1 + pic_id: 4 + + isg 60: + ib: 1 + pic_id: 3 + + isg 61: + ib: 1 + pic_id: 2 + + isg 62: + ib: 1 + pic_id: 1 + + isg 63: + ib: 1 + pic_id: 0 + + isg 64: + mode: 1:1 + ib: 1, 2 + pic_id: 8 diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/default_sku b/device/marvell/x86_64-marvell_dbmvtx9180-r0/default_sku new file mode 100644 index 000000000000..5be826c15e7d --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/default_sku @@ -0,0 +1 @@ +dbmvtx9180_64x100G t1 diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/installer.conf b/device/marvell/x86_64-marvell_dbmvtx9180-r0/installer.conf new file mode 100644 index 000000000000..d7d410dae704 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/installer.conf @@ -0,0 +1,4 @@ +CONSOLE_PORT=0x3f8 +CONSOLE_DEV=4 +CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="pcie_aspm=off intel_iommu=off" diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/platform_asic b/device/marvell/x86_64-marvell_dbmvtx9180-r0/platform_asic new file mode 100644 index 000000000000..84083a7415d9 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/platform_asic @@ -0,0 +1 @@ +innovium diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/eeprom.py b/device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/eeprom.py new file mode 100644 index 000000000000..b7724886eea4 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/eeprom.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +try: + import os + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +def eeprom_check(): + filepath="/sys/bus/i2c/devices/0-0056/eeprom" + if os.path.isfile(filepath): + return 1 #now board, 0x56 + else: + return 0 #now board, 0x57 + +class board(eeprom_tlvinfo.TlvInfoDecoder): + _TLV_INFO_MAX_LEN = 256 + def __init__(self, name, path, cpld_root, ro): + ret=eeprom_check() + if ret==1: + self.eeprom_path = "/sys/bus/i2c/devices/0-0056/eeprom" + else: + self.eeprom_path = "/sys/bus/i2c/devices/47-0057/eeprom" + + super(board, self).__init__(self.eeprom_path, 0, '', True) + diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/psuutil.py b/device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/psuutil.py new file mode 100644 index 000000000000..a8dbcd2299fc --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/psuutil.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python + +############################################################################# +# teralynx +# +# Module contains an implementation of SONiC PSU Base API and +# provides the PSUs status which are available in the platform +# +############################################################################# + +try: + from sonic_psu.psu_base import PsuBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +class PsuUtil(PsuBase): + """Platform-specific PSUutil class""" + + def __init__(self): + PsuBase.__init__(self) + + self.psu_path = "/sys/bus/i2c/devices/" + self.psu_presence = "/psu_present" + self.psu_oper_status = "/psu_power_good" + self.psu_mapping = { + 2: "0-0051", + 1: "0-0052", + } + + def get_num_psus(self): + return len(self.psu_mapping) + + def get_psu_status(self, index): + if index is None: + return False + + status = 0 + node = self.psu_path + self.psu_mapping[index]+self.psu_oper_status + try: + with open(node, 'r') as power_status: + status = int(power_status.read()) + except IOError: + return False + + return status == 1 + + def get_psu_presence(self, index): + if index is None: + return False + + status = 0 + node = self.psu_path + self.psu_mapping[index] + self.psu_presence + try: + with open(node, 'r') as presence_status: + status = int(presence_status.read()) + except IOError: + return False + + return status == 1 diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/sfputil.py b/device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/sfputil.py new file mode 100644 index 000000000000..8983579016b4 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/plugins/sfputil.py @@ -0,0 +1,186 @@ +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# + +try: + import time + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + + +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" + SONIC_PORT_NAME_PREFIX = "Ethernet" + PORT_START = 0 + PORT_END = 31 + PORTS_IN_BLOCK = 32 + + BASE_OOM_PATH = "/sys/bus/i2c/devices/0-00{0}/" + BASE_CPLD1_PATH = "/sys/bus/i2c/devices/0-0061/" + BASE_CPLD2_PATH = "/sys/bus/i2c/devices/0-0062/" + + _port_to_is_present = {} + _port_to_lp_mode = {} + + _port_to_eeprom_mapping = {} + _port_to_i2c_mapping = { + 0: [1, 10], + 1: [2, 11], + 2: [3, 12], + 3: [4, 13], + 4: [5, 14], + 5: [6, 15], + 6: [7, 16], + 7: [8, 17], + 8: [9, 18], + 9: [10, 19], + 10: [11, 20], + 11: [12, 21], + 12: [13, 22], + 13: [14, 23], + 14: [15, 24], + 15: [16, 25], + 16: [17, 26], + 17: [18, 27], + 18: [19, 28], + 19: [20, 29], + 20: [21, 30], + 21: [22, 31], + 22: [23, 32], + 23: [24, 33], + 24: [25, 34], + 25: [26, 35], + 26: [27, 36], + 27: [28, 37], + 28: [29, 38], + 29: [30, 39], + 30: [31, 40], + 31: [32, 41], + } + + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END + + @property + def qsfp_ports(self): + return range(self.PORT_START, self.PORTS_IN_BLOCK + 1) + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def is_logical_port(self, port_name): + return True + + def get_logical_to_physical(self, port_name): + if not port_name.startswith(self.SONIC_PORT_NAME_PREFIX): + return None + + port_idx = int(port_name[len(self.SONIC_PORT_NAME_PREFIX):]) + port_idx = port_idx // 8 + return [port_idx] + + def __init__(self): + eeprom_path = self.BASE_OOM_PATH + "eeprom1" + + for x in range(0, self.port_end+1): + self.port_to_eeprom_mapping[x] = eeprom_path.format(self._port_to_i2c_mapping[x][1]) + + self._transceiver_presence = self._get_sfp_presence() + SfpUtilBase.__init__(self) + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + if port_num < 16 : + present_path = self.BASE_CPLD1_PATH + "module_present_" + str(port_num+1) + else: + present_path = self.BASE_CPLD2_PATH + "module_present_" + str(port_num+1) + self.__port_to_is_present = present_path + + try: + val_file = open(self.__port_to_is_present) + content = val_file.readline().rstrip() + val_file.close() + except IOError as e: + print("Error: unable to access file: %s" % str(e)) + return False + + if content == "1": + return True + + return False + + def get_low_power_mode(self, port_num): + raise NotImplementedError + + def set_low_power_mode(self, port_num, lpmode): + raise NotImplementedError + + def reset(self, port_num): + raise NotImplementedError + + def _get_sfp_presence(self): + port_pres = {} + for port in range(0, self.port_end+1): + port_pres[port] = self.get_presence(port) + + return port_pres + + def get_transceiver_change_event(self, timeout=0): + start_time = time.time() + port_dict = {} + forever = False + + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + print("get_transceiver_change_event:Invalid timeout value", timeout) + return False, {} + + end_time = start_time + timeout + if start_time > end_time: + print('get_transceiver_change_event:' \ + 'time wrap / invalid timeout value', timeout) + + return False, {} # Time wrap or possibly incorrect timeout + + while timeout >= 0: + change_status = False + + cur_presence = self._get_sfp_presence() + for port in range(0, self.port_end+1): + if cur_presence[port] == 1: + port_dict[port]='1' + else: + port_dict[port]='0' + + if cur_presence[port] != self._transceiver_presence[port]: + change_status = True + + self._transceiver_presence = cur_presence + if change_status: + return True, port_dict + + if forever: + time.sleep(1) + else: + timeout = end_time - time.time() + if timeout >= 1: + time.sleep(1) # We poll at 1 second granularity + else: + if timeout > 0: + time.sleep(timeout) + return True, {} + print("get_evt_change_event: Should not reach here.") + return False, {} diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/pmon_daemon_control.json b/device/marvell/x86_64-marvell_dbmvtx9180-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..f5fdc945df33 --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/pmon_daemon_control.json @@ -0,0 +1,6 @@ +{ + "skip_ledd": true, + "skip_pcied": true, + "skip_thermalctld": true, + "skip_psud": true +} diff --git a/device/marvell/x86_64-marvell_dbmvtx9180-r0/topo.conf b/device/marvell/x86_64-marvell_dbmvtx9180-r0/topo.conf new file mode 100644 index 000000000000..795ea43143eb --- /dev/null +++ b/device/marvell/x86_64-marvell_dbmvtx9180-r0/topo.conf @@ -0,0 +1 @@ +t1 diff --git a/platform/innovium/one-image.mk b/platform/innovium/one-image.mk index bd63990f511d..b1abcf613aa4 100755 --- a/platform/innovium/one-image.mk +++ b/platform/innovium/one-image.mk @@ -9,6 +9,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELTA_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(NETBERG_AURORA_715_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(SMCI_SSE_T7132S_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(WISTRON_PLATFORM_MODULE) +$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(TL10_DBMVTX9180_PLATFORM) $(SONIC_ONE_IMAGE)_INSTALLS += $(INVM_DRV) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) diff --git a/platform/innovium/platform-modules-marvell.mk b/platform/innovium/platform-modules-marvell.mk new file mode 100644 index 000000000000..b3d720e64dde --- /dev/null +++ b/platform/innovium/platform-modules-marvell.mk @@ -0,0 +1,13 @@ +# Teralynx 10 Platform + +TL10_DBMVTX9180_VERSION = 1.0 + +export TL10_DBMVTX9180_VERSION + +TL10_DBMVTX9180_PLATFORM = sonic-platform-marvell-dbmvtx9180_$(TL10_DBMVTX9180_VERSION)_$(CONFIGURED_ARCH).deb +$(TL10_DBMVTX9180_PLATFORM)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-marvell +$(TL10_DBMVTX9180_PLATFORM)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(TL10_DBMVTX9180_PLATFORM)_PLATFORM = x86_64-marvell_dbmvtx9180-r0 + +SONIC_DPKG_DEBS += $(TL10_DBMVTX9180_PLATFORM) + diff --git a/platform/innovium/rules.mk b/platform/innovium/rules.mk index 03efa70b0def..4733f545245f 100755 --- a/platform/innovium/rules.mk +++ b/platform/innovium/rules.mk @@ -1,9 +1,8 @@ include $(PLATFORM_PATH)/invm-sai.mk include $(PLATFORM_PATH)/platform-modules-cel.mk include $(PLATFORM_PATH)/platform-modules-supermicro.mk -#include $(PLATFORM_PATH)/platform-modules-delta.mk include $(PLATFORM_PATH)/platform-modules-wistron.mk -#include $(PLATFORM_PATH)/platform-modules-netberg.mk +include $(PLATFORM_PATH)/platform-modules-marvell.mk include $(PLATFORM_PATH)/docker-syncd-invm.mk include $(PLATFORM_PATH)/docker-syncd-invm-rpc.mk include $(PLATFORM_PATH)/one-image.mk diff --git a/platform/innovium/sonic-platform-marvell b/platform/innovium/sonic-platform-marvell new file mode 160000 index 000000000000..a6e250959b4e --- /dev/null +++ b/platform/innovium/sonic-platform-marvell @@ -0,0 +1 @@ +Subproject commit a6e250959b4e98f443e759179ac25f93cc891c9a From 0d1131f8297308bf2cf9b454905430bbcad89844 Mon Sep 17 00:00:00 2001 From: Keshav Gupta Date: Tue, 30 Apr 2024 02:07:04 +0530 Subject: [PATCH 020/282] Innovium syncd bookworm migration (#18339) * Innovium syncd bookworm migration Signed-off-by: Keshav Gupta --- platform/innovium/docker-syncd-invm-rpc.mk | 5 +- .../docker-syncd-invm-rpc/Dockerfile.j2 | 46 +++++++++++-------- platform/innovium/docker-syncd-invm.mk | 5 +- .../innovium/docker-syncd-invm/Dockerfile.j2 | 3 +- platform/innovium/libsaithrift-dev.mk | 23 ++++++++-- platform/innovium/rules.mk | 7 ++- 6 files changed, 56 insertions(+), 33 deletions(-) diff --git a/platform/innovium/docker-syncd-invm-rpc.mk b/platform/innovium/docker-syncd-invm-rpc.mk index 9bb60ad42d41..c4e1c8762876 100755 --- a/platform/innovium/docker-syncd-invm-rpc.mk +++ b/platform/innovium/docker-syncd-invm-rpc.mk @@ -2,11 +2,12 @@ DOCKER_SYNCD_INVM_RPC = docker-syncd-invm-rpc.gz $(DOCKER_SYNCD_INVM_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-invm-rpc -$(DOCKER_SYNCD_INVM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(INVM_LIBSAI) $(PTF) $(INVM_SHELL) +$(DOCKER_SYNCD_INVM_RPC)_DEPENDS += $(SYNCD_RPC) $(INVM_LIBSAI) $(INVM_SHELL) +$(DOCKER_SYNCD_INVM_RPC)_PYTHON_WHEELS += $(PTF_PY3) $(DOCKER_SYNCD_INVM_RPC)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(DOCKER_SYNCD_INVM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_INVM_RPC) -SONIC_BUSTER_DOCKERS += $(DOCKER_SYNCD_INVM_RPC) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_SYNCD_INVM_RPC) ifeq ($(ENABLE_SYNCD_RPC),y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_INVM_RPC) endif diff --git a/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 b/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 index 7ddccc3ab29b..b5e00c0a8118 100755 --- a/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 +++ b/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 @@ -1,4 +1,5 @@ FROM docker-syncd-invm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +{% from "dockers/dockerfile-macros.j2" import install_python_wheels, copy_files %} ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive @@ -15,44 +16,49 @@ RUN apt-get purge -y syncd RUN apt-get update \ && apt-get -y install \ net-tools \ - python-pip \ - python-setuptools \ + python3-pip \ + python3-setuptools \ build-essential \ libssl-dev \ libffi-dev \ - python-dev \ + python3-dev \ libjansson4 \ libyaml-dev \ wget \ cmake \ libqt5core5a \ libqt5network5 \ - libboost-atomic1.71.0 + libboost-atomic1.74.0 \ + libthrift-0.17.0 \ + libnanomsg5 \ + libnanomsg-dev RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ {% for deb in docker_syncd_invm_rpc_debs.split(' ') -%} dpkg_apt debs/{{ deb }}{{'; '}} {%- endfor %} -RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ - && tar xvfz 1.0.0.tar.gz \ - && cd nanomsg-1.0.0 \ - && mkdir -p build \ - && cmake . \ - && make install \ - && ldconfig \ - && cd .. \ - && rm -fr nanomsg-1.0.0 \ - && rm -f 1.0.0.tar.gz \ - && pip install numpy \ - && pip install scipy \ - && pip install setuptools \ +RUN pip3 install cffi \ + && pip3 install nnpy \ && mkdir -p /opt \ && cd /opt \ - && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ - && apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ - && rm -rf /root/deps + && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"] +{% if docker_syncd_invm_rpc_whls.strip() -%} +# Copy locally-built Python wheel dependencies +{{ copy_files("python-wheels/", docker_syncd_invm_rpc_whls.split(' '), "/python-wheels/") }} + +# Install locally-built Python wheel dependencies +{{ install_python_wheels(docker_syncd_invm_rpc_whls.split(' ')) }} +{% endif %} + + +## Clean up +RUN apt-get purge -y libyaml-dev python3-dev libffi-dev libssl-dev wget cmake \ + build-essential +RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y +RUN rm -rf /root/deps + ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/platform/innovium/docker-syncd-invm.mk b/platform/innovium/docker-syncd-invm.mk index 0f748e3e8977..572680721f07 100755 --- a/platform/innovium/docker-syncd-invm.mk +++ b/platform/innovium/docker-syncd-invm.mk @@ -1,7 +1,7 @@ # docker image for innovium syncd DOCKER_SYNCD_PLATFORM_CODE = invm -include $(PLATFORM_PATH)/../template/docker-syncd-base.mk +include $(PLATFORM_PATH)/../template/docker-syncd-bookworm.mk $(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(INVM_LIBSAI) $(INVM_SHELL) @@ -10,9 +10,6 @@ $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \ $(LIBSAIMETADATA_DBG) \ $(LIBSAIREDIS_DBG) -SONIC_BUSTER_DOCKERS += $(DOCKER_SYNCD_BASE) -SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) - $(DOCKER_SYNCD_BASE)_VERSION = 1.0.0 $(DOCKER_SYNCD_BASE)_PACKAGE_NAME = syncd $(DOCKER_SYNCD_BASE)_MACHINE = innovium diff --git a/platform/innovium/docker-syncd-invm/Dockerfile.j2 b/platform/innovium/docker-syncd-invm/Dockerfile.j2 index 514e2237315f..3abe009d0afa 100755 --- a/platform/innovium/docker-syncd-invm/Dockerfile.j2 +++ b/platform/innovium/docker-syncd-invm/Dockerfile.j2 @@ -1,4 +1,5 @@ -FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +{% from "dockers/dockerfile-macros.j2" import install_debian_packages %} +FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name diff --git a/platform/innovium/libsaithrift-dev.mk b/platform/innovium/libsaithrift-dev.mk index 5357705bac98..ebc573e50e06 100755 --- a/platform/innovium/libsaithrift-dev.mk +++ b/platform/innovium/libsaithrift-dev.mk @@ -1,7 +1,20 @@ # libsaithrift-dev package +SAI_VER = 0.9.4 -LIBSAITHRIFT_DEV_INVM = libsaithrift-dev_0.9.4_$(CONFIGURED_ARCH).deb -$(LIBSAITHRIFT_DEV_INVM)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI -$(LIBSAITHRIFT_DEV_INVM)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(THRIFT_COMPILER) $(INVM_LIBSAI) $(INVM_HSAI) -$(LIBSAITHRIFT_DEV_INVM)_RDEPENDS += $(LIBTHRIFT) $(INVM_HSAI) -SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV_INVM) +LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb +$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI +ifeq ($(SAITHRIFT_V2),y) +$(LIBSAITHRIFT_DEV)_DEPENDS += $(INVM_LIBSAI) $(INVM_HSAI) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(INVM_HSAI) $(LIBSAIMETADATA) +$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2 +else +$(LIBSAITHRIFT_DEV)_DEPENDS += $(INVM_LIBSAI) $(INVM_HSAI) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(INVM_HSAI) +endif +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBSAIMETADATA) $(INVM_LIBSAI) $(INVM_SHELL) + +PYTHON_SAITHRIFT = python-saithrift$(SAITHRIFT_VER)_$(SAI_VER)_$(CONFIGURED_ARCH).deb +$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT))) + +SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) diff --git a/platform/innovium/rules.mk b/platform/innovium/rules.mk index 4733f545245f..dcf7f079fa16 100755 --- a/platform/innovium/rules.mk +++ b/platform/innovium/rules.mk @@ -15,8 +15,13 @@ SONIC_ALL += $(SONIC_INVM_ONE_IMAGE) \ $(DOCKER_SYNCD_INVM_RPC) # Inject invm sai into syncd -$(SYNCD)_DEPENDS += $(INVM_HSAI) $(INVM_LIBSAI) $(LIBSAITHRIFT_DEV_INVM) $(INVM_SHELL) +$(SYNCD)_DEPENDS += $(INVM_HSAI) $(INVM_LIBSAI) $(INVM_SHELL) $(SYNCD)_UNINSTALLS += $(INVM_HSAI) +ifeq ($(ENABLE_SYNCD_RPC),y) +$(SYNCD)_DEPENDS := $(filter-out $(LIBTHRIFT_DEV),$($(SYNCD)_DEPENDS)) +$(SYNCD)_DEPENDS += $(LIBSAITHRIFT_DEV) +endif + # Runtime dependency on invm sai is set only for syncd $(SYNCD)_RDEPENDS += $(INVM_HSAI) From 1cb12ba96ea47bcd0bb904baa5d74286f3621215 Mon Sep 17 00:00:00 2001 From: Adam Yeung <47261130+adyeung@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:38:08 -0700 Subject: [PATCH 021/282] ICCPD bookworm migration (#18542) ICCPD bookworm migration * Update Dockerfile.j2 * Update docker-iccpd.mk --- dockers/docker-iccpd/Dockerfile.j2 | 2 +- rules/docker-iccpd.mk | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dockers/docker-iccpd/Dockerfile.j2 b/dockers/docker-iccpd/Dockerfile.j2 index 42a73b4cd305..72d2d3d20883 100644 --- a/dockers/docker-iccpd/Dockerfile.j2 +++ b/dockers/docker-iccpd/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-swss-layer-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name diff --git a/rules/docker-iccpd.mk b/rules/docker-iccpd.mk index 3b94dec4257a..39be9f5a53d4 100644 --- a/rules/docker-iccpd.mk +++ b/rules/docker-iccpd.mk @@ -4,11 +4,11 @@ DOCKER_ICCPD_STEM = docker-iccpd DOCKER_ICCPD = $(DOCKER_ICCPD_STEM).gz DOCKER_ICCPD_DBG = $(DOCKER_ICCPD_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_ICCPD)_PATH = $(DOCKERS_PATH)/$(DOCKER_ICCPD_STEM) -$(DOCKER_ICCPD)_DEPENDS += $(SWSS) $(ICCPD) -$(DOCKER_ICCPD)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) -$(DOCKER_ICCPD)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) $(ICCPD_DBG) -$(DOCKER_ICCPD)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES) -$(DOCKER_ICCPD)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE) +$(DOCKER_ICCPD)_DEPENDS += $(ICCPD) +$(DOCKER_ICCPD)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_DEPENDS) +$(DOCKER_ICCPD)_DBG_DEPENDS += $(ICCPD_DBG) +$(DOCKER_ICCPD)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_IMAGE_PACKAGES) +$(DOCKER_ICCPD)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BOOKWORM) $(DOCKER_ICCPD)_VERSION = 1.0.0 $(DOCKER_ICCPD)_ICCPD = iccpd @@ -27,5 +27,5 @@ $(DOCKER_ICCPD)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro $(DOCKER_ICCPD)_BASE_IMAGE_FILES += mclagdctl:/usr/bin/mclagdctl -SONIC_BULLSEYE_DOCKERS += $(DOCKER_ICCPD) -SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_ICCPD_DBG) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_ICCPD) +SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_ICCPD_DBG) From 65b07cefb44c0f365acee33a829f14cf04b7de1a Mon Sep 17 00:00:00 2001 From: Julian Chang Date: Tue, 30 Apr 2024 05:47:50 +0800 Subject: [PATCH 022/282] [platform/supermicro] Fix compiling error in the kernel module of T7132. (#17755) Signed-off-by: Julian Chang - TW (HW3) --- .../sse-t7132s/modules/t7132s.c | 1 - 1 file changed, 1 deletion(-) diff --git a/platform/innovium/sonic-platform-modules-supermicro/sse-t7132s/modules/t7132s.c b/platform/innovium/sonic-platform-modules-supermicro/sse-t7132s/modules/t7132s.c index 2bc83f5b3a7a..c1fc33d32576 100755 --- a/platform/innovium/sonic-platform-modules-supermicro/sse-t7132s/modules/t7132s.c +++ b/platform/innovium/sonic-platform-modules-supermicro/sse-t7132s/modules/t7132s.c @@ -1702,5 +1702,4 @@ module_exit(t7132s_exit); MODULE_DEVICE_TABLE(pci, t7132s_pci_tbl); MODULE_DESCRIPTION("SuperMicro T7132S CPLD Module"); -MODULE_SUPPORTED_DEVICE("T7132S"); MODULE_LICENSE("GPL"); From 7172d856158693988b4586f8a6f84222fb172c2f Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Tue, 30 Apr 2024 08:30:12 -0700 Subject: [PATCH 023/282] [Nvidia] [DPU] Update SAI to SAIBuild0.0.30.0, SDK to v24.4-RC2 (#18769) - Why I did it Update SAI to SAIBuild0.0.30.0, SDK to v24.4-RC2. - How I did it Align SDK compilation makefiles to be compatible with the latest version. - How to verify it Build sonic-nvidia-bluefield.bin image. --- .../pinctrl-mlxbf3/pinctrl-mlxbf3.c.patch | 13 ++++++ platform/nvidia-bluefield/recipes/dpu-sai.mk | 2 +- platform/nvidia-bluefield/recipes/sdk.dep | 17 -------- platform/nvidia-bluefield/recipes/sdk.mk | 40 +++---------------- ...ove-meson-from-connectx-dependencies.patch | 28 +++++++++++++ .../nvidia-bluefield/sdk-src/doca/Makefile | 5 ++- .../0001-Remove-meson-from-dependencies.patch | 24 +++++++++++ ...w-warning-during-package-compilation.patch | 32 +++++++++++++++ .../0001-Install-LD-configuration.patch | 30 ++++++++++++++ .../0001-Remove-meson-from-dependencies.patch | 24 +++++++++++ .../sdk-src/ofed/templates/control.j2 | 23 +++++++++++ .../sdk-src/ofed/templates/postinst.j2 | 17 ++++++++ .../sdk-src/ofed/templates/postrm.j2 | 17 ++++++++ .../rdma/disable-ibverb-dependencies.patch | 22 ++++++++++ 14 files changed, 240 insertions(+), 54 deletions(-) create mode 100644 platform/nvidia-bluefield/pinctrl-mlxbf3/pinctrl-mlxbf3.c.patch create mode 100644 platform/nvidia-bluefield/sdk-src/doca/0001-Remove-meson-from-connectx-dependencies.patch create mode 100644 platform/nvidia-bluefield/sdk-src/dpdk/0001-Remove-meson-from-dependencies.patch create mode 100644 platform/nvidia-bluefield/sdk-src/flexio/0001-Allow-warning-during-package-compilation.patch create mode 100644 platform/nvidia-bluefield/sdk-src/flexio/0001-Install-LD-configuration.patch create mode 100644 platform/nvidia-bluefield/sdk-src/flexio/0001-Remove-meson-from-dependencies.patch create mode 100644 platform/nvidia-bluefield/sdk-src/ofed/templates/control.j2 create mode 100644 platform/nvidia-bluefield/sdk-src/ofed/templates/postinst.j2 create mode 100644 platform/nvidia-bluefield/sdk-src/ofed/templates/postrm.j2 create mode 100644 platform/nvidia-bluefield/sdk-src/rdma/disable-ibverb-dependencies.patch diff --git a/platform/nvidia-bluefield/pinctrl-mlxbf3/pinctrl-mlxbf3.c.patch b/platform/nvidia-bluefield/pinctrl-mlxbf3/pinctrl-mlxbf3.c.patch new file mode 100644 index 000000000000..c78afc4b2805 --- /dev/null +++ b/platform/nvidia-bluefield/pinctrl-mlxbf3/pinctrl-mlxbf3.c.patch @@ -0,0 +1,13 @@ +diff --git a/pinctrl-mlxbf3.c b/pinctrl-mlxbf3.c +index 8371d83..d3746f6 100644 +--- a/pinctrl-mlxbf3.c ++++ b/pinctrl-mlxbf3.c +@@ -18,7 +18,7 @@ + + #define DRV_VERSION "1.0" + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) + struct pinfunction { + const char *name; + const char * const *groups; diff --git a/platform/nvidia-bluefield/recipes/dpu-sai.mk b/platform/nvidia-bluefield/recipes/dpu-sai.mk index 40b3f6e506f5..6cac410ec104 100644 --- a/platform/nvidia-bluefield/recipes/dpu-sai.mk +++ b/platform/nvidia-bluefield/recipes/dpu-sai.mk @@ -15,7 +15,7 @@ # limitations under the License. # -DPU_SAI_VERSION = SAIBuild0.0.29.0 +DPU_SAI_VERSION = SAIBuild0.0.30.0 # Place here URL where SAI sources exist DPU_SAI_SOURCE_BASE_URL= diff --git a/platform/nvidia-bluefield/recipes/sdk.dep b/platform/nvidia-bluefield/recipes/sdk.dep index ced96a512e3f..7e32ba119551 100644 --- a/platform/nvidia-bluefield/recipes/sdk.dep +++ b/platform/nvidia-bluefield/recipes/sdk.dep @@ -112,14 +112,6 @@ $(DPDK_DEV)_CACHE_MODE := GIT_CONTENT_SHA $(DPDK_DEV)_DEP_FLAGS := $(SDK_COMMON_FLAGS_LIST) $(DPDK_DEV)_DEP_FILES := $(DEP_FILES) -# Collectx CLXAPI - -FLAGS := $($(COLLECTX_CLXAPI)_URL) -DEP_FILES := $(SDK_COMMON_FILES_LIST) - -$(COLLECTX_CLXAPI)_CACHE_MODE := GIT_CONTENT_SHA -$(COLLECTX_CLXAPI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(FLAGS) -$(COLLECTX_CLXAPI)_DEP_FILES := $(DEP_FILES) # RXP compiler @@ -135,15 +127,6 @@ $(LIBRXPCOMPILER_DEV)_CACHE_MODE := GIT_CONTENT_SHA $(LIBRXPCOMPILER_DEV)_DEP_FLAGS := $(SDK_COMMON_FLAGS_LIST) $(LIBRXPCOMPILER_DEV)_DEP_FILES := $(DEP_FILES) -# UCX - -SPATH := $($(UCX)_SRC_PATH) -DEP_FILES := $(SDK_COMMON_FILES_LIST) -DEP_FILES += $(shell git ls-files -- $(SPATH)) - -$(UCX)_CACHE_MODE := GIT_CONTENT_SHA -$(UCX)_DEP_FLAGS := $(SDK_COMMON_FLAGS_LIST) -$(UCX)_DEP_FILES := $(DEP_FILES) # GRPC diff --git a/platform/nvidia-bluefield/recipes/sdk.mk b/platform/nvidia-bluefield/recipes/sdk.mk index d2a35a30feb8..0e0a048aef86 100644 --- a/platform/nvidia-bluefield/recipes/sdk.mk +++ b/platform/nvidia-bluefield/recipes/sdk.mk @@ -19,7 +19,7 @@ SDK_BASE_PATH = $(PLATFORM_PATH)/sdk-src/sonic-bluefield-packages/bin # Place here URL where SDK sources exist SDK_SOURCE_BASE_URL = -SDK_VERSION = 24.1-RC3 +SDK_VERSION = 24.4-RC2 SDK_COLLECTX_URL = https://linux.mellanox.com/public/repo/doca/1.5.2/debian12/aarch64/ @@ -213,20 +213,6 @@ export DPDK_DERIVED_DEBS SDK_DEBS += $(DPDK) $(DPDK_DERIVED_DEBS) SDK_SRC_TARGETS += $(DPDK) -# Collectx - -COLLECTX_CLXAPI = collectx_1.14.3-9642347-debian12.1-aarch64-clxapi.deb -$(COLLECTX_CLXAPI)_URL = $(SDK_COLLECTX_URL)/collectx_1.14.3-9642347-debian12.1-aarch64-clxapi.deb -$(COLLECTX_CLXAPI)_RDEPENDS = $(IB_UMAD) - -COLLECTX_CLXAPI_DEV = collectx_1.14.3-9642347-debian12.1-aarch64-clxapidev.deb -$(COLLECTX_CLXAPI_DEV)_URL = $(SDK_COLLECTX_URL)/collectx_1.14.3-9642347-debian12.1-aarch64-clxapidev.deb -$(COLLECTX_CLXAPI_DEV)_DEPENDS = $(COLLECTX_CLXAPI) -$(COLLECTX_CLXAPI_DEV)_RDEPENDS = $(IB_UMAD) - -SDK_DEBS += $(COLLECTX_CLXAPI) $(COLLECTX_CLXAPI_DEV) -SDK_ONLINE_TARGETS += $(COLLECTX_CLXAPI) $(COLLECTX_CLXAPI_DEV) - # RXP compiler and derived packages RXPCOMPILER_VER = $(call get_sdk_package_version_full,"rxp-tools") @@ -245,20 +231,6 @@ export RXPCOMPILER_DERIVED_DEBS SDK_DEBS += $(RXPCOMPILER) $(RXPCOMPILER_DERIVED_DEBS) SDK_SRC_TARGETS += $(RXPCOMPILER) -# UCX and derived packages - -UCX_VER = $(call get_sdk_package_version_full,"ucx") - -UCX = ucx_$(UCX_VER)_arm64.deb -$(UCX)_DEPENDS = $(IB_VERBS_PROV) $(IB_VERBS) $(IB_VERBS_DEV) $(RDMACM) $(RDMACM_DEV) -$(UCX)_RDEPENDS = $(IB_VERBS_PROV) $(IB_VERBS) -$(UCX)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/ucx - -export UCX_VER UCX - -SDK_DEBS += $(UCX) -SDK_SRC_TARGETS += $(UCX) - # GRPC and derived packages LIBGRPC_VER = $(call get_sdk_package_version_full,"grpc") @@ -282,12 +254,12 @@ SDK_SRC_TARGETS += $(LIBGRPC_DEV) DOCA_VERSION = $(call get_sdk_package_version_full,"doca") DOCA_DEB_VERSION = $(DOCA_VERSION)-1 -DOCA_LIBS = doca-libs_${DOCA_DEB_VERSION}_${CONFIGURED_ARCH}.deb +DOCA_LIBS = doca-cx-libs_${DOCA_DEB_VERSION}_${CONFIGURED_ARCH}.deb $(DOCA_LIBS)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/doca -$(DOCA_LIBS)_RDEPENDS = $(DPDK) $(COLLECTX_CLXAPI) $(RXPCOMPILER) $(LIBRXPCOMPILER_DEV) $(UCX) $(LIBGRPC_DEV) $(FLEXIO) -$(DOCA_LIBS)_DEPENDS = $(COLLECTX_CLXAPI) $(COLLECTX_CLXAPI_DEV) $(RXPCOMPILER) $(LIBRXPCOMPILER_DEV) $(UCX) $(DPDK_DEV) $(LIBGRPC_DEV) $(FLEXIO) -DOCA_LIBS_DEV = libdoca-libs-dev_${DOCA_DEB_VERSION}_${CONFIGURED_ARCH}.deb -DOCA_LIBS_DBG = doca-libs-dbgsym_${DOCA_DEB_VERSION}_${CONFIGURED_ARCH}.deb +$(DOCA_LIBS)_RDEPENDS = $(DPDK) $(RXPCOMPILER) $(LIBRXPCOMPILER_DEV) $(LIBGRPC_DEV) $(FLEXIO) +$(DOCA_LIBS)_DEPENDS = $(RXPCOMPILER) $(LIBRXPCOMPILER_DEV) $(DPDK_DEV) $(LIBGRPC_DEV) $(FLEXIO) +DOCA_LIBS_DEV = libdoca-cx-libs-dev_${DOCA_DEB_VERSION}_${CONFIGURED_ARCH}.deb +DOCA_LIBS_DBG = doca-cx-libs-dbgsym_${DOCA_DEB_VERSION}_${CONFIGURED_ARCH}.deb $(eval $(call add_derived_package,$(DOCA_LIBS),$(DOCA_LIBS_DEV))) $(eval $(call add_derived_package,$(DOCA_LIBS),$(DOCA_LIBS_DBG))) diff --git a/platform/nvidia-bluefield/sdk-src/doca/0001-Remove-meson-from-connectx-dependencies.patch b/platform/nvidia-bluefield/sdk-src/doca/0001-Remove-meson-from-connectx-dependencies.patch new file mode 100644 index 000000000000..4823ce1aed1a --- /dev/null +++ b/platform/nvidia-bluefield/sdk-src/doca/0001-Remove-meson-from-connectx-dependencies.patch @@ -0,0 +1,28 @@ +diff --git a/configs/profiles/connectx/debian/control b/configs/profiles/connectx/debian/control +index 62f9403..fea0155 100644 +--- a/configs/profiles/connectx/debian/control ++++ b/configs/profiles/connectx/debian/control +@@ -4,7 +4,6 @@ Maintainer: + Build-Depends: debhelper (>= 10~), + gcc, + g++, +- meson, + pkg-config, + libibverbs-dev, + mlnx-dpdk-dev, +@@ -55,7 +54,6 @@ Architecture: amd64 arm64 armhf i386 ppc64el + Depends: ${misc:Depends}, + libdoca-cx-libs-dev, + gcc, +- meson, + pkg-config, + mlnx-dpdk-dev, + libjson-c-dev, +@@ -71,7 +69,6 @@ Architecture: amd64 arm64 armhf i386 ppc64el + Depends: ${misc:Depends}, + libdoca-cx-libs-dev, + gcc, +- meson, + pkg-config, + mlnx-dpdk-dev, + libjson-c-dev diff --git a/platform/nvidia-bluefield/sdk-src/doca/Makefile b/platform/nvidia-bluefield/sdk-src/doca/Makefile index e3bc80c06e66..47d9b00d93a0 100644 --- a/platform/nvidia-bluefield/sdk-src/doca/Makefile +++ b/platform/nvidia-bluefield/sdk-src/doca/Makefile @@ -36,12 +36,13 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : find . -type f -exec touch {} + patch -p1 < ../0001-Allow-compilation-with-warnings.patch - patch -p1 < ../0001-Remove-meson-from-dependencies.patch + patch -p1 < ../0001-Remove-meson-from-connectx-dependencies.patch + source /etc/profile.d/libgrpc.sh source /etc/profile.d/mlnx-dpdk-aarch64-linux-gnu.sh # Build the Debs - PATH=/opt/mellanox/grpc/bin:/usr/bin/:$(PATH) dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) + PATH=/opt/mellanox/grpc/bin:/usr/bin/:$(PATH) ./devtools/doca_package_build.sh connectx popd mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/platform/nvidia-bluefield/sdk-src/dpdk/0001-Remove-meson-from-dependencies.patch b/platform/nvidia-bluefield/sdk-src/dpdk/0001-Remove-meson-from-dependencies.patch new file mode 100644 index 000000000000..c1f663de9c63 --- /dev/null +++ b/platform/nvidia-bluefield/sdk-src/dpdk/0001-Remove-meson-from-dependencies.patch @@ -0,0 +1,24 @@ +From 178c90074d62fc6d8dfcef500cde1de8b4928eee Mon Sep 17 00:00:00 2001 +From: Oleksandr Ivantsiv +Date: Fri, 18 Nov 2022 20:09:52 +0200 +Subject: [PATCH] Remove meson from dependencies. + +--- + debian/control | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/debian/control b/debian/control +index a737765..b99b3e9 100644 +--- a/debian/control ++++ b/debian/control +@@ -21,7 +21,6 @@ Build-Depends: debhelper (>= 10.3~), + linux-headers-arm64 [arm64] | linux-headers-generic [arm64], + linux-headers-armmp [armhf] | linux-headers-generic [armhf], + linux-headers-powerpc64le [ppc64el] | linux-headers-generic [ppc64el], +- meson (>= 0.41~), + pkg-config, + python3, + python3-sphinx , +-- +2.25.1 + diff --git a/platform/nvidia-bluefield/sdk-src/flexio/0001-Allow-warning-during-package-compilation.patch b/platform/nvidia-bluefield/sdk-src/flexio/0001-Allow-warning-during-package-compilation.patch new file mode 100644 index 000000000000..99b4b710d4f8 --- /dev/null +++ b/platform/nvidia-bluefield/sdk-src/flexio/0001-Allow-warning-during-package-compilation.patch @@ -0,0 +1,32 @@ +From 6ce6a644e561f22021d031bc99f7b54a8d1142ad Mon Sep 17 00:00:00 2001 +From: Oleksandr Ivantsiv +Date: Mon, 10 Oct 2022 15:46:31 +0300 +Subject: [PATCH] Allow warning during package compilation. + +--- + debian/rules | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/debian/rules b/debian/rules +index 01e76c4..f4460af 100755 +--- a/debian/rules ++++ b/debian/rules +@@ -8,13 +8,13 @@ export DEB_BUILD_OPTIONS=nostrip + dh $@ + + override_dh_auto_build: +- ./build.sh ++ ./build.sh --allow_warnings + ./scripts/cp_pkg_content.sh deb ./debian/tmp + + clean: + rm -f ./debian/debhelper-build-stamp ./debian/files ./debian/flexio.debhelper.log + rm -rf ./debian/flexio.substvars ./debian/tmp ./debian/flexio +- ./build.sh --clean ++ ./build.sh --clean --allow_warnings + + override_dh_prep: + @ echo DH PREP +-- +2.25.1 + diff --git a/platform/nvidia-bluefield/sdk-src/flexio/0001-Install-LD-configuration.patch b/platform/nvidia-bluefield/sdk-src/flexio/0001-Install-LD-configuration.patch new file mode 100644 index 000000000000..abb61369b30d --- /dev/null +++ b/platform/nvidia-bluefield/sdk-src/flexio/0001-Install-LD-configuration.patch @@ -0,0 +1,30 @@ +From a009c7ed8fb199aaf456d91471937d1cc80871bc Mon Sep 17 00:00:00 2001 +From: Oleksandr Ivantsiv +Date: Mon, 17 Oct 2022 17:02:43 +0300 +Subject: [PATCH] Install LD configuration. + +--- + debian/flexio-aarch64-linux-gnu.conf | 1 + + debian/flexio.install | 3 ++- + 2 files changed, 3 insertions(+), 1 deletion(-) + create mode 100644 debian/flexio-aarch64-linux-gnu.conf + +diff --git a/debian/flexio-aarch64-linux-gnu.conf b/debian/flexio-aarch64-linux-gnu.conf +new file mode 100644 +index 0000000..abfff31 +--- /dev/null ++++ b/debian/flexio-aarch64-linux-gnu.conf +@@ -0,0 +1 @@ ++/opt/mellanox/flexio/lib/ +diff --git a/debian/flexio.install b/debian/flexio.install +index c54c604..93238ad 100644 +--- a/debian/flexio.install ++++ b/debian/flexio.install +@@ -1 +1,2 @@ +-debian/tmp/* / +\ No newline at end of file ++debian/tmp/* / ++debian/flexio-aarch64-linux-gnu.conf /etc/ld.so.conf.d/ +-- +2.25.1 + diff --git a/platform/nvidia-bluefield/sdk-src/flexio/0001-Remove-meson-from-dependencies.patch b/platform/nvidia-bluefield/sdk-src/flexio/0001-Remove-meson-from-dependencies.patch new file mode 100644 index 000000000000..d191e446d5b9 --- /dev/null +++ b/platform/nvidia-bluefield/sdk-src/flexio/0001-Remove-meson-from-dependencies.patch @@ -0,0 +1,24 @@ +From d2168682c00d3738d458a4f2bce23595e0e0729c Mon Sep 17 00:00:00 2001 +From: Oleksandr Ivantsiv +Date: Fri, 18 Nov 2022 17:29:38 +0200 +Subject: [PATCH] Remove meson from dependencies. + +--- + debian/control | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/debian/control b/debian/control +index b8a9ca1..d2367e3 100644 +--- a/debian/control ++++ b/debian/control +@@ -6,7 +6,6 @@ Build-Depends: autotools-dev, + debhelper (>= 10), + clang, + lld, +- meson, + patchelf + #Standards-Version: 4.1.2 + Homepage: www.nvidia.com +-- +2.25.1 + diff --git a/platform/nvidia-bluefield/sdk-src/ofed/templates/control.j2 b/platform/nvidia-bluefield/sdk-src/ofed/templates/control.j2 new file mode 100644 index 000000000000..029c41495fed --- /dev/null +++ b/platform/nvidia-bluefield/sdk-src/ofed/templates/control.j2 @@ -0,0 +1,23 @@ +{#- + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-#} +Package: mlnx-ofed-kernel-modules-{{kversion}} +Source: mlnx-ofed-kernel-modules-bin +Version: {{mft_version}} +Architecture: arm64 +Maintainer: Vivek Reddy +Provides: mlnx-ofed-kernel-modules +Depends: linux-image-{{ kversion }}-unsigned +Section: misc +Priority: optional +Description: mlnx-ofed-kernel-modules binary drivers for linux-image-{{kversion}} Kernel diff --git a/platform/nvidia-bluefield/sdk-src/ofed/templates/postinst.j2 b/platform/nvidia-bluefield/sdk-src/ofed/templates/postinst.j2 new file mode 100644 index 000000000000..a94c53f4ef3a --- /dev/null +++ b/platform/nvidia-bluefield/sdk-src/ofed/templates/postinst.j2 @@ -0,0 +1,17 @@ +{#- + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-#} + +#!/bin/sh +set -e +depmod -a {{kversion}} diff --git a/platform/nvidia-bluefield/sdk-src/ofed/templates/postrm.j2 b/platform/nvidia-bluefield/sdk-src/ofed/templates/postrm.j2 new file mode 100644 index 000000000000..a94c53f4ef3a --- /dev/null +++ b/platform/nvidia-bluefield/sdk-src/ofed/templates/postrm.j2 @@ -0,0 +1,17 @@ +{#- + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +-#} + +#!/bin/sh +set -e +depmod -a {{kversion}} diff --git a/platform/nvidia-bluefield/sdk-src/rdma/disable-ibverb-dependencies.patch b/platform/nvidia-bluefield/sdk-src/rdma/disable-ibverb-dependencies.patch new file mode 100644 index 000000000000..b551b9e48dfb --- /dev/null +++ b/platform/nvidia-bluefield/sdk-src/rdma/disable-ibverb-dependencies.patch @@ -0,0 +1,22 @@ +diff --git a/debian/control b/debian/control +index 0ef86f4..3e8dfb1 100644 +--- a/debian/control ++++ b/debian/control +@@ -65,7 +65,7 @@ Description: InfiniBand Communication Manager Assistant (ACM) + Package: ibverbs-providers + Architecture: linux-any + Multi-Arch: same +-Depends: ${misc:Depends}, ${shlibs:Depends} ++#Depends: ${misc:Depends}, ${shlibs:Depends} + Provides: libefa1, libipathverbs1, libmana1, libmlx5-1, libmthca1 + Replaces: libipathverbs1, + libmlx5-1, +@@ -138,7 +138,7 @@ Section: libs + Pre-Depends: ${misc:Pre-Depends} + Depends: adduser, ${misc:Depends}, ${shlibs:Depends} + Recommends: ibverbs-providers +-Breaks: ibverbs-providers (<< 34~) ++#Breaks: ibverbs-providers (<< 34~) + Description: Library for direct userspace use of RDMA (InfiniBand/iWARP) + libibverbs is a library that allows userspace processes to use RDMA + "verbs" as described in the InfiniBand Architecture Specification and From d7ae4cb61270d5263d20ba13c8ef5762ecdb63a1 Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Tue, 30 Apr 2024 15:34:35 -0700 Subject: [PATCH 024/282] [nvidia-bluefield] Add support Nvidia BF-3 platform to swss and syncd containers (#18806) - Add platform-specific extension to include NIC FW into the SONiC image. --- dockers/docker-orchagent/orchagent.sh | 2 ++ files/build_templates/sonic_debian_extension.j2 | 17 +++++++++++++++++ files/scripts/syncd.sh | 6 ++++++ 3 files changed, 25 insertions(+) diff --git a/dockers/docker-orchagent/orchagent.sh b/dockers/docker-orchagent/orchagent.sh index 79434668dcc7..1b2a1b88ab72 100755 --- a/dockers/docker-orchagent/orchagent.sh +++ b/dockers/docker-orchagent/orchagent.sh @@ -64,6 +64,8 @@ elif [ "$platform" == "mellanox" ]; then ORCHAGENT_ARGS+="" elif [ "$platform" == "innovium" ]; then ORCHAGENT_ARGS+="-m $MAC_ADDRESS" +elif [ "$platform" == "nvidia-bluefield" ]; then + ORCHAGENT_ARGS+="-m $MAC_ADDRESS" elif [ "$platform" == "pensando" ]; then MAC_ADDRESS=$(ip link property add dev oob_mnic0 altname eth0; ip link show oob_mnic0 | grep ether | awk '{print $2}') ORCHAGENT_ARGS+="-m $MAC_ADDRESS" diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index cd22584c942d..77ecf9509acb 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -1040,6 +1040,23 @@ sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable nv-syncd-shared sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install minicom {% endif %} +{% if sonic_asic_platform == "nvidia-bluefield" %} +declare -rA FW_FILE_MAP=( \ + [$BF3_FW_FILE]="fw-BF3.mfa" \ +) +sudo mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/dpu/ +sudo mkdir -p $FILESYSTEM_ROOT/etc/bluefield/ +for fw_file_name in ${!FW_FILE_MAP[@]}; do + sudo cp $files_path/$fw_file_name $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/dpu/${FW_FILE_MAP[$fw_file_name]} + sudo ln -s /host/image-$SONIC_IMAGE_VERSION/$PLATFORM_DIR/fw/dpu/${FW_FILE_MAP[$fw_file_name]} $FILESYSTEM_ROOT/etc/bluefield/${FW_FILE_MAP[$fw_file_name]} +done + +SONIC_PLATFORM_PY3_WHEEL_NAME=$(basename {{platform_api_py3_wheel_path}}) +sudo cp {{platform_api_py3_wheel_path}} $FILESYSTEM_ROOT/$SONIC_PLATFORM_PY3_WHEEL_NAME +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $SONIC_PLATFORM_PY3_WHEEL_NAME +sudo rm -rf $FILESYSTEM_ROOT/$SONIC_PLATFORM_PY3_WHEEL_NAME +{% endif %} + {%- if SONIC_ROUTING_STACK == "frr" %} sudo mkdir $FILESYSTEM_ROOT/etc/sonic/frr sudo touch $FILESYSTEM_ROOT/etc/sonic/frr/frr.conf diff --git a/files/scripts/syncd.sh b/files/scripts/syncd.sh index e9c2cfd494ba..c6fbf008c6dc 100755 --- a/files/scripts/syncd.sh +++ b/files/scripts/syncd.sh @@ -86,6 +86,10 @@ function startplatform() { /etc/init.d/xpnet.sh start fi fi + + if [[ x"$sonic_asic_platform" == x"nvidia-bluefield" ]]; then + /usr/bin/bfnet.sh start + fi } function waitplatform() { @@ -155,6 +159,8 @@ function stopplatform2() { elif [ x$sonic_asic_platform == x'cavium' ]; then /etc/init.d/xpnet.sh stop /etc/init.d/xpnet.sh start + elif [ x"$sonic_asic_platform" == x"nvidia-bluefield" ]; then + /usr/bin/bfnet.sh stop fi fi } From 4bdccbdb88d6c5e6429156dda02f002eca3269ca Mon Sep 17 00:00:00 2001 From: Pavan Naregundi <92989231+pavannaregundi@users.noreply.github.com> Date: Wed, 1 May 2024 04:54:12 +0530 Subject: [PATCH 025/282] [Marvell]: Upgrade syncd, syncd-rpc and saiserver to bookworm (#18740) * [Marvell] syncd migration to bookworm Signed-off-by: Pavan Naregundi * Add docker-saiserver-mrvl Signed-off-by: Pavan Naregundi * [Marvell-armhf] Update SAI SDK version to 1.13.0-3 Signed-off-by: Pavan Naregundi --------- Signed-off-by: Pavan Naregundi --- platform/marvell/docker-saiserver-mrvl.mk | 8 ++-- .../docker-saiserver-mrvl/Dockerfile.j2 | 35 +++++++++++++++++ .../marvell/docker-saiserver-mrvl/start.sh | 7 ++++ .../docker-saiserver-mrvl/supervisord.conf | 28 +++++++++++++ platform/marvell/docker-syncd-mrvl-rpc.mk | 5 ++- .../docker-syncd-mrvl-rpc/Dockerfile.j2 | 39 ++++++++++--------- platform/marvell/docker-syncd-mrvl.mk | 2 +- .../marvell/docker-syncd-mrvl/Dockerfile.j2 | 4 +- platform/marvell/libsaithrift-dev.mk | 19 +++++---- platform/marvell/rules.mk | 1 + platform/marvell/sai.mk | 2 +- 11 files changed, 115 insertions(+), 35 deletions(-) create mode 100644 platform/marvell/docker-saiserver-mrvl/Dockerfile.j2 create mode 100755 platform/marvell/docker-saiserver-mrvl/start.sh create mode 100644 platform/marvell/docker-saiserver-mrvl/supervisord.conf diff --git a/platform/marvell/docker-saiserver-mrvl.mk b/platform/marvell/docker-saiserver-mrvl.mk index 7e5c83ffc344..c6bd3e2ca1e7 100644 --- a/platform/marvell/docker-saiserver-mrvl.mk +++ b/platform/marvell/docker-saiserver-mrvl.mk @@ -1,13 +1,13 @@ # docker image for mrvl saiserver -DOCKER_SAISERVER_MRVL = docker-saiserver-mrvl.gz +DOCKER_SAISERVER_MRVL = docker-saiserver$(SAITHRIFT_VER)-mrvl.gz $(DOCKER_SAISERVER_MRVL)_PATH = $(PLATFORM_PATH)/docker-saiserver-mrvl $(DOCKER_SAISERVER_MRVL)_DEPENDS += $(SAISERVER) -$(DOCKER_SAISERVER_MRVL)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE) +$(DOCKER_SAISERVER_MRVL)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM) SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_MRVL) -SONIC_BULLSEYE_DOCKERS += $(DOCKER_SAISERVER_MRVL) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_SAISERVER_MRVL) -$(DOCKER_SAISERVER_MRVL)_CONTAINER_NAME = saiserver +$(DOCKER_SAISERVER_MRVL)_CONTAINER_NAME = saiserver$(SAITHRIFT_VER) $(DOCKER_SAISERVER_MRVL)_RUN_OPT += --privileged -t $(DOCKER_SAISERVER_MRVL)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SAISERVER_MRVL)_RUN_OPT += -v /var/run/docker-saiserver:/var/run/sswsyncd diff --git a/platform/marvell/docker-saiserver-mrvl/Dockerfile.j2 b/platform/marvell/docker-saiserver-mrvl/Dockerfile.j2 new file mode 100644 index 000000000000..1760fb872b92 --- /dev/null +++ b/platform/marvell/docker-saiserver-mrvl/Dockerfile.j2 @@ -0,0 +1,35 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages %} +FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} + +ARG docker_container_name + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get -y install \ + libboost-atomic1.74.0 \ + libqt5core5a \ + libqt5network5 \ + gdb \ + libthrift-0.17.0 + +COPY \ +{% for deb in docker_saiserver_mrvl_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_saiserver_mrvl_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +COPY ["start.sh", "/usr/bin/"] +COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] + +## Clean up +RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y +RUN rm -rf /debs + +ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/platform/marvell/docker-saiserver-mrvl/start.sh b/platform/marvell/docker-saiserver-mrvl/start.sh new file mode 100755 index 000000000000..09cc0ddb5416 --- /dev/null +++ b/platform/marvell/docker-saiserver-mrvl/start.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +rm -f /var/run/rsyslogd.pid + +supervisorctl start rsyslogd + +supervisorctl start saiserver diff --git a/platform/marvell/docker-saiserver-mrvl/supervisord.conf b/platform/marvell/docker-saiserver-mrvl/supervisord.conf new file mode 100644 index 000000000000..ccb107b3d1f8 --- /dev/null +++ b/platform/marvell/docker-saiserver-mrvl/supervisord.conf @@ -0,0 +1,28 @@ +[supervisord] +logfile_maxbytes=1MB +logfile_backups=2 +nodaemon=true + +[program:start.sh] +command=/usr/bin/start.sh +priority=1 +autostart=true +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n +priority=2 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog + +[program:saiserver] +command=/usr/sbin/saiserver -p /usr/share/sonic/hwsku/sai.profile -f /usr/share/sonic/hwsku/port_config.ini +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog diff --git a/platform/marvell/docker-syncd-mrvl-rpc.mk b/platform/marvell/docker-syncd-mrvl-rpc.mk index d642f4da4d9c..bf4bb103635f 100644 --- a/platform/marvell/docker-syncd-mrvl-rpc.mk +++ b/platform/marvell/docker-syncd-mrvl-rpc.mk @@ -2,7 +2,8 @@ DOCKER_SYNCD_MRVL_RPC = docker-syncd-mrvl-rpc.gz $(DOCKER_SYNCD_MRVL_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-mrvl-rpc -$(DOCKER_SYNCD_MRVL_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(PTF) +$(DOCKER_SYNCD_MRVL_RPC)_DEPENDS += $(SYNCD_RPC) +$(DOCKER_SYNCD_MRVL_RPC)_PYTHON_WHEELS += $(PTF_PY3) $(DOCKER_SYNCD_MRVL_RPC)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) ifeq ($(INSTALL_DEBUG_TOOLS), y) $(DOCKER_SYNCD_MRVL_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \ @@ -25,4 +26,4 @@ $(DOCKER_SYNCD_MRVL_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SYNCD_MRVL_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_SYNCD_MRVL_RPC)_RUN_OPT += -v /host/warmboot:/var/warmboot -SONIC_BULLSEYE_DOCKERS += $(DOCKER_SYNCD_MRVL_RPC) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_SYNCD_MRVL_RPC) diff --git a/platform/marvell/docker-syncd-mrvl-rpc/Dockerfile.j2 b/platform/marvell/docker-syncd-mrvl-rpc/Dockerfile.j2 index 6bd7fb9c7f64..02d962d19cee 100644 --- a/platform/marvell/docker-syncd-mrvl-rpc/Dockerfile.j2 +++ b/platform/marvell/docker-syncd-mrvl-rpc/Dockerfile.j2 @@ -1,4 +1,5 @@ FROM docker-syncd-mrvl-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +{% from "dockers/dockerfile-macros.j2" import install_python_wheels, copy_files %} ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive @@ -20,37 +21,39 @@ RUN apt-get update \ build-essential \ libssl-dev \ libffi-dev \ - python-dev \ + python3-dev \ wget \ - cmake \ libqt5core5a \ libqt5network5 \ - libboost-atomic1.74.0 + libboost-atomic1.74.0 \ + libthrift-0.17.0 \ + libnanomsg5 \ + libnanomsg-dev RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ {% for deb in docker_syncd_mrvl_rpc_debs.split(' ') -%} dpkg_apt debs/{{ deb }}{{'; '}} {%- endfor %} -RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ - && tar xvfz 1.0.0.tar.gz \ - && cd nanomsg-1.0.0 \ - && mkdir -p build \ - && cmake . \ - && make install \ - && ldconfig \ - && cd .. \ - && rm -fr nanomsg-1.0.0 \ - && rm -f 1.0.0.tar.gz \ - && pip3 install cffi==1.7.0 \ - && pip3 install --upgrade cffi==1.7.0 \ +RUN pip3 install cffi \ && pip3 install nnpy \ && mkdir -p /opt \ && cd /opt \ - && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ - && apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ - && rm -rf /root/deps + && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"] +{% if docker_syncd_mrvl_rpc_whls.strip() -%} +# Copy locally-built Python wheel dependencies +{{ copy_files("python-wheels/", docker_syncd_mrvl_rpc_whls.split(' '), "/python-wheels/") }} + +# Install locally-built Python wheel dependencies +{{ install_python_wheels(docker_syncd_mrvl_rpc_whls.split(' ')) }} +{% endif %} + +## Clean up +RUN apt-get purge -y libyaml-dev python3-dev libffi-dev libssl-dev wget build-essential +RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y +RUN rm -rf /root/deps + ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/platform/marvell/docker-syncd-mrvl.mk b/platform/marvell/docker-syncd-mrvl.mk index 566de773b338..d4c990cfe426 100644 --- a/platform/marvell/docker-syncd-mrvl.mk +++ b/platform/marvell/docker-syncd-mrvl.mk @@ -1,7 +1,7 @@ # docker image for mrvl syncd DOCKER_SYNCD_PLATFORM_CODE = mrvl -include $(PLATFORM_PATH)/../template/docker-syncd-bullseye.mk +include $(PLATFORM_PATH)/../template/docker-syncd-bookworm.mk $(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(DOCKER_SYNCD_BASE)_DEPENDS += $(MRVL_SAI) diff --git a/platform/marvell/docker-syncd-mrvl/Dockerfile.j2 b/platform/marvell/docker-syncd-mrvl/Dockerfile.j2 index 84e3d5bde2fb..a721a86428fa 100755 --- a/platform/marvell/docker-syncd-mrvl/Dockerfile.j2 +++ b/platform/marvell/docker-syncd-mrvl/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages %} -FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name @@ -19,7 +19,7 @@ RUN apt-get update \ net-tools \ iputils-ping -RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev nfs-common +RUN apt-get -y install libpcap-dev libxml2-dev python3-dev swig RUN dpkg -i \ {% for deb in docker_syncd_mrvl_debs.split(' ') -%} diff --git a/platform/marvell/libsaithrift-dev.mk b/platform/marvell/libsaithrift-dev.mk index e1c3da156ec2..eb13006f7be9 100644 --- a/platform/marvell/libsaithrift-dev.mk +++ b/platform/marvell/libsaithrift-dev.mk @@ -2,19 +2,24 @@ SAI_VER = 0.9.4 -LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb +LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb $(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI -$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(MRVL_FPA) $(MRVL_SAI) -$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(MRVL_SAI) + +ifeq ($(SAITHRIFT_V2),y) +$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2 +endif + +$(LIBSAITHRIFT_DEV)_DEPENDS += $(MRVL_SAI) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(MRVL_SAI) $(LIBSAIMETADATA) SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) -PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_$(CONFIGURED_ARCH).deb +PYTHON_SAITHRIFT = python-saithrift$(SAITHRIFT_VER)_$(SAI_VER)_$(CONFIGURED_ARCH).deb $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT))) -SAISERVER = saiserver_$(SAI_VER)_$(CONFIGURED_ARCH).deb -$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(MRVL_SAI) +SAISERVER = saiserver$(SAITHRIFT_VER)_$(SAI_VER)_$(CONFIGURED_ARCH).deb +$(SAISERVER)_RDEPENDS += $(LIBSAITHRIFT_DEV) $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER))) -SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_$(CONFIGURED_ARCH).deb +SAISERVER_DBG = saiserver$(SAITHRIFT_VER)-dbg_$(SAI_VER)_$(CONFIGURED_ARCH).deb $(SAISERVER_DBG)_RDEPENDS += $(SAISERVER) $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG))) diff --git a/platform/marvell/rules.mk b/platform/marvell/rules.mk index 0b78cd088a01..825d8d331a17 100644 --- a/platform/marvell/rules.mk +++ b/platform/marvell/rules.mk @@ -19,6 +19,7 @@ $(SYNCD)_DEPENDS += $(MRVL_SAI) $(SYNCD)_UNINSTALLS += $(MRVL_SAI) ifeq ($(ENABLE_SYNCD_RPC),y) +$(SYNCD)_DEPENDS := $(filter-out $(LIBTHRIFT_DEV),$($(SYNCD)_DEPENDS)) $(SYNCD)_DEPENDS += $(LIBSAITHRIFT_DEV) endif diff --git a/platform/marvell/sai.mk b/platform/marvell/sai.mk index 4fd89bf6cf83..3a50da904b99 100644 --- a/platform/marvell/sai.mk +++ b/platform/marvell/sai.mk @@ -4,7 +4,7 @@ BRANCH = master ifeq ($(CONFIGURED_ARCH),arm64) MRVL_SAI_VERSION = 1.13.0-1 else ifeq ($(CONFIGURED_ARCH),armhf) -MRVL_SAI_VERSION = 1.13.0-2 +MRVL_SAI_VERSION = 1.13.0-3 else MRVL_SAI_VERSION = 1.13.0-1 endif From 24a40c5c8a54a961990328e3bdec7291c56224f2 Mon Sep 17 00:00:00 2001 From: Akhilesh Samineni <47657796+AkhileshSamineni@users.noreply.github.com> Date: Wed, 1 May 2024 04:54:28 +0530 Subject: [PATCH 026/282] Upgrade the NAT docker to bookworm (#18799) * Upgrade the NAT docker to bookworm Signed-off-by: Akhilesh Samineni * Corrected the iptables Makefile Signed-off-by: Akhilesh Samineni * Updated the fullcone patch for iptables 1.8.9 version Signed-off-by: Akhilesh Samineni --------- Signed-off-by: Akhilesh Samineni --- dockers/docker-nat/Dockerfile.j2 | 2 +- rules/docker-nat.mk | 10 +- rules/iptables.mk | 4 +- src/iptables/Makefile | 2 +- ...ng-fullcone-option-for-SNAT-and-DNAT.patch | 346 ++++-------------- 5 files changed, 86 insertions(+), 278 deletions(-) diff --git a/dockers/docker-nat/Dockerfile.j2 b/dockers/docker-nat/Dockerfile.j2 index 23adcf3afa33..821c194a48e2 100644 --- a/dockers/docker-nat/Dockerfile.j2 +++ b/dockers/docker-nat/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, copy_files %} -FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-swss-layer-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name diff --git a/rules/docker-nat.mk b/rules/docker-nat.mk index 0298ace831c2..d15c43622886 100644 --- a/rules/docker-nat.mk +++ b/rules/docker-nat.mk @@ -7,11 +7,11 @@ DOCKER_NAT_DBG = $(DOCKER_NAT_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_NAT)_PATH = $(DOCKERS_PATH)/$(DOCKER_NAT_STEM) $(DOCKER_NAT)_DEPENDS += $(SWSS) $(IPTABLESIP4TC) $(IPTABLESIP6TC) $(IPTABLESIPTC) $(IPXTABLES12) $(IPTABLES) -$(DOCKER_NAT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS) +$(DOCKER_NAT)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_DEPENDS) $(DOCKER_NAT)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) -$(DOCKER_NAT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES) +$(DOCKER_NAT)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_IMAGE_PACKAGES) -$(DOCKER_NAT)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE) +$(DOCKER_NAT)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BOOKWORM) $(DOCKER_NAT)_VERSION = 1.0.0 $(DOCKER_NAT)_PACKAGE_NAME = nat @@ -38,5 +38,5 @@ $(DOCKER_NAT)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(DOCKER_NAT)_BASE_IMAGE_FILES += natctl:/usr/bin/natctl -SONIC_BULLSEYE_DOCKERS += $(DOCKER_NAT) -SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_NAT_DBG) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_NAT) +SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_NAT_DBG) diff --git a/rules/iptables.mk b/rules/iptables.mk index f8515f894969..c721d0919fe2 100644 --- a/rules/iptables.mk +++ b/rules/iptables.mk @@ -1,7 +1,7 @@ # iptables package -IPTABLES_VERSION = 1.8.7 -IPTABLES_VERSION_SUFFIX = 1 +IPTABLES_VERSION = 1.8.9 +IPTABLES_VERSION_SUFFIX = 2 IPTABLES_VERSION_FULL = $(IPTABLES_VERSION)-$(IPTABLES_VERSION_SUFFIX) IPTABLES = iptables_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb diff --git a/src/iptables/Makefile b/src/iptables/Makefile index a048ea5a9535..3efa01dfd546 100644 --- a/src/iptables/Makefile +++ b/src/iptables/Makefile @@ -11,7 +11,7 @@ DERIVED_TARGETS = libip4tc2_$(IPTABLES_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ IPTABLES_URL = http://deb.debian.org/debian/pool/main/i/iptables DSC_FILE = iptables_$(IPTABLES_VERSION_FULL).dsc -ORIG_FILE = iptables_$(IPTABLES_VERSION).orig.tar.bz2 +ORIG_FILE = iptables_$(IPTABLES_VERSION).orig.tar.xz DEBIAN_FILE = iptables_$(IPTABLES_VERSION_FULL).debian.tar.xz DSC_FILE_URL = $(IPTABLES_URL)/$(DSC_FILE) diff --git a/src/iptables/patch/0001-Passing-fullcone-option-for-SNAT-and-DNAT.patch b/src/iptables/patch/0001-Passing-fullcone-option-for-SNAT-and-DNAT.patch index 4e06adf9deb4..e07730aa479b 100644 --- a/src/iptables/patch/0001-Passing-fullcone-option-for-SNAT-and-DNAT.patch +++ b/src/iptables/patch/0001-Passing-fullcone-option-for-SNAT-and-DNAT.patch @@ -1,41 +1,54 @@ -From 386bb8378bc67b7dfc3db5d5f28a01620b4231cf Mon Sep 17 00:00:00 2001 -From: Kiran Kella -Date: Wed, 7 Aug 2019 07:22:42 -0700 -Subject: [PATCH] From 92f5aee7372748845f11b7a10d880f968769e860 Mon Sep 17 - 00:00:00 2001 Subject: [PATCH] Passing fullcone option for SNAT and DNAT +From 1cb735fdb3d3fa165fe5d02b55aad98037de42a6 Mon Sep 17 00:00:00 2001 +From: Akhilesh Samineni +Date: Sat, 27 Apr 2024 10:43:10 -0700 +Subject: [PATCH] Passing fullcone option for SNAT and DNAT --- - extensions/libipt_DNAT.c | 37 ++++++++++++++++++++++++++++++++-- - extensions/libipt_MASQUERADE.c | 22 +++++++++++++++++++- - extensions/libipt_SNAT.c | 22 +++++++++++++++++++- - 3 files changed, 77 insertions(+), 4 deletions(-) + extensions/libxt_NAT.c | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) -diff --git a/extensions/libipt_DNAT.c b/extensions/libipt_DNAT.c -index 4907a2e..95e3446 100644 ---- a/extensions/libipt_DNAT.c -+++ b/extensions/libipt_DNAT.c -@@ -8,14 +8,20 @@ - #include +diff --git a/extensions/libxt_NAT.c b/extensions/libxt_NAT.c +index da9f220..cfcc1ff 100644 +--- a/extensions/libxt_NAT.c ++++ b/extensions/libxt_NAT.c +@@ -17,6 +17,8 @@ + #include #include -+/* Temporarily defining here, need to be picked up from the -+ * new kernel header linux/netfilter/nf_nat.h */ +#define NF_NAT_RANGE_FULLCONE (1 << 10) + - enum { - O_TO_DEST = 0, + #define TO_IPV4_MRC(ptr) ((const struct nf_nat_ipv4_multi_range_compat *)(ptr)) + #define RANGE2_INIT_FROM_IPV4_MRC(ptr) { \ + .flags = TO_IPV4_MRC(ptr)->range[0].flags, \ +@@ -41,6 +43,7 @@ enum { O_RANDOM, + O_RANDOM_FULLY, O_PERSISTENT, - O_X_TO_DEST, /* hidden flag */ + O_FULLCONE, - F_TO_DEST = 1 << O_TO_DEST, - F_RANDOM = 1 << O_RANDOM, - F_X_TO_DEST = 1 << O_X_TO_DEST, -+ F_FULLCONE = 1 << O_FULLCONE }; - /* Dest NAT data consists of a multi-range, indicating where to map -@@ -32,7 +38,7 @@ static void DNAT_help(void) + static void SNAT_help(void) +@@ -49,7 +52,7 @@ static void SNAT_help(void) + "SNAT target options:\n" + " --to-source [[-]][:port[-port]]\n" + " Address to map source to.\n" +-"[--random] [--random-fully] [--persistent]\n"); ++"[--random] [--random-fully] [--persistent] [--fullcone]\n"); + } + + static void MASQUERADE_help(void) +@@ -61,7 +64,9 @@ static void MASQUERADE_help(void) + " --random\n" + " Randomize source port.\n" + " --random-fully\n" +-" Fully randomize source port.\n"); ++" Fully randomize source port.\n" ++" --fullcone\n" ++" Do fullcone NAT mapping.\n"); + } + + static void DNAT_help(void) +@@ -70,7 +75,7 @@ static void DNAT_help(void) "DNAT target options:\n" " --to-destination [[-]][:port[-port]]\n" " Address to map destination to.\n" @@ -44,7 +57,7 @@ index 4907a2e..95e3446 100644 } static void DNAT_help_v2(void) -@@ -41,7 +47,7 @@ static void DNAT_help_v2(void) +@@ -79,7 +84,7 @@ static void DNAT_help_v2(void) "DNAT target options:\n" " --to-destination [[-]][:port[-port[/port]]]\n" " Address to map destination to.\n" @@ -52,136 +65,16 @@ index 4907a2e..95e3446 100644 +"[--random] [--persistent] [--fullcone]\n"); } - static const struct xt_option_entry DNAT_opts[] = { -@@ -49,6 +55,7 @@ static const struct xt_option_entry DNAT_opts[] = { - .flags = XTOPT_MAND | XTOPT_MULTI}, + static void REDIRECT_help(void) +@@ -97,6 +102,7 @@ static const struct xt_option_entry SNAT_opts[] = { {.name = "random", .id = O_RANDOM, .type = XTTYPE_NONE}, + {.name = "random-fully", .id = O_RANDOM_FULLY, .type = XTTYPE_NONE}, {.name = "persistent", .id = O_PERSISTENT, .type = XTTYPE_NONE}, + {.name = "fullcone", .id = O_FULLCONE, .type = XTTYPE_NONE}, XTOPT_TABLEEND, }; -@@ -194,10 +201,14 @@ static void DNAT_parse(struct xt_option_call *cb) - static void DNAT_fcheck(struct xt_fcheck_call *cb) - { - static const unsigned int f = F_TO_DEST | F_RANDOM; -+ static const unsigned int c = F_FULLCONE; - struct nf_nat_ipv4_multi_range_compat *mr = cb->data; - - if ((cb->xflags & f) == f) - mr->range[0].flags |= NF_NAT_RANGE_PROTO_RANDOM; -+ -+ if ((cb->xflags & c) == c) -+ mr->range[0].flags |= NF_NAT_RANGE_FULLCONE; - } - - static void print_range(const struct nf_nat_ipv4_range *r) -@@ -233,6 +244,8 @@ static void DNAT_print(const void *ip, const struct xt_entry_target *target, - printf(" random"); - if (info->mr.range[i].flags & NF_NAT_RANGE_PERSISTENT) - printf(" persistent"); -+ if (info->mr.range[i].flags & NF_NAT_RANGE_FULLCONE) -+ printf(" fullcone"); - } - } - -@@ -248,6 +261,8 @@ static void DNAT_save(const void *ip, const struct xt_entry_target *target) - printf(" --random"); - if (info->mr.range[i].flags & NF_NAT_RANGE_PERSISTENT) - printf(" --persistent"); -+ if (info->mr.range[i].flags & NF_NAT_RANGE_FULLCONE) -+ printf(" --fullcone"); - } - } - -@@ -291,6 +306,11 @@ static int DNAT_xlate(struct xt_xlate *xl, - sep = ","; - xt_xlate_add(xl, "%spersistent", sep); - } -+ if (info->mr.range[i].flags & NF_NAT_RANGE_FULLCONE) { -+ if (sep_need) -+ sep = ","; -+ xt_xlate_add(xl, "%sfullcone", sep); -+ } - } - - return 1; -@@ -426,10 +446,14 @@ static void DNAT_parse_v2(struct xt_option_call *cb) - static void DNAT_fcheck_v2(struct xt_fcheck_call *cb) - { - static const unsigned int f = F_TO_DEST | F_RANDOM; -+ static const unsigned int c = F_FULLCONE; - struct nf_nat_range2 *range = cb->data; - - if ((cb->xflags & f) == f) - range->flags |= NF_NAT_RANGE_PROTO_RANDOM; -+ -+ if ((cb->xflags & c) == c) -+ range->flags |= NF_NAT_RANGE_FULLCONE; - } - - static void print_range_v2(const struct nf_nat_range2 *range) -@@ -461,6 +485,8 @@ static void DNAT_print_v2(const void *ip, const struct xt_entry_target *target, - printf(" random"); - if (range->flags & NF_NAT_RANGE_PERSISTENT) - printf(" persistent"); -+ if (range->flags & NF_NAT_RANGE_FULLCONE) -+ printf(" fullcone"); - } - - static void DNAT_save_v2(const void *ip, const struct xt_entry_target *target) -@@ -473,6 +499,8 @@ static void DNAT_save_v2(const void *ip, const struct xt_entry_target *target) - printf(" --random"); - if (range->flags & NF_NAT_RANGE_PERSISTENT) - printf(" --persistent"); -+ if (range->flags & NF_NAT_RANGE_FULLCONE) -+ printf(" --fullcone"); - } - - static void print_range_xlate_v2(const struct nf_nat_range2 *range, -@@ -512,6 +540,11 @@ static int DNAT_xlate_v2(struct xt_xlate *xl, - sep = ","; - xt_xlate_add(xl, "%spersistent", sep); - } -+ if (range->flags & NF_NAT_RANGE_FULLCONE) { -+ if (sep_need) -+ sep = ","; -+ xt_xlate_add(xl, "%sfullcone", sep); -+ } - - return 1; - } -diff --git a/extensions/libipt_MASQUERADE.c b/extensions/libipt_MASQUERADE.c -index 90bf606..b3ed1e6 100644 ---- a/extensions/libipt_MASQUERADE.c -+++ b/extensions/libipt_MASQUERADE.c -@@ -8,10 +8,15 @@ - #include - #include - -+/* Temporarily defining here, need to be picked up from the -+ * new kernel header linux/netfilter/nf_nat.h */ -+#define NF_NAT_RANGE_FULLCONE (1 << 10) -+ - enum { - O_TO_PORTS = 0, - O_RANDOM, - O_RANDOM_FULLY, -+ O_FULLCONE - }; - - static void MASQUERADE_help(void) -@@ -23,13 +28,16 @@ static void MASQUERADE_help(void) - " --random\n" - " Randomize source port.\n" - " --random-fully\n" --" Fully randomize source port.\n"); -+" Fully randomize source port.\n" -+" --fullcone\n" -+" Do fullcone NAT mapping.\n"); - } - - static const struct xt_option_entry MASQUERADE_opts[] = { +@@ -104,6 +110,7 @@ static const struct xt_option_entry MASQUERADE_opts[] = { {.name = "to-ports", .id = O_TO_PORTS, .type = XTTYPE_STRING}, {.name = "random", .id = O_RANDOM, .type = XTTYPE_NONE}, {.name = "random-fully", .id = O_RANDOM_FULLY, .type = XTTYPE_NONE}, @@ -189,137 +82,52 @@ index 90bf606..b3ed1e6 100644 XTOPT_TABLEEND, }; -@@ -104,6 +112,9 @@ static void MASQUERADE_parse(struct xt_option_call *cb) - case O_RANDOM_FULLY: - mr->range[0].flags |= NF_NAT_RANGE_PROTO_RANDOM_FULLY; - break; -+ case O_FULLCONE: -+ mr->range[0].flags |= NF_NAT_RANGE_FULLCONE; -+ break; - } - } - -@@ -126,6 +137,9 @@ MASQUERADE_print(const void *ip, const struct xt_entry_target *target, - - if (r->flags & NF_NAT_RANGE_PROTO_RANDOM_FULLY) - printf(" random-fully"); -+ -+ if (r->flags & NF_NAT_RANGE_FULLCONE) -+ printf(" fullcone"); - } - - static void -@@ -145,6 +159,9 @@ MASQUERADE_save(const void *ip, const struct xt_entry_target *target) - - if (r->flags & NF_NAT_RANGE_PROTO_RANDOM_FULLY) - printf(" --random-fully"); -+ -+ if (r->flags & NF_NAT_RANGE_FULLCONE) -+ printf(" --fullcone"); - } - - static int MASQUERADE_xlate(struct xt_xlate *xl, -@@ -166,6 +183,9 @@ static int MASQUERADE_xlate(struct xt_xlate *xl, - if (r->flags & NF_NAT_RANGE_PROTO_RANDOM) - xt_xlate_add(xl, "random "); - -+ if (r->flags & NF_NAT_RANGE_FULLCONE) -+ xt_xlate_add(xl, "fullcone "); -+ - return 1; - } - -diff --git a/extensions/libipt_SNAT.c b/extensions/libipt_SNAT.c -index e92d811..8704004 100644 ---- a/extensions/libipt_SNAT.c -+++ b/extensions/libipt_SNAT.c -@@ -8,16 +8,22 @@ - #include - #include - -+/* Temporarily defining here, need to be picked up from the -+ * new kernel header linux/netfilter/nf_nat.h */ -+#define NF_NAT_RANGE_FULLCONE (1 << 10) -+ - enum { - O_TO_SRC = 0, - O_RANDOM, - O_RANDOM_FULLY, - O_PERSISTENT, - O_X_TO_SRC, -+ O_FULLCONE, - F_TO_SRC = 1 << O_TO_SRC, - F_RANDOM = 1 << O_RANDOM, - F_RANDOM_FULLY = 1 << O_RANDOM_FULLY, - F_X_TO_SRC = 1 << O_X_TO_SRC, -+ F_FULLCONE = 1 << O_FULLCONE - }; - - /* Source NAT data consists of a multi-range, indicating where to map -@@ -34,7 +40,7 @@ static void SNAT_help(void) - "SNAT target options:\n" - " --to-source [[-]][:port[-port]]\n" - " Address to map source to.\n" --"[--random] [--random-fully] [--persistent]\n"); -+"[--random] [--random-fully] [--persistent] [--fullcone]\n"); - } - - static const struct xt_option_entry SNAT_opts[] = { -@@ -43,6 +49,7 @@ static const struct xt_option_entry SNAT_opts[] = { +@@ -112,6 +119,7 @@ static const struct xt_option_entry DNAT_opts[] = { + .flags = XTOPT_MAND}, {.name = "random", .id = O_RANDOM, .type = XTTYPE_NONE}, - {.name = "random-fully", .id = O_RANDOM_FULLY, .type = XTTYPE_NONE}, {.name = "persistent", .id = O_PERSISTENT, .type = XTTYPE_NONE}, + {.name = "fullcone", .id = O_FULLCONE, .type = XTTYPE_NONE}, XTOPT_TABLEEND, }; -@@ -189,12 +196,15 @@ static void SNAT_fcheck(struct xt_fcheck_call *cb) - { - static const unsigned int f = F_TO_SRC | F_RANDOM; - static const unsigned int r = F_TO_SRC | F_RANDOM_FULLY; -+ static const unsigned int c = F_TO_SRC | F_FULLCONE; - struct nf_nat_ipv4_multi_range_compat *mr = cb->data; - - if ((cb->xflags & f) == f) - mr->range[0].flags |= NF_NAT_RANGE_PROTO_RANDOM; - if ((cb->xflags & r) == r) - mr->range[0].flags |= NF_NAT_RANGE_PROTO_RANDOM_FULLY; -+ if ((cb->xflags & c) == c) -+ mr->range[0].flags |= NF_NAT_RANGE_FULLCONE; - } - - static void print_range(const struct nf_nat_ipv4_range *r) -@@ -232,6 +242,8 @@ static void SNAT_print(const void *ip, const struct xt_entry_target *target, - printf(" random-fully"); - if (info->mr.range[i].flags & NF_NAT_RANGE_PERSISTENT) - printf(" persistent"); -+ if (info->mr.range[i].flags & NF_NAT_RANGE_FULLCONE) -+ printf(" fullcone"); +@@ -280,6 +288,9 @@ static void __NAT_parse(struct xt_option_call *cb, __u16 proto, + case O_RANDOM_FULLY: + range->flags |= NF_NAT_RANGE_PROTO_RANDOM_FULLY; + break; ++ case O_FULLCONE: ++ range->flags |= NF_NAT_RANGE_FULLCONE; ++ break; } } -@@ -249,6 +261,8 @@ static void SNAT_save(const void *ip, const struct xt_entry_target *target) - printf(" --random-fully"); - if (info->mr.range[i].flags & NF_NAT_RANGE_PERSISTENT) - printf(" --persistent"); -+ if (info->mr.range[i].flags & NF_NAT_RANGE_FULLCONE) -+ printf(" --fullcone"); +@@ -304,6 +315,7 @@ static void NAT_parse(struct xt_option_call *cb) + case O_PERSISTENT: + case O_RANDOM: + case O_RANDOM_FULLY: ++ case O_FULLCONE: + mr->range->flags |= range.flags; + break; } +@@ -411,6 +423,8 @@ static void __NAT_print(const struct nf_nat_range2 *r, int family, + printf(" %srandom-fully", flag_pfx); + if (r->flags & NF_NAT_RANGE_PERSISTENT) + printf(" %spersistent", flag_pfx); ++ if (r->flags & NF_NAT_RANGE_FULLCONE) ++ printf(" %sfullcone", flag_pfx); } -@@ -299,6 +313,12 @@ static int SNAT_xlate(struct xt_xlate *xl, - sep = ","; - xt_xlate_add(xl, "%spersistent", sep); - } -+ if (info->mr.range[i].flags & NF_NAT_RANGE_FULLCONE) { -+ if (sep_need) -+ sep = ","; -+ xt_xlate_add(xl, "%sfullcone", sep); -+ sep_need = true; -+ } + static int +@@ -439,6 +453,10 @@ __NAT_xlate(struct xt_xlate *xl, const struct nf_nat_range2 *r, + xt_xlate_add(xl, "%spersistent", sep); + sep = ","; } - ++ if (r->flags & NF_NAT_RANGE_FULLCONE) { ++ xt_xlate_add(xl, "%sfullcone", sep); ++ sep = ","; ++ } return 1; + } + -- -2.27.0 +2.18.0 From 35d07e3f0b91aab067982663846ffd28e9609868 Mon Sep 17 00:00:00 2001 From: Vivek Date: Tue, 30 Apr 2024 16:24:50 -0700 Subject: [PATCH 027/282] Add python3-protobuf package to SwSS Container (#18802) --- dockers/docker-orchagent/Dockerfile.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index 5148cddeb973..3bc02a9d8fc4 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -18,6 +18,7 @@ RUN apt-get update && \ bridge-utils \ conntrack \ ndppd \ + python3-protobuf \ pciutils \ # Needed for installing netifaces Python package build-essential \ From 6f80681d3036c289b865e532a37dcda85f1e87f2 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 1 May 2024 16:01:34 +0800 Subject: [PATCH 028/282] [submodule] Update submodule sonic-mgmt-common to the latest HEAD automatically (#18825) #### Why I did it src/sonic-mgmt-common ``` * 85119e8 - (HEAD -> master, origin/master, origin/HEAD) Adding support for OC YANG interfaces (#125) (30 hours ago) [Nikita Agarwal] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-mgmt-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-common b/src/sonic-mgmt-common index 5f1191e61bef..85119e8f9203 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit 5f1191e61bef38b66655fbeac8e94bfe2c4710b8 +Subproject commit 85119e8f920399ad91eae06a33661707eeb7cd04 From 41c1e31412f7e3d54fadefccabae61679296be71 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 1 May 2024 16:01:43 +0800 Subject: [PATCH 029/282] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#18823) #### Why I did it src/sonic-gnmi ``` * eea5d7d - (HEAD -> master, origin/master, origin/HEAD) Fix memory leak (#223) (2 days ago) [ganglv] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index d0ec8b0dcb1a..eea5d7dd6297 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit d0ec8b0dcb1a546b07cda70a10ee6537ff5096fd +Subproject commit eea5d7dd6297b7c31e15d22c12c1c9b6350596cd From 8047998a1d3d016477cd2b8515cb5a236292a097 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 1 May 2024 19:01:15 +0800 Subject: [PATCH 030/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18827) #### Why I did it src/sonic-swss ``` * 67e03128 - (HEAD -> master, origin/master, origin/HEAD) change log level from ERR to WARN for pfc asym sai attribute not supported (#3125) (11 hours ago) [Zhixin Zhu] * c79fd932 - Add fabric capacity monitoring code. (#3097) (11 hours ago) [jfeng-arista] * 7612326c - Do not apply zero buffer profile list until all buffer pools are ready (#3112) (11 hours ago) [Stephen Sun] * 054ed34b - Support ASIC/SDK health event (#3020) (29 hours ago) [Stephen Sun] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 5ef737087a15..67e03128dedc 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 5ef737087a15f23d2038ca840e935f402ad92f31 +Subproject commit 67e03128dedc061c51da7ccd7fd716f00d974bb3 From 80fc33122c42fb260554cbd3f9aae4cfa396e405 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 2 May 2024 16:01:31 +0800 Subject: [PATCH 031/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18847) #### Why I did it src/sonic-swss ``` * 2e6c5b20 - (HEAD -> master, origin/master, origin/HEAD) [DropCounter]Fix the ordering issue with dropcounter (#3128) (4 hours ago) [Sudharsan Dhamal Gopalarathnam] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 67e03128dedc..2e6c5b209d57 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 67e03128dedc061c51da7ccd7fd716f00d974bb3 +Subproject commit 2e6c5b209d575f73b867de9f3e56b3be4066acec From ca25b3b7b5aab7602a7cce2c5d7d279590a7febe Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 2 May 2024 16:01:43 +0800 Subject: [PATCH 032/282] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18826) #### Why I did it src/sonic-platform-daemons ``` * 9d0c550 - (HEAD -> master, origin/master, origin/HEAD) [ycabled] [active-standby] add changes for correcting telemetry values for 'active-standby' when the cable is present but vendor name and part number is not recognized (#478) (8 hours ago) [vdahiya12] * 7e18648 - [xcvrd] Fix issue: logical_port_name is not defined (#482) (26 hours ago) [Junchao-Mellanox] * eb91cb7 - Handling exceptions in CMIS SM to prevent xcvrd crash (#483) (26 hours ago) [mihirpat1] * 6655396 - Adding frequency grid validation for ZR optics (#466) (2 days ago) [balram-csco] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 759862e6db35..9d0c55002129 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 759862e6db350db27e772bd65c36211f9b5f246f +Subproject commit 9d0c55002129dac4fecddc45edfd6cfa8bc510d8 From 987d060a9483d1818183390911300aaebe457297 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 4 May 2024 16:01:36 +0800 Subject: [PATCH 033/282] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#18859) #### Why I did it src/sonic-sairedis ``` * 8a0cc25 - (HEAD -> master, origin/master, origin/HEAD) Support ASIC/SDK health event (#1340) (28 hours ago) [Stephen Sun] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index c3395e5d7593..8a0cc25989fb 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit c3395e5d75933d961d6aaafb695753ae7ca3fe07 +Subproject commit 8a0cc25989fb5bd005bde493190faac6bc84a86d From 97bdc414ed26a60723f406eee8a6ee35fe227f27 Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Sat, 4 May 2024 12:56:25 -0700 Subject: [PATCH 034/282] [Mellanox] Query base MAC address from the syseepromfor Bluefield DPU (#18853) - Why I did it Query base MAC address from the syseeprom or machine.conf for nvidia-bluefield platform - How I did it Use the same flow as Mellanox platform uses. - How to verify it Run the image and verify the base MAC address in the config DB. --- src/sonic-py-common/sonic_py_common/device_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-py-common/sonic_py_common/device_info.py b/src/sonic-py-common/sonic_py_common/device_info.py index 15d5aec65df7..a5f982130484 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -728,7 +728,7 @@ def get_system_mac(namespace=None, hostname=None): if platform == VS_PLATFORM: return generate_mac_for_vs(hostname, namespace) - elif (version_info['asic_type'] == 'mellanox'): + if (version_info['asic_type'] in ['mellanox', 'nvidia-bluefield']): # With Mellanox ONIE release(2019.05-5.2.0012) and above # "onie_base_mac" was added to /host/machine.conf: # onie_base_mac=e4:1d:2d:44:5e:80 From 99ec0f3e74dd9fa72664c4dece05292db98f7491 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 5 May 2024 19:00:56 +0800 Subject: [PATCH 035/282] [submodule] Update submodule sonic-mgmt-framework to the latest HEAD automatically (#18856) #### Why I did it src/sonic-mgmt-framework ``` * 2248203 - (HEAD -> master, origin/master, origin/HEAD) Adding go.mod and go.sum files to resolve build issues. (#141) (2 days ago) [Nikita Agarwal] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-mgmt-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-framework b/src/sonic-mgmt-framework index 0a5962da21cd..2248203a4769 160000 --- a/src/sonic-mgmt-framework +++ b/src/sonic-mgmt-framework @@ -1 +1 @@ -Subproject commit 0a5962da21cdf0cf541a9198149c31e90cde5f4c +Subproject commit 2248203a47698c7598b6d745f6a1ca27813b4327 From 5fb0ee9ad0c1b3bf321ad35c4717dafec440d15e Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Mon, 6 May 2024 09:06:00 -0700 Subject: [PATCH 036/282] [sflow]Changing the verbosity of ERR log when interface is unavailable (#18821) --- ...emoved-just-as-we-discover-it-log-wi.patch | 33 +++++++++++++++++++ src/sflow/hsflowd/patch/series | 1 + 2 files changed, 34 insertions(+) create mode 100644 src/sflow/hsflowd/patch/0004-When-interface-removed-just-as-we-discover-it-log-wi.patch diff --git a/src/sflow/hsflowd/patch/0004-When-interface-removed-just-as-we-discover-it-log-wi.patch b/src/sflow/hsflowd/patch/0004-When-interface-removed-just-as-we-discover-it-log-wi.patch new file mode 100644 index 000000000000..337e3ffc5db9 --- /dev/null +++ b/src/sflow/hsflowd/patch/0004-When-interface-removed-just-as-we-discover-it-log-wi.patch @@ -0,0 +1,33 @@ +From 3d6a3a02d12bcd742e9bcd701cb77da5f265adee Mon Sep 17 00:00:00 2001 +From: Neil McKee +Date: Fri, 26 Apr 2024 11:05:19 -0700 +Subject: [PATCH] When interface removed just as we discover it, log with + LOG_INFO, not LOG_ERR. + + +diff --git a/src/Linux/readInterfaces.c b/src/Linux/readInterfaces.c +index 438d8ed..06427eb 100644 +--- a/src/Linux/readInterfaces.c ++++ b/src/Linux/readInterfaces.c +@@ -758,7 +758,8 @@ extern "C" { + + // Get the flags for this interface + if(ioctl(fd,SIOCGIFFLAGS, &ifr) < 0) { +- myLog(LOG_ERR, "device %s Get SIOCGIFFLAGS failed : %s", ++ // Can get here if the interface was just removed under our feet. ++ myLog(LOG_INFO, "device %s Get SIOCGIFFLAGS failed : %s", + devName, + strerror(errno)); + continue; +@@ -781,7 +782,7 @@ extern "C" { + u_char macBytes[6]; + int gotMac = NO; + if(ioctl(fd,SIOCGIFHWADDR, &ifr) < 0) { +- myLog(LOG_ERR, "device %s Get SIOCGIFHWADDR failed : %s", ++ myLog(LOG_INFO, "device %s Get SIOCGIFHWADDR failed : %s", + devName, + strerror(errno)); + } +-- +2.30.2 + diff --git a/src/sflow/hsflowd/patch/series b/src/sflow/hsflowd/patch/series index f6def262debc..727e9b4feb45 100644 --- a/src/sflow/hsflowd/patch/series +++ b/src/sflow/hsflowd/patch/series @@ -1,3 +1,4 @@ 0001-host_sflow_psample.patch 0002-host_sflow_debian.patch 0003-sflow-enabled-drop-monitor-support-for-SONiC.patch +0004-When-interface-removed-just-as-we-discover-it-log-wi.patch From 33990d88e1273a59893c89e4d2a770a86aa50042 Mon Sep 17 00:00:00 2001 From: vidhya-rajan <121014183+vidhya-rajan@users.noreply.github.com> Date: Mon, 6 May 2024 21:40:01 +0530 Subject: [PATCH 037/282] Platform driver change for Bookworm (#17702) --- .../midstone-200i/modules/mc24lc64t.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/innovium/sonic-platform-modules-cel/midstone-200i/modules/mc24lc64t.c b/platform/innovium/sonic-platform-modules-cel/midstone-200i/modules/mc24lc64t.c index 002172f587e8..b66a70006209 100755 --- a/platform/innovium/sonic-platform-modules-cel/midstone-200i/modules/mc24lc64t.c +++ b/platform/innovium/sonic-platform-modules-cel/midstone-200i/modules/mc24lc64t.c @@ -108,7 +108,7 @@ static int mc24lc64t_probe(struct i2c_client *client, return err; } -static int mc24lc64t_remove(struct i2c_client *client) +static void mc24lc64t_remove(struct i2c_client *client) { struct mc24lc64t_data *drvdata = i2c_get_clientdata(client); @@ -116,7 +116,7 @@ static int mc24lc64t_remove(struct i2c_client *client) sysfs_remove_bin_file(&client->dev.kobj, &mc24lc64t_bit_attr); - return 0; + return ; } static const struct i2c_device_id mc24lc64t_id[] = { From aa5a2141c8c02d55fe88b1adca91fcd98301b81b Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Wed, 17 Apr 2024 01:32:16 -0700 Subject: [PATCH 038/282] Platform configurations for QuicksilverP --- .../Arista-7060X6-64PE/port_config.ini | 65 + .../Arista-7060X6-64PE/sai.profile | 1 + .../th5-a7060x6-64pe.config.bcm | 1145 ++++++++++++++ .../x86_64-arista_7060x6_64pe/default_sku | 1 + .../x86_64-arista_7060x6_64pe/pcie.yaml | 1 + .../x86_64-arista_7060x6_64pe/platform.json | 1336 +++++++++++++++++ .../x86_64-arista_7060x6_64pe/platform_asic | 1 + .../platform_components.json | 12 + .../platform_env.conf | 2 + .../x86_64-arista_7060x6_64pe/platform_reboot | 1 + .../arista/x86_64-arista_7060x6_64pe/plugins | 1 + .../pmon_daemon_control.json | 1 + .../x86_64-arista_7060x6_64pe/sensors.conf | 26 + .../system_health_monitoring_config.json | 1 + .../thermal_policy.json | 1 + files/Aboot/boot0.j2 | 4 + 16 files changed, 2599 insertions(+) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm create mode 100644 device/arista/x86_64-arista_7060x6_64pe/default_sku create mode 120000 device/arista/x86_64-arista_7060x6_64pe/pcie.yaml create mode 100644 device/arista/x86_64-arista_7060x6_64pe/platform.json create mode 100644 device/arista/x86_64-arista_7060x6_64pe/platform_asic create mode 100644 device/arista/x86_64-arista_7060x6_64pe/platform_components.json create mode 100644 device/arista/x86_64-arista_7060x6_64pe/platform_env.conf create mode 120000 device/arista/x86_64-arista_7060x6_64pe/platform_reboot create mode 120000 device/arista/x86_64-arista_7060x6_64pe/plugins create mode 120000 device/arista/x86_64-arista_7060x6_64pe/pmon_daemon_control.json create mode 100644 device/arista/x86_64-arista_7060x6_64pe/sensors.conf create mode 120000 device/arista/x86_64-arista_7060x6_64pe/system_health_monitoring_config.json create mode 120000 device/arista/x86_64-arista_7060x6_64pe/thermal_policy.json diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini new file mode 100644 index 000000000000..48d2519c0ca4 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini @@ -0,0 +1,65 @@ +# name lanes alias index speed fec +Ethernet0 17,18,19,20,21,22,23,24 Ethernet1/1 1 800000 rs +Ethernet8 1,2,3,4,5,6,7,8 Ethernet2/1 2 800000 rs +Ethernet16 9,10,11,12,13,14,15,16 Ethernet3/1 3 800000 rs +Ethernet24 25,26,27,28,29,30,31,32 Ethernet4/1 4 800000 rs +Ethernet32 57,58,59,60,61,62,63,64 Ethernet5/1 5 800000 rs +Ethernet40 41,42,43,44,45,46,47,48 Ethernet6/1 6 800000 rs +Ethernet48 33,34,35,36,37,38,39,40 Ethernet7/1 7 800000 rs +Ethernet56 49,50,51,52,53,54,55,56 Ethernet8/1 8 800000 rs +Ethernet64 89,90,91,92,93,94,95,96 Ethernet9/1 9 800000 rs +Ethernet72 73,74,75,76,77,78,79,80 Ethernet10/1 10 800000 rs +Ethernet80 65,66,67,68,69,70,71,72 Ethernet11/1 11 800000 rs +Ethernet88 81,82,83,84,85,86,87,88 Ethernet12/1 12 800000 rs +Ethernet96 121,122,123,124,125,126,127,128 Ethernet13/1 13 800000 rs +Ethernet104 105,106,107,108,109,110,111,112 Ethernet14/1 14 800000 rs +Ethernet112 97,98,99,100,101,102,103,104 Ethernet15/1 15 800000 rs +Ethernet120 113,114,115,116,117,118,119,120 Ethernet16/1 16 800000 rs +Ethernet128 153,154,155,156,157,158,159,160 Ethernet17/1 17 800000 rs +Ethernet136 137,138,139,140,141,142,143,144 Ethernet18/1 18 800000 rs +Ethernet144 129,130,131,132,133,134,135,136 Ethernet19/1 19 800000 rs +Ethernet152 145,146,147,148,149,150,151,152 Ethernet20/1 20 800000 rs +Ethernet160 185,186,187,188,189,190,191,192 Ethernet21/1 21 800000 rs +Ethernet168 169,170,171,172,173,174,175,176 Ethernet22/1 22 800000 rs +Ethernet176 161,162,163,164,165,166,167,168 Ethernet23/1 23 800000 rs +Ethernet184 177,178,179,180,181,182,183,184 Ethernet24/1 24 800000 rs +Ethernet192 217,218,219,220,221,222,223,224 Ethernet25/1 25 800000 rs +Ethernet200 201,202,203,204,205,206,207,208 Ethernet26/1 26 800000 rs +Ethernet208 193,194,195,196,197,198,199,200 Ethernet27/1 27 800000 rs +Ethernet216 209,210,211,212,213,214,215,216 Ethernet28/1 28 800000 rs +Ethernet224 249,250,251,252,253,254,255,256 Ethernet29/1 29 800000 rs +Ethernet232 233,234,235,236,237,238,239,240 Ethernet30/1 30 800000 rs +Ethernet240 225,226,227,228,229,230,231,232 Ethernet31/1 31 800000 rs +Ethernet248 241,242,243,244,245,246,247,248 Ethernet32/1 32 800000 rs +Ethernet256 273,274,275,276,277,278,279,280 Ethernet33/1 33 800000 rs +Ethernet264 257,258,259,260,261,262,263,264 Ethernet34/1 34 800000 rs +Ethernet272 265,266,267,268,269,270,271,272 Ethernet35/1 35 800000 rs +Ethernet280 281,282,283,284,285,286,287,288 Ethernet36/1 36 800000 rs +Ethernet288 313,314,315,316,317,318,319,320 Ethernet37/1 37 800000 rs +Ethernet296 297,298,299,300,301,302,303,304 Ethernet38/1 38 800000 rs +Ethernet304 289,290,291,292,293,294,295,296 Ethernet39/1 39 800000 rs +Ethernet312 305,306,307,308,309,310,311,312 Ethernet40/1 40 800000 rs +Ethernet320 345,346,347,348,349,350,351,352 Ethernet41/1 41 800000 rs +Ethernet328 329,330,331,332,333,334,335,336 Ethernet42/1 42 800000 rs +Ethernet336 321,322,323,324,325,326,327,328 Ethernet43/1 43 800000 rs +Ethernet344 337,338,339,340,341,342,343,344 Ethernet44/1 44 800000 rs +Ethernet352 377,378,379,380,381,382,383,384 Ethernet45/1 45 800000 rs +Ethernet360 361,362,363,364,365,366,367,368 Ethernet46/1 46 800000 rs +Ethernet368 353,354,355,356,357,358,359,360 Ethernet47/1 47 800000 rs +Ethernet376 369,370,371,372,373,374,375,376 Ethernet48/1 48 800000 rs +Ethernet384 409,410,411,412,413,414,415,416 Ethernet49/1 49 800000 rs +Ethernet392 393,394,395,396,397,398,399,400 Ethernet50/1 50 800000 rs +Ethernet400 385,386,387,388,389,390,391,392 Ethernet51/1 51 800000 rs +Ethernet408 401,402,403,404,405,406,407,408 Ethernet52/1 52 800000 rs +Ethernet416 441,442,443,444,445,446,447,448 Ethernet53/1 53 800000 rs +Ethernet424 425,426,427,428,429,430,431,432 Ethernet54/1 54 800000 rs +Ethernet432 417,418,419,420,421,422,423,424 Ethernet55/1 55 800000 rs +Ethernet440 433,434,435,436,437,438,439,440 Ethernet56/1 56 800000 rs +Ethernet448 473,474,475,476,477,478,479,480 Ethernet57/1 57 800000 rs +Ethernet456 457,458,459,460,461,462,463,464 Ethernet58/1 58 800000 rs +Ethernet464 449,450,451,452,453,454,455,456 Ethernet59/1 59 800000 rs +Ethernet472 465,466,467,468,469,470,471,472 Ethernet60/1 60 800000 rs +Ethernet480 505,506,507,508,509,510,511,512 Ethernet61/1 61 800000 rs +Ethernet488 489,490,491,492,493,494,495,496 Ethernet62/1 62 800000 rs +Ethernet496 481,482,483,484,485,486,487,488 Ethernet63/1 63 800000 rs +Ethernet504 497,498,499,500,501,502,503,504 Ethernet64/1 64 800000 rs diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/sai.profile b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/sai.profile new file mode 100644 index 000000000000..50c136d97b24 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm new file mode 100644 index 000000000000..015f79440198 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm @@ -0,0 +1,1145 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +# : +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x26 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x67 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 505 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 2], + [11, 12], + [22, 23], + [33, 34], + [44, 45], + [55, 56], + [66, 67], + [77, 78], + [88, 89], + [99, 100], + [110, 111], + [121, 122], + [132, 133], + [143, 144], + [154, 155], + [165, 166], + [176, 177], + [187, 188], + [198, 199], + [209, 210], + [220, 221], + [231, 232], + [242, 243], + [253, 254], + [264, 265], + [275, 276], + [286, 287], + [297, 298], + [308, 309], + [319, 320], + [330, 331], + [341, 342]] + : + ENABLE: 1 + SPEED: 800000 + NUM_LANES: 8 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... diff --git a/device/arista/x86_64-arista_7060x6_64pe/default_sku b/device/arista/x86_64-arista_7060x6_64pe/default_sku new file mode 100644 index 000000000000..a2770760bedf --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/default_sku @@ -0,0 +1 @@ +Arista-7060X6-64PE t1 diff --git a/device/arista/x86_64-arista_7060x6_64pe/pcie.yaml b/device/arista/x86_64-arista_7060x6_64pe/pcie.yaml new file mode 120000 index 000000000000..df18a601d82f --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/pcie.yaml @@ -0,0 +1 @@ +../x86_64-arista_common/pcie.yaml \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform.json b/device/arista/x86_64-arista_7060x6_64pe/platform.json new file mode 100644 index 000000000000..a249a56b4c47 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/platform.json @@ -0,0 +1,1336 @@ +{ + "chassis": { + "name": "DCS-7060X6-64PE", + "components": [ + { + "name": "Aboot()" + }, + { + "name": "Scd(addr=0000:00:18.7)" + }, + { + "name": "Scd(addr=0000:03:00.0)" + }, + { + "name": "ShearwaterSysCpld(addr=13-0023)" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "slot1", + "fans": [ + { + "name": "fan1" + } + ] + }, + { + "name": "slot2", + "fans": [ + { + "name": "fan2" + } + ] + }, + { + "name": "slot3", + "fans": [ + { + "name": "fan3" + } + ] + }, + { + "name": "slot4", + "fans": [ + { + "name": "fan4" + } + ] + } + ], + "psus": [ + { + "name": "psu1", + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "fans": [ + { + "name": "psu1/1", + "speed": { + "controllable": false + } + } + ] + }, + { + "name": "psu2", + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "fans": [ + { + "name": "psu2/1", + "speed": { + "controllable": false + } + } + ] + } + ], + "thermals": [ + { + "name": "Cpu temp sensor", + "controllable": false + }, + { + "name": "Ambient", + "controllable": false + }, + { + "name": "Outlet", + "controllable": false + }, + { + "name": "Switch Card temp sensor", + "controllable": false + }, + { + "name": "Air Exit Behind TH5", + "controllable": false + }, + { + "name": "Left Edge PCB Near Rear of Switch", + "controllable": false + }, + { + "name": "Air Inlet", + "controllable": false + }, + { + "name": "Management Card Inlet", + "controllable": false + } + ], + "sfps": [ + { + "name": "osfp1" + }, + { + "name": "osfp2" + }, + { + "name": "osfp3" + }, + { + "name": "osfp4" + }, + { + "name": "osfp5" + }, + { + "name": "osfp6" + }, + { + "name": "osfp7" + }, + { + "name": "osfp8" + }, + { + "name": "osfp9" + }, + { + "name": "osfp10" + }, + { + "name": "osfp11" + }, + { + "name": "osfp12" + }, + { + "name": "osfp13" + }, + { + "name": "osfp14" + }, + { + "name": "osfp15" + }, + { + "name": "osfp16" + }, + { + "name": "osfp17" + }, + { + "name": "osfp18" + }, + { + "name": "osfp19" + }, + { + "name": "osfp20" + }, + { + "name": "osfp21" + }, + { + "name": "osfp22" + }, + { + "name": "osfp23" + }, + { + "name": "osfp24" + }, + { + "name": "osfp25" + }, + { + "name": "osfp26" + }, + { + "name": "osfp27" + }, + { + "name": "osfp28" + }, + { + "name": "osfp29" + }, + { + "name": "osfp30" + }, + { + "name": "osfp31" + }, + { + "name": "osfp32" + }, + { + "name": "osfp33" + }, + { + "name": "osfp34" + }, + { + "name": "osfp35" + }, + { + "name": "osfp36" + }, + { + "name": "osfp37" + }, + { + "name": "osfp38" + }, + { + "name": "osfp39" + }, + { + "name": "osfp40" + }, + { + "name": "osfp41" + }, + { + "name": "osfp42" + }, + { + "name": "osfp43" + }, + { + "name": "osfp44" + }, + { + "name": "osfp45" + }, + { + "name": "osfp46" + }, + { + "name": "osfp47" + }, + { + "name": "osfp48" + }, + { + "name": "osfp49" + }, + { + "name": "osfp50" + }, + { + "name": "osfp51" + }, + { + "name": "osfp52" + }, + { + "name": "osfp53" + }, + { + "name": "osfp54" + }, + { + "name": "osfp55" + }, + { + "name": "osfp56" + }, + { + "name": "osfp57" + }, + { + "name": "osfp58" + }, + { + "name": "osfp59" + }, + { + "name": "osfp60" + }, + { + "name": "osfp61" + }, + { + "name": "osfp62" + }, + { + "name": "osfp63" + }, + { + "name": "osfp64" + } + ] + }, + "interfaces": { + "Ethernet0": { + "index": "1,1,1,1,1,1,1,1", + "lanes": "17,18,19,20,21,22,23,24", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet1/1" + ], + "1x400G": [ + "Ethernet1/1" + ], + "2x400G": [ + "Ethernet1/1", + "Ethernet1/5" + ] + } + }, + "Ethernet8": { + "index": "2,2,2,2,2,2,2,2", + "lanes": "1,2,3,4,5,6,7,8", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet2/1" + ], + "1x400G": [ + "Ethernet2/1" + ], + "2x400G": [ + "Ethernet2/1", + "Ethernet2/5" + ] + } + }, + "Ethernet16": { + "index": "3,3,3,3,3,3,3,3", + "lanes": "9,10,11,12,13,14,15,16", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet3/1" + ], + "1x400G": [ + "Ethernet3/1" + ], + "2x400G": [ + "Ethernet3/1", + "Ethernet3/5" + ] + } + }, + "Ethernet24": { + "index": "4,4,4,4,4,4,4,4", + "lanes": "25,26,27,28,29,30,31,32", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet4/1" + ], + "1x400G": [ + "Ethernet4/1" + ], + "2x400G": [ + "Ethernet4/1", + "Ethernet4/5" + ] + } + }, + "Ethernet32": { + "index": "5,5,5,5,5,5,5,5", + "lanes": "57,58,59,60,61,62,63,64", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet5/1" + ], + "1x400G": [ + "Ethernet5/1" + ], + "2x400G": [ + "Ethernet5/1", + "Ethernet5/5" + ] + } + }, + "Ethernet40": { + "index": "6,6,6,6,6,6,6,6", + "lanes": "41,42,43,44,45,46,47,48", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet6/1" + ], + "1x400G": [ + "Ethernet6/1" + ], + "2x400G": [ + "Ethernet6/1", + "Ethernet6/5" + ] + } + }, + "Ethernet48": { + "index": "7,7,7,7,7,7,7,7", + "lanes": "33,34,35,36,37,38,39,40", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet7/1" + ], + "1x400G": [ + "Ethernet7/1" + ], + "2x400G": [ + "Ethernet7/1", + "Ethernet7/5" + ] + } + }, + "Ethernet56": { + "index": "8,8,8,8,8,8,8,8", + "lanes": "49,50,51,52,53,54,55,56", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet8/1" + ], + "1x400G": [ + "Ethernet8/1" + ], + "2x400G": [ + "Ethernet8/1", + "Ethernet8/5" + ] + } + }, + "Ethernet64": { + "index": "9,9,9,9,9,9,9,9", + "lanes": "89,90,91,92,93,94,95,96", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet9/1" + ], + "1x400G": [ + "Ethernet9/1" + ], + "2x400G": [ + "Ethernet9/1", + "Ethernet9/5" + ] + } + }, + "Ethernet72": { + "index": "10,10,10,10,10,10,10,10", + "lanes": "73,74,75,76,77,78,79,80", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet10/1" + ], + "1x400G": [ + "Ethernet10/1" + ], + "2x400G": [ + "Ethernet10/1", + "Ethernet10/5" + ] + } + }, + "Ethernet80": { + "index": "11,11,11,11,11,11,11,11", + "lanes": "65,66,67,68,69,70,71,72", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet11/1" + ], + "1x400G": [ + "Ethernet11/1" + ], + "2x400G": [ + "Ethernet11/1", + "Ethernet11/5" + ] + } + }, + "Ethernet88": { + "index": "12,12,12,12,12,12,12,12", + "lanes": "81,82,83,84,85,86,87,88", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet12/1" + ], + "1x400G": [ + "Ethernet12/1" + ], + "2x400G": [ + "Ethernet12/1", + "Ethernet12/5" + ] + } + }, + "Ethernet96": { + "index": "13,13,13,13,13,13,13,13", + "lanes": "121,122,123,124,125,126,127,128", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet13/1" + ], + "1x400G": [ + "Ethernet13/1" + ], + "2x400G": [ + "Ethernet13/1", + "Ethernet13/5" + ] + } + }, + "Ethernet104": { + "index": "14,14,14,14,14,14,14,14", + "lanes": "105,106,107,108,109,110,111,112", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet14/1" + ], + "1x400G": [ + "Ethernet14/1" + ], + "2x400G": [ + "Ethernet14/1", + "Ethernet14/5" + ] + } + }, + "Ethernet112": { + "index": "15,15,15,15,15,15,15,15", + "lanes": "97,98,99,100,101,102,103,104", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet15/1" + ], + "1x400G": [ + "Ethernet15/1" + ], + "2x400G": [ + "Ethernet15/1", + "Ethernet15/5" + ] + } + }, + "Ethernet120": { + "index": "16,16,16,16,16,16,16,16", + "lanes": "113,114,115,116,117,118,119,120", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet16/1" + ], + "1x400G": [ + "Ethernet16/1" + ], + "2x400G": [ + "Ethernet16/1", + "Ethernet16/5" + ] + } + }, + "Ethernet128": { + "index": "17,17,17,17,17,17,17,17", + "lanes": "153,154,155,156,157,158,159,160", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet17/1" + ], + "1x400G": [ + "Ethernet17/1" + ], + "2x400G": [ + "Ethernet17/1", + "Ethernet17/5" + ] + } + }, + "Ethernet136": { + "index": "18,18,18,18,18,18,18,18", + "lanes": "137,138,139,140,141,142,143,144", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet18/1" + ], + "1x400G": [ + "Ethernet18/1" + ], + "2x400G": [ + "Ethernet18/1", + "Ethernet18/5" + ] + } + }, + "Ethernet144": { + "index": "19,19,19,19,19,19,19,19", + "lanes": "129,130,131,132,133,134,135,136", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet19/1" + ], + "1x400G": [ + "Ethernet19/1" + ], + "2x400G": [ + "Ethernet19/1", + "Ethernet19/5" + ] + } + }, + "Ethernet152": { + "index": "20,20,20,20,20,20,20,20", + "lanes": "145,146,147,148,149,150,151,152", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet20/1" + ], + "1x400G": [ + "Ethernet20/1" + ], + "2x400G": [ + "Ethernet20/1", + "Ethernet20/5" + ] + } + }, + "Ethernet160": { + "index": "21,21,21,21,21,21,21,21", + "lanes": "185,186,187,188,189,190,191,192", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet21/1" + ], + "1x400G": [ + "Ethernet21/1" + ], + "2x400G": [ + "Ethernet21/1", + "Ethernet21/5" + ] + } + }, + "Ethernet168": { + "index": "22,22,22,22,22,22,22,22", + "lanes": "169,170,171,172,173,174,175,176", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet22/1" + ], + "1x400G": [ + "Ethernet22/1" + ], + "2x400G": [ + "Ethernet22/1", + "Ethernet22/5" + ] + } + }, + "Ethernet176": { + "index": "23,23,23,23,23,23,23,23", + "lanes": "161,162,163,164,165,166,167,168", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet23/1" + ], + "1x400G": [ + "Ethernet23/1" + ], + "2x400G": [ + "Ethernet23/1", + "Ethernet23/5" + ] + } + }, + "Ethernet184": { + "index": "24,24,24,24,24,24,24,24", + "lanes": "177,178,179,180,181,182,183,184", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet24/1" + ], + "1x400G": [ + "Ethernet24/1" + ], + "2x400G": [ + "Ethernet24/1", + "Ethernet24/5" + ] + } + }, + "Ethernet192": { + "index": "25,25,25,25,25,25,25,25", + "lanes": "217,218,219,220,221,222,223,224", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet25/1" + ], + "1x400G": [ + "Ethernet25/1" + ], + "2x400G": [ + "Ethernet25/1", + "Ethernet25/5" + ] + } + }, + "Ethernet200": { + "index": "26,26,26,26,26,26,26,26", + "lanes": "201,202,203,204,205,206,207,208", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet26/1" + ], + "1x400G": [ + "Ethernet26/1" + ], + "2x400G": [ + "Ethernet26/1", + "Ethernet26/5" + ] + } + }, + "Ethernet208": { + "index": "27,27,27,27,27,27,27,27", + "lanes": "193,194,195,196,197,198,199,200", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet27/1" + ], + "1x400G": [ + "Ethernet27/1" + ], + "2x400G": [ + "Ethernet27/1", + "Ethernet27/5" + ] + } + }, + "Ethernet216": { + "index": "28,28,28,28,28,28,28,28", + "lanes": "209,210,211,212,213,214,215,216", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet28/1" + ], + "1x400G": [ + "Ethernet28/1" + ], + "2x400G": [ + "Ethernet28/1", + "Ethernet28/5" + ] + } + }, + "Ethernet224": { + "index": "29,29,29,29,29,29,29,29", + "lanes": "249,250,251,252,253,254,255,256", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet29/1" + ], + "1x400G": [ + "Ethernet29/1" + ], + "2x400G": [ + "Ethernet29/1", + "Ethernet29/5" + ] + } + }, + "Ethernet232": { + "index": "30,30,30,30,30,30,30,30", + "lanes": "233,234,235,236,237,238,239,240", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet30/1" + ], + "1x400G": [ + "Ethernet30/1" + ], + "2x400G": [ + "Ethernet30/1", + "Ethernet30/5" + ] + } + }, + "Ethernet240": { + "index": "31,31,31,31,31,31,31,31", + "lanes": "225,226,227,228,229,230,231,232", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet31/1" + ], + "1x400G": [ + "Ethernet31/1" + ], + "2x400G": [ + "Ethernet31/1", + "Ethernet31/5" + ] + } + }, + "Ethernet248": { + "index": "32,32,32,32,32,32,32,32", + "lanes": "241,242,243,244,245,246,247,248", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet32/1" + ], + "1x400G": [ + "Ethernet32/1" + ], + "2x400G": [ + "Ethernet32/1", + "Ethernet32/5" + ] + } + }, + "Ethernet256": { + "index": "33,33,33,33,33,33,33,33", + "lanes": "273,274,275,276,277,278,279,280", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet33/1" + ], + "1x400G": [ + "Ethernet33/1" + ], + "2x400G": [ + "Ethernet33/1", + "Ethernet33/5" + ] + } + }, + "Ethernet264": { + "index": "34,34,34,34,34,34,34,34", + "lanes": "257,258,259,260,261,262,263,264", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet34/1" + ], + "1x400G": [ + "Ethernet34/1" + ], + "2x400G": [ + "Ethernet34/1", + "Ethernet34/5" + ] + } + }, + "Ethernet272": { + "index": "35,35,35,35,35,35,35,35", + "lanes": "265,266,267,268,269,270,271,272", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet35/1" + ], + "1x400G": [ + "Ethernet35/1" + ], + "2x400G": [ + "Ethernet35/1", + "Ethernet35/5" + ] + } + }, + "Ethernet280": { + "index": "36,36,36,36,36,36,36,36", + "lanes": "281,282,283,284,285,286,287,288", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet36/1" + ], + "1x400G": [ + "Ethernet36/1" + ], + "2x400G": [ + "Ethernet36/1", + "Ethernet36/5" + ] + } + }, + "Ethernet288": { + "index": "37,37,37,37,37,37,37,37", + "lanes": "313,314,315,316,317,318,319,320", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet37/1" + ], + "1x400G": [ + "Ethernet37/1" + ], + "2x400G": [ + "Ethernet37/1", + "Ethernet37/5" + ] + } + }, + "Ethernet296": { + "index": "38,38,38,38,38,38,38,38", + "lanes": "297,298,299,300,301,302,303,304", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet38/1" + ], + "1x400G": [ + "Ethernet38/1" + ], + "2x400G": [ + "Ethernet38/1", + "Ethernet38/5" + ] + } + }, + "Ethernet304": { + "index": "39,39,39,39,39,39,39,39", + "lanes": "289,290,291,292,293,294,295,296", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet39/1" + ], + "1x400G": [ + "Ethernet39/1" + ], + "2x400G": [ + "Ethernet39/1", + "Ethernet39/5" + ] + } + }, + "Ethernet312": { + "index": "40,40,40,40,40,40,40,40", + "lanes": "305,306,307,308,309,310,311,312", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet40/1" + ], + "1x400G": [ + "Ethernet40/1" + ], + "2x400G": [ + "Ethernet40/1", + "Ethernet40/5" + ] + } + }, + "Ethernet320": { + "index": "41,41,41,41,41,41,41,41", + "lanes": "345,346,347,348,349,350,351,352", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet41/1" + ], + "1x400G": [ + "Ethernet41/1" + ], + "2x400G": [ + "Ethernet41/1", + "Ethernet41/5" + ] + } + }, + "Ethernet328": { + "index": "42,42,42,42,42,42,42,42", + "lanes": "329,330,331,332,333,334,335,336", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet42/1" + ], + "1x400G": [ + "Ethernet42/1" + ], + "2x400G": [ + "Ethernet42/1", + "Ethernet42/5" + ] + } + }, + "Ethernet336": { + "index": "43,43,43,43,43,43,43,43", + "lanes": "321,322,323,324,325,326,327,328", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet43/1" + ], + "1x400G": [ + "Ethernet43/1" + ], + "2x400G": [ + "Ethernet43/1", + "Ethernet43/5" + ] + } + }, + "Ethernet344": { + "index": "44,44,44,44,44,44,44,44", + "lanes": "337,338,339,340,341,342,343,344", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet44/1" + ], + "1x400G": [ + "Ethernet44/1" + ], + "2x400G": [ + "Ethernet44/1", + "Ethernet44/5" + ] + } + }, + "Ethernet352": { + "index": "45,45,45,45,45,45,45,45", + "lanes": "377,378,379,380,381,382,383,384", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet45/1" + ], + "1x400G": [ + "Ethernet45/1" + ], + "2x400G": [ + "Ethernet45/1", + "Ethernet45/5" + ] + } + }, + "Ethernet360": { + "index": "46,46,46,46,46,46,46,46", + "lanes": "361,362,363,364,365,366,367,368", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet46/1" + ], + "1x400G": [ + "Ethernet46/1" + ], + "2x400G": [ + "Ethernet46/1", + "Ethernet46/5" + ] + } + }, + "Ethernet368": { + "index": "47,47,47,47,47,47,47,47", + "lanes": "353,354,355,356,357,358,359,360", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet47/1" + ], + "1x400G": [ + "Ethernet47/1" + ], + "2x400G": [ + "Ethernet47/1", + "Ethernet47/5" + ] + } + }, + "Ethernet376": { + "index": "48,48,48,48,48,48,48,48", + "lanes": "369,370,371,372,373,374,375,376", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet48/1" + ], + "1x400G": [ + "Ethernet48/1" + ], + "2x400G": [ + "Ethernet48/1", + "Ethernet48/5" + ] + } + }, + "Ethernet384": { + "index": "49,49,49,49,49,49,49,49", + "lanes": "409,410,411,412,413,414,415,416", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet49/1" + ], + "1x400G": [ + "Ethernet49/1" + ], + "2x400G": [ + "Ethernet49/1", + "Ethernet49/5" + ] + } + }, + "Ethernet392": { + "index": "50,50,50,50,50,50,50,50", + "lanes": "393,394,395,396,397,398,399,400", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet50/1" + ], + "1x400G": [ + "Ethernet50/1" + ], + "2x400G": [ + "Ethernet50/1", + "Ethernet50/5" + ] + } + }, + "Ethernet400": { + "index": "51,51,51,51,51,51,51,51", + "lanes": "385,386,387,388,389,390,391,392", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet51/1" + ], + "1x400G": [ + "Ethernet51/1" + ], + "2x400G": [ + "Ethernet51/1", + "Ethernet51/5" + ] + } + }, + "Ethernet408": { + "index": "52,52,52,52,52,52,52,52", + "lanes": "401,402,403,404,405,406,407,408", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet52/1" + ], + "1x400G": [ + "Ethernet52/1" + ], + "2x400G": [ + "Ethernet52/1", + "Ethernet52/5" + ] + } + }, + "Ethernet416": { + "index": "53,53,53,53,53,53,53,53", + "lanes": "441,442,443,444,445,446,447,448", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet53/1" + ], + "1x400G": [ + "Ethernet53/1" + ], + "2x400G": [ + "Ethernet53/1", + "Ethernet53/5" + ] + } + }, + "Ethernet424": { + "index": "54,54,54,54,54,54,54,54", + "lanes": "425,426,427,428,429,430,431,432", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet54/1" + ], + "1x400G": [ + "Ethernet54/1" + ], + "2x400G": [ + "Ethernet54/1", + "Ethernet54/5" + ] + } + }, + "Ethernet432": { + "index": "55,55,55,55,55,55,55,55", + "lanes": "417,418,419,420,421,422,423,424", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet55/1" + ], + "1x400G": [ + "Ethernet55/1" + ], + "2x400G": [ + "Ethernet55/1", + "Ethernet55/5" + ] + } + }, + "Ethernet440": { + "index": "56,56,56,56,56,56,56,56", + "lanes": "433,434,435,436,437,438,439,440", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet56/1" + ], + "1x400G": [ + "Ethernet56/1" + ], + "2x400G": [ + "Ethernet56/1", + "Ethernet56/5" + ] + } + }, + "Ethernet448": { + "index": "57,57,57,57,57,57,57,57", + "lanes": "473,474,475,476,477,478,479,480", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet57/1" + ], + "1x400G": [ + "Ethernet57/1" + ], + "2x400G": [ + "Ethernet57/1", + "Ethernet57/5" + ] + } + }, + "Ethernet456": { + "index": "58,58,58,58,58,58,58,58", + "lanes": "457,458,459,460,461,462,463,464", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet58/1" + ], + "1x400G": [ + "Ethernet58/1" + ], + "2x400G": [ + "Ethernet58/1", + "Ethernet58/5" + ] + } + }, + "Ethernet464": { + "index": "59,59,59,59,59,59,59,59", + "lanes": "449,450,451,452,453,454,455,456", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet59/1" + ], + "1x400G": [ + "Ethernet59/1" + ], + "2x400G": [ + "Ethernet59/1", + "Ethernet59/5" + ] + } + }, + "Ethernet472": { + "index": "60,60,60,60,60,60,60,60", + "lanes": "465,466,467,468,469,470,471,472", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet60/1" + ], + "1x400G": [ + "Ethernet60/1" + ], + "2x400G": [ + "Ethernet60/1", + "Ethernet60/5" + ] + } + }, + "Ethernet480": { + "index": "61,61,61,61,61,61,61,61", + "lanes": "505,506,507,508,509,510,511,512", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet61/1" + ], + "1x400G": [ + "Ethernet61/1" + ], + "2x400G": [ + "Ethernet61/1", + "Ethernet61/5" + ] + } + }, + "Ethernet488": { + "index": "62,62,62,62,62,62,62,62", + "lanes": "489,490,491,492,493,494,495,496", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet62/1" + ], + "1x400G": [ + "Ethernet62/1" + ], + "2x400G": [ + "Ethernet62/1", + "Ethernet62/5" + ] + } + }, + "Ethernet496": { + "index": "63,63,63,63,63,63,63,63", + "lanes": "481,482,483,484,485,486,487,488", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet63/1" + ], + "1x400G": [ + "Ethernet63/1" + ], + "2x400G": [ + "Ethernet63/1", + "Ethernet63/5" + ] + } + }, + "Ethernet504": { + "index": "64,64,64,64,64,64,64,64", + "lanes": "497,498,499,500,501,502,503,504", + "breakout_modes": { + "1x800G[400G]": [ + "Ethernet64/1" + ], + "1x400G": [ + "Ethernet64/1" + ], + "2x400G": [ + "Ethernet64/1", + "Ethernet64/5" + ] + } + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform_asic b/device/arista/x86_64-arista_7060x6_64pe/platform_asic new file mode 100644 index 000000000000..960467652765 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/platform_asic @@ -0,0 +1 @@ +broadcom diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform_components.json b/device/arista/x86_64-arista_7060x6_64pe/platform_components.json new file mode 100644 index 000000000000..2295cd3a9f89 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/platform_components.json @@ -0,0 +1,12 @@ +{ + "chassis": { + "DCS-7060X6-64PE": { + "component": { + "Aboot()": {}, + "Scd(addr=0000:00:18.7)": {}, + "Scd(addr=0000:03:00.0)": {}, + "ShearwaterSysCpld(addr=13-0023)": {} + } + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform_env.conf b/device/arista/x86_64-arista_7060x6_64pe/platform_env.conf new file mode 100644 index 000000000000..dd7cf4fe01c5 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/platform_env.conf @@ -0,0 +1,2 @@ +SYNCD_SHM_SIZE=512m +is_ltsw_chip=1 diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform_reboot b/device/arista/x86_64-arista_7060x6_64pe/platform_reboot new file mode 120000 index 000000000000..7f94a49e38b0 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/platform_reboot @@ -0,0 +1 @@ +../x86_64-arista_common/platform_reboot \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/plugins b/device/arista/x86_64-arista_7060x6_64pe/plugins new file mode 120000 index 000000000000..789a45fcace9 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/plugins @@ -0,0 +1 @@ +../x86_64-arista_common/plugins \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/pmon_daemon_control.json b/device/arista/x86_64-arista_7060x6_64pe/pmon_daemon_control.json new file mode 120000 index 000000000000..51d5ab7b0059 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/pmon_daemon_control.json @@ -0,0 +1 @@ +../x86_64-arista_common/pmon_daemon_control.json \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/sensors.conf b/device/arista/x86_64-arista_7060x6_64pe/sensors.conf new file mode 100644 index 000000000000..a3f85d5aee0a --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/sensors.conf @@ -0,0 +1,26 @@ +bus "i2c-25" "SCD 0000:03:00.0 SMBus master 1 bus 0" +bus "i2c-28" "SCD 0000:03:00.0 SMBus master 1 bus 3" +bus "i2c-29" "SCD 0000:03:00.0 SMBus master 1 bus 4" + +chip "max6581-i2c-25-4d" + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + +chip "nvme-pci-0400" + # TODO: sensors complaining about tempX_min and tempX_max + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + +chip "pmbus-i2c-28-58" + ignore fan3 + ignore fan4 + +chip "pmbus-i2c-29-58" + ignore fan3 + ignore fan4 diff --git a/device/arista/x86_64-arista_7060x6_64pe/system_health_monitoring_config.json b/device/arista/x86_64-arista_7060x6_64pe/system_health_monitoring_config.json new file mode 120000 index 000000000000..1185f771fa8e --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/system_health_monitoring_config.json @@ -0,0 +1 @@ +../x86_64-arista_common/system_health_monitoring_config.json \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/thermal_policy.json b/device/arista/x86_64-arista_7060x6_64pe/thermal_policy.json new file mode 120000 index 000000000000..0991dc7f3638 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/thermal_policy.json @@ -0,0 +1 @@ +../x86_64-arista_common/thermal_policy.json \ No newline at end of file diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index 43f3fcae1baa..439debc74859 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -626,6 +626,9 @@ write_platform_specific_cmdline() { if in_array "$sid" "Shearwater4Mk2" "Shearwater4Mk2N" "Shearwater4Mk2QuicksilverDD" "Shearwater4Mk2NQuicksilverDD"; then aboot_machine=arista_7060x6_64de fi + if in_array "$sid" "Shearwater4Mk2QuicksilverP" "Shearwater4Mk2NQuicksilverP"; then + aboot_machine=arista_7060x6_64pe + fi # disable cpu c-state other than C1 local cpuvendor="$(sed -nr 's/vendor_id[\t ]*: (.*)/\1/p' /proc/cpuinfo | head -n 1)" @@ -668,6 +671,7 @@ write_platform_specific_cmdline() { read_system_eeprom fi if in_array "$platform" "shearwater"; then + cmdline_add modprobe.blacklist=snd_hda_intel,hdaudio if [ -f /tmp/.switch-prefdl ]; then read_switch_eeprom else From 7f011017cb23741a878c39819fcf058f41975681 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 6 May 2024 06:22:48 -0700 Subject: [PATCH 039/282] Add 256x200G hwsku for QuicksilverP --- .../port_config.ini | 257 +++ .../Arista-7060X6-64PE-256x200G/sai.profile | 1 + .../th5-a7060x6-64pe.config.bcm | 1913 +++++++++++++++++ 3 files changed, 2171 insertions(+) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini new file mode 100644 index 000000000000..323b8e2612eb --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini @@ -0,0 +1,257 @@ +# name lanes alias index speed fec +Ethernet0 17,18 Ethernet1/1 1 200000 rs +Ethernet2 19,20 Ethernet1/3 1 200000 rs +Ethernet4 21,22 Ethernet1/5 1 200000 rs +Ethernet6 23,24 Ethernet1/7 1 200000 rs +Ethernet8 1,2 Ethernet2/1 2 200000 rs +Ethernet10 3,4 Ethernet2/3 2 200000 rs +Ethernet12 5,6 Ethernet2/5 2 200000 rs +Ethernet14 7,8 Ethernet2/7 2 200000 rs +Ethernet16 9,10 Ethernet3/1 3 200000 rs +Ethernet18 11,12 Ethernet3/3 3 200000 rs +Ethernet20 13,14 Ethernet3/5 3 200000 rs +Ethernet22 15,16 Ethernet3/7 3 200000 rs +Ethernet24 25,26 Ethernet4/1 4 200000 rs +Ethernet26 27,28 Ethernet4/3 4 200000 rs +Ethernet28 29,30 Ethernet4/5 4 200000 rs +Ethernet30 31,32 Ethernet4/7 4 200000 rs +Ethernet32 57,58 Ethernet5/1 5 200000 rs +Ethernet34 59,60 Ethernet5/3 5 200000 rs +Ethernet36 61,62 Ethernet5/5 5 200000 rs +Ethernet38 63,64 Ethernet5/7 5 200000 rs +Ethernet40 41,42 Ethernet6/1 6 200000 rs +Ethernet42 43,44 Ethernet6/3 6 200000 rs +Ethernet44 45,46 Ethernet6/5 6 200000 rs +Ethernet46 47,48 Ethernet6/7 6 200000 rs +Ethernet48 33,34 Ethernet7/1 7 200000 rs +Ethernet50 35,36 Ethernet7/3 7 200000 rs +Ethernet52 37,38 Ethernet7/5 7 200000 rs +Ethernet54 39,40 Ethernet7/7 7 200000 rs +Ethernet56 49,50 Ethernet8/1 8 200000 rs +Ethernet58 51,52 Ethernet8/3 8 200000 rs +Ethernet60 53,54 Ethernet8/5 8 200000 rs +Ethernet62 55,56 Ethernet8/7 8 200000 rs +Ethernet64 89,90 Ethernet9/1 9 200000 rs +Ethernet66 91,92 Ethernet9/3 9 200000 rs +Ethernet68 93,94 Ethernet9/5 9 200000 rs +Ethernet70 95,96 Ethernet9/7 9 200000 rs +Ethernet72 73,74 Ethernet10/1 10 200000 rs +Ethernet74 75,76 Ethernet10/3 10 200000 rs +Ethernet76 77,78 Ethernet10/5 10 200000 rs +Ethernet78 79,80 Ethernet10/7 10 200000 rs +Ethernet80 65,66 Ethernet11/1 11 200000 rs +Ethernet82 67,68 Ethernet11/3 11 200000 rs +Ethernet84 69,70 Ethernet11/5 11 200000 rs +Ethernet86 71,72 Ethernet11/7 11 200000 rs +Ethernet88 81,82 Ethernet12/1 12 200000 rs +Ethernet90 83,84 Ethernet12/3 12 200000 rs +Ethernet92 85,86 Ethernet12/5 12 200000 rs +Ethernet94 87,88 Ethernet12/7 12 200000 rs +Ethernet96 121,122 Ethernet13/1 13 200000 rs +Ethernet98 123,124 Ethernet13/3 13 200000 rs +Ethernet100 125,126 Ethernet13/5 13 200000 rs +Ethernet102 127,128 Ethernet13/7 13 200000 rs +Ethernet104 105,106 Ethernet14/1 14 200000 rs +Ethernet106 107,108 Ethernet14/3 14 200000 rs +Ethernet108 109,110 Ethernet14/5 14 200000 rs +Ethernet110 111,112 Ethernet14/7 14 200000 rs +Ethernet112 97,98 Ethernet15/1 15 200000 rs +Ethernet114 99,100 Ethernet15/3 15 200000 rs +Ethernet116 101,102 Ethernet15/5 15 200000 rs +Ethernet118 103,104 Ethernet15/7 15 200000 rs +Ethernet120 113,114 Ethernet16/1 16 200000 rs +Ethernet122 115,116 Ethernet16/3 16 200000 rs +Ethernet124 117,118 Ethernet16/5 16 200000 rs +Ethernet126 119,120 Ethernet16/7 16 200000 rs +Ethernet128 153,154 Ethernet17/1 17 200000 rs +Ethernet130 155,156 Ethernet17/3 17 200000 rs +Ethernet132 157,158 Ethernet17/5 17 200000 rs +Ethernet134 159,160 Ethernet17/7 17 200000 rs +Ethernet136 137,138 Ethernet18/1 18 200000 rs +Ethernet138 139,140 Ethernet18/3 18 200000 rs +Ethernet140 141,142 Ethernet18/5 18 200000 rs +Ethernet142 143,144 Ethernet18/7 18 200000 rs +Ethernet144 129,130 Ethernet19/1 19 200000 rs +Ethernet146 131,132 Ethernet19/3 19 200000 rs +Ethernet148 133,134 Ethernet19/5 19 200000 rs +Ethernet150 135,136 Ethernet19/7 19 200000 rs +Ethernet152 145,146 Ethernet20/1 20 200000 rs +Ethernet154 147,148 Ethernet20/3 20 200000 rs +Ethernet156 149,150 Ethernet20/5 20 200000 rs +Ethernet158 151,152 Ethernet20/7 20 200000 rs +Ethernet160 185,186 Ethernet21/1 21 200000 rs +Ethernet162 187,188 Ethernet21/3 21 200000 rs +Ethernet164 189,190 Ethernet21/5 21 200000 rs +Ethernet166 191,192 Ethernet21/7 21 200000 rs +Ethernet168 169,170 Ethernet22/1 22 200000 rs +Ethernet170 171,172 Ethernet22/3 22 200000 rs +Ethernet172 173,174 Ethernet22/5 22 200000 rs +Ethernet174 175,176 Ethernet22/7 22 200000 rs +Ethernet176 161,162 Ethernet23/1 23 200000 rs +Ethernet178 163,164 Ethernet23/3 23 200000 rs +Ethernet180 165,166 Ethernet23/5 23 200000 rs +Ethernet182 167,168 Ethernet23/7 23 200000 rs +Ethernet184 177,178 Ethernet24/1 24 200000 rs +Ethernet186 179,180 Ethernet24/3 24 200000 rs +Ethernet188 181,182 Ethernet24/5 24 200000 rs +Ethernet190 183,184 Ethernet24/7 24 200000 rs +Ethernet192 217,218 Ethernet25/1 25 200000 rs +Ethernet194 219,220 Ethernet25/3 25 200000 rs +Ethernet196 221,222 Ethernet25/5 25 200000 rs +Ethernet198 223,224 Ethernet25/7 25 200000 rs +Ethernet200 201,202 Ethernet26/1 26 200000 rs +Ethernet202 203,204 Ethernet26/3 26 200000 rs +Ethernet204 205,206 Ethernet26/5 26 200000 rs +Ethernet206 207,208 Ethernet26/7 26 200000 rs +Ethernet208 193,194 Ethernet27/1 27 200000 rs +Ethernet210 195,196 Ethernet27/3 27 200000 rs +Ethernet212 197,198 Ethernet27/5 27 200000 rs +Ethernet214 199,200 Ethernet27/7 27 200000 rs +Ethernet216 209,210 Ethernet28/1 28 200000 rs +Ethernet218 211,212 Ethernet28/3 28 200000 rs +Ethernet220 213,214 Ethernet28/5 28 200000 rs +Ethernet222 215,216 Ethernet28/7 28 200000 rs +Ethernet224 249,250 Ethernet29/1 29 200000 rs +Ethernet226 251,252 Ethernet29/3 29 200000 rs +Ethernet228 253,254 Ethernet29/5 29 200000 rs +Ethernet230 255,256 Ethernet29/7 29 200000 rs +Ethernet232 233,234 Ethernet30/1 30 200000 rs +Ethernet234 235,236 Ethernet30/3 30 200000 rs +Ethernet236 237,238 Ethernet30/5 30 200000 rs +Ethernet238 239,240 Ethernet30/7 30 200000 rs +Ethernet240 225,226 Ethernet31/1 31 200000 rs +Ethernet242 227,228 Ethernet31/3 31 200000 rs +Ethernet244 229,230 Ethernet31/5 31 200000 rs +Ethernet246 231,232 Ethernet31/7 31 200000 rs +Ethernet248 241,242 Ethernet32/1 32 200000 rs +Ethernet250 243,244 Ethernet32/3 32 200000 rs +Ethernet252 245,246 Ethernet32/5 32 200000 rs +Ethernet254 247,248 Ethernet32/7 32 200000 rs +Ethernet256 273,274 Ethernet33/1 33 200000 rs +Ethernet258 275,276 Ethernet33/3 33 200000 rs +Ethernet260 277,278 Ethernet33/5 33 200000 rs +Ethernet262 279,280 Ethernet33/7 33 200000 rs +Ethernet264 257,258 Ethernet34/1 34 200000 rs +Ethernet266 259,260 Ethernet34/3 34 200000 rs +Ethernet268 261,262 Ethernet34/5 34 200000 rs +Ethernet270 263,264 Ethernet34/7 34 200000 rs +Ethernet272 265,266 Ethernet35/1 35 200000 rs +Ethernet274 267,268 Ethernet35/3 35 200000 rs +Ethernet276 269,270 Ethernet35/5 35 200000 rs +Ethernet278 271,272 Ethernet35/7 35 200000 rs +Ethernet280 281,282 Ethernet36/1 36 200000 rs +Ethernet282 283,284 Ethernet36/3 36 200000 rs +Ethernet284 285,286 Ethernet36/5 36 200000 rs +Ethernet286 287,288 Ethernet36/7 36 200000 rs +Ethernet288 313,314 Ethernet37/1 37 200000 rs +Ethernet290 315,316 Ethernet37/3 37 200000 rs +Ethernet292 317,318 Ethernet37/5 37 200000 rs +Ethernet294 319,320 Ethernet37/7 37 200000 rs +Ethernet296 297,298 Ethernet38/1 38 200000 rs +Ethernet298 299,300 Ethernet38/3 38 200000 rs +Ethernet300 301,302 Ethernet38/5 38 200000 rs +Ethernet302 303,304 Ethernet38/7 38 200000 rs +Ethernet304 289,290 Ethernet39/1 39 200000 rs +Ethernet306 291,292 Ethernet39/3 39 200000 rs +Ethernet308 293,294 Ethernet39/5 39 200000 rs +Ethernet310 295,296 Ethernet39/7 39 200000 rs +Ethernet312 305,306 Ethernet40/1 40 200000 rs +Ethernet314 307,308 Ethernet40/3 40 200000 rs +Ethernet316 309,310 Ethernet40/5 40 200000 rs +Ethernet318 311,312 Ethernet40/7 40 200000 rs +Ethernet320 345,346 Ethernet41/1 41 200000 rs +Ethernet322 347,348 Ethernet41/3 41 200000 rs +Ethernet324 349,350 Ethernet41/5 41 200000 rs +Ethernet326 351,352 Ethernet41/7 41 200000 rs +Ethernet328 329,330 Ethernet42/1 42 200000 rs +Ethernet330 331,332 Ethernet42/3 42 200000 rs +Ethernet332 333,334 Ethernet42/5 42 200000 rs +Ethernet334 335,336 Ethernet42/7 42 200000 rs +Ethernet336 321,322 Ethernet43/1 43 200000 rs +Ethernet338 323,324 Ethernet43/3 43 200000 rs +Ethernet340 325,326 Ethernet43/5 43 200000 rs +Ethernet342 327,328 Ethernet43/7 43 200000 rs +Ethernet344 337,338 Ethernet44/1 44 200000 rs +Ethernet346 339,340 Ethernet44/3 44 200000 rs +Ethernet348 341,342 Ethernet44/5 44 200000 rs +Ethernet350 343,344 Ethernet44/7 44 200000 rs +Ethernet352 377,378 Ethernet45/1 45 200000 rs +Ethernet354 379,380 Ethernet45/3 45 200000 rs +Ethernet356 381,382 Ethernet45/5 45 200000 rs +Ethernet358 383,384 Ethernet45/7 45 200000 rs +Ethernet360 361,362 Ethernet46/1 46 200000 rs +Ethernet362 363,364 Ethernet46/3 46 200000 rs +Ethernet364 365,366 Ethernet46/5 46 200000 rs +Ethernet366 367,368 Ethernet46/7 46 200000 rs +Ethernet368 353,354 Ethernet47/1 47 200000 rs +Ethernet370 355,356 Ethernet47/3 47 200000 rs +Ethernet372 357,358 Ethernet47/5 47 200000 rs +Ethernet374 359,360 Ethernet47/7 47 200000 rs +Ethernet376 369,370 Ethernet48/1 48 200000 rs +Ethernet378 371,372 Ethernet48/3 48 200000 rs +Ethernet380 373,374 Ethernet48/5 48 200000 rs +Ethernet382 375,376 Ethernet48/7 48 200000 rs +Ethernet384 409,410 Ethernet49/1 49 200000 rs +Ethernet386 411,412 Ethernet49/3 49 200000 rs +Ethernet388 413,414 Ethernet49/5 49 200000 rs +Ethernet390 415,416 Ethernet49/7 49 200000 rs +Ethernet392 393,394 Ethernet50/1 50 200000 rs +Ethernet394 395,396 Ethernet50/3 50 200000 rs +Ethernet396 397,398 Ethernet50/5 50 200000 rs +Ethernet398 399,400 Ethernet50/7 50 200000 rs +Ethernet400 385,386 Ethernet51/1 51 200000 rs +Ethernet402 387,388 Ethernet51/3 51 200000 rs +Ethernet404 389,390 Ethernet51/5 51 200000 rs +Ethernet406 391,392 Ethernet51/7 51 200000 rs +Ethernet408 401,402 Ethernet52/1 52 200000 rs +Ethernet410 403,404 Ethernet52/3 52 200000 rs +Ethernet412 405,406 Ethernet52/5 52 200000 rs +Ethernet414 407,408 Ethernet52/7 52 200000 rs +Ethernet416 441,442 Ethernet53/1 53 200000 rs +Ethernet418 443,444 Ethernet53/3 53 200000 rs +Ethernet420 445,446 Ethernet53/5 53 200000 rs +Ethernet422 447,448 Ethernet53/7 53 200000 rs +Ethernet424 425,426 Ethernet54/1 54 200000 rs +Ethernet426 427,428 Ethernet54/3 54 200000 rs +Ethernet428 429,430 Ethernet54/5 54 200000 rs +Ethernet430 431,432 Ethernet54/7 54 200000 rs +Ethernet432 417,418 Ethernet55/1 55 200000 rs +Ethernet434 419,420 Ethernet55/3 55 200000 rs +Ethernet436 421,422 Ethernet55/5 55 200000 rs +Ethernet438 423,424 Ethernet55/7 55 200000 rs +Ethernet440 433,434 Ethernet56/1 56 200000 rs +Ethernet442 435,436 Ethernet56/3 56 200000 rs +Ethernet444 437,438 Ethernet56/5 56 200000 rs +Ethernet446 439,440 Ethernet56/7 56 200000 rs +Ethernet448 473,474 Ethernet57/1 57 200000 rs +Ethernet450 475,476 Ethernet57/3 57 200000 rs +Ethernet452 477,478 Ethernet57/5 57 200000 rs +Ethernet454 479,480 Ethernet57/7 57 200000 rs +Ethernet456 457,458 Ethernet58/1 58 200000 rs +Ethernet458 459,460 Ethernet58/3 58 200000 rs +Ethernet460 461,462 Ethernet58/5 58 200000 rs +Ethernet462 463,464 Ethernet58/7 58 200000 rs +Ethernet464 449,450 Ethernet59/1 59 200000 rs +Ethernet466 451,452 Ethernet59/3 59 200000 rs +Ethernet468 453,454 Ethernet59/5 59 200000 rs +Ethernet470 455,456 Ethernet59/7 59 200000 rs +Ethernet472 465,466 Ethernet60/1 60 200000 rs +Ethernet474 467,468 Ethernet60/3 60 200000 rs +Ethernet476 469,470 Ethernet60/5 60 200000 rs +Ethernet478 471,472 Ethernet60/7 60 200000 rs +Ethernet480 505,506 Ethernet61/1 61 200000 rs +Ethernet482 507,508 Ethernet61/3 61 200000 rs +Ethernet484 509,510 Ethernet61/5 61 200000 rs +Ethernet486 511,512 Ethernet61/7 61 200000 rs +Ethernet488 489,490 Ethernet62/1 62 200000 rs +Ethernet490 491,492 Ethernet62/3 62 200000 rs +Ethernet492 493,494 Ethernet62/5 62 200000 rs +Ethernet494 495,496 Ethernet62/7 62 200000 rs +Ethernet496 481,482 Ethernet63/1 63 200000 rs +Ethernet498 483,484 Ethernet63/3 63 200000 rs +Ethernet500 485,486 Ethernet63/5 63 200000 rs +Ethernet502 487,488 Ethernet63/7 63 200000 rs +Ethernet504 497,498 Ethernet64/1 64 200000 rs +Ethernet506 499,500 Ethernet64/3 64 200000 rs +Ethernet508 501,502 Ethernet64/5 64 200000 rs +Ethernet510 503,504 Ethernet64/7 64 200000 rs diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/sai.profile b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/sai.profile new file mode 100644 index 000000000000..50c136d97b24 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm new file mode 100644 index 000000000000..997636fdcc58 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm @@ -0,0 +1,1913 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +#
: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x26 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x67 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 3 + ? + PORT_ID: 3 + : + PC_PHYS_PORT_ID: 5 + ? + PORT_ID: 4 + : + PC_PHYS_PORT_ID: 7 + ? + PORT_ID: 5 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 6 + : + PC_PHYS_PORT_ID: 11 + ? + PORT_ID: 7 + : + PC_PHYS_PORT_ID: 13 + ? + PORT_ID: 8 + : + PC_PHYS_PORT_ID: 15 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 19 + ? + PORT_ID: 13 + : + PC_PHYS_PORT_ID: 21 + ? + PORT_ID: 14 + : + PC_PHYS_PORT_ID: 23 + ? + PORT_ID: 15 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 16 + : + PC_PHYS_PORT_ID: 27 + ? + PORT_ID: 17 + : + PC_PHYS_PORT_ID: 29 + ? + PORT_ID: 18 + : + PC_PHYS_PORT_ID: 31 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 35 + ? + PORT_ID: 24 + : + PC_PHYS_PORT_ID: 37 + ? + PORT_ID: 25 + : + PC_PHYS_PORT_ID: 39 + ? + PORT_ID: 26 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 27 + : + PC_PHYS_PORT_ID: 43 + ? + PORT_ID: 28 + : + PC_PHYS_PORT_ID: 45 + ? + PORT_ID: 29 + : + PC_PHYS_PORT_ID: 47 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 51 + ? + PORT_ID: 35 + : + PC_PHYS_PORT_ID: 53 + ? + PORT_ID: 36 + : + PC_PHYS_PORT_ID: 55 + ? + PORT_ID: 37 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 38 + : + PC_PHYS_PORT_ID: 59 + ? + PORT_ID: 39 + : + PC_PHYS_PORT_ID: 61 + ? + PORT_ID: 40 + : + PC_PHYS_PORT_ID: 63 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 67 + ? + PORT_ID: 46 + : + PC_PHYS_PORT_ID: 69 + ? + PORT_ID: 47 + : + PC_PHYS_PORT_ID: 71 + ? + PORT_ID: 48 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 49 + : + PC_PHYS_PORT_ID: 75 + ? + PORT_ID: 50 + : + PC_PHYS_PORT_ID: 77 + ? + PORT_ID: 51 + : + PC_PHYS_PORT_ID: 79 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 83 + ? + PORT_ID: 57 + : + PC_PHYS_PORT_ID: 85 + ? + PORT_ID: 58 + : + PC_PHYS_PORT_ID: 87 + ? + PORT_ID: 59 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 60 + : + PC_PHYS_PORT_ID: 91 + ? + PORT_ID: 61 + : + PC_PHYS_PORT_ID: 93 + ? + PORT_ID: 62 + : + PC_PHYS_PORT_ID: 95 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 99 + ? + PORT_ID: 68 + : + PC_PHYS_PORT_ID: 101 + ? + PORT_ID: 69 + : + PC_PHYS_PORT_ID: 103 + ? + PORT_ID: 70 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 71 + : + PC_PHYS_PORT_ID: 107 + ? + PORT_ID: 72 + : + PC_PHYS_PORT_ID: 109 + ? + PORT_ID: 73 + : + PC_PHYS_PORT_ID: 111 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 115 + ? + PORT_ID: 79 + : + PC_PHYS_PORT_ID: 117 + ? + PORT_ID: 80 + : + PC_PHYS_PORT_ID: 119 + ? + PORT_ID: 81 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 82 + : + PC_PHYS_PORT_ID: 123 + ? + PORT_ID: 83 + : + PC_PHYS_PORT_ID: 125 + ? + PORT_ID: 84 + : + PC_PHYS_PORT_ID: 127 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 131 + ? + PORT_ID: 90 + : + PC_PHYS_PORT_ID: 133 + ? + PORT_ID: 91 + : + PC_PHYS_PORT_ID: 135 + ? + PORT_ID: 92 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 93 + : + PC_PHYS_PORT_ID: 139 + ? + PORT_ID: 94 + : + PC_PHYS_PORT_ID: 141 + ? + PORT_ID: 95 + : + PC_PHYS_PORT_ID: 143 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 147 + ? + PORT_ID: 101 + : + PC_PHYS_PORT_ID: 149 + ? + PORT_ID: 102 + : + PC_PHYS_PORT_ID: 151 + ? + PORT_ID: 103 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 104 + : + PC_PHYS_PORT_ID: 155 + ? + PORT_ID: 105 + : + PC_PHYS_PORT_ID: 157 + ? + PORT_ID: 106 + : + PC_PHYS_PORT_ID: 159 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 163 + ? + PORT_ID: 112 + : + PC_PHYS_PORT_ID: 165 + ? + PORT_ID: 113 + : + PC_PHYS_PORT_ID: 167 + ? + PORT_ID: 114 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 115 + : + PC_PHYS_PORT_ID: 171 + ? + PORT_ID: 116 + : + PC_PHYS_PORT_ID: 173 + ? + PORT_ID: 117 + : + PC_PHYS_PORT_ID: 175 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 179 + ? + PORT_ID: 123 + : + PC_PHYS_PORT_ID: 181 + ? + PORT_ID: 124 + : + PC_PHYS_PORT_ID: 183 + ? + PORT_ID: 125 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 126 + : + PC_PHYS_PORT_ID: 187 + ? + PORT_ID: 127 + : + PC_PHYS_PORT_ID: 189 + ? + PORT_ID: 128 + : + PC_PHYS_PORT_ID: 191 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 195 + ? + PORT_ID: 134 + : + PC_PHYS_PORT_ID: 197 + ? + PORT_ID: 135 + : + PC_PHYS_PORT_ID: 199 + ? + PORT_ID: 136 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 137 + : + PC_PHYS_PORT_ID: 203 + ? + PORT_ID: 138 + : + PC_PHYS_PORT_ID: 205 + ? + PORT_ID: 139 + : + PC_PHYS_PORT_ID: 207 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 211 + ? + PORT_ID: 145 + : + PC_PHYS_PORT_ID: 213 + ? + PORT_ID: 146 + : + PC_PHYS_PORT_ID: 215 + ? + PORT_ID: 147 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 148 + : + PC_PHYS_PORT_ID: 219 + ? + PORT_ID: 149 + : + PC_PHYS_PORT_ID: 221 + ? + PORT_ID: 150 + : + PC_PHYS_PORT_ID: 223 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 227 + ? + PORT_ID: 156 + : + PC_PHYS_PORT_ID: 229 + ? + PORT_ID: 157 + : + PC_PHYS_PORT_ID: 231 + ? + PORT_ID: 158 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 159 + : + PC_PHYS_PORT_ID: 235 + ? + PORT_ID: 160 + : + PC_PHYS_PORT_ID: 237 + ? + PORT_ID: 161 + : + PC_PHYS_PORT_ID: 239 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 243 + ? + PORT_ID: 167 + : + PC_PHYS_PORT_ID: 245 + ? + PORT_ID: 168 + : + PC_PHYS_PORT_ID: 247 + ? + PORT_ID: 169 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 170 + : + PC_PHYS_PORT_ID: 251 + ? + PORT_ID: 171 + : + PC_PHYS_PORT_ID: 253 + ? + PORT_ID: 172 + : + PC_PHYS_PORT_ID: 255 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 259 + ? + PORT_ID: 178 + : + PC_PHYS_PORT_ID: 261 + ? + PORT_ID: 179 + : + PC_PHYS_PORT_ID: 263 + ? + PORT_ID: 180 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 181 + : + PC_PHYS_PORT_ID: 267 + ? + PORT_ID: 182 + : + PC_PHYS_PORT_ID: 269 + ? + PORT_ID: 183 + : + PC_PHYS_PORT_ID: 271 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 275 + ? + PORT_ID: 189 + : + PC_PHYS_PORT_ID: 277 + ? + PORT_ID: 190 + : + PC_PHYS_PORT_ID: 279 + ? + PORT_ID: 191 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 192 + : + PC_PHYS_PORT_ID: 283 + ? + PORT_ID: 193 + : + PC_PHYS_PORT_ID: 285 + ? + PORT_ID: 194 + : + PC_PHYS_PORT_ID: 287 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 291 + ? + PORT_ID: 200 + : + PC_PHYS_PORT_ID: 293 + ? + PORT_ID: 201 + : + PC_PHYS_PORT_ID: 295 + ? + PORT_ID: 202 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 203 + : + PC_PHYS_PORT_ID: 299 + ? + PORT_ID: 204 + : + PC_PHYS_PORT_ID: 301 + ? + PORT_ID: 205 + : + PC_PHYS_PORT_ID: 303 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 307 + ? + PORT_ID: 211 + : + PC_PHYS_PORT_ID: 309 + ? + PORT_ID: 212 + : + PC_PHYS_PORT_ID: 311 + ? + PORT_ID: 213 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 214 + : + PC_PHYS_PORT_ID: 315 + ? + PORT_ID: 215 + : + PC_PHYS_PORT_ID: 317 + ? + PORT_ID: 216 + : + PC_PHYS_PORT_ID: 319 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 323 + ? + PORT_ID: 222 + : + PC_PHYS_PORT_ID: 325 + ? + PORT_ID: 223 + : + PC_PHYS_PORT_ID: 327 + ? + PORT_ID: 224 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 225 + : + PC_PHYS_PORT_ID: 331 + ? + PORT_ID: 226 + : + PC_PHYS_PORT_ID: 333 + ? + PORT_ID: 227 + : + PC_PHYS_PORT_ID: 335 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 339 + ? + PORT_ID: 233 + : + PC_PHYS_PORT_ID: 341 + ? + PORT_ID: 234 + : + PC_PHYS_PORT_ID: 343 + ? + PORT_ID: 235 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 236 + : + PC_PHYS_PORT_ID: 347 + ? + PORT_ID: 237 + : + PC_PHYS_PORT_ID: 349 + ? + PORT_ID: 238 + : + PC_PHYS_PORT_ID: 351 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 355 + ? + PORT_ID: 244 + : + PC_PHYS_PORT_ID: 357 + ? + PORT_ID: 245 + : + PC_PHYS_PORT_ID: 359 + ? + PORT_ID: 246 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 247 + : + PC_PHYS_PORT_ID: 363 + ? + PORT_ID: 248 + : + PC_PHYS_PORT_ID: 365 + ? + PORT_ID: 249 + : + PC_PHYS_PORT_ID: 367 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 371 + ? + PORT_ID: 255 + : + PC_PHYS_PORT_ID: 373 + ? + PORT_ID: 256 + : + PC_PHYS_PORT_ID: 375 + ? + PORT_ID: 257 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 258 + : + PC_PHYS_PORT_ID: 379 + ? + PORT_ID: 259 + : + PC_PHYS_PORT_ID: 381 + ? + PORT_ID: 260 + : + PC_PHYS_PORT_ID: 383 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 387 + ? + PORT_ID: 266 + : + PC_PHYS_PORT_ID: 389 + ? + PORT_ID: 267 + : + PC_PHYS_PORT_ID: 391 + ? + PORT_ID: 268 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 269 + : + PC_PHYS_PORT_ID: 395 + ? + PORT_ID: 270 + : + PC_PHYS_PORT_ID: 397 + ? + PORT_ID: 271 + : + PC_PHYS_PORT_ID: 399 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 403 + ? + PORT_ID: 277 + : + PC_PHYS_PORT_ID: 405 + ? + PORT_ID: 278 + : + PC_PHYS_PORT_ID: 407 + ? + PORT_ID: 279 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 280 + : + PC_PHYS_PORT_ID: 411 + ? + PORT_ID: 281 + : + PC_PHYS_PORT_ID: 413 + ? + PORT_ID: 282 + : + PC_PHYS_PORT_ID: 415 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 419 + ? + PORT_ID: 288 + : + PC_PHYS_PORT_ID: 421 + ? + PORT_ID: 289 + : + PC_PHYS_PORT_ID: 423 + ? + PORT_ID: 290 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 291 + : + PC_PHYS_PORT_ID: 427 + ? + PORT_ID: 292 + : + PC_PHYS_PORT_ID: 429 + ? + PORT_ID: 293 + : + PC_PHYS_PORT_ID: 431 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 435 + ? + PORT_ID: 299 + : + PC_PHYS_PORT_ID: 437 + ? + PORT_ID: 300 + : + PC_PHYS_PORT_ID: 439 + ? + PORT_ID: 301 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 302 + : + PC_PHYS_PORT_ID: 443 + ? + PORT_ID: 303 + : + PC_PHYS_PORT_ID: 445 + ? + PORT_ID: 304 + : + PC_PHYS_PORT_ID: 447 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 451 + ? + PORT_ID: 310 + : + PC_PHYS_PORT_ID: 453 + ? + PORT_ID: 311 + : + PC_PHYS_PORT_ID: 455 + ? + PORT_ID: 312 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 313 + : + PC_PHYS_PORT_ID: 459 + ? + PORT_ID: 314 + : + PC_PHYS_PORT_ID: 461 + ? + PORT_ID: 315 + : + PC_PHYS_PORT_ID: 463 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 467 + ? + PORT_ID: 321 + : + PC_PHYS_PORT_ID: 469 + ? + PORT_ID: 322 + : + PC_PHYS_PORT_ID: 471 + ? + PORT_ID: 323 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 324 + : + PC_PHYS_PORT_ID: 475 + ? + PORT_ID: 325 + : + PC_PHYS_PORT_ID: 477 + ? + PORT_ID: 326 + : + PC_PHYS_PORT_ID: 479 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 483 + ? + PORT_ID: 332 + : + PC_PHYS_PORT_ID: 485 + ? + PORT_ID: 333 + : + PC_PHYS_PORT_ID: 487 + ? + PORT_ID: 334 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 335 + : + PC_PHYS_PORT_ID: 491 + ? + PORT_ID: 336 + : + PC_PHYS_PORT_ID: 493 + ? + PORT_ID: 337 + : + PC_PHYS_PORT_ID: 495 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 499 + ? + PORT_ID: 343 + : + PC_PHYS_PORT_ID: 501 + ? + PORT_ID: 344 + : + PC_PHYS_PORT_ID: 503 + ? + PORT_ID: 345 + : + PC_PHYS_PORT_ID: 505 + ? + PORT_ID: 346 + : + PC_PHYS_PORT_ID: 507 + ? + PORT_ID: 347 + : + PC_PHYS_PORT_ID: 509 + ? + PORT_ID: 348 + : + PC_PHYS_PORT_ID: 511 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 8], + [11, 18], + [22, 29], + [33, 40], + [44, 51], + [55, 62], + [66, 73], + [77, 84], + [88, 95], + [99, 106], + [110, 117], + [121, 128], + [132, 139], + [143, 150], + [154, 161], + [165, 172], + [176, 183], + [187, 194], + [198, 205], + [209, 216], + [220, 227], + [231, 238], + [242, 249], + [253, 260], + [264, 271], + [275, 282], + [286, 293], + [297, 304], + [308, 315], + [319, 326], + [330, 337], + [341, 348]] + : + ENABLE: 0 + SPEED: 200000 + NUM_LANES: 2 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... From 00c70707d8d07d537474ef8d5f4b655074a4efa8 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 6 May 2024 08:54:52 -0700 Subject: [PATCH 040/282] Add 4x200G breakout in platform.json --- .../x86_64-arista_7060x6_64pe/platform.json | 386 +++++++++++++++++- 1 file changed, 385 insertions(+), 1 deletion(-) diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform.json b/device/arista/x86_64-arista_7060x6_64pe/platform.json index a249a56b4c47..45c564a126f9 100644 --- a/device/arista/x86_64-arista_7060x6_64pe/platform.json +++ b/device/arista/x86_64-arista_7060x6_64pe/platform.json @@ -321,6 +321,12 @@ "2x400G": [ "Ethernet1/1", "Ethernet1/5" + ], + "4x200G": [ + "Ethernet1/1", + "Ethernet1/3", + "Ethernet1/5", + "Ethernet1/7" ] } }, @@ -337,6 +343,12 @@ "2x400G": [ "Ethernet2/1", "Ethernet2/5" + ], + "4x200G": [ + "Ethernet2/1", + "Ethernet2/3", + "Ethernet2/5", + "Ethernet2/7" ] } }, @@ -353,6 +365,12 @@ "2x400G": [ "Ethernet3/1", "Ethernet3/5" + ], + "4x200G": [ + "Ethernet3/1", + "Ethernet3/3", + "Ethernet3/5", + "Ethernet3/7" ] } }, @@ -369,6 +387,12 @@ "2x400G": [ "Ethernet4/1", "Ethernet4/5" + ], + "4x200G": [ + "Ethernet4/1", + "Ethernet4/3", + "Ethernet4/5", + "Ethernet4/7" ] } }, @@ -385,6 +409,12 @@ "2x400G": [ "Ethernet5/1", "Ethernet5/5" + ], + "4x200G": [ + "Ethernet5/1", + "Ethernet5/3", + "Ethernet5/5", + "Ethernet5/7" ] } }, @@ -401,6 +431,12 @@ "2x400G": [ "Ethernet6/1", "Ethernet6/5" + ], + "4x200G": [ + "Ethernet6/1", + "Ethernet6/3", + "Ethernet6/5", + "Ethernet6/7" ] } }, @@ -417,6 +453,12 @@ "2x400G": [ "Ethernet7/1", "Ethernet7/5" + ], + "4x200G": [ + "Ethernet7/1", + "Ethernet7/3", + "Ethernet7/5", + "Ethernet7/7" ] } }, @@ -433,6 +475,12 @@ "2x400G": [ "Ethernet8/1", "Ethernet8/5" + ], + "4x200G": [ + "Ethernet8/1", + "Ethernet8/3", + "Ethernet8/5", + "Ethernet8/7" ] } }, @@ -449,6 +497,12 @@ "2x400G": [ "Ethernet9/1", "Ethernet9/5" + ], + "4x200G": [ + "Ethernet9/1", + "Ethernet9/3", + "Ethernet9/5", + "Ethernet9/7" ] } }, @@ -465,6 +519,12 @@ "2x400G": [ "Ethernet10/1", "Ethernet10/5" + ], + "4x200G": [ + "Ethernet10/1", + "Ethernet10/3", + "Ethernet10/5", + "Ethernet10/7" ] } }, @@ -481,6 +541,12 @@ "2x400G": [ "Ethernet11/1", "Ethernet11/5" + ], + "4x200G": [ + "Ethernet11/1", + "Ethernet11/3", + "Ethernet11/5", + "Ethernet11/7" ] } }, @@ -497,6 +563,12 @@ "2x400G": [ "Ethernet12/1", "Ethernet12/5" + ], + "4x200G": [ + "Ethernet12/1", + "Ethernet12/3", + "Ethernet12/5", + "Ethernet12/7" ] } }, @@ -513,6 +585,12 @@ "2x400G": [ "Ethernet13/1", "Ethernet13/5" + ], + "4x200G": [ + "Ethernet13/1", + "Ethernet13/3", + "Ethernet13/5", + "Ethernet13/7" ] } }, @@ -529,6 +607,12 @@ "2x400G": [ "Ethernet14/1", "Ethernet14/5" + ], + "4x200G": [ + "Ethernet14/1", + "Ethernet14/3", + "Ethernet14/5", + "Ethernet14/7" ] } }, @@ -545,6 +629,12 @@ "2x400G": [ "Ethernet15/1", "Ethernet15/5" + ], + "4x200G": [ + "Ethernet15/1", + "Ethernet15/3", + "Ethernet15/5", + "Ethernet15/7" ] } }, @@ -561,6 +651,12 @@ "2x400G": [ "Ethernet16/1", "Ethernet16/5" + ], + "4x200G": [ + "Ethernet16/1", + "Ethernet16/3", + "Ethernet16/5", + "Ethernet16/7" ] } }, @@ -577,6 +673,12 @@ "2x400G": [ "Ethernet17/1", "Ethernet17/5" + ], + "4x200G": [ + "Ethernet17/1", + "Ethernet17/3", + "Ethernet17/5", + "Ethernet17/7" ] } }, @@ -593,6 +695,12 @@ "2x400G": [ "Ethernet18/1", "Ethernet18/5" + ], + "4x200G": [ + "Ethernet18/1", + "Ethernet18/3", + "Ethernet18/5", + "Ethernet18/7" ] } }, @@ -609,6 +717,12 @@ "2x400G": [ "Ethernet19/1", "Ethernet19/5" + ], + "4x200G": [ + "Ethernet19/1", + "Ethernet19/3", + "Ethernet19/5", + "Ethernet19/7" ] } }, @@ -625,6 +739,12 @@ "2x400G": [ "Ethernet20/1", "Ethernet20/5" + ], + "4x200G": [ + "Ethernet20/1", + "Ethernet20/3", + "Ethernet20/5", + "Ethernet20/7" ] } }, @@ -641,6 +761,12 @@ "2x400G": [ "Ethernet21/1", "Ethernet21/5" + ], + "4x200G": [ + "Ethernet21/1", + "Ethernet21/3", + "Ethernet21/5", + "Ethernet21/7" ] } }, @@ -657,6 +783,12 @@ "2x400G": [ "Ethernet22/1", "Ethernet22/5" + ], + "4x200G": [ + "Ethernet22/1", + "Ethernet22/3", + "Ethernet22/5", + "Ethernet22/7" ] } }, @@ -673,6 +805,12 @@ "2x400G": [ "Ethernet23/1", "Ethernet23/5" + ], + "4x200G": [ + "Ethernet23/1", + "Ethernet23/3", + "Ethernet23/5", + "Ethernet23/7" ] } }, @@ -689,6 +827,12 @@ "2x400G": [ "Ethernet24/1", "Ethernet24/5" + ], + "4x200G": [ + "Ethernet24/1", + "Ethernet24/3", + "Ethernet24/5", + "Ethernet24/7" ] } }, @@ -705,6 +849,12 @@ "2x400G": [ "Ethernet25/1", "Ethernet25/5" + ], + "4x200G": [ + "Ethernet25/1", + "Ethernet25/3", + "Ethernet25/5", + "Ethernet25/7" ] } }, @@ -721,6 +871,12 @@ "2x400G": [ "Ethernet26/1", "Ethernet26/5" + ], + "4x200G": [ + "Ethernet26/1", + "Ethernet26/3", + "Ethernet26/5", + "Ethernet26/7" ] } }, @@ -737,6 +893,12 @@ "2x400G": [ "Ethernet27/1", "Ethernet27/5" + ], + "4x200G": [ + "Ethernet27/1", + "Ethernet27/3", + "Ethernet27/5", + "Ethernet27/7" ] } }, @@ -753,6 +915,12 @@ "2x400G": [ "Ethernet28/1", "Ethernet28/5" + ], + "4x200G": [ + "Ethernet28/1", + "Ethernet28/3", + "Ethernet28/5", + "Ethernet28/7" ] } }, @@ -769,6 +937,12 @@ "2x400G": [ "Ethernet29/1", "Ethernet29/5" + ], + "4x200G": [ + "Ethernet29/1", + "Ethernet29/3", + "Ethernet29/5", + "Ethernet29/7" ] } }, @@ -785,6 +959,12 @@ "2x400G": [ "Ethernet30/1", "Ethernet30/5" + ], + "4x200G": [ + "Ethernet30/1", + "Ethernet30/3", + "Ethernet30/5", + "Ethernet30/7" ] } }, @@ -801,6 +981,12 @@ "2x400G": [ "Ethernet31/1", "Ethernet31/5" + ], + "4x200G": [ + "Ethernet31/1", + "Ethernet31/3", + "Ethernet31/5", + "Ethernet31/7" ] } }, @@ -817,6 +1003,12 @@ "2x400G": [ "Ethernet32/1", "Ethernet32/5" + ], + "4x200G": [ + "Ethernet32/1", + "Ethernet32/3", + "Ethernet32/5", + "Ethernet32/7" ] } }, @@ -833,6 +1025,12 @@ "2x400G": [ "Ethernet33/1", "Ethernet33/5" + ], + "4x200G": [ + "Ethernet33/1", + "Ethernet33/3", + "Ethernet33/5", + "Ethernet33/7" ] } }, @@ -849,6 +1047,12 @@ "2x400G": [ "Ethernet34/1", "Ethernet34/5" + ], + "4x200G": [ + "Ethernet34/1", + "Ethernet34/3", + "Ethernet34/5", + "Ethernet34/7" ] } }, @@ -865,6 +1069,12 @@ "2x400G": [ "Ethernet35/1", "Ethernet35/5" + ], + "4x200G": [ + "Ethernet35/1", + "Ethernet35/3", + "Ethernet35/5", + "Ethernet35/7" ] } }, @@ -881,6 +1091,12 @@ "2x400G": [ "Ethernet36/1", "Ethernet36/5" + ], + "4x200G": [ + "Ethernet36/1", + "Ethernet36/3", + "Ethernet36/5", + "Ethernet36/7" ] } }, @@ -897,6 +1113,12 @@ "2x400G": [ "Ethernet37/1", "Ethernet37/5" + ], + "4x200G": [ + "Ethernet37/1", + "Ethernet37/3", + "Ethernet37/5", + "Ethernet37/7" ] } }, @@ -913,6 +1135,12 @@ "2x400G": [ "Ethernet38/1", "Ethernet38/5" + ], + "4x200G": [ + "Ethernet38/1", + "Ethernet38/3", + "Ethernet38/5", + "Ethernet38/7" ] } }, @@ -929,6 +1157,12 @@ "2x400G": [ "Ethernet39/1", "Ethernet39/5" + ], + "4x200G": [ + "Ethernet39/1", + "Ethernet39/3", + "Ethernet39/5", + "Ethernet39/7" ] } }, @@ -945,6 +1179,12 @@ "2x400G": [ "Ethernet40/1", "Ethernet40/5" + ], + "4x200G": [ + "Ethernet40/1", + "Ethernet40/3", + "Ethernet40/5", + "Ethernet40/7" ] } }, @@ -961,6 +1201,12 @@ "2x400G": [ "Ethernet41/1", "Ethernet41/5" + ], + "4x200G": [ + "Ethernet41/1", + "Ethernet41/3", + "Ethernet41/5", + "Ethernet41/7" ] } }, @@ -977,6 +1223,12 @@ "2x400G": [ "Ethernet42/1", "Ethernet42/5" + ], + "4x200G": [ + "Ethernet42/1", + "Ethernet42/3", + "Ethernet42/5", + "Ethernet42/7" ] } }, @@ -993,6 +1245,12 @@ "2x400G": [ "Ethernet43/1", "Ethernet43/5" + ], + "4x200G": [ + "Ethernet43/1", + "Ethernet43/3", + "Ethernet43/5", + "Ethernet43/7" ] } }, @@ -1009,6 +1267,12 @@ "2x400G": [ "Ethernet44/1", "Ethernet44/5" + ], + "4x200G": [ + "Ethernet44/1", + "Ethernet44/3", + "Ethernet44/5", + "Ethernet44/7" ] } }, @@ -1025,6 +1289,12 @@ "2x400G": [ "Ethernet45/1", "Ethernet45/5" + ], + "4x200G": [ + "Ethernet45/1", + "Ethernet45/3", + "Ethernet45/5", + "Ethernet45/7" ] } }, @@ -1041,6 +1311,12 @@ "2x400G": [ "Ethernet46/1", "Ethernet46/5" + ], + "4x200G": [ + "Ethernet46/1", + "Ethernet46/3", + "Ethernet46/5", + "Ethernet46/7" ] } }, @@ -1057,6 +1333,12 @@ "2x400G": [ "Ethernet47/1", "Ethernet47/5" + ], + "4x200G": [ + "Ethernet47/1", + "Ethernet47/3", + "Ethernet47/5", + "Ethernet47/7" ] } }, @@ -1073,6 +1355,12 @@ "2x400G": [ "Ethernet48/1", "Ethernet48/5" + ], + "4x200G": [ + "Ethernet48/1", + "Ethernet48/3", + "Ethernet48/5", + "Ethernet48/7" ] } }, @@ -1089,6 +1377,12 @@ "2x400G": [ "Ethernet49/1", "Ethernet49/5" + ], + "4x200G": [ + "Ethernet49/1", + "Ethernet49/3", + "Ethernet49/5", + "Ethernet49/7" ] } }, @@ -1105,6 +1399,12 @@ "2x400G": [ "Ethernet50/1", "Ethernet50/5" + ], + "4x200G": [ + "Ethernet50/1", + "Ethernet50/3", + "Ethernet50/5", + "Ethernet50/7" ] } }, @@ -1121,6 +1421,12 @@ "2x400G": [ "Ethernet51/1", "Ethernet51/5" + ], + "4x200G": [ + "Ethernet51/1", + "Ethernet51/3", + "Ethernet51/5", + "Ethernet51/7" ] } }, @@ -1137,6 +1443,12 @@ "2x400G": [ "Ethernet52/1", "Ethernet52/5" + ], + "4x200G": [ + "Ethernet52/1", + "Ethernet52/3", + "Ethernet52/5", + "Ethernet52/7" ] } }, @@ -1153,6 +1465,12 @@ "2x400G": [ "Ethernet53/1", "Ethernet53/5" + ], + "4x200G": [ + "Ethernet53/1", + "Ethernet53/3", + "Ethernet53/5", + "Ethernet53/7" ] } }, @@ -1169,6 +1487,12 @@ "2x400G": [ "Ethernet54/1", "Ethernet54/5" + ], + "4x200G": [ + "Ethernet54/1", + "Ethernet54/3", + "Ethernet54/5", + "Ethernet54/7" ] } }, @@ -1185,6 +1509,12 @@ "2x400G": [ "Ethernet55/1", "Ethernet55/5" + ], + "4x200G": [ + "Ethernet55/1", + "Ethernet55/3", + "Ethernet55/5", + "Ethernet55/7" ] } }, @@ -1201,6 +1531,12 @@ "2x400G": [ "Ethernet56/1", "Ethernet56/5" + ], + "4x200G": [ + "Ethernet56/1", + "Ethernet56/3", + "Ethernet56/5", + "Ethernet56/7" ] } }, @@ -1217,6 +1553,12 @@ "2x400G": [ "Ethernet57/1", "Ethernet57/5" + ], + "4x200G": [ + "Ethernet57/1", + "Ethernet57/3", + "Ethernet57/5", + "Ethernet57/7" ] } }, @@ -1233,6 +1575,12 @@ "2x400G": [ "Ethernet58/1", "Ethernet58/5" + ], + "4x200G": [ + "Ethernet58/1", + "Ethernet58/3", + "Ethernet58/5", + "Ethernet58/7" ] } }, @@ -1249,6 +1597,12 @@ "2x400G": [ "Ethernet59/1", "Ethernet59/5" + ], + "4x200G": [ + "Ethernet59/1", + "Ethernet59/3", + "Ethernet59/5", + "Ethernet59/7" ] } }, @@ -1265,6 +1619,12 @@ "2x400G": [ "Ethernet60/1", "Ethernet60/5" + ], + "4x200G": [ + "Ethernet60/1", + "Ethernet60/3", + "Ethernet60/5", + "Ethernet60/7" ] } }, @@ -1281,6 +1641,12 @@ "2x400G": [ "Ethernet61/1", "Ethernet61/5" + ], + "4x200G": [ + "Ethernet61/1", + "Ethernet61/3", + "Ethernet61/5", + "Ethernet61/7" ] } }, @@ -1297,6 +1663,12 @@ "2x400G": [ "Ethernet62/1", "Ethernet62/5" + ], + "4x200G": [ + "Ethernet62/1", + "Ethernet62/3", + "Ethernet62/5", + "Ethernet62/7" ] } }, @@ -1313,6 +1685,12 @@ "2x400G": [ "Ethernet63/1", "Ethernet63/5" + ], + "4x200G": [ + "Ethernet63/1", + "Ethernet63/3", + "Ethernet63/5", + "Ethernet63/7" ] } }, @@ -1329,8 +1707,14 @@ "2x400G": [ "Ethernet64/1", "Ethernet64/5" + ], + "4x200G": [ + "Ethernet64/1", + "Ethernet64/3", + "Ethernet64/5", + "Ethernet64/7" ] } } } -} +} \ No newline at end of file From a268da38c9d88f056042db06345741557731e726 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Mon, 6 May 2024 22:59:41 +0200 Subject: [PATCH 041/282] [Arista] Update platform library submodules (#18877) Add platform driver support for the DCS-7060X6-64PE product --- platform/barefoot/sonic-platform-modules-arista | 2 +- platform/broadcom/sonic-platform-modules-arista | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/barefoot/sonic-platform-modules-arista b/platform/barefoot/sonic-platform-modules-arista index 9038696debe7..c8924f32a3cf 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 9038696debe74bd99b0b6e35552531e38cd1aa51 +Subproject commit c8924f32a3cff45e35dcdfd9f0b7dd9d37cecf60 diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 9038696debe7..c8924f32a3cf 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 9038696debe74bd99b0b6e35552531e38cd1aa51 +Subproject commit c8924f32a3cff45e35dcdfd9f0b7dd9d37cecf60 From 0fcdfee663a55a80d286f9b01b1b82c68b98a801 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 7 May 2024 16:01:31 +0800 Subject: [PATCH 042/282] [submodule] Update submodule sonic-mgmt-common to the latest HEAD automatically (#18889) #### Why I did it src/sonic-mgmt-common ``` * 328d806 - (HEAD -> master, origin/master, origin/HEAD) Release CString memory to fix memory leak (#138) (11 hours ago) [ganglv] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-mgmt-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-common b/src/sonic-mgmt-common index 85119e8f9203..328d8063c169 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit 85119e8f920399ad91eae06a33661707eeb7cd04 +Subproject commit 328d8063c1692ef402a15b5228b2a3c71b9dc53c From 8dde75f9d479be42d55ab7ef458ed714a30b18ac Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 7 May 2024 16:01:36 +0800 Subject: [PATCH 043/282] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#18888) #### Why I did it src/sonic-gnmi ``` * c2bfe3d - (HEAD -> master, origin/master, origin/HEAD) Fix memory leak in unit test (#230) (44 minutes ago) [ganglv] * 16c2975 - Disable translib unit test (#229) (71 minutes ago) [ganglv] * 4c86853 - Merge pull request #224 from ganglyu/fix_build (10 hours ago) [Saikrishna Arcot] * db2d896 - Disable dialout unit test (3 days ago) [ganglyu] * 0e4ac4d - Disable translib test (4 days ago) [ganglyu] * 8494e90 - Fix unit test (4 days ago) [ganglyu] * 036979d - Fix unit test (4 days ago) [ganglyu] * bd74b09 - Disable failed unit test (4 days ago) [ganglyu] * a4bc960 - Update go.mod (7 days ago) [ganglyu] * c15d45f - Fix build error (7 days ago) [ganglyu] * 775a41e - Fix go.sum (7 days ago) [ganglyu] * b39742e - Fix build error from sonic-mgmt-common (7 days ago) [ganglyu] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index eea5d7dd6297..c2bfe3d27354 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit eea5d7dd6297b7c31e15d22c12c1c9b6350596cd +Subproject commit c2bfe3d2735421b3cb84d10e84014ed8019f986b From 4a421c89acb09e665031b8389bc13b82cb353711 Mon Sep 17 00:00:00 2001 From: Yakiv Huryk <62013282+Yakiv-Huryk@users.noreply.github.com> Date: Tue, 7 May 2024 13:31:46 +0300 Subject: [PATCH 044/282] [Mellanox] update platform name for simx platforms (#18861) - Why I did it To update Mellanox simx platforms chassis name - How I did it Updated relevant platform.json files Signed-off-by: Yakiv Huryk --- device/mellanox/x86_64-mlnx_msn4700_simx-r0/platform.json | 2 +- device/mellanox/x86_64-nvidia_sn4280_simx-r0/platform.json | 2 +- device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json | 2 +- device/mellanox/x86_64-nvidia_sn5600_simx-r0/platform.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn4700_simx-r0/platform.json b/device/mellanox/x86_64-mlnx_msn4700_simx-r0/platform.json index 86fcbf5b91bb..480edaa95a15 100644 --- a/device/mellanox/x86_64-mlnx_msn4700_simx-r0/platform.json +++ b/device/mellanox/x86_64-mlnx_msn4700_simx-r0/platform.json @@ -1,6 +1,6 @@ { "chassis": { - "name": "MSN4700", + "name": "MSN4700_SIMX", "components": [ { "name": "ONIE" diff --git a/device/mellanox/x86_64-nvidia_sn4280_simx-r0/platform.json b/device/mellanox/x86_64-nvidia_sn4280_simx-r0/platform.json index 599d9269a0c5..e0640c0ce02d 100644 --- a/device/mellanox/x86_64-nvidia_sn4280_simx-r0/platform.json +++ b/device/mellanox/x86_64-nvidia_sn4280_simx-r0/platform.json @@ -1,6 +1,6 @@ { "chassis": { - "name": "SN4280", + "name": "SN4280_SIMX", "components": [ { "name": "ONIE" diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json index 213822ce5116..a2a9ad437419 100644 --- a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json @@ -1,6 +1,6 @@ { "chassis": { - "name": "SN5400", + "name": "SN5400_SIMX", "components": [ { "name": "ONIE" diff --git a/device/mellanox/x86_64-nvidia_sn5600_simx-r0/platform.json b/device/mellanox/x86_64-nvidia_sn5600_simx-r0/platform.json index 2843b8318943..a10a478c4ac7 100644 --- a/device/mellanox/x86_64-nvidia_sn5600_simx-r0/platform.json +++ b/device/mellanox/x86_64-nvidia_sn5600_simx-r0/platform.json @@ -1,6 +1,6 @@ { "chassis": { - "name": "SN5600", + "name": "SN5600_SIMX", "components": [ { "name": "ONIE" From baebd255e1c3bba6a0ae26f23a8356e5bfdeff14 Mon Sep 17 00:00:00 2001 From: Vivek Date: Tue, 7 May 2024 03:37:12 -0700 Subject: [PATCH 045/282] [Mellanox] Remove external-changes patch if no downstream changes are found (#18795) - Why I did it Bug Fix: when the external-changes.patch is empty, sonic-linux-kernel build fails when called with INCLUDE_EXTERNAL_PATCHES=y flag How I did it - How to verify it Verified by integrating a hw-mgmt version without downstream patches and building linux kernel with EXTERNAL_PATCHES flag Signed-off-by: Vivek Reddy --- platform/mellanox/integration-scripts.mk | 7 ++-- .../hwmgmt_kernel_patches.py | 33 +++++++++++++++---- .../tests/test_hwmgmtaction.py | 8 ++--- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/platform/mellanox/integration-scripts.mk b/platform/mellanox/integration-scripts.mk index 10282555b010..faca4c602884 100644 --- a/platform/mellanox/integration-scripts.mk +++ b/platform/mellanox/integration-scripts.mk @@ -163,11 +163,8 @@ endif git add -- $(PLATFORM_PATH)/non-upstream-patches/ git add -- $(PLATFORM_PATH)/hw-management.mk - echo -en '\n###-> Non Upstream external-changes.patch changes <-###\n' >> ${HWMGMT_USER_OUTFILE} - git diff --no-color --staged -- $(PLATFORM_PATH)/non-upstream-patches/external-changes.patch >> ${HWMGMT_USER_OUTFILE} - - echo -en '\n###-> Non Upstream kconfig-inclusions.patch changes <-###\n' >> ${HWMGMT_USER_OUTFILE} - git diff --no-color --staged -- $(PLATFORM_PATH)/non-upstream-patches/kconfig-inclusions.patch >> ${HWMGMT_USER_OUTFILE} + echo -en '\n###-> Non Upstream changes <-###\n' >> ${HWMGMT_USER_OUTFILE} + git diff --no-color --staged -- $(PLATFORM_PATH)/non-upstream-patches/ >> ${HWMGMT_USER_OUTFILE} echo -en '\n###-> Non Upstream patch list file <-###\n' >> ${HWMGMT_USER_OUTFILE} git diff --no-color --staged -- $($(MLNX_HW_MANAGEMENT)_SRC_PATH)/hwmgmt_nonup_patches >> ${HWMGMT_USER_OUTFILE} diff --git a/platform/mellanox/integration-scripts/hwmgmt_kernel_patches.py b/platform/mellanox/integration-scripts/hwmgmt_kernel_patches.py index 8db9babb8578..58de837430f9 100755 --- a/platform/mellanox/integration-scripts/hwmgmt_kernel_patches.py +++ b/platform/mellanox/integration-scripts/hwmgmt_kernel_patches.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,7 @@ from hwmgmt_helper import * -COMMIT_TITLE = "Intgerate HW-MGMT {} Changes" +COMMIT_TITLE = "Integrate HW-MGMT {} Changes" PATCH_TABLE_LOC = "platform/mellanox/hw-management/hw-mgmt/recipes-kernel/linux/" PATCHWORK_LOC = "linux-{}/patchwork" @@ -270,9 +270,15 @@ def rm_old_non_up_mlnx(self): sys.exit(1) def mv_new_non_up_mlnx(self): + dest_fpath = os.path.join(self.args.build_root, NON_UP_PATCH_LOC) + if not Data.new_non_up and os.path.exists(dest_fpath): + os.rmdir(dest_fpath) + return + for patch in Data.new_non_up: src_path = os.path.join(self.args.non_up_patches, patch) - shutil.copy(src_path, os.path.join(self.args.build_root, NON_UP_PATCH_LOC)) + os.makedirs(dest_fpath, exist_ok=True) + shutil.copy(src_path, dest_fpath) def construct_series_with_non_up(self): Data.agg_slk_series = copy.deepcopy(Data.up_slk_series) @@ -309,7 +315,23 @@ def get_series_diff(self): return lines def get_merged_diff(self, series_diff: list, kcfg_diff: list) -> list: - return series_diff + ["\n"] + kcfg_diff + if series_diff or kcfg_diff: + return series_diff + ["\n"] + kcfg_diff + else: + return [] + + def write_non_up_diff(self, series_diff, kcfg_diff): + final_diff = self.get_merged_diff(series_diff, kcfg_diff) + non_up_diff_path = os.path.join(self.args.build_root, NON_UP_DIFF) + if "".join(final_diff).strip(): + # don't write anything if the diff just contains whitespaces + FileHandler.write_lines(non_up_diff_path, final_diff, True) + else: + # if nothing to write, delete the patch file + try: + os.remove(non_up_diff_path) + except OSError as error: + print("-> NOTICE File {} remove failed with error {}".format(non_up_diff_path, error)) def list_patches(self): old_up_patches = [] @@ -388,8 +410,7 @@ def perform(self): series_diff = self.get_series_diff() # handle kconfig and get any diff kcfg_diff = self.kcfg_handler.perform() - final_diff = self.get_merged_diff(series_diff, kcfg_diff) - FileHandler.write_lines(os.path.join(self.args.build_root, NON_UP_DIFF), final_diff, True) + self.write_non_up_diff(series_diff, kcfg_diff) path = os.path.join(self.args.build_root, PATCH_TABLE_LOC) patch_table = load_patch_table(path, Data.k_ver) diff --git a/platform/mellanox/integration-scripts/tests/test_hwmgmtaction.py b/platform/mellanox/integration-scripts/tests/test_hwmgmtaction.py index f3ec546a2fae..84831e21e405 100644 --- a/platform/mellanox/integration-scripts/tests/test_hwmgmtaction.py +++ b/platform/mellanox/integration-scripts/tests/test_hwmgmtaction.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,7 +56,7 @@ """ TEST_SLK_COMMIT = """\ -Intgerate HW-MGMT 7.0030.0937 Changes +Integrate HW-MGMT 7.0030.0937 Changes ## Patch List * 0002-i2c-mlxcpld-Decrease-polling-time-for-performance-im.patch : https://github.com/torvalds/linux/commit/cb9744178f33 * 0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-settin.patch : https://github.com/torvalds/linux/commit/66b0c2846ba8 @@ -71,7 +71,7 @@ """ TEST_SB_COMMIT = """\ -Intgerate HW-MGMT 7.0030.0937 Changes +Integrate HW-MGMT 7.0030.0937 Changes """ @@ -165,8 +165,8 @@ def test_write_final_diff(self, mock_write_lines): series_diff = self.action.get_series_diff() kcfg_diff = self._get_kcfg_incl_diff() final_diff = self.action.get_merged_diff(series_diff, kcfg_diff) + self.action.write_non_up_diff(series_diff, kcfg_diff) print("".join(final_diff)) - FileHandler.write_lines(os.path.join(self.action.args.build_root, NON_UP_DIFF), final_diff, True) assert check_file_content(MOCK_INPUTS_DIR+"expected_data/external-changes.patch") def test_commit_msg(self): From 4839a7b08b6535eb107da24ff54b5f9b29abe506 Mon Sep 17 00:00:00 2001 From: Andriy Yurkiv <70649192+ayurkiv-nvda@users.noreply.github.com> Date: Tue, 7 May 2024 13:38:19 +0300 Subject: [PATCH 046/282] [Mellanox][SN4410] Add missing interfaces to hwsku (#18791) - Why I did it Logic of config generation changed recently Command : sonic-cfggen -H -k ACS-MSN4410 --preset t1 will fail after ONIE installation. There are missing interfaces for 4410 HWSKU. Need to add them. - How I did it Update file device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/hwsku.json - How to verify it sonic-cfggen -H -k ACS-MSN4410 --preset t1 will pass successfully on 4410 platform after ONIE installation. Signed-off-by: Andriy Yurkiv --- .../ACS-MSN4410/hwsku.json | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/hwsku.json b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/hwsku.json index 6e1c31705bd4..52d9c481a8cf 100644 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/hwsku.json +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/hwsku.json @@ -3,75 +3,147 @@ "Ethernet0": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet4": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet8": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet12": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet16": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet20": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet24": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet28": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet32": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet36": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet40": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet44": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet48": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet52": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet56": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet60": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet64": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet68": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet72": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet76": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet80": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet84": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet88": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet92": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet96": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet100": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet104": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet108": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet112": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet116": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet120": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet124": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet128": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet132": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet136": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet140": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet144": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet148": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet152": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet156": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet160": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet164": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet168": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet172": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet176": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet180": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet184": { "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" }, + "Ethernet188": { + "default_brkout_mode": "2x100G[200G,50G,40G,25G,10G,1G]" + }, "Ethernet192": { "default_brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]" }, From 1bd734bdfc19165e0e100f150b3a6dd6a68b6edf Mon Sep 17 00:00:00 2001 From: Yakiv Huryk <62013282+Yakiv-Huryk@users.noreply.github.com> Date: Tue, 7 May 2024 13:42:40 +0300 Subject: [PATCH 047/282] [systemd-generator] add support for platform config file (#18730) In addition to /etc/sonic/generated_services.conf, the generator now processes the platform config in /usr/share/sonic/device/%platform/services.conf - Why I did it This is to support platform-specific systemd-sonic-generator config file. It allows loading additional services based on platform (/etc/machine.conf) information on boot. - How I did it Added /usr/share/sonic/device/%platform/services.conf processing (if such file exists). The %platform is already available in systemd-sonic-generator (read from /etc/machine.conf) The unit test is updated to cover new functionality. - How to verify it Run the systemd-sonic-generator unit tests Signed-off-by: Yakiv Huryk --- src/systemd-sonic-generator/ssg-test.cc | 33 +++++++++++-- .../systemd-sonic-generator.cpp | 46 +++++++++++++++---- .../systemd-sonic-generator.h | 6 ++- 3 files changed, 73 insertions(+), 12 deletions(-) diff --git a/src/systemd-sonic-generator/ssg-test.cc b/src/systemd-sonic-generator/ssg-test.cc index 2462c0635ad9..99b71b9ba55d 100644 --- a/src/systemd-sonic-generator/ssg-test.cc +++ b/src/systemd-sonic-generator/ssg-test.cc @@ -44,8 +44,9 @@ const std::string TEST_ROOT_DIR = "tests/ssg-test/"; const std::string TEST_UNIT_FILE_PREFIX = TEST_ROOT_DIR + "systemd/"; const std::string TEST_LIB_NETWORK = TEST_UNIT_FILE_PREFIX + "network/"; const std::string TEST_ASIC_CONF_FORMAT = TEST_ROOT_DIR + "%s/asic.conf"; -const std::string TEST_PLATFORM_CONF_FORMAT = TEST_ROOT_DIR + "%s/platform.json"; +const std::string TEST_PLATFORM_FILE_FORMAT = TEST_ROOT_DIR + "%s/platform.json"; const std::string TEST_MACHINE_CONF = TEST_ROOT_DIR + "machine.conf"; +const std::string TEST_PLATFORM_CONF_FORMAT = TEST_ROOT_DIR + "%s/services.conf"; const std::string TEST_PLATFORM_DIR = TEST_ROOT_DIR + "test_platform/"; const std::string TEST_ASIC_CONF = TEST_PLATFORM_DIR + "asic.conf"; @@ -58,6 +59,7 @@ const std::string TEST_CONFIG_FILE = TEST_ROOT_DIR + "generated_services.conf"; const std::string TEST_UNIT_FILES = "tests/testfiles/"; +const std::string TEST_PLATFORM_CONFIG = TEST_PLATFORM_DIR + "services.conf"; /* Input data for generated_services.conf */ const std::vector generated_services = { @@ -87,6 +89,7 @@ class SystemdSonicGeneratorFixture : public testing::Test { config_file_ = g_config_file; machine_config_file_ = g_machine_config_file; asic_conf_format_ = g_asic_conf_format; + platform_conf_format_ = g_platform_conf_format; } /* Restore global vars */ @@ -95,6 +98,7 @@ class SystemdSonicGeneratorFixture : public testing::Test { g_config_file = config_file_; g_machine_config_file = machine_config_file_; g_asic_conf_format = asic_conf_format_; + g_platform_conf_format = platform_conf_format_; g_ssg_test_mutex.unlock(); } @@ -104,6 +108,7 @@ class SystemdSonicGeneratorFixture : public testing::Test { const char* config_file_; const char* machine_config_file_; const char* asic_conf_format_; + const char* platform_conf_format_; }; /* @@ -166,6 +171,11 @@ class SsgFunctionTest : public SystemdSonicGeneratorFixture { ASSERT_NE(fp, nullptr); fputs("onie_platform=test_platform", fp); fclose(fp); + + fp = fopen(TEST_PLATFORM_CONFIG.c_str(), "w"); + ASSERT_NE(fp, nullptr); + fputs("platform_specific.service\n", fp); + fclose(fp); generate_generated_services_conf(); copyfiles(TEST_UNIT_FILES.c_str(), TEST_UNIT_FILE_PREFIX.c_str()); } @@ -360,7 +370,7 @@ class SsgMainTest : public SsgFunctionTest { g_config_file = TEST_CONFIG_FILE.c_str(); g_machine_config_file = TEST_MACHINE_CONF.c_str(); g_asic_conf_format = TEST_ASIC_CONF_FORMAT.c_str(); - g_platform_file_format = TEST_PLATFORM_CONF_FORMAT.c_str(); + g_platform_file_format = TEST_PLATFORM_FILE_FORMAT.c_str(); std::string lib_systemd = fs::current_path().string() + "/" + TEST_UNIT_FILE_PREFIX; g_lib_systemd = lib_systemd.c_str(); std::string etc_systemd = fs::current_path().string() + "/" + TEST_OUTPUT_DIR; @@ -573,6 +583,11 @@ TEST_F(SystemdSonicGeneratorFixture, get_global_vars) { EXPECT_STREQ(get_asic_conf_format(), ASIC_CONF_FORMAT); g_asic_conf_format = TEST_ASIC_CONF_FORMAT.c_str(); EXPECT_STREQ(get_asic_conf_format(), TEST_ASIC_CONF_FORMAT.c_str()); + + EXPECT_EQ(g_platform_conf_format, nullptr); + EXPECT_STREQ(get_platform_conf_format(), PLATFORM_CONF_FORMAT); + g_platform_conf_format = TEST_PLATFORM_CONF_FORMAT.c_str(); + EXPECT_STREQ(get_platform_conf_format(), TEST_PLATFORM_CONF_FORMAT.c_str()); } TEST_F(SystemdSonicGeneratorFixture, global_vars) { @@ -592,6 +607,7 @@ TEST_F(SsgFunctionTest, missing_file) { EXPECT_TRUE(fs::exists(TEST_UNIT_FILE_PREFIX.c_str())); EXPECT_TRUE(fs::exists(TEST_OUTPUT_DIR.c_str())); EXPECT_TRUE(fs::exists(TEST_PLATFORM_DIR.c_str())); + EXPECT_TRUE(fs::exists(TEST_PLATFORM_CONFIG.c_str())); } /* TEST insert_instance_number() */ @@ -637,7 +653,7 @@ TEST_F(SsgFunctionTest, get_unit_files) { g_etc_systemd = TEST_OUTPUT_DIR.c_str(); g_config_file = TEST_CONFIG_FILE.c_str(); char* unit_files[NUM_UNIT_FILES] = { NULL }; - int num_unit_files = get_unit_files(unit_files); + int num_unit_files = get_unit_files(g_config_file, unit_files, NUM_UNIT_FILES); // Exclude the midplane-network-{npu/dpu}.service which is only used for smart switch auto non_smart_switch_generated_services = generated_services; non_smart_switch_generated_services.erase( @@ -666,6 +682,17 @@ TEST_F(SsgFunctionTest, get_unit_files) { } } +/* TEST get_platform_unit_files()*/ +TEST_F(SsgFunctionTest, get_platform_unit_files) { + g_unit_file_prefix = TEST_UNIT_FILE_PREFIX.c_str(); + g_config_file = TEST_CONFIG_FILE.c_str(); + g_platform_conf_format = TEST_PLATFORM_CONF_FORMAT.c_str(); + char* unit_files[NUM_UNIT_FILES]; + int num_unit_files = get_platform_unit_files(unit_files, NUM_UNIT_FILES); + EXPECT_EQ(num_unit_files, 1); + EXPECT_EQ(std::string(unit_files[0]), "platform_specific.service"); +} + /* TEST ssg_main() argv error */ TEST_F(SsgMainTest, ssg_main_argv) { std::vector argv_; diff --git a/src/systemd-sonic-generator/systemd-sonic-generator.cpp b/src/systemd-sonic-generator/systemd-sonic-generator.cpp index d1b61a325d3c..0569f4dd696e 100644 --- a/src/systemd-sonic-generator/systemd-sonic-generator.cpp +++ b/src/systemd-sonic-generator/systemd-sonic-generator.cpp @@ -27,6 +27,7 @@ const char* CONFIG_FILE = "/etc/sonic/generated_services.conf"; const char* MACHINE_CONF_FILE = "/host/machine.conf"; const char* ASIC_CONF_FORMAT = "/usr/share/sonic/device/%s/asic.conf"; const char* PLATFORM_FILE_FORMAT = "/usr/share/sonic/device/%s/platform.json"; +const char* PLATFORM_CONF_FORMAT = "/usr/share/sonic/device/%s/services.conf"; const char* DPU_PREFIX = "dpu"; @@ -65,6 +66,13 @@ const char* get_platform_file_format() { return (g_platform_file_format) ? g_platform_file_format : PLATFORM_FILE_FORMAT; } +const char* g_platform_conf_format = NULL; +const char* get_platform_conf_format() { + return (g_platform_conf_format) ? g_platform_conf_format : PLATFORM_CONF_FORMAT; +} + +const char* get_platform(); + static int num_asics; static char** multi_instance_services; static int num_multi_inst; @@ -440,16 +448,15 @@ int get_install_targets(std::string unit_file, char* targets[]) { } -int get_unit_files(char* unit_files[]) { +int get_unit_files(const char* config_file, char* unit_files[], int unit_files_size) { /*** - Reads a list of unit files to be installed from /etc/sonic/generated_services.conf + Reads a list of unit files to be installed from config_file ***/ FILE *fp; char *line = NULL; size_t len = 0; ssize_t read; char *pos; - const char* config_file = get_config_file(); fp = fopen(config_file, "r"); @@ -459,12 +466,14 @@ int get_unit_files(char* unit_files[]) { } int num_unit_files = 0; - num_multi_inst = 0; - multi_instance_services = (char**) calloc(MAX_NUM_UNITS, sizeof(char *)); + if (!multi_instance_services) { + num_multi_inst = 0; + multi_instance_services = (char**) calloc(MAX_NUM_UNITS, sizeof(char *)); + } while ((read = getline(&line, &len, fp)) != -1) { - if (num_unit_files >= MAX_NUM_UNITS) { + if (num_unit_files >= unit_files_size) { fprintf(stderr, "Maximum number of units exceeded, ignoring extras\n"); break; } @@ -501,6 +510,23 @@ int get_unit_files(char* unit_files[]) { return num_unit_files; } +int get_platform_unit_files(char* unit_files[], int unit_files_size) +{ + const char* platform = get_platform(); + if (!platform) { + return 0; + } + + char config_file[PATH_MAX]; + snprintf(config_file, PATH_MAX, get_platform_conf_format(), platform); + + if (access(config_file, R_OK) != 0) { + return 0; + } + + return get_unit_files(config_file, unit_files, unit_files_size); +} + std::string insert_instance_number(const std::string& unit_file, int instance, const std::string& instance_prefix) { /*** @@ -957,7 +983,7 @@ static int render_network_service_for_smart_switch() { size_t file_size = ftell(fp); fseek(fp, 0, SEEK_SET); size_t len = file_size + buffer_instruction.length() + 1; - char *unit_content = (char*) malloc(len); + char *unit_content = (char*) calloc(len, sizeof(unit_content)); if (unit_content == NULL) { fprintf(stderr, "Failed to allocate memory for %s\n", unit_path.c_str()); fclose(fp); @@ -1080,7 +1106,9 @@ int ssg_main(int argc, char **argv) { num_dpus = get_num_of_dpu(); install_dir = std::string(argv[1]) + "/"; - num_unit_files = get_unit_files(unit_files); + const char* config_file = get_config_file(); + num_unit_files = get_unit_files(config_file, unit_files, MAX_NUM_UNITS); + num_unit_files += get_platform_unit_files(&unit_files[num_unit_files], MAX_NUM_UNITS - num_unit_files); // Install and render midplane network service for smart switch if (smart_switch) { @@ -1125,6 +1153,8 @@ int ssg_main(int argc, char **argv) { free(multi_instance_services[i]); } free(multi_instance_services); + multi_instance_services = NULL; + num_multi_inst = 0; if (is_valid_pointer(platform_info)) { json_object_put(platform_info); diff --git a/src/systemd-sonic-generator/systemd-sonic-generator.h b/src/systemd-sonic-generator/systemd-sonic-generator.h index 91e2d476c1ac..e3e4d2e03914 100644 --- a/src/systemd-sonic-generator/systemd-sonic-generator.h +++ b/src/systemd-sonic-generator/systemd-sonic-generator.h @@ -18,6 +18,7 @@ extern const char* CONFIG_FILE; extern const char* MACHINE_CONF_FILE; extern const char* ASIC_CONF_FORMAT; extern const char* PLATFORM_FILE_FORMAT; +extern const char* PLATFORM_CONF_FORMAT; extern const char* g_lib_systemd; extern const char* g_etc_systemd; extern const char* g_unit_file_prefix; @@ -25,17 +26,20 @@ extern const char* g_config_file; extern const char* g_machine_config_file; extern const char* g_asic_conf_format; extern const char* g_platform_file_format; +extern const char* g_platform_conf_format; /* C-functions under test */ extern const char* get_unit_file_prefix(); extern const char* get_config_file(); extern const char* get_machine_config_file(); extern const char* get_asic_conf_format(); +extern const char* get_platform_conf_format(); extern std::string insert_instance_number(const std::string& unit_file, int instance, const std::string& instance_prefix); extern int ssg_main(int argc, char** argv); extern int get_num_of_asic(); extern int get_install_targets(std::string unit_file, char* targets[]); -extern int get_unit_files(char* unit_files[]); +extern int get_unit_files(const char* config_file, char* unit_files[], int unit_files_size); +extern int get_platform_unit_files(char* unit_files[], int unit_files_size); // #ifdef __cplusplus // } // #endif From 7129232147c791e8649211a0ce730aa08ff0d7c5 Mon Sep 17 00:00:00 2001 From: Yakiv Huryk <62013282+Yakiv-Huryk@users.noreply.github.com> Date: Tue, 7 May 2024 13:49:34 +0300 Subject: [PATCH 048/282] [Mellanox] add rshim package to mellanox image (#18684) - Why I did it To add rshim (BlueField Rshim Host Driver) package to the mellanox image. - How I did it Added rshim.mk to the Mellanox platform. Disabled rshim.service in sonic_debian_extension.j2 - How to verify it Build sonic-mellanox.bin Signed-off-by: Yakiv Huryk --- .../build_templates/sonic_debian_extension.j2 | 2 + platform/mellanox/one-image.mk | 4 +- platform/mellanox/rshim.dep | 8 ++++ platform/mellanox/rshim.mk | 36 +++++++++++++++++ platform/mellanox/rshim/.gitignore | 5 +++ platform/mellanox/rshim/Makefile | 40 +++++++++++++++++++ platform/mellanox/rules.dep | 1 + platform/mellanox/rules.mk | 1 + sonic-slave-bookworm/Dockerfile.j2 | 1 + 9 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 platform/mellanox/rshim.dep create mode 100644 platform/mellanox/rshim.mk create mode 100644 platform/mellanox/rshim/.gitignore create mode 100644 platform/mellanox/rshim/Makefile diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 77ecf9509acb..07ea75dd7232 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -1038,6 +1038,8 @@ sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable nv-syncd-shared # Install minicom package sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install minicom + +sudo LANG=C chroot $FILESYSTEM_ROOT systemctl disable rshim.service {% endif %} {% if sonic_asic_platform == "nvidia-bluefield" %} diff --git a/platform/mellanox/one-image.mk b/platform/mellanox/one-image.mk index 9db68f1c5f8e..aeda2e187304 100644 --- a/platform/mellanox/one-image.mk +++ b/platform/mellanox/one-image.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,7 +19,7 @@ SONIC_ONE_IMAGE = sonic-mellanox.bin $(SONIC_ONE_IMAGE)_MACHINE = mellanox $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie -$(SONIC_ONE_IMAGE)_INSTALLS += $(SX_KERNEL) $(KERNEL_MFT) $(MFT_OEM) $(MFT) $(MFT_FWTRACE_CFG) $(MLNX_HW_MANAGEMENT) +$(SONIC_ONE_IMAGE)_INSTALLS += $(SX_KERNEL) $(KERNEL_MFT) $(MFT_OEM) $(MFT) $(MFT_FWTRACE_CFG) $(MLNX_HW_MANAGEMENT) $(MLNX_RSHIM) $(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR) ifeq ($(INSTALL_DEBUG_TOOLS),y) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) diff --git a/platform/mellanox/rshim.dep b/platform/mellanox/rshim.dep new file mode 100644 index 000000000000..cd493b35f158 --- /dev/null +++ b/platform/mellanox/rshim.dep @@ -0,0 +1,8 @@ +SPATH := $(MLNX_RSHIM)_SRC_PATH +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/rshim.mk $(PLATFORM_PATH)/rshim.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files -- $(SPATH)) + +$(MLNX_RSHIM)_CACHE_MODE := GIT_CONTENT_SHA +$(MLNX_RSHIM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(MLNX_RSHIM_DRIVER_VERSION) +$(MLNX_RSHIM)_DEP_FILES := $(DEP_FILES) diff --git a/platform/mellanox/rshim.mk b/platform/mellanox/rshim.mk new file mode 100644 index 000000000000..9a375aec8c1b --- /dev/null +++ b/platform/mellanox/rshim.mk @@ -0,0 +1,36 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +MLNX_RSHIM_DRIVER_VERSION = 2.0.19 +MLNX_RSHIM_ASSETS_GITHUB_URL = https://github.com/Mellanox/sonic-bluefield-packages +MLNX_RSHIM_ASSETS_RELEASE_TAG = rshim-$(MLNX_RSHIM_DRIVER_VERSION)-$(BLDENV)-$(CONFIGURED_ARCH) +MLNX_RSHIM_ASSETS_URL = $(MLNX_RSHIM_ASSETS_GITHUB_URL)/releases/download/$(MLNX_RSHIM_ASSETS_RELEASE_TAG) + +MLNX_RSHIM = rshim_${MLNX_RSHIM_DRIVER_VERSION}_${CONFIGURED_ARCH}.deb +$(MLNX_RSHIM)_SRC_PATH = $(PLATFORM_PATH)/rshim +$(MLNX_RSHIM)_URL = $(MLNX_RSHIM_ASSETS_URL)/$(MLNX_RSHIM) +$(MLNX_RSHIM)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) + +MLNX_BSD_RSHIM_SRC_BASE_URL = + +export MLNX_RSHIM MLNX_BSD_RSHIM_SRC_BASE_URL MLNX_RSHIM_DRIVER_VERSION + +ifneq ($(MLNX_BSD_RSHIM_SRC_BASE_URL), ) +SONIC_MAKE_DEBS += $(MLNX_RSHIM) +else +SONIC_ONLINE_DEBS += $(MLNX_RSHIM) +endif diff --git a/platform/mellanox/rshim/.gitignore b/platform/mellanox/rshim/.gitignore new file mode 100644 index 000000000000..6dbdff4573bb --- /dev/null +++ b/platform/mellanox/rshim/.gitignore @@ -0,0 +1,5 @@ +# Ignore everything in this directory +* +# Except these files +!.gitignore +!Makefile diff --git a/platform/mellanox/rshim/Makefile b/platform/mellanox/rshim/Makefile new file mode 100644 index 000000000000..fee2e6ec7c5f --- /dev/null +++ b/platform/mellanox/rshim/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +.ONESHELL: +SHELL = /bin/bash +.SHELLFLAGS += -ex + +SRPMS_URL = $(MLNX_BSD_RSHIM_SRC_BASE_URL)/build/install/distro/SRPMS/ +RSHIM_URL = $(shell lynx --listonly --nonumbers -dump $(SRPMS_URL) | grep rshim) + +$(addprefix $(DEST)/, $(MLNX_RSHIM)): $(DEST)/% : + rm -rf ./rshim* + mkdir ./rshim_src + + wget ${RSHIM_URL} + rpm2cpio rshim-${MLNX_RSHIM_DRIVER_VERSION}*.src.rpm | cpio -idmv + tar xf rshim-${MLNX_RSHIM_DRIVER_VERSION}.tar.gz -C rshim_src --strip-components=1 + + pushd rshim_src + + # Build the package + DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) + + popd + + mv $* $(DEST)/ diff --git a/platform/mellanox/rules.dep b/platform/mellanox/rules.dep index fcf50e54d722..725331b0f526 100644 --- a/platform/mellanox/rules.dep +++ b/platform/mellanox/rules.dep @@ -17,3 +17,4 @@ include $(PLATFORM_PATH)/mlnx-onie-fw-update.dep include $(PLATFORM_PATH)/mlnx-ssd-fw-update.dep include $(PLATFORM_PATH)/install-pending-fw.dep include $(PLATFORM_PATH)/component-versions.dep +include $(PLATFORM_PATH)/rshim.dep diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index 69bad6725b7d..f7a10bc82b61 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -35,6 +35,7 @@ include $(PLATFORM_PATH)/iproute2.mk include $(PLATFORM_PATH)/install-pending-fw.mk include $(PLATFORM_PATH)/integration-scripts.mk include $(PLATFORM_PATH)/component-versions.mk +include $(PLATFORM_PATH)/rshim.mk SONIC_ALL += $(SONIC_ONE_IMAGE) \ $(DOCKER_FPM) diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 18a64a620cfb..9706510cb07b 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -428,6 +428,7 @@ RUN apt-get update && apt-get install -y \ rpm2cpio \ libsnmp-dev \ libpopt-dev \ + libfuse-dev \ {%- if CONFIGURED_ARCH == "arm64" %} grub-efi-arm64-bin \ {%- endif %} From afdc5d02aa1297cf761f35e07a1d889bfdecfb95 Mon Sep 17 00:00:00 2001 From: davidpil2002 <91657985+davidpil2002@users.noreply.github.com> Date: Tue, 7 May 2024 13:55:58 +0300 Subject: [PATCH 049/282] Add LDAP feature support (#16969) Why I did it To support LDAP feature - How I did it Similar to Radius/Tacacs authentication methods, the SONiC device is the LDAP client. Installed the Debian LDAP packages related to making SONiC able to function as an LDAP client. More description in the following HLD: sonic-net/SONiC#1487 - How to verify it Do LDAP configuration according to the HLD, then connect to the SONiC switch by using a user that exists in your LDAP server. --- .../build_templates/sonic_debian_extension.j2 | 17 ++- src/sonic-yang-models/setup.py | 1 + .../tests/files/sample_config_db.json | 16 +++ .../tests/yang_model_tests/tests/ldap.json | 16 +++ .../yang_model_tests/tests_config/ldap.json | 61 ++++++++++ .../yang-models/sonic-system-aaa.yang | 4 +- .../yang-models/sonic-system-ldap.yang | 108 ++++++++++++++++++ 7 files changed, 219 insertions(+), 4 deletions(-) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/ldap.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/ldap.json create mode 100644 src/sonic-yang-models/yang-models/sonic-system-ldap.yang diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 07ea75dd7232..2889b2469960 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -284,6 +284,19 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-device-data_*.deb || \ # package for supporting password hardening sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install libpam-pwquality +# Install pam-ldap, nss-ldap, ldap-utils +sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install \ + libnss-ldapd \ + libpam-ldapd \ + ldap-utils + +# add networking.service dependancy to nslcd +sudo LANG=C chroot $FILESYSTEM_ROOT sed -i '/# Required-Start:/ s/$/ networking.service/' /etc/init.d/nslcd + +# nslcd disable default +sudo LANG=C chroot $FILESYSTEM_ROOT systemctl stop nslcd.service +sudo LANG=C chroot $FILESYSTEM_ROOT systemctl mask nslcd.service + # Install pam-tacplus and nss-tacplus sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/libtac2_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f @@ -297,14 +310,14 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/bash-tacplus_*.deb || \ # Install audisp-tacplus sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/audisp-tacplus_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f -# Disable tacplus by default +# Disable tacplus and LDAP by default ## NOTE: this syntax of pam-auth-update is meant to be used when the package gets removed, not for specifying ## some local configuration of a PAM module. Currently, there's no clean way of noninteractively specifying ## whether some PAM module needs to be enabled or disabled on a system (there are hacky ways, though). ## ## If there is some PAM module that's installed/removed after this point, then this setting will end up having ## no impact, and there may be errors/test failures related to authentication. -sudo LANG=C chroot $FILESYSTEM_ROOT pam-auth-update --remove tacplus +sudo LANG=C chroot $FILESYSTEM_ROOT pam-auth-update --remove tacplus ldap sudo sed -i -e '/^passwd/s/ tacplus//' $FILESYSTEM_ROOT/etc/nsswitch.conf # Install pam-radius-auth and nss-radius diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index bf0372b8f61c..b1257f6eacab 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -164,6 +164,7 @@ def run(self): './yang-models/sonic-system-aaa.yang', './yang-models/sonic-system-tacacs.yang', './yang-models/sonic-system-radius.yang', + './yang-models/sonic-system-ldap.yang', './yang-models/sonic-telemetry.yang', './yang-models/sonic-telemetry_client.yang', './yang-models/sonic-gnmi.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 4cf42f535c60..33c9c265ad2d 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1631,6 +1631,22 @@ "timeout": "5" } }, + "LDAP": { + "global": { + "bind_dn": "test_bind", + "bind_password": "secret", + "bind_timeout": "5", + "version": "3", + "base_dn": "test_base", + "port": "389", + "timeout": "5" + } + }, + "LDAP_SERVER": { + "192.168.1.1": { + "priority": "5" + } + }, "NAT_BINDINGS": { "bind1": { "nat_pool": "pool1", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/ldap.json b/src/sonic-yang-models/tests/yang_model_tests/tests/ldap.json new file mode 100644 index 000000000000..93a6032bcf1b --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/ldap.json @@ -0,0 +1,16 @@ +{ + "LDAP_TABLE": { + "desc": "Configure LDAP global fields." + }, + "LDAP_INVALID_TIMEOUT_TEST": { + "desc": "LDAP global configuration with invalid timeout value in LDAP table.", + "eStr": "LDAP timeout must be 1..60" + }, + "LDAP_SERVER_TEST" : { + "desc": "LDAP server configuration in LDAP_SERVER table." + }, + "LDAP_SERVER_INVALID_PRIORITY_TEST": { + "desc": "LDAP server configuration with invalid priority value in LDAP_SERVER table.", + "eStr": "LDAP server priority must be 1..8" + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/ldap.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/ldap.json new file mode 100644 index 000000000000..39ff556cb2a8 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/ldap.json @@ -0,0 +1,61 @@ +{ + "LDAP_TABLE": { + "sonic-system-ldap:sonic-system-ldap": { + "sonic-system-ldap:LDAP": { + "global":{ + "bind_dn": "test_bind", + "bind_password": "secret", + "bind_timeout": "5", + "version": "3", + "base_dn": "test_base", + "port": "389", + "timeout": "5" + } + } + } + }, + "LDAP_INVALID_TIMEOUT_TEST": { + "sonic-system-ldap:sonic-system-ldap": { + "sonic-system-ldap:LDAP": { + "global": { + "bind_dn": "test_bind", + "bind_password": "secret", + "bind_timeout": "5", + "version": "3", + "base_dn": "test_base", + "port": "389", + "timeout": 150 + } + } + } + }, + "LDAP_SERVER_TEST": { + "sonic-system-ldap:sonic-system-ldap": { + "sonic-system-ldap:LDAP_SERVER": { + "LDAP_SERVER_LIST": [ + { + "hostname": "192.168.1.1", + "priority": 1 + }, + { + "hostname": "ldap_server_1", + "priority": 2 + } + ] + } + } + }, + + "LDAP_SERVER_INVALID_PRIORITY_TEST": { + "sonic-system-ldap:sonic-system-ldap": { + "sonic-system-ldap:LDAP_SERVER": { + "LDAP_SERVER_LIST": [ + { + "hostname": "192.168.1.1", + "priority": 70 + } + ] + } + } + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-system-aaa.yang b/src/sonic-yang-models/yang-models/sonic-system-aaa.yang index 1b1a8c4931a7..61fc9ab61841 100644 --- a/src/sonic-yang-models/yang-models/sonic-system-aaa.yang +++ b/src/sonic-yang-models/yang-models/sonic-system-aaa.yang @@ -35,11 +35,11 @@ module sonic-system-aaa { leaf login { type string { - pattern '((tacacs\+|local|radius|default),)*(tacacs\+|local|radius|default)' { + pattern '((ldap|tacacs\+|local|radius|default),)*(ldap|tacacs\+|local|radius|default)' { error-message "Invalid login choice"; } } - description "AAA authentication/authorization/accounting methods - radius/tacacs+/local/default"; + description "AAA authentication/authorization/accounting methods - radius/tacacs+/ldap|local/default"; default "local"; } diff --git a/src/sonic-yang-models/yang-models/sonic-system-ldap.yang b/src/sonic-yang-models/yang-models/sonic-system-ldap.yang new file mode 100644 index 000000000000..82fe4624005f --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-system-ldap.yang @@ -0,0 +1,108 @@ +module sonic-system-ldap { + yang-version 1.1; + namespace "http://github.com/Azure/sonic-system-ldap"; + prefix ssys-ldap; + + import ietf-inet-types { + prefix inet; + } + + description "LDAP YANG Module for SONiC OS"; + + revision 2023-10-01 { + description "First Revision"; + } + + container sonic-system-ldap { + + container LDAP_SERVER { + list LDAP_SERVER_LIST { + max-elements 8; + key "hostname"; + + leaf hostname { + type inet:host; + description + "LDAP server's Domain name or IP address (IPv4 or IPv6)"; + } + + leaf priority { + default 1; + type uint8 { + range "1..8" { + error-message "LDAP server priority must be 1..8"; + } + } + description "Server priority"; + } + } + } + + container LDAP { + + container global { + + + leaf bind_dn { + type string { + length "1..65"; + } + description + 'LDAP global bind dn'; + } + + leaf bind_password { + type string { + length "1..65"; + pattern "[^ #,]*" { + error-message 'LDAP shared secret (Valid chars are ASCII printable except SPACE, "#", and ",")'; + } + } + description "Shared secret used for encrypting the communication"; + } + + leaf bind_timeout { + default 5; + type uint16 { + range "1..120" { + error-message "Ldap bind timeout must be 1..120"; + } + } + description "Ldap bind timeout"; + } + + leaf version { + default 3; + type uint16 { + range "1..3" { + error-message "Ldap version must be 1..3"; + } + } + description "Ldap version"; + } + + leaf base_dn { + type string { + length "1..65"; + } + description "Ldap user base dn"; + } + + leaf port { + type inet:port-number; + default 389; + description "TCP port to communicate with LDAP server"; + } + + leaf timeout { + description "Ldap timeout duration in sec"; + type uint16 { + range "1..60" { + error-message "LDAP timeout must be 1..60"; + } + } + } + } /* container global */ + } /* container LDAP */ + }/* container sonic-system-ldap */ +}/* end of module sonic-system-ldap */ From 5c6fd3029814ce528c134d46043451e3ece5a3b6 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Tue, 7 May 2024 15:03:09 +0300 Subject: [PATCH 050/282] [Mellanox] Fix reboot script usage in mlnx-onie-fw-update (#18863) /usr/local/bin/reboot could return execution back to the invoking script in case of using graceful reboot. So, exit the script with reboot return code instead of proceeding with execution. - Why I did it Fix BIOS fw update procedure. - How I did it Return exit code from reboot script in mlnx-onie-fw-update.sh - How to verify it Tested with successful reboot Tested with unsuccessful reboot Signed-off-by: Stepan Blyschak --- platform/mellanox/mlnx-onie-fw-update.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-onie-fw-update.sh b/platform/mellanox/mlnx-onie-fw-update.sh index 4d441c5ced9b..35fdb55dfd93 100755 --- a/platform/mellanox/mlnx-onie-fw-update.sh +++ b/platform/mellanox/mlnx-onie-fw-update.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -107,6 +107,7 @@ system_reboot() { # Use SONiC reboot scenario /usr/local/bin/reboot + exit $? } terminate_handler() { From 7822c97e5a93effeb25069b16196cdc65bfd7524 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Tue, 7 May 2024 17:36:21 +0200 Subject: [PATCH 051/282] [Arista]: Add new 256x200G profile for QuicksilverDd (#18894) Add new HwSku to support 256x200G breakouts on QuicksilverDD --- .../Arista-7060X6-64DE-256x200G/hwsku.json | 196 ++ .../port_config.ini | 257 +++ .../Arista-7060X6-64DE-256x200G/sai.profile | 1 + .../th5-a7060x6-64de.config.bcm | 1913 +++++++++++++++++ .../x86_64-arista_7060x6_64de/platform.json | 386 +++- 5 files changed, 2752 insertions(+), 1 deletion(-) create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json new file mode 100644 index 000000000000..f30bfc4a06f2 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json @@ -0,0 +1,196 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "4x200G" + }, + "Ethernet8": { + "default_brkout_mode": "4x200G" + }, + "Ethernet16": { + "default_brkout_mode": "4x200G" + }, + "Ethernet24": { + "default_brkout_mode": "4x200G" + }, + "Ethernet32": { + "default_brkout_mode": "4x200G" + }, + "Ethernet40": { + "default_brkout_mode": "4x200G" + }, + "Ethernet48": { + "default_brkout_mode": "4x200G" + }, + "Ethernet56": { + "default_brkout_mode": "4x200G" + }, + "Ethernet64": { + "default_brkout_mode": "4x200G" + }, + "Ethernet72": { + "default_brkout_mode": "4x200G" + }, + "Ethernet80": { + "default_brkout_mode": "4x200G" + }, + "Ethernet88": { + "default_brkout_mode": "4x200G" + }, + "Ethernet96": { + "default_brkout_mode": "4x200G" + }, + "Ethernet104": { + "default_brkout_mode": "4x200G" + }, + "Ethernet112": { + "default_brkout_mode": "4x200G" + }, + "Ethernet120": { + "default_brkout_mode": "4x200G" + }, + "Ethernet128": { + "default_brkout_mode": "4x200G" + }, + "Ethernet136": { + "default_brkout_mode": "4x200G" + }, + "Ethernet144": { + "default_brkout_mode": "4x200G" + }, + "Ethernet152": { + "default_brkout_mode": "4x200G" + }, + "Ethernet160": { + "default_brkout_mode": "4x200G" + }, + "Ethernet168": { + "default_brkout_mode": "4x200G" + }, + "Ethernet176": { + "default_brkout_mode": "4x200G" + }, + "Ethernet184": { + "default_brkout_mode": "4x200G" + }, + "Ethernet192": { + "default_brkout_mode": "4x200G" + }, + "Ethernet200": { + "default_brkout_mode": "4x200G" + }, + "Ethernet208": { + "default_brkout_mode": "4x200G" + }, + "Ethernet216": { + "default_brkout_mode": "4x200G" + }, + "Ethernet224": { + "default_brkout_mode": "4x200G" + }, + "Ethernet232": { + "default_brkout_mode": "4x200G" + }, + "Ethernet240": { + "default_brkout_mode": "4x200G" + }, + "Ethernet248": { + "default_brkout_mode": "4x200G" + }, + "Ethernet256": { + "default_brkout_mode": "4x200G" + }, + "Ethernet264": { + "default_brkout_mode": "4x200G" + }, + "Ethernet272": { + "default_brkout_mode": "4x200G" + }, + "Ethernet280": { + "default_brkout_mode": "4x200G" + }, + "Ethernet288": { + "default_brkout_mode": "4x200G" + }, + "Ethernet296": { + "default_brkout_mode": "4x200G" + }, + "Ethernet304": { + "default_brkout_mode": "4x200G" + }, + "Ethernet312": { + "default_brkout_mode": "4x200G" + }, + "Ethernet320": { + "default_brkout_mode": "4x200G" + }, + "Ethernet328": { + "default_brkout_mode": "4x200G" + }, + "Ethernet336": { + "default_brkout_mode": "4x200G" + }, + "Ethernet344": { + "default_brkout_mode": "4x200G" + }, + "Ethernet352": { + "default_brkout_mode": "4x200G" + }, + "Ethernet360": { + "default_brkout_mode": "4x200G" + }, + "Ethernet368": { + "default_brkout_mode": "4x200G" + }, + "Ethernet376": { + "default_brkout_mode": "4x200G" + }, + "Ethernet384": { + "default_brkout_mode": "4x200G" + }, + "Ethernet392": { + "default_brkout_mode": "4x200G" + }, + "Ethernet400": { + "default_brkout_mode": "4x200G" + }, + "Ethernet408": { + "default_brkout_mode": "4x200G" + }, + "Ethernet416": { + "default_brkout_mode": "4x200G" + }, + "Ethernet424": { + "default_brkout_mode": "4x200G" + }, + "Ethernet432": { + "default_brkout_mode": "4x200G" + }, + "Ethernet440": { + "default_brkout_mode": "4x200G" + }, + "Ethernet448": { + "default_brkout_mode": "4x200G" + }, + "Ethernet456": { + "default_brkout_mode": "4x200G" + }, + "Ethernet464": { + "default_brkout_mode": "4x200G" + }, + "Ethernet472": { + "default_brkout_mode": "4x200G" + }, + "Ethernet480": { + "default_brkout_mode": "4x200G" + }, + "Ethernet488": { + "default_brkout_mode": "4x200G" + }, + "Ethernet496": { + "default_brkout_mode": "4x200G" + }, + "Ethernet504": { + "default_brkout_mode": "4x200G" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini new file mode 100644 index 000000000000..323b8e2612eb --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini @@ -0,0 +1,257 @@ +# name lanes alias index speed fec +Ethernet0 17,18 Ethernet1/1 1 200000 rs +Ethernet2 19,20 Ethernet1/3 1 200000 rs +Ethernet4 21,22 Ethernet1/5 1 200000 rs +Ethernet6 23,24 Ethernet1/7 1 200000 rs +Ethernet8 1,2 Ethernet2/1 2 200000 rs +Ethernet10 3,4 Ethernet2/3 2 200000 rs +Ethernet12 5,6 Ethernet2/5 2 200000 rs +Ethernet14 7,8 Ethernet2/7 2 200000 rs +Ethernet16 9,10 Ethernet3/1 3 200000 rs +Ethernet18 11,12 Ethernet3/3 3 200000 rs +Ethernet20 13,14 Ethernet3/5 3 200000 rs +Ethernet22 15,16 Ethernet3/7 3 200000 rs +Ethernet24 25,26 Ethernet4/1 4 200000 rs +Ethernet26 27,28 Ethernet4/3 4 200000 rs +Ethernet28 29,30 Ethernet4/5 4 200000 rs +Ethernet30 31,32 Ethernet4/7 4 200000 rs +Ethernet32 57,58 Ethernet5/1 5 200000 rs +Ethernet34 59,60 Ethernet5/3 5 200000 rs +Ethernet36 61,62 Ethernet5/5 5 200000 rs +Ethernet38 63,64 Ethernet5/7 5 200000 rs +Ethernet40 41,42 Ethernet6/1 6 200000 rs +Ethernet42 43,44 Ethernet6/3 6 200000 rs +Ethernet44 45,46 Ethernet6/5 6 200000 rs +Ethernet46 47,48 Ethernet6/7 6 200000 rs +Ethernet48 33,34 Ethernet7/1 7 200000 rs +Ethernet50 35,36 Ethernet7/3 7 200000 rs +Ethernet52 37,38 Ethernet7/5 7 200000 rs +Ethernet54 39,40 Ethernet7/7 7 200000 rs +Ethernet56 49,50 Ethernet8/1 8 200000 rs +Ethernet58 51,52 Ethernet8/3 8 200000 rs +Ethernet60 53,54 Ethernet8/5 8 200000 rs +Ethernet62 55,56 Ethernet8/7 8 200000 rs +Ethernet64 89,90 Ethernet9/1 9 200000 rs +Ethernet66 91,92 Ethernet9/3 9 200000 rs +Ethernet68 93,94 Ethernet9/5 9 200000 rs +Ethernet70 95,96 Ethernet9/7 9 200000 rs +Ethernet72 73,74 Ethernet10/1 10 200000 rs +Ethernet74 75,76 Ethernet10/3 10 200000 rs +Ethernet76 77,78 Ethernet10/5 10 200000 rs +Ethernet78 79,80 Ethernet10/7 10 200000 rs +Ethernet80 65,66 Ethernet11/1 11 200000 rs +Ethernet82 67,68 Ethernet11/3 11 200000 rs +Ethernet84 69,70 Ethernet11/5 11 200000 rs +Ethernet86 71,72 Ethernet11/7 11 200000 rs +Ethernet88 81,82 Ethernet12/1 12 200000 rs +Ethernet90 83,84 Ethernet12/3 12 200000 rs +Ethernet92 85,86 Ethernet12/5 12 200000 rs +Ethernet94 87,88 Ethernet12/7 12 200000 rs +Ethernet96 121,122 Ethernet13/1 13 200000 rs +Ethernet98 123,124 Ethernet13/3 13 200000 rs +Ethernet100 125,126 Ethernet13/5 13 200000 rs +Ethernet102 127,128 Ethernet13/7 13 200000 rs +Ethernet104 105,106 Ethernet14/1 14 200000 rs +Ethernet106 107,108 Ethernet14/3 14 200000 rs +Ethernet108 109,110 Ethernet14/5 14 200000 rs +Ethernet110 111,112 Ethernet14/7 14 200000 rs +Ethernet112 97,98 Ethernet15/1 15 200000 rs +Ethernet114 99,100 Ethernet15/3 15 200000 rs +Ethernet116 101,102 Ethernet15/5 15 200000 rs +Ethernet118 103,104 Ethernet15/7 15 200000 rs +Ethernet120 113,114 Ethernet16/1 16 200000 rs +Ethernet122 115,116 Ethernet16/3 16 200000 rs +Ethernet124 117,118 Ethernet16/5 16 200000 rs +Ethernet126 119,120 Ethernet16/7 16 200000 rs +Ethernet128 153,154 Ethernet17/1 17 200000 rs +Ethernet130 155,156 Ethernet17/3 17 200000 rs +Ethernet132 157,158 Ethernet17/5 17 200000 rs +Ethernet134 159,160 Ethernet17/7 17 200000 rs +Ethernet136 137,138 Ethernet18/1 18 200000 rs +Ethernet138 139,140 Ethernet18/3 18 200000 rs +Ethernet140 141,142 Ethernet18/5 18 200000 rs +Ethernet142 143,144 Ethernet18/7 18 200000 rs +Ethernet144 129,130 Ethernet19/1 19 200000 rs +Ethernet146 131,132 Ethernet19/3 19 200000 rs +Ethernet148 133,134 Ethernet19/5 19 200000 rs +Ethernet150 135,136 Ethernet19/7 19 200000 rs +Ethernet152 145,146 Ethernet20/1 20 200000 rs +Ethernet154 147,148 Ethernet20/3 20 200000 rs +Ethernet156 149,150 Ethernet20/5 20 200000 rs +Ethernet158 151,152 Ethernet20/7 20 200000 rs +Ethernet160 185,186 Ethernet21/1 21 200000 rs +Ethernet162 187,188 Ethernet21/3 21 200000 rs +Ethernet164 189,190 Ethernet21/5 21 200000 rs +Ethernet166 191,192 Ethernet21/7 21 200000 rs +Ethernet168 169,170 Ethernet22/1 22 200000 rs +Ethernet170 171,172 Ethernet22/3 22 200000 rs +Ethernet172 173,174 Ethernet22/5 22 200000 rs +Ethernet174 175,176 Ethernet22/7 22 200000 rs +Ethernet176 161,162 Ethernet23/1 23 200000 rs +Ethernet178 163,164 Ethernet23/3 23 200000 rs +Ethernet180 165,166 Ethernet23/5 23 200000 rs +Ethernet182 167,168 Ethernet23/7 23 200000 rs +Ethernet184 177,178 Ethernet24/1 24 200000 rs +Ethernet186 179,180 Ethernet24/3 24 200000 rs +Ethernet188 181,182 Ethernet24/5 24 200000 rs +Ethernet190 183,184 Ethernet24/7 24 200000 rs +Ethernet192 217,218 Ethernet25/1 25 200000 rs +Ethernet194 219,220 Ethernet25/3 25 200000 rs +Ethernet196 221,222 Ethernet25/5 25 200000 rs +Ethernet198 223,224 Ethernet25/7 25 200000 rs +Ethernet200 201,202 Ethernet26/1 26 200000 rs +Ethernet202 203,204 Ethernet26/3 26 200000 rs +Ethernet204 205,206 Ethernet26/5 26 200000 rs +Ethernet206 207,208 Ethernet26/7 26 200000 rs +Ethernet208 193,194 Ethernet27/1 27 200000 rs +Ethernet210 195,196 Ethernet27/3 27 200000 rs +Ethernet212 197,198 Ethernet27/5 27 200000 rs +Ethernet214 199,200 Ethernet27/7 27 200000 rs +Ethernet216 209,210 Ethernet28/1 28 200000 rs +Ethernet218 211,212 Ethernet28/3 28 200000 rs +Ethernet220 213,214 Ethernet28/5 28 200000 rs +Ethernet222 215,216 Ethernet28/7 28 200000 rs +Ethernet224 249,250 Ethernet29/1 29 200000 rs +Ethernet226 251,252 Ethernet29/3 29 200000 rs +Ethernet228 253,254 Ethernet29/5 29 200000 rs +Ethernet230 255,256 Ethernet29/7 29 200000 rs +Ethernet232 233,234 Ethernet30/1 30 200000 rs +Ethernet234 235,236 Ethernet30/3 30 200000 rs +Ethernet236 237,238 Ethernet30/5 30 200000 rs +Ethernet238 239,240 Ethernet30/7 30 200000 rs +Ethernet240 225,226 Ethernet31/1 31 200000 rs +Ethernet242 227,228 Ethernet31/3 31 200000 rs +Ethernet244 229,230 Ethernet31/5 31 200000 rs +Ethernet246 231,232 Ethernet31/7 31 200000 rs +Ethernet248 241,242 Ethernet32/1 32 200000 rs +Ethernet250 243,244 Ethernet32/3 32 200000 rs +Ethernet252 245,246 Ethernet32/5 32 200000 rs +Ethernet254 247,248 Ethernet32/7 32 200000 rs +Ethernet256 273,274 Ethernet33/1 33 200000 rs +Ethernet258 275,276 Ethernet33/3 33 200000 rs +Ethernet260 277,278 Ethernet33/5 33 200000 rs +Ethernet262 279,280 Ethernet33/7 33 200000 rs +Ethernet264 257,258 Ethernet34/1 34 200000 rs +Ethernet266 259,260 Ethernet34/3 34 200000 rs +Ethernet268 261,262 Ethernet34/5 34 200000 rs +Ethernet270 263,264 Ethernet34/7 34 200000 rs +Ethernet272 265,266 Ethernet35/1 35 200000 rs +Ethernet274 267,268 Ethernet35/3 35 200000 rs +Ethernet276 269,270 Ethernet35/5 35 200000 rs +Ethernet278 271,272 Ethernet35/7 35 200000 rs +Ethernet280 281,282 Ethernet36/1 36 200000 rs +Ethernet282 283,284 Ethernet36/3 36 200000 rs +Ethernet284 285,286 Ethernet36/5 36 200000 rs +Ethernet286 287,288 Ethernet36/7 36 200000 rs +Ethernet288 313,314 Ethernet37/1 37 200000 rs +Ethernet290 315,316 Ethernet37/3 37 200000 rs +Ethernet292 317,318 Ethernet37/5 37 200000 rs +Ethernet294 319,320 Ethernet37/7 37 200000 rs +Ethernet296 297,298 Ethernet38/1 38 200000 rs +Ethernet298 299,300 Ethernet38/3 38 200000 rs +Ethernet300 301,302 Ethernet38/5 38 200000 rs +Ethernet302 303,304 Ethernet38/7 38 200000 rs +Ethernet304 289,290 Ethernet39/1 39 200000 rs +Ethernet306 291,292 Ethernet39/3 39 200000 rs +Ethernet308 293,294 Ethernet39/5 39 200000 rs +Ethernet310 295,296 Ethernet39/7 39 200000 rs +Ethernet312 305,306 Ethernet40/1 40 200000 rs +Ethernet314 307,308 Ethernet40/3 40 200000 rs +Ethernet316 309,310 Ethernet40/5 40 200000 rs +Ethernet318 311,312 Ethernet40/7 40 200000 rs +Ethernet320 345,346 Ethernet41/1 41 200000 rs +Ethernet322 347,348 Ethernet41/3 41 200000 rs +Ethernet324 349,350 Ethernet41/5 41 200000 rs +Ethernet326 351,352 Ethernet41/7 41 200000 rs +Ethernet328 329,330 Ethernet42/1 42 200000 rs +Ethernet330 331,332 Ethernet42/3 42 200000 rs +Ethernet332 333,334 Ethernet42/5 42 200000 rs +Ethernet334 335,336 Ethernet42/7 42 200000 rs +Ethernet336 321,322 Ethernet43/1 43 200000 rs +Ethernet338 323,324 Ethernet43/3 43 200000 rs +Ethernet340 325,326 Ethernet43/5 43 200000 rs +Ethernet342 327,328 Ethernet43/7 43 200000 rs +Ethernet344 337,338 Ethernet44/1 44 200000 rs +Ethernet346 339,340 Ethernet44/3 44 200000 rs +Ethernet348 341,342 Ethernet44/5 44 200000 rs +Ethernet350 343,344 Ethernet44/7 44 200000 rs +Ethernet352 377,378 Ethernet45/1 45 200000 rs +Ethernet354 379,380 Ethernet45/3 45 200000 rs +Ethernet356 381,382 Ethernet45/5 45 200000 rs +Ethernet358 383,384 Ethernet45/7 45 200000 rs +Ethernet360 361,362 Ethernet46/1 46 200000 rs +Ethernet362 363,364 Ethernet46/3 46 200000 rs +Ethernet364 365,366 Ethernet46/5 46 200000 rs +Ethernet366 367,368 Ethernet46/7 46 200000 rs +Ethernet368 353,354 Ethernet47/1 47 200000 rs +Ethernet370 355,356 Ethernet47/3 47 200000 rs +Ethernet372 357,358 Ethernet47/5 47 200000 rs +Ethernet374 359,360 Ethernet47/7 47 200000 rs +Ethernet376 369,370 Ethernet48/1 48 200000 rs +Ethernet378 371,372 Ethernet48/3 48 200000 rs +Ethernet380 373,374 Ethernet48/5 48 200000 rs +Ethernet382 375,376 Ethernet48/7 48 200000 rs +Ethernet384 409,410 Ethernet49/1 49 200000 rs +Ethernet386 411,412 Ethernet49/3 49 200000 rs +Ethernet388 413,414 Ethernet49/5 49 200000 rs +Ethernet390 415,416 Ethernet49/7 49 200000 rs +Ethernet392 393,394 Ethernet50/1 50 200000 rs +Ethernet394 395,396 Ethernet50/3 50 200000 rs +Ethernet396 397,398 Ethernet50/5 50 200000 rs +Ethernet398 399,400 Ethernet50/7 50 200000 rs +Ethernet400 385,386 Ethernet51/1 51 200000 rs +Ethernet402 387,388 Ethernet51/3 51 200000 rs +Ethernet404 389,390 Ethernet51/5 51 200000 rs +Ethernet406 391,392 Ethernet51/7 51 200000 rs +Ethernet408 401,402 Ethernet52/1 52 200000 rs +Ethernet410 403,404 Ethernet52/3 52 200000 rs +Ethernet412 405,406 Ethernet52/5 52 200000 rs +Ethernet414 407,408 Ethernet52/7 52 200000 rs +Ethernet416 441,442 Ethernet53/1 53 200000 rs +Ethernet418 443,444 Ethernet53/3 53 200000 rs +Ethernet420 445,446 Ethernet53/5 53 200000 rs +Ethernet422 447,448 Ethernet53/7 53 200000 rs +Ethernet424 425,426 Ethernet54/1 54 200000 rs +Ethernet426 427,428 Ethernet54/3 54 200000 rs +Ethernet428 429,430 Ethernet54/5 54 200000 rs +Ethernet430 431,432 Ethernet54/7 54 200000 rs +Ethernet432 417,418 Ethernet55/1 55 200000 rs +Ethernet434 419,420 Ethernet55/3 55 200000 rs +Ethernet436 421,422 Ethernet55/5 55 200000 rs +Ethernet438 423,424 Ethernet55/7 55 200000 rs +Ethernet440 433,434 Ethernet56/1 56 200000 rs +Ethernet442 435,436 Ethernet56/3 56 200000 rs +Ethernet444 437,438 Ethernet56/5 56 200000 rs +Ethernet446 439,440 Ethernet56/7 56 200000 rs +Ethernet448 473,474 Ethernet57/1 57 200000 rs +Ethernet450 475,476 Ethernet57/3 57 200000 rs +Ethernet452 477,478 Ethernet57/5 57 200000 rs +Ethernet454 479,480 Ethernet57/7 57 200000 rs +Ethernet456 457,458 Ethernet58/1 58 200000 rs +Ethernet458 459,460 Ethernet58/3 58 200000 rs +Ethernet460 461,462 Ethernet58/5 58 200000 rs +Ethernet462 463,464 Ethernet58/7 58 200000 rs +Ethernet464 449,450 Ethernet59/1 59 200000 rs +Ethernet466 451,452 Ethernet59/3 59 200000 rs +Ethernet468 453,454 Ethernet59/5 59 200000 rs +Ethernet470 455,456 Ethernet59/7 59 200000 rs +Ethernet472 465,466 Ethernet60/1 60 200000 rs +Ethernet474 467,468 Ethernet60/3 60 200000 rs +Ethernet476 469,470 Ethernet60/5 60 200000 rs +Ethernet478 471,472 Ethernet60/7 60 200000 rs +Ethernet480 505,506 Ethernet61/1 61 200000 rs +Ethernet482 507,508 Ethernet61/3 61 200000 rs +Ethernet484 509,510 Ethernet61/5 61 200000 rs +Ethernet486 511,512 Ethernet61/7 61 200000 rs +Ethernet488 489,490 Ethernet62/1 62 200000 rs +Ethernet490 491,492 Ethernet62/3 62 200000 rs +Ethernet492 493,494 Ethernet62/5 62 200000 rs +Ethernet494 495,496 Ethernet62/7 62 200000 rs +Ethernet496 481,482 Ethernet63/1 63 200000 rs +Ethernet498 483,484 Ethernet63/3 63 200000 rs +Ethernet500 485,486 Ethernet63/5 63 200000 rs +Ethernet502 487,488 Ethernet63/7 63 200000 rs +Ethernet504 497,498 Ethernet64/1 64 200000 rs +Ethernet506 499,500 Ethernet64/3 64 200000 rs +Ethernet508 501,502 Ethernet64/5 64 200000 rs +Ethernet510 503,504 Ethernet64/7 64 200000 rs diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/sai.profile b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/sai.profile new file mode 100644 index 000000000000..89cfbc9f1b84 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64de.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm new file mode 100644 index 000000000000..b418d4965799 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm @@ -0,0 +1,1913 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +#
: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15047362 + TX_LANE_MAP: 0x4152637 + RX_POLARITY_FLIP: 0xc3 + TX_POLARITY_FLIP: 0xcc + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17063524 + TX_LANE_MAP: 0x60714253 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0xcc + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x6172435 + TX_LANE_MAP: 0x71605342 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x40516273 + TX_LANE_MAP: 0x51403726 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xc3 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71630524 + TX_LANE_MAP: 0x4371625 + RX_POLARITY_FLIP: 0x47 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70625143 + TX_LANE_MAP: 0x60534172 + RX_POLARITY_FLIP: 0x1e + TX_POLARITY_FLIP: 0x2c + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17063524 + TX_LANE_MAP: 0x60715243 + RX_POLARITY_FLIP: 0x38 + TX_POLARITY_FLIP: 0x4e + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x73402516 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71630524 + TX_LANE_MAP: 0x4371625 + RX_POLARITY_FLIP: 0x47 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70625143 + TX_LANE_MAP: 0x60534172 + RX_POLARITY_FLIP: 0x1e + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62704351 + TX_LANE_MAP: 0x53607241 + RX_POLARITY_FLIP: 0xb4 + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x73402516 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71630524 + TX_LANE_MAP: 0x4371625 + RX_POLARITY_FLIP: 0x47 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70625143 + TX_LANE_MAP: 0x60534172 + RX_POLARITY_FLIP: 0x1e + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62704351 + TX_LANE_MAP: 0x53607241 + RX_POLARITY_FLIP: 0xb4 + TX_POLARITY_FLIP: 0x6c + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x73402516 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0xc9 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15347062 + TX_LANE_MAP: 0x60734152 + RX_POLARITY_FLIP: 0x3f + TX_POLARITY_FLIP: 0x76 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17360524 + TX_LANE_MAP: 0x16270435 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x9b + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x27163504 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x91 + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43516270 + TX_LANE_MAP: 0x37065241 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x16 + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15347062 + TX_LANE_MAP: 0x60734152 + RX_POLARITY_FLIP: 0x3f + TX_POLARITY_FLIP: 0x76 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17360524 + TX_LANE_MAP: 0x16270435 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x9b + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x27163504 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x91 + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43516270 + TX_LANE_MAP: 0x37065241 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x16 + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43612705 + TX_LANE_MAP: 0x63507241 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x8e + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17360524 + TX_LANE_MAP: 0x16270435 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x9b + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x36172405 + TX_LANE_MAP: 0x27163504 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x91 + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43516270 + TX_LANE_MAP: 0x37065241 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x36 + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x73621504 + TX_LANE_MAP: 0x62734051 + RX_POLARITY_FLIP: 0xf0 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71605342 + TX_LANE_MAP: 0x6172435 + RX_POLARITY_FLIP: 0xa5 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x60714253 + TX_LANE_MAP: 0x17063524 + RX_POLARITY_FLIP: 0x21 + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26370415 + TX_LANE_MAP: 0x37265140 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0xc3 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15047362 + TX_LANE_MAP: 0x4152637 + RX_POLARITY_FLIP: 0xf0 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17063524 + TX_LANE_MAP: 0x60714253 + RX_POLARITY_FLIP: 0xa5 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x6172435 + TX_LANE_MAP: 0x71605342 + RX_POLARITY_FLIP: 0xed + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x40516273 + TX_LANE_MAP: 0x51403726 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0xc3 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70621534 + TX_LANE_MAP: 0x14250637 + RX_POLARITY_FLIP: 0x0c + TX_POLARITY_FLIP: 0x64 + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71635042 + TX_LANE_MAP: 0x61724053 + RX_POLARITY_FLIP: 0x48 + TX_POLARITY_FLIP: 0x9c + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x6241537 + TX_LANE_MAP: 0x51624073 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0x3a + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x52413706 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x9e + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70621534 + TX_LANE_MAP: 0x14250637 + RX_POLARITY_FLIP: 0x0c + TX_POLARITY_FLIP: 0x64 + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71635042 + TX_LANE_MAP: 0x61724053 + RX_POLARITY_FLIP: 0x48 + TX_POLARITY_FLIP: 0x98 + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x63714250 + TX_LANE_MAP: 0x72615340 + RX_POLARITY_FLIP: 0xed + TX_POLARITY_FLIP: 0x9d + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x52413706 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x9e + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x70621534 + TX_LANE_MAP: 0x14250637 + RX_POLARITY_FLIP: 0x0c + TX_POLARITY_FLIP: 0x64 + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71635042 + TX_LANE_MAP: 0x61724053 + RX_POLARITY_FLIP: 0x48 + TX_POLARITY_FLIP: 0x98 + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x63714250 + TX_LANE_MAP: 0x72615340 + RX_POLARITY_FLIP: 0xed + TX_POLARITY_FLIP: 0x9d + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x52413706 + RX_POLARITY_FLIP: 0xfc + TX_POLARITY_FLIP: 0x9e + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x5247163 + TX_LANE_MAP: 0x61524073 + RX_POLARITY_FLIP: 0x8b + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x7261534 + TX_LANE_MAP: 0x6351427 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x35062714 + RX_POLARITY_FLIP: 0x87 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x42506371 + TX_LANE_MAP: 0x25167340 + RX_POLARITY_FLIP: 0xe1 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x5247163 + TX_LANE_MAP: 0x61524073 + RX_POLARITY_FLIP: 0x8b + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x7261534 + TX_LANE_MAP: 0x6351427 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x35062714 + RX_POLARITY_FLIP: 0x87 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x42506371 + TX_LANE_MAP: 0x25167340 + RX_POLARITY_FLIP: 0xe1 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62730415 + TX_LANE_MAP: 0x73624150 + RX_POLARITY_FLIP: 0x98 + TX_POLARITY_FLIP: 0x1b + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x7261534 + TX_LANE_MAP: 0x6351427 + RX_POLARITY_FLIP: 0xd2 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26073415 + TX_LANE_MAP: 0x35062714 + RX_POLARITY_FLIP: 0x87 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x42506371 + TX_LANE_MAP: 0x25167340 + RX_POLARITY_FLIP: 0xe1 + TX_POLARITY_FLIP: 0x62 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x73621504 + TX_LANE_MAP: 0x62734051 + RX_POLARITY_FLIP: 0xc2 + TX_POLARITY_FLIP: 0x33 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71605342 + TX_LANE_MAP: 0x6172435 + RX_POLARITY_FLIP: 0x96 + TX_POLARITY_FLIP: 0x33 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x60714253 + TX_LANE_MAP: 0x17063524 + RX_POLARITY_FLIP: 0xcc + TX_POLARITY_FLIP: 0x69 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x26370415 + TX_LANE_MAP: 0x37265140 + RX_POLARITY_FLIP: 0xcc + TX_POLARITY_FLIP: 0xc3 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 3 + ? + PORT_ID: 3 + : + PC_PHYS_PORT_ID: 5 + ? + PORT_ID: 4 + : + PC_PHYS_PORT_ID: 7 + ? + PORT_ID: 5 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 6 + : + PC_PHYS_PORT_ID: 11 + ? + PORT_ID: 7 + : + PC_PHYS_PORT_ID: 13 + ? + PORT_ID: 8 + : + PC_PHYS_PORT_ID: 15 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 19 + ? + PORT_ID: 13 + : + PC_PHYS_PORT_ID: 21 + ? + PORT_ID: 14 + : + PC_PHYS_PORT_ID: 23 + ? + PORT_ID: 15 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 16 + : + PC_PHYS_PORT_ID: 27 + ? + PORT_ID: 17 + : + PC_PHYS_PORT_ID: 29 + ? + PORT_ID: 18 + : + PC_PHYS_PORT_ID: 31 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 35 + ? + PORT_ID: 24 + : + PC_PHYS_PORT_ID: 37 + ? + PORT_ID: 25 + : + PC_PHYS_PORT_ID: 39 + ? + PORT_ID: 26 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 27 + : + PC_PHYS_PORT_ID: 43 + ? + PORT_ID: 28 + : + PC_PHYS_PORT_ID: 45 + ? + PORT_ID: 29 + : + PC_PHYS_PORT_ID: 47 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 51 + ? + PORT_ID: 35 + : + PC_PHYS_PORT_ID: 53 + ? + PORT_ID: 36 + : + PC_PHYS_PORT_ID: 55 + ? + PORT_ID: 37 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 38 + : + PC_PHYS_PORT_ID: 59 + ? + PORT_ID: 39 + : + PC_PHYS_PORT_ID: 61 + ? + PORT_ID: 40 + : + PC_PHYS_PORT_ID: 63 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 67 + ? + PORT_ID: 46 + : + PC_PHYS_PORT_ID: 69 + ? + PORT_ID: 47 + : + PC_PHYS_PORT_ID: 71 + ? + PORT_ID: 48 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 49 + : + PC_PHYS_PORT_ID: 75 + ? + PORT_ID: 50 + : + PC_PHYS_PORT_ID: 77 + ? + PORT_ID: 51 + : + PC_PHYS_PORT_ID: 79 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 83 + ? + PORT_ID: 57 + : + PC_PHYS_PORT_ID: 85 + ? + PORT_ID: 58 + : + PC_PHYS_PORT_ID: 87 + ? + PORT_ID: 59 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 60 + : + PC_PHYS_PORT_ID: 91 + ? + PORT_ID: 61 + : + PC_PHYS_PORT_ID: 93 + ? + PORT_ID: 62 + : + PC_PHYS_PORT_ID: 95 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 99 + ? + PORT_ID: 68 + : + PC_PHYS_PORT_ID: 101 + ? + PORT_ID: 69 + : + PC_PHYS_PORT_ID: 103 + ? + PORT_ID: 70 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 71 + : + PC_PHYS_PORT_ID: 107 + ? + PORT_ID: 72 + : + PC_PHYS_PORT_ID: 109 + ? + PORT_ID: 73 + : + PC_PHYS_PORT_ID: 111 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 115 + ? + PORT_ID: 79 + : + PC_PHYS_PORT_ID: 117 + ? + PORT_ID: 80 + : + PC_PHYS_PORT_ID: 119 + ? + PORT_ID: 81 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 82 + : + PC_PHYS_PORT_ID: 123 + ? + PORT_ID: 83 + : + PC_PHYS_PORT_ID: 125 + ? + PORT_ID: 84 + : + PC_PHYS_PORT_ID: 127 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 131 + ? + PORT_ID: 90 + : + PC_PHYS_PORT_ID: 133 + ? + PORT_ID: 91 + : + PC_PHYS_PORT_ID: 135 + ? + PORT_ID: 92 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 93 + : + PC_PHYS_PORT_ID: 139 + ? + PORT_ID: 94 + : + PC_PHYS_PORT_ID: 141 + ? + PORT_ID: 95 + : + PC_PHYS_PORT_ID: 143 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 147 + ? + PORT_ID: 101 + : + PC_PHYS_PORT_ID: 149 + ? + PORT_ID: 102 + : + PC_PHYS_PORT_ID: 151 + ? + PORT_ID: 103 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 104 + : + PC_PHYS_PORT_ID: 155 + ? + PORT_ID: 105 + : + PC_PHYS_PORT_ID: 157 + ? + PORT_ID: 106 + : + PC_PHYS_PORT_ID: 159 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 163 + ? + PORT_ID: 112 + : + PC_PHYS_PORT_ID: 165 + ? + PORT_ID: 113 + : + PC_PHYS_PORT_ID: 167 + ? + PORT_ID: 114 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 115 + : + PC_PHYS_PORT_ID: 171 + ? + PORT_ID: 116 + : + PC_PHYS_PORT_ID: 173 + ? + PORT_ID: 117 + : + PC_PHYS_PORT_ID: 175 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 179 + ? + PORT_ID: 123 + : + PC_PHYS_PORT_ID: 181 + ? + PORT_ID: 124 + : + PC_PHYS_PORT_ID: 183 + ? + PORT_ID: 125 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 126 + : + PC_PHYS_PORT_ID: 187 + ? + PORT_ID: 127 + : + PC_PHYS_PORT_ID: 189 + ? + PORT_ID: 128 + : + PC_PHYS_PORT_ID: 191 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 195 + ? + PORT_ID: 134 + : + PC_PHYS_PORT_ID: 197 + ? + PORT_ID: 135 + : + PC_PHYS_PORT_ID: 199 + ? + PORT_ID: 136 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 137 + : + PC_PHYS_PORT_ID: 203 + ? + PORT_ID: 138 + : + PC_PHYS_PORT_ID: 205 + ? + PORT_ID: 139 + : + PC_PHYS_PORT_ID: 207 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 211 + ? + PORT_ID: 145 + : + PC_PHYS_PORT_ID: 213 + ? + PORT_ID: 146 + : + PC_PHYS_PORT_ID: 215 + ? + PORT_ID: 147 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 148 + : + PC_PHYS_PORT_ID: 219 + ? + PORT_ID: 149 + : + PC_PHYS_PORT_ID: 221 + ? + PORT_ID: 150 + : + PC_PHYS_PORT_ID: 223 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 227 + ? + PORT_ID: 156 + : + PC_PHYS_PORT_ID: 229 + ? + PORT_ID: 157 + : + PC_PHYS_PORT_ID: 231 + ? + PORT_ID: 158 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 159 + : + PC_PHYS_PORT_ID: 235 + ? + PORT_ID: 160 + : + PC_PHYS_PORT_ID: 237 + ? + PORT_ID: 161 + : + PC_PHYS_PORT_ID: 239 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 243 + ? + PORT_ID: 167 + : + PC_PHYS_PORT_ID: 245 + ? + PORT_ID: 168 + : + PC_PHYS_PORT_ID: 247 + ? + PORT_ID: 169 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 170 + : + PC_PHYS_PORT_ID: 251 + ? + PORT_ID: 171 + : + PC_PHYS_PORT_ID: 253 + ? + PORT_ID: 172 + : + PC_PHYS_PORT_ID: 255 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 259 + ? + PORT_ID: 178 + : + PC_PHYS_PORT_ID: 261 + ? + PORT_ID: 179 + : + PC_PHYS_PORT_ID: 263 + ? + PORT_ID: 180 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 181 + : + PC_PHYS_PORT_ID: 267 + ? + PORT_ID: 182 + : + PC_PHYS_PORT_ID: 269 + ? + PORT_ID: 183 + : + PC_PHYS_PORT_ID: 271 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 275 + ? + PORT_ID: 189 + : + PC_PHYS_PORT_ID: 277 + ? + PORT_ID: 190 + : + PC_PHYS_PORT_ID: 279 + ? + PORT_ID: 191 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 192 + : + PC_PHYS_PORT_ID: 283 + ? + PORT_ID: 193 + : + PC_PHYS_PORT_ID: 285 + ? + PORT_ID: 194 + : + PC_PHYS_PORT_ID: 287 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 291 + ? + PORT_ID: 200 + : + PC_PHYS_PORT_ID: 293 + ? + PORT_ID: 201 + : + PC_PHYS_PORT_ID: 295 + ? + PORT_ID: 202 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 203 + : + PC_PHYS_PORT_ID: 299 + ? + PORT_ID: 204 + : + PC_PHYS_PORT_ID: 301 + ? + PORT_ID: 205 + : + PC_PHYS_PORT_ID: 303 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 307 + ? + PORT_ID: 211 + : + PC_PHYS_PORT_ID: 309 + ? + PORT_ID: 212 + : + PC_PHYS_PORT_ID: 311 + ? + PORT_ID: 213 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 214 + : + PC_PHYS_PORT_ID: 315 + ? + PORT_ID: 215 + : + PC_PHYS_PORT_ID: 317 + ? + PORT_ID: 216 + : + PC_PHYS_PORT_ID: 319 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 323 + ? + PORT_ID: 222 + : + PC_PHYS_PORT_ID: 325 + ? + PORT_ID: 223 + : + PC_PHYS_PORT_ID: 327 + ? + PORT_ID: 224 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 225 + : + PC_PHYS_PORT_ID: 331 + ? + PORT_ID: 226 + : + PC_PHYS_PORT_ID: 333 + ? + PORT_ID: 227 + : + PC_PHYS_PORT_ID: 335 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 339 + ? + PORT_ID: 233 + : + PC_PHYS_PORT_ID: 341 + ? + PORT_ID: 234 + : + PC_PHYS_PORT_ID: 343 + ? + PORT_ID: 235 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 236 + : + PC_PHYS_PORT_ID: 347 + ? + PORT_ID: 237 + : + PC_PHYS_PORT_ID: 349 + ? + PORT_ID: 238 + : + PC_PHYS_PORT_ID: 351 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 355 + ? + PORT_ID: 244 + : + PC_PHYS_PORT_ID: 357 + ? + PORT_ID: 245 + : + PC_PHYS_PORT_ID: 359 + ? + PORT_ID: 246 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 247 + : + PC_PHYS_PORT_ID: 363 + ? + PORT_ID: 248 + : + PC_PHYS_PORT_ID: 365 + ? + PORT_ID: 249 + : + PC_PHYS_PORT_ID: 367 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 371 + ? + PORT_ID: 255 + : + PC_PHYS_PORT_ID: 373 + ? + PORT_ID: 256 + : + PC_PHYS_PORT_ID: 375 + ? + PORT_ID: 257 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 258 + : + PC_PHYS_PORT_ID: 379 + ? + PORT_ID: 259 + : + PC_PHYS_PORT_ID: 381 + ? + PORT_ID: 260 + : + PC_PHYS_PORT_ID: 383 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 387 + ? + PORT_ID: 266 + : + PC_PHYS_PORT_ID: 389 + ? + PORT_ID: 267 + : + PC_PHYS_PORT_ID: 391 + ? + PORT_ID: 268 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 269 + : + PC_PHYS_PORT_ID: 395 + ? + PORT_ID: 270 + : + PC_PHYS_PORT_ID: 397 + ? + PORT_ID: 271 + : + PC_PHYS_PORT_ID: 399 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 403 + ? + PORT_ID: 277 + : + PC_PHYS_PORT_ID: 405 + ? + PORT_ID: 278 + : + PC_PHYS_PORT_ID: 407 + ? + PORT_ID: 279 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 280 + : + PC_PHYS_PORT_ID: 411 + ? + PORT_ID: 281 + : + PC_PHYS_PORT_ID: 413 + ? + PORT_ID: 282 + : + PC_PHYS_PORT_ID: 415 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 419 + ? + PORT_ID: 288 + : + PC_PHYS_PORT_ID: 421 + ? + PORT_ID: 289 + : + PC_PHYS_PORT_ID: 423 + ? + PORT_ID: 290 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 291 + : + PC_PHYS_PORT_ID: 427 + ? + PORT_ID: 292 + : + PC_PHYS_PORT_ID: 429 + ? + PORT_ID: 293 + : + PC_PHYS_PORT_ID: 431 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 435 + ? + PORT_ID: 299 + : + PC_PHYS_PORT_ID: 437 + ? + PORT_ID: 300 + : + PC_PHYS_PORT_ID: 439 + ? + PORT_ID: 301 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 302 + : + PC_PHYS_PORT_ID: 443 + ? + PORT_ID: 303 + : + PC_PHYS_PORT_ID: 445 + ? + PORT_ID: 304 + : + PC_PHYS_PORT_ID: 447 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 451 + ? + PORT_ID: 310 + : + PC_PHYS_PORT_ID: 453 + ? + PORT_ID: 311 + : + PC_PHYS_PORT_ID: 455 + ? + PORT_ID: 312 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 313 + : + PC_PHYS_PORT_ID: 459 + ? + PORT_ID: 314 + : + PC_PHYS_PORT_ID: 461 + ? + PORT_ID: 315 + : + PC_PHYS_PORT_ID: 463 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 467 + ? + PORT_ID: 321 + : + PC_PHYS_PORT_ID: 469 + ? + PORT_ID: 322 + : + PC_PHYS_PORT_ID: 471 + ? + PORT_ID: 323 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 324 + : + PC_PHYS_PORT_ID: 475 + ? + PORT_ID: 325 + : + PC_PHYS_PORT_ID: 477 + ? + PORT_ID: 326 + : + PC_PHYS_PORT_ID: 479 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 483 + ? + PORT_ID: 332 + : + PC_PHYS_PORT_ID: 485 + ? + PORT_ID: 333 + : + PC_PHYS_PORT_ID: 487 + ? + PORT_ID: 334 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 335 + : + PC_PHYS_PORT_ID: 491 + ? + PORT_ID: 336 + : + PC_PHYS_PORT_ID: 493 + ? + PORT_ID: 337 + : + PC_PHYS_PORT_ID: 495 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 499 + ? + PORT_ID: 343 + : + PC_PHYS_PORT_ID: 501 + ? + PORT_ID: 344 + : + PC_PHYS_PORT_ID: 503 + ? + PORT_ID: 345 + : + PC_PHYS_PORT_ID: 505 + ? + PORT_ID: 346 + : + PC_PHYS_PORT_ID: 507 + ? + PORT_ID: 347 + : + PC_PHYS_PORT_ID: 509 + ? + PORT_ID: 348 + : + PC_PHYS_PORT_ID: 511 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 8], + [11, 18], + [22, 29], + [33, 40], + [44, 51], + [55, 62], + [66, 73], + [77, 84], + [88, 95], + [99, 106], + [110, 117], + [121, 128], + [132, 139], + [143, 150], + [154, 161], + [165, 172], + [176, 183], + [187, 194], + [198, 205], + [209, 216], + [220, 227], + [231, 238], + [242, 249], + [253, 260], + [264, 271], + [275, 282], + [286, 293], + [297, 304], + [308, 315], + [319, 326], + [330, 337], + [341, 348]] + : + ENABLE: 0 + SPEED: 200000 + NUM_LANES: 2 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... diff --git a/device/arista/x86_64-arista_7060x6_64de/platform.json b/device/arista/x86_64-arista_7060x6_64de/platform.json index 9f58b40e4c1d..6af55dd4f738 100644 --- a/device/arista/x86_64-arista_7060x6_64de/platform.json +++ b/device/arista/x86_64-arista_7060x6_64de/platform.json @@ -325,6 +325,12 @@ "2x400G": [ "Ethernet1/1", "Ethernet1/5" + ], + "4x200G": [ + "Ethernet1/1", + "Ethernet1/3", + "Ethernet1/5", + "Ethernet1/7" ] } }, @@ -341,6 +347,12 @@ "2x400G": [ "Ethernet2/1", "Ethernet2/5" + ], + "4x200G": [ + "Ethernet2/1", + "Ethernet2/3", + "Ethernet2/5", + "Ethernet2/7" ] } }, @@ -357,6 +369,12 @@ "2x400G": [ "Ethernet3/1", "Ethernet3/5" + ], + "4x200G": [ + "Ethernet3/1", + "Ethernet3/3", + "Ethernet3/5", + "Ethernet3/7" ] } }, @@ -373,6 +391,12 @@ "2x400G": [ "Ethernet4/1", "Ethernet4/5" + ], + "4x200G": [ + "Ethernet4/1", + "Ethernet4/3", + "Ethernet4/5", + "Ethernet4/7" ] } }, @@ -389,6 +413,12 @@ "2x400G": [ "Ethernet5/1", "Ethernet5/5" + ], + "4x200G": [ + "Ethernet5/1", + "Ethernet5/3", + "Ethernet5/5", + "Ethernet5/7" ] } }, @@ -405,6 +435,12 @@ "2x400G": [ "Ethernet6/1", "Ethernet6/5" + ], + "4x200G": [ + "Ethernet6/1", + "Ethernet6/3", + "Ethernet6/5", + "Ethernet6/7" ] } }, @@ -421,6 +457,12 @@ "2x400G": [ "Ethernet7/1", "Ethernet7/5" + ], + "4x200G": [ + "Ethernet7/1", + "Ethernet7/3", + "Ethernet7/5", + "Ethernet7/7" ] } }, @@ -437,6 +479,12 @@ "2x400G": [ "Ethernet8/1", "Ethernet8/5" + ], + "4x200G": [ + "Ethernet8/1", + "Ethernet8/3", + "Ethernet8/5", + "Ethernet8/7" ] } }, @@ -453,6 +501,12 @@ "2x400G": [ "Ethernet9/1", "Ethernet9/5" + ], + "4x200G": [ + "Ethernet9/1", + "Ethernet9/3", + "Ethernet9/5", + "Ethernet9/7" ] } }, @@ -469,6 +523,12 @@ "2x400G": [ "Ethernet10/1", "Ethernet10/5" + ], + "4x200G": [ + "Ethernet10/1", + "Ethernet10/3", + "Ethernet10/5", + "Ethernet10/7" ] } }, @@ -485,6 +545,12 @@ "2x400G": [ "Ethernet11/1", "Ethernet11/5" + ], + "4x200G": [ + "Ethernet11/1", + "Ethernet11/3", + "Ethernet11/5", + "Ethernet11/7" ] } }, @@ -501,6 +567,12 @@ "2x400G": [ "Ethernet12/1", "Ethernet12/5" + ], + "4x200G": [ + "Ethernet12/1", + "Ethernet12/3", + "Ethernet12/5", + "Ethernet12/7" ] } }, @@ -517,6 +589,12 @@ "2x400G": [ "Ethernet13/1", "Ethernet13/5" + ], + "4x200G": [ + "Ethernet13/1", + "Ethernet13/3", + "Ethernet13/5", + "Ethernet13/7" ] } }, @@ -533,6 +611,12 @@ "2x400G": [ "Ethernet14/1", "Ethernet14/5" + ], + "4x200G": [ + "Ethernet14/1", + "Ethernet14/3", + "Ethernet14/5", + "Ethernet14/7" ] } }, @@ -549,6 +633,12 @@ "2x400G": [ "Ethernet15/1", "Ethernet15/5" + ], + "4x200G": [ + "Ethernet15/1", + "Ethernet15/3", + "Ethernet15/5", + "Ethernet15/7" ] } }, @@ -565,6 +655,12 @@ "2x400G": [ "Ethernet16/1", "Ethernet16/5" + ], + "4x200G": [ + "Ethernet16/1", + "Ethernet16/3", + "Ethernet16/5", + "Ethernet16/7" ] } }, @@ -581,6 +677,12 @@ "2x400G": [ "Ethernet17/1", "Ethernet17/5" + ], + "4x200G": [ + "Ethernet17/1", + "Ethernet17/3", + "Ethernet17/5", + "Ethernet17/7" ] } }, @@ -597,6 +699,12 @@ "2x400G": [ "Ethernet18/1", "Ethernet18/5" + ], + "4x200G": [ + "Ethernet18/1", + "Ethernet18/3", + "Ethernet18/5", + "Ethernet18/7" ] } }, @@ -613,6 +721,12 @@ "2x400G": [ "Ethernet19/1", "Ethernet19/5" + ], + "4x200G": [ + "Ethernet19/1", + "Ethernet19/3", + "Ethernet19/5", + "Ethernet19/7" ] } }, @@ -629,6 +743,12 @@ "2x400G": [ "Ethernet20/1", "Ethernet20/5" + ], + "4x200G": [ + "Ethernet20/1", + "Ethernet20/3", + "Ethernet20/5", + "Ethernet20/7" ] } }, @@ -645,6 +765,12 @@ "2x400G": [ "Ethernet21/1", "Ethernet21/5" + ], + "4x200G": [ + "Ethernet21/1", + "Ethernet21/3", + "Ethernet21/5", + "Ethernet21/7" ] } }, @@ -661,6 +787,12 @@ "2x400G": [ "Ethernet22/1", "Ethernet22/5" + ], + "4x200G": [ + "Ethernet22/1", + "Ethernet22/3", + "Ethernet22/5", + "Ethernet22/7" ] } }, @@ -677,6 +809,12 @@ "2x400G": [ "Ethernet23/1", "Ethernet23/5" + ], + "4x200G": [ + "Ethernet23/1", + "Ethernet23/3", + "Ethernet23/5", + "Ethernet23/7" ] } }, @@ -693,6 +831,12 @@ "2x400G": [ "Ethernet24/1", "Ethernet24/5" + ], + "4x200G": [ + "Ethernet24/1", + "Ethernet24/3", + "Ethernet24/5", + "Ethernet24/7" ] } }, @@ -709,6 +853,12 @@ "2x400G": [ "Ethernet25/1", "Ethernet25/5" + ], + "4x200G": [ + "Ethernet25/1", + "Ethernet25/3", + "Ethernet25/5", + "Ethernet25/7" ] } }, @@ -725,6 +875,12 @@ "2x400G": [ "Ethernet26/1", "Ethernet26/5" + ], + "4x200G": [ + "Ethernet26/1", + "Ethernet26/3", + "Ethernet26/5", + "Ethernet26/7" ] } }, @@ -741,6 +897,12 @@ "2x400G": [ "Ethernet27/1", "Ethernet27/5" + ], + "4x200G": [ + "Ethernet27/1", + "Ethernet27/3", + "Ethernet27/5", + "Ethernet27/7" ] } }, @@ -757,6 +919,12 @@ "2x400G": [ "Ethernet28/1", "Ethernet28/5" + ], + "4x200G": [ + "Ethernet28/1", + "Ethernet28/3", + "Ethernet28/5", + "Ethernet28/7" ] } }, @@ -773,6 +941,12 @@ "2x400G": [ "Ethernet29/1", "Ethernet29/5" + ], + "4x200G": [ + "Ethernet29/1", + "Ethernet29/3", + "Ethernet29/5", + "Ethernet29/7" ] } }, @@ -789,6 +963,12 @@ "2x400G": [ "Ethernet30/1", "Ethernet30/5" + ], + "4x200G": [ + "Ethernet30/1", + "Ethernet30/3", + "Ethernet30/5", + "Ethernet30/7" ] } }, @@ -805,6 +985,12 @@ "2x400G": [ "Ethernet31/1", "Ethernet31/5" + ], + "4x200G": [ + "Ethernet31/1", + "Ethernet31/3", + "Ethernet31/5", + "Ethernet31/7" ] } }, @@ -821,6 +1007,12 @@ "2x400G": [ "Ethernet32/1", "Ethernet32/5" + ], + "4x200G": [ + "Ethernet32/1", + "Ethernet32/3", + "Ethernet32/5", + "Ethernet32/7" ] } }, @@ -837,6 +1029,12 @@ "2x400G": [ "Ethernet33/1", "Ethernet33/5" + ], + "4x200G": [ + "Ethernet33/1", + "Ethernet33/3", + "Ethernet33/5", + "Ethernet33/7" ] } }, @@ -853,6 +1051,12 @@ "2x400G": [ "Ethernet34/1", "Ethernet34/5" + ], + "4x200G": [ + "Ethernet34/1", + "Ethernet34/3", + "Ethernet34/5", + "Ethernet34/7" ] } }, @@ -869,6 +1073,12 @@ "2x400G": [ "Ethernet35/1", "Ethernet35/5" + ], + "4x200G": [ + "Ethernet35/1", + "Ethernet35/3", + "Ethernet35/5", + "Ethernet35/7" ] } }, @@ -885,6 +1095,12 @@ "2x400G": [ "Ethernet36/1", "Ethernet36/5" + ], + "4x200G": [ + "Ethernet36/1", + "Ethernet36/3", + "Ethernet36/5", + "Ethernet36/7" ] } }, @@ -901,6 +1117,12 @@ "2x400G": [ "Ethernet37/1", "Ethernet37/5" + ], + "4x200G": [ + "Ethernet37/1", + "Ethernet37/3", + "Ethernet37/5", + "Ethernet37/7" ] } }, @@ -917,6 +1139,12 @@ "2x400G": [ "Ethernet38/1", "Ethernet38/5" + ], + "4x200G": [ + "Ethernet38/1", + "Ethernet38/3", + "Ethernet38/5", + "Ethernet38/7" ] } }, @@ -933,6 +1161,12 @@ "2x400G": [ "Ethernet39/1", "Ethernet39/5" + ], + "4x200G": [ + "Ethernet39/1", + "Ethernet39/3", + "Ethernet39/5", + "Ethernet39/7" ] } }, @@ -949,6 +1183,12 @@ "2x400G": [ "Ethernet40/1", "Ethernet40/5" + ], + "4x200G": [ + "Ethernet40/1", + "Ethernet40/3", + "Ethernet40/5", + "Ethernet40/7" ] } }, @@ -965,6 +1205,12 @@ "2x400G": [ "Ethernet41/1", "Ethernet41/5" + ], + "4x200G": [ + "Ethernet41/1", + "Ethernet41/3", + "Ethernet41/5", + "Ethernet41/7" ] } }, @@ -981,6 +1227,12 @@ "2x400G": [ "Ethernet42/1", "Ethernet42/5" + ], + "4x200G": [ + "Ethernet42/1", + "Ethernet42/3", + "Ethernet42/5", + "Ethernet42/7" ] } }, @@ -997,6 +1249,12 @@ "2x400G": [ "Ethernet43/1", "Ethernet43/5" + ], + "4x200G": [ + "Ethernet43/1", + "Ethernet43/3", + "Ethernet43/5", + "Ethernet43/7" ] } }, @@ -1013,6 +1271,12 @@ "2x400G": [ "Ethernet44/1", "Ethernet44/5" + ], + "4x200G": [ + "Ethernet44/1", + "Ethernet44/3", + "Ethernet44/5", + "Ethernet44/7" ] } }, @@ -1029,6 +1293,12 @@ "2x400G": [ "Ethernet45/1", "Ethernet45/5" + ], + "4x200G": [ + "Ethernet45/1", + "Ethernet45/3", + "Ethernet45/5", + "Ethernet45/7" ] } }, @@ -1045,6 +1315,12 @@ "2x400G": [ "Ethernet46/1", "Ethernet46/5" + ], + "4x200G": [ + "Ethernet46/1", + "Ethernet46/3", + "Ethernet46/5", + "Ethernet46/7" ] } }, @@ -1061,6 +1337,12 @@ "2x400G": [ "Ethernet47/1", "Ethernet47/5" + ], + "4x200G": [ + "Ethernet47/1", + "Ethernet47/3", + "Ethernet47/5", + "Ethernet47/7" ] } }, @@ -1077,6 +1359,12 @@ "2x400G": [ "Ethernet48/1", "Ethernet48/5" + ], + "4x200G": [ + "Ethernet48/1", + "Ethernet48/3", + "Ethernet48/5", + "Ethernet48/7" ] } }, @@ -1093,6 +1381,12 @@ "2x400G": [ "Ethernet49/1", "Ethernet49/5" + ], + "4x200G": [ + "Ethernet49/1", + "Ethernet49/3", + "Ethernet49/5", + "Ethernet49/7" ] } }, @@ -1109,6 +1403,12 @@ "2x400G": [ "Ethernet50/1", "Ethernet50/5" + ], + "4x200G": [ + "Ethernet50/1", + "Ethernet50/3", + "Ethernet50/5", + "Ethernet50/7" ] } }, @@ -1125,6 +1425,12 @@ "2x400G": [ "Ethernet51/1", "Ethernet51/5" + ], + "4x200G": [ + "Ethernet51/1", + "Ethernet51/3", + "Ethernet51/5", + "Ethernet51/7" ] } }, @@ -1141,6 +1447,12 @@ "2x400G": [ "Ethernet52/1", "Ethernet52/5" + ], + "4x200G": [ + "Ethernet52/1", + "Ethernet52/3", + "Ethernet52/5", + "Ethernet52/7" ] } }, @@ -1157,6 +1469,12 @@ "2x400G": [ "Ethernet53/1", "Ethernet53/5" + ], + "4x200G": [ + "Ethernet53/1", + "Ethernet53/3", + "Ethernet53/5", + "Ethernet53/7" ] } }, @@ -1173,6 +1491,12 @@ "2x400G": [ "Ethernet54/1", "Ethernet54/5" + ], + "4x200G": [ + "Ethernet54/1", + "Ethernet54/3", + "Ethernet54/5", + "Ethernet54/7" ] } }, @@ -1189,6 +1513,12 @@ "2x400G": [ "Ethernet55/1", "Ethernet55/5" + ], + "4x200G": [ + "Ethernet55/1", + "Ethernet55/3", + "Ethernet55/5", + "Ethernet55/7" ] } }, @@ -1205,6 +1535,12 @@ "2x400G": [ "Ethernet56/1", "Ethernet56/5" + ], + "4x200G": [ + "Ethernet56/1", + "Ethernet56/3", + "Ethernet56/5", + "Ethernet56/7" ] } }, @@ -1221,6 +1557,12 @@ "2x400G": [ "Ethernet57/1", "Ethernet57/5" + ], + "4x200G": [ + "Ethernet57/1", + "Ethernet57/3", + "Ethernet57/5", + "Ethernet57/7" ] } }, @@ -1237,6 +1579,12 @@ "2x400G": [ "Ethernet58/1", "Ethernet58/5" + ], + "4x200G": [ + "Ethernet58/1", + "Ethernet58/3", + "Ethernet58/5", + "Ethernet58/7" ] } }, @@ -1253,6 +1601,12 @@ "2x400G": [ "Ethernet59/1", "Ethernet59/5" + ], + "4x200G": [ + "Ethernet59/1", + "Ethernet59/3", + "Ethernet59/5", + "Ethernet59/7" ] } }, @@ -1269,6 +1623,12 @@ "2x400G": [ "Ethernet60/1", "Ethernet60/5" + ], + "4x200G": [ + "Ethernet60/1", + "Ethernet60/3", + "Ethernet60/5", + "Ethernet60/7" ] } }, @@ -1285,6 +1645,12 @@ "2x400G": [ "Ethernet61/1", "Ethernet61/5" + ], + "4x200G": [ + "Ethernet61/1", + "Ethernet61/3", + "Ethernet61/5", + "Ethernet61/7" ] } }, @@ -1301,6 +1667,12 @@ "2x400G": [ "Ethernet62/1", "Ethernet62/5" + ], + "4x200G": [ + "Ethernet62/1", + "Ethernet62/3", + "Ethernet62/5", + "Ethernet62/7" ] } }, @@ -1317,6 +1689,12 @@ "2x400G": [ "Ethernet63/1", "Ethernet63/5" + ], + "4x200G": [ + "Ethernet63/1", + "Ethernet63/3", + "Ethernet63/5", + "Ethernet63/7" ] } }, @@ -1333,8 +1711,14 @@ "2x400G": [ "Ethernet64/1", "Ethernet64/5" + ], + "4x200G": [ + "Ethernet64/1", + "Ethernet64/3", + "Ethernet64/5", + "Ethernet64/7" ] } } } -} +} \ No newline at end of file From 4f5cb874ad9c9a74f0f6fa6a187eac12ca48f2ad Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Wed, 8 May 2024 00:50:59 +0800 Subject: [PATCH 052/282] [Mellanox] Support read/write more than 1 page in a single platform API call (#18881) - Why I did it Support read/write more than 1 page in a single platform API call. - How to verify it Manual and mock test Signed-off-by: Stephen Sun --- .../mlnx-platform-api/sonic_platform/sfp.py | 101 +++++++++++------- .../mlnx-platform-api/tests/test_sfp.py | 18 ++++ 2 files changed, 80 insertions(+), 39 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index d07de2233d00..cea8034bb530 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -355,25 +355,40 @@ def _read_eeprom(self, offset, num_bytes, log_on_error=True): Returns: bytearray: the content of EEPROM """ - _, page, page_offset = self._get_page_and_page_offset(offset) - if not page: - return None + result = None + while num_bytes > 0: + _, page, page_offset = self._get_page_and_page_offset(offset) + if not page: + return None - try: - with open(page, mode='rb', buffering=0) as f: - f.seek(page_offset) - content = f.read(num_bytes) - if ctypes.get_errno() != 0: - raise IOError(f'errno = {os.strerror(ctypes.get_errno())}') - logger.log_debug(f'read EEPROM sfp={self.sdk_index}, page={page}, page_offset={page_offset}, \ - size={num_bytes}, data={content}') - except (OSError, IOError) as e: - if log_on_error: - logger.log_warning(f'Failed to read sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, \ - size={num_bytes}, offset={offset}, error = {e}') - return None + try: + with open(page, mode='rb', buffering=0) as f: + f.seek(page_offset) + content = f.read(num_bytes) + if not result: + result = content + else: + result += content + read_length = len(content) + num_bytes -= read_length + if num_bytes > 0: + page_size = f.seek(0, os.SEEK_END) + if page_offset + read_length == page_size: + offset += read_length + else: + # Indicate read finished + num_bytes = 0 + if ctypes.get_errno() != 0: + raise IOError(f'errno = {os.strerror(ctypes.get_errno())}') + logger.log_debug(f'read EEPROM sfp={self.sdk_index}, page={page}, page_offset={page_offset}, '\ + f'size={read_length}, data={content}') + except (OSError, IOError) as e: + if log_on_error: + logger.log_warning(f'Failed to read sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, '\ + f'size={num_bytes}, offset={offset}, error = {e}') + return None - return bytearray(content) + return bytearray(result) # write eeprom specfic bytes beginning from offset with size as num_bytes def write_eeprom(self, offset, num_bytes, write_buffer): @@ -389,29 +404,37 @@ def write_eeprom(self, offset, num_bytes, write_buffer): logger.log_error("Error mismatch between buffer length and number of bytes to be written") return False - page_num, page, page_offset = self._get_page_and_page_offset(offset) - if not page: - return False + while num_bytes > 0: + page_num, page, page_offset = self._get_page_and_page_offset(offset) + if not page: + return False - try: - if self._is_write_protected(page_num, page_offset, num_bytes): - # write limited eeprom is not supported - raise IOError('write limited bytes') - - with open(page, mode='r+b', buffering=0) as f: - f.seek(page_offset) - ret = f.write(write_buffer[0:num_bytes]) - if ret != num_bytes: - raise IOError(f'write return code = {ret}') - if ctypes.get_errno() != 0: - raise IOError(f'errno = {os.strerror(ctypes.get_errno())}') - logger.log_debug(f'write EEPROM sfp={self.sdk_index}, page={page}, page_offset={page_offset}, \ - size={num_bytes}, data={write_buffer}') - except (OSError, IOError) as e: - data = ''.join('{:02x}'.format(x) for x in write_buffer) - logger.log_error(f'Failed to write EEPROM data sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, size={num_bytes}, \ - offset={offset}, data = {data}, error = {e}') - return False + try: + if self._is_write_protected(page_num, page_offset, num_bytes): + # write limited eeprom is not supported + raise IOError('write limited bytes') + with open(page, mode='r+b', buffering=0) as f: + f.seek(page_offset) + ret = f.write(write_buffer[0:num_bytes]) + written_buffer = write_buffer[0:ret] + if ret != num_bytes: + page_size = f.seek(0, os.SEEK_END) + if page_offset + ret == page_size: + # Move to next page + write_buffer = write_buffer[ret:num_bytes] + offset += ret + else: + raise IOError(f'write return code = {ret}') + num_bytes -= ret + if ctypes.get_errno() != 0: + raise IOError(f'errno = {os.strerror(ctypes.get_errno())}') + logger.log_debug(f'write EEPROM sfp={self.sdk_index}, page={page}, page_offset={page_offset}, '\ + f'size={ret}, left={num_bytes}, data={written_buffer}') + except (OSError, IOError) as e: + data = ''.join('{:02x}'.format(x) for x in write_buffer) + logger.log_error(f'Failed to write EEPROM data sfp={self.sdk_index} EEPROM page={page}, page_offset={page_offset}, size={num_bytes}, '\ + f'offset={offset}, data = {data}, error = {e}') + return False return True @classmethod diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 499983a01e15..748a9c7141b3 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -131,6 +131,17 @@ def test_sfp_write_eeprom(self, mock_limited_eeprom, mock_get_page): handle.write.side_effect = OSError('') assert not sfp.write_eeprom(0, 1, bytearray([1])) + mo = mock.mock_open() + print('after mock open') + with mock.patch('sonic_platform.sfp.open', mo): + handle = mo() + handle.write.side_effect = [128, 128, 64] + handle.seek.side_effect = [0, 128, 0, 128, 0] + bytes_to_write = bytearray([0]*128 + [1]*128 + [2]*64) + assert sfp.write_eeprom(0, 320, bytes_to_write) + expected_calls = [mock.call(bytes_to_write), mock.call(bytes_to_write[128:]), mock.call(bytes_to_write[256:])] + handle.write.assert_has_calls(expected_calls) + @mock.patch('sonic_platform.sfp.SFP._get_page_and_page_offset') def test_sfp_read_eeprom(self, mock_get_page): sfp = SFP(0) @@ -152,6 +163,13 @@ def test_sfp_read_eeprom(self, mock_get_page): handle.read.side_effect = OSError('') assert sfp.read_eeprom(0, 1) is None + mo = mock.mock_open() + with mock.patch('sonic_platform.sfp.open', mo): + handle = mo() + handle.read.side_effect = [b'\x00'*128, b'\x01'*128, b'\x02'*64] + handle.seek.side_effect = [0, 128, 0, 128, 0] + assert sfp.read_eeprom(0, 320) == bytearray([0]*128 + [1]*128 + [2]*64) + @mock.patch('sonic_platform.sfp.SFP._fetch_port_status') def test_is_port_admin_status_up(self, mock_port_status): mock_port_status.return_value = (0, True) From bbf4b86e67dd73cfdb249c3a539f23652246d94d Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Wed, 8 May 2024 01:41:51 +0800 Subject: [PATCH 053/282] [yang] Support ASIC/SDK health event (#17879) Support ASIC/SDK health event - Suppress ASIC/SDK health event configuration - New event Signed-off-by: Stephen Sun --- src/sonic-yang-models/doc/Configuration.md | 22 +++++ src/sonic-yang-models/setup.py | 1 + .../tests/files/sample_config_db.json | 6 ++ .../tests/sonic-events-swss.json | 14 +++ .../tests/suppress_asic_sdk_health_event.json | 23 +++++ .../tests_config/sonic-events-swss.json | 45 ++++++++- .../suppress_asic_sdk_health_event.json | 93 +++++++++++++++++++ .../yang-models/sonic-events-swss.yang | 36 +++++++ .../sonic-suppress-asic-sdk-health-event.yang | 59 ++++++++++++ 9 files changed, 298 insertions(+), 1 deletion(-) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/suppress_asic_sdk_health_event.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/suppress_asic_sdk_health_event.json create mode 100644 src/sonic-yang-models/yang-models/sonic-suppress-asic-sdk-health-event.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index bb0b2f87c630..37f193e1c5b9 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -13,6 +13,7 @@ Table of Contents * [ACL and Mirroring](#acl-and-mirroring) * [BGP BBR](#bgp-bbr) + * [ASIC SDK health event](#asic-sdk-health-event) * [BGP Device Global](#bgp-device-global) * [BGP Sessions](#bgp-sessions) * [BUFFER_PG](#buffer_pg) @@ -383,6 +384,27 @@ The **BGP_BBR** table contains device-level BBR state. } } ``` +### ASIC SDK health event + +ASIC/SDK health event related configuration is defined in **SUPPRESS_ASIC_SDK_HEALTH_EVENT** table. + +``` +"SUPPRESS_ASIC_SDK_HEALTH_EVENT": { + "notice": { + "categories": [ + "asic_hw" + ], + "max_events": "1000" + }, + "warning": { + "categories": [ + "software", + "cpu_hw" + ] + } +} +``` + ### BGP Device Global The **BGP_DEVICE_GLOBAL** table contains device-level BGP global state. diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index b1257f6eacab..6748bb137848 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -160,6 +160,7 @@ def run(self): './yang-models/sonic-routing-policy-sets.yang', './yang-models/sonic-sflow.yang', './yang-models/sonic-snmp.yang', + './yang-models/sonic-suppress-asic-sdk-health-event.yang', './yang-models/sonic-syslog.yang', './yang-models/sonic-system-aaa.yang', './yang-models/sonic-system-tacacs.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 33c9c265ad2d..71c957a545f9 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2539,6 +2539,12 @@ } }, + "SUPPRESS_ASIC_SDK_HEALTH_EVENT": { + "notice": { + "categories": ["firmware", "asic_hw"], + "max_events": "1024" + } + }, "SYSTEM_DEFAULTS": { "tunnel_qos_remap": { "status": "enabled" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json b/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json index 56a05d1736b3..a6c3d9332c08 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json @@ -92,5 +92,19 @@ }, "SONIC_EVENTS_SWSS_SELECT_OPERATION_FAILURE_VALID": { "desc": "VALID SELECT_OPERATION_FAILURE EVENT." + }, + "SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_VALID": { + "desc": "VALID ASIC_SDK_HEALTH EVENT." + }, + "SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_VALID_MASIC": { + "desc": "VALID ASIC_SDK_HEALTH EVENT." + }, + "SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_INVALID_SEVERITY": { + "desc": "ASIC_SDK_HEALTH_INVALID_SEVERITY failure.", + "eStrKey": "InvalidValue" + }, + "SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_INVALID_CATEGORY": { + "desc": "ASIC_SDK_HEALTH_INVALID_CATEGORY failure.", + "eStrKey": "InvalidValue" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/suppress_asic_sdk_health_event.json b/src/sonic-yang-models/tests/yang_model_tests/tests/suppress_asic_sdk_health_event.json new file mode 100644 index 000000000000..a96a95deb280 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/suppress_asic_sdk_health_event.json @@ -0,0 +1,23 @@ +{ + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_FATAL": { + "desc": "Load suppress ASIC/SDK health event list for fatal." + }, + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_WARNING": { + "desc": "Load suppress ASIC/SDK health event list for warning." + }, + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_NOTICE": { + "desc": "Load suppress ASIC/SDK health event list for notice." + }, + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_SEVERITY": { + "desc": "Load suppress ASIC/SDK health event list for notice.", + "eStrKey": "InvalidValue" + }, + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_NEGATIVE_MAX_EVENTS": { + "desc": "Load suppress ASIC/SDK health event list missing name.", + "eStrKey": "InvalidValue" + }, + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_MAX_EVENTS": { + "desc": "Load suppress ASIC/SDK health event list missing name.", + "eStrKey": "InvalidValue" + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json index 919468dcbc7d..1c2dcaa4ce7e 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json @@ -244,7 +244,7 @@ } } }, - "SONIC_EVENTS_SWSS_SELECT_OPERATION_FAILURE_VALID": { + "SONIC_EVENTS_SWSS_SELECT_OPERATION_FAILURE_VALID": { "sonic-events-swss:sonic-events-swss": { "sonic-events-swss:select-operation-failure": { "operation_result": "operation_result", @@ -252,5 +252,48 @@ "timestamp": "1985-04-12T23:20:50.52Z" } } + }, + "SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_VALID": { + "sonic-events-swss:sonic-events-swss": { + "sonic-events-swss:asic-sdk-health-event": { + "severity": "fatal", + "category": "asic_hw", + "description": "\ndescription\n", + "timestamp": "1985-04-12T23:20:50.52Z", + "sai_timestamp": "1985-04-12 23:20:50" + } + } + }, + "SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_VALID_MASIC": { + "sonic-events-swss:sonic-events-swss": { + "sonic-events-swss:asic-sdk-health-event": { + "severity": "fatal", + "category": "asic_hw", + "asic_name": "asic0", + "description": "\ndescription\n", + "timestamp": "1985-04-12T23:20:50.52Z", + "sai_timestamp": "1985-04-12 23:20:50" + } + } + }, + "SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_INVALID_SEVERITY": { + "sonic-events-swss:sonic-events-swss": { + "sonic-events-swss:asic-sdk-health-event": { + "severity": "unknown", + "category": "asic_hw", + "description": "\ndescription\n", + "timestamp": "1985-04-12T23:20:50.52Z" + } + } + }, + "SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_INVALID_CATEGORY": { + "sonic-events-swss:sonic-events-swss": { + "sonic-events-swss:asic-sdk-health-event": { + "severity": "fatal", + "category": "unknown", + "description": "\ndescription\n", + "timestamp": "1985-04-12T23:20:50.52Z" + } + } } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/suppress_asic_sdk_health_event.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/suppress_asic_sdk_health_event.json new file mode 100644 index 000000000000..452d12f10530 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/suppress_asic_sdk_health_event.json @@ -0,0 +1,93 @@ +{ + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_FATAL": { + "sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": { + "sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": { + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [ + { + "severity": "fatal", + "categories": ["software","firmware"] + } + ] + } + } + }, + + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_WARNING": { + "sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": { + "sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": { + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [ + { + "severity": "warning", + "categories": ["asic_hw","cpu_hw"] + } + ] + } + } + }, + + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_NOTICE": { + "sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": { + "sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": { + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [ + { + "severity": "notice", + "categories": ["software","firmware","cpu_hw","asic_hw"], + "max_events": "100" + } + ] + } + } + }, + + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_SEVERITY": { + "sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": { + "sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": { + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [ + { + "severity": "unknown", + "categories": ["software","firmware","cpu_hw","asic_hw"] + } + ] + } + } + }, + + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_CATEGORY": { + "sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": { + "sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": { + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [ + { + "severity": "notice", + "categories": ["software","unknown","cpu_hw","asic_hw"] + } + ] + } + } + }, + + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_NEGATIVE_MAX_EVENTS": { + "sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": { + "sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": { + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [ + { + "severity": "notice", + "max_events": "-1" + } + ] + } + } + }, + + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_MAX_EVENTS": { + "sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": { + "sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": { + "SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [ + { + "severity": "notice", + "max_events": "NaN" + } + ] + } + } + } +} diff --git a/src/sonic-yang-models/yang-models/sonic-events-swss.yang b/src/sonic-yang-models/yang-models/sonic-events-swss.yang index 4092fe42d2f6..66242d2ecd78 100644 --- a/src/sonic-yang-models/yang-models/sonic-events-swss.yang +++ b/src/sonic-yang-models/yang-models/sonic-events-swss.yang @@ -148,5 +148,41 @@ module sonic-events-swss { uses evtcmn:sonic-events-cmn; } + + container asic-sdk-health-event { + evtcmn:ALARM_SEVERITY_MAJOR; + description + "Declares an event for ASIC/SDK health event."; + leaf asic_name { + type string { + pattern 'asic[0-9]{1,2}'; + } + } + leaf severity { + type enumeration { + enum fatal; + enum warning; + enum notice; + } + } + leaf category { + type enumeration { + enum software; + enum firmware; + enum cpu_hw; + enum asic_hw; + } + } + leaf description { + type string; + } + leaf sai_timestamp { + type string { + pattern '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}'; + } + } + + uses evtcmn:sonic-events-cmn; + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-suppress-asic-sdk-health-event.yang b/src/sonic-yang-models/yang-models/sonic-suppress-asic-sdk-health-event.yang new file mode 100644 index 000000000000..650911cc8261 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-suppress-asic-sdk-health-event.yang @@ -0,0 +1,59 @@ +module sonic-suppress-asic-sdk-health-event { + + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-suppress-asic-sdk-health-event"; + + prefix sch; + + organization + "SONiC"; + + contact + "SONiC"; + + description + "Suppress ASIC/SDK health event yang Module for SONiC OS"; + + revision 2023-11-29 { + description + "Initial revision"; + } + + container sonic-suppress-asic-sdk-health-event { + + container SUPPRESS_ASIC_SDK_HEALTH_EVENT { + + description "SUPPRESS_ASIC_SDK_HEALTH_EVENT part of config_db.json"; + + list SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST { + + key "severity"; + + leaf severity { + type enumeration { + enum fatal; + enum warning; + enum notice; + } + description "Severity of the ASIC/SDK health event to suppress"; + } + + leaf max_events { + type uint32; + description "Maximum of events that can be stored in the database"; + } + + leaf-list categories { + type enumeration { + enum software; + enum firmware; + enum cpu_hw; + enum asic_hw; + } + description "Category of the ASIC/SDK health event to suppress"; + } + } + } + } +} From 9e2da6d6a8937e6ae497d49b25fd99dd9cafcad0 Mon Sep 17 00:00:00 2001 From: Sai Kiran <110003254+opcoder0@users.noreply.github.com> Date: Wed, 8 May 2024 11:47:01 +1000 Subject: [PATCH 054/282] [sonic-slave]: Add remake to debug makefiles (#18891) Remake supports GDB style debugging for makefiles making it easier to traverse complicated makefiles and stepping through builds Running remake from inside the slave container. For instance, running remake with the -X option starts the debugger. remake -X -f slave.mk PLATFORM=vs ... EXTRA_DOCKER_TARGETS=docker-ptf.gz buster --- sonic-slave-bookworm/Dockerfile.j2 | 1 + sonic-slave-bullseye/Dockerfile.j2 | 1 + sonic-slave-buster/Dockerfile.j2 | 1 + 3 files changed, 3 insertions(+) diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 9706510cb07b..b0efe041e9dd 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -91,6 +91,7 @@ RUN apt-get update && apt-get install -y \ {{ GZ_COMPRESS_PROGRAM }} \ git \ build-essential \ + remake \ libtool \ lintian \ sudo \ diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 7bcf438cca82..4ff550aca554 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -97,6 +97,7 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install {{ GZ_COMPRESS_PROGRAM }} \ git \ build-essential \ + remake \ libtool \ lintian \ sudo \ diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 5b2146eedbe6..ac4108fac0b9 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -93,6 +93,7 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install {{ GZ_COMPRESS_PROGRAM }} \ git \ build-essential \ + remake \ libtool \ lintian \ sudo \ From 50b4fb615ade819cf476722651b8c83b430050a4 Mon Sep 17 00:00:00 2001 From: Jon Goldberg <63672455+jon-nokia@users.noreply.github.com> Date: Tue, 7 May 2024 21:49:06 -0400 Subject: [PATCH 055/282] [Nokia-IXR7250E] disable pcie aer (#18864) In Linux kernel v6.0, commit, f26e58bf6f5470 "PCI/AER: Enable error reporting when AER is native" changed the default behavior of Advanced Error Reporting (AER). Reporting is now enabled by default, which was not the case prior. There are custom FPGA devices on our PCI bus that are not yet configured nor enabled across reboot until the Sonic platform is initialized. Therefore this is impacting AER adversely. Since AER was not enabled in 202205, this is not a regression. --- device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/installer.conf | 2 +- device/nokia/x86_64-nokia_ixr7250e_sup-r0/installer.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/installer.conf b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/installer.conf index 7580ad94c4cf..e0202983daca 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/installer.conf +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/installer.conf @@ -1,4 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="amd_iommu=off pci=resource_alignment=48@00:03.1" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="amd_iommu=off pci=resource_alignment=48@00:03.1 pci=noaer" diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/installer.conf b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/installer.conf index 6b58d6663580..2578a7d28beb 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/installer.conf +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/installer.conf @@ -1,4 +1,4 @@ CONSOLE_PORT=0x2f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="amd_iommu=off pci=resource_alignment=26@00:01.4" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="amd_iommu=off pci=resource_alignment=26@00:01.4 pci=noaer" From d07a83e4be072577f027c7884209081f28cc9e6a Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Wed, 8 May 2024 12:02:08 +0800 Subject: [PATCH 056/282] [YANG] Add valid v6 address to sonic-dhcp-sever.yang (#18690) #### Why I did it The PR is to allow v6 address in DHCP_SERVER table which was generated from PROD minigraph. This is to pass the YANG validation. #### How I did it Replace ipv4-address with ip-address which is a union of ipv4-address nad ipv6-address #### How to verify it Unit test --- src/sonic-yang-models/tests/files/sample_config_db.json | 3 ++- .../tests/yang_model_tests/tests_config/dhcp_server.json | 6 ++++++ src/sonic-yang-models/yang-models/sonic-dhcp-server.yang | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 71c957a545f9..9dc0b75e0c07 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -7,7 +7,8 @@ }, "DHCP_SERVER": { "192.0.0.8": {}, - "192.0.0.8": {} + "192.0.0.8": {}, + "2603:10e1:0:6f4::1": {} }, "DNS_NAMESERVER": { "1.1.1.1": {}, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server.json index 9fb7ccce99f8..36bf89af1f43 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server.json @@ -8,6 +8,12 @@ }, { "ip": "10.1.9.2" + }, + { + "ip": "2603:10e1:0:6f4::1" + }, + { + "ip": "2603:10e1:0:6f5::1" } ] } diff --git a/src/sonic-yang-models/yang-models/sonic-dhcp-server.yang b/src/sonic-yang-models/yang-models/sonic-dhcp-server.yang index 0ca5e8636c91..5f5039ae2dfc 100644 --- a/src/sonic-yang-models/yang-models/sonic-dhcp-server.yang +++ b/src/sonic-yang-models/yang-models/sonic-dhcp-server.yang @@ -40,7 +40,7 @@ module sonic-dhcp-server { leaf ip { description "IP as DHCP_SERVER"; - type inet:ipv4-address; + type inet:ip-address; } } /* end of list IPS_LIST */ From 1e6b1b57a40aac0e1a1e160e4e7392f28656589f Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 8 May 2024 19:01:04 +0800 Subject: [PATCH 057/282] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#18903) #### Why I did it src/sonic-swss-common ``` * 4b23970 - (HEAD -> master, origin/master, origin/HEAD) [Banner] Added BANNER_MESSAGE table to ConfigDB (#826) (16 hours ago) [SviatoslavBoichuk] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 5a737927d3fb..4b23970a0bc3 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 5a737927d3fb5763eba2f8b4cdcb89d43590c8df +Subproject commit 4b23970a0bc30ef66ff6825182a29886d9b253a6 From 485d9e9c0a39af96e29f6391dc6f480b17b1b4fa Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 8 May 2024 19:01:09 +0800 Subject: [PATCH 058/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18901) #### Why I did it src/sonic-swss ``` * 837e4675 - (HEAD -> master, origin/master, origin/HEAD) Remove unwanted newline character at end of timestamp (#3111) (10 hours ago) [arista-nwolfe] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 2e6c5b209d57..837e46757756 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 2e6c5b209d575f73b867de9f3e56b3be4066acec +Subproject commit 837e46757756dc07fd5840678fa73e8c27abaf20 From aeaa17da0bcec6c6ffe5a62ac1cf77a46a8f8906 Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Thu, 9 May 2024 12:19:52 +0800 Subject: [PATCH 059/282] [rsyslog] Include high-precision rfc3339 timestamps in messages from rsyslog (#18699) #### Why I did it Include high-precision rfc3339 timestamps in forwarded messages from rsyslog #### How I did it Create new template for rsyslog that better for kusto to parse with millisec. Before: `<13>Sep 14 22:24:43 PHX70-0101-1019-04T0 pmon#CCmisApi: forwarding state RPC received response port = Ethernet16 portids [0, 1] read_side 1` After: `<12>2023-09-14T22:25:03.853194+00:00 PHX70-0101-1019-04T0 WARNING pmon#CCmisApi: Could not retreive fieldvalue pairs for Ethernet24, inside config_db table MUX_CABLE` #### How to verify it Add unit test. Manual test: create syslog server using CLI/adding to Redis-DB verify server is added to file /etc/rsyslog.conf and server is functional. --- files/image_config/rsyslog/rsyslog.conf.j2 | 6 +- .../tests/data/rsyslog/config_db.json | 914 ++++++++++++++++++ src/sonic-config-engine/tests/test_j2files.py | 16 + 3 files changed, 934 insertions(+), 2 deletions(-) create mode 100644 src/sonic-config-engine/tests/data/rsyslog/config_db.json diff --git a/files/image_config/rsyslog/rsyslog.conf.j2 b/files/image_config/rsyslog/rsyslog.conf.j2 index f6d480494091..52096784c320 100644 --- a/files/image_config/rsyslog/rsyslog.conf.j2 +++ b/files/image_config/rsyslog/rsyslog.conf.j2 @@ -53,6 +53,8 @@ $UDPServerRun 514 # Define a custom template $template SONiCFileFormat,"%timegenerated%.%timegenerated:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" $ActionFileDefaultTemplate SONiCFileFormat +$template SONiCForwardFormat,"<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +$ActionForwardDefaultTemplate SONiCForwardFormat template(name="WelfRemoteFormat" type="string" string="%TIMESTAMP% id=firewall time=\"%timereported\ :::date-year%-%timereported:::date-month%-%timereported:::date-day% %timereported:::date-hour%:%timereported:::date-minute%:%timereported\ @@ -102,13 +104,13 @@ $RepeatedMsgReduction on {% set port = conf.get('port', 514) -%} {% set proto = conf.get('protocol', 'udp') -%} {% set vrf = conf.get('vrf', 'default') -%} -{% set severity = conf.get('severity', gconf.get('severity', 'notice')) -%} +{% set severity = conf.get('severity', gconf.get('severity', '*')) -%} {% set filter = conf.get('filter') -%} {% set regex = conf.get('filter_regex') -%} {% set fmodifier = '!' if filter == 'exclude' else '' %} {% set device = vrf if vrf != '' and vrf != 'default' -%} -{% set template = 'WelfRemoteFormat' if format == 'welf' else 'SONiCFileFormat' -%} +{% set template = 'WelfRemoteFormat' if format == 'welf' else 'SONiCForwardFormat' -%} {# Server extra options -#} {% set options = '' -%} diff --git a/src/sonic-config-engine/tests/data/rsyslog/config_db.json b/src/sonic-config-engine/tests/data/rsyslog/config_db.json new file mode 100644 index 000000000000..74f7f8ecbed5 --- /dev/null +++ b/src/sonic-config-engine/tests/data/rsyslog/config_db.json @@ -0,0 +1,914 @@ +{ + "AUTO_TECHSUPPORT_FEATURE": { + "acms": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "bgp": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "database": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "dhcp_relay": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "lldp": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "macsec": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "mux": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "pmon": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "radv": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "restapi": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "snmp": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "swss": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "syncd": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "teamd": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "telemetry": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + }, + "vnet-monitor": { + "available_mem_threshold": "10.0", + "rate_limit_interval": "600", + "state": "enabled" + } + }, + "BGP_NEIGHBOR": { + "10.0.0.57": { + "admin_status": "up", + "asn": "64600", + "holdtime": "10", + "keepalive": "3", + "local_addr": "10.0.0.56", + "name": "ARISTA01T1", + "nhopself": "0", + "rrclient": "0" + }, + "10.0.0.59": { + "admin_status": "up", + "asn": "64600", + "holdtime": "10", + "keepalive": "3", + "local_addr": "10.0.0.58", + "name": "ARISTA02T1", + "nhopself": "0", + "rrclient": "0" + }, + "10.0.0.61": { + "admin_status": "up", + "asn": "64600", + "holdtime": "10", + "keepalive": "3", + "local_addr": "10.0.0.60", + "name": "ARISTA03T1", + "nhopself": "0", + "rrclient": "0" + }, + "10.0.0.63": { + "admin_status": "up", + "asn": "64600", + "holdtime": "10", + "keepalive": "3", + "local_addr": "10.0.0.62", + "name": "ARISTA04T1", + "nhopself": "0", + "rrclient": "0" + }, + "fc00::7a": { + "admin_status": "up", + "asn": "64600", + "holdtime": "10", + "keepalive": "3", + "local_addr": "fc00::79", + "name": "ARISTA03T1", + "nhopself": "0", + "rrclient": "0" + }, + "fc00::7e": { + "admin_status": "up", + "asn": "64600", + "holdtime": "10", + "keepalive": "3", + "local_addr": "fc00::7d", + "name": "ARISTA04T1", + "nhopself": "0", + "rrclient": "0" + }, + "fc00::72": { + "admin_status": "up", + "asn": "64600", + "holdtime": "10", + "keepalive": "3", + "local_addr": "fc00::71", + "name": "ARISTA01T1", + "nhopself": "0", + "rrclient": "0" + }, + "fc00::76": { + "admin_status": "up", + "asn": "64600", + "holdtime": "10", + "keepalive": "3", + "local_addr": "fc00::75", + "name": "ARISTA02T1", + "nhopself": "0", + "rrclient": "0" + } + }, + "CONSOLE_SWITCH": { + "console_mgmt": { + "enabled": "no" + } + }, + "DEVICE_METADATA": { + "localhost": { + "bgp_asn": "65100", + "buffer_model": "traditional", + "cloudtype": "Public", + "default_bgp_status": "down", + "default_pfcwd_status": "enable", + "deployment_id": "1", + "docker_routing_config_mode": "separated", + "hostname": "kvm-host", + "hwsku": "Mellanox-SN2700", + "mac": "98:03:9B:F6:02:80", + "platform": "x86_64-mlnx_msn2700-r0", + "region": "None", + "synchronous_mode": "enable", + "type": "ToRRouter" + } + }, + "DEVICE_NEIGHBOR": { + "Ethernet112": { + "name": "ARISTA01T1", + "port": "Ethernet1" + }, + "Ethernet116": { + "name": "ARISTA02T1", + "port": "Ethernet1" + }, + "Ethernet120": { + "name": "ARISTA03T1", + "port": "Ethernet1" + }, + "Ethernet124": { + "name": "ARISTA04T1", + "port": "Ethernet1" + } + }, + "DEVICE_NEIGHBOR_METADATA": { + "ARISTA01T1": { + "hwsku": "Arista-VM", + "mgmt_addr": "172.16.190.114", + "type": "LeafRouter" + }, + "ARISTA02T1": { + "hwsku": "Arista-VM", + "mgmt_addr": "172.16.190.115", + "type": "LeafRouter" + }, + "ARISTA03T1": { + "hwsku": "Arista-VM", + "mgmt_addr": "172.16.190.116", + "type": "LeafRouter" + }, + "ARISTA04T1": { + "hwsku": "Arista-VM", + "mgmt_addr": "172.16.190.117", + "type": "LeafRouter" + } + }, + "DHCP_RELAY": { + "Vlan1000": { + "dhcpv6_servers": [ + "fc02:2000::1", + "fc02:2000::2", + "fc02:2000::3", + "fc02:2000::4" + ] + } + }, + "DHCP_SERVER": { + "192.0.0.1": {}, + "192.0.0.2": {}, + "192.0.0.3": {}, + "192.0.0.4": {} + }, + "FEATURE": { + "acms": { + "auto_restart": "enabled", + "has_global_scope": "True", + "has_per_asic_scope": "False", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "enabled" + }, + "bgp": { + "auto_restart": "enabled", + "check_up_status": "false", + "has_global_scope": "False", + "has_per_asic_scope": "True", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "enabled" + }, + "database": { + "auto_restart": "always_enabled", + "has_global_scope": "True", + "has_per_asic_scope": "True", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "always_enabled" + }, + "dhcp_relay": { + "auto_restart": "enabled", + "has_global_scope": "True", + "has_per_asic_scope": "False", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "enabled" + }, + "lldp": { + "auto_restart": "enabled", + "has_global_scope": "True", + "has_per_asic_scope": "True", + "delayed": "True", + "high_mem_alert": "disabled", + "set_owner": "kube", + "state": "enabled" + }, + "macsec": { + "auto_restart": "enabled", + "has_global_scope": "False", + "has_per_asic_scope": "True", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "disabled" + }, + "mux": { + "auto_restart": "enabled", + "has_global_scope": "True", + "has_per_asic_scope": "False", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "always_disabled" + }, + "pmon": { + "auto_restart": "enabled", + "check_up_status": "false", + "has_global_scope": "True", + "has_per_asic_scope": "False", + "delayed": "True", + "high_mem_alert": "disabled", + "set_owner": "kube", + "state": "enabled" + }, + "radv": { + "auto_restart": "enabled", + "has_global_scope": "True", + "has_per_asic_scope": "False", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "kube", + "state": "enabled" + }, + "restapi": { + "auto_restart": "enabled", + "has_global_scope": "True", + "has_per_asic_scope": "False", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "enabled" + }, + "snmp": { + "auto_restart": "enabled", + "has_global_scope": "True", + "has_per_asic_scope": "False", + "delayed": "True", + "high_mem_alert": "disabled", + "set_owner": "kube", + "state": "enabled" + }, + "swss": { + "auto_restart": "enabled", + "check_up_status": "false", + "has_global_scope": "False", + "has_per_asic_scope": "True", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "enabled" + }, + "syncd": { + "auto_restart": "enabled", + "has_global_scope": "False", + "has_per_asic_scope": "True", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "enabled" + }, + "teamd": { + "auto_restart": "enabled", + "has_global_scope": "False", + "has_per_asic_scope": "True", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "enabled" + }, + "telemetry": { + "auto_restart": "enabled", + "has_global_scope": "True", + "has_per_asic_scope": "False", + "delayed": "True", + "high_mem_alert": "disabled", + "set_owner": "kube", + "state": "enabled" + }, + "vnet-monitor": { + "auto_restart": "enabled", + "has_global_scope": "True", + "has_per_asic_scope": "False", + "delayed": "False", + "high_mem_alert": "disabled", + "set_owner": "local", + "state": "disabled" + } + }, + "FLEX_COUNTER_TABLE": { + "ACL": { + "FLEX_COUNTER_DELAY_STATUS": "false", + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "10000" + } + }, + "KDUMP": { + "config": { + "enabled": "false", + "memory": "0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M", + "num_dumps": "3" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback0": {}, + "Loopback0|10.1.0.32/32": {}, + "Loopback0|FC00:1::32/128": {} + }, + "MGMT_INTERFACE": { + "eth0|10.150.22.115/23": { + "gwaddr": "10.150.22.1" + }, + "eth0|2404:f801:10:2200::a96:1673/64": { + "gwaddr": "2404:f801:10:2200::1" + } + }, + "MGMT_PORT": { + "eth0": { + "admin_status": "up", + "alias": "eth0" + } + }, + "PORT": { + "Ethernet0": { + "alias": "etp1", + "description": "etp1", + "fec": "rs", + "index": "1", + "lanes": "0,1,2,3", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet4": { + "admin_status": "up", + "alias": "etp2", + "description": "Servers0:eth0", + "fec": "rs", + "index": "2", + "lanes": "4,5,6,7", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet8": { + "admin_status": "up", + "alias": "etp3", + "description": "Servers1:eth0", + "fec": "rs", + "index": "3", + "lanes": "8,9,10,11", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet12": { + "admin_status": "up", + "alias": "etp4", + "description": "Servers2:eth0", + "fec": "rs", + "index": "4", + "lanes": "12,13,14,15", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet16": { + "admin_status": "up", + "alias": "etp5", + "description": "Servers3:eth0", + "fec": "rs", + "index": "5", + "lanes": "16,17,18,19", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet20": { + "admin_status": "up", + "alias": "etp6", + "description": "Servers4:eth0", + "fec": "rs", + "index": "6", + "lanes": "20,21,22,23", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet24": { + "admin_status": "up", + "alias": "etp7", + "description": "Servers5:eth0", + "fec": "rs", + "index": "7", + "lanes": "24,25,26,27", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet28": { + "admin_status": "up", + "alias": "etp8", + "description": "Servers6:eth0", + "fec": "rs", + "index": "8", + "lanes": "28,29,30,31", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet32": { + "admin_status": "up", + "alias": "etp9", + "description": "Servers7:eth0", + "fec": "rs", + "index": "9", + "lanes": "32,33,34,35", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet36": { + "admin_status": "up", + "alias": "etp10", + "description": "Servers8:eth0", + "fec": "rs", + "index": "10", + "lanes": "36,37,38,39", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet40": { + "admin_status": "up", + "alias": "etp11", + "description": "Servers9:eth0", + "fec": "rs", + "index": "11", + "lanes": "40,41,42,43", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet44": { + "admin_status": "up", + "alias": "etp12", + "description": "Servers10:eth0", + "fec": "rs", + "index": "12", + "lanes": "44,45,46,47", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet48": { + "admin_status": "up", + "alias": "etp13", + "description": "Servers11:eth0", + "fec": "rs", + "index": "13", + "lanes": "48,49,50,51", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet52": { + "admin_status": "up", + "alias": "etp14", + "description": "Servers12:eth0", + "fec": "rs", + "index": "14", + "lanes": "52,53,54,55", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet56": { + "admin_status": "up", + "alias": "etp15", + "description": "Servers13:eth0", + "fec": "rs", + "index": "15", + "lanes": "56,57,58,59", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet60": { + "admin_status": "up", + "alias": "etp16", + "description": "Servers14:eth0", + "fec": "rs", + "index": "16", + "lanes": "60,61,62,63", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet64": { + "admin_status": "up", + "alias": "etp17", + "description": "Servers15:eth0", + "fec": "rs", + "index": "17", + "lanes": "64,65,66,67", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet68": { + "admin_status": "up", + "alias": "etp18", + "description": "Servers16:eth0", + "fec": "rs", + "index": "18", + "lanes": "68,69,70,71", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet72": { + "admin_status": "up", + "alias": "etp19", + "description": "Servers17:eth0", + "fec": "rs", + "index": "19", + "lanes": "72,73,74,75", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet76": { + "admin_status": "up", + "alias": "etp20", + "description": "Servers18:eth0", + "fec": "rs", + "index": "20", + "lanes": "76,77,78,79", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet80": { + "admin_status": "up", + "alias": "etp21", + "description": "Servers19:eth0", + "fec": "rs", + "index": "21", + "lanes": "80,81,82,83", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet84": { + "admin_status": "up", + "alias": "etp22", + "description": "Servers20:eth0", + "fec": "rs", + "index": "22", + "lanes": "84,85,86,87", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet88": { + "admin_status": "up", + "alias": "etp23", + "description": "Servers21:eth0", + "fec": "rs", + "index": "23", + "lanes": "88,89,90,91", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet92": { + "admin_status": "up", + "alias": "etp24", + "description": "Servers22:eth0", + "fec": "rs", + "index": "24", + "lanes": "92,93,94,95", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet96": { + "admin_status": "up", + "alias": "etp25", + "description": "Servers23:eth0", + "fec": "rs", + "index": "25", + "lanes": "96,97,98,99", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet100": { + "alias": "etp26", + "description": "etp26", + "fec": "rs", + "index": "26", + "lanes": "100,101,102,103", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet104": { + "alias": "etp27", + "description": "etp27", + "fec": "rs", + "index": "27", + "lanes": "104,105,106,107", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet108": { + "alias": "etp28", + "description": "etp28", + "fec": "rs", + "index": "28", + "lanes": "108,109,110,111", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet112": { + "admin_status": "up", + "alias": "etp29", + "description": "ARISTA01T1:Ethernet1", + "fec": "rs", + "index": "29", + "lanes": "112,113,114,115", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet116": { + "admin_status": "up", + "alias": "etp30", + "description": "ARISTA02T1:Ethernet1", + "fec": "rs", + "index": "30", + "lanes": "116,117,118,119", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet120": { + "admin_status": "up", + "alias": "etp31", + "description": "ARISTA03T1:Ethernet1", + "fec": "rs", + "index": "31", + "lanes": "120,121,122,123", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + }, + "Ethernet124": { + "admin_status": "up", + "alias": "etp32", + "description": "ARISTA04T1:Ethernet1", + "fec": "rs", + "index": "32", + "lanes": "124,125,126,127", + "mtu": "9100", + "pfc_asym": "off", + "speed": "100000", + "tpid": "0x8100" + } + }, + "PORTCHANNEL": { + "PortChannel101": { + "admin_status": "up", + "lacp_key": "auto", + "min_links": "1", + "mtu": "9100", + "tpid": "0x8100" + }, + "PortChannel102": { + "admin_status": "up", + "lacp_key": "auto", + "min_links": "1", + "mtu": "9100", + "tpid": "0x8100" + }, + "PortChannel103": { + "admin_status": "up", + "lacp_key": "auto", + "min_links": "1", + "mtu": "9100", + "tpid": "0x8100" + }, + "PortChannel104": { + "admin_status": "up", + "lacp_key": "auto", + "min_links": "1", + "mtu": "9100", + "tpid": "0x8100" + } + }, + "PORTCHANNEL_INTERFACE": { + "PortChannel101": {}, + "PortChannel101|10.0.0.56/31": {}, + "PortChannel101|FC00::71/126": {}, + "PortChannel102": {}, + "PortChannel102|10.0.0.58/31": {}, + "PortChannel102|FC00::75/126": {}, + "PortChannel103": {}, + "PortChannel103|10.0.0.60/31": {}, + "PortChannel103|FC00::79/126": {}, + "PortChannel104": {}, + "PortChannel104|10.0.0.62/31": {}, + "PortChannel104|FC00::7D/126": {} + }, + "PORTCHANNEL_MEMBER": { + "PortChannel101|Ethernet112": {}, + "PortChannel102|Ethernet116": {}, + "PortChannel103|Ethernet120": {}, + "PortChannel104|Ethernet124": {} + }, + "SNMP": { + "LOCATION": { + "Location": "public" + } + }, + "SNMP_COMMUNITY": { + "public": { + "TYPE": "RO" + } + }, + "SYSLOG_SERVER": { + "10.150.22.222": {} + }, + "VERSIONS": { + "DATABASE": { + "VERSION": "version_3_0_7" + } + }, + "VLAN": { + "Vlan1000": { + "dhcp_servers": [ + "192.0.0.1", + "192.0.0.2", + "192.0.0.3", + "192.0.0.4" + ], + "dhcpv6_servers": [ + "fc02:2000::1", + "fc02:2000::2", + "fc02:2000::3", + "fc02:2000::4" + ], + "vlanid": "1000" + } + }, + "VLAN_INTERFACE": { + "Vlan1000": {}, + "Vlan1000|192.168.0.1/21": {}, + "Vlan1000|fc02:1000::1/64": {} + }, + "VLAN_MEMBER": { + "Vlan1000|Ethernet4": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet8": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet12": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet16": { + "tagging_mode": "untagged" + } + } +} + diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 49b4a1d00427..b83926d4c9e6 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -2,6 +2,7 @@ import os import shutil import subprocess +import re from unittest import TestCase import tests.common_utils as utils @@ -744,6 +745,21 @@ def test_dns_template_render(self): def test_buffers_edgezone_aggregator_render_template(self): self._test_buffers_render_template('arista', 'x86_64-arista_7060_cx32s', 'Arista-7060CX-32S-D48C8', 'sample-arista-7060-t0-minigraph.xml', 'buffers.json.j2', 'buffer-arista7060-t0.json') + def test_rsyslog_conf(self): + if utils.PYvX_DIR != 'py3': + # Skip on python2 as the change will not be backported to previous version + return + + conf_template = os.path.join(self.test_dir, '..', '..', '..', 'files', 'image_config', 'rsyslog', 'rsyslog.conf.j2') + config_db_json = os.path.join(self.test_dir, "data", "rsyslog", "config_db.json") + additional_data = "{\"udp_server_ip\": \"10.150.22.222\", \"hostname\": \"kvm-host\"}" + + argument = ['-j', config_db_json, '-t', conf_template, '-a', additional_data] + self.run_script(argument, output_file=self.output_file) + with open(self.output_file) as file: + pattern = r'^action.*Device="eth0".*' + for line in file: + assert not bool(re.match(pattern, line.strip())), "eth0 is not allowed in Mgfx device" def tearDown(self): os.environ["CFGGEN_UNIT_TESTING"] = "" From ed27daffa8add00895f44749b6e4c373535cd437 Mon Sep 17 00:00:00 2001 From: Pavan Naregundi Date: Mon, 18 Mar 2024 11:04:34 +0000 Subject: [PATCH 060/282] Add support for rd98DX35xx platform Add following variant of rd98DX35xx board to marvell platform build. Board with external x86_64 CPU connected over PCI to 98DX35xx switching chip: Platform: x86_64-marvell_rd98DX35xx-r0 HwSKU: rd98DX35xx ASIC: marvell Port Config: 32x1G + 16x2.5G + 6x25G Signed-off-by: Pavan Naregundi --- platform/marvell/mrvl-prestera | 2 +- platform/marvell/one-image.mk | 2 ++ platform/marvell/platform-marvell.mk | 8 ++++++++ platform/marvell/sonic-platform-marvell | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/platform/marvell/mrvl-prestera b/platform/marvell/mrvl-prestera index b7a14a93b21c..5834b7338ff9 160000 --- a/platform/marvell/mrvl-prestera +++ b/platform/marvell/mrvl-prestera @@ -1 +1 @@ -Subproject commit b7a14a93b21c099fab6b53f5fc4917ca0eb9b6c9 +Subproject commit 5834b7338ff9ac6f03d45ab85568048be1f62199 diff --git a/platform/marvell/one-image.mk b/platform/marvell/one-image.mk index 155662aa66e5..d7faa90c2ee9 100644 --- a/platform/marvell/one-image.mk +++ b/platform/marvell/one-image.mk @@ -16,6 +16,8 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(NOKIA_7215_PLATFORM) \ else ifeq ($(CONFIGURED_ARCH),armhf) $(SONIC_ONE_IMAGE)_INSTALLS += $(MRVL_PRESTERA_DEB) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(NOKIA_7215_PLATFORM) +else ifeq ($(CONFIGURED_ARCH),amd64) +$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(AC5X_RD98DX35xx_PLATFORM) endif ifeq ($(INSTALL_DEBUG_TOOLS),y) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) diff --git a/platform/marvell/platform-marvell.mk b/platform/marvell/platform-marvell.mk index 9dffbf5e5bf8..b58814f489f9 100644 --- a/platform/marvell/platform-marvell.mk +++ b/platform/marvell/platform-marvell.mk @@ -15,4 +15,12 @@ AC5X_RD98DX35xxCN9131_PLATFORM = sonic-platform-rd98dx35xx-cn9131_$(AC5X_RD98DX3 $(AC5X_RD98DX35xxCN9131_PLATFORM)_PLATFORM = arm64-marvell_rd98DX35xx_cn9131-r0 $(eval $(call add_extra_package,$(AC5X_RD98DX35xx_PLATFORM),$(AC5X_RD98DX35xxCN9131_PLATFORM))) +else ifeq ($(CONFIGURED_ARCH),amd64) + +AC5X_RD98DX35xx_PLATFORM = sonic-platform-rd98dx35xx-x86_$(AC5X_RD98DX35xx_PLATFORM_MODULE_VERSION)_$(CONFIGURED_ARCH).deb +$(AC5X_RD98DX35xx_PLATFORM)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-marvell +$(AC5X_RD98DX35xx_PLATFORM)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(AC5X_RD98DX35xx_PLATFORM)_PLATFORM = x86_64-marvell_rd98DX35xx-r0 +SONIC_DPKG_DEBS += $(AC5X_RD98DX35xx_PLATFORM) + endif diff --git a/platform/marvell/sonic-platform-marvell b/platform/marvell/sonic-platform-marvell index 078a6fff30f3..be63e9c4b330 160000 --- a/platform/marvell/sonic-platform-marvell +++ b/platform/marvell/sonic-platform-marvell @@ -1 +1 @@ -Subproject commit 078a6fff30f3af786aae1208588030a3fcfe0876 +Subproject commit be63e9c4b330fd5eabfc5c694fe0231cf25b4425 From 8ef597a4656ea0c648e1d33b21f06021539faca4 Mon Sep 17 00:00:00 2001 From: Pavan Naregundi Date: Mon, 22 Apr 2024 03:52:08 +0000 Subject: [PATCH 061/282] Add support for falcon platforms Add following three variant of Falcon DB board to marvell platform build. Board with external x86_64 CPU connected over PCI to 98CX8580 switching chip: Platform: x86_64-marvell_db98cx8580_32cd-r0 HwSKU: db98cx8580_32cd ASIC: marvell Port Config: 32x400G Board with external x86_64 CPU connected over PCI to 98CX8540 switching chip: Platform: x86_64-marvell_db98cx8540_16cd-r0 HwSKU: db98cx8540_16cd ASIC: marvell Port Config: 16x400G Board with external x86_64 CPU connected over PCI to 98CX8514 switching chip: Platform: x86_64-marvell_db98cx8514_10cc-r0 HwSKU: db98cx8514_10cc ASIC: marvell Port Config: 48x25G + 8x100G Signed-off-by: Pavan Naregundi --- platform/marvell/one-image.mk | 3 +++ platform/marvell/platform-marvell.mk | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/platform/marvell/one-image.mk b/platform/marvell/one-image.mk index d7faa90c2ee9..b58a6179c255 100644 --- a/platform/marvell/one-image.mk +++ b/platform/marvell/one-image.mk @@ -18,6 +18,9 @@ $(SONIC_ONE_IMAGE)_INSTALLS += $(MRVL_PRESTERA_DEB) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(NOKIA_7215_PLATFORM) else ifeq ($(CONFIGURED_ARCH),amd64) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(AC5X_RD98DX35xx_PLATFORM) +$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(FALCON_DB98CX8580_32CD_PLATFORM) +$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(FALCON_DB98CX8540_16CD_PLATFORM) +$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(FALCON_DB98CX8514_10CC_PLATFORM) endif ifeq ($(INSTALL_DEBUG_TOOLS),y) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) diff --git a/platform/marvell/platform-marvell.mk b/platform/marvell/platform-marvell.mk index b58814f489f9..c4f237757c95 100644 --- a/platform/marvell/platform-marvell.mk +++ b/platform/marvell/platform-marvell.mk @@ -2,6 +2,7 @@ AC5X_RD98DX35xx_PLATFORM_MODULE_VERSION = 1.0 AC5X_RD98DX35xxCN9131_PLATFORM_MODULE_VERSION = 1.0 +FALCON_PLATFORM_MODULE_VERSION = 1.0 ifeq ($(CONFIGURED_ARCH),arm64) @@ -23,4 +24,16 @@ $(AC5X_RD98DX35xx_PLATFORM)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) $(AC5X_RD98DX35xx_PLATFORM)_PLATFORM = x86_64-marvell_rd98DX35xx-r0 SONIC_DPKG_DEBS += $(AC5X_RD98DX35xx_PLATFORM) +FALCON_DB98CX8580_32CD_PLATFORM = sonic-platform-db98cx8580-32cd_$(FALCON_PLATFORM_MODULE_VERSION)_$(CONFIGURED_ARCH).deb +$(FALCON_DB98CX8580_32CD_PLATFORM)_PLATFORM = x86_64-marvell_db98cx8580_32cd-r0 +$(eval $(call add_extra_package,$(AC5X_RD98DX35xx_PLATFORM),$(FALCON_DB98CX8580_32CD_PLATFORM))) + +FALCON_DB98CX8540_16CD_PLATFORM = sonic-platform-db98cx8540-16cd_$(FALCON_PLATFORM_MODULE_VERSION)_$(CONFIGURED_ARCH).deb +$(FALCON_DB98CX8540_16CD_PLATFORM)_PLATFORM = x86_64-marvell_db98cx8540_16cd-r0 +$(eval $(call add_extra_package,$(AC5X_RD98DX35xx_PLATFORM),$(FALCON_DB98CX8540_16CD_PLATFORM))) + +FALCON_DB98CX8514_10CC_PLATFORM = sonic-platform-db98cx8514-10cc_$(FALCON_PLATFORM_MODULE_VERSION)_$(CONFIGURED_ARCH).deb +$(FALCON_DB98CX8514_10CC_PLATFORM)_PLATFORM = x86_64-marvell_db98cx8514_10cc-r0 +$(eval $(call add_extra_package,$(AC5X_RD98DX35xx_PLATFORM),$(FALCON_DB98CX8514_10CC_PLATFORM))) + endif From 74cb9a9a02249f968dfadc804a9948de876a6fb4 Mon Sep 17 00:00:00 2001 From: Pavan Naregundi Date: Mon, 22 Apr 2024 04:28:05 +0000 Subject: [PATCH 062/282] HWSKU for x86_64-marvell_rd98DX35xx-r0 Signed-off-by: Pavan Naregundi --- .../x86_64-marvell_rd98DX35xx-r0/default_sku | 1 + .../x86_64-marvell_rd98DX35xx-r0/installer.conf | 1 + .../x86_64-marvell_rd98DX35xx-r0/platform_asic | 1 + .../x86_64-marvell_rd98DX35xx-r0/plugins/eeprom.py | 13 +++++++++++++ .../pmon_daemon_control.json | 8 ++++++++ .../marvell/x86_64-marvell_rd98DX35xx-r0/rd98DX35xx | 1 + .../system_health_monitoring_config.json | 10 ++++++++++ 7 files changed, 35 insertions(+) create mode 100644 device/marvell/x86_64-marvell_rd98DX35xx-r0/default_sku create mode 100644 device/marvell/x86_64-marvell_rd98DX35xx-r0/installer.conf create mode 100644 device/marvell/x86_64-marvell_rd98DX35xx-r0/platform_asic create mode 100644 device/marvell/x86_64-marvell_rd98DX35xx-r0/plugins/eeprom.py create mode 100644 device/marvell/x86_64-marvell_rd98DX35xx-r0/pmon_daemon_control.json create mode 120000 device/marvell/x86_64-marvell_rd98DX35xx-r0/rd98DX35xx create mode 100644 device/marvell/x86_64-marvell_rd98DX35xx-r0/system_health_monitoring_config.json diff --git a/device/marvell/x86_64-marvell_rd98DX35xx-r0/default_sku b/device/marvell/x86_64-marvell_rd98DX35xx-r0/default_sku new file mode 100644 index 000000000000..ce1567b488fc --- /dev/null +++ b/device/marvell/x86_64-marvell_rd98DX35xx-r0/default_sku @@ -0,0 +1 @@ +rd98DX35xx t1 diff --git a/device/marvell/x86_64-marvell_rd98DX35xx-r0/installer.conf b/device/marvell/x86_64-marvell_rd98DX35xx-r0/installer.conf new file mode 100644 index 000000000000..c3c465bb9a88 --- /dev/null +++ b/device/marvell/x86_64-marvell_rd98DX35xx-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="" diff --git a/device/marvell/x86_64-marvell_rd98DX35xx-r0/platform_asic b/device/marvell/x86_64-marvell_rd98DX35xx-r0/platform_asic new file mode 100644 index 000000000000..a554752878b7 --- /dev/null +++ b/device/marvell/x86_64-marvell_rd98DX35xx-r0/platform_asic @@ -0,0 +1 @@ +marvell diff --git a/device/marvell/x86_64-marvell_rd98DX35xx-r0/plugins/eeprom.py b/device/marvell/x86_64-marvell_rd98DX35xx-r0/plugins/eeprom.py new file mode 100644 index 000000000000..c99cf62da6c0 --- /dev/null +++ b/device/marvell/x86_64-marvell_rd98DX35xx-r0/plugins/eeprom.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class board(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self, name, path, cpld_root, ro): + self.eeprom_path = "/sys/bus/i2c/devices/2-0050/eeprom" + super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/marvell/x86_64-marvell_rd98DX35xx-r0/pmon_daemon_control.json b/device/marvell/x86_64-marvell_rd98DX35xx-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..39deb88be078 --- /dev/null +++ b/device/marvell/x86_64-marvell_rd98DX35xx-r0/pmon_daemon_control.json @@ -0,0 +1,8 @@ +{ + "skip_ledd": true, + "skip_pcied": true, + "skip_thermalctld": true, + "skip_psud": true, + "skip_xcvrd": true, + "skip_syseepromd": true +} diff --git a/device/marvell/x86_64-marvell_rd98DX35xx-r0/rd98DX35xx b/device/marvell/x86_64-marvell_rd98DX35xx-r0/rd98DX35xx new file mode 120000 index 000000000000..d241dbe47d9a --- /dev/null +++ b/device/marvell/x86_64-marvell_rd98DX35xx-r0/rd98DX35xx @@ -0,0 +1 @@ +../arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_rd98DX35xx-r0/system_health_monitoring_config.json b/device/marvell/x86_64-marvell_rd98DX35xx-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..79c17103bf76 --- /dev/null +++ b/device/marvell/x86_64-marvell_rd98DX35xx-r0/system_health_monitoring_config.json @@ -0,0 +1,10 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.temperature", + "fan", + "psu" + ], + "user_defined_checkers": [] +} From cbdebcf1556a40e5fa820c6ce8ae80610ab918ef Mon Sep 17 00:00:00 2001 From: Pavan Naregundi Date: Mon, 22 Apr 2024 04:36:11 +0000 Subject: [PATCH 063/282] HWSKU for x86_64-marvell_db98cx8580_32cd-r0 Signed-off-by: Pavan Naregundi --- .../FALCON32X25G/ASK-Board-F12_8T_32x25G.md5 | 1 + .../FALCON32X25G/ASK-Board-F12_8T_32x25G.xml | 3002 ++++++++++ .../FALCON32X25G/ASK-L1-F12_8T_32x25G.md5 | 1 + .../FALCON32X25G/ASK-L1-F12_8T_32x25G.xml | 1072 ++++ .../FALCON32X25G/ASK-PP-F12_8T_32x25G.md5 | 1 + .../FALCON32X25G/ASK-PP-F12_8T_32x25G.xml | 1180 ++++ .../FALCON32X25G/SAI-F12_8T_32x25G.md5 | 1 + .../FALCON32X25G/SAI-F12_8T_32x25G.xml | 401 ++ .../FALCON32X25G/port_config.ini | 68 +- .../FALCON32X25G/profile.ini | 1 - .../FALCON32X25G/sai.profile | 1 + .../FALCON32x400G/port_config.ini | 34 - .../FALCON32x400G/profile.ini | 2 - .../FALCON32x400G/sai.profile | 3 - .../FALCON_DB/ASK-Board-F12_8T-DB.md5 | 1 + .../FALCON_DB/ASK-Board-F12_8T-DB.xml | 4978 +++++++++++++++++ .../FALCON_DB/ASK-L1-F12_8T-DB.md5 | 1 + .../FALCON_DB/ASK-L1-F12_8T-DB.xml | 1962 +++++++ .../FALCON_DB/ASK-PP-F12_8T-DB.md5 | 1 + .../FALCON_DB/ASK-PP-F12_8T-DB.xml | 1180 ++++ .../FALCON_DB/SAI-F12_8T-DB.md5 | 1 + .../FALCON_DB/SAI-F12_8T-DB.xml | 918 +++ .../FALCON_DB/buffers_defaults_t0.j2 | 36 + .../FALCON_DB/buffers_defaults_t1.j2 | 36 + .../FALCON_DB/port_config.ini | 138 + .../FALCON_DB/profile.ini | 1 + .../FALCON_DB/sai.profile | 4 + .../ASK-Board-F12_8T-48x25G-8x100G.md5 | 1 + .../ASK-Board-F12_8T-48x25G-8x100G.xml | 3458 ++++++++++++ .../ASK-L1-F12_8T-48x25G-8x100G.md5 | 1 + .../ASK-L1-F12_8T-48x25G-8x100G.xml | 1246 +++++ .../ASK-PP-F12_8T-48x25G-8x100G.md5 | 1 + .../ASK-PP-F12_8T-48x25G-8x100G.xml | 1180 ++++ .../SAI-F12_8T-48x25G-8x100G.md5 | 1 + .../SAI-F12_8T-48x25G-8x100G.xml | 518 ++ .../buffers_defaults_t0.j2 | 0 .../buffers_defaults_t1.j2 | 0 .../FC48x25G8x100GR4/port_config.ini | 58 + .../FC48x25G8x100GR4/profile.ini | 1 + .../FC48x25G8x100GR4/sai.profile | 4 + .../ASK-Board-F12_8T-48x25G-8x100G.md5 | 1 + .../ASK-Board-F12_8T-48x25G-8x100G.xml | 3458 ++++++++++++ .../ASK-L1-F12_8T-48x25G-8x100G.md5 | 1 + .../ASK-L1-F12_8T-48x25G-8x100G.xml | 1246 +++++ .../ASK-PP-F12_8T-48x25G-8x100G.md5 | 1 + .../ASK-PP-F12_8T-48x25G-8x100G.xml | 1180 ++++ .../SAI-F12_8T-48x25G-8x100G.md5 | 1 + .../SAI-F12_8T-48x25G-8x100G.xml | 518 ++ .../db98cx8580_32cd/buffers_config.j2 | 14 +- .../db98cx8580_32cd/port_config.ini | 92 +- .../db98cx8580_32cd/profile.ini | 1 - .../db98cx8580_32cd/sai.profile | 3 +- .../plugins/eeprom.py | 11 - .../plugins/sfputil.py | 254 - .../pmon_daemon_control.json | 7 +- .../system_health_monitoring_config.json | 10 + 56 files changed, 27909 insertions(+), 383 deletions(-) create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-Board-F12_8T_32x25G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-Board-F12_8T_32x25G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-L1-F12_8T_32x25G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-L1-F12_8T_32x25G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-PP-F12_8T_32x25G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-PP-F12_8T_32x25G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/SAI-F12_8T_32x25G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/SAI-F12_8T_32x25G.xml delete mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/port_config.ini delete mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/profile.ini delete mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/sai.profile create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-Board-F12_8T-DB.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-Board-F12_8T-DB.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-L1-F12_8T-DB.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-L1-F12_8T-DB.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-PP-F12_8T-DB.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-PP-F12_8T-DB.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/SAI-F12_8T-DB.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/SAI-F12_8T-DB.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/buffers_defaults_t0.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/buffers_defaults_t1.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/port_config.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/profile.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/sai.profile create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-Board-F12_8T-48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-Board-F12_8T-48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-L1-F12_8T-48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-L1-F12_8T-48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-PP-F12_8T-48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-PP-F12_8T-48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/SAI-F12_8T-48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/SAI-F12_8T-48x25G-8x100G.xml rename device/marvell/x86_64-marvell_db98cx8580_32cd-r0/{FALCON32x400G => FC48x25G8x100GR4}/buffers_defaults_t0.j2 (100%) rename device/marvell/x86_64-marvell_db98cx8580_32cd-r0/{FALCON32x400G => FC48x25G8x100GR4}/buffers_defaults_t1.j2 (100%) create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/port_config.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/profile.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/sai.profile create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-Board-F12_8T-48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-Board-F12_8T-48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-L1-F12_8T-48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-L1-F12_8T-48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-PP-F12_8T-48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-PP-F12_8T-48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/SAI-F12_8T-48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/SAI-F12_8T-48x25G-8x100G.xml delete mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/plugins/eeprom.py delete mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/plugins/sfputil.py create mode 100644 device/marvell/x86_64-marvell_db98cx8580_32cd-r0/system_health_monitoring_config.json diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-Board-F12_8T_32x25G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-Board-F12_8T_32x25G.md5 new file mode 100644 index 000000000000..a50a5c4cc622 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-Board-F12_8T_32x25G.md5 @@ -0,0 +1 @@ +84a2cb54120192cfade31a5ae174b96e \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-Board-F12_8T_32x25G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-Board-F12_8T_32x25G.xml new file mode 100644 index 000000000000..00ff5d183b70 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-Board-F12_8T_32x25G.xml @@ -0,0 +1,3002 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + Falcon-12.8T_32x25G + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F12_8T_32x25G.xml + ASK-L1-F12_8T_32x25G.xml + sip6 + + 0 + + ethernet_mac + 32 + false + + + NA + + MAP4 + + + + 2 + true + + false + + + + 1 + + ethernet_mac + 40 + false + + + NA + + MAP5 + + + false + + + + 2 + + ethernet_mac + 48 + false + + + NA + + MAP6 + + + false + + + + 3 + + ethernet_mac + 56 + false + + + NA + + MAP7 + + + false + + + + 4 + + ethernet_mac + 64 + false + + + NA + + MAP0 + + + + 2 + true + + false + + + + 5 + + ethernet_mac + 72 + false + + + NA + + MAP1 + + + false + + + + 6 + + ethernet_mac + 80 + false + + + NA + + MAP2 + + + false + + + + 7 + + ethernet_mac + 88 + false + + + NA + + MAP3 + + + false + + + + 8 + + ethernet_mac + 96 + false + + + NA + + MAP4 + + + + 2 + true + + false + + + + 9 + + ethernet_mac + 104 + false + + + NA + + MAP5 + + + + 2 + true + + false + + + + 10 + + ethernet_mac + 112 + false + + + NA + + MAP6 + + + + 2 + true + + false + + + + 11 + + ethernet_mac + 120 + false + + + NA + + MAP7 + + + + 2 + true + + false + + + + 12 + + ethernet_mac + 128 + false + + + NA + + MAP0 + + + + 2 + true + + false + + + + 13 + + ethernet_mac + 136 + false + + + NA + + MAP1 + + + + 2 + true + + false + + + + 14 + + ethernet_mac + 144 + false + + + NA + + MAP2 + + + + 2 + true + + false + + + + 15 + + ethernet_mac + 152 + false + + + NA + + MAP3 + + + + 2 + true + + false + + + + 16 + + ethernet_mac + 160 + false + + + NA + + MAP4 + + + + 2 + true + + false + + + + 17 + + ethernet_mac + 168 + false + + + NA + + MAP5 + + + + 2 + true + + false + + + + 18 + + ethernet_mac + 176 + false + + + NA + + MAP6 + + + + 2 + true + + false + + + + 19 + + ethernet_mac + 184 + false + + + NA + + MAP7 + + + + 2 + true + + false + + + + 20 + + ethernet_mac + 192 + false + + + NA + + MAP0 + + + + 2 + true + + false + + + + 21 + + ethernet_mac + 200 + false + + + NA + + MAP1 + + + + 2 + true + + false + + + + 22 + + ethernet_mac + 208 + false + + + NA + + MAP2 + + + + 2 + true + + false + + + + 23 + + ethernet_mac + 216 + false + + + NA + + MAP3 + + + + 2 + true + + false + + + + 24 + + ethernet_mac + 224 + false + + + NA + + MAP4 + + + + 2 + true + + false + + + + 25 + + ethernet_mac + 232 + false + + + NA + + MAP5 + + + + 2 + true + + false + + + + 26 + + ethernet_mac + 240 + false + + + NA + + MAP6 + + + + 2 + true + + false + + + + 27 + + ethernet_mac + 248 + false + + + NA + + MAP7 + + + + 2 + true + + false + + + + 28 + + ethernet_mac + 0 + false + + + NA + + MAP0 + + + + 2 + true + + false + + + + 29 + + ethernet_mac + 8 + false + + + NA + + MAP1 + + + + 2 + true + + false + + + + 30 + + ethernet_mac + 16 + false + + + NA + + MAP2 + + + + 2 + true + + false + + + + 31 + + ethernet_mac + 24 + false + + + NA + + MAP3 + + + + 2 + true + + false + + + + 32 + + ethernet_mac + 258 + false + + + NA + + + + + 2 + true + + false + + + + 63 + + cpu_sdma + 273 + false + + + + 33 + + cpu_sdma + 274 + false + + + + 34 + + cpu_sdma + 275 + false + + + + 35 + + cpu_sdma + 276 + false + + + + 32 + false + false + + + 38 + false + false + + + 34 + false + false + + + 39 + false + false + + + 33 + false + false + + + 37 + false + false + + + 36 + false + true + + + 35 + false + false + + + 40 + false + false + + + 45 + false + false + + + 41 + false + true + + + 46 + false + false + + + 42 + false + false + + + 47 + false + false + + + 44 + false + false + + + 43 + false + false + + + 50 + false + false + + + 54 + false + false + + + 49 + false + false + + + 51 + false + false + + + 48 + false + false + + + 52 + false + false + + + 53 + false + false + + + 55 + false + false + + + 57 + false + false + + + 62 + false + false + + + 58 + false + false + + + 63 + false + false + + + 56 + false + false + + + 60 + false + false + + + 59 + false + false + + + 61 + false + false + + + 64 + false + true + + + 71 + false + false + + + 66 + false + true + + + 68 + false + true + + + 65 + false + true + + + 69 + false + false + + + 67 + false + false + + + 70 + false + true + + + 72 + false + false + + + 77 + false + true + + + 73 + false + false + + + 79 + false + true + + + 75 + false + true + + + 74 + false + true + + + 76 + false + true + + + 78 + false + true + + + 81 + false + true + + + 85 + false + true + + + 80 + false + true + + + 87 + false + true + + + 84 + false + false + + + 82 + false + false + + + 83 + false + false + + + 86 + false + false + + + 88 + false + false + + + 94 + false + false + + + 89 + false + false + + + 95 + false + false + + + 90 + false + true + + + 91 + false + true + + + 92 + false + true + + + 93 + false + true + + + 96 + false + true + + + 102 + false + true + + + 98 + false + true + + + 103 + false + true + + + 97 + false + true + + + 101 + false + false + + + 100 + false + true + + + 99 + false + true + + + 104 + false + true + + + 109 + false + true + + + 105 + false + false + + + 110 + false + true + + + 106 + false + false + + + 111 + false + true + + + 108 + false + true + + + 107 + false + true + + + 114 + false + true + + + 118 + false + true + + + 113 + false + true + + + 115 + false + true + + + 112 + false + true + + + 116 + false + true + + + 117 + false + true + + + 119 + false + true + + + 121 + false + true + + + 126 + false + true + + + 122 + false + true + + + 127 + false + false + + + 120 + false + true + + + 124 + false + true + + + 123 + false + true + + + 125 + false + false + + + 128 + false + true + + + 135 + false + false + + + 130 + false + true + + + 132 + false + true + + + 129 + false + true + + + 133 + false + true + + + 131 + false + false + + + 134 + false + true + + + 136 + false + true + + + 141 + false + true + + + 137 + false + true + + + 143 + false + true + + + 139 + false + true + + + 138 + false + true + + + 140 + false + false + + + 142 + false + true + + + 145 + false + true + + + 149 + false + true + + + 144 + false + true + + + 151 + false + true + + + 148 + false + true + + + 146 + false + false + + + 147 + false + true + + + 150 + false + false + + + 152 + false + false + + + 158 + false + false + + + 153 + false + false + + + 159 + false + false + + + 154 + false + true + + + 155 + false + true + + + 156 + false + true + + + 157 + false + true + + + 160 + false + true + + + 166 + false + true + + + 162 + false + true + + + 167 + false + true + + + 161 + false + true + + + 165 + false + false + + + 164 + false + true + + + 163 + false + true + + + 168 + false + true + + + 173 + false + true + + + 169 + false + false + + + 174 + false + true + + + 170 + false + false + + + 175 + false + true + + + 176 + false + true + + + 172 + false + true + + + 171 + false + true + + + 178 + false + true + + + 182 + false + true + + + 177 + false + true + + + 179 + false + true + + + 180 + false + true + + + 181 + false + true + + + 183 + false + true + + + 185 + false + true + + + 190 + false + true + + + 186 + false + true + + + 191 + false + false + + + 184 + false + true + + + 188 + false + true + + + 187 + false + true + + + 189 + false + true + + + 192 + false + false + + + 199 + false + false + + + 194 + false + true + + + 196 + false + false + + + 193 + false + false + + + 197 + false + false + + + 195 + false + false + + + 198 + false + false + + + 200 + true + true + + + 205 + false + false + + + 201 + false + true + + + 207 + false + false + + + 203 + false + true + + + 202 + false + false + + + 204 + false + false + + + 206 + false + false + + + 209 + false + true + + + 213 + false + false + + + 208 + false + false + + + 215 + false + true + + + 212 + false + false + + + 210 + false + false + + + 211 + false + false + + + 214 + false + false + + + 216 + false + true + + + 222 + false + false + + + 217 + false + true + + + 223 + false + false + + + 218 + false + true + + + 219 + false + false + + + 220 + false + true + + + 221 + false + false + + + 224 + false + true + + + 230 + false + false + + + 226 + false + false + + + 231 + false + true + + + 225 + false + true + + + 229 + false + false + + + 228 + false + true + + + 227 + false + true + + + 232 + false + false + + + 237 + false + false + + + 233 + false + true + + + 238 + false + false + + + 234 + false + true + + + 239 + false + false + + + 236 + false + true + + + 235 + false + false + + + 242 + false + true + + + 246 + false + false + + + 241 + false + false + + + 243 + false + true + + + 240 + false + false + + + 244 + false + false + + + 245 + false + false + + + 247 + false + false + + + 249 + false + false + + + 254 + false + false + + + 250 + false + false + + + 255 + false + false + + + 248 + false + false + + + 252 + false + false + + + 251 + false + true + + + 253 + false + true + + + 0 + true + false + + + 7 + false + false + + + 2 + false + true + + + 4 + false + false + + + 1 + false + false + + + 5 + false + false + + + 3 + false + false + + + 6 + false + false + + + 8 + false + false + + + 13 + false + false + + + 9 + false + false + + + 15 + false + false + + + 11 + false + true + + + 10 + false + false + + + 12 + false + false + + + 14 + false + false + + + 17 + false + false + + + 21 + false + false + + + 16 + false + false + + + 23 + false + false + + + 20 + false + false + + + 18 + false + false + + + 19 + false + false + + + 22 + false + false + + + 24 + false + true + + + 30 + false + false + + + 25 + false + false + + + 31 + false + false + + + 26 + false + true + + + 27 + false + false + + + 28 + false + true + + + 29 + false + false + + + 0 + + ORDER_MODE_BY_CLASS + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_0 + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_1 + PULSE_STRETCH_1 + false + 1627 + false + + 1 + 64 + 66 + false + + + 2 + 64 + 65 + false + + + 3 + 64 + 65 + false + + + 4 + 64 + 66 + false + + + 5 + 64 + 66 + false + + + 6 + 64 + 65 + false + + + 7 + 64 + 65 + false + + + 8 + 64 + 66 + false + + + + 0 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 1 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 2 + PORT_TYPE_XG + true + BLINK_SELECT_0 + false + true + true + + + 3 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 4 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 5 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + + /tmp/cpss_uds + + 8 + + MAP0 + + 0 + + + 7 + + + 2 + + + 4 + + + 1 + + + 5 + + + 3 + + + 6 + + + + MAP1 + + 0 + + + 5 + + + 1 + + + 7 + + + 3 + + + 2 + + + 4 + + + 6 + + + + MAP2 + + 1 + + + 5 + + + 0 + + + 7 + + + 4 + + + 2 + + + 3 + + + 6 + + + + MAP3 + + 0 + + + 6 + + + 1 + + + 7 + + + 2 + + + 3 + + + 4 + + + 5 + + + + MAP4 + + 0 + + + 6 + + + 2 + + + 7 + + + 1 + + + 5 + + + 4 + + + 3 + + + + MAP5 + + 0 + + + 5 + + + 1 + + + 6 + + + 2 + + + 7 + + + 4 + + + 3 + + + + MAP6 + + 2 + + + 6 + + + 1 + + + 3 + + + 0 + + + 4 + + + 5 + + + 7 + + + + MAP7 + + 1 + + + 6 + + + 2 + + + 7 + + + 0 + + + 4 + + + 3 + + + 5 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-L1-F12_8T_32x25G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-L1-F12_8T_32x25G.md5 new file mode 100644 index 000000000000..85848f340d1e --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-L1-F12_8T_32x25G.md5 @@ -0,0 +1 @@ +88c203cabdf73a053d2ff8802e0dbf30 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-L1-F12_8T_32x25G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-L1-F12_8T_32x25G.xml new file mode 100644 index 000000000000..386e692e6f1a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-L1-F12_8T_32x25G.xml @@ -0,0 +1,1072 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 10GR1Fix + + KR + 10G + disabled + + + + 25GR1 + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 25GR1 + + + 1 + AVAGO + profile_default + 25GR1 + + + 2 + AVAGO + profile_default + 25GR1 + + + 3 + AVAGO + profile_default + 25GR1 + + + 4 + AVAGO + profile_default + 25GR1 + + + 5 + AVAGO + profile_default + 25GR1 + + + 6 + AVAGO + profile_default + 25GR1 + + + 7 + AVAGO + profile_default + 25GR1 + + + 8 + AVAGO + profile_default + 25GR1 + + + 9 + AVAGO + profile_default + 25GR1 + + + 10 + AVAGO + profile_default + 25GR1 + + + 11 + AVAGO + profile_default + 25GR1 + + + 12 + AVAGO + profile_default + 25GR1 + + + 13 + AVAGO + profile_default + 25GR1 + + + 14 + AVAGO + profile_default + 25GR1 + + + 15 + AVAGO + profile_default + 25GR1 + + + 16 + AVAGO + profile_default + 25GR1 + + + 17 + AVAGO + profile_default + 25GR1 + + + 18 + AVAGO + profile_default + 25GR1 + + + 19 + AVAGO + profile_default + 25GR1 + + + 20 + AVAGO + profile_default + 25GR1 + + + 21 + AVAGO + profile_default + 25GR1 + + + 22 + AVAGO + profile_default + 25GR1 + + + 23 + AVAGO + profile_default + 25GR1 + + + 24 + AVAGO + profile_default + 25GR1 + + + 25 + AVAGO + profile_default + 25GR1 + + + 26 + AVAGO + profile_default + 25GR1 + + + 27 + AVAGO + profile_default + 25GR1 + + + 28 + AVAGO + profile_default + 25GR1 + + + 29 + AVAGO + profile_default + 25GR1 + + + 30 + AVAGO + profile_default + 25GR1 + + + 31 + AVAGO + profile_default + 25GR1 + + + 32 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-PP-F12_8T_32x25G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-PP-F12_8T_32x25G.md5 new file mode 100644 index 000000000000..3c28079976c6 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-PP-F12_8T_32x25G.md5 @@ -0,0 +1 @@ +1ed6046358d99524cdf9cd9e136a0efa \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-PP-F12_8T_32x25G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-PP-F12_8T_32x25G.xml new file mode 100644 index 000000000000..e3239589f006 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/ASK-PP-F12_8T_32x25G.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-12.8 + + 4294967295 + external_25_single_ended + 2 + 60 + 64-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/SAI-F12_8T_32x25G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/SAI-F12_8T_32x25G.md5 new file mode 100644 index 000000000000..09f527592746 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/SAI-F12_8T_32x25G.md5 @@ -0,0 +1 @@ +f9c28ab49d1a1af723ec804226e061f8 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/SAI-F12_8T_32x25G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/SAI-F12_8T_32x25G.xml new file mode 100644 index 000000000000..3c7443e9d1b5 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/SAI-F12_8T_32x25G.xml @@ -0,0 +1,401 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F12_8T_32x25G.xml + + + 0 + 0 + 31 + + + 1 + 0 + 30 + + + 2 + 0 + 29 + + + 3 + 0 + 28 + + + 4 + 0 + 27 + + + 5 + 0 + 26 + + + 6 + 0 + 25 + + + 7 + 0 + 24 + + + 8 + 0 + 23 + + + 9 + 0 + 22 + + + 10 + 0 + 21 + + + 11 + 0 + 20 + + + 12 + 0 + 19 + + + 13 + 0 + 18 + + + 14 + 0 + 17 + + + 15 + 0 + 16 + + + 16 + 0 + 15 + + + 17 + 0 + 14 + + + 18 + 0 + 13 + + + 19 + 0 + 12 + + + 20 + 0 + 11 + + + 21 + 0 + 10 + + + 22 + 0 + 9 + + + 23 + 0 + 8 + + + 24 + 0 + 7 + + + 25 + 0 + 6 + + + 26 + 0 + 5 + + + 27 + 0 + 4 + + + 28 + 0 + 3 + + + 29 + 0 + 2 + + + 30 + 0 + 1 + + + 31 + 0 + 0 + + + 32 + 0 + 32 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + 4096 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/port_config.ini b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/port_config.ini index 6d8b5d0a13df..939b74a024d3 100644 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/port_config.ini +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/port_config.ini @@ -1,34 +1,34 @@ -# name lanes speed alias -Ethernet0 0 25000 twenty5GigE0 -Ethernet1 1 25000 twenty5GigE1 -Ethernet2 2 25000 twenty5GigE2 -Ethernet3 3 25000 twenty5GigE3 -Ethernet4 4 25000 twenty5GigE4 -Ethernet5 5 25000 twenty5GigE5 -Ethernet6 6 25000 twenty5GigE6 -Ethernet7 7 25000 twenty5GigE7 -Ethernet8 8 25000 twenty5GigE8 -Ethernet9 9 25000 twenty5GigE9 -Ethernet10 10 25000 twenty5GigE10 -Ethernet11 11 25000 twenty5GigE11 -Ethernet12 12 25000 twenty5GigE12 -Ethernet13 13 25000 twenty5GigE13 -Ethernet14 14 25000 twenty5GigE14 -Ethernet15 15 25000 twenty5GigE15 -Ethernet16 16 25000 twenty5GigE16 -Ethernet17 17 25000 twenty5GigE17 -Ethernet18 18 25000 twenty5GigE18 -Ethernet19 19 25000 twenty5GigE19 -Ethernet20 20 25000 twenty5GigE20 -Ethernet21 21 25000 twenty5GigE21 -Ethernet22 22 25000 twenty5GigE22 -Ethernet23 23 25000 twenty5GigE23 -Ethernet24 24 25000 twenty5GigE24 -Ethernet25 25 25000 twenty5GigE25 -Ethernet26 26 25000 twenty5GigE26 -Ethernet27 27 25000 twenty5GigE27 -Ethernet28 28 25000 twenty5GigE28 -Ethernet29 29 25000 twenty5GigE29 -Ethernet30 30 25000 twenty5GigE30 -Ethernet31 31 25000 twenty5GigE31 -Ethernet32 32 10000 tenGigE32 +# name lanes alias speed autoneg fec index +Ethernet0 0 twenty5GigE0 25000 on none 1 +Ethernet1 1 twenty5GigE1 25000 on none 2 +Ethernet2 2 twenty5GigE2 25000 on none 3 +Ethernet3 3 twenty5GigE3 25000 on none 4 +Ethernet4 4 twenty5GigE4 25000 on none 5 +Ethernet5 5 twenty5GigE5 25000 on none 6 +Ethernet6 6 twenty5GigE6 25000 on none 7 +Ethernet7 7 twenty5GigE7 25000 on none 8 +Ethernet8 8 twenty5GigE8 25000 on none 9 +Ethernet9 9 twenty5GigE9 25000 on none 10 +Ethernet10 10 twenty5GigE10 25000 on none 11 +Ethernet11 11 twenty5GigE11 25000 on none 12 +Ethernet12 12 twenty5GigE12 25000 on none 13 +Ethernet13 13 twenty5GigE13 25000 on none 14 +Ethernet14 14 twenty5GigE14 25000 on none 15 +Ethernet15 15 twenty5GigE15 25000 on none 16 +Ethernet16 16 twenty5GigE16 25000 on none 17 +Ethernet17 17 twenty5GigE17 25000 on none 18 +Ethernet18 18 twenty5GigE18 25000 on none 19 +Ethernet19 19 twenty5GigE19 25000 on none 20 +Ethernet20 20 twenty5GigE20 25000 on none 21 +Ethernet21 21 twenty5GigE21 25000 on none 22 +Ethernet22 22 twenty5GigE22 25000 on none 23 +Ethernet23 23 twenty5GigE23 25000 on none 24 +Ethernet24 24 twenty5GigE24 25000 on none 25 +Ethernet25 25 twenty5GigE25 25000 on none 26 +Ethernet26 26 twenty5GigE26 25000 on none 27 +Ethernet27 27 twenty5GigE27 25000 on none 28 +Ethernet28 28 twenty5GigE28 25000 on none 29 +Ethernet29 29 twenty5GigE29 25000 on none 30 +Ethernet30 30 twenty5GigE30 25000 on none 31 +Ethernet31 31 twenty5GigE31 25000 on none 32 +Ethernet32 32 tenGigE32 10000 off none 33 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/profile.ini b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/profile.ini index 487e80dcbd70..c2f77685ad0a 100644 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/profile.ini +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/profile.ini @@ -1,2 +1 @@ switchMacAddress=00:01:02:03:04:05 -apPortListWithCableLen=000:1 001:1 002:1 003:1 004:1 005:1 006:1 007:1 008:1 009:1 010:1 011:1 012:1 013:1 014:1 015:1 016:1 017:1 018:1 019:1 020:1 021:1 022:1 023:1 024:1 025:1 026:1 027:1 028:1 029:1 030:1 031:1 032:1 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/sai.profile b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/sai.profile index dd6f707a81ab..3333fd4b7558 100644 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/sai.profile +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32X25G/sai.profile @@ -1,3 +1,4 @@ mode=1 hwId=FALCON32X25G +switchProfile=/usr/share/sonic/hwsku/SAI-F12_8T_32x25G.xml SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/port_config.ini b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/port_config.ini deleted file mode 100644 index 62dd91ba8869..000000000000 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/port_config.ini +++ /dev/null @@ -1,34 +0,0 @@ -# name lanes speed alias -Ethernet0 0,1,2,3,4,5,6,7 400000 four00GigE0 -Ethernet8 8,9,10,11,12,13,14,15 400000 four00GigE8 -Ethernet16 16,17,18,19,20,21,22,23 400000 four00GigE16 -Ethernet24 24,25,26,27,28,29,30,31 400000 four00GigE24 -Ethernet32 32,33,34,35,36,37,38,39 400000 four00GigE32 -Ethernet40 40,41,42,43,44,45,46,47 400000 four00GigE40 -Ethernet48 48,49,50,51,52,53,54,55 400000 four00GigE48 -Ethernet56 56,57,58,59,60,61,62,63 400000 four00GigE56 -Ethernet64 64,65,66,67,68,69,70,71 400000 four00GigE64 -Ethernet72 72,73,74,75,76,77,78,79 400000 four00GigE72 -Ethernet80 80,81,82,83,84,85,86,87 400000 four00GigE80 -Ethernet88 88,89,90,91,92,93,94,95 400000 four00GigE88 -Ethernet96 96,97,98,99,100,101,102,103 400000 four00GigE96 -Ethernet104 104,105,106,107,108,109,110,111 400000 four00GigE104 -Ethernet112 112,113,114,115,116,117,118,119 400000 four00GigE112 -Ethernet120 120,121,122,123,124,125,126,127 400000 four00GigE120 -Ethernet128 128,129,130,131,132,133,134,135 400000 four00GigE128 -Ethernet136 136,137,138,139,140,141,142,143 400000 four00GigE136 -Ethernet144 144,145,146,147,148,149,150,151 400000 four00GigE144 -Ethernet152 152,153,154,155,156,157,158,159 400000 four00GigE152 -Ethernet160 160,161,162,163,164,165,166,167 400000 four00GigE160 -Ethernet168 168,169,170,171,172,173,174,175 400000 four00GigE168 -Ethernet176 176,177,178,179,180,181,182,183 400000 four00GigE176 -Ethernet184 184,185,186,187,188,189,190,191 400000 four00GigE184 -Ethernet192 192,193,194,195,196,197,198,199 400000 four00GigE192 -Ethernet200 200,201,202,203,204,205,206,207 400000 four00GigE200 -Ethernet208 208,209,210,211,212,213,214,215 400000 four00GigE208 -Ethernet216 216,217,218,219,220,221,222,223 400000 four00GigE216 -Ethernet224 224,225,226,227,228,229,230,231 400000 four00GigE224 -Ethernet232 232,233,234,235,236,237,238,239 400000 four00GigE232 -Ethernet240 240,241,242,243,244,245,246,247 400000 four00GigE240 -Ethernet248 248,249,250,251,252,253,254,255 400000 four00GigE248 -Ethernet256 256 10000 tenGigE256 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/profile.ini b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/profile.ini deleted file mode 100644 index 2813bbd363f8..000000000000 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/profile.ini +++ /dev/null @@ -1,2 +0,0 @@ -switchMacAddress=00:01:02:03:04:05 -apPortListWithCableLen=000:1 008:1 016:1 024:1 032:1 040:1 048:1 056:1 064:1 072:1 080:1 088:1 096:1 104:1 112:1 120:1 128:1 136:1 144:1 152:1 160:1 168:1 176:1 184:1 192:1 200:1 208:1 216:1 224:1 232:1 240:1 248:1 256:1 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/sai.profile b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/sai.profile deleted file mode 100644 index 6dc6f35fed4e..000000000000 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/sai.profile +++ /dev/null @@ -1,3 +0,0 @@ -mode=1 -hwId=FALCON32x400G -SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-Board-F12_8T-DB.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-Board-F12_8T-DB.md5 new file mode 100644 index 000000000000..55bbf0dc39e5 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-Board-F12_8T-DB.md5 @@ -0,0 +1 @@ +a9b91dd828b6322ed3b341a7c49fecbc \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-Board-F12_8T-DB.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-Board-F12_8T-DB.xml new file mode 100644 index 000000000000..a9d2ccf46ead --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-Board-F12_8T-DB.xml @@ -0,0 +1,4978 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + Falcon-12.8T-DB + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F12_8T-DB.xml + ASK-L1-F12_8T-DB.xml + sip6 + + 0 + + ethernet_mac + 32 + false + + + NA + + MAP4 + + 0 + + 2 + true + + false + + + + 1 + + ethernet_mac + 33 + false + + + NA + + + + false + + + + 2 + + ethernet_mac + 34 + false + + + NA + + + + false + + + + 3 + + ethernet_mac + 35 + false + + + NA + + + + false + + + + 4 + + ethernet_mac + 36 + false + + + NA + + + + + 2 + true + + false + + + + 5 + + ethernet_mac + 37 + false + + + NA + + + + false + + + + 6 + + ethernet_mac + 38 + false + + + NA + + + + false + + + + 7 + + ethernet_mac + 39 + false + + + NA + + + + false + + + + 8 + + ethernet_mac + 40 + false + + + NA + + MAP5 + + 1 + + 2 + true + + false + + + + 9 + + ethernet_mac + 41 + false + + + NA + + + + + 2 + true + + false + + + + 10 + + ethernet_mac + 42 + false + + + NA + + + + + 2 + true + + false + + + + 11 + + ethernet_mac + 43 + false + + + NA + + + + + 2 + true + + false + + + + 12 + + ethernet_mac + 44 + false + + + NA + + + + + 2 + true + + false + + + + 13 + + ethernet_mac + 45 + false + + + NA + + + + + 2 + true + + false + + + + 14 + + ethernet_mac + 46 + false + + + NA + + + + + 2 + true + + false + + + + 15 + + ethernet_mac + 47 + false + + + NA + + + + + 2 + true + + false + + + + 16 + + ethernet_mac + 48 + false + + + NA + + MAP6 + + 0 + + 2 + true + + false + + + + 17 + + ethernet_mac + 49 + false + + + NA + + + + + 2 + true + + false + + + + 18 + + ethernet_mac + 50 + false + + + NA + + + + + 2 + true + + false + + + + 19 + + ethernet_mac + 51 + false + + + NA + + + + + 2 + true + + false + + + + 20 + + ethernet_mac + 52 + false + + + NA + + + + + 2 + true + + false + + + + 21 + + ethernet_mac + 53 + false + + + NA + + + + + 2 + true + + false + + + + 22 + + ethernet_mac + 54 + false + + + NA + + + + + 2 + true + + false + + + + 23 + + ethernet_mac + 55 + false + + + NA + + + + + 2 + true + + false + + + + 24 + + ethernet_mac + 56 + false + + + NA + + MAP7 + + 1 + + 2 + true + + false + + + + 25 + + ethernet_mac + 57 + false + + + NA + + + + + 2 + true + + false + + + + 26 + + ethernet_mac + 58 + false + + + NA + + + + + 2 + true + + false + + + + 27 + + ethernet_mac + 59 + false + + + NA + + + + + 2 + true + + false + + + + 28 + + ethernet_mac + 60 + false + + + NA + + + + + 2 + true + + false + + + + 29 + + ethernet_mac + 61 + false + + + NA + + + + + 2 + true + + false + + + + 30 + + ethernet_mac + 62 + false + + + NA + + + + + 2 + true + + false + + + + 31 + + ethernet_mac + 63 + false + + + NA + + + + + 2 + true + + false + + + + 32 + + ethernet_mac + 64 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 33 + + ethernet_mac + 65 + false + + + NA + + + + + 2 + true + + false + + + + 34 + + ethernet_mac + 66 + false + + + NA + + + + + 2 + true + + false + + + + 35 + + ethernet_mac + 67 + false + + + NA + + + + + 2 + true + + false + + + + 36 + + ethernet_mac + 68 + false + + + NA + + + + + 2 + true + + false + + + + 37 + + ethernet_mac + 69 + false + + + NA + + + + + 2 + true + + false + + + + 38 + + ethernet_mac + 70 + false + + + NA + + + + + 2 + true + + false + + + + 39 + + ethernet_mac + 71 + false + + + NA + + + + + 2 + true + + false + + + + 40 + + ethernet_mac + 72 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 41 + + ethernet_mac + 73 + false + + + NA + + + + + 2 + true + + false + + + + 42 + + ethernet_mac + 74 + false + + + NA + + + + + 2 + true + + false + + + + 43 + + ethernet_mac + 75 + false + + + NA + + + + + 2 + true + + false + + + + 44 + + ethernet_mac + 76 + false + + + NA + + + + + 2 + true + + false + + + + 45 + + ethernet_mac + 77 + false + + + NA + + + + + 2 + true + + false + + + + 46 + + ethernet_mac + 78 + false + + + NA + + + + + 2 + true + + false + + + + 47 + + ethernet_mac + 79 + false + + + NA + + + + + 2 + true + + false + + + + 48 + + ethernet_mac + 80 + false + + + NA + + MAP2 + + 0 + + 2 + true + + false + + + + 49 + + ethernet_mac + 81 + false + + + NA + + + + + 2 + true + + false + + + + 50 + + ethernet_mac + 82 + false + + + NA + + + + + 2 + true + + false + + + + 51 + + ethernet_mac + 83 + false + + + NA + + + + + 2 + true + + false + + + + 52 + + ethernet_mac + 84 + false + + + NA + + + + + 2 + true + + false + + + + 53 + + ethernet_mac + 85 + false + + + NA + + + + + 2 + true + + false + + + + 54 + + ethernet_mac + 86 + false + + + NA + + + + + 2 + true + + false + + + + 55 + + ethernet_mac + 87 + false + + + NA + + + + + 2 + true + + false + + + + 56 + + ethernet_mac + 88 + false + + + NA + + MAP3 + + 1 + + 2 + true + + false + + + + 57 + + ethernet_mac + 89 + false + + + NA + + + + + 2 + true + + false + + + + 58 + + ethernet_mac + 90 + false + + + NA + + + + + 2 + true + + false + + + + 59 + + ethernet_mac + 91 + false + + + NA + + + + + 2 + true + + false + + + + 60 + + ethernet_mac + 92 + false + + + NA + + + + + 2 + true + + false + + + + 64 + + ethernet_mac + 93 + false + + + NA + + + + + 2 + true + + false + + + + 65 + + ethernet_mac + 94 + false + + + NA + + + + + 2 + true + + false + + + + 66 + + ethernet_mac + 95 + false + + + NA + + + + + 2 + true + + false + + + + 67 + + ethernet_mac + 96 + false + + + NA + + MAP4 + + 0 + + 2 + true + + false + + + + 68 + + ethernet_mac + 97 + false + + + NA + + + + + 2 + true + + false + + + + 69 + + ethernet_mac + 98 + false + + + NA + + + + + 2 + true + + false + + + + 70 + + ethernet_mac + 99 + false + + + NA + + + + + 2 + true + + false + + + + 71 + + ethernet_mac + 100 + false + + + NA + + + + + 2 + true + + false + + + + 72 + + ethernet_mac + 101 + false + + + NA + + + + + 2 + true + + false + + + + 73 + + ethernet_mac + 102 + false + + + NA + + + + + 2 + true + + false + + + + 74 + + ethernet_mac + 103 + false + + + NA + + + + + 2 + true + + false + + + + 75 + + ethernet_mac + 104 + false + + + NA + + MAP5 + + 1 + + 2 + true + + false + + + + 76 + + ethernet_mac + 105 + false + + + NA + + + + + 2 + true + + false + + + + 77 + + ethernet_mac + 106 + false + + + NA + + + + + 2 + true + + false + + + + 78 + + ethernet_mac + 107 + false + + + NA + + + + + 2 + true + + false + + + + 79 + + ethernet_mac + 108 + false + + + NA + + + + + 2 + true + + false + + + + 80 + + ethernet_mac + 109 + false + + + NA + + + + + 2 + true + + false + + + + 81 + + ethernet_mac + 110 + false + + + NA + + + + + 2 + true + + false + + + + 82 + + ethernet_mac + 111 + false + + + NA + + + + + 2 + true + + false + + + + 83 + + ethernet_mac + 112 + false + + + NA + + MAP6 + + 0 + + 2 + true + + false + + + + 84 + + ethernet_mac + 113 + false + + + NA + + + + + 2 + true + + false + + + + 85 + + ethernet_mac + 114 + false + + + NA + + + + + 2 + true + + false + + + + 86 + + ethernet_mac + 115 + false + + + NA + + + + + 2 + true + + false + + + + 87 + + ethernet_mac + 116 + false + + + NA + + + + + 2 + true + + false + + + + 88 + + ethernet_mac + 117 + false + + + NA + + + + + 2 + true + + false + + + + 89 + + ethernet_mac + 118 + false + + + NA + + + + + 2 + true + + false + + + + 90 + + ethernet_mac + 119 + false + + + NA + + + + + 2 + true + + false + + + + 91 + + ethernet_mac + 120 + false + + + NA + + MAP7 + + 1 + + 2 + true + + false + + + + 92 + + ethernet_mac + 121 + false + + + NA + + + + + 2 + true + + false + + + + 93 + + ethernet_mac + 122 + false + + + NA + + + + + 2 + true + + false + + + + 94 + + ethernet_mac + 123 + false + + + NA + + + + + 2 + true + + false + + + + 95 + + ethernet_mac + 124 + false + + + NA + + + + + 2 + true + + false + + + + 96 + + ethernet_mac + 125 + false + + + NA + + + + + 2 + true + + false + + + + 97 + + ethernet_mac + 126 + false + + + NA + + + + + 2 + true + + false + + + + 98 + + ethernet_mac + 127 + false + + + NA + + + + + 2 + true + + false + + + + 99 + + ethernet_mac + 128 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 100 + + ethernet_mac + 130 + false + + + NA + + + + + 2 + true + + false + + + + 101 + + ethernet_mac + 132 + false + + + NA + + + + + 2 + true + + false + + + + 102 + + ethernet_mac + 134 + false + + + NA + + + + + 2 + true + + false + + + + 103 + + ethernet_mac + 136 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 104 + + ethernet_mac + 138 + false + + + NA + + + + + 2 + true + + false + + + + 105 + + ethernet_mac + 140 + false + + + NA + + + + + 2 + true + + false + + + + 106 + + ethernet_mac + 142 + false + + + NA + + + + + 2 + true + + false + + + + 107 + + ethernet_mac + 144 + false + + + NA + + MAP2 + + 0 + + 2 + true + + false + + + + 108 + + ethernet_mac + 146 + false + + + NA + + + + + 2 + true + + false + + + + 109 + + ethernet_mac + 148 + false + + + NA + + + + + 2 + true + + false + + + + 110 + + ethernet_mac + 150 + false + + + NA + + + + + 2 + true + + false + + + + 111 + + ethernet_mac + 152 + false + + + NA + + MAP3 + + 1 + + 2 + true + + false + + + + 112 + + ethernet_mac + 154 + false + + + NA + + + + + 2 + true + + false + + + + 113 + + ethernet_mac + 156 + false + + + NA + + + + + 2 + true + + false + + + + 114 + + ethernet_mac + 158 + false + + + NA + + + + + 2 + true + + false + + + + 115 + + ethernet_mac + 160 + false + + + NA + + MAP4 + + 0 + + 2 + true + + false + + + + 116 + + ethernet_mac + 164 + false + + + NA + + + + + 2 + true + + false + + + + 117 + + ethernet_mac + 168 + false + + + NA + + MAP5 + + 1 + + 2 + true + + false + + + + 118 + + ethernet_mac + 172 + false + + + NA + + + + + 2 + true + + false + + + + 119 + + ethernet_mac + 176 + false + + + NA + + MAP6 + + 0 + + 2 + true + + false + + + + 120 + + ethernet_mac + 180 + false + + + NA + + + + + 2 + true + + false + + + + 121 + + ethernet_mac + 184 + false + + + NA + + MAP7 + + 1 + + 2 + true + + false + + + + 122 + + ethernet_mac + 188 + false + + + NA + + + + + 2 + true + + false + + + + 123 + + ethernet_mac + 192 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 124 + + ethernet_mac + 196 + false + + + NA + + + + + 2 + true + + false + + + + 125 + + ethernet_mac + 200 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 126 + + ethernet_mac + 204 + false + + + NA + + + + + 2 + true + + false + + + + 127 + + ethernet_mac + 208 + false + + + NA + + MAP2 + + 0 + + 2 + true + + false + + + + 128 + + ethernet_mac + 212 + false + + + NA + + + + + 2 + true + + false + + + + 129 + + ethernet_mac + 216 + false + + + NA + + MAP3 + + 1 + + 2 + true + + false + + + + 130 + + ethernet_mac + 220 + false + + + NA + + + + + 2 + true + + false + + + + 131 + + ethernet_mac + 224 + false + + + NA + + MAP4 + + 0 + + 2 + true + + false + + + + 132 + + ethernet_mac + 232 + false + + + NA + + MAP5 + + 1 + + 2 + true + + false + + + + 133 + + ethernet_mac + 240 + false + + + NA + + MAP6 + + 0 + + 2 + true + + false + + + + 134 + + ethernet_mac + 248 + false + + + NA + + MAP7 + + 1 + + 2 + true + + false + + + + 135 + + ethernet_mac + 0 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 136 + + ethernet_mac + 8 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 137 + + ethernet_mac + 16 + false + + + NA + + MAP2 + + 0 + + 2 + true + + false + + + + 138 + + ethernet_mac + 24 + false + + + NA + + MAP3 + + 1 + + 2 + true + + false + + + + 139 + + ethernet_mac + 258 + false + + + NA + + + 2 + + 2 + true + + false + + + + 63 + + cpu_sdma + 273 + false + + + + 140 + + cpu_sdma + 274 + false + + + + 142 + + cpu_sdma + 275 + false + + + + 141 + + cpu_sdma + 276 + false + + + + 32 + false + false + + + 38 + false + false + + + 34 + false + false + + + 39 + false + false + + + 33 + false + false + + + 37 + false + false + + + 36 + false + true + + + 35 + false + false + + + 40 + false + false + + + 45 + false + false + + + 41 + false + true + + + 46 + false + false + + + 42 + false + false + + + 47 + false + false + + + 44 + false + false + + + 43 + false + false + + + 50 + false + false + + + 54 + false + false + + + 49 + false + false + + + 51 + false + false + + + 48 + false + false + + + 52 + false + false + + + 53 + false + false + + + 55 + false + false + + + 57 + false + false + + + 62 + false + false + + + 58 + false + false + + + 63 + false + false + + + 56 + false + false + + + 60 + false + false + + + 59 + false + false + + + 61 + false + false + + + 64 + false + true + + + 71 + false + false + + + 66 + false + true + + + 68 + false + true + + + 65 + false + true + + + 69 + false + false + + + 67 + false + false + + + 70 + false + true + + + 72 + false + false + + + 77 + false + true + + + 73 + false + false + + + 79 + false + true + + + 75 + false + true + + + 74 + false + true + + + 76 + false + true + + + 78 + false + true + + + 81 + false + true + + + 85 + false + true + + + 80 + false + true + + + 87 + false + true + + + 84 + false + false + + + 82 + false + false + + + 83 + false + false + + + 86 + false + false + + + 88 + false + false + + + 94 + false + false + + + 89 + false + false + + + 95 + false + false + + + 90 + false + true + + + 91 + false + true + + + 92 + false + true + + + 93 + false + true + + + 96 + false + true + + + 102 + false + true + + + 98 + false + true + + + 103 + false + true + + + 97 + false + true + + + 101 + false + false + + + 100 + false + true + + + 99 + false + true + + + 104 + false + true + + + 109 + false + true + + + 105 + false + false + + + 110 + false + true + + + 106 + false + false + + + 111 + false + true + + + 108 + false + true + + + 107 + false + true + + + 114 + false + true + + + 118 + false + true + + + 113 + false + true + + + 115 + false + true + + + 112 + false + true + + + 116 + false + true + + + 117 + false + true + + + 119 + false + true + + + 121 + false + true + + + 126 + false + true + + + 122 + false + true + + + 127 + false + false + + + 120 + false + true + + + 124 + false + true + + + 123 + false + true + + + 125 + false + false + + + 128 + false + true + + + 135 + false + false + + + 130 + false + true + + + 132 + false + true + + + 129 + false + true + + + 133 + false + true + + + 131 + false + false + + + 134 + false + true + + + 136 + false + true + + + 141 + false + true + + + 137 + false + true + + + 143 + false + true + + + 139 + false + true + + + 138 + false + true + + + 140 + false + false + + + 142 + false + true + + + 145 + false + true + + + 149 + false + true + + + 144 + false + true + + + 151 + false + true + + + 148 + false + true + + + 146 + false + false + + + 147 + false + true + + + 150 + false + false + + + 152 + false + false + + + 158 + false + false + + + 153 + false + false + + + 159 + false + false + + + 154 + false + true + + + 155 + false + true + + + 156 + false + true + + + 157 + false + true + + + 160 + false + true + + + 166 + false + true + + + 162 + false + true + + + 167 + false + true + + + 161 + false + true + + + 165 + false + false + + + 164 + false + true + + + 163 + false + true + + + 168 + false + true + + + 173 + false + true + + + 169 + false + false + + + 174 + false + true + + + 170 + false + false + + + 175 + false + true + + + 176 + false + true + + + 172 + false + true + + + 171 + false + true + + + 178 + false + true + + + 182 + false + true + + + 177 + false + true + + + 179 + false + true + + + 180 + false + true + + + 181 + false + true + + + 183 + false + true + + + 185 + false + true + + + 190 + false + true + + + 186 + false + true + + + 191 + false + false + + + 184 + false + true + + + 188 + false + true + + + 187 + false + true + + + 189 + false + true + + + 192 + false + false + + + 199 + false + false + + + 194 + false + true + + + 196 + false + false + + + 193 + false + false + + + 197 + false + false + + + 195 + false + false + + + 198 + false + false + + + 200 + true + true + + + 205 + false + false + + + 201 + false + true + + + 207 + false + false + + + 203 + false + true + + + 202 + false + false + + + 204 + false + false + + + 206 + false + false + + + 209 + false + true + + + 213 + false + false + + + 208 + false + false + + + 215 + false + true + + + 212 + false + false + + + 210 + false + false + + + 211 + false + false + + + 214 + false + false + + + 216 + false + true + + + 222 + false + false + + + 217 + false + true + + + 223 + false + false + + + 218 + false + true + + + 219 + false + false + + + 220 + false + true + + + 221 + false + false + + + 224 + false + true + + + 230 + false + false + + + 226 + false + false + + + 231 + false + true + + + 225 + false + true + + + 229 + false + false + + + 228 + false + true + + + 227 + false + true + + + 232 + false + false + + + 237 + false + false + + + 233 + false + true + + + 238 + false + false + + + 234 + false + true + + + 239 + false + false + + + 236 + false + true + + + 235 + false + false + + + 242 + false + true + + + 246 + false + false + + + 241 + false + false + + + 243 + false + true + + + 240 + false + false + + + 244 + false + false + + + 245 + false + false + + + 247 + false + false + + + 249 + false + false + + + 254 + false + false + + + 250 + false + false + + + 255 + false + false + + + 248 + false + false + + + 252 + false + false + + + 251 + false + true + + + 253 + false + true + + + 0 + true + false + + + 7 + false + false + + + 2 + false + true + + + 4 + false + false + + + 1 + false + false + + + 5 + false + false + + + 3 + false + false + + + 6 + false + false + + + 8 + false + false + + + 13 + false + false + + + 9 + false + false + + + 15 + false + false + + + 11 + false + true + + + 10 + false + false + + + 12 + false + false + + + 14 + false + false + + + 17 + false + false + + + 21 + false + false + + + 16 + false + false + + + 23 + false + false + + + 20 + false + false + + + 18 + false + false + + + 19 + false + false + + + 22 + false + false + + + 24 + false + true + + + 30 + false + false + + + 25 + false + false + + + 31 + false + false + + + 26 + false + true + + + 27 + false + false + + + 28 + false + true + + + 29 + false + false + + + 0 + + ORDER_MODE_BY_CLASS + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_0 + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_1 + PULSE_STRETCH_1 + false + 1627 + false + + 1 + 64 + 66 + false + + + 2 + 64 + 65 + false + + + 3 + 64 + 65 + false + + + 4 + 64 + 66 + false + + + 5 + 64 + 66 + false + + + 6 + 64 + 65 + false + + + 7 + 64 + 65 + false + + + 8 + 64 + 66 + false + + + + 0 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 1 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 2 + PORT_TYPE_XG + true + BLINK_SELECT_0 + false + true + true + + + 3 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 4 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 5 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + + /tmp/cpss_uds + + 8 + + MAP0 + + 0 + + + 7 + + + 2 + + + 4 + + + 1 + + + 5 + + + 3 + + + 6 + + + + MAP1 + + 0 + + + 5 + + + 1 + + + 7 + + + 3 + + + 2 + + + 4 + + + 6 + + + + MAP2 + + 1 + + + 5 + + + 0 + + + 7 + + + 4 + + + 2 + + + 3 + + + 6 + + + + MAP3 + + 0 + + + 6 + + + 1 + + + 7 + + + 2 + + + 3 + + + 4 + + + 5 + + + + MAP4 + + 0 + + + 6 + + + 2 + + + 7 + + + 1 + + + 5 + + + 4 + + + 3 + + + + MAP5 + + 0 + + + 5 + + + 1 + + + 6 + + + 2 + + + 7 + + + 4 + + + 3 + + + + MAP6 + + 2 + + + 6 + + + 1 + + + 3 + + + 0 + + + 4 + + + 5 + + + 7 + + + + MAP7 + + 1 + + + 6 + + + 2 + + + 7 + + + 0 + + + 4 + + + 3 + + + 5 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-L1-F12_8T-DB.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-L1-F12_8T-DB.md5 new file mode 100644 index 000000000000..dd2029e187cc --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-L1-F12_8T-DB.md5 @@ -0,0 +1 @@ +ea16f9a242a729d34f016aeb819b10c1 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-L1-F12_8T-DB.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-L1-F12_8T-DB.xml new file mode 100644 index 000000000000..c248b2556344 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-L1-F12_8T-DB.xml @@ -0,0 +1,1962 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 100GR2 + + CR2 + 100G + rs_544_514_enabled + + + KR2 + 100G + rs_544_514_enabled + + + SR_LR2 + 100G + rs_544_514_enabled + + + SR_LR2 + 50G + rs_enabled + + + CR2 + 50G + rs_enabled + + + KR2 + 50G + rs_enabled + + + CR2 + 100G + rs_544_514_enabled + rs_544_514_enabled + + + KR2 + 100G + rs_544_514_enabled + rs_544_514_enabled + + + CR2 + 50G + rs_enabled + rs_enabled + + + KR2 + 50G + rs_enabled + rs_enabled + + + + 100GR4 + + CR4 + 100G + rs_enabled + + + KR4 + 100G + rs_enabled + + + SR_LR4 + 100G + rs_enabled + + + CR4 + 100G + rs_enabled + rs_enabled + + + KR4 + 100G + rs_enabled + rs_enabled + + + + 10GR1 + + KR + 10G + enabled + + + SR_LR + 10G + enabled + + + KR + 10G + enabled + enabled + + + + 10GR1Fix + + KR + 10G + disabled + + + + 200GR4 + + CR4 + 200G + rs_544_514_enabled + + + SR_LR4 + 100G + rs_enabled + + + KR4 + 100G + rs_enabled + + + CR4 + 100G + rs_enabled + + + KR4 + 200G + rs_544_514_enabled + + + SR_LR4 + 200G + rs_544_514_enabled + + + CR4 + 200G + rs_544_514_enabled + rs_544_514_enabled + + + KR4 + 200G + rs_544_514_enabled + rs_544_514_enabled + + + CR4 + 100G + rs_enabled + rs_enabled + + + KR4 + 100G + rs_enabled + rs_enabled + + + + 25GR1 + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + 400GR8 + + CR8 + 400G + rs_544_514_enabled + + + KR8 + 400G + rs_544_514_enabled + + + SR_LR8 + 400G + rs_544_514_enabled + + + CR8 + 400G + rs_544_514_enabled + rs_544_514_enabled + + + KR8 + 400G + rs_544_514_enabled + rs_544_514_enabled + + + + 50GR1 + + CR + 50G + rs_544_514_enabled + + + KR + 50G + rs_544_514_enabled + + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 50G + rs_544_514_enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 50G + rs_544_514_enabled + rs_544_514_enabled + + + KR + 50G + rs_544_514_enabled + rs_544_514_enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 10GR1 + + + 1 + AVAGO + profile_default + 10GR1 + + + 2 + AVAGO + profile_default + 10GR1 + + + 3 + AVAGO + profile_default + 10GR1 + + + 4 + AVAGO + profile_default + 10GR1 + + + 5 + AVAGO + profile_default + 10GR1 + + + 6 + AVAGO + profile_default + 10GR1 + + + 7 + AVAGO + profile_default + 10GR1 + + + 8 + AVAGO + profile_default + 10GR1 + + + 9 + AVAGO + profile_default + 10GR1 + + + 10 + AVAGO + profile_default + 10GR1 + + + 11 + AVAGO + profile_default + 10GR1 + + + 12 + AVAGO + profile_default + 10GR1 + + + 13 + AVAGO + profile_default + 10GR1 + + + 14 + AVAGO + profile_default + 10GR1 + + + 15 + AVAGO + profile_default + 10GR1 + + + 16 + AVAGO + profile_default + 10GR1 + + + 17 + AVAGO + profile_default + 10GR1 + + + 18 + AVAGO + profile_default + 10GR1 + + + 19 + AVAGO + profile_default + 10GR1 + + + 20 + AVAGO + profile_default + 10GR1 + + + 21 + AVAGO + profile_default + 10GR1 + + + 22 + AVAGO + profile_default + 10GR1 + + + 23 + AVAGO + profile_default + 10GR1 + + + 24 + AVAGO + profile_default + 10GR1 + + + 25 + AVAGO + profile_default + 10GR1 + + + 26 + AVAGO + profile_default + 10GR1 + + + 27 + AVAGO + profile_default + 10GR1 + + + 28 + AVAGO + profile_default + 10GR1 + + + 29 + AVAGO + profile_default + 10GR1 + + + 30 + AVAGO + profile_default + 10GR1 + + + 31 + AVAGO + profile_default + 10GR1 + + + 32 + AVAGO + profile_default + 25GR1 + + + 33 + AVAGO + profile_default + 25GR1 + + + 34 + AVAGO + profile_default + 25GR1 + + + 35 + AVAGO + profile_default + 25GR1 + + + 36 + AVAGO + profile_default + 25GR1 + + + 37 + AVAGO + profile_default + 25GR1 + + + 38 + AVAGO + profile_default + 25GR1 + + + 39 + AVAGO + profile_default + 25GR1 + + + 40 + AVAGO + profile_default + 25GR1 + + + 41 + AVAGO + profile_default + 25GR1 + + + 42 + AVAGO + profile_default + 25GR1 + + + 43 + AVAGO + profile_default + 25GR1 + + + 44 + AVAGO + profile_default + 25GR1 + + + 45 + AVAGO + profile_default + 25GR1 + + + 46 + AVAGO + profile_default + 25GR1 + + + 47 + AVAGO + profile_default + 25GR1 + + + 48 + AVAGO + profile_default + 25GR1 + + + 49 + AVAGO + profile_default + 25GR1 + + + 50 + AVAGO + profile_default + 25GR1 + + + 51 + AVAGO + profile_default + 25GR1 + + + 52 + AVAGO + profile_default + 25GR1 + + + 53 + AVAGO + profile_default + 25GR1 + + + 54 + AVAGO + profile_default + 25GR1 + + + 55 + AVAGO + profile_default + 25GR1 + + + 56 + AVAGO + profile_default + 25GR1 + + + 57 + AVAGO + profile_default + 25GR1 + + + 58 + AVAGO + profile_default + 25GR1 + + + 59 + AVAGO + profile_default + 25GR1 + + + 60 + AVAGO + profile_default + 25GR1 + + + 64 + AVAGO + profile_default + 25GR1 + + + 65 + AVAGO + profile_default + 25GR1 + + + 66 + AVAGO + profile_default + 25GR1 + + + 67 + AVAGO + profile_default + 50GR1 + + + 68 + AVAGO + profile_default + 50GR1 + + + 69 + AVAGO + profile_default + 50GR1 + + + 70 + AVAGO + profile_default + 50GR1 + + + 71 + AVAGO + profile_default + 50GR1 + + + 72 + AVAGO + profile_default + 50GR1 + + + 73 + AVAGO + profile_default + 50GR1 + + + 74 + AVAGO + profile_default + 50GR1 + + + 75 + AVAGO + profile_default + 50GR1 + + + 76 + AVAGO + profile_default + 50GR1 + + + 77 + AVAGO + profile_default + 50GR1 + + + 78 + AVAGO + profile_default + 50GR1 + + + 79 + AVAGO + profile_default + 50GR1 + + + 80 + AVAGO + profile_default + 50GR1 + + + 81 + AVAGO + profile_default + 50GR1 + + + 82 + AVAGO + profile_default + 50GR1 + + + 83 + AVAGO + profile_default + 50GR1 + + + 84 + AVAGO + profile_default + 50GR1 + + + 85 + AVAGO + profile_default + 50GR1 + + + 86 + AVAGO + profile_default + 50GR1 + + + 87 + AVAGO + profile_default + 50GR1 + + + 88 + AVAGO + profile_default + 50GR1 + + + 89 + AVAGO + profile_default + 50GR1 + + + 90 + AVAGO + profile_default + 50GR1 + + + 91 + AVAGO + profile_default + 50GR1 + + + 92 + AVAGO + profile_default + 50GR1 + + + 93 + AVAGO + profile_default + 50GR1 + + + 94 + AVAGO + profile_default + 50GR1 + + + 95 + AVAGO + profile_default + 50GR1 + + + 96 + AVAGO + profile_default + 50GR1 + + + 97 + AVAGO + profile_default + 50GR1 + + + 98 + AVAGO + profile_default + 50GR1 + + + 99 + AVAGO + profile_default + 100GR2 + + + 100 + AVAGO + profile_default + 100GR2 + + + 101 + AVAGO + profile_default + 100GR2 + + + 102 + AVAGO + profile_default + 100GR2 + + + 103 + AVAGO + profile_default + 100GR2 + + + 104 + AVAGO + profile_default + 100GR2 + + + 105 + AVAGO + profile_default + 100GR2 + + + 106 + AVAGO + profile_default + 100GR2 + + + 107 + AVAGO + profile_default + 100GR2 + + + 108 + AVAGO + profile_default + 100GR2 + + + 109 + AVAGO + profile_default + 100GR2 + + + 110 + AVAGO + profile_default + 100GR2 + + + 111 + AVAGO + profile_default + 100GR2 + + + 112 + AVAGO + profile_default + 100GR2 + + + 113 + AVAGO + profile_default + 100GR2 + + + 114 + AVAGO + profile_default + 100GR2 + + + 115 + AVAGO + profile_default + 100GR4 + + + 116 + AVAGO + profile_default + 100GR4 + + + 117 + AVAGO + profile_default + 100GR4 + + + 118 + AVAGO + profile_default + 100GR4 + + + 119 + AVAGO + profile_default + 100GR4 + + + 120 + AVAGO + profile_default + 100GR4 + + + 121 + AVAGO + profile_default + 100GR4 + + + 122 + AVAGO + profile_default + 100GR4 + + + 123 + AVAGO + profile_default + 200GR4 + + + 124 + AVAGO + profile_default + 200GR4 + + + 125 + AVAGO + profile_default + 200GR4 + + + 126 + AVAGO + profile_default + 200GR4 + + + 127 + AVAGO + profile_default + 200GR4 + + + 128 + AVAGO + profile_default + 200GR4 + + + 129 + AVAGO + profile_default + 200GR4 + + + 130 + AVAGO + profile_default + 200GR4 + + + 131 + AVAGO + profile_default + 400GR8 + + + 132 + AVAGO + profile_default + 400GR8 + + + 133 + AVAGO + profile_default + 400GR8 + + + 134 + AVAGO + profile_default + 400GR8 + + + 135 + AVAGO + profile_default + 400GR8 + + + 136 + AVAGO + profile_default + 400GR8 + + + 137 + AVAGO + profile_default + 400GR8 + + + 138 + AVAGO + profile_default + 400GR8 + + + 139 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-PP-F12_8T-DB.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-PP-F12_8T-DB.md5 new file mode 100644 index 000000000000..9980130ff5c3 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-PP-F12_8T-DB.md5 @@ -0,0 +1 @@ +fa06a79dae1d9859fa0d579044b41e62 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-PP-F12_8T-DB.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-PP-F12_8T-DB.xml new file mode 100644 index 000000000000..6bc02e574fde --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/ASK-PP-F12_8T-DB.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-12.8 + + 4294967295 + external_25_single_ended + 2 + 60 + 256-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/SAI-F12_8T-DB.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/SAI-F12_8T-DB.md5 new file mode 100644 index 000000000000..b8354262f261 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/SAI-F12_8T-DB.md5 @@ -0,0 +1 @@ +77abb2b5b75369072fc4e2e498e86204 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/SAI-F12_8T-DB.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/SAI-F12_8T-DB.xml new file mode 100644 index 000000000000..b603467c45ed --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/SAI-F12_8T-DB.xml @@ -0,0 +1,918 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F12_8T-DB.xml + + + 0 + 0 + 31 + + + 1 + 0 + 30 + + + 2 + 0 + 29 + + + 3 + 0 + 28 + + + 4 + 0 + 27 + + + 5 + 0 + 26 + + + 6 + 0 + 25 + + + 7 + 0 + 24 + + + 8 + 0 + 23 + + + 9 + 0 + 22 + + + 10 + 0 + 21 + + + 11 + 0 + 20 + + + 12 + 0 + 19 + + + 13 + 0 + 18 + + + 14 + 0 + 17 + + + 15 + 0 + 16 + + + 16 + 0 + 15 + + + 17 + 0 + 14 + + + 18 + 0 + 13 + + + 19 + 0 + 12 + + + 20 + 0 + 11 + + + 21 + 0 + 10 + + + 22 + 0 + 9 + + + 23 + 0 + 8 + + + 24 + 0 + 7 + + + 25 + 0 + 6 + + + 26 + 0 + 5 + + + 27 + 0 + 4 + + + 28 + 0 + 3 + + + 29 + 0 + 2 + + + 30 + 0 + 1 + + + 31 + 0 + 0 + + + 32 + 0 + 66 + + + 33 + 0 + 65 + + + 34 + 0 + 64 + + + 35 + 0 + 60 + + + 36 + 0 + 59 + + + 37 + 0 + 58 + + + 38 + 0 + 57 + + + 39 + 0 + 56 + + + 40 + 0 + 55 + + + 41 + 0 + 54 + + + 42 + 0 + 53 + + + 43 + 0 + 52 + + + 44 + 0 + 51 + + + 45 + 0 + 50 + + + 46 + 0 + 49 + + + 47 + 0 + 48 + + + 48 + 0 + 47 + + + 49 + 0 + 46 + + + 50 + 0 + 45 + + + 51 + 0 + 44 + + + 52 + 0 + 43 + + + 53 + 0 + 42 + + + 54 + 0 + 41 + + + 55 + 0 + 40 + + + 56 + 0 + 39 + + + 57 + 0 + 38 + + + 58 + 0 + 37 + + + 59 + 0 + 36 + + + 60 + 0 + 35 + + + 61 + 0 + 34 + + + 62 + 0 + 33 + + + 63 + 0 + 32 + + + 64 + 0 + 98 + + + 65 + 0 + 97 + + + 66 + 0 + 96 + + + 67 + 0 + 95 + + + 68 + 0 + 94 + + + 69 + 0 + 93 + + + 70 + 0 + 92 + + + 71 + 0 + 91 + + + 72 + 0 + 90 + + + 73 + 0 + 89 + + + 74 + 0 + 88 + + + 75 + 0 + 87 + + + 76 + 0 + 86 + + + 77 + 0 + 85 + + + 78 + 0 + 84 + + + 79 + 0 + 83 + + + 80 + 0 + 82 + + + 81 + 0 + 81 + + + 82 + 0 + 80 + + + 83 + 0 + 79 + + + 84 + 0 + 78 + + + 85 + 0 + 77 + + + 86 + 0 + 76 + + + 87 + 0 + 75 + + + 88 + 0 + 74 + + + 89 + 0 + 73 + + + 90 + 0 + 72 + + + 91 + 0 + 71 + + + 92 + 0 + 70 + + + 93 + 0 + 69 + + + 94 + 0 + 68 + + + 95 + 0 + 67 + + + 96 + 0 + 114 + + + 98 + 0 + 113 + + + 100 + 0 + 112 + + + 102 + 0 + 111 + + + 104 + 0 + 110 + + + 106 + 0 + 109 + + + 108 + 0 + 108 + + + 110 + 0 + 107 + + + 112 + 0 + 106 + + + 114 + 0 + 105 + + + 116 + 0 + 104 + + + 118 + 0 + 103 + + + 120 + 0 + 102 + + + 122 + 0 + 101 + + + 124 + 0 + 100 + + + 126 + 0 + 99 + + + 128 + 0 + 122 + + + 132 + 0 + 121 + + + 136 + 0 + 120 + + + 140 + 0 + 119 + + + 144 + 0 + 118 + + + 148 + 0 + 117 + + + 152 + 0 + 116 + + + 156 + 0 + 115 + + + 160 + 0 + 130 + + + 164 + 0 + 129 + + + 168 + 0 + 128 + + + 172 + 0 + 127 + + + 176 + 0 + 126 + + + 180 + 0 + 125 + + + 184 + 0 + 124 + + + 188 + 0 + 123 + + + 192 + 0 + 138 + + + 200 + 0 + 137 + + + 208 + 0 + 136 + + + 216 + 0 + 135 + + + 224 + 0 + 134 + + + 232 + 0 + 133 + + + 240 + 0 + 132 + + + 248 + 0 + 131 + + + 256 + 0 + 139 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/buffers_defaults_t0.j2 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..5e24d992559a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/buffers_defaults_t0.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "23000000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "23000000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"85000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/buffers_defaults_t1.j2 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..5e24d992559a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/buffers_defaults_t1.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "23000000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "23000000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"85000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/port_config.ini b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/port_config.ini new file mode 100644 index 000000000000..57fb6e2c46f2 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/port_config.ini @@ -0,0 +1,138 @@ +# name lanes alias speed autoneg fec index +Ethernet0 0 tenGigE0 10000 on none 1 +Ethernet1 1 tenGigE1 10000 on none 2 +Ethernet2 2 tenGigE2 10000 on none 3 +Ethernet3 3 tenGigE3 10000 on none 4 +Ethernet4 4 tenGigE4 10000 on none 5 +Ethernet5 5 tenGigE5 10000 on none 6 +Ethernet6 6 tenGigE6 10000 on none 7 +Ethernet7 7 tenGigE7 10000 on none 8 +Ethernet8 8 tenGigE8 10000 on none 9 +Ethernet9 9 tenGigE9 10000 on none 10 +Ethernet10 10 tenGigE10 10000 on none 11 +Ethernet11 11 tenGigE11 10000 on none 12 +Ethernet12 12 tenGigE12 10000 on none 13 +Ethernet13 13 tenGigE13 10000 on none 14 +Ethernet14 14 tenGigE14 10000 on none 15 +Ethernet15 15 tenGigE15 10000 on none 16 +Ethernet16 16 tenGigE16 10000 on none 17 +Ethernet17 17 tenGigE17 10000 on none 18 +Ethernet18 18 tenGigE18 10000 on none 19 +Ethernet19 19 tenGigE19 10000 on none 20 +Ethernet20 20 tenGigE20 10000 on none 21 +Ethernet21 21 tenGigE21 10000 on none 22 +Ethernet22 22 tenGigE22 10000 on none 23 +Ethernet23 23 tenGigE23 10000 on none 24 +Ethernet24 24 tenGigE24 10000 on none 25 +Ethernet25 25 tenGigE25 10000 on none 26 +Ethernet26 26 tenGigE26 10000 on none 27 +Ethernet27 27 tenGigE27 10000 on none 28 +Ethernet28 28 tenGigE28 10000 on none 29 +Ethernet29 29 tenGigE29 10000 on none 30 +Ethernet30 30 tenGigE30 10000 on none 31 +Ethernet31 31 tenGigE31 10000 on none 32 +Ethernet32 32 twenty5GigE32 25000 on none 33 +Ethernet33 33 twenty5GigE33 25000 on none 34 +Ethernet34 34 twenty5GigE34 25000 on none 35 +Ethernet35 35 twenty5GigE35 25000 on none 36 +Ethernet36 36 twenty5GigE36 25000 on none 37 +Ethernet37 37 twenty5GigE37 25000 on none 38 +Ethernet38 38 twenty5GigE38 25000 on none 39 +Ethernet39 39 twenty5GigE39 25000 on none 40 +Ethernet40 40 twenty5GigE40 25000 on none 41 +Ethernet41 41 twenty5GigE41 25000 on none 42 +Ethernet42 42 twenty5GigE42 25000 on none 43 +Ethernet43 43 twenty5GigE43 25000 on none 44 +Ethernet44 44 twenty5GigE44 25000 on none 45 +Ethernet45 45 twenty5GigE45 25000 on none 46 +Ethernet46 46 twenty5GigE46 25000 on none 47 +Ethernet47 47 twenty5GigE47 25000 on none 48 +Ethernet48 48 twenty5GigE48 25000 on none 49 +Ethernet49 49 twenty5GigE49 25000 on none 50 +Ethernet50 50 twenty5GigE50 25000 on none 51 +Ethernet51 51 twenty5GigE51 25000 on none 52 +Ethernet52 52 twenty5GigE52 25000 on none 53 +Ethernet53 53 twenty5GigE53 25000 on none 54 +Ethernet54 54 twenty5GigE54 25000 on none 55 +Ethernet55 55 twenty5GigE55 25000 on none 56 +Ethernet56 56 twenty5GigE56 25000 on none 57 +Ethernet57 57 twenty5GigE57 25000 on none 58 +Ethernet58 58 twenty5GigE58 25000 on none 59 +Ethernet59 59 twenty5GigE59 25000 on none 60 +Ethernet60 60 twenty5GigE60 25000 on none 61 +Ethernet61 61 twenty5GigE61 25000 on none 62 +Ethernet62 62 twenty5GigE62 25000 on none 63 +Ethernet63 63 twenty5GigE63 25000 on none 64 +Ethernet64 64 fiftyGigE64 50000 on rs 65 +Ethernet65 65 fiftyGigE65 50000 on rs 66 +Ethernet66 66 fiftyGigE66 50000 on rs 67 +Ethernet67 67 fiftyGigE67 50000 on rs 68 +Ethernet68 68 fiftyGigE68 50000 on rs 69 +Ethernet69 69 fiftyGigE69 50000 on rs 70 +Ethernet70 70 fiftyGigE70 50000 on rs 71 +Ethernet71 71 fiftyGigE71 50000 on rs 72 +Ethernet72 72 fiftyGigE72 50000 on rs 73 +Ethernet73 73 fiftyGigE73 50000 on rs 74 +Ethernet74 74 fiftyGigE74 50000 on rs 75 +Ethernet75 75 fiftyGigE75 50000 on rs 76 +Ethernet76 76 fiftyGigE76 50000 on rs 77 +Ethernet77 77 fiftyGigE77 50000 on rs 78 +Ethernet78 78 fiftyGigE78 50000 on rs 79 +Ethernet79 79 fiftyGigE79 50000 on rs 80 +Ethernet80 80 fiftyGigE80 50000 on rs 81 +Ethernet81 81 fiftyGigE81 50000 on rs 82 +Ethernet82 82 fiftyGigE82 50000 on rs 83 +Ethernet83 83 fiftyGigE83 50000 on rs 84 +Ethernet84 84 fiftyGigE84 50000 on rs 85 +Ethernet85 85 fiftyGigE85 50000 on rs 86 +Ethernet86 86 fiftyGigE86 50000 on rs 87 +Ethernet87 87 fiftyGigE87 50000 on rs 88 +Ethernet88 88 fiftyGigE88 50000 on rs 89 +Ethernet89 89 fiftyGigE89 50000 on rs 90 +Ethernet90 90 fiftyGigE90 50000 on rs 91 +Ethernet91 91 fiftyGigE91 50000 on rs 92 +Ethernet92 92 fiftyGigE92 50000 on rs 93 +Ethernet93 93 fiftyGigE93 50000 on rs 94 +Ethernet94 94 fiftyGigE94 50000 on rs 95 +Ethernet95 95 fiftyGigE95 50000 on rs 96 +Ethernet96 96,97 one00GigE96 100000 on rs 97 +Ethernet97 98,99 one00GigE97 100000 on rs 98 +Ethernet98 100,101 one00GigE98 100000 on rs 99 +Ethernet99 102,103 one00GigE99 100000 on rs 100 +Ethernet100 104,105 one00GigE100 100000 on rs 101 +Ethernet101 106,107 one00GigE101 100000 on rs 102 +Ethernet102 108,109 one00GigE102 100000 on rs 103 +Ethernet103 110,111 one00GigE103 100000 on rs 104 +Ethernet104 112,113 one00GigE104 100000 on rs 105 +Ethernet105 114,115 one00GigE105 100000 on rs 106 +Ethernet106 116,117 one00GigE106 100000 on rs 107 +Ethernet107 118,119 one00GigE107 100000 on rs 108 +Ethernet108 120,121 one00GigE108 100000 on rs 109 +Ethernet109 122,123 one00GigE109 100000 on rs 110 +Ethernet110 124,125 one00GigE110 100000 on rs 111 +Ethernet111 126,127 one00GigE111 100000 on rs 112 +Ethernet112 128,129,130,131 one00GigE112 100000 on rs 113 +Ethernet113 132,133,134,135 one00GigE113 100000 on rs 114 +Ethernet114 136,137,138,139 one00GigE114 100000 on rs 115 +Ethernet115 140,141,142,143 one00GigE115 100000 on rs 116 +Ethernet116 144,145,146,147 one00GigE116 100000 on rs 117 +Ethernet117 148,149,150,151 one00GigE117 100000 on rs 118 +Ethernet118 152,153,154,155 one00GigE118 100000 on rs 119 +Ethernet119 156,157,158,159 one00GigE119 100000 on rs 120 +Ethernet120 160,161,162,163 two00GigE120 200000 on rs 121 +Ethernet121 164,165,166,167 two00GigE121 200000 on rs 122 +Ethernet122 168,169,170,171 two00GigE122 200000 on rs 123 +Ethernet123 172,173,174,175 two00GigE123 200000 on rs 124 +Ethernet124 176,177,178,179 two00GigE124 200000 on rs 125 +Ethernet125 180,181,182,183 two00GigE125 200000 on rs 126 +Ethernet126 184,185,186,187 two00GigE126 200000 on rs 127 +Ethernet127 188,189,190,191 two00GigE127 200000 on rs 128 +Ethernet128 192,193,194,195,196,197,198,199 four00GigE128 400000 on rs 129 +Ethernet129 200,201,202,203,204,205,206,207 four00GigE129 400000 on rs 130 +Ethernet130 208,209,210,211,212,213,214,215 four00GigE130 400000 on rs 131 +Ethernet131 216,217,218,219,220,221,222,223 four00GigE131 400000 on rs 132 +Ethernet132 224,225,226,227,228,229,230,231 four00GigE132 400000 on rs 133 +Ethernet133 232,233,234,235,236,237,238,239 four00GigE133 400000 on rs 134 +Ethernet134 240,241,242,243,244,245,246,247 four00GigE134 400000 on rs 135 +Ethernet135 248,249,250,251,252,253,254,255 four00GigE135 400000 on rs 136 +Ethernet136 256 tenGigE136 10000 off none 137 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/profile.ini b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/profile.ini new file mode 100644 index 000000000000..c2f77685ad0a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/profile.ini @@ -0,0 +1 @@ +switchMacAddress=00:01:02:03:04:05 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/sai.profile b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/sai.profile new file mode 100644 index 000000000000..735e6c221774 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON_DB/sai.profile @@ -0,0 +1,4 @@ +mode=1 +hwId=FC12_8T-DB +switchProfile=/usr/share/sonic/hwsku/SAI-F12_8T-DB.xml +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-Board-F12_8T-48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-Board-F12_8T-48x25G-8x100G.md5 new file mode 100644 index 000000000000..fc1b8e224ee0 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-Board-F12_8T-48x25G-8x100G.md5 @@ -0,0 +1 @@ +bfcdbba53aa3d422d93b9d900c305516 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-Board-F12_8T-48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-Board-F12_8T-48x25G-8x100G.xml new file mode 100644 index 000000000000..6bc7a71b1e7b --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-Board-F12_8T-48x25G-8x100G.xml @@ -0,0 +1,3458 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + Falcon-12.8T-48x25G-8x100G + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F12_8T-48x25G-8x100G.xml + ASK-L1-F12_8T-48x25G-8x100G.xml + sip6 + + 0 + + ethernet_mac + 32 + false + + + NA + + MAP4 + + 0 + + 2 + true + + false + + + + 1 + + ethernet_mac + 33 + false + + + NA + + + + false + + + + 2 + + ethernet_mac + 34 + false + + + NA + + + + false + + + + 3 + + ethernet_mac + 35 + false + + + NA + + + + false + + + + 4 + + ethernet_mac + 40 + false + + + NA + + MAP5 + + 1 + + 2 + true + + false + + + + 5 + + ethernet_mac + 41 + false + + + NA + + + + + 2 + true + + false + + + + 6 + + ethernet_mac + 42 + false + + + NA + + + + + 2 + true + + false + + + + 7 + + ethernet_mac + 43 + false + + + NA + + + + + 2 + true + + false + + + + 8 + + ethernet_mac + 48 + false + + + NA + + MAP6 + + 0 + + 2 + true + + false + + + + 9 + + ethernet_mac + 49 + false + + + NA + + + + + 2 + true + + false + + + + 10 + + ethernet_mac + 50 + false + + + NA + + + + + 2 + true + + false + + + + 11 + + ethernet_mac + 51 + false + + + NA + + + + + 2 + true + + false + + + + 12 + + ethernet_mac + 56 + false + + + NA + + MAP7 + + 1 + + 2 + true + + false + + + + 13 + + ethernet_mac + 57 + false + + + NA + + + + + 2 + true + + false + + + + 14 + + ethernet_mac + 58 + false + + + NA + + + + + 2 + true + + false + + + + 15 + + ethernet_mac + 59 + false + + + NA + + + + + 2 + true + + false + + + + 16 + + ethernet_mac + 64 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 17 + + ethernet_mac + 65 + false + + + NA + + + + + 2 + true + + false + + + + 18 + + ethernet_mac + 66 + false + + + NA + + + + + 2 + true + + false + + + + 19 + + ethernet_mac + 67 + false + + + NA + + + + + 2 + true + + false + + + + 20 + + ethernet_mac + 72 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 21 + + ethernet_mac + 73 + false + + + NA + + + + + 2 + true + + false + + + + 22 + + ethernet_mac + 74 + false + + + NA + + + + + 2 + true + + false + + + + 23 + + ethernet_mac + 75 + false + + + NA + + + + + 2 + true + + false + + + + 24 + + ethernet_mac + 80 + false + + + NA + + MAP2 + + 0 + + 2 + true + + false + + + + 25 + + ethernet_mac + 81 + false + + + NA + + + + + 2 + true + + false + + + + 26 + + ethernet_mac + 82 + false + + + NA + + + + + 2 + true + + false + + + + 27 + + ethernet_mac + 83 + false + + + NA + + + + + 2 + true + + false + + + + 28 + + ethernet_mac + 88 + false + + + NA + + MAP3 + + 1 + + 2 + true + + false + + + + 29 + + ethernet_mac + 89 + false + + + NA + + + + + 2 + true + + false + + + + 30 + + ethernet_mac + 90 + false + + + NA + + + + + 2 + true + + false + + + + 31 + + ethernet_mac + 91 + false + + + NA + + + + + 2 + true + + false + + + + 32 + + ethernet_mac + 96 + false + + + NA + + MAP4 + + 0 + + 2 + true + + false + + + + 33 + + ethernet_mac + 97 + false + + + NA + + + + + 2 + true + + false + + + + 34 + + ethernet_mac + 98 + false + + + NA + + + + + 2 + true + + false + + + + 35 + + ethernet_mac + 99 + false + + + NA + + + + + 2 + true + + false + + + + 36 + + ethernet_mac + 104 + false + + + NA + + MAP5 + + 1 + + 2 + true + + false + + + + 37 + + ethernet_mac + 105 + false + + + NA + + + + + 2 + true + + false + + + + 38 + + ethernet_mac + 106 + false + + + NA + + + + + 2 + true + + false + + + + 39 + + ethernet_mac + 107 + false + + + NA + + + + + 2 + true + + false + + + + 40 + + ethernet_mac + 112 + false + + + NA + + MAP6 + + 0 + + 2 + true + + false + + + + 41 + + ethernet_mac + 113 + false + + + NA + + + + + 2 + true + + false + + + + 42 + + ethernet_mac + 114 + false + + + NA + + + + + 2 + true + + false + + + + 43 + + ethernet_mac + 115 + false + + + NA + + + + + 2 + true + + false + + + + 44 + + ethernet_mac + 120 + false + + + NA + + MAP7 + + 1 + + 2 + true + + false + + + + 45 + + ethernet_mac + 121 + false + + + NA + + + + + 2 + true + + false + + + + 46 + + ethernet_mac + 122 + false + + + NA + + + + + 2 + true + + false + + + + 47 + + ethernet_mac + 123 + false + + + NA + + + + + 2 + true + + false + + + + 48 + + ethernet_mac + 128 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 49 + + ethernet_mac + 136 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 50 + + ethernet_mac + 144 + false + + + NA + + MAP2 + + 0 + + 2 + true + + false + + + + 51 + + ethernet_mac + 152 + false + + + NA + + MAP3 + + 1 + + 2 + true + + false + + + + 52 + + ethernet_mac + 160 + false + + + NA + + MAP4 + + 0 + + 2 + true + + false + + + + 53 + + ethernet_mac + 168 + false + + + NA + + MAP5 + + 1 + + 2 + true + + false + + + + 54 + + ethernet_mac + 176 + false + + + NA + + MAP6 + + 0 + + 2 + true + + false + + + + 55 + + ethernet_mac + 184 + false + + + NA + + MAP7 + + 1 + + 2 + true + + false + + + + 56 + + ethernet_mac + 258 + false + + + NA + + + 2 + + 2 + true + + false + + + + 63 + + cpu_sdma + 273 + false + + + + 57 + + cpu_sdma + 274 + false + + + + 58 + + cpu_sdma + 275 + false + + + + 59 + + cpu_sdma + 276 + false + + + + 32 + false + false + + + 38 + false + false + + + 34 + false + false + + + 39 + false + false + + + 33 + false + false + + + 37 + false + false + + + 36 + false + true + + + 35 + false + false + + + 40 + false + false + + + 45 + false + false + + + 41 + false + true + + + 46 + false + false + + + 42 + false + false + + + 47 + false + false + + + 44 + false + false + + + 43 + false + false + + + 50 + false + false + + + 54 + false + false + + + 49 + false + false + + + 51 + false + false + + + 48 + false + false + + + 52 + false + false + + + 53 + false + false + + + 55 + false + false + + + 57 + false + false + + + 62 + false + false + + + 58 + false + false + + + 63 + false + false + + + 56 + false + false + + + 60 + false + false + + + 59 + false + false + + + 61 + false + false + + + 64 + false + true + + + 71 + false + false + + + 66 + false + true + + + 68 + false + true + + + 65 + false + true + + + 69 + false + false + + + 67 + false + false + + + 70 + false + true + + + 72 + false + false + + + 77 + false + true + + + 73 + false + false + + + 79 + false + true + + + 75 + false + true + + + 74 + false + true + + + 76 + false + true + + + 78 + false + true + + + 81 + false + true + + + 85 + false + true + + + 80 + false + true + + + 87 + false + true + + + 84 + false + false + + + 82 + false + false + + + 83 + false + false + + + 86 + false + false + + + 88 + false + false + + + 94 + false + false + + + 89 + false + false + + + 95 + false + false + + + 90 + false + true + + + 91 + false + true + + + 92 + false + true + + + 93 + false + true + + + 96 + false + true + + + 102 + false + true + + + 98 + false + true + + + 103 + false + true + + + 97 + false + true + + + 101 + false + false + + + 100 + false + true + + + 99 + false + true + + + 104 + false + true + + + 109 + false + true + + + 105 + false + false + + + 110 + false + true + + + 106 + false + false + + + 111 + false + true + + + 108 + false + true + + + 107 + false + true + + + 114 + false + true + + + 118 + false + true + + + 113 + false + true + + + 115 + false + true + + + 112 + false + true + + + 116 + false + true + + + 117 + false + true + + + 119 + false + true + + + 121 + false + true + + + 126 + false + true + + + 122 + false + true + + + 127 + false + false + + + 120 + false + true + + + 124 + false + true + + + 123 + false + true + + + 125 + false + false + + + 128 + false + true + + + 135 + false + false + + + 130 + false + true + + + 132 + false + true + + + 129 + false + true + + + 133 + false + true + + + 131 + false + false + + + 134 + false + true + + + 136 + false + true + + + 141 + false + true + + + 137 + false + true + + + 143 + false + true + + + 139 + false + true + + + 138 + false + true + + + 140 + false + false + + + 142 + false + true + + + 145 + false + true + + + 149 + false + true + + + 144 + false + true + + + 151 + false + true + + + 148 + false + true + + + 146 + false + false + + + 147 + false + true + + + 150 + false + false + + + 152 + false + false + + + 158 + false + false + + + 153 + false + false + + + 159 + false + false + + + 154 + false + true + + + 155 + false + true + + + 156 + false + true + + + 157 + false + true + + + 160 + false + true + + + 166 + false + true + + + 162 + false + true + + + 167 + false + true + + + 161 + false + true + + + 165 + false + false + + + 164 + false + true + + + 163 + false + true + + + 168 + false + true + + + 173 + false + true + + + 169 + false + false + + + 174 + false + true + + + 170 + false + false + + + 175 + false + true + + + 176 + false + true + + + 172 + false + true + + + 171 + false + true + + + 178 + false + true + + + 182 + false + true + + + 177 + false + true + + + 179 + false + true + + + 180 + false + true + + + 181 + false + true + + + 183 + false + true + + + 185 + false + true + + + 190 + false + true + + + 186 + false + true + + + 191 + false + false + + + 184 + false + true + + + 188 + false + true + + + 187 + false + true + + + 189 + false + true + + + 192 + false + false + + + 199 + false + false + + + 194 + false + true + + + 196 + false + false + + + 193 + false + false + + + 197 + false + false + + + 195 + false + false + + + 198 + false + false + + + 200 + true + true + + + 205 + false + false + + + 201 + false + true + + + 207 + false + false + + + 203 + false + true + + + 202 + false + false + + + 204 + false + false + + + 206 + false + false + + + 209 + false + true + + + 213 + false + false + + + 208 + false + false + + + 215 + false + true + + + 212 + false + false + + + 210 + false + false + + + 211 + false + false + + + 214 + false + false + + + 216 + false + true + + + 222 + false + false + + + 217 + false + true + + + 223 + false + false + + + 218 + false + true + + + 219 + false + false + + + 220 + false + true + + + 221 + false + false + + + 224 + false + true + + + 230 + false + false + + + 226 + false + false + + + 231 + false + true + + + 225 + false + true + + + 229 + false + false + + + 228 + false + true + + + 227 + false + true + + + 232 + false + false + + + 237 + false + false + + + 233 + false + true + + + 238 + false + false + + + 234 + false + true + + + 239 + false + false + + + 236 + false + true + + + 235 + false + false + + + 242 + false + true + + + 246 + false + false + + + 241 + false + false + + + 243 + false + true + + + 240 + false + false + + + 244 + false + false + + + 245 + false + false + + + 247 + false + false + + + 249 + false + false + + + 254 + false + false + + + 250 + false + false + + + 255 + false + false + + + 248 + false + false + + + 252 + false + false + + + 251 + false + true + + + 253 + false + true + + + 0 + true + false + + + 7 + false + false + + + 2 + false + true + + + 4 + false + false + + + 1 + false + false + + + 5 + false + false + + + 3 + false + false + + + 6 + false + false + + + 8 + false + false + + + 13 + false + false + + + 9 + false + false + + + 15 + false + false + + + 11 + false + true + + + 10 + false + false + + + 12 + false + false + + + 14 + false + false + + + 17 + false + false + + + 21 + false + false + + + 16 + false + false + + + 23 + false + false + + + 20 + false + false + + + 18 + false + false + + + 19 + false + false + + + 22 + false + false + + + 24 + false + true + + + 30 + false + false + + + 25 + false + false + + + 31 + false + false + + + 26 + false + true + + + 27 + false + false + + + 28 + false + true + + + 29 + false + false + + + 0 + + ORDER_MODE_BY_CLASS + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_0 + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_1 + PULSE_STRETCH_1 + false + 1627 + false + + 1 + 64 + 66 + false + + + 2 + 64 + 65 + false + + + 3 + 64 + 65 + false + + + 4 + 64 + 66 + false + + + 5 + 64 + 66 + false + + + 6 + 64 + 65 + false + + + 7 + 64 + 65 + false + + + 8 + 64 + 66 + false + + + + 0 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 1 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 2 + PORT_TYPE_XG + true + BLINK_SELECT_0 + false + true + true + + + 3 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 4 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 5 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + + /tmp/cpss_uds + + 8 + + MAP0 + + 0 + + + 7 + + + 2 + + + 4 + + + 1 + + + 5 + + + 3 + + + 6 + + + + MAP1 + + 0 + + + 5 + + + 1 + + + 7 + + + 3 + + + 2 + + + 4 + + + 6 + + + + MAP2 + + 1 + + + 5 + + + 0 + + + 7 + + + 4 + + + 2 + + + 3 + + + 6 + + + + MAP3 + + 0 + + + 6 + + + 1 + + + 7 + + + 2 + + + 3 + + + 4 + + + 5 + + + + MAP4 + + 0 + + + 6 + + + 2 + + + 7 + + + 1 + + + 5 + + + 4 + + + 3 + + + + MAP5 + + 0 + + + 5 + + + 1 + + + 6 + + + 2 + + + 7 + + + 4 + + + 3 + + + + MAP6 + + 2 + + + 6 + + + 1 + + + 3 + + + 0 + + + 4 + + + 5 + + + 7 + + + + MAP7 + + 1 + + + 6 + + + 2 + + + 7 + + + 0 + + + 4 + + + 3 + + + 5 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-L1-F12_8T-48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-L1-F12_8T-48x25G-8x100G.md5 new file mode 100644 index 000000000000..80f5a48191a5 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-L1-F12_8T-48x25G-8x100G.md5 @@ -0,0 +1 @@ +bae90780b221c3059c83112fab4abca5 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-L1-F12_8T-48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-L1-F12_8T-48x25G-8x100G.xml new file mode 100644 index 000000000000..796023cd7a37 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-L1-F12_8T-48x25G-8x100G.xml @@ -0,0 +1,1246 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 100GR4 + + CR4 + 100G + rs_enabled + + + KR4 + 100G + rs_enabled + + + SR_LR4 + 100G + rs_enabled + + + CR4 + 100G + rs_enabled + rs_enabled + + + KR4 + 100G + rs_enabled + rs_enabled + + + + 10GR1Fix + + KR + 10G + disabled + + + + 25GR1 + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 25GR1 + + + 1 + AVAGO + profile_default + 25GR1 + + + 2 + AVAGO + profile_default + 25GR1 + + + 3 + AVAGO + profile_default + 25GR1 + + + 4 + AVAGO + profile_default + 25GR1 + + + 5 + AVAGO + profile_default + 25GR1 + + + 6 + AVAGO + profile_default + 25GR1 + + + 7 + AVAGO + profile_default + 25GR1 + + + 8 + AVAGO + profile_default + 25GR1 + + + 9 + AVAGO + profile_default + 25GR1 + + + 10 + AVAGO + profile_default + 25GR1 + + + 11 + AVAGO + profile_default + 25GR1 + + + 12 + AVAGO + profile_default + 25GR1 + + + 13 + AVAGO + profile_default + 25GR1 + + + 14 + AVAGO + profile_default + 25GR1 + + + 15 + AVAGO + profile_default + 25GR1 + + + 16 + AVAGO + profile_default + 25GR1 + + + 17 + AVAGO + profile_default + 25GR1 + + + 18 + AVAGO + profile_default + 25GR1 + + + 19 + AVAGO + profile_default + 25GR1 + + + 20 + AVAGO + profile_default + 25GR1 + + + 21 + AVAGO + profile_default + 25GR1 + + + 22 + AVAGO + profile_default + 25GR1 + + + 23 + AVAGO + profile_default + 25GR1 + + + 24 + AVAGO + profile_default + 25GR1 + + + 25 + AVAGO + profile_default + 25GR1 + + + 26 + AVAGO + profile_default + 25GR1 + + + 27 + AVAGO + profile_default + 25GR1 + + + 28 + AVAGO + profile_default + 25GR1 + + + 29 + AVAGO + profile_default + 25GR1 + + + 30 + AVAGO + profile_default + 25GR1 + + + 31 + AVAGO + profile_default + 25GR1 + + + 32 + AVAGO + profile_default + 25GR1 + + + 33 + AVAGO + profile_default + 25GR1 + + + 34 + AVAGO + profile_default + 25GR1 + + + 35 + AVAGO + profile_default + 25GR1 + + + 36 + AVAGO + profile_default + 25GR1 + + + 37 + AVAGO + profile_default + 25GR1 + + + 38 + AVAGO + profile_default + 25GR1 + + + 39 + AVAGO + profile_default + 25GR1 + + + 40 + AVAGO + profile_default + 25GR1 + + + 41 + AVAGO + profile_default + 25GR1 + + + 42 + AVAGO + profile_default + 25GR1 + + + 43 + AVAGO + profile_default + 25GR1 + + + 44 + AVAGO + profile_default + 25GR1 + + + 45 + AVAGO + profile_default + 25GR1 + + + 46 + AVAGO + profile_default + 25GR1 + + + 47 + AVAGO + profile_default + 25GR1 + + + 48 + AVAGO + profile_default + 100GR4 + + + 49 + AVAGO + profile_default + 100GR4 + + + 50 + AVAGO + profile_default + 100GR4 + + + 51 + AVAGO + profile_default + 100GR4 + + + 52 + AVAGO + profile_default + 100GR4 + + + 53 + AVAGO + profile_default + 100GR4 + + + 54 + AVAGO + profile_default + 100GR4 + + + 55 + AVAGO + profile_default + 100GR4 + + + 56 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-PP-F12_8T-48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-PP-F12_8T-48x25G-8x100G.md5 new file mode 100644 index 000000000000..3c28079976c6 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-PP-F12_8T-48x25G-8x100G.md5 @@ -0,0 +1 @@ +1ed6046358d99524cdf9cd9e136a0efa \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-PP-F12_8T-48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-PP-F12_8T-48x25G-8x100G.xml new file mode 100644 index 000000000000..e3239589f006 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/ASK-PP-F12_8T-48x25G-8x100G.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-12.8 + + 4294967295 + external_25_single_ended + 2 + 60 + 64-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/SAI-F12_8T-48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/SAI-F12_8T-48x25G-8x100G.md5 new file mode 100644 index 000000000000..c01137b77a96 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/SAI-F12_8T-48x25G-8x100G.md5 @@ -0,0 +1 @@ +68eb84de73105b7ea023989d8e8ebd13 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/SAI-F12_8T-48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/SAI-F12_8T-48x25G-8x100G.xml new file mode 100644 index 000000000000..7039fa0dafda --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/SAI-F12_8T-48x25G-8x100G.xml @@ -0,0 +1,518 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F12_8T-48x25G-8x100G.xml + + + 0 + 0 + 47 + + + 1 + 0 + 46 + + + 2 + 0 + 45 + + + 3 + 0 + 44 + + + 4 + 0 + 43 + + + 5 + 0 + 42 + + + 6 + 0 + 41 + + + 7 + 0 + 40 + + + 8 + 0 + 39 + + + 9 + 0 + 38 + + + 10 + 0 + 37 + + + 11 + 0 + 36 + + + 12 + 0 + 35 + + + 13 + 0 + 34 + + + 14 + 0 + 33 + + + 15 + 0 + 32 + + + 16 + 0 + 31 + + + 17 + 0 + 30 + + + 18 + 0 + 29 + + + 19 + 0 + 28 + + + 20 + 0 + 27 + + + 21 + 0 + 26 + + + 22 + 0 + 25 + + + 23 + 0 + 24 + + + 24 + 0 + 23 + + + 25 + 0 + 22 + + + 26 + 0 + 21 + + + 27 + 0 + 20 + + + 28 + 0 + 19 + + + 29 + 0 + 18 + + + 30 + 0 + 17 + + + 31 + 0 + 16 + + + 32 + 0 + 15 + + + 33 + 0 + 14 + + + 34 + 0 + 13 + + + 35 + 0 + 12 + + + 36 + 0 + 11 + + + 37 + 0 + 10 + + + 38 + 0 + 9 + + + 39 + 0 + 8 + + + 40 + 0 + 7 + + + 41 + 0 + 6 + + + 42 + 0 + 5 + + + 43 + 0 + 4 + + + 44 + 0 + 3 + + + 45 + 0 + 2 + + + 46 + 0 + 1 + + + 47 + 0 + 0 + + + 48 + 0 + 55 + + + 52 + 0 + 54 + + + 56 + 0 + 53 + + + 60 + 0 + 52 + + + 64 + 0 + 51 + + + 68 + 0 + 50 + + + 72 + 0 + 49 + + + 76 + 0 + 48 + + + 80 + 0 + 56 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/buffers_defaults_t0.j2 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/buffers_defaults_t0.j2 similarity index 100% rename from device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/buffers_defaults_t0.j2 rename to device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/buffers_defaults_t0.j2 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/buffers_defaults_t1.j2 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/buffers_defaults_t1.j2 similarity index 100% rename from device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FALCON32x400G/buffers_defaults_t1.j2 rename to device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/buffers_defaults_t1.j2 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/port_config.ini b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/port_config.ini new file mode 100644 index 000000000000..a1ee6d9bb6db --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/port_config.ini @@ -0,0 +1,58 @@ +# name lanes alias speed autoneg fec index +Ethernet0 0 twenty5GigE0 25000 on none 1 +Ethernet1 1 twenty5GigE1 25000 on none 2 +Ethernet2 2 twenty5GigE2 25000 on none 3 +Ethernet3 3 twenty5GigE3 25000 on none 4 +Ethernet4 4 twenty5GigE4 25000 on none 5 +Ethernet5 5 twenty5GigE5 25000 on none 6 +Ethernet6 6 twenty5GigE6 25000 on none 7 +Ethernet7 7 twenty5GigE7 25000 on none 8 +Ethernet8 8 twenty5GigE8 25000 on none 9 +Ethernet9 9 twenty5GigE9 25000 on none 10 +Ethernet10 10 twenty5GigE10 25000 on none 11 +Ethernet11 11 twenty5GigE11 25000 on none 12 +Ethernet12 12 twenty5GigE12 25000 on none 13 +Ethernet13 13 twenty5GigE13 25000 on none 14 +Ethernet14 14 twenty5GigE14 25000 on none 15 +Ethernet15 15 twenty5GigE15 25000 on none 16 +Ethernet16 16 twenty5GigE16 25000 on none 17 +Ethernet17 17 twenty5GigE17 25000 on none 18 +Ethernet18 18 twenty5GigE18 25000 on none 19 +Ethernet19 19 twenty5GigE19 25000 on none 20 +Ethernet20 20 twenty5GigE20 25000 on none 21 +Ethernet21 21 twenty5GigE21 25000 on none 22 +Ethernet22 22 twenty5GigE22 25000 on none 23 +Ethernet23 23 twenty5GigE23 25000 on none 24 +Ethernet24 24 twenty5GigE24 25000 on none 25 +Ethernet25 25 twenty5GigE25 25000 on none 26 +Ethernet26 26 twenty5GigE26 25000 on none 27 +Ethernet27 27 twenty5GigE27 25000 on none 28 +Ethernet28 28 twenty5GigE28 25000 on none 29 +Ethernet29 29 twenty5GigE29 25000 on none 30 +Ethernet30 30 twenty5GigE30 25000 on none 31 +Ethernet31 31 twenty5GigE31 25000 on none 32 +Ethernet32 32 twenty5GigE32 25000 on none 33 +Ethernet33 33 twenty5GigE33 25000 on none 34 +Ethernet34 34 twenty5GigE34 25000 on none 35 +Ethernet35 35 twenty5GigE35 25000 on none 36 +Ethernet36 36 twenty5GigE36 25000 on none 37 +Ethernet37 37 twenty5GigE37 25000 on none 38 +Ethernet38 38 twenty5GigE38 25000 on none 39 +Ethernet39 39 twenty5GigE39 25000 on none 40 +Ethernet40 40 twenty5GigE40 25000 on none 41 +Ethernet41 41 twenty5GigE41 25000 on none 42 +Ethernet42 42 twenty5GigE42 25000 on none 43 +Ethernet43 43 twenty5GigE43 25000 on none 44 +Ethernet44 44 twenty5GigE44 25000 on none 45 +Ethernet45 45 twenty5GigE45 25000 on none 46 +Ethernet46 46 twenty5GigE46 25000 on none 47 +Ethernet47 47 twenty5GigE47 25000 on none 48 +Ethernet48 48,49,50,51 one00GigE48 100000 on rs 49 +Ethernet49 52,53,54,55 one00GigE49 100000 on rs 50 +Ethernet50 56,57,58,59 one00GigE113 100000 on rs 51 +Ethernet51 60,61,62,63 one00GigE114 100000 on rs 52 +Ethernet52 64,65,66,67 one00GigE115 100000 on rs 53 +Ethernet53 68,69,70,71 one00GigE116 100000 on rs 54 +Ethernet54 72,73,74,75 one00GigE117 100000 on rs 55 +Ethernet55 76,77,78,79 one00GigE118 100000 on rs 56 +Ethernet56 80 tenGigE136 10000 off none 57 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/profile.ini b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/profile.ini new file mode 100644 index 000000000000..c2f77685ad0a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/profile.ini @@ -0,0 +1 @@ +switchMacAddress=00:01:02:03:04:05 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/sai.profile b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/sai.profile new file mode 100644 index 000000000000..8f6edc9ae77f --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/FC48x25G8x100GR4/sai.profile @@ -0,0 +1,4 @@ +mode=1 +hwId=FC48x25G8x100GR4 +switchProfile=/usr/share/sonic/hwsku/SAI-F12_8T-48x25G-8x100G.xml +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-Board-F12_8T-48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-Board-F12_8T-48x25G-8x100G.md5 new file mode 100644 index 000000000000..fc1b8e224ee0 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-Board-F12_8T-48x25G-8x100G.md5 @@ -0,0 +1 @@ +bfcdbba53aa3d422d93b9d900c305516 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-Board-F12_8T-48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-Board-F12_8T-48x25G-8x100G.xml new file mode 100644 index 000000000000..6bc7a71b1e7b --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-Board-F12_8T-48x25G-8x100G.xml @@ -0,0 +1,3458 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + Falcon-12.8T-48x25G-8x100G + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F12_8T-48x25G-8x100G.xml + ASK-L1-F12_8T-48x25G-8x100G.xml + sip6 + + 0 + + ethernet_mac + 32 + false + + + NA + + MAP4 + + 0 + + 2 + true + + false + + + + 1 + + ethernet_mac + 33 + false + + + NA + + + + false + + + + 2 + + ethernet_mac + 34 + false + + + NA + + + + false + + + + 3 + + ethernet_mac + 35 + false + + + NA + + + + false + + + + 4 + + ethernet_mac + 40 + false + + + NA + + MAP5 + + 1 + + 2 + true + + false + + + + 5 + + ethernet_mac + 41 + false + + + NA + + + + + 2 + true + + false + + + + 6 + + ethernet_mac + 42 + false + + + NA + + + + + 2 + true + + false + + + + 7 + + ethernet_mac + 43 + false + + + NA + + + + + 2 + true + + false + + + + 8 + + ethernet_mac + 48 + false + + + NA + + MAP6 + + 0 + + 2 + true + + false + + + + 9 + + ethernet_mac + 49 + false + + + NA + + + + + 2 + true + + false + + + + 10 + + ethernet_mac + 50 + false + + + NA + + + + + 2 + true + + false + + + + 11 + + ethernet_mac + 51 + false + + + NA + + + + + 2 + true + + false + + + + 12 + + ethernet_mac + 56 + false + + + NA + + MAP7 + + 1 + + 2 + true + + false + + + + 13 + + ethernet_mac + 57 + false + + + NA + + + + + 2 + true + + false + + + + 14 + + ethernet_mac + 58 + false + + + NA + + + + + 2 + true + + false + + + + 15 + + ethernet_mac + 59 + false + + + NA + + + + + 2 + true + + false + + + + 16 + + ethernet_mac + 64 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 17 + + ethernet_mac + 65 + false + + + NA + + + + + 2 + true + + false + + + + 18 + + ethernet_mac + 66 + false + + + NA + + + + + 2 + true + + false + + + + 19 + + ethernet_mac + 67 + false + + + NA + + + + + 2 + true + + false + + + + 20 + + ethernet_mac + 72 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 21 + + ethernet_mac + 73 + false + + + NA + + + + + 2 + true + + false + + + + 22 + + ethernet_mac + 74 + false + + + NA + + + + + 2 + true + + false + + + + 23 + + ethernet_mac + 75 + false + + + NA + + + + + 2 + true + + false + + + + 24 + + ethernet_mac + 80 + false + + + NA + + MAP2 + + 0 + + 2 + true + + false + + + + 25 + + ethernet_mac + 81 + false + + + NA + + + + + 2 + true + + false + + + + 26 + + ethernet_mac + 82 + false + + + NA + + + + + 2 + true + + false + + + + 27 + + ethernet_mac + 83 + false + + + NA + + + + + 2 + true + + false + + + + 28 + + ethernet_mac + 88 + false + + + NA + + MAP3 + + 1 + + 2 + true + + false + + + + 29 + + ethernet_mac + 89 + false + + + NA + + + + + 2 + true + + false + + + + 30 + + ethernet_mac + 90 + false + + + NA + + + + + 2 + true + + false + + + + 31 + + ethernet_mac + 91 + false + + + NA + + + + + 2 + true + + false + + + + 32 + + ethernet_mac + 96 + false + + + NA + + MAP4 + + 0 + + 2 + true + + false + + + + 33 + + ethernet_mac + 97 + false + + + NA + + + + + 2 + true + + false + + + + 34 + + ethernet_mac + 98 + false + + + NA + + + + + 2 + true + + false + + + + 35 + + ethernet_mac + 99 + false + + + NA + + + + + 2 + true + + false + + + + 36 + + ethernet_mac + 104 + false + + + NA + + MAP5 + + 1 + + 2 + true + + false + + + + 37 + + ethernet_mac + 105 + false + + + NA + + + + + 2 + true + + false + + + + 38 + + ethernet_mac + 106 + false + + + NA + + + + + 2 + true + + false + + + + 39 + + ethernet_mac + 107 + false + + + NA + + + + + 2 + true + + false + + + + 40 + + ethernet_mac + 112 + false + + + NA + + MAP6 + + 0 + + 2 + true + + false + + + + 41 + + ethernet_mac + 113 + false + + + NA + + + + + 2 + true + + false + + + + 42 + + ethernet_mac + 114 + false + + + NA + + + + + 2 + true + + false + + + + 43 + + ethernet_mac + 115 + false + + + NA + + + + + 2 + true + + false + + + + 44 + + ethernet_mac + 120 + false + + + NA + + MAP7 + + 1 + + 2 + true + + false + + + + 45 + + ethernet_mac + 121 + false + + + NA + + + + + 2 + true + + false + + + + 46 + + ethernet_mac + 122 + false + + + NA + + + + + 2 + true + + false + + + + 47 + + ethernet_mac + 123 + false + + + NA + + + + + 2 + true + + false + + + + 48 + + ethernet_mac + 128 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 49 + + ethernet_mac + 136 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 50 + + ethernet_mac + 144 + false + + + NA + + MAP2 + + 0 + + 2 + true + + false + + + + 51 + + ethernet_mac + 152 + false + + + NA + + MAP3 + + 1 + + 2 + true + + false + + + + 52 + + ethernet_mac + 160 + false + + + NA + + MAP4 + + 0 + + 2 + true + + false + + + + 53 + + ethernet_mac + 168 + false + + + NA + + MAP5 + + 1 + + 2 + true + + false + + + + 54 + + ethernet_mac + 176 + false + + + NA + + MAP6 + + 0 + + 2 + true + + false + + + + 55 + + ethernet_mac + 184 + false + + + NA + + MAP7 + + 1 + + 2 + true + + false + + + + 56 + + ethernet_mac + 258 + false + + + NA + + + 2 + + 2 + true + + false + + + + 63 + + cpu_sdma + 273 + false + + + + 57 + + cpu_sdma + 274 + false + + + + 58 + + cpu_sdma + 275 + false + + + + 59 + + cpu_sdma + 276 + false + + + + 32 + false + false + + + 38 + false + false + + + 34 + false + false + + + 39 + false + false + + + 33 + false + false + + + 37 + false + false + + + 36 + false + true + + + 35 + false + false + + + 40 + false + false + + + 45 + false + false + + + 41 + false + true + + + 46 + false + false + + + 42 + false + false + + + 47 + false + false + + + 44 + false + false + + + 43 + false + false + + + 50 + false + false + + + 54 + false + false + + + 49 + false + false + + + 51 + false + false + + + 48 + false + false + + + 52 + false + false + + + 53 + false + false + + + 55 + false + false + + + 57 + false + false + + + 62 + false + false + + + 58 + false + false + + + 63 + false + false + + + 56 + false + false + + + 60 + false + false + + + 59 + false + false + + + 61 + false + false + + + 64 + false + true + + + 71 + false + false + + + 66 + false + true + + + 68 + false + true + + + 65 + false + true + + + 69 + false + false + + + 67 + false + false + + + 70 + false + true + + + 72 + false + false + + + 77 + false + true + + + 73 + false + false + + + 79 + false + true + + + 75 + false + true + + + 74 + false + true + + + 76 + false + true + + + 78 + false + true + + + 81 + false + true + + + 85 + false + true + + + 80 + false + true + + + 87 + false + true + + + 84 + false + false + + + 82 + false + false + + + 83 + false + false + + + 86 + false + false + + + 88 + false + false + + + 94 + false + false + + + 89 + false + false + + + 95 + false + false + + + 90 + false + true + + + 91 + false + true + + + 92 + false + true + + + 93 + false + true + + + 96 + false + true + + + 102 + false + true + + + 98 + false + true + + + 103 + false + true + + + 97 + false + true + + + 101 + false + false + + + 100 + false + true + + + 99 + false + true + + + 104 + false + true + + + 109 + false + true + + + 105 + false + false + + + 110 + false + true + + + 106 + false + false + + + 111 + false + true + + + 108 + false + true + + + 107 + false + true + + + 114 + false + true + + + 118 + false + true + + + 113 + false + true + + + 115 + false + true + + + 112 + false + true + + + 116 + false + true + + + 117 + false + true + + + 119 + false + true + + + 121 + false + true + + + 126 + false + true + + + 122 + false + true + + + 127 + false + false + + + 120 + false + true + + + 124 + false + true + + + 123 + false + true + + + 125 + false + false + + + 128 + false + true + + + 135 + false + false + + + 130 + false + true + + + 132 + false + true + + + 129 + false + true + + + 133 + false + true + + + 131 + false + false + + + 134 + false + true + + + 136 + false + true + + + 141 + false + true + + + 137 + false + true + + + 143 + false + true + + + 139 + false + true + + + 138 + false + true + + + 140 + false + false + + + 142 + false + true + + + 145 + false + true + + + 149 + false + true + + + 144 + false + true + + + 151 + false + true + + + 148 + false + true + + + 146 + false + false + + + 147 + false + true + + + 150 + false + false + + + 152 + false + false + + + 158 + false + false + + + 153 + false + false + + + 159 + false + false + + + 154 + false + true + + + 155 + false + true + + + 156 + false + true + + + 157 + false + true + + + 160 + false + true + + + 166 + false + true + + + 162 + false + true + + + 167 + false + true + + + 161 + false + true + + + 165 + false + false + + + 164 + false + true + + + 163 + false + true + + + 168 + false + true + + + 173 + false + true + + + 169 + false + false + + + 174 + false + true + + + 170 + false + false + + + 175 + false + true + + + 176 + false + true + + + 172 + false + true + + + 171 + false + true + + + 178 + false + true + + + 182 + false + true + + + 177 + false + true + + + 179 + false + true + + + 180 + false + true + + + 181 + false + true + + + 183 + false + true + + + 185 + false + true + + + 190 + false + true + + + 186 + false + true + + + 191 + false + false + + + 184 + false + true + + + 188 + false + true + + + 187 + false + true + + + 189 + false + true + + + 192 + false + false + + + 199 + false + false + + + 194 + false + true + + + 196 + false + false + + + 193 + false + false + + + 197 + false + false + + + 195 + false + false + + + 198 + false + false + + + 200 + true + true + + + 205 + false + false + + + 201 + false + true + + + 207 + false + false + + + 203 + false + true + + + 202 + false + false + + + 204 + false + false + + + 206 + false + false + + + 209 + false + true + + + 213 + false + false + + + 208 + false + false + + + 215 + false + true + + + 212 + false + false + + + 210 + false + false + + + 211 + false + false + + + 214 + false + false + + + 216 + false + true + + + 222 + false + false + + + 217 + false + true + + + 223 + false + false + + + 218 + false + true + + + 219 + false + false + + + 220 + false + true + + + 221 + false + false + + + 224 + false + true + + + 230 + false + false + + + 226 + false + false + + + 231 + false + true + + + 225 + false + true + + + 229 + false + false + + + 228 + false + true + + + 227 + false + true + + + 232 + false + false + + + 237 + false + false + + + 233 + false + true + + + 238 + false + false + + + 234 + false + true + + + 239 + false + false + + + 236 + false + true + + + 235 + false + false + + + 242 + false + true + + + 246 + false + false + + + 241 + false + false + + + 243 + false + true + + + 240 + false + false + + + 244 + false + false + + + 245 + false + false + + + 247 + false + false + + + 249 + false + false + + + 254 + false + false + + + 250 + false + false + + + 255 + false + false + + + 248 + false + false + + + 252 + false + false + + + 251 + false + true + + + 253 + false + true + + + 0 + true + false + + + 7 + false + false + + + 2 + false + true + + + 4 + false + false + + + 1 + false + false + + + 5 + false + false + + + 3 + false + false + + + 6 + false + false + + + 8 + false + false + + + 13 + false + false + + + 9 + false + false + + + 15 + false + false + + + 11 + false + true + + + 10 + false + false + + + 12 + false + false + + + 14 + false + false + + + 17 + false + false + + + 21 + false + false + + + 16 + false + false + + + 23 + false + false + + + 20 + false + false + + + 18 + false + false + + + 19 + false + false + + + 22 + false + false + + + 24 + false + true + + + 30 + false + false + + + 25 + false + false + + + 31 + false + false + + + 26 + false + true + + + 27 + false + false + + + 28 + false + true + + + 29 + false + false + + + 0 + + ORDER_MODE_BY_CLASS + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_0 + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_1 + PULSE_STRETCH_1 + false + 1627 + false + + 1 + 64 + 66 + false + + + 2 + 64 + 65 + false + + + 3 + 64 + 65 + false + + + 4 + 64 + 66 + false + + + 5 + 64 + 66 + false + + + 6 + 64 + 65 + false + + + 7 + 64 + 65 + false + + + 8 + 64 + 66 + false + + + + 0 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 1 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 2 + PORT_TYPE_XG + true + BLINK_SELECT_0 + false + true + true + + + 3 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 4 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 5 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + + /tmp/cpss_uds + + 8 + + MAP0 + + 0 + + + 7 + + + 2 + + + 4 + + + 1 + + + 5 + + + 3 + + + 6 + + + + MAP1 + + 0 + + + 5 + + + 1 + + + 7 + + + 3 + + + 2 + + + 4 + + + 6 + + + + MAP2 + + 1 + + + 5 + + + 0 + + + 7 + + + 4 + + + 2 + + + 3 + + + 6 + + + + MAP3 + + 0 + + + 6 + + + 1 + + + 7 + + + 2 + + + 3 + + + 4 + + + 5 + + + + MAP4 + + 0 + + + 6 + + + 2 + + + 7 + + + 1 + + + 5 + + + 4 + + + 3 + + + + MAP5 + + 0 + + + 5 + + + 1 + + + 6 + + + 2 + + + 7 + + + 4 + + + 3 + + + + MAP6 + + 2 + + + 6 + + + 1 + + + 3 + + + 0 + + + 4 + + + 5 + + + 7 + + + + MAP7 + + 1 + + + 6 + + + 2 + + + 7 + + + 0 + + + 4 + + + 3 + + + 5 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-L1-F12_8T-48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-L1-F12_8T-48x25G-8x100G.md5 new file mode 100644 index 000000000000..80f5a48191a5 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-L1-F12_8T-48x25G-8x100G.md5 @@ -0,0 +1 @@ +bae90780b221c3059c83112fab4abca5 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-L1-F12_8T-48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-L1-F12_8T-48x25G-8x100G.xml new file mode 100644 index 000000000000..796023cd7a37 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-L1-F12_8T-48x25G-8x100G.xml @@ -0,0 +1,1246 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 100GR4 + + CR4 + 100G + rs_enabled + + + KR4 + 100G + rs_enabled + + + SR_LR4 + 100G + rs_enabled + + + CR4 + 100G + rs_enabled + rs_enabled + + + KR4 + 100G + rs_enabled + rs_enabled + + + + 10GR1Fix + + KR + 10G + disabled + + + + 25GR1 + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 25GR1 + + + 1 + AVAGO + profile_default + 25GR1 + + + 2 + AVAGO + profile_default + 25GR1 + + + 3 + AVAGO + profile_default + 25GR1 + + + 4 + AVAGO + profile_default + 25GR1 + + + 5 + AVAGO + profile_default + 25GR1 + + + 6 + AVAGO + profile_default + 25GR1 + + + 7 + AVAGO + profile_default + 25GR1 + + + 8 + AVAGO + profile_default + 25GR1 + + + 9 + AVAGO + profile_default + 25GR1 + + + 10 + AVAGO + profile_default + 25GR1 + + + 11 + AVAGO + profile_default + 25GR1 + + + 12 + AVAGO + profile_default + 25GR1 + + + 13 + AVAGO + profile_default + 25GR1 + + + 14 + AVAGO + profile_default + 25GR1 + + + 15 + AVAGO + profile_default + 25GR1 + + + 16 + AVAGO + profile_default + 25GR1 + + + 17 + AVAGO + profile_default + 25GR1 + + + 18 + AVAGO + profile_default + 25GR1 + + + 19 + AVAGO + profile_default + 25GR1 + + + 20 + AVAGO + profile_default + 25GR1 + + + 21 + AVAGO + profile_default + 25GR1 + + + 22 + AVAGO + profile_default + 25GR1 + + + 23 + AVAGO + profile_default + 25GR1 + + + 24 + AVAGO + profile_default + 25GR1 + + + 25 + AVAGO + profile_default + 25GR1 + + + 26 + AVAGO + profile_default + 25GR1 + + + 27 + AVAGO + profile_default + 25GR1 + + + 28 + AVAGO + profile_default + 25GR1 + + + 29 + AVAGO + profile_default + 25GR1 + + + 30 + AVAGO + profile_default + 25GR1 + + + 31 + AVAGO + profile_default + 25GR1 + + + 32 + AVAGO + profile_default + 25GR1 + + + 33 + AVAGO + profile_default + 25GR1 + + + 34 + AVAGO + profile_default + 25GR1 + + + 35 + AVAGO + profile_default + 25GR1 + + + 36 + AVAGO + profile_default + 25GR1 + + + 37 + AVAGO + profile_default + 25GR1 + + + 38 + AVAGO + profile_default + 25GR1 + + + 39 + AVAGO + profile_default + 25GR1 + + + 40 + AVAGO + profile_default + 25GR1 + + + 41 + AVAGO + profile_default + 25GR1 + + + 42 + AVAGO + profile_default + 25GR1 + + + 43 + AVAGO + profile_default + 25GR1 + + + 44 + AVAGO + profile_default + 25GR1 + + + 45 + AVAGO + profile_default + 25GR1 + + + 46 + AVAGO + profile_default + 25GR1 + + + 47 + AVAGO + profile_default + 25GR1 + + + 48 + AVAGO + profile_default + 100GR4 + + + 49 + AVAGO + profile_default + 100GR4 + + + 50 + AVAGO + profile_default + 100GR4 + + + 51 + AVAGO + profile_default + 100GR4 + + + 52 + AVAGO + profile_default + 100GR4 + + + 53 + AVAGO + profile_default + 100GR4 + + + 54 + AVAGO + profile_default + 100GR4 + + + 55 + AVAGO + profile_default + 100GR4 + + + 56 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-PP-F12_8T-48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-PP-F12_8T-48x25G-8x100G.md5 new file mode 100644 index 000000000000..3c28079976c6 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-PP-F12_8T-48x25G-8x100G.md5 @@ -0,0 +1 @@ +1ed6046358d99524cdf9cd9e136a0efa \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-PP-F12_8T-48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-PP-F12_8T-48x25G-8x100G.xml new file mode 100644 index 000000000000..e3239589f006 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/ASK-PP-F12_8T-48x25G-8x100G.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-12.8 + + 4294967295 + external_25_single_ended + 2 + 60 + 64-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/SAI-F12_8T-48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/SAI-F12_8T-48x25G-8x100G.md5 new file mode 100644 index 000000000000..c01137b77a96 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/SAI-F12_8T-48x25G-8x100G.md5 @@ -0,0 +1 @@ +68eb84de73105b7ea023989d8e8ebd13 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/SAI-F12_8T-48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/SAI-F12_8T-48x25G-8x100G.xml new file mode 100644 index 000000000000..7039fa0dafda --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/SAI-F12_8T-48x25G-8x100G.xml @@ -0,0 +1,518 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F12_8T-48x25G-8x100G.xml + + + 0 + 0 + 47 + + + 1 + 0 + 46 + + + 2 + 0 + 45 + + + 3 + 0 + 44 + + + 4 + 0 + 43 + + + 5 + 0 + 42 + + + 6 + 0 + 41 + + + 7 + 0 + 40 + + + 8 + 0 + 39 + + + 9 + 0 + 38 + + + 10 + 0 + 37 + + + 11 + 0 + 36 + + + 12 + 0 + 35 + + + 13 + 0 + 34 + + + 14 + 0 + 33 + + + 15 + 0 + 32 + + + 16 + 0 + 31 + + + 17 + 0 + 30 + + + 18 + 0 + 29 + + + 19 + 0 + 28 + + + 20 + 0 + 27 + + + 21 + 0 + 26 + + + 22 + 0 + 25 + + + 23 + 0 + 24 + + + 24 + 0 + 23 + + + 25 + 0 + 22 + + + 26 + 0 + 21 + + + 27 + 0 + 20 + + + 28 + 0 + 19 + + + 29 + 0 + 18 + + + 30 + 0 + 17 + + + 31 + 0 + 16 + + + 32 + 0 + 15 + + + 33 + 0 + 14 + + + 34 + 0 + 13 + + + 35 + 0 + 12 + + + 36 + 0 + 11 + + + 37 + 0 + 10 + + + 38 + 0 + 9 + + + 39 + 0 + 8 + + + 40 + 0 + 7 + + + 41 + 0 + 6 + + + 42 + 0 + 5 + + + 43 + 0 + 4 + + + 44 + 0 + 3 + + + 45 + 0 + 2 + + + 46 + 0 + 1 + + + 47 + 0 + 0 + + + 48 + 0 + 55 + + + 52 + 0 + 54 + + + 56 + 0 + 53 + + + 60 + 0 + 52 + + + 64 + 0 + 51 + + + 68 + 0 + 50 + + + 72 + 0 + 49 + + + 76 + 0 + 48 + + + 80 + 0 + 56 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/buffers_config.j2 b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/buffers_config.j2 index 6ad65b4f7309..a5212d979fcb 100644 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/buffers_config.j2 +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/buffers_config.j2 @@ -9,9 +9,9 @@ def {# Determine device topology and filename postfix #} {%- if DEVICE_METADATA is defined %} {%- set switch_role = DEVICE_METADATA['localhost']['type'] %} -{%- if 'torrouter' in switch_role.lower() %} +{%- if switch_role.lower() == 'torrouter' %} {%- set filename_postfix = 't0' %} -{%- elif 'leafrouter' in switch_role.lower() %} +{%- elif switch_role.lower() == 'leafrouter' %} {%- set filename_postfix = 't1' %} {%- else %} {%- set filename_postfix = set_default_topology() %} @@ -62,7 +62,7 @@ def {%- if cable_len -%} {{ cable_len.0 }} {%- else %} - {%- if 'torrouter' in switch_role.lower() %} + {%- if switch_role.lower() == 'torrouter' %} {%- for local_port in VLAN_MEMBER %} {%- if local_port[1] == port_name %} {%- set roles3 = switch_role + '_' + 'server' %} @@ -133,7 +133,7 @@ def "BUFFER_PG": { {% for port in PORT_ACTIVE %} "{{ port }}|0": { - "profile" : "ingress_lossy_profile" + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" }{% if not loop.last %},{% endif %} {% endfor %} @@ -146,17 +146,17 @@ def "BUFFER_QUEUE": { {% for port in PORT_ACTIVE %} "{{ port }}|3-4": { - "profile" : "egress_lossless_profile" + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" }, {% endfor %} {% for port in PORT_ACTIVE %} "{{ port }}|0-2": { - "profile" : "egress_lossy_profile" + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" }, {% endfor %} {% for port in PORT_ACTIVE %} "{{ port }}|5-6": { - "profile" : "egress_lossy_profile" + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" }{% if not loop.last %},{% endif %} {% endfor %} diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/port_config.ini b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/port_config.ini index 62dd91ba8869..a1ee6d9bb6db 100644 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/port_config.ini +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/port_config.ini @@ -1,34 +1,58 @@ -# name lanes speed alias -Ethernet0 0,1,2,3,4,5,6,7 400000 four00GigE0 -Ethernet8 8,9,10,11,12,13,14,15 400000 four00GigE8 -Ethernet16 16,17,18,19,20,21,22,23 400000 four00GigE16 -Ethernet24 24,25,26,27,28,29,30,31 400000 four00GigE24 -Ethernet32 32,33,34,35,36,37,38,39 400000 four00GigE32 -Ethernet40 40,41,42,43,44,45,46,47 400000 four00GigE40 -Ethernet48 48,49,50,51,52,53,54,55 400000 four00GigE48 -Ethernet56 56,57,58,59,60,61,62,63 400000 four00GigE56 -Ethernet64 64,65,66,67,68,69,70,71 400000 four00GigE64 -Ethernet72 72,73,74,75,76,77,78,79 400000 four00GigE72 -Ethernet80 80,81,82,83,84,85,86,87 400000 four00GigE80 -Ethernet88 88,89,90,91,92,93,94,95 400000 four00GigE88 -Ethernet96 96,97,98,99,100,101,102,103 400000 four00GigE96 -Ethernet104 104,105,106,107,108,109,110,111 400000 four00GigE104 -Ethernet112 112,113,114,115,116,117,118,119 400000 four00GigE112 -Ethernet120 120,121,122,123,124,125,126,127 400000 four00GigE120 -Ethernet128 128,129,130,131,132,133,134,135 400000 four00GigE128 -Ethernet136 136,137,138,139,140,141,142,143 400000 four00GigE136 -Ethernet144 144,145,146,147,148,149,150,151 400000 four00GigE144 -Ethernet152 152,153,154,155,156,157,158,159 400000 four00GigE152 -Ethernet160 160,161,162,163,164,165,166,167 400000 four00GigE160 -Ethernet168 168,169,170,171,172,173,174,175 400000 four00GigE168 -Ethernet176 176,177,178,179,180,181,182,183 400000 four00GigE176 -Ethernet184 184,185,186,187,188,189,190,191 400000 four00GigE184 -Ethernet192 192,193,194,195,196,197,198,199 400000 four00GigE192 -Ethernet200 200,201,202,203,204,205,206,207 400000 four00GigE200 -Ethernet208 208,209,210,211,212,213,214,215 400000 four00GigE208 -Ethernet216 216,217,218,219,220,221,222,223 400000 four00GigE216 -Ethernet224 224,225,226,227,228,229,230,231 400000 four00GigE224 -Ethernet232 232,233,234,235,236,237,238,239 400000 four00GigE232 -Ethernet240 240,241,242,243,244,245,246,247 400000 four00GigE240 -Ethernet248 248,249,250,251,252,253,254,255 400000 four00GigE248 -Ethernet256 256 10000 tenGigE256 +# name lanes alias speed autoneg fec index +Ethernet0 0 twenty5GigE0 25000 on none 1 +Ethernet1 1 twenty5GigE1 25000 on none 2 +Ethernet2 2 twenty5GigE2 25000 on none 3 +Ethernet3 3 twenty5GigE3 25000 on none 4 +Ethernet4 4 twenty5GigE4 25000 on none 5 +Ethernet5 5 twenty5GigE5 25000 on none 6 +Ethernet6 6 twenty5GigE6 25000 on none 7 +Ethernet7 7 twenty5GigE7 25000 on none 8 +Ethernet8 8 twenty5GigE8 25000 on none 9 +Ethernet9 9 twenty5GigE9 25000 on none 10 +Ethernet10 10 twenty5GigE10 25000 on none 11 +Ethernet11 11 twenty5GigE11 25000 on none 12 +Ethernet12 12 twenty5GigE12 25000 on none 13 +Ethernet13 13 twenty5GigE13 25000 on none 14 +Ethernet14 14 twenty5GigE14 25000 on none 15 +Ethernet15 15 twenty5GigE15 25000 on none 16 +Ethernet16 16 twenty5GigE16 25000 on none 17 +Ethernet17 17 twenty5GigE17 25000 on none 18 +Ethernet18 18 twenty5GigE18 25000 on none 19 +Ethernet19 19 twenty5GigE19 25000 on none 20 +Ethernet20 20 twenty5GigE20 25000 on none 21 +Ethernet21 21 twenty5GigE21 25000 on none 22 +Ethernet22 22 twenty5GigE22 25000 on none 23 +Ethernet23 23 twenty5GigE23 25000 on none 24 +Ethernet24 24 twenty5GigE24 25000 on none 25 +Ethernet25 25 twenty5GigE25 25000 on none 26 +Ethernet26 26 twenty5GigE26 25000 on none 27 +Ethernet27 27 twenty5GigE27 25000 on none 28 +Ethernet28 28 twenty5GigE28 25000 on none 29 +Ethernet29 29 twenty5GigE29 25000 on none 30 +Ethernet30 30 twenty5GigE30 25000 on none 31 +Ethernet31 31 twenty5GigE31 25000 on none 32 +Ethernet32 32 twenty5GigE32 25000 on none 33 +Ethernet33 33 twenty5GigE33 25000 on none 34 +Ethernet34 34 twenty5GigE34 25000 on none 35 +Ethernet35 35 twenty5GigE35 25000 on none 36 +Ethernet36 36 twenty5GigE36 25000 on none 37 +Ethernet37 37 twenty5GigE37 25000 on none 38 +Ethernet38 38 twenty5GigE38 25000 on none 39 +Ethernet39 39 twenty5GigE39 25000 on none 40 +Ethernet40 40 twenty5GigE40 25000 on none 41 +Ethernet41 41 twenty5GigE41 25000 on none 42 +Ethernet42 42 twenty5GigE42 25000 on none 43 +Ethernet43 43 twenty5GigE43 25000 on none 44 +Ethernet44 44 twenty5GigE44 25000 on none 45 +Ethernet45 45 twenty5GigE45 25000 on none 46 +Ethernet46 46 twenty5GigE46 25000 on none 47 +Ethernet47 47 twenty5GigE47 25000 on none 48 +Ethernet48 48,49,50,51 one00GigE48 100000 on rs 49 +Ethernet49 52,53,54,55 one00GigE49 100000 on rs 50 +Ethernet50 56,57,58,59 one00GigE113 100000 on rs 51 +Ethernet51 60,61,62,63 one00GigE114 100000 on rs 52 +Ethernet52 64,65,66,67 one00GigE115 100000 on rs 53 +Ethernet53 68,69,70,71 one00GigE116 100000 on rs 54 +Ethernet54 72,73,74,75 one00GigE117 100000 on rs 55 +Ethernet55 76,77,78,79 one00GigE118 100000 on rs 56 +Ethernet56 80 tenGigE136 10000 off none 57 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/profile.ini b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/profile.ini index 2813bbd363f8..c2f77685ad0a 100644 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/profile.ini +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/profile.ini @@ -1,2 +1 @@ switchMacAddress=00:01:02:03:04:05 -apPortListWithCableLen=000:1 008:1 016:1 024:1 032:1 040:1 048:1 056:1 064:1 072:1 080:1 088:1 096:1 104:1 112:1 120:1 128:1 136:1 144:1 152:1 160:1 168:1 176:1 184:1 192:1 200:1 208:1 216:1 224:1 232:1 240:1 248:1 256:1 diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/sai.profile b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/sai.profile index 6dc6f35fed4e..8f6edc9ae77f 100644 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/sai.profile +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/db98cx8580_32cd/sai.profile @@ -1,3 +1,4 @@ mode=1 -hwId=FALCON32x400G +hwId=FC48x25G8x100GR4 +switchProfile=/usr/share/sonic/hwsku/SAI-F12_8T-48x25G-8x100G.xml SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/plugins/eeprom.py b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/plugins/eeprom.py deleted file mode 100644 index 71f05c5b70f5..000000000000 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/plugins/eeprom.py +++ /dev/null @@ -1,11 +0,0 @@ -try: - from sonic_eeprom import eeprom_tlvinfo -except ImportError as e: - raise ImportError(str(e) + "- required module not found") - - -class board(eeprom_tlvinfo.TlvInfoDecoder): - - def __init__(self, name, path, cpld_root, ro): - self.eeprom_path = "/etc/sonic/eeprom" - super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/plugins/sfputil.py b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/plugins/sfputil.py deleted file mode 100644 index 280593c60be1..000000000000 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/plugins/sfputil.py +++ /dev/null @@ -1,254 +0,0 @@ -try: - import os - import time - import re - import subprocess - from sonic_sfp.sfputilbase import SfpUtilBase - from sonic_py_common.general import getstatusoutput_noshell -except ImportError as e: - raise ImportError(str(e) + "- required module not found") - -smbus_present = 1 - -try: - import smbus -except ImportError as e: - smbus_present = 0 - - -class SfpUtil(SfpUtilBase): - """Platform specific sfputil class""" - _port_start = 1 - _port_end = 257 - ports_in_block = 257 - - _port_to_eeprom_mapping = {} - - _qsfp_ports = list(range(_port_start, ports_in_block + 1)) - - def __init__(self): - subprocess.call(["modprobe", "i2c-dev"]) - if not os.path.exists("/sys/bus/i2c/devices/0-0050"): - with open("/sys/bus/i2c/devices/i2c-0/new_device", 'w') as file: - file.write("optoe2 0x50") - - eeprom_path = '/sys/bus/i2c/devices/0-0050/eeprom' - # for x in range(self.port _start, self.port_end +1): - x = self.port_start - while(x < self.port_end+1): - self.port_to_eeprom_mapping[x] = eeprom_path - x = x + 1 - SfpUtilBase.__init__(self) - - def reset(self, port_num): - # Check for invalid port_num - if port_num < self._port_start or port_num > self._port_end: - return False - - port_ps = "/sys/bus/i2c/devices/0-0050/sfp_port_reset" - - try: - reg_file = open(port_ps, 'w') - except IOError as e: - print("Error: unable to open file: %s" % str(e)) - return False - - # toggle reset - reg_file.seek(0) - reg_file.write('1') - time.sleep(1) - reg_file.seek(0) - reg_file.write('0') - reg_file.close() - return True - - def set_low_power_mode(self, port_nuM, lpmode): - raise NotImplementedError - - def get_low_power_mode(self, port_num): - raise NotImplementedError - - def i2c_get(self, device_addr, offset): - status = 0 - if smbus_present == 0: - x = ["i2cget", "-y", "0", hex(device_addr), hex(offset)] - cmdstatus, status = getstatusoutput_noshell(x) - if cmdstatus != 0: - return cmdstatus - status = int(status, 16) - else: - bus = smbus.SMBus(0) - status = bus.read_byte_data(device_addr, offset) - return status - - def i2c_set(self, device_addr, offset, value): - if smbus_present == 0: - cmd = ["i2cset", "-y", "0", hex(device_addr), hex(offset), hex(value)] - subprocess.call(cmd) - else: - bus = smbus.SMBus(0) - bus.write_byte_data(device_addr, offset, value) - - def get_presence(self, port_num): - # Check for invalid port_num - if port_num < self._port_start or port_num > self._port_end: - return False - else: - self.i2c_set(0x70, 0, 0) - self.i2c_set(0x71, 0, 0) - self.i2c_set(0x72, 0, 0) - self.i2c_set(0x73, 0, 0) - self.i2c_set(0x74, 0, 0) - reg = (port_num)/8 - offset = reg % 8 - if offset >= 4: - offset = offset-4 - elif offset < 4: - offset = offset+4 - bin_offset = 1 << offset - - if port_num >= 0 and port_num <= 63: - device_reg = 0x70 - elif port_num >= 64 and port_num <= 127: - device_reg = 0x71 - elif port_num >= 128 and port_num <= 191: - device_reg = 0x72 - elif port_num >= 192 and port_num <= 255: - device_reg = 0x73 - elif port_num >= 256 and port_num <= 257: - device_reg = 0x74 - - #print "i2c %d %x %x" % (port_num, device_reg, bin_offset) - self.i2c_set(device_reg, 0, bin_offset) - path = "/sys/bus/i2c/devices/0-0050/eeprom" - try: - reg_file = open(path) - reg_file.seek(0o1) - reg_file.read(0o2) - except IOError as e: - return False - - return True - - def read_porttab_mappings(self, porttabfile): - #print("I am in porttab_mappings") - logical = [] - logical_to_bcm = {} - logical_to_physical = {} - physical_to_logical = {} - last_fp_port_index = 0 - last_portname = "" - first = 1 - port_pos_in_file = 0 - parse_fmt_port_config_ini = False - - try: - f = open(porttabfile) - except: - raise - - parse_fmt_port_config_ini = (os.path.basename(porttabfile) == "port_config.ini") - # Read the porttab file and generate dicts - # with mapping for future reference. - # - # TODO: Refactor this to use the portconfig.py module that now - # exists as part of the sonic-config-engine package. - title = [] - for line in f: - line.strip() - if re.search("^#", line) is not None: - # The current format is: # name lanes alias index speed - # Where the ordering of the columns can vary - title = line.split()[1:] - continue - #print title - - # Parsing logic for 'port_config.ini' file - if (parse_fmt_port_config_ini): - # bcm_port is not explicitly listed in port_config.ini format - # Currently we assume ports are listed in numerical order according to bcm_port - # so we use the port's position in the file (zero-based) as bcm_port - portname = line.split()[0] - - bcm_port = str(port_pos_in_file) - - if "index" in title: - fp_port_index = int(line.split()[title.index("index")]) - # Leave the old code for backward compatibility - # if len(line.split()) >= 4: - # fp_port_index = (line.split()[3]) - # print(fp_port_index) - else: - fp_port_index = portname.split("Ethernet").pop() - fp_port_index = int(fp_port_index.split("s").pop(0))+1 - else: # Parsing logic for older 'portmap.ini' file - (portname, bcm_port) = line.split("=")[1].split(",")[:2] - - fp_port_index = portname.split("Ethernet").pop() - fp_port_index = int(fp_port_index.split("s").pop(0))+1 - - if ((len(self.sfp_ports) > 0) and (fp_port_index not in self.sfp_ports)): - continue - - if first == 1: - # Initialize last_[physical|logical]_port - # to the first valid port - last_fp_port_index = fp_port_index - last_portname = portname - first = 0 - - logical.append(portname) - - logical_to_bcm[portname] = "xe" + bcm_port - logical_to_physical[portname] = [fp_port_index] - if physical_to_logical.get(fp_port_index) is None: - physical_to_logical[fp_port_index] = [portname] - else: - physical_to_logical[fp_port_index].append( - portname) - - if (fp_port_index - last_fp_port_index) > 1: - # last port was a gang port - for p in range(last_fp_port_index+1, fp_port_index): - logical_to_physical[last_portname].append(p) - if physical_to_logical.get(p) is None: - physical_to_logical[p] = [last_portname] - else: - physical_to_logical[p].append(last_portname) - - last_fp_port_index = fp_port_index - last_portname = portname - - port_pos_in_file += 1 - - self.logical = logical - self.logical_to_bcm = logical_to_bcm - self.logical_to_physical = logical_to_physical - self.physical_to_logical = physical_to_logical - - # print(self.logical_to_physical) - '''print("logical: " + self.logical) - print("logical to bcm: " + self.logical_to_bcm) - print("logical to physical: " + self.logical_to_physical) - print("physical to logical: " + self.physical_to_logical)''' - #print("exiting port_tab_mappings") - - @property - def port_start(self): - return self._port_start - - @property - def port_end(self): - return self._port_end - - @property - def qsfp_ports(self): - return self._qsfp_ports - - @property - def port_to_eeprom_mapping(self): - return self._port_to_eeprom_mapping - - @property - def get_transceiver_change_event(self): - raise NotImplementedError diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/pmon_daemon_control.json b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/pmon_daemon_control.json index 94592fa8cebc..39deb88be078 100644 --- a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/pmon_daemon_control.json +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/pmon_daemon_control.json @@ -1,3 +1,8 @@ { - "skip_ledd": true + "skip_ledd": true, + "skip_pcied": true, + "skip_thermalctld": true, + "skip_psud": true, + "skip_xcvrd": true, + "skip_syseepromd": true } diff --git a/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/system_health_monitoring_config.json b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..79c17103bf76 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8580_32cd-r0/system_health_monitoring_config.json @@ -0,0 +1,10 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.temperature", + "fan", + "psu" + ], + "user_defined_checkers": [] +} From c4695baa9b37fe43c5425ba37ea04486ba3d307e Mon Sep 17 00:00:00 2001 From: Pavan Naregundi Date: Mon, 22 Apr 2024 04:39:20 +0000 Subject: [PATCH 064/282] HWSKU for x86_64-marvell_db98cx8540_16cd-r0 Signed-off-by: Pavan Naregundi --- .../FALCON_DB/ASK-Board-F6_4T-DB.md5 | 1 + .../FALCON_DB/ASK-Board-F6_4T-DB.xml | 2898 ++++++++++++ .../FALCON_DB/ASK-L1-F6_4T-DB.md5 | 1 + .../FALCON_DB/ASK-L1-F6_4T-DB.xml | 1560 +++++++ .../FALCON_DB/ASK-PP-F6_4T-DB.md5 | 1 + .../FALCON_DB/ASK-PP-F6_4T-DB.xml | 1180 +++++ .../FALCON_DB/SAI-F6_4T-DB.md5 | 1 + .../FALCON_DB/SAI-F6_4T-DB.xml | 583 +++ .../FALCON_DB/buffers_defaults_t0.j2 | 36 + .../FALCON_DB/buffers_defaults_t1.j2 | 36 + .../FALCON_DB/port_config.ini | 71 + .../FALCON_DB/profile.ini | 1 + .../FALCON_DB/sai.profile | 4 + .../FC128x50G/ASK-Board-F6_4T-128x50G.md5 | 1 + .../FC128x50G/ASK-Board-F6_4T-128x50G.xml | 4038 +++++++++++++++++ .../FC128x50G/ASK-L1-F6_4T-128x50G.md5 | 1 + .../FC128x50G/ASK-L1-F6_4T-128x50G.xml | 1681 +++++++ .../FC128x50G/ASK-PP-F6_4T-128x50G.md5 | 1 + .../FC128x50G/ASK-PP-F6_4T-128x50G.xml | 1180 +++++ .../FC128x50G/SAI-F6_4T-128x50G.md5 | 1 + .../FC128x50G/SAI-F6_4T-128x50G.xml | 883 ++++ .../FC128x50G/buffers_defaults_t0.j2 | 36 + .../FC128x50G/buffers_defaults_t1.j2 | 36 + .../FC128x50G/port_config.ini | 131 + .../FC128x50G/profile.ini | 1 + .../FC128x50G/sai.profile | 4 + .../ASK-Board-F6_4T-48x25G-4x100G.md5 | 1 + .../ASK-Board-F6_4T-48x25G-4x100G.xml | 2606 +++++++++++ .../ASK-L1-F6_4T-48x25G-4x100G.md5 | 1 + .../ASK-L1-F6_4T-48x25G-4x100G.xml | 1228 +++++ .../ASK-PP-F6_4T-48x25G-4x100G.md5 | 1 + .../ASK-PP-F6_4T-48x25G-4x100G.xml | 1180 +++++ .../SAI-F6_4T-48x25G-4x100G.md5 | 1 + .../SAI-F6_4T-48x25G-4x100G.xml | 503 ++ .../FC48x25G4x100GR4/buffers_defaults_t0.j2 | 36 + .../FC48x25G4x100GR4/buffers_defaults_t1.j2 | 36 + .../FC48x25G4x100GR4/port_config.ini | 55 + .../FC48x25G4x100GR4/profile.ini | 1 + .../FC48x25G4x100GR4/sai.profile | 4 + .../ASK-Board-F6_4T-48x25G-4x100G.md5 | 1 + .../ASK-Board-F6_4T-48x25G-4x100G.xml | 2606 +++++++++++ .../ASK-L1-F6_4T-48x25G-4x100G.md5 | 1 + .../ASK-L1-F6_4T-48x25G-4x100G.xml | 1228 +++++ .../ASK-PP-F6_4T-48x25G-4x100G.md5 | 1 + .../ASK-PP-F6_4T-48x25G-4x100G.xml | 1180 +++++ .../SAI-F6_4T-48x25G-4x100G.md5 | 1 + .../SAI-F6_4T-48x25G-4x100G.xml | 503 ++ .../db98cx8540_16cd/buffers.json.j2 | 1 + .../db98cx8540_16cd/buffers_config.j2 | 165 + .../db98cx8540_16cd/buffers_defaults_t0.j2 | 36 + .../db98cx8540_16cd/buffers_defaults_t1.j2 | 36 + .../db98cx8540_16cd/port_config.ini | 55 + .../db98cx8540_16cd/profile.ini | 1 + .../db98cx8540_16cd/qos.json.j2 | 1 + .../db98cx8540_16cd/sai.profile | 4 + .../default_sku | 1 + .../platform_asic | 1 + .../pmon_daemon_control.json | 8 + .../system_health_monitoring_config.json | 10 + 59 files changed, 25860 insertions(+) create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-Board-F6_4T-DB.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-Board-F6_4T-DB.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-L1-F6_4T-DB.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-L1-F6_4T-DB.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-PP-F6_4T-DB.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-PP-F6_4T-DB.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/SAI-F6_4T-DB.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/SAI-F6_4T-DB.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/buffers_defaults_t0.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/buffers_defaults_t1.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/port_config.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/profile.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/sai.profile create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-Board-F6_4T-128x50G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-Board-F6_4T-128x50G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-L1-F6_4T-128x50G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-L1-F6_4T-128x50G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-PP-F6_4T-128x50G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-PP-F6_4T-128x50G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/SAI-F6_4T-128x50G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/SAI-F6_4T-128x50G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/buffers_defaults_t0.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/buffers_defaults_t1.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/port_config.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/profile.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/sai.profile create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-Board-F6_4T-48x25G-4x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-Board-F6_4T-48x25G-4x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-L1-F6_4T-48x25G-4x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-L1-F6_4T-48x25G-4x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-PP-F6_4T-48x25G-4x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-PP-F6_4T-48x25G-4x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/SAI-F6_4T-48x25G-4x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/SAI-F6_4T-48x25G-4x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/buffers_defaults_t0.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/buffers_defaults_t1.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/port_config.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/profile.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/sai.profile create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-Board-F6_4T-48x25G-4x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-Board-F6_4T-48x25G-4x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-L1-F6_4T-48x25G-4x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-L1-F6_4T-48x25G-4x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-PP-F6_4T-48x25G-4x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-PP-F6_4T-48x25G-4x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/SAI-F6_4T-48x25G-4x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/SAI-F6_4T-48x25G-4x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers.json.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_config.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_defaults_t0.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_defaults_t1.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/port_config.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/profile.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/qos.json.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/sai.profile create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/default_sku create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/platform_asic create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/pmon_daemon_control.json create mode 100644 device/marvell/x86_64-marvell_db98cx8540_16cd-r0/system_health_monitoring_config.json diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-Board-F6_4T-DB.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-Board-F6_4T-DB.md5 new file mode 100644 index 000000000000..ed4d23021a1a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-Board-F6_4T-DB.md5 @@ -0,0 +1 @@ +79a4ca665350035cf9ba9b1c19507011 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-Board-F6_4T-DB.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-Board-F6_4T-DB.xml new file mode 100644 index 000000000000..fb05b78254f3 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-Board-F6_4T-DB.xml @@ -0,0 +1,2898 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + Falcon-6.4T-DB + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F6_4T-DB.xml + ASK-L1-F6_4T-DB.xml + sip6 + + 0 + + ethernet_mac + 0 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 1 + + ethernet_mac + 1 + false + + + NA + + + + false + + + + 2 + + ethernet_mac + 2 + false + + + NA + + + + false + + + + 3 + + ethernet_mac + 3 + false + + + NA + + + + false + + + + 4 + + ethernet_mac + 4 + false + + + NA + + + + + 2 + true + + false + + + + 5 + + ethernet_mac + 5 + false + + + NA + + + + false + + + + 6 + + ethernet_mac + 6 + false + + + NA + + + + false + + + + 7 + + ethernet_mac + 7 + false + + + NA + + + + false + + + + 8 + + ethernet_mac + 8 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 9 + + ethernet_mac + 9 + false + + + NA + + + + + 2 + true + + false + + + + 10 + + ethernet_mac + 10 + false + + + NA + + + + + 2 + true + + false + + + + 11 + + ethernet_mac + 11 + false + + + NA + + + + + 2 + true + + false + + + + 12 + + ethernet_mac + 12 + false + + + NA + + + + + 2 + true + + false + + + + 13 + + ethernet_mac + 13 + false + + + NA + + + + + 2 + true + + false + + + + 14 + + ethernet_mac + 14 + false + + + NA + + + + + 2 + true + + false + + + + 15 + + ethernet_mac + 15 + false + + + NA + + + + + 2 + true + + false + + + + 16 + + ethernet_mac + 16 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 17 + + ethernet_mac + 17 + false + + + NA + + + + + 2 + true + + false + + + + 18 + + ethernet_mac + 18 + false + + + NA + + + + + 2 + true + + false + + + + 19 + + ethernet_mac + 19 + false + + + NA + + + + + 2 + true + + false + + + + 20 + + ethernet_mac + 20 + false + + + NA + + + + + 2 + true + + false + + + + 21 + + ethernet_mac + 21 + false + + + NA + + + + + 2 + true + + false + + + + 22 + + ethernet_mac + 22 + false + + + NA + + + + + 2 + true + + false + + + + 23 + + ethernet_mac + 23 + false + + + NA + + + + + 2 + true + + false + + + + 24 + + ethernet_mac + 24 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 25 + + ethernet_mac + 25 + false + + + NA + + + + + 2 + true + + false + + + + 26 + + ethernet_mac + 26 + false + + + NA + + + + + 2 + true + + false + + + + 27 + + ethernet_mac + 27 + false + + + NA + + + + + 2 + true + + false + + + + 28 + + ethernet_mac + 28 + false + + + NA + + + + + 2 + true + + false + + + + 29 + + ethernet_mac + 29 + false + + + NA + + + + + 2 + true + + false + + + + 30 + + ethernet_mac + 30 + false + + + NA + + + + + 2 + true + + false + + + + 31 + + ethernet_mac + 31 + false + + + NA + + + + + 2 + true + + false + + + + 32 + + ethernet_mac + 32 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 33 + + ethernet_mac + 33 + false + + + NA + + + + + 2 + true + + false + + + + 34 + + ethernet_mac + 34 + false + + + NA + + + + + 2 + true + + false + + + + 35 + + ethernet_mac + 35 + false + + + NA + + + + + 2 + true + + false + + + + 36 + + ethernet_mac + 36 + false + + + NA + + + + + 2 + true + + false + + + + 37 + + ethernet_mac + 37 + false + + + NA + + + + + 2 + true + + false + + + + 38 + + ethernet_mac + 38 + false + + + NA + + + + + 2 + true + + false + + + + 39 + + ethernet_mac + 39 + false + + + NA + + + + + 2 + true + + false + + + + 40 + + ethernet_mac + 40 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 41 + + ethernet_mac + 41 + false + + + NA + + + + + 2 + true + + false + + + + 42 + + ethernet_mac + 42 + false + + + NA + + + + + 2 + true + + false + + + + 43 + + ethernet_mac + 43 + false + + + NA + + + + + 2 + true + + false + + + + 44 + + ethernet_mac + 44 + false + + + NA + + + + + 2 + true + + false + + + + 45 + + ethernet_mac + 45 + false + + + NA + + + + + 2 + true + + false + + + + 46 + + ethernet_mac + 46 + false + + + NA + + + + + 2 + true + + false + + + + 47 + + ethernet_mac + 47 + false + + + NA + + + + + 2 + true + + false + + + + 48 + + ethernet_mac + 48 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 49 + + ethernet_mac + 50 + false + + + NA + + + + + 2 + true + + false + + + + 50 + + ethernet_mac + 52 + false + + + NA + + + + + 2 + true + + false + + + + 51 + + ethernet_mac + 54 + false + + + NA + + + + + 2 + true + + false + + + + 52 + + ethernet_mac + 56 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 53 + + ethernet_mac + 58 + false + + + NA + + + + + 2 + true + + false + + + + 54 + + ethernet_mac + 60 + false + + + NA + + + + + 2 + true + + false + + + + 55 + + ethernet_mac + 62 + false + + + NA + + + + + 2 + true + + false + + + + 56 + + ethernet_mac + 64 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 57 + + ethernet_mac + 68 + false + + + NA + + + + + 2 + true + + false + + + + 58 + + ethernet_mac + 72 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 59 + + ethernet_mac + 76 + false + + + NA + + + + + 2 + true + + false + + + + 60 + + ethernet_mac + 80 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 64 + + ethernet_mac + 84 + false + + + NA + + + + + 2 + true + + false + + + + 65 + + ethernet_mac + 88 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 66 + + ethernet_mac + 92 + false + + + NA + + + + + 2 + true + + false + + + + 67 + + ethernet_mac + 96 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 68 + + ethernet_mac + 104 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 69 + + ethernet_mac + 112 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 70 + + ethernet_mac + 120 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 71 + + ethernet_mac + 128 + false + + + NA + + + + + + 2 + true + + false + + + + 72 + + ethernet_mac + 135 + false + + + NA + + + + + 2 + true + + false + + + + 63 + + cpu_sdma + 136 + false + + + + 73 + + cpu_sdma + 137 + false + + + + 74 + + cpu_sdma + 138 + false + + + + 75 + + cpu_sdma + 139 + false + + + + 7 + true + false + + + 1 + true + false + + + 6 + true + true + + + 0 + true + false + + + 5 + true + false + + + 3 + true + true + + + 4 + true + true + + + 2 + false + false + + + 8 + false + true + + + 14 + false + false + + + 9 + false + false + + + 15 + false + true + + + 10 + false + true + + + 12 + false + true + + + 11 + true + false + + + 13 + false + true + + + 23 + false + false + + + 17 + false + false + + + 22 + true + false + + + 16 + false + true + + + 21 + false + false + + + 19 + true + true + + + 20 + true + false + + + 18 + false + true + + + 24 + false + false + + + 30 + false + false + + + 25 + false + true + + + 31 + false + false + + + 26 + true + false + + + 28 + false + true + + + 27 + false + true + + + 29 + false + true + + + 39 + false + false + + + 33 + true + false + + + 38 + false + false + + + 32 + false + false + + + 37 + true + false + + + 35 + true + true + + + 36 + true + false + + + 34 + false + false + + + 40 + false + false + + + 41 + true + true + + + 46 + true + true + + + 47 + true + true + + + 42 + true + false + + + 44 + false + false + + + 43 + false + true + + + 45 + true + false + + + 55 + false + false + + + 49 + true + false + + + 54 + true + true + + + 48 + false + true + + + 53 + true + false + + + 51 + false + true + + + 52 + false + true + + + 50 + false + true + + + 56 + false + false + + + 62 + true + false + + + 57 + false + true + + + 63 + true + true + + + 58 + false + false + + + 60 + false + true + + + 59 + false + true + + + 61 + false + true + + + 71 + false + false + + + 65 + true + false + + + 70 + false + true + + + 64 + true + true + + + 69 + true + false + + + 67 + true + true + + + 68 + true + true + + + 66 + true + true + + + 72 + true + false + + + 78 + false + false + + + 73 + false + true + + + 79 + true + true + + + 74 + true + false + + + 76 + true + true + + + 75 + true + true + + + 77 + false + true + + + 87 + false + false + + + 81 + false + false + + + 86 + false + false + + + 80 + true + false + + + 85 + false + true + + + 83 + true + true + + + 84 + true + false + + + 82 + false + false + + + 88 + true + false + + + 94 + true + false + + + 89 + false + false + + + 95 + true + false + + + 90 + true + false + + + 92 + false + true + + + 91 + false + false + + + 93 + false + false + + + 103 + true + false + + + 97 + true + false + + + 102 + true + false + + + 96 + true + true + + + 101 + true + false + + + 99 + true + true + + + 100 + true + true + + + 98 + false + true + + + 104 + true + false + + + 110 + false + false + + + 105 + true + true + + + 111 + true + false + + + 106 + true + false + + + 108 + false + false + + + 107 + false + true + + + 109 + true + false + + + 119 + true + false + + + 113 + true + true + + + 118 + true + true + + + 112 + true + false + + + 117 + true + false + + + 115 + false + false + + + 116 + true + false + + + 114 + false + false + + + 120 + false + false + + + 126 + false + false + + + 121 + false + true + + + 127 + false + true + + + 122 + true + false + + + 124 + false + true + + + 123 + false + true + + + 125 + false + true + + + 128 + false + true + + + 135 + true + false + + + 0 + + ORDER_MODE_BY_CLASS + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_0 + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_1 + PULSE_STRETCH_1 + false + 1627 + false + + 1 + 64 + 66 + false + + + 2 + 64 + 65 + false + + + 3 + 64 + 65 + false + + + 4 + 64 + 66 + false + + + 5 + 64 + 66 + false + + + 6 + 64 + 65 + false + + + 7 + 64 + 65 + false + + + 8 + 64 + 66 + false + + + + 0 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 1 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 2 + PORT_TYPE_XG + true + BLINK_SELECT_0 + false + true + true + + + 3 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 4 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 5 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + + /tmp/cpss_uds + + 8 + + MAP0 + + 7 + + + 1 + + + 6 + + + 0 + + + 5 + + + 3 + + + 4 + + + 2 + + + + MAP1 + + 0 + + + 6 + + + 1 + + + 7 + + + 2 + + + 4 + + + 3 + + + 5 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-L1-F6_4T-DB.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-L1-F6_4T-DB.md5 new file mode 100644 index 000000000000..5e201dca8b93 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-L1-F6_4T-DB.md5 @@ -0,0 +1 @@ +ce74a7780c98ac3f53f39cb7e2564ae6 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-L1-F6_4T-DB.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-L1-F6_4T-DB.xml new file mode 100644 index 000000000000..52d534122984 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-L1-F6_4T-DB.xml @@ -0,0 +1,1560 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 100GR2 + + CR2 + 100G + rs_544_514_enabled + + + KR2 + 100G + rs_544_514_enabled + + + SR_LR2 + 100G + rs_544_514_enabled + + + SR_LR2 + 50G + rs_enabled + + + CR2 + 50G + rs_enabled + + + KR2 + 50G + rs_enabled + + + CR2 + 100G + rs_544_514_enabled + rs_544_514_enabled + + + KR2 + 100G + rs_544_514_enabled + rs_544_514_enabled + + + CR2 + 50G + rs_enabled + rs_enabled + + + KR2 + 50G + rs_enabled + rs_enabled + + + + 100GR4 + + CR4 + 100G + rs_enabled + + + KR4 + 100G + rs_enabled + + + SR_LR4 + 100G + rs_enabled + + + CR4 + 100G + rs_enabled + rs_enabled + + + KR4 + 100G + rs_enabled + rs_enabled + + + + 10GR1 + + KR + 10G + enabled + + + SR_LR + 10G + enabled + + + KR + 10G + enabled + enabled + + + + 10GR1Fix + + KR + 10G + disabled + + + + 200GR4 + + CR4 + 200G + rs_544_514_enabled + + + SR_LR4 + 100G + rs_enabled + + + KR4 + 100G + rs_enabled + + + CR4 + 100G + rs_enabled + + + KR4 + 200G + rs_544_514_enabled + + + SR_LR4 + 200G + rs_544_514_enabled + + + CR4 + 200G + rs_544_514_enabled + rs_544_514_enabled + + + KR4 + 200G + rs_544_514_enabled + rs_544_514_enabled + + + CR4 + 100G + rs_enabled + rs_enabled + + + KR4 + 100G + rs_enabled + rs_enabled + + + + 25GR1 + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + 400GR8 + + CR8 + 400G + rs_544_514_enabled + + + KR8 + 400G + rs_544_514_enabled + + + SR_LR8 + 400G + rs_544_514_enabled + + + CR8 + 400G + rs_544_514_enabled + rs_544_514_enabled + + + KR8 + 400G + rs_544_514_enabled + rs_544_514_enabled + + + + 50GR1 + + CR + 50G + rs_544_514_enabled + + + KR + 50G + rs_544_514_enabled + + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 50G + rs_544_514_enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 50G + rs_544_514_enabled + rs_544_514_enabled + + + KR + 50G + rs_544_514_enabled + rs_544_514_enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 10GR1 + + + 1 + AVAGO + profile_default + 10GR1 + + + 2 + AVAGO + profile_default + 10GR1 + + + 3 + AVAGO + profile_default + 10GR1 + + + 4 + AVAGO + profile_default + 10GR1 + + + 5 + AVAGO + profile_default + 10GR1 + + + 6 + AVAGO + profile_default + 10GR1 + + + 7 + AVAGO + profile_default + 10GR1 + + + 8 + AVAGO + profile_default + 10GR1 + + + 9 + AVAGO + profile_default + 10GR1 + + + 10 + AVAGO + profile_default + 10GR1 + + + 11 + AVAGO + profile_default + 10GR1 + + + 12 + AVAGO + profile_default + 10GR1 + + + 13 + AVAGO + profile_default + 10GR1 + + + 14 + AVAGO + profile_default + 10GR1 + + + 15 + AVAGO + profile_default + 10GR1 + + + 16 + AVAGO + profile_default + 25GR1 + + + 17 + AVAGO + profile_default + 25GR1 + + + 18 + AVAGO + profile_default + 25GR1 + + + 19 + AVAGO + profile_default + 25GR1 + + + 20 + AVAGO + profile_default + 25GR1 + + + 21 + AVAGO + profile_default + 25GR1 + + + 22 + AVAGO + profile_default + 25GR1 + + + 23 + AVAGO + profile_default + 25GR1 + + + 24 + AVAGO + profile_default + 25GR1 + + + 25 + AVAGO + profile_default + 25GR1 + + + 26 + AVAGO + profile_default + 25GR1 + + + 27 + AVAGO + profile_default + 25GR1 + + + 28 + AVAGO + profile_default + 25GR1 + + + 29 + AVAGO + profile_default + 25GR1 + + + 30 + AVAGO + profile_default + 25GR1 + + + 31 + AVAGO + profile_default + 25GR1 + + + 32 + AVAGO + profile_default + 50GR1 + + + 33 + AVAGO + profile_default + 50GR1 + + + 34 + AVAGO + profile_default + 50GR1 + + + 35 + AVAGO + profile_default + 50GR1 + + + 36 + AVAGO + profile_default + 50GR1 + + + 37 + AVAGO + profile_default + 50GR1 + + + 38 + AVAGO + profile_default + 50GR1 + + + 39 + AVAGO + profile_default + 50GR1 + + + 40 + AVAGO + profile_default + 50GR1 + + + 41 + AVAGO + profile_default + 50GR1 + + + 42 + AVAGO + profile_default + 50GR1 + + + 43 + AVAGO + profile_default + 50GR1 + + + 44 + AVAGO + profile_default + 50GR1 + + + 45 + AVAGO + profile_default + 50GR1 + + + 46 + AVAGO + profile_default + 50GR1 + + + 47 + AVAGO + profile_default + 50GR1 + + + 48 + AVAGO + profile_default + 100GR2 + + + 49 + AVAGO + profile_default + 100GR2 + + + 50 + AVAGO + profile_default + 100GR2 + + + 51 + AVAGO + profile_default + 100GR2 + + + 52 + AVAGO + profile_default + 100GR2 + + + 53 + AVAGO + profile_default + 100GR2 + + + 54 + AVAGO + profile_default + 100GR2 + + + 55 + AVAGO + profile_default + 100GR2 + + + 56 + AVAGO + profile_default + 100GR4 + + + 57 + AVAGO + profile_default + 100GR4 + + + 58 + AVAGO + profile_default + 100GR4 + + + 59 + AVAGO + profile_default + 100GR4 + + + 60 + AVAGO + profile_default + 200GR4 + + + 64 + AVAGO + profile_default + 200GR4 + + + 65 + AVAGO + profile_default + 200GR4 + + + 66 + AVAGO + profile_default + 200GR4 + + + 67 + AVAGO + profile_default + 400GR8 + + + 68 + AVAGO + profile_default + 400GR8 + + + 69 + AVAGO + profile_default + 400GR8 + + + 70 + AVAGO + profile_default + 400GR8 + + + 71 + AVAGO + profile_default + 10GR1Fix + + + 72 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-PP-F6_4T-DB.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-PP-F6_4T-DB.md5 new file mode 100644 index 000000000000..3b165056b705 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-PP-F6_4T-DB.md5 @@ -0,0 +1 @@ +715e923d22c6767a6f6bb95d32b78713 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-PP-F6_4T-DB.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-PP-F6_4T-DB.xml new file mode 100644 index 000000000000..7f7dde9c00e6 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/ASK-PP-F6_4T-DB.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-6.4 + + 4294967295 + external_25_single_ended + 2 + 60 + 128-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/SAI-F6_4T-DB.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/SAI-F6_4T-DB.md5 new file mode 100644 index 000000000000..8e92075a304f --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/SAI-F6_4T-DB.md5 @@ -0,0 +1 @@ +79e0d448ff6f12de9926163545fcf9a2 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/SAI-F6_4T-DB.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/SAI-F6_4T-DB.xml new file mode 100644 index 000000000000..2b5db797609b --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/SAI-F6_4T-DB.xml @@ -0,0 +1,583 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F6_4T-DB.xml + + + 0 + 0 + 15 + + + 1 + 0 + 14 + + + 2 + 0 + 13 + + + 3 + 0 + 12 + + + 4 + 0 + 11 + + + 5 + 0 + 10 + + + 6 + 0 + 9 + + + 7 + 0 + 8 + + + 8 + 0 + 7 + + + 9 + 0 + 6 + + + 10 + 0 + 5 + + + 11 + 0 + 4 + + + 12 + 0 + 3 + + + 13 + 0 + 2 + + + 14 + 0 + 1 + + + 15 + 0 + 0 + + + 16 + 0 + 31 + + + 17 + 0 + 30 + + + 18 + 0 + 29 + + + 19 + 0 + 28 + + + 20 + 0 + 27 + + + 21 + 0 + 26 + + + 22 + 0 + 25 + + + 23 + 0 + 24 + + + 24 + 0 + 23 + + + 25 + 0 + 22 + + + 26 + 0 + 21 + + + 27 + 0 + 20 + + + 28 + 0 + 19 + + + 29 + 0 + 18 + + + 30 + 0 + 17 + + + 31 + 0 + 16 + + + 32 + 0 + 47 + + + 33 + 0 + 46 + + + 34 + 0 + 45 + + + 35 + 0 + 44 + + + 36 + 0 + 43 + + + 37 + 0 + 42 + + + 38 + 0 + 41 + + + 39 + 0 + 40 + + + 40 + 0 + 39 + + + 41 + 0 + 38 + + + 42 + 0 + 37 + + + 43 + 0 + 36 + + + 44 + 0 + 35 + + + 45 + 0 + 34 + + + 46 + 0 + 33 + + + 47 + 0 + 32 + + + 48 + 0 + 55 + + + 50 + 0 + 54 + + + 52 + 0 + 53 + + + 54 + 0 + 52 + + + 56 + 0 + 51 + + + 58 + 0 + 50 + + + 60 + 0 + 49 + + + 62 + 0 + 48 + + + 64 + 0 + 59 + + + 68 + 0 + 58 + + + 72 + 0 + 57 + + + 76 + 0 + 56 + + + 80 + 0 + 66 + + + 84 + 0 + 65 + + + 88 + 0 + 64 + + + 92 + 0 + 60 + + + 96 + 0 + 70 + + + 104 + 0 + 69 + + + 112 + 0 + 68 + + + 120 + 0 + 67 + + + 128 + 0 + 71 + + + 129 + 0 + 72 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/buffers_defaults_t0.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..688fbe9d42fa --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/buffers_defaults_t0.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "11500000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "11500000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"85000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/buffers_defaults_t1.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..e9685b5530c0 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/buffers_defaults_t1.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "11500000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "11500000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"85000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/port_config.ini b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/port_config.ini new file mode 100644 index 000000000000..607dbf393955 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/port_config.ini @@ -0,0 +1,71 @@ +# name lanes alias speed autoneg fec index +Ethernet0 0 tenGigE0 10000 on none 1 +Ethernet1 1 tenGigE1 10000 on none 2 +Ethernet2 2 tenGigE2 10000 on none 3 +Ethernet3 3 tenGigE3 10000 on none 4 +Ethernet4 4 tenGigE4 10000 on none 5 +Ethernet5 5 tenGigE5 10000 on none 6 +Ethernet6 6 tenGigE6 10000 on none 7 +Ethernet7 7 tenGigE7 10000 on none 8 +Ethernet8 8 tenGigE8 10000 on none 9 +Ethernet9 9 tenGigE9 10000 on none 10 +Ethernet10 10 tenGigE10 10000 on none 11 +Ethernet11 11 tenGigE11 10000 on none 12 +Ethernet12 12 tenGigE12 10000 on none 13 +Ethernet13 13 tenGigE13 10000 on none 14 +Ethernet14 14 tenGigE14 10000 on none 15 +Ethernet15 15 tenGigE15 10000 on none 16 +Ethernet16 16 twenty5GigE16 25000 on none 17 +Ethernet17 17 twenty5GigE17 25000 on none 18 +Ethernet18 18 twenty5GigE18 25000 on none 19 +Ethernet19 19 twenty5GigE19 25000 on none 20 +Ethernet20 20 twenty5GigE20 25000 on none 21 +Ethernet21 21 twenty5GigE21 25000 on none 22 +Ethernet22 22 twenty5GigE22 25000 on none 23 +Ethernet23 23 twenty5GigE23 25000 on none 24 +Ethernet24 24 twenty5GigE24 25000 on none 25 +Ethernet25 25 twenty5GigE25 25000 on none 26 +Ethernet26 26 twenty5GigE26 25000 on none 27 +Ethernet27 27 twenty5GigE27 25000 on none 28 +Ethernet28 28 twenty5GigE28 25000 on none 29 +Ethernet29 29 twenty5GigE29 25000 on none 30 +Ethernet30 30 twenty5GigE30 25000 on none 31 +Ethernet31 31 twenty5GigE31 25000 on none 32 +Ethernet32 32 fiftyGigE32 50000 on rs 33 +Ethernet33 33 fiftyGigE33 50000 on rs 34 +Ethernet34 34 fiftyGigE34 50000 on rs 35 +Ethernet35 35 fiftyGigE35 50000 on rs 36 +Ethernet36 36 fiftyGigE36 50000 on rs 37 +Ethernet37 37 fiftyGigE37 50000 on rs 38 +Ethernet38 38 fiftyGigE38 50000 on rs 39 +Ethernet39 39 fiftyGigE39 50000 on rs 40 +Ethernet40 40 fiftyGigE40 50000 on rs 41 +Ethernet41 41 fiftyGigE41 50000 on rs 42 +Ethernet42 42 fiftyGigE42 50000 on rs 43 +Ethernet43 43 fiftyGigE43 50000 on rs 44 +Ethernet44 44 fiftyGigE44 50000 on rs 45 +Ethernet45 45 fiftyGigE45 50000 on rs 46 +Ethernet46 46 fiftyGigE46 50000 on rs 47 +Ethernet47 47 fiftyGigE47 50000 on rs 48 +Ethernet48 48,49 one00GigE48 100000 on rs 49 +Ethernet49 50,51 one00GigE49 100000 on rs 50 +Ethernet50 52,53 one00GigE50 100000 on rs 51 +Ethernet51 54,55 one00GigE51 100000 on rs 52 +Ethernet52 56,57 one00GigE52 100000 on rs 53 +Ethernet53 58,59 one00GigE53 100000 on rs 54 +Ethernet54 60,61 one00GigE54 100000 on rs 55 +Ethernet55 62,63 one00GigE55 100000 on rs 56 +Ethernet56 64,65,66,67 one00GigE56 100000 on rs 57 +Ethernet57 68,69,70,71 one00GigE57 100000 on rs 58 +Ethernet58 72,73,74,75 one00GigE58 100000 on rs 59 +Ethernet59 76,77,78,79 one00GigE59 100000 on rs 60 +Ethernet60 80,81,82,83 two00GigE60 200000 on rs 61 +Ethernet61 84,85,86,87 two00GigE61 200000 on rs 62 +Ethernet62 88,89,90,91 two00GigE62 200000 on rs 63 +Ethernet63 92,93,94,95 two00GigE63 200000 on rs 64 +Ethernet64 96,97,98,99,100,101,102,103 four00GigE64 400000 on rs 65 +Ethernet65 104,105,106,107,108,109,110,111 four00GigE65 400000 on rs 66 +Ethernet66 112,113,114,115,116,117,118,119 four00GigE66 400000 on rs 67 +Ethernet67 120,121,122,123,124,125,126,127 four00GigE67 400000 on rs 68 +Ethernet68 128 tenGigE68 10000 off none 69 +Ethernet69 129 tenGigE69 10000 off none 70 diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/profile.ini b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/profile.ini new file mode 100644 index 000000000000..c2f77685ad0a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/profile.ini @@ -0,0 +1 @@ +switchMacAddress=00:01:02:03:04:05 diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/sai.profile b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/sai.profile new file mode 100644 index 000000000000..c38ff1ab2259 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FALCON_DB/sai.profile @@ -0,0 +1,4 @@ +mode=1 +hwId=FC6_8T-DB +switchProfile=/usr/share/sonic/hwsku/SAI-F6_4T-DB.xml +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-Board-F6_4T-128x50G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-Board-F6_4T-128x50G.md5 new file mode 100644 index 000000000000..3a1dbc2cb3e3 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-Board-F6_4T-128x50G.md5 @@ -0,0 +1 @@ +62fde882ea62d2c13eb9d7def73f5373 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-Board-F6_4T-128x50G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-Board-F6_4T-128x50G.xml new file mode 100644 index 000000000000..6fb03bf181b4 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-Board-F6_4T-128x50G.xml @@ -0,0 +1,4038 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + Falcon-6.4T-256x50G + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F6_4T-128x50G.xml + ASK-L1-F6_4T-128x50G.xml + sip6 + + 0 + + ethernet_mac + 0 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 1 + + ethernet_mac + 1 + false + + + NA + + + + false + + + + 2 + + ethernet_mac + 2 + false + + + NA + + + + false + + + + 3 + + ethernet_mac + 3 + false + + + NA + + + + false + + + + 4 + + ethernet_mac + 4 + false + + + NA + + + + + 2 + true + + false + + + + 5 + + ethernet_mac + 5 + false + + + NA + + + + false + + + + 6 + + ethernet_mac + 6 + false + + + NA + + + + false + + + + 7 + + ethernet_mac + 7 + false + + + NA + + + + false + + + + 8 + + ethernet_mac + 8 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 9 + + ethernet_mac + 9 + false + + + NA + + + + + 2 + true + + false + + + + 10 + + ethernet_mac + 10 + false + + + NA + + + + + 2 + true + + false + + + + 11 + + ethernet_mac + 11 + false + + + NA + + + + + 2 + true + + false + + + + 12 + + ethernet_mac + 12 + false + + + NA + + + + + 2 + true + + false + + + + 13 + + ethernet_mac + 13 + false + + + NA + + + + + 2 + true + + false + + + + 14 + + ethernet_mac + 14 + false + + + NA + + + + + 2 + true + + false + + + + 15 + + ethernet_mac + 15 + false + + + NA + + + + + 2 + true + + false + + + + 16 + + ethernet_mac + 16 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 17 + + ethernet_mac + 17 + false + + + NA + + + + + 2 + true + + false + + + + 18 + + ethernet_mac + 18 + false + + + NA + + + + + 2 + true + + false + + + + 19 + + ethernet_mac + 19 + false + + + NA + + + + + 2 + true + + false + + + + 20 + + ethernet_mac + 20 + false + + + NA + + + + + 2 + true + + false + + + + 21 + + ethernet_mac + 21 + false + + + NA + + + + + 2 + true + + false + + + + 22 + + ethernet_mac + 22 + false + + + NA + + + + + 2 + true + + false + + + + 23 + + ethernet_mac + 23 + false + + + NA + + + + + 2 + true + + false + + + + 24 + + ethernet_mac + 24 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 25 + + ethernet_mac + 25 + false + + + NA + + + + + 2 + true + + false + + + + 26 + + ethernet_mac + 26 + false + + + NA + + + + + 2 + true + + false + + + + 27 + + ethernet_mac + 27 + false + + + NA + + + + + 2 + true + + false + + + + 28 + + ethernet_mac + 28 + false + + + NA + + + + + 2 + true + + false + + + + 29 + + ethernet_mac + 29 + false + + + NA + + + + + 2 + true + + false + + + + 30 + + ethernet_mac + 30 + false + + + NA + + + + + 2 + true + + false + + + + 31 + + ethernet_mac + 31 + false + + + NA + + + + + 2 + true + + false + + + + 32 + + ethernet_mac + 32 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 33 + + ethernet_mac + 33 + false + + + NA + + + + + 2 + true + + false + + + + 34 + + ethernet_mac + 34 + false + + + NA + + + + + 2 + true + + false + + + + 35 + + ethernet_mac + 35 + false + + + NA + + + + + 2 + true + + false + + + + 36 + + ethernet_mac + 36 + false + + + NA + + + + + 2 + true + + false + + + + 37 + + ethernet_mac + 37 + false + + + NA + + + + + 2 + true + + false + + + + 38 + + ethernet_mac + 38 + false + + + NA + + + + + 2 + true + + false + + + + 39 + + ethernet_mac + 39 + false + + + NA + + + + + 2 + true + + false + + + + 40 + + ethernet_mac + 40 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 41 + + ethernet_mac + 41 + false + + + NA + + + + + 2 + true + + false + + + + 42 + + ethernet_mac + 42 + false + + + NA + + + + + 2 + true + + false + + + + 43 + + ethernet_mac + 43 + false + + + NA + + + + + 2 + true + + false + + + + 44 + + ethernet_mac + 44 + false + + + NA + + + + + 2 + true + + false + + + + 45 + + ethernet_mac + 45 + false + + + NA + + + + + 2 + true + + false + + + + 46 + + ethernet_mac + 46 + false + + + NA + + + + + 2 + true + + false + + + + 47 + + ethernet_mac + 47 + false + + + NA + + + + + 2 + true + + false + + + + 48 + + ethernet_mac + 48 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 49 + + ethernet_mac + 49 + false + + + NA + + + + + 2 + true + + false + + + + 50 + + ethernet_mac + 50 + false + + + NA + + + + + 2 + true + + false + + + + 51 + + ethernet_mac + 51 + false + + + NA + + + + + 2 + true + + false + + + + 52 + + ethernet_mac + 52 + false + + + NA + + + + + 2 + true + + false + + + + 53 + + ethernet_mac + 53 + false + + + NA + + + + + 2 + true + + false + + + + 54 + + ethernet_mac + 54 + false + + + NA + + + + + 2 + true + + false + + + + 55 + + ethernet_mac + 55 + false + + + NA + + + + + 2 + true + + false + + + + 56 + + ethernet_mac + 56 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 57 + + ethernet_mac + 57 + false + + + NA + + + + + 2 + true + + false + + + + 58 + + ethernet_mac + 58 + false + + + NA + + + + + 2 + true + + false + + + + 59 + + ethernet_mac + 59 + false + + + NA + + + + + 2 + true + + false + + + + 60 + + ethernet_mac + 60 + false + + + NA + + + + + 2 + true + + false + + + + 64 + + ethernet_mac + 61 + false + + + NA + + + + + 2 + true + + false + + + + 65 + + ethernet_mac + 62 + false + + + NA + + + + + 2 + true + + false + + + + 66 + + ethernet_mac + 63 + false + + + NA + + + + + 2 + true + + false + + + + 67 + + ethernet_mac + 64 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 68 + + ethernet_mac + 65 + false + + + NA + + + + + 2 + true + + false + + + + 69 + + ethernet_mac + 66 + false + + + NA + + + + + 2 + true + + false + + + + 70 + + ethernet_mac + 67 + false + + + NA + + + + + 2 + true + + false + + + + 130 + + ethernet_mac + 127 + false + + + NA + + + + + 2 + true + + false + + + + 129 + + ethernet_mac + 126 + false + + + NA + + + + + 2 + true + + false + + + + 128 + + ethernet_mac + 125 + false + + + NA + + + + + 2 + true + + false + + + + 127 + + ethernet_mac + 124 + false + + + NA + + + + + 2 + true + + false + + + + 126 + + ethernet_mac + 123 + false + + + NA + + + + + 2 + true + + false + + + + 125 + + ethernet_mac + 122 + false + + + NA + + + + + 2 + true + + false + + + + 124 + + ethernet_mac + 121 + false + + + NA + + + + + 2 + true + + false + + + + 123 + + ethernet_mac + 120 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 122 + + ethernet_mac + 119 + false + + + NA + + + + + 2 + true + + false + + + + 121 + + ethernet_mac + 118 + false + + + NA + + + + + 2 + true + + false + + + + 120 + + ethernet_mac + 117 + false + + + NA + + + + + 2 + true + + false + + + + 119 + + ethernet_mac + 116 + false + + + NA + + + + + 2 + true + + false + + + + 118 + + ethernet_mac + 115 + false + + + NA + + + + + 2 + true + + false + + + + 117 + + ethernet_mac + 114 + false + + + NA + + + + + 2 + true + + false + + + + 116 + + ethernet_mac + 113 + false + + + NA + + + + + 2 + true + + false + + + + 115 + + ethernet_mac + 112 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 114 + + ethernet_mac + 111 + false + + + NA + + + + + 2 + true + + false + + + + 113 + + ethernet_mac + 110 + false + + + NA + + + + + 2 + true + + false + + + + 112 + + ethernet_mac + 109 + false + + + NA + + + + + 2 + true + + false + + + + 111 + + ethernet_mac + 108 + false + + + NA + + + + + 2 + true + + false + + + + 110 + + ethernet_mac + 107 + false + + + NA + + + + + 2 + true + + false + + + + 109 + + ethernet_mac + 106 + false + + + NA + + + + + 2 + true + + false + + + + 108 + + ethernet_mac + 105 + false + + + NA + + + + + 2 + true + + false + + + + 107 + + ethernet_mac + 104 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 106 + + ethernet_mac + 103 + false + + + NA + + + + + 2 + true + + false + + + + 105 + + ethernet_mac + 102 + false + + + NA + + + + + 2 + true + + false + + + + 104 + + ethernet_mac + 101 + false + + + NA + + + + + 2 + true + + false + + + + 103 + + ethernet_mac + 100 + false + + + NA + + + + + 2 + true + + false + + + + 102 + + ethernet_mac + 99 + false + + + NA + + + + + 2 + true + + false + + + + 101 + + ethernet_mac + 98 + false + + + NA + + + + + 2 + true + + false + + + + 100 + + ethernet_mac + 97 + false + + + NA + + + + + 2 + true + + false + + + + 99 + + ethernet_mac + 96 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 98 + + ethernet_mac + 95 + false + + + NA + + + + + 2 + true + + false + + + + 97 + + ethernet_mac + 94 + false + + + NA + + + + + 2 + true + + false + + + + 96 + + ethernet_mac + 93 + false + + + NA + + + + + 2 + true + + false + + + + 95 + + ethernet_mac + 92 + false + + + NA + + + + + 2 + true + + false + + + + 94 + + ethernet_mac + 91 + false + + + NA + + + + + 2 + true + + false + + + + 93 + + ethernet_mac + 90 + false + + + NA + + + + + 2 + true + + false + + + + 92 + + ethernet_mac + 89 + false + + + NA + + + + + 2 + true + + false + + + + 91 + + ethernet_mac + 88 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 90 + + ethernet_mac + 87 + false + + + NA + + + + + 2 + true + + false + + + + 89 + + ethernet_mac + 86 + false + + + NA + + + + + 2 + true + + false + + + + 88 + + ethernet_mac + 85 + false + + + NA + + + + + 2 + true + + false + + + + 87 + + ethernet_mac + 84 + false + + + NA + + + + + 2 + true + + false + + + + 86 + + ethernet_mac + 83 + false + + + NA + + + + + 2 + true + + false + + + + 85 + + ethernet_mac + 82 + false + + + NA + + + + + 2 + true + + false + + + + 84 + + ethernet_mac + 81 + false + + + NA + + + + + 2 + true + + false + + + + 83 + + ethernet_mac + 80 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 82 + + ethernet_mac + 79 + false + + + NA + + + + + 2 + true + + false + + + + 81 + + ethernet_mac + 78 + false + + + NA + + + + + 2 + true + + false + + + + 80 + + ethernet_mac + 77 + false + + + NA + + + + + 2 + true + + false + + + + 79 + + ethernet_mac + 76 + false + + + NA + + + + + 2 + true + + false + + + + 78 + + ethernet_mac + 75 + false + + + NA + + + + + 2 + true + + false + + + + 77 + + ethernet_mac + 74 + false + + + NA + + + + + 2 + true + + false + + + + 76 + + ethernet_mac + 73 + false + + + NA + + + + + 2 + true + + false + + + + 75 + + ethernet_mac + 72 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 74 + + ethernet_mac + 71 + false + + + NA + + + + + 2 + true + + false + + + + 73 + + ethernet_mac + 70 + false + + + NA + + + + + 2 + true + + false + + + + 72 + + ethernet_mac + 69 + false + + + NA + + + + + 2 + true + + false + + + + 71 + + ethernet_mac + 68 + false + + + NA + + + + + 2 + true + + false + + + + 131 + + ethernet_mac + 128 + false + + + NA + + + + + + 2 + true + + false + + + + 132 + + ethernet_mac + 135 + false + + + NA + + + + + 2 + true + + false + + + + 63 + + cpu_sdma + 136 + false + + + + 133 + + cpu_sdma + 137 + false + + + + 134 + + cpu_sdma + 138 + false + + + + 135 + + cpu_sdma + 139 + false + + + + 7 + true + false + + + 1 + true + false + + + 6 + true + true + + + 0 + true + false + + + 5 + true + false + + + 3 + true + true + + + 4 + true + true + + + 2 + false + false + + + 8 + false + true + + + 14 + false + false + + + 9 + false + false + + + 15 + false + true + + + 10 + false + true + + + 12 + false + true + + + 11 + true + false + + + 13 + false + true + + + 23 + false + false + + + 17 + false + false + + + 22 + true + false + + + 16 + false + true + + + 21 + false + false + + + 19 + true + true + + + 20 + true + false + + + 18 + false + true + + + 24 + false + false + + + 30 + false + false + + + 25 + false + true + + + 31 + false + false + + + 26 + true + false + + + 28 + false + true + + + 27 + false + true + + + 29 + false + true + + + 39 + false + false + + + 33 + true + false + + + 38 + false + false + + + 32 + false + false + + + 37 + true + false + + + 35 + true + true + + + 36 + true + false + + + 34 + false + false + + + 40 + false + false + + + 41 + true + true + + + 46 + true + true + + + 47 + true + true + + + 42 + true + false + + + 44 + false + false + + + 43 + false + true + + + 45 + true + false + + + 55 + false + false + + + 49 + true + false + + + 54 + true + true + + + 48 + false + true + + + 53 + true + false + + + 51 + false + true + + + 52 + false + true + + + 50 + false + true + + + 56 + false + false + + + 62 + true + false + + + 57 + false + true + + + 63 + true + true + + + 58 + false + false + + + 60 + false + true + + + 59 + false + true + + + 61 + false + true + + + 71 + false + false + + + 65 + true + false + + + 70 + false + true + + + 64 + true + true + + + 69 + true + false + + + 67 + true + true + + + 68 + true + true + + + 66 + true + true + + + 72 + true + false + + + 78 + false + false + + + 73 + false + true + + + 79 + true + true + + + 74 + true + false + + + 76 + true + true + + + 75 + true + true + + + 77 + false + true + + + 87 + false + false + + + 81 + false + false + + + 86 + false + false + + + 80 + true + false + + + 85 + false + true + + + 83 + true + true + + + 84 + true + false + + + 82 + false + false + + + 88 + true + false + + + 94 + true + false + + + 89 + false + false + + + 95 + true + false + + + 90 + true + false + + + 92 + false + true + + + 91 + false + false + + + 93 + false + false + + + 103 + true + false + + + 97 + true + false + + + 102 + true + false + + + 96 + true + true + + + 101 + true + false + + + 99 + true + true + + + 100 + true + true + + + 98 + false + true + + + 104 + true + false + + + 110 + false + false + + + 105 + true + true + + + 111 + true + false + + + 106 + true + false + + + 108 + false + false + + + 107 + false + true + + + 109 + true + false + + + 119 + true + false + + + 113 + true + true + + + 118 + true + true + + + 112 + true + false + + + 117 + true + false + + + 115 + false + false + + + 116 + true + false + + + 114 + false + false + + + 120 + false + false + + + 126 + false + false + + + 121 + false + true + + + 127 + false + true + + + 122 + true + false + + + 124 + false + true + + + 123 + false + true + + + 125 + false + true + + + 128 + false + true + + + 135 + true + false + + + 0 + + ORDER_MODE_BY_CLASS + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_0 + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_1 + PULSE_STRETCH_1 + false + 1627 + false + + 1 + 64 + 66 + false + + + 2 + 64 + 65 + false + + + 3 + 64 + 65 + false + + + 4 + 64 + 66 + false + + + 5 + 64 + 66 + false + + + 6 + 64 + 65 + false + + + 7 + 64 + 65 + false + + + 8 + 64 + 66 + false + + + + 0 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 1 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 2 + PORT_TYPE_XG + true + BLINK_SELECT_0 + false + true + true + + + 3 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 4 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 5 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + + /tmp/cpss_uds + + 8 + + MAP0 + + 7 + + + 1 + + + 6 + + + 0 + + + 5 + + + 3 + + + 4 + + + 2 + + + + MAP1 + + 0 + + + 6 + + + 1 + + + 7 + + + 2 + + + 4 + + + 3 + + + 5 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-L1-F6_4T-128x50G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-L1-F6_4T-128x50G.md5 new file mode 100644 index 000000000000..5f5b56ae97cb --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-L1-F6_4T-128x50G.md5 @@ -0,0 +1 @@ +51984f20fe0c5fc520468799ed78af96 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-L1-F6_4T-128x50G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-L1-F6_4T-128x50G.xml new file mode 100644 index 000000000000..b79e0a2f0cf8 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-L1-F6_4T-128x50G.xml @@ -0,0 +1,1681 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 10GR1Fix + + KR + 10G + disabled + + + + 50GR1 + + CR + 50G + rs_544_514_enabled + + + KR + 50G + rs_544_514_enabled + + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 50G + rs_544_514_enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 50G + rs_544_514_enabled + rs_544_514_enabled + + + KR + 50G + rs_544_514_enabled + rs_544_514_enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 50GR1 + + + 1 + AVAGO + profile_default + 50GR1 + + + 2 + AVAGO + profile_default + 50GR1 + + + 3 + AVAGO + profile_default + 50GR1 + + + 4 + AVAGO + profile_default + 50GR1 + + + 5 + AVAGO + profile_default + 50GR1 + + + 6 + AVAGO + profile_default + 50GR1 + + + 7 + AVAGO + profile_default + 50GR1 + + + 8 + AVAGO + profile_default + 50GR1 + + + 9 + AVAGO + profile_default + 50GR1 + + + 10 + AVAGO + profile_default + 50GR1 + + + 11 + AVAGO + profile_default + 50GR1 + + + 12 + AVAGO + profile_default + 50GR1 + + + 13 + AVAGO + profile_default + 50GR1 + + + 14 + AVAGO + profile_default + 50GR1 + + + 15 + AVAGO + profile_default + 50GR1 + + + 16 + AVAGO + profile_default + 50GR1 + + + 17 + AVAGO + profile_default + 50GR1 + + + 18 + AVAGO + profile_default + 50GR1 + + + 19 + AVAGO + profile_default + 50GR1 + + + 20 + AVAGO + profile_default + 50GR1 + + + 21 + AVAGO + profile_default + 50GR1 + + + 22 + AVAGO + profile_default + 50GR1 + + + 23 + AVAGO + profile_default + 50GR1 + + + 24 + AVAGO + profile_default + 50GR1 + + + 25 + AVAGO + profile_default + 50GR1 + + + 26 + AVAGO + profile_default + 50GR1 + + + 27 + AVAGO + profile_default + 50GR1 + + + 28 + AVAGO + profile_default + 50GR1 + + + 29 + AVAGO + profile_default + 50GR1 + + + 30 + AVAGO + profile_default + 50GR1 + + + 31 + AVAGO + profile_default + 50GR1 + + + 32 + AVAGO + profile_default + 50GR1 + + + 33 + AVAGO + profile_default + 50GR1 + + + 34 + AVAGO + profile_default + 50GR1 + + + 35 + AVAGO + profile_default + 50GR1 + + + 36 + AVAGO + profile_default + 50GR1 + + + 37 + AVAGO + profile_default + 50GR1 + + + 38 + AVAGO + profile_default + 50GR1 + + + 39 + AVAGO + profile_default + 50GR1 + + + 40 + AVAGO + profile_default + 50GR1 + + + 41 + AVAGO + profile_default + 50GR1 + + + 42 + AVAGO + profile_default + 50GR1 + + + 43 + AVAGO + profile_default + 50GR1 + + + 44 + AVAGO + profile_default + 50GR1 + + + 45 + AVAGO + profile_default + 50GR1 + + + 46 + AVAGO + profile_default + 50GR1 + + + 47 + AVAGO + profile_default + 50GR1 + + + 48 + AVAGO + profile_default + 50GR1 + + + 49 + AVAGO + profile_default + 50GR1 + + + 50 + AVAGO + profile_default + 50GR1 + + + 51 + AVAGO + profile_default + 50GR1 + + + 52 + AVAGO + profile_default + 50GR1 + + + 53 + AVAGO + profile_default + 50GR1 + + + 54 + AVAGO + profile_default + 50GR1 + + + 55 + AVAGO + profile_default + 50GR1 + + + 56 + AVAGO + profile_default + 50GR1 + + + 57 + AVAGO + profile_default + 50GR1 + + + 58 + AVAGO + profile_default + 50GR1 + + + 59 + AVAGO + profile_default + 50GR1 + + + 60 + AVAGO + profile_default + 50GR1 + + + 64 + AVAGO + profile_default + 50GR1 + + + 65 + AVAGO + profile_default + 50GR1 + + + 66 + AVAGO + profile_default + 50GR1 + + + 67 + AVAGO + profile_default + 50GR1 + + + 68 + AVAGO + profile_default + 50GR1 + + + 69 + AVAGO + profile_default + 50GR1 + + + 70 + AVAGO + profile_default + 50GR1 + + + 71 + AVAGO + profile_default + 50GR1 + + + 72 + AVAGO + profile_default + 50GR1 + + + 73 + AVAGO + profile_default + 50GR1 + + + 74 + AVAGO + profile_default + 50GR1 + + + 75 + AVAGO + profile_default + 50GR1 + + + 76 + AVAGO + profile_default + 50GR1 + + + 77 + AVAGO + profile_default + 50GR1 + + + 78 + AVAGO + profile_default + 50GR1 + + + 79 + AVAGO + profile_default + 50GR1 + + + 80 + AVAGO + profile_default + 50GR1 + + + 81 + AVAGO + profile_default + 50GR1 + + + 82 + AVAGO + profile_default + 50GR1 + + + 83 + AVAGO + profile_default + 50GR1 + + + 84 + AVAGO + profile_default + 50GR1 + + + 85 + AVAGO + profile_default + 50GR1 + + + 86 + AVAGO + profile_default + 50GR1 + + + 87 + AVAGO + profile_default + 50GR1 + + + 88 + AVAGO + profile_default + 50GR1 + + + 89 + AVAGO + profile_default + 50GR1 + + + 90 + AVAGO + profile_default + 50GR1 + + + 91 + AVAGO + profile_default + 50GR1 + + + 92 + AVAGO + profile_default + 50GR1 + + + 93 + AVAGO + profile_default + 50GR1 + + + 94 + AVAGO + profile_default + 50GR1 + + + 95 + AVAGO + profile_default + 50GR1 + + + 96 + AVAGO + profile_default + 50GR1 + + + 97 + AVAGO + profile_default + 50GR1 + + + 98 + AVAGO + profile_default + 50GR1 + + + 99 + AVAGO + profile_default + 50GR1 + + + 100 + AVAGO + profile_default + 50GR1 + + + 101 + AVAGO + profile_default + 50GR1 + + + 102 + AVAGO + profile_default + 50GR1 + + + 103 + AVAGO + profile_default + 50GR1 + + + 104 + AVAGO + profile_default + 50GR1 + + + 105 + AVAGO + profile_default + 50GR1 + + + 106 + AVAGO + profile_default + 50GR1 + + + 107 + AVAGO + profile_default + 50GR1 + + + 108 + AVAGO + profile_default + 50GR1 + + + 109 + AVAGO + profile_default + 50GR1 + + + 110 + AVAGO + profile_default + 50GR1 + + + 111 + AVAGO + profile_default + 50GR1 + + + 112 + AVAGO + profile_default + 50GR1 + + + 113 + AVAGO + profile_default + 50GR1 + + + 114 + AVAGO + profile_default + 50GR1 + + + 115 + AVAGO + profile_default + 50GR1 + + + 116 + AVAGO + profile_default + 50GR1 + + + 117 + AVAGO + profile_default + 50GR1 + + + 118 + AVAGO + profile_default + 50GR1 + + + 119 + AVAGO + profile_default + 50GR1 + + + 120 + AVAGO + profile_default + 50GR1 + + + 121 + AVAGO + profile_default + 50GR1 + + + 122 + AVAGO + profile_default + 50GR1 + + + 123 + AVAGO + profile_default + 50GR1 + + + 124 + AVAGO + profile_default + 50GR1 + + + 125 + AVAGO + profile_default + 50GR1 + + + 126 + AVAGO + profile_default + 50GR1 + + + 127 + AVAGO + profile_default + 50GR1 + + + 128 + AVAGO + profile_default + 50GR1 + + + 129 + AVAGO + profile_default + 50GR1 + + + 130 + AVAGO + profile_default + 50GR1 + + + 131 + AVAGO + profile_default + 10GR1Fix + + + 132 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-PP-F6_4T-128x50G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-PP-F6_4T-128x50G.md5 new file mode 100644 index 000000000000..a42c5128e593 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-PP-F6_4T-128x50G.md5 @@ -0,0 +1 @@ +2af3a9b26c1f50a5b1201246746c1094 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-PP-F6_4T-128x50G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-PP-F6_4T-128x50G.xml new file mode 100644 index 000000000000..e3d2f754e49a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/ASK-PP-F6_4T-128x50G.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-6.4 + + 4294967295 + external_25_single_ended + 2 + 60 + 256-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/SAI-F6_4T-128x50G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/SAI-F6_4T-128x50G.md5 new file mode 100644 index 000000000000..937d5b67fa70 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/SAI-F6_4T-128x50G.md5 @@ -0,0 +1 @@ +b6f84e11689b4f1c648e63119410f900 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/SAI-F6_4T-128x50G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/SAI-F6_4T-128x50G.xml new file mode 100644 index 000000000000..31d7b03f1a34 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/SAI-F6_4T-128x50G.xml @@ -0,0 +1,883 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F6_4T-128x50G.xml + + + 0 + 0 + 130 + + + 1 + 0 + 129 + + + 2 + 0 + 128 + + + 3 + 0 + 127 + + + 4 + 0 + 126 + + + 5 + 0 + 125 + + + 6 + 0 + 124 + + + 7 + 0 + 123 + + + 8 + 0 + 122 + + + 9 + 0 + 121 + + + 10 + 0 + 120 + + + 11 + 0 + 119 + + + 12 + 0 + 118 + + + 13 + 0 + 117 + + + 14 + 0 + 116 + + + 15 + 0 + 115 + + + 16 + 0 + 114 + + + 17 + 0 + 113 + + + 18 + 0 + 112 + + + 19 + 0 + 111 + + + 20 + 0 + 110 + + + 21 + 0 + 109 + + + 22 + 0 + 108 + + + 23 + 0 + 107 + + + 24 + 0 + 106 + + + 25 + 0 + 105 + + + 26 + 0 + 104 + + + 27 + 0 + 103 + + + 28 + 0 + 102 + + + 29 + 0 + 101 + + + 30 + 0 + 100 + + + 31 + 0 + 99 + + + 32 + 0 + 98 + + + 33 + 0 + 97 + + + 34 + 0 + 96 + + + 35 + 0 + 95 + + + 36 + 0 + 94 + + + 37 + 0 + 93 + + + 38 + 0 + 92 + + + 39 + 0 + 91 + + + 40 + 0 + 90 + + + 41 + 0 + 89 + + + 42 + 0 + 88 + + + 43 + 0 + 87 + + + 44 + 0 + 86 + + + 45 + 0 + 85 + + + 46 + 0 + 84 + + + 47 + 0 + 83 + + + 48 + 0 + 82 + + + 49 + 0 + 81 + + + 50 + 0 + 80 + + + 51 + 0 + 79 + + + 52 + 0 + 78 + + + 53 + 0 + 77 + + + 54 + 0 + 76 + + + 55 + 0 + 75 + + + 56 + 0 + 74 + + + 57 + 0 + 73 + + + 58 + 0 + 72 + + + 59 + 0 + 71 + + + 60 + 0 + 70 + + + 61 + 0 + 69 + + + 62 + 0 + 68 + + + 63 + 0 + 67 + + + 64 + 0 + 66 + + + 65 + 0 + 65 + + + 66 + 0 + 64 + + + 67 + 0 + 60 + + + 68 + 0 + 59 + + + 69 + 0 + 58 + + + 70 + 0 + 57 + + + 71 + 0 + 56 + + + 72 + 0 + 55 + + + 73 + 0 + 54 + + + 74 + 0 + 53 + + + 75 + 0 + 52 + + + 76 + 0 + 51 + + + 77 + 0 + 50 + + + 78 + 0 + 49 + + + 79 + 0 + 48 + + + 80 + 0 + 47 + + + 81 + 0 + 46 + + + 82 + 0 + 45 + + + 83 + 0 + 44 + + + 84 + 0 + 43 + + + 85 + 0 + 42 + + + 86 + 0 + 41 + + + 87 + 0 + 40 + + + 88 + 0 + 39 + + + 89 + 0 + 38 + + + 90 + 0 + 37 + + + 91 + 0 + 36 + + + 92 + 0 + 35 + + + 93 + 0 + 34 + + + 94 + 0 + 33 + + + 95 + 0 + 32 + + + 96 + 0 + 31 + + + 97 + 0 + 30 + + + 98 + 0 + 29 + + + 99 + 0 + 28 + + + 100 + 0 + 27 + + + 101 + 0 + 26 + + + 102 + 0 + 25 + + + 103 + 0 + 24 + + + 104 + 0 + 23 + + + 105 + 0 + 22 + + + 106 + 0 + 21 + + + 107 + 0 + 20 + + + 108 + 0 + 19 + + + 109 + 0 + 18 + + + 110 + 0 + 17 + + + 111 + 0 + 16 + + + 112 + 0 + 15 + + + 113 + 0 + 14 + + + 114 + 0 + 13 + + + 115 + 0 + 12 + + + 116 + 0 + 11 + + + 117 + 0 + 10 + + + 118 + 0 + 9 + + + 119 + 0 + 8 + + + 120 + 0 + 7 + + + 121 + 0 + 6 + + + 122 + 0 + 5 + + + 123 + 0 + 4 + + + 124 + 0 + 3 + + + 125 + 0 + 2 + + + 126 + 0 + 1 + + + 127 + 0 + 0 + + + 128 + 0 + 131 + + + 129 + 0 + 132 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/buffers_defaults_t0.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..d207208ed964 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/buffers_defaults_t0.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "11500000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "11500000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"42500", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/buffers_defaults_t1.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..0de5fbd21423 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/buffers_defaults_t1.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "11500000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "11500000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"42500", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/port_config.ini b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/port_config.ini new file mode 100644 index 000000000000..bb752f698c2b --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/port_config.ini @@ -0,0 +1,131 @@ +# name lanes alias speed autoneg fec index +Ethernet0 0 fiftyGigE0 50000 on rs 1 +Ethernet1 1 fiftyGigE1 50000 on rs 2 +Ethernet2 2 fiftyGigE2 50000 on rs 3 +Ethernet3 3 fiftyGigE3 50000 on rs 4 +Ethernet4 4 fiftyGigE4 50000 on rs 5 +Ethernet5 5 fiftyGigE5 50000 on rs 6 +Ethernet6 6 fiftyGigE6 50000 on rs 7 +Ethernet7 7 fiftyGigE7 50000 on rs 8 +Ethernet8 8 fiftyGigE8 50000 on rs 9 +Ethernet9 9 fiftyGigE9 50000 on rs 10 +Ethernet10 10 fiftyGigE10 50000 on rs 11 +Ethernet11 11 fiftyGigE11 50000 on rs 12 +Ethernet12 12 fiftyGigE12 50000 on rs 13 +Ethernet13 13 fiftyGigE13 50000 on rs 14 +Ethernet14 14 fiftyGigE14 50000 on rs 15 +Ethernet15 15 fiftyGigE15 50000 on rs 16 +Ethernet16 16 fiftyGigE16 50000 on rs 17 +Ethernet17 17 fiftyGigE17 50000 on rs 18 +Ethernet18 18 fiftyGigE18 50000 on rs 19 +Ethernet19 19 fiftyGigE19 50000 on rs 20 +Ethernet20 20 fiftyGigE20 50000 on rs 21 +Ethernet21 21 fiftyGigE21 50000 on rs 22 +Ethernet22 22 fiftyGigE22 50000 on rs 23 +Ethernet23 23 fiftyGigE23 50000 on rs 24 +Ethernet24 24 fiftyGigE24 50000 on rs 25 +Ethernet25 25 fiftyGigE25 50000 on rs 26 +Ethernet26 26 fiftyGigE26 50000 on rs 27 +Ethernet27 27 fiftyGigE27 50000 on rs 28 +Ethernet28 28 fiftyGigE28 50000 on rs 29 +Ethernet29 29 fiftyGigE29 50000 on rs 30 +Ethernet30 30 fiftyGigE30 50000 on rs 31 +Ethernet31 31 fiftyGigE31 50000 on rs 32 +Ethernet32 32 fiftyGigE32 50000 on rs 33 +Ethernet33 33 fiftyGigE33 50000 on rs 34 +Ethernet34 34 fiftyGigE34 50000 on rs 35 +Ethernet35 35 fiftyGigE35 50000 on rs 36 +Ethernet36 36 fiftyGigE36 50000 on rs 37 +Ethernet37 37 fiftyGigE37 50000 on rs 38 +Ethernet38 38 fiftyGigE38 50000 on rs 39 +Ethernet39 39 fiftyGigE39 50000 on rs 40 +Ethernet40 40 fiftyGigE40 50000 on rs 41 +Ethernet41 41 fiftyGigE41 50000 on rs 42 +Ethernet42 42 fiftyGigE42 50000 on rs 43 +Ethernet43 43 fiftyGigE43 50000 on rs 44 +Ethernet44 44 fiftyGigE44 50000 on rs 45 +Ethernet45 45 fiftyGigE45 50000 on rs 46 +Ethernet46 46 fiftyGigE46 50000 on rs 47 +Ethernet47 47 fiftyGigE47 50000 on rs 48 +Ethernet48 48 fiftyGigE48 50000 on rs 49 +Ethernet49 49 fiftyGigE49 50000 on rs 50 +Ethernet50 50 fiftyGigE50 50000 on rs 51 +Ethernet51 51 fiftyGigE51 50000 on rs 52 +Ethernet52 52 fiftyGigE52 50000 on rs 53 +Ethernet53 53 fiftyGigE53 50000 on rs 54 +Ethernet54 54 fiftyGigE54 50000 on rs 55 +Ethernet55 55 fiftyGigE55 50000 on rs 56 +Ethernet56 56 fiftyGigE56 50000 on rs 57 +Ethernet57 57 fiftyGigE57 50000 on rs 58 +Ethernet58 58 fiftyGigE58 50000 on rs 59 +Ethernet59 59 fiftyGigE59 50000 on rs 60 +Ethernet60 60 fiftyGigE60 50000 on rs 61 +Ethernet61 61 fiftyGigE61 50000 on rs 62 +Ethernet62 62 fiftyGigE62 50000 on rs 63 +Ethernet63 63 fiftyGigE63 50000 on rs 64 +Ethernet64 64 fiftyGigE64 50000 on rs 65 +Ethernet65 65 fiftyGigE65 50000 on rs 66 +Ethernet66 66 fiftyGigE66 50000 on rs 67 +Ethernet67 67 fiftyGigE67 50000 on rs 68 +Ethernet68 68 fiftyGigE68 50000 on rs 69 +Ethernet69 69 fiftyGigE69 50000 on rs 70 +Ethernet70 70 fiftyGigE70 50000 on rs 71 +Ethernet71 71 fiftyGigE71 50000 on rs 72 +Ethernet72 72 fiftyGigE72 50000 on rs 73 +Ethernet73 73 fiftyGigE73 50000 on rs 74 +Ethernet74 74 fiftyGigE74 50000 on rs 75 +Ethernet75 75 fiftyGigE75 50000 on rs 76 +Ethernet76 76 fiftyGigE76 50000 on rs 77 +Ethernet77 77 fiftyGigE77 50000 on rs 78 +Ethernet78 78 fiftyGigE78 50000 on rs 79 +Ethernet79 79 fiftyGigE79 50000 on rs 80 +Ethernet80 80 fiftyGigE80 50000 on rs 81 +Ethernet81 81 fiftyGigE81 50000 on rs 82 +Ethernet82 82 fiftyGigE82 50000 on rs 83 +Ethernet83 83 fiftyGigE83 50000 on rs 84 +Ethernet84 84 fiftyGigE84 50000 on rs 85 +Ethernet85 85 fiftyGigE85 50000 on rs 86 +Ethernet86 86 fiftyGigE86 50000 on rs 87 +Ethernet87 87 fiftyGigE87 50000 on rs 88 +Ethernet88 88 fiftyGigE88 50000 on rs 89 +Ethernet89 89 fiftyGigE89 50000 on rs 90 +Ethernet90 90 fiftyGigE90 50000 on rs 91 +Ethernet91 91 fiftyGigE91 50000 on rs 92 +Ethernet92 92 fiftyGigE92 50000 on rs 93 +Ethernet93 93 fiftyGigE93 50000 on rs 94 +Ethernet94 94 fiftyGigE94 50000 on rs 95 +Ethernet95 95 fiftyGigE95 50000 on rs 96 +Ethernet96 96 fiftyGigE96 50000 on rs 97 +Ethernet97 97 fiftyGigE97 50000 on rs 98 +Ethernet98 98 fiftyGigE98 50000 on rs 99 +Ethernet99 99 fiftyGigE99 50000 on rs 100 +Ethernet100 100 fiftyGigE100 50000 on rs 101 +Ethernet101 101 fiftyGigE101 50000 on rs 102 +Ethernet102 102 fiftyGigE102 50000 on rs 103 +Ethernet103 103 fiftyGigE103 50000 on rs 104 +Ethernet104 104 fiftyGigE104 50000 on rs 105 +Ethernet105 105 fiftyGigE105 50000 on rs 106 +Ethernet106 106 fiftyGigE106 50000 on rs 107 +Ethernet107 107 fiftyGigE107 50000 on rs 108 +Ethernet108 108 fiftyGigE108 50000 on rs 109 +Ethernet109 109 fiftyGigE109 50000 on rs 110 +Ethernet110 110 fiftyGigE110 50000 on rs 111 +Ethernet111 111 fiftyGigE111 50000 on rs 112 +Ethernet112 112 fiftyGigE112 50000 on rs 113 +Ethernet113 113 fiftyGigE113 50000 on rs 114 +Ethernet114 114 fiftyGigE114 50000 on rs 115 +Ethernet115 115 fiftyGigE115 50000 on rs 116 +Ethernet116 116 fiftyGigE116 50000 on rs 117 +Ethernet117 117 fiftyGigE117 50000 on rs 118 +Ethernet118 118 fiftyGigE118 50000 on rs 119 +Ethernet119 119 fiftyGigE119 50000 on rs 120 +Ethernet120 120 fiftyGigE120 50000 on rs 121 +Ethernet121 121 fiftyGigE121 50000 on rs 122 +Ethernet122 122 fiftyGigE122 50000 on rs 123 +Ethernet123 123 fiftyGigE123 50000 on rs 124 +Ethernet124 124 fiftyGigE124 50000 on rs 125 +Ethernet125 125 fiftyGigE125 50000 on rs 126 +Ethernet126 126 fiftyGigE126 50000 on rs 127 +Ethernet127 127 fiftyGigE127 50000 on rs 128 +Ethernet128 128 tenGigE128 10000 off none 129 +Ethernet129 129 tenGigE129 10000 off none 130 diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/profile.ini b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/profile.ini new file mode 100644 index 000000000000..c2f77685ad0a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/profile.ini @@ -0,0 +1 @@ +switchMacAddress=00:01:02:03:04:05 diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/sai.profile b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/sai.profile new file mode 100644 index 000000000000..74f7334f55f3 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC128x50G/sai.profile @@ -0,0 +1,4 @@ +mode=1 +hwId=FC128x50G +switchProfile=/usr/share/sonic/hwsku/SAI-F6_4T-128x50G.xml +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-Board-F6_4T-48x25G-4x100G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-Board-F6_4T-48x25G-4x100G.md5 new file mode 100644 index 000000000000..8c4e2fc5394d --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-Board-F6_4T-48x25G-4x100G.md5 @@ -0,0 +1 @@ +8aeebdef0a211f5143f1084019654814 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-Board-F6_4T-48x25G-4x100G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-Board-F6_4T-48x25G-4x100G.xml new file mode 100644 index 000000000000..d88594c3edee --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-Board-F6_4T-48x25G-4x100G.xml @@ -0,0 +1,2606 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + Falcon-6.4T-48x25G-4x100G + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F6_4T-48x25G-4x100G.xml + ASK-L1-F6_4T-48x25G-4x100G.xml + sip6 + + 0 + + ethernet_mac + 0 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 1 + + ethernet_mac + 1 + false + + + NA + + + + false + + + + 2 + + ethernet_mac + 2 + false + + + NA + + + + false + + + + 3 + + ethernet_mac + 3 + false + + + NA + + + + false + + + + 4 + + ethernet_mac + 8 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 5 + + ethernet_mac + 9 + false + + + NA + + + + + 2 + true + + false + + + + 6 + + ethernet_mac + 10 + false + + + NA + + + + + 2 + true + + false + + + + 7 + + ethernet_mac + 11 + false + + + NA + + + + + 2 + true + + false + + + + 8 + + ethernet_mac + 16 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 9 + + ethernet_mac + 17 + false + + + NA + + + + + 2 + true + + false + + + + 10 + + ethernet_mac + 18 + false + + + NA + + + + + 2 + true + + false + + + + 11 + + ethernet_mac + 19 + false + + + NA + + + + + 2 + true + + false + + + + 12 + + ethernet_mac + 24 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 13 + + ethernet_mac + 25 + false + + + NA + + + + + 2 + true + + false + + + + 14 + + ethernet_mac + 26 + false + + + NA + + + + + 2 + true + + false + + + + 15 + + ethernet_mac + 27 + false + + + NA + + + + + 2 + true + + false + + + + 16 + + ethernet_mac + 32 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 17 + + ethernet_mac + 33 + false + + + NA + + + + + 2 + true + + false + + + + 18 + + ethernet_mac + 34 + false + + + NA + + + + + 2 + true + + false + + + + 19 + + ethernet_mac + 35 + false + + + NA + + + + + 2 + true + + false + + + + 20 + + ethernet_mac + 40 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 21 + + ethernet_mac + 41 + false + + + NA + + + + + 2 + true + + false + + + + 22 + + ethernet_mac + 42 + false + + + NA + + + + + 2 + true + + false + + + + 23 + + ethernet_mac + 43 + false + + + NA + + + + + 2 + true + + false + + + + 24 + + ethernet_mac + 48 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 25 + + ethernet_mac + 49 + false + + + NA + + + + + 2 + true + + false + + + + 26 + + ethernet_mac + 50 + false + + + NA + + + + + 2 + true + + false + + + + 27 + + ethernet_mac + 51 + false + + + NA + + + + + 2 + true + + false + + + + 28 + + ethernet_mac + 56 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 29 + + ethernet_mac + 57 + false + + + NA + + + + + 2 + true + + false + + + + 30 + + ethernet_mac + 58 + false + + + NA + + + + + 2 + true + + false + + + + 31 + + ethernet_mac + 59 + false + + + NA + + + + + 2 + true + + false + + + + 32 + + ethernet_mac + 64 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 33 + + ethernet_mac + 65 + false + + + NA + + + + + 2 + true + + false + + + + 35 + + ethernet_mac + 67 + false + + + NA + + + + + 2 + true + + false + + + + 34 + + ethernet_mac + 66 + false + + + NA + + + + + 2 + true + + false + + + + 36 + + ethernet_mac + 72 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 37 + + ethernet_mac + 73 + false + + + NA + + + + + 2 + true + + false + + + + 39 + + ethernet_mac + 75 + false + + + NA + + + + + 2 + true + + false + + + + 38 + + ethernet_mac + 74 + false + + + NA + + + + + 2 + true + + false + + + + 40 + + ethernet_mac + 80 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 41 + + ethernet_mac + 81 + false + + + NA + + + + + 2 + true + + false + + + + 43 + + ethernet_mac + 83 + false + + + NA + + + + + 2 + true + + false + + + + 42 + + ethernet_mac + 82 + false + + + NA + + + + + 2 + true + + false + + + + 44 + + ethernet_mac + 88 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 45 + + ethernet_mac + 89 + false + + + NA + + + + + 2 + true + + false + + + + 46 + + ethernet_mac + 90 + false + + + NA + + + + + 2 + true + + false + + + + 47 + + ethernet_mac + 91 + false + + + NA + + + + + 2 + true + + false + + + + 48 + + ethernet_mac + 96 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 49 + + ethernet_mac + 104 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 50 + + ethernet_mac + 112 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 51 + + ethernet_mac + 120 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 52 + + ethernet_mac + 128 + false + + + NA + + + + + + 2 + true + + false + + + + 53 + + ethernet_mac + 135 + false + + + NA + + + + + 2 + true + + false + + + + 63 + + cpu_sdma + 136 + false + + + + 54 + + cpu_sdma + 137 + false + + + + 55 + + cpu_sdma + 138 + false + + + + 56 + + cpu_sdma + 139 + false + + + + 7 + true + false + + + 1 + true + false + + + 6 + true + true + + + 0 + true + false + + + 5 + true + false + + + 3 + true + true + + + 4 + true + true + + + 2 + false + false + + + 8 + false + true + + + 14 + false + false + + + 9 + false + false + + + 15 + false + true + + + 10 + false + true + + + 12 + false + true + + + 11 + true + false + + + 13 + false + true + + + 23 + false + false + + + 17 + false + false + + + 22 + true + false + + + 16 + false + true + + + 21 + false + false + + + 19 + true + true + + + 20 + true + false + + + 18 + false + true + + + 24 + false + false + + + 30 + false + false + + + 25 + false + true + + + 31 + false + false + + + 26 + true + false + + + 28 + false + true + + + 27 + false + true + + + 29 + false + true + + + 39 + false + false + + + 33 + true + false + + + 38 + false + false + + + 32 + false + false + + + 37 + true + false + + + 35 + true + true + + + 36 + true + false + + + 34 + false + false + + + 40 + false + false + + + 41 + true + true + + + 46 + true + true + + + 47 + true + true + + + 42 + true + false + + + 44 + false + false + + + 43 + false + true + + + 45 + true + false + + + 55 + false + false + + + 49 + true + false + + + 54 + true + true + + + 48 + false + true + + + 53 + true + false + + + 51 + false + true + + + 52 + false + true + + + 50 + false + true + + + 56 + false + false + + + 62 + true + false + + + 57 + false + true + + + 63 + true + true + + + 58 + false + false + + + 60 + false + true + + + 59 + false + true + + + 61 + false + true + + + 71 + false + false + + + 65 + true + false + + + 70 + false + true + + + 64 + true + true + + + 69 + true + false + + + 67 + true + true + + + 68 + true + true + + + 66 + true + true + + + 72 + true + false + + + 78 + false + false + + + 73 + false + true + + + 79 + true + true + + + 74 + true + false + + + 76 + true + true + + + 75 + true + true + + + 77 + false + true + + + 87 + false + false + + + 81 + false + false + + + 86 + false + false + + + 80 + true + false + + + 85 + false + true + + + 83 + true + true + + + 84 + true + false + + + 82 + false + false + + + 88 + true + false + + + 94 + true + false + + + 89 + false + false + + + 95 + true + false + + + 90 + true + false + + + 92 + false + true + + + 91 + false + false + + + 93 + false + false + + + 103 + true + false + + + 97 + true + false + + + 102 + true + false + + + 96 + true + true + + + 101 + true + false + + + 99 + true + true + + + 100 + true + true + + + 98 + false + true + + + 104 + true + false + + + 110 + false + false + + + 105 + true + true + + + 111 + true + false + + + 106 + true + false + + + 108 + false + false + + + 107 + false + true + + + 109 + true + false + + + 119 + true + false + + + 113 + true + true + + + 118 + true + true + + + 112 + true + false + + + 117 + true + false + + + 115 + false + false + + + 116 + true + false + + + 114 + false + false + + + 120 + false + false + + + 126 + false + false + + + 121 + false + true + + + 127 + false + true + + + 122 + true + false + + + 124 + false + true + + + 123 + false + true + + + 125 + false + true + + + 128 + false + true + + + 135 + true + false + + + 0 + + ORDER_MODE_BY_CLASS + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_0 + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_1 + PULSE_STRETCH_1 + false + 1627 + false + + 1 + 64 + 66 + false + + + 2 + 64 + 65 + false + + + 3 + 64 + 65 + false + + + 4 + 64 + 66 + false + + + 5 + 64 + 66 + false + + + 6 + 64 + 65 + false + + + 7 + 64 + 65 + false + + + 8 + 64 + 66 + false + + + + 0 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 1 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 2 + PORT_TYPE_XG + true + BLINK_SELECT_0 + false + true + true + + + 3 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 4 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 5 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + + /tmp/cpss_uds + + 8 + + MAP0 + + 7 + + + 1 + + + 6 + + + 0 + + + 5 + + + 3 + + + 4 + + + 2 + + + + MAP1 + + 0 + + + 6 + + + 1 + + + 7 + + + 2 + + + 4 + + + 3 + + + 5 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-L1-F6_4T-48x25G-4x100G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-L1-F6_4T-48x25G-4x100G.md5 new file mode 100644 index 000000000000..be0843ca8b13 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-L1-F6_4T-48x25G-4x100G.md5 @@ -0,0 +1 @@ +825014d819cb5d702586d3cc0bf9e2d0 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-L1-F6_4T-48x25G-4x100G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-L1-F6_4T-48x25G-4x100G.xml new file mode 100644 index 000000000000..e33753b1e676 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-L1-F6_4T-48x25G-4x100G.xml @@ -0,0 +1,1228 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 100GR4 + + CR4 + 100G + rs_enabled + + + KR4 + 100G + rs_enabled + + + SR_LR4 + 100G + rs_enabled + + + CR4 + 100G + rs_enabled + rs_enabled + + + KR4 + 100G + rs_enabled + rs_enabled + + + + 10GR1Fix + + KR + 10G + disabled + + + + 25GR1 + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 25GR1 + + + 1 + AVAGO + profile_default + 25GR1 + + + 2 + AVAGO + profile_default + 25GR1 + + + 3 + AVAGO + profile_default + 25GR1 + + + 4 + AVAGO + profile_default + 25GR1 + + + 5 + AVAGO + profile_default + 25GR1 + + + 6 + AVAGO + profile_default + 25GR1 + + + 7 + AVAGO + profile_default + 25GR1 + + + 8 + AVAGO + profile_default + 25GR1 + + + 9 + AVAGO + profile_default + 25GR1 + + + 10 + AVAGO + profile_default + 25GR1 + + + 11 + AVAGO + profile_default + 25GR1 + + + 12 + AVAGO + profile_default + 25GR1 + + + 13 + AVAGO + profile_default + 25GR1 + + + 14 + AVAGO + profile_default + 25GR1 + + + 15 + AVAGO + profile_default + 25GR1 + + + 16 + AVAGO + profile_default + 25GR1 + + + 17 + AVAGO + profile_default + 25GR1 + + + 18 + AVAGO + profile_default + 25GR1 + + + 19 + AVAGO + profile_default + 25GR1 + + + 20 + AVAGO + profile_default + 25GR1 + + + 21 + AVAGO + profile_default + 25GR1 + + + 22 + AVAGO + profile_default + 25GR1 + + + 23 + AVAGO + profile_default + 25GR1 + + + 24 + AVAGO + profile_default + 25GR1 + + + 25 + AVAGO + profile_default + 25GR1 + + + 26 + AVAGO + profile_default + 25GR1 + + + 27 + AVAGO + profile_default + 25GR1 + + + 28 + AVAGO + profile_default + 25GR1 + + + 29 + AVAGO + profile_default + 25GR1 + + + 30 + AVAGO + profile_default + 25GR1 + + + 31 + AVAGO + profile_default + 25GR1 + + + 32 + AVAGO + profile_default + 25GR1 + + + 33 + AVAGO + profile_default + 25GR1 + + + 34 + AVAGO + profile_default + 25GR1 + + + 35 + AVAGO + profile_default + 25GR1 + + + 36 + AVAGO + profile_default + 25GR1 + + + 37 + AVAGO + profile_default + 25GR1 + + + 38 + AVAGO + profile_default + 25GR1 + + + 39 + AVAGO + profile_default + 25GR1 + + + 40 + AVAGO + profile_default + 25GR1 + + + 41 + AVAGO + profile_default + 25GR1 + + + 42 + AVAGO + profile_default + 25GR1 + + + 43 + AVAGO + profile_default + 25GR1 + + + 44 + AVAGO + profile_default + 25GR1 + + + 45 + AVAGO + profile_default + 25GR1 + + + 46 + AVAGO + profile_default + 25GR1 + + + 47 + AVAGO + profile_default + 25GR1 + + + 48 + AVAGO + profile_default + 100GR4 + + + 49 + AVAGO + profile_default + 100GR4 + + + 50 + AVAGO + profile_default + 100GR4 + + + 51 + AVAGO + profile_default + 100GR4 + + + 52 + AVAGO + profile_default + 10GR1Fix + + + 53 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-PP-F6_4T-48x25G-4x100G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-PP-F6_4T-48x25G-4x100G.md5 new file mode 100644 index 000000000000..8f2588351150 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-PP-F6_4T-48x25G-4x100G.md5 @@ -0,0 +1 @@ +897ca459774ad5e95dcd7dcb0d10c0af \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-PP-F6_4T-48x25G-4x100G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-PP-F6_4T-48x25G-4x100G.xml new file mode 100644 index 000000000000..b50dbcd5d93e --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/ASK-PP-F6_4T-48x25G-4x100G.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-6.4 + + 4294967295 + external_25_single_ended + 2 + 60 + 64-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/SAI-F6_4T-48x25G-4x100G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/SAI-F6_4T-48x25G-4x100G.md5 new file mode 100644 index 000000000000..64a77978577a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/SAI-F6_4T-48x25G-4x100G.md5 @@ -0,0 +1 @@ +0952c232696d216ca2361801f32bfac4 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/SAI-F6_4T-48x25G-4x100G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/SAI-F6_4T-48x25G-4x100G.xml new file mode 100644 index 000000000000..9b3224ab63fc --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/SAI-F6_4T-48x25G-4x100G.xml @@ -0,0 +1,503 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F6_4T-48x25G-4x100G.xml + + + 0 + 0 + 47 + + + 1 + 0 + 46 + + + 2 + 0 + 45 + + + 3 + 0 + 44 + + + 4 + 0 + 43 + + + 5 + 0 + 42 + + + 6 + 0 + 41 + + + 7 + 0 + 40 + + + 8 + 0 + 39 + + + 9 + 0 + 38 + + + 10 + 0 + 37 + + + 11 + 0 + 36 + + + 12 + 0 + 35 + + + 13 + 0 + 34 + + + 14 + 0 + 33 + + + 15 + 0 + 32 + + + 16 + 0 + 31 + + + 17 + 0 + 30 + + + 18 + 0 + 29 + + + 19 + 0 + 28 + + + 20 + 0 + 27 + + + 21 + 0 + 26 + + + 22 + 0 + 25 + + + 23 + 0 + 24 + + + 24 + 0 + 23 + + + 25 + 0 + 22 + + + 26 + 0 + 21 + + + 27 + 0 + 20 + + + 28 + 0 + 19 + + + 29 + 0 + 18 + + + 30 + 0 + 17 + + + 31 + 0 + 16 + + + 32 + 0 + 15 + + + 33 + 0 + 14 + + + 34 + 0 + 13 + + + 35 + 0 + 12 + + + 36 + 0 + 11 + + + 37 + 0 + 10 + + + 38 + 0 + 9 + + + 39 + 0 + 8 + + + 40 + 0 + 7 + + + 41 + 0 + 6 + + + 42 + 0 + 5 + + + 43 + 0 + 4 + + + 44 + 0 + 3 + + + 45 + 0 + 2 + + + 46 + 0 + 1 + + + 47 + 0 + 0 + + + 48 + 0 + 51 + + + 52 + 0 + 50 + + + 56 + 0 + 49 + + + 60 + 0 + 48 + + + 64 + 0 + 52 + + + 65 + 0 + 53 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/buffers_defaults_t0.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..f056413e8283 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/buffers_defaults_t0.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "11500000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "11500000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"170000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/buffers_defaults_t1.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..f056413e8283 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/buffers_defaults_t1.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "11500000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "11500000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"170000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/port_config.ini b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/port_config.ini new file mode 100644 index 000000000000..a8d3745718fd --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/port_config.ini @@ -0,0 +1,55 @@ +# name lanes alias speed autoneg fec index +Ethernet0 0 twenty5GigE0 25000 on none 1 +Ethernet1 1 twenty5GigE1 25000 on none 2 +Ethernet2 2 twenty5GigE2 25000 on none 3 +Ethernet3 3 twenty5GigE3 25000 on none 4 +Ethernet4 4 twenty5GigE4 25000 on none 5 +Ethernet5 5 twenty5GigE5 25000 on none 6 +Ethernet6 6 twenty5GigE6 25000 on none 7 +Ethernet7 7 twenty5GigE7 25000 on none 8 +Ethernet8 8 twenty5GigE8 25000 on none 9 +Ethernet9 9 twenty5GigE9 25000 on none 10 +Ethernet10 10 twenty5GigE10 25000 on none 11 +Ethernet11 11 twenty5GigE11 25000 on none 12 +Ethernet12 12 twenty5GigE12 25000 on none 13 +Ethernet13 13 twenty5GigE13 25000 on none 14 +Ethernet14 14 twenty5GigE14 25000 on none 15 +Ethernet15 15 twenty5GigE15 25000 on none 16 +Ethernet16 16 twenty5GigE16 25000 on none 17 +Ethernet17 17 twenty5GigE17 25000 on none 18 +Ethernet18 18 twenty5GigE18 25000 on none 19 +Ethernet19 19 twenty5GigE19 25000 on none 20 +Ethernet20 20 twenty5GigE20 25000 on none 21 +Ethernet21 21 twenty5GigE21 25000 on none 22 +Ethernet22 22 twenty5GigE22 25000 on none 23 +Ethernet23 23 twenty5GigE23 25000 on none 24 +Ethernet24 24 twenty5GigE24 25000 on none 25 +Ethernet25 25 twenty5GigE25 25000 on none 26 +Ethernet26 26 twenty5GigE26 25000 on none 27 +Ethernet27 27 twenty5GigE27 25000 on none 28 +Ethernet28 28 twenty5GigE28 25000 on none 29 +Ethernet29 29 twenty5GigE29 25000 on none 30 +Ethernet30 30 twenty5GigE30 25000 on none 31 +Ethernet31 31 twenty5GigE31 25000 on none 32 +Ethernet32 32 twenty5GigE32 25000 on none 33 +Ethernet33 33 twenty5GigE33 25000 on none 34 +Ethernet34 34 twenty5GigE34 25000 on none 35 +Ethernet35 35 twenty5GigE35 25000 on none 36 +Ethernet36 36 twenty5GigE36 25000 on none 37 +Ethernet37 37 twenty5GigE37 25000 on none 38 +Ethernet38 38 twenty5GigE38 25000 on none 39 +Ethernet39 39 twenty5GigE39 25000 on none 40 +Ethernet40 40 twenty5GigE40 25000 on none 41 +Ethernet41 41 twenty5GigE41 25000 on none 42 +Ethernet42 42 twenty5GigE42 25000 on none 43 +Ethernet43 43 twenty5GigE43 25000 on none 44 +Ethernet44 44 twenty5GigE44 25000 on none 45 +Ethernet45 45 twenty5GigE45 25000 on none 46 +Ethernet46 46 twenty5GigE46 25000 on none 47 +Ethernet47 47 twenty5GigE47 25000 on none 48 +Ethernet48 48,49,50,51 one00GigE48 100000 on rs 49 +Ethernet49 52,53,54,55 one00GigE49 100000 on rs 50 +Ethernet50 56,57,58,59 one00GigE50 100000 on rs 51 +Ethernet51 60,61,62,63 one00GigE51 100000 on rs 52 +Ethernet52 64 tenGigE52 10000 off none 53 +Ethernet53 65 tenGigE53 10000 off none 54 diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/profile.ini b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/profile.ini new file mode 100644 index 000000000000..c2f77685ad0a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/profile.ini @@ -0,0 +1 @@ +switchMacAddress=00:01:02:03:04:05 diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/sai.profile b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/sai.profile new file mode 100644 index 000000000000..b57d61241c1f --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/FC48x25G4x100GR4/sai.profile @@ -0,0 +1,4 @@ +mode=1 +hwId=FC48x25G4x100GR4 +switchProfile=/usr/share/sonic/hwsku/SAI-F6_4T-48x25G-4x100G.xml +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-Board-F6_4T-48x25G-4x100G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-Board-F6_4T-48x25G-4x100G.md5 new file mode 100644 index 000000000000..8c4e2fc5394d --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-Board-F6_4T-48x25G-4x100G.md5 @@ -0,0 +1 @@ +8aeebdef0a211f5143f1084019654814 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-Board-F6_4T-48x25G-4x100G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-Board-F6_4T-48x25G-4x100G.xml new file mode 100644 index 000000000000..d88594c3edee --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-Board-F6_4T-48x25G-4x100G.xml @@ -0,0 +1,2606 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + Falcon-6.4T-48x25G-4x100G + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F6_4T-48x25G-4x100G.xml + ASK-L1-F6_4T-48x25G-4x100G.xml + sip6 + + 0 + + ethernet_mac + 0 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 1 + + ethernet_mac + 1 + false + + + NA + + + + false + + + + 2 + + ethernet_mac + 2 + false + + + NA + + + + false + + + + 3 + + ethernet_mac + 3 + false + + + NA + + + + false + + + + 4 + + ethernet_mac + 8 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 5 + + ethernet_mac + 9 + false + + + NA + + + + + 2 + true + + false + + + + 6 + + ethernet_mac + 10 + false + + + NA + + + + + 2 + true + + false + + + + 7 + + ethernet_mac + 11 + false + + + NA + + + + + 2 + true + + false + + + + 8 + + ethernet_mac + 16 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 9 + + ethernet_mac + 17 + false + + + NA + + + + + 2 + true + + false + + + + 10 + + ethernet_mac + 18 + false + + + NA + + + + + 2 + true + + false + + + + 11 + + ethernet_mac + 19 + false + + + NA + + + + + 2 + true + + false + + + + 12 + + ethernet_mac + 24 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 13 + + ethernet_mac + 25 + false + + + NA + + + + + 2 + true + + false + + + + 14 + + ethernet_mac + 26 + false + + + NA + + + + + 2 + true + + false + + + + 15 + + ethernet_mac + 27 + false + + + NA + + + + + 2 + true + + false + + + + 16 + + ethernet_mac + 32 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 17 + + ethernet_mac + 33 + false + + + NA + + + + + 2 + true + + false + + + + 18 + + ethernet_mac + 34 + false + + + NA + + + + + 2 + true + + false + + + + 19 + + ethernet_mac + 35 + false + + + NA + + + + + 2 + true + + false + + + + 20 + + ethernet_mac + 40 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 21 + + ethernet_mac + 41 + false + + + NA + + + + + 2 + true + + false + + + + 22 + + ethernet_mac + 42 + false + + + NA + + + + + 2 + true + + false + + + + 23 + + ethernet_mac + 43 + false + + + NA + + + + + 2 + true + + false + + + + 24 + + ethernet_mac + 48 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 25 + + ethernet_mac + 49 + false + + + NA + + + + + 2 + true + + false + + + + 26 + + ethernet_mac + 50 + false + + + NA + + + + + 2 + true + + false + + + + 27 + + ethernet_mac + 51 + false + + + NA + + + + + 2 + true + + false + + + + 28 + + ethernet_mac + 56 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 29 + + ethernet_mac + 57 + false + + + NA + + + + + 2 + true + + false + + + + 30 + + ethernet_mac + 58 + false + + + NA + + + + + 2 + true + + false + + + + 31 + + ethernet_mac + 59 + false + + + NA + + + + + 2 + true + + false + + + + 32 + + ethernet_mac + 64 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 33 + + ethernet_mac + 65 + false + + + NA + + + + + 2 + true + + false + + + + 35 + + ethernet_mac + 67 + false + + + NA + + + + + 2 + true + + false + + + + 34 + + ethernet_mac + 66 + false + + + NA + + + + + 2 + true + + false + + + + 36 + + ethernet_mac + 72 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 37 + + ethernet_mac + 73 + false + + + NA + + + + + 2 + true + + false + + + + 39 + + ethernet_mac + 75 + false + + + NA + + + + + 2 + true + + false + + + + 38 + + ethernet_mac + 74 + false + + + NA + + + + + 2 + true + + false + + + + 40 + + ethernet_mac + 80 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 41 + + ethernet_mac + 81 + false + + + NA + + + + + 2 + true + + false + + + + 43 + + ethernet_mac + 83 + false + + + NA + + + + + 2 + true + + false + + + + 42 + + ethernet_mac + 82 + false + + + NA + + + + + 2 + true + + false + + + + 44 + + ethernet_mac + 88 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 45 + + ethernet_mac + 89 + false + + + NA + + + + + 2 + true + + false + + + + 46 + + ethernet_mac + 90 + false + + + NA + + + + + 2 + true + + false + + + + 47 + + ethernet_mac + 91 + false + + + NA + + + + + 2 + true + + false + + + + 48 + + ethernet_mac + 96 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 49 + + ethernet_mac + 104 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 50 + + ethernet_mac + 112 + false + + + NA + + MAP0 + + 0 + + 2 + true + + false + + + + 51 + + ethernet_mac + 120 + false + + + NA + + MAP1 + + 1 + + 2 + true + + false + + + + 52 + + ethernet_mac + 128 + false + + + NA + + + + + + 2 + true + + false + + + + 53 + + ethernet_mac + 135 + false + + + NA + + + + + 2 + true + + false + + + + 63 + + cpu_sdma + 136 + false + + + + 54 + + cpu_sdma + 137 + false + + + + 55 + + cpu_sdma + 138 + false + + + + 56 + + cpu_sdma + 139 + false + + + + 7 + true + false + + + 1 + true + false + + + 6 + true + true + + + 0 + true + false + + + 5 + true + false + + + 3 + true + true + + + 4 + true + true + + + 2 + false + false + + + 8 + false + true + + + 14 + false + false + + + 9 + false + false + + + 15 + false + true + + + 10 + false + true + + + 12 + false + true + + + 11 + true + false + + + 13 + false + true + + + 23 + false + false + + + 17 + false + false + + + 22 + true + false + + + 16 + false + true + + + 21 + false + false + + + 19 + true + true + + + 20 + true + false + + + 18 + false + true + + + 24 + false + false + + + 30 + false + false + + + 25 + false + true + + + 31 + false + false + + + 26 + true + false + + + 28 + false + true + + + 27 + false + true + + + 29 + false + true + + + 39 + false + false + + + 33 + true + false + + + 38 + false + false + + + 32 + false + false + + + 37 + true + false + + + 35 + true + true + + + 36 + true + false + + + 34 + false + false + + + 40 + false + false + + + 41 + true + true + + + 46 + true + true + + + 47 + true + true + + + 42 + true + false + + + 44 + false + false + + + 43 + false + true + + + 45 + true + false + + + 55 + false + false + + + 49 + true + false + + + 54 + true + true + + + 48 + false + true + + + 53 + true + false + + + 51 + false + true + + + 52 + false + true + + + 50 + false + true + + + 56 + false + false + + + 62 + true + false + + + 57 + false + true + + + 63 + true + true + + + 58 + false + false + + + 60 + false + true + + + 59 + false + true + + + 61 + false + true + + + 71 + false + false + + + 65 + true + false + + + 70 + false + true + + + 64 + true + true + + + 69 + true + false + + + 67 + true + true + + + 68 + true + true + + + 66 + true + true + + + 72 + true + false + + + 78 + false + false + + + 73 + false + true + + + 79 + true + true + + + 74 + true + false + + + 76 + true + true + + + 75 + true + true + + + 77 + false + true + + + 87 + false + false + + + 81 + false + false + + + 86 + false + false + + + 80 + true + false + + + 85 + false + true + + + 83 + true + true + + + 84 + true + false + + + 82 + false + false + + + 88 + true + false + + + 94 + true + false + + + 89 + false + false + + + 95 + true + false + + + 90 + true + false + + + 92 + false + true + + + 91 + false + false + + + 93 + false + false + + + 103 + true + false + + + 97 + true + false + + + 102 + true + false + + + 96 + true + true + + + 101 + true + false + + + 99 + true + true + + + 100 + true + true + + + 98 + false + true + + + 104 + true + false + + + 110 + false + false + + + 105 + true + true + + + 111 + true + false + + + 106 + true + false + + + 108 + false + false + + + 107 + false + true + + + 109 + true + false + + + 119 + true + false + + + 113 + true + true + + + 118 + true + true + + + 112 + true + false + + + 117 + true + false + + + 115 + false + false + + + 116 + true + false + + + 114 + false + false + + + 120 + false + false + + + 126 + false + false + + + 121 + false + true + + + 127 + false + true + + + 122 + true + false + + + 124 + false + true + + + 123 + false + true + + + 125 + false + true + + + 128 + false + true + + + 135 + true + false + + + 0 + + ORDER_MODE_BY_CLASS + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_0 + BLINK_DUTY_CYCLE_0 + BLINK_DURATION_1 + PULSE_STRETCH_1 + false + 1627 + false + + 1 + 64 + 66 + false + + + 2 + 64 + 65 + false + + + 3 + 64 + 65 + false + + + 4 + 64 + 66 + false + + + 5 + 64 + 66 + false + + + 6 + 64 + 65 + false + + + 7 + 64 + 65 + false + + + 8 + 64 + 66 + false + + + + 0 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 1 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 2 + PORT_TYPE_XG + true + BLINK_SELECT_0 + false + true + true + + + 3 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 4 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + 5 + PORT_TYPE_XG + false + BLINK_SELECT_0 + false + true + false + + + + /tmp/cpss_uds + + 8 + + MAP0 + + 7 + + + 1 + + + 6 + + + 0 + + + 5 + + + 3 + + + 4 + + + 2 + + + + MAP1 + + 0 + + + 6 + + + 1 + + + 7 + + + 2 + + + 4 + + + 3 + + + 5 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-L1-F6_4T-48x25G-4x100G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-L1-F6_4T-48x25G-4x100G.md5 new file mode 100644 index 000000000000..be0843ca8b13 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-L1-F6_4T-48x25G-4x100G.md5 @@ -0,0 +1 @@ +825014d819cb5d702586d3cc0bf9e2d0 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-L1-F6_4T-48x25G-4x100G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-L1-F6_4T-48x25G-4x100G.xml new file mode 100644 index 000000000000..e33753b1e676 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-L1-F6_4T-48x25G-4x100G.xml @@ -0,0 +1,1228 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 100GR4 + + CR4 + 100G + rs_enabled + + + KR4 + 100G + rs_enabled + + + SR_LR4 + 100G + rs_enabled + + + CR4 + 100G + rs_enabled + rs_enabled + + + KR4 + 100G + rs_enabled + rs_enabled + + + + 10GR1Fix + + KR + 10G + disabled + + + + 25GR1 + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 25GR1 + + + 1 + AVAGO + profile_default + 25GR1 + + + 2 + AVAGO + profile_default + 25GR1 + + + 3 + AVAGO + profile_default + 25GR1 + + + 4 + AVAGO + profile_default + 25GR1 + + + 5 + AVAGO + profile_default + 25GR1 + + + 6 + AVAGO + profile_default + 25GR1 + + + 7 + AVAGO + profile_default + 25GR1 + + + 8 + AVAGO + profile_default + 25GR1 + + + 9 + AVAGO + profile_default + 25GR1 + + + 10 + AVAGO + profile_default + 25GR1 + + + 11 + AVAGO + profile_default + 25GR1 + + + 12 + AVAGO + profile_default + 25GR1 + + + 13 + AVAGO + profile_default + 25GR1 + + + 14 + AVAGO + profile_default + 25GR1 + + + 15 + AVAGO + profile_default + 25GR1 + + + 16 + AVAGO + profile_default + 25GR1 + + + 17 + AVAGO + profile_default + 25GR1 + + + 18 + AVAGO + profile_default + 25GR1 + + + 19 + AVAGO + profile_default + 25GR1 + + + 20 + AVAGO + profile_default + 25GR1 + + + 21 + AVAGO + profile_default + 25GR1 + + + 22 + AVAGO + profile_default + 25GR1 + + + 23 + AVAGO + profile_default + 25GR1 + + + 24 + AVAGO + profile_default + 25GR1 + + + 25 + AVAGO + profile_default + 25GR1 + + + 26 + AVAGO + profile_default + 25GR1 + + + 27 + AVAGO + profile_default + 25GR1 + + + 28 + AVAGO + profile_default + 25GR1 + + + 29 + AVAGO + profile_default + 25GR1 + + + 30 + AVAGO + profile_default + 25GR1 + + + 31 + AVAGO + profile_default + 25GR1 + + + 32 + AVAGO + profile_default + 25GR1 + + + 33 + AVAGO + profile_default + 25GR1 + + + 34 + AVAGO + profile_default + 25GR1 + + + 35 + AVAGO + profile_default + 25GR1 + + + 36 + AVAGO + profile_default + 25GR1 + + + 37 + AVAGO + profile_default + 25GR1 + + + 38 + AVAGO + profile_default + 25GR1 + + + 39 + AVAGO + profile_default + 25GR1 + + + 40 + AVAGO + profile_default + 25GR1 + + + 41 + AVAGO + profile_default + 25GR1 + + + 42 + AVAGO + profile_default + 25GR1 + + + 43 + AVAGO + profile_default + 25GR1 + + + 44 + AVAGO + profile_default + 25GR1 + + + 45 + AVAGO + profile_default + 25GR1 + + + 46 + AVAGO + profile_default + 25GR1 + + + 47 + AVAGO + profile_default + 25GR1 + + + 48 + AVAGO + profile_default + 100GR4 + + + 49 + AVAGO + profile_default + 100GR4 + + + 50 + AVAGO + profile_default + 100GR4 + + + 51 + AVAGO + profile_default + 100GR4 + + + 52 + AVAGO + profile_default + 10GR1Fix + + + 53 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-PP-F6_4T-48x25G-4x100G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-PP-F6_4T-48x25G-4x100G.md5 new file mode 100644 index 000000000000..8f2588351150 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-PP-F6_4T-48x25G-4x100G.md5 @@ -0,0 +1 @@ +897ca459774ad5e95dcd7dcb0d10c0af \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-PP-F6_4T-48x25G-4x100G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-PP-F6_4T-48x25G-4x100G.xml new file mode 100644 index 000000000000..b50dbcd5d93e --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/ASK-PP-F6_4T-48x25G-4x100G.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-6.4 + + 4294967295 + external_25_single_ended + 2 + 60 + 64-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/SAI-F6_4T-48x25G-4x100G.md5 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/SAI-F6_4T-48x25G-4x100G.md5 new file mode 100644 index 000000000000..64a77978577a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/SAI-F6_4T-48x25G-4x100G.md5 @@ -0,0 +1 @@ +0952c232696d216ca2361801f32bfac4 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/SAI-F6_4T-48x25G-4x100G.xml b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/SAI-F6_4T-48x25G-4x100G.xml new file mode 100644 index 000000000000..9b3224ab63fc --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/SAI-F6_4T-48x25G-4x100G.xml @@ -0,0 +1,503 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F6_4T-48x25G-4x100G.xml + + + 0 + 0 + 47 + + + 1 + 0 + 46 + + + 2 + 0 + 45 + + + 3 + 0 + 44 + + + 4 + 0 + 43 + + + 5 + 0 + 42 + + + 6 + 0 + 41 + + + 7 + 0 + 40 + + + 8 + 0 + 39 + + + 9 + 0 + 38 + + + 10 + 0 + 37 + + + 11 + 0 + 36 + + + 12 + 0 + 35 + + + 13 + 0 + 34 + + + 14 + 0 + 33 + + + 15 + 0 + 32 + + + 16 + 0 + 31 + + + 17 + 0 + 30 + + + 18 + 0 + 29 + + + 19 + 0 + 28 + + + 20 + 0 + 27 + + + 21 + 0 + 26 + + + 22 + 0 + 25 + + + 23 + 0 + 24 + + + 24 + 0 + 23 + + + 25 + 0 + 22 + + + 26 + 0 + 21 + + + 27 + 0 + 20 + + + 28 + 0 + 19 + + + 29 + 0 + 18 + + + 30 + 0 + 17 + + + 31 + 0 + 16 + + + 32 + 0 + 15 + + + 33 + 0 + 14 + + + 34 + 0 + 13 + + + 35 + 0 + 12 + + + 36 + 0 + 11 + + + 37 + 0 + 10 + + + 38 + 0 + 9 + + + 39 + 0 + 8 + + + 40 + 0 + 7 + + + 41 + 0 + 6 + + + 42 + 0 + 5 + + + 43 + 0 + 4 + + + 44 + 0 + 3 + + + 45 + 0 + 2 + + + 46 + 0 + 1 + + + 47 + 0 + 0 + + + 48 + 0 + 51 + + + 52 + 0 + 50 + + + 56 + 0 + 49 + + + 60 + 0 + 48 + + + 64 + 0 + 52 + + + 65 + 0 + 53 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers.json.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers.json.j2 new file mode 100644 index 000000000000..a9a01d707ebf --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers.json.j2 @@ -0,0 +1 @@ +{%- include 'buffers_config.j2' %} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_config.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_config.j2 new file mode 100644 index 000000000000..a5212d979fcb --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_config.j2 @@ -0,0 +1,165 @@ +{%- macro set_default_topology() %} +{%- if default_topo is defined %} +{{ default_topo }} +{%- else %} +def +{%- endif %} +{%- endmacro -%} + +{# Determine device topology and filename postfix #} +{%- if DEVICE_METADATA is defined %} +{%- set switch_role = DEVICE_METADATA['localhost']['type'] %} +{%- if switch_role.lower() == 'torrouter' %} +{%- set filename_postfix = 't0' %} +{%- elif switch_role.lower() == 'leafrouter' %} +{%- set filename_postfix = 't1' %} +{%- else %} +{%- set filename_postfix = set_default_topology() %} +{%- endif %} +{%- else %} +{%- set filename_postfix = set_default_topology() %} +{%- set switch_role = '' %} +{%- endif -%} + +{# Import default values from device HWSKU folder #} +{%- import 'buffers_defaults_%s.j2' % filename_postfix as defs %} + +{%- set default_cable = defs.default_cable -%} + +{# 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 #} +{%- if defs.ports2cable is defined %} + {%- set ports2cable = defs.ports2cable %} +{%- else %} + {%- set ports2cable = { + 'torrouter_server' : '5m', + 'leafrouter_torrouter' : '40m', + 'spinerouter_leafrouter' : '300m' + } + -%} +{%- endif %} + +{%- macro cable_length(port_name) %} + {%- set cable_len = [] %} + {%- for local_port in DEVICE_NEIGHBOR %} + {%- if local_port == port_name %} + {%- if DEVICE_NEIGHBOR_METADATA is defined and 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 %} + {%- if switch_role.lower() == 'torrouter' %} + {%- for local_port in VLAN_MEMBER %} + {%- if local_port[1] == port_name %} + {%- set roles3 = switch_role + '_' + 'server' %} + {%- set roles3 = roles3 | lower %} + {%- if roles3 in ports2cable %} + {%- if cable_len.append(ports2cable[roles3]) %}{% endif %} + {%- endif %} + {%- endif %} + {%- endfor %} + {%- if cable_len -%} + {{ cable_len.0 }} + {%- else -%} + {{ default_cable }} + {%- endif %} + {%- else -%} + {{ default_cable }} + {%- endif %} + {%- endif %} +{%- endmacro %} + +{%- set PORT_ALL = [] %} + +{%- if PORT is not defined %} + {%- if defs.generate_port_lists(PORT_ALL) %} {% endif %} +{%- else %} + {%- for port in PORT %} + {%- if PORT_ALL.append(port) %}{%- endif %} + {%- endfor %} +{%- endif %} + +{%- set PORT_ACTIVE = [] %} +{%- if DEVICE_NEIGHBOR is not defined %} + {%- set PORT_ACTIVE = PORT_ALL %} +{%- else %} + {%- for port in DEVICE_NEIGHBOR.keys() %} + {%- if PORT_ACTIVE.append(port) %}{%- endif %} + {%- endfor %} +{%- endif %} + +{%- set port_names_list_active = [] %} +{%- for port in PORT_ACTIVE %} + {%- if port_names_list_active.append(port) %}{%- endif %} +{%- endfor %} +{%- set port_names_active = port_names_list_active | join(',') %} + +{ + "CABLE_LENGTH": { + "AZURE": { + {% for port in PORT_ALL %} + {%- set cable = cable_length(port) %} + "{{ port }}": "{{ cable }}"{%- if not loop.last %},{% endif %} + + {% endfor %} + } + }, + +{% if defs.generate_buffer_pool_and_profiles is defined %} +{{ defs.generate_buffer_pool_and_profiles() }} +{% endif %} + +{%- if defs.generate_profile_lists is defined %} +{{ defs.generate_profile_lists(port_names_active) }}, +{% endif %} + +{%- if defs.generate_pg_profils is defined %} +{{ defs.generate_pg_profils(port_names_active) }} +{% else %} + "BUFFER_PG": { +{% for port in PORT_ACTIVE %} + "{{ port }}|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, +{% endif %} + +{% if defs.generate_queue_buffers is defined %} +{{ defs.generate_queue_buffers(port_names_active) }} +{% else %} + "BUFFER_QUEUE": { +{% for port in PORT_ACTIVE %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{% endif %} +} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_defaults_t0.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..f056413e8283 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_defaults_t0.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "11500000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "11500000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"170000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_defaults_t1.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..f056413e8283 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/buffers_defaults_t1.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "11500000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "11500000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"170000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/port_config.ini b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/port_config.ini new file mode 100644 index 000000000000..a8d3745718fd --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/port_config.ini @@ -0,0 +1,55 @@ +# name lanes alias speed autoneg fec index +Ethernet0 0 twenty5GigE0 25000 on none 1 +Ethernet1 1 twenty5GigE1 25000 on none 2 +Ethernet2 2 twenty5GigE2 25000 on none 3 +Ethernet3 3 twenty5GigE3 25000 on none 4 +Ethernet4 4 twenty5GigE4 25000 on none 5 +Ethernet5 5 twenty5GigE5 25000 on none 6 +Ethernet6 6 twenty5GigE6 25000 on none 7 +Ethernet7 7 twenty5GigE7 25000 on none 8 +Ethernet8 8 twenty5GigE8 25000 on none 9 +Ethernet9 9 twenty5GigE9 25000 on none 10 +Ethernet10 10 twenty5GigE10 25000 on none 11 +Ethernet11 11 twenty5GigE11 25000 on none 12 +Ethernet12 12 twenty5GigE12 25000 on none 13 +Ethernet13 13 twenty5GigE13 25000 on none 14 +Ethernet14 14 twenty5GigE14 25000 on none 15 +Ethernet15 15 twenty5GigE15 25000 on none 16 +Ethernet16 16 twenty5GigE16 25000 on none 17 +Ethernet17 17 twenty5GigE17 25000 on none 18 +Ethernet18 18 twenty5GigE18 25000 on none 19 +Ethernet19 19 twenty5GigE19 25000 on none 20 +Ethernet20 20 twenty5GigE20 25000 on none 21 +Ethernet21 21 twenty5GigE21 25000 on none 22 +Ethernet22 22 twenty5GigE22 25000 on none 23 +Ethernet23 23 twenty5GigE23 25000 on none 24 +Ethernet24 24 twenty5GigE24 25000 on none 25 +Ethernet25 25 twenty5GigE25 25000 on none 26 +Ethernet26 26 twenty5GigE26 25000 on none 27 +Ethernet27 27 twenty5GigE27 25000 on none 28 +Ethernet28 28 twenty5GigE28 25000 on none 29 +Ethernet29 29 twenty5GigE29 25000 on none 30 +Ethernet30 30 twenty5GigE30 25000 on none 31 +Ethernet31 31 twenty5GigE31 25000 on none 32 +Ethernet32 32 twenty5GigE32 25000 on none 33 +Ethernet33 33 twenty5GigE33 25000 on none 34 +Ethernet34 34 twenty5GigE34 25000 on none 35 +Ethernet35 35 twenty5GigE35 25000 on none 36 +Ethernet36 36 twenty5GigE36 25000 on none 37 +Ethernet37 37 twenty5GigE37 25000 on none 38 +Ethernet38 38 twenty5GigE38 25000 on none 39 +Ethernet39 39 twenty5GigE39 25000 on none 40 +Ethernet40 40 twenty5GigE40 25000 on none 41 +Ethernet41 41 twenty5GigE41 25000 on none 42 +Ethernet42 42 twenty5GigE42 25000 on none 43 +Ethernet43 43 twenty5GigE43 25000 on none 44 +Ethernet44 44 twenty5GigE44 25000 on none 45 +Ethernet45 45 twenty5GigE45 25000 on none 46 +Ethernet46 46 twenty5GigE46 25000 on none 47 +Ethernet47 47 twenty5GigE47 25000 on none 48 +Ethernet48 48,49,50,51 one00GigE48 100000 on rs 49 +Ethernet49 52,53,54,55 one00GigE49 100000 on rs 50 +Ethernet50 56,57,58,59 one00GigE50 100000 on rs 51 +Ethernet51 60,61,62,63 one00GigE51 100000 on rs 52 +Ethernet52 64 tenGigE52 10000 off none 53 +Ethernet53 65 tenGigE53 10000 off none 54 diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/profile.ini b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/profile.ini new file mode 100644 index 000000000000..c2f77685ad0a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/profile.ini @@ -0,0 +1 @@ +switchMacAddress=00:01:02:03:04:05 diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/qos.json.j2 b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/sai.profile b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/sai.profile new file mode 100644 index 000000000000..b57d61241c1f --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/db98cx8540_16cd/sai.profile @@ -0,0 +1,4 @@ +mode=1 +hwId=FC48x25G4x100GR4 +switchProfile=/usr/share/sonic/hwsku/SAI-F6_4T-48x25G-4x100G.xml +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/default_sku b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/default_sku new file mode 100644 index 000000000000..e18b74451315 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/default_sku @@ -0,0 +1 @@ +db98cx8540_16cd t1 diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/platform_asic b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/platform_asic new file mode 100644 index 000000000000..a554752878b7 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/platform_asic @@ -0,0 +1 @@ +marvell diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/pmon_daemon_control.json b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..39deb88be078 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/pmon_daemon_control.json @@ -0,0 +1,8 @@ +{ + "skip_ledd": true, + "skip_pcied": true, + "skip_thermalctld": true, + "skip_psud": true, + "skip_xcvrd": true, + "skip_syseepromd": true +} diff --git a/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/system_health_monitoring_config.json b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..79c17103bf76 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8540_16cd-r0/system_health_monitoring_config.json @@ -0,0 +1,10 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.temperature", + "fan", + "psu" + ], + "user_defined_checkers": [] +} From 556d1f1361cca9cc3630c7de8d3b0f6860a2d52d Mon Sep 17 00:00:00 2001 From: Pavan Naregundi Date: Mon, 22 Apr 2024 04:42:02 +0000 Subject: [PATCH 065/282] HWSKU for x86_64-marvell_db98cx8514_10cc-r0 Signed-off-by: Pavan Naregundi --- .../ASK-Board-F2T_48x25G-8x100G.md5 | 1 + .../ASK-Board-F2T_48x25G-8x100G.xml | 2153 ++++++++++++++ .../ASK-L1-F2T_48x25G-8x100G.md5 | 1 + .../ASK-L1-F2T_48x25G-8x100G.xml | 1252 ++++++++ .../ASK-PP-F2T_48x25G-8x100G.md5 | 1 + .../ASK-PP-F2T_48x25G-8x100G.xml | 1180 ++++++++ .../F2T48x25G8x100G/SAI-F2T_48x25G-8x100G.md5 | 1 + .../F2T48x25G8x100G/SAI-F2T_48x25G-8x100G.xml | 523 ++++ .../F2T48x25G8x100G/buffers_defaults_t0.j2 | 36 + .../F2T48x25G8x100G/buffers_defaults_t1.j2 | 36 + .../F2T48x25G8x100G/port_config.ini | 59 + .../F2T48x25G8x100G/profile.ini | 1 + .../F2T48x25G8x100G/sai.profile | 4 + .../F2T80x25G/ASK-Board-F2T_80x25G.md5 | 1 + .../F2T80x25G/ASK-Board-F2T_80x25G.xml | 2513 +++++++++++++++++ .../F2T80x25G/ASK-L1-F2T_80x25G.md5 | 1 + .../F2T80x25G/ASK-L1-F2T_80x25G.xml | 1366 +++++++++ .../F2T80x25G/ASK-PP-F2T_80x25G.md5 | 1 + .../F2T80x25G/ASK-PP-F2T_80x25G.xml | 1180 ++++++++ .../F2T80x25G/SAI-F2T_80x25G.md5 | 1 + .../F2T80x25G/SAI-F2T_80x25G.xml | 646 +++++ .../F2T80x25G/buffers_defaults_t0.j2 | 36 + .../F2T80x25G/buffers_defaults_t1.j2 | 36 + .../F2T80x25G/port_config.ini | 83 + .../F2T80x25G/profile.ini | 1 + .../F2T80x25G/sai.profile | 4 + .../ASK-Board-F2T_48x25G-8x100G.md5 | 1 + .../ASK-Board-F2T_48x25G-8x100G.xml | 2153 ++++++++++++++ .../ASK-L1-F2T_48x25G-8x100G.md5 | 1 + .../ASK-L1-F2T_48x25G-8x100G.xml | 1252 ++++++++ .../ASK-PP-F2T_48x25G-8x100G.md5 | 1 + .../ASK-PP-F2T_48x25G-8x100G.xml | 1180 ++++++++ .../db98cx8514_10cc/SAI-F2T_48x25G-8x100G.md5 | 1 + .../db98cx8514_10cc/SAI-F2T_48x25G-8x100G.xml | 523 ++++ .../db98cx8514_10cc/buffers.json.j2 | 1 + .../db98cx8514_10cc/buffers_config.j2 | 165 ++ .../db98cx8514_10cc/buffers_defaults_t0.j2 | 36 + .../db98cx8514_10cc/buffers_defaults_t1.j2 | 36 + .../db98cx8514_10cc/port_config.ini | 59 + .../db98cx8514_10cc/profile.ini | 1 + .../db98cx8514_10cc/qos.json.j2 | 1 + .../db98cx8514_10cc/sai.profile | 4 + .../default_sku | 1 + .../platform_asic | 1 + .../pmon_daemon_control.json | 8 + .../system_health_monitoring_config.json | 10 + 46 files changed, 16552 insertions(+) create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-Board-F2T_48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-Board-F2T_48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-L1-F2T_48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-L1-F2T_48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-PP-F2T_48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-PP-F2T_48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/SAI-F2T_48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/SAI-F2T_48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/buffers_defaults_t0.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/buffers_defaults_t1.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/port_config.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/profile.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/sai.profile create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-Board-F2T_80x25G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-Board-F2T_80x25G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-L1-F2T_80x25G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-L1-F2T_80x25G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-PP-F2T_80x25G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-PP-F2T_80x25G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/SAI-F2T_80x25G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/SAI-F2T_80x25G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/buffers_defaults_t0.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/buffers_defaults_t1.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/port_config.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/profile.ini create mode 100755 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/sai.profile create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-Board-F2T_48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-Board-F2T_48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-L1-F2T_48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-L1-F2T_48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-PP-F2T_48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-PP-F2T_48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/SAI-F2T_48x25G-8x100G.md5 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/SAI-F2T_48x25G-8x100G.xml create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers.json.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_config.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_defaults_t0.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_defaults_t1.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/port_config.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/profile.ini create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/qos.json.j2 create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/sai.profile create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/default_sku create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/platform_asic create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/pmon_daemon_control.json create mode 100644 device/marvell/x86_64-marvell_db98cx8514_10cc-r0/system_health_monitoring_config.json diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-Board-F2T_48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-Board-F2T_48x25G-8x100G.md5 new file mode 100644 index 000000000000..3e849f9f5131 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-Board-F2T_48x25G-8x100G.md5 @@ -0,0 +1 @@ +6eecbbbd215fe27637a19f5b01f96b51 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-Board-F2T_48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-Board-F2T_48x25G-8x100G.xml new file mode 100644 index 000000000000..9eeb751c964b --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-Board-F2T_48x25G-8x100G.xml @@ -0,0 +1,2153 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F2T_48x25G-8x100G + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F2T_48x25G-8x100G.xml + ASK-L1-F2T_48x25G-8x100G.xml + sip6 + + 0 + + ethernet_mac + 112 + false + + + NA + + MAP0 + + + false + + + + 1 + + ethernet_mac + 113 + false + + + NA + + + + false + + + + 2 + + ethernet_mac + 114 + false + + + NA + + + + false + + + + 3 + + ethernet_mac + 115 + false + + + NA + + + + false + + + + 4 + + ethernet_mac + 116 + false + + + NA + + + + false + + + + 5 + + ethernet_mac + 117 + false + + + NA + + + + false + + + + 6 + + ethernet_mac + 118 + false + + + NA + + + + false + + + + 7 + + ethernet_mac + 119 + false + + + NA + + + + false + + + + 8 + + ethernet_mac + 120 + false + + + NA + + MAP1 + + + false + + + + 9 + + ethernet_mac + 121 + false + + + NA + + + + false + + + + 10 + + ethernet_mac + 122 + false + + + NA + + + + false + + + + 11 + + ethernet_mac + 123 + false + + + NA + + + + false + + + + 12 + + ethernet_mac + 124 + false + + + NA + + + + false + + + + 13 + + ethernet_mac + 125 + false + + + NA + + + + false + + + + 14 + + ethernet_mac + 126 + false + + + NA + + + + false + + + + 15 + + ethernet_mac + 127 + false + + + NA + + + + false + + + + 16 + + ethernet_mac + 0 + false + + + NA + + MAP0 + + + false + + + + 17 + + ethernet_mac + 1 + false + + + NA + + + + false + + + + 18 + + ethernet_mac + 2 + false + + + NA + + + + false + + + + 19 + + ethernet_mac + 3 + false + + + NA + + + + false + + + + 20 + + ethernet_mac + 4 + false + + + NA + + + + false + + + + 21 + + ethernet_mac + 5 + false + + + NA + + + + false + + + + 22 + + ethernet_mac + 6 + false + + + NA + + + + false + + + + 23 + + ethernet_mac + 7 + false + + + NA + + + + false + + + + 24 + + ethernet_mac + 8 + false + + + NA + + MAP1 + + + false + + + + 25 + + ethernet_mac + 9 + false + + + NA + + + + false + + + + 26 + + ethernet_mac + 10 + false + + + NA + + + + false + + + + 27 + + ethernet_mac + 11 + false + + + NA + + + + false + + + + 28 + + ethernet_mac + 12 + false + + + NA + + + + false + + + + 29 + + ethernet_mac + 13 + false + + + NA + + + + false + + + + 30 + + ethernet_mac + 14 + false + + + NA + + + + false + + + + 31 + + ethernet_mac + 15 + false + + + NA + + + + false + + + + 32 + + ethernet_mac + 32 + false + + + NA + + MAP0 + + + false + + + + 33 + + ethernet_mac + 33 + false + + + NA + + + + false + + + + 34 + + ethernet_mac + 34 + false + + + NA + + + + false + + + + 35 + + ethernet_mac + 35 + false + + + NA + + + + false + + + + 36 + + ethernet_mac + 36 + false + + + NA + + + + false + + + + 37 + + ethernet_mac + 37 + false + + + NA + + + + false + + + + 38 + + ethernet_mac + 38 + false + + + NA + + + + false + + + + 39 + + ethernet_mac + 39 + false + + + NA + + + + false + + + + 40 + + ethernet_mac + 40 + false + + + NA + + MAP1 + + + false + + + + 41 + + ethernet_mac + 41 + false + + + NA + + + + false + + + + 42 + + ethernet_mac + 42 + false + + + NA + + + + false + + + + 43 + + ethernet_mac + 43 + false + + + NA + + + + false + + + + 44 + + ethernet_mac + 44 + false + + + NA + + + + false + + + + 45 + + ethernet_mac + 45 + false + + + NA + + + + false + + + + 46 + + ethernet_mac + 46 + false + + + NA + + + + false + + + + 47 + + ethernet_mac + 47 + false + + + NA + + + + false + + + + 48 + + ethernet_mac + 64 + false + + + NA + + MAP2 + + + false + + + + 49 + + ethernet_mac + 68 + false + + + NA + + + + false + + + + 50 + + ethernet_mac + 72 + false + + + NA + + MAP3 + + + false + + + + 51 + + ethernet_mac + 76 + false + + + NA + + + + false + + + + 52 + + ethernet_mac + 80 + false + + + NA + + MAP2 + + + false + + + + 53 + + ethernet_mac + 84 + false + + + NA + + + + false + + + + 54 + + ethernet_mac + 88 + false + + + NA + + MAP3 + + + false + + + + 55 + + ethernet_mac + 92 + false + + + NA + + + + false + + + + 56 + + ethernet_mac + 133 + false + + + NA + + + + false + + + + 57 + + ethernet_mac + 135 + false + + + NA + + + + false + + + + 63 + + cpu_sdma + 136 + false + + + + 58 + + cpu_sdma + 137 + false + + + + 59 + + cpu_sdma + 138 + false + + + + 60 + + cpu_sdma + 139 + false + + + + 64 + true + true + + + 65 + true + false + + + 66 + false + true + + + 67 + false + true + + + 68 + false + false + + + 69 + false + true + + + 70 + false + true + + + 71 + false + true + + + 79 + true + true + + + 78 + true + true + + + 77 + true + true + + + 76 + true + true + + + 75 + true + true + + + 74 + false + true + + + 73 + true + true + + + 72 + true + true + + + 0 + false + true + + + 1 + false + true + + + 2 + true + true + + + 3 + false + true + + + 4 + true + true + + + 5 + true + false + + + 6 + false + true + + + 7 + true + false + + + 15 + true + true + + + 14 + true + false + + + 13 + true + true + + + 12 + true + false + + + 11 + true + true + + + 10 + false + false + + + 9 + true + true + + + 8 + true + false + + + 16 + true + true + + + 17 + false + false + + + 18 + true + false + + + 19 + true + false + + + 20 + false + true + + + 21 + false + false + + + 22 + false + true + + + 23 + false + false + + + 31 + false + true + + + 30 + false + false + + + 29 + true + true + + + 28 + true + false + + + 27 + false + false + + + 26 + true + false + + + 25 + false + true + + + 24 + false + false + + + 32 + false + false + + + 35 + true + true + + + 33 + true + false + + + 34 + true + false + + + 37 + false + true + + + 39 + false + false + + + 36 + true + true + + + 38 + false + false + + + 47 + false + false + + + 44 + true + true + + + 46 + false + false + + + 45 + true + false + + + 42 + true + true + + + 40 + true + false + + + 43 + true + true + + + 41 + false + false + + + 48 + false + false + + + 51 + false + true + + + 49 + false + false + + + 50 + true + false + + + 53 + true + true + + + 55 + true + false + + + 52 + false + true + + + 54 + false + false + + + 63 + false + false + + + 60 + false + true + + + 62 + false + false + + + 61 + false + false + + + 58 + false + true + + + 56 + false + false + + + 59 + false + true + + + 57 + false + false + + + 80 + false + true + + + 81 + true + false + + + /tmp/cpss_uds + + 8 + + MAP0 + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + + MAP1 + + 7 + + + 6 + + + 5 + + + 4 + + + 3 + + + 2 + + + 1 + + + 0 + + + + MAP2 + + 0 + + + 3 + + + 1 + + + 2 + + + 5 + + + 7 + + + 4 + + + 6 + + + + MAP3 + + 7 + + + 4 + + + 6 + + + 5 + + + 2 + + + 0 + + + 3 + + + 1 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-L1-F2T_48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-L1-F2T_48x25G-8x100G.md5 new file mode 100644 index 000000000000..5ce1720c3114 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-L1-F2T_48x25G-8x100G.md5 @@ -0,0 +1 @@ +06a802c61f6b37d6e1897fdf4be6ee83 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-L1-F2T_48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-L1-F2T_48x25G-8x100G.xml new file mode 100644 index 000000000000..666a1eec84d4 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-L1-F2T_48x25G-8x100G.xml @@ -0,0 +1,1252 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 100GR4 + + CR4 + 100G + rs_enabled + + + KR4 + 100G + rs_enabled + + + SR_LR4 + 100G + rs_enabled + + + CR4 + 100G + rs_enabled + rs_enabled + + + KR4 + 100G + rs_enabled + rs_enabled + + + + 10GR1Fix + + KR + 10G + disabled + + + + 25GR1 + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 25GR1 + + + 1 + AVAGO + profile_default + 25GR1 + + + 2 + AVAGO + profile_default + 25GR1 + + + 3 + AVAGO + profile_default + 25GR1 + + + 4 + AVAGO + profile_default + 25GR1 + + + 5 + AVAGO + profile_default + 25GR1 + + + 6 + AVAGO + profile_default + 25GR1 + + + 7 + AVAGO + profile_default + 25GR1 + + + 8 + AVAGO + profile_default + 25GR1 + + + 9 + AVAGO + profile_default + 25GR1 + + + 10 + AVAGO + profile_default + 25GR1 + + + 11 + AVAGO + profile_default + 25GR1 + + + 12 + AVAGO + profile_default + 25GR1 + + + 13 + AVAGO + profile_default + 25GR1 + + + 14 + AVAGO + profile_default + 25GR1 + + + 15 + AVAGO + profile_default + 25GR1 + + + 16 + AVAGO + profile_default + 25GR1 + + + 17 + AVAGO + profile_default + 25GR1 + + + 18 + AVAGO + profile_default + 25GR1 + + + 19 + AVAGO + profile_default + 25GR1 + + + 20 + AVAGO + profile_default + 25GR1 + + + 21 + AVAGO + profile_default + 25GR1 + + + 22 + AVAGO + profile_default + 25GR1 + + + 23 + AVAGO + profile_default + 25GR1 + + + 24 + AVAGO + profile_default + 25GR1 + + + 25 + AVAGO + profile_default + 25GR1 + + + 26 + AVAGO + profile_default + 25GR1 + + + 27 + AVAGO + profile_default + 25GR1 + + + 28 + AVAGO + profile_default + 25GR1 + + + 29 + AVAGO + profile_default + 25GR1 + + + 30 + AVAGO + profile_default + 25GR1 + + + 31 + AVAGO + profile_default + 25GR1 + + + 32 + AVAGO + profile_default + 25GR1 + + + 33 + AVAGO + profile_default + 25GR1 + + + 34 + AVAGO + profile_default + 25GR1 + + + 35 + AVAGO + profile_default + 25GR1 + + + 36 + AVAGO + profile_default + 25GR1 + + + 37 + AVAGO + profile_default + 25GR1 + + + 38 + AVAGO + profile_default + 25GR1 + + + 39 + AVAGO + profile_default + 25GR1 + + + 40 + AVAGO + profile_default + 25GR1 + + + 41 + AVAGO + profile_default + 25GR1 + + + 42 + AVAGO + profile_default + 25GR1 + + + 43 + AVAGO + profile_default + 25GR1 + + + 44 + AVAGO + profile_default + 25GR1 + + + 45 + AVAGO + profile_default + 25GR1 + + + 46 + AVAGO + profile_default + 25GR1 + + + 47 + AVAGO + profile_default + 25GR1 + + + 48 + AVAGO + profile_default + 100GR4 + + + 49 + AVAGO + profile_default + 100GR4 + + + 50 + AVAGO + profile_default + 100GR4 + + + 51 + AVAGO + profile_default + 100GR4 + + + 52 + AVAGO + profile_default + 100GR4 + + + 53 + AVAGO + profile_default + 100GR4 + + + 54 + AVAGO + profile_default + 100GR4 + + + 55 + AVAGO + profile_default + 100GR4 + + + 56 + AVAGO + profile_default + 10GR1Fix + + + 57 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-PP-F2T_48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-PP-F2T_48x25G-8x100G.md5 new file mode 100644 index 000000000000..92fc07b50bf1 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-PP-F2T_48x25G-8x100G.md5 @@ -0,0 +1 @@ +72ea1b2a8dd25f7d1584a05b11c1ae0b \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-PP-F2T_48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-PP-F2T_48x25G-8x100G.xml new file mode 100644 index 000000000000..288006a4ae0c --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/ASK-PP-F2T_48x25G-8x100G.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-2 + + 4294967295 + external_25_single_ended + 2 + 60 + 64-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/SAI-F2T_48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/SAI-F2T_48x25G-8x100G.md5 new file mode 100644 index 000000000000..8f24db9ff7e3 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/SAI-F2T_48x25G-8x100G.md5 @@ -0,0 +1 @@ +cdd0dffb9811802ae6b98caa7b62b96b \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/SAI-F2T_48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/SAI-F2T_48x25G-8x100G.xml new file mode 100644 index 000000000000..973cc465de77 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/SAI-F2T_48x25G-8x100G.xml @@ -0,0 +1,523 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F2T_48x25G-8x100G.xml + + + 0 + 0 + 47 + + + 1 + 0 + 46 + + + 2 + 0 + 45 + + + 3 + 0 + 44 + + + 4 + 0 + 43 + + + 5 + 0 + 42 + + + 6 + 0 + 41 + + + 7 + 0 + 40 + + + 8 + 0 + 39 + + + 9 + 0 + 38 + + + 10 + 0 + 37 + + + 11 + 0 + 36 + + + 12 + 0 + 35 + + + 13 + 0 + 34 + + + 14 + 0 + 33 + + + 15 + 0 + 32 + + + 16 + 0 + 31 + + + 17 + 0 + 30 + + + 18 + 0 + 29 + + + 19 + 0 + 28 + + + 20 + 0 + 27 + + + 21 + 0 + 26 + + + 22 + 0 + 25 + + + 23 + 0 + 24 + + + 24 + 0 + 23 + + + 25 + 0 + 22 + + + 26 + 0 + 21 + + + 27 + 0 + 20 + + + 28 + 0 + 19 + + + 29 + 0 + 18 + + + 30 + 0 + 17 + + + 31 + 0 + 16 + + + 32 + 0 + 15 + + + 33 + 0 + 14 + + + 34 + 0 + 13 + + + 35 + 0 + 12 + + + 36 + 0 + 11 + + + 37 + 0 + 10 + + + 38 + 0 + 9 + + + 39 + 0 + 8 + + + 40 + 0 + 7 + + + 41 + 0 + 6 + + + 42 + 0 + 5 + + + 43 + 0 + 4 + + + 44 + 0 + 3 + + + 45 + 0 + 2 + + + 46 + 0 + 1 + + + 47 + 0 + 0 + + + 48 + 0 + 55 + + + 52 + 0 + 54 + + + 56 + 0 + 53 + + + 60 + 0 + 52 + + + 64 + 0 + 51 + + + 68 + 0 + 50 + + + 72 + 0 + 49 + + + 76 + 0 + 48 + + + 80 + 0 + 56 + + + 81 + 0 + 57 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/buffers_defaults_t0.j2 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..f3eaf01447bd --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/buffers_defaults_t0.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "21120000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "21120000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"330000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/buffers_defaults_t1.j2 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..f3eaf01447bd --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/buffers_defaults_t1.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "21120000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "21120000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"330000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/port_config.ini b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/port_config.ini new file mode 100644 index 000000000000..0c4067b10e81 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/port_config.ini @@ -0,0 +1,59 @@ +# name lanes alias speed autoneg fec index +Ethernet0 0 twenty5GigE0 25000 on none 1 +Ethernet1 1 twenty5GigE1 25000 on none 2 +Ethernet2 2 twenty5GigE2 25000 on none 3 +Ethernet3 3 twenty5GigE3 25000 on none 4 +Ethernet4 4 twenty5GigE4 25000 on none 5 +Ethernet5 5 twenty5GigE5 25000 on none 6 +Ethernet6 6 twenty5GigE6 25000 on none 7 +Ethernet7 7 twenty5GigE7 25000 on none 8 +Ethernet8 8 twenty5GigE8 25000 on none 9 +Ethernet9 9 twenty5GigE9 25000 on none 10 +Ethernet10 10 twenty5GigE10 25000 on none 11 +Ethernet11 11 twenty5GigE11 25000 on none 12 +Ethernet12 12 twenty5GigE12 25000 on none 13 +Ethernet13 13 twenty5GigE13 25000 on none 14 +Ethernet14 14 twenty5GigE14 25000 on none 15 +Ethernet15 15 twenty5GigE15 25000 on none 16 +Ethernet16 16 twenty5GigE16 25000 on none 17 +Ethernet17 17 twenty5GigE17 25000 on none 18 +Ethernet18 18 twenty5GigE18 25000 on none 19 +Ethernet19 19 twenty5GigE19 25000 on none 20 +Ethernet20 20 twenty5GigE20 25000 on none 21 +Ethernet21 21 twenty5GigE21 25000 on none 22 +Ethernet22 22 twenty5GigE22 25000 on none 23 +Ethernet23 23 twenty5GigE23 25000 on none 24 +Ethernet24 24 twenty5GigE24 25000 on none 25 +Ethernet25 25 twenty5GigE25 25000 on none 26 +Ethernet26 26 twenty5GigE26 25000 on none 27 +Ethernet27 27 twenty5GigE27 25000 on none 28 +Ethernet28 28 twenty5GigE28 25000 on none 29 +Ethernet29 29 twenty5GigE29 25000 on none 30 +Ethernet30 30 twenty5GigE30 25000 on none 31 +Ethernet31 31 twenty5GigE31 25000 on none 32 +Ethernet32 32 twenty5GigE32 25000 on none 33 +Ethernet33 33 twenty5GigE33 25000 on none 34 +Ethernet34 34 twenty5GigE34 25000 on none 35 +Ethernet35 35 twenty5GigE35 25000 on none 36 +Ethernet36 36 twenty5GigE36 25000 on none 37 +Ethernet37 37 twenty5GigE37 25000 on none 38 +Ethernet38 38 twenty5GigE38 25000 on none 39 +Ethernet39 39 twenty5GigE39 25000 on none 40 +Ethernet40 40 twenty5GigE40 25000 on none 41 +Ethernet41 41 twenty5GigE41 25000 on none 42 +Ethernet42 42 twenty5GigE42 25000 on none 43 +Ethernet43 43 twenty5GigE43 25000 on none 44 +Ethernet44 44 twenty5GigE44 25000 on none 45 +Ethernet45 45 twenty5GigE45 25000 on none 46 +Ethernet46 46 twenty5GigE46 25000 on none 47 +Ethernet47 47 twenty5GigE47 25000 on none 48 +Ethernet48 48,49,50,51 one00GigE48 100000 on rs 49 +Ethernet49 52,53,54,55 one00GigE49 100000 on rs 50 +Ethernet50 56,57,58,59 one00GigE50 100000 on rs 51 +Ethernet51 60,61,62,63 one00GigE51 100000 on rs 52 +Ethernet52 64,65,66,67 one00GigE52 100000 on rs 53 +Ethernet53 68,69,70,71 one00GigE53 100000 on rs 54 +Ethernet54 72,73,74,75 one00GigE54 100000 on rs 55 +Ethernet55 76,77,78,79 one00GigE55 100000 on rs 56 +Ethernet56 80 tenGigE56 10000 off none 57 +Ethernet57 81 tenGigE57 10000 off none 58 diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/profile.ini b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/profile.ini new file mode 100644 index 000000000000..c2f77685ad0a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/profile.ini @@ -0,0 +1 @@ +switchMacAddress=00:01:02:03:04:05 diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/sai.profile b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/sai.profile new file mode 100644 index 000000000000..49afb26f8d47 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T48x25G8x100G/sai.profile @@ -0,0 +1,4 @@ +mode=1 +hwId=F2T48x25G8x100G +switchProfile=/usr/share/sonic/hwsku/SAI-F2T_48x25G-8x100G.xml +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-Board-F2T_80x25G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-Board-F2T_80x25G.md5 new file mode 100644 index 000000000000..afe19e324e96 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-Board-F2T_80x25G.md5 @@ -0,0 +1 @@ +5a26299fae46aeeca40f450e0cc4e602 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-Board-F2T_80x25G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-Board-F2T_80x25G.xml new file mode 100644 index 000000000000..879e3b954522 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-Board-F2T_80x25G.xml @@ -0,0 +1,2513 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F2T_80x25G + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F2T_80x25G.xml + ASK-L1-F2T_80x25G.xml + sip6 + + 0 + + ethernet_mac + 112 + false + + + NA + + MAP0 + + + false + + + + 1 + + ethernet_mac + 113 + false + + + NA + + + + false + + + + 2 + + ethernet_mac + 114 + false + + + NA + + + + false + + + + 3 + + ethernet_mac + 115 + false + + + NA + + + + false + + + + 4 + + ethernet_mac + 116 + false + + + NA + + + + false + + + + 5 + + ethernet_mac + 117 + false + + + NA + + + + false + + + + 6 + + ethernet_mac + 118 + false + + + NA + + + + false + + + + 7 + + ethernet_mac + 119 + false + + + NA + + + + false + + + + 8 + + ethernet_mac + 120 + false + + + NA + + MAP1 + + + false + + + + 9 + + ethernet_mac + 121 + false + + + NA + + + + false + + + + 10 + + ethernet_mac + 122 + false + + + NA + + + + false + + + + 11 + + ethernet_mac + 123 + false + + + NA + + + + false + + + + 12 + + ethernet_mac + 124 + false + + + NA + + + + false + + + + 13 + + ethernet_mac + 125 + false + + + NA + + + + false + + + + 14 + + ethernet_mac + 126 + false + + + NA + + + + false + + + + 15 + + ethernet_mac + 127 + false + + + NA + + + + false + + + + 16 + + ethernet_mac + 0 + false + + + NA + + MAP0 + + + false + + + + 17 + + ethernet_mac + 1 + false + + + NA + + + + false + + + + 18 + + ethernet_mac + 2 + false + + + NA + + + + false + + + + 19 + + ethernet_mac + 3 + false + + + NA + + + + false + + + + 20 + + ethernet_mac + 4 + false + + + NA + + + + false + + + + 21 + + ethernet_mac + 5 + false + + + NA + + + + false + + + + 22 + + ethernet_mac + 6 + false + + + NA + + + + false + + + + 23 + + ethernet_mac + 7 + false + + + NA + + + + false + + + + 24 + + ethernet_mac + 8 + false + + + NA + + MAP1 + + + false + + + + 25 + + ethernet_mac + 9 + false + + + NA + + + + false + + + + 26 + + ethernet_mac + 10 + false + + + NA + + + + false + + + + 27 + + ethernet_mac + 11 + false + + + NA + + + + false + + + + 28 + + ethernet_mac + 12 + false + + + NA + + + + false + + + + 29 + + ethernet_mac + 13 + false + + + NA + + + + false + + + + 30 + + ethernet_mac + 14 + false + + + NA + + + + false + + + + 31 + + ethernet_mac + 15 + false + + + NA + + + + false + + + + 32 + + ethernet_mac + 32 + false + + + NA + + MAP0 + + + false + + + + 33 + + ethernet_mac + 33 + false + + + NA + + + + false + + + + 34 + + ethernet_mac + 34 + false + + + NA + + + + false + + + + 35 + + ethernet_mac + 35 + false + + + NA + + + + false + + + + 36 + + ethernet_mac + 36 + false + + + NA + + + + false + + + + 37 + + ethernet_mac + 37 + false + + + NA + + + + false + + + + 38 + + ethernet_mac + 38 + false + + + NA + + + + false + + + + 39 + + ethernet_mac + 39 + false + + + NA + + + + false + + + + 40 + + ethernet_mac + 40 + false + + + NA + + MAP1 + + + false + + + + 41 + + ethernet_mac + 41 + false + + + NA + + + + false + + + + 42 + + ethernet_mac + 42 + false + + + NA + + + + false + + + + 43 + + ethernet_mac + 43 + false + + + NA + + + + false + + + + 44 + + ethernet_mac + 44 + false + + + NA + + + + false + + + + 45 + + ethernet_mac + 45 + false + + + NA + + + + false + + + + 46 + + ethernet_mac + 46 + false + + + NA + + + + false + + + + 47 + + ethernet_mac + 47 + false + + + NA + + + + false + + + + 48 + + ethernet_mac + 64 + false + + + NA + + MAP2 + + + false + + + + 49 + + ethernet_mac + 65 + false + + + NA + + + + false + + + + 50 + + ethernet_mac + 66 + false + + + NA + + + + false + + + + 51 + + ethernet_mac + 67 + false + + + NA + + + + false + + + + 52 + + ethernet_mac + 68 + false + + + NA + + + + false + + + + 53 + + ethernet_mac + 69 + false + + + NA + + + + false + + + + 54 + + ethernet_mac + 70 + false + + + NA + + + + false + + + + 55 + + ethernet_mac + 71 + false + + + NA + + + + false + + + + 56 + + ethernet_mac + 72 + false + + + NA + + MAP3 + + + false + + + + 57 + + ethernet_mac + 73 + false + + + NA + + + + false + + + + 58 + + ethernet_mac + 74 + false + + + NA + + + + false + + + + 59 + + ethernet_mac + 75 + false + + + NA + + + + false + + + + 60 + + ethernet_mac + 76 + false + + + NA + + + + false + + + + 64 + + ethernet_mac + 77 + false + + + NA + + + + false + + + + 65 + + ethernet_mac + 78 + false + + + NA + + + + false + + + + 66 + + ethernet_mac + 79 + false + + + NA + + + + false + + + + 67 + + ethernet_mac + 80 + false + + + NA + + MAP2 + + + false + + + + 68 + + ethernet_mac + 81 + false + + + NA + + + + false + + + + 69 + + ethernet_mac + 82 + false + + + NA + + + + false + + + + 70 + + ethernet_mac + 83 + false + + + NA + + + + false + + + + 71 + + ethernet_mac + 84 + false + + + NA + + + + false + + + + 72 + + ethernet_mac + 85 + false + + + NA + + + + false + + + + 73 + + ethernet_mac + 86 + false + + + NA + + + + false + + + + 74 + + ethernet_mac + 87 + false + + + NA + + + + false + + + + 75 + + ethernet_mac + 88 + false + + + NA + + MAP3 + + + false + + + + 76 + + ethernet_mac + 89 + false + + + NA + + + + false + + + + 77 + + ethernet_mac + 90 + false + + + NA + + + + false + + + + 78 + + ethernet_mac + 91 + false + + + NA + + + + false + + + + 79 + + ethernet_mac + 92 + false + + + NA + + + + false + + + + 80 + + ethernet_mac + 93 + false + + + NA + + + + false + + + + 81 + + ethernet_mac + 94 + false + + + NA + + + + false + + + + 82 + + ethernet_mac + 95 + false + + + NA + + + + false + + + + 83 + + ethernet_mac + 133 + false + + + NA + + + + false + + + + 84 + + ethernet_mac + 135 + false + + + NA + + + + false + + + + 63 + + cpu_sdma + 136 + false + + + + 85 + + cpu_sdma + 137 + false + + + + 86 + + cpu_sdma + 138 + false + + + + 87 + + cpu_sdma + 139 + false + + + + 64 + true + true + + + 65 + true + false + + + 66 + false + true + + + 67 + false + true + + + 68 + false + false + + + 69 + false + true + + + 70 + false + true + + + 71 + false + true + + + 79 + true + true + + + 78 + true + true + + + 77 + true + true + + + 76 + true + true + + + 75 + true + true + + + 74 + false + true + + + 73 + true + true + + + 72 + true + true + + + 0 + false + true + + + 1 + false + true + + + 2 + true + true + + + 3 + false + true + + + 4 + true + true + + + 5 + true + false + + + 6 + false + true + + + 7 + true + false + + + 15 + true + true + + + 14 + true + false + + + 13 + true + true + + + 12 + true + false + + + 11 + true + true + + + 10 + false + false + + + 9 + true + true + + + 8 + true + false + + + 16 + true + true + + + 17 + false + false + + + 18 + true + false + + + 19 + true + false + + + 20 + false + true + + + 21 + false + false + + + 22 + false + true + + + 23 + false + false + + + 31 + false + true + + + 30 + false + false + + + 29 + true + true + + + 28 + true + false + + + 27 + false + false + + + 26 + true + false + + + 25 + false + true + + + 24 + false + false + + + 32 + false + false + + + 35 + true + true + + + 33 + true + false + + + 34 + true + false + + + 37 + false + true + + + 39 + false + false + + + 36 + true + true + + + 38 + false + false + + + 47 + false + false + + + 44 + true + true + + + 46 + false + false + + + 45 + true + false + + + 42 + true + true + + + 40 + true + false + + + 43 + true + true + + + 41 + false + false + + + 48 + false + false + + + 51 + false + true + + + 49 + false + false + + + 50 + true + false + + + 53 + true + true + + + 55 + true + false + + + 52 + false + true + + + 54 + false + false + + + 63 + false + false + + + 60 + false + true + + + 62 + false + false + + + 61 + false + false + + + 58 + false + true + + + 56 + false + false + + + 59 + false + true + + + 57 + false + false + + + 80 + false + true + + + 81 + true + false + + + /tmp/cpss_uds + + 8 + + MAP0 + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + + MAP1 + + 7 + + + 6 + + + 5 + + + 4 + + + 3 + + + 2 + + + 1 + + + 0 + + + + MAP2 + + 0 + + + 3 + + + 1 + + + 2 + + + 5 + + + 7 + + + 4 + + + 6 + + + + MAP3 + + 7 + + + 4 + + + 6 + + + 5 + + + 2 + + + 0 + + + 3 + + + 1 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-L1-F2T_80x25G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-L1-F2T_80x25G.md5 new file mode 100644 index 000000000000..48db349139ac --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-L1-F2T_80x25G.md5 @@ -0,0 +1 @@ +b9e6fa1643045736b22b06e5a3443962 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-L1-F2T_80x25G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-L1-F2T_80x25G.xml new file mode 100644 index 000000000000..448077663b13 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-L1-F2T_80x25G.xml @@ -0,0 +1,1366 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 10GR1Fix + + KR + 10G + disabled + + + + 25GR1 + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 25GR1 + + + 1 + AVAGO + profile_default + 25GR1 + + + 2 + AVAGO + profile_default + 25GR1 + + + 3 + AVAGO + profile_default + 25GR1 + + + 4 + AVAGO + profile_default + 25GR1 + + + 5 + AVAGO + profile_default + 25GR1 + + + 6 + AVAGO + profile_default + 25GR1 + + + 7 + AVAGO + profile_default + 25GR1 + + + 8 + AVAGO + profile_default + 25GR1 + + + 9 + AVAGO + profile_default + 25GR1 + + + 10 + AVAGO + profile_default + 25GR1 + + + 11 + AVAGO + profile_default + 25GR1 + + + 12 + AVAGO + profile_default + 25GR1 + + + 13 + AVAGO + profile_default + 25GR1 + + + 14 + AVAGO + profile_default + 25GR1 + + + 15 + AVAGO + profile_default + 25GR1 + + + 16 + AVAGO + profile_default + 25GR1 + + + 17 + AVAGO + profile_default + 25GR1 + + + 18 + AVAGO + profile_default + 25GR1 + + + 19 + AVAGO + profile_default + 25GR1 + + + 20 + AVAGO + profile_default + 25GR1 + + + 21 + AVAGO + profile_default + 25GR1 + + + 22 + AVAGO + profile_default + 25GR1 + + + 23 + AVAGO + profile_default + 25GR1 + + + 24 + AVAGO + profile_default + 25GR1 + + + 25 + AVAGO + profile_default + 25GR1 + + + 26 + AVAGO + profile_default + 25GR1 + + + 27 + AVAGO + profile_default + 25GR1 + + + 28 + AVAGO + profile_default + 25GR1 + + + 29 + AVAGO + profile_default + 25GR1 + + + 30 + AVAGO + profile_default + 25GR1 + + + 31 + AVAGO + profile_default + 25GR1 + + + 32 + AVAGO + profile_default + 25GR1 + + + 33 + AVAGO + profile_default + 25GR1 + + + 34 + AVAGO + profile_default + 25GR1 + + + 35 + AVAGO + profile_default + 25GR1 + + + 36 + AVAGO + profile_default + 25GR1 + + + 37 + AVAGO + profile_default + 25GR1 + + + 38 + AVAGO + profile_default + 25GR1 + + + 39 + AVAGO + profile_default + 25GR1 + + + 40 + AVAGO + profile_default + 25GR1 + + + 41 + AVAGO + profile_default + 25GR1 + + + 42 + AVAGO + profile_default + 25GR1 + + + 43 + AVAGO + profile_default + 25GR1 + + + 44 + AVAGO + profile_default + 25GR1 + + + 45 + AVAGO + profile_default + 25GR1 + + + 46 + AVAGO + profile_default + 25GR1 + + + 47 + AVAGO + profile_default + 25GR1 + + + 48 + AVAGO + profile_default + 25GR1 + + + 49 + AVAGO + profile_default + 25GR1 + + + 50 + AVAGO + profile_default + 25GR1 + + + 51 + AVAGO + profile_default + 25GR1 + + + 52 + AVAGO + profile_default + 25GR1 + + + 53 + AVAGO + profile_default + 25GR1 + + + 54 + AVAGO + profile_default + 25GR1 + + + 55 + AVAGO + profile_default + 25GR1 + + + 56 + AVAGO + profile_default + 25GR1 + + + 57 + AVAGO + profile_default + 25GR1 + + + 58 + AVAGO + profile_default + 25GR1 + + + 59 + AVAGO + profile_default + 25GR1 + + + 60 + AVAGO + profile_default + 25GR1 + + + 64 + AVAGO + profile_default + 25GR1 + + + 65 + AVAGO + profile_default + 25GR1 + + + 66 + AVAGO + profile_default + 25GR1 + + + 67 + AVAGO + profile_default + 25GR1 + + + 68 + AVAGO + profile_default + 25GR1 + + + 69 + AVAGO + profile_default + 25GR1 + + + 70 + AVAGO + profile_default + 25GR1 + + + 71 + AVAGO + profile_default + 25GR1 + + + 72 + AVAGO + profile_default + 25GR1 + + + 73 + AVAGO + profile_default + 25GR1 + + + 74 + AVAGO + profile_default + 25GR1 + + + 75 + AVAGO + profile_default + 25GR1 + + + 76 + AVAGO + profile_default + 25GR1 + + + 77 + AVAGO + profile_default + 25GR1 + + + 78 + AVAGO + profile_default + 25GR1 + + + 79 + AVAGO + profile_default + 25GR1 + + + 80 + AVAGO + profile_default + 25GR1 + + + 81 + AVAGO + profile_default + 25GR1 + + + 82 + AVAGO + profile_default + 25GR1 + + + 83 + AVAGO + profile_default + 10GR1Fix + + + 84 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-PP-F2T_80x25G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-PP-F2T_80x25G.md5 new file mode 100644 index 000000000000..604343ce0794 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-PP-F2T_80x25G.md5 @@ -0,0 +1 @@ +3943f8d39de0129472bf59ff13c92222 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-PP-F2T_80x25G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-PP-F2T_80x25G.xml new file mode 100644 index 000000000000..b7e9ec199eb9 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/ASK-PP-F2T_80x25G.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-2 + + 4294967295 + external_25_single_ended + 2 + 60 + 128-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/SAI-F2T_80x25G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/SAI-F2T_80x25G.md5 new file mode 100644 index 000000000000..e804ba2cba74 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/SAI-F2T_80x25G.md5 @@ -0,0 +1 @@ +fa2395cae24db38d8388f251dae7c5b4 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/SAI-F2T_80x25G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/SAI-F2T_80x25G.xml new file mode 100644 index 000000000000..24006250ecb0 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/SAI-F2T_80x25G.xml @@ -0,0 +1,646 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F2T_80x25G.xml + + + 0 + 0 + 82 + + + 1 + 0 + 81 + + + 2 + 0 + 80 + + + 3 + 0 + 79 + + + 4 + 0 + 78 + + + 5 + 0 + 77 + + + 6 + 0 + 76 + + + 7 + 0 + 75 + + + 8 + 0 + 74 + + + 9 + 0 + 73 + + + 10 + 0 + 72 + + + 11 + 0 + 71 + + + 12 + 0 + 70 + + + 13 + 0 + 69 + + + 14 + 0 + 68 + + + 15 + 0 + 67 + + + 16 + 0 + 66 + + + 17 + 0 + 65 + + + 18 + 0 + 64 + + + 19 + 0 + 60 + + + 20 + 0 + 59 + + + 21 + 0 + 58 + + + 22 + 0 + 57 + + + 23 + 0 + 56 + + + 24 + 0 + 55 + + + 25 + 0 + 54 + + + 26 + 0 + 53 + + + 27 + 0 + 52 + + + 28 + 0 + 51 + + + 29 + 0 + 50 + + + 30 + 0 + 49 + + + 31 + 0 + 48 + + + 32 + 0 + 47 + + + 33 + 0 + 46 + + + 34 + 0 + 45 + + + 35 + 0 + 44 + + + 36 + 0 + 43 + + + 37 + 0 + 42 + + + 38 + 0 + 41 + + + 39 + 0 + 40 + + + 40 + 0 + 39 + + + 41 + 0 + 38 + + + 42 + 0 + 37 + + + 43 + 0 + 36 + + + 44 + 0 + 35 + + + 45 + 0 + 34 + + + 46 + 0 + 33 + + + 47 + 0 + 32 + + + 48 + 0 + 31 + + + 49 + 0 + 30 + + + 50 + 0 + 29 + + + 51 + 0 + 28 + + + 52 + 0 + 27 + + + 53 + 0 + 26 + + + 54 + 0 + 25 + + + 55 + 0 + 24 + + + 56 + 0 + 23 + + + 57 + 0 + 22 + + + 58 + 0 + 21 + + + 59 + 0 + 20 + + + 60 + 0 + 19 + + + 61 + 0 + 18 + + + 62 + 0 + 17 + + + 63 + 0 + 16 + + + 64 + 0 + 15 + + + 65 + 0 + 14 + + + 66 + 0 + 13 + + + 67 + 0 + 12 + + + 68 + 0 + 11 + + + 69 + 0 + 10 + + + 70 + 0 + 9 + + + 71 + 0 + 8 + + + 72 + 0 + 7 + + + 73 + 0 + 6 + + + 74 + 0 + 5 + + + 75 + 0 + 4 + + + 76 + 0 + 3 + + + 77 + 0 + 2 + + + 78 + 0 + 1 + + + 79 + 0 + 0 + + + 80 + 0 + 83 + + + 81 + 0 + 84 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + 2048 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/buffers_defaults_t0.j2 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..f3eaf01447bd --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/buffers_defaults_t0.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "21120000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "21120000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"330000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/buffers_defaults_t1.j2 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..f3eaf01447bd --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/buffers_defaults_t1.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "21120000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "21120000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"330000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/port_config.ini b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/port_config.ini new file mode 100644 index 000000000000..e0f004920690 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/port_config.ini @@ -0,0 +1,83 @@ +# name lanes alias speed autoneg fec index +Ethernet0 0 twenty5GigE0 25000 on none 1 +Ethernet1 1 twenty5GigE1 25000 on none 2 +Ethernet2 2 twenty5GigE2 25000 on none 3 +Ethernet3 3 twenty5GigE3 25000 on none 4 +Ethernet4 4 twenty5GigE4 25000 on none 5 +Ethernet5 5 twenty5GigE5 25000 on none 6 +Ethernet6 6 twenty5GigE6 25000 on none 7 +Ethernet7 7 twenty5GigE7 25000 on none 8 +Ethernet8 8 twenty5GigE8 25000 on none 9 +Ethernet9 9 twenty5GigE9 25000 on none 10 +Ethernet10 10 twenty5GigE10 25000 on none 11 +Ethernet11 11 twenty5GigE11 25000 on none 12 +Ethernet12 12 twenty5GigE12 25000 on none 13 +Ethernet13 13 twenty5GigE13 25000 on none 14 +Ethernet14 14 twenty5GigE14 25000 on none 15 +Ethernet15 15 twenty5GigE15 25000 on none 16 +Ethernet16 16 twenty5GigE16 25000 on none 17 +Ethernet17 17 twenty5GigE17 25000 on none 18 +Ethernet18 18 twenty5GigE18 25000 on none 19 +Ethernet19 19 twenty5GigE19 25000 on none 20 +Ethernet20 20 twenty5GigE20 25000 on none 21 +Ethernet21 21 twenty5GigE21 25000 on none 22 +Ethernet22 22 twenty5GigE22 25000 on none 23 +Ethernet23 23 twenty5GigE23 25000 on none 24 +Ethernet24 24 twenty5GigE24 25000 on none 25 +Ethernet25 25 twenty5GigE25 25000 on none 26 +Ethernet26 26 twenty5GigE26 25000 on none 27 +Ethernet27 27 twenty5GigE27 25000 on none 28 +Ethernet28 28 twenty5GigE28 25000 on none 29 +Ethernet29 29 twenty5GigE29 25000 on none 30 +Ethernet30 30 twenty5GigE30 25000 on none 31 +Ethernet31 31 twenty5GigE31 25000 on none 32 +Ethernet32 32 twenty5GigE32 25000 on none 33 +Ethernet33 33 twenty5GigE33 25000 on none 34 +Ethernet34 34 twenty5GigE34 25000 on none 35 +Ethernet35 35 twenty5GigE35 25000 on none 36 +Ethernet36 36 twenty5GigE36 25000 on none 37 +Ethernet37 37 twenty5GigE37 25000 on none 38 +Ethernet38 38 twenty5GigE38 25000 on none 39 +Ethernet39 39 twenty5GigE39 25000 on none 40 +Ethernet40 40 twenty5GigE40 25000 on none 41 +Ethernet41 41 twenty5GigE41 25000 on none 42 +Ethernet42 42 twenty5GigE42 25000 on none 43 +Ethernet43 43 twenty5GigE43 25000 on none 44 +Ethernet44 44 twenty5GigE44 25000 on none 45 +Ethernet45 45 twenty5GigE45 25000 on none 46 +Ethernet46 46 twenty5GigE46 25000 on none 47 +Ethernet47 47 twenty5GigE47 25000 on none 48 +Ethernet48 48 twenty5GigE48 25000 on none 49 +Ethernet49 49 twenty5GigE49 25000 on none 50 +Ethernet50 50 twenty5GigE50 25000 on none 51 +Ethernet51 51 twenty5GigE51 25000 on none 52 +Ethernet52 52 twenty5GigE52 25000 on none 53 +Ethernet53 53 twenty5GigE53 25000 on none 54 +Ethernet54 54 twenty5GigE54 25000 on none 55 +Ethernet55 55 twenty5GigE55 25000 on none 56 +Ethernet56 56 twenty5GigE56 25000 on none 57 +Ethernet57 57 twenty5GigE57 25000 on none 58 +Ethernet58 58 twenty5GigE58 25000 on none 59 +Ethernet59 59 twenty5GigE59 25000 on none 60 +Ethernet60 60 twenty5GigE60 25000 on none 61 +Ethernet61 61 twenty5GigE61 25000 on none 62 +Ethernet62 62 twenty5GigE62 25000 on none 63 +Ethernet63 63 twenty5GigE63 25000 on none 64 +Ethernet64 64 twenty5GigE64 25000 on none 65 +Ethernet65 65 twenty5GigE65 25000 on none 66 +Ethernet66 66 twenty5GigE66 25000 on none 67 +Ethernet67 67 twenty5GigE67 25000 on none 68 +Ethernet68 68 twenty5GigE68 25000 on none 69 +Ethernet69 69 twenty5GigE69 25000 on none 70 +Ethernet70 70 twenty5GigE70 25000 on none 71 +Ethernet71 71 twenty5GigE71 25000 on none 72 +Ethernet72 72 twenty5GigE72 25000 on none 73 +Ethernet73 73 twenty5GigE73 25000 on none 74 +Ethernet74 74 twenty5GigE74 25000 on none 75 +Ethernet75 75 twenty5GigE75 25000 on none 76 +Ethernet76 76 twenty5GigE76 25000 on none 77 +Ethernet77 77 twenty5GigE77 25000 on none 78 +Ethernet78 78 twenty5GigE78 25000 on none 79 +Ethernet79 79 twenty5GigE79 25000 on none 80 +Ethernet80 80 tenGigE80 10000 off none 81 +Ethernet81 81 tenGigE81 10000 off none 82 diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/profile.ini b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/profile.ini new file mode 100644 index 000000000000..c2f77685ad0a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/profile.ini @@ -0,0 +1 @@ +switchMacAddress=00:01:02:03:04:05 diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/sai.profile b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/sai.profile new file mode 100755 index 000000000000..e7c78a75e401 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/F2T80x25G/sai.profile @@ -0,0 +1,4 @@ +mode=1 +hwId=F2T80x25G +switchProfile=/usr/share/sonic/hwsku/SAI-F2T_80x25G.xml +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-Board-F2T_48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-Board-F2T_48x25G-8x100G.md5 new file mode 100644 index 000000000000..3e849f9f5131 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-Board-F2T_48x25G-8x100G.md5 @@ -0,0 +1 @@ +6eecbbbd215fe27637a19f5b01f96b51 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-Board-F2T_48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-Board-F2T_48x25G-8x100G.xml new file mode 100644 index 000000000000..9eeb751c964b --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-Board-F2T_48x25G-8x100G.xml @@ -0,0 +1,2153 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + board-callback-type + enumeration + Specifies os/ext drv callback types. + + linux-static + Linux Static + 0 + + + linux-shared + Linux Shared Lib mode + 1 + + + external + External Os + 3 + + + freeBsd + Free BSD + 4 + + + + board-pp-map-type + enumeration + Specifies pci info types. + + fixed + Fixed + 0 + + + autoscan + Auto scan + 1 + + + + board-pp-interface-channel-type + enumeration + Specifies channel interface type. + + pci + PCI + 0 + + + smi + SMI + 1 + + + twsi + TWSI + 2 + + + + board-pp-as-type + enumeration + Specifies Address space type. + + 4_regions + address-space 4 regions + 0 + + + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-mapping-type + enumeration + Specifies port map type. + + ethernet_mac + ETHERNET_MAC + 0 + + + cpu_sdma + CPU_SDMA + 1 + + + + interface-num-type + uint32 + Interface number + 0 + 1023 + + + txq-port-number-type + uint32 + TXq port number + 0 + 99 + + + phy-smi-interface-type + uint32 + Phy SMI interface type. + 0 + 3 + + + phy-xsmi-interface-type + uint32 + Phy XSMI interface type. + 0 + 15 + + + phy-type + enumeration + Specifies the PHY Part Identifier. + + NA + No Phy + 0 + + + alaska-88E1543 + Specifies PHY identifier 88E1543, used for Combo ports. + 1 + + + alaska-88E1545 + Specifies PHY identifier 88E1545, used for Copper GE with MAC on PHY support. + 2 + + + alaska-88E1680 + Specifies PHY identifier 88E1680, used for Copper with speeds of 10M/100M/1G. + 3 + + + alaska-88E151X + Specifies PHY identifier 88E151X, used for Copper (HW supports combo and fiber). + 4 + + + alaska-88E3140 + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. + 5 + + + alaska-88E3240 + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. + 6 + + + alaska-88E3680 + Specifies PHY identifier 88E3680, used for Octal Copper 100M. + 7 + + + alaska-88E3220 + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. + 8 + + + alaska-88E1680L + Specifies PHY identifier 88E1680L, used for Copper with speeds of 10M/100M/1G. + 9 + + + alaska-88E33X0 + Specifies PHY identifier 88E33X0, used for MGIG Combo. + 10 + + + alaska-88E1548 + Specifies PHY identifier 88E1548, used for Fiber GE. + 11 + + + alaska-88E20X0 + Specifies PHY identifier 88E20X0, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 12 + + + alaska-88E1512 + Specifies PHY identifier 88E1512, used for Copper with speeds of 10M/100M/1G. + 13 + + + alaska-88E2180 + Specifies PHY identifier 88E2180, used for Copper with speeds of 10M/100M/1G/2.5G/5G. + 14 + + + alaska-88E1780 + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver + 15 + + + alaska-88E2540 + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support + 16 + + + alaska-88E2580 + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support + 17 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + led-stream-port-type + enumeration + Specifies the ledstream port type. + + PORT_TYPE_TRI_SPEED + tri-speed port. + 1 + + + PORT_TYPE_XG + XG port. + 2 + + + + led-stream-blink-select-type + enumeration + Specifies the LED stream blink select type. + + BLINK_SELECT_0 + Blink 0 signal. + 1 + + + BLINK_SELECT_1 + Blink 1 signal + 2 + + + + led-stream-order-mode-type + enumeration + Specifies the LED stream ordering mode. + + ORDER_MODE_BY_PORT + the indication order is arranged by port. + 1 + + + ORDER_MODE_BY_CLASS + the indication order is arranged by class. + 2 + + + + led-stream-blink-duty-cycle-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + BLINK_DUTY_CYCLE_0 + 25% on, 75% off. + 1 + + + BLINK_DUTY_CYCLE_1 + 50% on, 50% off. + 2 + + + BLINK_DUTY_CYCLE_2 + 50% on, 50% off. + 3 + + + BLINK_DUTY_CYCLE_3 + 75% on, 25% off. + 4 + + + + led-stream-blink-duration-type + enumeration + Specifies the LED stream blink period type. + + BLINK_DURATION_0 + BLINK_DURATION_0. + 1 + + + BLINK_DURATION_1 + BLINK_DURATION_1. + 2 + + + BLINK_DURATION_2 + BLINK_DURATION_2. + 3 + + + BLINK_DURATION_3 + BLINK_DURATION_3. + 4 + + + BLINK_DURATION_4 + BLINK_DURATION_4. + 5 + + + BLINK_DURATION_5 + BLINK_DURATION_5. + 6 + + + BLINK_DURATION_6 + (APPLICABLE DEVICES: xCat3; AC5; Lion2; Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe) . + 7 + + + BLINK_DURATION_7 + APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Pipe). + 8 + + + + led-stream-pulse-stretch-type + enumeration + Specifies the LED stream length of stretching for dynamic signals. + + PULSE_STRETCH_0_NO + PULSE_STRETCH_0_NO. + 1 + + + PULSE_STRETCH_1 + PULSE_STRETCH_1. + 2 + + + PULSE_STRETCH_2 + PULSE_STRETCH_2. + 3 + + + PULSE_STRETCH_3 + PULSE_STRETCH_3. + 4 + + + PULSE_STRETCH_4 + PULSE_STRETCH_4. + 5 + + + PULSE_STRETCH_5 + PULSE_STRETCH_5. + 6 + + + PULSE_STRETCH_6 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 7 + + + PULSE_STRETCH_7 + (APPLICABLE DEVICES: Bobcat2; Caelum; Aldrin; AC3X; Bobcat3; Aldrin2; Falcon; AC5P; Pipe). + 8 + + + + led-stream-clock-out-frequency-type + enumeration + Specifies the LED stream blink cycle duty cycle type. + + _CLOCK_OUT_FREQUENCY_500 + 500 KHz LED clock frequency. + 1 + + + CLOCK_OUT_FREQUENCY_1000 + 1 MHz LED clock frequency. + 2 + + + CLOCK_OUT_FREQUENCY_2000 + 2 MHz LED clock frequency. + 3 + + + CLOCK_OUT_FREQUENCY_3000 + 3 MHz LED clock frequency. + 4 + + + + led-stream-class5-select-type + enumeration + Specifies the LED stream indication displayed on class5 (for dual-media port/phy). + + CLASS_5_SELECT_HALF_DUPLEX + Half Duplex is displayed on class5. + 1 + + + CLASS_5_SELECT_FIBER_LINK_UP + If port is a dual media port, Fiber Link Up is displayed on class5. + 2 + + + + led-stream-class13-select-type + enumeration + Specifies the LED stream indication displayed on class13 (for dual-media port/phy). + + CLASS_13_SELECT_LINK_DOWN + Link Down is displayed on class13. + 1 + + + CLASS_13_SELECT_COPPER_LINK_UP + If port is a dual media port, Copper Link Up is displayed on class13. + 2 + + + + led-class-num-type + uint32 + Led Class number + 0 + 11 + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + bus-id-type + uint32 + Bus Id Type, PCI/SMI + 0 + 255 + + + function-id-type + uint32 + Function Id Type, PCI/SMI + 0 + 255 + + + domain-type + uint32 + Domain, PCI/SMI + 0 + 255 + + + led-interface-type + uint32 + Led interface + 0 + 255 + + + led-position-type + uint32 + Led position + 0 + 63 + + + serdes-lane-type + uint32 + serdes lane + 0 + 7 + + + cpu-type + enumeration + The CPU Internal/External + + external + Extrenal connected CPU + 0 + + + internal + Internal CPU + 1 + + + + led-stream-clock-frequency-type + uint32 + Led Clock Frequency Sip6 + 500 + 80000 + + + led-unit-type + uint32 + Led units + 1 + 16 + + + led-unit-or-no-unit-type + uint32 + Led units, 0 for no Unit + 0 + 16 + + + led-group-type + uint32 + Led Group + 0 + 1 + + + led-stream-force-data-type + string + A hexadecimal string with octets represented as hex digits +separated by colons. The canonical representation uses +lowercase characters. + 3 + 11 + + + bit-type + uint32 + Bit range 0..31 + 0 + 31 + + + bit-size-type + uint32 + Bit leng 1..32 + 1 + 32 + + + led-sip-type + enumeration + The LED scehme + + na + NA + 0 + + + sip5 + SIP5: AC3x + 5 + + + sip6 + SIP6: Falcon, AC5x + 6 + + + + port-cscd-type + enumeration + Specifies the cascade port type. + + DSA_1_WORD + DSA Regular + 0 + + + DSA_2_WORDS + DSA Extended + 1 + + + NETWORK + Network. + 2 + + + DSA_3_WORDS + DSA 3 Words + 3 + + + DSA_4_WORD + DSA 4 Words + 4 + + + + trunk-cscd-type + uint32 + Specifies the Cascade Trunk id. + 0 + 127 + + + port-trunk-cscd-type + enumeration + Specifies the cascade port type. + + cscdPort + Cascade port + 0 + + + cscdTrunk + Csacde trunk + 1 + + + + hash-cscd-type + enumeration + Specifies the hash used by cascade trunk. + + pkt + Hash based on packet + 0 + + + srcPort + Hash based on source port + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F2T_48x25G-8x100G + linux-static + linux-static + autoscan + external + pci + atu + + 0 + 0 + ASK-PP-F2T_48x25G-8x100G.xml + ASK-L1-F2T_48x25G-8x100G.xml + sip6 + + 0 + + ethernet_mac + 112 + false + + + NA + + MAP0 + + + false + + + + 1 + + ethernet_mac + 113 + false + + + NA + + + + false + + + + 2 + + ethernet_mac + 114 + false + + + NA + + + + false + + + + 3 + + ethernet_mac + 115 + false + + + NA + + + + false + + + + 4 + + ethernet_mac + 116 + false + + + NA + + + + false + + + + 5 + + ethernet_mac + 117 + false + + + NA + + + + false + + + + 6 + + ethernet_mac + 118 + false + + + NA + + + + false + + + + 7 + + ethernet_mac + 119 + false + + + NA + + + + false + + + + 8 + + ethernet_mac + 120 + false + + + NA + + MAP1 + + + false + + + + 9 + + ethernet_mac + 121 + false + + + NA + + + + false + + + + 10 + + ethernet_mac + 122 + false + + + NA + + + + false + + + + 11 + + ethernet_mac + 123 + false + + + NA + + + + false + + + + 12 + + ethernet_mac + 124 + false + + + NA + + + + false + + + + 13 + + ethernet_mac + 125 + false + + + NA + + + + false + + + + 14 + + ethernet_mac + 126 + false + + + NA + + + + false + + + + 15 + + ethernet_mac + 127 + false + + + NA + + + + false + + + + 16 + + ethernet_mac + 0 + false + + + NA + + MAP0 + + + false + + + + 17 + + ethernet_mac + 1 + false + + + NA + + + + false + + + + 18 + + ethernet_mac + 2 + false + + + NA + + + + false + + + + 19 + + ethernet_mac + 3 + false + + + NA + + + + false + + + + 20 + + ethernet_mac + 4 + false + + + NA + + + + false + + + + 21 + + ethernet_mac + 5 + false + + + NA + + + + false + + + + 22 + + ethernet_mac + 6 + false + + + NA + + + + false + + + + 23 + + ethernet_mac + 7 + false + + + NA + + + + false + + + + 24 + + ethernet_mac + 8 + false + + + NA + + MAP1 + + + false + + + + 25 + + ethernet_mac + 9 + false + + + NA + + + + false + + + + 26 + + ethernet_mac + 10 + false + + + NA + + + + false + + + + 27 + + ethernet_mac + 11 + false + + + NA + + + + false + + + + 28 + + ethernet_mac + 12 + false + + + NA + + + + false + + + + 29 + + ethernet_mac + 13 + false + + + NA + + + + false + + + + 30 + + ethernet_mac + 14 + false + + + NA + + + + false + + + + 31 + + ethernet_mac + 15 + false + + + NA + + + + false + + + + 32 + + ethernet_mac + 32 + false + + + NA + + MAP0 + + + false + + + + 33 + + ethernet_mac + 33 + false + + + NA + + + + false + + + + 34 + + ethernet_mac + 34 + false + + + NA + + + + false + + + + 35 + + ethernet_mac + 35 + false + + + NA + + + + false + + + + 36 + + ethernet_mac + 36 + false + + + NA + + + + false + + + + 37 + + ethernet_mac + 37 + false + + + NA + + + + false + + + + 38 + + ethernet_mac + 38 + false + + + NA + + + + false + + + + 39 + + ethernet_mac + 39 + false + + + NA + + + + false + + + + 40 + + ethernet_mac + 40 + false + + + NA + + MAP1 + + + false + + + + 41 + + ethernet_mac + 41 + false + + + NA + + + + false + + + + 42 + + ethernet_mac + 42 + false + + + NA + + + + false + + + + 43 + + ethernet_mac + 43 + false + + + NA + + + + false + + + + 44 + + ethernet_mac + 44 + false + + + NA + + + + false + + + + 45 + + ethernet_mac + 45 + false + + + NA + + + + false + + + + 46 + + ethernet_mac + 46 + false + + + NA + + + + false + + + + 47 + + ethernet_mac + 47 + false + + + NA + + + + false + + + + 48 + + ethernet_mac + 64 + false + + + NA + + MAP2 + + + false + + + + 49 + + ethernet_mac + 68 + false + + + NA + + + + false + + + + 50 + + ethernet_mac + 72 + false + + + NA + + MAP3 + + + false + + + + 51 + + ethernet_mac + 76 + false + + + NA + + + + false + + + + 52 + + ethernet_mac + 80 + false + + + NA + + MAP2 + + + false + + + + 53 + + ethernet_mac + 84 + false + + + NA + + + + false + + + + 54 + + ethernet_mac + 88 + false + + + NA + + MAP3 + + + false + + + + 55 + + ethernet_mac + 92 + false + + + NA + + + + false + + + + 56 + + ethernet_mac + 133 + false + + + NA + + + + false + + + + 57 + + ethernet_mac + 135 + false + + + NA + + + + false + + + + 63 + + cpu_sdma + 136 + false + + + + 58 + + cpu_sdma + 137 + false + + + + 59 + + cpu_sdma + 138 + false + + + + 60 + + cpu_sdma + 139 + false + + + + 64 + true + true + + + 65 + true + false + + + 66 + false + true + + + 67 + false + true + + + 68 + false + false + + + 69 + false + true + + + 70 + false + true + + + 71 + false + true + + + 79 + true + true + + + 78 + true + true + + + 77 + true + true + + + 76 + true + true + + + 75 + true + true + + + 74 + false + true + + + 73 + true + true + + + 72 + true + true + + + 0 + false + true + + + 1 + false + true + + + 2 + true + true + + + 3 + false + true + + + 4 + true + true + + + 5 + true + false + + + 6 + false + true + + + 7 + true + false + + + 15 + true + true + + + 14 + true + false + + + 13 + true + true + + + 12 + true + false + + + 11 + true + true + + + 10 + false + false + + + 9 + true + true + + + 8 + true + false + + + 16 + true + true + + + 17 + false + false + + + 18 + true + false + + + 19 + true + false + + + 20 + false + true + + + 21 + false + false + + + 22 + false + true + + + 23 + false + false + + + 31 + false + true + + + 30 + false + false + + + 29 + true + true + + + 28 + true + false + + + 27 + false + false + + + 26 + true + false + + + 25 + false + true + + + 24 + false + false + + + 32 + false + false + + + 35 + true + true + + + 33 + true + false + + + 34 + true + false + + + 37 + false + true + + + 39 + false + false + + + 36 + true + true + + + 38 + false + false + + + 47 + false + false + + + 44 + true + true + + + 46 + false + false + + + 45 + true + false + + + 42 + true + true + + + 40 + true + false + + + 43 + true + true + + + 41 + false + false + + + 48 + false + false + + + 51 + false + true + + + 49 + false + false + + + 50 + true + false + + + 53 + true + true + + + 55 + true + false + + + 52 + false + true + + + 54 + false + false + + + 63 + false + false + + + 60 + false + true + + + 62 + false + false + + + 61 + false + false + + + 58 + false + true + + + 56 + false + false + + + 59 + false + true + + + 57 + false + false + + + 80 + false + true + + + 81 + true + false + + + /tmp/cpss_uds + + 8 + + MAP0 + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + + MAP1 + + 7 + + + 6 + + + 5 + + + 4 + + + 3 + + + 2 + + + 1 + + + 0 + + + + MAP2 + + 0 + + + 3 + + + 1 + + + 2 + + + 5 + + + 7 + + + 4 + + + 6 + + + + MAP3 + + 7 + + + 4 + + + 6 + + + 5 + + + 2 + + + 0 + + + 3 + + + 1 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-L1-F2T_48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-L1-F2T_48x25G-8x100G.md5 new file mode 100644 index 000000000000..5ce1720c3114 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-L1-F2T_48x25G-8x100G.md5 @@ -0,0 +1 @@ +06a802c61f6b37d6e1897fdf4be6ee83 \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-L1-F2T_48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-L1-F2T_48x25G-8x100G.xml new file mode 100644 index 000000000000..666a1eec84d4 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-L1-F2T_48x25G-8x100G.xml @@ -0,0 +1,1252 @@ + + + + + + interface-mode-type + enumeration + Specifies supported Interface modes + + 1000BASE_X + 1G + 6 + + + SGMII + 1G , 2.5G + 3 + + + QSGMII + 1G + 13 + + + KR + 10G, 12G, 20G, 40G, 100G + 16 + + + SR_LR + 5G, 10G, 12G, 20G, 40G + 20 + + + KR2 + + 27 + + + KR4 + + 28 + + + SR_LR2 + + 29 + + + SR_LR4 + 100G + 30 + + + KR_C + CONSORTIUM - 25G + 32 + + + CR_C + CONSORTIUM - 25G + 33 + + + KR2_C + CONSORTIUM - 50G + 34 + + + CR2_C + CONSORTIUM - 50G + 35 + + + CR + + 36 + + + CR2 + + 37 + + + CR4 + + 38 + + + KR_S + + 39 + + + CR_S + + 40 + + + KR8 + + 41 + + + CR8 + + 42 + + + SR_LR8 + + 43 + + + USX_10G_QXGMII + + 51 + + + USX_20G_QXGMII + + 52 + + + USX_OUSGMII + + 53 + + + USX_20G_OXGMII + + 54 + + + NA + + 57 + + + + port-speed-type + enumeration + Specifies supported speeds + + 1G + 1G + 2 + + + 10G + 10G + 3 + + + 2500M + 2.5G + 5 + + + 5G + 5G + 6 + + + 25G + 25G, used in combination with CPSS_PORT_INTERFACE_MODE_KR_E, CPSS_PORT_INTERFACE_MODE_KR2_E + 21 + + + 40G + 40G + 9 + + + 50G + 50G + 14 + + + 100G + 100G + 13 + + + 200G + 200G + 24 + + + 400G + 400G + 25 + + + NA + NA + 35 + + + + fec-type + enumeration + Rx parameter type + + enabled + Enabled + 0 + + + disabled + Disabled + 1 + + + rs_enabled + RS FEC enabled + 2 + + + both_enabled + Both enabled + 3 + + + rs_544_514_enabled + RS FEC 544 and 514 + 4 + + + + physical-port-num-type + uint32 + PHYSICAL PORT NUM + 0 + 1023 + + + tx-param-type + enumeration + Tx parameter type + + atten + atten + 0 + + + post + post + 1 + + + pre + pre + 2 + + + pre2 + pre2 + 3 + + + pre3 + pre3 + 4 + + + peak + peak + 5 + + + main + main + 6 + + + txAmpAdjEn + txAmpAdjEn + 7 + + + emph0 + emph0 + 8 + + + emph1 + emph1 + 9 + + + txAmpShft + txAmpShft + 10 + + + txEmphEn + txEmphEn + 11 + + + txEmphEn1 + txEmphEn1 + 12 + + + txAmpAdj + txAmpAdj + 13 + + + slewCtrlEn + slewCtrlEn + 14 + + + slewRate + slewRate + 15 + + + + rx-param-type + enumeration + Rx parameter type + + sqlch + sqlch + 0 + + + DC + DC + 1 + + + LF + LF + 2 + + + HF + HF + 3 + + + gainShape1 + gainShape1 + 4 + + + gainShape2 + gainShape2 + 5 + + + shortChannelEn + shortChannelEn + 7 + + + bfLf + bfLf + 8 + + + bfHf + bfHf + 9 + + + minLf + minLf + 10 + + + maxLf + maxLf + 11 + + + minHf + minHf + 12 + + + maxHf + maxHf + 13 + + + minPre1 + minPre1 + 14 + + + maxPre1 + maxPre1 + 15 + + + minPre2 + minPre2 + 16 + + + maxPre2 + + 17 + + + minPost + minPost + 18 + + + maxPost + maxPost + 19 + + + squelch + squelch + 20 + + + termination + termination + 27 + + + coldEnvelope + coldEnvelope + 35 + + + hotEnvelope + hotEnvelope + 36 + + + dcGain + dcGain + 37 + + + bandWidth + bandWidth + 38 + + + dfe + dfe + 39 + + + ffeR + ffeR + 40 + + + ffeC + ffeC + 41 + + + sampler + sampler + 42 + + + align90 + align90 + 43 + + + ffeS + ffeS + 44 + + + resSel + resSel + 45 + + + resShift + resShift + 46 + + + capSel + capSel + 47 + + + ffeSettingForce + ffeSettingForce + 48 + + + adaptedResSel + adaptedResSel + 49 + + + adaptedCapSel + adaptedCapSel + 50 + + + selmufi + selmufi + 51 + + + selmuff + selmuff + 52 + + + selmupi + selmupi + 53 + + + selmupf + selmupf + 54 + + + slewRateCtrl0 + slewRateCtrl0 + 55 + + + slewRateCtrl1 + slewRateCtrl1 + 56 + + + EO + EO + 57 + + + dataRate + dataRate + 58 + + + res1Sel + res1Sel + 59 + + + res2Sel + res2Sel + 60 + + + cap1Sel + cap1Sel + 61 + + + cap2Sel + cap2Sel + 62 + + + midpointLargeThresKLane + midpointLargeThresKLane + 63 + + + midpointSmallThresKLane + midpointSmallThresKLane + 64 + + + midpointLargeThresCLane + midpointLargeThresCLane + 65 + + + midpointSmallThresCLane + midpointSmallThresCLane + 66 + + + dfeResF0aHighThresInitLane + dfeResF0aHighThresInitLane + 67 + + + dfeResF0aHighThresEndLane + dfeResF0aHighThresEndLane + 68 + + + current1Sel + current1Sel + 69 + + + rl1Sel + rl1Sel + 70 + + + rl1Extra + rl1Extra + 71 + + + cl1Ctrl + cl1Ctrl + 72 + + + enMidFreq + enMidFreq + 73 + + + cs1Mid + cs1Mid + 74 + + + rs1Mid + rs1Mid + 75 + + + rfCtrl + rfCtrl + 76 + + + rl1TiaSel + rl1TiaSel + 77 + + + rl1TiaExtra + rl1TiaExtra + 78 + + + hpfRSel1st + hpfRSel1st + 79 + + + current1TiaSel + current1TiaSel + 80 + + + rl2Tune + rl2Tune + 81 + + + rl2Sel + rl2Sel + 82 + + + rs2Sel + rs2Sel + 83 + + + current2Sel + current2Sel + 84 + + + hpfRsel2nd + hpfRsel2nd + 85 + + + BW + BW + 86 + + + dfeGAIN + dfeGAIN + 87 + + + dfeGAIN2 + dfeGAIN2 + 88 + + + pre1 + pre1 + 89 + + + pre2 + pre2 + 90 + + + post1 + post1 + 91 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + serdes-type + enumeration + Serdes Type + + NA + No serdes + 0 + + + AVAGO + AVAGO + 1 + + + COMPHY + COMPHY + 2 + + + COMPHY_C12G + COMPHY_C12G + 3 + + + COMPHY_C28G + COMPHY_C28G + 4 + + + COMPHY_C112G + COMPHY_C112G + 5 + + + + uint8-type + uint32 + Uint8 32 bits , due to bing endian + 0 + 255 + + + serdes-termination-type + enumeration + RX termination mode + + GND + Enabled + 0 + + + VDD + Disabled + 1 + + + FLOATING + RS FEC enabled + 2 + + + + port-interconnect-profile-type + enumeration + Enumerator of interconnect profile. + + profile_default + Profile Default + 0 + + + profile_1 + Profile 1 + 1 + + + profile_2 + Profile 2 + 2 + + + + + + 100GR4 + + CR4 + 100G + rs_enabled + + + KR4 + 100G + rs_enabled + + + SR_LR4 + 100G + rs_enabled + + + CR4 + 100G + rs_enabled + rs_enabled + + + KR4 + 100G + rs_enabled + rs_enabled + + + + 10GR1Fix + + KR + 10G + disabled + + + + 25GR1 + + CR + 25G + rs_enabled + + + KR + 25G + rs_enabled + + + KR + 10G + enabled + + + SR_LR + 25G + rs_enabled + + + SR_LR + 10G + enabled + + + CR + 25G + rs_enabled + rs_enabled + + + KR + 25G + rs_enabled + rs_enabled + + + KR + 10G + enabled + enabled + + + + + + 0 + AVAGO + profile_default + 25GR1 + + + 1 + AVAGO + profile_default + 25GR1 + + + 2 + AVAGO + profile_default + 25GR1 + + + 3 + AVAGO + profile_default + 25GR1 + + + 4 + AVAGO + profile_default + 25GR1 + + + 5 + AVAGO + profile_default + 25GR1 + + + 6 + AVAGO + profile_default + 25GR1 + + + 7 + AVAGO + profile_default + 25GR1 + + + 8 + AVAGO + profile_default + 25GR1 + + + 9 + AVAGO + profile_default + 25GR1 + + + 10 + AVAGO + profile_default + 25GR1 + + + 11 + AVAGO + profile_default + 25GR1 + + + 12 + AVAGO + profile_default + 25GR1 + + + 13 + AVAGO + profile_default + 25GR1 + + + 14 + AVAGO + profile_default + 25GR1 + + + 15 + AVAGO + profile_default + 25GR1 + + + 16 + AVAGO + profile_default + 25GR1 + + + 17 + AVAGO + profile_default + 25GR1 + + + 18 + AVAGO + profile_default + 25GR1 + + + 19 + AVAGO + profile_default + 25GR1 + + + 20 + AVAGO + profile_default + 25GR1 + + + 21 + AVAGO + profile_default + 25GR1 + + + 22 + AVAGO + profile_default + 25GR1 + + + 23 + AVAGO + profile_default + 25GR1 + + + 24 + AVAGO + profile_default + 25GR1 + + + 25 + AVAGO + profile_default + 25GR1 + + + 26 + AVAGO + profile_default + 25GR1 + + + 27 + AVAGO + profile_default + 25GR1 + + + 28 + AVAGO + profile_default + 25GR1 + + + 29 + AVAGO + profile_default + 25GR1 + + + 30 + AVAGO + profile_default + 25GR1 + + + 31 + AVAGO + profile_default + 25GR1 + + + 32 + AVAGO + profile_default + 25GR1 + + + 33 + AVAGO + profile_default + 25GR1 + + + 34 + AVAGO + profile_default + 25GR1 + + + 35 + AVAGO + profile_default + 25GR1 + + + 36 + AVAGO + profile_default + 25GR1 + + + 37 + AVAGO + profile_default + 25GR1 + + + 38 + AVAGO + profile_default + 25GR1 + + + 39 + AVAGO + profile_default + 25GR1 + + + 40 + AVAGO + profile_default + 25GR1 + + + 41 + AVAGO + profile_default + 25GR1 + + + 42 + AVAGO + profile_default + 25GR1 + + + 43 + AVAGO + profile_default + 25GR1 + + + 44 + AVAGO + profile_default + 25GR1 + + + 45 + AVAGO + profile_default + 25GR1 + + + 46 + AVAGO + profile_default + 25GR1 + + + 47 + AVAGO + profile_default + 25GR1 + + + 48 + AVAGO + profile_default + 100GR4 + + + 49 + AVAGO + profile_default + 100GR4 + + + 50 + AVAGO + profile_default + 100GR4 + + + 51 + AVAGO + profile_default + 100GR4 + + + 52 + AVAGO + profile_default + 100GR4 + + + 53 + AVAGO + profile_default + 100GR4 + + + 54 + AVAGO + profile_default + 100GR4 + + + 55 + AVAGO + profile_default + 100GR4 + + + 56 + AVAGO + profile_default + 10GR1Fix + + + 57 + AVAGO + profile_default + 10GR1Fix + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-PP-F2T_48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-PP-F2T_48x25G-8x100G.md5 new file mode 100644 index 000000000000..92fc07b50bf1 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-PP-F2T_48x25G-8x100G.md5 @@ -0,0 +1 @@ +72ea1b2a8dd25f7d1584a05b11c1ae0b \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-PP-F2T_48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-PP-F2T_48x25G-8x100G.xml new file mode 100644 index 000000000000..288006a4ae0c --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/ASK-PP-F2T_48x25G-8x100G.xml @@ -0,0 +1,1180 @@ + + + + + + std-string + string + standard string. + 1 + 100 + + + queue-id-type + uint32 + Queue id + 0 + 7 + + + precent-type + uint32 + Precent + 0 + 100 + + + phaThreadId-type + uint32 + Thread id + 1 + 255 + + + routing-mode-type + enumeration + Specifies routing mode. + + POLICY_BASED_ROUTING_ONLY + PBR only + 0 + + + TCAM_ROUTER_BASED + Router engine or PBR + 1 + + + + shared-table-mode-type + enumeration + Specifies table sharing modes for L3 (LPM), L2 (FDB), EM (Exact Match) + + MID_L3_MID_L2_NO_EM + MID_L3_MID_L2_NO_EM + 0 + + + MID_L3_MID_L2_MIN_EM + MID_L3_MID_L2_MIN_EM + 1 + + + LOW_MAX_L3_MID_LOW_L2_NO_EM + LOW_MAX_L3_MID_LOW_L2_NO_EM + 2 + + + MAX_L3_MIN_L2_NO_EM + MAX_L3_MIN_L2_NO_EM + 3 + + + + pha-firmware-image-id-type + enumeration + Specifies supported Pha image id + + DEFAULT + Default PHA firmware image ID + 0 + + + 01 + 01 firmware image ID + 1 + + + 02 + 02 PHA firmware image ID + 2 + + + + pha-firmware-thread-type + enumeration + Specifies supported Pha thread type + + IOAM_INGRESS_SWITCH_IPV4 + IOAM_INGRESS_SWITCH_IPV4 + 1 + + + IOAM_INGRESS_SWITCH_IPV6 + IOAM_INGRESS_SWITCH_IPV6 + 2 + + + IOAM_TRANSIT_SWITCH_IPV4 + IOAM_TRANSIT_SWITCH_IPV4 + 3 + + + IOAM_TRANSIT_SWITCH_IPV6 + IOAM_TRANSIT_SWITCH_IPV6 + 4 + + + INT_IOAM_MIRRORING + INT_IOAM_MIRRORING + 5 + + + INT_IOAM_EGRESS_SWITCH + INT_IOAM_EGRESS_SWITCH + 6 + + + MPLS_SR_NO_EL + MPLS_SR_NO_EL + 7 + + + MPLS_SR_ONE_EL + MPLS_SR_ONE_EL + 8 + + + MPLS_SR_TWO_EL + MPLS_SR_TWO_EL + 9 + + + MPLS_SR_THREE_EL + MPLS_SR_THREE_EL + 10 + + + UNIFIED_SR + UNIFIED_SR + 11 + + + CLASSIFIER_NSH_OVER_ETHERNET + CLASSIFIER_NSH_OVER_ETHERNET + 12 + + + CLASSIFIER_NSH_OVER_VXLAN_GPE + CLASSIFIER_NSH_OVER_VXLAN_GPE + 13 + + + SFF_NSH_VXLAN_GPE_TO_ETHERNET + SFF_NSH_VXLAN_GPE_TO_ETHERNET + 14 + + + SFF_NSH_ETHERNET_TO_VXLAN_GPE + SFF_NSH_ETHERNET_TO_VXLAN_GPE + 15 + + + IOAM_EGRESS_SWITCH_IPV6 + IOAM_EGRESS_SWITCH_IPV6 + 16 + + + SRV6_END_NODE + SRV6_END_NODE + 17 + + + SRV6_PENULTIMATE_END_NODE + SRV6_PENULTIMATE_END_NODE + 18 + + + SRV6_SRC_NODE_1_SEGMENT + SRV6_SRC_NODE_1_SEGMENT + 19 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + SRV6_SRC_NODE_FIRST_PASS_2_3_SEGMENTS + 20 + + + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_3_SEGMENTS + 21 + + + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + SRV6_SRC_NODE_SECOND_PASS_2_SEGMENTS + 22 + + + SGT_NETWORK_ADD_MSB + SGT_NETWORK_ADD_MSB + 23 + + + SGT_NETWORK_FIX + SGT_NETWORK_FIX + 24 + + + SGT_NETWORK_REMOVE + SGT_NETWORK_REMOVE + 25 + + + SGT_EDSA_FIX + SGT_EDSA_FIX + 26 + + + SGT_EDSA_REMOVE + SGT_EDSA_REMOVE + 27 + + + SGT_GBP_FIX_IPV4 + SGT_GBP_FIX_IPV4 + 28 + + + SGT_GBP_FIX_IPV6 + SGT_GBP_FIX_IPV6 + 29 + + + SGT_GBP_REMOVE_IPV4 + SGT_GBP_REMOVE_IPV4 + 30 + + + SGT_GBP_REMOVE_IPV6 + SGT_GBP_REMOVE_IPV6 + 31 + + + PTP_PHY_1_STEP + PTP_PHY_1_STEP + 32 + + + EGRESS_MIRRORING_METADATA + EGRESS_MIRRORING_METADATA + 33 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV4 + 34 + + + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_LC_IPV6 + 35 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV4 + 36 + + + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + CC_ERSPAN_TYPE_II_TRG_DEV_DIRECT_IPV6 + 37 + + + CC_ERSPAN_TYPE_II_SRC_DEV + CC_ERSPAN_TYPE_II_SRC_DEV + 38 + + + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + VXLAN_GBP_SOURCE_GROUP_POLICY_ID + 39 + + + SRV6_BEST_EFFORT + SRV6_BEST_EFFORT + 40 + + + SRV6_SRC_NODE_1_CONTAINER + SRV6_SRC_NODE_1_CONTAINER + 41 + + + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + SRV6_SRC_NODE_FIRST_PASS_2_3_CONTAINERS + 42 + + + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_2_CONTAINERS + 43 + + + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + SRV6_SRC_NODE_SECOND_PASS_3_CONTAINERS + 44 + + + SRV6_END_NODE_COC32_GSID + SRV6_END_NODE_COC32_GSID + 45 + + + IPV4_TTL_INCREMENT + IPV4_TTL_INCREMENT + 46 + + + IPV6_HOP_LIMIT_INCREMENT + IPV6_HOP_LIMIT_INCREMENT + 47 + + + CLEAR_OUTGOING_MTAG_COMMAND + CLEAR_OUTGOING_MTAG_COMMAND + 48 + + + SFLOW_V5_IPV4 + SFLOW_V5_IPV4 + 49 + + + SFLOW_V5_IPV6 + SFLOW_V5_IPV6 + 50 + + + SLS + SLS + 51 + + + + trunk-member-mode-type + enumeration + Specifies supported Pha image id + + NATIVE + NATIVE +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members + 0 + + + FLEX + FLEX +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. + 2 + + + + number-physical-port-type + enumeration + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 + + no-ports + no-ports + 0 + + + 64-ports + 64-ports + 64 + + + 128-ports + 128-ports + 128 + + + 256-ports + 256-ports + 256 + + + 512-ports + 512-ports + 512 + + + 1024-ports + 1024-ports + 1024 + + + + serdes-ref-clock-type + enumeration + Specifies serdes refernce clock. + + external_25_single_ended + EXTERNAL_25_SINGLE_ENDED + 0 + + + external_125_single_ended + EXTERNAL_125_SINGLE_ENDED + 1 + + + external_125_diff + EXTERNAL_125_DIFF + 2 + + + external_156_25_single_ended + EXTERNAL_156_25_SINGLE_ENDED + 3 + + + external_156_25_diff + EXTERNAL_156_25_DIFF + 4 + + + internal_125 + INTERNAL_125 + 5 + + + + cpu-port-id-type + uint32 + CPU port id + 0 + 7 + + + rx-buffer-size-type + uint32 + Rx Buffer size + 64 + 10240 + + + tx-sdma-queue-mode-type + enumeration + Specifies TX queue mode. + + Normal + Application + 0 + + + Packet_Generator + Traffic generator + 1 + + + + alloc-method-type + enumeration + Specifies Buffers allocation method. + + Dynamic_Alloc + Dynamic + 0 + + + Static_Alloc + Static + 1 + + + + au_mesage_lenght-type + enumeration + Specifies Buffers allocation method. + + 4_words + 4 Words + 0 + + + 8_words + 8 Words + 1 + + + + boolean-type + enumeration + Boolean 32 bits , due to bing endian + + false + False + 0 + + + true + True + 1 + + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + + Falcon-2 + + 4294967295 + external_25_single_ended + 2 + 60 + 64-ports + false + true + 0 + + + true + + 4096 + + + 2048 + + + + 0 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 3 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 2 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 1 + 0 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 7 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 6 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 5 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 4 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 3 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 2 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 1 + Static_Alloc + 20 + 20 + 2048 + 0 + + + 0 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 0 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 1 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 6 + Static_Alloc + Normal + 20 + 0 + 128 + + + 2 + 7 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 0 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 1 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 2 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 3 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 4 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 5 + Static_Alloc + Normal + 20 + 0 + 128 + + + 3 + 6 + Static_Alloc + Packet_Generator + 256 + 256 + 144 + + + 3 + 7 + Static_Alloc + Packet_Generator + 1 + 1 + 3032 + + + + false + false + false + 0 + 8_words + false + + + + TCAM_ROUTER_BASED + 0 + MID_L3_MID_L2_NO_EM + false + + + true + true + true + true + true + true + + 1023 + FLEX + + true + true + true + true + + false + 02 + 0 + + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/SAI-F2T_48x25G-8x100G.md5 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/SAI-F2T_48x25G-8x100G.md5 new file mode 100644 index 000000000000..8f24db9ff7e3 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/SAI-F2T_48x25G-8x100G.md5 @@ -0,0 +1 @@ +cdd0dffb9811802ae6b98caa7b62b96b \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/SAI-F2T_48x25G-8x100G.xml b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/SAI-F2T_48x25G-8x100G.xml new file mode 100644 index 000000000000..973cc465de77 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/SAI-F2T_48x25G-8x100G.xml @@ -0,0 +1,523 @@ + + + + + + device-id-type + uint32 + Device ID 0..1 + 0 + 1 + + + port-id-type + uint32 + Interface number + 0 + 1023 + + + logDest-type + enumeration + Logging Feature Options + + SAI_LOG_SYSLOG + SYSLOG {Syslog service should be running to use this option} + 0 + + + SAI_LOG_CONSOLE + CONSOLE + 1 + + + SAI_LOG_FILE + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + + + log-dest-file-path-type + string + A string with path to file for logging feature + 2 + 30 + + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + + ASIC_Falcon + ASK-Board-F2T_48x25G-8x100G.xml + + + 0 + 0 + 47 + + + 1 + 0 + 46 + + + 2 + 0 + 45 + + + 3 + 0 + 44 + + + 4 + 0 + 43 + + + 5 + 0 + 42 + + + 6 + 0 + 41 + + + 7 + 0 + 40 + + + 8 + 0 + 39 + + + 9 + 0 + 38 + + + 10 + 0 + 37 + + + 11 + 0 + 36 + + + 12 + 0 + 35 + + + 13 + 0 + 34 + + + 14 + 0 + 33 + + + 15 + 0 + 32 + + + 16 + 0 + 31 + + + 17 + 0 + 30 + + + 18 + 0 + 29 + + + 19 + 0 + 28 + + + 20 + 0 + 27 + + + 21 + 0 + 26 + + + 22 + 0 + 25 + + + 23 + 0 + 24 + + + 24 + 0 + 23 + + + 25 + 0 + 22 + + + 26 + 0 + 21 + + + 27 + 0 + 20 + + + 28 + 0 + 19 + + + 29 + 0 + 18 + + + 30 + 0 + 17 + + + 31 + 0 + 16 + + + 32 + 0 + 15 + + + 33 + 0 + 14 + + + 34 + 0 + 13 + + + 35 + 0 + 12 + + + 36 + 0 + 11 + + + 37 + 0 + 10 + + + 38 + 0 + 9 + + + 39 + 0 + 8 + + + 40 + 0 + 7 + + + 41 + 0 + 6 + + + 42 + 0 + 5 + + + 43 + 0 + 4 + + + 44 + 0 + 3 + + + 45 + 0 + 2 + + + 46 + 0 + 1 + + + 47 + 0 + 0 + + + 48 + 0 + 55 + + + 52 + 0 + 54 + + + 56 + 0 + 53 + + + 60 + 0 + 52 + + + 64 + 0 + 51 + + + 68 + 0 + 50 + + + 72 + 0 + 49 + + + 76 + 0 + 48 + + + 80 + 0 + 56 + + + 81 + 0 + 57 + + + + 8 + 0 + 0 + 64 + 8 + 8 + 1024 + 0 + 0 + + + + 0 + + + + SAI_LOG_SYSLOG + + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + \ No newline at end of file diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers.json.j2 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers.json.j2 new file mode 100644 index 000000000000..a9a01d707ebf --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers.json.j2 @@ -0,0 +1 @@ +{%- include 'buffers_config.j2' %} diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_config.j2 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_config.j2 new file mode 100644 index 000000000000..a5212d979fcb --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_config.j2 @@ -0,0 +1,165 @@ +{%- macro set_default_topology() %} +{%- if default_topo is defined %} +{{ default_topo }} +{%- else %} +def +{%- endif %} +{%- endmacro -%} + +{# Determine device topology and filename postfix #} +{%- if DEVICE_METADATA is defined %} +{%- set switch_role = DEVICE_METADATA['localhost']['type'] %} +{%- if switch_role.lower() == 'torrouter' %} +{%- set filename_postfix = 't0' %} +{%- elif switch_role.lower() == 'leafrouter' %} +{%- set filename_postfix = 't1' %} +{%- else %} +{%- set filename_postfix = set_default_topology() %} +{%- endif %} +{%- else %} +{%- set filename_postfix = set_default_topology() %} +{%- set switch_role = '' %} +{%- endif -%} + +{# Import default values from device HWSKU folder #} +{%- import 'buffers_defaults_%s.j2' % filename_postfix as defs %} + +{%- set default_cable = defs.default_cable -%} + +{# 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 #} +{%- if defs.ports2cable is defined %} + {%- set ports2cable = defs.ports2cable %} +{%- else %} + {%- set ports2cable = { + 'torrouter_server' : '5m', + 'leafrouter_torrouter' : '40m', + 'spinerouter_leafrouter' : '300m' + } + -%} +{%- endif %} + +{%- macro cable_length(port_name) %} + {%- set cable_len = [] %} + {%- for local_port in DEVICE_NEIGHBOR %} + {%- if local_port == port_name %} + {%- if DEVICE_NEIGHBOR_METADATA is defined and 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 %} + {%- if switch_role.lower() == 'torrouter' %} + {%- for local_port in VLAN_MEMBER %} + {%- if local_port[1] == port_name %} + {%- set roles3 = switch_role + '_' + 'server' %} + {%- set roles3 = roles3 | lower %} + {%- if roles3 in ports2cable %} + {%- if cable_len.append(ports2cable[roles3]) %}{% endif %} + {%- endif %} + {%- endif %} + {%- endfor %} + {%- if cable_len -%} + {{ cable_len.0 }} + {%- else -%} + {{ default_cable }} + {%- endif %} + {%- else -%} + {{ default_cable }} + {%- endif %} + {%- endif %} +{%- endmacro %} + +{%- set PORT_ALL = [] %} + +{%- if PORT is not defined %} + {%- if defs.generate_port_lists(PORT_ALL) %} {% endif %} +{%- else %} + {%- for port in PORT %} + {%- if PORT_ALL.append(port) %}{%- endif %} + {%- endfor %} +{%- endif %} + +{%- set PORT_ACTIVE = [] %} +{%- if DEVICE_NEIGHBOR is not defined %} + {%- set PORT_ACTIVE = PORT_ALL %} +{%- else %} + {%- for port in DEVICE_NEIGHBOR.keys() %} + {%- if PORT_ACTIVE.append(port) %}{%- endif %} + {%- endfor %} +{%- endif %} + +{%- set port_names_list_active = [] %} +{%- for port in PORT_ACTIVE %} + {%- if port_names_list_active.append(port) %}{%- endif %} +{%- endfor %} +{%- set port_names_active = port_names_list_active | join(',') %} + +{ + "CABLE_LENGTH": { + "AZURE": { + {% for port in PORT_ALL %} + {%- set cable = cable_length(port) %} + "{{ port }}": "{{ cable }}"{%- if not loop.last %},{% endif %} + + {% endfor %} + } + }, + +{% if defs.generate_buffer_pool_and_profiles is defined %} +{{ defs.generate_buffer_pool_and_profiles() }} +{% endif %} + +{%- if defs.generate_profile_lists is defined %} +{{ defs.generate_profile_lists(port_names_active) }}, +{% endif %} + +{%- if defs.generate_pg_profils is defined %} +{{ defs.generate_pg_profils(port_names_active) }} +{% else %} + "BUFFER_PG": { +{% for port in PORT_ACTIVE %} + "{{ port }}|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, +{% endif %} + +{% if defs.generate_queue_buffers is defined %} +{{ defs.generate_queue_buffers(port_names_active) }} +{% else %} + "BUFFER_QUEUE": { +{% for port in PORT_ACTIVE %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{% endif %} +} diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_defaults_t0.j2 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..f3eaf01447bd --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_defaults_t0.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "21120000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "21120000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"330000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_defaults_t1.j2 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..f3eaf01447bd --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/buffers_defaults_t1.j2 @@ -0,0 +1,36 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "21120000", + "type": "ingress", + "mode": "dynamic" + }, + "egress_pool": { + "size": "21120000", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_pool", + "mode": "static", + "size":"330000", + "static_th":"0" + }, + "egress_lossy_profile": { + "pool":"egress_pool", + "size":"0", + "mode": "dynamic", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/port_config.ini b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/port_config.ini new file mode 100644 index 000000000000..0c4067b10e81 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/port_config.ini @@ -0,0 +1,59 @@ +# name lanes alias speed autoneg fec index +Ethernet0 0 twenty5GigE0 25000 on none 1 +Ethernet1 1 twenty5GigE1 25000 on none 2 +Ethernet2 2 twenty5GigE2 25000 on none 3 +Ethernet3 3 twenty5GigE3 25000 on none 4 +Ethernet4 4 twenty5GigE4 25000 on none 5 +Ethernet5 5 twenty5GigE5 25000 on none 6 +Ethernet6 6 twenty5GigE6 25000 on none 7 +Ethernet7 7 twenty5GigE7 25000 on none 8 +Ethernet8 8 twenty5GigE8 25000 on none 9 +Ethernet9 9 twenty5GigE9 25000 on none 10 +Ethernet10 10 twenty5GigE10 25000 on none 11 +Ethernet11 11 twenty5GigE11 25000 on none 12 +Ethernet12 12 twenty5GigE12 25000 on none 13 +Ethernet13 13 twenty5GigE13 25000 on none 14 +Ethernet14 14 twenty5GigE14 25000 on none 15 +Ethernet15 15 twenty5GigE15 25000 on none 16 +Ethernet16 16 twenty5GigE16 25000 on none 17 +Ethernet17 17 twenty5GigE17 25000 on none 18 +Ethernet18 18 twenty5GigE18 25000 on none 19 +Ethernet19 19 twenty5GigE19 25000 on none 20 +Ethernet20 20 twenty5GigE20 25000 on none 21 +Ethernet21 21 twenty5GigE21 25000 on none 22 +Ethernet22 22 twenty5GigE22 25000 on none 23 +Ethernet23 23 twenty5GigE23 25000 on none 24 +Ethernet24 24 twenty5GigE24 25000 on none 25 +Ethernet25 25 twenty5GigE25 25000 on none 26 +Ethernet26 26 twenty5GigE26 25000 on none 27 +Ethernet27 27 twenty5GigE27 25000 on none 28 +Ethernet28 28 twenty5GigE28 25000 on none 29 +Ethernet29 29 twenty5GigE29 25000 on none 30 +Ethernet30 30 twenty5GigE30 25000 on none 31 +Ethernet31 31 twenty5GigE31 25000 on none 32 +Ethernet32 32 twenty5GigE32 25000 on none 33 +Ethernet33 33 twenty5GigE33 25000 on none 34 +Ethernet34 34 twenty5GigE34 25000 on none 35 +Ethernet35 35 twenty5GigE35 25000 on none 36 +Ethernet36 36 twenty5GigE36 25000 on none 37 +Ethernet37 37 twenty5GigE37 25000 on none 38 +Ethernet38 38 twenty5GigE38 25000 on none 39 +Ethernet39 39 twenty5GigE39 25000 on none 40 +Ethernet40 40 twenty5GigE40 25000 on none 41 +Ethernet41 41 twenty5GigE41 25000 on none 42 +Ethernet42 42 twenty5GigE42 25000 on none 43 +Ethernet43 43 twenty5GigE43 25000 on none 44 +Ethernet44 44 twenty5GigE44 25000 on none 45 +Ethernet45 45 twenty5GigE45 25000 on none 46 +Ethernet46 46 twenty5GigE46 25000 on none 47 +Ethernet47 47 twenty5GigE47 25000 on none 48 +Ethernet48 48,49,50,51 one00GigE48 100000 on rs 49 +Ethernet49 52,53,54,55 one00GigE49 100000 on rs 50 +Ethernet50 56,57,58,59 one00GigE50 100000 on rs 51 +Ethernet51 60,61,62,63 one00GigE51 100000 on rs 52 +Ethernet52 64,65,66,67 one00GigE52 100000 on rs 53 +Ethernet53 68,69,70,71 one00GigE53 100000 on rs 54 +Ethernet54 72,73,74,75 one00GigE54 100000 on rs 55 +Ethernet55 76,77,78,79 one00GigE55 100000 on rs 56 +Ethernet56 80 tenGigE56 10000 off none 57 +Ethernet57 81 tenGigE57 10000 off none 58 diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/profile.ini b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/profile.ini new file mode 100644 index 000000000000..c2f77685ad0a --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/profile.ini @@ -0,0 +1 @@ +switchMacAddress=00:01:02:03:04:05 diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/qos.json.j2 b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/sai.profile b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/sai.profile new file mode 100644 index 000000000000..49afb26f8d47 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/db98cx8514_10cc/sai.profile @@ -0,0 +1,4 @@ +mode=1 +hwId=F2T48x25G8x100G +switchProfile=/usr/share/sonic/hwsku/SAI-F2T_48x25G-8x100G.xml +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/profile.ini diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/default_sku b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/default_sku new file mode 100644 index 000000000000..00fddc16223f --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/default_sku @@ -0,0 +1 @@ +db98cx8514_10cc t1 diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/platform_asic b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/platform_asic new file mode 100644 index 000000000000..a554752878b7 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/platform_asic @@ -0,0 +1 @@ +marvell diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/pmon_daemon_control.json b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..39deb88be078 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/pmon_daemon_control.json @@ -0,0 +1,8 @@ +{ + "skip_ledd": true, + "skip_pcied": true, + "skip_thermalctld": true, + "skip_psud": true, + "skip_xcvrd": true, + "skip_syseepromd": true +} diff --git a/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/system_health_monitoring_config.json b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..79c17103bf76 --- /dev/null +++ b/device/marvell/x86_64-marvell_db98cx8514_10cc-r0/system_health_monitoring_config.json @@ -0,0 +1,10 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.temperature", + "fan", + "psu" + ], + "user_defined_checkers": [] +} From e046f7f2ce4d8fee5bc5fca4d6c4e46570520bcb Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Thu, 9 May 2024 08:13:52 +0300 Subject: [PATCH 066/282] [Mellanox] Mount /var/log/sdk_dbg folder to host filesystem (#18711) - Why I did it Mellanox SDK Sniffer target path was changed from "/var/log/mellanox/sniffer/" To: "/var/log/sdk_dbg" This PR mount the new folder so it can be accessed from host - How I did it Add /var/log/sdk_dbg to mount - How to verify it Run SDK sniffer and make sure the sniffer output file kept in the new location --- files/build_templates/docker_image_ctl.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 21676ca59888..f0208d32f1e5 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -607,6 +607,7 @@ start() { {%- if sonic_asic_platform == "mellanox" %} {%- if docker_container_name == "syncd" %} -v /var/log/mellanox:/var/log/mellanox:rw \ + -v /var/log/sdk_dbg:/var/log/sdk_dbg:rw \ -v mlnx_sdk_socket:/var/run/sx_sdk \ -v /tmp/nv-syncd-shared/:/tmp \ -v /dev/shm:/dev/shm:rw \ From 5c39fb2ab7c6b342c7a37d9cd688449e2bc21d44 Mon Sep 17 00:00:00 2001 From: Junhua Zhai Date: Thu, 9 May 2024 16:35:09 +0800 Subject: [PATCH 067/282] [gearbox]: Upgrade credo sai package to v0.9.6 (#18910) Update credo sai package to the latest v0.9.6 to support the blackhawk phys used on Arista platform 7060dx5_64s. It also fixes the issue #17716. Microsoft ADO: 28013325 How I did it Update credo sai url for v0.9.6 Include credo sai blackhawk package for blackhawk phy How to verify it Basic traffic test on A7280 --- platform/components/docker-gbsyncd-credo.mk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/components/docker-gbsyncd-credo.mk b/platform/components/docker-gbsyncd-credo.mk index a500a34a45bc..e0833068d008 100644 --- a/platform/components/docker-gbsyncd-credo.mk +++ b/platform/components/docker-gbsyncd-credo.mk @@ -1,15 +1,17 @@ DOCKER_GBSYNCD_PLATFORM_CODE = credo -LIBSAI_CREDO = libsaicredo_0.9.3_amd64.deb -$(LIBSAI_CREDO)_URL = "https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo_0.9.3_amd64.deb" -LIBSAI_CREDO_OWL = libsaicredo-owl_0.9.3_amd64.deb -$(LIBSAI_CREDO_OWL)_URL = "https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo-owl_0.9.3_amd64.deb?" +LIBSAI_CREDO = libsaicredo_0.9.6_amd64.deb +$(LIBSAI_CREDO)_URL = "https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo_0.9.6_amd64.deb" +LIBSAI_CREDO_OWL = libsaicredo-owl_0.9.6_amd64.deb +$(LIBSAI_CREDO_OWL)_URL = "https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo-owl_0.9.6_amd64.deb" +LIBSAI_CREDO_BLACKHAWK = libsaicredo-blackhawk_0.9.6_amd64.deb +$(LIBSAI_CREDO_BLACKHAWK)_URL = "https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo-blackhawk_0.9.6_amd64.deb" ifneq ($($(LIBSAI_CREDO)_URL),) include $(PLATFORM_PATH)/../template/docker-gbsyncd-base.mk $(DOCKER_GBSYNCD_BASE)_VERSION = 1.0.0 $(DOCKER_GBSYNCD_BASE)_PACKAGE_NAME = gbsyncd $(DOCKER_GBSYNCD_BASE)_PATH = $(PLATFORM_PATH)/../components/docker-gbsyncd-$(DOCKER_GBSYNCD_PLATFORM_CODE) -SONIC_ONLINE_DEBS += $(LIBSAI_CREDO) $(LIBSAI_CREDO_OWL) -$(DOCKER_GBSYNCD_BASE)_DEPENDS += $(SYNCD) $(LIBSAI_CREDO) $(LIBSAI_CREDO_OWL) +SONIC_ONLINE_DEBS += $(LIBSAI_CREDO) $(LIBSAI_CREDO_OWL) $(LIBSAI_CREDO_BLACKHAWK) +$(DOCKER_GBSYNCD_BASE)_DEPENDS += $(SYNCD) $(LIBSAI_CREDO) $(LIBSAI_CREDO_OWL) $(LIBSAI_CREDO_BLACKHAWK) endif From dfa242f6b4649c8299c4059ce758697a5d7a2b56 Mon Sep 17 00:00:00 2001 From: byu343 Date: Thu, 9 May 2024 01:36:59 -0700 Subject: [PATCH 068/282] [arista] add dpp_db_path for Arista-7280CR3-C40 (#18917) This is to fix the runtime syncd error for HwSku Arista-7280CR3-C40: sonic INFO syncd#supervisord: syncd :dbx_file_get_db_directory: Error: Entry not found ; DB was not found in /db0:dbx_file_get_db_location: DB Directory does not exist#015 How I did it Add dpp_db_path=/usr/share/bcm/db to the broadcom config file, which has been done on another HwSku Arista-7280CR3-C32D4: https://github.com/sonic-net/sonic-buildimage/blob/202205/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C32D4/jr2-a7280cr3-32d4-32x100G%2B4x400G.config.bcm#L3 --- .../Arista-7280CR3-C40/jr2-a7280cr3-32d4-40x100G.config.bcm | 1 + .../Arista-7280CR3-C40/jr2-a7280cr3-32p4-40x100G.config.bcm | 1 + 2 files changed, 2 insertions(+) diff --git a/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C40/jr2-a7280cr3-32d4-40x100G.config.bcm b/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C40/jr2-a7280cr3-32d4-40x100G.config.bcm index 8dbd850d30e6..e30cd5f384c5 100644 --- a/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C40/jr2-a7280cr3-32d4-40x100G.config.bcm +++ b/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C40/jr2-a7280cr3-32d4-40x100G.config.bcm @@ -1,5 +1,6 @@ soc_family.BCM8869X=BCM8869X +dpp_db_path=/usr/share/bcm/db custom_feature_ucode_path=u_code_db2pem.txt system_headers_mode=1 suppress_unknown_prop_warnings=1 diff --git a/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C40/jr2-a7280cr3-32p4-40x100G.config.bcm b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C40/jr2-a7280cr3-32p4-40x100G.config.bcm index ea071fa044f3..8acc88016a23 100644 --- a/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C40/jr2-a7280cr3-32p4-40x100G.config.bcm +++ b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C40/jr2-a7280cr3-32p4-40x100G.config.bcm @@ -1,5 +1,6 @@ soc_family.BCM8869X=BCM8869X +dpp_db_path=/usr/share/bcm/db custom_feature_ucode_path=u_code_db2pem.txt system_headers_mode=1 suppress_unknown_prop_warnings=1 From 4956cf3b16df46d0ac8f3c31584ddb645d63d1c2 Mon Sep 17 00:00:00 2001 From: arista-nwolfe <94405414+arista-nwolfe@users.noreply.github.com> Date: Thu, 9 May 2024 04:37:48 -0400 Subject: [PATCH 069/282] Bump up rif_id_max to match other 7280cr3 SKUs (#18792) In the following commit the rif_id_max was increased from 0x4000 to 0x6000 but it appears a few 7280cr3 SKUs were missed: c3506ce Fixing those missing SKUs --- .../jr2-a7280cr3-32d4-32x100G+4x400G.config.bcm | 2 +- .../jr2-a7280cr3-32p4-32x100G+4x400G.config.bcm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C32D4/jr2-a7280cr3-32d4-32x100G+4x400G.config.bcm b/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C32D4/jr2-a7280cr3-32d4-32x100G+4x400G.config.bcm index a8e711e7bd09..7530e40e6a58 100644 --- a/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C32D4/jr2-a7280cr3-32d4-32x100G+4x400G.config.bcm +++ b/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C32D4/jr2-a7280cr3-32d4-32x100G+4x400G.config.bcm @@ -744,7 +744,7 @@ ucode_port_34=CDGE5:core_0.34 ucode_port_35=CDGE11:core_1.35 ucode_port_36=CDGE10:core_1.36 -rif_id_max=0x4000 +rif_id_max=0x6000 dma_desc_aggregator_chain_length_max.BCM8869X=1000 dma_desc_aggregator_buff_size_kb.BCM8869X=100 diff --git a/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C32P4/jr2-a7280cr3-32p4-32x100G+4x400G.config.bcm b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C32P4/jr2-a7280cr3-32p4-32x100G+4x400G.config.bcm index 3d4f595f2d30..7bd0fdea82c3 100644 --- a/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C32P4/jr2-a7280cr3-32p4-32x100G+4x400G.config.bcm +++ b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C32P4/jr2-a7280cr3-32p4-32x100G+4x400G.config.bcm @@ -734,7 +734,7 @@ ucode_port_34=CDGE5:core_0.34 ucode_port_35=CDGE11:core_1.35 ucode_port_36=CDGE10:core_1.36 -rif_id_max=0x4000 +rif_id_max=0x6000 dma_desc_aggregator_chain_length_max.BCM8869X=1000 dma_desc_aggregator_buff_size_kb.BCM8869X=100 From d9e62560fdd0b67ebab99e54a0949e4684a6ee50 Mon Sep 17 00:00:00 2001 From: Gagan Punathil Ellath Date: Thu, 9 May 2024 11:02:05 -0700 Subject: [PATCH 070/282] Fix for DNS service being canceled (#18670) #### Why I did it To fix `resolv-config.service` being cancelled: `resolv-config.service` is started from `hostcfgd` each time there is an [update to the dns configuration or during the start of hostcfgd. ](https://github.com/sonic-net/sonic-host-services/blob/6fce4781da508709f11be595e3c7048ffd3138cb/scripts/hostcfgd#L1406) When we perform `config reload` because `hostcfgd` is restarted `resolv-config.service` is also restarted, but due to dependency of [`resolv-config.service` on `sonic.target`](https://github.com/sonic-net/sonic-buildimage/blob/ed839c65055c3cbb446ddabdc9c15b0684988139/files/image_config/resolv-config/resolv-config.service#L5) `systemd` also tries to restart `resolv-config.service` causing cancellation of one of the instances of `resolv-config.service`. This fix removes the dependency of `resolv-config.service` on `sonic.target` #### How I did it By removing the `BindsTo` and `WantedBy` dependency to `sonic.target` the service is not restarted upon `config reload` by `systemd` anymore, which would solve the issue of the service being cancelled. #### How to verify it No occurrence of `Job for resolv-config.service canceled.` in `syslog` after this change is considered --- files/image_config/resolv-config/resolv-config.service | 3 --- 1 file changed, 3 deletions(-) diff --git a/files/image_config/resolv-config/resolv-config.service b/files/image_config/resolv-config/resolv-config.service index fa69330ab191..36b5f32406af 100644 --- a/files/image_config/resolv-config/resolv-config.service +++ b/files/image_config/resolv-config/resolv-config.service @@ -2,7 +2,6 @@ Description=Update DNS configuration Requires=config-setup.service After=config-setup.service -BindsTo=sonic.target After=sonic.target StartLimitIntervalSec=0 @@ -11,5 +10,3 @@ Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/resolv-config.sh start -[Install] -WantedBy=sonic.target From d982462880c87978785a30055eccd055a89770e6 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Fri, 10 May 2024 14:00:51 +0800 Subject: [PATCH 071/282] [Mellanox] run module initialization when any SFP related API is called (#18930) Why I did it Currently, there are a few issues related to module host management: 1. module initialization flow is triggered when chassis.get_change_event is called for the first time. It is too late which delays fast-reboot/warm-reboot convergence time 2. module initialization flow always send change event for all SFP objects to xcvrd even if there is no real module change event. It causes ports flapping during warm-reboot 3. legacy mode and module host management mode are mixed into the same code logic which makes it hard to maintain and extend To address above issues, the PR introduces following changes: 1. module initialization flow is triggered when chassis SFP related API is called for the first time. It means that any of the following API will trigger module init: chassis.get_sfp, chassis.get_all_sfps, chassis.get_change_event. The init flow shall only execute once under xcvrd context. 2. module initialization flow does not send change event anymore. Change event shall be sent only if a real cable event is detected by chassis.get_change_event (plug-in/plug-out/error) 3. legacy mode and module host management mode are decoupled to avoid affecting each other How to verify it 1. Unit test covered most of the new change 2. Full sonic-mgmt regression test make sure there is no degradation (test branch 202311) 3. Manual test --- .../sonic_platform/chassis.py | 251 +++++- .../sonic_platform/device_data.py | 4 +- .../module_host_mgmt_initializer.py | 128 +++ .../sonic_platform/modules_mgmt.py | 783 ----------------- .../mlnx-platform-api/sonic_platform/sfp.py | 786 +++++++++++++++-- .../sonic_platform/sfp_event.py | 409 --------- .../sonic_platform/state_machine.py | 168 ++++ .../sonic_platform/thermal_manager.py | 6 +- .../sonic_platform/thermal_updater.py | 25 +- .../mlnx-platform-api/sonic_platform/utils.py | 8 +- .../sonic_platform/wait_sfp_ready_task.py | 139 +++ .../tests/test_change_event.py | 220 +++++ .../mlnx-platform-api/tests/test_chassis.py | 21 +- .../tests/test_device_data.py | 8 +- .../tests/test_module_initializer.py | 98 +++ .../tests/test_modules_mgmt.py | 800 ------------------ .../mlnx-platform-api/tests/test_sfp.py | 151 +++- .../mlnx-platform-api/tests/test_sfp_event.py | 61 -- .../mlnx-platform-api/tests/test_sfp_sm.py | 170 ++++ .../tests/test_statemachine.py | 137 +++ .../tests/test_thermal_updater.py | 21 +- .../tests/test_wait_sfp_ready_task.py | 51 ++ 22 files changed, 2201 insertions(+), 2244 deletions(-) create mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/module_host_mgmt_initializer.py delete mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py delete mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py create mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/state_machine.py create mode 100644 platform/mellanox/mlnx-platform-api/sonic_platform/wait_sfp_ready_task.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_change_event.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_module_initializer.py delete mode 100644 platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py delete mode 100644 platform/mellanox/mlnx-platform-api/tests/test_sfp_event.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_statemachine.py create mode 100644 platform/mellanox/mlnx-platform-api/tests/test_wait_sfp_ready_task.py diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index f216f6de2c36..935a2fa5f1f8 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -28,13 +28,13 @@ import os from functools import reduce from .utils import extract_RJ45_ports_index + from . import module_host_mgmt_initializer from . import utils from .device_data import DeviceDataManager import re - import queue + import select import threading import time - from sonic_platform import modules_mgmt except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -132,9 +132,9 @@ def __init__(self): Chassis.chassis_instance = self - self.modules_mgmt_thread = threading.Thread() - self.modules_changes_queue = queue.Queue() - self.modules_mgmt_task_stopping_event = threading.Event() + self.module_host_mgmt_initializer = module_host_mgmt_initializer.ModuleHostMgmtInitializer() + self.poll_obj = None + self.registered_fds = None logger.log_info("Chassis loaded successfully") @@ -344,8 +344,11 @@ def get_all_sfps(self): Returns: A list of objects derived from SfpBase representing all sfps available on this chassis - """ - self.initialize_sfp() + """ + if DeviceDataManager.is_module_host_management_mode(): + self.module_host_mgmt_initializer.initialize(self) + else: + self.initialize_sfp() return self._sfp_list def get_sfp(self, index): @@ -362,7 +365,10 @@ def get_sfp(self, index): An object dervied from SfpBase representing the specified sfp """ index = index - 1 - self.initialize_single_sfp(index) + if DeviceDataManager.is_module_host_management_mode(): + self.module_host_mgmt_initializer.initialize(self) + else: + self.initialize_single_sfp(index) return super(Chassis, self).get_sfp(index) def get_port_or_cage_type(self, index): @@ -412,42 +418,223 @@ def get_change_event(self, timeout=0): indicates that fan 0 has been removed, fan 2 has been inserted and sfp 11 has been removed. """ - if not self.modules_mgmt_thread.is_alive(): - # open new SFP change events thread - self.modules_mgmt_thread = modules_mgmt.ModulesMgmtTask(q=self.modules_changes_queue - , main_thread_stop_event = self.modules_mgmt_task_stopping_event) - # Set the thread as daemon so when pmon/xcvrd are shutting down, modules_mgmt will shut down immedietly. - self.modules_mgmt_thread.daemon = True - self.modules_mgmt_thread.start() - self.initialize_sfp() - wait_for_ever = (timeout == 0) + if DeviceDataManager.is_module_host_management_mode(): + self.module_host_mgmt_initializer.initialize(self) + return self.get_change_event_for_module_host_management_mode(timeout) + else: + self.initialize_sfp() + return self.get_change_event_legacy(timeout) + + def get_change_event_for_module_host_management_mode(self, timeout): + """Get SFP change event when module host management mode is enabled. + + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + + Returns: + (bool, dict): + - True if call successful, False if not; - Deprecated, will always return True + - A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, + where device_id is the device ID for this device and + device_event, + status='1' represents device inserted, + status='0' represents device removed. + Ex. {'fan':{'0':'0', '2':'1'}, 'sfp':{'11':'0'}} + indicates that fan 0 has been removed, fan 2 + has been inserted and sfp 11 has been removed. + """ + if not self.poll_obj: + self.poll_obj = select.poll() + self.registered_fds = {} + for s in self._sfp_list: + fds = s.get_fds_for_poling() + for fd_type, fd in fds.items(): + self.poll_obj.register(fd, select.POLLERR | select.POLLPRI) + self.registered_fds[fd.fileno()] = (s.sdk_index, fd, fd_type) + + logger.log_debug(f'Registered SFP file descriptors for polling: {self.registered_fds}') + + from . import sfp + + wait_forever = (timeout == 0) + # poll timeout should be no more than 1000ms to ensure fast shutdown flow + timeout = 1000.0 if timeout >= 1000 else float(timeout) + port_dict = {} + error_dict = {} + begin = time.time() + wait_ready_task = sfp.SFP.get_wait_ready_task() + + while True: + fds_events = self.poll_obj.poll(timeout) + for fileno, _ in fds_events: + if fileno not in self.registered_fds: + logger.log_error(f'Unknown file no {fileno} from poll event, registered files are {self.registered_fds}') + continue + + sfp_index, fd, fd_type = self.registered_fds[fileno] + s = self._sfp_list[sfp_index] + fd.seek(0) + fd_value = int(fd.read().strip()) + + # Detecting dummy event + if s.is_dummy_event(fd_type, fd_value): + # Ignore dummy event for the first poll, assume SDK only provide 1 dummy event + logger.log_debug(f'Ignore dummy event {fd_type}:{fd_value} for SFP {sfp_index}') + continue + + logger.log_notice(f'Got SFP event: index={sfp_index}, type={fd_type}, value={fd_value}') + if fd_type == 'hw_present': + # event could be EVENT_NOT_PRESENT or EVENT_PRESENT + event = sfp.EVENT_NOT_PRESENT if fd_value == 0 else sfp.EVENT_PRESENT + s.on_event(event) + elif fd_type == 'present': + if str(fd_value) == sfp.SFP_STATUS_ERROR: + # FW control cable got an error, no need trigger state machine + sfp_status, error_desc = s.get_error_info_from_sdk_error_type() + port_dict[sfp_index + 1] = sfp_status + if error_desc: + error_dict[sfp_index + 1] = error_desc + continue + elif str(fd_value) == sfp.SFP_STATUS_INSERTED: + # FW control cable got present, only case is that the cable is recovering + # from an error. FW control cable has no transition from "Not Present" to "Present" + # because "Not Present" cable is always "software control" and should always poll + # hw_present sysfs instead of present sysfs. + port_dict[sfp_index + 1] = sfp.SFP_STATUS_INSERTED + continue + else: + s.on_event(sfp.EVENT_NOT_PRESENT) + else: + # event could be EVENT_POWER_GOOD or EVENT_POWER_BAD + event = sfp.EVENT_POWER_BAD if fd_value == 0 else sfp.EVENT_POWER_GOOD + s.on_event(event) + + if s.in_stable_state(): + s.fill_change_event(port_dict) + s.refresh_poll_obj(self.poll_obj, self.registered_fds) + else: + logger.log_debug(f'SFP {sfp_index} does not reach stable state, state={s.state}') + + ready_sfp_set = wait_ready_task.get_ready_set() + for sfp_index in ready_sfp_set: + s = self._sfp_list[sfp_index] + s.on_event(sfp.EVENT_RESET_DONE) + if s.in_stable_state(): + s.fill_change_event(port_dict) + s.refresh_poll_obj(self.poll_obj, self.registered_fds) + else: + logger.log_error(f'SFP {sfp_index} failed to reach stable state, state={s.state}') + + if port_dict: + logger.log_notice(f'Sending SFP change event: {port_dict}, error event: {error_dict}') + self.reinit_sfps(port_dict) + return True, { + 'sfp': port_dict, + 'sfp_error': error_dict + } + else: + if not wait_forever: + elapse = time.time() - begin + if elapse * 1000 >= timeout: + return True, {'sfp': {}} + + def get_change_event_legacy(self, timeout): + """Get SFP change event when module host management is disabled. + + Args: + timeout (int): polling timeout in ms + + Returns: + (bool, dict): + - True if call successful, False if not; - Deprecated, will always return True + - A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, + where device_id is the device ID for this device and + device_event, + status='1' represents device inserted, + status='0' represents device removed. + Ex. {'fan':{'0':'0', '2':'1'}, 'sfp':{'11':'0'}} + indicates that fan 0 has been removed, fan 2 + has been inserted and sfp 11 has been removed. + """ + if not self.poll_obj: + self.poll_obj = select.poll() + self.registered_fds = {} + # SDK always sent event for the first time polling. Such event should not be sent to xcvrd. + # Store SFP state before first time polling so that we can detect dummy event. + self.sfp_states_before_first_poll = {} + for s in self._sfp_list: + fd = s.get_fd_for_polling_legacy() + self.poll_obj.register(fd, select.POLLERR | select.POLLPRI) + self.registered_fds[fd.fileno()] = (s.sdk_index, fd) + self.sfp_states_before_first_poll[s.sdk_index] = s.get_module_status() + + logger.log_debug(f'Registered SFP file descriptors for polling: {self.registered_fds}') + + from . import sfp + + wait_forever = (timeout == 0) # poll timeout should be no more than 1000ms to ensure fast shutdown flow timeout = 1000.0 if timeout >= 1000 else float(timeout) port_dict = {} error_dict = {} begin = time.time() - i = 0 + while True: - try: - logger.log_info(f'get_change_event() trying to get changes from queue on iteration {i}') - port_dict = self.modules_changes_queue.get(timeout=timeout / 1000) - logger.log_info(f'get_change_event() iteration {i} port_dict: {port_dict}') - except queue.Empty: - logger.log_info(f"failed to get item from modules changes queue on itertaion {i}") + fds_events = self.poll_obj.poll(timeout) + for fileno, _ in fds_events: + if fileno not in self.registered_fds: + logger.log_error(f'Unknown file no {fileno} from poll event, registered files are {self.registered_fds}') + continue + + sfp_index, fd = self.registered_fds[fileno] + fd.seek(0) + fd.read() + s = self._sfp_list[sfp_index] + sfp_status = s.get_module_status() + + if sfp_index in self.sfp_states_before_first_poll: + # Detecting dummy event + sfp_state_before_poll = self.sfp_states_before_first_poll[sfp_index] + self.sfp_states_before_first_poll.pop(sfp_index) + if sfp_state_before_poll == sfp_status: + # Ignore dummy event for the first poll, assume SDK only provide 1 dummy event + logger.log_debug(f'Ignore dummy event {sfp_status} for SFP {sfp_index}') + continue + + logger.log_notice(f'Got SFP event: index={sfp_index}, value={sfp_status}') + if sfp_status == sfp.SFP_STATUS_UNKNOWN: + # in the following sequence, STATUS_UNKNOWN can be returned. + # so we shouldn't raise exception here. + # 1. some sfp module is inserted + # 2. sfp_event gets stuck and fails to fetch the change event instantaneously + # 3. and then the sfp module is removed + # 4. sfp_event starts to try fetching the change event + logger.log_notice("unknown module state, maybe the port suffers two adjacent insertion/removal") + continue + + if sfp_status == sfp.SFP_STATUS_ERROR: + sfp_status, error_desc = s.get_error_info_from_sdk_error_type() + if error_desc: + error_dict[sfp_index + 1] = error_desc + port_dict[sfp_index + 1] = sfp_status if port_dict: + logger.log_notice(f'Sending SFP change event: {port_dict}, error event: {error_dict}') self.reinit_sfps(port_dict) - result_dict = {'sfp': port_dict} - result_dict['sfp_error'] = error_dict - return True, result_dict + return True, { + 'sfp': port_dict, + 'sfp_error': error_dict + } else: - if not wait_for_ever: + if not wait_forever: elapse = time.time() - begin - logger.log_info(f"get_change_event: wait_for_ever {wait_for_ever} elapse {elapse} iteartion {i}") if elapse * 1000 >= timeout: - logger.log_info(f"elapse {elapse} > timeout {timeout} iteartion {i} returning empty dict") return True, {'sfp': {}} - i += 1 def reinit_sfps(self, port_dict): """ @@ -457,7 +644,7 @@ def reinit_sfps(self, port_dict): """ from . import sfp for index, status in port_dict.items(): - if status == sfp.SFP_STATUS_INSERTED: + if status == sfp.SFP_STATUS_REMOVED: try: self._sfp_list[int(index) - 1].reinit() except Exception as e: diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py index b3b07657382b..d6f846a30e7a 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -258,7 +258,7 @@ def get_cpld_component_list(cls): @classmethod @utils.read_only_cache() - def is_independent_mode(cls): + def is_module_host_management_mode(cls): from sonic_py_common import device_info _, hwsku_dir = device_info.get_paths_to_platform_and_hwsku_dirs() sai_profile_file = os.path.join(hwsku_dir, 'sai.profile') @@ -274,7 +274,7 @@ def wait_platform_ready(cls): """ conditions = [] sysfs_nodes = ['power_mode', 'power_mode_policy', 'present', 'reset', 'status', 'statuserror'] - if cls.is_independent_mode(): + if cls.is_module_host_management_mode(): sysfs_nodes.extend(['control', 'frequency', 'frequency_support', 'hw_present', 'hw_reset', 'power_good', 'power_limit', 'power_on', 'temperature/input']) else: diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/module_host_mgmt_initializer.py b/platform/mellanox/mlnx-platform-api/sonic_platform/module_host_mgmt_initializer.py new file mode 100644 index 000000000000..d9bec65987e0 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/module_host_mgmt_initializer.py @@ -0,0 +1,128 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from . import utils +from sonic_py_common.logger import Logger + +import atexit +import os +import sys +import threading + +MODULE_READY_MAX_WAIT_TIME = 300 +MODULE_READY_CHECK_INTERVAL = 5 +MODULE_READY_CONTAINER_FILE = '/tmp/module_host_mgmt_ready' +MODULE_READY_HOST_FILE = '/tmp/nv-syncd-shared/module_host_mgmt_ready' +DEDICATE_INIT_DAEMON = 'xcvrd' +initialization_owner = False + +logger = Logger() + + +class ModuleHostMgmtInitializer: + """Responsible for initializing modules for host management mode. + """ + def __init__(self): + self.initialized = False + self.lock = threading.Lock() + + def initialize(self, chassis): + """Initialize all modules. Only applicable for module host management mode. + The real initialization job shall only be done in xcvrd. Only 1 owner is allowed + to to the initialization. Other daemon/CLI shall wait for the initialization done. + + Args: + chassis (object): chassis object + """ + global initialization_owner + if self.initialized: + return + + if utils.is_host(): + self.wait_module_ready() + chassis.initialize_sfp() + else: + if self.is_initialization_owner(): + if not self.initialized: + with self.lock: + if not self.initialized: + logger.log_notice('Starting module initialization for module host management...') + initialization_owner = True + self.remove_module_ready_file() + + chassis.initialize_sfp() + + from .sfp import SFP + SFP.initialize_sfp_modules(chassis._sfp_list) + + self.create_module_ready_file() + self.initialized = True + logger.log_notice('Module initialization for module host management done') + else: + self.wait_module_ready() + chassis.initialize_sfp() + + @classmethod + def create_module_ready_file(cls): + """Create module ready file + """ + with open(MODULE_READY_CONTAINER_FILE, 'w'): + pass + + @classmethod + def remove_module_ready_file(cls): + """Remove module ready file + """ + if os.path.exists(MODULE_READY_CONTAINER_FILE): + os.remove(MODULE_READY_CONTAINER_FILE) + + def wait_module_ready(self): + """Wait up to MODULE_READY_MAX_WAIT_TIME seconds for all modules to be ready + """ + if utils.is_host(): + module_ready_file = MODULE_READY_HOST_FILE + else: + module_ready_file = MODULE_READY_CONTAINER_FILE + + if os.path.exists(module_ready_file): + self.initialized = True + return + else: + print('Waiting module to be initialized...') + + if utils.wait_until(os.path.exists, MODULE_READY_MAX_WAIT_TIME, MODULE_READY_CHECK_INTERVAL, module_ready_file): + self.initialized = True + else: + logger.log_error('Module initialization timeout', True) + + def is_initialization_owner(self): + """Indicate whether current thread is the owner of doing module initialization + + Returns: + bool: True if current thread is the owner + """ + cmd = os.path.basename(sys.argv[0]) + return DEDICATE_INIT_DAEMON in cmd + +@atexit.register +def clean_up(): + """Remove module ready file when program exits. + When module host management is enabled, xcvrd is the dependency for all other + daemon/CLI who potentially uses SFP API. + """ + if initialization_owner: + ModuleHostMgmtInitializer.remove_module_ready_file() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py b/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py deleted file mode 100644 index b8d99ca1f429..000000000000 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/modules_mgmt.py +++ /dev/null @@ -1,783 +0,0 @@ -# -# Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. -# Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import threading -import time -import queue -import os -import select -import traceback - -try: - from sonic_py_common.logger import Logger - from sonic_py_common import device_info, multi_asic - from .device_data import DeviceDataManager - from sonic_platform_base.sonic_xcvr.fields import consts - from sonic_platform_base.sonic_xcvr.api.public import cmis - from . import sfp as sfp_module - from . import utils - from swsscommon.swsscommon import SonicV2Connector -except ImportError as e: - raise ImportError (str(e) + "- required module not found") - -# Global logger class instance -logger = Logger() - -STATE_HW_NOT_PRESENT = "Initial state. module is not plugged to cage." -STATE_HW_PRESENT = "Module is plugged to cage" -STATE_MODULE_AVAILABLE = "Module hw present and power is good" -STATE_POWERED = "Module power is already loaded" -STATE_NOT_POWERED = "Module power is not loaded" -STATE_FW_CONTROL = "The module is not CMIS and FW needs to handle" -STATE_SW_CONTROL = "The module is CMIS and SW needs to handle" -STATE_ERROR_HANDLER = "An error occurred - read/write error, power limit or power cap." -STATE_POWER_LIMIT_ERROR = "The cage has not enough power for the plugged module" -STATE_SYSFS_ERROR = "An error occurred while writing/reading SySFS." - -SAI_PROFILE_FILE = "/{}/sai.profile" -SAI_INDEP_MODULE_MODE = "SAI_INDEPENDENT_MODULE_MODE" -SAI_INDEP_MODULE_MODE_DELIMITER = "=" -SAI_INDEP_MODULE_MODE_TRUE_STR = "1" -SYSFS_LEGACY_FD_PRESENCE = "/sys/module/sx_core/asic0/module{}/present" -ASIC_NUM = 0 -SYSFS_INDEPENDENT_FD_PREFIX_WO_MODULE = "/sys/module/sx_core/asic{}".format(ASIC_NUM) -SYSFS_INDEPENDENT_FD_PREFIX = SYSFS_INDEPENDENT_FD_PREFIX_WO_MODULE + "/module{}" -SYSFS_INDEPENDENT_FD_PRESENCE = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "hw_present") -SYSFS_INDEPENDENT_FD_POWER_GOOD = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "power_good") -SYSFS_INDEPENDENT_FD_POWER_ON = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "power_on") -SYSFS_INDEPENDENT_FD_HW_RESET = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "hw_reset") -SYSFS_INDEPENDENT_FD_POWER_LIMIT = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "power_limit") -SYSFS_INDEPENDENT_FD_FW_CONTROL = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "control") -# echo /sys/module/sx_core/$asic/$module/frequency // val: 0 - up to 400KHz, 1 - up to 1MHz -SYSFS_INDEPENDENT_FD_FREQ = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "frequency") -SYSFS_INDEPENDENT_FD_FREQ_SUPPORT = os.path.join(SYSFS_INDEPENDENT_FD_PREFIX, "frequency_support") -IS_INDEPENDENT_MODULE = 'is_independent_module' -PROC_CMDLINE = "/proc/cmdline" -CMDLINE_STR_TO_LOOK_FOR = 'SONIC_BOOT_TYPE=' -CMDLINE_VAL_TO_LOOK_FOR = 'fastfast' - -MAX_EEPROM_ERROR_RESET_RETRIES = 4 - - -class ModulesMgmtTask(threading.Thread): - - def __init__(self, namespaces=None, main_thread_stop_event=None, q=None): - threading.Thread.__init__(self) - self.name = "ModulesMgmtTask" - self.main_thread_stop_event = main_thread_stop_event - self.sfp_port_dict_initial = {} - self.sfp_port_dict = {} - self.sfp_changes_dict = {} - self.sfp_delete_list_from_port_dict = [] - self.namespaces = namespaces - self.modules_changes_queue = q - self.is_supported_indep_mods_system = False - self.modules_lock_list = [] - # A set to hold those modules waiting 3 seconds since power on and hw reset - self.waiting_modules_list = set() - self.timer = threading.Thread() - self.poll_obj = None - self.fds_mapping_to_obj = {} - self.port_to_fds = {} - self.fds_events_count_dict = {} - self.delete_ports_and_reset_states_dict = {} - self.setName("ModulesMgmtTask") - self.register_hw_present_fds = [] - self.is_warm_reboot = False - self.port_control_dict = {} - - # SFPs state machine - def get_sm_func(self, sm, port): - SFP_SM_ENUM = {STATE_HW_NOT_PRESENT: self.check_if_hw_present - , STATE_HW_PRESENT: self.check_if_power_on - , STATE_NOT_POWERED: self.power_on_module - , STATE_POWERED: self.check_if_module_available - , STATE_MODULE_AVAILABLE: self.check_module_type - , STATE_FW_CONTROL: self.save_module_control_mode - , STATE_SW_CONTROL: self.save_module_control_mode - , STATE_ERROR_HANDLER: STATE_ERROR_HANDLER - , STATE_POWER_LIMIT_ERROR: STATE_POWER_LIMIT_ERROR - , STATE_SYSFS_ERROR: STATE_SYSFS_ERROR - } - logger.log_debug("getting state machine func for state {} for port {}".format(sm, port)) - try: - func = SFP_SM_ENUM[sm] - logger.log_debug("got state machine func {} for state {} for port {}".format(func, sm, port)) - return func - except KeyError as e: - logger.log_error("exception {} for port {} sm {}".format(e, port, sm)) - return None - - def run(self): - # check first if the system supports independent mode and set boolean accordingly - (platform_path, hwsku_dir) = device_info.get_paths_to_platform_and_hwsku_dirs() - logger.log_info("hwsku_dir {} found, continue to check sai.profile file".format(hwsku_dir)) - independent_file = SAI_PROFILE_FILE.format(hwsku_dir) - if os.path.isfile(independent_file): - logger.log_info("file {} found, checking content for independent mode value".format(independent_file)) - with open(independent_file, "r") as independent_file_fd: - found = False - independent_file_content = ' ' - logger.log_info("file {} found, checking content for independent mode value".format(independent_file)) - while independent_file_content and not found: - independent_file_content = independent_file_fd.readline() - if SAI_INDEP_MODULE_MODE in independent_file_content and \ - SAI_INDEP_MODULE_MODE_DELIMITER in independent_file_content: - independent_file_splitted = independent_file_content.split(SAI_INDEP_MODULE_MODE_DELIMITER) - if (len(independent_file_splitted) > 1): - self.is_supported_indep_mods_system = int(independent_file_splitted[1]) == int(SAI_INDEP_MODULE_MODE_TRUE_STR) - logger.log_notice(f"{SAI_INDEP_MODULE_MODE}={SAI_INDEP_MODULE_MODE_TRUE_STR} in file {independent_file}, \ - module host management mode is enabled") - found = True - else: - logger.log_notice("module host management mode is disabled".format(independent_file)) - - # static init - at first go over all ports and check each one if it's independent module or legacy - self.sfp_changes_dict = {} - # check for each port if the module connected and if it supports independent mode or legacy - num_of_ports = DeviceDataManager.get_sfp_count() - # create the modules sysfs fds poller - self.poll_obj = select.poll() - # read cmdline to check if warm reboot done. cannot use swsscommon warmstart since this code runs after - # warm-reboot is finished. if done, need to read control sysfs per port and act accordingly since modules are - # not reset in warm-reboot - cmdline_dict = {} - proc_cmdline_str = utils.read_str_from_file(PROC_CMDLINE) - if CMDLINE_STR_TO_LOOK_FOR in proc_cmdline_str: - cmdline_dict[CMDLINE_STR_TO_LOOK_FOR] = proc_cmdline_str.split(CMDLINE_STR_TO_LOOK_FOR)[1] - if CMDLINE_STR_TO_LOOK_FOR in cmdline_dict.keys(): - self.is_warm_reboot = cmdline_dict[CMDLINE_STR_TO_LOOK_FOR] == CMDLINE_VAL_TO_LOOK_FOR - logger.log_info(f"system was warm rebooted is_warm_reboot: {self.is_warm_reboot}") - for port in range(num_of_ports): - # check sysfs per port whether it's independent mode or legacy - temp_module_sm = ModuleStateMachine(port_num=port, initial_state=STATE_HW_NOT_PRESENT - , current_state=STATE_HW_NOT_PRESENT) - module_fd_indep_path = SYSFS_INDEPENDENT_FD_PRESENCE.format(port) - logger.log_info("system in indep mode: {} port {}".format(self.is_supported_indep_mods_system, port)) - if self.is_warm_reboot: - logger.log_info("system was warm rebooted is_warm_reboot: {} trying to read control sysfs for port {}" - .format(self.is_warm_reboot, port)) - port_control_file = SYSFS_INDEPENDENT_FD_FW_CONTROL.format(port) - try: - port_control = utils.read_int_from_file(port_control_file, raise_exception=True) - self.port_control_dict[port] = port_control - logger.log_info(f"port control sysfs is {port_control} for port {port}") - except Exception as e: - logger.log_error("exception {} for port {} trying to read port control sysfs {}" - .format(e, port, port_control_file)) - if (self.is_supported_indep_mods_system and os.path.isfile(module_fd_indep_path)) \ - and not (self.is_warm_reboot and 0 == port_control): - logger.log_info("system in indep mode: {} port {} reading file {}".format(self.is_supported_indep_mods_system, port, module_fd_indep_path)) - temp_module_sm.set_is_indep_modules(True) - temp_module_sm.set_module_fd_path(module_fd_indep_path) - module_fd = open(module_fd_indep_path, "r") - temp_module_sm.set_module_fd(module_fd) - else: - module_fd_legacy_path = self.get_sysfs_ethernet_port_fd(SYSFS_LEGACY_FD_PRESENCE, port) - temp_module_sm.set_module_fd_path(module_fd_legacy_path) - module_fd = open(module_fd_legacy_path, "r") - temp_module_sm.set_module_fd(module_fd) - # add lock to use with timer task updating next state per module object - self.modules_lock_list.append(threading.Lock()) - # start SM for this independent module - logger.log_debug("adding temp_module_sm {} to sfp_port_dict".format(temp_module_sm)) - self.sfp_port_dict_initial[port] = temp_module_sm - self.sfp_port_dict[port] = temp_module_sm - - i = 0 - # need at least 1 module in final state until it makes sense to send changes dict - is_final_state_module = False - all_static_detection_done = False - logger.log_debug(f"sfp_port_dict before starting static detection: {self.sfp_port_dict} main_thread_stop_event: " - f"{self.main_thread_stop_event.is_set()} all_static_detection_done: {all_static_detection_done}") - # static detection - loop on different state for all ports until all done - while not self.main_thread_stop_event.is_set() and not all_static_detection_done: - logger.log_debug("static detection running iteration {}".format(i)) - waiting_list_len = len(self.waiting_modules_list) - sfp_port_dict_keys_len = len(self.sfp_port_dict.keys()) - if waiting_list_len == sfp_port_dict_keys_len: - logger.log_debug("static detection length of waiting list {}: {} and sfp port dict keys {}:{} is the same, sleeping 1 second..." - .format(waiting_list_len, self.waiting_modules_list, sfp_port_dict_keys_len, self.sfp_port_dict.keys())) - time.sleep(1) - else: - logger.log_debug("static detection length of waiting list {}: {} and sfp port dict keys {}: {} is different, NOT sleeping 1 second" - .format(waiting_list_len, self.waiting_modules_list, sfp_port_dict_keys_len, self.sfp_port_dict.keys())) - for port_num, module_sm_obj in self.sfp_port_dict.items(): - curr_state = module_sm_obj.get_current_state() - logger.log_debug(f'static detection STATE_LOG {port_num}: curr_state is {curr_state}') - func = self.get_sm_func(curr_state, port_num) - logger.log_debug("static detection got returned func {} for state {}".format(func, curr_state)) - try: - if not isinstance(func, str): - if func is not None: - next_state = func(port_num, module_sm_obj) - except TypeError as e: - logger.log_error("static detection exception {} for port {} traceback:\n{}".format(e, port_num, traceback.format_exc())) - module_sm_obj.set_final_state(STATE_ERROR_HANDLER) - continue - logger.log_debug(f'static detection STATE_LOG {port_num}: next_state is {next_state}') - if self.timer.is_alive(): - logger.log_debug("static detection timer threads is alive, acquiring lock") - self.modules_lock_list[port_num].acquire() - # for STATE_NOT_POWERED we dont advance to next state, timerTask is doing it into STATE_POWERED - if curr_state != STATE_NOT_POWERED or not module_sm_obj.wait_for_power_on: - module_sm_obj.set_next_state(next_state) - module_sm_obj.advance_state() - if module_sm_obj.get_final_state(): - logger.log_info(f'static detection STATE_LOG {port_num}: enter final state {module_sm_obj.get_final_state()}') - is_final_state_module = True - if self.timer.is_alive(): - self.modules_lock_list[port_num].release() - is_timer_alive = self.timer.is_alive() - logger.log_debug("static detection timer thread is_alive {} port {}".format(is_timer_alive, port_num)) - if STATE_NOT_POWERED == curr_state: - if not is_timer_alive: - logger.log_debug ("static detection curr_state is {} and timer thread is_alive {}, running timer task thread" - .format(curr_state, is_timer_alive)) - # call timer task - self.timer = threading.Timer(1.0, self.timerTask) - self.timer.start() - if self.timer.is_alive(): - logger.log_debug("timer thread is_alive {}, locking module obj".format(self.timer.is_alive())) - self.modules_lock_list[port_num].acquire() - module_sm_obj.set_next_state(next_state) - if self.timer.is_alive(): - logger.log_debug("timer thread is_alive {}, releasing module obj".format(self.timer.is_alive())) - self.modules_lock_list[port_num].release() - - if is_final_state_module: - self.map_ports_final_state() - self.delete_ports_from_dict() - self.send_changes_to_shared_queue() - self.register_presece_closed_ports(False, self.register_hw_present_fds) - i += 1 - self.register_hw_present_fds = [] - logger.log_debug("sfp_port_dict: {}".format(self.sfp_port_dict)) - for port_num, module_sm_obj in self.sfp_port_dict.items(): - logger.log_debug("static detection port_num: {} initial state: {} current_state: {} next_state: {}" - .format(port_num, module_sm_obj.initial_state, module_sm_obj.get_current_state() - , module_sm_obj.get_next_state())) - sfp_port_dict_keys_len = len(self.sfp_port_dict.keys()) - if sfp_port_dict_keys_len == 0: - logger.log_notice('All ports have been initialized, static detection is done') - all_static_detection_done = True - else: - logger.log_info("Continue static detection, pending ports number: {}".format(sfp_port_dict_keys_len)) - - logger.log_debug(f"sfp_port_dict before dynamic detection: {self.sfp_port_dict} " - f"main_thread_stop_event.is_set(): {self.main_thread_stop_event.is_set()}") - # dynamic detection - loop on polling changes, run state machine for them and put them into shared queue - i = 0 - # need at least 1 module in final state until it makes sense to send changes dict - is_final_state_module = False - # initialize fds events count to 0 - for fd_fileno in self.fds_mapping_to_obj: - module_obj = self.fds_mapping_to_obj[fd_fileno]['module_obj'] - # for debug purposes - self.fds_events_count_dict[module_obj.port_num] = { 'presence' : 0 , 'power_good' : 0 } - while not self.main_thread_stop_event.is_set(): - logger.log_debug("dynamic detection running iteration {}".format(i)) - # poll for changes with 1 second timeout - fds_events = self.poll_obj.poll(1000) - logger.log_debug("dynamic detection polled obj checking fds_events iteration {}".format(i)) - for fd, event in fds_events: - # get modules object from fd according to saved key-value of fd-module obj saved earlier - logger.log_info("dynamic detection working on fd {} event {}".format(fd, event)) - module_obj = self.fds_mapping_to_obj[fd]['module_obj'] - module_fd = self.fds_mapping_to_obj[fd]['fd'] - fd_name = self.fds_mapping_to_obj[fd]['fd_name'] - if 'presence' == fd_name: - module_fd_path = module_obj.module_fd_path - elif 'power_good' == fd_name: - module_fd_path = module_obj.module_power_good_fd_path - self.fds_events_count_dict[module_obj.port_num][fd_name] += 1 - try: - module_fd.seek(0) - val = module_fd.read().strip() - logger.log_info("dynamic detection got module_obj {} with port {} from fd number {} path {} val {} count {}" - .format(module_obj, module_obj.port_num, fd, module_fd_path - , val, self.fds_events_count_dict[module_obj.port_num])) - if self.is_dummy_event(int(val), module_obj): - logger.log_info(f"dynamic detection dummy event port {module_obj.port_num} from fd number {fd}") - continue - if module_obj.port_num not in self.sfp_port_dict.keys(): - logger.log_info("dynamic detection port {} not found in sfp_port_dict keys: {} adding it" - .format(module_obj.port_num, self.sfp_port_dict.keys())) - self.deregister_fd_from_polling(module_obj.port_num) - # put again module obj in sfp_port_dict so next loop will work on it - self.sfp_port_dict[module_obj.port_num] = module_obj - self.delete_ports_and_reset_states_dict[module_obj.port_num] = val - except Exception as e: - logger.log_error("dynamic detection exception on read presence {} for port {} fd name {} traceback:\n{}" - .format(e, module_obj.port_num, module_fd.name, traceback.format_exc())) - for port, val in self.delete_ports_and_reset_states_dict.items(): - logger.log_info(f"dynamic detection resetting all states for port {port} close_presence_ports {val}") - module_obj = self.sfp_port_dict[port] - module_obj.reset_all_states(close_presence_ports=val) - self.delete_ports_and_reset_states_dict = {} - for port_num, module_sm_obj in self.sfp_port_dict.items(): - curr_state = module_sm_obj.get_current_state() - logger.log_debug(f'dynamic detection STATE_LOG {port_num}: curr_state is {curr_state}') - func = self.get_sm_func(curr_state, port) - logger.log_debug("dynamic detection got returned func {} for state {}".format(func, curr_state)) - try: - if func is not None: - next_state = func(port_num, module_sm_obj, dynamic=True) - except TypeError as e: - logger.log_error("exception {} for port {}".format(e, port_num)) - continue - logger.log_debug(f'dynamic detection STATE_LOG {port_num}: next_state is {next_state}') - if self.timer.is_alive(): - logger.log_debug("dynamic detection timer threads is alive, acquiring lock") - self.modules_lock_list[port_num].acquire() - if curr_state != STATE_NOT_POWERED or not module_sm_obj.wait_for_power_on: - module_sm_obj.set_next_state(next_state) - module_sm_obj.advance_state() - if module_sm_obj.get_final_state(): - logger.log_info(f'dynamic detection STATE_LOG {port_num}: enter final state {module_sm_obj.get_final_state()}') - is_final_state_module = True - if self.timer.is_alive(): - self.modules_lock_list[port_num].release() - is_timer_alive = self.timer.is_alive() - logger.log_debug("dynamic detection timer thread is_alive {} port {}".format(is_timer_alive, port_num)) - if STATE_NOT_POWERED == curr_state: - if not is_timer_alive: - logger.log_debug("dynamic detection curr_state is {} and timer thread is_alive {}, running timer task thread" - .format(curr_state, is_timer_alive)) - # call timer task - self.timer = threading.Timer(1.0, self.timerTask) - self.timer.start() - if self.timer.is_alive(): - logger.log_debug("dynamic detection timer thread is_alive {}, locking module obj".format(self.timer.is_alive())) - self.modules_lock_list[port_num].acquire() - module_sm_obj.set_next_state(next_state) - if self.timer.is_alive(): - logger.log_debug( - "dynamic detection timer thread is_alive {}, releasing module obj".format(self.timer.is_alive())) - self.modules_lock_list[port_num].release() - - if is_final_state_module: - self.map_ports_final_state(dynamic=True) - self.delete_ports_from_dict(dynamic=True) - self.send_changes_to_shared_queue(dynamic=True) - self.register_presece_closed_ports(True, self.register_hw_present_fds) - if not self.sfp_port_dict and is_final_state_module: - is_final_state_module = False - logger.log_debug(f"sft_port_dict is empty {self.sfp_port_dict}, set is_final_state_module to {is_final_state_module}") - self.register_hw_present_fds = [] - i += 1 - logger.log_debug("sfp_port_dict: {}".format(self.sfp_port_dict)) - for port_num, module_sm_obj in self.sfp_port_dict.items(): - logger.log_debug("port_num: {} module_sm_obj initial state: {} current_state: {} next_state: {}" - .format(port_num, module_sm_obj.initial_state, module_sm_obj.get_current_state(), module_sm_obj.get_next_state())) - - def is_dummy_event(self, val, module_sm_obj): - if val == 1: - return module_sm_obj.final_state in (STATE_HW_PRESENT, STATE_SW_CONTROL, STATE_FW_CONTROL) - elif val == 0: - return module_sm_obj.final_state in (STATE_HW_NOT_PRESENT,) - return False - - def check_if_hw_present(self, port, module_sm_obj, dynamic=False): - detection_method = 'dynamic' if dynamic else 'static' - logger.log_debug(f"{detection_method} detection enter check_if_hw_present port {port} module_sm_obj {module_sm_obj}") - module_fd_indep_path = module_sm_obj.module_fd_path - if os.path.isfile(module_fd_indep_path): - try: - val_int = utils.read_int_from_file(module_fd_indep_path) - logger.log_info(f'reading sysfs {module_fd_indep_path} got value {val_int}') - if 0 == val_int: - retval_state = STATE_HW_NOT_PRESENT - module_sm_obj.set_final_state(retval_state, detection_method) - return retval_state - elif 1 == val_int: - retval_state = STATE_HW_PRESENT - if not self.is_supported_indep_mods_system or (self.is_warm_reboot and 0 == self.port_control_dict[port] and not dynamic): - module_sm_obj.set_final_state(retval_state, detection_method) - self.register_fd_for_polling(module_sm_obj, module_sm_obj.module_fd, 'presence') - return retval_state - else: - logger.log_error(f'unexpected value {val_int} from file {module_fd_indep_path}') - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT, detection_method) - return STATE_HW_NOT_PRESENT - except Exception as e: - logger.log_error("exception {} in check_if_hw_present for port {}, setting final state STATE_ERROR_HANDLER".format(e, port)) - module_sm_obj.set_final_state(STATE_ERROR_HANDLER) - return STATE_ERROR_HANDLER - logger.log_error(f'{module_fd_indep_path} does not exists, treat this port as not present') - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT, detection_method) - return STATE_HW_NOT_PRESENT - - def check_if_module_available(self, port, module_sm_obj, dynamic=False): - logger.log_debug("enter check_if_module_available port {} module_sm_obj {}".format(port, module_sm_obj)) - module_fd_indep_path = SYSFS_INDEPENDENT_FD_POWER_GOOD.format(port) - if os.path.isfile(module_fd_indep_path): - try: - # not using utils.read_int_from_file since need to catch the exception here if no such file or it is - # not accesible. utils.read_int_from_file will return 0 in such a case - module_power_good_fd = open(module_fd_indep_path, "r") - val = module_power_good_fd.read() - val_int = int(val) - module_sm_obj.module_power_good_fd_path = module_fd_indep_path - module_sm_obj.module_power_good_fd = module_power_good_fd - logger.log_info(f'reading sysfs {module_fd_indep_path} got value {val_int}') - if 0 == val_int: - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) - return STATE_HW_NOT_PRESENT - elif 1 == val_int: - return STATE_MODULE_AVAILABLE - else: - logger.log_error(f'unexpected value {val_int} from file {module_fd_indep_path}') - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) - return STATE_HW_NOT_PRESENT - except Exception as e: - logger.log_error("exception {} for port {}".format(e, port)) - return STATE_HW_NOT_PRESENT - logger.log_error(f'port {port} has no power good file {module_fd_indep_path}') - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) - return STATE_HW_NOT_PRESENT - - def check_if_power_on(self, port, module_sm_obj, dynamic=False): - logger.log_debug(f'enter check_if_power_on for port {port}') - module_fd_indep_path = SYSFS_INDEPENDENT_FD_POWER_ON.format(port) - if os.path.isfile(module_fd_indep_path): - try: - val_int = utils.read_int_from_file(module_fd_indep_path) - logger.log_info(f'reading sysfs {module_fd_indep_path} got value {val_int}') - if 0 == val_int: - return STATE_NOT_POWERED - elif 1 == val_int: - return STATE_POWERED - else: - logger.log_error(f'unexpected value {val_int} from file {module_fd_indep_path}') - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) - return STATE_HW_NOT_PRESENT - except Exception as e: - logger.log_error(f'check_if_power_on got exception {e}') - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) - return STATE_HW_NOT_PRESENT - logger.log_error(f'port {port} has no power on file {module_fd_indep_path}') - module_sm_obj.set_final_state(STATE_HW_NOT_PRESENT) - return STATE_HW_NOT_PRESENT - - - def power_on_module(self, port, module_sm_obj, dynamic=False): - logger.log_debug(f'enter power_on_module for port {port}') - if not module_sm_obj.wait_for_power_on: - module_fd_indep_path_po = SYSFS_INDEPENDENT_FD_POWER_ON.format(port) - module_fd_indep_path_r = SYSFS_INDEPENDENT_FD_HW_RESET.format(port) - try: - if os.path.isfile(module_fd_indep_path_po): - # echo 1 > /sys/module/sx_core/$asic/$module/power_on - utils.write_file(module_fd_indep_path_po, "1") - logger.log_info(f'write sysfs {module_fd_indep_path_po} with value 1') - if os.path.isfile(module_fd_indep_path_r): - # de-assert hw_reset - low polarity. 1 for de-assert 0 for assert - # echo 1 > /sys/module/sx_core/$asic/$module/hw_reset - utils.write_file(module_fd_indep_path_r, "1") - logger.log_info(f'write sysfs {module_fd_indep_path_r} with value 1') - self.add_port_to_wait_reset(module_sm_obj) - except Exception as e: - logger.log_error("exception in power_on_module {} for port {}".format(e, port)) - return STATE_HW_NOT_PRESENT - return STATE_NOT_POWERED - - def check_module_type(self, port, module_sm_obj, dynamic=False): - logger.log_debug("enter check_module_type port {} module_sm_obj {}".format(port, module_sm_obj)) - sfp = sfp_module.SFP(port) - xcvr_api = sfp.get_xcvr_api() - if not xcvr_api: - logger.log_debug("check_module_type calling sfp reinit for port {} module_sm_obj {}" - .format(port, module_sm_obj)) - sfp.reinit() - logger.log_info("check_module_type setting as FW control as xcvr_api is None for port {} module_sm_obj {}" - .format(port, module_sm_obj)) - return STATE_FW_CONTROL - # QSFP-DD ID is 24, OSFP ID is 25 - only these 2 are supported currently as independent module - SW controlled - if not isinstance(xcvr_api, cmis.CmisApi): - logger.log_info("check_module_type setting STATE_FW_CONTROL for {} in check_module_type port {} module_sm_obj {}" - .format(xcvr_api, port, module_sm_obj)) - return STATE_FW_CONTROL - else: - if xcvr_api.is_flat_memory(): - logger.log_info("check_module_type port {} setting STATE_FW_CONTROL module ID {} due to flat_mem device" - .format(xcvr_api, port)) - return STATE_FW_CONTROL - logger.log_debug("check_module_type checking power cap for {} in check_module_type port {} module_sm_obj {}" - .format(xcvr_api, port, module_sm_obj)) - power_cap = self.check_power_cap(port, module_sm_obj) - if power_cap is STATE_POWER_LIMIT_ERROR: - logger.log_info(f"check_module_type port {port} setting STATE_POWER_LIMIT_ERROR") - module_sm_obj.set_final_state(STATE_POWER_LIMIT_ERROR) - return STATE_POWER_LIMIT_ERROR - else: - # first read the frequency support - if it's 1 then continue, if it's 0 no need to do anything - module_fd_freq_support_path = SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format(port) - val_int = utils.read_int_from_file(module_fd_freq_support_path) - logger.log_info(f'reading sysfs {module_fd_freq_support_path} got value {val_int}') - if 1 == val_int: - # read the module maximum supported clock of Management Comm Interface (MCI) from module EEPROM. - # from byte 2 bits 3-2: - # 00b means module supports up to 400KHz - # 01b means module supports up to 1MHz - logger.log_debug(f"check_module_type reading mci max frequency for port {port}") - read_mci = xcvr_api.xcvr_eeprom.read_raw(2, 1) - logger.log_debug(f"check_module_type read mci max frequency {read_mci} for port {port}") - mci_bits = read_mci & 0b00001100 - logger.log_debug(f"check_module_type read mci max frequency bits {mci_bits} for port {port}") - # Then, set it to frequency Sysfs using: - # echo > /sys/module/sx_core/$asic/$module/frequency // val: 0 - up to 400KHz, 1 - up to 1MHz - indep_fd_freq = SYSFS_INDEPENDENT_FD_FREQ.format(port) - utils.write_file(indep_fd_freq, mci_bits) - logger.log_info(f'write sysfs {indep_fd_freq} with value {mci_bits}') - logger.log_info(f"check_module_type port {port} setting STATE_SW_CONTROL") - return STATE_SW_CONTROL - - def check_power_cap(self, port, module_sm_obj, dynamic=False): - logger.log_debug("enter check_power_cap port {} module_sm_obj {}".format(port, module_sm_obj)) - sfp = sfp_module.SFP(port) - xcvr_api = sfp.get_xcvr_api() - field = xcvr_api.xcvr_eeprom.mem_map.get_field(consts.MAX_POWER_FIELD) - powercap_ba = xcvr_api.xcvr_eeprom.reader(field.get_offset(), field.get_size()) - logger.log_debug("check_power_cap got powercap bytearray {} for port {} module_sm_obj {}".format(powercap_ba, port, module_sm_obj)) - powercap = int.from_bytes(powercap_ba, "big") - logger.log_debug("check_power_cap got powercap {} for port {} module_sm_obj {}".format(powercap, port, module_sm_obj)) - indep_fd_power_limit = self.get_sysfs_ethernet_port_fd(SYSFS_INDEPENDENT_FD_POWER_LIMIT, port) - cage_power_limit = utils.read_int_from_file(indep_fd_power_limit) - logger.log_info(f'reading sysfs {indep_fd_power_limit} got value {cage_power_limit}, power capability from EEPROM is {powercap}') - if powercap > int(cage_power_limit): - logger.log_info("check_power_cap powercap {} != cage_power_limit {} for port {} module_sm_obj {}".format(powercap, cage_power_limit, port, module_sm_obj)) - module_sm_obj.set_final_state(STATE_POWER_LIMIT_ERROR) - return STATE_POWER_LIMIT_ERROR - - def save_module_control_mode(self, port, module_sm_obj, dynamic=False): - detection_method = 'dynamic' if dynamic else 'static' - logger.log_debug("{} detection save_module_control_mode setting current state {} for port {} as final state" - .format(detection_method, module_sm_obj.get_current_state(), port)) - state = module_sm_obj.get_current_state() - module_sm_obj.set_final_state(state) - try: - if state == STATE_FW_CONTROL: - # echo 0 > /sys/module/sx_core/$asic/$module/control - indep_fd_fw_control = SYSFS_INDEPENDENT_FD_FW_CONTROL.format(port) - utils.write_file(indep_fd_fw_control, "0") - logger.log_info(f'write sysfs {indep_fd_fw_control} with value 0') - # update the presence sysfs fd to legacy FD presence, first close the previous fd - module_sm_obj.module_fd.close() - module_fd_legacy_path = SYSFS_LEGACY_FD_PRESENCE.format(port) - module_sm_obj.set_module_fd_path(module_fd_legacy_path) - module_fd = open(module_fd_legacy_path, "r") - module_sm_obj.set_module_fd(module_fd) - logger.log_debug("save_module_control_mode changed module fd to legacy present for port {}".format(port)) - else: - # registering power good sysfs even if not good, so we can get an event from poller upon changes - self.register_fd_for_polling(module_sm_obj, module_sm_obj.module_power_good_fd, 'power_good') - # register the module's sysfs fd to poller with ERR and PRI attrs - logger.log_debug("save_module_control_mode registering sysfs fd {} number {} path {} for port {}" - .format(module_sm_obj.module_fd, module_sm_obj.module_fd.fileno(), module_sm_obj.set_module_fd_path, port)) - except Exception as e: - logger.log_error("{} detection exception on read presence {} for port {} fd name {} traceback:\n{}" - .format(detection_method, e, port, module_sm_obj.module_fd.name, traceback.format_exc())) - self.register_fd_for_polling(module_sm_obj, module_sm_obj.module_fd, 'presence') - logger.log_info("save_module_control_mode set current state {} for port {} as final state {}".format( - module_sm_obj.get_current_state(), port, module_sm_obj.get_final_state())) - - def register_fd_for_polling(self, module_sm_obj, fd, fd_name): - self.fds_mapping_to_obj[fd.fileno()] = {'module_obj' : module_sm_obj, - 'fd': fd, - 'fd_name' : fd_name} - if module_sm_obj.port_num not in self.port_to_fds: - self.port_to_fds[module_sm_obj.port_num] = [fd] - else: - self.port_to_fds[module_sm_obj.port_num].append(fd) - self.poll_obj.register(fd, select.POLLERR | select.POLLPRI) - - def deregister_fd_from_polling(self, port): - if port in self.port_to_fds: - fds = self.port_to_fds[port] - for fd in fds: - self.fds_mapping_to_obj.pop(fd.fileno()) - self.poll_obj.unregister(fd) - self.port_to_fds.pop(port) - - def timerTask(self): # wakes up every 1 second - logger.log_debug("timerTask entered run state") - empty = False - i = 0 - while not empty: - logger.log_debug("timerTask while loop iteration {}".format(i)) - empty = True - port_list_to_delete = [] - for port in self.waiting_modules_list: - logger.log_debug("timerTask working on port {}".format(port)) - empty = False - module = self.sfp_port_dict[port] - logger.log_debug("timerTask got module with port_num {} from port {}".format(module.port_num, port)) - state = module.get_current_state() - if module and state == STATE_NOT_POWERED: - logger.log_debug("timerTask module {} current_state {} counting seconds since reset_start_time" - .format(module, module.get_current_state())) - if time.time() - module.reset_start_time >= 3: - # set next state as STATE_POWERED state to trigger the function of check module type - logger.log_debug("timerTask module port {} locking lock of port {}".format(module.port_num, module.port_num)) - self.modules_lock_list[module.port_num].acquire() - logger.log_info("timerTask module port {} setting next state to STATE_POWERED".format(module.port_num)) - module.set_next_state(STATE_POWERED) - logger.log_debug("timerTask module port {} advancing next state".format(module.port_num)) - module.advance_state() - logger.log_debug("timerTask module port {} releasing lock of port {}".format(port, module.port_num)) - self.modules_lock_list[module.port_num].release() - logger.log_debug("timerTask module port {} adding to delete list to remove from waiting_modules_list".format(module.port_num)) - port_list_to_delete.append(module.port_num) - logger.log_debug("timerTask deleting ports {} from waiting_modules_list...".format(port_list_to_delete)) - for port in port_list_to_delete: - logger.log_debug("timerTask deleting port {} from waiting_modules_list".format(port)) - self.waiting_modules_list.remove(port) - logger.log_debug("timerTask waiting_modules_list after deletion: {}".format(self.waiting_modules_list)) - time.sleep(1) - i += 1 - - def get_sysfs_ethernet_port_fd(self, sysfs_fd, port): - sysfs_eth_port_fd = sysfs_fd.format(port) - return sysfs_eth_port_fd - - def add_port_to_wait_reset(self, module_sm_obj): - module_sm_obj.reset_start_time = time.time() - module_sm_obj.wait_for_power_on = True - self.waiting_modules_list.add(module_sm_obj.port_num) - logger.log_info(f'added port {module_sm_obj.port_num} to wait list with timestamp {module_sm_obj.reset_start_time}') - - def map_ports_final_state(self, dynamic=False): - detection_method = 'dynamic' if dynamic else 'static' - logger.log_debug(f"{detection_method} detection enter map_ports_final_state") - for port, module_obj in self.sfp_port_dict.items(): - final_state = module_obj.get_final_state() - if final_state: - # add port to delete list that we will iterate on later and delete the ports from sfp_port_dict - self.sfp_delete_list_from_port_dict.append(port) - if final_state in [STATE_HW_NOT_PRESENT, STATE_POWER_LIMIT_ERROR, STATE_ERROR_HANDLER]: - port_status = '0' - logger.log_debug(f"{detection_method} detection adding port {port} to register_hw_present_fds") - self.register_hw_present_fds.append(module_obj) - else: - port_status = '1' - self.sfp_changes_dict[str(module_obj.port_num + 1)] = port_status - - def delete_ports_from_dict(self, dynamic=False): - detection_method = 'dynamic' if dynamic else 'static' - logger.log_debug(f"{detection_method} detection sfp_port_dict before deletion: {self.sfp_port_dict}") - for port in self.sfp_delete_list_from_port_dict: - del self.sfp_port_dict[port] - self.sfp_delete_list_from_port_dict = [] - logger.log_debug("{} detection sfp_port_dict after deletion: {}".format(detection_method, self.sfp_port_dict)) - - def send_changes_to_shared_queue(self, dynamic=False): - detection_method = 'dynamic' if dynamic else 'static' - if self.sfp_changes_dict: - logger.log_info(f"{detection_method} detection putting sfp_changes_dict {self.sfp_changes_dict} " - f"in modules changes queue...") - try: - self.modules_changes_queue.put(self.sfp_changes_dict, timeout=1) - self.sfp_changes_dict = {} - logger.log_debug(f"{detection_method} sfp_changes_dict after put changes: {self.sfp_changes_dict}") - except queue.Full: - logger.log_error(f"{detection_method} failed to put item from modules changes queue, queue is full") - else: - logger.log_debug(f"{detection_method} sfp_changes_dict {self.sfp_changes_dict} is empty...") - - def register_presece_closed_ports(self, dynamic=False, module_obj_list=[]): - detection_method = 'dynamic' if dynamic else 'static' - logger.log_debug(f"{detection_method} detection enter register_presence_closed_ports") - for module_obj in module_obj_list: - port = module_obj.port_num - if self.is_supported_indep_mods_system: - module_fd_indep_path = SYSFS_INDEPENDENT_FD_PRESENCE.format(port) - else: - module_fd_indep_path = SYSFS_LEGACY_FD_PRESENCE.format(port) - module_obj.set_module_fd_path(module_fd_indep_path) - module_fd = open(module_fd_indep_path, "r") - module_obj.set_module_fd(module_fd) - logger.log_debug(f"{detection_method} registering fd {module_fd} fd name {module_fd.name} for port {port}") - self.register_fd_for_polling(module_obj, module_fd, 'presence') - -class ModuleStateMachine(object): - - def __init__(self, port_num=0, initial_state=STATE_HW_NOT_PRESENT, current_state=STATE_HW_NOT_PRESENT - , next_state=STATE_HW_NOT_PRESENT, final_state='', is_indep_module=False - , module_fd_path='', module_fd=None, reset_start_time=None - , eeprom_poweron_reset_retries=1, module_power_good_fd_path=None, module_power_good_fd=None): - - self.port_num = port_num - self.initial_state = initial_state - self.current_state = current_state - self.next_state = next_state - self.final_state = final_state - self.is_indep_modules = is_indep_module - self.module_fd_path = module_fd_path - self.module_fd = module_fd - self.reset_start_time = reset_start_time - self.wait_for_power_on = False - self.eeprom_poweron_reset_retries = eeprom_poweron_reset_retries - self.module_power_good_fd_path = module_power_good_fd_path - self.module_power_good_fd = module_power_good_fd - - def set_initial_state(self, state): - self.initial_state = state - - def get_current_state(self): - return self.current_state - - def set_current_state(self, state): - self.current_state = state - - def get_next_state(self): - return self.next_state - - def set_next_state(self, state): - self.next_state = state - - def get_final_state(self): - return self.final_state - - def set_final_state(self, state, detection_method='static'): - logger.log_info(f"{detection_method} set_final_state setting {state} port {self.port_num}") - self.final_state = state - - def advance_state(self): - self.set_current_state(self.next_state) - self.next_state = '' - - def set_is_indep_modules(self, is_indep_modules): - self.is_indep_modules = is_indep_modules - - def set_module_fd_path(self, module_fd_path): - self.module_fd_path = module_fd_path - - def set_module_fd(self, module_fd): - self.module_fd = module_fd - - def reset_all_states(self, def_state=STATE_HW_NOT_PRESENT, retries=1, close_presence_ports='0'): - self.initial_state = def_state - self.current_state = def_state - self.next_state = def_state - self.final_state = '' - self.wait_for_power_on = False - self.eeprom_poweron_reset_retries = retries - if '0' == close_presence_ports: - self.module_fd.close() - if self.module_power_good_fd: - self.module_power_good_fd.close() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index cea8034bb530..35d5904a12fe 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -24,16 +24,18 @@ try: import ctypes + import select import subprocess import os import threading + import time from sonic_py_common.logger import Logger from sonic_py_common.general import check_output_pipe from . import utils from .device_data import DeviceDataManager from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase from sonic_platform_base.sonic_xcvr.fields import consts - from sonic_platform_base.sonic_xcvr.api.public import sff8636, sff8436 + from sonic_platform_base.sonic_xcvr.api.public import cmis, sff8636, sff8436 except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -127,7 +129,44 @@ CPU_MASK = PORT_TYPE_MASK & (PORT_TYPE_CPU << PORT_TYPE_OFFSET) # parameters for SFP presence +SFP_STATUS_REMOVED = '0' SFP_STATUS_INSERTED = '1' +SFP_STATUS_ERROR = '2' +SFP_STATUS_UNKNOWN = '-1' + +# SFP status from PMAOS register +# 0x1 plug in +# 0x2 plug out +# 0x3 plug in with error +# 0x4 disabled, at this status SFP eeprom is not accessible, +# and presence status also will be not present, +# so treate it as plug out. +SDK_SFP_STATE_IN = 0x1 +SDK_SFP_STATE_OUT = 0x2 +SDK_SFP_STATE_ERR = 0x3 +SDK_SFP_STATE_DIS = 0x4 +SDK_SFP_STATE_UNKNOWN = 0x5 + +SDK_STATUS_TO_SONIC_STATUS = { + SDK_SFP_STATE_IN: SFP_STATUS_INSERTED, + SDK_SFP_STATE_OUT: SFP_STATUS_REMOVED, + SDK_SFP_STATE_ERR: SFP_STATUS_ERROR, + SDK_SFP_STATE_DIS: SFP_STATUS_REMOVED, + SDK_SFP_STATE_UNKNOWN: SFP_STATUS_UNKNOWN +} + +# SDK error definitions begin + +# SFP errors that will block eeprom accessing +SDK_SFP_BLOCKING_ERRORS = [ + 0x2, # SFP.SFP_ERROR_BIT_I2C_STUCK, + 0x3, # SFP.SFP_ERROR_BIT_BAD_EEPROM, + 0x5, # SFP.SFP_ERROR_BIT_UNSUPPORTED_CABLE, + 0x6, # SFP.SFP_ERROR_BIT_HIGH_TEMP, + 0x7, # SFP.SFP_ERROR_BIT_BAD_CABLE +] + +# SDK error definitions end # SFP constants SFP_PAGE_SIZE = 256 # page size of page0h @@ -162,6 +201,60 @@ SFP_DEFAULT_TEMP_CRITICAL_THRESHOLD = 80.0 SFP_TEMPERATURE_SCALE = 8.0 +# Module host management definitions begin +SFP_SW_CONTROL = 1 +SFP_FW_CONTROL = 0 + +CMIS_MAX_POWER_OFFSET = 201 + +SFF_POWER_CLASS_MASK = 0xE3 +SFF_POWER_CLASS_MAPPING = { + 0: 1.5, # 1.5W + 64: 2, # 2.0W + 128: 2.5, # 2.5W + 192: 3.5, # 3.5W + 193: 4, # 4.0W + 194: 4.5, # 4.5W + 195: 5 # 5.0W +} +SFF_POWER_CLASS_OFFSET = 129 +SFF_POWER_CLASS_8_INDICATOR = 32 +SFF_POWER_CLASS_8_OFFSET = 107 + +CMIS_MCI_EEPROM_OFFSET = 2 +CMIS_MCI_MASK = 0b00001100 + +STATE_DOWN = 'Down' # Initial state +STATE_INIT = 'Initializing' # Module starts initializing, check module present, also power on the module if need +STATE_RESETTING = 'Resetting' # Module is resetting the firmware +STATE_POWERED_ON = 'Power On' # Module is powered on, module firmware has been loaded, check module power is in good state +STATE_SW_CONTROL = 'Software Control' # Module is under software control +STATE_FW_CONTROL = 'Firmware Control' # Module is under firmware control +STATE_POWER_BAD = 'Power Bad' # Module power_good returns 0 +STATE_POWER_LIMIT_ERROR = 'Exceed Power Limit' # Module power exceeds cage power limit +STATE_NOT_PRESENT = 'Not Present' # Module is not present + +EVENT_START = 'Start' +EVENT_NOT_PRESENT = 'Not Present' +EVENT_RESET = 'Reset' +EVENT_POWER_ON = 'Power On' +EVENT_RESET_DONE = 'Reset Done' +EVENT_POWER_BAD = 'Power Bad' +EVENT_SW_CONTROL = 'Software Control' +EVENT_FW_CONTROL = 'Firmware Control' +EVENT_POWER_LIMIT_EXCEED = 'Power Limit Exceed' +EVENT_POWER_GOOD = 'Power Good' +EVENT_PRESENT = 'Present' + +ACTION_ON_START = 'On Start' +ACTION_ON_RESET = 'On Reset' +ACTION_ON_POWERED = 'On Powered' +ACTION_ON_SW_CONTROL = 'On Software Control' +ACTION_ON_FW_CONTROL = 'On Firmware Control' +ACTION_ON_POWER_LIMIT_ERROR = 'On Power Limit Error' +ACTION_ON_CANCEL_WAIT = 'On Cancel Wait' +# Module host management definitions end + # SFP EEPROM limited bytes limited_eeprom = { SFP_TYPE_CMIS: { @@ -223,6 +316,38 @@ class NvidiaSFPCommon(SfpOptoeBase): sfp_index_to_logical_port_dict = {} sfp_index_to_logical_lock = threading.Lock() + SFP_MLNX_ERROR_DESCRIPTION_LONGRANGE_NON_MLNX_CABLE = 'Long range for non-Mellanox cable or module' + SFP_MLNX_ERROR_DESCRIPTION_ENFORCE_PART_NUMBER_LIST = 'Enforce part number list' + SFP_MLNX_ERROR_DESCRIPTION_PMD_TYPE_NOT_ENABLED = 'PMD type not enabled' + SFP_MLNX_ERROR_DESCRIPTION_PCIE_POWER_SLOT_EXCEEDED = 'PCIE system power slot exceeded' + SFP_MLNX_ERROR_DESCRIPTION_RESERVED = 'Reserved' + + SDK_ERRORS_TO_DESCRIPTION = { + 0x1: SFP_MLNX_ERROR_DESCRIPTION_LONGRANGE_NON_MLNX_CABLE, + 0x4: SFP_MLNX_ERROR_DESCRIPTION_ENFORCE_PART_NUMBER_LIST, + 0x8: SFP_MLNX_ERROR_DESCRIPTION_PMD_TYPE_NOT_ENABLED, + 0xc: SFP_MLNX_ERROR_DESCRIPTION_PCIE_POWER_SLOT_EXCEEDED + } + + SFP_MLNX_ERROR_BIT_LONGRANGE_NON_MLNX_CABLE = 0x00010000 + SFP_MLNX_ERROR_BIT_ENFORCE_PART_NUMBER_LIST = 0x00020000 + SFP_MLNX_ERROR_BIT_PMD_TYPE_NOT_ENABLED = 0x00040000 + SFP_MLNX_ERROR_BIT_PCIE_POWER_SLOT_EXCEEDED = 0x00080000 + SFP_MLNX_ERROR_BIT_RESERVED = 0x80000000 + + SDK_ERRORS_TO_ERROR_BITS = { + 0x0: SfpOptoeBase.SFP_ERROR_BIT_POWER_BUDGET_EXCEEDED, + 0x1: SFP_MLNX_ERROR_BIT_LONGRANGE_NON_MLNX_CABLE, + 0x2: SfpOptoeBase.SFP_ERROR_BIT_I2C_STUCK, + 0x3: SfpOptoeBase.SFP_ERROR_BIT_BAD_EEPROM, + 0x4: SFP_MLNX_ERROR_BIT_ENFORCE_PART_NUMBER_LIST, + 0x5: SfpOptoeBase.SFP_ERROR_BIT_UNSUPPORTED_CABLE, + 0x6: SfpOptoeBase.SFP_ERROR_BIT_HIGH_TEMP, + 0x7: SfpOptoeBase.SFP_ERROR_BIT_BAD_CABLE, + 0x8: SFP_MLNX_ERROR_BIT_PMD_TYPE_NOT_ENABLED, + 0xc: SFP_MLNX_ERROR_BIT_PCIE_POWER_SLOT_EXCEEDED + } + def __init__(self, sfp_index): super(NvidiaSFPCommon, self).__init__() self.index = sfp_index + 1 @@ -251,46 +376,72 @@ def _get_module_info(self, sdk_index): error_type = utils.read_int_from_file(status_error_file_path) return oper_state, error_type + + def get_fd(self, fd_type): + return open(f'/sys/module/sx_core/asic0/module{self.sdk_index}/{fd_type}') + + def get_fd_for_polling_legacy(self): + """Get polling fds for when module host management is disabled + + Returns: + object: file descriptor of present + """ + return self.get_fd('present') + + def get_module_status(self): + """Get value of sysfs status. It could return: + SXD_PMPE_MODULE_STATUS_PLUGGED_ENABLED_E = 0x1, + SXD_PMPE_MODULE_STATUS_UNPLUGGED_E = 0x2, + SXD_PMPE_MODULE_STATUS_MODULE_PLUGGED_ERROR_E = 0x3, + SXD_PMPE_MODULE_STATUS_PLUGGED_DISABLED_E = 0x4, + SXD_PMPE_MODULE_STATUS_UNKNOWN_E = 0x5, + + Returns: + str: sonic status of the module + """ + status = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/status') + return SDK_STATUS_TO_SONIC_STATUS[status] + + def get_error_info_from_sdk_error_type(self): + """Translate SDK error type to SONiC error state and error description. Only calls + when sysfs "present" returns "2". + + Returns: + tuple: (error state, error description) + """ + error_type = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/temperature/statuserror', default=-1) + sfp_state_bits = NvidiaSFPCommon.SDK_ERRORS_TO_ERROR_BITS.get(error_type) + if sfp_state_bits is None: + logger.log_error(f"Unrecognized error {error_type} detected on SFP {self.sdk_index}") + return SFP_STATUS_ERROR, "Unknown error ({})".format(error_type) + + if error_type in SDK_SFP_BLOCKING_ERRORS: + # In SFP at error status case, need to overwrite the sfp_state with the exact error code + sfp_state_bits |= SfpOptoeBase.SFP_ERROR_BIT_BLOCKING + + # An error should be always set along with 'INSERTED' + sfp_state_bits |= SfpOptoeBase.SFP_STATUS_BIT_INSERTED + + # For vendor specific errors, the description should be returned as well + error_description = NvidiaSFPCommon.SDK_ERRORS_TO_DESCRIPTION.get(error_type) + sfp_state = str(sfp_state_bits) + return sfp_state, error_description - @classmethod - def get_sfp_index_to_logical_port(cls, force=False): - if not cls.sfp_index_to_logical_port_dict or force: - config_db = utils.DbUtils.get_db_instance('CONFIG_DB') - port_data = config_db.get_table('PORT') - for key, data in port_data.items(): - if data['index'] not in cls.sfp_index_to_logical_port_dict: - cls.sfp_index_to_logical_port_dict[int(data['index']) - 1] = key - - @classmethod - def get_logical_port_by_sfp_index(cls, sfp_index): - with cls.sfp_index_to_logical_lock: - cls.get_sfp_index_to_logical_port() - logical_port_name = cls.sfp_index_to_logical_port_dict.get(sfp_index) - if not logical_port_name: - cls.get_sfp_index_to_logical_port(force=True) - else: - config_db = utils.DbUtils.get_db_instance('CONFIG_DB') - current_index = int(config_db.get('CONFIG_DB', f'PORT|{logical_port_name}', 'index')) - if current_index != sfp_index: - cls.get_sfp_index_to_logical_port(force=True) - logical_port_name = cls.sfp_index_to_logical_port_dict.get(sfp_index) - return logical_port_name - class SFP(NvidiaSFPCommon): """Platform-specific SFP class""" shared_sdk_handle = None - SFP_MLNX_ERROR_DESCRIPTION_LONGRANGE_NON_MLNX_CABLE = 'Long range for non-Mellanox cable or module' - SFP_MLNX_ERROR_DESCRIPTION_ENFORCE_PART_NUMBER_LIST = 'Enforce part number list' - SFP_MLNX_ERROR_DESCRIPTION_PMD_TYPE_NOT_ENABLED = 'PMD type not enabled' - SFP_MLNX_ERROR_DESCRIPTION_PCIE_POWER_SLOT_EXCEEDED = 'PCIE system power slot exceeded' - SFP_MLNX_ERROR_DESCRIPTION_RESERVED = 'Reserved' - - SFP_MLNX_ERROR_BIT_LONGRANGE_NON_MLNX_CABLE = 0x00010000 - SFP_MLNX_ERROR_BIT_ENFORCE_PART_NUMBER_LIST = 0x00020000 - SFP_MLNX_ERROR_BIT_PMD_TYPE_NOT_ENABLED = 0x00040000 - SFP_MLNX_ERROR_BIT_PCIE_POWER_SLOT_EXCEEDED = 0x00080000 - SFP_MLNX_ERROR_BIT_RESERVED = 0x80000000 + + # Class level state machine object, only applicable for module host management + sm = None + + # Class level wait SFP ready task, the task waits for module to load its firmware after resetting, + # only applicable for module host management + wait_ready_task = None + + # Class level action table which stores the mapping from action name to action function, + # only applicable for module host management + action_table = None def __init__(self, sfp_index, sfp_type=None, slot_id=0, linecard_port_count=0, lc_name=None): super(SFP, self).__init__(sfp_index) @@ -311,6 +462,11 @@ def __init__(self, sfp_index, sfp_type=None, slot_id=0, linecard_port_count=0, l self.slot_id = slot_id self._sfp_type_str = None + # SFP state, only applicable for module host management + self.state = STATE_DOWN + + def __str__(self): + return f'SFP {self.sdk_index}' def reinit(self): """ @@ -318,7 +474,7 @@ def reinit(self): :return: """ self._sfp_type_str = None - self.refresh_xcvr_api() + self._xcvr_api = None def get_presence(self): """ @@ -327,10 +483,6 @@ def get_presence(self): Returns: bool: True if device is present, False if not """ - try: - self.is_sw_control() - except: - return False eeprom_raw = self._read_eeprom(0, 1, log_on_error=False) return eeprom_raw is not None @@ -466,7 +618,7 @@ def get_lpmode(self): if self.is_sw_control(): api = self.get_xcvr_api() return api.get_lpmode() if api else False - elif DeviceDataManager.is_independent_mode(): + elif DeviceDataManager.is_module_host_management_mode(): file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(self.sdk_index) + SFP_SYSFS_POWER_MODE power_mode = utils.read_int_from_file(file_path) return power_mode == POWER_MODE_LOW @@ -673,7 +825,7 @@ def set_lpmode(self, lpmode): # If at some point get_lpmode=desired_lpmode, it will return true. # If after timeout ends, lpmode will not be desired_lpmode, it will return false. return utils.wait_until(check_lpmode, 2, 1, api=api, lpmode=lpmode) - elif DeviceDataManager.is_independent_mode(): + elif DeviceDataManager.is_module_host_management_mode(): # FW control under CMIS host management mode. # Currently, we don't support set LPM under this mode. # Just return False to indicate set Fail @@ -1003,24 +1155,534 @@ def get_xcvr_api(self): return self._xcvr_api def is_sw_control(self): - if not DeviceDataManager.is_independent_mode(): + if not DeviceDataManager.is_module_host_management_mode(): return False - - db = utils.DbUtils.get_db_instance('STATE_DB') - logical_port = NvidiaSFPCommon.get_logical_port_by_sfp_index(self.sdk_index) - if not logical_port: - raise Exception(f'Module {self.sdk_index} is not present or under initialization') - - initialized = db.exists('STATE_DB', f'TRANSCEIVER_STATUS|{logical_port}') - if not initialized: - raise Exception(f'Module {self.sdk_index} is not present or under initialization') - try: return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control', raise_exception=True, log_func=None) == 1 except: # just in case control file does not exist - raise Exception(f'Module {self.sdk_index} is under initialization') + raise Exception(f'control sysfs for SFP {self.sdk_index} does not exist') + + def get_hw_present(self): + """Get hardware present status, only applicable on host management mode + + Returns: + bool: True if module is in the cage + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_present') == 1 + + def get_power_on(self): + """Get power on status, only applicable on host management mode + + Returns: + bool: True if the module is powered on + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_on') == 1 + + def set_power(self, on): + """Control the power of this module, only applicable on host management mode + + Args: + on (bool): True if on + """ + value = 1 if on else 0 + utils.write_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_on', value) + + def get_reset_state(self): + """Get reset state of this module, only applicable on host management mode + + Returns: + bool: True if module is not in reset status + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_reset') == 1 + + def set_hw_reset(self, value): + """Set the module reset status + + Args: + value (int): 1 for reset, 0 for leaving reset + """ + utils.write_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_reset', value) + + def get_power_good(self): + """Get power good status of this module, only applicable on host management mode + + Returns: + bool: True if the power is in good status + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_good') == 1 + + def get_control_type(self): + """Get control type of this module, only applicable on host management mode + + Returns: + int: 1 - software control, 0 - firmware control + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control') + + def set_control_type(self, control_type): + """Set control type for the module + + Args: + control_type (int): 0 for firmware control, currently only 0 is allowed + """ + utils.write_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/control', control_type) + + def determine_control_type(self): + """Determine control type according to module type + + Returns: + enum: software control or firmware control + """ + api = self.get_xcvr_api() + if not api: + logger.log_error(f'Failed to get api object for SFP {self.sdk_index}, probably module EEPROM is not ready') + return SFP_FW_CONTROL + + if not self.is_supported_for_software_control(api): + return SFP_FW_CONTROL + else: + return SFP_SW_CONTROL + + def is_cmis_api(self, xcvr_api): + """Check if the api type is CMIS + + Args: + xcvr_api (object): xcvr api object + + Returns: + bool: True if the api is of type CMIS + """ + return isinstance(xcvr_api, cmis.CmisApi) + + def is_sff_api(self, xcvr_api): + """Check if the api type is SFF + + Args: + xcvr_api (object): xcvr api object + + Returns: + bool: True if the api is of type SFF + """ + return isinstance(xcvr_api, sff8636.Sff8636Api) or isinstance(xcvr_api, sff8436.Sff8436Api) + + def is_supported_for_software_control(self, xcvr_api): + """Check if the api object supports software control + + Args: + xcvr_api (object): xcvr api object + + Returns: + bool: True if the api object supports software control + """ + return self.is_cmis_api(xcvr_api) and not xcvr_api.is_flat_memory() + + def check_power_capability(self): + """Check module max power with cage power limit + + Returns: + bool: True if max power does not exceed cage power limit + """ + max_power = self.get_module_max_power() + if max_power < 0: + return False + + power_limit = self.get_power_limit() + logger.log_info(f'SFP {self.sdk_index}: max_power={max_power}, power_limit={power_limit}') + if max_power <= power_limit: + return True + else: + logger.log_error(f'SFP {self.sdk_index} exceed power limit: max_power={max_power}, power_limit={power_limit}') + return False + + def get_power_limit(self): + """Get power limit of this module + + Returns: + int: Power limit in unit of 0.25W + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/power_limit') + + def get_module_max_power(self): + """Get module max power from EEPROM + + Returns: + int: max power in terms of 0.25W. Return POWER_CLASS_INVALID if EEPROM data is incorrect. + """ + xcvr_api = self.get_xcvr_api() + if self.is_cmis_api(xcvr_api): + powercap_raw = self.read_eeprom(CMIS_MAX_POWER_OFFSET, 1) + return powercap_raw[0] + elif self.is_sff_api(xcvr_api): + power_class_raw = self.read_eeprom(SFF_POWER_CLASS_OFFSET, 1) + power_class_bit = power_class_raw[0] & SFF_POWER_CLASS_MASK + if power_class_bit in SFF_POWER_CLASS_MAPPING: + powercap = SFF_POWER_CLASS_MAPPING[power_class_bit] + elif power_class_bit == SFF_POWER_CLASS_8_INDICATOR: + # According to standard: + # Byte 128: + # if bit 5 is 1, "Power Class 8 implemented (Max power declared in byte 107)" + # Byte 107: + # "Maximum power consumption of module. Unsigned integer with LSB = 0.1 W." + power_class_8_byte = self.read_eeprom(SFF_POWER_CLASS_8_OFFSET, 1) + powercap = power_class_8_byte[0] * 0.1 + else: + logger.log_error(f'SFP {self.sdk_index} got invalid value for power class field: {power_class_bit}') + return -1 + + # Multiplying the sysfs value (0.25 Watt units) by 4 aligns it with the EEPROM max power value (1 Watt units), + # ensuring both are in the same unit for a meaningful comparison + return powercap * 4 # + else: + # Should never hit, just in case + logger.log_error(f'SFP {self.sdk_index} with api type {xcvr_api} does not support getting max power') + return -1 + + def update_i2c_frequency(self): + """Update I2C frequency for the module. + """ + if self.get_frequency_support(): + api = self.get_xcvr_api() + if self.is_cmis_api(api): + # for CMIS modules, read the module maximum supported clock of Management Comm Interface (MCI) from module EEPROM. + # from byte 2 bits 3-2: + # 00b means module supports up to 400KHz + # 01b means module supports up to 1MHz + logger.log_debug(f"Reading mci max frequency for SFP {self.sdk_index}") + read_mci = self.read_eeprom(CMIS_MCI_EEPROM_OFFSET, 1) + logger.log_debug(f"Read mci max frequency {read_mci[0]} for SFP {self.sdk_index}") + frequency = (read_mci[0] & CMIS_MCI_MASK) >> 2 + elif self.is_sff_api(api): + # for SFF modules, frequency is always 400KHz + frequency = 0 + else: + # Should never hit, just in case + logger.log_error(f'SFP {self.sdk_index} with api type {api} does not support updating frequency but frequency_support sysfs return 1') + return + + logger.log_info(f"Read mci max frequency bits {frequency} for SFP {self.sdk_index}") + self.set_frequency(frequency) + + def get_frequency_support(self): + """Get frequency support for this module + + Returns: + bool: True if supported + """ + return utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/frequency_support') == 1 + + def set_frequency(self, freqeuncy): + """Set module frequency. + + Args: + freqeuncy (int): 0 - up to 400KHz, 1 - up to 1MHz + """ + utils.write_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/frequency', freqeuncy) + + def disable_tx_for_sff_optics(self): + """Disable TX for SFF optics + """ + api = self.get_xcvr_api() + if self.is_sff_api(api) and api.get_tx_disable_support(): + logger.log_info(f'Disabling tx for SFP {self.sdk_index}') + api.tx_disable(True) + + @classmethod + def get_state_machine(cls): + """Get state machine object, create if not exists + + Returns: + object: state machine object + """ + if not cls.sm: + from .state_machine import StateMachine + sm = StateMachine() + sm.add_state(STATE_DOWN).add_transition(EVENT_START, STATE_INIT) + sm.add_state(STATE_INIT).set_entry_action(ACTION_ON_START) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) \ + .add_transition(EVENT_RESET, STATE_RESETTING) \ + .add_transition(EVENT_POWER_ON, STATE_POWERED_ON) \ + .add_transition(EVENT_FW_CONTROL, STATE_FW_CONTROL) # for warm reboot, cable might be in firmware control at startup + sm.add_state(STATE_RESETTING).set_entry_action(ACTION_ON_RESET) \ + .add_transition(EVENT_RESET_DONE, STATE_POWERED_ON) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT, ACTION_ON_CANCEL_WAIT) + sm.add_state(STATE_POWERED_ON).set_entry_action(ACTION_ON_POWERED) \ + .add_transition(EVENT_POWER_BAD, STATE_POWER_BAD) \ + .add_transition(EVENT_SW_CONTROL, STATE_SW_CONTROL) \ + .add_transition(EVENT_FW_CONTROL, STATE_FW_CONTROL) + sm.add_state(STATE_SW_CONTROL).set_entry_action(ACTION_ON_SW_CONTROL) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) \ + .add_transition(EVENT_POWER_LIMIT_EXCEED, STATE_POWER_LIMIT_ERROR) \ + .add_transition(EVENT_POWER_BAD, STATE_POWER_BAD) + sm.add_state(STATE_FW_CONTROL).set_entry_action(ACTION_ON_FW_CONTROL) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) + sm.add_state(STATE_POWER_BAD).add_transition(EVENT_POWER_GOOD, STATE_POWERED_ON) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) + sm.add_state(STATE_NOT_PRESENT).add_transition(EVENT_PRESENT, STATE_INIT) + sm.add_state(STATE_POWER_LIMIT_ERROR).set_entry_action(ACTION_ON_POWER_LIMIT_ERROR) \ + .add_transition(EVENT_POWER_GOOD, STATE_POWERED_ON) \ + .add_transition(EVENT_NOT_PRESENT, STATE_NOT_PRESENT) + + cls.action_table = {} + cls.action_table[ACTION_ON_START] = cls.action_on_start + cls.action_table[ACTION_ON_RESET] = cls.action_on_reset + cls.action_table[ACTION_ON_POWERED] = cls.action_on_powered + cls.action_table[ACTION_ON_SW_CONTROL] = cls.action_on_sw_control + cls.action_table[ACTION_ON_FW_CONTROL] = cls.action_on_fw_control + cls.action_table[ACTION_ON_CANCEL_WAIT] = cls.action_on_cancel_wait + cls.action_table[ACTION_ON_POWER_LIMIT_ERROR] = cls.action_on_power_limit_error + + cls.sm = sm + + return cls.sm + + @classmethod + def action_on_start(cls, sfp): + if sfp.get_control_type() == SFP_FW_CONTROL: + logger.log_info(f'SFP {sfp.sdk_index} is already FW control, probably in warm reboot') + sfp.on_event(EVENT_FW_CONTROL) + return + + if not sfp.get_hw_present(): + logger.log_info(f'SFP {sfp.sdk_index} is not present') + sfp.on_event(EVENT_NOT_PRESENT) + return + + if not sfp.get_power_on(): + logger.log_info(f'SFP {sfp.sdk_index} is not powered on') + sfp.set_power(True) + sfp.set_hw_reset(1) + sfp.on_event(EVENT_RESET) + else: + if not sfp.get_reset_state(): + logger.log_info(f'SFP {sfp.sdk_index} is in reset state') + sfp.set_hw_reset(1) + sfp.on_event(EVENT_RESET) + else: + sfp.on_event(EVENT_POWER_ON) + + @classmethod + def action_on_reset(cls, sfp): + logger.log_info(f'SFP {sfp.sdk_index} is scheduled to wait for resetting done') + cls.get_wait_ready_task().schedule_wait(sfp.sdk_index) + + @classmethod + def action_on_powered(cls, sfp): + if not sfp.get_power_good(): + logger.log_error(f'SFP {sfp.sdk_index} is not in power good state') + sfp.on_event(EVENT_POWER_BAD) + return + + control_type = sfp.determine_control_type() + if control_type == SFP_SW_CONTROL: + sfp.on_event(EVENT_SW_CONTROL) + else: + sfp.on_event(EVENT_FW_CONTROL) + + @classmethod + def action_on_sw_control(cls, sfp): + if not sfp.check_power_capability(): + sfp.on_event(EVENT_POWER_LIMIT_EXCEED) + return + + sfp.update_i2c_frequency() + sfp.disable_tx_for_sff_optics() + logger.log_info(f'SFP {sfp.sdk_index} is set to software control') + + @classmethod + def action_on_fw_control(cls, sfp): + logger.log_info(f'SFP {sfp.sdk_index} is set to firmware control') + sfp.set_control_type(SFP_FW_CONTROL) + + @classmethod + def action_on_cancel_wait(cls, sfp): + cls.get_wait_ready_task().cancel_wait(sfp.sdk_index) + + @classmethod + def action_on_power_limit_error(cls, sfp): + logger.log_info(f'SFP {sfp.sdk_index} is powered off due to exceeding power limit') + sfp.set_power(False) + sfp.set_hw_reset(0) + + @classmethod + def get_wait_ready_task(cls): + """Get SFP wait ready task. Create if not exists. + + Returns: + object: an instance of WaitSfpReadyTask + """ + if not cls.wait_ready_task: + from .wait_sfp_ready_task import WaitSfpReadyTask + cls.wait_ready_task = WaitSfpReadyTask() + return cls.wait_ready_task + + def get_state(self): + """Return the current state. + + Returns: + str: current state + """ + return self.state + + def change_state(self, new_state): + """Change from old state to new state + + Args: + new_state (str): new state + """ + self.state = new_state + + def on_action(self, action_name): + """Called when a state machine action is executing + + Args: + action_name (str): action name + """ + SFP.action_table[action_name](self) + + def on_event(self, event): + """Called when a state machine event arrives + + Args: + event (str): State machine event + """ + SFP.get_state_machine().on_event(self, event) + + def in_stable_state(self): + """Indicate whether this module is in a stable state. 'Stable state' means the module is pending on a polling event + from SDK. + + Returns: + bool: True if the module is in a stable state + """ + return self.state in (STATE_NOT_PRESENT, STATE_SW_CONTROL, STATE_FW_CONTROL, STATE_POWER_BAD, STATE_POWER_LIMIT_ERROR) + + def get_fds_for_poling(self): + if self.state == STATE_FW_CONTROL: + return { + 'present': self.get_fd('present') + } + else: + return { + 'hw_present': self.get_fd('hw_present'), + 'power_good': self.get_fd('power_good') + } + + def fill_change_event(self, port_dict): + """Fill change event data based on current state. + + Args: + port_dict (dict): {:} + """ + if self.state == STATE_NOT_PRESENT: + port_dict[self.sdk_index + 1] = SFP_STATUS_REMOVED + elif self.state == STATE_SW_CONTROL: + port_dict[self.sdk_index + 1] = SFP_STATUS_INSERTED + elif self.state == STATE_FW_CONTROL: + port_dict[self.sdk_index + 1] = SFP_STATUS_INSERTED + elif self.state == STATE_POWER_BAD or self.state == STATE_POWER_LIMIT_ERROR: + sfp_state = SFP.SFP_ERROR_BIT_POWER_BUDGET_EXCEEDED | SFP.SFP_STATUS_BIT_INSERTED + port_dict[self.sdk_index + 1] = str(sfp_state) + + def refresh_poll_obj(self, poll_obj, all_registered_fds): + """Refresh polling object and registered fds. This function is usually called when a cable plugin + event occurs. For example, user plugs out a software control module and replaces with a firmware + control cable. In such case, poll_obj was polling "hw_present" and "power_good" for software control, + and it needs to be changed to poll "present" for new control type which is firmware control. + + Args: + poll_obj (object): poll object + all_registered_fds (dict): fds that have been registered to poll object + """ + # find fds registered by this SFP + current_registered_fds = {item[2]: (fileno, item[1]) for fileno, item in all_registered_fds.items() if item[0] == self.sdk_index} + logger.log_debug(f'SFP {self.sdk_index} registered fds are: {current_registered_fds}') + if self.state == STATE_FW_CONTROL: + target_poll_types = ['present'] + else: + target_poll_types = ['hw_present', 'power_good'] + + for target_poll_type in target_poll_types: + if target_poll_type not in current_registered_fds: + # need add new fd for polling + logger.log_debug(f'SFP {self.sdk_index} is registering file descriptor: {target_poll_type}') + fd = self.get_fd(target_poll_type) + poll_obj.register(fd, select.POLLERR | select.POLLPRI) + all_registered_fds[fd.fileno()] = (self.sdk_index, fd, target_poll_type) + else: + # the fd is already in polling + current_registered_fds.pop(target_poll_type) + + for _, item in current_registered_fds.items(): + # Deregister poll, close fd + logger.log_debug(f'SFP {self.sdk_index} is de-registering file descriptor: {item}') + poll_obj.unregister(item[1]) + all_registered_fds.pop(item[0]) + item[1].close() + + def is_dummy_event(self, fd_type, fd_value): + """Check whether an event is dummy event + + Args: + origin_state (str): original state before polling + fd_type (str): polling sysfs type + fd_value (int): polling sysfs value + + Returns: + bool: True if the event is a dummy event + """ + if fd_type == 'hw_present' or fd_type == 'present': + if fd_value == int(SFP_STATUS_INSERTED): + return self.state in (STATE_SW_CONTROL, STATE_FW_CONTROL, STATE_POWER_BAD, STATE_POWER_LIMIT_ERROR) + elif fd_value == int(SFP_STATUS_REMOVED): + return self.state == STATE_NOT_PRESENT + elif fd_type == 'power_good': + if fd_value == 1: + return self.state in (STATE_SW_CONTROL, STATE_NOT_PRESENT, STATE_RESETTING) + else: + return self.state in (STATE_POWER_BAD, STATE_POWER_LIMIT_ERROR, STATE_NOT_PRESENT) + return False + + @classmethod + def initialize_sfp_modules(cls, sfp_list): + """Initialize all modules. Only applicable when module host management is enabled + + Args: + sfp_list (object): all sfps + """ + wait_ready_task = cls.get_wait_ready_task() + wait_ready_task.start() + + for s in sfp_list: + s.on_event(EVENT_START) + + if not wait_ready_task.empty(): + # Wait until wait_ready_task is up + while not wait_ready_task.is_alive(): + pass + + # Resetting SFP requires a reloading of module firmware, it takes up to 3 seconds + # according to standard + max_wait_time = 3.5 + begin = time.time() + while True: + ready_sfp_set = wait_ready_task.get_ready_set() + for sfp_index in ready_sfp_set: + s = sfp_list[sfp_index] + logger.log_debug(f'SFP {sfp_index} is recovered from resetting state') + s.on_event(EVENT_RESET_DONE) + elapse = time.time() - begin + if elapse < max_wait_time: + time.sleep(0.5) + else: + break + + # Verify that all modules are in a stable state + for index, s in enumerate(sfp_list): + if not s.in_stable_state(): + logger.log_error(f'SFP {index} is not in stable state after initializing, state={s.state}') + logger.log_notice(f'SFP {index} is in state {s.state} after module initialization') class RJ45Port(NvidiaSFPCommon): @@ -1261,3 +1923,17 @@ def reinit(self): :return: """ return + + def get_module_status(self): + """Get value of sysfs status. It could return: + SXD_PMPE_MODULE_STATUS_PLUGGED_ENABLED_E = 0x1, + SXD_PMPE_MODULE_STATUS_UNPLUGGED_E = 0x2, + SXD_PMPE_MODULE_STATUS_MODULE_PLUGGED_ERROR_E = 0x3, + SXD_PMPE_MODULE_STATUS_PLUGGED_DISABLED_E = 0x4, + SXD_PMPE_MODULE_STATUS_UNKNOWN_E = 0x5, + + Returns: + str: sonic status of the module + """ + status = super().get_module_status() + return SFP_STATUS_REMOVED if status == SFP_STATUS_UNKNOWN else status diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py deleted file mode 100644 index 133001020495..000000000000 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py +++ /dev/null @@ -1,409 +0,0 @@ -# -# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. -# Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -''' -listen to the SDK for the SFP change event and return to chassis. -''' - - -import sys, errno -import os -import time -import select - -from .device_data import DeviceDataManager -try: - if 'PLATFORM_API_UNIT_TESTING' not in os.environ: - from python_sdk_api.sx_api import * - else: - from mock import MagicMock - class MockSxFd(object): - fd = 99 - new_sx_fd_t_p = MagicMock(return_value=MockSxFd()) - new_sx_user_channel_t_p = MagicMock() -except KeyError: - pass -from sonic_py_common.logger import Logger -from .sfp import SFP - -# SFP status from PMAOS register -# 0x1 plug in -# 0x2 plug out -# 0x3 plug in with error -# 0x4 disabled, at this status SFP eeprom is not accessible, -# and presence status also will be not present, -# so treate it as plug out. -SDK_SFP_STATE_IN = 0x1 -SDK_SFP_STATE_OUT = 0x2 -SDK_SFP_STATE_ERR = 0x3 -SDK_SFP_STATE_DIS = 0x4 -SDK_SFP_STATE_UNKNOWN = 0x5 - -# SFP status used in this file only, will not expose to XCVRD -# STATUS_ERROR will be mapped to different status according to the error code -STATUS_UNKNOWN = '-1' -STATUS_ERROR = '-2' - -# SFP error code, only valid when SFP at SDK_SFP_STATE_ERR status -# Only 0x2, 0x3, 0x5, 0x6 and 0x7 will block the eeprom access, -# so will only report above errors to XCVRD and other errors will be -# printed to syslog. - -''' -0x0: "Power_Budget_Exceeded", -0x1: "Long_Range_for_non_MLNX_cable_or_module", -0x2: "Bus_stuck", -0x3: "bad_or_unsupported_EEPROM", -0x4: "Enforce_part_number_list", -0x5: "unsupported_cable", -0x6: "High_Temperature", -0x7: "bad_cable", -0x8: "PMD_type_is_not_enabled", -0x9: "[internal]Laster_TEC_failure", -0xa: "[internal]High_current", -0xb: "[internal]High_voltage", -0xd: "[internal]High_power", -0xe: "[internal]Module_state_machine_fault", -0xc: "pcie_system_power_slot_Exceeded" -''' - -# SFP errors that will block eeprom accessing -SDK_SFP_BLOCKING_ERRORS = [ - 0x2, # SFP.SFP_ERROR_BIT_I2C_STUCK, - 0x3, # SFP.SFP_ERROR_BIT_BAD_EEPROM, - 0x5, # SFP.SFP_ERROR_BIT_UNSUPPORTED_CABLE, - 0x6, # SFP.SFP_ERROR_BIT_HIGH_TEMP, - 0x7, # SFP.SFP_ERROR_BIT_BAD_CABLE -] - -SDK_ERRORS_TO_ERROR_BITS = { - 0x0: SFP.SFP_ERROR_BIT_POWER_BUDGET_EXCEEDED, - 0x1: SFP.SFP_MLNX_ERROR_BIT_LONGRANGE_NON_MLNX_CABLE, - 0x2: SFP.SFP_ERROR_BIT_I2C_STUCK, - 0x3: SFP.SFP_ERROR_BIT_BAD_EEPROM, - 0x4: SFP.SFP_MLNX_ERROR_BIT_ENFORCE_PART_NUMBER_LIST, - 0x5: SFP.SFP_ERROR_BIT_UNSUPPORTED_CABLE, - 0x6: SFP.SFP_ERROR_BIT_HIGH_TEMP, - 0x7: SFP.SFP_ERROR_BIT_BAD_CABLE, - 0x8: SFP.SFP_MLNX_ERROR_BIT_PMD_TYPE_NOT_ENABLED, - 0xc: SFP.SFP_MLNX_ERROR_BIT_PCIE_POWER_SLOT_EXCEEDED -} - -SDK_ERRORS_TO_DESCRIPTION = { - 0x1: SFP.SFP_MLNX_ERROR_DESCRIPTION_LONGRANGE_NON_MLNX_CABLE, - 0x4: SFP.SFP_MLNX_ERROR_DESCRIPTION_ENFORCE_PART_NUMBER_LIST, - 0x8: SFP.SFP_MLNX_ERROR_DESCRIPTION_PMD_TYPE_NOT_ENABLED, - 0xc: SFP.SFP_MLNX_ERROR_DESCRIPTION_PCIE_POWER_SLOT_EXCEEDED -} - -sfp_value_status_dict = { - SDK_SFP_STATE_IN: str(SFP.SFP_STATUS_BIT_INSERTED), - SDK_SFP_STATE_OUT: str(SFP.SFP_STATUS_BIT_REMOVED), - SDK_SFP_STATE_ERR: STATUS_ERROR, - SDK_SFP_STATE_DIS: str(SFP.SFP_STATUS_BIT_REMOVED), -} - -# system level event/error -EVENT_ON_ALL_SFP = '-1' -SYSTEM_NOT_READY = 'system_not_ready' -SYSTEM_READY = 'system_become_ready' -SYSTEM_FAIL = 'system_fail' - -SDK_DAEMON_READY_FILE = '/tmp/sdk_ready' - -PMPE_PACKET_SIZE = 2000 - -logger = Logger() - -class sfp_event: - ''' Listen to plugin/plugout cable events ''' - - SX_OPEN_RETRIES = 30 - SX_OPEN_TIMEOUT = 5 - SELECT_TIMEOUT = 1 - - def __init__(self, rj45_port_list=None): - self.swid = 0 - self.handle = None - - # Allocate SDK fd and user channel structures - self.rx_fd_p = new_sx_fd_t_p() - self.user_channel_p = new_sx_user_channel_t_p() - if rj45_port_list: - self.RJ45_port_set = set(rj45_port_list) - else: - self.RJ45_port_set = set() - - def initialize(self): - swid_cnt_p = None - - try: - # Wait for SDK daemon to be started with detect the sdk_ready file - retry = 0 - while not os.path.exists(SDK_DAEMON_READY_FILE): - if retry >= self.SX_OPEN_RETRIES: - raise RuntimeError("SDK daemon failed to start after {} retries and {} seconds waiting, exiting..." - .format(retry, self.SX_OPEN_TIMEOUT * self.SX_OPEN_RETRIES)) - else: - logger.log_info("SDK daemon not started yet, retry {} times".format(retry)) - retry += 1 - time.sleep(self.SX_OPEN_TIMEOUT) - - # After SDK daemon started, sx_api_open and sx_api_host_ifc_open is ready for call - rc, self.handle = sx_api_open(None) - if rc != SX_STATUS_SUCCESS: - raise RuntimeError("failed to call sx_api_open with rc {}, exiting...".format(rc)) - - rc = sx_api_host_ifc_open(self.handle, self.rx_fd_p) - if rc != SX_STATUS_SUCCESS: - raise RuntimeError("failed to call sx_api_host_ifc_open with rc {}, exiting...".format(rc)) - - self.user_channel_p.type = SX_USER_CHANNEL_TYPE_FD - self.user_channel_p.channel.fd = self.rx_fd_p - - # Wait for switch to be created and initialized inside SDK - retry = 0 - swid_cnt_p = new_uint32_t_p() - uint32_t_p_assign(swid_cnt_p, 0) - swid_cnt = 0 - while True: - if retry >= self.SX_OPEN_RETRIES: - raise RuntimeError("switch not created after {} retries and {} seconds waiting, exiting..." - .format(retry, self.SX_OPEN_RETRIES * self.SX_OPEN_TIMEOUT)) - else: - rc = sx_api_port_swid_list_get(self.handle, None, swid_cnt_p) - if rc == SX_STATUS_SUCCESS: - swid_cnt = uint32_t_p_value(swid_cnt_p) - if swid_cnt > 0: - delete_uint32_t_p(swid_cnt_p) - swid_cnt_p = None - break - else: - logger.log_info("switch not created yet, swid_cnt {}, retry {} times and wait for {} seconds" - .format(swid_cnt, retry, self.SX_OPEN_TIMEOUT * retry)) - else: - raise RuntimeError("sx_api_port_swid_list_get fail with rc {}, retry {} times and wait for {} seconds". - format(rc, retry, self.SX_OPEN_TIMEOUT * retry)) - - retry += 1 - time.sleep(self.SX_OPEN_TIMEOUT) - - # After switch was created inside SDK, sx_api_host_ifc_trap_id_register_set is ready to call - rc = sx_api_host_ifc_trap_id_register_set(self.handle, - SX_ACCESS_CMD_REGISTER, - self.swid, - SX_TRAP_ID_PMPE, - self.user_channel_p) - - if rc != SX_STATUS_SUCCESS: - raise RuntimeError("sx_api_host_ifc_trap_id_register_set failed with rc {}, exiting...".format(rc)) - except Exception as e: - logger.log_error("sfp_event initialization failed due to {}, exiting...".format(repr(e))) - if swid_cnt_p is not None: - delete_uint32_t_p(swid_cnt_p) - self.deinitialize() - - def deinitialize(self): - if self.handle is None: - return - - # unregister trap id - rc = sx_api_host_ifc_trap_id_register_set(self.handle, - SX_ACCESS_CMD_DEREGISTER, - self.swid, - SX_TRAP_ID_PMPE, - self.user_channel_p) - if rc != SX_STATUS_SUCCESS: - logger.log_error("sx_api_host_ifc_trap_id_register_set exited with error, rc {}".format(rc)) - - rc = sx_api_host_ifc_close(self.handle, self.rx_fd_p) - if rc != SX_STATUS_SUCCESS: - logger.log_error("sx_api_host_ifc_close exited with error, rc {}".format(rc)) - - rc = sx_api_close(self.handle) - if rc != SX_STATUS_SUCCESS: - logger.log_error("sx_api_close exited with error, rc {}".format(rc)) - - delete_sx_fd_t_p(self.rx_fd_p) - delete_sx_user_channel_t_p(self.user_channel_p) - - def check_sfp_status(self, port_change, error_dict, timeout): - """ - the meaning of timeout is aligned with select.select, which has the following meaning: - 0: poll, returns without blocked - arbitrary positive value: doesn't returns until at least fd in the set is ready or - seconds elapsed - Note: - check_sfp_status makes the use of select to retrieve the notifications, which means - it should has the logic of reading out all the notifications in the fd selected without blocked. - However, it fails to do that due to some sdk API's characteristics: - sx_lib_host_ifc_recv can only read one notification each time and will block when no notification in that fd. - sx_lib_host_ifc_recv_list can return all notification in the fd via a single reading operation but - not supported by PMPE register (I've tested it but failed) - as a result the only way to satisfy the logic is to call sx_lib_host_ifc_recv in a loop until all notifications - has been read and we have to find a way to check that. it seems the only way to check that is via using select. - in this sense, we return one notification each time check_sfp_status called and let the caller, get_change_event, - to repeat calling it with timeout = 0 in a loop until no new notification read (in this case it returns false). - by doing so all the notifications in the fd can be retrieved through a single call to get_change_event. - """ - found = 0 - - try: - read, _, _ = select.select([self.rx_fd_p.fd], [], [], float(timeout) / 1000) - print(read) - except select.error as err: - rc, msg = err - if rc == errno.EAGAIN or rc == errno.EINTR: - return False - else: - raise - - for fd in read: - if fd == self.rx_fd_p.fd: - success, port_list, module_state, error_type = self.on_pmpe(self.rx_fd_p) - print('success = ', success) - if not success: - logger.log_error("failed to read from {}".format(fd)) - break - - sfp_state = sfp_value_status_dict.get(module_state, STATUS_UNKNOWN) - error_description = None - if sfp_state == STATUS_UNKNOWN: - # in the following sequence, STATUS_UNKNOWN can be returned. - # so we shouldn't raise exception here. - # 1. some sfp module is inserted - # 2. sfp_event gets stuck and fails to fetch the change event instantaneously - # 3. and then the sfp module is removed - # 4. sfp_event starts to try fetching the change event - # in this case found is increased so that True will be returned - logger.log_info("unknown module state {}, maybe the port suffers two adjacent insertion/removal".format(module_state)) - found += 1 - continue - - # If get SFP status error(0x3) from SDK, then need to read the error_type to get the detailed error - if sfp_state == STATUS_ERROR: - sfp_state_bits = SDK_ERRORS_TO_ERROR_BITS.get(error_type) - if sfp_state_bits is None: - logger.log_error("Unrecognized error {} detected on ports {}".format(error_type, port_list)) - found += 1 - continue - - if error_type in SDK_SFP_BLOCKING_ERRORS: - # In SFP at error status case, need to overwrite the sfp_state with the exact error code - sfp_state_bits |= SFP.SFP_ERROR_BIT_BLOCKING - - # An error should be always set along with 'INSERTED' - sfp_state_bits |= SFP.SFP_STATUS_BIT_INSERTED - - # For vendor specific errors, the description should be returned as well - error_description = SDK_ERRORS_TO_DESCRIPTION.get(error_type) - - sfp_state = str(sfp_state_bits) - - for port in port_list: - logger.log_info("SFP on port {} state {}".format(port, sfp_state)) - port_change[port+1] = sfp_state - if error_description: - error_dict[port+1] = error_description - found += 1 - - return found != 0 - - def on_pmpe(self, fd_p): - ''' on port module plug event handler ''' - - # recv parameters - pkt_size = PMPE_PACKET_SIZE - pkt_size_p = new_uint32_t_p() - uint32_t_p_assign(pkt_size_p, pkt_size) - pkt = new_uint8_t_arr(pkt_size) - recv_info_p = new_sx_receive_info_t_p() - pmpe_t = sx_event_pmpe_t() - port_cnt_p = new_uint32_t_p() - uint32_t_p_assign(port_cnt_p, 0) - label_port_list = [] - module_state = 0 - error_type = pmpe_t.error_type - - rc = sx_lib_host_ifc_recv(fd_p, pkt, pkt_size_p, recv_info_p) - if rc != 0: - logger.log_error("sx_lib_host_ifc_recv exited with error, rc %d" % rc) - status = False - else: - status = True - unknown = False - pmpe_t = recv_info_p.event_info.pmpe - port_list_size = pmpe_t.list_size - logical_port_list = pmpe_t.log_port_list - module_state = pmpe_t.module_state - error_type = pmpe_t.error_type - module_id = pmpe_t.module_id - slot_id = pmpe_t.slot_id # For non-modular chassis, it should return 0 - - if module_state == SDK_SFP_STATE_ERR: - logger.log_error("Receive PMPE error event on module {}: status {} error type {}".format(module_id, module_state, error_type)) - elif module_state == SDK_SFP_STATE_DIS: - logger.log_notice("Receive PMPE disable event on module {}: status {}".format(module_id, module_state)) - elif module_state == SDK_SFP_STATE_IN or module_state == SDK_SFP_STATE_OUT: - logger.log_notice("Receive PMPE plug in/out event on module {}: status {}".format(module_id, module_state)) - elif module_state == SDK_SFP_STATE_UNKNOWN: - unknown = True - else: - logger.log_error("Receive PMPE unknown event on module {}: status {}".format(module_id, module_state)) - - # Call sx_api_port_device_get with port_cnt_p=0, SDK will return the logical port number - rc = sx_api_port_device_get(self.handle, 1, 0, None, port_cnt_p) - if rc != SX_STATUS_SUCCESS: - logger.log_error("Failed to get logical port number") - status = False - else: - port_cnt = uint32_t_p_value(port_cnt_p) - port_attributes_list = new_sx_port_attributes_t_arr(port_cnt) - rc = sx_api_port_device_get(self.handle, 1, 0, port_attributes_list, port_cnt_p) - if rc != SX_STATUS_SUCCESS: - logger.log_error("Failed to get logical port attributes") - status = False - else: - for i in range(port_list_size): - label_port = None - logical_port = sx_port_log_id_t_arr_getitem(logical_port_list, i) - for j in range(port_cnt): - port_attributes = sx_port_attributes_t_arr_getitem(port_attributes_list,j) - if port_attributes.log_port == logical_port: - label_port = slot_id * DeviceDataManager.get_linecard_max_port_count() + port_attributes.port_mapping.module_port - break - - if label_port is not None: - label_port_list.append(label_port) - delete_sx_port_attributes_t_arr(port_attributes_list) - - if unknown: - SFP_ports_with_unknown_event = set(label_port_list) - self.RJ45_port_set - if SFP_ports_with_unknown_event: - logger.log_error("Receive PMPE unknown event on module {}: status {}".format(module_id, module_state)) - else: - # For RJ45 ports, we treat unknown as disconnect - module_state = SDK_SFP_STATE_DIS - - delete_uint32_t_p(pkt_size_p) - delete_uint8_t_arr(pkt) - delete_sx_receive_info_t_p(recv_info_p) - delete_uint32_t_p(port_cnt_p) - - if not label_port_list: - logger.log_error('Dropping PMPE event due to label port not found') - - return status, label_port_list, module_state, error_type diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/state_machine.py b/platform/mellanox/mlnx-platform-api/sonic_platform/state_machine.py new file mode 100644 index 000000000000..d7b6faf10c37 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/state_machine.py @@ -0,0 +1,168 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from sonic_py_common.logger import Logger + +logger = Logger() + + +class State: + """Represent a state in a state machine + """ + def __init__(self, name): + self.name = name + self.entry_action = None + self.leave_action = None + self.transitions = {} + self.event_actions = {} + + def set_entry_action(self, action_name): + """Set an action when entering this state + + Args: + action_name (str): action name + + Returns: + object: self + """ + self.entry_action = action_name + return self + + def set_leave_action(self, action_name): + """Set a leave action when leaving the state + + Args: + action_name (str): action name + + Returns: + object: self + """ + self.leave_action = action_name + return self + + def add_transition(self, event, next_state, event_action=None): + """Add a transition item to this state + + Args: + event (str): event name + next_state (str): next state that the state entity will transit to upon this event. + event_action (str): action called when event arrives + + Raises: + RuntimeError: raise if the event is already in the transition table + + Returns: + object: self + """ + if event in self.transitions: + raise RuntimeError(f'event {event} already exists in transition table of state {self.name}') + + self.transitions[event] = next_state + + if event_action: + if event in self.event_actions: + raise RuntimeError(f'event {event} already exists in action table of state {self.name}') + self.event_actions[event] = event_action + return self + + def on_enter(self, entity): + """Called when state entity enters the state + + Args: + entity (obj): state entity + """ + if self.entry_action: + logger.log_debug(f'{entity} entered state [{self.name}] and is triggering action [{self.entry_action}]') + entity.on_action(self.entry_action) + else: + logger.log_debug(f'{entity} entered state [{self.name}]') + + def on_leave(self, entity): + """Called when state entity leaves the state + + Args: + entity (obj): state entity + """ + if self.leave_action: + entity.on_action(self.leave_action) + + def on_event(self, entity, event): + """Called when state entity has got an event + + Args: + entity (object): state entity + event (str): event name + + Returns: + str: next event name + """ + if event not in self.transitions: + logger.log_error(f'{event} is not defined in state {self.name}') + return self.name + else: + if event in self.event_actions: + entity.on_action(self.event_actions[event]) + return self.transitions[event] + + +class StateMachine: + def __init__(self): + self.states = {} + + def add_state(self, state_name): + """Register a state to state machine + + Args: + state_name (str): name of the state + + Raises: + RuntimeError: raise if state name already exists + + Returns: + object: the new state object + """ + if state_name in self.states: + raise RuntimeError(f'state {state_name} already exists') + + state = State(state_name) + self.states[state_name] = state + return state + + def on_event(self, entity, event): + """Called when an event occurs + + Args: + entity (object): state entity + event (str): event name + + Raises: + RuntimeError: raise if the current state is not registered + RuntimeError: raise if next state is not registered + """ + current_state_name = entity.get_state() + if current_state_name not in self.states: + raise RuntimeError(f'Unknown state {current_state_name}') + + current_state = self.states[current_state_name] + next_state_name = current_state.on_event(entity, event) + logger.log_debug(f'{entity} has got event [{event}], it is changing from state [{current_state}] to [{next_state_name}]') + if next_state_name not in self.states: + raise RuntimeError(f'Unknown next state {next_state_name}') + if next_state_name != current_state_name: + current_state.on_leave(entity) + entity.change_state(next_state_name) + self.states[next_state_name].on_enter(entity) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py index 5c118b4c9a07..3512a0cf52e5 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,7 +33,7 @@ def initialize(cls): and any other vendor specific initialization. :return: """ - if DeviceDataManager.is_independent_mode(): + if DeviceDataManager.is_module_host_management_mode(): from .chassis import Chassis cls.thermal_updater_task = thermal_updater.ThermalUpdater(Chassis.chassis_instance.get_all_sfps()) cls.thermal_updater_task.start() @@ -46,5 +46,5 @@ def deinitialize(cls): is a no-op. :return: """ - if DeviceDataManager.is_independent_mode() and cls.thermal_updater_task: + if DeviceDataManager.is_module_host_management_mode() and cls.thermal_updater_task: cls.thermal_updater_task.stop() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py index f2f0f75b2fd1..889bc96d3bec 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_updater.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -81,10 +81,6 @@ def load_tc_config(self): def start(self): self.clean_thermal_data() - if not self.wait_all_sfp_ready(): - logger.log_error('Failed to wait for all SFP ready, will put hw-management-tc to suspend') - self.control_tc(True) - return self.control_tc(False) self.load_tc_config() self._timer.start() @@ -106,25 +102,6 @@ def clean_thermal_data(self): sfp.sdk_index + 1 ) - def wait_all_sfp_ready(self): - logger.log_notice('Waiting for all SFP modules ready...') - max_wait_time = 300 - ready_set = set() - while len(ready_set) != len(self._sfp_list): - for sfp in self._sfp_list: - try: - sfp.is_sw_control() - ready_set.add(sfp) - except: - continue - max_wait_time -= 1 - if max_wait_time == 0: - return False - time.sleep(1) - - logger.log_notice('All SFP modules are ready') - return True - def get_asic_temp(self): temperature = utils.read_int_from_file('/sys/module/sx_core/asic0/temperature/input', default=None) return temperature * ASIC_TEMPERATURE_SCALE if temperature is not None else None diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py index a7354ac7b864..77aad4a315c7 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -282,11 +282,13 @@ def wait_until(predict, timeout, interval=1, *args, **kwargs): Returns: _type_: _description_ """ + if predict(*args, **kwargs): + return True while timeout > 0: - if predict(*args, **kwargs): - return True time.sleep(interval) timeout -= interval + if predict(*args, **kwargs): + return True return False diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/wait_sfp_ready_task.py b/platform/mellanox/mlnx-platform-api/sonic_platform/wait_sfp_ready_task.py new file mode 100644 index 000000000000..56b1f479fd44 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/wait_sfp_ready_task.py @@ -0,0 +1,139 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import copy +import threading +import time +from sonic_py_common.logger import Logger + +logger = Logger() +EMPTY_SET = set() + + +class WaitSfpReadyTask(threading.Thread): + """When bring a module from powered off to powered on, it takes 3 seconds + for module to load its firmware. This class is designed to perform a wait for + those modules who are loading firmware. + """ + WAIT_TIME = 3 + + def __init__(self): + # Set daemon to True so that the thread will be destroyed when daemon exits. + super().__init__(daemon=True) + self.running = False + + # Lock to protect the wait list + self.lock = threading.Lock() + + # Event to wake up thread function + self.event = threading.Event() + + # A list of SFP to be waited. Key is SFP index, value is the expire time. + self._wait_dict = {} + + # The queue to store those SFPs who finish loading firmware. + self._ready_set = set() + + def stop(self): + """Stop the task, only used in unit test + """ + self.running = False + self.event.set() + + def schedule_wait(self, sfp_index): + """Add a SFP to the wait list + + Args: + sfp_index (int): the index of the SFP object + """ + logger.log_debug(f'SFP {sfp_index} is scheduled for waiting reset done') + with self.lock: + if len(self._wait_dict) == 0: + is_empty = True + # The item will be expired in 3 seconds + self._wait_dict[sfp_index] = time.time() + self.WAIT_TIME + + if is_empty: + logger.log_debug('An item arrives, wake up WaitSfpReadyTask') + # wake up the thread + self.event.set() + + def cancel_wait(self, sfp_index): + """Cancel a SFP from the wait list + + Args: + sfp_index (int): the index of the SFP object + """ + logger.log_debug(f'SFP {sfp_index} is canceled for waiting reset done') + with self.lock: + if sfp_index in self._wait_dict: + self._wait_dict.pop(sfp_index) + if sfp_index in self._ready_set: + self._ready_set.pop(sfp_index) + + def get_ready_set(self): + """Get ready set and clear it + + Returns: + set: a deep copy of self._ready_set + """ + with self.lock: + if not self._ready_set: + return EMPTY_SET + ready_set = copy.deepcopy(self._ready_set) + self._ready_set.clear() + return ready_set + + def empty(self): + """Indicate if wait_dict is empty + + Returns: + bool: True if wait_dict is empty + """ + with self.lock: + return len(self._wait_dict) == 0 + + def run(self): + """Thread function + """ + self.running = True + pending_remove_set = set() + is_empty = True + while self.running: + if is_empty: + logger.log_debug(f'WaitSfpReadyTask is waiting for task...') + # If wait_dict is empty, hold the thread until an item coming + self.event.wait() + self.event.clear() + + now = time.time() + with self.lock: + logger.log_debug(f'Processing wait SFP dict: {self._wait_dict}, now={now}') + for sfp_index, expire_time in self._wait_dict.items(): + # If now time is greater than the expire time, remove + # the item from wait_dict + if now >= expire_time: + pending_remove_set.add(sfp_index) + + for sfp_index in pending_remove_set: + self._wait_dict.pop(sfp_index) + self._ready_set.add(sfp_index) + + is_empty = (len(self._wait_dict) == 0) + + pending_remove_set.clear() + time.sleep(1) diff --git a/platform/mellanox/mlnx-platform-api/tests/test_change_event.py b/platform/mellanox/mlnx-platform-api/tests/test_change_event.py new file mode 100644 index 000000000000..0d3429c483de --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_change_event.py @@ -0,0 +1,220 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys + +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform import chassis +from sonic_platform import sfp + + +class TestChangeEvent: + @mock.patch('sonic_platform.sfp.SFP.get_fd_for_polling_legacy') + @mock.patch('select.poll') + @mock.patch('time.time') + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=1)) + @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) + @mock.patch('sonic_platform.sfp.SFP.get_module_status') + def test_get_change_event_legacy(self, mock_status, mock_time, mock_create_poll, mock_get_fd): + c = chassis.Chassis() + s = c.get_sfp(1) + + mock_status.return_value = sfp.SFP_STATUS_INSERTED + + # mock poll object + mock_poll = mock.MagicMock() + mock_create_poll.return_value = mock_poll + mock_poll.poll = mock.MagicMock(return_value = []) + + # mock file descriptor for polling + mock_file = mock.MagicMock() + mock_get_fd.return_value = mock_file + mock_file.fileno = mock.MagicMock(return_value = 1) + + timeout = 1000 + # mock time function so that the while loop exit early + mock_time.side_effect = [0, timeout] + + # no event, expect returning empty change event + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and not change_event['sfp'] + + # dummy event, expect returning empty change event + sfp_index = s.sdk_index + 1 + mock_poll.poll.return_value = [(1, 10)] + mock_time.side_effect = [0, timeout] + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and not change_event['sfp'] + + # plug out event, expect returning remove event + mock_time.side_effect = [0, timeout] + mock_status.return_value = sfp.SFP_STATUS_REMOVED + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == sfp.SFP_STATUS_REMOVED + + # error event, expect returning error event + mock_time.side_effect = [0, timeout] + mock_status.return_value = sfp.SFP_STATUS_ERROR + s.get_error_info_from_sdk_error_type = mock.MagicMock(return_value=('2', 'some error')) + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == '2' + assert 'sfp_error' in change_event and sfp_index in change_event['sfp_error'] and change_event['sfp_error'][sfp_index] == 'some error' + + @mock.patch('sonic_platform.sfp.SFP.get_fd') + @mock.patch('select.poll') + @mock.patch('time.time') + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=True)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=1)) + @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) + @mock.patch('sonic_platform.module_host_mgmt_initializer.ModuleHostMgmtInitializer.initialize', mock.MagicMock()) + def test_get_change_event_for_module_host_management_mode(self, mock_time, mock_create_poll, mock_get_fd): + """Test steps: + 1. Simulate polling with no event + 2. Simulate polling the first dummy event. (SDK always return a event when first polling the fd even if there is no change) + 3. Simulate a plug out event, module transfer from sw control to not present + 4. Simulate plugging in a fw control module, module transfer to fw control + 5. Simulate an error event + 6. Simulate a plug out event, module transfer from fw control to not present + 7. Simulate plugging in a sw control module, module transfer to sw control + 8. Simulate a power bad event, module transfer from sw control to power bad + 9. Simulate a power good event, module transfer from power bad to sw control + """ + c = chassis.Chassis() + c.initialize_sfp() + s = c._sfp_list[0] + s.state = sfp.STATE_SW_CONTROL + + # mock poll object + mock_poll = mock.MagicMock() + mock_create_poll.return_value = mock_poll + mock_poll.poll = mock.MagicMock(return_value = []) + + # mock file descriptors for polling + mock_hw_present_file = mock.MagicMock() + mock_power_good_file = mock.MagicMock() + mock_present_file = mock.MagicMock() + mock_hw_present_file.read = mock.MagicMock(return_value=sfp.SFP_STATUS_INSERTED) + mock_hw_present_file.fileno = mock.MagicMock(return_value = 1) + mock_power_good_file.read = mock.MagicMock(return_value=1) + mock_power_good_file.fileno = mock.MagicMock(return_value = 2) + mock_present_file.read = mock.MagicMock(return_value=sfp.SFP_STATUS_INSERTED) + mock_present_file.fileno = mock.MagicMock(return_value = 3) + def get_fd(fd_type): + if fd_type == 'hw_present': + return mock_hw_present_file + elif fd_type == 'power_good': + return mock_power_good_file + else: + return mock_present_file + mock_get_fd.side_effect = get_fd + + timeout = 1000 + # mock time function so that the while loop exit early + mock_time.side_effect = [0, timeout] + + # no event, expect returning empty change event + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and not change_event['sfp'] + + # dummy event, expect returning empty change event + sfp_index = s.sdk_index + 1 + mock_poll.poll.return_value = [(1, 10)] + mock_time.side_effect = [0, timeout] + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and not change_event['sfp'] + + # plug out event, expect returning remove event + mock_time.side_effect = [0, timeout] + mock_hw_present_file.read.return_value = sfp.SFP_STATUS_REMOVED + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == sfp.SFP_STATUS_REMOVED + assert s.state == sfp.STATE_NOT_PRESENT + + # plug in with a fw control cable, expect returning insert event + s.get_control_type = mock.MagicMock(return_value=sfp.SFP_SW_CONTROL) + s.get_hw_present = mock.MagicMock(return_value=True) + s.get_power_on = mock.MagicMock(return_value=True) + s.get_reset_state = mock.MagicMock(return_value=True) + s.get_power_good = mock.MagicMock(return_value=True) + s.determine_control_type = mock.MagicMock(return_value=sfp.SFP_FW_CONTROL) + s.set_control_type = mock.MagicMock() + mock_time.side_effect = [0, timeout] + mock_hw_present_file.read.return_value = sfp.SFP_STATUS_INSERTED + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == sfp.SFP_STATUS_INSERTED + assert s.state == sfp.STATE_FW_CONTROL + assert 1 not in c.registered_fds # stop polling hw_present + assert 2 not in c.registered_fds # stop polling power_good + assert 3 in c.registered_fds # start polling present because it is firmware control + print(c.registered_fds) + + # error event, expect returning error + mock_time.side_effect = [0, timeout] + mock_poll.poll.return_value = [(3, 10)] + mock_present_file.read.return_value = sfp.SFP_STATUS_ERROR + s.get_error_info_from_sdk_error_type = mock.MagicMock(return_value=('2', 'some error')) + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == '2' + assert 'sfp_error' in change_event and sfp_index in change_event['sfp_error'] and change_event['sfp_error'][sfp_index] == 'some error' + + # plug out the firmware control cable, expect returning remove event + mock_time.side_effect = [0, timeout] + mock_present_file.read.return_value = sfp.SFP_STATUS_REMOVED + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == sfp.SFP_STATUS_REMOVED + assert s.state == sfp.STATE_NOT_PRESENT + assert 1 in c.registered_fds # start polling hw_present because cable is not present, always assume software control + assert 2 in c.registered_fds # start polling power_good because cable is not present, always assume software control + assert 3 not in c.registered_fds # stop polling present + + # plug in a software control cable, expect returning insert event + mock_time.side_effect = [0, timeout] + mock_poll.poll.return_value = [(1, 10)] + mock_hw_present_file.read.return_value = sfp.SFP_STATUS_INSERTED + s.determine_control_type.return_value = sfp.SFP_SW_CONTROL + s.check_power_capability = mock.MagicMock(return_value=True) + s.update_i2c_frequency = mock.MagicMock() + s.disable_tx_for_sff_optics = mock.MagicMock() + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == sfp.SFP_STATUS_INSERTED + assert s.state == sfp.STATE_SW_CONTROL + + # power bad event, expect returning error event + mock_time.side_effect = [0, timeout] + mock_poll.poll.return_value = [(2, 10)] + mock_power_good_file.read.return_value = '0' + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == '5' + assert s.state == sfp.STATE_POWER_BAD + + # power good event, expect returning insert event + mock_time.side_effect = [0, timeout] + mock_poll.poll.return_value = [(2, 10)] + mock_power_good_file.read.return_value = '1' + _, change_event = c.get_change_event(timeout) + assert 'sfp' in change_event and sfp_index in change_event['sfp'] and change_event['sfp'][sfp_index] == '1' + assert s.state == sfp.STATE_SW_CONTROL diff --git a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py index ad23cd8dde85..49dfa8ff3fa9 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py @@ -124,6 +124,7 @@ def test_fan(self): chassis._fan_drawer_list = [] assert chassis.get_num_fan_drawers() == 2 + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False)) def test_sfp(self): # Test get_num_sfps, it should not create any SFP objects DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=3) @@ -176,6 +177,7 @@ def test_sfp(self): assert chassis.get_num_sfps() == 6 sonic_platform.chassis.extract_RJ45_ports_index = mock.MagicMock(return_value=[]) + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False)) def test_create_sfp_in_multi_thread(self): DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=3) @@ -199,25 +201,6 @@ def test_create_sfp_in_multi_thread(self): assert s.sdk_index == index iteration_num -= 1 - - @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=3)) - def test_change_event(self): - chassis = Chassis() - chassis.modules_mgmt_thread.is_alive = MagicMock(return_value=True) - chassis.modules_changes_queue.get = MagicMock(return_value={1: '1'}) - - # Call get_change_event with timeout=0, wait until an event is detected - status, event_dict = chassis.get_change_event() - assert status is True - assert 'sfp' in event_dict and event_dict['sfp'][1] == '1' - assert len(chassis._sfp_list) == 3 - - # Call get_change_event with timeout=1.0 - chassis.modules_changes_queue.get.return_value = {} - status, event_dict = chassis.get_change_event(timeout=1.0) - assert status is True - assert 'sfp' in event_dict and not event_dict['sfp'] - @mock.patch('sonic_platform.chassis.Chassis._wait_reboot_cause_ready', MagicMock(return_value=True)) def test_reboot_cause(self): from sonic_platform import utils diff --git a/platform/mellanox/mlnx-platform-api/tests/test_device_data.py b/platform/mellanox/mlnx-platform-api/tests/test_device_data.py index c172b82a30b7..f67793419091 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_device_data.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_device_data.py @@ -54,11 +54,11 @@ def test_get_bios_component(self): @mock.patch('sonic_py_common.device_info.get_paths_to_platform_and_hwsku_dirs', mock.MagicMock(return_value=('', '/tmp'))) @mock.patch('sonic_platform.device_data.utils.read_key_value_file') - def test_is_independent_mode(self, mock_read): + def test_is_module_host_management_mode(self, mock_read): mock_read.return_value = {} - assert not DeviceDataManager.is_independent_mode() + assert not DeviceDataManager.is_module_host_management_mode() mock_read.return_value = {'SAI_INDEPENDENT_MODULE_MODE': '1'} - assert DeviceDataManager.is_independent_mode() + assert DeviceDataManager.is_module_host_management_mode() @mock.patch('sonic_py_common.device_info.get_path_to_platform_dir', mock.MagicMock(return_value='/tmp')) @mock.patch('sonic_platform.device_data.utils.load_json_file') @@ -74,7 +74,7 @@ def test_get_sfp_count(self, mock_load_json): @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=3)) @mock.patch('sonic_platform.device_data.utils.read_int_from_file', mock.MagicMock(return_value=1)) @mock.patch('sonic_platform.device_data.os.path.exists') - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode') + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode') def test_wait_platform_ready(self, mock_is_indep, mock_exists): mock_exists.return_value = True mock_is_indep.return_value = True diff --git a/platform/mellanox/mlnx-platform-api/tests/test_module_initializer.py b/platform/mellanox/mlnx-platform-api/tests/test_module_initializer.py new file mode 100644 index 000000000000..ad833a70f85c --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_module_initializer.py @@ -0,0 +1,98 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys + +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform import chassis +from sonic_platform import module_host_mgmt_initializer + + +class TestModuleInitializer: + @mock.patch('os.path.exists') + @mock.patch('sonic_platform.utils.wait_until') + @mock.patch('sonic_platform.utils.is_host') + def test_wait_module_ready(self, mock_is_host, mock_wait, mock_exists): + initializer = module_host_mgmt_initializer.ModuleHostMgmtInitializer() + mock_is_host.return_value = True + mock_exists.return_value = False + mock_wait.return_value = True + initializer.wait_module_ready() + mock_exists.assert_called_with(module_host_mgmt_initializer.MODULE_READY_HOST_FILE) + assert initializer.initialized + + initializer.initialized = False + mock_is_host.return_value = False + initializer.wait_module_ready() + mock_exists.assert_called_with(module_host_mgmt_initializer.MODULE_READY_CONTAINER_FILE) + + initializer.initialized = False + mock_exists.return_value = True + initializer.wait_module_ready() + assert initializer.initialized + + initializer.initialized = False + mock_wait.return_value = False + mock_exists.return_value = False + initializer.wait_module_ready() + assert not initializer.initialized + + + @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=1)) + @mock.patch('sonic_platform.sfp.SFP.initialize_sfp_modules', mock.MagicMock()) + @mock.patch('sonic_platform.module_host_mgmt_initializer.ModuleHostMgmtInitializer.is_initialization_owner') + @mock.patch('sonic_platform.module_host_mgmt_initializer.ModuleHostMgmtInitializer.wait_module_ready') + @mock.patch('sonic_platform.utils.is_host') + def test_initialize(self, mock_is_host, mock_wait_ready, mock_owner): + c = chassis.Chassis() + initializer = module_host_mgmt_initializer.ModuleHostMgmtInitializer() + mock_is_host.return_value = True + mock_owner.return_value = False + # called from host side, just wait + initializer.initialize(c) + mock_wait_ready.assert_called_once() + mock_wait_ready.reset_mock() + + mock_is_host.return_value = False + # non-initializer-owner called from container side, just wait + initializer.initialize(c) + mock_wait_ready.assert_called_once() + mock_wait_ready.reset_mock() + + mock_owner.return_value = True + initializer.initialize(c) + mock_wait_ready.assert_not_called() + assert initializer.initialized + assert module_host_mgmt_initializer.initialization_owner + assert os.path.exists(module_host_mgmt_initializer.MODULE_READY_CONTAINER_FILE) + + module_host_mgmt_initializer.clean_up() + assert not os.path.exists(module_host_mgmt_initializer.MODULE_READY_CONTAINER_FILE) + + def test_is_initialization_owner(self): + initializer = module_host_mgmt_initializer.ModuleHostMgmtInitializer() + assert not initializer.is_initialization_owner() diff --git a/platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py b/platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py deleted file mode 100644 index d0cab978cf2f..000000000000 --- a/platform/mellanox/mlnx-platform-api/tests/test_modules_mgmt.py +++ /dev/null @@ -1,800 +0,0 @@ -# -# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. -# Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import os -import queue -import sys -import threading -import time -import types -import unittest - -from mock import MagicMock, patch, mock_open, Mock -if sys.version_info.major == 3: - from unittest import mock -else: - import mock - -test_path = os.path.dirname(os.path.abspath(__file__)) -modules_path = os.path.dirname(test_path) -sys.path.insert(0, modules_path) - -from sonic_platform.device_data import DeviceDataManager -from sonic_py_common import device_info -from sonic_platform import modules_mgmt -from sonic_platform.modules_mgmt import ModulesMgmtTask -from sonic_platform_base.sonic_xcvr.api.public.cmis import CmisApi -from sonic_platform_base.sonic_xcvr.xcvr_eeprom import XcvrEeprom -from sonic_platform_base.sonic_xcvr.codes.public.cmis import CmisCodes -from sonic_platform_base.sonic_xcvr.mem_maps.public.cmis import CmisMemMap -from sonic_platform_base.sonic_xcvr.fields import consts - -DEFAULT_NUM_OF_PORTS_1 = 1 -DEFAULT_NUM_OF_PORTS_3 = 3 -DEFAULT_NUM_OF_PORTS_32 = 32 -POLLER_EXECUTED = False - -def _mock_sysfs_default_file_content(): - return { - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0"): "48", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1"): "48", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2"): "48", - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"): "0", - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1"): "0", - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2"): "0", - modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET: "", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT: "48", - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("1"): "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("2"): "1", - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE: "1", - modules_mgmt.PROC_CMDLINE: "" - } - - -mock_file_content = _mock_sysfs_default_file_content() - - -class MockPoller: - - def __init__(self, modules_mgmt_task_stopping_event, modules_mgmt_thrd=None, num_of_ports=3, port_plug_out=False - , feature_enabled=True, warm_reboot=False, port_plug_in=False, sleep_timeout=False): - self.fds_dict = {} - self.poller_iteration_count = 0 - self.modules_mgmt_task_stopping_event = modules_mgmt_task_stopping_event - self.modules_mgmt_thrd = modules_mgmt_thrd - self.num_of_ports = num_of_ports - self.port_plug_out = port_plug_out - self.port_plug_in = port_plug_in - self.feature_enabled = feature_enabled - self.warm_reboot = warm_reboot - self.port_plug_out_changed = False - self.port_plug_in_changed = False - self.sleep_timeout = sleep_timeout - - def register(self, fd, attrs): - self.fds_dict[fd.fileno()] = { fd : attrs } - assert fd.fileno() in self.fds_dict - - def unregister(self, fd): - if fd.fileno() in self.fds_dict.keys(): - del self.fds_dict[fd.fileno()] - assert fd.fileno() not in self.fds_dict.keys() - - def poll(self, timeout=1000): - global POLLER_EXECUTED - assert len(self.modules_mgmt_thrd.sfp_port_dict_initial) == self.num_of_ports - assert self.modules_mgmt_thrd.is_supported_indep_mods_system == self.feature_enabled - # counting the number of poller iterations to know when to do the checks after plug out (and plug in) - # have to check at least on iteration 7 to let ports reach final state - self.poller_iteration_count += 1 - if self.num_of_ports > 0: - if not self.port_plug_out_changed: - if self.port_plug_out: - # return first fd registered with some made up event number 870 - fd_no_to_return = list(self.fds_dict.keys())[0] - fd = list(self.fds_dict[fd_no_to_return].keys())[0] - fd.set_file_int_content(0) - event_to_return = 870 - self.port_plug_out_changed = True - return [(fd_no_to_return, event_to_return)] - if not self.port_plug_in_changed: - if self.port_plug_in: - # return first fd registered with some made up event number 871 - fd_no_to_return = list(self.fds_dict.keys())[0] - fd = list(self.fds_dict[fd_no_to_return].keys())[0] - fd.set_file_int_content(1) - event_to_return = 871 - self.port_plug_in_changed = True - return [(fd_no_to_return, event_to_return)] - if 7 == self.poller_iteration_count: - # when feature is enabled, need to check for each port both power_good and hw_present sysfs for - # cmis non-flat memory cables - num_of_sysfs_to_check = self.num_of_ports if (not self.port_plug_out or not self.feature_enabled - or self.warm_reboot) else self.num_of_ports * 2 - for i in range(num_of_sysfs_to_check): - # when feature is enabled, power_good sysfs is also registered for cmis non-flat memory cables - # so each SW controlled port has 2 fds registered - port_to_test = i if not self.feature_enabled else int(i / 2) - assert self.modules_mgmt_thrd.sfp_port_dict_initial[port_to_test].port_num == port_to_test - assert self.modules_mgmt_thrd.sfp_port_dict_initial[ - port_to_test].initial_state == modules_mgmt.STATE_HW_NOT_PRESENT - if self.feature_enabled: - module_obj = self.modules_mgmt_thrd.fds_mapping_to_obj[list(self.fds_dict.keys())[i]][ - 'module_obj'] - assert module_obj.port_num == port_to_test - if not self.warm_reboot: - # in tests other than warm reboot it creates only SW control ports - if not self.port_plug_out: - assert module_obj.final_state == modules_mgmt.STATE_SW_CONTROL - else: - assert module_obj.final_state == modules_mgmt.STATE_HW_NOT_PRESENT - else: - if not self.port_plug_out: - assert module_obj.final_state == modules_mgmt.STATE_HW_PRESENT - # in warm reboot test with plug out plug in test creates only FW control ports - elif self.port_plug_out and self.port_plug_in: - assert module_obj.final_state == modules_mgmt.STATE_FW_CONTROL - else: - assert module_obj.final_state == modules_mgmt.STATE_HW_NOT_PRESENT - POLLER_EXECUTED = True - self.modules_mgmt_task_stopping_event.set() - if self.sleep_timeout: - time.sleep(timeout/1000) - return [] - - -class MockOpen: - - def __init__(self, name='', file_no=None, indep_mode_supported=True): - self.name = name - self.file_no = file_no - self.indep_mode_supported = indep_mode_supported - self.retint = None - self.curr = 0 - - def read(self): - if self.fileno() in [SAI_PROFILE_FD_FILENO]: - pass - else: - # if return value was changed, i.e. sysfs content changed from 1 to 0 to simulate plug out - if self.retint is not None: - return str(self.retint) - # return default values (can be changed per test) - else: - return mock_file_content[self.name] - - def readline(self): - # if trying to read sai profile file, according to fd fileno - if self.fileno() in [SAI_PROFILE_FD_FILENO]: - if self.indep_mode_supported: - return "SAI_INDEPENDENT_MODULE_MODE=1" - else: - return "" - else: - return mock_file_content[self.name] - - def fileno(self): - return self.file_no - - def seek(self, seek_val): - self.curr = seek_val - - def close(self): - pass - - def write(self, write_val): - self.set_file_int_content(write_val) - - def set_file_int_content(self, retint): - self.retint = str(retint) - mock_file_content[self.name] = str(retint) - - def __enter__(self): - return self - - def __exit__(self, filename, *args, **kwargs): - pass - -class MockPollerStopEvent: - - def __init__(self, modules_mgmt_task_stopping_event, modules_mgmt_thrd=None, num_of_ports=DEFAULT_NUM_OF_PORTS_3 - , feature_enabled=True, ports_connected=True, fw_controlled_ports=False, sleep_timeout=False): - self.fds_dict = {} - self.modules_mgmt_task_stopping_event = modules_mgmt_task_stopping_event - self.modules_mgmt_thrd = modules_mgmt_thrd - self.num_of_ports = num_of_ports - self.feature_enabled = feature_enabled - self.ports_connected = ports_connected - self.sleep_timeout = sleep_timeout - self.fw_controlled_ports = fw_controlled_ports - - def register(self, fd, attrs): - self.fds_dict[fd.fileno()] = 1 & attrs - assert fd.fileno() in self.fds_dict - - def poll(self, timeout=0): - assert len(self.modules_mgmt_thrd.sfp_port_dict_initial) == self.num_of_ports - assert self.modules_mgmt_thrd.is_supported_indep_mods_system == self.feature_enabled - global POLLER_EXECUTED - if self.num_of_ports > 0: - # when feature is enabled, need to check for each port both power_good and hw_present sysfs for - # cmis non-flat memory cables - ports_to_test = self.num_of_ports if (not self.feature_enabled or not self.ports_connected - or self.fw_controlled_ports) else self.num_of_ports * 2 - for i in range(ports_to_test): - # when feature is enabled, power_good sysfs is also registered for cmis non-flat memory cables - port_to_test = i if (not self.feature_enabled or not self.ports_connected - or self.fw_controlled_ports) else int(i / 2) - assert self.modules_mgmt_thrd.sfp_port_dict_initial[port_to_test].port_num == port_to_test - assert self.modules_mgmt_thrd.sfp_port_dict_initial[port_to_test].initial_state == modules_mgmt.STATE_HW_NOT_PRESENT - module_obj = self.modules_mgmt_thrd.fds_mapping_to_obj[list(self.fds_dict.keys())[i]]['module_obj'] - assert module_obj.port_num == port_to_test - if self.ports_connected: - if self.feature_enabled: - if self.fw_controlled_ports: - assert module_obj.final_state == modules_mgmt.STATE_FW_CONTROL - else: - assert module_obj.final_state == modules_mgmt.STATE_SW_CONTROL - else: - assert module_obj.final_state == modules_mgmt.STATE_HW_PRESENT - else: - assert module_obj.final_state == modules_mgmt.STATE_HW_NOT_PRESENT - POLLER_EXECUTED = True - else: - POLLER_EXECUTED = True - self.modules_mgmt_task_stopping_event.set() - if self.sleep_timeout: - time.sleep(timeout/1000) - return [] - - -def _mock_is_file_indep_mode_disabled_content(): - return { - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL: True, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"): True, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"): True, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"): True, - '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : True - } - -mock_is_file_indep_mode_disabled_content = _mock_is_file_indep_mode_disabled_content() - -def mock_is_file_indep_mode_disabled(file_path, **kwargs): - return mock_is_file_indep_mode_disabled_content[file_path] - -def _mock_is_file_indep_mode_enabled_content(): - return { - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT: True, - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL: True, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"): True, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"): True, - '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : True - } - -mock_is_file_indep_mode_enabled_content = _mock_is_file_indep_mode_enabled_content() - - -def mock_is_file_indep_mode_enabled(file_path, **kwargs): - return mock_is_file_indep_mode_enabled_content[file_path] - - -def mock_read_int_from_file(filename, *args): - return_dict = { - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : 1, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : 1, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : 1 - } - - return return_dict[filename] - - -class MockXcvrEeprom(): - def __init__(self, is_flat_memory, mem_map): - self.is_flat_memory = is_flat_memory - self.mem_map = mem_map - - def is_cmis_api(self): - return self.is_cmis_api - - def is_flat_memory(self): - return self.is_flat_memory - - def read(self, field): - if consts.FLAT_MEM_FIELD == field: - return 0 if self.is_flat_memory else 1 - else: - return 0 - - -class MockXcvrapi: - def __init__(self, is_cmis_api=True, is_flat_memory_bool=False): - self.is_cmis_api = is_cmis_api - self.is_flat_memory_bool = is_flat_memory_bool - self.xcvr_eeprom = MagicMock(autospec=XcvrEeprom, return_value=MockXcvrEeprom(is_flat_memory_bool, CmisMemMap(CmisCodes))) - - def is_flat_memory(self): - return self.is_flat_memory_bool - - def xcvr_eeprom(self): - return self.xcvr_eeprom - - -class MockSFPxcvrapi: - def __init__(self, xcvr_api_is_cmis_api=True, xcvr_eeprom_is_flat_memory=False): - self.xcvr_api = Mock(spec=CmisApi(MockXcvrEeprom(False, CmisMemMap(CmisCodes))), return_value=MockXcvrapi(xcvr_api_is_cmis_api, xcvr_eeprom_is_flat_memory)) - self.xcvr_api_is_cmis_api = xcvr_api_is_cmis_api - self.xcvr_eeprom_is_flat_memory = xcvr_eeprom_is_flat_memory - self.xcvr_api.is_flat_memory = types.MethodType(self.is_flat_memory, self) - - def get_xcvr_api(self): - return self.xcvr_api - - def is_flat_memory(self, ref): - return self.xcvr_eeprom_is_flat_memory - - -def check_power_cap(port, module_sm_obj): - pass - -SAI_PROFILE_FD_FILENO = 99 - - -class TestModulesMgmt(unittest.TestCase): - """Test class to test modules_mgmt.py. The test cases covers: - 1. cables detection for 1 to 3 ports - feature disabled / enabled / poller - 2. cable disconnection - plug out - 3. cable reconnection - plug in - 4. warm reboot normal flow with FW ports - 5. warm reboot flow with FW ports plugged out - 6. warm reboot flow with FW ports plugged out and then plugged in (stays FW controlled, no SFP mock change) - 7. test 32 FW controlled (non cmis flat mem) cables powered off - 8. test 32 SW controlled (cmis active non flat mem) cables powered off - """ - - def _mock_sysfs_file_content(self): - return { - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE : "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD : "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON : "0", - modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET : "", - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT : "48", - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL : "1", - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : "1", - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : "1", - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : "1", - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"): "0" - } - - def mock_open_builtin(self, file_name, feature_enabled=True): - return_dict = { - (modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"), 'r') : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"), 100), - (modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"), 'r') : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"), 101), - (modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"), 'r') : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"), 102), - '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : MockOpen('//usr/share/sonic/platform/ACS-MSN4700/sai.profile' - , SAI_PROFILE_FD_FILENO, feature_enabled), - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0"), 100), - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1"), 101), - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : MockOpen(modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2"), 102), - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0"), 0), - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1"), 1), - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2"), 2), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0"), 200), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1"), 201), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2"), 202), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0"), 300), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1"), 301), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2"), 302), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0"), 500), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1"), 501), - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2"), 502), - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0"), 602), - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1"), 602), - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2"): MockOpen(modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2"), 602), - modules_mgmt.PROC_CMDLINE: MockOpen(modules_mgmt.PROC_CMDLINE, self.fd_number_by_fd_name_dict[modules_mgmt.PROC_CMDLINE]) - } - return return_dict[file_name] - - # side effects are used in mock when want to create different mocks per variable, i.e. here it's filename - # see below mock_open_new_side_effect_poller_test where returning a new MockOpen passing it the filename - def mock_open_new_side_effect_feature_disabled(self, filename, *args, **kwargs): - mock_context = MagicMock() - mock_context.__enter__.return_value = self.mock_open_builtin(filename, False) - mock_context.__exit__.return_value = False - return mock_context - - def mock_open_new_side_effect_feature_enabled(self, filename, *args, **kwargs): - mock_context = MagicMock() - mock_context.__enter__.return_value = self.mock_open_builtin(filename) - mock_context.__exit__.return_value = False - return mock_context - - def mock_open_new_side_effect_poller_test(self, filename, *args, **kwargs): - if filename in ['//usr/share/sonic/platform/ACS-MSN4700/sai.profile']: - mock_context = MagicMock() - mock_context.__enter__.return_value = MockOpen(filename, SAI_PROFILE_FD_FILENO) - mock_context.__exit__.return_value = False - return mock_context - else: - mock_context = MagicMock() - mock_open_new = MockOpen(filename, self.fd_number_by_fd_name_dict[filename]) - mock_context.return_value = mock_open_new - mock_context.__enter__.return_value = mock_open_new - mock_context.__exit__.return_value = False - if 'hw_present' in filename or 'power_on' in filename or 'freq' in filename or 'control' in filename: - return mock_context - else: - return mock_context.return_value - - def mock_open_new_side_effect_warm_reboot(self, filename, *args, **kwargs): - if filename in ['//usr/share/sonic/platform/ACS-MSN4700/sai.profile']: - mock_context = MagicMock() - mock_context.__enter__.return_value = MockOpen(filename, SAI_PROFILE_FD_FILENO) - mock_context.__exit__.return_value = False - return mock_context - else: - mock_open_new = MockOpen(filename, self.fd_number_by_fd_name_dict[filename]) - return mock_open_new - - def setUp(cls): - cls.modules_mgmt_task_stopping_event = threading.Event() - cls.modules_changes_queue = queue.Queue() - global POLLER_EXECUTED - POLLER_EXECUTED = False - # start modules_mgmt thread and the test in poller part - cls.modules_mgmt_thrd = ModulesMgmtTask(main_thread_stop_event=cls.modules_mgmt_task_stopping_event, - q=cls.modules_changes_queue) - cls.modules_mgmt_thrd.check_power_cap = check_power_cap - assert cls.modules_mgmt_thrd.sfp_port_dict_initial == {} - - @classmethod - def setup_class(cls): - os.environ["MLNX_PLATFORM_API_UNIT_TESTING"] = "1" - cls.fd_number_by_fd_name_dict = { - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("0") : 100, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("1") : 101, - modules_mgmt.SYSFS_LEGACY_FD_PRESENCE.format("2") : 102, - '//usr/share/sonic/platform/ACS-MSN4700/sai.profile' : SAI_PROFILE_FD_FILENO, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("0") : 0, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("1") : 1, - modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format("2") : 2, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("0") : 200, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("1") : 201, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format("2") : 202, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("0") : 300, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("1") : 301, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format("2") : 302, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("0") : 500, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("1") : 501, - modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_LIMIT.format("2") : 502, - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("0") : 600, - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("1") : 601, - modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format("2") : 602, - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0") : 700, - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("1") : 701, - modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("2") : 702, - modules_mgmt.PROC_CMDLINE : 800 - } - # mock the directory holding relevant sai.profile - device_info.get_paths_to_platform_and_hwsku_dirs = mock.MagicMock(return_value=('', '/usr/share/sonic/platform/ACS-MSN4700')) - - - @patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3)) - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_disabled)) - @patch('sonic_platform.utils.read_int_from_file', MagicMock(side_effect=mock_read_int_from_file)) - @patch('builtins.open', spec=open) - def test_mdf_all_ports_feature_disabled(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_feature_disabled - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, feature_enabled=False))): - self.modules_mgmt_thrd.run() - - @patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3)) - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) - def test_mdf_all_ports_feature_enabled(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_feature_enabled - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) - def test_modules_mgmt_poller_events_3_ports(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) - def test_modules_mgmt_poller_events_single_port(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports))): - #with patch('builtins.open', MagicMock(side_effect=self.mock_open_new_side_effect_poller_test)): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_normal_warm_reboot(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_warm_reboot - # mock /proc/cmdline with warm reboot boot type key value - mock_file_content[modules_mgmt.PROC_CMDLINE] = f'{modules_mgmt.CMDLINE_STR_TO_LOOK_FOR}{modules_mgmt.CMDLINE_VAL_TO_LOOK_FOR}' - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - # set the port to start with FW controlled before warm reboot takes place - mock_file_content[modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0")] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPoller(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, warm_reboot=True))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_plug_out_fw_cable_after_warm_reboot(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_warm_reboot - # mock /proc/cmdline with warm reboot boot type key value - mock_file_content[modules_mgmt.PROC_CMDLINE] = f'{modules_mgmt.CMDLINE_STR_TO_LOOK_FOR}{modules_mgmt.CMDLINE_VAL_TO_LOOK_FOR}' - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - - # set the port to start with FW controlled before warm reboot takes place - mock_file_content[modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0")] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPoller(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, port_plug_out=True, warm_reboot=True))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_plug_out_plug_in_fw_cable_after_warm_reboot(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_warm_reboot - # mock /proc/cmdline with warm reboot boot type key value - mock_file_content[modules_mgmt.PROC_CMDLINE] = f'{modules_mgmt.CMDLINE_STR_TO_LOOK_FOR}{modules_mgmt.CMDLINE_VAL_TO_LOOK_FOR}' - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - - mock_file_content[modules_mgmt.SYSFS_INDEPENDENT_FD_FW_CONTROL.format("0")] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPoller(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, port_plug_out=True, warm_reboot=True, port_plug_in=True))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_no_ports(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=0) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == 0 - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_ports_disconnected(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_3) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_3 - - # update hw_present sysfs with value of 0 for each port - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f"{i}") - mock_file_content[modules_sysfs] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, ports_connected=False))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_bad_flows_port_disconnected(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - - # update hw_present sysfs with value of 0 for each port - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f"{i}") - mock_file_content[modules_sysfs] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, ports_connected=False))): - self.modules_mgmt_thrd.run() - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_bad_flows_power_good(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_1) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_1 - - # update power_good sysfs with value of 0 for each port - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f"{i}") - mock_file_content[modules_sysfs] = "0" - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, ports_connected=False))): - self.modules_mgmt_thrd.run() - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f"{i}") - mock_file_content[modules_sysfs] = "1" - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi(False, True))) - def test_modules_mgmt_bad_flows_ports_powered_off_fw_controlled(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_32) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_32 - - # create or update different sysfs and is_file mocking with relevant value for each port - for i in range(num_of_tested_ports): - # mock power_on sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") - mock_file_content[modules_sysfs] = "0" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 300 + i - # mock hw_presence sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f'{i}') - mock_file_content[modules_sysfs] = "1" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = i - # mock power_good sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f'{i}') - mock_file_content[modules_sysfs] = "1" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 200 + i - # mock hw_reset sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET.format(f'{i}') - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 400 + i - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports, fw_controlled_ports=True))): - self.modules_mgmt_thrd.run() - - # change power_on sysfs values back to the default ones - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") - mock_file_content[modules_sysfs] = "1" - - @patch('os.path.isfile', MagicMock(side_effect=mock_is_file_indep_mode_enabled)) - @patch('builtins.open', spec=open) - @patch('sonic_platform.sfp.SFP', MagicMock(return_value=MockSFPxcvrapi())) - def test_modules_mgmt_bad_flows_ports_powered_off_sw_controlled(self, mock_open): - mock_open.side_effect = self.mock_open_new_side_effect_poller_test - DeviceDataManager.get_sfp_count = mock.MagicMock(return_value=DEFAULT_NUM_OF_PORTS_32) - num_of_tested_ports = DeviceDataManager.get_sfp_count() - assert num_of_tested_ports == DEFAULT_NUM_OF_PORTS_32 - - # create or update different sysfs and is_file mocking with relevant value for each port - for i in range(num_of_tested_ports): - # mock power_on sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") - mock_file_content[modules_sysfs] = "0" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 300 + i - # mock hw_presence sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_PRESENCE.format(f'{i}') - mock_file_content[modules_sysfs] = "1" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = i - # mock power_good sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_GOOD.format(f'{i}') - mock_file_content[modules_sysfs] = "1" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 200 + i - # mock hw_reset sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_HW_RESET.format(f'{i}') - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 400 + i - # mock frequency_support sysfs for all ports - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_FREQ_SUPPORT.format(f'{i}') - mock_file_content[modules_sysfs] = "0" - mock_is_file_indep_mode_enabled_content[modules_sysfs] = True - self.fd_number_by_fd_name_dict[modules_sysfs] = 600 + i - - # start modules_mgmt thread and the test in poller part - with patch('select.poll', MagicMock(return_value=MockPollerStopEvent(self.modules_mgmt_task_stopping_event - , self.modules_mgmt_thrd, num_of_tested_ports))): - self.modules_mgmt_thrd.run() - - # change power_on sysfs values back to the default ones - for i in range(num_of_tested_ports): - modules_sysfs = modules_mgmt.SYSFS_INDEPENDENT_FD_POWER_ON.format(f"{i}") - mock_file_content[modules_sysfs] = "1" - - def tearDown(cls): - mock_file_content[modules_mgmt.PROC_CMDLINE] = '' - cls.modules_mgmt_thrd = None - # a check that modules mgmt thread ran and got into the poller part where the tests here has all checks - assert POLLER_EXECUTED diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 748a9c7141b3..98246c2959a4 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -61,10 +61,7 @@ def test_sfp_index(self, mock_max_port): @mock.patch('sonic_platform.chassis.Chassis.get_num_sfps', mock.MagicMock(return_value=2)) @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) def test_sfp_get_error_status(self, mock_get_error_code, mock_control): - chassis = Chassis() - - # Fetch an SFP module to test - sfp = chassis.get_sfp(1) + sfp = SFP(1) mock_control.return_value = False description_dict = sfp._get_error_description_dict() for error in description_dict.keys(): @@ -248,18 +245,14 @@ def test_get_page_and_page_offset(self, mock_get_type_str, mock_eeprom_path, moc assert page == '/tmp/1/data' assert page_offset is 0 - @mock.patch('sonic_platform.sfp.SFP.is_sw_control') @mock.patch('sonic_platform.sfp.SFP._read_eeprom') - def test_sfp_get_presence(self, mock_read, mock_control): + def test_sfp_get_presence(self, mock_read): sfp = SFP(0) mock_read.return_value = None assert not sfp.get_presence() mock_read.return_value = 0 assert sfp.get_presence() - - mock_control.side_effect = RuntimeError('') - assert not sfp.get_presence() @mock.patch('sonic_platform.utils.read_int_from_file') def test_rj45_get_presence(self, mock_read_int): @@ -361,34 +354,20 @@ def test_get_temperature_threshold(self): assert sfp.get_temperature_warning_threshold() == 75.0 assert sfp.get_temperature_critical_threshold() == 85.0 - @mock.patch('sonic_platform.sfp.NvidiaSFPCommon.get_logical_port_by_sfp_index') @mock.patch('sonic_platform.utils.read_int_from_file') - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode') - @mock.patch('sonic_platform.utils.DbUtils.get_db_instance') - def test_is_sw_control(self, mock_get_db, mock_mode, mock_read, mock_get_logical): + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode') + def test_is_sw_control(self, mock_mode, mock_read): sfp = SFP(0) mock_mode.return_value = False assert not sfp.is_sw_control() mock_mode.return_value = True - mock_get_logical.return_value = None - with pytest.raises(Exception): - sfp.is_sw_control() - - mock_get_logical.return_value = 'Ethernet0' - mock_db = mock.MagicMock() - mock_get_db.return_value = mock_db - mock_db.exists = mock.MagicMock(return_value=False) - with pytest.raises(Exception): - sfp.is_sw_control() - - mock_db.exists.return_value = True mock_read.return_value = 0 assert not sfp.is_sw_control() mock_read.return_value = 1 assert sfp.is_sw_control() - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=False)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.sfp.SFP.is_sw_control', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.utils.is_host', mock.MagicMock(side_effect = [True, True, False, False])) @mock.patch('subprocess.check_output', mock.MagicMock(side_effect = ['True', 'False'])) @@ -401,7 +380,7 @@ def test_get_lpmode(self): assert sfp.get_lpmode() assert not sfp.get_lpmode() - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=False)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.sfp.SFP.is_sw_control', mock.MagicMock(return_value=False)) @mock.patch('sonic_platform.utils.is_host', mock.MagicMock(side_effect = [True, True, False, False])) @mock.patch('subprocess.check_output', mock.MagicMock(side_effect = ['True', 'False'])) @@ -414,7 +393,7 @@ def test_set_lpmode(self): assert sfp.set_lpmode(False) assert not sfp.set_lpmode(False) - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=True)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=True)) @mock.patch('sonic_platform.utils.read_int_from_file') @mock.patch('sonic_platform.sfp.SFP.is_sw_control') def test_get_lpmode_cmis_host_mangagement(self, mock_control, mock_read): @@ -438,7 +417,7 @@ def test_get_lpmode_cmis_host_mangagement(self, mock_control, mock_read): mock_read.return_value = 2 assert not sfp.get_lpmode() - @mock.patch('sonic_platform.device_data.DeviceDataManager.is_independent_mode', mock.MagicMock(return_value=True)) + @mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=True)) @mock.patch('sonic_platform.sfp.SFP.is_sw_control') def test_set_lpmode_cmis_host_mangagement(self, mock_control): mock_control.return_value = True @@ -455,3 +434,115 @@ def test_set_lpmode_cmis_host_mangagement(self, mock_control): mock_control.return_value = False assert not sfp.set_lpmode(True) assert not sfp.set_lpmode(False) + + def test_determine_control_type(self): + sfp = SFP(0) + sfp.get_xcvr_api = mock.MagicMock(return_value=None) + assert sfp.determine_control_type() == 0 + + sfp.get_xcvr_api.return_value = 1 # Just make it not None + sfp.is_supported_for_software_control = mock.MagicMock(return_value=True) + assert sfp.determine_control_type() == 1 + + sfp.is_supported_for_software_control.return_value = False + assert sfp.determine_control_type() == 0 + + def test_check_power_capability(self): + sfp = SFP(0) + sfp.get_module_max_power = mock.MagicMock(return_value=-1) + assert not sfp.check_power_capability() + + sfp.get_module_max_power.return_value = 48 + sfp.get_power_limit = mock.MagicMock(return_value=48) + assert sfp.check_power_capability() + + sfp.get_power_limit.return_value = 1 + assert not sfp.check_power_capability() + + def test_get_module_max_power(self): + sfp = SFP(0) + sfp.is_cmis_api = mock.MagicMock(return_value=True) + sfp.read_eeprom = mock.MagicMock(return_value=bytearray([48])) + assert sfp.get_module_max_power() == 48 + + sfp.is_cmis_api.return_value = False + sfp.is_sff_api = mock.MagicMock(return_value=True) + sfp.read_eeprom.return_value = bytearray([128]) + assert sfp.get_module_max_power() == 2.5 * 4 + + sfp.read_eeprom.return_value = bytearray([32]) + assert sfp.get_module_max_power() == 3.2 * 4 + + # Simulate invalid value + sfp.read_eeprom.return_value = bytearray([33]) + assert sfp.get_module_max_power() == -1 + + # Simulate unsupported module type + sfp.is_sff_api .return_value = False + assert sfp.get_module_max_power() == -1 + + def test_update_i2c_frequency(self): + sfp = SFP(0) + sfp.get_frequency_support = mock.MagicMock(return_value=False) + sfp.set_frequency = mock.MagicMock() + sfp.update_i2c_frequency() + sfp.set_frequency.assert_not_called() + + sfp.get_frequency_support.return_value = True + sfp.update_i2c_frequency() + sfp.set_frequency.assert_not_called() + + sfp.is_cmis_api = mock.MagicMock(return_value=True) + sfp.read_eeprom = mock.MagicMock(return_value=bytearray([0])) + sfp.update_i2c_frequency() + sfp.set_frequency.assert_called_with(0) + + sfp.is_cmis_api.return_value = False + sfp.is_sff_api = mock.MagicMock(return_value=True) + sfp.update_i2c_frequency() + sfp.set_frequency.assert_called_with(0) + + def test_disable_tx_for_sff_optics(self): + sfp = SFP(0) + mock_api = mock.MagicMock() + sfp.get_xcvr_api = mock.MagicMock(return_value=mock_api) + mock_api.tx_disable = mock.MagicMock() + sfp.disable_tx_for_sff_optics() + mock_api.tx_disable.assert_not_called() + + sfp.is_sff_api = mock.MagicMock(return_value=True) + mock_api.get_tx_disable_support = mock.MagicMock(return_value=True) + sfp.disable_tx_for_sff_optics() + mock_api.tx_disable.assert_called_with(True) + + @mock.patch('sonic_platform.utils.read_int_from_file') + def test_get_error_info_from_sdk_error_type(self, mock_read): + sfp = SFP(0) + # Unknown error + mock_read.return_value = -1 + sfp_state, error_desc = sfp.get_error_info_from_sdk_error_type() + assert sfp_state == '2' + assert 'Unknown error' in error_desc + + mock_read.return_value = 2 + sfp_state, error_desc = sfp.get_error_info_from_sdk_error_type() + assert sfp_state == '11' + assert error_desc is None + + @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=1)) + def test_initialize_sfp_modules(self): + c = Chassis() + c.initialize_sfp() + s = c._sfp_list[0] + s.get_hw_present = mock.MagicMock(return_value=True) + s.get_power_on = mock.MagicMock(return_value=False) + s.get_reset_state = mock.MagicMock(return_value=True) + s.get_power_good = mock.MagicMock(return_value=True) + s.determine_control_type = mock.MagicMock(return_value=1) # software control + s.set_control_type = mock.MagicMock() + SFP.initialize_sfp_modules(c._sfp_list) + assert s.in_stable_state() + SFP.wait_ready_task.stop() + SFP.wait_ready_task.join() + SFP.wait_ready_task = None diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp_event.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp_event.py deleted file mode 100644 index ef4820ecfd8f..000000000000 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp_event.py +++ /dev/null @@ -1,61 +0,0 @@ -# -# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. -# Apache-2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import sys - -from mock import MagicMock, patch - -test_path = os.path.dirname(os.path.abspath(__file__)) -modules_path = os.path.dirname(test_path) -sys.path.insert(0, modules_path) - -from sonic_platform_base.sfp_base import SfpBase - -class TestSfpEvent(object): - @classmethod - def setup_class(cls): - os.environ["MLNX_PLATFORM_API_UNIT_TESTING"] = "1" - - @patch('select.select', MagicMock(return_value=([99], None, None))) - def test_check_sfp_status(self): - from sonic_platform.sfp_event import SDK_SFP_STATE_IN, SDK_SFP_STATE_OUT, SDK_SFP_STATE_ERR - from sonic_platform.sfp_event import SDK_ERRORS_TO_ERROR_BITS, SDK_ERRORS_TO_DESCRIPTION, SDK_SFP_BLOCKING_ERRORS - - self.executor(SDK_SFP_STATE_IN, None, SfpBase.SFP_STATUS_BIT_INSERTED) - self.executor(SDK_SFP_STATE_OUT, None, SfpBase.SFP_STATUS_BIT_REMOVED) - for error_type, error_status in SDK_ERRORS_TO_ERROR_BITS.items(): - description = SDK_ERRORS_TO_DESCRIPTION.get(error_type) - if error_type in SDK_SFP_BLOCKING_ERRORS: - error_status |= SfpBase.SFP_ERROR_BIT_BLOCKING - error_status |= SfpBase.SFP_STATUS_BIT_INSERTED - self.executor(SDK_SFP_STATE_ERR, error_type, error_status, description) - - def executor(self, mock_module_state, mock_error_type, expect_status, description=None): - from sonic_platform.sfp_event import sfp_event - - event = sfp_event() - event.on_pmpe = MagicMock(return_value=(True, [0,1], mock_module_state, mock_error_type)) - port_change = {} - error_dict = {} - found = event.check_sfp_status(port_change, error_dict, 0) - assert found - expect_status_str = str(expect_status) - assert 1 in port_change and port_change[1] == expect_status_str - assert 2 in port_change and port_change[2] == expect_status_str - if description: - assert 1 in error_dict and error_dict[1] == description - assert 2 in error_dict and error_dict[2] == description diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py new file mode 100644 index 000000000000..9f2154173d32 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp_sm.py @@ -0,0 +1,170 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform import sfp +from sonic_platform import utils + +origin_read = utils.read_from_file +origin_write = utils.write_file + + +class TestSfpStateMachine: + PATH_PREFIX = '/sys/module/sx_core/asic0/module0' + mock_file_content = {} + + @classmethod + def setup_class(cls): + utils.read_from_file = cls.mock_read + utils.write_file = cls.mock_write + + @classmethod + def teardown_class(cls): + utils.read_from_file = origin_read + utils.write_file = origin_write + + @classmethod + def mock_value(cls, file_name, value): + cls.mock_file_content[f'{cls.PATH_PREFIX}/{file_name}'] = value + + @classmethod + def get_value(cls, file_name): + return cls.mock_file_content[f'{cls.PATH_PREFIX}/{file_name}'] + + @classmethod + def mock_write(cls, file_path, value, *args, **kwargs): + cls.mock_file_content[file_path] = value + + @classmethod + def mock_read(cls, file_path, *args, **kwargs): + return cls.mock_file_content[file_path] + + def test_warm_reboot_from_fw_control(self): + self.mock_value('control', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_FW_CONTROL + + def test_no_hw_present(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_NOT_PRESENT + + def test_not_powered(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_RESETTING + assert self.get_value('power_on') == 1 + assert self.get_value('hw_reset') == 1 + assert 0 in sfp.SFP.get_wait_ready_task()._wait_dict + sfp.SFP.get_wait_ready_task()._wait_dict.pop(0) + + def test_in_reset_state(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_RESETTING + assert self.get_value('hw_reset') == 1 + assert 0 in sfp.SFP.get_wait_ready_task()._wait_dict + s.on_event(sfp.EVENT_NOT_PRESENT) + assert s.get_state() == sfp.STATE_NOT_PRESENT + assert 0 not in sfp.SFP.get_wait_ready_task()._wait_dict + + def test_reset_done(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 0) + self.mock_value('power_good', 1) + s = sfp.SFP(0) + s.determine_control_type = mock.MagicMock(return_value=sfp.SFP_FW_CONTROL) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_RESETTING + s.on_event(sfp.EVENT_RESET_DONE) + assert s.get_state() == sfp.STATE_FW_CONTROL + + def test_no_power_good(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 1) + self.mock_value('power_good', 0) + s = sfp.SFP(0) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_POWER_BAD + s.on_event(sfp.EVENT_NOT_PRESENT) + assert s.get_state() == sfp.STATE_NOT_PRESENT + + def test_fw_control(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 1) + self.mock_value('power_good', 1) + s = sfp.SFP(0) + s.determine_control_type = mock.MagicMock(return_value=sfp.SFP_FW_CONTROL) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_FW_CONTROL + assert self.get_value('control') == sfp.SFP_FW_CONTROL + + def test_power_exceed(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 1) + self.mock_value('power_good', 1) + s = sfp.SFP(0) + s.determine_control_type = mock.MagicMock(return_value=sfp.SFP_SW_CONTROL) + s.check_power_capability = mock.MagicMock(return_value=False) + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_POWER_LIMIT_ERROR + assert self.get_value('power_on') == 0 + assert self.get_value('hw_reset') == 0 + s.on_event(sfp.EVENT_NOT_PRESENT) + assert s.get_state() == sfp.STATE_NOT_PRESENT + + def test_sw_control(self): + self.mock_value('control', 1) + self.mock_value('hw_present', 1) + self.mock_value('power_on', 1) + self.mock_value('hw_reset', 1) + self.mock_value('power_good', 1) + s = sfp.SFP(0) + s.determine_control_type = mock.MagicMock(return_value=sfp.SFP_SW_CONTROL) + s.check_power_capability = mock.MagicMock(return_value=True) + s.update_i2c_frequency = mock.MagicMock() + s.disable_tx_for_sff_optics = mock.MagicMock() + s.on_event(sfp.EVENT_START) + assert s.get_state() == sfp.STATE_SW_CONTROL diff --git a/platform/mellanox/mlnx-platform-api/tests/test_statemachine.py b/platform/mellanox/mlnx-platform-api/tests/test_statemachine.py new file mode 100644 index 000000000000..f2193a6866d4 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_statemachine.py @@ -0,0 +1,137 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import pytest +import sys + +from mock import MagicMock +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform import state_machine + +STATE_DOWN = 'Down' +STATE_INIT = 'Initializing' +STATE_UP = 'Up' + +ACTION_LEAVE_DOWN = 'Leave Down' +ACTION_INIT = 'Initializing' +ACTION_UP = 'Up' + +EVENT_START = 'Start' +EVENT_INIT_DONE = 'Initialize Done' +EVENT_STOP = 'Stop' + +class StateEntity: + def __init__(self): + self.state = STATE_DOWN + self.current_action = None + self.triggered_actions = [] + + def get_state(self): + return self.state + + def change_state(self, new_state): + self.state = new_state + + def on_event(self, event): + pass + + def on_action(self, action_name): + self.current_action = action_name + self.triggered_actions.append(action_name) + + +class TestStateMachine: + sm = None + @classmethod + def setup_class(cls): + sm = state_machine.StateMachine() + sm.add_state(STATE_DOWN).set_leave_action(ACTION_LEAVE_DOWN) \ + .add_transition(EVENT_START, STATE_INIT) + sm.add_state(STATE_INIT).set_entry_action(ACTION_INIT) \ + .add_transition(EVENT_INIT_DONE, STATE_UP) \ + .add_transition(EVENT_STOP, STATE_DOWN) + sm.add_state(STATE_UP).set_entry_action(ACTION_UP) \ + .add_transition(EVENT_STOP, STATE_DOWN) + cls.sm = sm + + def test_state_machine(self): + state_entity = StateEntity() + + # Start + self.sm.on_event(state_entity, EVENT_START) + assert state_entity.triggered_actions == [ACTION_LEAVE_DOWN, ACTION_INIT] + assert state_entity.get_state() == STATE_INIT + + # Initialize done + self.sm.on_event(state_entity, EVENT_INIT_DONE) + assert state_entity.current_action == ACTION_UP + assert state_entity.get_state() == STATE_UP + + # Stop + self.sm.on_event(state_entity, EVENT_STOP) + assert state_entity.get_state() == STATE_DOWN + + # Quick start/stop + self.sm.on_event(state_entity, EVENT_START) + self.sm.on_event(state_entity, EVENT_STOP) + assert state_entity.get_state() == STATE_DOWN + + # Event not defined for this state, state machine should ignore it + self.sm.on_event(state_entity, EVENT_STOP) + assert state_entity.get_state() == STATE_DOWN + + def test_unknown_state(self): + state_entity = StateEntity() + state_entity.state = 'unknown' + with pytest.raises(RuntimeError): + # Trigger unknown event + self.sm.on_event(state_entity, EVENT_START) + + def test_duplicate_state(self): + sm = state_machine.StateMachine() + sm.add_state(STATE_DOWN) + with pytest.raises(RuntimeError): + # Add duplicate state + sm.add_state(STATE_DOWN) + + def test_duplicate_transition(self): + sm = state_machine.StateMachine() + with pytest.raises(RuntimeError): + # Add duplicate transition + sm.add_state(STATE_DOWN) \ + .add_transition(EVENT_START, STATE_INIT) \ + .add_transition(EVENT_START, STATE_INIT) + + def test_unknown_transition_target(self): + sm = state_machine.StateMachine() + # Add unknown transition target + sm.add_state(STATE_DOWN) \ + .add_transition(EVENT_START, 'unknown') + + state_entity = StateEntity() + with pytest.raises(RuntimeError): + sm.on_event(state_entity, EVENT_START) + \ No newline at end of file diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py index 8e7509ce9b69..c135395c363b 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal_updater.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -61,10 +61,8 @@ def test_load_tc_config_mocked(self): @mock.patch('sonic_platform.thermal_updater.ThermalUpdater.update_asic', mock.MagicMock()) @mock.patch('sonic_platform.thermal_updater.ThermalUpdater.update_module', mock.MagicMock()) - @mock.patch('sonic_platform.thermal_updater.ThermalUpdater.wait_all_sfp_ready') @mock.patch('sonic_platform.utils.write_file') - def test_start_stop(self, mock_write, mock_wait): - mock_wait.return_value = True + def test_start_stop(self, mock_write): mock_sfp = mock.MagicMock() mock_sfp.sdk_index = 1 updater = ThermalUpdater([mock_sfp]) @@ -77,21 +75,6 @@ def test_start_stop(self, mock_write, mock_wait): assert not updater._timer.is_alive() mock_write.assert_called_once_with('/run/hw-management/config/suspend', 1) - mock_wait.return_value = False - mock_write.reset_mock() - updater.start() - mock_write.assert_called_once_with('/run/hw-management/config/suspend', 1) - updater.stop() - - @mock.patch('sonic_platform.thermal_updater.time.sleep', mock.MagicMock()) - def test_wait_all_sfp_ready(self): - mock_sfp = mock.MagicMock() - mock_sfp.is_sw_control = mock.MagicMock(return_value=True) - updater = ThermalUpdater([mock_sfp]) - assert updater.wait_all_sfp_ready() - mock_sfp.is_sw_control.side_effect = Exception('') - assert not updater.wait_all_sfp_ready() - @mock.patch('sonic_platform.utils.read_int_from_file') def test_update_asic(self, mock_read): mock_read.return_value = 8 diff --git a/platform/mellanox/mlnx-platform-api/tests/test_wait_sfp_ready_task.py b/platform/mellanox/mlnx-platform-api/tests/test_wait_sfp_ready_task.py new file mode 100644 index 000000000000..16e361f09327 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/test_wait_sfp_ready_task.py @@ -0,0 +1,51 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys + +if sys.version_info.major == 3: + from unittest import mock +else: + import mock + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +sys.path.insert(0, modules_path) + +from sonic_platform import wait_sfp_ready_task +from sonic_platform import utils + + +class TestWaitSfpReadyTask: + def test_schedule(self): + task = wait_sfp_ready_task.WaitSfpReadyTask() + task.schedule_wait(0) + assert not task.empty() + task.cancel_wait(0) + assert task.empty() + + def test_run(self): + task = wait_sfp_ready_task.WaitSfpReadyTask() + task.WAIT_TIME = 1 # Fast the test + task.start() + task.schedule_wait(0) + assert utils.wait_until(lambda: 0 in task.get_ready_set(), 4, 0.5), 'sfp does not reach ready in 4 seconds' + assert 0 not in task._wait_dict + assert len(task._ready_set) == 0 + task.stop() + task.join() From 5da926d83c435afa7b069a9630ace817d1c4f2ba Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 11 May 2024 16:00:56 +0800 Subject: [PATCH 072/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18935) #### Why I did it src/sonic-swss ``` * 198eb3d1 - (HEAD -> master, origin/master, origin/HEAD) Add transceiver info to bake only if supported (#3142) (2 hours ago) [Sudharsan Dhamal Gopalarathnam] * f62eed23 - [Mellanox] PFC watchdog long term solution to reduce false alarm (#3036) (35 hours ago) [Stephen Sun] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 837e46757756..198eb3d1f16f 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 837e46757756dc07fd5840678fa73e8c27abaf20 +Subproject commit 198eb3d1f16f3e5746f1613b74a3debcbc2ac669 From 6caa1fba71567fa298b0ad5b5fbf2dea164a7247 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 11 May 2024 19:01:04 +0800 Subject: [PATCH 073/282] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#18922) #### Why I did it src/sonic-linux-kernel ``` * f182d03 - (HEAD -> master, origin/master, origin/HEAD) Kernel changes for support of elba DSS (#389) (2 days ago) [Shantanu Shrivastava] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index b0dec2c92c57..f182d03e9155 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit b0dec2c92c570fa9d7d04d80aca381fd360ff52c +Subproject commit f182d03e9155a429d62a0dbf08ad8f5a33f2bc83 From e6b3f91be3e96feb6bf4b59f841643054a6c3906 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 11 May 2024 22:01:13 +0800 Subject: [PATCH 074/282] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#18934) #### Why I did it src/sonic-sairedis ``` * 256ce7d - (HEAD -> master, origin/master, origin/HEAD) [syncd]: Generate syncd_dash (#1377) (27 hours ago) [Ze Gan] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 8a0cc25989fb..256ce7dc546e 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 8a0cc25989fb5bd005bde493190faac6bc84a86d +Subproject commit 256ce7dc546e99dbeeb43404c4157ed7136e2932 From 595ee17b10b243604c79d9d0485efc6bf358234d Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Sat, 11 May 2024 15:52:46 -0700 Subject: [PATCH 075/282] [FRR]Fix zebra parse attribute problem for encap (#18939) Adding patch FRRouting/frr#15968. This fixes zebra encap problem for multipath with evpn --- ...ra-fix-parse-attr-problems-for-encap.patch | 290 ++++++++++++++++++ src/sonic-frr/patch/series | 1 + 2 files changed, 291 insertions(+) create mode 100644 src/sonic-frr/patch/0028-zebra-fix-parse-attr-problems-for-encap.patch diff --git a/src/sonic-frr/patch/0028-zebra-fix-parse-attr-problems-for-encap.patch b/src/sonic-frr/patch/0028-zebra-fix-parse-attr-problems-for-encap.patch new file mode 100644 index 000000000000..358cee25b9da --- /dev/null +++ b/src/sonic-frr/patch/0028-zebra-fix-parse-attr-problems-for-encap.patch @@ -0,0 +1,290 @@ +From bef0dda1527782830b034dce9fbdc35a5b3aa88e Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Wed, 8 May 2024 12:46:08 -0400 +Subject: [PATCH 1/3] zebra: Move netlink_route_nexthop_encap + +Move this static function earlier so we can avoid +a predecleartion. + +Signed-off-by: Donald Sharp +--- + zebra/rt_netlink.c | 82 +++++++++++++++++++++++----------------------- + 1 file changed, 41 insertions(+), 41 deletions(-) + +diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c +index fc9e8c457c..42b4d7c199 100644 +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -1732,6 +1732,47 @@ static inline bool _netlink_set_tag(struct nlmsghdr *n, unsigned int maxlen, + return true; + } + ++/* ++ * The function returns true if the attribute could be added ++ * to the message, otherwise false is returned. ++ */ ++static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, ++ struct nexthop *nh) ++{ ++ struct rtattr *nest; ++ struct vxlan_nh_encap* encap_data; ++ ++ switch (nh->nh_encap_type) { ++ case NET_VXLAN: ++ if (!nl_attr_put16(n, nlen, RTA_ENCAP_TYPE, nh->nh_encap_type)) ++ return false; ++ ++ nest = nl_attr_nest(n, nlen, RTA_ENCAP); ++ if (!nest) ++ return false; ++ ++ encap_data = &nh->nh_encap.encap_data; ++ ++ if (!nl_attr_put32(n, nlen, 0 /* VXLAN_VNI */, ++ encap_data->vni)) ++ return false; ++ ++ if (ZEBRA_DEBUG_KERNEL) ++ zlog_debug( ++ "%s: VNI:%d RMAC:%pEA", __func__, encap_data->vni, ++ &encap_data->rmac); ++ ++ if (!nl_attr_put(n, nlen, 1 /* VXLAN_RMAC */, ++ &encap_data->rmac, sizeof(encap_data->rmac))) ++ return false; ++ ++ nl_attr_nest_end(n, nest); ++ break; ++ } ++ ++ return true; ++} ++ + /* This function takes a nexthop as argument and + * appends to the given netlink msg. If the nexthop + * defines a preferred source, the src parameter +@@ -1972,47 +2013,6 @@ static bool nexthop_set_src(const struct nexthop *nexthop, int family, + return false; + } + +-/* +- * The function returns true if the attribute could be added +- * to the message, otherwise false is returned. +- */ +-static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, +- struct nexthop *nh) +-{ +- struct rtattr *nest; +- struct vxlan_nh_encap* encap_data; +- +- switch (nh->nh_encap_type) { +- case NET_VXLAN: +- if (!nl_attr_put16(n, nlen, RTA_ENCAP_TYPE, nh->nh_encap_type)) +- return false; +- +- nest = nl_attr_nest(n, nlen, RTA_ENCAP); +- if (!nest) +- return false; +- +- encap_data = &nh->nh_encap.encap_data; +- +- if (!nl_attr_put32(n, nlen, 0 /* VXLAN_VNI */, +- encap_data->vni)) +- return false; +- +- if (ZEBRA_DEBUG_KERNEL) +- zlog_debug( +- "%s: VNI:%d RMAC:%pEA", __func__, encap_data->vni, +- &encap_data->rmac); +- +- if (!nl_attr_put(n, nlen, 1 /* VXLAN_RMAC */, +- &encap_data->rmac, sizeof(encap_data->rmac))) +- return false; +- +- nl_attr_nest_end(n, nest); +- break; +- } +- +- return true; +-} +- + /* + * Routing table change via netlink interface, using a dataplane context object + * +-- +2.17.1 + + +From 35e1282543bda57563a68046489e0fdb1a0416d1 Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Wed, 8 May 2024 12:48:12 -0400 +Subject: [PATCH 2/3] zebra: Move fpm check to inside of + netlink_route_nexthop_encap + +Signed-off-by: Donald Sharp +--- + zebra/rt_netlink.c | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c +index 42b4d7c199..e52916fa07 100644 +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -1736,12 +1736,15 @@ static inline bool _netlink_set_tag(struct nlmsghdr *n, unsigned int maxlen, + * The function returns true if the attribute could be added + * to the message, otherwise false is returned. + */ +-static int netlink_route_nexthop_encap(struct nlmsghdr *n, size_t nlen, +- struct nexthop *nh) ++static int netlink_route_nexthop_encap(bool fpm, struct nlmsghdr *n, ++ size_t nlen, struct nexthop *nh) + { + struct rtattr *nest; + struct vxlan_nh_encap* encap_data; + ++ if (!fpm) ++ return true; ++ + switch (nh->nh_encap_type) { + case NET_VXLAN: + if (!nl_attr_put16(n, nlen, RTA_ENCAP_TYPE, nh->nh_encap_type)) +@@ -2276,12 +2279,10 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, + * Add encapsulation information when + * installing via FPM. + */ +- if (fpm) { +- if (!netlink_route_nexthop_encap(&req->n, +- datalen, +- nexthop)) +- return 0; +- } ++ if (!netlink_route_nexthop_encap(fpm, &req->n, ++ datalen, ++ nexthop)) ++ return 0; + + nexthop_num++; + break; +@@ -2336,11 +2337,10 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, + * Add encapsulation information when installing via + * FPM. + */ +- if (fpm) { +- if (!netlink_route_nexthop_encap( +- &req->n, datalen, nexthop)) +- return 0; +- } ++ if (!netlink_route_nexthop_encap(fpm, &req->n, ++ datalen, ++ nexthop)) ++ return 0; + + if (!setsrc && src1) { + if (p->family == AF_INET) +-- +2.17.1 + + +From 9f3314723a0569c1d2b5aec5088af87c1d06d40e Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Wed, 8 May 2024 12:52:12 -0400 +Subject: [PATCH 3/3] zebra: Ensure multipath encodes vxlan right for fpm usage + +The fpm code path for the dplane_fpm_nl module was improperly +encoding the multipath nexthop data for vxlan type routes. +Move this into the embedded nexthop encoding where it belongs. + +This change makes it so that the usage of `-M dplane_fpm_nl` +is now producing the same netlink messages that `-M fpm` +produces when using vxlan based nexthops. + +Signed-off-by: Donald Sharp +--- + zebra/rt_netlink.c | 43 ++++++++++++++++++++++++------------------- + 1 file changed, 24 insertions(+), 19 deletions(-) + +diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c +index e52916fa07..3f51894be3 100644 +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -1737,7 +1737,7 @@ static inline bool _netlink_set_tag(struct nlmsghdr *n, unsigned int maxlen, + * to the message, otherwise false is returned. + */ + static int netlink_route_nexthop_encap(bool fpm, struct nlmsghdr *n, +- size_t nlen, struct nexthop *nh) ++ size_t nlen, const struct nexthop *nh) + { + struct rtattr *nest; + struct vxlan_nh_encap* encap_data; +@@ -1794,10 +1794,13 @@ static int netlink_route_nexthop_encap(bool fpm, struct nlmsghdr *n, + * The function returns true if the nexthop could be added + * to the message, otherwise false is returned. + */ +-static bool _netlink_route_build_multipath( +- const struct prefix *p, const char *routedesc, int bytelen, +- const struct nexthop *nexthop, struct nlmsghdr *nlmsg, size_t req_size, +- struct rtmsg *rtmsg, const union g_addr **src, route_tag_t tag) ++static bool _netlink_route_build_multipath(const struct prefix *p, ++ const char *routedesc, int bytelen, ++ const struct nexthop *nexthop, ++ struct nlmsghdr *nlmsg, ++ size_t req_size, struct rtmsg *rtmsg, ++ const union g_addr **src, ++ route_tag_t tag, bool fpm) + { + char label_buf[256]; + struct vrf *vrf; +@@ -1906,6 +1909,13 @@ static bool _netlink_route_build_multipath( + if (!_netlink_set_tag(nlmsg, req_size, tag)) + return false; + ++ /* ++ * Add encapsulation information when installing via ++ * FPM. ++ */ ++ if (!netlink_route_nexthop_encap(fpm, nlmsg, req_size, nexthop)) ++ return false; ++ + nl_attr_rtnh_end(nlmsg, rtnh); + return true; + } +@@ -1940,7 +1950,7 @@ _netlink_mpls_build_multipath(const struct prefix *p, const char *routedesc, + bytelen = (family == AF_INET ? 4 : 16); + return _netlink_route_build_multipath(p, routedesc, bytelen, + nhlfe->nexthop, nlmsg, req_size, +- rtmsg, src, 0); ++ rtmsg, src, 0, false); + } + + static void _netlink_mpls_debug(int cmd, uint32_t label, const char *routedesc) +@@ -2327,19 +2337,14 @@ ssize_t netlink_route_multipath_msg_encode(int cmd, + : "multipath"; + nexthop_num++; + +- if (!_netlink_route_build_multipath( +- p, routedesc, bytelen, nexthop, +- &req->n, datalen, &req->r, &src1, +- tag)) +- return 0; +- +- /* +- * Add encapsulation information when installing via +- * FPM. +- */ +- if (!netlink_route_nexthop_encap(fpm, &req->n, +- datalen, +- nexthop)) ++ if (!_netlink_route_build_multipath(p, routedesc, ++ bytelen, ++ nexthop, ++ &req->n, ++ datalen, ++ &req->r, ++ &src1, tag, ++ fpm)) + return 0; + + if (!setsrc && src1) { +-- +2.17.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index 9874e27aea8a..f2cd08ca666c 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -25,3 +25,4 @@ 0025-bgp-community-memory-leak-fix.patch 0026-bgp-fib-suppress-announce-fix.patch 0027-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch +0028-zebra-fix-parse-attr-problems-for-encap.patch From e1d4c9abbeec1195f70700286b8152a57f9ff199 Mon Sep 17 00:00:00 2001 From: Pavan Prakash <120486223+Pavan-Nokia@users.noreply.github.com> Date: Sat, 11 May 2024 21:53:30 -0400 Subject: [PATCH 076/282] [Nokia-7215-A1] EZB update for SAI and platform finetuning (#18914) 1) Update EZB to version 1.06 to suppost Marvell SAI update to version 1.13.3 2) Platform changes to finetune fan and thermals --- .../Nokia-7215-A1/ASK-Board-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-Board-AC5X-xb.xml | 52 +++++++++++------ .../Nokia-7215-A1/ASK-L1-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-L1-AC5X-xb.xml | 2 +- .../Nokia-7215-A1/ASK-PP-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/ASK-PP-AC5X-xb.xml | 24 +++++++- .../Nokia-7215-A1/SAI-AC5X-xb.md5 | 2 +- .../Nokia-7215-A1/SAI-AC5X-xb.xml | 56 +++++++++++++++++-- .../7215-a1/modules/nokia_7215_ixs_a1_cpld.c | 6 +- .../7215-a1/scripts/nokia-7215-init.sh | 3 + .../7215-a1/sonic_platform/chassis.py | 5 +- .../7215-a1/sonic_platform/fan.py | 4 +- 12 files changed, 123 insertions(+), 37 deletions(-) diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 index fe63caf784ee..b11b209e5598 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.md5 @@ -1 +1 @@ -4983b60d1d68623c202b91093f3730db \ No newline at end of file +c99947340cd205fa728bd418d1ca7a92 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml index 20cdef069c45..f23c2e9badda 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-Board-AC5X-xb.xml @@ -1,5 +1,5 @@ - + @@ -52,7 +52,7 @@ board-pp-interface-channel-type enumeration - Specifies interface tunnel. + Specifies channel interface type. pci PCI @@ -64,19 +64,29 @@ 1 - pex - PEX - 3 + twsi + TWSI + 2 + + + board-pp-as-type + enumeration + Specifies Address space type. - pex_eagle - PEX EAGLE - 5 + 4_regions + address-space 4 regions + 0 - pex_falcon_z - PEX FALCON Z - 6 + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 @@ -683,6 +693,11 @@ lowercase characters. AC5X 1 + + ASIC_Falcon + FALCON + 2 + ASIC_AC5X @@ -691,7 +706,8 @@ lowercase characters. linux-static autoscan external - pex_eagle + pci + atu 0 0 @@ -1625,7 +1641,7 @@ lowercase characters. 0 2 - true + false false @@ -1645,7 +1661,7 @@ lowercase characters. 1 2 - true + false false @@ -1665,7 +1681,7 @@ lowercase characters. 0 2 - true + false false @@ -1685,7 +1701,7 @@ lowercase characters. 1 2 - true + false false @@ -1771,9 +1787,9 @@ lowercase characters. ORDER_MODE_BY_PORT BLINK_DUTY_CYCLE_1 - BLINK_DURATION_2 + BLINK_DURATION_0 BLINK_DUTY_CYCLE_1 - BLINK_DURATION_2 + BLINK_DURATION_0 PULSE_STRETCH_1 false 1627 diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 index 6ea0d9634769..575bbf06a1b2 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.md5 @@ -1 +1 @@ -48c76e16726ad2b1cb797c55c477fc30 \ No newline at end of file +83b91095c99529e49619e31e3fd72101 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml index e00ba0314768..eff23c06ff2b 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-L1-AC5X-xb.xml @@ -1,5 +1,5 @@ - + diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 index bcd85e67a645..c043a0d7231f 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.md5 @@ -1 +1 @@ -d36319f76733ae8593e31f3231599936 \ No newline at end of file +209426f8b550ddf85db19925f9f202a1 \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml index cd948edc27f2..9e40492cfe8f 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/ASK-PP-AC5X-xb.xml @@ -1,5 +1,5 @@ - + @@ -519,7 +519,28 @@ 1 + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + ASIC_AC5X AC5X-RD @@ -842,7 +863,6 @@ TCAM_ROUTER_BASED 0 - MID_L3_MID_L2_NO_EM true diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 index dd43b585717b..04eaffc09efc 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.md5 @@ -1 +1 @@ -1ff8c65eb4b5dfff5d2c9be67401c723 \ No newline at end of file +8918d787a5ccaa80a481ddb8b169574a \ No newline at end of file diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml index d88939c0005f..00c77001f56b 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/Nokia-7215-A1/SAI-AC5X-xb.xml @@ -1,5 +1,5 @@ - + @@ -36,6 +36,26 @@ 2 + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets + 2 + + log-dest-file-path-type string @@ -62,6 +82,11 @@ ACLs for control packet handling 2 + + debug-counter-acl + ACLs for Debug Counters + 3 + ingress-acl-stage-type @@ -126,6 +151,11 @@ AC5X 1 + + ASIC_Falcon + FALCON + 2 + ASIC_AC5X @@ -400,15 +430,19 @@ 8 8 1024 - 0 - 0 + + + 0 + + IN_DROP_ANY + SAI_LOG_SYSLOG control-acl - 2 + 3 IPCL0 1 @@ -420,7 +454,7 @@ port-sFlow - 3 + 4 IPCL0 0 @@ -432,7 +466,7 @@ port-counters-ipv4-ipv6 - 4 + 5 IPCL0 3 @@ -442,5 +476,15 @@ 0 + + debug-counter-acl + 2 + + disabled + + + disabled + + \ No newline at end of file diff --git a/platform/marvell/sonic-platform-nokia/7215-a1/modules/nokia_7215_ixs_a1_cpld.c b/platform/marvell/sonic-platform-nokia/7215-a1/modules/nokia_7215_ixs_a1_cpld.c index 3c063977026d..e90715dc3b2e 100644 --- a/platform/marvell/sonic-platform-nokia/7215-a1/modules/nokia_7215_ixs_a1_cpld.c +++ b/platform/marvell/sonic-platform-nokia/7215-a1/modules/nokia_7215_ixs_a1_cpld.c @@ -351,13 +351,13 @@ static ssize_t show_temp_event_status(struct device *dev, struct device_attribut val = nokia_7215_ixs_a1_cpld_read(data, TEMP_EVENT_STATUS_REG); switch (val) { case TS1_ALERT_EVENT: - reason="ts1"; + reason="PCB Back"; break; case TS2_ALERT_EVENT: - reason="ts2"; + reason="PCB Front"; break; case TS3_ALERT_EVENT: - reason="ts3"; + reason="PCB Mid"; break; case CPU_TEMP_EVENT: reason="cpu"; diff --git a/platform/marvell/sonic-platform-nokia/7215-a1/scripts/nokia-7215-init.sh b/platform/marvell/sonic-platform-nokia/7215-a1/scripts/nokia-7215-init.sh index a69c871b0282..51474c2e0ff0 100644 --- a/platform/marvell/sonic-platform-nokia/7215-a1/scripts/nokia-7215-init.sh +++ b/platform/marvell/sonic-platform-nokia/7215-a1/scripts/nokia-7215-init.sh @@ -40,6 +40,9 @@ file_exists() { # Install kernel drivers required for i2c bus access load_kernel_drivers +# Disable sysrq-trigger +echo 0 > /proc/sys/kernel/sysrq + #setting up uboot environment fw_uboot_env_cfg diff --git a/platform/marvell/sonic-platform-nokia/7215-a1/sonic_platform/chassis.py b/platform/marvell/sonic-platform-nokia/7215-a1/sonic_platform/chassis.py index 19007a3b4de1..41d600147bd9 100644 --- a/platform/marvell/sonic-platform-nokia/7215-a1/sonic_platform/chassis.py +++ b/platform/marvell/sonic-platform-nokia/7215-a1/sonic_platform/chassis.py @@ -271,8 +271,11 @@ def get_reboot_cause(self): reboot_cause=(ChassisBase.REBOOT_CAUSE_THERMAL_OVERLOAD_OTHER, thermal) else: reboot_cause=(ChassisBase.REBOOT_CAUSE_NON_HARDWARE, None) - #unmask temperature event + + #Log reboot cause and unmask temperature event + sonic_logger.log_notice("Reboot-cause reported by platform - {}".format(reboot_cause)) self._write_sysfs_file(CPLD_DIR+"temp_event_mask", 0) + return reboot_cause def get_watchdog(self): diff --git a/platform/marvell/sonic-platform-nokia/7215-a1/sonic_platform/fan.py b/platform/marvell/sonic-platform-nokia/7215-a1/sonic_platform/fan.py index b86370dc0eec..a8891a51f0f0 100644 --- a/platform/marvell/sonic-platform-nokia/7215-a1/sonic_platform/fan.py +++ b/platform/marvell/sonic-platform-nokia/7215-a1/sonic_platform/fan.py @@ -16,8 +16,8 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") -MAX_IXS7215_FAN_SPEED = 23000 -WORKING_IXS7215_FAN_SPEED = 2300 +MAX_IXS7215_FAN_SPEED = 24000 +WORKING_IXS7215_FAN_SPEED = 2400 sonic_logger = logger.Logger('fan') From 3d47ac1879eaa19a1585b4d0bd40ff267acb28f1 Mon Sep 17 00:00:00 2001 From: Keshav Gupta Date: Sun, 12 May 2024 07:29:05 +0530 Subject: [PATCH 077/282] [innovium]: sai-server bookworm changes for innovium (#18848) Signed-off-by: Keshav Gupta --- platform/innovium/docker-saiserver-invm.dep | 8 ++++ platform/innovium/docker-saiserver-invm.mk | 14 +++++++ .../docker-saiserver-invm/Dockerfile.j2 | 41 +++++++++++++++++++ .../innovium/docker-saiserver-invm/start.sh | 5 +++ .../docker-saiserver-invm/supervisord.conf | 28 +++++++++++++ platform/innovium/libsaithrift-dev.dep | 13 ++++++ platform/innovium/libsaithrift-dev.mk | 9 +++- platform/innovium/rules.mk | 1 + 8 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 platform/innovium/docker-saiserver-invm.dep create mode 100644 platform/innovium/docker-saiserver-invm.mk create mode 100644 platform/innovium/docker-saiserver-invm/Dockerfile.j2 create mode 100755 platform/innovium/docker-saiserver-invm/start.sh create mode 100644 platform/innovium/docker-saiserver-invm/supervisord.conf create mode 100644 platform/innovium/libsaithrift-dev.dep diff --git a/platform/innovium/docker-saiserver-invm.dep b/platform/innovium/docker-saiserver-invm.dep new file mode 100644 index 000000000000..cf8cc4b6b0f8 --- /dev/null +++ b/platform/innovium/docker-saiserver-invm.dep @@ -0,0 +1,8 @@ +DPATH := $($(DOCKER_SAISERVER_INVM)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/innovium/docker-saiserver-invm.mk platform/innovium/docker-saiserver-invm.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_SAISERVER_INVM)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_SAISERVER_INVM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SAISERVER_INVM)_DEP_FILES := $(DEP_FILES) diff --git a/platform/innovium/docker-saiserver-invm.mk b/platform/innovium/docker-saiserver-invm.mk new file mode 100644 index 000000000000..1f30efc6b1c8 --- /dev/null +++ b/platform/innovium/docker-saiserver-invm.mk @@ -0,0 +1,14 @@ +# docker image for invm saiserver + +DOCKER_SAISERVER_INVM = docker-saiserver$(SAITHRIFT_VER)-invm.gz +$(DOCKER_SAISERVER_INVM)_PATH = $(PLATFORM_PATH)/docker-saiserver-invm +$(DOCKER_SAISERVER_INVM)_DEPENDS += $(SAISERVER) +$(DOCKER_SAISERVER_INVM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM) +SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_INVM) + +$(DOCKER_SAISERVER_INVM)_CONTAINER_NAME = saiserver$(SAITHRIFT_VER) +$(DOCKER_SAISERVER_INVM)_RUN_OPT += --privileged -t +$(DOCKER_SAISERVER_INVM)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf +$(DOCKER_SAISERVER_INVM)_RUN_OPT += -v /var/run/docker-saiserver:/var/run/sswsyncd +$(DOCKER_SAISERVER_INVM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_SAISERVER_INVM)_RUN_OPT += -v /host/warmboot:/var/warmboot diff --git a/platform/innovium/docker-saiserver-invm/Dockerfile.j2 b/platform/innovium/docker-saiserver-invm/Dockerfile.j2 new file mode 100644 index 000000000000..c6d0ada17e36 --- /dev/null +++ b/platform/innovium/docker-saiserver-invm/Dockerfile.j2 @@ -0,0 +1,41 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages %} +FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} + +ARG docker_container_name + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +## Pre-install the fundamental packages +RUN apt-get update \ + && apt-get -y install \ + gdb \ + libboost-atomic1.74.0 \ + libqt5core5a \ + libqt5network5 \ + libyaml-dev \ + libthrift-0.17.0 \ + binutils + +RUN pip3 install numpy +RUN pip3 install yamlordereddictloader + +COPY \ +{% for deb in docker_saiserver_invm_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_saiserver_invm_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +COPY ["start.sh", "/usr/bin"] +COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] + +## Clean up +RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y +RUN rm -rf /debs + +ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/platform/innovium/docker-saiserver-invm/start.sh b/platform/innovium/docker-saiserver-invm/start.sh new file mode 100755 index 000000000000..13592e0744fd --- /dev/null +++ b/platform/innovium/docker-saiserver-invm/start.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +rm -f /var/run/rsyslogd.pid +supervisorctl start rsyslogd +supervisorctl start saiserver diff --git a/platform/innovium/docker-saiserver-invm/supervisord.conf b/platform/innovium/docker-saiserver-invm/supervisord.conf new file mode 100644 index 000000000000..ccb107b3d1f8 --- /dev/null +++ b/platform/innovium/docker-saiserver-invm/supervisord.conf @@ -0,0 +1,28 @@ +[supervisord] +logfile_maxbytes=1MB +logfile_backups=2 +nodaemon=true + +[program:start.sh] +command=/usr/bin/start.sh +priority=1 +autostart=true +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n +priority=2 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog + +[program:saiserver] +command=/usr/sbin/saiserver -p /usr/share/sonic/hwsku/sai.profile -f /usr/share/sonic/hwsku/port_config.ini +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog diff --git a/platform/innovium/libsaithrift-dev.dep b/platform/innovium/libsaithrift-dev.dep new file mode 100644 index 000000000000..f9d75d284ca6 --- /dev/null +++ b/platform/innovium/libsaithrift-dev.dep @@ -0,0 +1,13 @@ +#DPKG FRK +SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/innovium/libsaithrift-dev.mk platform/innovium/libsaithrift-dev.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen +$(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " ))))) + +$(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA +$(LIBSAITHRIFT_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(LIBSAITHRIFT_DEV)_DEP_FILES := $(DEP_FILES) +$(LIBSAITHRIFT_DEV)_SMDEP_FILES := $(foreach path, $(SMDEP_PATHS), $($(path))) +$(LIBSAITHRIFT_DEV)_SMDEP_PATHS := $(SMDEP_PATHS) + diff --git a/platform/innovium/libsaithrift-dev.mk b/platform/innovium/libsaithrift-dev.mk index ebc573e50e06..2a8b6bf137c4 100755 --- a/platform/innovium/libsaithrift-dev.mk +++ b/platform/innovium/libsaithrift-dev.mk @@ -13,8 +13,15 @@ $(LIBSAITHRIFT_DEV)_RDEPENDS += $(INVM_HSAI) endif $(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV) $(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBSAIMETADATA) $(INVM_LIBSAI) $(INVM_SHELL) +SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) PYTHON_SAITHRIFT = python-saithrift$(SAITHRIFT_VER)_$(SAI_VER)_$(CONFIGURED_ARCH).deb $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT))) -SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) +SAISERVER = saiserver$(SAITHRIFT_VER)_$(SAI_VER)_$(CONFIGURED_ARCH).deb +$(SAISERVER)_RDEPENDS += $(LIBSAITHRIFT_DEV) $(INVM_LIBSAI) $(INVM_HSAI) $(INVM_SHELL) +$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER))) + +SAISERVER_DBG = saiserver$(SAITHRIFT_VER)-dbg_$(SAI_VER)_$(CONFIGURED_ARCH).deb +$(SAISERVER_DBG)_RDEPENDS += $(SAISERVER) +$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG))) diff --git a/platform/innovium/rules.mk b/platform/innovium/rules.mk index dcf7f079fa16..906d0619d5f5 100755 --- a/platform/innovium/rules.mk +++ b/platform/innovium/rules.mk @@ -6,6 +6,7 @@ include $(PLATFORM_PATH)/platform-modules-marvell.mk include $(PLATFORM_PATH)/docker-syncd-invm.mk include $(PLATFORM_PATH)/docker-syncd-invm-rpc.mk include $(PLATFORM_PATH)/one-image.mk +include $(PLATFORM_PATH)/docker-saiserver-invm.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/python-saithrift.mk From 4d4b1d4c4912d22df169f06966ab0accef9c8414 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Sat, 11 May 2024 22:01:27 -0400 Subject: [PATCH 078/282] [Nokia][chassis] modify Nokia-IXR7250E-36x400G platform specified reboot to allow SUP to log expected/unepected midplane/module connectivity msg (#18805) Why I did it For Linecard expected and unexpected reboot, Supervisor needs to log a expected and unexpected lost connectivity message. After the new mechanism has been introduced by PRs. For Nokia-IXR7250E-36x600G linecard, it requires to handle missing heartbeat reboot is unexpected reboot for SUP. Issue #18540 Work item tracking Microsoft ADO (number only): How I did it On Nokia-IXR7250E-36x400G platform, missing heartbeat reboot also call the "sudo reboot" which creates a CHASSIS_MODULE_REBOOT_INFO_TABLE entry expected reboot on SUP. Since heartbeat reboot is unexpected reboot, it requires to modify the platform_reboot check if it is missing heart reboot, then remove the CHASSIS_MODULE_REBOOT_INFO_TABLE entry on the SUP. So that, SUP can log the unexpected log. How to verify it Simulated the missing heartbeat reboot on the linecard, then, verify the log message on SUP as below Apr 25 19:50:19.286081 ixre-cpm-chassis7 WARNING pmon#chassisd: Module LINE-CARD0 went off-line! Apr 25 19:50:22.549416 ixre-cpm-chassis7 WARNING pmon#chassisd: Unexpected: Module LINE-CARD0 lost midplane connectivity. Signed-off-by: mlok --- .../platform_reboot | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot index eb0bebef0e54..454a14c5ab74 100755 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_reboot @@ -1,12 +1,27 @@ #!/bin/bash +DEVICE_MGR_REBOOT_FILE=/tmp/device_mgr_reboot +REBOOT_CAUSE_FILE=/host/reboot-cause/reboot-cause.txt +DEVICE_REBOOT_CAUSE_FILE=/etc/opt/srlinux/reboot-cause.txt +kHeartbeatLostRebootCause="Heartbeat with the Supervisor card lost" +DEVICE_DETAILS_FILE="/etc/opt/srlinux/devices/hw_details.json" + +ungraceful_reboot_handle() +{ + str=$(grep "$kHeartbeatLostRebootCause" $DEVICE_REBOOT_CAUSE_FILE 2> /dev/null) + status=$? + if [ $status -eq 0 ]; then + slot_num=$(jq -r '.slot_num' $DEVICE_DETAILS_FILE 2>/dev/null) + slot_num=$((slot_num - 1)) + sonic-db-cli CHASSIS_STATE_DB del "CHASSIS_MODULE_REBOOT_INFO_TABLE|LINE-CARD${slot_num}" + fi +} update_reboot_cause() { - DEVICE_MGR_REBOOT_FILE=/tmp/device_mgr_reboot - REBOOT_CAUSE_FILE=/host/reboot-cause/reboot-cause.txt - DEVICE_REBOOT_CAUSE_FILE=/etc/opt/srlinux/reboot-cause.txt if [ -e $DEVICE_MGR_REBOOT_FILE ]; then if [ -e $DEVICE_REBOOT_CAUSE_FILE ]; then + # reomve the REBOOT_INFO_TABLE entry for unpexected reboot + ungraceful_reboot_handle cp -f $DEVICE_REBOOT_CAUSE_FILE $REBOOT_CAUSE_FILE fi rm -f $DEVICE_MGR_REBOOT_FILE @@ -18,7 +33,7 @@ update_reboot_cause() } echo "Disable all SFPs" -python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.tx_disable_all_sfps()' +python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.tx_disable_all_sfps()' & sleep 3 # update the reboot_cuase file when reboot is trigger by device-mgr From 2e97051809531ebe11040f093b94f67f049bf99e Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 12 May 2024 16:01:15 +0800 Subject: [PATCH 079/282] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18840) #### Why I did it src/sonic-platform-common ``` * 0362460 - (HEAD -> master, origin/master, origin/HEAD) fix: using PAGE_LENGTH instead of INIT_OFFSET (#452) (4 days ago) [Qingxiao Ren] * 16ab403 - Update Innolight package for mock test (#461) (4 days ago) [Anoop Kamath] * 50a75a5 - Aligning SONiC code with sff8024 spec (#457) (5 days ago) [Tomer Shalvi] * 655a5ff - Handle page select and remote access check after changing SFP target (#462) (9 days ago) [mihirpat1] * de16e50 - DPinit timeout seen for Innolight transceiver during CMIS init + transceiver OIR causing CMIS init failure (#450) (11 days ago) [Anoop Kamath] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-common b/src/sonic-platform-common index 4163365b97a8..036246032e00 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 4163365b97a8a2cb80dc895dcada1a51b5347fd3 +Subproject commit 036246032e0012910b71e1986b74100dbd8142a3 From 3ef49c97df1aeccb44bdfd6eb8e7bcc34c62f960 Mon Sep 17 00:00:00 2001 From: Sai Kiran <110003254+opcoder0@users.noreply.github.com> Date: Sun, 12 May 2024 18:37:38 +1000 Subject: [PATCH 080/282] [docker-ptf]: Changes to build Python 3 docker-ptf (#18909) Why I did it As Python 2 has reached EOL it is important to migrate all PTF tests to Python 3. The current docker-ptf image contains both Python 2 and Python 3. This PR adds configuration option to build docker-ptf image with its current contents of both Python 2 and 3 by setting SONIC_PTF_ENV_PY_VER to mixed (default value). Or building a Python 3 only image by setting SONIC_PTF_ENV_PY_VER to py3. Once all the tests are fully migrated to Python 3 the older docker-ptf container with Python 2 will only be used for older releases and newer releases can use Python 3 only PTF docker image. The main branch's setting can be updated to use py3 image. How I did it Add SONIC_PTF_ENV_PY_VER configuration variable with mixed and py3 values. platform/vs/docker-ptf.mk and slave.mk uses the configuration value to set dependencies and build the image make target/docker-ptf.gz builds a Python 2 and 3 or Python 3 only image based on the configuration value. How to verify it make USERNAME=admin SONIC_BUILD_JOBS=4 BUILD_MULTIASIC_KVM=y INCLUDE_DHCP_SERVER=y target/docker-ptf.gz Which release branch to backport (provide reason below if selected) Not applicable Tested branch (Please provide the tested image version) None. Individual PTF scripts that have been moved to Python 3 (from the main branch) will be tested. Description for the changelog [docker-ptf]: Changes to build Python 3 docker-ptf Adds SONIC_PTF_ENV_PY_VER to build current docker-ptf with Python 2 and 3 or just Python 3 Update dockers/docker-ptf/Dockerfile.j2 to install Python 3 only and required packages --- Makefile.work | 5 +++- dockers/docker-ptf/Dockerfile.j2 | 39 +++++++++++++++++++++++++++++--- platform/vs/docker-ptf.mk | 4 ++++ rules/config | 4 ++++ slave.mk | 5 ++++ 5 files changed, 53 insertions(+), 4 deletions(-) diff --git a/Makefile.work b/Makefile.work index bece7e56cb74..d66774ddcf28 100644 --- a/Makefile.work +++ b/Makefile.work @@ -61,7 +61,9 @@ # * value to anything will enable it # * Default: unset # * Value: y -# +# * SONIC_PTF_ENV_PY_VER: Python version for PTF image +# * Default: mixed +# * Values: mixed,py3 ############################################################################### SHELL = /bin/bash @@ -592,6 +594,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ SONIC_OS_VERSION=$(SONIC_OS_VERSION) \ PIP_HTTP_TIMEOUT=$(PIP_HTTP_TIMEOUT) \ LEGACY_SONIC_MGMT_DOCKER=$(LEGACY_SONIC_MGMT_DOCKER) \ + SONIC_PTF_ENV_PY_VER=$(SONIC_PTF_ENV_PY_VER) \ $(SONIC_OVERRIDE_BUILD_VARS) .PHONY: sonic-slave-build sonic-slave-bash init reset diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index 809b1474d6d1..d026b708b4b3 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -3,8 +3,10 @@ FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch +{% elif PTF_ENV_PY_VER == "mixed" %} +FROM {{ prefix}}debian:buster {% else %} -FROM {{ prefix }}debian:buster +FROM {{ prefix }}debian:bullseye {% endif %} {% from "dockers/dockerfile-macros.j2" import install_python_wheels, copy_files %} @@ -12,7 +14,7 @@ FROM {{ prefix }}debian:buster USER root WORKDIR /root -MAINTAINER Pavel Shirshov +LABEL maintainer="Pavel Shirshov" COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"] COPY ["no-check-valid-until", "/etc/apt/apt.conf.d"] @@ -45,18 +47,24 @@ RUN apt-get update \ cmake \ libqt5core5a \ libqt5network5 \ +{% if PTF_ENV_PY_VER == "mixed" %} libboost-atomic1.71.0 \ +{% else %} + libboost-atomic1.74.0 \ +{% endif %} less \ git \ iputils-ping \ hping3 \ curl \ tmux \ +{% if PTF_ENV_PY_VER == "mixed" %} python \ python-dev \ python-libpcap \ python-scapy \ python-six \ +{% endif %} python3 \ python3-venv \ python3-pip \ @@ -64,7 +72,10 @@ RUN apt-get update \ python3-scapy \ python3-six \ libpcap-dev \ +# TODO check if tacacs+ is required by tests +{% if PTF_ENV_PY_VER == "mixed" %} tacacs+ \ +{% endif %} rsyslog \ ntp \ ntpstat \ @@ -77,12 +88,20 @@ RUN apt-get update \ iproute2 \ wireshark-common +{% if PTF_ENV_PY_VER == "py3" %} +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \ + && update-alternatives --install /usr/bin/pdb pdb /usr/bin/pdb3 1 \ + && update-alternatives --install /usr/bin/pydoc pydoc /usr/bin/pydoc3 1 \ + && update-alternatives --install /usr/bin/pygettext pygettext /usr/bin/pygettext3 1 +{% endif %} + # Install all python modules from pypi. python-scapy is exception, ptf debian package requires python-scapy # TODO: Clean up this step RUN rm -rf /debs \ && apt-get -y autoclean \ && apt-get -y autoremove \ && rm -rf /var/lib/apt/lists/* \ +{% if PTF_ENV_PY_VER == "mixed" %} && wget --https-only https://bootstrap.pypa.io/pip/2.7/get-pip.py \ && python get-pip.py \ && rm -f get-pip.py \ @@ -94,6 +113,7 @@ RUN rm -rf /debs \ && python setup.py install \ && cd .. \ && rm -fr scapy-vxlan \ +{% endif %} && git clone https://github.com/sflow/sflowtool \ && cd sflowtool \ && ./boot.sh \ @@ -121,6 +141,7 @@ RUN rm -rf /debs \ && cd ../.. \ && rm -fr nanomsg-1.0.0 \ && rm -f 1.0.0.tar.gz \ +{% if PTF_ENV_PY_VER == "mixed" %} && pip install cffi \ && pip install nnpy \ && pip install dpkt \ @@ -134,6 +155,7 @@ RUN rm -rf /debs \ && pip install unittest-xml-reporting \ && pip install pyrasite \ && pip install retrying \ +{% endif %} && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py @@ -147,10 +169,14 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH" ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 PYTHONIOENCODING=UTF-8 +{% if PTF_ENV_PY_VER == "mixed" %} RUN python3 -m pip install --upgrade --ignore-installed pip +{% else %} +RUN pip install --upgrade --ignore-installed pip +{% endif %} # Install all python modules from pypi. python3-scapy is exception, ptf debian package requires python3-scapy -RUN python3 -m pip install setuptools \ +RUN pip3 install setuptools \ && pip3 install supervisor \ && pip3 install ipython==5.4.1 \ && pip3 install Cython \ @@ -200,9 +226,11 @@ COPY supervisord.conf /etc/supervisor/ COPY conf.d/ /etc/supervisor/conf.d/ COPY ptf_tgen.sh /ptf_tgen/ +{% if PTF_ENV_PY_VER == "mixed" %} # Move tcpdump into /usr/bin Otherwise it's impossible to run tcpdump due to a docker bug RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump RUN ln -s /usr/bin/tcpdump /usr/sbin/tcpdump +{% endif %} RUN mkdir -p /var/log/supervisor @@ -211,7 +239,12 @@ RUN git clone https://github.com/lguohan/gnxi.git \ && cd gnxi \ && git checkout 3adf8b9 \ && cd gnmi_cli_py \ +{% if PTF_ENV_PY_VER == "mixed" %} && pip install -r requirements.txt +{% else %} + && cat requirements.txt | grep -v futures > /tmp/requirements.txt \ + && pip3 install -r /tmp/requirements.txt +{% endif %} COPY \ {% for deb in docker_ptf_debs.split(' ') -%} diff --git a/platform/vs/docker-ptf.mk b/platform/vs/docker-ptf.mk index ef102be967f4..1c66f8b889bd 100644 --- a/platform/vs/docker-ptf.mk +++ b/platform/vs/docker-ptf.mk @@ -3,6 +3,10 @@ DOCKER_PTF = docker-ptf.gz $(DOCKER_PTF)_PYTHON_WHEELS += $(PTF_PY3) $(DOCKER_PTF)_PATH = $(DOCKERS_PATH)/docker-ptf +ifeq ($(SONIC_PTF_ENV_PY_VER), mixed) $(DOCKER_PTF)_DEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(PTF) $(PYTHON_SAITHRIFT) +else +$(DOCKER_PTF)_DEPENDS += $(LIBTHRIFT_0_14_1) $(PYTHON3_THRIFT_0_14_1) $(PYTHON_SAITHRIFT) +endif SONIC_DOCKER_IMAGES += $(DOCKER_PTF) SONIC_BUSTER_DOCKERS += $(DOCKER_PTF) diff --git a/rules/config b/rules/config index e52eeae4c410..2996d0f46f35 100644 --- a/rules/config +++ b/rules/config @@ -319,3 +319,7 @@ PIP_HTTP_TIMEOUT ?= 60 # BUILD_REDUCE_IMAGE_SIZE - reduce the image size as much as possbible BUILD_REDUCE_IMAGE_SIZE = n + +# SONIC_PTF_ENV_PY_VER - SONiC PTF test Python version. Set to 'mixed' to build the +# image with both Python 2 and 3. Set to 'py3' to build a Python 3 only image +SONIC_PTF_ENV_PY_VER = mixed diff --git a/slave.mk b/slave.mk index eb537e740527..c6c0e32e6569 100644 --- a/slave.mk +++ b/slave.mk @@ -75,6 +75,9 @@ else ENABLE_PY2_MODULES = y endif +# Python version for PTF image +PTF_ENV_PY_VER = $(if $(SONIC_PTF_ENV_PY_VER),$(SONIC_PTF_ENV_PY_VER),mixed) + export BUILD_NUMBER export BUILD_TIMESTAMP export SONIC_IMAGE_VERSION @@ -94,6 +97,7 @@ export MIRROR_SNAPSHOT export SONIC_OS_VERSION export FILES_PATH export PROJECT_ROOT +export PTF_ENV_PY_VER ############################################################################### ## Utility rules @@ -461,6 +465,7 @@ $(info "CROSS_BUILD_ENVIRON" : "$(CROSS_BUILD_ENVIRON)") $(info "GZ_COMPRESS_PROGRAM" : "$(GZ_COMPRESS_PROGRAM)") $(info "LEGACY_SONIC_MGMT_DOCKER" : "$(LEGACY_SONIC_MGMT_DOCKER)") $(info "INCLUDE_EXTERNAL_PATCHES" : "$(INCLUDE_EXTERNAL_PATCHES)") +$(info "PTF_ENV_PY_VER" : "$(PTF_ENV_PY_VER)") $(info ) else $(info SONiC Build System for $(CONFIGURED_PLATFORM):$(CONFIGURED_ARCH)) From 71eb9b9162599dc05edb90f4a5e1ca25f10ca6c0 Mon Sep 17 00:00:00 2001 From: Bob Chu <79439153+qnos@users.noreply.github.com> Date: Sun, 12 May 2024 16:45:19 +0800 Subject: [PATCH 081/282] [devices]: Seastone fix issue #18767 psu fan speed issue (#18787) Fix issue #18787 fan information could not been shown issue. How I did it Add psu fan get_target_speed api support. How to verify it Use `show platform fan` in branch 202311. --- device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan.py index 00785dd8fddf..9269dbe26fc2 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan.py @@ -188,6 +188,8 @@ def get_target_speed(self): sysfs_path = sysfs_path.format(fan_index[self.fan_tray_index]) pwm = self._api_helper.read_txt_file(sysfs_path) target = round(int(pwm) / 255 * 100.0) + else: + return self.get_speed() return target From 71001711c7733dbd3ddb1d5fb2428b4433ee1939 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 12 May 2024 16:47:54 +0800 Subject: [PATCH 082/282] [ci/build]: Upgrade SONiC package versions (#18786) --- .../versions-deb-bookworm | 11 +++ .../build-sonic-slave-bookworm/versions-py3 | 5 +- .../versions-deb-bullseye | 17 ---- .../versions-deb-bullseye-arm64 | 1 - .../build-sonic-slave-bullseye/versions-py3 | 3 +- files/build/versions/default/versions-docker | 36 ++++---- files/build/versions/default/versions-git | 14 +-- files/build/versions/default/versions-mirror | 37 ++++---- files/build/versions/default/versions-web | 61 ++++++------- .../versions-deb-bookworm | 4 +- .../dockers/docker-base-bookworm/versions-py3 | 4 +- .../versions-deb-bullseye | 3 +- .../dockers/docker-base-bullseye/versions-py3 | 4 +- .../docker-base-buster/versions-deb-buster | 2 +- .../dockers/docker-base-buster/versions-py3 | 2 +- .../versions-deb-bookworm | 6 +- .../versions-mirror | 1 - .../versions-py3 | 2 +- .../versions-deb-bullseye | 6 +- .../versions-py3 | 2 +- .../versions-deb-buster | 5 +- .../docker-database/versions-deb-bookworm | 2 +- .../dockers/docker-database/versions-mirror | 1 - .../docker-dhcp-relay/versions-deb-bookworm | 2 +- .../dockers/docker-dhcp-relay/versions-mirror | 1 - .../dockers/docker-dhcp-relay/versions-py3 | 2 +- .../docker-eventd/versions-deb-bookworm | 2 +- .../dockers/docker-eventd/versions-mirror | 1 - .../docker-fpm-frr/versions-deb-bullseye | 10 +-- .../versions-deb-bullseye | 8 +- .../versions-deb-bullseye | 7 +- .../docker-gbsyncd-vs/versions-deb-bookworm | 35 ++++++++ .../dockers/docker-lldp/versions-deb-bookworm | 37 ++++++++ .../dockers/docker-lldp/versions-deb-bullseye | 34 ------- .../docker-macsec/versions-deb-bookworm | 2 +- .../dockers/docker-macsec/versions-mirror | 1 - .../dockers/docker-mux/versions-deb-bookworm | 2 +- .../dockers/docker-mux/versions-mirror | 1 - .../dockers/docker-nat/versions-deb-bookworm | 38 ++++++++ .../dockers/docker-nat/versions-deb-bullseye | 35 -------- .../docker-orchagent/versions-deb-bookworm | 3 +- .../dockers/docker-orchagent/versions-mirror | 1 - .../dockers/docker-orchagent/versions-py3 | 1 + .../versions-deb-bookworm | 2 +- .../docker-platform-monitor/versions-mirror | 1 - .../dockers/docker-ptf/versions-deb-buster | 26 +++--- .../versions-deb-bookworm | 2 +- .../docker-router-advertiser/versions-mirror | 1 - .../docker-sflow/versions-deb-bullseye | 2 +- .../dockers/docker-snmp/versions-deb-bookworm | 43 +++++++++ .../dockers/docker-snmp/versions-deb-bullseye | 40 --------- .../docker-sonic-gnmi/versions-deb-bullseye | 2 +- .../docker-sonic-vs/versions-deb-bullseye | 14 +-- .../dockers/docker-sonic-vs/versions-py3 | 7 +- .../versions-mirror | 1 - .../versions-deb-bullseye | 8 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 8 +- .../docker-syncd-brcm/versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 8 +- .../docker-syncd-centec/versions-deb-bullseye | 2 +- .../versions-deb-bookworm | 18 ++++ .../docker-syncd-mlnx-rpc/versions-py3 | 3 +- .../docker-syncd-mlnx/versions-deb-bookworm | 74 +++++++++++++++ .../dockers/docker-syncd-mlnx/versions-py3 | 7 +- .../versions-deb-bookworm-arm64 | 24 +++++ .../versions-deb-bookworm-armhf | 24 +++++ .../docker-syncd-vs/versions-deb-bookworm | 35 ++++++++ .../docker-teamd/versions-deb-bookworm | 2 +- .../dockers/docker-teamd/versions-mirror | 1 - .../versions-deb-bookworm | 76 +++++++++------- .../versions-deb-bookworm-armhf | 6 +- .../sonic-slave-bookworm/versions-mirror | 1 - .../dockers/sonic-slave-bookworm/versions-py3 | 5 +- .../versions-deb-bullseye | 63 ++++++------- .../versions-deb-bullseye-armhf | 6 +- .../dockers/sonic-slave-bullseye/versions-py3 | 4 +- .../sonic-slave-buster/versions-deb-buster | 90 ++++++++++--------- .../versions-deb-buster-armhf | 19 ++++ .../dockers/sonic-slave-buster/versions-py3 | 2 +- .../versions/host-image/versions-deb-bookworm | 23 +++-- files/build/versions/host-image/versions-py3 | 8 +- 82 files changed, 678 insertions(+), 436 deletions(-) delete mode 100644 files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 delete mode 100644 files/build/versions/dockers/docker-config-engine-bookworm/versions-mirror delete mode 100644 files/build/versions/dockers/docker-database/versions-mirror delete mode 100644 files/build/versions/dockers/docker-dhcp-relay/versions-mirror delete mode 100644 files/build/versions/dockers/docker-eventd/versions-mirror create mode 100644 files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bookworm create mode 100644 files/build/versions/dockers/docker-lldp/versions-deb-bookworm delete mode 100644 files/build/versions/dockers/docker-lldp/versions-deb-bullseye delete mode 100644 files/build/versions/dockers/docker-macsec/versions-mirror delete mode 100644 files/build/versions/dockers/docker-mux/versions-mirror create mode 100644 files/build/versions/dockers/docker-nat/versions-deb-bookworm delete mode 100644 files/build/versions/dockers/docker-nat/versions-deb-bullseye delete mode 100644 files/build/versions/dockers/docker-orchagent/versions-mirror delete mode 100644 files/build/versions/dockers/docker-platform-monitor/versions-mirror delete mode 100644 files/build/versions/dockers/docker-router-advertiser/versions-mirror create mode 100644 files/build/versions/dockers/docker-snmp/versions-deb-bookworm delete mode 100644 files/build/versions/dockers/docker-snmp/versions-deb-bullseye delete mode 100644 files/build/versions/dockers/docker-swss-layer-bookworm/versions-mirror create mode 100644 files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bookworm create mode 100644 files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bookworm create mode 100644 files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bookworm-arm64 create mode 100644 files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bookworm-armhf create mode 100644 files/build/versions/dockers/docker-syncd-vs/versions-deb-bookworm delete mode 100644 files/build/versions/dockers/docker-teamd/versions-mirror delete mode 100644 files/build/versions/dockers/sonic-slave-bookworm/versions-mirror diff --git a/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm b/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm index 36978b68947d..5f1fcdeb3fa7 100644 --- a/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm +++ b/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm @@ -1,4 +1,5 @@ applibs==1.mlnx.4.6.3064 +applibs-dev==1.mlnx.4.6.3064 kernel-mft-dkms==4.27.0-83 libdashapi==1.0.0 libnl-3-200==3.5.0-1 @@ -15,6 +16,7 @@ libsaimetadata==1.0.0 libsaimetadata-dev==1.0.0 libsairedis==1.0.0 libsairedis-dev==1.0.0 +libsaithrift-dev==0.9.4 libsaivs==1.0.0 libswsscommon==1.0.0 libswsscommon-dev==1.0.0 @@ -35,9 +37,18 @@ python3-swsscommon==1.0.0 python3-yang==1.0.73 sonic-platform-pddf==1.1 sonic-platform-pddf-sym==1.1 +sx-acl-helper==1.mlnx.4.6.3064 +sx-acl-helper-dev==1.mlnx.4.6.3064 sx-complib==1.mlnx.4.6.3064 sx-complib-dev==1.mlnx.4.6.3064 +sx-examples==1.mlnx.4.6.3064 +sx-examples-dev==1.mlnx.4.6.3064 sx-gen-utils==1.mlnx.4.6.3064 sx-gen-utils-dev==1.mlnx.4.6.3064 +sx-hash-calc==1.mlnx.4.6.3064 +sx-obj-desc-lib==1.mlnx.4.6.3064 +sx-obj-desc-lib-dev==1.mlnx.4.6.3064 sxd-libs==1.mlnx.4.6.3064 sxd-libs-dev==1.mlnx.4.6.3064 +wjh-libs==1.mlnx.4.6.3064 +wjh-libs-dev==1.mlnx.4.6.3064 diff --git a/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 b/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 index 31d944ddd352..8007697ea3bb 100644 --- a/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 @@ -8,8 +8,8 @@ deepdiff==6.2.2 docker==7.0.0 docker-image-py==0.1.12 enlighten==1.12.4 -filelock==3.13.4 -freezegun==1.4.0 +filelock==3.14.0 +freezegun==1.5.0 ijson==3.2.3 ipaddress==1.0.23 jsondiff==2.0.0 @@ -31,6 +31,7 @@ pycairo==1.26.0 pycparser==2.22 pynacl==1.5.0 pyroute2==0.5.19 +python-arptable==0.0.2 pyyaml==6.0.1 semantic-version==2.10.0 systemd-python==235 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye index 50350dd3ee40..3709687caad9 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye @@ -1,5 +1,3 @@ -applibs==1.mlnx.4.6.3064 -applibs-dev==1.mlnx.4.6.3064 libdashapi==1.0.0 libnl-3-200==3.5.0-1 libnl-3-dev==3.5.0-1 @@ -40,19 +38,4 @@ python3-swsscommon==1.0.0 python3-yang==1.0.73 sonic-mgmt-common==1.0.0 sonic-mgmt-common-codegen==1.0.0 -sx-acl-helper==1.mlnx.4.6.3064 -sx-acl-helper-dev==1.mlnx.4.6.3064 -sx-complib==1.mlnx.4.6.3064 -sx-complib-dev==1.mlnx.4.6.3064 -sx-examples==1.mlnx.4.6.3064 -sx-examples-dev==1.mlnx.4.6.3064 -sx-gen-utils==1.mlnx.4.6.3064 -sx-gen-utils-dev==1.mlnx.4.6.3064 -sx-hash-calc==1.mlnx.4.6.3064 -sx-obj-desc-lib==1.mlnx.4.6.3064 -sx-obj-desc-lib-dev==1.mlnx.4.6.3064 -sxd-libs==1.mlnx.4.6.3064 -sxd-libs-dev==1.mlnx.4.6.3064 thrift-compiler==0.11.0-4 -wjh-libs==1.mlnx.4.6.3064 -wjh-libs-dev==1.mlnx.4.6.3064 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 deleted file mode 100644 index f49254536b08..000000000000 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 +++ /dev/null @@ -1 +0,0 @@ -libsaivs-dev==1.0.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 index 5f7fde14a943..b7b7da383a58 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -7,7 +7,7 @@ colorful==0.5.6 docker==7.0.0 docker-image-py==0.1.12 enlighten==1.12.4 -filelock==3.13.4 +filelock==3.14.0 ijson==3.2.3 ipaddress==1.0.23 jsondiff==2.0.0 @@ -24,7 +24,6 @@ pycairo==1.26.0 pycparser==2.22 pynacl==1.5.0 pyroute2==0.5.19 -python-arptable==0.0.2 pyyaml==6.0.1 semantic-version==2.10.0 systemd-python==235 diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index d13a537ee5e4..c7c706f47465 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,18 +1,18 @@ -amd64:amd64/debian:bookworm==sha256:ada577e24663e2f16bd2aa706bd11d4594f52b9ae08fd3a2156eeefdb8dff1a2 -amd64:amd64/debian:bullseye==sha256:ad47d883924a75f704037e49c71c20ef209fb3ba05be7070322cb45d2e089261 -amd64:amd64/debian:buster==sha256:354013bcb050b68661b9d6038faa63a6bb9f52f559058e31fa6121f6b24e0be1 -amd64:debian:bookworm==sha256:b37bc259c67238d814516548c17ad912f26c3eed48dd9bb54893eafec8739c89 -amd64:debian:bullseye==sha256:26d72b71f88865377988af6f54da9aaa5bed201f39bcee13eb55737016660df2 -amd64:debian:buster==sha256:873743c4eec09ddea0dcac0cda31fce2ff348ed41cd1d5c33ecee7d42f03052f -arm64:arm64v8/debian:bookworm==sha256:e27b218f4fbed3b1b2769805708bf8c4cb7992287e801c8a38821d8765d02880 -arm64:arm64v8/debian:bullseye==sha256:2e5a4906b6d9aaea56dc705dff91d16b092f3b0d504869f8c66cb5223dfff7c7 -arm64:arm64v8/debian:buster==sha256:5e790baa2535371cf5309af22f2b721bde93bdfa22d9d2121e3ab0ac949a702f -arm64:debian:bookworm==sha256:b37bc259c67238d814516548c17ad912f26c3eed48dd9bb54893eafec8739c89 -arm64:debian:bullseye==sha256:26d72b71f88865377988af6f54da9aaa5bed201f39bcee13eb55737016660df2 -arm64:debian:buster==sha256:873743c4eec09ddea0dcac0cda31fce2ff348ed41cd1d5c33ecee7d42f03052f -armhf:arm32v7/debian:bookworm==sha256:72f95924eb348f8dcd1f01a5888ac50a126aa63009dc7705abaeeda2e18f04ea -armhf:arm32v7/debian:bullseye==sha256:55034733fd35fc50c600430a0e6e59f7fe7c46b2b6630274befe3c631e015968 -armhf:arm32v7/debian:buster==sha256:25da76aea696384d64882d7cb3762ab38e427e868aab9e2efdef25321b923101 -armhf:debian:bookworm==sha256:b37bc259c67238d814516548c17ad912f26c3eed48dd9bb54893eafec8739c89 -armhf:debian:bullseye==sha256:26d72b71f88865377988af6f54da9aaa5bed201f39bcee13eb55737016660df2 -armhf:debian:buster==sha256:873743c4eec09ddea0dcac0cda31fce2ff348ed41cd1d5c33ecee7d42f03052f +amd64:amd64/debian:bookworm==sha256:40f71cd223a60afc1bac2adf1b204bfabef29cdef725e74993f86098ff87f92f +amd64:amd64/debian:bullseye==sha256:38fb0f1618bfa65b0cf1dd279293ebc70ef94aab2f2dc49274a2efc6ee29880e +amd64:amd64/debian:buster==sha256:255eec9d157d35e00a81a45f1e958fd19437d504139e8eb4ea6cc380ea741ed4 +amd64:debian:bookworm==sha256:1aadfee8d292f64b045adb830f8a58bfacc15789ae5f489a0fedcd517a862cb9 +amd64:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 +amd64:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 +arm64:arm64v8/debian:bookworm==sha256:40374b5cdc928ffc606cb5c2bbf5e2b2eb6eb918a8e62104ae1f001c49dcbe3a +arm64:arm64v8/debian:bullseye==sha256:284d075b0fd0350198c79fcb19b9b0fccac6ade8ada1b1309aee35dd223fc802 +arm64:arm64v8/debian:buster==sha256:4d104dd705ba3cba521271fae2d7259e4bc078c5f4855de32dab30acc9a5d3c5 +arm64:debian:bookworm==sha256:1aadfee8d292f64b045adb830f8a58bfacc15789ae5f489a0fedcd517a862cb9 +arm64:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 +arm64:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 +armhf:arm32v7/debian:bookworm==sha256:4c1f203254edd0f60bf8269d57f64c3cfc238af1d13d4f8e484c05af2154046b +armhf:arm32v7/debian:bullseye==sha256:c1205d95cc1479322f5c34df0a98f62ede571d041cb02a48ccca34209b3f7be9 +armhf:arm32v7/debian:buster==sha256:540d61b391864b97f3ee3d9d0ded73d21e35b23c3db56c6400ac789118d0f47c +armhf:debian:bookworm==sha256:1aadfee8d292f64b045adb830f8a58bfacc15789ae5f489a0fedcd517a862cb9 +armhf:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 +armhf:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 6be317c50902..f52de7666d54 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,21 +1,21 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==6ba67afd6fb7718743af91b847ddf1907f3ee9a6 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==a9b9284faf89cd1a426371237df8307c328cc818 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 -https://github.com/flashrom/flashrom.git==e5ed0c6340961594dcf1a22f9907d91d576b4885 -https://github.com/FreeRADIUS/freeradius-server.git==a3d5f7f5173f562b53b6da564806fadb97fb3cef -https://github.com/FreeRADIUS/pam_radius.git==2751218c5cd822b4ca8783f1fc03df15500db3c6 +https://github.com/flashrom/flashrom.git==a67b7963a0f8f671fe3d3db54c803a068b93f2c4 +https://github.com/FreeRADIUS/freeradius-server.git==ae174ae97d3274cb168a87e445348845b1da07a2 +https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/lguohan/gnxi.git==3adf8b97755b49947e465b5a14645f11e79fa0cd https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/openconfig/oc-pyang.git==4607fd1987d4f586aba03b40f222015cb3ef8161 https://github.com/p4lang/ptf.git==c554f83685186be4cfa9387eb5d6d700d2bbd7c0 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==0224201ebb6dd47e1dd9ab1f68f8cf2950ea4591 +https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 -https://github.com/thom311/libnl==19d48b0fe924085f28c9410fae448d385f5f9a23 +https://github.com/thom311/libnl==7cc72d19f84698a194bee843af66be9be6179baa https://salsa.debian.org/kernel-team/initramfs-tools.git==cf964bfb4362019fd7fba1e839e403ff950dca8e https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==e4f80d7ae4c9bb1125ff1987b1a0ead33b577ec4 +https://salsa.debian.org/ssh-team/openssh.git==52d8a44435f69123efb98d0e7c128b4a81e8aacb diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 279756087d7a..c699c20d010e 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,23 +1,20 @@ -deb.debian.org_debian-security_dists_bookworm-security==2024-04-19T19:43:00Z -deb.debian.org_debian_dists_bookworm==2024-02-10T11:07:25Z -deb.debian.org_debian_dists_bookworm-updates==2024-04-19T20:17:02Z deb.nodesource.com_node%5f14.x_dists_bookworm==2023-02-17T00:35:29Z deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20240419T000606Z -debian-security==20240419T000427Z -download.docker.com_linux_debian_dists_bookworm==2024-04-18T19:25:14Z -download.docker.com_linux_debian_dists_bullseye==2024-04-18T19:25:15Z -download.docker.com_linux_debian_dists_buster==2024-04-18T19:25:15Z -packages.trafficmanager.net_snapshot_debian-security_20240419T000427Z_dists_bookworm-security==2024-04-17T21:43:25Z -packages.trafficmanager.net_snapshot_debian-security_20240419T000427Z_dists_bullseye-security==2024-04-17T21:43:25Z -packages.trafficmanager.net_snapshot_debian-security_20240419T000427Z_dists_buster_updates==2024-04-17T21:43:25Z -packages.trafficmanager.net_snapshot_debian_20240419T000606Z_dists_bookworm==2024-02-10T11:07:25Z -packages.trafficmanager.net_snapshot_debian_20240419T000606Z_dists_bookworm-backports==2024-04-18T20:13:31Z -packages.trafficmanager.net_snapshot_debian_20240419T000606Z_dists_bookworm-updates==2024-04-18T20:13:31Z -packages.trafficmanager.net_snapshot_debian_20240419T000606Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240419T000606Z_dists_bullseye-backports==2024-04-18T20:13:31Z -packages.trafficmanager.net_snapshot_debian_20240419T000606Z_dists_bullseye-updates==2024-04-18T20:13:31Z -packages.trafficmanager.net_snapshot_debian_20240419T000606Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240419T000606Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240419T000606Z_dists_buster-updates==2023-06-10T08:55:10Z +debian==20240510T000228Z +debian-security==20240510T000251Z +download.docker.com_linux_debian_dists_bookworm==2024-05-10T08:31:56Z +download.docker.com_linux_debian_dists_bullseye==2024-05-10T08:31:56Z +download.docker.com_linux_debian_dists_buster==2024-05-09T09:19:41Z +packages.trafficmanager.net_snapshot_debian-security_20240510T000251Z_dists_bookworm-security==2024-05-09T22:23:01Z +packages.trafficmanager.net_snapshot_debian-security_20240510T000251Z_dists_bullseye-security==2024-05-09T22:23:00Z +packages.trafficmanager.net_snapshot_debian-security_20240510T000251Z_dists_buster_updates==2024-05-09T22:23:00Z +packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bookworm==2024-02-10T11:07:25Z +packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bookworm-backports==2024-05-09T20:12:26Z +packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bookworm-updates==2024-05-09T20:12:26Z +packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bullseye-backports==2024-05-09T20:12:26Z +packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bullseye-updates==2024-05-09T20:12:26Z +packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 87e523f2bd1b..15e5c98151d6 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -1,11 +1,9 @@ -http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4.debian.tar.xz==9a85eed17658cdbf9287606da64143e5 -http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4.dsc==0038ddbc885bea2b1bcf367b1806bfbf -http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4~bpo10+1.debian.tar.xz==4fcbfdd68253864ebbfc11c3fb1480c6 -http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0-4~bpo10+1.dsc==81cf5b863f12de38a48b5a3b602cfff4 -http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_5.10.0.orig.tar.xz==f36f0a0612f7fd565680e918d692900d -http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.7-1.debian.tar.xz==bacfd4f463240af61c4a50298e5f7560 -http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.7-1.dsc==c7b1880f0d2e7a9306007969f3b541ee -http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.7.orig.tar.bz2==602ba7e937c72fbb7b1c2b71c3b0004b +http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_6.1.0-3.debian.tar.xz==fc7fd2b3eebb09770c1608dcddda878e +http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_6.1.0-3.dsc==c3116f907750a9e903d605b18256839f +http://deb.debian.org/debian/pool/main/i/iproute2/iproute2_6.1.0.orig.tar.xz==f3ff4461e25dbc5ef1fb7a9167a9523d +http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.9-2.debian.tar.xz==833a30b64d7b257ce27e6bfa91a33b96 +http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.9-2.dsc==f75e4908e4c841e569447376be6bb043 +http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.9.orig.tar.xz==ffa00f68d63e723c21b8a091c5c0271b http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.3-P1-2.debian.tar.xz==64fbb939e9c93d14e5a9040b45e5b459 http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.3-P1-2.dsc==9f39c78ebbf7d66194de179dc12de49e http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.3-P1.orig.tar.gz==36c6ca77212373b0cff478ae9e5d32af @@ -16,8 +14,7 @@ http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.6.0.orig.tar.gz http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.debian.tar.xz==f457e44218a7d4cc7b7ab0ed696096e3 http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.dsc==d8e34e7b07473c6903f9d245934524fb http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12.orig.tar.gz==d38562490234d8080bdbe8eb7baf937a -http://ftp.us.debian.org/debian/pool/main/s/scapy/python3-scapy_2.4.0-2_all.deb==b8717ca83b3b60da54bc3f72018964a7 -http://www.iana.org/assignments/enterprise-numbers.txt==76c0dcc9f445729894dd54827a91ad38 +http://www.iana.org/assignments/enterprise-numbers.txt==1ab53990feba6e1917592d0b085740ff http://www.mellanox.com/downloads/MFT/mft-4.27.0-83-x86_64-deb.tgz==e475ca87a9252ba8d0abb6b05d5d94d0 https://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz==c64434548438df2cb1e53fb27c600e85 https://bootstrap.pypa.io/pip/2.7/get-pip.py==60e8267eb1b7bc71dc4843eb7bd294d3 @@ -36,8 +33,8 @@ https://deb.nodesource.com/node_14.x/dists/buster/Release==42875141604382f0abb4d https://deb.nodesource.com/setup_14.x==c30873f4a513bb935afaf8f65e7de9e1 https://download.docker.com/linux/debian/gpg==1afae06b34a13c1b3d9cb61a26285a15 https://github.com/aristanetworks/sonic-firmware/raw/9e34da2a2d2d1e7e972cda3064b7b73c0558b322/phy/phy-credo_1.0_amd64.deb==a9c38d11ae4e34ca728d9b3b92fd89af -https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64==44124b7ea28b7ffc38cb7a6b770b7844 -https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64==13442c16ab9043c7f351f74001c565ac +https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64==4c5f03df0d1074addce889dd53d9564a +https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64==bd02444daced3e97685d1067fbe6498d https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/sai/libsaictc-dev_1.13.0-1_amd64.deb==b2e4b33541d4ab5de4c1b8eb4a783761 https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/sai/libsaictc_1.13.0-1_amd64.deb==fd5f2ddc1d9bc12c0e612154c63634cf https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/third_party/advantech/_Susi4.so==5e1b8daef522c9da00af400abe25810b @@ -45,39 +42,31 @@ https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/third_party/ad https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc-dev_1.13.0-1_arm64.deb==1162131e154bba573bf7502d743f1d81 https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc_1.13.0-1_arm64.deb==b8b25694a1dc9b4d8dffc2f2c04ddaed https://github.com/CumulusNetworks/ifupdown2/archive/3.0.0-1.tar.gz==755459b3a58fbc11625336846cea7420 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/rshim-2.0.19-bookworm-amd64/rshim_2.0.19_amd64.deb==8128219b0328704b67def640a356df1f https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.3064/fw-SPC-rel-13_2012_3064-EVB.mfa==55a6024132fb9192fe4a5a1804b4526c https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.3064/fw-SPC2-rel-29_2012_3064-EVB.mfa==093179eb16f8f2e296369015d627af14 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.3064/fw-SPC3-rel-30_2012_3064-EVB.mfa==551440f0027386cf6046df54349a262f https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.3064/fw-SPC4-rel-34_2012_3064-EVB.mfa==e7273975f2dbda83e270f6cc88ebd7aa -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2311.27.0.16-bullseye-amd64/mlnx-sai-dbgsym_1.mlnx.SAIBuild2311.27.0.16_amd64.deb==2cbe57565baca9586c9bf96cf32587ed -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2311.27.0.16-bullseye-amd64/mlnx-sai_1.mlnx.SAIBuild2311.27.0.16_amd64.deb==b406879fee5f14b387a8aa38d91ea3d2 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2311.27.0.16-bookworm-amd64/mlnx-sai-dbgsym_1.mlnx.SAIBuild2311.27.0.16_amd64.deb==351569aa94d7fe2295af2e014572afbd +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sai-SAIBuild2311.27.0.16-bookworm-amd64/mlnx-sai_1.mlnx.SAIBuild2311.27.0.16_amd64.deb==cc89e15c7c7bbdcb36a158d2c944612a https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/applibs-dev_1.mlnx.4.6.3064_amd64.deb==4afd853865eac1d4451116b450732ef6 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/applibs_1.mlnx.4.6.3064_amd64.deb==eaa46b143a2e695cdf06fec59b5f0d19 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/python-sdk-api_1.mlnx.4.6.3064_amd64.deb==7aaa3d3262cc29cd8578d9a9f715bf9b +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-acl-helper-dev_1.mlnx.4.6.3064_amd64.deb==295f02bccd4f80073813deb5ec93e0b9 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-acl-helper_1.mlnx.4.6.3064_amd64.deb==65873768b4d6d01b67e5b0c78bb09e45 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-complib-dev_1.mlnx.4.6.3064_amd64.deb==5aa39735e958c3680f0affca56fc789f https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-complib_1.mlnx.4.6.3064_amd64.deb==9dea90a36971b7acdb1dc7d728bfa58a +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-examples-dev_1.mlnx.4.6.3064_amd64.deb==1915fbb41d1f624b9559fd07f9af7a5d +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-examples_1.mlnx.4.6.3064_amd64.deb==839a814c914b5c56e6eccf6903921250 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-gen-utils-dev_1.mlnx.4.6.3064_amd64.deb==1b3595cef9ec3e516b5bd9ce7d136c80 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-gen-utils_1.mlnx.4.6.3064_amd64.deb==a459df151f33b83946b99ad7041f7957 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-hash-calc_1.mlnx.4.6.3064_amd64.deb==6f3030a1a88ca5373b0d75ae95d8d9da +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-obj-desc-lib-dev_1.mlnx.4.6.3064_amd64.deb==1a8f5bbf2453c12176ae513c95f2e056 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sx-obj-desc-lib_1.mlnx.4.6.3064_amd64.deb==8b4f006c73574b7a572c6e3aa330a4ea https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sxd-libs-dev_1.mlnx.4.6.3064_amd64.deb==16fcc34bec3389592acd2d9e9ce6fd50 https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/sxd-libs_1.mlnx.4.6.3064_amd64.deb==5728c901f56fb8b9de36e7384b17986c -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/applibs-dev_1.mlnx.4.6.3064_amd64.deb==4afd853865eac1d4451116b450732ef6 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/applibs_1.mlnx.4.6.3064_amd64.deb==f7d8a36e61037f262ae861c5dcaaaef7 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/python-sdk-api_1.mlnx.4.6.3064_amd64.deb==bf70e636f8cb51890dac42fce5ed9d7a -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-acl-helper-dev_1.mlnx.4.6.3064_amd64.deb==295f02bccd4f80073813deb5ec93e0b9 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-acl-helper_1.mlnx.4.6.3064_amd64.deb==e7b9964121896f21d040e9a2f5ea53c1 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-complib-dev_1.mlnx.4.6.3064_amd64.deb==5aa39735e958c3680f0affca56fc789f -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-complib_1.mlnx.4.6.3064_amd64.deb==404f0a2db0569748b86eed3ca52a1026 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-examples-dev_1.mlnx.4.6.3064_amd64.deb==1915fbb41d1f624b9559fd07f9af7a5d -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-examples_1.mlnx.4.6.3064_amd64.deb==e368267f7e362c4fad4f56aae2d18335 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-gen-utils-dev_1.mlnx.4.6.3064_amd64.deb==d9d5a987450b20137e26a6b7df636697 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-gen-utils_1.mlnx.4.6.3064_amd64.deb==5369a411c49d496e9ece552229e822ce -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-hash-calc_1.mlnx.4.6.3064_amd64.deb==2dbc24b4f4781e47862b297eddd64677 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-obj-desc-lib-dev_1.mlnx.4.6.3064_amd64.deb==1a8f5bbf2453c12176ae513c95f2e056 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sx-obj-desc-lib_1.mlnx.4.6.3064_amd64.deb==add3a6b702ecfe093ef7c88aa8b7efb6 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sxd-libs-dev_1.mlnx.4.6.3064_amd64.deb==16fcc34bec3389592acd2d9e9ce6fd50 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/sxd-libs_1.mlnx.4.6.3064_amd64.deb==cc3632c5e67f7d3beafc3f132d0d4bc3 -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/wjh-libs-dev_1.mlnx.4.6.3064_amd64.deb==197da637515976dc561a8b11e39df40f -https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bullseye-amd64/wjh-libs_1.mlnx.4.6.3064_amd64.deb==2f61fe9259654e36555f1df40e056b45 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/wjh-libs-dev_1.mlnx.4.6.3064_amd64.deb==197da637515976dc561a8b11e39df40f +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.6.3064-bookworm-amd64/wjh-libs_1.mlnx.4.6.3064_amd64.deb==a6a703cd188ee26e1f75d432971995b5 https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads/4.6.3064.zip==358cd7bbec9e481663addb798517848d https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz==6f56ef28c93cee644e8c4aaaef7cfb55 https://github.com/pensando/dsc-artifacts/blob/main/docker-dpu-base.gz?raw=true==26caa959af69bc5f895dce0cd02557a8 @@ -100,10 +89,14 @@ https://sonicstorage.blob.core.windows.net/debian/pool/main/liby/libyang/libyang https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9+dfsg-4+deb11u1.debian.tar.xz==a3e626b1ed5adc26430e1727d81641df https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9+dfsg-4+deb11u1.dsc==a36ed553b5034b7400d9e9a8d529b27e https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9+dfsg.orig.tar.xz==6c2d346ce3320e8999500497e9bacc99 +https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9.3+dfsg-2.debian.tar.xz==a0561270faa298995d7106ff5c0de3bb +https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9.3+dfsg-2.dsc==2f4fdd92831f79763efbc96457949f6b +https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9.3+dfsg.orig.tar.xz==cb1dd152d16ea204e7b026937f152b38 https://sonicstorage.blob.core.windows.net/public/20190307/bcmcmd==b8aefc751bdf93218716bca6797460ff https://sonicstorage.blob.core.windows.net/public/20190307/dsserve==f9d4b815ebb9be9f755dedca8a51170d -https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo-owl_0.9.3_amd64.deb?==c69922a1589cf5615a3fddd5b66aa296 -https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo_0.9.3_amd64.deb==0400bc2015f56bff7d4283c030be26cc +https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo-blackhawk_0.9.6_amd64.deb==18f6144a93ba577509b7ff8609c35a27 +https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo-owl_0.9.6_amd64.deb==ead55c816f8592bd038815349b388ea3 +https://sonicstorage.blob.core.windows.net/public/credosai/libsaicredo_0.9.6_amd64.deb==1cbebed1acd41a4e90ea04355304d5ac https://sonicstorage.blob.core.windows.net/public/debian/socat_1.7.4.1-3.debian.tar.xz==e8d1e99b4b9e93f5dde860f6d55f42e3 https://sonicstorage.blob.core.windows.net/public/debian/socat_1.7.4.1-3.dsc==df3ed0dd965589fd09bf6a2920bc273e https://sonicstorage.blob.core.windows.net/public/debian/socat_1.7.4.1.orig.tar.gz==780d14908dc1a6aa2790de376ab56b7a diff --git a/files/build/versions/dockers/docker-base-bookworm/versions-deb-bookworm b/files/build/versions/dockers/docker-base-bookworm/versions-deb-bookworm index d0c554ae963d..501094edff8a 100644 --- a/files/build/versions/dockers/docker-base-bookworm/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-base-bookworm/versions-deb-bookworm @@ -2,11 +2,13 @@ ca-certificates==20230311 curl==7.88.1-10+deb12u5 iproute2==6.1.0-3 jq==1.6-2.1 -less==590-2 +less==590-2.1~deb12u2 libatomic1==12.2.0-14 libbpf1==1:1.1.0-1 libbrotli1==1.0.9-2+b6 libbsd0==0.11.7-2 +libc-bin==2.36-9+deb12u7 +libc6==2.36-9+deb12u7 libcap2-bin==1:2.66-4 libcurl4==7.88.1-10+deb12u5 libdaemon0==0.14-7.1 diff --git a/files/build/versions/dockers/docker-base-bookworm/versions-py3 b/files/build/versions/dockers/docker-base-bookworm/versions-py3 index 0ef39410ff1a..13275869ad3c 100644 --- a/files/build/versions/dockers/docker-base-bookworm/versions-py3 +++ b/files/build/versions/dockers/docker-base-bookworm/versions-py3 @@ -1,11 +1,11 @@ async-timeout==4.0.3 j2cli==0.3.10 -jinja2==3.1.3 +jinja2==3.1.4 markupsafe==2.1.5 pip==24.0 python-lzf==0.2.4 rdbtools==0.1.15 -redis==5.0.3 +redis==5.0.4 setuptools==66.1.1 supervisor==4.2.5 supervisord-dependent-startup==1.4.0 diff --git a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye index 716540f65ecb..1a43c5332ff9 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye @@ -2,11 +2,12 @@ ca-certificates==20210119 curl==7.74.0-1.3+deb11u11 iproute2==5.10.0-4 jq==1.6-2.1 -less==551-2 +less==551-2+deb11u2 libatomic1==10.2.1-6 libbpf0==1:0.3-2 libbrotli1==1.0.9-2+b2 libbsd0==0.11.3-1+deb11u1 +libc6==2.31-13+deb11u10 libcap2==1:2.44-1 libcap2-bin==1:2.44-1 libcurl4==7.74.0-1.3+deb11u11 diff --git a/files/build/versions/dockers/docker-base-bullseye/versions-py3 b/files/build/versions/dockers/docker-base-bullseye/versions-py3 index 78376cb1748e..c927d101229d 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-py3 +++ b/files/build/versions/dockers/docker-base-bullseye/versions-py3 @@ -1,11 +1,11 @@ async-timeout==4.0.3 j2cli==0.3.10 -jinja2==3.1.3 +jinja2==3.1.4 markupsafe==2.1.5 pip==24.0 python-lzf==0.2.4 rdbtools==0.1.15 -redis==5.0.3 +redis==5.0.4 setuptools==49.6.0 supervisor==4.2.1 supervisord-dependent-startup==1.4.0 diff --git a/files/build/versions/dockers/docker-base-buster/versions-deb-buster b/files/build/versions/dockers/docker-base-buster/versions-deb-buster index 0f0a68887fe1..820ceac71c13 100644 --- a/files/build/versions/dockers/docker-base-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-base-buster/versions-deb-buster @@ -25,7 +25,7 @@ liblognorm5==2.0.5-1 liblua5.1-0==5.1.5-8.1+b2 libmpdec2==2.4.2-2 libncurses6==6.1+20181013-2+deb10u5 -libnghttp2-14==1.36.0-2+deb10u2 +libnghttp2-14==1.36.0-2+deb10u3 libnorm1==1.5.8+dfsg2-1 libonig5==6.9.1-1 libperl5.28==5.28.1-6+deb10u1 diff --git a/files/build/versions/dockers/docker-base-buster/versions-py3 b/files/build/versions/dockers/docker-base-buster/versions-py3 index 927a1686e911..37440ddb13b4 100644 --- a/files/build/versions/dockers/docker-base-buster/versions-py3 +++ b/files/build/versions/dockers/docker-base-buster/versions-py3 @@ -1,5 +1,5 @@ j2cli==0.3.10 -jinja2==3.1.3 +jinja2==3.1.4 markupsafe==2.1.5 pip==24.0 setuptools==49.6.0 diff --git a/files/build/versions/dockers/docker-config-engine-bookworm/versions-deb-bookworm b/files/build/versions/dockers/docker-config-engine-bookworm/versions-deb-bookworm index 6e642a04ee77..4cbe81273067 100644 --- a/files/build/versions/dockers/docker-config-engine-bookworm/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-config-engine-bookworm/versions-deb-bookworm @@ -3,8 +3,8 @@ binutils-common==2.40-2 dpkg-dev==1.21.22 icu-devtools==72.1-3 libboost-serialization1.74.0==1.74.0+ds1-21 -libc-dev-bin==2.36-9+deb12u4 -libc6-dev==2.36-9+deb12u4 +libc-dev-bin==2.36-9+deb12u7 +libc6-dev==2.36-9+deb12u7 libcrypt-dev==1:4.4.33-2 libhiredis0.14==0.14.1-3 libicu-dev==72.1-3 @@ -27,7 +27,7 @@ libxslt1.1==1.1.35-1 libyaml-0-2==0.2.5-1 libyang==1.0.73 libyang-cpp==1.0.73 -linux-libc-dev==6.1.85-1 +linux-libc-dev==6.1.90-1 python3-swsscommon==1.0.0 python3-yaml==6.0-3+b2 python3-yang==1.0.73 diff --git a/files/build/versions/dockers/docker-config-engine-bookworm/versions-mirror b/files/build/versions/dockers/docker-config-engine-bookworm/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-config-engine-bookworm/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 b/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 index becec22b48d8..ab241307b3a1 100644 --- a/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 @@ -10,7 +10,7 @@ pyangbind==0.8.2 pyyaml==6.0.1 redis==5.0.1 redis-dump-load==1.1 -regex==2024.4.16 +regex==2024.5.10 six==1.16.0 tabulate==0.9.0 xmltodict==0.12.0 diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye index 0eb227fc7d91..f833c3a67be2 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye @@ -2,8 +2,8 @@ apt-utils==2.2.4 dpkg-dev==1.20.13 icu-devtools==67.1-7 libboost-serialization1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcrypt-dev==1:4.4.18-4 libhiredis0.14==0.14.1-1 libicu-dev==67.1-7 @@ -24,7 +24,7 @@ libxslt1-dev==1.1.34-4+deb11u1 libxslt1.1==1.1.34-4+deb11u1 libyang==1.0.73 libyang-cpp==1.0.73 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 python3-swsscommon==1.0.0 python3-yang==1.0.73 sonic-db-cli==1.0.0 diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 index e468cb0439c2..cb89d4ce2eb6 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 @@ -10,7 +10,7 @@ pyangbind==0.8.1 pyyaml==6.0.1 redis==4.5.4 redis-dump-load==1.1 -regex==2024.4.16 +regex==2024.5.10 six==1.16.0 tabulate==0.9.0 xmltodict==0.12.0 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster index 1801e2a268cc..f6ec0e97af11 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster @@ -4,8 +4,9 @@ dpkg-dev==1.19.8 icu-devtools==63.1-6+deb10u3 libapt-inst2.0==1.8.2.3 libboost-serialization1.71.0==1.71.0-6~bpo10+1 -libc-dev-bin==2.28-10+deb10u2 -libc6-dev==2.28-10+deb10u2 +libc-dev-bin==2.28-10+deb10u3 +libc6==2.28-10+deb10u3 +libc6-dev==2.28-10+deb10u3 libdpkg-perl==1.19.8 libglib2.0-0==2.58.3-2+deb10u5 libhiredis0.14==0.14.0-3 diff --git a/files/build/versions/dockers/docker-database/versions-deb-bookworm b/files/build/versions/dockers/docker-database/versions-deb-bookworm index dbb9241216ff..d4a0316f6cd4 100644 --- a/files/build/versions/dockers/docker-database/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-database/versions-deb-bookworm @@ -10,7 +10,7 @@ libdebuginfod1==0.188-2.1 libdw1==0.188-2.1 libedit2==3.1-20221030-2 libfido2-1==1.12.0-2+b1 -libglib2.0-0==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 libgpm2==1.20.7-10+b1 libicu72==72.1-3 libipt2==2.0.5-1 diff --git a/files/build/versions/dockers/docker-database/versions-mirror b/files/build/versions/dockers/docker-database/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-database/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bookworm b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bookworm index acd363bffa5d..3da29ccd3fdb 100644 --- a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-bookworm @@ -13,7 +13,7 @@ libedit2==3.1-20221030-2 libevent-2.1-7==2.1.12-stable-8 libexplain51==1.4.D001-12+b1 libfido2-1==1.12.0-2+b1 -libglib2.0-0==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 libgpm2==1.20.7-10+b1 libicu72==72.1-3 libipt2==2.0.5-1 diff --git a/files/build/versions/dockers/docker-dhcp-relay/versions-mirror b/files/build/versions/dockers/docker-dhcp-relay/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-dhcp-relay/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/docker-dhcp-relay/versions-py3 b/files/build/versions/dockers/docker-dhcp-relay/versions-py3 index 0ff1a8722e47..23bb524ebaaf 100644 --- a/files/build/versions/dockers/docker-dhcp-relay/versions-py3 +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-py3 @@ -1,3 +1,3 @@ -freezegun==1.4.0 +freezegun==1.5.0 psutil==5.9.8 python-dateutil==2.9.0.post0 diff --git a/files/build/versions/dockers/docker-eventd/versions-deb-bookworm b/files/build/versions/dockers/docker-eventd/versions-deb-bookworm index bb687701b5f1..f865853059e8 100644 --- a/files/build/versions/dockers/docker-eventd/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-eventd/versions-deb-bookworm @@ -9,7 +9,7 @@ libdebuginfod1==0.188-2.1 libdw1==0.188-2.1 libedit2==3.1-20221030-2 libfido2-1==1.12.0-2+b1 -libglib2.0-0==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 libgpm2==1.20.7-10+b1 libicu72==72.1-3 libipt2==2.0.5-1 diff --git a/files/build/versions/dockers/docker-eventd/versions-mirror b/files/build/versions/dockers/docker-eventd/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-eventd/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye index 7d076b3f8a5c..551d1b7e5bd1 100644 --- a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye @@ -1,8 +1,8 @@ cron==3.0pl1-137 -frr==8.5.1-sonic-0 -frr-dbgsym==8.5.1-sonic-0 -frr-snmp==8.5.1-sonic-0 -frr-snmp-dbgsym==8.5.1-sonic-0 +frr==8.5.4-sonic-0 +frr-dbgsym==8.5.4-sonic-0 +frr-snmp==8.5.4-sonic-0 +frr-snmp-dbgsym==8.5.4-sonic-0 gdb==10.1-1.7 gdbserver==10.1-1.7 libbabeltrace1==1.5.8-1+b3 @@ -14,7 +14,7 @@ libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye index bf8acc56c2c3..99169d93b946 100644 --- a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye @@ -2,8 +2,8 @@ gdb==10.1-1.7 gdbserver==10.1-1.7 libbabeltrace1==1.5.8-1+b3 libboost-regex1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 libcurl3-gnutls==7.74.0-1.3+deb11u11 @@ -11,7 +11,7 @@ libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 @@ -28,7 +28,7 @@ libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 libtirpc-dev==1.3.1-1+deb11u1 libunwind8==1.3.2-2 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 diff --git a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye index 272f7dca37ab..d61c9bbe5283 100644 --- a/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-credo/versions-deb-bullseye @@ -8,13 +8,14 @@ libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 libmpfr6==4.1.0-3 -libsaicredo==0.9.3 -libsaicredo-owl==0.9.3 +libsaicredo==0.9.6 +libsaicredo-blackhawk==0.9.6 +libsaicredo-owl==0.9.6 libsaimetadata==1.0.0 libsairedis==1.0.0 libsource-highlight-common==3.1.9-3 diff --git a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bookworm b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bookworm new file mode 100644 index 000000000000..afd567e7c4ae --- /dev/null +++ b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bookworm @@ -0,0 +1,35 @@ +gdb==13.1-3 +gdbserver==13.1-3 +libbabeltrace1==1.5.11-1+b2 +libboost-regex1.74.0==1.74.0+ds1-21 +libcbor0.8==0.8.0-2+b1 +libcurl3-gnutls==7.88.1-10+deb12u5 +libdebuginfod-common==0.188-2.1 +libdebuginfod1==0.188-2.1 +libdw1==0.188-2.1 +libedit2==3.1-20221030-2 +libfido2-1==1.12.0-2+b1 +libglib2.0-0==2.74.6-2+deb12u2 +libgpm2==1.20.7-10+b1 +libicu72==72.1-3 +libipt2==2.0.5-1 +libmpfr6==4.2.0-1 +libsaimetadata==1.0.0 +libsaimetadata-dbgsym==1.0.0 +libsairedis==1.0.0 +libsairedis-dbgsym==1.0.0 +libsaivs==1.0.0 +libsaivs-dbgsym==1.0.0 +libsource-highlight-common==3.1.9-4.2 +libsource-highlight4v5==3.1.9-4.2+b3 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.6.2-3 +openssh-client==1:9.2p1-2+deb12u2 +sensible-utils==0.0.17+nmu1 +sshpass==1.09-1+b1 +strace==6.1-0.1 +syncd-vs==1.0.0 +syncd-vs-dbgsym==1.0.0 +ucf==3.0043+nmu1 +vim==2:9.0.1378-2 +vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-lldp/versions-deb-bookworm b/files/build/versions/dockers/docker-lldp/versions-deb-bookworm new file mode 100644 index 000000000000..3c52fb813cd5 --- /dev/null +++ b/files/build/versions/dockers/docker-lldp/versions-deb-bookworm @@ -0,0 +1,37 @@ +gdb==13.1-3 +gdbserver==13.1-3 +libbabeltrace1==1.5.11-1+b2 +libboost-regex1.74.0==1.74.0+ds1-21 +libcbor0.8==0.8.0-2+b1 +libcurl3-gnutls==7.88.1-10+deb12u5 +libdebuginfod-common==0.188-2.1 +libdebuginfod1==0.188-2.1 +libdw1==0.188-2.1 +libedit2==3.1-20221030-2 +libevent-2.1-7==2.1.12-stable-8 +libfido2-1==1.12.0-2+b1 +libglib2.0-0==2.74.6-2+deb12u2 +libgpm2==1.20.7-10+b1 +libicu72==72.1-3 +libipt2==2.0.5-1 +libmpfr6==4.2.0-1 +libpci3==1:3.9.0-4 +libsensors-config==1:3.6.0-7.1 +libsensors5==1:3.6.0-7.1 +libsnmp-base==5.9.3+dfsg-2 +libsnmp40==5.9.3+dfsg-2 +libsource-highlight-common==3.1.9-4.2 +libsource-highlight4v5==3.1.9-4.2+b3 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.6.2-3 +libxml2==2.9.14+dfsg-1.3~deb12u1 +lldpd==1.0.16-1+deb12u1 +lldpd-dbgsym==1.0.16-1+deb12u1 +openssh-client==1:9.2p1-2+deb12u2 +pci.ids==0.0~2023.04.11-1 +sensible-utils==0.0.17+nmu1 +sshpass==1.09-1+b1 +strace==6.1-0.1 +ucf==3.0043+nmu1 +vim==2:9.0.1378-2 +vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye b/files/build/versions/dockers/docker-lldp/versions-deb-bullseye deleted file mode 100644 index 2454215e4ad7..000000000000 --- a/files/build/versions/dockers/docker-lldp/versions-deb-bullseye +++ /dev/null @@ -1,34 +0,0 @@ -gdb==10.1-1.7 -gdbserver==10.1-1.7 -libbabeltrace1==1.5.8-1+b3 -libboost-regex1.74.0==1.74.0-9 -libcbor0==0.5.0+dfsg-2 -libcurl3-gnutls==7.74.0-1.3+deb11u11 -libdebuginfod1==0.183-1 -libdw1==0.183-1 -libedit2==3.1-20191231-2+b1 -libevent-2.1-7==2.1.12-stable-1 -libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 -libgpm2==1.20.7-8 -libicu67==67.1-7 -libipt2==2.0.3-1 -libmpfr6==4.1.0-3 -libpci3==1:3.7.0-5 -libsensors-config==1:3.6.0-7 -libsensors5==1:3.6.0-7 -libsnmp-base==5.9+dfsg-4+deb11u1 -libsnmp40==5.9+dfsg-4+deb11u1 -libsource-highlight-common==3.1.9-3 -libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbgsym==1.0.0 -libunwind8==1.3.2-2 -libxml2==2.9.10+dfsg-6.7+deb11u4 -lldpd==1.0.16-1+deb12u1 -lldpd-dbgsym==1.0.16-1+deb12u1 -openssh-client==1:8.4p1-5+deb11u3 -pci.ids==0.0~2021.02.08-1 -sshpass==1.09-1+b1 -strace==5.10-1 -vim==2:8.2.2434-3+deb11u1 -vim-runtime==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/dockers/docker-macsec/versions-deb-bookworm b/files/build/versions/dockers/docker-macsec/versions-deb-bookworm index 24a19338a1fb..ecadea5a6d95 100644 --- a/files/build/versions/dockers/docker-macsec/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-macsec/versions-deb-bookworm @@ -9,7 +9,7 @@ libdebuginfod1==0.188-2.1 libdw1==0.188-2.1 libedit2==3.1-20221030-2 libfido2-1==1.12.0-2+b1 -libglib2.0-0==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 libgpm2==1.20.7-10+b1 libicu72==72.1-3 libipt2==2.0.5-1 diff --git a/files/build/versions/dockers/docker-macsec/versions-mirror b/files/build/versions/dockers/docker-macsec/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-macsec/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/docker-mux/versions-deb-bookworm b/files/build/versions/dockers/docker-mux/versions-deb-bookworm index e67021248c2d..0838f42f982d 100644 --- a/files/build/versions/dockers/docker-mux/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-mux/versions-deb-bookworm @@ -13,7 +13,7 @@ libdebuginfod1==0.188-2.1 libdw1==0.188-2.1 libedit2==3.1-20221030-2 libfido2-1==1.12.0-2+b1 -libglib2.0-0==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 libgpm2==1.20.7-10+b1 libicu72==72.1-3 libipt2==2.0.5-1 diff --git a/files/build/versions/dockers/docker-mux/versions-mirror b/files/build/versions/dockers/docker-mux/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-mux/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/docker-nat/versions-deb-bookworm b/files/build/versions/dockers/docker-nat/versions-deb-bookworm new file mode 100644 index 000000000000..6e0af0d6e2d1 --- /dev/null +++ b/files/build/versions/dockers/docker-nat/versions-deb-bookworm @@ -0,0 +1,38 @@ +bridge-utils==1.7.1-1 +conntrack==1:1.4.7-1+b2 +gdb==13.1-3 +gdbserver==13.1-3 +iptables==1.8.9-2 +libbabeltrace1==1.5.11-1+b2 +libboost-regex1.74.0==1.74.0+ds1-21 +libcbor0.8==0.8.0-2+b1 +libcurl3-gnutls==7.88.1-10+deb12u5 +libdebuginfod-common==0.188-2.1 +libdebuginfod1==0.188-2.1 +libdw1==0.188-2.1 +libedit2==3.1-20221030-2 +libfido2-1==1.12.0-2+b1 +libglib2.0-0==2.74.6-2+deb12u2 +libgpm2==1.20.7-10+b1 +libicu72==72.1-3 +libip4tc2==1.8.9-2 +libip6tc2==1.8.9-2 +libipt2==2.0.5-1 +libiptc0==1.8.9-2 +libmpfr6==4.2.0-1 +libnetfilter-conntrack3==1.0.9-3 +libnfnetlink0==1.0.2-2 +libnftnl11==1.2.4-2 +libsource-highlight-common==3.1.9-4.2 +libsource-highlight4v5==3.1.9-4.2+b3 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.6.2-3 +netbase==6.4 +openssh-client==1:9.2p1-2+deb12u2 +sensible-utils==0.0.17+nmu1 +sshpass==1.09-1+b1 +strace==6.1-0.1 +swss-dbg==1.0.0 +ucf==3.0043+nmu1 +vim==2:9.0.1378-2 +vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-nat/versions-deb-bullseye b/files/build/versions/dockers/docker-nat/versions-deb-bullseye deleted file mode 100644 index fa4f16b3aacf..000000000000 --- a/files/build/versions/dockers/docker-nat/versions-deb-bullseye +++ /dev/null @@ -1,35 +0,0 @@ -bridge-utils==1.7-1 -conntrack==1:1.4.6-2 -gdb==10.1-1.7 -gdbserver==10.1-1.7 -iptables==1.8.7-1 -libbabeltrace1==1.5.8-1+b3 -libboost-regex1.74.0==1.74.0-9 -libcbor0==0.5.0+dfsg-2 -libcurl3-gnutls==7.74.0-1.3+deb11u11 -libdebuginfod1==0.183-1 -libdw1==0.183-1 -libedit2==3.1-20191231-2+b1 -libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 -libgpm2==1.20.7-8 -libicu67==67.1-7 -libip4tc2==1.8.7-1 -libip6tc2==1.8.7-1 -libipt2==2.0.3-1 -libiptc0==1.8.7-1 -libmpfr6==4.1.0-3 -libnetfilter-conntrack3==1.0.8-3 -libnfnetlink0==1.0.1-3+b1 -libnftnl11==1.1.9-1 -libsource-highlight-common==3.1.9-3 -libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbgsym==1.0.0 -libunwind8==1.3.2-2 -netbase==6.3 -openssh-client==1:8.4p1-5+deb11u3 -sshpass==1.09-1+b1 -strace==5.10-1 -swss-dbg==1.0.0 -vim==2:8.2.2434-3+deb11u1 -vim-runtime==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/dockers/docker-orchagent/versions-deb-bookworm b/files/build/versions/dockers/docker-orchagent/versions-deb-bookworm index 113b60aed8e4..f606f8ca6820 100644 --- a/files/build/versions/dockers/docker-orchagent/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-orchagent/versions-deb-bookworm @@ -13,7 +13,7 @@ libdebuginfod1==0.188-2.1 libdw1==0.188-2.1 libedit2==3.1-20221030-2 libfido2-1==1.12.0-2+b1 -libglib2.0-0==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 libgpm2==1.20.7-10+b1 libicu72==72.1-3 libipt2==2.0.5-1 @@ -35,6 +35,7 @@ ndppd==0.2.5-6 openssh-client==1:9.2p1-2+deb12u2 pci.ids==0.0~2023.04.11-1 pciutils==1:3.9.0-4 +python3-protobuf==3.21.12-3 sensible-utils==0.0.17+nmu1 sgml-base==1.31 sonic-rsyslog-plugin==1.0.0-0 diff --git a/files/build/versions/dockers/docker-orchagent/versions-mirror b/files/build/versions/dockers/docker-orchagent/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-orchagent/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/docker-orchagent/versions-py3 b/files/build/versions/dockers/docker-orchagent/versions-py3 index 197d40489fb2..00191ce1cda2 100644 --- a/files/build/versions/dockers/docker-orchagent/versions-py3 +++ b/files/build/versions/dockers/docker-orchagent/versions-py3 @@ -1,2 +1,3 @@ netifaces==0.10.9 +protobuf==4.21.12 pyroute2==0.5.14 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm index fd6d7b8a226b..ce7883fa9d43 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm @@ -27,7 +27,7 @@ libfido2-1==1.12.0-2+b1 libfontconfig1==2.14.1-4 libfreetype6==2.12.1+dfsg-5 libfribidi0==1.0.8-2.1 -libglib2.0-0==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 libgpm2==1.20.7-10+b1 libgraphite2-3==1.3.14-1 libharfbuzz0b==6.0.0+dfsg-3 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-mirror b/files/build/versions/dockers/docker-platform-monitor/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-platform-monitor/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index 02c90922c038..518fcc70e7de 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -99,9 +99,11 @@ libboost-atomic1.71.0==1.71.0-6~bpo10+1 libbrotli1==1.0.7-2+deb10u1 libbsd0==0.9.1-2+deb10u1 libc-ares2==1.14.0-1+deb10u4 -libc-dev-bin==2.28-10+deb10u2 -libc6-dbg==2.28-10+deb10u2 -libc6-dev==2.28-10+deb10u2 +libc-bin==2.28-10+deb10u3 +libc-dev-bin==2.28-10+deb10u3 +libc6==2.28-10+deb10u3 +libc6-dbg==2.28-10+deb10u3 +libc6-dev==2.28-10+deb10u3 libcairo-gobject2==1.16.0-4+deb10u1 libcairo2==1.16.0-4+deb10u1 libcc1-0==8.3.0-6 @@ -269,7 +271,7 @@ libnet-http-perl==6.18-1 libnet-smtp-ssl-perl==1.04-1 libnet-ssleay-perl==1.85-2+deb10u1 libnet1==1.1.6+dfsg-3.1 -libnghttp2-14==1.36.0-2+deb10u2 +libnghttp2-14==1.36.0-2+deb10u3 libnl-3-200==3.4.0-1 libnl-cli-3-200==3.4.0-1 libnl-genl-3-200==3.4.0-1 @@ -319,18 +321,18 @@ libpython3.7==3.7.3-2+deb10u7 libpython3.7-dev==3.7.3-2+deb10u7 libpython3.7-minimal==3.7.3-2+deb10u7 libpython3.7-stdlib==3.7.3-2+deb10u7 -libqt5core5a==5.11.3+dfsg1-1+deb10u5 -libqt5dbus5==5.11.3+dfsg1-1+deb10u5 -libqt5gui5==5.11.3+dfsg1-1+deb10u5 +libqt5core5a==5.11.3+dfsg1-1+deb10u6 +libqt5dbus5==5.11.3+dfsg1-1+deb10u6 +libqt5gui5==5.11.3+dfsg1-1+deb10u6 libqt5multimedia5==5.11.3-2 libqt5multimedia5-plugins==5.11.3-2 libqt5multimediagsttools5==5.11.3-2 libqt5multimediawidgets5==5.11.3-2 -libqt5network5==5.11.3+dfsg1-1+deb10u5 -libqt5opengl5==5.11.3+dfsg1-1+deb10u5 -libqt5printsupport5==5.11.3+dfsg1-1+deb10u5 +libqt5network5==5.11.3+dfsg1-1+deb10u6 +libqt5opengl5==5.11.3+dfsg1-1+deb10u6 +libqt5printsupport5==5.11.3+dfsg1-1+deb10u6 libqt5svg5==5.11.3-2 -libqt5widgets5==5.11.3+dfsg1-1+deb10u5 +libqt5widgets5==5.11.3+dfsg1-1+deb10u6 libquadmath0==8.3.0-6 libreadline7==7.0-5 librest-0.7-0==0.8.1-1 @@ -557,7 +559,7 @@ python3.7==3.7.3-2+deb10u7 python3.7-dev==3.7.3-2+deb10u7 python3.7-minimal==3.7.3-2+deb10u7 python3.7-venv==3.7.3-2+deb10u7 -qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 +qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u6 qttranslations5-l10n==5.11.3-2 readline-common==7.0-5 rsync==3.1.3-6 diff --git a/files/build/versions/dockers/docker-router-advertiser/versions-deb-bookworm b/files/build/versions/dockers/docker-router-advertiser/versions-deb-bookworm index ef60589684cc..2c7500156d98 100644 --- a/files/build/versions/dockers/docker-router-advertiser/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-router-advertiser/versions-deb-bookworm @@ -9,7 +9,7 @@ libdebuginfod1==0.188-2.1 libdw1==0.188-2.1 libedit2==3.1-20221030-2 libfido2-1==1.12.0-2+b1 -libglib2.0-0==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 libgpm2==1.20.7-10+b1 libicu72==72.1-3 libipt2==2.0.5-1 diff --git a/files/build/versions/dockers/docker-router-advertiser/versions-mirror b/files/build/versions/dockers/docker-router-advertiser/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-router-advertiser/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye index 9c2e1a810961..351cd823756a 100644 --- a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye @@ -11,7 +11,7 @@ libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-snmp/versions-deb-bookworm b/files/build/versions/dockers/docker-snmp/versions-deb-bookworm new file mode 100644 index 000000000000..80548bf4227b --- /dev/null +++ b/files/build/versions/dockers/docker-snmp/versions-deb-bookworm @@ -0,0 +1,43 @@ +freeipmi-common==1.6.10-1 +gdb==13.1-3 +gdbserver==13.1-3 +ipmitool==1.8.19-4 +libbabeltrace1==1.5.11-1+b2 +libboost-regex1.74.0==1.74.0+ds1-21 +libc-l10n==2.36-9+deb12u7 +libcbor0.8==0.8.0-2+b1 +libcurl3-gnutls==7.88.1-10+deb12u5 +libdebuginfod-common==0.188-2.1 +libdebuginfod1==0.188-2.1 +libdw1==0.188-2.1 +libedit2==3.1-20221030-2 +libfido2-1==1.12.0-2+b1 +libfreeipmi17==1.6.10-1+b1 +libglib2.0-0==2.74.6-2+deb12u2 +libgpm2==1.20.7-10+b1 +libicu72==72.1-3 +libipt2==2.0.5-1 +libmpfr6==4.2.0-1 +libpci3==1:3.9.0-4 +libsensors-config==1:3.6.0-7.1 +libsensors5==1:3.6.0-7.1 +libsnmp-base==5.9.3+dfsg-2 +libsnmp40==5.9.3+dfsg-2 +libsnmp40-dbgsym==5.9.3+dfsg-2 +libsource-highlight-common==3.1.9-4.2 +libsource-highlight4v5==3.1.9-4.2+b3 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.6.2-3 +locales==2.36-9+deb12u7 +openssh-client==1:9.2p1-2+deb12u2 +pci.ids==0.0~2023.04.11-1 +sensible-utils==0.0.17+nmu1 +snmp==5.9.3+dfsg-2 +snmp-dbgsym==5.9.3+dfsg-2 +snmpd==5.9.3+dfsg-2 +snmpd-dbgsym==5.9.3+dfsg-2 +sshpass==1.09-1+b1 +strace==6.1-0.1 +ucf==3.0043+nmu1 +vim==2:9.0.1378-2 +vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye b/files/build/versions/dockers/docker-snmp/versions-deb-bullseye deleted file mode 100644 index 247f77f7900a..000000000000 --- a/files/build/versions/dockers/docker-snmp/versions-deb-bullseye +++ /dev/null @@ -1,40 +0,0 @@ -freeipmi-common==1.6.6-4+deb11u1 -gdb==10.1-1.7 -gdbserver==10.1-1.7 -ipmitool==1.8.18-10.1 -libbabeltrace1==1.5.8-1+b3 -libboost-regex1.74.0==1.74.0-9 -libc-l10n==2.31-13+deb11u8 -libcbor0==0.5.0+dfsg-2 -libcurl3-gnutls==7.74.0-1.3+deb11u11 -libdebuginfod1==0.183-1 -libdw1==0.183-1 -libedit2==3.1-20191231-2+b1 -libfido2-1==1.6.0-2 -libfreeipmi17==1.6.6-4+deb11u1 -libglib2.0-0==2.66.8-1+deb11u1 -libgpm2==1.20.7-8 -libicu67==67.1-7 -libipt2==2.0.3-1 -libmpfr6==4.1.0-3 -libpci3==1:3.7.0-5 -libsensors-config==1:3.6.0-7 -libsensors5==1:3.6.0-7 -libsnmp-base==5.9+dfsg-4+deb11u1 -libsnmp40==5.9+dfsg-4+deb11u1 -libsnmp40-dbgsym==5.9+dfsg-4+deb11u1 -libsource-highlight-common==3.1.9-3 -libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbgsym==1.0.0 -libunwind8==1.3.2-2 -locales==2.31-13+deb11u8 -openssh-client==1:8.4p1-5+deb11u3 -pci.ids==0.0~2021.02.08-1 -snmp==5.9+dfsg-4+deb11u1 -snmp-dbgsym==5.9+dfsg-4+deb11u1 -snmpd==5.9+dfsg-4+deb11u1 -snmpd-dbgsym==5.9+dfsg-4+deb11u1 -sshpass==1.09-1+b1 -strace==5.10-1 -vim==2:8.2.2434-3+deb11u1 -vim-runtime==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye index 7ae0b391e217..40e96a175a43 100644 --- a/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye @@ -8,7 +8,7 @@ libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye index 6766a3285ffb..27ec4b678e17 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye @@ -13,7 +13,7 @@ fontconfig-config==2.13.1-4.2 fonts-dejavu-core==2.37-2 fonts-font-awesome==5.0.10+really4.7.0~dfsg-4.1 fonts-lato==2.0-2.1 -frr==8.5.1-sonic-0 +frr==8.5.4-sonic-0 gettext-base==0.21-4 gir1.2-glib-2.0==1.66.1-1+b1 gnupg==2.2.27-2+deb11u2 @@ -29,7 +29,7 @@ grub-common==2.06-3~deb11u6 grub2-common==2.06-3~deb11u6 icu-devtools==67.1-7 ifupdown==0.8.36 -iproute2==5.10.0-4sonic1 +iproute2==6.1.0-3~bpo11+1 iptables==1.8.7-1 krb5-multidev==1.18.3-6+deb11u4+fips libapparmor1==2.13.6-10 @@ -38,8 +38,8 @@ libblkid-dev==2.36.1-8+deb11u2 libblkid1==2.36.1-8+deb11u2 libbsd-dev==0.11.3-1+deb11u1 libc-ares2==1.17.1-1+deb11u3 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcbor0==0.5.0+dfsg-2 libcrypt-dev==1:4.4.18-4 libdevmapper1.02.1==2:1.02.175-2.1 @@ -52,8 +52,8 @@ libfreetype6==2.10.4+dfsg-1+deb11u1 libfreetype6-dev==2.10.4+dfsg-1+deb11u1 libfuse2==2.9.9-5 libgirepository-1.0-1==1.66.1-1+b1 -libglib2.0-0==2.66.8-1+deb11u1 -libglib2.0-data==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 +libglib2.0-data==2.66.8-1+deb11u3 libgssapi-krb5-2==1.18.3-6+deb11u4+fips libgssrpc4==1.18.3-6+deb11u4+fips libicu-dev==67.1-7 @@ -104,7 +104,7 @@ libxml2==2.9.10+dfsg-6.7+deb11u4 libxml2-dev==2.9.10+dfsg-6.7+deb11u4 libyang2==2.0.112-6 libzmq3-dev==4.3.4-1+deb11u1 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 logrotate==3.18.0-2+deb11u2 lsof==4.93.2+dfsg-1.1 mailcap==3.69 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index 9830e037484b..d0d352f18c01 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -7,12 +7,12 @@ charset-normalizer==3.3.2 click==7.0 click-log==0.4.0 colorful==0.5.6 -cryptography==42.0.5 +cryptography==42.0.7 dbus-python==1.3.2 docker==7.0.0 docker-image-py==0.1.12 enlighten==1.12.4 -filelock==3.13.4 +filelock==3.14.0 idna==3.7 importlib-metadata==6.1.0 jsonpatch==1.33 @@ -25,10 +25,11 @@ paramiko==2.11.0 pexpect==4.9.0 prefixed==0.7.1 prettyprinter==0.18.0 +psutil==5.9.8 ptyprocess==0.7.0 pycairo==1.26.0 pycparser==2.22 -pygments==2.17.2 +pygments==2.18.0 pygobject==3.48.2 pynacl==1.5.0 pyroute2==0.5.14 diff --git a/files/build/versions/dockers/docker-swss-layer-bookworm/versions-mirror b/files/build/versions/dockers/docker-swss-layer-bookworm/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-swss-layer-bookworm/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye index 5aa883cb4d99..ccec9b25c822 100644 --- a/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye @@ -15,8 +15,8 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 @@ -26,7 +26,7 @@ libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgomp1==10.2.1-6 libicu67==67.1-7 libisl23==0.23-1 @@ -57,7 +57,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 diff --git a/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye index 6a726d5dff63..72bbb5739dfb 100644 --- a/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm-dnx/versions-deb-bullseye @@ -10,7 +10,7 @@ libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye index 5aa883cb4d99..ccec9b25c822 100644 --- a/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye @@ -15,8 +15,8 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 @@ -26,7 +26,7 @@ libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgomp1==10.2.1-6 libicu67==67.1-7 libisl23==0.23-1 @@ -57,7 +57,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 diff --git a/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye index 225a59d00758..1c5b66ad5b5c 100644 --- a/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-bullseye @@ -10,7 +10,7 @@ libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libicu67==67.1-7 libipt2==2.0.3-1 diff --git a/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye index 5aa883cb4d99..ccec9b25c822 100644 --- a/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye @@ -15,8 +15,8 @@ libarchive13==3.4.3-2+deb11u1 libasan6==10.2.1-6 libbinutils==2.35.2-2 libboost-atomic1.74.0==1.74.0-9 -libc-dev-bin==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 libcc1-0==10.2.1-6 libcrypt-dev==1:4.4.18-4 libctf-nobfd0==2.35.2-2 @@ -26,7 +26,7 @@ libdpkg-perl==1.20.13 libexpat1-dev==2.2.10-2+deb11u5 libffi-dev==3.3-6 libgcc-10-dev==10.2.1-6 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgomp1==10.2.1-6 libicu67==67.1-7 libisl23==0.23-1 @@ -57,7 +57,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.209-2 +linux-libc-dev==5.10.216-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 diff --git a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye index a3b48eb31ab1..f9547ecf807d 100644 --- a/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-centec/versions-deb-bullseye @@ -9,7 +9,7 @@ libdebuginfod1==0.183-1 libdw1==0.183-1 libedit2==3.1-20191231-2+b1 libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 libgpm2==1.20.7-8 libhiredis0.14-dbgsym==0.14.1-1 libicu67==67.1-7 diff --git a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bookworm b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bookworm new file mode 100644 index 000000000000..5fa2d43ee267 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-bookworm @@ -0,0 +1,18 @@ +cmake-data==3.25.1-1 +libboost-atomic1.74.0==1.74.0+ds1-21 +libdouble-conversion3==3.2.1-1 +libglib2.0-0==2.74.6-2+deb12u2 +libnanomsg-dev==1.1.5+dfsg-1.1+b1 +libnanomsg5==1.1.5+dfsg-1.1+b1 +libpcre2-16-0==10.42-1 +libqt5core5a==5.15.8+dfsg-11 +libqt5dbus5==5.15.8+dfsg-11 +libqt5network5==5.15.8+dfsg-11 +libthrift-0.17.0==0.17.0-2+b2 +netbase==6.4 +python3-scapy==2.5.0+dfsg-2 +python3-thrift==0.17.0-2+b2 +shared-mime-info==2.2-1 +syncd-rpc==1.0.0 +thrift-compiler==0.17.0-2+b2 +wget==1.21.3-1+b2 diff --git a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py3 b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py3 index 9ad41d81dc2f..cf9d9ebd3176 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py3 +++ b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py3 @@ -2,4 +2,5 @@ cffi==1.16.0 nnpy==1.4.2 ptf==0.10.0 pycparser==2.22 -scapy==2.4.0 +scapy==2.5.0 +thrift==0.17.0 diff --git a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bookworm b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bookworm new file mode 100644 index 000000000000..c6b09dbd0b75 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bookworm @@ -0,0 +1,74 @@ +applibs==1.mlnx.4.6.3064 +applibs-dev==1.mlnx.4.6.3064 +gdb==13.1-3 +gdbserver==13.1-3 +iproute2-mlnx==6.1.0-3 +libbabeltrace1==1.5.11-1+b2 +libboost-regex1.74.0==1.74.0+ds1-21 +libc-dev-bin==2.36-9+deb12u7 +libc6-dev==2.36-9+deb12u7 +libcbor0.8==0.8.0-2+b1 +libcurl3-gnutls==7.88.1-10+deb12u5 +libdebuginfod-common==0.188-2.1 +libdebuginfod1==0.188-2.1 +libdw1==0.188-2.1 +libedit2==3.1-20221030-2 +libexpat1-dev==2.5.0-1 +libfido2-1==1.12.0-2+b1 +libglib2.0-0==2.74.6-2+deb12u2 +libgpm2==1.20.7-10+b1 +libicu72==72.1-3 +libipt2==2.0.5-1 +libjs-sphinxdoc==5.3.0-4 +libjs-underscore==1.13.4~dfsg+~1.11.4-3 +libmpfr6==4.2.0-1 +libnsl-dev==1.3.0-2 +libpython3-dev==3.11.2-1+b1 +libpython3.11-dev==3.11.2-6 +libsaimetadata==1.0.0 +libsaimetadata-dbgsym==1.0.0 +libsairedis==1.0.0 +libsairedis-dbgsym==1.0.0 +libsource-highlight-common==3.1.9-4.2 +libsource-highlight4v5==3.1.9-4.2+b3 +libswsscommon-dbgsym==1.0.0 +libtirpc-dev==1.3.3+ds-1 +libunwind8==1.6.2-3 +libxml2==2.9.14+dfsg-1.3~deb12u1 +linux-libc-dev==6.1.90-1 +mft==4.27.0-83 +mft-fwtrace-cfg==1.0.0 +mlnx-sai==1.mlnx.SAIBuild2311.27.0.16 +openssh-client==1:9.2p1-2+deb12u2 +python-sdk-api==1.mlnx.4.6.3064 +python3-attr==22.2.0-1 +python3-dev==3.11.2-1+b1 +python3-jsonschema==4.10.3-1 +python3-pip==23.0.1+dfsg-1 +python3-pyrsistent==0.18.1-1+b3 +python3.11-dev==3.11.2-6 +rpcsvc-proto==1.4.3-1 +sensible-utils==0.0.17+nmu1 +sshpass==1.09-1+b1 +strace==6.1-0.1 +sx-acl-helper==1.mlnx.4.6.3064 +sx-acl-helper-dev==1.mlnx.4.6.3064 +sx-complib==1.mlnx.4.6.3064 +sx-complib-dev==1.mlnx.4.6.3064 +sx-examples==1.mlnx.4.6.3064 +sx-examples-dev==1.mlnx.4.6.3064 +sx-gen-utils==1.mlnx.4.6.3064 +sx-gen-utils-dev==1.mlnx.4.6.3064 +sx-hash-calc==1.mlnx.4.6.3064 +sx-obj-desc-lib==1.mlnx.4.6.3064 +sx-obj-desc-lib-dev==1.mlnx.4.6.3064 +sxd-libs==1.mlnx.4.6.3064 +sxd-libs-dev==1.mlnx.4.6.3064 +syncd==1.0.0 +syncd-dbgsym==1.0.0 +ucf==3.0043+nmu1 +vim==2:9.0.1378-2 +vim-runtime==2:9.0.1378-2 +wjh-libs==1.mlnx.4.6.3064 +wjh-libs-dev==1.mlnx.4.6.3064 +zlib1g-dev==1:1.2.13.dfsg-1 diff --git a/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 b/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 index 908739d95973..9330926a786d 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 @@ -1,7 +1,8 @@ -attrs==20.3.0 +attrs==22.2.0 importlib-metadata==1.6.0 -jsonschema==3.2.0 +jsonschema==4.10.3 more-itertools==4.2.0 -pyrsistent==0.15.5 +pyrsistent==0.18.1 +python-sdk-api==4.6.3064 python_sdk_api==4.6.3064 zipp==1.0.0 diff --git a/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bookworm-arm64 b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bookworm-arm64 new file mode 100644 index 000000000000..86b1a2416211 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bookworm-arm64 @@ -0,0 +1,24 @@ +iputils-ping==3:20221126-1 +libdbus-1-dev==1.14.10-1~deb12u1 +libexpat1-dev==2.5.0-1 +libjs-sphinxdoc==5.3.0-4 +libjs-underscore==1.13.4~dfsg+~1.11.4-3 +libpcap-dev==1.10.3-1 +libpcap0.8==1.10.3-1 +libpcap0.8-dev==1.10.3-1 +libpkgconf3==1.8.1-1 +libpython3-dev==3.11.2-1+b1 +libpython3.11-dev==3.11.2-6 +libsaimetadata==1.0.0 +libsairedis==1.0.0 +mrvllibsai==1.13.0-1 +pkg-config==1.8.1-1 +pkgconf==1.8.1-1 +pkgconf-bin==1.8.1-1 +python3-dev==3.11.2-1+b1 +python3.11-dev==3.11.2-6 +sgml-base==1.31 +swig==4.1.0-0.2 +swig4.0==4.1.0-0.2 +syncd==1.0.0 +xml-core==0.18+nmu1 diff --git a/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bookworm-armhf b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bookworm-armhf new file mode 100644 index 000000000000..0cc251c1f8d0 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-bookworm-armhf @@ -0,0 +1,24 @@ +iputils-ping==3:20221126-1 +libdbus-1-dev==1.14.10-1~deb12u1 +libexpat1-dev==2.5.0-1 +libjs-sphinxdoc==5.3.0-4 +libjs-underscore==1.13.4~dfsg+~1.11.4-3 +libpcap-dev==1.10.3-1 +libpcap0.8==1.10.3-1 +libpcap0.8-dev==1.10.3-1 +libpkgconf3==1.8.1-1 +libpython3-dev==3.11.2-1+b1 +libpython3.11-dev==3.11.2-6 +libsaimetadata==1.0.0 +libsairedis==1.0.0 +mrvllibsai==1.13.0-3 +pkg-config==1.8.1-1 +pkgconf==1.8.1-1 +pkgconf-bin==1.8.1-1 +python3-dev==3.11.2-1+b1 +python3.11-dev==3.11.2-6 +sgml-base==1.31 +swig==4.1.0-0.2 +swig4.0==4.1.0-0.2 +syncd==1.0.0 +xml-core==0.18+nmu1 diff --git a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bookworm b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bookworm new file mode 100644 index 000000000000..afd567e7c4ae --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bookworm @@ -0,0 +1,35 @@ +gdb==13.1-3 +gdbserver==13.1-3 +libbabeltrace1==1.5.11-1+b2 +libboost-regex1.74.0==1.74.0+ds1-21 +libcbor0.8==0.8.0-2+b1 +libcurl3-gnutls==7.88.1-10+deb12u5 +libdebuginfod-common==0.188-2.1 +libdebuginfod1==0.188-2.1 +libdw1==0.188-2.1 +libedit2==3.1-20221030-2 +libfido2-1==1.12.0-2+b1 +libglib2.0-0==2.74.6-2+deb12u2 +libgpm2==1.20.7-10+b1 +libicu72==72.1-3 +libipt2==2.0.5-1 +libmpfr6==4.2.0-1 +libsaimetadata==1.0.0 +libsaimetadata-dbgsym==1.0.0 +libsairedis==1.0.0 +libsairedis-dbgsym==1.0.0 +libsaivs==1.0.0 +libsaivs-dbgsym==1.0.0 +libsource-highlight-common==3.1.9-4.2 +libsource-highlight4v5==3.1.9-4.2+b3 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.6.2-3 +openssh-client==1:9.2p1-2+deb12u2 +sensible-utils==0.0.17+nmu1 +sshpass==1.09-1+b1 +strace==6.1-0.1 +syncd-vs==1.0.0 +syncd-vs-dbgsym==1.0.0 +ucf==3.0043+nmu1 +vim==2:9.0.1378-2 +vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-teamd/versions-deb-bookworm b/files/build/versions/dockers/docker-teamd/versions-deb-bookworm index 22d08f783258..b2369562d25c 100644 --- a/files/build/versions/dockers/docker-teamd/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-teamd/versions-deb-bookworm @@ -9,7 +9,7 @@ libdebuginfod1==0.188-2.1 libdw1==0.188-2.1 libedit2==3.1-20221030-2 libfido2-1==1.12.0-2+b1 -libglib2.0-0==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 libgpm2==1.20.7-10+b1 libicu72==72.1-3 libipt2==2.0.5-1 diff --git a/files/build/versions/dockers/docker-teamd/versions-mirror b/files/build/versions/dockers/docker-teamd/versions-mirror deleted file mode 100644 index 18bbd1153814..000000000000 --- a/files/build/versions/dockers/docker-teamd/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-20T02:13:22Z diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm b/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm index 2e0c8d12ef94..af573272f4f8 100644 --- a/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm @@ -110,7 +110,7 @@ docbook-xml==4.5-12 docker-buildx-plugin==0.10.5-1~debian.12~bookworm docker-ce==5:24.0.2-1~debian.12~bookworm docker-ce-cli==5:24.0.2-1~debian.12~bookworm -docker-ce-rootless-extras==5:26.0.2-1~debian.12~bookworm +docker-ce-rootless-extras==5:26.1.2-1~debian.12~bookworm docker-compose-plugin==2.18.1-1~debian.12~bookworm docutils-common==0.19+dfsg-6 dosfstools==4.2-1 @@ -247,7 +247,7 @@ kmod==30+20221128-1 krb5-locales==1.20.1-2+deb12u1 krb5-multidev==1.20.1-2+deb12u1 lcov==1.16-1 -less==590-2 +less==590-2.1~deb12u2 lib2geom1.2.0==1.2.2-3 lib32asan8==12.2.0-14 lib32atomic1==12.2.0-14 @@ -398,16 +398,18 @@ libbsh-java==2.0b4-20 libbz2-dev==1.0.8-5+b1 libc-ares-dev==1.18.1-3 libc-ares2==1.18.1-3 -libc-dev-bin==2.36-9+deb12u4 -libc-devtools==2.36-9+deb12u4 -libc-l10n==2.36-9+deb12u4 +libc-bin==2.36-9+deb12u7 +libc-dev-bin==2.36-9+deb12u7 +libc-devtools==2.36-9+deb12u7 +libc-l10n==2.36-9+deb12u7 +libc6==2.36-9+deb12u7 libc6-armhf-cross==2.36-8cross1 -libc6-dbg==2.36-9+deb12u4 -libc6-dev==2.36-9+deb12u4 -libc6-dev-i386==2.36-9+deb12u4 -libc6-dev-x32==2.36-9+deb12u4 -libc6-i386==2.36-9+deb12u4 -libc6-x32==2.36-9+deb12u4 +libc6-dbg==2.36-9+deb12u7 +libc6-dev==2.36-9+deb12u7 +libc6-dev-i386==2.36-9+deb12u7 +libc6-dev-x32==2.36-9+deb12u7 +libc6-i386==2.36-9+deb12u7 +libc6-x32==2.36-9+deb12u7 libcaca0==0.99.beta20-3 libcacard0==1:2.8.0-3 libcairo-gobject2==1.16.0-7 @@ -498,7 +500,7 @@ libdate-calc-xs-perl==6.4-2+b1 libdate-manip-perl==6.91-1 libdatrie-dev==0.2.13-2+b1 libdatrie1==0.2.13-2+b1 -libdav1d6==1.0.0-2 +libdav1d6==1.0.0-2+deb12u1 libdaxctl1==76.1-1 libdb-dev==5.3.2 libdb5.3-dev==5.3.28+dfsg2-1 @@ -630,6 +632,7 @@ libfreezethaw-perl==0.5001-3 libfribidi-dev==1.0.8-2.1 libfribidi0==1.0.8-2.1 libfstrm0==0.6.1-1 +libfuse-dev==2.9.9-6+b1 libfuse2==2.9.9-6+b1 libfuse3-3==3.14.0-4 libgail-common==2.24.33-2 @@ -667,11 +670,11 @@ libglapi-mesa==22.3.6-1+deb12u1 libgles-dev==1.6.0-1 libgles1==1.6.0-1 libgles2==1.6.0-1 -libglib2.0-0==2.74.6-2 -libglib2.0-bin==2.74.6-2 -libglib2.0-data==2.74.6-2 -libglib2.0-dev==2.74.6-2 -libglib2.0-dev-bin==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 +libglib2.0-bin==2.74.6-2+deb12u2 +libglib2.0-data==2.74.6-2+deb12u2 +libglib2.0-dev==2.74.6-2+deb12u2 +libglib2.0-dev-bin==2.74.6-2+deb12u2 libglibmm-2.4-1v5==2.66.5-2 libglu1-mesa==9.0.2-1.1 libglu1-mesa-dev==9.0.2-1.1 @@ -1177,7 +1180,7 @@ librsvg2-common==2.54.7+dfsg-1~deb12u1 librtmp1==2.4+20151223.gitfa8646d.1-2+b2 librubberband2==3.1.2+dfsg0-1 libruby==1:3.1 -libruby3.1==3.1.2-7 +libruby3.1==3.1.2-7+deb12u1 libsamplerate0==0.2.2-3 libsasl2-2==2.1.28+dfsg-10 libsasl2-modules==2.1.28+dfsg-10 @@ -1294,6 +1297,8 @@ libthai-data==0.1.29-1 libthai-dev==0.1.29-1 libthai0==0.1.29-1 libtheora0==1.1.1+dfsg.1-16.1+b1 +libthrift-0.17.0==0.17.0-2+b2 +libthrift-dev==0.17.0-2+b2 libtie-ixhash-perl==1.23-4 libtiff-dev==4.5.0-6+deb12u1 libtiff6==4.5.0-6+deb12u1 @@ -1523,14 +1528,14 @@ libzvbi0==0.2.41-1 libzzip-0-13==0.13.72+dfsg.1-1.1 licensecheck==3.3.5-1 lintian==2.116.3 -linux-compiler-gcc-12-x86==6.1.85-1 -linux-headers-6.1.0-20-amd64==6.1.85-1 -linux-headers-6.1.0-20-arm64==6.1.85-1 -linux-headers-6.1.0-20-common==6.1.85-1 -linux-headers-amd64==6.1.85-1 -linux-headers-arm64==6.1.85-1 -linux-kbuild-6.1==6.1.85-1 -linux-libc-dev==6.1.85-1 +linux-compiler-gcc-12-x86==6.1.90-1 +linux-headers-6.1.0-21-amd64==6.1.90-1 +linux-headers-6.1.0-21-arm64==6.1.90-1 +linux-headers-6.1.0-21-common==6.1.90-1 +linux-headers-amd64==6.1.90-1 +linux-headers-arm64==6.1.90-1 +linux-kbuild-6.1==6.1.90-1 +linux-libc-dev==6.1.90-1 linuxdoc-tools==0.9.82-1 llvm-14==1:14.0.6-12 llvm-14-dev==1:14.0.6-12 @@ -1538,7 +1543,7 @@ llvm-14-linker-tools==1:14.0.6-12 llvm-14-runtime==1:14.0.6-12 llvm-14-tools==1:14.0.6-12 lmodern==2.005-1 -locales==2.36-9+deb12u4 +locales==2.36-9+deb12u7 logrotate==3.21.0-1 lsb-release==12.0-1 lsof==4.95.0-1 @@ -1588,10 +1593,10 @@ nodejs-doc==18.19.0+dfsg-6~deb12u1 nss-plugin-pem==1.0.8+1-1 ocl-icd-libopencl1==2.3.1-1 openjade==1.4devel1-22 -openjdk-17-jdk==17.0.10+7-1~deb12u1 -openjdk-17-jdk-headless==17.0.10+7-1~deb12u1 -openjdk-17-jre==17.0.10+7-1~deb12u1 -openjdk-17-jre-headless==17.0.10+7-1~deb12u1 +openjdk-17-jdk==17.0.11+9-1~deb12u1 +openjdk-17-jdk-headless==17.0.11+9-1~deb12u1 +openjdk-17-jre==17.0.11+9-1~deb12u1 +openjdk-17-jre-headless==17.0.11+9-1~deb12u1 opensp==1.5.2-13+b2 openssh-client==1:9.2p1-2+deb12u2 openssh-server==1:9.2p1-2+deb12u2 @@ -1777,6 +1782,7 @@ python3-soupsieve==2.3.2-1 python3-sphinx==5.3.0-4 python3-sphinx-rtd-theme==1.2.0+dfsg-1 python3-stdeb==0.10.0-2 +python3-thrift==0.17.0-2+b2 python3-tk==3.11.2-3 python3-toml==0.10.2-1 python3-tomli==2.0.1-2 @@ -1817,6 +1823,7 @@ qtwayland5==5.15.8-2 quilt==0.67+really0.66-1 rake==13.0.6-3 readline-common==8.2-1.3 +remake==4.3+dbg-1.6+dfsg-1 rpcsvc-proto==1.4.3-1 rpm-common==4.18.0+dfsg-1+deb12u1 rpm2cpio==4.18.0+dfsg-1+deb12u1 @@ -1831,9 +1838,9 @@ ruby-rubygems==3.3.15-2 ruby-sdbm==1.0.0-5+b1 ruby-webrick==1.8.1-1 ruby-xmlrpc==0.3.2-2 -ruby3.1==3.1.2-7 -ruby3.1-dev==3.1.2-7 -ruby3.1-doc==3.1.2-7 +ruby3.1==3.1.2-7+deb12u1 +ruby3.1-dev==3.1.2-7+deb12u1 +ruby3.1-doc==3.1.2-7+deb12u1 rubygems-integration==1.18 runit-helper==2.15.2 sbsigntool==0.9.4-3.1 @@ -1882,6 +1889,7 @@ texlive-latex-recommended==2022.20230122-3 texlive-pictures==2022.20230122-3 texlive-plain-generic==2022.20230122-4 texlive-xetex==2022.20230122-3 +thrift-compiler==0.17.0-2+b2 time==1.9-0.2 tipa==2:1.3-21 tk==8.6.13 diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm-armhf b/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm-armhf index aa5cf7c82dd1..17485c2a2f9a 100644 --- a/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm-armhf +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm-armhf @@ -3,8 +3,8 @@ dctrl-tools==2.24-3 dvipng==1.15-1.1 libnanomsg-dev==1.1.5+dfsg-1.1 libnanomsg5==1.1.5+dfsg-1.1 -linux-compiler-gcc-12-arm==6.1.85-1 -linux-headers-6.1.0-20-armmp==6.1.85-1 -linux-headers-armmp==6.1.85-1 +linux-compiler-gcc-12-arm==6.1.90-1 +linux-headers-6.1.0-21-armmp==6.1.90-1 +linux-headers-armmp==6.1.90-1 watchdog==5.16-1+b1 wget==1.21.3-1+b1 diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-mirror b/files/build/versions/dockers/sonic-slave-bookworm/versions-mirror deleted file mode 100644 index f393a67e9f32..000000000000 --- a/files/build/versions/dockers/sonic-slave-bookworm/versions-mirror +++ /dev/null @@ -1 +0,0 @@ -deb.debian.org_debian_dists_bookworm-updates==2024-04-19T20:17:02Z diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 index f4259abbb3c7..7781b8119a66 100644 --- a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 @@ -99,8 +99,8 @@ python-magic==0.4.26 pytz==2022.7.1 pyxdg==0.28 pyyaml==6.0 -redis==5.0.3 -regex==2024.4.16 +redis==5.0.4 +regex==2024.5.10 requests==2.28.1 roman==3.3 scour==0.38.2 @@ -115,6 +115,7 @@ sphinx==5.3.0 sphinx-rtd-theme==1.2.0 stdeb==0.10.0 stgit==0.19 +thrift==0.17.0 toml==0.10.2 tomli==2.0.1 tomlkit==0.11.7 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye index 739eb3c63d57..527521bb3b30 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -105,7 +105,7 @@ docbook-xsl==1.79.2+dfsg-1 docker-buildx-plugin==0.10.5-1~debian.11~bullseye docker-ce==5:24.0.2-1~debian.11~bullseye docker-ce-cli==5:24.0.2-1~debian.11~bullseye -docker-ce-rootless-extras==5:26.0.2-1~debian.11~bullseye +docker-ce-rootless-extras==5:26.1.2-1~debian.11~bullseye docker-compose-plugin==2.18.1-1~debian.11~bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 @@ -207,6 +207,7 @@ gstreamer1.0-plugins-good==1.18.4-2+deb11u2 gstreamer1.0-x==1.18.4-2+deb11u1 gtk-update-icon-cache==3.24.24-4+deb11u3 guile-2.2-libs==2.2.7+1-6 +guile-3.0-libs==3.0.5-4 hicolor-icon-theme==0.17-2 i965-va-driver==2.4.1+dfsg1-1 ibverbs-providers==33.2-1 @@ -232,7 +233,7 @@ kernel-wedge==2.104 kmod==28-1 krb5-multidev==1.18.3-6+deb11u4 lcov==1.14-2 -less==551-2 +less==551-2+deb11u2 lib32asan6==10.2.1-6 lib32atomic1==10.2.1-6 lib32gcc-10-dev==10.2.1-6 @@ -382,16 +383,17 @@ libbsh-java==2.0b4-20 libbz2-dev==1.0.8-4 libc-ares-dev==1.17.1-1+deb11u3 libc-ares2==1.17.1-1+deb11u3 -libc-dev-bin==2.31-13+deb11u8 -libc-devtools==2.31-13+deb11u8 -libc-l10n==2.31-13+deb11u8 +libc-dev-bin==2.31-13+deb11u10 +libc-devtools==2.31-13+deb11u10 +libc-l10n==2.31-13+deb11u10 +libc6==2.31-13+deb11u10 libc6-armhf-cross==2.31-9cross4 -libc6-dbg==2.31-13+deb11u8 -libc6-dev==2.31-13+deb11u8 -libc6-dev-i386==2.31-13+deb11u8 -libc6-dev-x32==2.31-13+deb11u8 -libc6-i386==2.31-13+deb11u8 -libc6-x32==2.31-13+deb11u8 +libc6-dbg==2.31-13+deb11u10 +libc6-dev==2.31-13+deb11u10 +libc6-dev-i386==2.31-13+deb11u10 +libc6-dev-x32==2.31-13+deb11u10 +libc6-i386==2.31-13+deb11u10 +libc6-x32==2.31-13+deb11u10 libcaca0==0.99.beta19-2.2 libcacard0==1:2.8.0-3 libcairo-gobject2==1.16.0-5 @@ -472,7 +474,7 @@ libdata-optlist-perl==0.110-1.1 libdata-validate-domain-perl==0.10-1.1 libdatrie-dev==0.2.13-1 libdatrie1==0.2.13-1 -libdav1d4==0.7.1-3 +libdav1d4==0.7.1-3+deb11u1 libdaxctl1==71.1-1 libdb-dev==5.3.1+nmu1 libdb5.3-dev==5.3.28+dfsg1-0.8 @@ -625,11 +627,11 @@ libglapi-mesa==20.3.5-1 libgles-dev==1.3.2-1 libgles1==1.3.2-1 libgles2==1.3.2-1 -libglib2.0-0==2.66.8-1+deb11u1 -libglib2.0-bin==2.66.8-1+deb11u1 -libglib2.0-data==2.66.8-1+deb11u1 -libglib2.0-dev==2.66.8-1+deb11u1 -libglib2.0-dev-bin==2.66.8-1+deb11u1 +libglib2.0-0==2.66.8-1+deb11u3 +libglib2.0-bin==2.66.8-1+deb11u3 +libglib2.0-data==2.66.8-1+deb11u3 +libglib2.0-dev==2.66.8-1+deb11u3 +libglib2.0-dev-bin==2.66.8-1+deb11u3 libglu1-mesa==9.0.1-1 libglu1-mesa-dev==9.0.1-1 libglvnd-dev==1.3.2-1 @@ -1417,19 +1419,19 @@ libzvbi0==0.2.35-18 libzzip-0-13==0.13.62-3.3+deb11u1 licensecheck==3.1.1-2 lintian==2.104.0 -linux-compiler-gcc-10-x86==5.10.209-2 -linux-headers-5.10.0-28-amd64==5.10.209-2 -linux-headers-5.10.0-28-arm64==5.10.209-2 -linux-headers-5.10.0-28-common==5.10.209-2 -linux-headers-amd64==5.10.209-2 -linux-headers-arm64==5.10.209-2 -linux-kbuild-5.10==5.10.209-2 -linux-libc-dev==5.10.209-2 +linux-compiler-gcc-10-x86==5.10.216-1 +linux-headers-5.10.0-29-amd64==5.10.216-1 +linux-headers-5.10.0-29-arm64==5.10.216-1 +linux-headers-5.10.0-29-common==5.10.216-1 +linux-headers-amd64==5.10.216-1 +linux-headers-arm64==5.10.216-1 +linux-kbuild-5.10==5.10.216-1 +linux-libc-dev==5.10.216-1 linuxdoc-tools==0.9.82-1 llvm-11==1:11.0.1-2 llvm-11-runtime==1:11.0.1-2 lmodern==2.004.5-6.1 -locales==2.31-13+deb11u8 +locales==2.31-13+deb11u10 logrotate==3.18.0-2+deb11u2 lsb-release==11.1.0 lsof==4.93.2+dfsg-1.1 @@ -1472,10 +1474,10 @@ node-jquery==3.5.1+dfsg+~3.5.5-7 nodejs==14.21.3-deb-1nodesource1 ocl-icd-libopencl1==2.2.14-2 openjade==1.4devel1-22 -openjdk-11-jdk==11.0.22+7-1~deb11u1 -openjdk-11-jdk-headless==11.0.22+7-1~deb11u1 -openjdk-11-jre==11.0.22+7-1~deb11u1 -openjdk-11-jre-headless==11.0.22+7-1~deb11u1 +openjdk-11-jdk==11.0.23+9-1~deb11u1 +openjdk-11-jdk-headless==11.0.23+9-1~deb11u1 +openjdk-11-jre==11.0.23+9-1~deb11u1 +openjdk-11-jre-headless==11.0.23+9-1~deb11u1 opensp==1.5.2-13+b2 openssh-client==1:8.4p1-5+deb11u3 openssh-server==1:8.4p1-5+deb11u3 @@ -1686,6 +1688,7 @@ quilt==0.66-2.1 rake==13.0.3-1 rake-compiler==1.1.1-1 readline-common==8.1-1 +remake==4.3+dbg-1.5+dfsg-1 rrdtool==1.7.2-3+b7 rsync==3.2.3-4+deb11u1 rsyslog==8.2102.0-2+deb11u1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf index 05c16b6c8182..27aa80758120 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -5,7 +5,7 @@ golang-1.15-src==1.15.15-1~deb11u4 libjpeg-dev==1:2.0.6-4 libjpeg62-turbo-dev==1:2.0.6-4 libunicode-linebreak-perl==0.0.20190101-1+b2 -linux-compiler-gcc-10-arm==5.10.209-2 -linux-headers-5.10.0-28-armmp==5.10.209-2 -linux-headers-armmp==5.10.209-2 +linux-compiler-gcc-10-arm==5.10.216-1 +linux-headers-5.10.0-29-armmp==5.10.216-1 +linux-headers-armmp==5.10.216-1 nasm==2.15.05-1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index 210a4c94a379..43bbe1c30455 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -88,8 +88,8 @@ python-magic==0.4.20 pytz==2021.1 pyxdg==0.27 pyyaml==5.4.1 -redis==5.0.3 -regex==2024.4.16 +redis==5.0.4 +regex==2024.5.10 requests==2.25.1 roman==2.0.0 service-identity==18.1.0 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index 86e292b812c1..42298a8462e5 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -82,7 +82,7 @@ dh-systemd==12.1.1 dictionaries-common==1.28.1 diffstat==1.62-1 dirmngr==2.2.12-1+deb10u2 -distro-info-data==0.41+deb10u8 +distro-info-data==0.41+deb10u9 dkms==2.6.1-4 dmeventd==2:1.02.155-3 dmsetup==2:1.02.155-3 @@ -95,7 +95,7 @@ docbook-xml==4.5-8 docker-buildx-plugin==0.10.5-1~debian.10~buster docker-ce==5:24.0.2-1~debian.10~buster docker-ce-cli==5:24.0.2-1~debian.10~buster -docker-ce-rootless-extras==5:26.0.2-1~debian.10~buster +docker-ce-rootless-extras==5:26.1.2-1~debian.10~buster docker-compose-plugin==2.18.1-1~debian.10~buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 @@ -342,14 +342,15 @@ libbsh-java==2.0b4-19 libbz2-dev==1.0.6-9.2~deb10u2 libc-ares-dev==1.14.0-1+deb10u4 libc-ares2==1.14.0-1+deb10u4 -libc-dev-bin==2.28-10+deb10u2 -libc-l10n==2.28-10+deb10u2 -libc6-dbg==2.28-10+deb10u2 -libc6-dev==2.28-10+deb10u2 -libc6-dev-i386==2.28-10+deb10u2 -libc6-dev-x32==2.28-10+deb10u2 -libc6-i386==2.28-10+deb10u2 -libc6-x32==2.28-10+deb10u2 +libc-dev-bin==2.28-10+deb10u3 +libc-l10n==2.28-10+deb10u3 +libc6==2.28-10+deb10u3 +libc6-dbg==2.28-10+deb10u3 +libc6-dev==2.28-10+deb10u3 +libc6-dev-i386==2.28-10+deb10u3 +libc6-dev-x32==2.28-10+deb10u3 +libc6-i386==2.28-10+deb10u3 +libc6-x32==2.28-10+deb10u3 libcaca0==0.99.beta19-2.1+deb10u1 libcacard0==1:2.6.1-1 libcaf-openmpi-3==2.4.0-2 @@ -839,7 +840,7 @@ libnfnetlink0==1.0.1-3+b1 libnftables0==0.9.0-2 libnftnl-dev==1.1.2-2 libnftnl11==1.1.2-2 -libnghttp2-14==1.36.0-2+deb10u2 +libnghttp2-14==1.36.0-2+deb10u3 libnl-3-200==3.4.0-1 libnl-3-dev==3.4.0-1 libnl-route-3-200==3.4.0-1 @@ -1008,20 +1009,20 @@ libqt4-svg==4:4.8.7+dfsg-18+deb10u2 libqt4-test==4:4.8.7+dfsg-18+deb10u2 libqt4-xml==4:4.8.7+dfsg-18+deb10u2 libqt4-xmlpatterns==4:4.8.7+dfsg-18+deb10u2 -libqt5concurrent5==5.11.3+dfsg1-1+deb10u5 -libqt5core5a==5.11.3+dfsg1-1+deb10u5 -libqt5dbus5==5.11.3+dfsg1-1+deb10u5 -libqt5gui5==5.11.3+dfsg1-1+deb10u5 -libqt5network5==5.11.3+dfsg1-1+deb10u5 -libqt5opengl5==5.11.3+dfsg1-1+deb10u5 -libqt5opengl5-dev==5.11.3+dfsg1-1+deb10u5 -libqt5printsupport5==5.11.3+dfsg1-1+deb10u5 -libqt5sql5==5.11.3+dfsg1-1+deb10u5 -libqt5sql5-sqlite==5.11.3+dfsg1-1+deb10u5 +libqt5concurrent5==5.11.3+dfsg1-1+deb10u6 +libqt5core5a==5.11.3+dfsg1-1+deb10u6 +libqt5dbus5==5.11.3+dfsg1-1+deb10u6 +libqt5gui5==5.11.3+dfsg1-1+deb10u6 +libqt5network5==5.11.3+dfsg1-1+deb10u6 +libqt5opengl5==5.11.3+dfsg1-1+deb10u6 +libqt5opengl5-dev==5.11.3+dfsg1-1+deb10u6 +libqt5printsupport5==5.11.3+dfsg1-1+deb10u6 +libqt5sql5==5.11.3+dfsg1-1+deb10u6 +libqt5sql5-sqlite==5.11.3+dfsg1-1+deb10u6 libqt5svg5==5.11.3-2 -libqt5test5==5.11.3+dfsg1-1+deb10u5 -libqt5widgets5==5.11.3+dfsg1-1+deb10u5 -libqt5xml5==5.11.3+dfsg1-1+deb10u5 +libqt5test5==5.11.3+dfsg1-1+deb10u6 +libqt5widgets5==5.11.3+dfsg1-1+deb10u6 +libqt5xml5==5.11.3+dfsg1-1+deb10u6 libqtcore4==4:4.8.7+dfsg-18+deb10u2 libqtdbus4==4:4.8.7+dfsg-18+deb10u2 libqtgui4==4:4.8.7+dfsg-18+deb10u2 @@ -1370,7 +1371,7 @@ llvm-7==1:7.0.1-8+deb10u2 llvm-7-dev==1:7.0.1-8+deb10u2 llvm-7-runtime==1:7.0.1-8+deb10u2 lmodern==2.004.5-6 -locales==2.28-10+deb10u2 +locales==2.28-10+deb10u3 logrotate==3.14.0-4 lsb-base==10.2019051400 lsb-release==10.2019051400 @@ -1407,10 +1408,10 @@ nlohmann-json3-dev==3.5.0-0.1 nodejs==14.21.3-deb-1nodesource1 ocl-icd-libopencl1==2.2.12-2 openjade==1.4devel1-21.3+b1 -openjdk-11-jdk==11.0.22+7-1~deb10u1 -openjdk-11-jdk-headless==11.0.22+7-1~deb10u1 -openjdk-11-jre==11.0.22+7-1~deb10u1 -openjdk-11-jre-headless==11.0.22+7-1~deb10u1 +openjdk-11-jdk==11.0.23+9-1~deb10u1 +openjdk-11-jdk-headless==11.0.23+9-1~deb10u1 +openjdk-11-jre==11.0.23+9-1~deb10u1 +openjdk-11-jre-headless==11.0.23+9-1~deb10u1 openmpi-bin==3.1.3-11 openmpi-common==3.1.3-11 opensp==1.5.2-13+b1 @@ -1449,13 +1450,13 @@ php-token-stream==3.0.1-1 php-tokenizer==1.1.0-1 php-webmozart-assert==1.4.0-3 php-xml==2:7.3+69 -php7.3-cli==7.3.31-1~deb10u5 -php7.3-common==7.3.31-1~deb10u5 -php7.3-json==7.3.31-1~deb10u5 -php7.3-mbstring==7.3.31-1~deb10u5 -php7.3-opcache==7.3.31-1~deb10u5 -php7.3-readline==7.3.31-1~deb10u5 -php7.3-xml==7.3.31-1~deb10u5 +php7.3-cli==7.3.31-1~deb10u6 +php7.3-common==7.3.31-1~deb10u6 +php7.3-json==7.3.31-1~deb10u6 +php7.3-mbstring==7.3.31-1~deb10u6 +php7.3-opcache==7.3.31-1~deb10u6 +php7.3-readline==7.3.31-1~deb10u6 +php7.3-xml==7.3.31-1~deb10u6 phpunit==7.5.6-1 phpunit-code-unit-reverse-lookup==1.0.1-1 phpunit-comparator==3.0.2-1 @@ -1522,7 +1523,7 @@ python-funcsigs==1.0.2-4 python-gi==3.30.4-1 python-html5lib==1.0.1-1 python-hyperlink==17.3.1-2 -python-idna==2.6-1 +python-idna==2.6-1+deb10u1 python-imagesize==1.0.0-1 python-incremental==16.10.1-3 python-ipaddr==2.2.0-2 @@ -1614,7 +1615,7 @@ python3-docutils==0.14+dfsg-4 python3-entrypoints==0.3-1 python3-gi==3.30.4-1 python3-gpg==1.12.0-6 -python3-idna==2.6-1 +python3-idna==2.6-1+deb10u1 python3-imagesize==1.0.0-1 python3-jinja2==2.10-2+deb10u1 python3-keyring==17.1.1-1 @@ -1667,18 +1668,19 @@ qemu-utils==1:3.1+dfsg-8+deb10u12 qt-at-spi==0.4.0-9 qt4-linguist-tools==4:4.8.7+dfsg-18+deb10u2 qt4-qmake==4:4.8.7+dfsg-18+deb10u2 -qt5-default==5.11.3+dfsg1-1+deb10u5 -qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 -qt5-qmake==5.11.3+dfsg1-1+deb10u5 -qt5-qmake-bin==5.11.3+dfsg1-1+deb10u5 -qtbase5-dev==5.11.3+dfsg1-1+deb10u5 -qtbase5-dev-tools==5.11.3+dfsg1-1+deb10u5 +qt5-default==5.11.3+dfsg1-1+deb10u6 +qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u6 +qt5-qmake==5.11.3+dfsg1-1+deb10u6 +qt5-qmake-bin==5.11.3+dfsg1-1+deb10u6 +qtbase5-dev==5.11.3+dfsg1-1+deb10u6 +qtbase5-dev-tools==5.11.3+dfsg1-1+deb10u6 qtchooser==66-2 qtcore4-l10n==4:4.8.7+dfsg-18+deb10u2 qttranslations5-l10n==5.11.3-2 quilt==0.65-3 rake==12.3.1-3+deb10u1 readline-common==7.0-5 +remake==4.1+dbg1.3~dfsg.1-2 rrdtool==1.7.1-2 rsync==3.1.3-6 rsyslog==8.1901.0-1+deb10u2 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf index cad875a8e9e3..fc8b535d026f 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf @@ -4,5 +4,24 @@ libdrm-omap1==2.4.97-1 libgles2-mesa-dev==18.3.6-2+deb10u1 libjpeg-dev==1:1.5.2-2+deb10u1 libjpeg62-turbo-dev==1:1.5.2-2+deb10u1 +libqt5concurrent5==5.11.3+dfsg1-1+deb10u5 +libqt5core5a==5.11.3+dfsg1-1+deb10u5 +libqt5dbus5==5.11.3+dfsg1-1+deb10u5 +libqt5gui5==5.11.3+dfsg1-1+deb10u5 +libqt5network5==5.11.3+dfsg1-1+deb10u5 +libqt5opengl5==5.11.3+dfsg1-1+deb10u5 +libqt5opengl5-dev==5.11.3+dfsg1-1+deb10u5 +libqt5printsupport5==5.11.3+dfsg1-1+deb10u5 +libqt5sql5==5.11.3+dfsg1-1+deb10u5 +libqt5sql5-sqlite==5.11.3+dfsg1-1+deb10u5 +libqt5test5==5.11.3+dfsg1-1+deb10u5 +libqt5widgets5==5.11.3+dfsg1-1+deb10u5 +libqt5xml5==5.11.3+dfsg1-1+deb10u5 linux-compiler-gcc-8-arm==4.19.304-1 nasm==2.14-1 +qt5-default==5.11.3+dfsg1-1+deb10u5 +qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 +qt5-qmake==5.11.3+dfsg1-1+deb10u5 +qt5-qmake-bin==5.11.3+dfsg1-1+deb10u5 +qtbase5-dev==5.11.3+dfsg1-1+deb10u5 +qtbase5-dev-tools==5.11.3+dfsg1-1+deb10u5 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index 5e1ba2343b70..bb6e871567d8 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -64,7 +64,7 @@ python-magic==0.4.16 pytz==2019.1 pyxdg==0.25 pyyaml==5.4.1 -redis==5.0.3 +redis==5.0.4 regex==2024.4.16 requests==2.21.0 roman==2.0.0 diff --git a/files/build/versions/host-image/versions-deb-bookworm b/files/build/versions/host-image/versions-deb-bookworm index 3675e4426d89..5be3e86e8fe7 100644 --- a/files/build/versions/host-image/versions-deb-bookworm +++ b/files/build/versions/host-image/versions-deb-bookworm @@ -83,7 +83,8 @@ kernel-mft-dkms-modules-6.1.0-11-2-amd64==4.27.0 kexec-tools==1:2.0.25-3+b1 klibc-utils==2.0.12-1 kmod==30+20221128-1 -less==590-2 +ldap-utils==2.5.13+dfsg-5 +less==590-2.1~deb12u2 libabsl20220623==20220623.1-1 libapparmor1==3.0.8-3 libargon2-1==0~20171227-0.3+deb12u1 @@ -99,9 +100,11 @@ libbpf1==1:1.1.0-1 libbrotli1==1.0.9-2+b6 libbsd0==0.11.7-2 libc-ares2==1.18.1-3 -libc-dev-bin==2.36-9+deb12u4 -libc-l10n==2.36-9+deb12u4 -libc6-dev==2.36-9+deb12u4 +libc-bin==2.36-9+deb12u7 +libc-dev-bin==2.36-9+deb12u7 +libc-l10n==2.36-9+deb12u7 +libc6==2.36-9+deb12u7 +libc6-dev==2.36-9+deb12u7 libcap2-bin==1:2.66-4 libcbor0.8==0.8.0-2+b1 libcc1-0==12.2.0-14 @@ -135,7 +138,7 @@ libgcc-12-dev==12.2.0-14 libgdbm-compat4==1.23-3 libgdbm6==1.23-3 libgirepository-1.0-1==1.74.0-3 -libglib2.0-0==2.74.6-2 +libglib2.0-0==2.74.6-2+deb12u2 libgomp1==12.2.0-14 libgpm2==1.20.7-10+b1 libgprofng0==2.40-2 @@ -189,11 +192,13 @@ libnl-route-3-200==3.5.0-1 libnorm1==1.5.9+dfsg-2 libnsl-dev==1.3.0-2 libnsl2==1.3.0-2 +libnss-ldapd==0.9.12-4 libnss-radius==1.0.1-1 libnss-tacplus==1.0.4-1 libnuma1==2.0.16-1 libonig5==6.9.8-1 libopencsd1==1.3.3-1 +libpam-ldapd==0.9.12-4 libpam-pwquality==1.4.5-1+b1 libpam-radius-auth==1.4.1-1 libpam-tacplus==1.4.1-1 @@ -269,9 +274,9 @@ libzmq5==4.3.4-6 linux-base==4.9 linux-image-6.1.0-11-2-amd64-unsigned==6.1.38-4 linux-image-6.1.0-11-2-arm64-unsigned==6.1.38-4 -linux-libc-dev==6.1.85-1 -linux-perf==6.1.85-1 -locales==2.36-9+deb12u4 +linux-libc-dev==6.1.90-1 +linux-perf==6.1.90-1 +locales==2.36-9+deb12u7 logrotate==3.21.0-1 lsof==4.95.0-1 makedev==2.3.1-97 @@ -291,6 +296,7 @@ ndisc6==1.0.5-1+b2 net-tools==2.10-0.1 netbase==6.4 netfilter-persistent==1.0.20 +nslcd==0.9.12-4 ntp==1:4.2.8p15+dfsg-2~1.2.2+dfsg1-1+deb12u1 ntpdate==1:4.2.8p15+dfsg-2~1.2.2+dfsg1-1+deb12u1 ntpsec==1.2.2+dfsg1-1+deb12u1 @@ -341,6 +347,7 @@ rasdaemon==0.6.8-1.1 readline-common==8.2-1.3 resolvconf==1.91+nmu1 rpcsvc-proto==1.4.3-1 +rshim==2.0.19 rsyslog==8.2302.0-1 runit-helper==2.15.2 sbsigntool==0.9.4-3.1 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index b5cc83b7e080..1200e659ac4c 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -15,7 +15,7 @@ dbus-python==1.3.2 docker==6.1.1 docker-image-py==0.1.12 enlighten==1.12.4 -filelock==3.13.4 +filelock==3.14.0 grpcio==1.51.1 grpcio-tools==1.51.1 idna==3.7 @@ -52,7 +52,7 @@ pyang==2.6.0 pyangbind==0.8.2 pycairo==1.26.0 pycparser==2.21 -pygments==2.17.2 +pygments==2.18.0 pygobject==3.48.2 pynacl==1.5.0 pyroute2==0.5.19 @@ -60,7 +60,7 @@ python-apt==2.6.0 python-dateutil==2.9.0.post0 pyyaml==5.4.1 redis==3.5.3 -regex==2024.4.16 +regex==2024.5.10 requests==2.31.0 scapy==2.4.4 semantic-version==2.10.0 @@ -72,7 +72,7 @@ toposort==1.6 urllib3==2.2.1 watchdog==0.10.3 wcwidth==0.2.13 -websocket-client==1.7.0 +websocket-client==1.8.0 wheel==0.38.4 www-authenticate==0.9.2 xmltodict==0.12.0 From e87a3ac1a028008102eb567cd9c1d1d2c9ee73ae Mon Sep 17 00:00:00 2001 From: bofish-arista <128172814+bofish-arista@users.noreply.github.com> Date: Sun, 12 May 2024 04:55:37 -0400 Subject: [PATCH 083/282] [Arista]: Misc sensor updates for DCS-7060DX5-64S (#18763) Follow-up to "Misc platform improvements for DCS-7060DX5-64S" filed originally as PR #13875. While generating a 202305 backport of the aforementioned PR, some fixes were identified and implemented to the sensors.conf file on 202305. These same changes are being upstreamed as part of this PR to master and 202311 to bring the branches into alignment. The 202305 backport is tracked under PR #18701. How I did it Sensor modifications corresponding to the platform implementation. How to verify it Fixes have been validated in our in-house testing and running sonic-mgmt testing on DCS-7060DX5-64S. Co-authored-by: enes.oncu --- .../x86_64-arista_7060px5_64s/sensors.conf | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/device/arista/x86_64-arista_7060px5_64s/sensors.conf b/device/arista/x86_64-arista_7060px5_64s/sensors.conf index 835a10c3cc51..4fb5447b6df7 100644 --- a/device/arista/x86_64-arista_7060px5_64s/sensors.conf +++ b/device/arista/x86_64-arista_7060px5_64s/sensors.conf @@ -11,16 +11,30 @@ chip "tmp464-i2c-19-48" label temp1 "Board sensor" label temp2 "TH4 exhaust temp sensor" label temp3 "Inlet temp sensor" + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 chip "dps800-i2c-22-58" label temp1 "Power supply 1 hotspot sensor" label temp2 "Power supply 1 inlet temp sensor" - ignore temp3 "Power supply 1 exhaust temp sensor" + ignore temp3 + + ignore fan2 + ignore fan3 + ignore fan4 chip "dps800-i2c-23-58" label temp1 "Power supply 2 hotspot sensor" label temp2 "Power supply 2 inlet temp sensor" - label temp3 "Power supply 2 exhaust temp sensor" + ignore temp3 + + ignore fan2 + ignore fan3 + ignore fan4 chip "lm73-i2c-24-48" label temp1 "Front panel temp sensor" From cb9d71ac2351a4a4fab6a84ecaa8a9c7c416b065 Mon Sep 17 00:00:00 2001 From: Mati Alfaro Date: Sun, 12 May 2024 12:07:58 +0300 Subject: [PATCH 084/282] [yang] set port admin state default down - fix for #18345 (#18658) fix #18345 Signed-off-by: matiAlfaro --- src/sonic-yang-models/yang-models/sonic-port.yang | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sonic-yang-models/yang-models/sonic-port.yang b/src/sonic-yang-models/yang-models/sonic-port.yang index 163e19fc841b..459b6520847d 100644 --- a/src/sonic-yang-models/yang-models/sonic-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-port.yang @@ -173,6 +173,7 @@ module sonic-port{ leaf admin_status { type stypes:admin_status; + default down; } leaf fec { From 4f4a5d04602309df1f1e3d6c72b4610182412f4f Mon Sep 17 00:00:00 2001 From: Justin Wong <51811017+justin-wong-ce@users.noreply.github.com> Date: Sun, 12 May 2024 02:12:39 -0700 Subject: [PATCH 085/282] [baseimage]: Added wireless-regdb as package to install for Debian (#18650) In Debian 6.1.38, rfkill is used, which uses cfg80211. cfg80211 will attempt to load on boot and will look for regulatory.db, which is installed via wireless-regdb, a missing package. It looks like the cause for the cfg80211 module getting automatically loaded is mentioned in systemd/systemd#27520 (specifically, systemd/systemd#20802). Some code refactoring occurred in systemd-networkd that causes the module to automatically get loaded, which then looks for the regulatory.db firmware file. (Also, the cfg80211 module depends on the rfkill module, not the other way around.) systemd-networkd isn't enabled by default by Debian, but looks like SONiC now uses systemd-networkd in one case, starting with #18178, which is probably when this issue started happening. I do see the advantages of using it more; network configuration could potentially become a bit easier with this, but it would take some effort in migrating everything over to it. Given all of this, either the cfg80211 module needs to be blacklisted, or the wireless-regdb package needs to be added. Considering there could be a theoretical use case of someone trying to use SONiC with wireless interfaces (although it would be clunky), it might be fine to add the wireless-regdb package. --- build_debian.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index 508c5dffa8f6..6ba2a134efef 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -402,10 +402,11 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in auditd \ linux-perf \ resolvconf \ - lsof \ - sysstat \ - xxd \ - zstd + lsof \ + sysstat \ + xxd \ + wireless-regdb \ + zstd # Have systemd create the auditd log directory sudo mkdir -p ${FILESYSTEM_ROOT}/etc/systemd/system/auditd.service.d From a0ff20edf2ddac2a6c281cce109bddbaf6ae6007 Mon Sep 17 00:00:00 2001 From: SuvarnaMeenakshi <50386592+SuvarnaMeenakshi@users.noreply.github.com> Date: Sun, 12 May 2024 02:16:26 -0700 Subject: [PATCH 086/282] [snmpd]: Fix to use IPv6 linklocal address as snmp agent address (#18350) Why I did it 1. fix [snmp] Snmpd fails to start when mgmt or Loopback interface is configured with Link local IPv6 address #16001 2. fix Timeout error while fetching response using snmpget #17807 #17045 modified minigraph parser to use management and loopback IPs to support SNMP query over IPv6. With this fix, if mgmt or loopback IP contains link local IP, that will not work as link local IP has to be appended with scope id associating the IP address to a specific interface. This PR change is to ensure that snmp works with link local IPv6 address. How I did it Modify minigraph parser to append the Ip address with % scope id if snmp agent address being used is link local IP address. Modify snmpd.conf.j2 to take this change while checking if an IP address is ipv4 or ipv6. How to verify it Verified by configuring link local ipv6 address. Last login: Wed Mar 13 01:45:09 2024 from 10.1.84.57 admin@<>:~$ sudo netstat -tulnp | grep 161 ... udp6 0 0 fe80::f6ee:31ff:fe9:161 :::* 70355/snmpd Signed-off-by: Suvarna Meenakshi --- dockers/docker-snmp/snmpd.conf.j2 | 2 +- src/sonic-config-engine/minigraph.py | 13 +++++++------ src/sonic-config-engine/tests/sample_graph.xml | 8 ++++++++ src/sonic-config-engine/tests/test_cfggen.py | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/dockers/docker-snmp/snmpd.conf.j2 b/dockers/docker-snmp/snmpd.conf.j2 index aa04901f0009..b6dd826007a1 100644 --- a/dockers/docker-snmp/snmpd.conf.j2 +++ b/dockers/docker-snmp/snmpd.conf.j2 @@ -17,7 +17,7 @@ # Listen on managment and loopback0 ips for single asic platform # {% macro protocol(ip_addr) %} -{%- if ip_addr|ipv6 -%} +{%- if ip_addr.split('%')[0]|ipv6 -%} {{ 'udp6' }} {%- else -%} {{ 'udp' }} diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index dab011bc5d77..5bfbeb650379 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -1762,12 +1762,13 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if not is_multi_asic() and asic_name is None: results['SNMP_AGENT_ADDRESS_CONFIG'] = {} port = '161' - for mgmt_intf in mgmt_intf.keys(): - snmp_key = mgmt_intf[1].split('/')[0] + '|' + port + '|' - results['SNMP_AGENT_ADDRESS_CONFIG'][snmp_key] = {} - # Add Loopback IP as agent address for single asic - for loip in lo_intfs.keys(): - snmp_key = loip[1].split('/')[0] + '|' + port + '|' + for intf in list(mgmt_intf.keys()) + list(lo_intfs.keys()): + ip_addr = ipaddress.ip_address(UNICODE_TYPE(intf[1].split('/')[0])) + if ip_addr.version == 6 and ip_addr.is_link_local: + agent_addr = str(ip_addr) + '%' + intf[0] + else: + agent_addr = str(ip_addr) + snmp_key = agent_addr + '|' + port + '|' results['SNMP_AGENT_ADDRESS_CONFIG'][snmp_key] = {} else: results['SNMP_AGENT_ADDRESS_CONFIG'] = {} diff --git a/src/sonic-config-engine/tests/sample_graph.xml b/src/sonic-config-engine/tests/sample_graph.xml index 35247671fa24..a0c41a7f55c3 100644 --- a/src/sonic-config-engine/tests/sample_graph.xml +++ b/src/sonic-config-engine/tests/sample_graph.xml @@ -81,6 +81,14 @@ 192.168.200.15/24 + + ManagementIPv6 + Management0 + + fe80::1/64 + + fe80::1/64 + diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 7018dc7db3bf..6126522bb6dd 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -1150,4 +1150,4 @@ def testsnmp_agent_address_config(self): output = self.run_script(argument) self.assertEqual( utils.liststr_to_dict(output.strip()), - utils.liststr_to_dict("['192.168.200.15|161|', '100.0.0.6|161|', '100.0.0.7|161|']")) + utils.liststr_to_dict("['192.168.200.15|161|', '100.0.0.6|161|', '100.0.0.7|161|', 'fe80::1%Management0|161|']")) From 73194090114e4f839cafe7e0b3209135ed88b32b Mon Sep 17 00:00:00 2001 From: Vijaya Kumar Abbaraju Date: Sun, 12 May 2024 14:47:56 +0530 Subject: [PATCH 087/282] MAB protocol related changes (#18630) --- src/sonic-pac/mab/protocol/mab_auth.c | 226 ++++++ src/sonic-pac/mab/protocol/mab_db.c | 438 +++++++++++ src/sonic-pac/mab/protocol/mab_local.c | 269 +++++++ src/sonic-pac/mab/protocol/mab_mac_db.c | 443 +++++++++++ src/sonic-pac/mab/protocol/mab_radius.c | 943 ++++++++++++++++++++++++ src/sonic-pac/mab/protocol/mab_timer.c | 272 +++++++ src/sonic-pac/mab/protocol/mab_utils.c | 65 ++ src/sonic-pac/mab/protocol/mab_vlan.c | 260 +++++++ 8 files changed, 2916 insertions(+) create mode 100755 src/sonic-pac/mab/protocol/mab_auth.c create mode 100755 src/sonic-pac/mab/protocol/mab_db.c create mode 100755 src/sonic-pac/mab/protocol/mab_local.c create mode 100755 src/sonic-pac/mab/protocol/mab_mac_db.c create mode 100755 src/sonic-pac/mab/protocol/mab_radius.c create mode 100755 src/sonic-pac/mab/protocol/mab_timer.c create mode 100755 src/sonic-pac/mab/protocol/mab_utils.c create mode 100755 src/sonic-pac/mab/protocol/mab_vlan.c diff --git a/src/sonic-pac/mab/protocol/mab_auth.c b/src/sonic-pac/mab/protocol/mab_auth.c new file mode 100755 index 000000000000..32b5128d2f9b --- /dev/null +++ b/src/sonic-pac/mab/protocol/mab_auth.c @@ -0,0 +1,226 @@ +/* + * Copyright 2024 Broadcom Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define MAC_EAPOL_PDU + +#include "mab_include.h" +#include "sysapi.h" +#include "mab_db.h" +#include "auth_mgr_exports.h" +#include "mab_client.h" +#include "mab_struct.h" +#include "mab_timer.h" + +extern mabBlock_t *mabBlock; + +/********************************************************************* + * @purpose Get the authentication method for the user of this port + * + * @param logicalPortInfo @b{(input)) Logical Port Info node + * @param bufHandle @b{(input)} the handle to the mab PDU + * @param authMethod @b{(output)} user's authentication method + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *********************************************************************/ +static +RC_t mabSmAuthMethodGet(mabLogicalPortInfo_t *logicalPortInf, + netBufHandle bufHandle, + USER_MGR_AUTH_METHOD_t *authMethod) +{ + uchar8 *data; + enetHeader_t *enetHdr; + eapolPacket_t *eapolPkt; + authmgrEapPacket_t *eapPkt; + eapRrPacket_t *eapRrPkt= NULLPTR; + RC_t rc = FAILURE; + + if (bufHandle != NULL) + { + SYSAPI_NET_MBUF_GET_DATASTART(bufHandle, data); + enetHdr = ( enetHeader_t *)data; + eapolPkt = ( eapolPacket_t *)(( uchar8 *)enetHdr + ENET_HDR_SIZE + ENET_ENCAPS_HDR_SIZE); + eapPkt = ( authmgrEapPacket_t *)(( uchar8 *)eapolPkt + sizeof( eapolPacket_t)); + eapRrPkt = ( eapRrPacket_t *)(( uchar8 *)eapPkt + sizeof( authmgrEapPacket_t)); + } + + /* attempt authentication with RADIUS */ + *authMethod = AUTH_METHOD_RADIUS; + + logicalPortInf->client.authMethod = *authMethod; + rc = SUCCESS; + + return rc; +} + +/********************************************************************* + * @purpose Actions to be performed when sending request to a client + * + * @param logicalPortInfo @b{(input)) Logical Port Info node + * + * @returns SUCCESS + * + * @comments + * + * @end + *********************************************************************/ +RC_t mabClientRequestAction(mabLogicalPortInfo_t *logicalPortInfo, netBufHandle bufHandle) +{ + uint32 physPort = 0, lPort = 0, type = 0; + uchar8 ch, *data = NULLPTR; + radiusAttr_t *eapTlv = NULLPTR; + BOOL generateNak = FALSE; + + MAB_IF_NULLPTR_RETURN_LOG(logicalPortInfo); + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, logicalPortInfo->key.keyNum); + + logicalPortInfo->client.currentIdL = logicalPortInfo->client.attrInfo.idFromServer; + + if ( AUTHMGR_PORT_MAB_AUTH_TYPE_INVALID != logicalPortInfo->client.mabAuthType) + { + if(bufHandle != NULL) + { + SYSAPI_NET_MBUF_GET_DATASTART(bufHandle, data); + eapTlv = ( radiusAttr_t *) (data + ENET_HDR_SIZE + ENET_ENCAPS_HDR_SIZE + + sizeof( eapolPacket_t) + sizeof( authmgrEapPacket_t)); + ch = ( uchar8)EAP_RRMD5; + if (memcmp(&eapTlv->type,( uchar8 *)&ch,sizeof( uchar8)) !=0) + { + /* generate NAK for unsupported EAP types */ + generateNak = TRUE; + } + /* Free bufHandle as another one will be allocated in mabCtlLogicalPortMABGenResp() */ + SYSAPI_NET_MBUF_FREE(bufHandle); + } + mabCtlLogicalPortMABGenResp(logicalPortInfo->key.keyNum, generateNak); + } + else + { + if ( NULL != bufHandle) + { + SYSAPI_NET_MBUF_FREE(bufHandle); + } + } + + return SUCCESS; +} + +/********************************************************************* + * @purpose Actions to be performed when sending response to AAA + * + * @param logicalPortInfo @b{(input)) Logical Port Info node + * + * @returns SUCCESS + * + * @comments + * + * @end + *********************************************************************/ +RC_t mabClientResponseAction(mabLogicalPortInfo_t *logicalPortInfo, netBufHandle bufHandle) +{ + mabPortCfg_t * pCfg; + USER_MGR_AUTH_METHOD_t authMethod; + uint32 physPort, lPort = 0, type = 0; + + MAB_IF_NULLPTR_RETURN_LOG(logicalPortInfo); + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, logicalPortInfo->key.keyNum); + + if (mabIntfIsConfigurable(physPort, &pCfg) != TRUE) + return FAILURE; + + /* start the timer for the Server timeout */ + if ( SUCCESS != mabTimerStart(logicalPortInfo, MAB_SERVER_AWHILE)) + { + return FAILURE; + } + + if (logicalPortInfo->client.suppBufHandle != NULL) + { + SYSAPI_NET_MBUF_FREE(logicalPortInfo->client.suppBufHandle); + logicalPortInfo->client.suppBufHandle = NULL; + } + + if (mabSmAuthMethodGet(logicalPortInfo, bufHandle, &authMethod) == SUCCESS) + { + switch (authMethod) + { + case AUTH_METHOD_UNDEFINED: + case AUTH_METHOD_REJECT: + /* reset port from the existing vlans*/ + MAB_EVENT_TRACE( + "\n%s:Reset vlan Type %s vlan Id %d participation " + "for linterface = %d as auth method is reject or undefined. \n", + __FUNCTION__, mabVlanTypeStringGet(logicalPortInfo->client.vlanType), + logicalPortInfo->client.vlanId, logicalPortInfo->key.keyNum); + + logicalPortInfo->protocol.authFail = TRUE; + + mabUnAuthenticatedAction(logicalPortInfo); + + break; + + case AUTH_METHOD_LOCAL: + /* attempt local authentication */ + (void)mabLocalAuthResponseProcess(logicalPortInfo, bufHandle); + break; + + case AUTH_METHOD_RADIUS: + /* attempt authentication with RADIUS */ + (void)mabRadiusSuppResponseProcess(logicalPortInfo->key.keyNum, bufHandle); + break; + case AUTH_METHOD_NONE: + /* authorize */ + mabAuthenticatedAction(logicalPortInfo); + + break; + + default: + /* reset port in any mab assigned vlans*/ + MAB_EVENT_TRACE( + "\n%s:Reset vlan Type %s vlan Id %d participation " + "for linterface = %d as auth method is unsupported. \n", + __FUNCTION__, mabVlanTypeStringGet(logicalPortInfo->client.vlanType), + logicalPortInfo->client.vlanId, logicalPortInfo->key.keyNum); + mabUnAuthenticatedAction(logicalPortInfo); + + break; + } + } + else + { + /* If we couldn't get an auth method, log an error and fail the authentication */ + LOGF( LOG_SEVERITY_NOTICE, + "%s: Failed getting auth method, logical port %d." + " Could not determine the authentication method to be used . " + "Probably because of a mis-configuration.", __FUNCTION__, logicalPortInfo->key.keyNum); + /* reset port in any mab assigned vlans*/ + MAB_EVENT_TRACE( + "\n%s:Reset vlan Type %s vlan Id %d participation " + "for linterface = %d as auth method is unsupported. \n", + __FUNCTION__, mabVlanTypeStringGet(logicalPortInfo->client.vlanType), + logicalPortInfo->client.vlanId, logicalPortInfo->key.keyNum); + + mabUnAuthenticatedAction(logicalPortInfo); + } + + return SUCCESS; +} + + diff --git a/src/sonic-pac/mab/protocol/mab_db.c b/src/sonic-pac/mab/protocol/mab_db.c new file mode 100755 index 000000000000..6ee661165a96 --- /dev/null +++ b/src/sonic-pac/mab/protocol/mab_db.c @@ -0,0 +1,438 @@ +/* + * Copyright 2024 Broadcom Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "mab_include.h" +#include "mab_util.h" +#include "mab_struct.h" +#include "osapi_sem.h" + +extern mabBlock_t *mabBlock; + + int32 + mabLogicalPortDbEntryCompare (const void* pData1, + const void* pData2, + size_t size) +{ + mabLogicalNodeKey_t *pKey1 = (mabLogicalNodeKey_t *) pData1; + mabLogicalNodeKey_t *pKey2 = (mabLogicalNodeKey_t *) pData2; + register int32 retVal = 0; + + if ((pKey1 == NULLPTR) || (pKey2 == NULLPTR)) + { + return 1; + } + + retVal = pKey1->keyNum - pKey2->keyNum; + + return retVal; +} + +/********************************************************************* + * @purpose Initialize Logical Port Info Database + * + * @param nodeCount @b{(input)} The number of nodes to be created. + * + * @returns SUCCESS or FAILURE + * + * @comments none + * + * @end + *********************************************************************/ +RC_t mabLogicalPortInfoDBInit(uint32 nodeCount) +{ + /* Allocate the Heap structures */ + mabBlock->mabLogicalPortTreeHeap = (avlTreeTables_t *)osapiMalloc( MAB_COMPONENT_ID, + nodeCount * sizeof(avlTreeTables_t)); + + mabBlock->mabLogicalPortDataHeap = (mabLogicalPortInfo_t *)osapiMalloc( MAB_COMPONENT_ID, + nodeCount * sizeof(mabLogicalPortInfo_t)); + + /* validate the pointers*/ + if ((mabBlock->mabLogicalPortTreeHeap == NULLPTR) ||(mabBlock->mabLogicalPortDataHeap == NULLPTR)) + { + LOGF( LOG_SEVERITY_NOTICE, + " Error in allocating memory for the MAB database. Possible causes are insufficient memory."); + return FAILURE; + } + + /* AVL Tree creations - mabLogicalPortTreeDb*/ + avlCreateAvlTree(&(mabBlock->mabLogicalPortTreeDb), mabBlock->mabLogicalPortTreeHeap, + mabBlock->mabLogicalPortDataHeap, nodeCount, + sizeof(mabLogicalPortInfo_t), 0x10, + sizeof(mabLogicalNodeKey_t)); + + avlSetAvlTreeComparator(&(mabBlock->mabLogicalPortTreeDb), mabLogicalPortDbEntryCompare); + return SUCCESS; +} + + +/********************************************************************* + * @purpose DeInitialize Logical Port Info Database + * + * @param none + * + * @returns SUCCESS or FAILURE + * + * @comments none + * + * @end + *********************************************************************/ +RC_t mabLogicalPortInfoDBDeInit(void) +{ + /* Destroy the AVL Tree */ + if(mabBlock->mabLogicalPortTreeDb.semId != NULLPTR) + { + avlDeleteAvlTree(&mabBlock->mabLogicalPortTreeDb); + } + + /* Give up the memory */ + if (mabBlock->mabLogicalPortTreeHeap != NULLPTR) + { + osapiFree( MAB_COMPONENT_ID, mabBlock->mabLogicalPortTreeHeap); + mabBlock->mabLogicalPortTreeHeap = NULLPTR; + } + + if (mabBlock->mabLogicalPortDataHeap != NULLPTR) + { + osapiFree( MAB_COMPONENT_ID, mabBlock->mabLogicalPortDataHeap); + mabBlock->mabLogicalPortDataHeap = NULLPTR; + } + return SUCCESS; +} + +/********************************************************************* + * @purpose To Take lock for the Logical Port Info Node + * + * @param None + * + * @returns SUCCESS or FAILURE + * + * @comments This lock needs to be taken only the API functions not running in + * the mab threads context. + * + * @end + *********************************************************************/ +RC_t mabLogicalPortInfoTakeLock(void) +{ + return osapiSemaTake(mabBlock->mabLogicalPortTreeDb.semId, WAIT_FOREVER); +} + +/********************************************************************* + * @purpose To Giveup lock for the Logical Port Info Node + * + * @param None + * + * @returns SUCCESS or FAILURE + * + * @comments This lock needs to be taken only the API functions not running in + * the mab threads context. + * + * @end + *********************************************************************/ +RC_t mabLogicalPortInfoGiveLock(void) +{ + return osapiSemaGive(mabBlock->mabLogicalPortTreeDb.semId); +} + + +/********************************************************************* + * @purpose To allocate a Logical Port Info Node + * + * @param intIfNum @b{(input)} The internal interface for which this + * logical interface is being created + * + * @returns Logical Internal Interface Number + * + * @comments none + * + * @end + *********************************************************************/ +mabLogicalPortInfo_t *mabDynamicLogicalPortInfoAlloc(uint32 intIfNum) +{ + uint32 lIntIfNum; + mabLogicalPortInfo_t newNode,*retNode,*tmpNode; + uchar8 ifName[ NIM_IF_ALIAS_SIZE + 1]; + nimGetIntfName(intIfNum, ALIASNAME, ifName); + mabLogicalNodeKey_t key; + + /* iterate through the Logical interfaces to assign a empty slot to the new node.*/ + for (lIntIfNum = MAB_LOGICAL_PORT_START; + lIntIfNum < MAB_LOGICAL_PORT_END; lIntIfNum++) + { + memset(&key, 0, sizeof(mabLogicalNodeKey_t)); + MAB_LPORT_KEY_PACK(intIfNum, lIntIfNum, AUTHMGR_LOGICAL, key.keyNum); + + tmpNode = mabLogicalPortInfoGet(key.keyNum); + if (tmpNode == NULLPTR) + { + /* found one - use it */ + memset(&newNode,0,sizeof(mabLogicalPortInfo_t)); + newNode.key = key; + + /* add the node to the tree */ + osapiSemaTake(mabBlock->mabLogicalPortTreeDb.semId, WAIT_FOREVER); + retNode = avlInsertEntry(&mabBlock->mabLogicalPortTreeDb,&newNode); + osapiSemaGive(mabBlock->mabLogicalPortTreeDb.semId); + if (retNode == &newNode) + { + LOGF( LOG_SEVERITY_INFO, + "Error in adding the node to the MAB tree for interface %s.\n", + ifName); + return NULLPTR; + } + return mabLogicalPortInfoGet(key.keyNum); + } + } + LOGF( LOG_SEVERITY_NOTICE, + "Error in allocating node for interface %s,as it reached maximum limit per port." + " Could not allocate memory for client as maximum number of clients allowed per port" + " has been reached.", ifName); + return NULLPTR; +} + +/********************************************************************* + * @purpose To allocate a Logical Port Info Node + * + * @param intIfNum @b{(input)} The internal interface for which this + * logical interface is being created + * + * @returns Logical Internal Interface Number + * + * @comments none + * + * @end + *********************************************************************/ +mabLogicalPortInfo_t *mabLogicalPortInfoAlloc(uint32 intIfNum) +{ + return mabDynamicLogicalPortInfoAlloc(intIfNum); +} + +/********************************************************************* + * @purpose To Deallocate a Logical Port Info Node + * + * @param intIfNum @b{(input)} The internal interface for which this + * logical interface is being destroyed + * + * @returns SUCCESS or FAILURE + * + * @comments none + * + * @end + *********************************************************************/ +RC_t mabLogicalPortInfoDeAlloc(mabLogicalPortInfo_t *node) +{ + uint32 physPort = 0, lPort = 0, type = 0; + if(node != NULLPTR) + { + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, node->key.keyNum); + + if (AUTHMGR_LOGICAL == type) + { + osapiSemaTake(mabBlock->mabLogicalPortTreeDb.semId, WAIT_FOREVER); + avlDeleteEntry(&mabBlock->mabLogicalPortTreeDb,node); + osapiSemaGive(mabBlock->mabLogicalPortTreeDb.semId); + } + return SUCCESS; + } + return FAILURE; +} + +/********************************************************************* + * @purpose To Get a Logical Port Info Node + * + * @param lIntIfNum @b{(input)} The logical internal interface number + * + * @returns Logical Internal Interface node + * + * @comments none + * + * @end + *********************************************************************/ +mabLogicalPortInfo_t *mabLogicalPortInfoGet(uint32 lIntIfNum) +{ + mabLogicalNodeKey_t key; + uint32 physPort = 0, lPort = 0, type = 0; + mabLogicalPortInfo_t *entry = NULLPTR; + + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, lIntIfNum); + + key.keyNum = lIntIfNum; + + if (AUTHMGR_LOGICAL == type) + { + entry = (mabLogicalPortInfo_t *)avlSearch(&mabBlock->mabLogicalPortTreeDb, &key, AVL_EXACT); + } + return entry; +} + +/********************************************************************* + * @purpose To Get Next Logical Port Info Node + * + * @param lIntIfNum @b{(input)} The logical internal interface number + * + * @returns Logical Internal Interface node + * + * @comments none + * + * @end + *********************************************************************/ +mabLogicalPortInfo_t *mabLogicalPortInfoGetNext(uint32 lIntIfNum) +{ + uint32 physPort = 0, lPort = 0, type = 0; + mabLogicalPortInfo_t *entry = NULLPTR; + RC_t nimRc = SUCCESS; + + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, lIntIfNum); + + while (( SUCCESS == nimRc) && + ( NULLPTR == (entry = mabLogicalPortInfoGetNextNode(physPort,&lIntIfNum)))) + { + /* Entry not available on this port. + search on the next port */ + lIntIfNum = MAB_LOGICAL_PORT_ITERATE; + nimRc = mabNextValidIntf(physPort, &physPort); + } + + return entry; +} + +/********************************************************************* + * @purpose To get First logical interfaces for dynamically allocated nodes + * + * @param intIfNum @b{(input)} The internal interface + * @param lIntIfNum @b{(input/output)} The logical internal interface number + * + * @returns Logical Internal Interface node + * + * @comments For the first iteration start with zero. + * + * @end + *********************************************************************/ +mabLogicalPortInfo_t *mabDynamicLogicalPortInfoFirstGet(uint32 intIfNum, + uint32 *lIntIfNum) +{ + mabLogicalPortInfo_t *node; + uint32 maxintf = MAB_LOGICAL_PORT_END; + uint32 lPort = 0; + uint32 temp = 0; + + + lPort = MAB_LOGICAL_PORT_START; + MAB_LPORT_KEY_PACK(intIfNum, lPort, AUTHMGR_LOGICAL, temp); + while((node=mabLogicalPortInfoGet(temp))== NULLPTR && + lPort < maxintf) + { + lPort = lPort + 1; + temp = 0; + MAB_LPORT_KEY_PACK(intIfNum, lPort, AUTHMGR_LOGICAL, temp); + } + + *lIntIfNum = temp; + return node; +} + +/********************************************************************* + * @purpose To iterate all the logical interfaces of a physical interface + * + * @param intIfNum @b{(input)} The internal interface + * @param lIntIfNum @b{(input/output)} The logical internal interface number + * + * @returns Logical Internal Interface node + * + * @comments For the first iteration start with zero. + * + * @end + *********************************************************************/ +mabLogicalPortInfo_t *mabDynamicLogicalPortInfoGetNextNode(uint32 intIfNum, + uint32 *lIntIfNum) +{ + mabLogicalPortInfo_t *node = NULLPTR; + uint32 physPort = 0, lPort = 0, type = 0, temp = 0; + + if(*lIntIfNum == MAB_LOGICAL_PORT_ITERATE) + { + return mabLogicalPortInfoFirstGet(intIfNum,lIntIfNum); + } + + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, *lIntIfNum); + + if ((intIfNum != physPort) || (lPort >= MAB_LOGICAL_PORT_END)) + { + return NULLPTR; + } + + lPort = lPort + 1; + MAB_LPORT_KEY_PACK(intIfNum, lPort, AUTHMGR_LOGICAL, temp); + while((node=mabLogicalPortInfoGet(temp))== NULLPTR && + lPort < MAB_LOGICAL_PORT_END) + { + lPort = lPort + 1; + temp = 0; + MAB_LPORT_KEY_PACK(intIfNum, lPort, AUTHMGR_LOGICAL, temp); + } + + *lIntIfNum = temp; + return node; +} + +/********************************************************************* + * @purpose To get First logical interfaces for a physical interface + * + * @param intIfNum @b{(input)} The internal interface + * @param lIntIfNum @b{(input/output)} The logical internal interface number + * + * @returns Logical Internal Interface node + * + * @comments For the first iteration start with zero. + * + * @end + *********************************************************************/ +mabLogicalPortInfo_t *mabLogicalPortInfoFirstGet(uint32 intIfNum, + uint32 *lIntIfNum) +{ + mabLogicalPortInfo_t *node; + + /* dynamically allocated node */ + node = mabDynamicLogicalPortInfoFirstGet(intIfNum, lIntIfNum); + + return node; +} + +/********************************************************************* + * @purpose To iterate all the logical interfaces of a physical interface + * + * @param intIfNum @b{(input)} The internal interface + * @param lIntIfNum @b{(input/output)} The logical internal interface number + * + * @returns Logical Internal Interface node + * + * @comments For the first iteration start with zero. + * + * @end + *********************************************************************/ +mabLogicalPortInfo_t *mabLogicalPortInfoGetNextNode(uint32 intIfNum, + uint32 *lIntIfNum) +{ + mabLogicalPortInfo_t *node; + + /* dynamically allocated node */ + node = mabDynamicLogicalPortInfoGetNextNode(intIfNum, lIntIfNum); + + return node; +} + + diff --git a/src/sonic-pac/mab/protocol/mab_local.c b/src/sonic-pac/mab/protocol/mab_local.c new file mode 100755 index 000000000000..010aef8b7266 --- /dev/null +++ b/src/sonic-pac/mab/protocol/mab_local.c @@ -0,0 +1,269 @@ +/* + * Copyright 2024 Broadcom Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "mab_include.h" +#include "md5_api.h" +#include "mab_auth.h" +#include "mab_client.h" +#include "mab_control.h" + +RC_t mabLocalAuthSendAuthReq(mabLogicalPortInfo_t *logicalPortInfo) +{ + MAB_IF_NULLPTR_RETURN_LOG(logicalPortInfo); + /* Generate an event that will cause a request (MD5 challenge) to be sent to the supplicant. + * The bufHandle is NULLPTR in this case since we didn't actually receive the request + * from a server. So, we will need to generate the request locally. + */ + if (AUTHMGR_CLIENT_UNAWARE == logicalPortInfo->client.clientType) + { + /* if MAB client generate and store mab challenge*/ + memset(logicalPortInfo->client.mabChallenge,0,MAB_CHALLENGE_LEN); + mabLocalAuthChallengeGenerate(logicalPortInfo->client.mabChallenge, MAB_CHALLENGE_LEN); + logicalPortInfo->client.mabChallengelen = MAB_CHALLENGE_LEN; + + } + return mabClientRequestAction(logicalPortInfo, NULLPTR); +} + +/************************************************************************** +* @purpose Process EAP Response and Response/Identity frames +* +* @param logicalPortInfo @b{(input)) Logical Port Info node +* @param bufHandle @b{(input)} the handle to the mab PDU +* +* @returns SUCCESS +* @returns FAILURE +* +* @comments +* +* @end +*************************************************************************/ +RC_t mabLocalAuthResponseProcess(mabLogicalPortInfo_t *logicalPortInfo, netBufHandle bufHandle) +{ + uchar8 *data; + enetHeader_t *enetHdr; + eapolPacket_t *eapolPkt; + authmgrEapPacket_t *eapPkt; + eapRrPacket_t *eapRrPkt; + BOOL portAllow; + RC_t rc = SUCCESS, authRc; + mabPortCfg_t * pCfg; + uint32 physPort = 0, type = 0, lPort = 0; + authmgrFailureReason_t reason=0; + + if ( NULLPTR == logicalPortInfo) + { + return FAILURE; + } + + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, logicalPortInfo->key.keyNum); + + if ( TRUE != mabIntfIsConfigurable(physPort, &pCfg)) + { + return FAILURE; + } + + enetHdr = ( enetHeader_t *)data; + eapolPkt = ( eapolPacket_t *)(( uchar8 *)enetHdr + ENET_HDR_SIZE + ENET_ENCAPS_HDR_SIZE); + eapPkt = ( authmgrEapPacket_t *)(( uchar8 *)eapolPkt + sizeof( eapolPacket_t)); + eapRrPkt = ( eapRrPacket_t *)(( uchar8 *)eapPkt + sizeof( authmgrEapPacket_t)); + + logicalPortInfo->client.attrInfo.idFromServer = logicalPortInfo->client.currentIdL; + + if (eapRrPkt->type == EAP_RRIDENTITY) + { + logicalPortInfo->client.mabUserIndex = MAB_USER_INDEX_INVALID; + if ( AUTH_METHOD_LOCAL == logicalPortInfo->client.authMethod) + { + + /* User name was stored in port info structure when EAP-Response/Identity frame was received. + * See if this user name matches a locally configured user. If we find a match, generate an + * event that will cause an MD5 challenge to be sent to the supplicant. If we don't find a + * match, generate an authentication failure event. + */ + if (/*userMgrLoginIndexGet(( char8 *)logicalPortInfo->client.mabUserName, + &logicalPortInfo->client.mabUserIndex) != */ SUCCESS) + { + logicalPortInfo->client.mabUserIndex = MAB_USER_INDEX_INVALID; + reason = AUTHMGR_FAIL_REASON_INVALID_USER; + } + } + + if (logicalPortInfo->client.mabUserIndex != MAB_USER_INDEX_INVALID) + { + /* Make sure user has access to this port */ + if (/*userMgrPortUserAccessGet(physPort, logicalPortInfo->client.mabUserName, &portAllow) == */ SUCCESS) + { + if(portAllow == TRUE) + { + rc = mabLocalAuthSendAuthReq(logicalPortInfo); + } + } + else + { + logicalPortInfo->client.mabUserIndex = MAB_USER_INDEX_INVALID; + reason = AUTHMGR_FAIL_REASON_INVALID_USER; + } + } + } + else if (eapRrPkt->type == EAP_RRMD5) + { + uchar8 *response = (( uchar8 *)eapRrPkt) + sizeof( eapRrPacket_t); + authRc = mabLocalAuthMd5ResponseValidate(logicalPortInfo, response); + if (authRc == SUCCESS) + { + /* Log the information */ + LOGF( LOG_SEVERITY_NOTICE, + "Local MAB Authenticated Successfully."); + + mabAuthenticatedAction(logicalPortInfo); + + } + else if(authRc == NOT_EXIST) + { + reason = AUTHMGR_FAIL_REASON_AUTH_FAILED; + } + else + { + /* FAILED Unauthenticated vlan needs to be assigned */ + reason = AUTHMGR_FAIL_REASON_AUTH_FAILED; + } + } + + if(reason == AUTHMGR_FAIL_REASON_INVALID_USER) + { + /* Send the challenge to accomodate clients that does not + accept eap-success/failure for initial eap-identity frames */ + rc = mabLocalAuthSendAuthReq(logicalPortInfo); + } + + return rc; +} + +/************************************************************************** +* @purpose Validate an MD5 challenge response +* +* @param logicalPortInfo @b{(input)) Logical Port Info node +* @param *response @b{(input)} pointer to MD5 response data +* +* @returns SUCCESS if authenticated +* @returns FAILURE if not authenticated +* +* @comments +* +* @end +*************************************************************************/ +RC_t mabLocalAuthMd5ResponseValidate(mabLogicalPortInfo_t *logicalPortInfo, uchar8 *response) +{ + uint32 suppResponseLen, responseDataLen, challengeLen; + uchar8 suppAnswer[MAB_MD5_LEN], answer[MAB_MD5_LEN]; + uchar8 responseData[ PASSWORD_SIZE+MAB_CHALLENGE_LEN+1]; + uchar8 userPw[ PASSWORD_SIZE]; + RC_t rc = FAILURE; + + /* Length is first byte in response field */ + suppResponseLen = (uint32)(*response); + if (suppResponseLen != MAB_MD5_LEN) + { + return FAILURE; + } + + if (logicalPortInfo->client.mabUserIndex == MAB_USER_INDEX_INVALID) + { + return NOT_EXIST; + } + + memcpy(suppAnswer, &response[1], suppResponseLen); + + memset(userPw, 0x0, PASSWORD_SIZE); + + challengeLen = logicalPortInfo->client.mabChallengelen; + responseDataLen = 1 + strlen(( char8 *)userPw) + challengeLen; + + memset(responseData,0,sizeof(responseData)); + responseData[0] = logicalPortInfo->client.currentIdL; + memcpy(&responseData[1], userPw, strlen(( char8 *)userPw)); + memcpy(&responseData[1+strlen(( char8 *)userPw)], logicalPortInfo->client.mabChallenge, challengeLen); + + mabLocalMd5Calc(responseData, responseDataLen, answer); + + if (memcmp(answer, suppAnswer, MAB_MD5_LEN) == 0) + rc = SUCCESS; + else + rc = FAILURE; + + return rc; +} + +/************************************************************************** +* @purpose Generate an random challenge +* +* @param *challenge @b{(output)} pointer to buffer to hold challenge +* @param challengeLen @b{(input)} length of challenge buffer +* +* @returns void +* +* @comments +* +* @end +*************************************************************************/ +void mabLocalAuthChallengeGenerate( uchar8 *challenge, uint32 challengeLen) +{ + uint32 i, randno, cpLen; + uchar8 *vector = &challenge[0]; + + bzero(( uchar8 *)vector, challengeLen); + + srand((uint32)time(0)); + for (i = 0; i < challengeLen;) + { + cpLen = (uint32)sizeof(uint32); + + randno = (uint32)rand(); + memcpy (( uchar8 *) vector, ( uchar8 *) &randno, cpLen); + vector += cpLen; + i += cpLen; + } + + return; +} + +/************************************************************************** +* @purpose Calculate MD5 for given input buffer and length +* +* @param *inBuf @b{(input)} pointer to input buffer run MD5 against +* @param inLen @b{(input)} length of input buffer +* @param *outBuf @b{(output)} pointer to output buffer to hold MD5 result +* +* @returns void +* +* @comments *outBuf must be MAB_MD5_LEN (16) bytes +* +* @end +*************************************************************************/ +void mabLocalMd5Calc( uchar8 *inBuf, uint32 inLen, uchar8 *outBuf) +{ + MD5_CTX_t context; + + bzero(outBuf, MAB_MD5_LEN); + + md5_init(&context); + md5_update(&context, inBuf, inLen); + md5_final(outBuf, &context); + + return; +} diff --git a/src/sonic-pac/mab/protocol/mab_mac_db.c b/src/sonic-pac/mab/protocol/mab_mac_db.c new file mode 100755 index 000000000000..a01cfa2b008b --- /dev/null +++ b/src/sonic-pac/mab/protocol/mab_mac_db.c @@ -0,0 +1,443 @@ +/* + * Copyright 2024 Broadcom Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "mab_include.h" +#include "mab_struct.h" + +extern mabBlock_t *mabBlock; + + +/* Global parameters */ +typedef struct mabMacAddrInfo_s{ + sll_member_t *next; + enetMacAddr_t suppMacAddr; + uint32 lIntIfNum; +}mabMacAddrInfo_t; + +/************************************************************************* +* @purpose API to destroy the Mac Addr Info data node +* +* @param ll_member @b{(input)} Linked list node containing the +* Mac Addr Info to be destroyed +* +* @returns SUCCESS +* +* @comments This is called by SLL library when a node is being deleted +* +* @end +*************************************************************************/ +RC_t mabMacAddrDataDestroy ( sll_member_t *ll_member) +{ + mabMacAddrInfo_t *pMacAddrInfo ; + + pMacAddrInfo = ( mabMacAddrInfo_t *)ll_member; + + pMacAddrInfo->lIntIfNum = MAB_LOGICAL_PORT_ITERATE; + + bufferPoolFree(mabBlock->mabMacAddrBufferPoolId,( uchar8 *)pMacAddrInfo); + + return SUCCESS; +} +/************************************************************************* +* @purpose Helper API to compare two Mac Addr Info nodes and +* returns the result +* +* @param p @b{(input)} Pointer to Candidate 1 for comparison +* @param q @b{(input)} Pointer to Candidate 2 for comparison +* +* @returns 0 p = q +* @returns -1 p < q +* @returns +1 p > q +* +* @comments This is called by SLL library when a nodes are compared +* +* @end +*************************************************************************/ + int32 mabMacAddrDataCmp(void *p, void *q, uint32 key) +{ + int32 cmp; + cmp = memcmp(((mabMacAddrInfo_t *)p)->suppMacAddr.addr,((mabMacAddrInfo_t *)q)->suppMacAddr.addr, ENET_MAC_ADDR_LEN); + if (cmp == 0) + return 0; + else if (cmp < 0) + return -1; + else + return 1; + +} + + +/********************************************************************* +* @purpose Initialize Mac Address Info Database +* +* @param nodeCount @b{(input)} The number of nodes to be created. +* +* @returns SUCCESS or FAILURE +* +* @comments none +* +* @end +*********************************************************************/ +RC_t mabMacAddrInfoDBInit(uint32 nodeCount) +{ + /* Allocate the buffer pool */ + if (bufferPoolInit( MAB_COMPONENT_ID, nodeCount, sizeof(mabMacAddrInfo_t), + "MAB Mac Addr Bufs", + &(mabBlock->mabMacAddrBufferPoolId)) != SUCCESS) + { + LOGF( LOG_SEVERITY_NOTICE, + "\n%s: Error allocating buffers for supplicant mac address database." + " Could not allocate buffer pool for Mac address link list. Insufficient memory." + ,__FUNCTION__); + MAB_EVENT_TRACE("%s: Error allocating buffers for supplicant mac address database\n",__FUNCTION__); + return FAILURE; + } + + /* Create the SLL*/ + if (SLLCreate( MAB_COMPONENT_ID, SLL_ASCEND_ORDER, + sizeof( enetMacAddr_t),mabMacAddrDataCmp ,mabMacAddrDataDestroy , + &mabBlock->mabMacAddrSLL) != SUCCESS) + { + LOGF( LOG_SEVERITY_INFO, + "\n%s: Failed to create supplicant mac address linked list \n",__FUNCTION__); + MAB_EVENT_TRACE("%s: Failed to create supplicant mac address linked list \n",__FUNCTION__); + return FAILURE; + } + + /* Create Mac Address DB Semaphore*/ + /* Read write lock for controlling Mac Addr Info additions and Deletions */ + if (osapiRWLockCreate(&mabBlock->mabMacAddrDBRWLock, + OSAPI_RWLOCK_Q_PRIORITY) == FAILURE) + { + LOGF( LOG_SEVERITY_INFO, + "Error creating mabMacAddrDBRWLock semaphore \n"); + return FAILURE; + } + + return SUCCESS; +} + + +/********************************************************************* +* @purpose DeInitialize Mac Address Info Database +* +* @param none +* +* @returns SUCCESS or FAILURE +* +* @comments none +* +* @end +*********************************************************************/ +RC_t mabMacAddrInfoDBDeInit(void) +{ + /* Destroy the SLL */ + if (SLLDestroy( MAB_COMPONENT_ID, &mabBlock->mabMacAddrSLL)!= SUCCESS) + { + LOGF( LOG_SEVERITY_INFO, + "\n%s: Failed to destroy the supplicant mac address linked list \n",__FUNCTION__); + MAB_EVENT_TRACE("\n%s: Failed to destroy the supplicant mac address linked list \n",__FUNCTION__); + } + + /* Deallocate the buffer pool */ + + if (mabBlock->mabMacAddrBufferPoolId != 0) + { + bufferPoolDelete(mabBlock->mabMacAddrBufferPoolId ); + mabBlock->mabMacAddrBufferPoolId = 0; + } + + /* Delete the Mac Address DB Semaphore */ + (void)osapiRWLockDelete(mabBlock->mabMacAddrDBRWLock); + + + return SUCCESS; +} + +/********************************************************************* +* @purpose Add a node Mac Address Info Database +* +* @param mac_addr supplicant mac address +* @param lIntIfNum corresponding logical interface +* +* @returns SUCCESS or FAILURE +* +* @comments none +* +* @end +*********************************************************************/ +RC_t mabMacAddrInfoAdd( enetMacAddr_t *mac_addr,uint32 lIntIfNum) +{ + mabMacAddrInfo_t *pMacAddrInfo,*pMacAddrFind,macAddrInfo; + enetMacAddr_t nullMacAddr; + uint32 physPort = 0; + + memset(&(nullMacAddr.addr),0, ENET_MAC_ADDR_LEN); + + MAB_PORT_GET(physPort, lIntIfNum); + + if (mac_addr== NULL) + { + MAB_EVENT_TRACE("\n%s: Could not add supplicant mac address. Mac address is NULL. Input error. \n", + __FUNCTION__); + return FAILURE; + } + if((lIntIfNum == MAB_LOGICAL_PORT_ITERATE)|| + (memcmp(mac_addr->addr,nullMacAddr.addr, ENET_MAC_ADDR_LEN)==0)) + { + MAB_EVENT_TRACE("\n%s: Could not add supplicant mac address(%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x) logical Interface: %d . Input error. \n", + __FUNCTION__, mac_addr->addr[0],mac_addr->addr[1],mac_addr->addr[2],mac_addr->addr[3],mac_addr->addr[4],mac_addr->addr[5],lIntIfNum); + return FAILURE; + } + + /* In order to handle client roaming , check if the mac address already exists*/ + /* copy info to node*/ + memcpy(macAddrInfo.suppMacAddr.addr,mac_addr->addr, ENET_MAC_ADDR_LEN); + /* take Mac address DB semaphore*/ + (void)osapiWriteLockTake(mabBlock->mabMacAddrDBRWLock, WAIT_FOREVER); + + if ((pMacAddrFind=(mabMacAddrInfo_t *)SLLFind(&mabBlock->mabMacAddrSLL,( sll_member_t *)&macAddrInfo)) != NULLPTR) + { + pMacAddrFind->lIntIfNum = lIntIfNum; + (void) osapiWriteLockGive(mabBlock->mabMacAddrDBRWLock); + MAB_EVENT_TRACE("\n%s: Found supplicant mac address(%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x) Changed logical Interface to: %d .\n", + __FUNCTION__, mac_addr->addr[0],mac_addr->addr[1],mac_addr->addr[2],mac_addr->addr[3],mac_addr->addr[4],mac_addr->addr[5],lIntIfNum); + return SUCCESS; + } + + /* Allocate memory from the buffer pool*/ + if (bufferPoolAllocate(mabBlock->mabMacAddrBufferPoolId, + ( uchar8 **)&pMacAddrInfo) != SUCCESS) + { + /* release semaphore*/ + (void)osapiWriteLockGive(mabBlock->mabMacAddrDBRWLock); + + LOGF( LOG_SEVERITY_NOTICE, + "\n%s: Could not add supplicant mac address(%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x) logical Interface: %d . Insufficient memory. \n", + __FUNCTION__, mac_addr->addr[0],mac_addr->addr[1],mac_addr->addr[2],mac_addr->addr[3],mac_addr->addr[4],mac_addr->addr[5],lIntIfNum); + + MAB_EVENT_TRACE("\n%s: Could not add supplicant mac address(%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x) logical Interface: %d . Insufficient memory. \n", + __FUNCTION__, mac_addr->addr[0],mac_addr->addr[1],mac_addr->addr[2],mac_addr->addr[3],mac_addr->addr[4],mac_addr->addr[5],lIntIfNum); + + return FAILURE; + } + + /* copy details into allocated node*/ + memset(pMacAddrInfo,0,sizeof(mabMacAddrInfo_t)); + memcpy(pMacAddrInfo->suppMacAddr.addr,mac_addr->addr, ENET_MAC_ADDR_LEN); + pMacAddrInfo->lIntIfNum = lIntIfNum; + + + /* Add node to the SLL*/ + if (SLLAdd(&mabBlock->mabMacAddrSLL, ( sll_member_t *)pMacAddrInfo) + != SUCCESS) + { + MAB_EVENT_TRACE("\n%s: Could not add supplicant mac address(%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x) logical Interface: %d . \n", + __FUNCTION__, mac_addr->addr[0],mac_addr->addr[1],mac_addr->addr[2],mac_addr->addr[3],mac_addr->addr[4],mac_addr->addr[5],lIntIfNum); + /* Free the previously allocated bufferpool */ + bufferPoolFree(mabBlock->mabMacAddrBufferPoolId, ( uchar8 *)pMacAddrInfo); + /* release semaphore*/ + (void)osapiWriteLockGive(mabBlock->mabMacAddrDBRWLock); + return FAILURE; + } + + /* release semaphore*/ + (void)osapiWriteLockGive(mabBlock->mabMacAddrDBRWLock); + return SUCCESS; +} + +/********************************************************************* +* @purpose Remove a node from the Mac Address Info Database +* +* @param mac_addr supplicant mac address +* +* @returns SUCCESS or FAILURE +* +* @comments none +* +* @end +*********************************************************************/ +RC_t mabMacAddrInfoRemove( enetMacAddr_t *mac_addr) +{ + mabMacAddrInfo_t macAddrInfo; + enetMacAddr_t nullMacAddr; + + memset(&nullMacAddr.addr,0, ENET_MAC_ADDR_LEN); + /*input check*/ + if ((mac_addr == NULLPTR) || + (memcmp(mac_addr->addr,nullMacAddr.addr, ENET_MAC_ADDR_LEN)==0)) + { + return FAILURE; + } + /* copy info to node*/ + memcpy(macAddrInfo.suppMacAddr.addr,mac_addr->addr, ENET_MAC_ADDR_LEN); + macAddrInfo.lIntIfNum = 0; + + /* take Mac address DB semaphore*/ + (void)osapiWriteLockTake(mabBlock->mabMacAddrDBRWLock, WAIT_FOREVER); + + /* delete from SLL*/ + if (SLLDelete(&mabBlock->mabMacAddrSLL, ( sll_member_t *)&macAddrInfo) + != SUCCESS) + { + /* release semaphore*/ + (void)osapiWriteLockGive(mabBlock->mabMacAddrDBRWLock); + + MAB_EVENT_TRACE("\n%s: Could not delete supplicant mac address(%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x) from the SLL . \n", + __FUNCTION__, mac_addr->addr[0],mac_addr->addr[1],mac_addr->addr[2],mac_addr->addr[3],mac_addr->addr[4],mac_addr->addr[5]); + return FAILURE; + } + + /* release semaphore*/ + (void)osapiWriteLockGive(mabBlock->mabMacAddrDBRWLock); + return SUCCESS; +} + + +/********************************************************************* +* @purpose Find a node in the Mac Address Info Database +* +* @param mac_addr supplicant mac address +* @param lIntIfnum{(output)} logical Port Number +* +* @returns SUCCESS or FAILURE +* +* @comments none +* +* @end +*********************************************************************/ +RC_t mabMacAddrInfoFind( enetMacAddr_t *mac_addr,uint32 *lIntIfNum) +{ + mabMacAddrInfo_t macAddrInfo,*pMacAddrInfo; + enetMacAddr_t nullMacAddr; + + memset(&nullMacAddr.addr,0, ENET_MAC_ADDR_LEN); + /*input check*/ + if ((mac_addr == NULLPTR) || + (memcmp(mac_addr->addr,nullMacAddr.addr, ENET_MAC_ADDR_LEN)==0)) + { + return FAILURE; + } + /* copy info to node*/ + memcpy(macAddrInfo.suppMacAddr.addr,mac_addr->addr, ENET_MAC_ADDR_LEN); + + /* take Mac address DB semaphore*/ + (void)osapiWriteLockTake(mabBlock->mabMacAddrDBRWLock, WAIT_FOREVER); + + if ((pMacAddrInfo=(mabMacAddrInfo_t *)SLLFind(&mabBlock->mabMacAddrSLL,( sll_member_t *)&macAddrInfo)) == NULLPTR) + { + /* release semaphore*/ + (void)osapiWriteLockGive(mabBlock->mabMacAddrDBRWLock); + MAB_EVENT_TRACE("\n%s: Could not find supplicant mac address(%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x). \n", + __FUNCTION__, mac_addr->addr[0],mac_addr->addr[1],mac_addr->addr[2],mac_addr->addr[3],mac_addr->addr[4],mac_addr->addr[5]); + *lIntIfNum = MAB_LOGICAL_PORT_ITERATE; + return FAILURE; + } + *lIntIfNum = pMacAddrInfo->lIntIfNum; + /* release semaphore*/ + (void)osapiWriteLockGive(mabBlock->mabMacAddrDBRWLock); + return SUCCESS; +} + +/********************************************************************* +* @purpose Find the next node in the Mac Address Info Database +* +* @param mac_addr supplicant mac address +* @param lIntIfnum{(output)} logical Port Number +* +* @returns SUCCESS or FAILURE +* +* @comments none +* +* @end +*********************************************************************/ +RC_t mabMacAddrInfoFindNext( enetMacAddr_t *mac_addr,uint32 *lIntIfNum) +{ + mabMacAddrInfo_t macAddrInfo,*pMacAddrInfo; + + /*input check*/ + if (mac_addr == NULLPTR) + { + return FAILURE; + } + + /* copy info to node*/ + memcpy(macAddrInfo.suppMacAddr.addr,mac_addr->addr, ENET_MAC_ADDR_LEN); + + /* take Mac address DB semaphore*/ + (void)osapiWriteLockTake(mabBlock->mabMacAddrDBRWLock, WAIT_FOREVER); + + if ((pMacAddrInfo=(mabMacAddrInfo_t *)SLLFindNext(&mabBlock->mabMacAddrSLL,( sll_member_t *)&macAddrInfo)) == NULLPTR) + { + /* release semaphore*/ + (void)osapiWriteLockGive(mabBlock->mabMacAddrDBRWLock); + + MAB_EVENT_TRACE("\n%s: Could not find next node for supplicant mac address(%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x). \n", + __FUNCTION__, mac_addr->addr[0],mac_addr->addr[1],mac_addr->addr[2],mac_addr->addr[3],mac_addr->addr[4],mac_addr->addr[5]); + *lIntIfNum = MAB_LOGICAL_PORT_ITERATE; + return FAILURE; + } + memcpy(mac_addr->addr,pMacAddrInfo->suppMacAddr.addr, ENET_MAC_ADDR_LEN); + *lIntIfNum = pMacAddrInfo->lIntIfNum; + + /* release semaphore*/ + (void)osapiWriteLockGive(mabBlock->mabMacAddrDBRWLock); + + return SUCCESS; +} + +/********************************************************************* +* @purpose Print the information in the Mac Address Database +* +* @param +* +* @returns SUCCESS or FAILURE +* +* @comments none +* +* @end +*********************************************************************/ +RC_t mabDebugMacAddrDBList() +{ + enetMacAddr_t macAddr,nullMacAddr; + uint32 lIntIfNum; + + memset(&macAddr,0,sizeof( enetMacAddr_t)); + + while(mabMacAddrInfoFindNext(&macAddr,&lIntIfNum)== SUCCESS) + { + SYSAPI_PRINTF("\n Mac Address: %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", + macAddr.addr[0],macAddr.addr[1],macAddr.addr[2],macAddr.addr[3],macAddr.addr[4],macAddr.addr[5]); + + SYSAPI_PRINTF("\n Logical Port :%u",lIntIfNum); + + } + + memset(&nullMacAddr,0,sizeof( enetMacAddr_t)); + if (memcmp(macAddr.addr,nullMacAddr.addr, ENET_MAC_ADDR_LEN)!=0) + { + if (mabMacAddrInfoFind(&macAddr,&lIntIfNum)== SUCCESS) + { + SYSAPI_PRINTF("\n Testing mabMacAddrInfoFind.Found \n"); + SYSAPI_PRINTF("\n Mac Address: %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", + macAddr.addr[0],macAddr.addr[1],macAddr.addr[2],macAddr.addr[3],macAddr.addr[4],macAddr.addr[5]); + + SYSAPI_PRINTF("\n Logical Port :%u",lIntIfNum); + } + } + return SUCCESS; +} diff --git a/src/sonic-pac/mab/protocol/mab_radius.c b/src/sonic-pac/mab/protocol/mab_radius.c new file mode 100755 index 000000000000..7b654b73304d --- /dev/null +++ b/src/sonic-pac/mab/protocol/mab_radius.c @@ -0,0 +1,943 @@ +/* + * Copyright 2024 Broadcom Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define MAC_EAPOL_PDU + +#include "mab_include.h" +#include "mab_auth.h" +#include "mab_client.h" +#include "mab_control.h" +#include "mab_timer.h" +#include "utils_api.h" +#include "sysapi.h" +#include "includes.h" +#include "common.h" +#include "eloop.h" +#include "radius.h" +#include "radius_client.h" +#include "mab_radius.h" +#include "osapi_sem.h" + +#define RADIUS_STATUS_SUCCESS 1 +#define RADIUS_STATUS_CHALLENGED 2 +#define RADIUS_STATUS_AUTHEN_FAILURE 3 +#define RADIUS_STATUS_REQUEST_TIMED_OUT 4 +#define RADIUS_STATUS_COMM_FAILURE 5 +#define RADIUS_STATUS_ALL_AUTH_SERVERS_DEAD 6 + +static enetMacAddr_t EAPOL_PDU_MAC_ADDR = +{{0x01, 0x80, 0xC2, 0x00, 0x00, 0x03}}; + +#include "mab_struct.h" + +extern mabBlock_t *mabBlock; + +/************************************************************************** + * @purpose Handle RADIUS client callbacks + * + * @param status @b{(input)} status of RADIUS response (accept, reject, challenge, etc) + * @param correlator @b{(input)} correlates responses to requests; for mab, this is ifIndex + * @param *attributes @b{(input)} RADIUS attribute data + * @param attributesLen @b{(input)} length of RADIUS attribute data + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *************************************************************************/ +RC_t mabRadiusResponseCallback (void *msg, + unsigned int correlator) +{ + mabAaaMsg_t mabAaaMsg; + + /* Fill in AAA message structure */ + bzero(( uchar8 *)&mabAaaMsg, sizeof(mabAaaMsg_t)); + mabAaaMsg.resp = msg; + + return mabIssueCmd(mabAaaInfoReceived, correlator, &mabAaaMsg); +} + +int mab_radius_resp_code_map(unsigned int code, unsigned int *status) +{ + switch (code) + { + case RADIUS_CODE_ACCESS_ACCEPT: + *status = RADIUS_STATUS_SUCCESS; + break; + + case RADIUS_CODE_ACCESS_REJECT: + *status = RADIUS_STATUS_AUTHEN_FAILURE; + break; + + case RADIUS_CODE_ACCESS_CHALLENGE: + *status = RADIUS_STATUS_CHALLENGED; + break; + default: + *status = RADIUS_STATUS_REQUEST_TIMED_OUT; + } + + return 0; +} + + +/************************************************************************** + * @purpose Process RADIUS Server responses + * + * @param lIntIfNum @b{(input)} Logical internal interface number of port being authenticated + * @param status @b{(input)} status of RADIUS response (accept, reject, challenge, etc) + * @param *attributes @b{(input)} RADIUS attribute data + * @param attributesLen @b{(input)} length of RADIUS attribute data + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *************************************************************************/ +RC_t mabRadiusResponseProcess(unsigned int lIntIfNum, void *resp) +{ + mabLogicalPortInfo_t *logicalPortInfo; + mabPortCfg_t *pCfg; + RC_t rc = FAILURE; + uchar8 ifName[ NIM_IF_ALIAS_SIZE + 1]; + uint32 physPort = 0, lPort = 0, type = 0; + uint32 status = 0, code = 0; + + if (!(MAB_IS_READY)) + return SUCCESS; + logicalPortInfo = mabLogicalPortInfoGet(lIntIfNum); + if (logicalPortInfo == NULLPTR) + { + return FAILURE; + } + + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, lIntIfNum); + + if (mabIntfIsConfigurable(physPort, &pCfg) != TRUE) + return FAILURE; +/* get the response code */ + if (-1 == radius_get_resp_code(resp, &code)) + return FAILURE; + + nimGetIntfName(physPort, ALIASNAME, ifName); + MAB_EVENT_TRACE( + "%s:Received Radius response message on logicalPort:[%s] with status[%d]\n\r", + __FUNCTION__,ifName, code); + + mab_radius_resp_code_map(code, &status); + + /* Ensure we are expecting a response from the server */ + if (logicalPortInfo->protocol.mabAuthState == MAB_AUTHENTICATING) + { + switch (status) + { + case RADIUS_STATUS_SUCCESS: + rc = mabRadiusAcceptProcess(lIntIfNum, resp); + + if (logicalPortInfo->client.attrInfo.serverStateLen != 0) + { + memset(logicalPortInfo->client.attrInfo.serverState,0, MAB_SERVER_STATE_LEN); + logicalPortInfo->client.attrInfo.serverStateLen = 0; + } + + break; + + case RADIUS_STATUS_CHALLENGED: + rc = mabRadiusChallengeProcess(lIntIfNum, resp); + break; + + case RADIUS_STATUS_AUTHEN_FAILURE: + + /* response from radius server received. + stop the serverwhile timer */ + mabTimerDestroy(mabBlock->mabTimerCB, logicalPortInfo); + + + /* Initialize state to NULL as the session has been ended with a failure */ + if (logicalPortInfo->client.attrInfo.serverStateLen != 0) + { + memset(logicalPortInfo->client.attrInfo.serverState,0, MAB_SERVER_STATE_LEN); + logicalPortInfo->client.attrInfo.serverStateLen = 0; + } + + /* Log the information */ + LOGF( LOG_SEVERITY_NOTICE, + "Radius Authentication failed on physPort:[%s] lIntIfNum:[%d]" + "Mac Address :[%02x:%02x:%02x:%02x:%02x:%02x].\n\r", + ifName, lIntIfNum, + logicalPortInfo->client.suppMacAddr.addr[0], + logicalPortInfo->client.suppMacAddr.addr[1], + logicalPortInfo->client.suppMacAddr.addr[2], + logicalPortInfo->client.suppMacAddr.addr[3], + logicalPortInfo->client.suppMacAddr.addr[4], + logicalPortInfo->client.suppMacAddr.addr[5]); + + logicalPortInfo->protocol.authFail = TRUE; + mabUnAuthenticatedAction(logicalPortInfo); + break; + + case RADIUS_STATUS_REQUEST_TIMED_OUT: + case RADIUS_STATUS_COMM_FAILURE: + + MAB_EVENT_TRACE( + "Reason:'%s' on physPort:[%d] logical interface:[%s]\n\r", + (status == RADIUS_STATUS_COMM_FAILURE)?"RADIUS_STATUS_COMM_FAILURE":"RADIUS_STATUS_REQUEST_TIMED_OUT", + physPort, ifName); + + /* response from radius server received. + stop the serverwhile timer */ + mabTimerDestroy(mabBlock->mabTimerCB, logicalPortInfo); + + /* Initialize state to NULL as the session has been ended with a failure */ + if (logicalPortInfo->client.attrInfo.serverStateLen != 0) + { + memset(logicalPortInfo->client.attrInfo.serverState,0, MAB_SERVER_STATE_LEN); + logicalPortInfo->client.attrInfo.serverStateLen = 0; + } + + LOGF(LOG_SEVERITY_NOTICE, + "Failed to authenticate on logical interface %s.", ifName); + + logicalPortInfo->protocol.authFail = TRUE; + mabUnAuthenticatedAction(logicalPortInfo); + + break; + + case RADIUS_STATUS_ALL_AUTH_SERVERS_DEAD: + + /* All Radius Auth servers unreachable. Go through Inaccessible Auth Bypass */ + LOGF( LOG_SEVERITY_INFO, "All RADIUS Servers Dead."); + + /* response from radius server received. + stop the serverwhile timer */ + mabTimerDestroy(mabBlock->mabTimerCB, logicalPortInfo); + + logicalPortInfo->protocol.authFail = TRUE; + mabUnAuthenticatedAction(logicalPortInfo); + + break; + + default: + rc = FAILURE; + /* Log the information */ + LOGF( LOG_SEVERITY_NOTICE, + "Failed to authenticate on interface %s. Received an invalid RADIUS status type.", ifName); + break; + } + } + + radius_msg_free(resp); + return rc; +} + +/************************************************************************** + * @purpose Process RADIUS Challenge from server + * + * @param lIntIfNum @b{(input)} Logical interface number of port being authenticated + * @param *radiusPayload @b{(input)} payload of RADIUS frame (attributes) + * @param payloadLen @b{(input)} length of RADIUS payload + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *************************************************************************/ +RC_t mabRadiusChallengeProcess(uint32 lIntIfNum, void *resp) +{ + netBufHandle bufHandle; + uchar8 *data, *eapBuf; + enetHeader_t *enetHdr; + enet_encaps_t *encap; + uchar8 srcMac[ MAC_ADDR_LEN]; + eapolPacket_t *eapolPkt; + authmgrEapPacket_t *eapPkt; + uint32 length; + RC_t rc = SUCCESS; + mabPortCfg_t *pCfg; + mabLogicalPortInfo_t *logicalPortInfo; + uint32 physPort = 0, lPort = 0, type = 0; + uchar8 ifName[ NIM_IF_ALIAS_SIZE + 1]; + challenge_info_t get_data; + + logicalPortInfo = mabLogicalPortInfoGet(lIntIfNum); + if ((logicalPortInfo == NULLPTR) || ( NULLPTR == resp)) + { + return FAILURE; + } + + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, lIntIfNum); + + if (mabIntfIsConfigurable(physPort, &pCfg) != TRUE) + return FAILURE; + + /* response from radius server received. + stop the serverwhile timer */ + mabTimerDestroy(mabBlock->mabTimerCB, logicalPortInfo); + + nimGetIntfName(physPort, ALIASNAME, ifName); + MAB_EVENT_TRACE( + "%s:Received Radius Challenge message for " + "client - %02X:%02X:%02X:%02X:%02X:%02X on port - %s[%d]\n", + __FUNCTION__,( uchar8)logicalPortInfo->client.suppMacAddr.addr[0], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[1], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[2], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[3], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[4], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[5], ifName, lIntIfNum); + + nimGetIntfAddress(physPort, NULL, srcMac); + + SYSAPI_NET_MBUF_GET(bufHandle); + if (bufHandle == NULL) + { + LOGF( LOG_SEVERITY_NOTICE, + "mabRadiusChallengeProcess: Out of system buffers." + " 802.1X cannot process/transmit message due to lack of internal buffers"); + return FAILURE; + } + + SYSAPI_NET_MBUF_GET_DATASTART(bufHandle, data); + /* Set ethernet header */ + enetHdr = ( enetHeader_t *)(data); + /* Set dest and source MAC in ethernet header */ + memcpy(enetHdr->dest.addr, EAPOL_PDU_MAC_ADDR.addr, MAC_ADDR_LEN); + memcpy(enetHdr->src.addr, srcMac, MAC_ADDR_LEN); + + /* Set ethernet type */ + encap = ( enet_encaps_t *)(( uchar8 *)enetHdr + ENET_HDR_SIZE); + encap->type = osapiHtons( ETYPE_EAPOL); + + /* Set EAPOL header */ + eapolPkt = ( eapolPacket_t *)(( uchar8 *)encap + ENET_ENCAPS_HDR_SIZE); + eapolPkt->protocolVersion = MAB_PAE_PORT_PROTOCOL_VERSION_1; + eapolPkt->packetType = EAPOL_EAPPKT; + + eapPkt = ( authmgrEapPacket_t *)(( uchar8 *)eapolPkt + sizeof( eapolPacket_t)); + eapBuf = ( uchar8 *)eapPkt; + + logicalPortInfo->client.attrInfo.rcvdEapAttr = FALSE; + if ( NULLPTR != resp) + { + memset(&get_data, 0, sizeof(get_data)); + get_data.nas_port = lIntIfNum; + get_data.challenge = logicalPortInfo->client.mabChallenge; + get_data.challenge_len = &logicalPortInfo->client.mabChallengelen; + /*get_data.challenge_len = 32;*/ + + get_data.attrInfo = &logicalPortInfo->client.attrInfo; + get_data.supp_data = eapBuf; + + + rc = radiusClientChallengeProcess(resp, &get_data); + if ( SUCCESS != rc) + { + SYSAPI_NET_MBUF_FREE(bufHandle); + return FAILURE; + } + + if (0 == logicalPortInfo->client.attrInfo.accessLevel) + logicalPortInfo->client.attrInfo.accessLevel = RADIUS_SERVICE_TYPE_LOGIN; + + + if ((logicalPortInfo->client.attrInfo.accessLevel != RADIUS_SERVICE_TYPE_ADMIN) && + (logicalPortInfo->client.attrInfo.accessLevel != RADIUS_SERVICE_TYPE_LOGIN) && + (RADIUS_SERVICE_TYPE_CALL_CHECK != logicalPortInfo->client.attrInfo.accessLevel)) + { + LOGF( LOG_SEVERITY_NOTICE, + "Received an unsupported service-type value (%d) in the " + "radius challenge message, sending EAP failure to the " + "client %02X:%02X:%02X:%02X:%02X:%02X." + "Supported values are 'Login' and 'Admin'.Modify the radius " + "server settings with supported service-type", + logicalPortInfo->client.attrInfo.accessLevel, ( uchar8)logicalPortInfo->client.suppMacAddr.addr[0], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[1], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[2], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[3], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[4], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[5]); + SYSAPI_NET_MBUF_FREE(bufHandle); + return FAILURE; + } + } + + eapolPkt->packetBodyLength = eapPkt->length; /* already in network byte order */ + + length = ENET_HDR_SIZE + ENET_ENCAPS_HDR_SIZE + sizeof( eapolPacket_t) + + osapiNtohs(eapolPkt->packetBodyLength); + SYSAPI_NET_MBUF_SET_DATALENGTH(bufHandle, length); + + /* send request to supplicant */ + rc = mabClientRequestAction(logicalPortInfo, bufHandle); + + return rc; +} + +/************************************************************************** + * @purpose Build VP list and send Access Request to RADIUS client + * + * @param lIntIfNum @b{(input)} Logical interface number of port being authenticated + * @param *suppEapData @b{(input)} EAP info received from supplicant + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *************************************************************************/ +RC_t mabRadiusAccessRequestSend(uint32 lIntIfNum, uchar8 *suppEapData) +{ + authmgrEapPacket_t *eapPkt = NULLPTR; + RC_t rc; + mabPortCfg_t *pCfg; + mabLogicalPortInfo_t *logicalPortInfo; + uint32 physPort; + uint32 ifIndex; + access_req_info_t *req; + mab_radius_cmd_msg_t cmd_req; + uchar8 localMac[6]; + uchar8 calledId[AUTHMGR_MAC_ADDR_STR_LEN+1]; + uchar8 callingId[AUTHMGR_MAC_ADDR_STR_LEN+1]; + uchar8 nasPortId[ NIM_IF_ALIAS_SIZE + 1]; + uchar8 md5ChkSum[MAB_MD5_LEN+1], responseData[ PASSWORD_SIZE + MAB_CHALLENGE_LEN + 2]; + uint32 responseDataLen; + uchar8 password[ PASSWORD_SIZE]; + uint32 challengelen; + uchar8 chapPassword[MAB_MD5_LEN+1]; + + if (suppEapData != NULL) + eapPkt = ( authmgrEapPacket_t *)suppEapData; + + logicalPortInfo = mabLogicalPortInfoGet(lIntIfNum); + if (logicalPortInfo == NULLPTR) + { + return FAILURE; + } + + MAB_PORT_GET(physPort, lIntIfNum); + + + MAB_EVENT_TRACE( + "%s:Recieved Radius send Access Request message for logical - %d \n", + __FUNCTION__,lIntIfNum); + + if (mabIntfIsConfigurable(physPort, &pCfg) != TRUE) + return FAILURE; + + if (nimGetIntfIfIndex(physPort, &ifIndex) != SUCCESS) + return FAILURE; + + if ( AUTHMGR_PORT_MAB_AUTH_TYPE_CHAP == logicalPortInfo->client.mabAuthType) + { + memset(logicalPortInfo->client.mabChallenge,0, MAB_CHALLENGE_LEN); + mabLocalAuthChallengeGenerate(logicalPortInfo->client.mabChallenge, MAB_CHAP_CHALLENGE_LEN); + logicalPortInfo->client.mabChallengelen = MAB_CHAP_CHALLENGE_LEN; + + /* generate CHAP-Password using MD5 encryption */ + memset(password, 0, sizeof(password)); + osapiStrncpySafe(password, logicalPortInfo->client.mabUserName, strlen(logicalPortInfo->client.mabUserName)+ 1); + + challengelen= logicalPortInfo->client.mabChallengelen; + responseDataLen = 1 + strlen(( char8 *)password) + challengelen; + + memset(responseData, 0, sizeof(responseData)); + responseData[0] = logicalPortInfo->client.currentIdL; + + memcpy (&responseData[1], password, strlen(( char8 *)password)); + memcpy (&responseData[1+strlen(( char8 *)password)], logicalPortInfo->client.mabChallenge, challengelen); + + mabLocalMd5Calc(responseData, responseDataLen, md5ChkSum); + + chapPassword[0] = logicalPortInfo->client.currentIdL; + memcpy(&chapPassword[1], md5ChkSum, MAB_MD5_LEN); + } + + req = (access_req_info_t *)malloc(sizeof(access_req_info_t)); + memset(req, 0, sizeof(req)); + + /* pack the reqired info to sent the access-req */ + req->user_name = logicalPortInfo->client.mabUserName; + req->user_name_len = strlen(logicalPortInfo->client.mabUserName); + req->chap_password = chapPassword; + req->chap_password_len = MAB_MD5_LEN+1; + req->challenge = logicalPortInfo->client.mabChallenge; + req->challenge_len = logicalPortInfo->client.mabChallengelen; + req->mab_auth_type = logicalPortInfo->client.mabAuthType; + req->supp_eap_data = suppEapData; + + /* Called-Station-Id */ + bzero(localMac, MAC_ADDR_LEN); + + if (nimGetIntfAddress(physPort, NULL, localMac) == SUCCESS) + { + bzero(calledId, AUTHMGR_MAC_ADDR_STR_LEN+1); + osapiSnprintf(( char8 *)calledId, sizeof(calledId), "%02X-%02X-%02X-%02X-%02X-%02X", + localMac[0], localMac[1], localMac[2], localMac[3], localMac[4], localMac[5]); + req->calledId = calledId; + req->calledId_len = strlen(calledId); + } + + /* Calling-Station-Id */ + bzero(callingId, AUTHMGR_MAC_ADDR_STR_LEN+1); + osapiSnprintf(( char8 *)callingId, sizeof(callingId), "%02X-%02X-%02X-%02X-%02X-%02X", + logicalPortInfo->client.suppMacAddr.addr[0], + logicalPortInfo->client.suppMacAddr.addr[1], + logicalPortInfo->client.suppMacAddr.addr[2], + logicalPortInfo->client.suppMacAddr.addr[3], + logicalPortInfo->client.suppMacAddr.addr[4], + logicalPortInfo->client.suppMacAddr.addr[5]); + + req->callingId = callingId; + req->callingId_len = strlen(callingId); + + /* nas-port */ + req->nas_port = ifIndex; + + +/* nas-port-id */ + bzero(nasPortId, ( NIM_IF_ALIAS_SIZE + 1)); + nimGetIntfName(physPort, ALIASNAME, nasPortId); + req->nas_portid = nasPortId; + + if ((AF_INET == mabBlock->nas_ip.af) || ((AF_INET6 == mabBlock->nas_ip.af))) + { + req->nas_ip.family = mabBlock->nas_ip.af; + + if (AF_INET == mabBlock->nas_ip.af) + { + req->nas_ip.addr.ipv4.s_addr = mabBlock->nas_ip.u.v4.s_addr; + } + else + { + memcpy(&req->nas_ip.addr.ipv6.in6, &mabBlock->nas_ip.u.v6, 16); + } + } + + if (strlen(mabBlock->nas_id)) + { + memcpy(req->nas_id, mabBlock->nas_id, min(sizeof(req->nas_id), sizeof(mabBlock->nas_id))); + } + +req->attrInfo = &logicalPortInfo->client.attrInfo; + +memcpy (req->supp_mac, logicalPortInfo->client.suppMacAddr.addr, sizeof(logicalPortInfo->client.suppMacAddr)); + +req->cxt = mabBlock->rad_cxt; +req->correlator = lIntIfNum; + + rc = SUCCESS; + if (0 != radiusAccessRequestSend(req)) + { + MAB_EVENT_TRACE( + "%s: radiusAccessRequestSend - failed \n", + __FUNCTION__); + rc = FAILURE; + } + + + if ( SUCCESS != rc) + { + LOGF( LOG_SEVERITY_NOTICE, + "Failed to send access-req to RADIUS Server."); + free(req); + return rc; + } + + memset(&cmd_req, 0, sizeof(cmd_req)); + + strncpy(cmd_req.cmd, "access-req", strlen("access-req")+1); + cmd_req.data = mabBlock->rad_cxt; + cmd_req.cmd_data.access_req.req_attr = (void *)req; + cmd_req.cmd_data.access_req.msg = req->msg_req; + radius_mab_cmd_req_send(mabBlock->send_fd,(char *)&cmd_req, sizeof(cmd_req)); + return rc; +} + + +/************************************************************************** + * @purpose After client disconnected send clear RADIUS messages Request + * to RADIUS client + * + * @param suppMacAddr @b{(input)} Supplicant MAC address + * + * @comments + * + * @end + *************************************************************************/ +void mabRadiusClearRadiusMsgsSend( enetMacAddr_t suppMacAddr) +{ + mab_radius_cmd_msg_t cmd_req; + + memset(&cmd_req, 0, sizeof(cmd_req)); + + strncpy(cmd_req.cmd, "clear-radius-msgs", strlen("clear-radius-msgs")+1); + cmd_req.data = mabBlock->rad_cxt; + memcpy(&cmd_req.cmd_data.mab_cli_mac_addr, &suppMacAddr.addr, ENET_MAC_ADDR_LEN); + radius_mab_cmd_req_send(mabBlock->send_fd,(char *)&cmd_req, sizeof(cmd_req)); +} + + +/************************************************************************** + * @purpose Process EAP Response and Response/Identity frames + * + * @param lIntIfNum @b{(input)} Logical internal interface number + * @param bufHandle @b{(input)} the handle to the mab PDU + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *************************************************************************/ +RC_t mabRadiusSuppResponseProcess(uint32 lIntIfNum, netBufHandle bufHandle) +{ + uchar8 *data; + enetHeader_t *enetHdr; + eapolPacket_t *eapolPkt; + authmgrEapPacket_t *eapPkt; + eapRrPacket_t *eapRrPkt = NULLPTR; + mabLogicalPortInfo_t *logicalPortInfo; + uint32 physPort = 0, lPort = 0, type = 0; /*, monitorMode */ + + logicalPortInfo = mabLogicalPortInfoGet(lIntIfNum); + if ((logicalPortInfo == NULLPTR) || + ( NULL == bufHandle)) + { + return FAILURE; + } + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, lIntIfNum); + + MAB_EVENT_TRACE("%s: called for port -%d\n", + __FUNCTION__,lIntIfNum); + + if(bufHandle != NULL) + { + SYSAPI_NET_MBUF_GET_DATASTART(bufHandle, data); + enetHdr = ( enetHeader_t *)data; + eapolPkt = ( eapolPacket_t *)(( uchar8 *)enetHdr + ENET_HDR_SIZE + ENET_ENCAPS_HDR_SIZE); + eapPkt = ( authmgrEapPacket_t *)(( uchar8 *)eapolPkt + sizeof( eapolPacket_t)); + eapRrPkt = ( eapRrPacket_t *)(( uchar8 *)eapPkt + sizeof( authmgrEapPacket_t)); + } + + /* If this is a an EAP/Response-Identity, we need to see if the user has access to this port. */ + if ((eapRrPkt != NULLPTR)&&(eapRrPkt->type == EAP_RRIDENTITY)) + { + /* User name was stored in port info structure when EAP-Response/Identity frame was received. + * See if this user name matches a locally configured user. If the user is locally configured + * but does not have access to this port, generate an error. + */ +#if 0 + if (userMgrLoginIndexGet(( char8 *)logicalPortInfo->client.mabUserName, + &logicalPortInfo->client.mabUserIndex) == SUCCESS) + { + /* Make sure user has access to this port */ + if ( (userMgrPortUserAccessGet(physPort, logicalPortInfo->client.mabUserName, &portAllow) == SUCCESS) && + (portAllow == FALSE) ) + { + logicalPortInfo->protocol.authFail = TRUE; + return mabUnAuthenticatedAction(logicalPortInfo); + } + } +#endif + } + + /* Send the Supplicant response to the server */ + return mabSendRespToServer(lIntIfNum, bufHandle); +} + +/********************************************************************* + * + * @purpose Convert the given vlan string based on the id or name + * + * @param vlanId @b{(output)} Vlan Id assigned. + * @param vlanName @b{(input)} Vlan string. + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + * + *********************************************************************/ +RC_t mabRadiusServerVlanConversionHandle(const char8 *vlanName, uint32 *vlanId) +{ + + /*Check that any vlan has same name with given string*/ + if(/*dot1qVlanIdFromNameGet(vlanName, vlanId) == */ SUCCESS) + { + return SUCCESS; + } /*check that given string is pure numeric string */ + else if (/*usmDbStringNumericCheck(vlanName) == */ SUCCESS) + { + *vlanId = atoi(vlanName); + return SUCCESS; + } + else + { + /*Then given string is invalid string */ + *vlanId = 0; + return FAILURE; + } +} + +RC_t mabAccessLevelAttrValidate(mabLogicalPortInfo_t *logicalPortInfo) +{ + MAB_IF_NULLPTR_RETURN_LOG(logicalPortInfo); + + /* if the service type from radius server is not + **supported by DUT consider the response + ** as Access-Reject */ + if ((RADIUS_SERVICE_TYPE_ADMIN != logicalPortInfo->client.attrInfo.accessLevel) && + (RADIUS_SERVICE_TYPE_LOGIN != logicalPortInfo->client.attrInfo.accessLevel) && + (RADIUS_SERVICE_TYPE_CALL_CHECK != logicalPortInfo->client.attrInfo.accessLevel)) + { + LOGF( LOG_SEVERITY_WARNING, + "Unable to authenticate as an unsupported service-type value (%d) " + "received in the radius server access-accept message.Sending EAP " + "failure to the client %02X:%02X:%02X:%02X:%02X:%02X.Supported " + "values are 'Login' and 'Admin'.Recommend changing the radius " + "server settings with supported service-type.", + logicalPortInfo->client.attrInfo.accessLevel, ( uchar8)logicalPortInfo->client.suppMacAddr.addr[0], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[1], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[2], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[3], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[4], + ( uchar8)logicalPortInfo->client.suppMacAddr.addr[5]); + return FAILURE; + } + return SUCCESS; +} + +RC_t mabVlanAttrValidate(mabLogicalPortInfo_t *logicalPortInfo) +{ + uint32 vlanId = 0; + + MAB_IF_NULLPTR_RETURN_LOG(logicalPortInfo); + + /* process the string received and validate the + result for presense of VLAN */ + if ( SUCCESS != mabRadiusServerVlanConversionHandle + (logicalPortInfo->client.attrInfo.vlanString, &vlanId)) + { + return FAILURE; + } + + logicalPortInfo->client.attrInfo.vlanId = vlanId; + + return SUCCESS; +} + +RC_t mabRadiusAcceptPostProcess(mabLogicalPortInfo_t *logicalPortInfo) +{ + uint32 physPort = 0; + mabPortCfg_t *pCfg = NULLPTR; + + MAB_IF_NULLPTR_RETURN_LOG(logicalPortInfo); + + MAB_PORT_GET(physPort, logicalPortInfo->key.keyNum); + + /* check access level attribute */ + if ((AUTHMGR_RADIUS_ATTR_TYPE_SERVICE_TYPE & logicalPortInfo->client.attrInfo.attrFlags) && + ( SUCCESS != mabAccessLevelAttrValidate(logicalPortInfo))) + { + logicalPortInfo->protocol.authFail = TRUE; + mabUnAuthenticatedAction(logicalPortInfo); + return FAILURE; + } + + /* check if EAP message is receied. + If the client is mab aware the eap attribute + need to be present in the accept message */ + + if (!(AUTHMGR_RADIUS_ATTR_TYPE_EAP_MESSAGE & logicalPortInfo->client.attrInfo.attrFlags)) + { + if (( TRUE != mabIntfIsConfigurable(physPort, &pCfg)) || + ( NULLPTR == pCfg)) + { + return FAILURE; + } + + /* check if the method is MD5 */ + if ( AUTHMGR_PORT_MAB_AUTH_TYPE_EAP_MD5 == pCfg->mabAuthType) + { + logicalPortInfo->protocol.authFail = TRUE; + mabUnAuthenticatedAction(logicalPortInfo); + return FAILURE; + } + } + + return SUCCESS; +} +/************************************************************************** + * @purpose Process RADIUS Accept from server + * + * @param lIntIfNum @b{(input)} Logical internal interface number of port being authenticated + * @param *radiusPayload @b{(input)} payload of RADIUS frame (attributes) + * @param payloadLen @b{(input)} length of RADIUS payload + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *************************************************************************/ +RC_t mabRadiusAcceptProcess(uint32 lIntIfNum, void *resp) +{ + uint32 rc = SUCCESS; + mabPortCfg_t *pCfg; + uint32 physPort = 0, lPort = 0, type = 0; + uchar8 ifName[ NIM_IF_ALIAS_SIZE + 1]; + mabLogicalPortInfo_t *logicalPortInfo = NULLPTR; + + logicalPortInfo = mabLogicalPortInfoGet(lIntIfNum); + MAB_IF_NULLPTR_RETURN_LOG (logicalPortInfo); + + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, lIntIfNum); + + if (mabIntfIsConfigurable(physPort, &pCfg) != TRUE) + return FAILURE; + + nimGetIntfName(physPort, ALIASNAME, ifName); + MAB_EVENT_TRACE( + "%s:Received Radius Accept message for port - %s\n", + __FUNCTION__,ifName); + + /* response from radius server received. + stop the serverwhile timer */ + mabTimerDestroy(mabBlock->mabTimerCB, logicalPortInfo); + + if ( NULLPTR != resp) + { + if (0 != radiusClientAcceptProcess(resp, &logicalPortInfo->client.attrInfo)) + { + printf("radiusClientAcceptProcess failed \n"); + rc = FAILURE; + } + + if ( SUCCESS != rc) + { + LOGF( LOG_SEVERITY_INFO, + "Could not parse RADIUS attributes."); + return FAILURE; + } + } /* radiusPayload check ends here */ + + rc = mabRadiusAcceptPostProcess(logicalPortInfo); + if ( SUCCESS == rc) + { + logicalPortInfo->client.authMethod = AUTH_METHOD_RADIUS; + mabAuthenticatedAction(logicalPortInfo); + } + + return rc; +} + + +/************************************************************************** +* @purpose Send Response frame to Server +* +* @param lIntIfNum @b{(input)} Logical internal interface number +* @param bufHandle @b{(input)} the handle to the mab PDU +* +* @returns SUCCESS +* @returns FAILURE +* +* @comments +* +* @end +*************************************************************************/ +RC_t mabSendRespToServer(uint32 lIntIfNum, netBufHandle bufHandle) +{ + uchar8 *data; + authmgrEapPacket_t *eapPkt = NULLPTR; + mabLogicalPortInfo_t *logicalPortInfo; + + if ( NULL == bufHandle) + { + return FAILURE; + } + + MAB_EVENT_TRACE( + "%s: called for port -%d\n",__FUNCTION__,lIntIfNum); + + if (bufHandle != NULL) + { + SYSAPI_NET_MBUF_GET_DATASTART(bufHandle, data); + + eapPkt = ( authmgrEapPacket_t *)(data + ENET_HDR_SIZE + ENET_ENCAPS_HDR_SIZE + sizeof( eapolPacket_t)); + } + + + if (mabRadiusAccessRequestSend(lIntIfNum, ( uchar8 *)eapPkt) != SUCCESS) + { + LOGF( LOG_SEVERITY_NOTICE, + "mabSendRespToServer: mabRadiusAccessRequestSend failed\n" + " Failed sending message to RADIUS server"); + MAB_EVENT_TRACE( + "%s: mabRadiusAccessRequestSend failed for port -%d\n",__FUNCTION__,lIntIfNum); + + logicalPortInfo = mabLogicalPortInfoGet(lIntIfNum); + if (logicalPortInfo != NULLPTR) + { + logicalPortInfo->protocol.authFail = TRUE; + mabUnAuthenticatedAction(logicalPortInfo); + } + } + + return SUCCESS; +} + +/************************************************************************** + * @purpose Take MAB Radius server lock + * + * @param none + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *************************************************************************/ +RC_t mabRadiusServerTaskLockTake(void) +{ + return osapiSemaTake(mabBlock->mabRadiusSrvrTaskSyncSema, WAIT_FOREVER); +} + +/************************************************************************** + * @purpose Give MAB Radius server lock + * + * @param none + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *************************************************************************/ +RC_t mabRadiusServerTaskLockGive(void) +{ + return osapiSemaGive(mabBlock->mabRadiusSrvrTaskSyncSema); +} diff --git a/src/sonic-pac/mab/protocol/mab_timer.c b/src/sonic-pac/mab/protocol/mab_timer.c new file mode 100755 index 000000000000..bf7d14cf78c2 --- /dev/null +++ b/src/sonic-pac/mab/protocol/mab_timer.c @@ -0,0 +1,272 @@ +/* + * Copyright 2024 Broadcom Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mab_include.h" +#include "mab_db.h" +#include "mab_debug.h" +#include "mab_struct.h" + +extern mabBlock_t *mabBlock; + +/************************************************************************* + * @purpose function to process on expiry of server awhile timer + * + * @param timer @b{(input)} Pointer to appTimer node + * @param logicalPortInfo @b{(input)} Pointer to logicalPort Info + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments none + * + * @end + *************************************************************************/ +RC_t mabServerAwhileExpiryAction(mabLogicalPortInfo_t *logicalPortInfo) +{ + + MAB_IF_NULLPTR_RETURN_LOG(logicalPortInfo); + + /* Supp AWhile Timer has expired. */ + logicalPortInfo->protocol.authFail = TRUE; + mabUnAuthenticatedAction(logicalPortInfo); + return SUCCESS; +} + +/************************************************************************* + * @purpose function to get function map entry for the given timer type + * + * @param type @b{(input)} timer type + * @param elem @b{(input)} Pointer to map entry + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments none + * + * @end + *************************************************************************/ +RC_t mabTimerHandlerInfoGet(mabTimerType_t type, mabTimerMap_t *elem) +{ + uint32 i = 0; + static mabTimerMap_t mabTimerHandlerTable[] = + { + {MAB_SERVER_AWHILE, mabServerAwhileExpiryAction}, + }; + + + for (i = 0; i < (sizeof (mabTimerHandlerTable)/sizeof(mabTimerMap_t)); i++) + { + if (type == mabTimerHandlerTable[i].type) + { + *elem = mabTimerHandlerTable[i]; + return SUCCESS; + } + } + + return FAILURE; +} + + +/********************************************************************* + * @purpose This function is used to send timer events + * + * @param timerCtrlBlk @b{(input)} Timer Control Block + * @param ptrData @b{(input)} Ptr to passed data + * + * @returns None + * + * @notes None + * @end + *********************************************************************/ +void mabTimerExpiryHdlr( APP_TMR_CTRL_BLK_t timerCtrlBlk, void* ptrData) +{ + mabIssueCmd(mabTimeTick, NULL, NULLPTR); +} + +/************************************************************************* + * @purpose Process the mab timer expiry event + * + * @param param @b{(input)} Pointer to added mab node identifier + * + * @returns void + * + * @comments none + * + * @end + *************************************************************************/ +void mabTimerExpiryAction(void *param) +{ + mabTimerContext_t *pNode; + mabTimerMap_t entry; + mabLogicalPortInfo_t *logicalPortInfo = NULLPTR; + + pNode = (mabTimerContext_t *)param; + if (pNode == NULLPTR) + { + LOGF( LOG_SEVERITY_INFO, + "mabTimerExpiryAction: Failed to retrieve handle \n"); + return; + } + + logicalPortInfo = mabLogicalPortInfoGet(pNode->keyNum); + + if ( NULLPTR == logicalPortInfo) + { + return; + } + + MAB_EVENT_TRACE( + "MAB timer %s expired on logical port %d \r\n", + mabTimerTypeStringGet(pNode->type), logicalPortInfo->key.keyNum); + + /* Delete the apptimer node */ + (void)appTimerDelete(mabBlock->mabTimerCB, logicalPortInfo->mabTimer.handle.timer); + /* Null out the timer Details */ + logicalPortInfo->mabTimer.handle.timer = NULL; + + /* pass the event accoring to the timer type */ + + memset(&entry, 0, sizeof(mabTimerMap_t)); + if ( SUCCESS != mabTimerHandlerInfoGet(pNode->type, &entry)) + { + LOGF( LOG_SEVERITY_WARNING, + "mabTimerExpiryAction: Failed to retrieve information" + "for timer type %s", mabTimerTypeStringGet(pNode->type)); + return; + } + + if ( NULLPTR != entry.expiryFn) + { + entry.expiryFn(logicalPortInfo); + } + + return; +} + +/************************************************************************* + * @purpose Starts the specified timer + * + * @param intIfNum @b{(input)} Interface for starting the timer + * @param timerType @b{(input)} Interface/Timer type + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments none + * + * @end + *************************************************************************/ +RC_t mabTimerStart(mabLogicalPortInfo_t *logicalPortInfo, mabTimerType_t timerType) +{ + uint32 physPort = 0, lPort = 0, type = 0, val = 0; + mabTimerMap_t entry; + + memset(&entry, 0, sizeof(mabTimerMap_t)); + + MAB_IF_NULLPTR_RETURN_LOG(logicalPortInfo); + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, logicalPortInfo->key.keyNum); + + if (logicalPortInfo->mabTimer.handle.timer != NULLPTR) + { + MAB_EVENT_TRACE( + "timer %s already running for logical port %d \r\n", + mabTimerTypeStringGet (logicalPortInfo->mabTimer.cxt.type), + logicalPortInfo->key.keyNum); + + MAB_EVENT_TRACE( + "not starting timer %s for logical port %d \r\n", + mabTimerTypeStringGet (timerType), + logicalPortInfo->key.keyNum); + return SUCCESS; + } + + if ( SUCCESS != mabTimerHandlerInfoGet(timerType, &entry)) + { + LOGF( LOG_SEVERITY_WARNING, + "mabTimerExpiryAction: Failed to retrieve information" + "for timer type %s", mabTimerTypeStringGet(timerType)); + return FAILURE; + } + + MAB_EVENT_TRACE( "mab Timer start:" + "starting timer %s for logical port %d \r\n", + mabTimerTypeStringGet(timerType), + logicalPortInfo->key.keyNum); + + /* Timer value should be multipled by 2 to match the retries in hostapd. */ + val = (2 * FD_MAB_PORT_SERVER_TIMEOUT); + + /* fill the timer context */ + logicalPortInfo->mabTimer.cxt.type = timerType; + logicalPortInfo->mabTimer.cxt.keyNum = logicalPortInfo->key.keyNum; + + /* Start the timer */ + logicalPortInfo->mabTimer.handle.timer = appTimerAdd(mabBlock->mabTimerCB, mabTimerExpiryAction, + (void *)&logicalPortInfo->mabTimer.cxt, val, mabTimerTypeStringGet(timerType)); + + if(logicalPortInfo->mabTimer.handle.timer == NULLPTR) + { + LOGF( LOG_SEVERITY_WARNING, + "mabTimerStart: Could not Start the %s timer." + "intIf %d, clientType %s, logical IntIfNum %d.", + mabTimerTypeStringGet(timerType), physPort, + mabNodeTypeStringGet(type), lPort); + return FAILURE; + } + + return SUCCESS; +} + +/************************************************************************* + * @purpose Helper API to delete the specifed timer node + * + * @param timer @b{(input)} Pointer to appTimer node + * @param logicalPortInfo @b{(input)} Pointer to logicalPort Info + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments none + * + * @end + *************************************************************************/ +RC_t mabTimerDestroy( APP_TMR_CTRL_BLK_t timerCB, + mabLogicalPortInfo_t *logicalPortInfo) +{ + uint32 physPort = 0, lPort = 0, type = 0; + + MAB_IF_NULLPTR_RETURN_LOG(logicalPortInfo); + + MAB_LPORT_KEY_UNPACK(physPort, lPort, type, logicalPortInfo->key.keyNum); + + /* Delete the apptimer node */ + if ( NULL != logicalPortInfo->mabTimer.handle.timer) + { + (void)appTimerDelete(timerCB, logicalPortInfo->mabTimer.handle.timer); + logicalPortInfo->mabTimer.handle.timer = NULL; + + MAB_EVENT_TRACE( "deleted the timer type %s" + "port %d type %s lport %d \r\n", + mabTimerTypeStringGet(logicalPortInfo->mabTimer.cxt.type), + physPort, mabNodeTypeStringGet(type), lPort); + } + + + /* clear the context */ + memset(&logicalPortInfo->mabTimer, 0, sizeof(mabTimer_t)); + return SUCCESS; +} + diff --git a/src/sonic-pac/mab/protocol/mab_utils.c b/src/sonic-pac/mab/protocol/mab_utils.c new file mode 100755 index 000000000000..6000a4843817 --- /dev/null +++ b/src/sonic-pac/mab/protocol/mab_utils.c @@ -0,0 +1,65 @@ +/* + * Copyright 2024 Broadcom Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "mab_include.h" +#include "mab_db.h" +#include "mab_client.h" +#include "mab_timer.h" +#include "mab_control.h" +#include "mab_struct.h" + +extern mabBlock_t *mabBlock; +/********************************************************************* + * @purpose function to check policy validation based on host mode + * + * @param hostMode @b{(input)) hostmode + * @param *appyPolicy @b{(input)) bool value + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *********************************************************************/ +RC_t mabHostIsDynamicNodeAllocCheck( AUTHMGR_HOST_CONTROL_t hostMode, BOOL *valid) +{ + *valid = TRUE; + return SUCCESS; +} + + +RC_t mabNimIntfStateCheck(uint32 intIfNum) +{ + INTF_STATES_t state; + mabPortCfg_t *pCfg; + + if(mabIntfIsConfigurable(intIfNum, &pCfg) != TRUE) + { + return FAILURE; + } + + state = nimGetIntfState(intIfNum); + if ((state != INTF_ATTACHED) + && (state != INTF_ATTACHING) + && (state != INTF_DETACHING)) + { + return FAILURE; + } + + return SUCCESS; +} diff --git a/src/sonic-pac/mab/protocol/mab_vlan.c b/src/sonic-pac/mab/protocol/mab_vlan.c new file mode 100755 index 000000000000..191070a98758 --- /dev/null +++ b/src/sonic-pac/mab/protocol/mab_vlan.c @@ -0,0 +1,260 @@ +/* + * Copyright 2024 Broadcom Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mab_include.h" +#include "auth_mgr_exports.h" +#include "mab_include.h" +#include "mab_client.h" +#include "mab_struct.h" + +extern mabBlock_t *mabBlock; + + +/********************************************************************* + * @purpose Processes Vlan PVID Change Notify event. + * + * @param intIfNum @b{(input)} internal interface number + * @param vlanId @b{(input)} VlanId (new PVID on the port) + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end +*********************************************************************/ +RC_t mabVlanPVIDChangeEventProcess(uint32 physPort,uint32 vlanId) +{ + RC_t rc = FAILURE; + mabLogicalPortInfo_t *logicalPortInfo; + uint32 i = 0; + BOOL valid = FALSE; + + MAB_EVENT_TRACE( + "%s:PVID for port -%d changed to Vlan %d\n", + __FUNCTION__,physPort,vlanId); + + if (mabBlock->mabPortInfo[physPort].portControlMode == AUTHMGR_PORT_AUTO) + { + /* Nothing to be done as port pvid change is also triggered by a client being authorized + on the port in other host modes, where mab can aquire the port. + The Admin cannot change the operational pvid of the port + as it is acquired by mab. */ + + /* check if the host policy is valid for the current host mode */ + if (( SUCCESS == mabHostIsDynamicNodeAllocCheck(mabBlock->mabPortInfo[physPort].hostMode, &valid)) && + ( TRUE == valid)) + { + i = MAB_LOGICAL_PORT_ITERATE; + while ((NULLPTR != (logicalPortInfo=mabLogicalPortInfoGetNextNode(physPort,&i)) && + (0 != logicalPortInfo->key.keyNum))) + { + if ((vlanId == logicalPortInfo->client.vlanId) && + ( AUTHMGR_PORT_STATUS_AUTHORIZED == logicalPortInfo->client.logicalPortStatus)) + { + MAB_EVENT_TRACE( + "pvid %d is changed. logicalPort %d is authenticated on same vlan. vlan type %s" + "Cleaning up the client \n", + vlanId, i, mabVlanTypeStringGet(logicalPortInfo->client.vlanType)); + + + /* invoke the cleanup */ + rc = mabClientInfoCleanup(logicalPortInfo); + + if ( SUCCESS != rc) + { + MAB_EVENT_TRACE( + "client cleanup for logicalPort %d is NOT successful\n",i); + } + } + } + } + } + return rc; +} + +/********************************************************************* + * @purpose check if the port participation can be removed for a vlan + * + * @param physPort @b{(input)) Port + * @param vlanId @b{(input)) vlan Id + * + * @returns SUCCESS/ FAILRE + * + * @comments + * + * @end + *********************************************************************/ +RC_t mabVlanPortDeletionValidate(uint32 physPort, uint32 vlanId) +{ + uint32 i = 0; + mabLogicalPortInfo_t *logicalPortInfo = NULLPTR; + + if (AUTHMGR_PORT_AUTO == mabBlock->mabPortInfo[physPort].portControlMode) + { + i = MAB_LOGICAL_PORT_ITERATE; + while ((NULLPTR != (logicalPortInfo=mabLogicalPortInfoGetNextNode(physPort,&i)) && + (0 != logicalPortInfo->key.keyNum))) + { + if (vlanId == logicalPortInfo->client.vlanId) + { + MAB_EVENT_TRACE( + "logicalPort %d is still a member of vlanId %d. \n", + i, logicalPortInfo->client.vlanId); + + return FAILURE; + } + } + } + return SUCCESS; +} + +/********************************************************************* + * @purpose check if the port can be aquired by mab + * + * @param physPort @b{(input)) Port + * @param vlanId @b{(input)) vlan Id + * + * @returns SUCCESS/ FAILRE + * + * @comments + * + * @end + *********************************************************************/ +RC_t mabVlanPortAcquireCheck(uint32 physPort) +{ + BOOL valid = FALSE; + + if ( AUTHMGR_PORT_AUTO == mabBlock->mabPortInfo[physPort].portControlMode) + { + /* check if the host policy is valid for the current host mode */ + if (( SUCCESS == mabHostIsDynamicNodeAllocCheck(mabBlock->mabPortInfo[physPort].hostMode, &valid)) && + ( FALSE == valid)) + { + return SUCCESS; + } + } + return FAILURE; +} + +/********************************************************************* + * @purpose Apply mab vlan assignment to a specific logical interface + * + * @param intIfNum @b{(input)) internal interface number + * @param vlanId @b{(input)) vlan id + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments This call should happen only in mac-based mode. + * + * @end + *********************************************************************/ +RC_t mabVlanPortAddProcess(uint32 intIfNum,uint32 vlanId) +{ + return SUCCESS; +} + +/********************************************************************* + * @purpose remove mab vlan assignment to a specific logical interface + * + * @param intIfNum @b{(input)) internal interface number + * @param vlanId @b{(input)) vlan id + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments This call should happen only in mac-based mode. + * + * @end + *********************************************************************/ +RC_t mabVlanDeleteProcess(uint32 vlanId) +{ + RC_t nimRc = SUCCESS; + uint32 intIfNum; + + nimRc = mabFirstValidIntfNumber(&intIfNum); + while (nimRc == SUCCESS) + { + /* delete the clients on this port for the vlan */ + mabVlanPortDeleteProcess(intIfNum, vlanId); + + nimRc = mabNextValidIntf(intIfNum, &intIfNum); + } + + return SUCCESS; +} + + +/********************************************* + * @purpose Enable mab vlan to a specified interface + * + * @param intIfNum @b{(input)) internal interface number + * @param guestVlanId @b{(input)} guest vlan id + * + * @returns SUCCESS + * @returns FAILURE + * + * @comments + * + * @end + *********************************************************************/ +RC_t mabVlanPortDeleteProcess(uint32 intIfNum,uint32 vlanId) +{ + RC_t rc = SUCCESS; + mabLogicalPortInfo_t *logicalPortInfo = NULLPTR; + uint32 lIntIfNum; + mabPortCfg_t *pCfg; + + if (mabIntfIsConfigurable(intIfNum, &pCfg) != TRUE) + return FAILURE; + + + if ( AUTHMGR_PORT_AUTO != mabBlock->mabPortInfo[intIfNum].portControlMode) + return SUCCESS; + + + if(mabBlock->mabPortInfo[intIfNum].portControlMode == AUTHMGR_PORT_AUTO) + { + lIntIfNum = MAB_LOGICAL_PORT_ITERATE; + while((logicalPortInfo=mabLogicalPortInfoGetNextNode(intIfNum,&lIntIfNum))!= NULLPTR) + { + if ( AUTHMGR_PORT_STATUS_AUTHORIZED == logicalPortInfo->client.logicalPortStatus) + { + /* clean up the client */ + if (vlanId == logicalPortInfo->client.vlanId) + { + MAB_EVENT_TRACE( + "port %d is deleted from vlan %d. logicalPort %d is authenticated on same vlan. vlan type %s" + "Cleaning up the client \n", + intIfNum, vlanId, lIntIfNum, mabVlanTypeStringGet(logicalPortInfo->client.vlanType)); + + /* invoke the cleanup */ + rc = mabClientSwInfoCleanup(logicalPortInfo); + + if ( SUCCESS != rc) + { + MAB_EVENT_TRACE( + "client cleanup for logicalPort %d is NOT successful\n",lIntIfNum); + } + } + } + } + } + return SUCCESS; +} + + From f2f9a76c53e377a209e82f40ab2c9a5d685ea9d6 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Sun, 12 May 2024 02:27:59 -0700 Subject: [PATCH 088/282] [sflow]: Upgrade sflow container to be based on Bookworm (#18543) Microsoft ADO (number only): 27475035 Signed-off-by: Saikrishna Arcot --- dockers/docker-sflow/Dockerfile.j2 | 4 +- rules/docker-sflow.mk | 10 ++-- rules/sflow.mk | 2 +- src/sflow/hsflowd/Makefile | 6 +- .../patch/0002-host_sflow_debian.patch | 59 ++----------------- 5 files changed, 17 insertions(+), 64 deletions(-) diff --git a/dockers/docker-sflow/Dockerfile.j2 b/dockers/docker-sflow/Dockerfile.j2 index e8aee5fe6bed..a5eebf3a0959 100644 --- a/dockers/docker-sflow/Dockerfile.j2 +++ b/dockers/docker-sflow/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-swss-layer-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -f -y \ dmidecode \ - libmnl0=1.0.4-3 + libmnl0 {% if docker_sflow_debs.strip() -%} # Copy locally-built Debian package dependencies diff --git a/rules/docker-sflow.mk b/rules/docker-sflow.mk index 3acd3c5dc86f..ece35f5cb8d0 100644 --- a/rules/docker-sflow.mk +++ b/rules/docker-sflow.mk @@ -7,12 +7,12 @@ DOCKER_SFLOW_DBG = $(DOCKER_SFLOW_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_SFLOW)_PATH = $(DOCKERS_PATH)/$(DOCKER_SFLOW_STEM) $(DOCKER_SFLOW)_DEPENDS += $(SWSS) $(HSFLOWD) $(SFLOWTOOL) $(PSAMPLE) -$(DOCKER_SFLOW)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS) +$(DOCKER_SFLOW)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_DEPENDS) $(DOCKER_SFLOW)_DBG_DEPENDS += $(HSFLOWD_DBG) $(DOCKER_TEAMD)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) -$(DOCKER_SFLOW)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES) +$(DOCKER_SFLOW)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_IMAGE_PACKAGES) -$(DOCKER_SFLOW)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE) +$(DOCKER_SFLOW)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BOOKWORM) $(DOCKER_SFLOW)_VERSION = 1.0.0 $(DOCKER_SFLOW)_PACKAGE_NAME = sflow @@ -39,5 +39,5 @@ $(DOCKER_SFLOW)_BASE_IMAGE_FILES += psample:/usr/bin/psample $(DOCKER_SFLOW)_BASE_IMAGE_FILES += sflowtool:/usr/bin/sflowtool $(DOCKER_SFLOW)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) -SONIC_BULLSEYE_DOCKERS += $(DOCKER_SFLOW) -SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_SFLOW_DBG) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_SFLOW) +SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_SFLOW_DBG) diff --git a/rules/sflow.mk b/rules/sflow.mk index a7dc205aca2c..949b82289a8c 100644 --- a/rules/sflow.mk +++ b/rules/sflow.mk @@ -11,7 +11,7 @@ $(HSFLOWD)_SRC_PATH = $(SRC_PATH)/sflow/hsflowd SONIC_MAKE_DEBS += $(HSFLOWD) -HSFLOWD_DBG = hsflowd-dbg_$(HSFLOWD_VERSION)-$(HSFLOWD_SUBVERSION)_$(CONFIGURED_ARCH).deb +HSFLOWD_DBG = hsflowd-dbgsym_$(HSFLOWD_VERSION)-$(HSFLOWD_SUBVERSION)_$(CONFIGURED_ARCH).deb $(HSFLOWD_DBG)_DEPENDS += $(HSFLOWD) $(HSFLOWD_DBG)_RDEPENDS += $(HSFLOWD) $(eval $(call add_derived_package,$(HSFLOWD),$(HSFLOWD_DBG))) diff --git a/src/sflow/hsflowd/Makefile b/src/sflow/hsflowd/Makefile index 5a9bf6047391..23ed8801253c 100644 --- a/src/sflow/hsflowd/Makefile +++ b/src/sflow/hsflowd/Makefile @@ -22,12 +22,12 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : sed -i -e s/_VERSION_/$(HSFLOWD_VERSION)-$(HSFLOWD_SUBVERSION)/g debian/changelog ifeq ($(CROSS_BUILD_ENVIRON), y) - dpkg-buildpackage -rfakeroot -b -us -uc -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) --buildinfo-option=-u. --changes-option=-u. + dpkg-buildpackage -rfakeroot -b -us -uc -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) else - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) --buildinfo-option=-u. --changes-option=-u. + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) endif + popd mv $(DERIVED_TARGET) $* $(DEST)/ - popd $(addprefix $(DEST)/, $(DERIVED_TARGET)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) diff --git a/src/sflow/hsflowd/patch/0002-host_sflow_debian.patch b/src/sflow/hsflowd/patch/0002-host_sflow_debian.patch index f1977ccb00b2..518a75ff7a3e 100644 --- a/src/sflow/hsflowd/patch/0002-host_sflow_debian.patch +++ b/src/sflow/hsflowd/patch/0002-host_sflow_debian.patch @@ -12,11 +12,11 @@ diff -ruN a/DEBIAN_build/compat b/DEBIAN_build/compat --- a/DEBIAN_build/compat 1969-12-31 19:00:00.000000000 -0500 +++ b/DEBIAN_build/compat 2019-08-16 23:28:58.020938096 -0400 @@ -0,0 +1 @@ -+9 ++13 diff -ruN a/DEBIAN_build/control b/DEBIAN_build/control --- a/DEBIAN_build/control 2019-08-16 05:11:33.974949327 -0400 +++ b/DEBIAN_build/control 2019-08-19 21:28:07.155722725 -0400 -@@ -1,9 +1,22 @@ +@@ -1,9 +1,15 @@ -Package: _PACKAGE_ -Version: _VERSION_ -Section: admin @@ -37,17 +37,10 @@ diff -ruN a/DEBIAN_build/control b/DEBIAN_build/control -Maintainer: Neil McKee [neil.mckee@inmon.com] Description: sFlow(R) monitoring agent Homepage: sflow.net -+ -+Package: hsflowd-dbg -+Architecture: any -+Section: debug -+Priority: extra -+Depends: hsflowd -+Description: debugging symbols for hsflowd diff -ruN a/DEBIAN_build/rules b/DEBIAN_build/rules --- a/DEBIAN_build/rules 1969-12-31 19:00:00.000000000 -0500 +++ b/DEBIAN_build/rules 2019-08-19 22:20:42.998569601 -0400 -@@ -0,0 +1,31 @@ +@@ -0,0 +1,18 @@ +#!/usr/bin/make -f + +# See debhelper(7) (uncomment to enable) @@ -59,50 +52,10 @@ diff -ruN a/DEBIAN_build/rules b/DEBIAN_build/rules +include /usr/share/dpkg/default.mk + +%: -+ dh $@ -+ -+binary: -+ dh_gencontrol -+ dh_strip -phsflowd --dbg-package=hsflowd-dbg -+ dpkg-deb --build debian/hsflowd-dbg hsflowd-dbg_$(HSFLOWD_VERSION)-$(HSFLOWD_SUBVERSION)_$(CONFIGURED_ARCH).deb -+ dpkg-deb --build debian/hsflowd hsflowd_$(HSFLOWD_VERSION)-$(HSFLOWD_SUBVERSION)_$(CONFIGURED_ARCH).deb ++ dh $@ --no-parallel + +override_dh_auto_build: -+ make sonic-deb FEATURES="SONIC" CC=$(CC) CXX=$(CXX) LD=$(CC) -+ -+override_dh_auto_configure: ++ dh_auto_build -- hsflowd MYARCH=$(shell uname -m | sed 's/x86_64/amd64/') FEATURES="SONIC" + +override_dh_auto_install: -+ -+override_dh_auto_test: -+ -+override_dh_auto_clean: -+ -+override_dh_clean: -diff -ruN a/Makefile b/Makefile ---- a/Makefile 2019-08-16 21:34:25.167679297 -0400 -+++ b/Makefile 2019-08-19 22:20:23.758479002 -0400 -@@ -146,6 +146,23 @@ - cd ..; \ - dpkg-deb --build debian hsflowd_$${MYVER}-$${MYREL}_$$MYARCH.deb - -+sonic-deb: $(PROG) -+ MYARCH=`uname -m|sed 's/x86_64/amd64/'`; \ -+ MYVER=`./getVersion`; \ -+ MYREL=`./getRelease`; \ -+ PLATFORM=`uname`; \ -+ mkdir -p debian/usr/sbin; \ -+ mkdir -p debian/etc/init.d; \ -+ mkdir -p debian/etc/hsflowd/modules; \ -+ mkdir -p debian/lib/systemd/system; \ -+ mkdir -p debian/etc/dbus-1/system.d; \ -+ cd src/$$PLATFORM; $(MAKE) VERSION=$$MYVER RELEASE=$$MYREL INSTROOT="../../debian/hsflowd" install; cd ../..; \ -+ pwd; \ -+ cd debian/hsflowd; \ -+ find . -type d | xargs chmod 755; \ -+ md5sum `find usr etc -type f` > md5sums; \ -+ cd ../..; -+ - xenserver: xenrpm - cd xenserver-ddk; $(MAKE) clean; $(MAKE) - ++ dh_auto_install -- INSTROOT="$(PWD)/debian/hsflowd/" FEATURES="SONIC" From c2e249a9ce488ea3ca1183cf76bef4d13a37ef53 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 12 May 2024 19:00:47 +0800 Subject: [PATCH 089/282] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#18943) #### Why I did it src/sonic-swss-common ``` * 0044540 - (HEAD -> master, origin/master, origin/HEAD) Add new tables for Event and Alarms. (#852) (20 hours ago) [bhaveshdell] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 4b23970a0bc3..00445404fff6 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 4b23970a0bc30ef66ff6825182a29886d9b253a6 +Subproject commit 00445404fff6d3673464e2a5defca1dc97ab3a43 From 3c1e31bfc2fb916066de2148cc821d72c088b1ed Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Mon, 13 May 2024 13:54:33 +0800 Subject: [PATCH 090/282] [bgp] Add support to explicitly specify bgp router id for single asice device (#18727) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HLD: sonic-net/SONiC#1643 Add support to explictly specify bgp router id for single asic device Microsoft ADO (number only): 27674485 How I did it 1. When bgp_router_id configured in DEVICE_METADATA, use it as bgp router-id. 2. Remove the hard dependency on loopback0 ipv4 address when adding bgp peer. 3. Add UTs. Behavior of set bgp router-id To be clarified that when bgp router-id hasn't been explicitly set, bgp actions would totally like previous Loopback0 IPv4 address exists Loopback0 IPv4 address doesn't exist bgp_router_id configured Honor bgp_router_id Honor bgp_router_id bgp_router_id not confgd Honor Loopback0 IPv4 address FRR default router ID value is selected as the largest IP address of the device. When router zebra is not enabled bgpd can’t get interface information, so router-id is set to 0.0.0.0 Behavior of add bgp peer To be clarified that when bgp router-id hasn't been explicitly set, bgp actions would totally like previous Loopback0 IPv4 address exists Loopback0 IPv4 address doesn't exist bgp_router_id configured Add BGP peer Add BGP peer bgp_router_id not configured Add BGP peer Do not add BGP peer --- .../docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 | 15 +++- .../templates/monitors/peer-group.conf.j2 | 2 +- src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py | 10 ++- .../param_without_lo0_ipv4.json | 7 ++ .../result_without_lo0_ipv4.conf | 15 ++++ .../bgpd.main.conf.j2/defaults_router_id.conf | 80 +++++++++++++++++++ .../bgpd.main.conf.j2/defaults_router_id.json | 36 +++++++++ .../bgpd.main.conf.j2/lo0_ipv6_only.conf | 75 +++++++++++++++++ .../bgpd.main.conf.j2/lo0_ipv6_only.json | 37 +++++++++ .../lo0_ipv6_only_router_id.conf | 77 ++++++++++++++++++ .../lo0_ipv6_only_router_id.json | 35 ++++++++ src/sonic-bgpcfgd/tests/test_bgp.py | 28 ++++++- src/sonic-bgpcfgd/tests/test_sonic-cfggen.py | 19 +++++ 13 files changed, 425 insertions(+), 11 deletions(-) create mode 100644 src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_without_lo0_ipv4.json create mode 100644 src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/result_without_lo0_ipv4.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults_router_id.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults_router_id.json create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only.json create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only_router_id.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only_router_id.json diff --git a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 index 793ab055c215..1ea4c8ac612c 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 @@ -8,7 +8,10 @@ ! ! TSA configuration ! -ip prefix-list PL_LoopbackV4 permit {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip }}/32 +{% set lo0_ipv4 = get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip %} +{% if lo0_ipv4 is not none %} +ip prefix-list PL_LoopbackV4 permit {{ lo0_ipv4 }}/32 +{% endif %} ! {% if get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback0") != 'None' %} {% if ( ('localhost' in DEVICE_METADATA) and ('bgp_adv_lo_prefix_as_128' in DEVICE_METADATA['localhost']) and @@ -88,11 +91,17 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' or DEVICE_METADATA['localhost']['switch_type'] == 'voq' or DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %} bgp router-id {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback4096") | ip }} {% else %} - bgp router-id {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip }} +{% if "localhost" in DEVICE_METADATA and "bgp_router_id" in DEVICE_METADATA["localhost"] %} + bgp router-id {{ DEVICE_METADATA["localhost"]["bgp_router_id"] }} +{% elif lo0_ipv4 is not none%} + bgp router-id {{ lo0_ipv4 }} +{% endif %} {% endif %} ! {# advertise loopback #} - network {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip }}/32 +{% if lo0_ipv4 is not none %} + network {{ lo0_ipv4 }}/32 +{% endif %} {% if ((multi_asic is defined and DEVICE_METADATA['localhost']['switch_type'] != 'chassis-packet') or (DEVICE_METADATA['localhost']['switch_type'] == 'voq')) %} network {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback4096") | ip }}/32 route-map HIDE_INTERNAL {% endif %} diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/monitors/peer-group.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/monitors/peer-group.conf.j2 index 08df8adf755a..45c60b817888 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/monitors/peer-group.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/monitors/peer-group.conf.j2 @@ -4,7 +4,7 @@ neighbor BGPMON peer-group {% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'SpineRouter' %} neighbor BGPMON update-source Loopback4096 -{% else %} +{% elif loopback0_ipv4 %} neighbor BGPMON update-source {{ loopback0_ipv4 | ip }} {% endif %} diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py index f0f23d3c4a27..347270f94a50 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py @@ -106,7 +106,6 @@ def __init__(self, common_objs, db_name, table_name, peer_type, check_neig_meta) deps = [ ("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"), - ("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0"), ("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"), ("LOCAL", "local_addresses", ""), ("LOCAL", "interfaces", ""), @@ -168,9 +167,11 @@ def add_peer(self, vrf, nbr, data): bgp_asn = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]["bgp_asn"] # lo0_ipv4 = self.get_lo_ipv4("Loopback0|") - if lo0_ipv4 is None: - log_warn("Loopback0 ipv4 address is not presented yet") + if (lo0_ipv4 is None and "bgp_router_id" + not in self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]): + log_warn("Loopback0 ipv4 address is not presented yet and bgp_router_id not configured") return False + # if self.peer_type == 'internal': lo4096_ipv4 = self.get_lo_ipv4("Loopback4096|") @@ -203,10 +204,11 @@ def add_peer(self, vrf, nbr, data): 'vrf': vrf, 'neighbor_addr': nbr, 'bgp_session': data, - 'loopback0_ipv4': lo0_ipv4, 'CONFIG_DB__LOOPBACK_INTERFACE':{ tuple(key.split('|')) : {} for key in self.directory.get_slot("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME) if '|' in key } } + if lo0_ipv4 is not None: + kwargs['loopback0_ipv4'] = lo0_ipv4 if self.check_neig_meta: neigmeta = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_NEIGHBOR_METADATA_TABLE_NAME) if 'name' in data and data["name"] not in neigmeta: diff --git a/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_without_lo0_ipv4.json b/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_without_lo0_ipv4.json new file mode 100644 index 000000000000..da9a5c3db38c --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/param_without_lo0_ipv4.json @@ -0,0 +1,7 @@ +{ + "CONFIG_DB__DEVICE_METADATA": { + "localhost": { + "type": "LeafRouter" + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/result_without_lo0_ipv4.conf b/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/result_without_lo0_ipv4.conf new file mode 100644 index 000000000000..ff6f981252cb --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/monitors/peer-group.conf/result_without_lo0_ipv4.conf @@ -0,0 +1,15 @@ +! +! template: bgpd/templates/BGPMON/peer-group.conf.j2 +! + neighbor BGPMON peer-group + address-family ipv4 + neighbor BGPMON activate + neighbor BGPMON route-map FROM_BGPMON in + neighbor BGPMON route-map TO_BGPMON out + neighbor BGPMON send-community + neighbor BGPMON maximum-prefix 1 + exit-address-family +! +! end of template: bgpd/templates/BGPMON/peer-group.conf.j2 +! + diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults_router_id.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults_router_id.conf new file mode 100644 index 000000000000..96a30d0ab5df --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults_router_id.conf @@ -0,0 +1,80 @@ +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 +! +ipv6 prefix-list PL_LoopbackV6 permit fc00::/64 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.10.10.0/24 +! +ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit fc01::/64 +! +ip prefix-list V4_P2P_IP permit 0.0.0.0/0 ge 31 le 31 +! +ipv6 prefix-list V6_P2P_IP permit ::/0 ge 126 le 126 +! +route-map V4_CONNECTED_ROUTES permit 10 + match ip address prefix-list V4_P2P_IP + call HIDE_INTERNAL +! +route-map V6_CONNECTED_ROUTES permit 10 + match ipv6 address prefix-list V6_P2P_IP + call HIDE_INTERNAL +! +route-map HIDE_INTERNAL permit 10 + set community no-export +! +! +router bgp 55555 +! + bgp log-neighbor-changes + bgp suppress-fib-pending + no bgp default ipv4-unicast + no bgp ebgp-requires-policy +! + bgp bestpath as-path multipath-relax +! + bgp graceful-restart restart-time 240 + bgp graceful-restart + bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 +! + bgp router-id 8.8.8.8 +! + network 55.55.55.55/32 + network 55.55.55.56/32 route-map HIDE_INTERNAL +! + address-family ipv6 + network fc00::1/64 + exit-address-family + address-family ipv6 + network fc00::2/128 route-map HIDE_INTERNAL + exit-address-family +! + network 10.10.10.1/24 + address-family ipv6 + network fc01::1/64 + exit-address-family +! + address-family ipv4 + redistribute connected route-map V4_CONNECTED_ROUTES + exit-address-family + address-family ipv6 + redistribute connected route-map V6_CONNECTED_ROUTES + exit-address-family +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults_router_id.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults_router_id.json new file mode 100644 index 000000000000..1074ae707a49 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults_router_id.json @@ -0,0 +1,36 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "bgp_asn": "55555", + "sub_role": "FrontEnd", + "type": "ToRRouter", + "bgp_router_id": "8.8.8.8" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback0|55.55.55.55/32": {}, + "Loopback0|fc00::1/128": {}, + "Loopback4096|55.55.55.56/32": {}, + "Loopback4096|fc00::2/128": {} + }, + "VLAN_INTERFACE": { + "Vlan10|10.10.10.1/24": {}, + "Vlan10|fc01::1/64": {}, + "Vlan20": {"vnet_name": "Vnet1"}, + "Vlan20|20.20.20.1/24": {}, + "Vlan20|fd01::1/64": {} + }, + "constants": { + "bgp": { + "multipath_relax": { + "enabled": true + }, + "graceful_restart": { + "enabled": true + }, + "maximum_paths": { + "enabled": true + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only.conf new file mode 100644 index 000000000000..b181dbd5e430 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only.conf @@ -0,0 +1,75 @@ +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ipv6 prefix-list PL_LoopbackV6 permit fc00::/64 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.10.10.0/24 +! +ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit fc01::/64 +! +ip prefix-list V4_P2P_IP permit 0.0.0.0/0 ge 31 le 31 +! +ipv6 prefix-list V6_P2P_IP permit ::/0 ge 126 le 126 +! +route-map V4_CONNECTED_ROUTES permit 10 + match ip address prefix-list V4_P2P_IP + call HIDE_INTERNAL +! +route-map V6_CONNECTED_ROUTES permit 10 + match ipv6 address prefix-list V6_P2P_IP + call HIDE_INTERNAL +! +route-map HIDE_INTERNAL permit 10 + set community no-export +! +! +router bgp 55555 +! + bgp log-neighbor-changes + bgp suppress-fib-pending + no bgp default ipv4-unicast + no bgp ebgp-requires-policy +! + bgp bestpath as-path multipath-relax +! + bgp graceful-restart restart-time 480 + bgp graceful-restart + bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 +! + network 55.55.55.56/32 route-map HIDE_INTERNAL +! + address-family ipv6 + network fc00::1/64 + exit-address-family + address-family ipv6 + network fc00::2/128 route-map HIDE_INTERNAL + exit-address-family +! + network 10.10.10.1/24 + address-family ipv6 + network fc01::1/64 + exit-address-family +! + address-family ipv4 + redistribute connected route-map V4_CONNECTED_ROUTES + exit-address-family + address-family ipv6 + redistribute connected route-map V6_CONNECTED_ROUTES + exit-address-family +! + address-family ipv4 + maximum-paths 32 + exit-address-family + address-family ipv6 + maximum-paths 32 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only.json new file mode 100644 index 000000000000..3378029bdc1f --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only.json @@ -0,0 +1,37 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "bgp_asn": "55555", + "sub_role": "FrontEnd", + "type": "ToRRouter" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback0|fc00::1/128": {}, + "Loopback4096|55.55.55.56/32": {}, + "Loopback4096|fc00::2/128": {} + }, + "VLAN_INTERFACE": { + "Vlan10|10.10.10.1/24": {}, + "Vlan10|fc01::1/64": {}, + "Vlan20": {"vnet_name": "Vnet1"}, + "Vlan20|20.20.20.1/24": {}, + "Vlan20|fd01::1/64": {} + }, + "constants": { + "bgp": { + "multipath_relax": { + "enabled": true + }, + "graceful_restart": { + "enabled": true, + "restart_time": 480 + }, + "maximum_paths": { + "enabled": true, + "ipv4": 32, + "ipv6": 32 + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only_router_id.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only_router_id.conf new file mode 100644 index 000000000000..c41fa0cfedc9 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only_router_id.conf @@ -0,0 +1,77 @@ +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ipv6 prefix-list PL_LoopbackV6 permit fc00::/64 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.10.10.0/24 +! +ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit fc01::/64 +! +ip prefix-list V4_P2P_IP permit 0.0.0.0/0 ge 31 le 31 +! +ipv6 prefix-list V6_P2P_IP permit ::/0 ge 126 le 126 +! +route-map V4_CONNECTED_ROUTES permit 10 + match ip address prefix-list V4_P2P_IP + call HIDE_INTERNAL +! +route-map V6_CONNECTED_ROUTES permit 10 + match ipv6 address prefix-list V6_P2P_IP + call HIDE_INTERNAL +! +route-map HIDE_INTERNAL permit 10 + set community no-export +! +! +router bgp 55555 +! + bgp log-neighbor-changes + bgp suppress-fib-pending + no bgp default ipv4-unicast + no bgp ebgp-requires-policy +! + bgp bestpath as-path multipath-relax +! + bgp graceful-restart restart-time 240 + bgp graceful-restart + bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 +! + bgp router-id 8.8.8.8 +! + network 55.55.55.56/32 route-map HIDE_INTERNAL +! + address-family ipv6 + network fc00::1/64 + exit-address-family + address-family ipv6 + network fc00::2/128 route-map HIDE_INTERNAL + exit-address-family +! + network 10.10.10.1/24 + address-family ipv6 + network fc01::1/64 + exit-address-family +! + address-family ipv4 + redistribute connected route-map V4_CONNECTED_ROUTES + exit-address-family + address-family ipv6 + redistribute connected route-map V6_CONNECTED_ROUTES + exit-address-family +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only_router_id.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only_router_id.json new file mode 100644 index 000000000000..b400740e3b49 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/lo0_ipv6_only_router_id.json @@ -0,0 +1,35 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "bgp_asn": "55555", + "sub_role": "FrontEnd", + "type": "ToRRouter", + "bgp_router_id": "8.8.8.8" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback0|fc00::1/128": {}, + "Loopback4096|55.55.55.56/32": {}, + "Loopback4096|fc00::2/128": {} + }, + "VLAN_INTERFACE": { + "Vlan10|10.10.10.1/24": {}, + "Vlan10|fc01::1/64": {}, + "Vlan20": {"vnet_name": "Vnet1"}, + "Vlan20|20.20.20.1/24": {}, + "Vlan20|fd01::1/64": {} + }, + "constants": { + "bgp": { + "multipath_relax": { + "enabled": true + }, + "graceful_restart": { + "enabled": true + }, + "maximum_paths": { + "enabled": true + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/test_bgp.py b/src/sonic-bgpcfgd/tests/test_bgp.py index bd6f34c4b660..6add8eaf09ed 100644 --- a/src/sonic-bgpcfgd/tests/test_bgp.py +++ b/src/sonic-bgpcfgd/tests/test_bgp.py @@ -21,7 +21,7 @@ def load_constant_files(): return constant_files -def constructor(constants_path): +def constructor(constants_path, with_lo0_ipv4=True, bgp_router_id=""): cfg_mgr = MagicMock() constants = load_constants(constants_path)['constants'] common_objs = { @@ -41,8 +41,12 @@ def constructor(constants_path): assert m.peer_type == "general" assert m.check_neig_meta == ('bgp' in constants and 'use_neighbors_meta' in constants['bgp'] and constants['bgp']['use_neighbors_meta']) - m.directory.put("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost", {"bgp_asn": "65100"}) - m.directory.put("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0|11.11.11.11/32", {}) + localhost_obj = {"bgp_asn": "65100"} + if len(bgp_router_id) != 0: + localhost_obj["bgp_router_id"] = bgp_router_id + m.directory.put("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost", localhost_obj) + if with_lo0_ipv4: + m.directory.put("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0|11.11.11.11/32", {}) m.directory.put("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0|FC00:1::32/128", {}) m.directory.put("LOCAL", "local_addresses", "30.30.30.30", {"interface": "Ethernet4|30.30.30.30/24"}) m.directory.put("LOCAL", "local_addresses", "fc00:20::20", {"interface": "Ethernet8|fc00:20::20/96"}) @@ -100,6 +104,24 @@ def test_add_peer(): res = m.set_handler("30.30.30.1", {'asn': '65200', 'holdtime': '180', 'keepalive': '60', 'local_addr': '30.30.30.30', 'name': 'TOR', 'nhopself': '0', 'rrclient': '0'}) assert res, "Expect True return value" +def test_add_peer_router_id(): + for constant in load_constant_files(): + m = constructor(constant, bgp_router_id="8.8.8.8") + res = m.set_handler("30.30.30.1", {'asn': '65200', 'holdtime': '180', 'keepalive': '60', 'local_addr': '30.30.30.30', 'name': 'TOR', 'nhopself': '0', 'rrclient': '0'}) + assert res, "Expect True return value" + +def test_add_peer_without_lo_ipv4(): + for constant in load_constant_files(): + m = constructor(constant, with_lo0_ipv4=False) + res = m.set_handler("30.30.30.1", {'asn': '65200', 'holdtime': '180', 'keepalive': '60', 'local_addr': '30.30.30.30', 'name': 'TOR', 'nhopself': '0', 'rrclient': '0'}) + assert not res, "Expect False return value" + +def test_add_peer_without_lo_ipv4_router_id(): + for constant in load_constant_files(): + m = constructor(constant, with_lo0_ipv4=False, bgp_router_id="8.8.8.8") + res = m.set_handler("30.30.30.1", {'asn': '65200', 'holdtime': '180', 'keepalive': '60', 'local_addr': '30.30.30.30', 'name': 'TOR', 'nhopself': '0', 'rrclient': '0'}) + assert res, "Expect True return value" + def test_add_peer_ipv6(): for constant in load_constant_files(): m = constructor(constant) diff --git a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py index d18bbd058c90..d230197b710c 100644 --- a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py +++ b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py @@ -152,3 +152,22 @@ def test_bgp_conf_all(): "bgpd/bgpd.conf.j2", "bgpd.conf.j2/all.json", "bgpd.conf.j2/all.conf") + +def test_bgpd_main_conf_lo0_ipv6_only(): + run_test("Base bgpd.main.conf.j2", + "bgpd/bgpd.main.conf.j2", + "bgpd.main.conf.j2/lo0_ipv6_only.json", + "bgpd.main.conf.j2/lo0_ipv6_only.conf") + +def test_bgpd_main_conf_lo0_ipv6_only_router_id(): + run_test("Base bgpd.main.conf.j2", + "bgpd/bgpd.main.conf.j2", + "bgpd.main.conf.j2/lo0_ipv6_only_router_id.json", + "bgpd.main.conf.j2/lo0_ipv6_only_router_id.conf") + +def test_bgpd_main_conf_defaults_router_id(): + run_test("Defaults bgpd.main.conf.j2", + "bgpd/bgpd.main.conf.j2", + "bgpd.main.conf.j2/defaults_router_id.json", + "bgpd.main.conf.j2/defaults_router_id.conf") + \ No newline at end of file From 050c764de3b6c1336d6f19c3a4076b5c9797dd2c Mon Sep 17 00:00:00 2001 From: wumiao_nokia Date: Mon, 13 May 2024 01:58:51 -0400 Subject: [PATCH 091/282] Clear FABRIC_PORT_TABLE when swss is got down (#18611) Why I did it fix #18554 Issue 18554(#18554) describes an issue of that when stopping swss services on SFMs, the related fabric reachability information do not get remove from the database. It's found that corresponding fabric port status information is in STATE_DB with key FABRIC_PORT_TABLE|PORTxxx. How I did it Add clean table action for FABRIC_PORT_TABLE in STATE_DB when swss service is down. How to verify it Made changes and loaded the changes into chassis. Run "show fabric reachability -n asic7" to see the fabric ports. Also checked STATE_DB by using "sonic-db-cli -n asic7 STATE_DB hgetall "FABRIC_PORT_TABLE|PORT112" where port 112 is connected and up. Issue "sudo systemctl stop swss@7". Check "show fabric reachability -n asic7". It's empty now. Issue "sudo systemctl start swss@7" or "docker start swss7". Wait for 1 minutes. Run "show fabric reachability -n asic7", all connected port are displayed there. Also checked STATE_DB and all entries with key FABRIC_PORT_TABLE|PORTxxx are correct. Issue "docker kill swss7". Repeat testing steps in 1). It works as exepcted. Enter container swss7. Run "kill 35" where 35 is task id for orchagent. Watched container swss7 is stopped and then restarted. Watched the "Cleared FABRIC_PORT_TABLE from STATE_DB for swss7" log showed up after container is stopped. --- files/scripts/swss.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index 0d73663b7707..cb51c0bb0021 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -310,7 +310,7 @@ start() { $SONIC_DB_CLI GB_ASIC_DB FLUSHDB $SONIC_DB_CLI GB_COUNTERS_DB FLUSHDB $SONIC_DB_CLI RESTAPI_DB FLUSHDB - clean_up_tables STATE_DB "'PORT_TABLE*', 'MGMT_PORT_TABLE*', 'VLAN_TABLE*', 'VLAN_MEMBER_TABLE*', 'LAG_TABLE*', 'LAG_MEMBER_TABLE*', 'INTERFACE_TABLE*', 'MIRROR_SESSION*', 'VRF_TABLE*', 'FDB_TABLE*', 'FG_ROUTE_TABLE*', 'BUFFER_POOL*', 'BUFFER_PROFILE*', 'MUX_CABLE_TABLE*', 'ADVERTISE_NETWORK_TABLE*', 'VXLAN_TUNNEL_TABLE*', 'VNET_ROUTE*', 'MACSEC_PORT_TABLE*', 'MACSEC_INGRESS_SA_TABLE*', 'MACSEC_EGRESS_SA_TABLE*', 'MACSEC_INGRESS_SC_TABLE*', 'MACSEC_EGRESS_SC_TABLE*', 'VRF_OBJECT_TABLE*', 'VNET_MONITOR_TABLE*', 'BFD_SESSION_TABLE*','SYSTEM_NEIGH_TABLE*'" + clean_up_tables STATE_DB "'PORT_TABLE*', 'MGMT_PORT_TABLE*', 'VLAN_TABLE*', 'VLAN_MEMBER_TABLE*', 'LAG_TABLE*', 'LAG_MEMBER_TABLE*', 'INTERFACE_TABLE*', 'MIRROR_SESSION*', 'VRF_TABLE*', 'FDB_TABLE*', 'FG_ROUTE_TABLE*', 'BUFFER_POOL*', 'BUFFER_PROFILE*', 'MUX_CABLE_TABLE*', 'ADVERTISE_NETWORK_TABLE*', 'VXLAN_TUNNEL_TABLE*', 'VNET_ROUTE*', 'MACSEC_PORT_TABLE*', 'MACSEC_INGRESS_SA_TABLE*', 'MACSEC_EGRESS_SA_TABLE*', 'MACSEC_INGRESS_SC_TABLE*', 'MACSEC_EGRESS_SC_TABLE*', 'VRF_OBJECT_TABLE*', 'VNET_MONITOR_TABLE*', 'BFD_SESSION_TABLE*', 'SYSTEM_NEIGH_TABLE*', 'FABRIC_PORT_TABLE*'" $SONIC_DB_CLI APPL_STATE_DB FLUSHDB clean_up_chassis_db_tables rm -rf /tmp/cache @@ -412,7 +412,9 @@ stop() { /usr/bin/${SERVICE}.sh stop $DEV debug "Stopped ${SERVICE}$DEV service..." $SONIC_DB_CLI APPL_DB DEL PORT_TABLE:PortInitDone - debug "Cleared PortInitDone from APPL_DB..." + debug "Cleared PortInitDone from APPL_DB for ${SERVICE}$DEV..." + clean_up_tables STATE_DB "'FABRIC_PORT_TABLE*'" + debug "Cleared FABRIC_PORT_TABLE from STATE_DB for ${SERVICE}$DEV..." else debug "Killing Docker swss..." /usr/bin/docker kill swss &> /dev/null || debug "Docker swss is not running ($?) ..." From c01f03164456b638b2bfa11521eedaa2feefd855 Mon Sep 17 00:00:00 2001 From: Mai Bui Date: Mon, 13 May 2024 02:10:15 -0400 Subject: [PATCH 092/282] [iccpd]: Add boundary check before memset, memcpy, strncpy (#18270) Add boundary check before memset, memcpy, strncpy calls to prevent buffer overflow Microsoft ADO (number only): 27008041 Signed-off-by: Mai Bui --- src/iccpd/src/iccp_cli.c | 22 +++++++++++++++++++++- src/iccpd/src/iccp_cmd.c | 4 ++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/iccpd/src/iccp_cli.c b/src/iccpd/src/iccp_cli.c index 59235215bffb..54b1e890762e 100644 --- a/src/iccpd/src/iccp_cli.c +++ b/src/iccpd/src/iccp_cli.c @@ -117,7 +117,12 @@ int set_peer_link(int mid, const char* ifname) csm->mlag_id, ifname); } - memset(csm->peer_itf_name, 0, MAX_L_PORT_NAME); + memset(csm->peer_itf_name, 0, IFNAMSIZ); + if (len > IFNAMSIZ) + { + ICCPD_LOG_ERR(__FUNCTION__, "len=%d greater than IFNAMESIZ=%d", len, IFNAMSIZ); + return MCLAG_ERROR; + } memcpy(csm->peer_itf_name, ifname, len); /* update peer-link link handler*/ @@ -208,8 +213,18 @@ int set_local_address(int mid, const char* addr) len = strlen(addr); memset(csm->sender_ip, 0, INET_ADDRSTRLEN); + if (len > INET_ADDRSTRLEN) + { + ICCPD_LOG_ERR(__FUNCTION__, "len=%d greater than INET_ADDRSTRLEN=%d ", len, INET_ADDRSTRLEN); + return MCLAG_ERROR; + } memcpy(csm->sender_ip, addr, len); memset(csm->iccp_info.sender_name, 0, INET_ADDRSTRLEN); + if (len > INET_ADDRSTRLEN) + { + ICCPD_LOG_ERR(__FUNCTION__, "len=%d greater than INET_ADDRSTRLEN=%d ", len, INET_ADDRSTRLEN); + return MCLAG_ERROR; + } memcpy(csm->iccp_info.sender_name, addr, len); return 0; @@ -268,6 +283,11 @@ int set_peer_address(int mid, const char* addr) } memset(csm->peer_ip, 0, INET_ADDRSTRLEN); + if (len > INET_ADDRSTRLEN) + { + ICCPD_LOG_ERR(__FUNCTION__, "len=%d greater than INET_ADDRSTRLEN=%d ", len, INET_ADDRSTRLEN); + return MCLAG_ERROR; + } memcpy(csm->peer_ip, addr, len); return 0; diff --git a/src/iccpd/src/iccp_cmd.c b/src/iccpd/src/iccp_cmd.c index 8b39b73d0f6b..134b293c0909 100644 --- a/src/iccpd/src/iccp_cmd.c +++ b/src/iccpd/src/iccp_cmd.c @@ -135,6 +135,10 @@ int iccp_config_from_command(char * line) cp++; slen = cp - start; + if (slen > strlen(token)) + { + return MCLAG_ERROR; + } strncpy(token, start, slen); *(token + slen) = '\0'; iccp_cli_attach_mclag_domain_to_port_channel(mid, token); From edc9b6ad0dd4eead3db72c9f97afe9a60ad17279 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 13 May 2024 16:01:41 +0800 Subject: [PATCH 093/282] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#18900) #### Why I did it src/sonic-host-services ``` * aa84129 - (HEAD -> master, origin/master, origin/HEAD) Updated tacacs test (#123) (17 hours ago) [ycoheNvidia] * 9e6404c - Add LDAP feature support (#80) (6 days ago) [davidpil2002] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index e93494c9c3b1..aa841298691d 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit e93494c9c3b1fc49f998fcdc1daf7b02af8c9aba +Subproject commit aa841298691dffd1ac0b527eb784928c08547cc2 From 1414156546bfd1ccbefa449d66be7b9a44717718 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 13 May 2024 16:01:47 +0800 Subject: [PATCH 094/282] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#18899) #### Why I did it src/sonic-gnmi ``` * adece7c - (HEAD -> master, origin/master, origin/HEAD) Merge pull request #234 from saiarcot895/use-latest-swsscommon (3 days ago) [Saikrishna Arcot] |\ | failure_prs.log 82c57c7 - Merge branch 'master' into use-latest-swsscommon (4 days ago) [Saikrishna Arcot] | |\ | |/ |/| * | d442e7a - Fix memory leak in unit test (#235) (4 days ago) [Hua Liu] | failure_prs.log ec15a40 - Use the latest libswsscommon artifacts from the repo (4 days ago) [Saikrishna Arcot] |/ * d16d1ca - Fix mixed_db_client ZMQ memory leak. (#232) (6 days ago) [Hua Liu] * abe3ec0 - Merge pull request #227 from liuh-80/dev/liuh/fix_zmq_memory_leak (6 days ago) [Hua Liu] * 7949eff - Fix indent issue (6 days ago) [liuh-80] * 50c6c6d - Merge remote-tracking branch 'origin' into dev/liuh/fix_zmq_memory_leak (6 days ago) [liuh-80] * 43b6fe5 - Improve code (6 days ago) [liuh-80] * 709be76 - Fix ZMQ memory leak (7 days ago) [liuh-80] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index c2bfe3d27354..adece7c46bed 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit c2bfe3d2735421b3cb84d10e84014ed8019f986b +Subproject commit adece7c46bed9b2a43ed2ea3fa325590988e95d3 From f88a12a3f69d350cf6e7acf2aa9d75abc4b3539a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 13 May 2024 19:00:55 +0800 Subject: [PATCH 095/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18942) #### Why I did it src/sonic-swss ``` * 2aaca417 - (HEAD -> master, origin/master, origin/HEAD) [VRF]Fixing vrf orch to update state_db when evpn nvo arrives late (#3140) (2 days ago) [Sudharsan Dhamal Gopalarathnam] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 198eb3d1f16f..2aaca4179423 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 198eb3d1f16f3e5746f1613b74a3debcbc2ac669 +Subproject commit 2aaca41794237cb6516866da2d0c7e29e31f44d2 From fd4c71f02bd072eba2af4d149c7653139dc9c9cf Mon Sep 17 00:00:00 2001 From: Pavan Naregundi <92989231+pavannaregundi@users.noreply.github.com> Date: Tue, 14 May 2024 03:42:33 +0530 Subject: [PATCH 096/282] [marvell-arm64] Update HWSKU files to EZBv1.06 (#18072) Easy bringup (EZB) 1.05 and 1.06 add following features: - User config support for ACL enhancements. - Range check and validation changes in yang model. Signed-off-by: Pavan Naregundi --- .../installer.conf | 2 +- .../ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.md5 | 2 +- .../ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml | 202 ++++++------------ .../ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.md5 | 2 +- .../ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.xml | 2 +- .../rd98DX35xx/ASK-PP-AC5X-RD.md5 | 2 +- .../rd98DX35xx/ASK-PP-AC5X-RD.xml | 46 ++-- .../SAI-AC5X-RD-32x1G-16x2_5G-6x25G.md5 | 2 +- .../SAI-AC5X-RD-32x1G-16x2_5G-6x25G.xml | 184 ++++++++++++++-- .../ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.md5 | 2 +- .../ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml | 202 ++++++------------ .../ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.md5 | 2 +- .../ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.xml | 2 +- .../rd98DX35xx_cn9131/ASK-PP-AC5X-RD.md5 | 2 +- .../rd98DX35xx_cn9131/ASK-PP-AC5X-RD.xml | 46 ++-- .../SAI-AC5X-RD-32x1G-16x2_5G-6x25G.md5 | 2 +- .../SAI-AC5X-RD-32x1G-16x2_5G-6x25G.xml | 184 ++++++++++++++-- 17 files changed, 541 insertions(+), 345 deletions(-) diff --git a/device/marvell/arm64-marvell_rd98DX35xx-r0/installer.conf b/device/marvell/arm64-marvell_rd98DX35xx-r0/installer.conf index b65a867509ee..d22a7b2ea73f 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx-r0/installer.conf +++ b/device/marvell/arm64-marvell_rd98DX35xx-r0/installer.conf @@ -1 +1 @@ -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="default_hugepagesz=32M hugepages=4" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="default_hugepagesz=32M hugepages=4 mem=4G" diff --git a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.md5 b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.md5 index a848fd51cd7b..0e8ad2bf7e9d 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.md5 +++ b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.md5 @@ -1 +1 @@ -7a62aaeaed876bd57c22537911fa7a4e \ No newline at end of file +266aa59b7e63faf97657313fe65cdf86 \ No newline at end of file diff --git a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml index b2d413fff6e5..fc26d290eedd 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml +++ b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml @@ -1,5 +1,5 @@ - + @@ -52,7 +52,7 @@ board-pp-interface-channel-type enumeration - Specifies interface tunnel. + Specifies channel interface type. pci PCI @@ -64,27 +64,37 @@ 1 - pex - PEX - 3 + twsi + TWSI + 2 + + + board-pp-as-type + enumeration + Specifies Address space type. - pex_eagle - PEX EAGLE - 5 + 4_regions + address-space 4 regions + 0 - pex_falcon_z - PEX FALCON Z - 6 + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 device-id-type uint32 - Device ID 0..1023 + Device ID 0..1 0 - 1023 + 1 port-mapping-type @@ -111,11 +121,9 @@ txq-port-number-type uint32 - 0 - 8 queues are configured per port (legacy mode), -1...16 - the number of queues configured per port - SIP 5 : Bobcat2,BobK:0..71 ;Bobcat3: 0..576 ;Aldrin2:0..99 + TXq port number 0 - 576 + 99 phy-smi-interface-type @@ -162,12 +170,14 @@ alaska-88E3140 - Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. Uses with FW SolarFlare next generation. + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. 5 alaska-88E3240 - Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. Uses with FW, SolarFlare next generation. + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. 6 @@ -177,7 +187,8 @@ alaska-88E3220 - Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. Uses FW, SolarFlare next generation. + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. 8 @@ -212,17 +223,20 @@ alaska-88E1780 - Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy Efficient Ethernet Transceiver + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver 15 alaska-88E2540 - Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver with IEEE 1588v2 PTP Support + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support 16 alaska-88E2580 - Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver with IEEE 1588v2 PTP Support + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support 17 @@ -510,7 +524,7 @@ uint32 serdes lane 0 - 255 + 7 cpu-type @@ -589,12 +603,12 @@ lowercase characters. sip5 - SIP5: AC5, AC3x + SIP5: AC3x 5 sip6 - SIP6: Falcon, AC5x, AC5P + SIP6: Falcon, AC5x 6 @@ -665,13 +679,35 @@ lowercase characters. 1 + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + ASIC_AC5X AC5X-RD-32x1G-16x2.5G-6x25G linux-static linux-static autoscan internal - pex_eagle + pci + atu 0 0 @@ -683,10 +719,8 @@ lowercase characters. ethernet_mac 1 - 0 false - NETWORK alaska-88E1780 0 @@ -704,10 +738,8 @@ lowercase characters. ethernet_mac 0 - 0 false - NETWORK alaska-88E1780 0 @@ -725,10 +757,8 @@ lowercase characters. ethernet_mac 3 - 0 false - NETWORK alaska-88E1780 0 @@ -746,10 +776,8 @@ lowercase characters. ethernet_mac 2 - 0 false - NETWORK alaska-88E1780 0 @@ -767,10 +795,8 @@ lowercase characters. ethernet_mac 5 - 0 false - NETWORK alaska-88E1780 0 @@ -788,10 +814,8 @@ lowercase characters. ethernet_mac 4 - 0 false - NETWORK alaska-88E1780 0 @@ -809,10 +833,8 @@ lowercase characters. ethernet_mac 7 - 0 false - NETWORK alaska-88E1780 0 @@ -830,10 +852,8 @@ lowercase characters. ethernet_mac 6 - 0 false - NETWORK alaska-88E1780 0 @@ -851,10 +871,8 @@ lowercase characters. ethernet_mac 9 - 0 false - NETWORK alaska-88E1780 1 @@ -872,10 +890,8 @@ lowercase characters. ethernet_mac 8 - 0 false - NETWORK alaska-88E1780 1 @@ -893,10 +909,8 @@ lowercase characters. ethernet_mac 11 - 0 false - NETWORK alaska-88E1780 1 @@ -914,10 +928,8 @@ lowercase characters. ethernet_mac 10 - 0 false - NETWORK alaska-88E1780 1 @@ -935,10 +947,8 @@ lowercase characters. ethernet_mac 13 - 0 false - NETWORK alaska-88E1780 1 @@ -956,10 +966,8 @@ lowercase characters. ethernet_mac 12 - 0 false - NETWORK alaska-88E1780 1 @@ -977,10 +985,8 @@ lowercase characters. ethernet_mac 15 - 0 false - NETWORK alaska-88E1780 1 @@ -998,10 +1004,8 @@ lowercase characters. ethernet_mac 14 - 0 false - NETWORK alaska-88E1780 1 @@ -1019,10 +1023,8 @@ lowercase characters. ethernet_mac 17 - 0 false - NETWORK alaska-88E1780 2 @@ -1040,10 +1042,8 @@ lowercase characters. ethernet_mac 16 - 0 false - NETWORK alaska-88E1780 2 @@ -1061,10 +1061,8 @@ lowercase characters. ethernet_mac 19 - 0 false - NETWORK alaska-88E1780 2 @@ -1082,10 +1080,8 @@ lowercase characters. ethernet_mac 18 - 0 false - NETWORK alaska-88E1780 2 @@ -1103,10 +1099,8 @@ lowercase characters. ethernet_mac 21 - 0 false - NETWORK alaska-88E1780 2 @@ -1124,10 +1118,8 @@ lowercase characters. ethernet_mac 20 - 0 false - NETWORK alaska-88E1780 2 @@ -1145,10 +1137,8 @@ lowercase characters. ethernet_mac 23 - 0 false - NETWORK alaska-88E1780 2 @@ -1166,10 +1156,8 @@ lowercase characters. ethernet_mac 22 - 0 false - NETWORK alaska-88E1780 2 @@ -1187,10 +1175,8 @@ lowercase characters. ethernet_mac 25 - 0 false - NETWORK alaska-88E1780 3 @@ -1208,10 +1194,8 @@ lowercase characters. ethernet_mac 24 - 0 false - NETWORK alaska-88E1780 3 @@ -1229,10 +1213,8 @@ lowercase characters. ethernet_mac 27 - 0 false - NETWORK alaska-88E1780 3 @@ -1250,10 +1232,8 @@ lowercase characters. ethernet_mac 26 - 0 false - NETWORK alaska-88E1780 3 @@ -1271,10 +1251,8 @@ lowercase characters. ethernet_mac 29 - 0 false - NETWORK alaska-88E1780 3 @@ -1292,10 +1270,8 @@ lowercase characters. ethernet_mac 28 - 0 false - NETWORK alaska-88E1780 3 @@ -1313,10 +1289,8 @@ lowercase characters. ethernet_mac 31 - 0 false - NETWORK alaska-88E1780 3 @@ -1334,10 +1308,8 @@ lowercase characters. ethernet_mac 30 - 0 false - NETWORK alaska-88E1780 3 @@ -1355,10 +1327,8 @@ lowercase characters. ethernet_mac 33 - 0 false - NETWORK alaska-88E2580 4 @@ -1376,10 +1346,8 @@ lowercase characters. ethernet_mac 46 - 0 false - NETWORK alaska-88E2540 6 @@ -1397,10 +1365,8 @@ lowercase characters. ethernet_mac 47 - 0 false - NETWORK alaska-88E2540 6 @@ -1418,10 +1384,8 @@ lowercase characters. ethernet_mac 44 - 0 false - NETWORK alaska-88E2540 6 @@ -1439,10 +1403,8 @@ lowercase characters. ethernet_mac 45 - 0 false - NETWORK alaska-88E2540 6 @@ -1460,10 +1422,8 @@ lowercase characters. ethernet_mac 42 - 0 false - NETWORK alaska-88E2540 5 @@ -1481,10 +1441,8 @@ lowercase characters. ethernet_mac 43 - 0 false - NETWORK alaska-88E2540 5 @@ -1502,10 +1460,8 @@ lowercase characters. ethernet_mac 40 - 0 false - NETWORK alaska-88E2540 5 @@ -1523,10 +1479,8 @@ lowercase characters. ethernet_mac 41 - 0 false - NETWORK alaska-88E2540 5 @@ -1544,10 +1498,8 @@ lowercase characters. ethernet_mac 38 - 0 false - NETWORK alaska-88E2580 4 @@ -1565,10 +1517,8 @@ lowercase characters. ethernet_mac 39 - 0 false - NETWORK alaska-88E2580 4 @@ -1586,10 +1536,8 @@ lowercase characters. ethernet_mac 36 - 0 false - NETWORK alaska-88E2580 4 @@ -1607,10 +1555,8 @@ lowercase characters. ethernet_mac 37 - 0 false - NETWORK alaska-88E2580 4 @@ -1628,10 +1574,8 @@ lowercase characters. ethernet_mac 34 - 0 false - NETWORK alaska-88E2580 4 @@ -1649,10 +1593,8 @@ lowercase characters. ethernet_mac 35 - 0 false - NETWORK alaska-88E2580 4 @@ -1670,10 +1612,8 @@ lowercase characters. ethernet_mac 32 - 0 false - NETWORK alaska-88E2580 4 @@ -1691,10 +1631,8 @@ lowercase characters. ethernet_mac 48 - 0 false - NETWORK NA @@ -1713,10 +1651,8 @@ lowercase characters. ethernet_mac 49 - 0 false - NETWORK NA @@ -1735,10 +1671,8 @@ lowercase characters. ethernet_mac 50 - 0 false - NETWORK NA @@ -1757,10 +1691,8 @@ lowercase characters. ethernet_mac 51 - 0 false - NETWORK NA @@ -1779,10 +1711,8 @@ lowercase characters. ethernet_mac 52 - 0 false - NETWORK NA @@ -1801,10 +1731,8 @@ lowercase characters. ethernet_mac 53 - 0 false - NETWORK NA @@ -1823,20 +1751,16 @@ lowercase characters. cpu_sdma 54 - 0 false - NETWORK 60 cpu_sdma 55 - 0 false - NETWORK 0 diff --git a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.md5 b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.md5 index 3a08897bfb40..f2cf3d5b688e 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.md5 +++ b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.md5 @@ -1 +1 @@ -2876aaa02a47b5842e152ce794c50110 \ No newline at end of file +85b49bcb9d399bcd1b8128a42caba2d2 \ No newline at end of file diff --git a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.xml b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.xml index 1d07f5994cae..980d4267b1bb 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.xml +++ b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.xml @@ -1,5 +1,5 @@ - + diff --git a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-PP-AC5X-RD.md5 b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-PP-AC5X-RD.md5 index de23afe95536..c043a0d7231f 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-PP-AC5X-RD.md5 +++ b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-PP-AC5X-RD.md5 @@ -1 +1 @@ -b42f2a2be9da6c7752c0807f9dee48bf \ No newline at end of file +209426f8b550ddf85db19925f9f202a1 \ No newline at end of file diff --git a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-PP-AC5X-RD.xml b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-PP-AC5X-RD.xml index ad457fe7db03..9e40492cfe8f 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-PP-AC5X-RD.xml +++ b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/ASK-PP-AC5X-RD.xml @@ -1,5 +1,5 @@ - + @@ -357,28 +357,28 @@ NATIVE NATIVE - * the trunk members are filled - * according to the order given by application. - * Regular trunk may hold max of 8 members. - * Cascade trunk may hold : - * max of 64 members +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members 0 FLEX FLEX - * A mode to allows flexibility for - * each Regular trunk to state it's max number of members (before starting to add members). - * (this mode not effect 'cascade trunk' members) - * Regular trunk may hold : max of 4K members. (each trunk set it's own limit) - * Cascade trunk may hold : max of 64 members. +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. 2 number-physical-port-type enumeration - ac5x 128, falcon 64,128,256, 512, 1024 + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 no-ports no-ports @@ -519,7 +519,28 @@ 1 + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + ASIC_AC5X AC5X-RD @@ -842,7 +863,6 @@ TCAM_ROUTER_BASED 0 - MID_L3_MID_L2_NO_EM true diff --git a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.md5 b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.md5 index bd88f03a2e86..41cd1629560b 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.md5 +++ b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.md5 @@ -1 +1 @@ -079a2fcdb8fe1d1f0cf39e3c40e6dd36 \ No newline at end of file +fec8b7884a940c38451ef84be6fdbb24 \ No newline at end of file diff --git a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.xml b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.xml index f71d485bbeab..bbedd396d2b7 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.xml +++ b/device/marvell/arm64-marvell_rd98DX35xx-r0/rd98DX35xx/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.xml @@ -1,13 +1,13 @@ - + device-id-type uint32 - Device ID 0..1023 + Device ID 0..1 0 - 1023 + 1 port-id-type @@ -22,7 +22,7 @@ Logging Feature Options SAI_LOG_SYSLOG - SYSLOG {Syslog service should be running to use this option} + SYSLOG {Syslog service should be running to use this option} 0 @@ -32,7 +32,27 @@ SAI_LOG_FILE - FILE {Warning !!! Use with caution. Can cause disk full issues} + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets 2 @@ -43,11 +63,103 @@ 2 30 + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + ASIC_AC5X ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml - - false - 0 @@ -320,7 +432,7 @@ 53 - + 8 0 0 @@ -328,19 +440,61 @@ 8 8 1024 - 0 - 0 - + 0 - - 2048 - + IN_DROP_ANY SAI_LOG_SYSLOG + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + disabled + + + disabled + + \ No newline at end of file diff --git a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.md5 b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.md5 index 433753d8f457..7b8c7b490de9 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.md5 +++ b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.md5 @@ -1 +1 @@ -95f963f02f1cb808656fcb1f008aa36a \ No newline at end of file +69af36a9007f8c9e4d33ea6465cc6b89 \ No newline at end of file diff --git a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml index 2c1bb27fba18..7fd11122c546 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml +++ b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml @@ -1,5 +1,5 @@ - + @@ -52,7 +52,7 @@ board-pp-interface-channel-type enumeration - Specifies interface tunnel. + Specifies channel interface type. pci PCI @@ -64,27 +64,37 @@ 1 - pex - PEX - 3 + twsi + TWSI + 2 + + + board-pp-as-type + enumeration + Specifies Address space type. - pex_eagle - PEX EAGLE - 5 + 4_regions + address-space 4 regions + 0 - pex_falcon_z - PEX FALCON Z - 6 + 8_regions + address-space 8 regions + 1 + + + atu + address translation unit + 2 device-id-type uint32 - Device ID 0..1023 + Device ID 0..1 0 - 1023 + 1 port-mapping-type @@ -111,11 +121,9 @@ txq-port-number-type uint32 - 0 - 8 queues are configured per port (legacy mode), -1...16 - the number of queues configured per port - SIP 5 : Bobcat2,BobK:0..71 ;Bobcat3: 0..576 ;Aldrin2:0..99 + TXq port number 0 - 576 + 99 phy-smi-interface-type @@ -162,12 +170,14 @@ alaska-88E3140 - Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. Uses with FW SolarFlare next generation. + Specifies PHY identifier 88E3140, used for Copper with speeds of 100M/1G/10G. +Uses with FW SolarFlare next generation. 5 alaska-88E3240 - Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. Uses with FW, SolarFlare next generation. + Specifies PHY identifier 88E3240, used for Copper with speeds of 100M/1G/10G. +Uses with FW, SolarFlare next generation. 6 @@ -177,7 +187,8 @@ alaska-88E3220 - Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. Uses FW, SolarFlare next generation. + Specifies PHY identifier 88E3220, used for Combo port with speeds of 100M/1G/10G. +Uses FW, SolarFlare next generation. 8 @@ -212,17 +223,20 @@ alaska-88E1780 - Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy Efficient Ethernet Transceiver + Specifies PHY identifier 88E1780, Integrated Octal 10/100/1000 Mbps Energy +Efficient Ethernet Transceiver 15 alaska-88E2540 - Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver with IEEE 1588v2 PTP Support + Specifies PHY identifier 88E2540, 4 ports 10/100/1000/2.5G/5GBASE-T Ethernet +Transceiver with IEEE 1588v2 PTP Support 16 alaska-88E2580 - Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver with IEEE 1588v2 PTP Support + Specifies PHY identifier 88E12580, Octal 10/100/1000/2.5G/5GBASE-T Ethernet Transceiver +with IEEE 1588v2 PTP Support 17 @@ -510,7 +524,7 @@ uint32 serdes lane 0 - 255 + 7 cpu-type @@ -589,12 +603,12 @@ lowercase characters. sip5 - SIP5: AC5, AC3x + SIP5: AC3x 5 sip6 - SIP6: Falcon, AC5x, AC5P + SIP6: Falcon, AC5x 6 @@ -665,13 +679,35 @@ lowercase characters. 1 + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + ASIC_AC5X AC5X-RD-32x1G-16x2.5G-6x25G linux-static linux-static autoscan external - pex_eagle + pci + atu 0 0 @@ -683,10 +719,8 @@ lowercase characters. ethernet_mac 1 - 0 false - NETWORK alaska-88E1780 0 @@ -704,10 +738,8 @@ lowercase characters. ethernet_mac 0 - 0 false - NETWORK alaska-88E1780 0 @@ -725,10 +757,8 @@ lowercase characters. ethernet_mac 3 - 0 false - NETWORK alaska-88E1780 0 @@ -746,10 +776,8 @@ lowercase characters. ethernet_mac 2 - 0 false - NETWORK alaska-88E1780 0 @@ -767,10 +795,8 @@ lowercase characters. ethernet_mac 5 - 0 false - NETWORK alaska-88E1780 0 @@ -788,10 +814,8 @@ lowercase characters. ethernet_mac 4 - 0 false - NETWORK alaska-88E1780 0 @@ -809,10 +833,8 @@ lowercase characters. ethernet_mac 7 - 0 false - NETWORK alaska-88E1780 0 @@ -830,10 +852,8 @@ lowercase characters. ethernet_mac 6 - 0 false - NETWORK alaska-88E1780 0 @@ -851,10 +871,8 @@ lowercase characters. ethernet_mac 9 - 0 false - NETWORK alaska-88E1780 1 @@ -872,10 +890,8 @@ lowercase characters. ethernet_mac 8 - 0 false - NETWORK alaska-88E1780 1 @@ -893,10 +909,8 @@ lowercase characters. ethernet_mac 11 - 0 false - NETWORK alaska-88E1780 1 @@ -914,10 +928,8 @@ lowercase characters. ethernet_mac 10 - 0 false - NETWORK alaska-88E1780 1 @@ -935,10 +947,8 @@ lowercase characters. ethernet_mac 13 - 0 false - NETWORK alaska-88E1780 1 @@ -956,10 +966,8 @@ lowercase characters. ethernet_mac 12 - 0 false - NETWORK alaska-88E1780 1 @@ -977,10 +985,8 @@ lowercase characters. ethernet_mac 15 - 0 false - NETWORK alaska-88E1780 1 @@ -998,10 +1004,8 @@ lowercase characters. ethernet_mac 14 - 0 false - NETWORK alaska-88E1780 1 @@ -1019,10 +1023,8 @@ lowercase characters. ethernet_mac 17 - 0 false - NETWORK alaska-88E1780 2 @@ -1040,10 +1042,8 @@ lowercase characters. ethernet_mac 16 - 0 false - NETWORK alaska-88E1780 2 @@ -1061,10 +1061,8 @@ lowercase characters. ethernet_mac 19 - 0 false - NETWORK alaska-88E1780 2 @@ -1082,10 +1080,8 @@ lowercase characters. ethernet_mac 18 - 0 false - NETWORK alaska-88E1780 2 @@ -1103,10 +1099,8 @@ lowercase characters. ethernet_mac 21 - 0 false - NETWORK alaska-88E1780 2 @@ -1124,10 +1118,8 @@ lowercase characters. ethernet_mac 20 - 0 false - NETWORK alaska-88E1780 2 @@ -1145,10 +1137,8 @@ lowercase characters. ethernet_mac 23 - 0 false - NETWORK alaska-88E1780 2 @@ -1166,10 +1156,8 @@ lowercase characters. ethernet_mac 22 - 0 false - NETWORK alaska-88E1780 2 @@ -1187,10 +1175,8 @@ lowercase characters. ethernet_mac 25 - 0 false - NETWORK alaska-88E1780 3 @@ -1208,10 +1194,8 @@ lowercase characters. ethernet_mac 24 - 0 false - NETWORK alaska-88E1780 3 @@ -1229,10 +1213,8 @@ lowercase characters. ethernet_mac 27 - 0 false - NETWORK alaska-88E1780 3 @@ -1250,10 +1232,8 @@ lowercase characters. ethernet_mac 26 - 0 false - NETWORK alaska-88E1780 3 @@ -1271,10 +1251,8 @@ lowercase characters. ethernet_mac 29 - 0 false - NETWORK alaska-88E1780 3 @@ -1292,10 +1270,8 @@ lowercase characters. ethernet_mac 28 - 0 false - NETWORK alaska-88E1780 3 @@ -1313,10 +1289,8 @@ lowercase characters. ethernet_mac 31 - 0 false - NETWORK alaska-88E1780 3 @@ -1334,10 +1308,8 @@ lowercase characters. ethernet_mac 30 - 0 false - NETWORK alaska-88E1780 3 @@ -1355,10 +1327,8 @@ lowercase characters. ethernet_mac 33 - 0 false - NETWORK alaska-88E2580 4 @@ -1376,10 +1346,8 @@ lowercase characters. ethernet_mac 46 - 0 false - NETWORK alaska-88E2540 6 @@ -1397,10 +1365,8 @@ lowercase characters. ethernet_mac 47 - 0 false - NETWORK alaska-88E2540 6 @@ -1418,10 +1384,8 @@ lowercase characters. ethernet_mac 44 - 0 false - NETWORK alaska-88E2540 6 @@ -1439,10 +1403,8 @@ lowercase characters. ethernet_mac 45 - 0 false - NETWORK alaska-88E2540 6 @@ -1460,10 +1422,8 @@ lowercase characters. ethernet_mac 42 - 0 false - NETWORK alaska-88E2540 5 @@ -1481,10 +1441,8 @@ lowercase characters. ethernet_mac 43 - 0 false - NETWORK alaska-88E2540 5 @@ -1502,10 +1460,8 @@ lowercase characters. ethernet_mac 40 - 0 false - NETWORK alaska-88E2540 5 @@ -1523,10 +1479,8 @@ lowercase characters. ethernet_mac 41 - 0 false - NETWORK alaska-88E2540 5 @@ -1544,10 +1498,8 @@ lowercase characters. ethernet_mac 38 - 0 false - NETWORK alaska-88E2580 4 @@ -1565,10 +1517,8 @@ lowercase characters. ethernet_mac 39 - 0 false - NETWORK alaska-88E2580 4 @@ -1586,10 +1536,8 @@ lowercase characters. ethernet_mac 36 - 0 false - NETWORK alaska-88E2580 4 @@ -1607,10 +1555,8 @@ lowercase characters. ethernet_mac 37 - 0 false - NETWORK alaska-88E2580 4 @@ -1628,10 +1574,8 @@ lowercase characters. ethernet_mac 34 - 0 false - NETWORK alaska-88E2580 4 @@ -1649,10 +1593,8 @@ lowercase characters. ethernet_mac 35 - 0 false - NETWORK alaska-88E2580 4 @@ -1670,10 +1612,8 @@ lowercase characters. ethernet_mac 32 - 0 false - NETWORK alaska-88E2580 4 @@ -1691,10 +1631,8 @@ lowercase characters. ethernet_mac 48 - 0 false - NETWORK NA @@ -1713,10 +1651,8 @@ lowercase characters. ethernet_mac 49 - 0 false - NETWORK NA @@ -1735,10 +1671,8 @@ lowercase characters. ethernet_mac 50 - 0 false - NETWORK NA @@ -1757,10 +1691,8 @@ lowercase characters. ethernet_mac 51 - 0 false - NETWORK NA @@ -1779,10 +1711,8 @@ lowercase characters. ethernet_mac 52 - 0 false - NETWORK NA @@ -1801,10 +1731,8 @@ lowercase characters. ethernet_mac 53 - 0 false - NETWORK NA @@ -1823,20 +1751,16 @@ lowercase characters. cpu_sdma 54 - 0 false - NETWORK 60 cpu_sdma 55 - 0 false - NETWORK 0 diff --git a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.md5 b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.md5 index 3a08897bfb40..f2cf3d5b688e 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.md5 +++ b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.md5 @@ -1 +1 @@ -2876aaa02a47b5842e152ce794c50110 \ No newline at end of file +85b49bcb9d399bcd1b8128a42caba2d2 \ No newline at end of file diff --git a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.xml b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.xml index 1d07f5994cae..980d4267b1bb 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.xml +++ b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-L1-AC5X-RD-32x1G-16x2_5G-6x25G.xml @@ -1,5 +1,5 @@ - + diff --git a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-PP-AC5X-RD.md5 b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-PP-AC5X-RD.md5 index de23afe95536..c043a0d7231f 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-PP-AC5X-RD.md5 +++ b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-PP-AC5X-RD.md5 @@ -1 +1 @@ -b42f2a2be9da6c7752c0807f9dee48bf \ No newline at end of file +209426f8b550ddf85db19925f9f202a1 \ No newline at end of file diff --git a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-PP-AC5X-RD.xml b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-PP-AC5X-RD.xml index ad457fe7db03..9e40492cfe8f 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-PP-AC5X-RD.xml +++ b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/ASK-PP-AC5X-RD.xml @@ -1,5 +1,5 @@ - + @@ -357,28 +357,28 @@ NATIVE NATIVE - * the trunk members are filled - * according to the order given by application. - * Regular trunk may hold max of 8 members. - * Cascade trunk may hold : - * max of 64 members +* the trunk members are filled +* according to the order given by application. +* Regular trunk may hold max of 8 members. +* Cascade trunk may hold : +* max of 64 members 0 FLEX FLEX - * A mode to allows flexibility for - * each Regular trunk to state it's max number of members (before starting to add members). - * (this mode not effect 'cascade trunk' members) - * Regular trunk may hold : max of 4K members. (each trunk set it's own limit) - * Cascade trunk may hold : max of 64 members. +* A mode to allows flexibility for +* each Regular trunk to state it's max number of members (before starting to add members). +* (this mode not effect 'cascade trunk' members) +* Regular trunk may hold : max of 4K members. (each trunk set it's own limit) +* Cascade trunk may hold : max of 64 members. 2 number-physical-port-type enumeration - ac5x 128, falcon 64,128,256, 512, 1024 + AC3X/AC5X 128, falcon 64, 128, 256, 512, 1024 no-ports no-ports @@ -519,7 +519,28 @@ 1 + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + ASIC_AC5X AC5X-RD @@ -842,7 +863,6 @@ TCAM_ROUTER_BASED 0 - MID_L3_MID_L2_NO_EM true diff --git a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.md5 b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.md5 index bd88f03a2e86..41cd1629560b 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.md5 +++ b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.md5 @@ -1 +1 @@ -079a2fcdb8fe1d1f0cf39e3c40e6dd36 \ No newline at end of file +fec8b7884a940c38451ef84be6fdbb24 \ No newline at end of file diff --git a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.xml b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.xml index f71d485bbeab..bbedd396d2b7 100644 --- a/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.xml +++ b/device/marvell/arm64-marvell_rd98DX35xx_cn9131-r0/rd98DX35xx_cn9131/SAI-AC5X-RD-32x1G-16x2_5G-6x25G.xml @@ -1,13 +1,13 @@ - + device-id-type uint32 - Device ID 0..1023 + Device ID 0..1 0 - 1023 + 1 port-id-type @@ -22,7 +22,7 @@ Logging Feature Options SAI_LOG_SYSLOG - SYSLOG {Syslog service should be running to use this option} + SYSLOG {Syslog service should be running to use this option} 0 @@ -32,7 +32,27 @@ SAI_LOG_FILE - FILE {Warning !!! Use with caution. Can cause disk full issues} + FILE {Warning !!! Use with caution. Can cause disk full issues} + 2 + + + + InDropCounter-type + enumeration + Router In Drop Reason Feature Options + + TTL_HOPLIMIT_EXCEEDED + Router In Drop Counters track TTL & Hop Limit Exceeded Packets + 0 + + + ROUTE_BLACKHOLE + Router In Drop Counters track Route Black Hole Packets + 1 + + + IN_DROP_ANY + Router In Drop Counters track either TTL & Hop Limit Exceeded or Route Black Hole Packets 2 @@ -43,11 +63,103 @@ 2 30 + + acl-feature-name-type + enumeration + + + port-sFlow + SFlow over Port + 0 + + + port-counters-ipv4-ipv6 + Port ipv4/ipv6 counters + 1 + + + control-acl + ACLs for control packet handling + 2 + + + debug-counter-acl + ACLs for Debug Counters + 3 + + + + ingress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + IPCL0 + Stage IPCL0 + 1 + + + IPCL1 + Stage IPCL1 + 2 + + + + egress-acl-stage-type + enumeration + + + disabled + Feature not enabled + 0 + + + EPCL0 + Stage EPCL0 + 2 + + + + feature-priority-type + uint32 + Feature priority + 2 + 15 + + + hit-number-type + uint32 + Hit/lookup number + 0 + 3 + + + asic-type + enumeration + ASIC Type + + ASIC_AC3X + AC3X + 0 + + + ASIC_AC5X + AC5X + 1 + + + ASIC_Falcon + FALCON + 2 + + + ASIC_AC5X ASK-Board-ac5x-rd-32x1G-16x2_5G-6x25G.xml - - false - 0 @@ -320,7 +432,7 @@ 53 - + 8 0 0 @@ -328,19 +440,61 @@ 8 8 1024 - 0 - 0 - + 0 - - 2048 - + IN_DROP_ANY SAI_LOG_SYSLOG + + control-acl + 3 + + IPCL0 + 1 + + + EPCL0 + 0 + + + + port-sFlow + 4 + + IPCL0 + 0 + + + EPCL0 + 0 + + + + port-counters-ipv4-ipv6 + 5 + + IPCL0 + 3 + + + EPCL0 + 0 + + + + debug-counter-acl + 2 + + disabled + + + disabled + + \ No newline at end of file From 07cd4fff2900f1202f91ada2f9404903fec6f36a Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Tue, 14 May 2024 08:08:11 +0800 Subject: [PATCH 097/282] [YANG] Align to authentication check with load_minigraph to cover more scenarios (#18908) #### Why I did it This will cover more cases for those only have authentication enabled with tacacs but not authorization enabled. Also, make it algin with the check in load_minigraph #### How I did it Change to authentication #### How to verify it unit test --- .../tests/yang_model_tests/tests/aaa.json | 10 +++++----- .../tests/yang_model_tests/tests_config/aaa.json | 10 +++++----- .../yang-models/sonic-system-aaa.yang | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/aaa.json b/src/sonic-yang-models/tests/yang_model_tests/tests/aaa.json index e1cf51385ac4..9b02a303e274 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/aaa.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/aaa.json @@ -15,12 +15,12 @@ "eStrKey": "Pattern", "eStr": ["false|true|False|True"] }, - "AAA_AUTHORIZATION_TEST": { - "desc": "Configure an authorization type in AAA table." + "AAA_AUTHENTICATION_TEST": { + "desc": "Configure an authentication type in AAA table." }, - "AAA_AUTHORIZATION_TEST_TACACS_WITHOUT_TACPLUS": { - "desc": "Configure tacacs in authorization type in AAA table without TACPLUS table.", - "eStr": ["Authorization with 'tacacs+' is not allowed when passkey not exists."] + "AAA_AUTHENTICATION_TEST_TACACS_WITHOUT_TACPLUS": { + "desc": "Configure tacacs in authentication type in AAA table without TACPLUS table.", + "eStr": ["Authentication with 'tacacs+' is not allowed when passkey not exists."] }, "AAA_ACCOUNTING_TEST": { "desc": "Configure an accounting type in AAA table." diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/aaa.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/aaa.json index 0be9b4b1f500..ec7f4e961024 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/aaa.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/aaa.json @@ -4,7 +4,7 @@ "sonic-system-aaa:AAA": { "AAA_LIST": [{ "type": "authentication", - "login": "tacacs+,local", + "login": "local", "failthrough": "True", "fallback": "True", "trace": "True", @@ -45,11 +45,11 @@ } }, - "AAA_AUTHORIZATION_TEST": { + "AAA_AUTHENTICATION_TEST": { "sonic-system-aaa:sonic-system-aaa": { "sonic-system-aaa:AAA": { "AAA_LIST": [{ - "type": "authorization", + "type": "authentication", "login": "tacacs+" }] } @@ -64,11 +64,11 @@ } }, - "AAA_AUTHORIZATION_TEST_TACACS_WITHOUT_TACPLUS": { + "AAA_AUTHENTICATION_TEST_TACACS_WITHOUT_TACPLUS": { "sonic-system-aaa:sonic-system-aaa": { "sonic-system-aaa:AAA": { "AAA_LIST": [{ - "type": "authorization", + "type": "authentication", "login": "tacacs+" }] } diff --git a/src/sonic-yang-models/yang-models/sonic-system-aaa.yang b/src/sonic-yang-models/yang-models/sonic-system-aaa.yang index 61fc9ab61841..360ff9195a54 100644 --- a/src/sonic-yang-models/yang-models/sonic-system-aaa.yang +++ b/src/sonic-yang-models/yang-models/sonic-system-aaa.yang @@ -43,8 +43,8 @@ module sonic-system-aaa { default "local"; } - must 'not(./type = "authorization" and contains(./login, "tacacs+") and not(/tacacs:sonic-system-tacacs/tacacs:TACPLUS/tacacs:global/tacacs:passkey))' { - error-message "Authorization with 'tacacs+' is not allowed when passkey not exists."; + must 'not(./type = "authentication" and contains(./login, "tacacs+") and not(/tacacs:sonic-system-tacacs/tacacs:TACPLUS/tacacs:global/tacacs:passkey))' { + error-message "Authentication with 'tacacs+' is not allowed when passkey not exists."; } leaf failthrough { From 1627c5cef4bc73f5d48dd97f68c4110ac838aa13 Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Tue, 14 May 2024 18:08:14 -0700 Subject: [PATCH 098/282] [eventd]: Close rsyslog plugin when rsyslog SIGTERM and EOF is sent to stream (#18835) Fix #18771 Microsoft ADO (number only):27882794 How I did it Add signalOnClose for omprog as well as close rsyslog plugin when receives an EOF. How to verify it Verify rsyslog_plugin is running inside bgp or swss container Run docker exec -it bgp supervisorctl restart rsyslogd Before change: This will not kill current rsyslog_plugin process but instead rsyslogd will now break off its end of writing to cin and send EOF to rsyslog_plugin, however will not send a signal SIGTERM or SIGKILL to rsyslog_plugin. Therefore, rsyslog plugin will run in an infinite loop forever, constantly calling getline raising CPU to 100% inside docker. After change of adding signalOnClose="on" to conf file inside omprog, rsyslogd will now send SIGTERM to rsyslog_plugin process running inside container, and rsyslog_plugin will die. ? ( ): rsyslog_plugin/578637 ... [continued]: read()) = -1 (unknown) (INTERNAL ERROR: strerror_r(512, [buf], 128)=22) UT (will add sonic-mgmt testcase for storming events with logs) RCA: 1. When rsyslogd is terminated, no signal is sent to child process of rsyslog_plugin meaning that rsyslog_plugin will be constantly trying to read from cin with no writer on the other end of the pipe. This leads to rsyslog_plugin process will constantly be reading via getline infinitely. 2. Because rsyslog is terminated and the spawned rsyslog_plugin is still alive, when rsyslog starts backup again, and log is triggered, a new rsyslog_plugin will be spawned for that rsyslog process, which can lead to many "ghost" rsyslog_plugin processes that will be at high CPU usage. --- files/build_templates/rsyslog_plugin.conf.j2 | 1 + .../rsyslog_plugin/rsyslog_plugin.cpp | 27 ++++++++++--------- .../rsyslog_plugin/rsyslog_plugin.h | 8 ++++++ .../rsyslog_plugin_ut.cpp | 26 ++++++++++++++++++ 4 files changed, 50 insertions(+), 12 deletions(-) diff --git a/files/build_templates/rsyslog_plugin.conf.j2 b/files/build_templates/rsyslog_plugin.conf.j2 index 4628bea70e62..56ec0f71d3f1 100644 --- a/files/build_templates/rsyslog_plugin.conf.j2 +++ b/files/build_templates/rsyslog_plugin.conf.j2 @@ -12,6 +12,7 @@ if re_match($programname, "{{ proc.name }}") then { action(type="omprog" binary="/usr/bin/rsyslog_plugin -r /etc/rsyslog.d/{{ proc.parse_json }} -m {{ yang_module }}" output="/var/log/rsyslog_plugin.log" + signalOnClose="on" template="prog_msg") } {% endfor %} diff --git a/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp b/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp index 6df0a73b0210..52a70fd182ae 100644 --- a/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp +++ b/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.cpp @@ -9,6 +9,8 @@ using json = nlohmann::json; +bool RsyslogPlugin::g_running; + bool RsyslogPlugin::onMessage(string msg, lua_State* luaState) { string tag; event_params_t paramDict; @@ -30,18 +32,18 @@ void parseParams(vector params, vector& eventParams) { if(params[i].empty()) { SWSS_LOG_ERROR("Empty param provided in regex file\n"); continue; - } + } EventParam ep = EventParam(); auto delimPos = params[i].find(':'); if(delimPos == string::npos) { // no lua code ep.paramName = params[i]; } else { ep.paramName = params[i].substr(0, delimPos); - ep.luaCode = params[i].substr(delimPos + 1); + ep.luaCode = params[i].substr(delimPos + 1); if(ep.luaCode.empty()) { SWSS_LOG_ERROR("Lua code missing after :\n"); } - } + } eventParams.push_back(ep); } } @@ -71,11 +73,11 @@ bool RsyslogPlugin::createRegexList() { vector eventParams; try { string eventRegex = jsonList[i]["regex"]; - regexString = timestampRegex + eventRegex; + regexString = timestampRegex + eventRegex; string tag = jsonList[i]["tag"]; vector params = jsonList[i]["params"]; - vector timestampParams = { "month", "day", "time" }; - params.insert(params.begin(), timestampParams.begin(), timestampParams.end()); + vector timestampParams = { "month", "day", "time" }; + params.insert(params.begin(), timestampParams.begin(), timestampParams.end()); regex expr(regexString); expression = expr; parseParams(params, eventParams); @@ -83,13 +85,13 @@ bool RsyslogPlugin::createRegexList() { rs.tag = tag; rs.regexExpression = expression; regexList.push_back(rs); - } catch (nlohmann::detail::type_error& deException) { + } catch (nlohmann::detail::type_error& deException) { SWSS_LOG_ERROR("Missing required key, throws exception: %s\n", deException.what()); return false; } catch (regex_error& reException) { SWSS_LOG_ERROR("Invalid regex, throws exception: %s\n", reException.what()); - return false; - } + return false; + } } if(regexList.empty()) { @@ -104,11 +106,11 @@ bool RsyslogPlugin::createRegexList() { } void RsyslogPlugin::run() { + signal(SIGTERM, RsyslogPlugin::signalHandler); lua_State* luaState = luaL_newstate(); luaL_openlibs(luaState); - while(true) { - string line; - getline(cin, line); + string line; + while(RsyslogPlugin::g_running && getline(cin, line)) { if(line.empty()) { continue; } @@ -132,4 +134,5 @@ RsyslogPlugin::RsyslogPlugin(string moduleName, string regexPath) { m_parser = unique_ptr(new SyslogParser()); m_moduleName = moduleName; m_regexPath = regexPath; + RsyslogPlugin::g_running = true; } diff --git a/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.h b/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.h index 0811b5f3032f..ae6c9baf9630 100644 --- a/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.h +++ b/src/sonic-eventd/rsyslog_plugin/rsyslog_plugin.h @@ -9,6 +9,7 @@ extern "C" } #include #include +#include #include "syslog_parser.h" #include "events.h" #include "logger.h" @@ -24,10 +25,17 @@ using namespace swss; class RsyslogPlugin { public: + static bool g_running; int onInit(); bool onMessage(string msg, lua_State* luaState); void run(); RsyslogPlugin(string moduleName, string regexPath); + static void signalHandler(int signum) { + if (signum == SIGTERM) { + SWSS_LOG_INFO("Rsyslog plugin received SIGTERM, shutting down"); + RsyslogPlugin::g_running = false; + } + } private: unique_ptr m_parser; event_handle_t m_eventHandle; diff --git a/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp b/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp index 5ff41d11dd70..aafd357006eb 100644 --- a/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp +++ b/src/sonic-eventd/rsyslog_plugin_tests/rsyslog_plugin_ut.cpp @@ -8,6 +8,7 @@ extern "C" #include #include #include +#include #include "gtest/gtest.h" #include #include "events.h" @@ -253,6 +254,31 @@ TEST(rsyslog_plugin, onMessage_noParams) { infile.close(); } +TEST(rsyslog_plugin, run) { + unique_ptr plugin(new RsyslogPlugin("test_mod_name", "./rsyslog_plugin_tests/test_regex_5.rc.json")); + EXPECT_EQ(0, plugin->onInit()); + istringstream ss(""); + streambuf* cinbuf = cin.rdbuf(); + cin.rdbuf(ss.rdbuf()); + plugin->run(); + cin.rdbuf(cinbuf); +} + +TEST(rsyslog_plugin, run_SIGTERM) { + unique_ptr plugin(new RsyslogPlugin("test_mod_name", "./rsyslog_plugin_tests/test_regex_5.rc.json")); + EXPECT_EQ(0, plugin->onInit()); + EXPECT_TRUE(RsyslogPlugin::g_running); + thread pluginThread([&]() { + plugin->run(); + }); + + RsyslogPlugin::signalHandler(SIGTERM); + + pluginThread.join(); + + EXPECT_FALSE(RsyslogPlugin::g_running); +} + TEST(timestampFormatter, changeTimestampFormat) { unique_ptr formatter(new TimestampFormatter()); From a480f8dc0e99702471c3c97fbca8d782b8ac55ac Mon Sep 17 00:00:00 2001 From: Senthil Kumar Guruswamy <75792349+sg893052@users.noreply.github.com> Date: Wed, 15 May 2024 06:52:18 +0530 Subject: [PATCH 099/282] Third Party Container Management Support in Sonic App Extension (#14917) --- files/build_templates/default_manifest | 60 +++++++++++++++++++ .../build_templates/sonic_debian_extension.j2 | 5 ++ 2 files changed, 65 insertions(+) create mode 100644 files/build_templates/default_manifest diff --git a/files/build_templates/default_manifest b/files/build_templates/default_manifest new file mode 100644 index 000000000000..f6821b4ef480 --- /dev/null +++ b/files/build_templates/default_manifest @@ -0,0 +1,60 @@ +{ + "version": "1.0.0", + "package": { + "version": "1.0.0", + "name": "default_manifest", + "description": "", + "base-os": {}, + "depends": [], + "breaks": [], + "init-cfg": {}, + "changelog": {}, + "debug-dump": "" + }, + "service": { + "name": "default_manifest", + "requires": [], + "requisite": [], + "wanted-by": [], + "after": [], + "before": [], + "dependent": [], + "dependent-of": [], + "post-start-action": "", + "pre-shutdown-action": "", + "asic-service": false, + "host-service": true, + "delayed": false, + "check_up_status": false, + "warm-shutdown": { + "after": [], + "before": [] + }, + "fast-shutdown": { + "after": [], + "before": [] + }, + "syslog": { + "support-rate-limit": false + } + }, + "container": { + "privileged": false, + "entrypoint": "", + "volumes": [], + "mounts": [], + "environment": {}, + "tmpfs": [] + }, + "processes": [], + "cli": { + "mandatory": false, + "show": [], + "config": [], + "clear": [], + "auto-generate-show": false, + "auto-generate-config": false, + "auto-generate-show-source-yang-modules": [], + "auto-generate-config-source-yang-modules": [] + } +} diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 2889b2469960..d30e85c268b5 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -845,6 +845,11 @@ if [ "${PIPESTATUS[0]}" != "0" ]; then exit 1 fi +#Copy the default manifest file to SONIC_PACKAGE_MANAGER_FOLDER directly +sudo cp $BUILD_TEMPLATES/default_manifest $FILESYSTEM_ROOT/$SONIC_PACKAGE_MANAGER_FOLDER/default_manifest +#Create a new manifests subdirectory under SONIC_PACKAGE_MANAGER_FOLDER for all the user created custom manifests +sudo mkdir -p $FILESYSTEM_ROOT/$SONIC_PACKAGE_MANAGER_FOLDER/manifests + # Copy docker_image_ctl.j2 for SONiC Package Manager sudo cp $BUILD_TEMPLATES/docker_image_ctl.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/docker_image_ctl.j2 From 166a9fba0672757a2ed4e17b0aab5709b0e6da02 Mon Sep 17 00:00:00 2001 From: Xincun Li <147451452+xincunli-sonic@users.noreply.github.com> Date: Tue, 14 May 2024 22:49:37 -0700 Subject: [PATCH 100/282] Add SysLogger for new implementation. (#17171) This PR introduces the SysLogger to address an issue where the original Logger.py could override the SYSLOG_IDENTIFIER if a new Logger instance is created. - Why I did it? This change was made because the SysLog was displaying NOTICE pmon#CCmisApi: instead of NOTICE pmon#ycable:. This discrepancy led to confusion during debugging and incorrect component identification in log analysis. - How I did it I implemented an instance-level syslog using the logging.handlers module to prevent the SYSLOG_IDENTIFIER from being overridden. --- .../sonic_py_common/daemon_base.py | 38 ++++++++++-- .../sonic_py_common/syslogger.py | 62 +++++++++++++++++++ src/system-health/tests/test_system_health.py | 11 +++- 3 files changed, 103 insertions(+), 8 deletions(-) create mode 100644 src/sonic-py-common/sonic_py_common/syslogger.py diff --git a/src/sonic-py-common/sonic_py_common/daemon_base.py b/src/sonic-py-common/sonic_py_common/daemon_base.py index 86870ba1fdc0..8bfd09cd881d 100644 --- a/src/sonic-py-common/sonic_py_common/daemon_base.py +++ b/src/sonic-py-common/sonic_py_common/daemon_base.py @@ -1,9 +1,12 @@ +import logging import signal import sys +import syslog from . import device_info from .general import load_module_from_source from .logger import Logger +from .syslogger import SysLogger # # Constants ==================================================================== @@ -32,12 +35,16 @@ def db_connect(db_name, namespace=EMPTY_NAMESPACE): class DaemonBase(Logger): - def __init__(self, log_identifier): - super(DaemonBase, self).__init__( - log_identifier=log_identifier, - log_facility=Logger.LOG_FACILITY_DAEMON, - log_option=(Logger.LOG_OPTION_NDELAY | Logger.LOG_OPTION_PID) - ) + def __init__(self, log_identifier, use_syslogger=True): + super().__init__() + if use_syslogger: + self.logger_instance = SysLogger(log_identifier) + else: + self.logger_instance = Logger( + log_identifier=log_identifier, + log_facility=Logger.LOG_FACILITY_DAEMON, + log_option=(Logger.LOG_OPTION_NDELAY | Logger.LOG_OPTION_PID) + ) # Register our default signal handlers, unless the signal already has a # handler registered, most likely from a subclass implementation @@ -48,6 +55,25 @@ def __init__(self, log_identifier): if not signal.getsignal(signal.SIGTERM): signal.signal(signal.SIGTERM, self.signal_handler) + def log(self, priority, message, also_print_to_console=False): + self.logger_instance.log(priority, message, also_print_to_console) + + def log_error(self, message, also_print_to_console=False): + self.logger_instance.log_error(message, also_print_to_console) + + def log_warning(self, message, also_print_to_console=False): + self.logger_instance.log_warning(message, also_print_to_console) + + def log_notice(self, message, also_print_to_console=False): + self.logger_instance.log_notice(message, also_print_to_console) + + def log_info(self, message, also_print_to_console=False): + self.logger_instance.log_info(message, also_print_to_console) + + def log_debug(self, message, also_print_to_console=False): + self.logger_instance.log_debug(message, also_print_to_console) + + # Default signal handler; can be overridden by subclass def signal_handler(self, sig, frame): if sig == signal.SIGHUP: diff --git a/src/sonic-py-common/sonic_py_common/syslogger.py b/src/sonic-py-common/sonic_py_common/syslogger.py new file mode 100644 index 000000000000..b3c8f726502c --- /dev/null +++ b/src/sonic-py-common/sonic_py_common/syslogger.py @@ -0,0 +1,62 @@ +import logging +from logging.handlers import SysLogHandler +import os +import socket +import sys + +class SysLogger: + """ + SysLogger class for Python applications using SysLogHandler + """ + + DEFAULT_LOG_FACILITY = SysLogHandler.LOG_USER + DEFAULT_LOG_LEVEL = SysLogHandler.LOG_NOTICE + + def __init__(self, log_identifier=None, log_facility=DEFAULT_LOG_FACILITY, log_level=DEFAULT_LOG_LEVEL): + if log_identifier is None: + log_identifier = os.path.basename(sys.argv[0]) + + # Initialize SysLogger + self.logger = logging.getLogger(log_identifier) + + # Reset all existing handlers + for handler in self.logger.handlers[:]: + self.logger.removeHandler(handler) + + handler = SysLogHandler(address="/dev/log", facility=log_facility, socktype=socket.SOCK_DGRAM) + formatter = logging.Formatter('%(name)s[%(process)d]: %(message)s') + handler.setFormatter(formatter) + self.logger.addHandler(handler) + + self.set_min_log_priority(log_level) + + def set_min_log_priority(self, priority): + """ + Sets the minimum log priority level. All log messages + with a priority lower than this will not be logged + """ + self._min_log_level = priority + self.logger.setLevel(priority) + + # Methods for logging messages + def log(self, priority, msg, also_print_to_console=False): + self.logger.log(priority, msg) + + if also_print_to_console: + print(msg) + + # Convenience methods + def log_error(self, msg, also_print_to_console=False): + self.log(logging.ERROR, msg, also_print_to_console) + + def log_warning(self, msg, also_print_to_console=False): + self.log(logging.WARNING, msg, also_print_to_console) + + def log_notice(self, msg, also_print_to_console=False): + self.log(logging.INFO, msg, also_print_to_console) + + def log_info(self, msg, also_print_to_console=False): + self.log(logging.INFO, msg, also_print_to_console) + + def log_debug(self, msg, also_print_to_console=False): + self.log(logging.DEBUG, msg, also_print_to_console) diff --git a/src/system-health/tests/test_system_health.py b/src/system-health/tests/test_system_health.py index cd9a54e8799f..ab44fcd66c9d 100644 --- a/src/system-health/tests/test_system_health.py +++ b/src/system-health/tests/test_system_health.py @@ -46,9 +46,12 @@ snmp-subagent EXITED Oct 19 01:53 AM """ device_info.get_platform = MagicMock(return_value='unittest') - + device_runtime_metadata = {"DEVICE_RUNTIME_METADATA": {"ETHERNET_PORTS_PRESENT":True}} +def no_op(*args, **kwargs): + pass # This function does nothing + def setup(): if os.path.exists(ServiceChecker.CRITICAL_PROCESS_CACHE): os.remove(ServiceChecker.CRITICAL_PROCESS_CACHE) @@ -875,7 +878,9 @@ def test_get_service_from_feature_table(): @patch('healthd.time.time') -def test_healthd_check_interval(mock_time): +@patch('healthd.HealthDaemon.log_notice', side_effect=lambda *args, **kwargs: None) +@patch('healthd.HealthDaemon.log_warning', side_effect=lambda *args, **kwargs: None) +def test_healthd_check_interval(mock_log_warning, mock_log_notice, mock_time): daemon = HealthDaemon() manager = MagicMock() manager.check = MagicMock() @@ -888,6 +893,8 @@ def test_healthd_check_interval(mock_time): daemon.stop_event.wait.return_value = False manager.config.interval = 60 mock_time.side_effect = [0, 3, 0, 61, 0, 1] + mock_log_notice.side_effect = no_op + mock_log_warning.side_effect = no_op assert daemon._run_checker(manager, chassis) daemon.stop_event.wait.assert_called_with(57) assert daemon._run_checker(manager, chassis) From 31f2c7c09142197d32fbc36aa20bc765db00d53e Mon Sep 17 00:00:00 2001 From: Ashwin Srinivasan <93744978+assrinivasan@users.noreply.github.com> Date: Tue, 14 May 2024 23:09:38 -0700 Subject: [PATCH 101/282] [syslog]: add year to all log files (#18099) Why I did it Currently SONiC logs do not show the year: root@str2-7050cx3-acs-01:~# tail -f /var/log/teamd.log Feb 14 00:07:54.856313 str2-7050cx3-acs-01 DEBUG teamd#teamd_PortChannel102[37]: usock: calling method "StateDump" Feb 14 00:07:54.856795 str2-7050cx3-acs-01 DEBUG teamd#teamd_PortChannel101[29]: usock: calling method "StateDump" Feb 14 00:07:55.859690 str2-7050cx3-acs-01 DEBUG teamd#teamd_PortChannel104[53]: usock: calling method "StateDump" This PR fixes that issue: 2024 Feb 15 02:24:26.091224 str2-7050cx3-acs-01 DEBUG teamd#teamd_PortChannel102[33]: usock: calling method "StateDump" 2024 Feb 15 02:24:26.091224 str2-7050cx3-acs-01 DEBUG teamd#teamd_PortChannel101[25]: usock: calling method "StateDump" 2024 Feb 15 02:24:26.752655 str2-7050cx3-acs-01 DEBUG teamd#teamd_PortChannel103[41]: Ethernet120: Enabling port 2024 Feb 15 02:24:26.752655 str2-7050cx3-acs-01 DEBUG teamd#teamd_PortChannel103[41]: Enable carrier. Number of enabled ports 1 >= configured min_ports 1 2024 Feb 15 02:24:27.094931 str2-7050cx3-acs-01 DEBUG teamd#teamd_PortChannel103[41]: usock: calling method "StateDump" Also added a sonic-mgmt PR 11806 to update the FMT time template in platform_tests/conftest.py to keep up with this image change. Microsoft ADO (number only): 26399333 --- files/image_config/rsyslog/rsyslog.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/image_config/rsyslog/rsyslog.conf.j2 b/files/image_config/rsyslog/rsyslog.conf.j2 index 52096784c320..dc88fc8863a1 100644 --- a/files/image_config/rsyslog/rsyslog.conf.j2 +++ b/files/image_config/rsyslog/rsyslog.conf.j2 @@ -51,7 +51,7 @@ $UDPServerRun 514 #$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat # Define a custom template -$template SONiCFileFormat,"%timegenerated%.%timegenerated:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" +$template SONiCFileFormat,"%timegenerated:::date-year% %timegenerated%.%timegenerated:::date-subseconds% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" $ActionFileDefaultTemplate SONiCFileFormat $template SONiCForwardFormat,"<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogseverity-text:::uppercase% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" $ActionForwardDefaultTemplate SONiCForwardFormat From 8b3944f36128748eb5e67fb138641b8694d4a206 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Thu, 16 May 2024 01:28:10 +0800 Subject: [PATCH 102/282] [dhcp_server] Add support for monitoring used but invalid range/option (#18945) Why I did it Currently, dhcpservd wouldn't monitor option / range change which is referred in DHCP_SERVER_IPV4 table but is invalid or not been defined. It would miss config when they are defined or become valid. How I did it Treat invalid or not defined option / range as interested items. --- .../dhcp_utilities/dhcpservd/dhcp_cfggen.py | 4 ++-- src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py | 4 ++-- src/sonic-dhcp-utilities/tests/test_smart_switch.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index 5bc9e6cb95e2..eb7ae34d852f 100755 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -196,6 +196,7 @@ def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, cust curr_options = {} if "customized_options" in dhcp_config: for option in dhcp_config["customized_options"]: + used_options.add(option) if option not in customized_option_keys: syslog.syslog(syslog.LOG_WARNING, "Customized option {} configured for {} is not defined" .format(option, dhcp_interface_name)) @@ -231,7 +232,6 @@ def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, cust "lease_time": dhcp_config["lease_time"] if "lease_time" in dhcp_config else DEFAULT_LEASE_TIME, "customized_options": curr_options } - used_options = used_options | set(subnet_obj["customized_options"]) subnets.append(subnet_obj) render_obj = { "subnets": subnets, @@ -422,10 +422,10 @@ def _parse_port(self, port_ipv4, dhcp_interfaces, dhcp_members, ranges): port_ips) if "ranges" in port_config and len(port_config["ranges"]) != 0: for range_name in list(port_config["ranges"]): + used_ranges.add(range_name) if range_name not in ranges: syslog.syslog(syslog.LOG_WARNING, f"Range {range_name} is not in range table, skip") continue - used_ranges.add(range_name) range = ranges[range_name] # Loop the IP of the dhcp interface and find the network that target range is in this network. self._match_range_network(dhcp_interface, dhcp_interface_name, port, range, port_ips) diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py index 0d5edf03cb1f..723731839649 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py @@ -314,7 +314,7 @@ def test_parse_port(test_config_db, mock_swsscommon_dbconnector_init, mock_get_r parsed_port, used_ranges = dhcp_cfg_generator._parse_port(ipv4_port, tested_vlan_interfaces, vlan_members, tested_ranges) assert parsed_port == (expected_parsed_port if test_config_db == "mock_config_db.json" else {}) - assert used_ranges == ({"range1", "range0", "range3"} + assert used_ranges == ({"range1", "range0", "range3", "range2", "range6"} if test_config_db == "mock_config_db.json" else set()) @@ -366,7 +366,7 @@ def test_construct_obj_for_template(mock_swsscommon_dbconnector_init, mock_parse port_ips, tested_hostname, customized_options) assert render_obj == expected_render_obj assert enabled_dhcp_interfaces == {"Vlan1000", "Vlan4000", "Vlan3000", "Vlan6000"} - assert used_options == set(["option223"]) + assert used_options == set(["option223", "option60"]) assert subscribe_table == set(PORT_MODE_CHECKER) diff --git a/src/sonic-dhcp-utilities/tests/test_smart_switch.py b/src/sonic-dhcp-utilities/tests/test_smart_switch.py index 9d9d8a33fb6e..0347d5df2f6d 100644 --- a/src/sonic-dhcp-utilities/tests/test_smart_switch.py +++ b/src/sonic-dhcp-utilities/tests/test_smart_switch.py @@ -129,7 +129,7 @@ def test_dhcp_dhcp_cfggen_generate(mock_swsscommon_dbconnector_init, mock_parse_ assert json.loads(kea_dhcp4_config) == expected_kea_config assert used_ranges == set() assert enabled_dhcp_interfaces == set(["bridge_midplane"]) - assert used_options == set() + assert used_options == set(["option60", "option223"]) expected_tables = set(["DpusTableEventChecker", "MidPlaneTableEventChecker", "VlanTableEventChecker", "VlanIntfTableEventChecker", "DhcpRangeTableEventChecker", "VlanMemberTableEventChecker", "DhcpOptionTableEventChecker", "DhcpPortTableEventChecker", From b952caa155b2760a52ef9081ed28b505767da528 Mon Sep 17 00:00:00 2001 From: Yevhen Fastiuk Date: Thu, 16 May 2024 02:27:25 +0300 Subject: [PATCH 103/282] =?UTF-8?q?=F0=9F=90=9E=20NTP:=20Fix=20config=20te?= =?UTF-8?q?mplate=20to=20init=20default=20parameters=20(#18736)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #17906 #### Why I did it To fix NTP config generation from the minigraph and save backward compatability #### How I did it Align `ntp.conf.j2` template to generate config out of empty `NTP_SERVER` DB configuration #### How to verify it Out of that NTP_SERVER configuration: ```json { "10.210.25.32": {}, "10.75.202.2": {} } ``` The next config in `ntp.conf` file should be produced: ``` server 10.210.25.32 restrict 10.210.25.32 kod limited nomodify notrap noquery nopeer server 10.75.202.2 restrict 10.75.202.2 kod limited nomodify notrap noquery nopeer ``` --- files/image_config/ntp/ntp.conf.j2 | 22 ++++++++----------- .../tests/sample_output/py3/ntp.conf | 4 ++-- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/files/image_config/ntp/ntp.conf.j2 b/files/image_config/ntp/ntp.conf.j2 index 0563e5044476..e50822a67a9d 100644 --- a/files/image_config/ntp/ntp.conf.j2 +++ b/files/image_config/ntp/ntp.conf.j2 @@ -18,14 +18,14 @@ leapfile /usr/share/zoneinfo/leap-seconds.list {# Adding NTP servers. We need to know if we have some pools, to set proper config -#} {% set ns = namespace(is_pools=false) %} -{% for server in NTP_SERVER if NTP_SERVER[server].admin_state != 'disabled' and - NTP_SERVER[server].resolve_as and - NTP_SERVER[server].association_type -%} +{% for server in NTP_SERVER if NTP_SERVER[server].admin_state != 'disabled' -%} {% set config = NTP_SERVER[server] -%} {# Server options -#} {% set soptions = '' -%} - {# Server access control options -#} - {% set aoptions = '' -%} + + {# Define defaults if not defined -#} + {% set association_type = config.association_type | d('server') -%} + {% set resolve_as = config.resolve_as | d(server) -%} {# Authentication key -#} {% if global.authentication == 'enabled' -%} @@ -47,17 +47,13 @@ config -#} {# Check if there are any pool configured. BTW it doesn't matter what was configured as "resolve_as" for pools. If they were configured with FQDN they must remain like that -#} - {% set config_as = config.resolve_as -%} - {% if config.association_type == 'pool' -%} - {% set ns.is_pools = true -%} - {% set config_as = server -%} - {% else -%} - {% set aoptions = aoptions ~ ' nopeer' -%} + {% if association_type == 'pool' -%} + {% set resolve_as = server -%} {% endif -%} -{{ config.association_type }} {{ config_as }}{{ soptions }} +{{ association_type }} {{ resolve_as }}{{ soptions }} {% if global.server_role == 'disabled' %} -restrict {{ config_as }} kod limited nomodify notrap noquery{{ aoptions }} +restrict {{ resolve_as }} kod limited nomodify noquery {% endif %} {% endfor -%} diff --git a/src/sonic-config-engine/tests/sample_output/py3/ntp.conf b/src/sonic-config-engine/tests/sample_output/py3/ntp.conf index 41361573949b..412d06cfd4aa 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/ntp.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/ntp.conf @@ -13,10 +13,10 @@ driftfile /var/lib/ntpsec/ntp.drift leapfile /usr/share/zoneinfo/leap-seconds.list server 10.20.30.50 key 42 iburst version 3 -restrict 10.20.30.50 kod limited nomodify notrap noquery nopeer +restrict 10.20.30.50 kod limited nomodify noquery pool pool.ntp.org iburst version 3 -restrict pool.ntp.org kod limited nomodify notrap noquery +restrict pool.ntp.org kod limited nomodify noquery keys /etc/ntpsec/ntp.keys From 98fefc6c0c95a5bdf754065589edbc1b1c66f349 Mon Sep 17 00:00:00 2001 From: Prince George <45705344+prgeor@users.noreply.github.com> Date: Wed, 15 May 2024 17:04:08 -0700 Subject: [PATCH 104/282] [baseimage]: Add nvme-cli tool in both baseimage and pmon (#18967) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add nvme-cli utility tool for platforms using NVMe How to verify it root@str-D10-U32:~# nvme version nvme version 2.3 (git 2.3) libnvme version 1.3 (git 1.3) root@str-D10-U32:~# root@str-D10-U32:~# nvme smart-log /dev/nvme0 Smart Log for NVME device:nvme0 namespace-id:ffffffff critical_warning : 0 temperature : 43°C (316 Kelvin) available_spare : 100% available_spare_threshold : 10% percentage_used : 0% endurance group critical warning summary: 0 Data Units Read : 4,421,218 (2.26 TB) Data Units Written : 2,590,713 (1.33 TB) host_read_commands : 26,514,410 host_write_commands : 30,359,625 controller_busy_time : 555 power_cycles : 222 power_on_hours : 2,528 unsafe_shutdowns : 219 media_errors : 0 num_err_log_entries : 0 Warning Temperature Time : 18 Critical Composite Temperature Time : 0 Temperature Sensor 2 : 43°C (316 Kelvin) Temperature Sensor 3 : 30°C (303 Kelvin) Temperature Sensor 6 : 43°C (316 Kelvin) Thermal Management T1 Trans Count : 4 Thermal Management T2 Trans Count : 0 Thermal Management T1 Total Time : 1337 Thermal Management T2 Total Time : 0 root@str-D10-U32:~# --- build_debian.sh | 3 ++- dockers/docker-platform-monitor/Dockerfile.j2 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build_debian.sh b/build_debian.sh index 6ba2a134efef..bc927fbb36d6 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -406,7 +406,8 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in sysstat \ xxd \ wireless-regdb \ - zstd + zstd \ + nvme-cli # Have systemd create the auditd log directory sudo mkdir -p ${FILESYSTEM_ROOT}/etc/systemd/system/auditd.service.d diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index ef6b2fcea824..a4e01237e053 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -26,6 +26,7 @@ RUN apt-get update && \ libpci3 \ iputils-ping \ pciutils \ + nvme-cli \ ethtool && \ # smartmontools version should match the installed smartmontools in sonic_debian_extension build template apt-get install -y -t bookworm-backports \ From 2a3bdb68ed1dd9ae7f99e489a2e6e616c27991de Mon Sep 17 00:00:00 2001 From: Senthil Kumar Guruswamy <75792349+sg893052@users.noreply.github.com> Date: Thu, 16 May 2024 10:55:26 +0530 Subject: [PATCH 105/282] Remove services mentioned in exclude service list for system monitoring (#18911) - Why I did it To address #18814 - How I did it Introduce exclude service list in the code to be parsed and remove the services from the system ready tracking. In this case, it is ztp.service - How to verify it show system-health sysready-status output --- src/system-health/health_checker/sysmonitor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/system-health/health_checker/sysmonitor.py b/src/system-health/health_checker/sysmonitor.py index 5312603d7365..115dbfbe9ea0 100755 --- a/src/system-health/health_checker/sysmonitor.py +++ b/src/system-health/health_checker/sysmonitor.py @@ -23,7 +23,7 @@ QUEUE_TIMEOUT = 15 TASK_STOP_TIMEOUT = 10 logger = Logger(log_identifier=SYSLOG_IDENTIFIER) - +exclude_srv_list = ['ztp.service'] #Subprocess which subscribes to STATE_DB FEATURE table for any update #and push service events to main process via queue @@ -158,6 +158,11 @@ def get_all_service_list(self): if srv in dir_list: dir_list.remove(srv) + #Remove services from exclude list Eg.ztp.service + for srv in exclude_srv_list: + if srv in dir_list: + dir_list.remove(srv) + dir_list.sort() return dir_list From c5a2eba47c1fcdc331730678a4cc62fc09033d58 Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Wed, 15 May 2024 22:36:50 -0700 Subject: [PATCH 106/282] Add configuration optimization to run SONiC on DPU (#18807) - Why I did it The Appliance DPU supports a limited subset of the configuration defined in the SONiC DASH HLD. Configure SWSS and GMNI to communicate on the Appliance DPU. Add a sample configuration for the appliance topology. - How I did it Disable configuration unsupported by the Appliance DPU based on the device type. - How to verify it Run VNET-to-VNET sonic-mgmt test. --- dockers/docker-orchagent/ipinip.json.j2 | 5 +++++ dockers/docker-orchagent/switch.json.j2 | 2 ++ dockers/docker-platform-monitor/docker_init.j2 | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/dockers/docker-orchagent/ipinip.json.j2 b/dockers/docker-orchagent/ipinip.json.j2 index 9cdf6857bddd..9d40ec68cd12 100644 --- a/dockers/docker-orchagent/ipinip.json.j2 +++ b/dockers/docker-orchagent/ipinip.json.j2 @@ -1,3 +1,6 @@ +{% if DEVICE_METADATA['localhost']['switch_type'] == "dpu" %} +[] +{% else %} {% set ipv4_addresses = [] %} {% set ipv6_addresses = [] %} {% set ipv4_loopback_addresses = [] %} @@ -77,3 +80,5 @@ } {% endif %} ] +{% endif %} + diff --git a/dockers/docker-orchagent/switch.json.j2 b/dockers/docker-orchagent/switch.json.j2 index 30ad703bc2cf..5816cecacc1f 100644 --- a/dockers/docker-orchagent/switch.json.j2 +++ b/dockers/docker-orchagent/switch.json.j2 @@ -18,6 +18,7 @@ [ { "SWITCH_TABLE:switch": { +{% if not DEVICE_METADATA.localhost.switch_type or DEVICE_METADATA.localhost.switch_type != "dpu" %} "ecmp_hash_seed": "{{ hash_seed_value }}", "lag_hash_seed": "{{ hash_seed_value }}", "fdb_aging_time": "600", @@ -25,6 +26,7 @@ "ordered_ecmp": "true" {% else %} "ordered_ecmp": "false" +{% endif %} {% endif %} }, "OP": "SET" diff --git a/dockers/docker-platform-monitor/docker_init.j2 b/dockers/docker-platform-monitor/docker_init.j2 index 46766b5fd171..765f7c863efc 100755 --- a/dockers/docker-platform-monitor/docker_init.j2 +++ b/dockers/docker-platform-monitor/docker_init.j2 @@ -91,6 +91,10 @@ if [ -e $SENSORS_CONF_PATH_GETTER ]; then fi {% endif %} +{% if CONFIGURED_PLATFORM == "nvidia-bluefield" %} + mount -t debugfs none /sys/kernel/debug +{% endif %} + if [ -e $SENSORS_CONF_FILE ]; then HAVE_SENSORS_CONF=1 mkdir -p /etc/sensors.d From c48cc1e8979e5475f8e8a291076355504c934bc8 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Thu, 16 May 2024 14:19:04 +0800 Subject: [PATCH 107/282] [bgp] Add explictly configure bgp router id for multi-asic (#18764) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why I did it HLD: sonic-net/SONiC#1643 Remove hard coupling between bgp router-id and IPv4 address of Loopback4096 Add support to explictly specify bgp router id for multi asic device Work item tracking Microsoft ADO (number only): 27801007 How I did it When bgp_router_id configured in DEVICE_METADATA, use it as bgp router-id and originator-id. Remove the hard dependency on loopback4096 ipv4 address when adding ibgp peer. Add UTs. Behavior of set bgp router-id To be clarified that when bgp router-id hasn't been explicitly set, bgp actions would totally like previous Loopback4096 IPv4 address exists Loopback4096 IPv4 address doesn't exist bgp_router_id configured Honor bgp_router_id Honor bgp_router_id bgp_router_id doesn't be configured Honor Loopback4096 IPv4 address FRR default router ID value is selected as the largest IP address of the device. When router zebra is not enabled bgpd can’t get interface information, so router-id is set to 0.0.0.0 Behavior of add bgp peer To be clarified that when bgp router-id hasn't been explicitly set, bgp actions would totally like previous Loopback4096 IPv4 address exists Loopback4096 IPv4 address doesn't exist bgp_router_id configured Add BGP peer Add BGP peer bgp_router_id doesn't be configured Add BGP peer Do not add iBGP peer How to verify it UT passed. --- .../docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 | 11 ++- .../bgpd/templates/internal/policies.conf.j2 | 13 +++- src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py | 8 +- .../policies.conf/param_back_no_lo4096.json | 13 ++++ .../policies.conf/param_back_router_id.json | 17 +++++ .../param_back_router_id_no_lo4096.json | 14 ++++ .../policies.conf/result_back_no_lo4096.conf | 21 ++++++ .../policies.conf/result_back_router_id.conf | 23 ++++++ .../result_back_router_id_no_lo4096.conf | 23 ++++++ .../packet_chassis_ipv6_lo4096.conf | 72 ++++++++++++++++++ .../packet_chassis_ipv6_lo4096.json | 35 +++++++++ .../packet_chassis_ipv6_lo4096_router_id.conf | 73 +++++++++++++++++++ .../packet_chassis_ipv6_lo4096_router_id.json | 36 +++++++++ .../packet_chassis_router_id.conf | 73 +++++++++++++++++++ .../packet_chassis_router_id.json | 37 ++++++++++ src/sonic-bgpcfgd/tests/test_bgp.py | 32 +++++++- src/sonic-bgpcfgd/tests/test_sonic-cfggen.py | 22 +++++- 17 files changed, 508 insertions(+), 15 deletions(-) create mode 100644 src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_no_lo4096.json create mode 100644 src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_router_id.json create mode 100644 src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_router_id_no_lo4096.json create mode 100644 src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_no_lo4096.conf create mode 100644 src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_router_id.conf create mode 100644 src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_router_id_no_lo4096.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096.json create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096_router_id.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096_router_id.json create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_router_id.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_router_id.json diff --git a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 index 1ea4c8ac612c..da6358a00ca6 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 @@ -9,6 +9,7 @@ ! TSA configuration ! {% set lo0_ipv4 = get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip %} +{% set lo4096_ipv4 = get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback4096") | ip %} {% if lo0_ipv4 is not none %} ip prefix-list PL_LoopbackV4 permit {{ lo0_ipv4 }}/32 {% endif %} @@ -89,7 +90,11 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} ! {# set router-id #} {% if DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' or DEVICE_METADATA['localhost']['switch_type'] == 'voq' or DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %} - bgp router-id {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback4096") | ip }} +{% if 'bgp_router_id' in DEVICE_METADATA['localhost'] %} + bgp router-id {{ DEVICE_METADATA["localhost"]["bgp_router_id"] }} +{% elif lo4096_ipv4 is not none %} + bgp router-id {{ lo4096_ipv4 }} +{% endif %} {% else %} {% if "localhost" in DEVICE_METADATA and "bgp_router_id" in DEVICE_METADATA["localhost"] %} bgp router-id {{ DEVICE_METADATA["localhost"]["bgp_router_id"] }} @@ -102,8 +107,8 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} {% if lo0_ipv4 is not none %} network {{ lo0_ipv4 }}/32 {% endif %} -{% if ((multi_asic is defined and DEVICE_METADATA['localhost']['switch_type'] != 'chassis-packet') or (DEVICE_METADATA['localhost']['switch_type'] == 'voq')) %} - network {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback4096") | ip }}/32 route-map HIDE_INTERNAL +{% if lo4096_ipv4 is not none and ((multi_asic is defined and DEVICE_METADATA['localhost']['switch_type'] != 'chassis-packet') or (DEVICE_METADATA['localhost']['switch_type'] == 'voq')) %} + network {{ lo4096_ipv4 }}/32 route-map HIDE_INTERNAL {% endif %} ! {% if get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback0") != 'None' %} diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 index bedc6eeea422..bd341e70d7f4 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 @@ -4,16 +4,25 @@ ! {% from "common/functions.conf.j2" import get_ipv4_loopback_address %} ! +{% set lo4096_ipv4 = get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip %} {% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} route-map FROM_BGP_INTERNAL_PEER_V4 permit 1 - set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} +{% if "localhost" in CONFIG_DB__DEVICE_METADATA and "bgp_router_id" in CONFIG_DB__DEVICE_METADATA["localhost"] %} + set originator-id {{ CONFIG_DB__DEVICE_METADATA["localhost"]["bgp_router_id"] }} +{% elif lo4096_ipv4 is not none%} + set originator-id {{ lo4096_ipv4 }} +{% endif %} ! route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 set ipv6 next-hop prefer-global on-match next ! route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 - set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} +{% if "localhost" in CONFIG_DB__DEVICE_METADATA and "bgp_router_id" in CONFIG_DB__DEVICE_METADATA["localhost"] %} + set originator-id {{ CONFIG_DB__DEVICE_METADATA["localhost"]["bgp_router_id"] }} + {% elif lo4096_ipv4 is not none%} + set originator-id {{ lo4096_ipv4 }} + {% endif %} {% elif CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %} bgp community-list standard DEVICE_INTERNAL_COMMUNITY permit {{ constants.bgp.internal_community }} bgp community-list standard NO_EXPORT permit no-export diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py index 347270f94a50..26202ebc5016 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py @@ -128,9 +128,6 @@ def __init__(self, common_objs, db_name, table_name, peer_type, check_neig_meta) if self.check_deployment_id: deps.append(("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/deployment_id")) - if self.peer_type == 'internal': - deps.append(("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback4096")) - super(BGPPeerMgrBase, self).__init__( common_objs, deps, @@ -175,8 +172,9 @@ def add_peer(self, vrf, nbr, data): # if self.peer_type == 'internal': lo4096_ipv4 = self.get_lo_ipv4("Loopback4096|") - if lo4096_ipv4 is None: - log_warn("Loopback4096 ipv4 address is not presented yet") + if (lo4096_ipv4 is None and "bgp_router_id" + not in self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]): + log_warn("Loopback4096 ipv4 address is not presented yet and bgp_router_id not configured") return False if "local_addr" not in data: diff --git a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_no_lo4096.json b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_no_lo4096.json new file mode 100644 index 000000000000..824193e7e446 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_no_lo4096.json @@ -0,0 +1,13 @@ +{ + "CONFIG_DB__DEVICE_METADATA": { + "localhost": { + "sub_role": "BackEnd" + } + }, + "constants": { + "bgp": { + "internal_community": "12345:556", + "internal_community_match_tag": "101" + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_router_id.json b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_router_id.json new file mode 100644 index 000000000000..8240db6bb5df --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_router_id.json @@ -0,0 +1,17 @@ +{ + "CONFIG_DB__DEVICE_METADATA": { + "localhost": { + "sub_role": "BackEnd", + "bgp_router_id": "8.8.8.8" + } + }, + "CONFIG_DB__LOOPBACK_INTERFACE": { + "Loopback4096|10.10.10.10/32": {} + }, + "constants": { + "bgp": { + "internal_community": "12345:556", + "internal_community_match_tag": "101" + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_router_id_no_lo4096.json b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_router_id_no_lo4096.json new file mode 100644 index 000000000000..13d782a6840c --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back_router_id_no_lo4096.json @@ -0,0 +1,14 @@ +{ + "CONFIG_DB__DEVICE_METADATA": { + "localhost": { + "sub_role": "BackEnd", + "bgp_router_id": "8.8.8.8" + } + }, + "constants": { + "bgp": { + "internal_community": "12345:556", + "internal_community_match_tag": "101" + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_no_lo4096.conf b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_no_lo4096.conf new file mode 100644 index 000000000000..a51f97aac5a8 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_no_lo4096.conf @@ -0,0 +1,21 @@ +! +! template: bgpd/templates/internal/policies.conf.j2 +! +route-map FROM_BGP_INTERNAL_PEER_V4 permit 1 +! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 + set ipv6 next-hop prefer-global + on-match next +! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 +! +route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 +! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 +! +route-map TO_BGP_INTERNAL_PEER_V4 permit 100 +! +route-map TO_BGP_INTERNAL_PEER_V6 permit 100 +! +! end of template: bgpd/templates/internal/policies.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_router_id.conf b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_router_id.conf new file mode 100644 index 000000000000..d067d862d781 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_router_id.conf @@ -0,0 +1,23 @@ +! +! template: bgpd/templates/internal/policies.conf.j2 +! +route-map FROM_BGP_INTERNAL_PEER_V4 permit 1 + set originator-id 8.8.8.8 +! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 + set ipv6 next-hop prefer-global + on-match next +! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 + set originator-id 8.8.8.8 +! +route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 +! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 +! +route-map TO_BGP_INTERNAL_PEER_V4 permit 100 +! +route-map TO_BGP_INTERNAL_PEER_V6 permit 100 +! +! end of template: bgpd/templates/internal/policies.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_router_id_no_lo4096.conf b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_router_id_no_lo4096.conf new file mode 100644 index 000000000000..d067d862d781 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back_router_id_no_lo4096.conf @@ -0,0 +1,23 @@ +! +! template: bgpd/templates/internal/policies.conf.j2 +! +route-map FROM_BGP_INTERNAL_PEER_V4 permit 1 + set originator-id 8.8.8.8 +! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 + set ipv6 next-hop prefer-global + on-match next +! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 + set originator-id 8.8.8.8 +! +route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 +! +route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 +! +route-map TO_BGP_INTERNAL_PEER_V4 permit 100 +! +route-map TO_BGP_INTERNAL_PEER_V6 permit 100 +! +! end of template: bgpd/templates/internal/policies.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096.conf new file mode 100644 index 000000000000..381c5b05a1f0 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096.conf @@ -0,0 +1,72 @@ +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 +! +ipv6 prefix-list PL_LoopbackV6 permit fc00::/64 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.10.10.0/24 +! +ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit fc01::/64 +! +ip prefix-list V4_P2P_IP permit 0.0.0.0/0 ge 31 le 31 +! +ipv6 prefix-list V6_P2P_IP permit ::/0 ge 126 le 126 +! +route-map V4_CONNECTED_ROUTES permit 10 + match ip address prefix-list V4_P2P_IP + call HIDE_INTERNAL +! +route-map V6_CONNECTED_ROUTES permit 10 + match ipv6 address prefix-list V6_P2P_IP + call HIDE_INTERNAL +! +route-map HIDE_INTERNAL permit 10 + set community no-export +! +! +router bgp 55555 +! + bgp log-neighbor-changes + bgp suppress-fib-pending + no bgp default ipv4-unicast + no bgp ebgp-requires-policy +! + bgp bestpath as-path multipath-relax +! +! +! + network 55.55.55.55/32 +! + address-family ipv6 + network fc00::1/64 + network fc00::1/128 route-map HIDE_INTERNAL + exit-address-family +! + network 10.10.10.1/24 + address-family ipv6 + network fc01::1/64 + exit-address-family +! + address-family ipv4 + redistribute connected route-map V4_CONNECTED_ROUTES + exit-address-family + address-family ipv6 + redistribute connected route-map V6_CONNECTED_ROUTES + exit-address-family +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096.json new file mode 100644 index 000000000000..34bc6b33904f --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096.json @@ -0,0 +1,35 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "bgp_asn": "55555", + "sub_role": "FrontEnd", + "switch_type": "chassis-packet", + "type": "SpineRouter" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback0|55.55.55.55/32": {}, + "Loopback0|fc00::1/128": {}, + "Loopback4096|fc00::2/128": {} + }, + "VLAN_INTERFACE": { + "Vlan10|10.10.10.1/24": {}, + "Vlan10|fc01::1/64": {}, + "Vlan20": {"vnet_name": "Vnet1"}, + "Vlan20|20.20.20.1/24": {}, + "Vlan20|fd01::1/64": {} + }, + "constants": { + "bgp": { + "multipath_relax": { + "enabled": true + }, + "graceful_restart": { + "enabled": true + }, + "maximum_paths": { + "enabled": true + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096_router_id.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096_router_id.conf new file mode 100644 index 000000000000..213872f45c70 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096_router_id.conf @@ -0,0 +1,73 @@ +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 +! +ipv6 prefix-list PL_LoopbackV6 permit fc00::/64 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.10.10.0/24 +! +ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit fc01::/64 +! +ip prefix-list V4_P2P_IP permit 0.0.0.0/0 ge 31 le 31 +! +ipv6 prefix-list V6_P2P_IP permit ::/0 ge 126 le 126 +! +route-map V4_CONNECTED_ROUTES permit 10 + match ip address prefix-list V4_P2P_IP + call HIDE_INTERNAL +! +route-map V6_CONNECTED_ROUTES permit 10 + match ipv6 address prefix-list V6_P2P_IP + call HIDE_INTERNAL +! +route-map HIDE_INTERNAL permit 10 + set community no-export +! +! +router bgp 55555 +! + bgp log-neighbor-changes + bgp suppress-fib-pending + no bgp default ipv4-unicast + no bgp ebgp-requires-policy +! + bgp bestpath as-path multipath-relax +! +! + bgp router-id 8.8.8.8 +! + network 55.55.55.55/32 +! + address-family ipv6 + network fc00::1/64 + network fc00::1/128 route-map HIDE_INTERNAL + exit-address-family +! + network 10.10.10.1/24 + address-family ipv6 + network fc01::1/64 + exit-address-family +! + address-family ipv4 + redistribute connected route-map V4_CONNECTED_ROUTES + exit-address-family + address-family ipv6 + redistribute connected route-map V6_CONNECTED_ROUTES + exit-address-family +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096_router_id.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096_router_id.json new file mode 100644 index 000000000000..8ff0d8afb231 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_ipv6_lo4096_router_id.json @@ -0,0 +1,36 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "bgp_asn": "55555", + "sub_role": "FrontEnd", + "switch_type": "chassis-packet", + "type": "SpineRouter", + "bgp_router_id": "8.8.8.8" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback0|55.55.55.55/32": {}, + "Loopback0|fc00::1/128": {}, + "Loopback4096|fc00::2/128": {} + }, + "VLAN_INTERFACE": { + "Vlan10|10.10.10.1/24": {}, + "Vlan10|fc01::1/64": {}, + "Vlan20": {"vnet_name": "Vnet1"}, + "Vlan20|20.20.20.1/24": {}, + "Vlan20|fd01::1/64": {} + }, + "constants": { + "bgp": { + "multipath_relax": { + "enabled": true + }, + "graceful_restart": { + "enabled": true + }, + "maximum_paths": { + "enabled": true + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_router_id.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_router_id.conf new file mode 100644 index 000000000000..213872f45c70 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_router_id.conf @@ -0,0 +1,73 @@ +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ip prefix-list PL_LoopbackV4 permit 55.55.55.55/32 +! +ipv6 prefix-list PL_LoopbackV6 permit fc00::/64 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.10.10.0/24 +! +ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit fc01::/64 +! +ip prefix-list V4_P2P_IP permit 0.0.0.0/0 ge 31 le 31 +! +ipv6 prefix-list V6_P2P_IP permit ::/0 ge 126 le 126 +! +route-map V4_CONNECTED_ROUTES permit 10 + match ip address prefix-list V4_P2P_IP + call HIDE_INTERNAL +! +route-map V6_CONNECTED_ROUTES permit 10 + match ipv6 address prefix-list V6_P2P_IP + call HIDE_INTERNAL +! +route-map HIDE_INTERNAL permit 10 + set community no-export +! +! +router bgp 55555 +! + bgp log-neighbor-changes + bgp suppress-fib-pending + no bgp default ipv4-unicast + no bgp ebgp-requires-policy +! + bgp bestpath as-path multipath-relax +! +! + bgp router-id 8.8.8.8 +! + network 55.55.55.55/32 +! + address-family ipv6 + network fc00::1/64 + network fc00::1/128 route-map HIDE_INTERNAL + exit-address-family +! + network 10.10.10.1/24 + address-family ipv6 + network fc01::1/64 + exit-address-family +! + address-family ipv4 + redistribute connected route-map V4_CONNECTED_ROUTES + exit-address-family + address-family ipv6 + redistribute connected route-map V6_CONNECTED_ROUTES + exit-address-family +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_router_id.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_router_id.json new file mode 100644 index 000000000000..9b037b681bf4 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/packet_chassis_router_id.json @@ -0,0 +1,37 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "bgp_asn": "55555", + "sub_role": "FrontEnd", + "switch_type": "chassis-packet", + "type": "SpineRouter", + "bgp_router_id": "8.8.8.8" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback0|55.55.55.55/32": {}, + "Loopback0|fc00::1/128": {}, + "Loopback4096|55.55.55.56/32": {}, + "Loopback4096|fc00::2/128": {} + }, + "VLAN_INTERFACE": { + "Vlan10|10.10.10.1/24": {}, + "Vlan10|fc01::1/64": {}, + "Vlan20": {"vnet_name": "Vnet1"}, + "Vlan20|20.20.20.1/24": {}, + "Vlan20|fd01::1/64": {} + }, + "constants": { + "bgp": { + "multipath_relax": { + "enabled": true + }, + "graceful_restart": { + "enabled": true + }, + "maximum_paths": { + "enabled": true + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/test_bgp.py b/src/sonic-bgpcfgd/tests/test_bgp.py index 6add8eaf09ed..5b494af4d79a 100644 --- a/src/sonic-bgpcfgd/tests/test_bgp.py +++ b/src/sonic-bgpcfgd/tests/test_bgp.py @@ -21,7 +21,7 @@ def load_constant_files(): return constant_files -def constructor(constants_path, with_lo0_ipv4=True, bgp_router_id=""): +def constructor(constants_path, bgp_router_id="", peer_type="general", with_lo0_ipv4=True, with_lo4096_ipv4=False): cfg_mgr = MagicMock() constants = load_constants(constants_path)['constants'] common_objs = { @@ -37,14 +37,16 @@ def constructor(constants_path, with_lo0_ipv4=True, bgp_router_id=""): } bgpcfgd.managers_bgp.run_command = lambda cmd: return_value_map[str(cmd)] - m = bgpcfgd.managers_bgp.BGPPeerMgrBase(common_objs, "CONFIG_DB", swsscommon.CFG_BGP_NEIGHBOR_TABLE_NAME, "general", True) - assert m.peer_type == "general" + m = bgpcfgd.managers_bgp.BGPPeerMgrBase(common_objs, "CONFIG_DB", swsscommon.CFG_BGP_NEIGHBOR_TABLE_NAME, peer_type, True) + assert m.peer_type == peer_type assert m.check_neig_meta == ('bgp' in constants and 'use_neighbors_meta' in constants['bgp'] and constants['bgp']['use_neighbors_meta']) localhost_obj = {"bgp_asn": "65100"} if len(bgp_router_id) != 0: localhost_obj["bgp_router_id"] = bgp_router_id m.directory.put("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost", localhost_obj) + if with_lo4096_ipv4: + m.directory.put("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback4096|11.11.11.11/32", {}) if with_lo0_ipv4: m.directory.put("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0|11.11.11.11/32", {}) m.directory.put("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0|FC00:1::32/128", {}) @@ -104,6 +106,28 @@ def test_add_peer(): res = m.set_handler("30.30.30.1", {'asn': '65200', 'holdtime': '180', 'keepalive': '60', 'local_addr': '30.30.30.30', 'name': 'TOR', 'nhopself': '0', 'rrclient': '0'}) assert res, "Expect True return value" +def test_add_peer_internal(): + for constant in load_constant_files(): + m = constructor(constant, peer_type="internal", with_lo4096_ipv4=True) + res = m.set_handler("30.30.30.1", {'asn': '65200', 'holdtime': '180', 'keepalive': '60', 'local_addr': '30.30.30.30', 'name': 'TOR', 'nhopself': '0', 'rrclient': '0'}) + assert res, "Expect True return value" + +def test_add_peer_internal_no_router_id_no_lo4096(): + for constant in load_constant_files(): + m = constructor(constant, peer_type="internal") + res = m.set_handler("30.30.30.1", {'asn': '65200', 'holdtime': '180', 'keepalive': '60', 'local_addr': '30.30.30.30', 'name': 'TOR', 'nhopself': '0', 'rrclient': '0'}) + assert not res, "Expect False return value" + +def test_add_peer_internal_router_id(): + for constant in load_constant_files(): + m = constructor(constant, bgp_router_id="8.8.8.8", peer_type="internal", with_lo4096_ipv4=True) + res = m.set_handler("30.30.30.1", {'asn': '65200', 'holdtime': '180', 'keepalive': '60', 'local_addr': '30.30.30.30', 'name': 'TOR', 'nhopself': '0', 'rrclient': '0'}) + assert res, "Expect True return value" + +def test_add_peer_internal_router_id_no_lo4096(): + for constant in load_constant_files(): + m = constructor(constant, bgp_router_id="8.8.8.8", peer_type="internal") + def test_add_peer_router_id(): for constant in load_constant_files(): m = constructor(constant, bgp_router_id="8.8.8.8") @@ -118,7 +142,7 @@ def test_add_peer_without_lo_ipv4(): def test_add_peer_without_lo_ipv4_router_id(): for constant in load_constant_files(): - m = constructor(constant, with_lo0_ipv4=False, bgp_router_id="8.8.8.8") + m = constructor(constant, bgp_router_id="8.8.8.8", with_lo0_ipv4=False) res = m.set_handler("30.30.30.1", {'asn': '65200', 'holdtime': '180', 'keepalive': '60', 'local_addr': '30.30.30.30', 'name': 'TOR', 'nhopself': '0', 'rrclient': '0'}) assert res, "Expect True return value" diff --git a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py index d230197b710c..b5685b7332f0 100644 --- a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py +++ b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py @@ -24,6 +24,9 @@ def run_test(name, template_path, json_path, match_path): with open(match_path) as result_fp: raw_saved_result = result_fp.read() canonical_saved_result = ConfigMgr.to_canonical(raw_saved_result) + print(canonical_generated_result) + print("----") + print(canonical_saved_result) assert canonical_saved_result == canonical_generated_result, "Test %s" % name @@ -153,6 +156,24 @@ def test_bgp_conf_all(): "bgpd.conf.j2/all.json", "bgpd.conf.j2/all.conf") +def test_bgp_conf_packet_chassis_ipv6_lo4096(): + run_test("packet chassis ipv6 loopback4096 bgpd.main.conf.j2", + "bgpd/bgpd.main.conf.j2", + "bgpd.main.conf.j2/packet_chassis_ipv6_lo4096.json", + "bgpd.main.conf.j2/packet_chassis_ipv6_lo4096.conf") + +def test_bgp_conf_packet_chassis_ipv6_lo4096_router_id(): + run_test("packet chassis ipv6 loopback4096 with router_id bgpd.main.conf.j2", + "bgpd/bgpd.main.conf.j2", + "bgpd.main.conf.j2/packet_chassis_ipv6_lo4096_router_id.json", + "bgpd.main.conf.j2/packet_chassis_ipv6_lo4096_router_id.conf") + +def test_bgp_conf_packet_chassis_router_id(): + run_test("packet chassis with router_id bgpd.main.conf.j2", + "bgpd/bgpd.main.conf.j2", + "bgpd.main.conf.j2/packet_chassis_router_id.json", + "bgpd.main.conf.j2/packet_chassis_router_id.conf") + def test_bgpd_main_conf_lo0_ipv6_only(): run_test("Base bgpd.main.conf.j2", "bgpd/bgpd.main.conf.j2", @@ -170,4 +191,3 @@ def test_bgpd_main_conf_defaults_router_id(): "bgpd/bgpd.main.conf.j2", "bgpd.main.conf.j2/defaults_router_id.json", "bgpd.main.conf.j2/defaults_router_id.conf") - \ No newline at end of file From 38fe4670d29f0418adda592dc83e288b27ef2ac1 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 16 May 2024 19:01:14 +0800 Subject: [PATCH 108/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18969) #### Why I did it src/sonic-swss ``` * c36333c3 - (HEAD -> master, origin/master, origin/HEAD) New p4orch development changes (#3066) (6 hours ago) [mint570] * 26a5a1cb - Fix flex counter out-of-order issue by notifying counter operations using SelectableChannel (#3076) (10 hours ago) [Stephen Sun] * 2f8bd9cf - Add support for ECMP and LAG hash offset (#3138) (28 hours ago) [Kumaresh Perumal] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 2aaca4179423..c36333c3d757 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 2aaca41794237cb6516866da2d0c7e29e31f44d2 +Subproject commit c36333c3d7573a249991df5357955f0189ab4ada From 9aef5610964ae42a614206ece25845a13d4ddb91 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 16 May 2024 19:01:23 +0800 Subject: [PATCH 109/282] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#18959) #### Why I did it src/sonic-host-services ``` * 10bfa90 - (HEAD -> master, origin/master, origin/HEAD) Add new API to support config replace (#125) (25 hours ago) [ganglv] * 1a8ff81 - Fix issue: delayed service will not be restarted if swss crashes (#107) (3 days ago) [Junchao-Mellanox] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index aa841298691d..10bfa901a78d 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit aa841298691dffd1ac0b527eb784928c08547cc2 +Subproject commit 10bfa901a78d678edc7ed00187f7d97870b22e26 From 0a6160acb33046cfa62ab2728b0f97c70afb99fb Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 17 May 2024 04:05:05 +0800 Subject: [PATCH 110/282] [ci/build]: Upgrade SONiC package versions (#18972) --- .../build-sonic-slave-bookworm/versions-py3 | 2 +- files/build/versions/default/versions-git | 12 +++---- files/build/versions/default/versions-mirror | 28 ++++++++-------- files/build/versions/default/versions-web | 2 +- .../versions-deb-buster | 2 +- .../dockers/docker-dhcp-relay/versions-py3 | 2 +- .../dockers/docker-ptf/versions-deb-buster | 4 +-- .../docker-sflow/versions-deb-bookworm | 33 +++++++++++++++++++ .../docker-sflow/versions-deb-bullseye | 30 ----------------- .../versions-deb-buster | 2 +- .../dockers/sonic-slave-bookworm/versions-py3 | 2 +- .../dockers/sonic-slave-bullseye/versions-py3 | 2 +- .../sonic-slave-buster/versions-deb-buster | 10 +++--- .../dockers/sonic-slave-buster/versions-py3 | 2 +- .../versions/host-image/versions-deb-bookworm | 1 + 15 files changed, 69 insertions(+), 65 deletions(-) create mode 100644 files/build/versions/dockers/docker-sflow/versions-deb-bookworm delete mode 100644 files/build/versions/dockers/docker-sflow/versions-deb-bullseye diff --git a/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 b/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 index 8007697ea3bb..322deae41746 100644 --- a/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 @@ -9,7 +9,7 @@ docker==7.0.0 docker-image-py==0.1.12 enlighten==1.12.4 filelock==3.14.0 -freezegun==1.5.0 +freezegun==1.5.1 ijson==3.2.3 ipaddress==1.0.23 jsondiff==2.0.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index f52de7666d54..41a9a05ebc06 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,11 +1,11 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==a9b9284faf89cd1a426371237df8307c328cc818 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==5a86d1cc3934b7a388c29b6005f64675c56c9949 https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 -https://github.com/flashrom/flashrom.git==a67b7963a0f8f671fe3d3db54c803a068b93f2c4 -https://github.com/FreeRADIUS/freeradius-server.git==ae174ae97d3274cb168a87e445348845b1da07a2 +https://github.com/flashrom/flashrom.git==e177e77f9fa2ee0a1bd459df27558528d8dabc8e +https://github.com/FreeRADIUS/freeradius-server.git==e42947b083e77e0c6fc5d2c4de090f5d18eb06ae https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/lguohan/gnxi.git==3adf8b97755b49947e465b5a14645f11e79fa0cd @@ -15,7 +15,7 @@ https://github.com/p4lang/ptf.git==c554f83685186be4cfa9387eb5d6d700d2bbd7c0 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 -https://github.com/thom311/libnl==7cc72d19f84698a194bee843af66be9be6179baa -https://salsa.debian.org/kernel-team/initramfs-tools.git==cf964bfb4362019fd7fba1e839e403ff950dca8e +https://github.com/thom311/libnl==6db85366264c9c83e0d53995bfb68e0150184cb4 +https://salsa.debian.org/kernel-team/initramfs-tools.git==8801fda185d2accf39c4095858f76089799bfc7e https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==52d8a44435f69123efb98d0e7c128b4a81e8aacb +https://salsa.debian.org/ssh-team/openssh.git==703b8198a123f57fd09e555a4c62b2d55273d57b diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index c699c20d010e..f198371892fb 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,20 +1,20 @@ deb.nodesource.com_node%5f14.x_dists_bookworm==2023-02-17T00:35:29Z deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20240510T000228Z -debian-security==20240510T000251Z +debian==20240514T000307Z +debian-security==20240514T000247Z download.docker.com_linux_debian_dists_bookworm==2024-05-10T08:31:56Z download.docker.com_linux_debian_dists_bullseye==2024-05-10T08:31:56Z download.docker.com_linux_debian_dists_buster==2024-05-09T09:19:41Z -packages.trafficmanager.net_snapshot_debian-security_20240510T000251Z_dists_bookworm-security==2024-05-09T22:23:01Z -packages.trafficmanager.net_snapshot_debian-security_20240510T000251Z_dists_bullseye-security==2024-05-09T22:23:00Z -packages.trafficmanager.net_snapshot_debian-security_20240510T000251Z_dists_buster_updates==2024-05-09T22:23:00Z -packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bookworm==2024-02-10T11:07:25Z -packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bookworm-backports==2024-05-09T20:12:26Z -packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bookworm-updates==2024-05-09T20:12:26Z -packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bullseye-backports==2024-05-09T20:12:26Z -packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_bullseye-updates==2024-05-09T20:12:26Z -packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240510T000228Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20240514T000247Z_dists_bookworm-security==2024-05-13T21:03:23Z +packages.trafficmanager.net_snapshot_debian-security_20240514T000247Z_dists_bullseye-security==2024-05-13T21:03:22Z +packages.trafficmanager.net_snapshot_debian-security_20240514T000247Z_dists_buster_updates==2024-05-13T21:03:21Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bookworm==2024-02-10T11:07:25Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bookworm-backports==2024-05-13T20:15:31Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bookworm-updates==2024-05-13T20:15:31Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye-backports==2024-05-13T20:15:31Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye-updates==2024-05-13T20:15:31Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 15e5c98151d6..4ef245014a90 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -14,7 +14,7 @@ http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.6.0.orig.tar.gz http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.debian.tar.xz==f457e44218a7d4cc7b7ab0ed696096e3 http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.dsc==d8e34e7b07473c6903f9d245934524fb http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12.orig.tar.gz==d38562490234d8080bdbe8eb7baf937a -http://www.iana.org/assignments/enterprise-numbers.txt==1ab53990feba6e1917592d0b085740ff +http://www.iana.org/assignments/enterprise-numbers.txt==a34d6d99898f7230f1bc9c8087923818 http://www.mellanox.com/downloads/MFT/mft-4.27.0-83-x86_64-deb.tgz==e475ca87a9252ba8d0abb6b05d5d94d0 https://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz==c64434548438df2cb1e53fb27c600e85 https://bootstrap.pypa.io/pip/2.7/get-pip.py==60e8267eb1b7bc71dc4843eb7bd294d3 diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster index f6ec0e97af11..da9912ab623b 100644 --- a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster @@ -8,7 +8,7 @@ libc-dev-bin==2.28-10+deb10u3 libc6==2.28-10+deb10u3 libc6-dev==2.28-10+deb10u3 libdpkg-perl==1.19.8 -libglib2.0-0==2.58.3-2+deb10u5 +libglib2.0-0==2.58.3-2+deb10u6 libhiredis0.14==0.14.0-3 libicu-dev==63.1-6+deb10u3 libicu63==63.1-6+deb10u3 diff --git a/files/build/versions/dockers/docker-dhcp-relay/versions-py3 b/files/build/versions/dockers/docker-dhcp-relay/versions-py3 index 23bb524ebaaf..7d60ac8db299 100644 --- a/files/build/versions/dockers/docker-dhcp-relay/versions-py3 +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-py3 @@ -1,3 +1,3 @@ -freezegun==1.5.0 +freezegun==1.5.1 psutil==5.9.8 python-dateutil==2.9.0.post0 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index 518fcc70e7de..dd4ff86f9104 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -174,8 +174,8 @@ libgirepository-1.0-1==1.58.3-2 libgl1==1.1.0-1 libgl1-mesa-dri==18.3.6-2+deb10u1 libglapi-mesa==18.3.6-2+deb10u1 -libglib2.0-0==2.58.3-2+deb10u5 -libglib2.0-data==2.58.3-2+deb10u5 +libglib2.0-0==2.58.3-2+deb10u6 +libglib2.0-data==2.58.3-2+deb10u6 libglvnd0==1.1.0-1 libglx-mesa0==18.3.6-2+deb10u1 libglx0==1.1.0-1 diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-bookworm b/files/build/versions/dockers/docker-sflow/versions-deb-bookworm new file mode 100644 index 000000000000..d4868ac3d886 --- /dev/null +++ b/files/build/versions/dockers/docker-sflow/versions-deb-bookworm @@ -0,0 +1,33 @@ +dmidecode==3.4-1 +gdb==13.1-3 +gdbserver==13.1-3 +hsflowd==2.0.51-26 +hsflowd-dbgsym==2.0.51-26 +libbabeltrace1==1.5.11-1+b2 +libboost-regex1.74.0==1.74.0+ds1-21 +libcbor0.8==0.8.0-2+b1 +libcurl3-gnutls==7.88.1-10+deb12u5 +libdebuginfod-common==0.188-2.1 +libdebuginfod1==0.188-2.1 +libdw1==0.188-2.1 +libedit2==3.1-20221030-2 +libfido2-1==1.12.0-2+b1 +libglib2.0-0==2.74.6-2+deb12u2 +libgpm2==1.20.7-10+b1 +libicu72==72.1-3 +libipt2==2.0.5-1 +libmpfr6==4.2.0-1 +libsource-highlight-common==3.1.9-4.2 +libsource-highlight4v5==3.1.9-4.2+b3 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.6.2-3 +openssh-client==1:9.2p1-2+deb12u2 +psample==1.1-1 +sensible-utils==0.0.17+nmu1 +sflowtool==5.04 +sshpass==1.09-1+b1 +strace==6.1-0.1 +swss-dbg==1.0.0 +ucf==3.0043+nmu1 +vim==2:9.0.1378-2 +vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye b/files/build/versions/dockers/docker-sflow/versions-deb-bullseye deleted file mode 100644 index 351cd823756a..000000000000 --- a/files/build/versions/dockers/docker-sflow/versions-deb-bullseye +++ /dev/null @@ -1,30 +0,0 @@ -dmidecode==3.3-2 -gdb==10.1-1.7 -gdbserver==10.1-1.7 -hsflowd==2.0.51-26 -hsflowd-dbg==2.0.51-26 -libbabeltrace1==1.5.8-1+b3 -libboost-regex1.74.0==1.74.0-9 -libcbor0==0.5.0+dfsg-2 -libcurl3-gnutls==7.74.0-1.3+deb11u11 -libdebuginfod1==0.183-1 -libdw1==0.183-1 -libedit2==3.1-20191231-2+b1 -libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u3 -libgpm2==1.20.7-8 -libicu67==67.1-7 -libipt2==2.0.3-1 -libmpfr6==4.1.0-3 -libsource-highlight-common==3.1.9-3 -libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbgsym==1.0.0 -libunwind8==1.3.2-2 -openssh-client==1:8.4p1-5+deb11u3 -psample==1.1-1 -sflowtool==5.04 -sshpass==1.09-1+b1 -strace==5.10-1 -swss-dbg==1.0.0 -vim==2:8.2.2434-3+deb11u1 -vim-runtime==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster index 84f912677860..9515fdc04786 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster @@ -7,7 +7,7 @@ libcjson1==1.7.10-1.1+deb10u2 libcurl3-gnutls==7.64.0-4+deb10u9 libdw1==0.176-1.1+deb10u1 libedit2==3.1-20181209-1 -libglib2.0-0==2.58.3-2+deb10u5 +libglib2.0-0==2.58.3-2+deb10u6 libgpm2==1.20.7-5 libicu63==63.1-6+deb10u3 libipt2==2.0-2 diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 index 7781b8119a66..0f751c5881ed 100644 --- a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 @@ -80,7 +80,7 @@ pyangbind==0.8.2 pyasn1==0.4.8 pyasn1-modules==0.2.8 pyelftools==0.29 -pyfakefs==5.4.1 +pyfakefs==5.5.0 pygments==2.14.0 pygobject==3.42.2 pyhamcrest==2.0.3 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index 43bbe1c30455..9481bff74f72 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -70,7 +70,7 @@ pyangbind==0.8.1 pyasn1==0.4.8 pyasn1-modules==0.2.1 pycurl==7.43.0.6 -pyfakefs==5.4.1 +pyfakefs==5.5.0 pygments==2.7.1 pygobject==3.38.0 pyhamcrest==1.9.0 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index 42298a8462e5..18c959d3ad97 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -566,11 +566,11 @@ libgl1-mesa-dri==18.3.6-2+deb10u1 libglapi-mesa==18.3.6-2+deb10u1 libgles1==1.1.0-1 libgles2==1.1.0-1 -libglib2.0-0==2.58.3-2+deb10u5 -libglib2.0-bin==2.58.3-2+deb10u5 -libglib2.0-data==2.58.3-2+deb10u5 -libglib2.0-dev==2.58.3-2+deb10u5 -libglib2.0-dev-bin==2.58.3-2+deb10u5 +libglib2.0-0==2.58.3-2+deb10u6 +libglib2.0-bin==2.58.3-2+deb10u6 +libglib2.0-data==2.58.3-2+deb10u6 +libglib2.0-dev==2.58.3-2+deb10u6 +libglib2.0-dev-bin==2.58.3-2+deb10u6 libglu1-mesa==9.0.0-2.1+b3 libglu1-mesa-dev==9.0.0-2.1+b3 libglvnd-core-dev==1.1.0-1 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 index bb6e871567d8..169a0f62a0fe 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -49,7 +49,7 @@ pyang==2.4.0 pyangbind==0.8.1 pycrypto==2.6.1 pycurl==7.43.0.2 -pyfakefs==5.4.1 +pyfakefs==5.5.0 pygments==2.3.1 pygobject==3.30.4 pympler==0.8 diff --git a/files/build/versions/host-image/versions-deb-bookworm b/files/build/versions/host-image/versions-deb-bookworm index 5be3e86e8fe7..360701181fb0 100644 --- a/files/build/versions/host-image/versions-deb-bookworm +++ b/files/build/versions/host-image/versions-deb-bookworm @@ -384,6 +384,7 @@ util-linux-extra==2.38.1-5+deb12u1 vim==2:9.0.1378-2 vim-common==2:9.0.1378-2 vim-runtime==2:9.0.1378-2 +wireless-regdb==2022.06.06-1 x11-common==1:7.7+23 xml-core==0.18+nmu1 xxd==2:9.0.1378-2 From c710002cb3059ba26c7d7e1efdf60a5a281eee16 Mon Sep 17 00:00:00 2001 From: Arvindsrinivasan Lakshmi Narasimhan <55814491+arlakshm@users.noreply.github.com> Date: Thu, 16 May 2024 14:43:33 -0700 Subject: [PATCH 111/282] [Chassis][Voq]Update sonic-buffer-queue and sonic-queue for Voq Chassis (#18875) Why I did it The configuration for QUEUE and BUFFER_QUEUE differs between a VOQ device and a Non-VOQ devices. For the Voq device: The queue and buffer queue is applied on the system port. The system port is a representation of every port in a chassis, the key for systemport consists of Linecard Name , Asic Name and portname On a Non voq device: the queue and buffer queue configuration is applied on the front panel port. Due to this differences the yang models sonic-queue.yang and sonic-buffer-queue.yang does not work for Voq devices This is address in this PR Microsoft ADO (27252773 and 27252696): How I did it Update the yang model to have different CONFIG_LIST with different keys based on the following condition when the switch_type is not present or switch_type is not voq, the yang LIST will have key of port and queue_index when the switch_type is present and switch_type is voqhe yang LIST will have key of Linecard name, asi name, port and queue_index How to verify it UT and incremental config push on chassis --- .../tests/files/sample_config_db.json | 1 - .../yang_model_tests/tests/buffer_queue.json | 3 + .../tests/yang_model_tests/tests/qos.json | 3 + .../tests_config/buffer_queue.json | 256 +++++++++++------- .../yang_model_tests/tests_config/qos.json | 63 +++++ .../yang-models/sonic-buffer-queue.yang | 55 ++++ .../yang-models/sonic-queue.yang | 60 +++- 7 files changed, 334 insertions(+), 107 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 9dc0b75e0c07..b6e6ef07045c 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -362,7 +362,6 @@ "region": "usfoo", "asic_name": "Asic0", "switch_id": "2", - "switch_type": "voq", "max_cores": "8", "sub_role": "FrontEnd", "dhcp_server": "disabled", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_queue.json b/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_queue.json index d6e05eeafb4b..32619dcd5fb0 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_queue.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_queue.json @@ -13,5 +13,8 @@ "BUFFER_QUEUE_WRONG_PORT_VALUE": { "desc": "BUFFER_QUEUE_WRONG_PORT_VALUE pattern failure", "eStr": "wrong" + }, + "VOQ_BUFFER_QUEUE_CONFIG": { + "desc": "VOQ_BUFFER_QUEUE_CONFIG has no failure" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json b/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json index 47905cadf149..3b0199106472 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json @@ -85,5 +85,8 @@ "QUEUE_WRED_NOT_EXIST": { "desc": "Referring non-existing WRED table.", "eStrKey" : "LeafRef" + }, + "VOQ_QUEUE_CONFIG": { + "desc": "Attach scheduler and wred profiles to VOQ." } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_queue.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_queue.json index e737c129682e..91a39a89e3a5 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_queue.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_queue.json @@ -3,51 +3,51 @@ "sonic-port:sonic-port": { "sonic-port:PORT": { "PORT_LIST": [ - { - "admin_status": "up", - "alias": "eth0", - "description": "Ethernet0", - "lanes": "65", - "mtu": "9000", - "name": "Ethernet4", - "tpid": "0x8100", - "speed": "25000" - } + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "65", + "mtu": "9000", + "name": "Ethernet4", + "tpid": "0x8100", + "speed": "25000" + } ] } }, "sonic-buffer-pool:sonic-buffer-pool": { "sonic-buffer-pool:BUFFER_POOL": { "BUFFER_POOL_LIST": [ - { - "name": "egress_lossless_pool", - "mode": "static", - "size": "12766208", - "type": "ingress" - } + { + "name": "egress_lossless_pool", + "mode": "static", + "size": "12766208", + "type": "ingress" + } ] } }, "sonic-buffer-profile:sonic-buffer-profile": { "sonic-buffer-profile:BUFFER_PROFILE": { "BUFFER_PROFILE_LIST": [ - { - "name": "lossless_buffer_profile", - "size": 1518, - "dynamic_th": "2", - "pool": "egress_lossless_pool" - } + { + "name": "lossless_buffer_profile", + "size": 1518, + "dynamic_th": "2", + "pool": "egress_lossless_pool" + } ] } }, "sonic-buffer-queue:sonic-buffer-queue": { "sonic-buffer-queue:BUFFER_QUEUE": { "BUFFER_QUEUE_LIST": [ - { - "port": "Ethernet4", - "qindex": "15", - "profile": "lossless_buffer_profile" - } + { + "port": "Ethernet4", + "qindex": "15", + "profile": "lossless_buffer_profile" + } ] } } @@ -56,50 +56,50 @@ "sonic-port:sonic-port": { "sonic-port:PORT": { "PORT_LIST": [ - { - "admin_status": "up", - "alias": "eth0", - "description": "Ethernet0", - "lanes": "65", - "mtu": "9000", - "name": "Ethernet4", - "tpid": "0x8100", - "speed": "25000" - } + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "65", + "mtu": "9000", + "name": "Ethernet4", + "tpid": "0x8100", + "speed": "25000" + } ] } }, "sonic-buffer-pool:sonic-buffer-pool": { "sonic-buffer-pool:BUFFER_POOL": { "BUFFER_POOL_LIST": [ - { - "name": "egress_lossless_pool", - "mode": "static", - "size": "12766208", - "type": "ingress" - } + { + "name": "egress_lossless_pool", + "mode": "static", + "size": "12766208", + "type": "ingress" + } ] } }, "sonic-buffer-profile:sonic-buffer-profile": { "sonic-buffer-profile:BUFFER_PROFILE": { "BUFFER_PROFILE_LIST": [ - { - "name": "lossless_buffer_profile", - "size": "1518", - "pool": "egress_lossless_pool" - } + { + "name": "lossless_buffer_profile", + "size": "1518", + "pool": "egress_lossless_pool" + } ] } }, "sonic-buffer-queue:sonic-buffer-queue": { "sonic-buffer-queue:BUFFER_QUEUE": { "BUFFER_QUEUE_LIST": [ - { - "port": "Ethernet4", - "qindex": "3", - "profile": "wrong" - } + { + "port": "Ethernet4", + "qindex": "3", + "profile": "wrong" + } ] } } @@ -108,50 +108,50 @@ "sonic-port:sonic-port": { "sonic-port:PORT": { "PORT_LIST": [ - { - "admin_status": "up", - "alias": "eth0", - "description": "Ethernet0", - "lanes": "65", - "mtu": "9000", - "name": "Ethernet4", - "tpid": "0x8100", - "speed": "25000" - } + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "65", + "mtu": "9000", + "name": "Ethernet4", + "tpid": "0x8100", + "speed": "25000" + } ] } }, "sonic-buffer-pool:sonic-buffer-pool": { "sonic-buffer-pool:BUFFER_POOL": { "BUFFER_POOL_LIST": [ - { - "name": "egress_lossless_pool", - "mode": "static", - "size": "12766208", - "type": "ingress" - } + { + "name": "egress_lossless_pool", + "mode": "static", + "size": "12766208", + "type": "ingress" + } ] } }, "sonic-buffer-profile:sonic-buffer-profile": { "sonic-buffer-profile:BUFFER_PROFILE": { "BUFFER_PROFILE_LIST": [ - { - "name": "lossless_buffer_profile", - "size": "1518", - "pool": "egress_lossless_pool" - } + { + "name": "lossless_buffer_profile", + "size": "1518", + "pool": "egress_lossless_pool" + } ] } }, "sonic-buffer-queue:sonic-buffer-queue": { "sonic-buffer-queue:BUFFER_QUEUE": { "BUFFER_QUEUE_LIST": [ - { - "port": "Ethernet4", - "qindex": "16", - "profile": "lossless_buffer_profile" - } + { + "port": "Ethernet4", + "qindex": "16", + "profile": "lossless_buffer_profile" + } ] } } @@ -160,52 +160,98 @@ "sonic-port:sonic-port": { "sonic-port:PORT": { "PORT_LIST": [ - { - "admin_status": "up", - "alias": "eth0", - "description": "Ethernet0", - "lanes": "65", - "mtu": "9000", - "name": "Ethernet4", - "tpid": "0x8100", - "speed": "25000" - } + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "65", + "mtu": "9000", + "name": "Ethernet4", + "tpid": "0x8100", + "speed": "25000" + } ] } }, "sonic-buffer-pool:sonic-buffer-pool": { "sonic-buffer-pool:BUFFER_POOL": { "BUFFER_POOL_LIST": [ - { - "name": "egress_lossless_pool", - "mode": "static", - "size": "12766208", - "type": "ingress" - } + { + "name": "egress_lossless_pool", + "mode": "static", + "size": "12766208", + "type": "ingress" + } ] } }, "sonic-buffer-profile:sonic-buffer-profile": { "sonic-buffer-profile:BUFFER_PROFILE": { "BUFFER_PROFILE_LIST": [ - { - "name": "lossless_buffer_profile", - "size": "1518", - "pool": "egress_lossless_pool" - } + { + "name": "lossless_buffer_profile", + "size": "1518", + "pool": "egress_lossless_pool" + } ] } }, "sonic-buffer-queue:sonic-buffer-queue": { "sonic-buffer-queue:BUFFER_QUEUE": { "BUFFER_QUEUE_LIST": [ - { - "port": "wrong", - "qindex": "4", - "profile": "lossless_buffer_profile" + { + "port": "wrong", + "qindex": "4", + "profile": "lossless_buffer_profile" + } + ] + } + } + }, + "VOQ_BUFFER_QUEUE_CONFIG": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "switch_type": "voq" } + } + }, + "sonic-buffer-pool:sonic-buffer-pool": { + "sonic-buffer-pool:BUFFER_POOL": { + "BUFFER_POOL_LIST": [ + { + "name": "egress_lossless_pool", + "mode": "static", + "size": "12766208", + "type": "ingress" + } + ] + } + }, + "sonic-buffer-profile:sonic-buffer-profile": { + "sonic-buffer-profile:BUFFER_PROFILE": { + "BUFFER_PROFILE_LIST": [ + { + "name": "lossless_buffer_profile", + "size": 1518, + "dynamic_th": "2", + "pool": "egress_lossless_pool" + } + ] + } + }, + "sonic-buffer-queue:sonic-buffer-queue": { + "sonic-buffer-queue:BUFFER_QUEUE": { + "VOQ_BUFFER_QUEUE_LIST": [ + { + "hostname": "lc1", + "asic_name": "asic0", + "port": "Ethernet4", + "qindex": "15", + "profile": "lossless_buffer_profile" + } ] } } } -} +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json index 3b846d4ecf18..a26ff7f5855c 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json @@ -511,5 +511,68 @@ ] } } + }, + "VOQ_QUEUE_CONFIG": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "switch_type": "voq" + } + } + }, + "sonic-scheduler:sonic-scheduler":{ + "sonic-scheduler:SCHEDULER": { + "SCHEDULER_LIST": [ + { + "name":"Test@0", + "cbs": 256, + "cir": 1250000, + "meter_type": "bytes", + "pbs": 1024, + "pir": 25000000, + "type": "DWRR", + "weight": 10 + } + ] + } + }, + "sonic-wred-profile:sonic-wred-profile":{ + "sonic-wred-profile:WRED_PROFILE": { + "WRED_PROFILE_LIST": [ + { + "name":"Wred1", + "yellow_min_threshold": 2048, + "green_min_threshold": 4096, + "red_min_threshold": 1024, + "yellow_max_threshold": 4096, + "green_max_threshold": 8192, + "red_max_threshold": 2048, + "ecn": "ecn_none", + "wred_green_enable": true, + "wred_yellow_enable": true, + "wred_red_enable": true, + "yellow_drop_probability": 50, + "green_drop_probability": 25, + "red_drop_probability": 100 + } + ] + } + }, + + "sonic-queue:sonic-queue": { + "sonic-queue:QUEUE": { + "VOQ_QUEUE_LIST": [ + { + "hostname": "lc1", + "asic_name": "asic0", + "ifname": "Ethernet0", + "qindex": "0", + "scheduler": "Test@0", + "wred_profile": "Wred1" + } + ] + } + } } + } diff --git a/src/sonic-yang-models/yang-models/sonic-buffer-queue.yang b/src/sonic-yang-models/yang-models/sonic-buffer-queue.yang index bd1130fcc4e2..3e96db23c16c 100644 --- a/src/sonic-yang-models/yang-models/sonic-buffer-queue.yang +++ b/src/sonic-yang-models/yang-models/sonic-buffer-queue.yang @@ -14,6 +14,14 @@ module sonic-buffer-queue { prefix bpf; } + import sonic-device_metadata { + prefix sdm; + } + + import sonic-types { + prefix stypes; + } + organization "SONiC"; @@ -34,6 +42,9 @@ module sonic-buffer-queue { container BUFFER_QUEUE { list BUFFER_QUEUE_LIST { + when "not(/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type) or + (/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type!='voq')"; + key "port qindex"; leaf port { @@ -61,6 +72,50 @@ module sonic-buffer-queue { } } + list VOQ_BUFFER_QUEUE_LIST { + when "boolean(/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type) and + (/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type='voq')"; + + key "hostname asic_name port qindex"; + + + leaf hostname { + type stypes:hostname; + } + + leaf asic_name { + type string { + pattern "[Aa]sic[0-4]"; + } + } + + leaf port { + type string { + length 1..128; + } + + description "port name."; + } + + leaf qindex { + type string { + pattern "(1[0-5]|[0-9])((-)(1[0-5]|[0-9]))?"{ + error-message "Invalid Q-index"; + error-app-tag qindex-invalid; + } + } + description "Egress Queue Index for a port"; + } + + leaf profile { + default 0; + type leafref { + path "/bpf:sonic-buffer-profile/bpf:BUFFER_PROFILE/bpf:BUFFER_PROFILE_LIST/bpf:name"; + } + description "Buffer Profile associated with Priority Queue for a port"; + } + + } } } } diff --git a/src/sonic-yang-models/yang-models/sonic-queue.yang b/src/sonic-yang-models/yang-models/sonic-queue.yang index c29c61387c17..e491a50b01d2 100644 --- a/src/sonic-yang-models/yang-models/sonic-queue.yang +++ b/src/sonic-yang-models/yang-models/sonic-queue.yang @@ -22,6 +22,14 @@ module sonic-queue { prefix wrd; } + import sonic-device_metadata { + prefix sdm; + } + + import sonic-types { + prefix stypes; + } + organization "SONiC"; @@ -43,10 +51,12 @@ module sonic-queue { description "QUEUE part of config_db.json"; list QUEUE_LIST { + when "not(/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type) or + (/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type!='voq')"; key "ifname qindex"; - // sonic-ext:key-pattern "QUEUE|{ifname}|{qindex}"; //special pattern used for extracting keys from redis-key and populate the yang instance +// sonic-ext:key-pattern "QUEUE|{ifname}|{qindex}"; //special pattern used for extracting keys from redis-key and populate the yang instance // Total list instances = number(key1) * number(key2) * number(key3) leaf ifname { @@ -83,6 +93,54 @@ module sonic-queue { description "Wred profile for queue."; } } + + list VOQ_QUEUE_LIST { + when "boolean(/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type) and + (/sdm:sonic-device_metadata/sdm:DEVICE_METADATA/sdm:localhost/sdm:switch_type='voq')"; + key "hostname asic_name ifname qindex"; + + + leaf hostname { + type stypes:hostname; + } + + leaf asic_name { + type string { + pattern "[Aa]sic[0-4]"; + } + } + + leaf ifname { + type string { + length 1..128; + } + + description "Interface name."; + } + // qindex format is (X) | (X-Y). X is start and Y is end index. + // X and Y value depends on platform, example for physical ports 0-7 and + // for CPU port 0-48. Example qindex is 3-4 + leaf qindex { + // sonic-ext:custom-validation ValidateQindexPattern; + type string; + description "Queue index on the interface."; + } + + leaf scheduler { + type leafref { + path "/sch:sonic-scheduler/sch:SCHEDULER/sch:SCHEDULER_LIST/sch:name"; //Reference to SCHEDULER table + } + description "Scheduler for queue."; + } + + leaf wred_profile { + type leafref { + path "/wrd:sonic-wred-profile/wrd:WRED_PROFILE/wrd:WRED_PROFILE_LIST/wrd:name"; // Reference to WRED_PROFILE table + } + description "Wred profile for queue."; + } + } } + } } From f4fc6ce5a9f857907e69b636e80e44e05985be73 Mon Sep 17 00:00:00 2001 From: ranjinidn <51423501+ranjinidn@users.noreply.github.com> Date: Thu, 16 May 2024 16:53:14 -0700 Subject: [PATCH 112/282] Bookworm migration for sonic-mgmt-framework and sonic-gnmi dockers (#18548) * Bookworm migration for mgmt-framework container * Bookworm migration for sonic-gnmi container * removed unnecessary python packages from sonic-mgmt-framework docker manifest file * use curl openssl for mgmt-framework same as what is used in bookworm backend * install python-is-python3 for all archs for bookworm * Address review comment to remove bazel 's python-is-python3 requirement since its to be included unconditionally --------- Co-authored-by: amrutasali Co-authored-by: amrutasali <51424374+amrutasali@users.noreply.github.com> --- dockers/docker-sonic-gnmi/Dockerfile.j2 | 2 +- .../docker-sonic-mgmt-framework/Dockerfile.j2 | 17 +++++------------ rules/docker-gnmi.mk | 10 +++++----- rules/docker-sonic-mgmt-framework.mk | 10 +++++----- sonic-slave-bookworm/Dockerfile.j2 | 5 ++--- 5 files changed, 18 insertions(+), 26 deletions(-) diff --git a/dockers/docker-sonic-gnmi/Dockerfile.j2 b/dockers/docker-sonic-gnmi/Dockerfile.j2 index 962486520282..7298a05978be 100644 --- a/dockers/docker-sonic-gnmi/Dockerfile.j2 +++ b/dockers/docker-sonic-gnmi/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name ARG image_version diff --git a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 index 03ab38cc32be..91f7ba7ee736 100644 --- a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine-buster-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name @@ -6,17 +6,10 @@ ARG docker_container_name ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ - apt-get install -y g++ python3-dev libxml2 libcurl3-gnutls libcjson-dev - -# Limited to grpcio 1.58.0 due to armhf -RUN pip3 install connexion==2.7.0 \ - setuptools==21.0.0 \ - grpcio==1.58.0 \ - grpcio-tools==1.20.0 \ - certifi==2017.4.17 \ - python-dateutil==2.6.0 \ - six==1.11.0 \ - urllib3==1.26.5 + apt-get install -y g++ python3-dev libxml2 libcurl4-openssl-dev libcjson-dev + +RUN pip3 install requests \ + urllib3 COPY \ {% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%} diff --git a/rules/docker-gnmi.mk b/rules/docker-gnmi.mk index 43cb7be2f7de..fccbafd2a880 100644 --- a/rules/docker-gnmi.mk +++ b/rules/docker-gnmi.mk @@ -8,23 +8,23 @@ $(DOCKER_GNMI)_PATH = $(DOCKERS_PATH)/$(DOCKER_GNMI_STEM) $(DOCKER_GNMI)_DEPENDS += $(SONIC_MGMT_COMMON) $(DOCKER_GNMI)_DEPENDS += $(SONIC_TELEMETRY) -$(DOCKER_GNMI)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) +$(DOCKER_GNMI)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS) -$(DOCKER_GNMI)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE) +$(DOCKER_GNMI)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM) $(DOCKER_GNMI)_VERSION = 1.0.0 $(DOCKER_GNMI)_PACKAGE_NAME = gnmi -$(DOCKER_GNMI)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES) +$(DOCKER_GNMI)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES) SONIC_DOCKER_IMAGES += $(DOCKER_GNMI) -SONIC_BULLSEYE_DOCKERS += $(DOCKER_GNMI) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_GNMI) ifeq ($(INCLUDE_SYSTEM_GNMI), y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_GNMI) endif SONIC_DOCKER_DBG_IMAGES += $(DOCKER_GNMI_DBG) -SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_GNMI_DBG) +SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_GNMI_DBG) ifeq ($(INCLUDE_SYSTEM_GNMI), y) SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_GNMI_DBG) endif diff --git a/rules/docker-sonic-mgmt-framework.mk b/rules/docker-sonic-mgmt-framework.mk index 1f26de396141..b93c5e1006d3 100644 --- a/rules/docker-sonic-mgmt-framework.mk +++ b/rules/docker-sonic-mgmt-framework.mk @@ -8,16 +8,16 @@ $(DOCKER_MGMT_FRAMEWORK)_PATH = $(DOCKERS_PATH)/$(DOCKER_MGMT_FRAMEWORK_STEM) $(DOCKER_MGMT_FRAMEWORK)_DEPENDS += $(SONIC_MGMT_COMMON) $(DOCKER_MGMT_FRAMEWORK)_DEPENDS += $(SONIC_MGMT_FRAMEWORK) -$(DOCKER_MGMT_FRAMEWORK)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) +$(DOCKER_MGMT_FRAMEWORK)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS) $(DOCKER_MGMT_FRAMEWORK)_DBG_DEPENDS += $(SONIC_MGMT_FRAMEWORK_DBG) SONIC_DOCKER_IMAGES += $(DOCKER_MGMT_FRAMEWORK) -$(DOCKER_MGMT_FRAMEWORK)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) +$(DOCKER_MGMT_FRAMEWORK)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM) $(DOCKER_MGMT_FRAMEWORK)_VERSION = 1.0.0 $(DOCKER_MGMT_FRAMEWORK)_PACKAGE_NAME = mgmt-framework -$(DOCKER_MGMT_FRAMEWORK)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES) +$(DOCKER_MGMT_FRAMEWORK)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES) ifeq ($(INCLUDE_MGMT_FRAMEWORK), y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_MGMT_FRAMEWORK) @@ -38,5 +38,5 @@ $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += --mount type=bind,source="/var/platform/",ta $(DOCKER_MGMT_FRAMEWORK)_BASE_IMAGE_FILES += sonic-cli:/usr/bin/sonic-cli -SONIC_BUSTER_DOCKERS += $(DOCKER_MGMT_FRAMEWORK) -SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_MGMT_FRAMEWORK_DBG) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_MGMT_FRAMEWORK) +SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_MGMT_FRAMEWORK_DBG) diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index b0efe041e9dd..2d48357f5605 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -694,12 +694,11 @@ RUN apt-get download python3.11-dev:$arch && apt-get download python3-dev:$arch LABEL "com.azure.dev.pipelines.agent.handler.node.path"="/usr/bin/node" {% endif -%} +RUN apt install -y python-is-python3 + # Install Bazel build system (amd64 and arm64 architectures are supported using this method) # TODO(PINS): Remove once pre-build Bazel binaries are available for armhf (armv7l) {%- if CONFIGURED_ARCH == "amd64" or CONFIGURED_ARCH == "arm64" %} ARG bazelisk_url=https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-{{ CONFIGURED_ARCH }} RUN curl -fsSL -o /usr/local/bin/bazel ${bazelisk_url} && chmod 755 /usr/local/bin/bazel -# Bazel requires "python" -# TODO(PINS): remove when Bazel is okay with "python3" binary name -RUN apt install -y python-is-python3 {% endif -%} From 4863b0b3ea56f8fc4cf167ba05d8e80263a83051 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Thu, 16 May 2024 16:54:53 -0700 Subject: [PATCH 113/282] (Properly) upgrade docker-restapi to Bookworm, and add a debug container (#18975) Upgrade docker-restapi container to Bookworm. It's worth noting that because this container was not in the SONIC_BULLSEYE_DOCKERS list, the binaries/libraries that got packaged here came from the Bookworm build, but the base layer was for Bullseye, so it was already in some hybrid state. Also, include the autogenerated dbgsym package for restapi in `rules/restapi.mk`, and add a debug container for restapi. Also, enable caching of docker-restapi (not sure why it wasn't enabled before). Signed-off-by: Saikrishna Arcot --- dockers/docker-sonic-restapi/Dockerfile.j2 | 2 +- rules/docker-restapi.dep | 11 +++++++++++ rules/docker-restapi.mk | 19 +++++++++++++++---- rules/restapi.mk | 4 ++++ 4 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 rules/docker-restapi.dep diff --git a/dockers/docker-sonic-restapi/Dockerfile.j2 b/dockers/docker-sonic-restapi/Dockerfile.j2 index ca1a80580ba7..3bb1ab7df3ba 100644 --- a/dockers/docker-sonic-restapi/Dockerfile.j2 +++ b/dockers/docker-sonic-restapi/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name diff --git a/rules/docker-restapi.dep b/rules/docker-restapi.dep new file mode 100644 index 000000000000..77a5e712daa4 --- /dev/null +++ b/rules/docker-restapi.dep @@ -0,0 +1,11 @@ + +DPATH := $($(DOCKER_RESTAPI)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-restapi.mk rules/docker-restapi.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_RESTAPI)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_RESTAPI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_RESTAPI)_DEP_FILES := $(DEP_FILES) + +$(eval $(call add_dbg_docker,$(DOCKER_RESTAPI),$(DOCKER_RESTAPI_DBG))) diff --git a/rules/docker-restapi.mk b/rules/docker-restapi.mk index e6dc2dcf47ea..0fb8e19d5c92 100644 --- a/rules/docker-restapi.mk +++ b/rules/docker-restapi.mk @@ -2,20 +2,28 @@ DOCKER_RESTAPI_STEM = docker-sonic-restapi DOCKER_RESTAPI = $(DOCKER_RESTAPI_STEM).gz +DOCKER_RESTAPI_DBG = $(DOCKER_RESTAPI_STEM)-$(DBG_IMAGE_MARK).gz -$(DOCKER_RESTAPI)_DEPENDS += $(LIBNL3) $(LIBNL_GENL3) \ - $(LIBNL_ROUTE3) $(LIBSWSSCOMMON) $(RESTAPI) +$(DOCKER_RESTAPI)_DEPENDS += $(RESTAPI) + +$(DOCKER_RESTAPI)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS) +$(DOCKER_RESTAPI)_DBG_DEPENDS += $(RESTAPI_DBG) + +$(DOCKER_RESTAPI)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES) $(DOCKER_RESTAPI)_PATH = $(DOCKERS_PATH)/$(DOCKER_RESTAPI_STEM) -$(DOCKER_RESTAPI)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE) +$(DOCKER_RESTAPI)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM) $(DOCKER_RESTAPI)_VERSION = 1.0.0 $(DOCKER_RESTAPI)_PACKAGE_NAME = restapi -ifeq ($(INCLUDE_RESTAPI), y) SONIC_DOCKER_IMAGES += $(DOCKER_RESTAPI) +SONIC_DOCKER_DBG_IMAGES += $(DOCKER_RESTAPI_DBG) + +ifeq ($(INCLUDE_RESTAPI), y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_RESTAPI) +SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_RESTAPI_DBG) endif $(DOCKER_RESTAPI)_CONTAINER_NAME = restapi @@ -25,3 +33,6 @@ $(DOCKER_RESTAPI)_RUN_OPT += -v /etc/sonic/credentials:/etc/sonic/credentials:ro $(DOCKER_RESTAPI)_RUN_OPT += -p=8081:8081/tcp $(DOCKER_RESTAPI)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) + +SONIC_BOOKWORM_DOCKERS += $(DOCKER_RESTAPI) +SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_RESTAPI_DBG) diff --git a/rules/restapi.mk b/rules/restapi.mk index 9be5be9ae06a..b603ecd7a591 100644 --- a/rules/restapi.mk +++ b/rules/restapi.mk @@ -2,8 +2,12 @@ RESTAPI = sonic-rest-api_1.0.1_$(CONFIGURED_ARCH).deb $(RESTAPI)_SRC_PATH = $(SRC_PATH)/sonic-restapi + $(RESTAPI)_DEPENDS += $(LIBNL3_DEV) $(LIBNL_GENL3_DEV) \ $(LIBNL_ROUTE3_DEV) $(LIBSWSSCOMMON_DEV) $(LIBSWSSCOMMON) $(RESTAPI)_RDEPENDS += $(LIBNL3) $(LIBNL_GENL3) \ $(LIBNL_ROUTE3) $(LIBSWSSCOMMON) SONIC_DPKG_DEBS += $(RESTAPI) + +RESTAPI_DBG = sonic-rest-api-dbgsym_1.0.1_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(RESTAPI_DBG),$(RESTAPI_DBG))) From c2406e6fc9e0bd120ae74653ad4fe9e7ba635f73 Mon Sep 17 00:00:00 2001 From: Arvindsrinivasan Lakshmi Narasimhan <55814491+arlakshm@users.noreply.github.com> Date: Thu, 16 May 2024 17:13:08 -0700 Subject: [PATCH 114/282] [chassis][voq] Remove the leaf ref for the ifname in sonic-system-port.yang (#18855) Microsoft ADO 27934751: Fixes #18854 Update the sonic-system-port.yang to remove the check to have ifname as leafref in the port table The system-port config table will have all the ports in the chassis not only to one linecard, so in case of the chassis with different linecards sku with different number of ports this leafref will not work. --- src/sonic-yang-models/yang-models/sonic-system-port.yang | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/sonic-yang-models/yang-models/sonic-system-port.yang b/src/sonic-yang-models/yang-models/sonic-system-port.yang index 804b3313fc18..f95405ac662f 100644 --- a/src/sonic-yang-models/yang-models/sonic-system-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-system-port.yang @@ -40,13 +40,8 @@ module sonic-system-port { } leaf ifname { - type union { - type leafref { - path /port:sonic-port/port:PORT/port:PORT_LIST/port:name; - } - type string { - pattern "Cpu0"; - } + type string { + length 1..128; } } From 592562aab47e19e1a4f519c1ee4337d96d0b595c Mon Sep 17 00:00:00 2001 From: dgsudharsan Date: Tue, 30 Apr 2024 18:03:12 +0000 Subject: [PATCH 115/282] [FRR]Porting fix to handle nexthop group on interface up --- .../patch/0029-zebra-nhg-fix-on-intf-up.patch | 338 ++++++++++++++++++ src/sonic-frr/patch/series | 1 + 2 files changed, 339 insertions(+) create mode 100644 src/sonic-frr/patch/0029-zebra-nhg-fix-on-intf-up.patch diff --git a/src/sonic-frr/patch/0029-zebra-nhg-fix-on-intf-up.patch b/src/sonic-frr/patch/0029-zebra-nhg-fix-on-intf-up.patch new file mode 100644 index 000000000000..64e8ac5d5713 --- /dev/null +++ b/src/sonic-frr/patch/0029-zebra-nhg-fix-on-intf-up.patch @@ -0,0 +1,338 @@ +From 4a58bc9e856c4ca953474548d61f06aad2fdf45b Mon Sep 17 00:00:00 2001 +From: Ashwini Reddy +Date: Wed, 19 Apr 2023 11:35:25 -0700 +Subject: [PATCH 1/3] zebra: re-install nhg on interface up + +Intermittently zebra and kernel are out of sync +when interface flaps and the add's/dels are in +same processing queue and zebra assumes no change in nexthop. +Hence we need to bring in a reinstall to kernel +of the nexthops and routes to sync their states. + +Upon interface flap kernel would have deleted NHGs +associated to a interface (the one flapped), +zebra retains NHGs for 3 mins even though upper +layer protocol removes the nexthops (associated NHG). +As part of interface address add , +re-add singleton NHGs associated to interface. + +Ticket: #3173663 +Issue: 3173663 + +Signed-off-by: Ashwini Reddy +Signed-off-by: Chirag Shah +--- + lib/nexthop.c | 9 +++++++++ + lib/nexthop.h | 3 +++ + zebra/redistribute.c | 4 ++++ + zebra/zebra_nhg.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ + zebra/zebra_nhg.h | 1 + + 5 files changed, 63 insertions(+) + +diff --git a/lib/nexthop.c b/lib/nexthop.c +index 52679388fd..e3bdbfb9e8 100644 +--- a/lib/nexthop.c ++++ b/lib/nexthop.c +@@ -1093,3 +1093,12 @@ static ssize_t printfrr_nh(struct fbuf *buf, struct printfrr_eargs *ea, + } + return -1; + } ++ ++bool nexthop_is_ifindex_type(const struct nexthop *nh) ++{ ++ if (nh->type == NEXTHOP_TYPE_IFINDEX || ++ nh->type == NEXTHOP_TYPE_IPV4_IFINDEX || ++ nh->type == NEXTHOP_TYPE_IPV6_IFINDEX) ++ return true; ++ return false; ++} +diff --git a/lib/nexthop.h b/lib/nexthop.h +index f6fb6ec2b7..a52ae02172 100644 +--- a/lib/nexthop.h ++++ b/lib/nexthop.h +@@ -260,6 +260,9 @@ extern struct nexthop *nexthop_dup(const struct nexthop *nexthop, + extern struct nexthop *nexthop_dup_no_recurse(const struct nexthop *nexthop, + struct nexthop *rparent); + ++/* Check nexthop of IFINDEX type */ ++extern bool nexthop_is_ifindex_type(const struct nexthop *nh); ++ + /* + * Parse one or more backup index values, as comma-separated numbers, + * into caller's array of uint8_ts. The array must be NEXTHOP_MAX_BACKUPS +diff --git a/zebra/redistribute.c b/zebra/redistribute.c +index 4a8fe938ed..fccbee7d85 100644 +--- a/zebra/redistribute.c ++++ b/zebra/redistribute.c +@@ -561,6 +561,10 @@ void zebra_interface_address_add_update(struct interface *ifp, + client, ifp, ifc); + } + } ++ /* interface associated NHGs may have been deleted, ++ * re-sync zebra -> dplane NHGs ++ */ ++ zebra_interface_nhg_reinstall(ifp); + } + + /* Interface address deletion. */ +diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c +index 54c66fbf18..753efef7f8 100644 +--- a/zebra/zebra_nhg.c ++++ b/zebra/zebra_nhg.c +@@ -3003,6 +3003,12 @@ void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe) + /* Resolve it first */ + nhe = zebra_nhg_resolve(nhe); + ++ if (zebra_nhg_set_valid_if_active(nhe)) { ++ if (IS_ZEBRA_DEBUG_NHG_DETAIL) ++ zlog_debug("%s: valid flag set for nh %pNG", __func__, ++ nhe); ++ } ++ + /* Make sure all depends are installed/queued */ + frr_each(nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) { + zebra_nhg_install_kernel(rb_node_dep->nhe); +@@ -3586,3 +3592,43 @@ static ssize_t printfrr_nhghe(struct fbuf *buf, struct printfrr_eargs *ea, + ret += bputs(buf, "]"); + return ret; + } ++ ++/* ++ * On interface add the nexthop that resolves to this intf needs ++ * a re-install. There are following scenarios when the nexthop group update ++ * gets skipped: ++ * 1. When upper level protocol sends removal of NHG, there is ++ * timer running to keep NHG for 180 seconds, during this interval, same route ++ * with same set of nexthops installation is given , the same NHG is used ++ * but since NHG is not reinstalled on interface address add, it is not aware ++ * in Dplan/Kernel. ++ * 2. Due to a quick port flap due to interface add and delete ++ * to be processed in same queue one after another. Zebra believes that ++ * there is no change in nhg in this case. Hence this re-install will ++ * make sure the nexthop group gets updated to Dplan/Kernel. ++ */ ++void zebra_interface_nhg_reinstall(struct interface *ifp) ++{ ++ struct nhg_connected *rb_node_dep = NULL; ++ struct zebra_if *zif = ifp->info; ++ struct nexthop *nh; ++ ++ if (IS_ZEBRA_DEBUG_NHG_DETAIL) ++ zlog_debug( ++ "%s: Installing interface %s associated NHGs into kernel", ++ __func__, ifp->name); ++ ++ frr_each (nhg_connected_tree, &zif->nhg_dependents, rb_node_dep) { ++ nh = rb_node_dep->nhe->nhg.nexthop; ++ if (zebra_nhg_set_valid_if_active(rb_node_dep->nhe)) { ++ if (IS_ZEBRA_DEBUG_NHG_DETAIL) ++ zlog_debug( ++ "%s: Setting the valid flag for nhe %pNG, interface: %s", ++ __func__, rb_node_dep->nhe, ifp->name); ++ } ++ /* Check for singleton NHG associated to interface */ ++ if (nexthop_is_ifindex_type(nh) && ++ zebra_nhg_depends_is_empty(rb_node_dep->nhe)) ++ zebra_nhg_install_kernel(rb_node_dep->nhe); ++ } ++} +diff --git a/zebra/zebra_nhg.h b/zebra/zebra_nhg.h +index 9b925bf10f..18914b7856 100644 +--- a/zebra/zebra_nhg.h ++++ b/zebra/zebra_nhg.h +@@ -374,6 +374,7 @@ extern uint8_t zebra_nhg_nhe2grp(struct nh_grp *grp, struct nhg_hash_entry *nhe, + /* Dataplane install/uninstall */ + extern void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe); + extern void zebra_nhg_uninstall_kernel(struct nhg_hash_entry *nhe); ++extern void zebra_interface_nhg_reinstall(struct interface *ifp); + + /* Forward ref of dplane update context type */ + struct zebra_dplane_ctx; +-- +2.17.1 + + +From 2b99f5ccf7768eff1393e07db2b77abc104dbbd7 Mon Sep 17 00:00:00 2001 +From: Chirag Shah +Date: Fri, 28 Apr 2023 19:09:55 -0700 +Subject: [PATCH 2/3] zebra:re-install dependent nhgs on interface up + +Upon interface up associated singleton NHG's +dependent NHGs needs to be reinstalled as +kernel would have deleted if there is no route +referencing it. + +Ticket:#3416477 +Issue:3416477 +Testing Done: +flap interfaces which are part of route NHG, +upon interfaces up event, NHGs are resynced +into dplane. + +Signed-off-by: Chirag Shah +--- + zebra/zebra_nhg.c | 43 ++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 38 insertions(+), 5 deletions(-) + +diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c +index 753efef7f8..e5efbf8d5f 100644 +--- a/zebra/zebra_nhg.c ++++ b/zebra/zebra_nhg.c +@@ -1140,13 +1140,23 @@ static void zebra_nhg_handle_uninstall(struct nhg_hash_entry *nhe) + zebra_nhg_free(nhe); + } + +-static void zebra_nhg_handle_install(struct nhg_hash_entry *nhe) ++static void zebra_nhg_handle_install(struct nhg_hash_entry *nhe, bool install) + { + /* Update validity of groups depending on it */ + struct nhg_connected *rb_node_dep; + +- frr_each_safe(nhg_connected_tree, &nhe->nhg_dependents, rb_node_dep) ++ frr_each_safe (nhg_connected_tree, &nhe->nhg_dependents, rb_node_dep) { + zebra_nhg_set_valid(rb_node_dep->nhe); ++ /* install dependent NHG into kernel */ ++ if (install) { ++ if (IS_ZEBRA_DEBUG_NHG_DETAIL) ++ zlog_debug( ++ "%s nh id %u (flags 0x%x) associated dependent NHG %pNG install", ++ __func__, nhe->id, nhe->flags, ++ rb_node_dep->nhe); ++ zebra_nhg_install_kernel(rb_node_dep->nhe); ++ } ++ } + } + + /* +@@ -3035,7 +3045,7 @@ void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe) + break; + case ZEBRA_DPLANE_REQUEST_SUCCESS: + SET_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED); +- zebra_nhg_handle_install(nhe); ++ zebra_nhg_handle_install(nhe, false); + break; + } + } +@@ -3109,7 +3119,7 @@ void zebra_nhg_dplane_result(struct zebra_dplane_ctx *ctx) + if (status == ZEBRA_DPLANE_REQUEST_SUCCESS) { + SET_FLAG(nhe->flags, NEXTHOP_GROUP_VALID); + SET_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED); +- zebra_nhg_handle_install(nhe); ++ zebra_nhg_handle_install(nhe, true); + + /* If daemon nhg, send it an update */ + if (PROTO_OWNED(nhe)) +@@ -3628,7 +3638,30 @@ void zebra_interface_nhg_reinstall(struct interface *ifp) + } + /* Check for singleton NHG associated to interface */ + if (nexthop_is_ifindex_type(nh) && +- zebra_nhg_depends_is_empty(rb_node_dep->nhe)) ++ zebra_nhg_depends_is_empty(rb_node_dep->nhe)) { ++ struct nhg_connected *rb_node_dependent; ++ ++ if (IS_ZEBRA_DEBUG_NHG) ++ zlog_debug( ++ "%s install nhe %pNG nh type %u flags 0x%x", ++ __func__, rb_node_dep->nhe, nh->type, ++ rb_node_dep->nhe->flags); + zebra_nhg_install_kernel(rb_node_dep->nhe); ++ ++ /* mark depedent uninstall, when interface associated ++ * singleton is installed, install depedent ++ */ ++ frr_each_safe (nhg_connected_tree, ++ &rb_node_dep->nhe->nhg_dependents, ++ rb_node_dependent) { ++ if (IS_ZEBRA_DEBUG_NHG) ++ zlog_debug( ++ "%s dependent nhe %pNG unset installed flag", ++ __func__, ++ rb_node_dependent->nhe); ++ UNSET_FLAG(rb_node_dependent->nhe->flags, ++ NEXTHOP_GROUP_INSTALLED); ++ } ++ } + } + } +-- +2.17.1 + + +From be767bd66143c2dcdd564a40a852400ae9e251e5 Mon Sep 17 00:00:00 2001 +From: Donald Sharp +Date: Fri, 19 Apr 2024 12:13:32 -0400 +Subject: [PATCH 3/3] lib, zebra: Check for not being a blackhole route + +In zebra_interface_nhg_reinstall zebra is checking that the +nhg is a singleton and not a blackhole nhg. This was originally +done with checking that the nexthop is a NEXTHOP_TYPE_IFINDEX, +NEXTHOP_TYPE_IPV4_IFINDEX and NEXTHOP_TYPE_IPV6_IFINDEX. This +was excluding NEXTHOP_TYPE_IPV4 and NEXTHOP_TYPE_IPV6. These +were both possible to be received and maintained from the upper +level protocol for when a route is being recursively resolved. +If we have gotten to this point in zebra_interface_nhg_reinstall +the nexthop group has already been installed at least once +and we *know* that it is actually a valid nexthop. What the +test is really trying to do is ensure that we are not reinstalling +a blackhole nexthop group( Which is not possible to even be +here by the way, but safety first! ). So let's change +to test for that instead. + +Signed-off-by: Donald Sharp +--- + lib/nexthop.c | 8 ++------ + lib/nexthop.h | 4 ++-- + zebra/zebra_nhg.c | 3 ++- + 3 files changed, 6 insertions(+), 9 deletions(-) + +diff --git a/lib/nexthop.c b/lib/nexthop.c +index e3bdbfb9e8..884255f158 100644 +--- a/lib/nexthop.c ++++ b/lib/nexthop.c +@@ -1094,11 +1094,7 @@ static ssize_t printfrr_nh(struct fbuf *buf, struct printfrr_eargs *ea, + return -1; + } + +-bool nexthop_is_ifindex_type(const struct nexthop *nh) ++bool nexthop_is_blackhole(const struct nexthop *nh) + { +- if (nh->type == NEXTHOP_TYPE_IFINDEX || +- nh->type == NEXTHOP_TYPE_IPV4_IFINDEX || +- nh->type == NEXTHOP_TYPE_IPV6_IFINDEX) +- return true; +- return false; ++ return nh->type == NEXTHOP_TYPE_BLACKHOLE; + } +diff --git a/lib/nexthop.h b/lib/nexthop.h +index a52ae02172..bd1c0514fc 100644 +--- a/lib/nexthop.h ++++ b/lib/nexthop.h +@@ -260,8 +260,8 @@ extern struct nexthop *nexthop_dup(const struct nexthop *nexthop, + extern struct nexthop *nexthop_dup_no_recurse(const struct nexthop *nexthop, + struct nexthop *rparent); + +-/* Check nexthop of IFINDEX type */ +-extern bool nexthop_is_ifindex_type(const struct nexthop *nh); ++/* Is this nexthop a blackhole? */ ++extern bool nexthop_is_blackhole(const struct nexthop *nh); + + /* + * Parse one or more backup index values, as comma-separated numbers, +diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c +index e5efbf8d5f..33d2344f51 100644 +--- a/zebra/zebra_nhg.c ++++ b/zebra/zebra_nhg.c +@@ -3636,8 +3636,9 @@ void zebra_interface_nhg_reinstall(struct interface *ifp) + "%s: Setting the valid flag for nhe %pNG, interface: %s", + __func__, rb_node_dep->nhe, ifp->name); + } ++ + /* Check for singleton NHG associated to interface */ +- if (nexthop_is_ifindex_type(nh) && ++ if (!nexthop_is_blackhole(nh) && + zebra_nhg_depends_is_empty(rb_node_dep->nhe)) { + struct nhg_connected *rb_node_dependent; + +-- +2.17.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index f2cd08ca666c..445bc9dd9653 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -26,3 +26,4 @@ 0026-bgp-fib-suppress-announce-fix.patch 0027-lib-Do-not-convert-EVPN-prefixes-into-IPv4-IPv6-if-n.patch 0028-zebra-fix-parse-attr-problems-for-encap.patch +0029-zebra-nhg-fix-on-intf-up.patch From c91ce6059931b52750964031d4f621cd2912e08e Mon Sep 17 00:00:00 2001 From: dgsudharsan Date: Tue, 5 Mar 2024 00:28:06 +0000 Subject: [PATCH 116/282] Revert "[frr]: Force disable next hop group support. (#17344)" This reverts commit 1ff27db42f4f8722f8f74967030a4d7e31473731. --- dockers/docker-fpm-frr/docker_init.sh | 4 ---- dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 | 2 -- platform/vs/docker-sonic-vs/frr/zebra.conf | 3 ++- src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf | 2 -- .../tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf | 2 -- .../tests/sample_output/py2/t2-chassis-fe-zebra.conf | 2 -- .../tests/sample_output/py2/zebra_frr.conf | 2 -- .../tests/sample_output/py2/zebra_frr_dualtor.conf | 2 -- .../tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf | 2 -- .../tests/sample_output/py3/t2-chassis-fe-zebra.conf | 2 -- .../tests/sample_output/py3/zebra_frr.conf | 2 -- .../tests/sample_output/py3/zebra_frr_dualtor.conf | 2 -- 12 files changed, 2 insertions(+), 25 deletions(-) diff --git a/dockers/docker-fpm-frr/docker_init.sh b/dockers/docker-fpm-frr/docker_init.sh index 390a403aa598..0ed274ec703f 100755 --- a/dockers/docker-fpm-frr/docker_init.sh +++ b/dockers/docker-fpm-frr/docker_init.sh @@ -49,10 +49,6 @@ write_default_zebra_config() echo "no fpm use-next-hop-groups" >> $FILE_NAME echo "fpm address 127.0.0.1" >> $FILE_NAME } - - grep -q '^no zebra nexthop kernel enable' $FILE_NAME || { - echo "no zebra nexthop kernel enable" >> $FILE_NAME - } } if [[ ! -z "$NAMESPACE_ID" ]]; then diff --git a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 index 4543ad8f974e..f5a56c316d41 100644 --- a/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 +++ b/dockers/docker-fpm-frr/frr/zebra/zebra.conf.j2 @@ -7,8 +7,6 @@ {% endblock banner %} ! {% block fpm %} -! Force disable next hop group support -no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/platform/vs/docker-sonic-vs/frr/zebra.conf b/platform/vs/docker-sonic-vs/frr/zebra.conf index 1980a6e159f0..4c994e60def2 100644 --- a/platform/vs/docker-sonic-vs/frr/zebra.conf +++ b/platform/vs/docker-sonic-vs/frr/zebra.conf @@ -1,3 +1,4 @@ -no zebra nexthop kernel enable no fpm use-next-hop-groups + fpm address 127.0.0.1 + diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf index 38db2964823e..6b7e1feff000 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/zebra/zebra.conf @@ -4,8 +4,6 @@ ! file: zebra.conf ! ! -! Force disable next hop group support -no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf index 120878fe1186..8bb483456829 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-vni-zebra.conf @@ -4,8 +4,6 @@ ! file: zebra.conf ! ! -! Force disable next hop group support -no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf index a6e3ad05310f..402230348a4a 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-zebra.conf @@ -4,8 +4,6 @@ ! file: zebra.conf ! ! -! Force disable next hop group support -no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf index 9e438caa0e34..9d0ab16ee384 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr.conf @@ -4,8 +4,6 @@ ! file: zebra.conf ! ! -! Force disable next hop group support -no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf index 0f49b229b88d..4a23467ce210 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/zebra_frr_dualtor.conf @@ -4,8 +4,6 @@ ! file: zebra.conf ! ! -! Force disable next hop group support -no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf index c6c973f7f05c..b55906056616 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-vni-zebra.conf @@ -4,8 +4,6 @@ ! file: zebra.conf ! ! -! Force disable next hop group support -no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf index 84e76ecdb01c..19e303639a55 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-zebra.conf @@ -4,8 +4,6 @@ ! file: zebra.conf ! ! -! Force disable next hop group support -no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf index b8adb98787a7..a5fb8b1ca104 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr.conf @@ -4,8 +4,6 @@ ! file: zebra.conf ! ! -! Force disable next hop group support -no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf index 2741ba54cf4f..5fdf0ced3972 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/zebra_frr_dualtor.conf @@ -4,8 +4,6 @@ ! file: zebra.conf ! ! -! Force disable next hop group support -no zebra nexthop kernel enable ! Uses the old known FPM behavior of including next hop information in the route (e.g. RTM_NEWROUTE) messages no fpm use-next-hop-groups ! From 53966e3ff340cc16127d78aa92587aee3b48dd0e Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 17 May 2024 16:01:28 +0800 Subject: [PATCH 117/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#18987) #### Why I did it src/sonic-swss ``` * 84ce1a7c - (HEAD -> master, origin/master, origin/HEAD) [mclag] Use port-isolation feature for Marvell platforms. (#3151) (11 hours ago) [Rajkumar-Marvell] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index c36333c3d757..84ce1a7c9cf5 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit c36333c3d7573a249991df5357955f0189ab4ada +Subproject commit 84ce1a7c9cf50bf6719d710f3ee3e5286998bf8b From 2c6927738b23f2283243f0cc74e430de4dcce89d Mon Sep 17 00:00:00 2001 From: Bobby McGonigle Date: Fri, 17 May 2024 13:58:09 -0700 Subject: [PATCH 118/282] Calulcate subport values and fix key error in hwsku.json (#18499) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatically populate the correct subport value for an interface and insert into config_db.json Why I did it Problem 1 Breakouts of optic CMIS modules are broken. For example when in breakout mode of 4x100G on a port the /3, /5, /7 are not correctly associating with lanes (3,4), (5,6) and (7,8) of the transceiver respectively. The /3, /5, /7 are all trying to reprogram lanes (1,2). In the xcvrd logs we see the following lane masks for all 4 interfaces for a port in 4x100G-2 mode: EthernetX/X: Setting host_lanemask=0x3 EthernetX/X: Setting media_lanemask=0x1 As a result, we only see the /1 interface linking up correctly, the other 3 interfaces do not have the correct application advertisement + lanemasks applied. This is what we should expect to see: lanes (1,2) EthernetX/1: Setting host_lanemask=0x3 EthernetX/1: Setting media_lanemask=0x1 lanes (3,4) EthernetX/3: Setting host_lanemask=0xc EthernetX/3: Setting media_lanemask=0x2 lanes (5,6) EthernetX/5: Setting host_lanemask=0x30 EthernetX/5: Setting media_lanemask=0x4 lanes (7,8) EthernetX/7: Setting host_lanemask=0xc0 EthernetX/7: Setting media_lanemask=0x8 The problem is that “subport†is expected and used in xcvrd, xcvrd unit tests and explained in the Port Breakout HLD ; it was not implemented and does not end up in DB as expected, which defaults this value to 0. (Pdb) self.port_dict["Ethernet194"] {'index': 25, 'speed': '100000', 'lanes': '451,452', 'admin_status': 'up', 'cmis_state': 'INSERTED', 'cmis_retries': 0, 'cmis_expired': None} Problem 2 This Pull Request does not play well with all HWSKUs that define breakouts. It does a lookup for every child port in the hwsku.json file - There should be 1 default breakout mode for each front panel port - this change expects every child port in a front panel port to have an entry - which causes an exception. Right now as far as I can tell this will break a lot of HWSKUs in a breakout config. For example this is what the Dynamic Port Breakout feature uses on an Arista SKU to define 2x200G on the first front panel port: "Ethernet0": { "default_brkout_mode": "2x200G[100G,50G,40G,25G,10G]" }, but it currently expects: "Ethernet0": { ... }, "Ethernet4": { ... }, How I did it Calculate subport value automatically based on the number of child ports used per front panel port and insert it into CONFIG_DB for the interface. If that number is 1 for the front panel, subport 0 is used. If has more than 1 I.e. is in breakout mode use a 1 based subport number as the feature expects. For example: 1x400G-8: Ethernet0: subport 0 4x100G-2: Ethernet0: subport 1 Ethernet2: subport 2 Ethernet4: subport 3 Ethernet6: subport 4 I have kept it compatible with Mellanox change - if you want to define a different subport number in your hwsku.json that is fine and it will override the dynamically generated default. How to verify it I verified this by checking the output of sonic-cfggen, updating config_db. and checking that both the host and media lane masks were correct for a 400GBASE-DR4 xcvr in both 2x200G-4 mode and 4x100G-2 mode. All links came up and xcvrd prints the correct lanemasks in logs. I also made sure that portconfig.py no longer causes an exception; it only checks for the optional HWSKU value if childports are present in hwsku.json file (this is to make sure we don't break Mellanox hwsku's) I also changed the unit test for config_db generation and ensured the correct values match. The test passes. --- .../sample_output/sample_new_port_config.json | 96 ++++++++++------ .../vs/tests/breakout/test_breakout_cli.py | 8 +- src/sonic-config-engine/portconfig.py | 15 ++- .../tests/sample_output/platform_output.json | 105 ++++++++++++++++-- .../tests/test_cfggen_platformJson.py | 6 +- 5 files changed, 179 insertions(+), 51 deletions(-) diff --git a/platform/vs/tests/breakout/sample_output/sample_new_port_config.json b/platform/vs/tests/breakout/sample_output/sample_new_port_config.json index 442224ea6d6e..2d4cb86a1e51 100644 --- a/platform/vs/tests/breakout/sample_output/sample_new_port_config.json +++ b/platform/vs/tests/breakout/sample_output/sample_new_port_config.json @@ -4,13 +4,15 @@ "alias": "fortyGigE0/2", "lanes": "27,28", "speed": "50000", - "index": "0" + "index": "0", + "subport": "2" }, "Ethernet0": { "alias": "fortyGigE0/0", "lanes": "25,26", "speed": "50000", - "index": "0" + "index": "0", + "subport": "1" } }, "Ethernet12_1x50G_2x25G": { @@ -18,19 +20,22 @@ "alias": "fortyGigE0/12", "lanes": "37,38", "speed": "50000", - "index": "3" + "index": "3", + "subport": "1" }, "Ethernet14": { "alias": "fortyGigE0/14", "lanes": "39", "speed": "25000", - "index": "3" + "index": "3", + "subport": "2" }, "Ethernet15": { "alias": "fortyGigE0/15", "lanes": "40", "speed": "25000", - "index": "3" + "index": "3", + "subport": "3" } }, "Ethernet0_2x50G": { @@ -38,13 +43,15 @@ "alias": "fortyGigE0/2", "lanes": "27,28", "speed": "50000", - "index": "0" + "index": "0", + "subport": "2" }, "Ethernet0": { "alias": "fortyGigE0/0", "lanes": "25,26", "speed": "50000", - "index": "0" + "index": "0", + "subport": "1" } }, "Ethernet0_1x100G": { @@ -52,7 +59,8 @@ "alias": "fortyGigE0/0", "lanes": "25,26,27,28", "speed": "100000", - "index": "0" + "index": "0", + "subport": "1" } }, "Ethernet0_4x25G": { @@ -60,25 +68,29 @@ "alias": "fortyGigE0/2", "lanes": "27", "speed": "25000", - "index": "0" + "index": "0", + "subport": "3" }, "Ethernet3": { "alias": "fortyGigE0/3", "lanes": "28", "speed": "25000", - "index": "0" + "index": "0", + "subport": "4" }, "Ethernet0": { "alias": "fortyGigE0/0", "lanes": "25", "speed": "25000", - "index": "0" + "index": "0", + "subport": "1" }, "Ethernet1": { "alias": "fortyGigE0/1", "lanes": "26", "speed": "25000", - "index": "0" + "index": "0", + "subport": "2" } }, "Ethernet0_2x25G_1x50G": { @@ -86,19 +98,22 @@ "alias": "fortyGigE0/2", "lanes": "27,28", "speed": "50000", - "index": "0" + "index": "0", + "subport": "3" }, "Ethernet0": { "alias": "fortyGigE0/0", "lanes": "25", "speed": "25000", - "index": "0" + "index": "0", + "subport": "1" }, "Ethernet1": { "alias": "fortyGigE0/1", "lanes": "26", "speed": "25000", - "index": "0" + "index": "0", + "subport": "2" } }, "Ethernet0_1x50G_2x25G": { @@ -106,19 +121,22 @@ "alias": "fortyGigE0/2", "lanes": "27", "speed": "25000", - "index": "0" + "index": "0", + "subport": "2" }, "Ethernet3": { "alias": "fortyGigE0/3", "lanes": "28", "speed": "25000", - "index": "0" + "index": "0", + "subport": "3" }, "Ethernet0": { "alias": "fortyGigE0/0", "lanes": "25,26", "speed": "50000", - "index": "0" + "index": "0", + "subport": "1" } }, "Ethernet4_4x25G": { @@ -126,25 +144,29 @@ "alias": "fortyGigE0/6", "lanes": "31", "speed": "25000", - "index": "1" + "index": "1", + "subport": "3" }, "Ethernet7": { "alias": "fortyGigE0/7", "lanes": "32", "speed": "25000", - "index": "1" + "index": "1", + "subport": "4" }, "Ethernet4": { "alias": "fortyGigE0/4", "lanes": "29", "speed": "25000", - "index": "1" + "index": "1", + "subport": "1" }, "Ethernet5": { "alias": "fortyGigE0/5", "lanes": "30", "speed": "25000", - "index": "1" + "index": "1", + "subport": "2" } }, "Ethernet4_2x50G": { @@ -152,13 +174,15 @@ "alias": "fortyGigE0/6", "lanes": "31,32", "speed": "50000", - "index": "1" + "index": "1", + "subport": "2" }, "Ethernet4": { "alias": "fortyGigE0/4", "lanes": "29,30", "speed": "50000", - "index": "1" + "index": "1", + "subport": "1" } }, "Ethernet8_2x50G": { @@ -166,13 +190,15 @@ "alias": "fortyGigE0/8", "lanes": "33,34", "speed": "50000", - "index": "2" + "index": "2", + "subport": "1" }, "Ethernet10": { "alias": "fortyGigE0/10", "lanes": "35,36", "speed": "50000", - "index": "2" + "index": "2", + "subport": "2" } }, "Ethernet8_1x50G_2x25G": { @@ -180,13 +206,15 @@ "alias": "fortyGigE0/10", "lanes": "35", "speed": "25000", - "index": "2" + "index": "2", + "subport": "1" }, "Ethernet11": { "alias": "fortyGigE0/11", "lanes": "36", "speed": "25000", - "index": "2" + "index": "2", + "subport": "2" } }, "Ethernet8_2x25G_1x50G": { @@ -194,19 +222,22 @@ "alias": "fortyGigE0/8", "lanes": "33", "speed": "25000", - "index": "2" + "index": "2", + "subport": "1" }, "Ethernet9": { "alias": "fortyGigE0/9", "lanes": "34", "speed": "25000", - "index": "2" + "index": "2", + "subport": "2" }, "Ethernet10": { "alias": "fortyGigE0/10", "lanes": "35,36", "speed": "50000", - "index": "2" + "index": "2", + "subport": "3" } }, "Ethernet8_1x100G": { @@ -214,7 +245,8 @@ "alias": "fortyGigE0/8", "lanes": "33,34,35,36", "speed": "100000", - "index": "2" + "index": "2", + "subport": "0" } } } diff --git a/platform/vs/tests/breakout/test_breakout_cli.py b/platform/vs/tests/breakout/test_breakout_cli.py index d93dc0e044a6..5a41aae5c2d3 100755 --- a/platform/vs/tests/breakout/test_breakout_cli.py +++ b/platform/vs/tests/breakout/test_breakout_cli.py @@ -74,22 +74,22 @@ def test_breakout_modes(self, dvs): print("**** Breakout Cli test Starts ****") output_dict = self.breakout(dvs, 'Ethernet0', '2x50G') expected_dict = expected["Ethernet0_2x50G"] - assert output_dict == expected_dict + assert output_dict == expected_dict, "output: {} != expected: {}".format(output_dict, expected_dict) print("**** 1X100G --> 2x50G passed ****") output_dict = self.breakout(dvs, 'Ethernet4', '4x25G[10G]') expected_dict = expected["Ethernet4_4x25G"] - assert output_dict == expected_dict + assert output_dict == expected_dict, "output: {} != expected: {}".format(output_dict, expected_dict) print("**** 1X100G --> 4x25G[10G] passed ****") output_dict = self.breakout(dvs, 'Ethernet8', '2x25G(2)+1x50G(2)') expected_dict = expected["Ethernet8_2x25G_1x50G"] - assert output_dict == expected_dict + assert output_dict == expected_dict, "output: {} != expected: {}".format(output_dict, expected_dict) print("**** 1X100G --> 2x25G(2)+1x50G(2) passed ****") output_dict = self.breakout(dvs, 'Ethernet12', '1x50G(2)+2x25G(2)') expected_dict = expected["Ethernet12_1x50G_2x25G"] - assert output_dict == expected_dict + assert output_dict == expected_dict, "output: {} != expected: {}".format(output_dict, expected_dict) print("**** 1X100G --> 1x50G(2)+2x25G(2) passed ****") # TODOFIX: remove comments once #4442 PR got merged and diff --git a/src/sonic-config-engine/portconfig.py b/src/sonic-config-engine/portconfig.py index dcc535eed0f1..788774d34969 100644 --- a/src/sonic-config-engine/portconfig.py +++ b/src/sonic-config-engine/portconfig.py @@ -37,7 +37,7 @@ BRKOUT_MODE = "default_brkout_mode" CUR_BRKOUT_MODE = "brkout_mode" INTF_KEY = "interfaces" -OPTIONAL_HWSKU_ATTRIBUTES = ["fec", "autoneg", "subport", "role"] +OPTIONAL_HWSKU_ATTRIBUTES = ["fec", "autoneg", "role"] BRKOUT_PATTERN = r'(\d{1,6})x(\d{1,6}G?)(\[(\d{1,6}G?,?)*\])?(\((\d{1,6})\))?' BRKOUT_PATTERN_GROUPS = 6 @@ -353,8 +353,10 @@ def _str_to_entries(self, bmode): def get_config(self): # Ensure that we have corret number of configured lanes lanes_used = 0 + total_num_ports = 0 for entry in self._breakout_mode_entry: lanes_used += entry.num_assigned_lanes + total_num_ports += entry.num_ports if lanes_used > len(self._lanes): raise RuntimeError("Assigned lines count is more that available!") @@ -376,7 +378,8 @@ def get_config(self): 'alias': self._breakout_capabilities[alias_id], 'lanes': ','.join(lanes), 'speed': str(entry.default_speed), - 'index': self._indexes[lane_id] + 'index': self._indexes[lane_id], + 'subport': "0" if total_num_ports == 1 else str(alias_id + 1) } lane_id += lanes_per_port @@ -422,10 +425,12 @@ def parse_platform_json_file(hwsku_json_file, platform_json_file): child_ports = get_child_ports(intf, brkout_mode, platform_json_file) # take optional fields from hwsku.json + hwsku_entry = hwsku_dict[INTF_KEY] for child_port in child_ports: - for key, item in hwsku_dict[INTF_KEY][child_port].items(): - if key in OPTIONAL_HWSKU_ATTRIBUTES: - child_ports.get(child_port)[key] = item + if child_port in hwsku_entry: + for key, item in hwsku_entry[child_port].items(): + if key in OPTIONAL_HWSKU_ATTRIBUTES: + child_ports.get(child_port)[key] = item ports.update(child_ports) diff --git a/src/sonic-config-engine/tests/sample_output/platform_output.json b/src/sonic-config-engine/tests/sample_output/platform_output.json index 15bd4a29da50..51c26754e982 100644 --- a/src/sonic-config-engine/tests/sample_output/platform_output.json +++ b/src/sonic-config-engine/tests/sample_output/platform_output.json @@ -7,6 +7,7 @@ "alias": "Eth3/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet9": { @@ -17,6 +18,7 @@ "alias": "Eth3/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet36": { @@ -27,6 +29,7 @@ "alias": "Eth10/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet98": { @@ -37,6 +40,7 @@ "alias": "Eth25/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet0": { @@ -49,6 +53,7 @@ "alias": "Eth1", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet6": { @@ -60,6 +65,7 @@ "alias": "Eth2/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet4": { @@ -71,6 +77,7 @@ "alias": "Eth2/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet109": { @@ -81,6 +88,7 @@ "alias": "Eth28/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet108": { @@ -91,6 +99,7 @@ "alias": "Eth28/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet18": { @@ -101,6 +110,7 @@ "alias": "Eth5/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet100": { @@ -112,6 +122,7 @@ "alias": "Eth26", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet34": { @@ -122,6 +133,7 @@ "alias": "Eth9/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet104": { @@ -132,6 +144,7 @@ "alias": "Eth27/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet106": { @@ -142,6 +155,7 @@ "alias": "Eth27/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet94": { @@ -152,6 +166,7 @@ "alias": "Eth24/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet126": { @@ -162,6 +177,7 @@ "alias": "Eth32/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet96": { @@ -172,6 +188,7 @@ "alias": "Eth25/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet124": { @@ -182,6 +199,7 @@ "alias": "Eth32/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet90": { @@ -192,6 +210,7 @@ "alias": "Eth23/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet91": { @@ -202,6 +221,7 @@ "alias": "Eth23/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet92": { @@ -212,6 +232,7 @@ "alias": "Eth24/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet93": { @@ -222,6 +243,7 @@ "alias": "Eth24/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet50": { @@ -232,6 +254,7 @@ "alias": "Eth13/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet51": { @@ -242,6 +265,7 @@ "alias": "Eth13/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet52": { @@ -252,6 +276,7 @@ "alias": "Eth14/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet53": { @@ -262,6 +287,7 @@ "alias": "Eth14/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet54": { @@ -272,6 +298,7 @@ "alias": "Eth14/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet99": { @@ -282,6 +309,7 @@ "alias": "Eth25/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet56": { @@ -292,6 +320,7 @@ "alias": "Eth15/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet113": { @@ -302,6 +331,7 @@ "alias": "Eth29/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet76": { @@ -312,6 +342,7 @@ "alias": "Eth20/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet74": { @@ -322,6 +353,7 @@ "alias": "Eth19/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet39": { @@ -332,6 +364,7 @@ "alias": "Eth10/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet72": { @@ -342,6 +375,7 @@ "alias": "Eth19/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet73": { @@ -352,6 +386,7 @@ "alias": "Eth19/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet70": { @@ -362,6 +397,7 @@ "alias": "Eth18/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet71": { @@ -372,6 +408,7 @@ "alias": "Eth18/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet32": { @@ -382,6 +419,7 @@ "alias": "Eth9/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet33": { @@ -392,6 +430,7 @@ "alias": "Eth9/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet16": { @@ -402,6 +441,7 @@ "alias": "Eth5/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet111": { @@ -412,6 +452,7 @@ "alias": "Eth28/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet10": { @@ -422,6 +463,7 @@ "alias": "Eth3/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet11": { @@ -432,6 +474,7 @@ "alias": "Eth3/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet12": { @@ -442,6 +485,7 @@ "alias": "Eth4/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet13": { @@ -452,6 +496,7 @@ "alias": "Eth4/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet58": { @@ -462,6 +507,7 @@ "alias": "Eth15/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet19": { @@ -472,6 +518,7 @@ "alias": "Eth5/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet59": { @@ -482,6 +529,7 @@ "alias": "Eth15/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet38": { @@ -492,6 +540,7 @@ "alias": "Eth10/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet78": { @@ -502,6 +551,7 @@ "alias": "Eth20/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet68": { @@ -512,6 +562,7 @@ "alias": "Eth18/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet14": { @@ -522,6 +573,7 @@ "alias": "Eth4/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet89": { @@ -532,6 +584,7 @@ "alias": "Eth23/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet88": { @@ -542,6 +595,7 @@ "alias": "Eth23/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet118": { @@ -552,6 +606,7 @@ "alias": "Eth30/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet119": { @@ -562,6 +617,7 @@ "alias": "Eth30/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet116": { @@ -572,6 +628,7 @@ "alias": "Eth30/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet114": { @@ -582,6 +639,7 @@ "alias": "Eth29/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "tpid": "0x8100" }, "Ethernet80": { @@ -593,6 +651,7 @@ "alias": "Eth21", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet112": { @@ -603,6 +662,7 @@ "alias": "Eth29/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet86": { @@ -613,6 +673,7 @@ "alias": "Eth22/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet110": { @@ -623,6 +684,7 @@ "alias": "Eth28/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet84": { @@ -633,6 +695,7 @@ "alias": "Eth22/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet31": { @@ -643,6 +706,7 @@ "alias": "Eth8/4", "pfc_asym": "off", "speed": "25000", + "subport": "4", "tpid": "0x8100" }, "Ethernet49": { @@ -653,6 +717,7 @@ "alias": "Eth13/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet48": { @@ -663,6 +728,7 @@ "alias": "Eth13/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet46": { @@ -673,6 +739,7 @@ "alias": "Eth12/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet30": { @@ -683,6 +750,7 @@ "alias": "Eth8/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet29": { @@ -693,6 +761,7 @@ "alias": "Eth8/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet40": { @@ -704,6 +773,7 @@ "alias": "Eth11", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet120": { @@ -715,6 +785,7 @@ "alias": "Eth31", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet28": { @@ -725,6 +796,7 @@ "alias": "Eth8/1", "pfc_asym": "off", "speed": "25000", + "subport": "1", "tpid": "0x8100" }, "Ethernet66": { @@ -735,6 +807,7 @@ "alias": "Eth17/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet60": { @@ -746,6 +819,7 @@ "alias": "Eth16", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet64": { @@ -756,6 +830,7 @@ "alias": "Eth17/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet44": { @@ -766,6 +841,7 @@ "alias": "Eth12/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet20": { @@ -778,6 +854,7 @@ "alias": "Eth6", "pfc_asym": "off", "speed": "100000", + "subport": "0", "tpid": "0x8100" }, "Ethernet79": { @@ -788,6 +865,7 @@ "alias": "Eth20/3", "pfc_asym": "off", "speed": "25000", + "subport": "3", "tpid": "0x8100" }, "Ethernet69": { @@ -798,6 +876,7 @@ "alias": "Eth18/2", "pfc_asym": "off", "speed": "25000", + "subport": "2", "tpid": "0x8100" }, "Ethernet24": { @@ -808,6 +887,7 @@ "alias": "Eth7/1", "pfc_asym": "off", "speed": "50000", + "subport": "1", "tpid": "0x8100" }, "Ethernet26": { @@ -818,6 +898,7 @@ "alias": "Eth7/2", "pfc_asym": "off", "speed": "50000", + "subport": "2", "tpid": "0x8100" }, "Ethernet128": { @@ -828,7 +909,8 @@ "mtu": "9100", "alias": "Eth33", "pfc_asym": "off", - "speed": "40000" + "speed": "40000", + "subport": "0" }, "Ethernet132": { "index": "34", @@ -838,7 +920,8 @@ "mtu": "9100", "alias": "Eth34", "pfc_asym": "off", - "speed": "25000" + "speed": "25000", + "subport": "0" }, "Ethernet136": { "index": "35", @@ -848,7 +931,8 @@ "mtu": "9100", "alias": "Eth35/1", "pfc_asym": "off", - "speed": "10000" + "speed": "10000", + "subport": "1" }, "Ethernet137": { "index": "35", @@ -858,7 +942,8 @@ "mtu": "9100", "alias": "Eth35/2", "pfc_asym": "off", - "speed": "10000" + "speed": "10000", + "subport": "2" }, "Ethernet138": { "index": "35", @@ -868,7 +953,8 @@ "mtu": "9100", "alias": "Eth35/3", "pfc_asym": "off", - "speed": "10000" + "speed": "10000", + "subport": "3" }, "Ethernet139": { "index": "35", @@ -878,7 +964,8 @@ "mtu": "9100", "alias": "Eth35/4", "pfc_asym": "off", - "speed": "10000" + "speed": "10000", + "subport": "4" }, "Ethernet140": { "index": "36", @@ -888,6 +975,7 @@ "mtu": "9100", "alias": "Eth36/1", "pfc_asym": "off", + "subport": "1", "speed": "25000" }, "Ethernet141": { @@ -898,7 +986,8 @@ "mtu": "9100", "alias": "Eth36/2", "pfc_asym": "off", - "speed": "25000" + "speed": "25000", + "subport": "2" }, "Ethernet142": { "index": "36", @@ -909,6 +998,7 @@ "alias": "Eth36/3", "pfc_asym": "off", "speed": "50000", + "subport": "3", "role": "Dpc" }, "Ethernet144": { @@ -920,6 +1010,7 @@ "alias": "Eth37", "pfc_asym": "off", "speed": "100000", + "subport": "0", "fec": "rs" } } diff --git a/src/sonic-config-engine/tests/test_cfggen_platformJson.py b/src/sonic-config-engine/tests/test_cfggen_platformJson.py index 5d39fd2f3660..4a255ba5d4c1 100644 --- a/src/sonic-config-engine/tests/test_cfggen_platformJson.py +++ b/src/sonic-config-engine/tests/test_cfggen_platformJson.py @@ -79,19 +79,19 @@ def test_platform_json_specific_ethernet_interfaces(self): argument = ['-m', self.platform_sample_graph, '-p', self.platform_json, '-S', self.hwsku_json, '-v', "PORT[\'Ethernet8\']"] output = self.run_script(argument) self.maxDiff = None - expected = "{'index': '3', 'lanes': '8', 'description': 'Eth3/1', 'mtu': '9100', 'alias': 'Eth3/1', 'pfc_asym': 'off', 'speed': '25000', 'tpid': '0x8100'}" + expected = "{'index': '3', 'lanes': '8', 'description': 'Eth3/1', 'mtu': '9100', 'alias': 'Eth3/1', 'pfc_asym': 'off', 'speed': '25000', 'subport': '1', 'tpid': '0x8100'}" self.assertEqual(utils.to_dict(output.strip()), utils.to_dict(expected)) argument = ['-m', self.platform_sample_graph, '-p', self.platform_json, '-S', self.hwsku_json, '-v', "PORT[\'Ethernet112\']"] output = self.run_script(argument) self.maxDiff = None - expected = "{'index': '29', 'lanes': '112', 'description': 'Eth29/1', 'mtu': '9100', 'alias': 'Eth29/1', 'pfc_asym': 'off', 'speed': '25000', 'tpid': '0x8100'}" + expected = "{'index': '29', 'lanes': '112', 'description': 'Eth29/1', 'mtu': '9100', 'alias': 'Eth29/1', 'pfc_asym': 'off', 'speed': '25000', 'subport': '1', 'tpid': '0x8100'}" self.assertEqual(utils.to_dict(output.strip()), utils.to_dict(expected)) argument = ['-m', self.platform_sample_graph, '-p', self.platform_json, '-S', self.hwsku_json, '-v', "PORT[\'Ethernet4\']"] output = self.run_script(argument) self.maxDiff = None - expected = "{'index': '2', 'lanes': '4,5', 'description': 'Eth2/1', 'admin_status': 'up', 'mtu': '9100', 'alias': 'Eth2/1', 'pfc_asym': 'off', 'speed': '50000', 'tpid': '0x8100'}" + expected = "{'index': '2', 'lanes': '4,5', 'description': 'Eth2/1', 'admin_status': 'up', 'mtu': '9100', 'alias': 'Eth2/1', 'pfc_asym': 'off', 'speed': '50000', 'subport': '1', 'tpid': '0x8100'}" print(output.strip()) self.assertEqual(utils.to_dict(output.strip()), utils.to_dict(expected)) From 3a84ba8cac38c15d70df14ba428bdca9c4a3a3a6 Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Sat, 18 May 2024 06:10:31 +0800 Subject: [PATCH 119/282] [vs]: BMv2-based DPU KVM image (#18762) Why I did it Provide POC for development and cooperation. Test for CI (Azp) Microsoft ADO (number only): 27515178 How I did it HLD: sonic-net/SONiC#1634 How to verify it Merge PR: sonic-net/sonic-sairedis#1377 Download the vsdpu image from Azp check the syncd links to the correct DASH SAI admin@vlab-01:~$ docker exec -ti syncd bash root@vlab-01:/# dpkg -l | grep sai ii libsai 1.0.0 amd64 This package contains DASH libsai root@vlab-01:/# dpkg -L libsai /. /etc /etc/dash /etc/dash/dash_pipeline.json /etc/dash/dash_pipeline_ir.json /etc/dash/dash_pipeline_p4rt.json /etc/dash/dash_pipeline_p4rt.txt /usr /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libsai.so root@vlab-01:/# which syncd_dash /usr/bin/syncd_dash root@vlab-01:/# ldd /usr/bin/syncd_dash | grep sai libsaimetadata.so.0 => /usr/lib/x86_64-linux-gnu/libsaimetadata.so.0 (0x00007f949e99b000) libsaimeta.so.0 => /usr/lib/x86_64-linux-gnu/libsaimeta.so.0 (0x00007f949e8ca000) libsai.so => /usr/lib/x86_64-linux-gnu/libsai.so (0x00007f949e417000) root@vlab-01:/# md5sum /usr/lib/x86_64-linux-gnu/libsai.so 9e86fa2f49a824837064d1b8f95b7e48 /usr/lib/x86_64-linux-gnu/libsai.so root@vlab-01:/# ls /etc/dash dash_pipeline.json dash_pipeline_ir.json dash_pipeline_p4rt.json dash_pipeline_p4rt.txt Check the dash engine logs(BMv2) likes following admin@vlab-01:~$ docker logs dash_engine Calling target program-options parser Adding interface eth1 as port 0 [11:20:12.458] [bmv2] [D] [thread 7] Adding interface eth1 as port 0 [11:20:12.500] [bmv2] [E] [thread 7] Add port operation failed Adding interface eth2 as port 1 [11:20:12.500] [bmv2] [D] [thread 7] Adding interface eth2 as port 1 [11:20:12.556] [bmv2] [E] [thread 7] Add port operation failed Server listening on 0.0.0.0:9559 [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_dash_pipeline241': dash_pipeline241 - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'dash_ingress.vip': dash_ingress.deny - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_dash_pipeline247': dash_pipeline247 - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'dash_ingress.direction_lookup_stage.direction_lookup': dash_ingress.direction_lookup_stage.set_inbound_direction - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'dash_ingress.appliance': NoAction - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_eni_lookup33': eni_lookup33 - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_eni_lookup33_0': eni_lookup33_0 - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_eni_lookup33_1': eni_lookup33_1 - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table ... [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_metering_update92': metering_update92 - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_metering_update94': metering_update94 - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_metering_update97': metering_update97 - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'dash_ingress.metering_update_stage.meter_bucket': NoAction - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_metering_update103': metering_update103 - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_metering_update105': metering_update105 - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'dash_ingress.metering_update_stage.eni_meter': NoAction - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_drop_action': dash_ingress.drop_action - [11:23:32.049] [bmv2] [D] [thread 23] simple_switch target has been notified of a config swap Signed-off-by: Ze Gan --- .../build_templates/sonic_debian_extension.j2 | 4 ++ platform/vs/dash-engine.service | 16 ++++++ platform/vs/docker-dash-engine.dep | 8 +++ platform/vs/docker-dash-engine.mk | 14 +++++ .../vs/docker-dash-engine/Dockerfile.cleanup | 11 ++++ platform/vs/docker-dash-engine/Dockerfile.j2 | 23 ++++++++ .../vs/docker-dash-engine/critical_processes | 1 + platform/vs/docker-dash-engine/start.sh | 3 + .../vs/docker-dash-engine/supervisord.conf | 33 +++++++++++ platform/vs/docker-gbsyncd-vs/Dockerfile.j2 | 7 +++ platform/vs/docker-syncd-vs/Dockerfile.j2 | 9 ++- platform/vs/rules.dep | 1 + platform/vs/rules.mk | 1 + platform/vs/syncd-vs.mk | 10 ++++ rules/dash-sai.dep | 8 +++ rules/dash-sai.mk | 17 ++++++ rules/grpc.mk | 39 +++++++++++++ rules/p4lang.dep | 9 +++ rules/p4lang.mk | 45 +++++++++++++++ rules/protobuf.mk | 9 +++ slave.mk | 1 - sonic-slave-bookworm/Dockerfile.j2 | 31 ++++++++++ sonic-slave-bullseye/Dockerfile.j2 | 34 +++++++++++ src/dash-sai/Makefile | 57 +++++++++++++++++++ src/grpc/Makefile | 30 ++++++++++ src/p4lang/Makefile | 48 ++++++++++++++++ src/protobuf/Makefile | 4 +- 27 files changed, 470 insertions(+), 3 deletions(-) create mode 100644 platform/vs/dash-engine.service create mode 100644 platform/vs/docker-dash-engine.dep create mode 100644 platform/vs/docker-dash-engine.mk create mode 100644 platform/vs/docker-dash-engine/Dockerfile.cleanup create mode 100644 platform/vs/docker-dash-engine/Dockerfile.j2 create mode 100644 platform/vs/docker-dash-engine/critical_processes create mode 100755 platform/vs/docker-dash-engine/start.sh create mode 100644 platform/vs/docker-dash-engine/supervisord.conf create mode 100644 rules/dash-sai.dep create mode 100644 rules/dash-sai.mk create mode 100644 rules/grpc.mk create mode 100644 rules/p4lang.dep create mode 100644 rules/p4lang.mk create mode 100644 src/dash-sai/Makefile create mode 100644 src/grpc/Makefile create mode 100644 src/p4lang/Makefile diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index d30e85c268b5..ca8ad48b9c73 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -633,6 +633,10 @@ sudo cp $IMAGE_CONFIGS/misc/docker-wait-any $FILESYSTEM_ROOT/usr/bin/ sudo cp $IMAGE_CONFIGS/topology/topology.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM echo "topology.service" | sudo tee -a $GENERATED_SERVICE_FILE sudo cp $IMAGE_CONFIGS/topology/topology.sh $FILESYSTEM_ROOT/usr/bin + +sudo cp platform/vs/dash-engine.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM +sudo LANG=C chroot $FILESYSTEM_ROOT systemctl disable dash-engine + {%- endif %} # Copy platform topology configuration scripts diff --git a/platform/vs/dash-engine.service b/platform/vs/dash-engine.service new file mode 100644 index 000000000000..342cca06a5c3 --- /dev/null +++ b/platform/vs/dash-engine.service @@ -0,0 +1,16 @@ +[Unit] +Description=Dash engine service +Before=syncd.service +StartLimitIntervalSec=1200 +StartLimitBurst=3 + +[Service] +User=root +ExecStartPre=/usr/bin/dash_engine.sh start +ExecStart=/usr/bin/dash_engine.sh wait +ExecStop=/usr/bin/dash_engine.sh stop +Restart=always +RestartSec=30 + +[Install] +WantedBy=multi-user.target diff --git a/platform/vs/docker-dash-engine.dep b/platform/vs/docker-dash-engine.dep new file mode 100644 index 000000000000..cd0bfe88993e --- /dev/null +++ b/platform/vs/docker-dash-engine.dep @@ -0,0 +1,8 @@ +DPATH := $($(DOCKER_DASH_ENGINE)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/vs/docker-dash-engine.mk platform/vs/docker-dash-engine.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_DASH_ENGINE)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_DASH_ENGINE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_DASH_ENGINE)_DEP_FILES := $(DEP_FILES) diff --git a/platform/vs/docker-dash-engine.mk b/platform/vs/docker-dash-engine.mk new file mode 100644 index 000000000000..177045f299b0 --- /dev/null +++ b/platform/vs/docker-dash-engine.mk @@ -0,0 +1,14 @@ +# docker image for vs gbsyncd + +DOCKER_DASH_ENGINE = docker-dash-engine.gz +$(DOCKER_DASH_ENGINE)_VERSION = 1.0.0 +$(DOCKER_DASH_ENGINE)_PACKAGE_NAME = dash-engine +$(DOCKER_DASH_ENGINE)_PATH = $(PLATFORM_PATH)/docker-dash-engine + +SONIC_DOCKER_IMAGES += $(DOCKER_DASH_ENGINE) +SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_DASH_ENGINE) + +$(DOCKER_DASH_ENGINE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM) + +$(DOCKER_DASH_ENGINE)_CONTAINER_NAME = dash_engine +$(DOCKER_DASH_ENGINE)_CONTAINER_PRIVILEGED = true diff --git a/platform/vs/docker-dash-engine/Dockerfile.cleanup b/platform/vs/docker-dash-engine/Dockerfile.cleanup new file mode 100644 index 000000000000..514bd95ae301 --- /dev/null +++ b/platform/vs/docker-dash-engine/Dockerfile.cleanup @@ -0,0 +1,11 @@ +# Base docker build +FROM docker-dash-engine-sonic:latest + +# Copy the cache data to host +From scratch as output +COPY --from=docker-dash-engine-sonic:latest /cache.tgz cache.tgz + +# Clean up the cache data +FROM docker-dash-engine-sonic:latest as final +RUN rm /cache.tgz + diff --git a/platform/vs/docker-dash-engine/Dockerfile.j2 b/platform/vs/docker-dash-engine/Dockerfile.j2 new file mode 100644 index 000000000000..a3d2ebf034ae --- /dev/null +++ b/platform/vs/docker-dash-engine/Dockerfile.j2 @@ -0,0 +1,23 @@ +FROM p4lang/behavioral-model@sha256:ce45720e28a96a50f275c1b511cd84c2558b62f2cf7a7e506765183bc3fb2e32 +## FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update + +RUN apt-get install -f -y supervisor rsyslog python3-pip +RUN pip3 install supervisord-dependent-startup + +COPY ["start.sh", "/usr/bin/"] + +## COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] +## COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] +## COPY ["critical_processes", "/etc/supervisor/"] + +## Clean up +RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y +RUN rm -rf /debs + +## ENTRYPOINT ["/usr/bin/supervisord"] +ENTRYPOINT ["/usr/bin/start.sh"] diff --git a/platform/vs/docker-dash-engine/critical_processes b/platform/vs/docker-dash-engine/critical_processes new file mode 100644 index 000000000000..41d8adfbccae --- /dev/null +++ b/platform/vs/docker-dash-engine/critical_processes @@ -0,0 +1 @@ +program:simple_switch_grpc diff --git a/platform/vs/docker-dash-engine/start.sh b/platform/vs/docker-dash-engine/start.sh new file mode 100755 index 000000000000..26adccd38b55 --- /dev/null +++ b/platform/vs/docker-dash-engine/start.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +simple_switch_grpc --interface 0@eth1 --interface 1@eth2 --log-console --no-p4 diff --git a/platform/vs/docker-dash-engine/supervisord.conf b/platform/vs/docker-dash-engine/supervisord.conf new file mode 100644 index 000000000000..df50a2d9a633 --- /dev/null +++ b/platform/vs/docker-dash-engine/supervisord.conf @@ -0,0 +1,33 @@ +[supervisord] +logfile_maxbytes=1MB +logfile_backups=2 +nodaemon=true + +[eventlistener:dependent-startup] +command=python3 -m supervisord_dependent_startup +autostart=true +autorestart=unexpected +startretries=0 +exitcodes=0,3 +events=PROCESS_STATE +buffer_size=1024 + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n -iNONE +priority=1 +autostart=true +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true + +[program:start] +command=/usr/bin/start.sh +priority=2 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=rsyslogd:running diff --git a/platform/vs/docker-gbsyncd-vs/Dockerfile.j2 b/platform/vs/docker-gbsyncd-vs/Dockerfile.j2 index e5491fd1b5fb..1c28688ca7c3 100644 --- a/platform/vs/docker-gbsyncd-vs/Dockerfile.j2 +++ b/platform/vs/docker-gbsyncd-vs/Dockerfile.j2 @@ -9,6 +9,13 @@ RUN apt-get update RUN apt-get install -f -y iproute2 libcap2-bin +# For DASH engine + +COPY debs/libnl-3-dev_3.5.0-1_amd64.deb debs/libnl-route-3-dev_3.5.0-1_amd64.deb debs/ +RUN dpkg -i debs/libnl-3-dev_3.5.0-1_amd64.deb debs/libnl-route-3-dev_3.5.0-1_amd64.deb + +RUN apt-get install -f -y libabsl20220623 libc-ares2 python3-six libboost-thread1.74.0 libboost-dev libboost-system-dev libboost-thread-dev libboost-filesystem1.74.0 libboost-program-options1.74.0 libboost-thread1.74.0 libnanomsg5 libpcap0.8 libthrift-0.17.0 libboost-dev libboost-filesystem-dev libboost-program-options-dev libgmp-dev libnanomsg-dev libpcap-dev libtool pkg-config libthrift-dev python3-thrift thrift-compiler libboost-iostreams1.74.0 libgc1 cpp libboost-dev libboost-all-dev libboost-graph-dev libboost-iostreams-dev libfl-dev libgc-dev libgmp-dev libbpf-dev tcpdump libelf-dev llvm clang python3-pyroute2 python3-ply python3-scapy python3-setuptools python3-thrift libthrift-0.17.0 libgrpc++1.51 libgrpc29 libprotobuf32 libboost-dev libboost-system-dev libboost-thread-dev libprotoc-dev protobuf-compiler python3-protobuf libgrpc++-dev libgrpc-dev protobuf-compiler-grpc python3-grpcio + COPY \ {% for deb in docker_gbsyncd_vs_debs.split(' ') -%} debs/{{ deb }}{{' '}} diff --git a/platform/vs/docker-syncd-vs/Dockerfile.j2 b/platform/vs/docker-syncd-vs/Dockerfile.j2 index a29b5e6b6472..6e40fd8225bf 100644 --- a/platform/vs/docker-syncd-vs/Dockerfile.j2 +++ b/platform/vs/docker-syncd-vs/Dockerfile.j2 @@ -8,7 +8,14 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -RUN apt-get install -y libcap2-bin +RUN apt-get install -f -y iproute2 libcap2-bin + +# For DASH engine + +COPY debs/libnl-3-dev_3.5.0-1_amd64.deb debs/libnl-route-3-dev_3.5.0-1_amd64.deb debs/ +RUN dpkg -i debs/libnl-3-dev_3.5.0-1_amd64.deb debs/libnl-route-3-dev_3.5.0-1_amd64.deb + +RUN apt-get install -f -y libabsl20220623 libc-ares2 python3-six libboost-thread1.74.0 libboost-dev libboost-system-dev libboost-thread-dev libboost-filesystem1.74.0 libboost-program-options1.74.0 libboost-thread1.74.0 libnanomsg5 libpcap0.8 libthrift-0.17.0 libboost-dev libboost-filesystem-dev libboost-program-options-dev libgmp-dev libnanomsg-dev libpcap-dev libtool pkg-config libthrift-dev python3-thrift thrift-compiler libboost-iostreams1.74.0 libgc1 cpp libboost-dev libboost-all-dev libboost-graph-dev libboost-iostreams-dev libfl-dev libgc-dev libgmp-dev libbpf-dev tcpdump libelf-dev llvm clang python3-pyroute2 python3-ply python3-scapy python3-setuptools python3-thrift libthrift-0.17.0 libgrpc++1.51 libgrpc29 libprotobuf32 libboost-dev libboost-system-dev libboost-thread-dev libprotoc-dev protobuf-compiler python3-protobuf libgrpc++-dev libgrpc-dev protobuf-compiler-grpc python3-grpcio {% if docker_syncd_vs_debs.strip() -%} # Copy built Debian packages diff --git a/platform/vs/rules.dep b/platform/vs/rules.dep index 44c863612992..14597a1e0dc1 100644 --- a/platform/vs/rules.dep +++ b/platform/vs/rules.dep @@ -10,3 +10,4 @@ include $(PLATFORM_PATH)/one-image.dep include $(PLATFORM_PATH)/onie.dep include $(PLATFORM_PATH)/kvm-image.dep +include $(PLATFORM_PATH)/docker-dash-engine.dep diff --git a/platform/vs/rules.mk b/platform/vs/rules.mk index 6f67778ea55b..c03e386b8bb9 100644 --- a/platform/vs/rules.mk +++ b/platform/vs/rules.mk @@ -11,5 +11,6 @@ include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/onie.mk include $(PLATFORM_PATH)/kvm-image.mk include $(PLATFORM_PATH)/raw-image.mk +include $(PLATFORM_PATH)/docker-dash-engine.mk SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_KVM_IMAGE) $(DOCKER_SONIC_VS) $(SONIC_RAW_IMAGE) diff --git a/platform/vs/syncd-vs.mk b/platform/vs/syncd-vs.mk index e9edf78b2520..748e2a7df20d 100644 --- a/platform/vs/syncd-vs.mk +++ b/platform/vs/syncd-vs.mk @@ -2,6 +2,16 @@ $(LIBSAIREDIS)_DEB_BUILD_PROFILES += syncd vs SYNCD_VS = syncd-vs_1.0.0_$(CONFIGURED_ARCH).deb $(SYNCD_VS)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(LIBSAIVS) + +ifeq ($(BLDENV),bookworm) + $(LIBSAIREDIS)_DEB_BUILD_PROFILES += dashsai + $(LIBSAIREDIS)_DEPENDS += $(DASH_SAI) + $(SYNCD_VS)_RDEPENDS += $(DASH_SAI) +else + $(warning DASH_SAI cannot support this build environment $(BLDENV)) +endif + + $(eval $(call add_derived_package,$(LIBSAIREDIS),$(SYNCD_VS))) SYNCD_VS_DBG = syncd-vs-dbgsym_1.0.0_$(CONFIGURED_ARCH).deb diff --git a/rules/dash-sai.dep b/rules/dash-sai.dep new file mode 100644 index 000000000000..2cc40f8f7b7b --- /dev/null +++ b/rules/dash-sai.dep @@ -0,0 +1,8 @@ +SPATH := $($(DASH_SAI)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/dash-sai.mk rules/dash-sai.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(SPATH)) + +$(DASH_SAI)_CACHE_MODE := GIT_CONTENT_SHA +$(DASH_SAI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DASH_SAI)_DEP_FILES := $(DEP_FILES) diff --git a/rules/dash-sai.mk b/rules/dash-sai.mk new file mode 100644 index 000000000000..7accf72e9013 --- /dev/null +++ b/rules/dash-sai.mk @@ -0,0 +1,17 @@ +# DASH SAI repo: https://github.com/sonic-net/DASH + +DASH_SAI_VERSION = 1.0.0 +DASH_SAI_COMMIT = cc281333e24ade258773ea843f669251a44d7c9a + +export DASH_SAI_VERSION +export DASH_SAI_COMMIT + +DASH_SAI = libsai_$(DASH_SAI_VERSION)_$(CONFIGURED_ARCH).deb +$(DASH_SAI)_SRC_PATH = $(SRC_PATH)/dash-sai +$(DASH_SAI)_DEPENDS = $(P4LANG_PI) $(P4LANG_BMV2) $(P4LANG_P4C) +$(DASH_SAI)_RDEPENDS = $(P4LANG_PI) $(P4LANG_BMV2) $(P4LANG_P4C) +SONIC_MAKE_DEBS += $(DASH_SAI) + +DASH_SAI_DEV = libsai-dev_$(DASH_SAI_VERSION)_$(CONFIGURED_ARCH).deb +$(DASH_SAI_DEV)_DEPENDS = $(DASH_SAI) +$(eval $(call add_derived_package,$(DASH_SAI),$(DASH_SAI_DEV))) diff --git a/rules/grpc.mk b/rules/grpc.mk new file mode 100644 index 000000000000..71612e7081ad --- /dev/null +++ b/rules/grpc.mk @@ -0,0 +1,39 @@ +# grpc package +# A newer GRPC has been released in bookworm, So we only need to build it +# in the bullseye environment. +ifeq ($(BLDENV),bullseye) + + GRPC_VERSION = 1.30.2 + GRPC_VERSION_FULL = $(GRPC_VERSION)-3 + + export GRPC_VERSION + export GRPC_VERSION_FULL + + GRPC = libgrpc10_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(GRPC)_DEPENDS = $(PROTOBUF) $(PROTOC32) $(PROTOBUF_COMPILER) $(PROTOBUF_DEV) $(PROTOC_DEV) $(RUBY_PROTOBUF) + $(GRPC)_SRC_PATH = $(SRC_PATH)/grpc + SONIC_MAKE_DEBS += $(GRPC) + + GRPC_DEV = libgrpc-dev_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(GRPC_DEV)_DEPENDS = $(GRPC) + $(eval $(call add_derived_package,$(GRPC),$(GRPC_DEV))) + + GRPC_CPP = libgrpc++1_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(GRPC_CPP)_DEPENDS = $(GRPC) $(PROTOC32) + $(eval $(call add_derived_package,$(GRPC),$(GRPC_CPP))) + + GRPC_CPP_DEV = libgrpc++-dev_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(GRPC_CPP_DEV)_DEPENDS = $(GRPC_CPP) $(GRPC_DEV) + $(eval $(call add_derived_package,$(GRPC),$(GRPC_CPP_DEV))) + + PYTHON3_GRPC = python3-grpcio_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PYTHON3_GRPC)_DEPENDS = $(GRPC_DEV) $(GRPC) $(GRPC_DEV) $(GRPC_CPP) $(GRPC_CPP_DEV) $(PYTHON3_PROTOBUF) + $(PYTHON3_GRPC)_RDEPENDS = $(GRPC) $(GRPC_CPP) $(PYTHON3_PROTOBUF) + $(eval $(call add_derived_package,$(GRPC),$(PYTHON3_GRPC))) + + GRPC_COMPILER = protobuf-compiler-grpc_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(GRPC_COMPILER)_DEPENDS = $(PROTOBUF) $(PROTOC32) $(PROTOBUF_COMPILER) + $(GRPC_COMPILER)_RDEPENDS = $(PROTOBUF) $(PROTOC32) $(PROTOBUF_COMPILER) + $(eval $(call add_derived_package,$(GRPC),$(GRPC_COMPILER))) + +endif diff --git a/rules/p4lang.dep b/rules/p4lang.dep new file mode 100644 index 000000000000..01effeb6f078 --- /dev/null +++ b/rules/p4lang.dep @@ -0,0 +1,9 @@ + +SPATH := $($(P4LANG_PI)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/p4lang.mk rules/p4lang.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(SPATH)) + +$(P4LANG_PI)_CACHE_MODE := GIT_CONTENT_SHA +$(P4LANG_PI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(P4LANG_PI)_DEP_FILES := $(DEP_FILES) diff --git a/rules/p4lang.mk b/rules/p4lang.mk new file mode 100644 index 000000000000..2bca4e1f50bd --- /dev/null +++ b/rules/p4lang.mk @@ -0,0 +1,45 @@ +# p4lang package + +# Main target: p4lang-pi +P4LANG_PI_VERSION = 0.1.0 +P4LANG_PI_VERSION_FULL = $(P4LANG_PI_VERSION)-15 + +export P4LANG_PI_VERSION +export P4LANG_PI_VERSION_FULL + +P4LANG_PI = p4lang-pi_$(P4LANG_PI_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(P4LANG_PI)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOC32) $(PYTHON3_PROTOBUF) $(GRPC) $(GRPC_CPP) $(PYTHON3_GRPC) $(PROTOBUF_DEV) $(PROTOC_DEV) $(PROTOBUF_COMPILER) $(GRPC_DEV) $(GRPC_CPP_DEV) $(GRPC_COMPILER) +$(P4LANG_PI)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOC32) $(PYTHON3_PROTOBUF) $(GRPC) $(GRPC_CPP) $(PYTHON3_GRPC) $(PROTOBUF_DEV) $(PROTOC_DEV) $(PROTOBUF_COMPILER) $(GRPC_DEV) $(GRPC_CPP_DEV) $(GRPC_COMPILER) + + +P4LANG = $(P4LANG_PI) +$(P4LANG)_SRC_PATH = $(SRC_PATH)/p4lang +SONIC_MAKE_DEBS += $(P4LANG) + +# p4lang-bmv2 + +P4LANG_BMV2_VERSION = 1.15.0 +P4LANG_BMV2_VERSION_FULL = $(P4LANG_BMV2_VERSION)-7 + +export P4LANG_BMV2_VERSION +export P4LANG_BMV2_VERSION_FULL + +P4LANG_BMV2 = p4lang-bmv2_$(P4LANG_BMV2_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(P4LANG_BMV2)_SRC_PATH = $(SRC_PATH)/p4lang +$(P4LANG_BMV2)_DEPENDS = $(P4LANG_PI) +$(P4LANG_BMV2)_RDEPENDS = $(P4LANG_PI) +SONIC_MAKE_DEBS += $(P4LANG_BMV2) + +# p4lang-p4c + +P4LANG_P4C_VERSION = 1.2.4.2 +P4LANG_P4C_VERSION_FULL = $(P4LANG_P4C_VERSION)-2 + +export P4LANG_P4C_VERSION +export P4LANG_P4C_VERSION_FULL + +P4LANG_P4C = p4lang-p4c_$(P4LANG_P4C_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(P4LANG_P4C)_SRC_PATH = $(SRC_PATH)/p4lang +$(P4LANG_P4C)_DEPENDS = $(P4LANG_BMV2) +$(P4LANG_P4C)_RDEPENDS = $(P4LANG_BMV2) +SONIC_MAKE_DEBS += $(P4LANG_P4C) diff --git a/rules/protobuf.mk b/rules/protobuf.mk index 866eb6b99f3e..4ebb88e76a0e 100644 --- a/rules/protobuf.mk +++ b/rules/protobuf.mk @@ -24,6 +24,10 @@ ifeq ($(BLDENV),bullseye) $(PROTOC32)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC32))) + PROTOC_DEV = libprotoc-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOC_DEV)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOC32) + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC_DEV))) + PROTOBUF_COMPILER = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb $(PROTOBUF_COMPILER)_DEPENDS = $(PROTOC32) $(PROTOBUF_COMPILER)_RDEPENDS = $(PROTOC32) @@ -34,4 +38,9 @@ ifeq ($(BLDENV),bullseye) $(PYTHON3_PROTOBUF)_RDEPENDS = $(PROTOBUF) $(eval $(call add_derived_package,$(PROTOBUF),$(PYTHON3_PROTOBUF))) + RUBY_PROTOBUF = ruby-google-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(RUBY_PROTOBUF)_DEPENDS = $(PROTOBUF_DEV) $(PROTOBUF) + $(RUBY_PROTOBUF)_RDEPENDS = $(PROTOBUF) + $(eval $(call add_derived_package,$(PROTOBUF),$(RUBY_PROTOBUF))) + endif diff --git a/slave.mk b/slave.mk index c6c0e32e6569..783ca1ac0b75 100644 --- a/slave.mk +++ b/slave.mk @@ -250,7 +250,6 @@ ifeq ($(SONIC_ENABLE_BOOTCHART),y) ENABLE_BOOTCHART = y endif - ifeq ($(ENABLE_ASAN),y) ifneq ($(CONFIGURED_ARCH),amd64) $(Q)echo "Disabling SWSS address sanitizer due to incompatible CPU architecture: $(CONFIGURED_ARCH)" diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 2d48357f5605..6b749b5e8f40 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -447,6 +447,34 @@ RUN apt-get update && apt-get install -y \ hwdata \ libzip-dev +{%- if CONFIGURED_ARCH != "arm64" and CONFIGURED_ARCH != "armhf" %} +RUN apt-get update && apt-get install -y \ +# For p4 libraries + libgrpc++-dev \ + libgrpc-dev \ + libprotoc-dev \ + protobuf-compiler-grpc \ + valgrind \ + python3-protobuf \ + python3-grpcio \ + thrift-compiler \ + gfortran \ + libopenmpi-dev \ + libthrift-0.17.0 \ + libthrift-dev \ + libboost-all-dev \ + libboost-graph-dev \ + libboost-iostreams-dev \ + libgc-dev \ + tcpdump \ + llvm \ + net-tools \ + python3-pyroute2 \ + python3-ply \ + python3-scapy \ + python3-thrift +{%- endif %} + {%- if CROSS_BUILD_ENVIRON == "y" %} # Arm vs. amd64 versions conflict - remove amd64 packages RUN apt-get remove -y libnl-3-200 @@ -506,6 +534,9 @@ RUN patch -p1 -i /disable-non-manylinux.patch /usr/local/lib/python3.11/dist-pac # For building sonic-utilities RUN pip3 install fastentrypoints mock +# For DASH BMv2 +RUN pip3 install jsonpath_ng + # For building sonic_ycabled # Note: Match version in bookworm RUN pip3 install grpcio==1.51.1 grpcio-tools==1.51.1 diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 4ff550aca554..2e9a3b2e6db6 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -427,6 +427,37 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install default-jdk \ libgoogle-gson-java +{%- if CONFIGURED_ARCH != "arm64" and CONFIGURED_ARCH != "armhf" %} +# For DASH BMv2 +RUN eatmydata apt install -y \ +# For grpc + libgflags-dev \ + libgoogle-perftools-dev \ + ruby-googleauth \ + ruby-googleapis-common-protos-types \ + ruby-simplecov \ + cython3 \ +# For p4 libraries + valgrind \ + thrift-compiler \ + gfortran \ + libopenmpi-dev \ + libthrift-0.13.0 \ + libthrift-dev \ + libboost-all-dev \ + libboost-graph-dev \ + libboost-iostreams-dev \ + libgc-dev \ + tcpdump \ + llvm \ + net-tools \ + python3-pyroute2 \ + python3-ply \ + python3-scapy \ + python3-thrift \ + libabsl20200923 libc-ares2 python3-six libboost-thread1.74.0 libboost-dev libboost-system-dev libboost-thread-dev libboost-filesystem1.74.0 libboost-program-options1.74.0 libboost-thread1.74.0 libnanomsg5 libpcap0.8 libthrift-0.13.0 libboost-dev libboost-filesystem-dev libboost-program-options-dev libgmp-dev libnanomsg-dev libpcap-dev libtool pkg-config libthrift-dev python3-thrift thrift-compiler libboost-iostreams1.74.0 libgc1 cpp libboost-dev libboost-all-dev libboost-graph-dev libboost-iostreams-dev libfl-dev libgc-dev libgmp-dev libbpf-dev tcpdump libelf-dev llvm clang python3-pyroute2 python3-ply python3-scapy python3-setuptools python3-thrift libthrift-0.13.0 +{%- endif %} + {%- if CROSS_BUILD_ENVIRON == "y" %} # Arm vs. amd64 versions conflict - remove amd64 packages RUN apt-get remove -y libnl-3-200 @@ -571,6 +602,9 @@ RUN pip3 install mmh3==2.5.1 RUN pip3 install parameterized==0.8.1 +# For DASH BMv2 +RUN pip3 install jsonpath_ng + RUN eatmydata apt-get install -y xsltproc # Install dependencies for isc-dhcp-relay build diff --git a/src/dash-sai/Makefile b/src/dash-sai/Makefile new file mode 100644 index 000000000000..2a188c49f6c9 --- /dev/null +++ b/src/dash-sai/Makefile @@ -0,0 +1,57 @@ +SHELL = /bin/bash +.ONESHELL: +.SHELLFLAGS += -xe + +MAIN_TARGET = libsai_$(DASH_SAI_VERSION)_$(CONFIGURED_ARCH).deb +DERIVED_TARGETS = libsai-dev_$(DASH_SAI_VERSION)_$(CONFIGURED_ARCH).deb + +CURRENT_DIR=$(shell pwd) +PIPELINE_DIR=$(CURRENT_DIR)/DASH/dash-pipeline +P4_MAIN=bmv2/dash_pipeline.p4 +P4_OUTDIR=bmv2/dash_pipeline.bmv2 + + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : +# Remove any stale files + rm -rf DASH + + git clone https://github.com/sonic-net/DASH.git DASH + + pushd DASH/dash-pipeline + git checkout $(DASH_SAI_COMMIT) + git submodule update --init + + mkdir -p $(P4_OUTDIR) + mkdir -p SAI/lib + sudo ln -sf $(PIPELINE_DIR)/bmv2 /bmv2 + +# Compile the P4 program + p4c-bm2-ss -DTARGET_BMV2_V1MODEL $(P4_MAIN) -o $(P4_OUTDIR)/dash_pipeline.json --p4runtime-files $(P4_OUTDIR)/dash_pipeline_p4rt.json,$(P4_OUTDIR)/dash_pipeline_p4rt.txt --toJSON $(P4_OUTDIR)/dash_pipeline_ir.json + +# Generate SAI files + pushd SAI + make + popd + +# Compile sai meta + sed -i.bak '/checkenumlock.sh/d' SAI/SAI/meta/Makefile + sed -i.bak '/checkancestry.sh/d' SAI/SAI/meta/Makefile + sed -i.bak '/checkstructs.sh/d' SAI/SAI/meta/Makefile + pushd SAI/SAI/meta/ + CFLAGS=-Wdangling-pointer=1 make all libsaimetadata.so + popd + +# Compile sai library + pushd SAI/lib + make + popd + + pushd SAI/debian + make + mv $(DERIVED_TARGETS) $* $(DEST)/ + popd + + popd + +$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) + diff --git a/src/grpc/Makefile b/src/grpc/Makefile new file mode 100644 index 000000000000..c77cb8d4434a --- /dev/null +++ b/src/grpc/Makefile @@ -0,0 +1,30 @@ +SHELL = /bin/bash +.ONESHELL: +.SHELLFLAGS += -e + +MAIN_TARGET = libgrpc10_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb +DERIVED_TARGETS = libgrpc-dev_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + libgrpc++1_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + libgrpc++-dev_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + python3-grpcio_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + protobuf-compiler-grpc_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + # Remove any stale files + rm -rf grpc-$(GRPC_VERSION) + + dget -u grpc_$(GRPC_VERSION_FULL).dsc https://deb.debian.org/debian/pool/main/g/grpc/grpc_$(GRPC_VERSION_FULL).dsc + + pushd grpc-$(GRPC_VERSION) + +ifeq ($(CROSS_BUILD_ENVIRON), y) + dpkg-buildpackage -us -uc -b -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +else + dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +endif + + popd + + mv $(DERIVED_TARGETS) $* $(DEST)/ + +$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) \ No newline at end of file diff --git a/src/p4lang/Makefile b/src/p4lang/Makefile new file mode 100644 index 000000000000..a896001ba1e9 --- /dev/null +++ b/src/p4lang/Makefile @@ -0,0 +1,48 @@ +SHELL = /bin/bash +.ONESHELL: +.SHELLFLAGS += -xe + +P4LANG_TARGET = p4lang-pi_$(P4LANG_PI_VERSION_FULL)_$(CONFIGURED_ARCH).deb + +$(addprefix $(DEST)/, $(P4LANG_TARGET)): $(DEST)/% : +# # Remove any stale files + rm -rf p4lang-pi-$(P4LANG_PI_VERSION) + dget -u p4lang-pi_$(P4LANG_PI_VERSION_FULL).dsc http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-pi_$(P4LANG_PI_VERSION_FULL).dsc + pushd p4lang-pi-$(P4LANG_PI_VERSION) +ifeq ($(CROSS_BUILD_ENVIRON), y) + dpkg-buildpackage -us -uc -b -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +else + dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +endif + popd + mv $* $(DEST)/ + +P4LANG_BMV2_TARGET = p4lang-bmv2_$(P4LANG_BMV2_VERSION_FULL)_$(CONFIGURED_ARCH).deb + +$(addprefix $(DEST)/, $(P4LANG_BMV2_TARGET)): $(DEST)/% : +# # Remove any stale files + rm -rf p4lang-bmv2-$(P4LANG_BMV2_VERSION) + dget -u p4lang-bmv2_$(P4LANG_BMV2_VERSION_FULL).dsc http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-bmv2_$(P4LANG_BMV2_VERSION_FULL).dsc + pushd p4lang-bmv2-$(P4LANG_BMV2_VERSION) +ifeq ($(CROSS_BUILD_ENVIRON), y) + dpkg-buildpackage -us -uc -b -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +else + dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +endif + popd + mv $* $(DEST)/ + +P4LANG_P4C_TARGET = p4lang-p4c_$(P4LANG_P4C_VERSION_FULL)_$(CONFIGURED_ARCH).deb +$(addprefix $(DEST)/, $(P4LANG_P4C_TARGET)): $(DEST)/% : +# # Remove any stale files + rm -rf p4lang-p4c-$(P4LANG_P4C_VERSION) + dget -u p4lang-p4c_$(P4LANG_P4C_VERSION_FULL).dsc http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-p4c_$(P4LANG_P4C_VERSION_FULL).dsc + pushd p4lang-p4c-$(P4LANG_P4C_VERSION) +ifeq ($(CROSS_BUILD_ENVIRON), y) + dpkg-buildpackage -us -uc -b -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +else + dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +endif + popd + mv $* $(DEST)/ + diff --git a/src/protobuf/Makefile b/src/protobuf/Makefile index 3b13eaec526b..6aead6060ad1 100644 --- a/src/protobuf/Makefile +++ b/src/protobuf/Makefile @@ -7,7 +7,9 @@ DERIVED_TARGETS = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH). libprotobuf-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ libprotobuf-lite32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ libprotoc32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ - python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + libprotoc-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ + ruby-google-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Remove any stale files From 79502f0de187d24c43fe539fb245fe5602b67e22 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 18 May 2024 10:00:51 +0800 Subject: [PATCH 120/282] [submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#18986) #### Why I did it src/sonic-platform-common ``` * 862a67c - (HEAD -> master, origin/master, origin/HEAD) Added API to decommison all datapaths of a CMIS compliant module (#471) (10 hours ago) [Prince George] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-common b/src/sonic-platform-common index 036246032e00..862a67c59de2 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 036246032e0012910b71e1986b74100dbd8142a3 +Subproject commit 862a67c59de267567563e003f5d0845b5f939527 From 2e1d4026a7f2b09b2cb5e67d6a85aedeaeb5392b Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 18 May 2024 10:00:56 +0800 Subject: [PATCH 121/282] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18976) #### Why I did it src/sonic-platform-daemons ``` * 88bf8ec - (HEAD -> master, origin/master, origin/HEAD) [chassis][midplane] Modify the chassisd to log expected/unexpected midplane connectivity messages (#480) (34 hours ago) [Marty Y. Lok] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 9d0c55002129..88bf8ecc0b27 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 9d0c55002129dac4fecddc45edfd6cfa8bc510d8 +Subproject commit 88bf8ecc0b2733b37340902eeea3382c3477ff1b From aed91044a977ca560e8e2843d9a21dba915f6674 Mon Sep 17 00:00:00 2001 From: anamehra <54692434+anamehra@users.noreply.github.com> Date: Fri, 17 May 2024 21:13:03 -0700 Subject: [PATCH 122/282] [cisco]: Update cisco-8000.ini to 0.master.0.1 release (#18989) Support for Cisco-8000 platforms on master/ bookworm --- platform/checkout/cisco-8000.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/checkout/cisco-8000.ini b/platform/checkout/cisco-8000.ini index ccda22289a97..709f576b1e2a 100644 --- a/platform/checkout/cisco-8000.ini +++ b/platform/checkout/cisco-8000.ini @@ -1,3 +1,3 @@ [module] repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git -ref=202311.main.0.1 +ref=0.master.0.1 From 15c9014aea741c39cd51dc5b7e767a0b2d0c7d27 Mon Sep 17 00:00:00 2001 From: Vivek Date: Fri, 17 May 2024 21:15:48 -0700 Subject: [PATCH 123/282] [Mellanox] Use the explicit mst device of SPC during fw-upgrade (#18929) Why I did it mlxfwmanager on smartwitch will show more than 1 device. Thus update the mlnx-fw-upgrade script to operate explicitly on Spectrum PCI device. How I did it Used the mlxfwmanager --query-format XML command to get the output in XML format and used xmlstarlet cmd to parse the output Example cmd output: No matching image found NVIDIA BlueField-3 DPU based COM express; IPN QP No matching image found NVIDIA Spectrum-3 based 400GbE 2U Ethernet Smart-Switch with ONIE; 28 ports QSFP-DD; 4 DPUs; 2 power supplies (AC); x86 CPU - 16 Cores; Secure-boot Capable; standard depth; C2P airflow; Tool-less Rail Kit Exclusively operate on the PCI device inferred from the output to Wait, fetch psid and Current FW version Use awk for a reliable extraction of Available FW output How to verify it Verify the script if it upgrades FW properly during switch init and during reboot. Signed-off-by: Vivek Reddy --- .../build_templates/sonic_debian_extension.j2 | 4 +- platform/mellanox/mlnx-fw-upgrade.j2 | 56 ++++++++++++------- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index ca8ad48b9c73..74865bf571e0 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -1058,8 +1058,8 @@ sudo rm -rf $FILESYSTEM_ROOT/$MLNX_SONIC_PLATFORM_PY3_WHEEL_NAME sudo cp platform/mellanox/nv-syncd-shared/nv-syncd-shared.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/ sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable nv-syncd-shared -# Install minicom package -sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install minicom +# Install required packages specific for mellanox platform +sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install minicom xmlstarlet sudo LANG=C chroot $FILESYSTEM_ROOT systemctl disable rshim.service {% endif %} diff --git a/platform/mellanox/mlnx-fw-upgrade.j2 b/platform/mellanox/mlnx-fw-upgrade.j2 index 7a36a2ebd92d..eb288624982c 100755 --- a/platform/mellanox/mlnx-fw-upgrade.j2 +++ b/platform/mellanox/mlnx-fw-upgrade.j2 @@ -1,10 +1,13 @@ {#- - Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. + Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -32,6 +35,7 @@ declare -r EXIT_SUCCESS="0" declare -r EXIT_FAILURE="1" declare -r FW_ALREADY_UPDATED_FAILURE="2" +declare -r QUERY_XML="mlxfwmanager --query-format XML" declare -r QUERY_CMD="mlxfwmanager --query" declare -r LIST_CONTENT_CMD="mlxfwmanager --list-content" declare -r BURN_CMD="mlxfwmanager -u -f -y" @@ -163,21 +167,22 @@ function WaitForDevice() { local -i QUERY_RETRY_COUNT_MAX="10" local -i QUERY_RETRY_COUNT="0" - ${QUERY_CMD} > /dev/null + local SPC_MST_DEV=$(GetSPCMstDevice) - while [[ ("${QUERY_RETRY_COUNT}" -lt "${QUERY_RETRY_COUNT_MAX}") && ("$?" -ne "${EXIT_SUCCESS}") ]]; do + while [[ ("${QUERY_RETRY_COUNT}" -lt "${QUERY_RETRY_COUNT_MAX}") && ("${SPC_MST_DEV}" == "${UNKN_MST}") ]]; do sleep 1s ((QUERY_RETRY_COUNT++)) - output=$(eval ${MFT_DIAGNOSIS_FLAGS} ${QUERY_CMD}) > /dev/null + SPC_MST_DEV=$(GetSPCMstDevice) done - ERROR_CODE="$?" - if [[ "${ERROR_CODE}" != "${EXIT_SUCCESS}" ]]; then - # Exit failure and print the detailed information - echo "$output" + if [[ "${SPC_MST_DEV}" == "${UNKN_MST}" ]]; then + # Couldn't Detect the Spectrum ASIC. Exit failure and print the detailed information + output=$(${QUERY_CMD}) failure_msg="${output#*Fail : }" - ExitFailure "FW Query command: ${QUERY_CMD} failed to wait for device with error: ${failure_msg}" + ExitFailure "FW Query command: ${QUERY_CMD} failed to detect spectrum device with error: ${failure_msg}" fi + + LogInfo "Spectrum ASIC successfully detected at ${SPC_MST_DEV}" } function GetAsicType() { @@ -206,8 +211,8 @@ function GetAsicType() { exit "${EXIT_FAILURE}" } -function GetMstDevice() { - local _MST_DEVICE="$(ls /dev/mst/*_pci_cr0 2>&1)" +function GetSPCMstDevice() { + local _MST_DEVICE=$(${QUERY_XML} | xmlstarlet sel -t -m "//Device[contains(@type,'Spectrum')]" -v @pciName | head -n 1) if [[ ! -c "${_MST_DEVICE}" ]]; then echo "${UNKN_MST}" @@ -218,6 +223,19 @@ function GetMstDevice() { exit "${EXIT_SUCCESS}" } +function GetXPathXML() { + local xpath=$1 + local xml_file=$2 + + val=$(xmlstarlet sel -t -v "${xpath}" ${xml_file}) + ERROR_CODE="$?" + if [[ "${ERROR_CODE}" != "${EXIT_SUCCESS}" ]]; then + ExitFailure "XML Fetch failed for path: ${xpath}, file: $(cat ${xml_file})" + fi + + echo ${val} +} + function RunCmd() { local ERROR_CODE="${EXIT_SUCCESS}" @@ -247,7 +265,7 @@ function RunFwUpdateCmd() { if [[ "${ERROR_CODE}" == "${FW_ALREADY_UPDATED_FAILURE}" ]]; then LogInfo "FW reactivation is required. Reactivating and updating FW ..." - local -r _MST_DEVICE="$(GetMstDevice)" + local -r _MST_DEVICE="$(GetSPCMstDevice)" local -r _CMD="flint -d ${_MST_DEVICE} ir" output=$(eval "${_CMD}") @@ -285,15 +303,14 @@ function UpgradeFW() { ExitFailure "no such file: ${_FW_FILE}" fi - RunCmd "${QUERY_CMD} -o ${QUERY_FILE}" - local -r _FW_CURRENT_INFO="$(grep FW ${QUERY_FILE})" - local -r _FW_CURRENT="$(echo ${_FW_CURRENT_INFO} | cut -f2 -d' ')" - local -r _PSID_INFO="$(grep PSID ${QUERY_FILE})" - local -r _PSID="$(echo ${_PSID_INFO} | cut -f2 -d' ')" + local -r _MST_DEVICE=$(GetSPCMstDevice) + RunCmd "${QUERY_XML} -d ${_MST_DEVICE} -o ${QUERY_FILE}" + local -r _FW_CURRENT=$(GetXPathXML "//Device/Versions/FW/@current" ${QUERY_FILE}) + local -r _PSID=$(GetXPathXML "//Device/@psid" ${QUERY_FILE}) - RunCmd "${LIST_CONTENT_CMD} -i ${_FW_FILE} -o ${LIST_CONTENT_FILE}" + RunCmd "${LIST_CONTENT_CMD} -i ${_FW_FILE} -d ${_MST_DEVICE} -o ${LIST_CONTENT_FILE}" local -r _FW_AVAILABLE_INFO="$(grep ${_PSID} ${LIST_CONTENT_FILE})" - local -r _FW_AVAILABLE="$(echo ${_FW_AVAILABLE_INFO} | cut -f4 -d' ')" + local -r _FW_AVAILABLE="$(echo ${_FW_AVAILABLE_INFO} | awk '{print $4}')" if [[ -z "${_FW_CURRENT}" ]]; then ExitFailure "could not retreive current FW version" @@ -307,7 +324,6 @@ function UpgradeFW() { ExitSuccess "firmware is up to date" else LogNotice "firmware upgrade is required. Installing compatible version..." - local -r _MST_DEVICE="$(GetMstDevice)" if [[ "${_MST_DEVICE}" = "${UNKN_MST}" ]]; then LogWarning "could not find fastest mst device, using default device" RunFwUpdateCmd "-i ${_FW_FILE}" From f2418ab2eccbd0c2822326dd359246ca0af05adc Mon Sep 17 00:00:00 2001 From: wumiao_nokia Date: Sat, 18 May 2024 00:24:00 -0400 Subject: [PATCH 124/282] Fix a logic issue for load_namespace_config in sonic-cfggen (#18691) PR 10960 fixed an issue of calling load_sonic_global_db_config() multiple times which causes error log of "SonicDBConfig Global config is already initialized". The load_namespace_config() has logic issue so is fixed with this PR --- src/sonic-config-engine/sonic-cfggen | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index 87a1dbb17652..a3b54c756425 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -184,12 +184,13 @@ def get_primary_addr(value): intf_with_secondary.remove(name) return primary_gateways -def load_namespace_config(asic_name): - if not SonicDBConfig.isInit(): - if is_multi_asic(): - SonicDBConfig.load_sonic_global_db_config(namespace=asic_name) - else: - SonicDBConfig.load_sonic_db_config() +def load_namespace_config(): + if is_multi_asic(): + if not SonicDBConfig.isGlobalInit(): + SonicDBConfig.initializeGlobalConfig() + else: + if not SonicDBConfig.isInit(): + SonicDBConfig.initialize() class FormatConverter: """Convert config DB based schema to legacy minigraph based schema for backward capability. @@ -241,7 +242,6 @@ TODO(taoyl): Current version of config db only supports BGP admin states. data[table][new_key] = data[table].pop(key) return data - def deep_update(dst, src): """ Deep update of dst dict with contest of src dict""" pending_nodes = [(dst, src)] @@ -360,7 +360,7 @@ def main(): deep_update(data, hardware_data) if args.port_config is None: args.port_config = device_info.get_path_to_port_config_file(hwsku) - load_namespace_config(asic_name) + load_namespace_config() (ports, _, _) = get_port_config(hwsku, platform, args.port_config, asic_id) if ports is None: print('Failed to get port config', file=sys.stderr) @@ -391,7 +391,7 @@ def main(): if args.minigraph is not None: minigraph = args.minigraph - load_namespace_config(asic_name) + load_namespace_config() if platform: if args.port_config is not None: deep_update(data, parse_xml(minigraph, platform, args.port_config, asic_name=asic_name, hwsku_config_file=args.hwsku_config)) @@ -419,7 +419,7 @@ def main(): if args.namespace is None: configdb = ConfigDBPipeConnector(use_unix_socket_path=use_unix_sock, **db_kwargs) else: - SonicDBConfig.load_sonic_global_db_config(namespace=args.namespace) + load_namespace_config() configdb = ConfigDBPipeConnector(use_unix_socket_path=use_unix_sock, namespace=args.namespace, **db_kwargs) configdb.connect() @@ -496,7 +496,7 @@ def main(): if args.namespace is None: configdb = ConfigDBPipeConnector(use_unix_socket_path=True, **db_kwargs) else: - SonicDBConfig.load_sonic_global_db_config(namespace=args.namespace) + load_namespace_config() configdb = ConfigDBPipeConnector(use_unix_socket_path=True, namespace=args.namespace, **db_kwargs) configdb.connect(False) From db78f748f02cae9f9130616827c450ae6e365733 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 18 May 2024 19:01:00 +0800 Subject: [PATCH 125/282] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#18994) #### Why I did it src/sonic-platform-daemons ``` * 9ffce20 - (HEAD -> master, origin/master, origin/HEAD) CMIS 'ConfigSuccess" failure while changing default ApSel code for 800G DR8/FR8 modules (#459) (9 hours ago) [Anoop Kamath] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 88bf8ecc0b27..9ffce2036d53 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 88bf8ecc0b2733b37340902eeea3382c3477ff1b +Subproject commit 9ffce2036d53571bd23b4a630ac285039e383c4f From dfa3eaae9c053d7cd88cb55d001f4e7223e6a47a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 18 May 2024 19:01:09 +0800 Subject: [PATCH 126/282] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#18991) #### Why I did it src/sonic-gnmi ``` * 692f967 - (HEAD -> master, origin/master, origin/HEAD) Update pipeline to check memory leak (#228) (19 hours ago) [ganglv] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index adece7c46bed..692f967d4fb2 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit adece7c46bed9b2a43ed2ea3fa325590988e95d3 +Subproject commit 692f967d4fb2d55593267663a722826186ddf0d1 From 19f7e1c0e7fb5ff81cec4cf3c973052d20cfcffa Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 19 May 2024 02:52:48 +0800 Subject: [PATCH 127/282] [ci/build]: Upgrade SONiC package versions (#18996) --- .../versions-deb-bookworm | 7 +- .../versions-deb-bullseye | 4 - .../build-sonic-slave-bullseye/versions-py3 | 3 - files/build/versions/default/versions-docker | 4 +- files/build/versions/default/versions-git | 13 +- files/build/versions/default/versions-mirror | 38 +-- files/build/versions/default/versions-web | 14 +- .../versions-py3 | 2 +- .../versions-py3 | 2 +- .../docker-dash-engine/versions-deb-focal | 101 +++++++ .../dockers/docker-dash-engine/versions-py3 | 18 ++ .../docker-gbsyncd-vs/versions-deb-bookworm | 268 ++++++++++++++++++ .../dockers/docker-gbsyncd-vs/versions-py3 | 7 + .../versions-deb-bookworm | 4 + .../docker-sonic-gnmi/versions-deb-bookworm | 29 ++ .../docker-sonic-gnmi/versions-deb-bullseye | 26 -- .../versions-deb-bookworm | 34 +++ .../versions-deb-buster | 25 -- .../docker-sonic-mgmt-framework/versions-py3 | 29 +- .../docker-syncd-vs/versions-deb-bookworm | 268 ++++++++++++++++++ .../dockers/docker-syncd-vs/versions-py3 | 7 + .../versions-deb-bookworm | 136 ++++++++- .../dockers/sonic-slave-bookworm/versions-py3 | 39 ++- .../versions-py3-all-arm64 | 1 + .../versions-py3-all-armhf | 1 + .../versions-deb-bullseye | 127 ++++++++- .../dockers/sonic-slave-bullseye/versions-py3 | 19 +- .../sonic-slave-buster/versions-deb-buster | 2 +- .../versions/host-image/versions-deb-bookworm | 9 +- .../host-image/versions-deb-bookworm-arm64 | 3 - .../host-image/versions-deb-bookworm-armhf | 3 - files/build/versions/host-image/versions-py3 | 4 +- .../host-image/versions-py3-all-arm64 | 1 - .../host-image/versions-py3-all-armhf | 1 - 34 files changed, 1105 insertions(+), 144 deletions(-) create mode 100644 files/build/versions/dockers/docker-dash-engine/versions-deb-focal create mode 100644 files/build/versions/dockers/docker-dash-engine/versions-py3 create mode 100644 files/build/versions/dockers/docker-gbsyncd-vs/versions-py3 create mode 100644 files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bookworm delete mode 100644 files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye create mode 100644 files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-bookworm delete mode 100644 files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster create mode 100644 files/build/versions/dockers/docker-syncd-vs/versions-py3 create mode 100644 files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-arm64 create mode 100644 files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-armhf delete mode 100644 files/build/versions/host-image/versions-py3-all-arm64 diff --git a/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm b/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm index 5f1fcdeb3fa7..d53a235ff3d8 100644 --- a/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm +++ b/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm @@ -12,6 +12,7 @@ libnl-nf-3-200==3.5.0-1 libnl-nf-3-dev==3.5.0-1 libnl-route-3-200==3.5.0-1 libnl-route-3-dev==3.5.0-1 +libsai==1.0.0 libsaimetadata==1.0.0 libsaimetadata-dev==1.0.0 libsairedis==1.0.0 @@ -32,9 +33,13 @@ libyang-dev==1.0.73 linux-headers-6.1.0-11-2-amd64==6.1.38-4 linux-headers-6.1.0-11-2-arm64==6.1.38-4 linux-headers-6.1.0-11-2-common==6.1.38-4 -net-tools==2.10-0.1 +p4lang-bmv2==1.15.0-7 +p4lang-p4c==1.2.4.2-2 +p4lang-pi==0.1.0-15 python3-swsscommon==1.0.0 python3-yang==1.0.73 +sonic-mgmt-common==1.0.0 +sonic-mgmt-common-codegen==1.0.0 sonic-platform-pddf==1.1 sonic-platform-pddf-sym==1.1 sx-acl-helper==1.mlnx.4.6.3064 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye index 3709687caad9..1a89e443ed52 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye @@ -28,7 +28,6 @@ libteam-utils==1.31-1 libteam5==1.31-1 libteamdctl0==1.31-1 libthrift-0.11.0==0.11.0-4 -libthrift-dev==0.11.0-4 libyang==1.0.73 libyang-cpp==1.0.73 libyang-dev==1.0.73 @@ -36,6 +35,3 @@ protobuf-compiler==3.21.12-3 python-thrift==0.11.0-4 python3-swsscommon==1.0.0 python3-yang==1.0.73 -sonic-mgmt-common==1.0.0 -sonic-mgmt-common-codegen==1.0.0 -thrift-compiler==0.11.0-4 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 index b7b7da383a58..97b8c8233b11 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -19,17 +19,14 @@ netifaces==0.11.0 paramiko==2.11.0 prefixed==0.7.1 prettyprinter==0.18.0 -psutil==5.9.8 pycairo==1.26.0 pycparser==2.22 pynacl==1.5.0 -pyroute2==0.5.19 pyyaml==6.0.1 semantic-version==2.10.0 systemd-python==235 tabulate==0.9.0 toposort==1.6 -wcwidth==0.2.13 www-authenticate==0.9.2 xmltodict==0.12.0 zipp==1.2.0 diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index c7c706f47465..75ade2ee96de 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,18 +1,16 @@ amd64:amd64/debian:bookworm==sha256:40f71cd223a60afc1bac2adf1b204bfabef29cdef725e74993f86098ff87f92f amd64:amd64/debian:bullseye==sha256:38fb0f1618bfa65b0cf1dd279293ebc70ef94aab2f2dc49274a2efc6ee29880e -amd64:amd64/debian:buster==sha256:255eec9d157d35e00a81a45f1e958fd19437d504139e8eb4ea6cc380ea741ed4 amd64:debian:bookworm==sha256:1aadfee8d292f64b045adb830f8a58bfacc15789ae5f489a0fedcd517a862cb9 amd64:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 amd64:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 +amd64:p4lang/behavioral-model@sha256:ce45720e28a96a50f275c1b511cd84c2558b62f2cf7a7e506765183bc3fb2e32==sha256:ce45720e28a96a50f275c1b511cd84c2558b62f2cf7a7e506765183bc3fb2e32 arm64:arm64v8/debian:bookworm==sha256:40374b5cdc928ffc606cb5c2bbf5e2b2eb6eb918a8e62104ae1f001c49dcbe3a arm64:arm64v8/debian:bullseye==sha256:284d075b0fd0350198c79fcb19b9b0fccac6ade8ada1b1309aee35dd223fc802 -arm64:arm64v8/debian:buster==sha256:4d104dd705ba3cba521271fae2d7259e4bc078c5f4855de32dab30acc9a5d3c5 arm64:debian:bookworm==sha256:1aadfee8d292f64b045adb830f8a58bfacc15789ae5f489a0fedcd517a862cb9 arm64:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 arm64:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 armhf:arm32v7/debian:bookworm==sha256:4c1f203254edd0f60bf8269d57f64c3cfc238af1d13d4f8e484c05af2154046b armhf:arm32v7/debian:bullseye==sha256:c1205d95cc1479322f5c34df0a98f62ede571d041cb02a48ccca34209b3f7be9 -armhf:arm32v7/debian:buster==sha256:540d61b391864b97f3ee3d9d0ded73d21e35b23c3db56c6400ac789118d0f47c armhf:debian:bookworm==sha256:1aadfee8d292f64b045adb830f8a58bfacc15789ae5f489a0fedcd517a862cb9 armhf:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 armhf:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 41a9a05ebc06..4c9e43ea6360 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,11 +1,11 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==5a86d1cc3934b7a388c29b6005f64675c56c9949 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==6708d95ec6d819098093cd57c746636a5bb9a4ea https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 -https://github.com/flashrom/flashrom.git==e177e77f9fa2ee0a1bd459df27558528d8dabc8e -https://github.com/FreeRADIUS/freeradius-server.git==e42947b083e77e0c6fc5d2c4de090f5d18eb06ae +https://github.com/flashrom/flashrom.git==643ae4d1fcb9b3bda6f35e8ff6f5b71b1104f600 +https://github.com/FreeRADIUS/freeradius-server.git==66cf26be5e195b56c70288c98a3e62680ff38154 https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/lguohan/gnxi.git==3adf8b97755b49947e465b5a14645f11e79fa0cd @@ -15,7 +15,8 @@ https://github.com/p4lang/ptf.git==c554f83685186be4cfa9387eb5d6d700d2bbd7c0 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 -https://github.com/thom311/libnl==6db85366264c9c83e0d53995bfb68e0150184cb4 -https://salsa.debian.org/kernel-team/initramfs-tools.git==8801fda185d2accf39c4095858f76089799bfc7e +https://github.com/sonic-net/DASH.git==2cb918fbe22eee60296c7326af530bd25b23398f +https://github.com/thom311/libnl==49f7822961f5bc6b18cd2a2d3f3b8d2ab0896d3f +https://salsa.debian.org/kernel-team/initramfs-tools.git==15311e6282434f184fb306c38d415f2217239214 https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==703b8198a123f57fd09e555a4c62b2d55273d57b +https://salsa.debian.org/ssh-team/openssh.git==d150d0d69246f55c711684078f47f999a4bfd6bc diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index f198371892fb..9e406ee2f03e 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,20 +1,24 @@ +archive.ubuntu.com_ubuntu_dists_focal==2020-04-23T17:33:17Z +archive.ubuntu.com_ubuntu_dists_focal-backports==2023-11-13T00:36:10Z +archive.ubuntu.com_ubuntu_dists_focal-updates==2024-05-18T01:45:17Z deb.nodesource.com_node%5f14.x_dists_bookworm==2023-02-17T00:35:29Z deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20240514T000307Z -debian-security==20240514T000247Z -download.docker.com_linux_debian_dists_bookworm==2024-05-10T08:31:56Z -download.docker.com_linux_debian_dists_bullseye==2024-05-10T08:31:56Z -download.docker.com_linux_debian_dists_buster==2024-05-09T09:19:41Z -packages.trafficmanager.net_snapshot_debian-security_20240514T000247Z_dists_bookworm-security==2024-05-13T21:03:23Z -packages.trafficmanager.net_snapshot_debian-security_20240514T000247Z_dists_bullseye-security==2024-05-13T21:03:22Z -packages.trafficmanager.net_snapshot_debian-security_20240514T000247Z_dists_buster_updates==2024-05-13T21:03:21Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bookworm==2024-02-10T11:07:25Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bookworm-backports==2024-05-13T20:15:31Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bookworm-updates==2024-05-13T20:15:31Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye-backports==2024-05-13T20:15:31Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_bullseye-updates==2024-05-13T20:15:31Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240514T000307Z_dists_buster-updates==2023-06-10T08:55:10Z +debian==20240517T000625Z +debian-security==20240517T000237Z +download.docker.com_linux_debian_dists_bookworm==2024-05-16T12:25:40Z +download.docker.com_linux_debian_dists_bullseye==2024-05-16T12:25:40Z +download.docker.com_linux_debian_dists_buster==2024-05-16T12:25:40Z +packages.trafficmanager.net_snapshot_debian-security_20240517T000237Z_dists_bookworm-security==2024-05-16T19:15:13Z +packages.trafficmanager.net_snapshot_debian-security_20240517T000237Z_dists_bullseye-security==2024-05-16T19:15:12Z +packages.trafficmanager.net_snapshot_debian-security_20240517T000237Z_dists_buster_updates==2024-05-16T19:15:12Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bookworm==2024-02-10T11:07:25Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bookworm-backports==2024-05-16T20:19:56Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bookworm-updates==2024-05-16T20:19:56Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye-backports==2024-05-16T20:19:56Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye-updates==2024-05-16T20:19:56Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster-updates==2023-06-10T08:55:10Z +security.ubuntu.com_ubuntu_dists_focal-security==2024-05-15T17:54:08Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index 4ef245014a90..bb96556092b9 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -14,7 +14,16 @@ http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.6.0.orig.tar.gz http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.debian.tar.xz==f457e44218a7d4cc7b7ab0ed696096e3 http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12-3.dsc==d8e34e7b07473c6903f9d245934524fb http://deb.debian.org/debian/pool/main/p/protobuf/protobuf_3.21.12.orig.tar.gz==d38562490234d8080bdbe8eb7baf937a -http://www.iana.org/assignments/enterprise-numbers.txt==a34d6d99898f7230f1bc9c8087923818 +http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-bmv2_1.15.0-7.debian.tar.xz==f4d249b77d4f8d120b229834aac02df5 +http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-bmv2_1.15.0-7.dsc==6882841200ce58acc8db7f3e6a15e91d +http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-bmv2_1.15.0.orig.tar.gz==cbbb4a0d5b1e17dca0532c3ca761e05c +http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-p4c_1.2.4.2-2.debian.tar.xz==7ea7d64c9147bd93a790af57693ce36f +http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-p4c_1.2.4.2-2.dsc==49a4c37e4030348958320e7d95a08209 +http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-p4c_1.2.4.2.orig.tar.gz==b1008dffbe236d065c5557f2d4629aa9 +http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-pi_0.1.0-15.debian.tar.xz==b9d8e4ce4cb66385250cf6dded0ef57a +http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-pi_0.1.0-15.dsc==9bfdfc3b6bf96e4e8c3a6a72fc56fded +http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-pi_0.1.0.orig.tar.gz==551d3780d615557674e93fa11210499d +http://www.iana.org/assignments/enterprise-numbers.txt==a08ba53e0976a8776b3b1a2cc9f91feb http://www.mellanox.com/downloads/MFT/mft-4.27.0-83-x86_64-deb.tgz==e475ca87a9252ba8d0abb6b05d5d94d0 https://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz==c64434548438df2cb1e53fb27c600e85 https://bootstrap.pypa.io/pip/2.7/get-pip.py==60e8267eb1b7bc71dc4843eb7bd294d3 @@ -162,9 +171,6 @@ https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/symcr https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64-r0.iso==54e11e450a461b1f4ae39c3ce3f15eff https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64_4_asic-r0.iso==1d8b8d3fa37f842d0184b5205be22be9 https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64_6_asic-r0.iso==58494305d4ac201daedf9364a1018a1b -https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1_bpo10+1_arm64.deb==282b4766cc9ac7d8bb70622bd69d9f5c -https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1_bpo10+1_armhf.deb==62f287117afab6caaec564232ebbb5de -https://sonicstorage.blob.core.windows.net/public/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb==2d58c3c3358290c04d5e0ba70f297f18 https://sonicstorage.blob.core.windows.net/public/sai/bcmpai/REL_3.11/3.11/libsaibroncos_3.11_amd64.deb==6e21a16126e833516a9659d4c35c284e https://storage.googleapis.com/golang/go1.15.15.linux-amd64.tar.gz==b75227438c6129b5013da053b3aa3f38 https://storage.googleapis.com/golang/go1.15.15.linux-arm64.tar.gz==6d721146a9195592d92a80cf27d475f9 diff --git a/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 b/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 index ab241307b3a1..d28ce7ea2b6c 100644 --- a/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 @@ -10,7 +10,7 @@ pyangbind==0.8.2 pyyaml==6.0.1 redis==5.0.1 redis-dump-load==1.1 -regex==2024.5.10 +regex==2024.5.15 six==1.16.0 tabulate==0.9.0 xmltodict==0.12.0 diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 index cb89d4ce2eb6..e3564c3c8ecf 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 @@ -10,7 +10,7 @@ pyangbind==0.8.1 pyyaml==6.0.1 redis==4.5.4 redis-dump-load==1.1 -regex==2024.5.10 +regex==2024.5.15 six==1.16.0 tabulate==0.9.0 xmltodict==0.12.0 diff --git a/files/build/versions/dockers/docker-dash-engine/versions-deb-focal b/files/build/versions/dockers/docker-dash-engine/versions-deb-focal new file mode 100644 index 000000000000..723eaaedd005 --- /dev/null +++ b/files/build/versions/dockers/docker-dash-engine/versions-deb-focal @@ -0,0 +1,101 @@ +binutils==2.34-6ubuntu1.9 +binutils-common==2.34-6ubuntu1.9 +binutils-x86-64-linux-gnu==2.34-6ubuntu1.9 +build-essential==12.8ubuntu1.1 +ca-certificates==20230311ubuntu0.20.04.1 +cpp==4:9.3.0-1ubuntu2 +cpp-9==9.4.0-1ubuntu1~20.04.2 +cron==3.0pl1-136ubuntu1 +dirmngr==2.2.19-3ubuntu2.2 +dpkg-dev==1.19.7ubuntu3.2 +fakeroot==1.24-1 +g++==4:9.3.0-1ubuntu2 +g++-9==9.4.0-1ubuntu1~20.04.2 +gcc==4:9.3.0-1ubuntu2 +gcc-10-base==10.5.0-1ubuntu1~20.04 +gcc-9==9.4.0-1ubuntu1~20.04.2 +gcc-9-base==9.4.0-1ubuntu1~20.04.2 +gnupg==2.2.19-3ubuntu2.2 +gnupg-l10n==2.2.19-3ubuntu2.2 +gnupg-utils==2.2.19-3ubuntu2.2 +gpg==2.2.19-3ubuntu2.2 +gpg-agent==2.2.19-3ubuntu2.2 +gpg-wks-client==2.2.19-3ubuntu2.2 +gpg-wks-server==2.2.19-3ubuntu2.2 +gpgconf==2.2.19-3ubuntu2.2 +gpgsm==2.2.19-3ubuntu2.2 +gpgv==2.2.19-3ubuntu2.2 +libalgorithm-diff-perl==1.19.03-2 +libalgorithm-diff-xs-perl==0.04-6 +libalgorithm-merge-perl==0.08-3 +libasan5==9.4.0-1ubuntu1~20.04.2 +libasn1-8-heimdal==7.7.0+dfsg-1ubuntu1.4 +libassuan0==2.5.3-7ubuntu2 +libatomic1==10.5.0-1ubuntu1~20.04 +libbinutils==2.34-6ubuntu1.9 +libcc1-0==10.5.0-1ubuntu1~20.04 +libctf-nobfd0==2.34-6ubuntu1.9 +libctf0==2.34-6ubuntu1.9 +libdpkg-perl==1.19.7ubuntu3.2 +libestr0==0.1.10-2.1 +libexpat1==2.2.9-1ubuntu0.6 +libexpat1-dev==2.2.9-1ubuntu0.6 +libfakeroot==1.24-1 +libfastjson4==0.99.8-2 +libfile-fcntllock-perl==0.22-3build4 +libgcc-9-dev==9.4.0-1ubuntu1~20.04.2 +libgcc-s1==10.5.0-1ubuntu1~20.04 +libgdbm-compat4==1.18.1-5 +libgdbm6==1.18.1-5 +libgomp1==10.5.0-1ubuntu1~20.04 +libgssapi3-heimdal==7.7.0+dfsg-1ubuntu1.4 +libhcrypto4-heimdal==7.7.0+dfsg-1ubuntu1.4 +libheimbase1-heimdal==7.7.0+dfsg-1ubuntu1.4 +libheimntlm0-heimdal==7.7.0+dfsg-1ubuntu1.4 +libhx509-5-heimdal==7.7.0+dfsg-1ubuntu1.4 +libisl22==0.22.1-1 +libitm1==10.5.0-1ubuntu1~20.04 +libkrb5-26-heimdal==7.7.0+dfsg-1ubuntu1.4 +libksba8==1.3.5-2ubuntu0.20.04.2 +libldap-2.4-2==2.4.49+dfsg-2ubuntu1.10 +libldap-common==2.4.49+dfsg-2ubuntu1.10 +liblocale-gettext-perl==1.07-4 +liblsan0==10.5.0-1ubuntu1~20.04 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libnpth0==1.6-1 +libperl5.30==5.30.0-9ubuntu0.5 +libpopt0==1.16-14 +libpython3-dev==3.8.2-0ubuntu2 +libpython3.8==3.8.10-0ubuntu1~20.04.9 +libpython3.8-dev==3.8.10-0ubuntu1~20.04.9 +libpython3.8-minimal==3.8.10-0ubuntu1~20.04.9 +libpython3.8-stdlib==3.8.10-0ubuntu1~20.04.9 +libquadmath0==10.5.0-1ubuntu1~20.04 +libroken18-heimdal==7.7.0+dfsg-1ubuntu1.4 +libstdc++-9-dev==9.4.0-1ubuntu1~20.04.2 +libstdc++6==10.5.0-1ubuntu1~20.04 +libtsan0==10.5.0-1ubuntu1~20.04 +libubsan1==10.5.0-1ubuntu1~20.04 +libwind0-heimdal==7.7.0+dfsg-1ubuntu1.4 +logrotate==3.14.0-4ubuntu3 +make==4.2.1-1.2 +netbase==6.1 +openssl==1.1.1f-1ubuntu2.22 +patch==2.7.6-6 +perl==5.30.0-9ubuntu0.5 +perl-base==5.30.0-9ubuntu0.5 +perl-modules-5.30==5.30.0-9ubuntu0.5 +pinentry-curses==1.1.0-3build1 +python-pip-whl==20.0.2-5ubuntu1.10 +python3-dev==3.8.2-0ubuntu2 +python3-pip==20.0.2-5ubuntu1.10 +python3-wheel==0.34.2-1ubuntu0.1 +python3.8==3.8.10-0ubuntu1~20.04.9 +python3.8-dev==3.8.10-0ubuntu1~20.04.9 +python3.8-minimal==3.8.10-0ubuntu1~20.04.9 +rsyslog==8.2001.0-1ubuntu1.3 +supervisor==4.1.0-1ubuntu1 +ucf==3.0038+nmu1 +zlib1g==1:1.2.11.dfsg-2ubuntu1.5 +zlib1g-dev==1:1.2.11.dfsg-2ubuntu1.5 diff --git a/files/build/versions/dockers/docker-dash-engine/versions-py3 b/files/build/versions/dockers/docker-dash-engine/versions-py3 new file mode 100644 index 000000000000..da8137a384f7 --- /dev/null +++ b/files/build/versions/dockers/docker-dash-engine/versions-py3 @@ -0,0 +1,18 @@ +cffi==1.15.0 +coverage==6.3.1 +cython==0.29.27 +grpcio==1.43.2 +nnpy==0.1 +pip==20.0.2 +protobuf==3.18.1 +ptf==0.9.1 +pycparser==2.21 +pypcap==1.2.3 +scapy==2.4.5 +setuptools==45.2.0 +six==1.16.0 +supervisor==4.1.0 +supervisord-dependent-startup==1.4.0 +thrift==0.13.0 +toposort==1.10 +wheel==0.37.1 diff --git a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bookworm b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bookworm index afd567e7c4ae..616dcecd80a9 100644 --- a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-bookworm @@ -1,19 +1,230 @@ +autoconf==2.71-3 +automake==1:1.16.5-1.3 +autotools-dev==20220109.1 +binutils==2.40-2 +binutils-x86-64-linux-gnu==2.40-2 +clang==1:14.0-55.7~deb12u1 +clang-14==1:14.0.6-12 +cpp==4:12.2.0-3 +cpp-12==12.2.0-14 +file==1:5.44-3 +flex==2.6.4-8.2 +gcc==4:12.2.0-3 +gcc-12==12.2.0-14 gdb==13.1-3 gdbserver==13.1-3 +gfortran-12==12.2.0-14 +ibverbs-providers==44.0-2 +icu-devtools==72.1-3 +libabsl-dev==20220623.1-1 +libabsl20220623==20220623.1-1 +libasan8==12.2.0-14 libbabeltrace1==1.5.11-1+b2 +libbinutils==2.40-2 +libboost-all-dev==1.74.0.3 +libboost-atomic-dev==1.74.0.3 +libboost-atomic1.74-dev==1.74.0+ds1-21 +libboost-atomic1.74.0==1.74.0+ds1-21 +libboost-chrono-dev==1.74.0.3 +libboost-chrono1.74-dev==1.74.0+ds1-21 +libboost-chrono1.74.0==1.74.0+ds1-21 +libboost-container-dev==1.74.0.3 +libboost-container1.74-dev==1.74.0+ds1-21 +libboost-container1.74.0==1.74.0+ds1-21 +libboost-context-dev==1.74.0.3 +libboost-context1.74-dev==1.74.0+ds1-21 +libboost-context1.74.0==1.74.0+ds1-21 +libboost-coroutine-dev==1.74.0.3 +libboost-coroutine1.74-dev==1.74.0+ds1-21 +libboost-coroutine1.74.0==1.74.0+ds1-21 +libboost-date-time-dev==1.74.0.3 +libboost-date-time1.74-dev==1.74.0+ds1-21 +libboost-date-time1.74.0==1.74.0+ds1-21 +libboost-dev==1.74.0.3 +libboost-exception-dev==1.74.0.3 +libboost-exception1.74-dev==1.74.0+ds1-21 +libboost-fiber-dev==1.74.0.3 +libboost-fiber1.74-dev==1.74.0+ds1-21 +libboost-fiber1.74.0==1.74.0+ds1-21 +libboost-filesystem-dev==1.74.0.3 +libboost-filesystem1.74-dev==1.74.0+ds1-21 +libboost-filesystem1.74.0==1.74.0+ds1-21 +libboost-graph-dev==1.74.0.3 +libboost-graph-parallel-dev==1.74.0.3 +libboost-graph-parallel1.74-dev==1.74.0+ds1-21 +libboost-graph-parallel1.74.0==1.74.0+ds1-21 +libboost-graph1.74-dev==1.74.0+ds1-21 +libboost-graph1.74.0==1.74.0+ds1-21 +libboost-iostreams-dev==1.74.0.3 +libboost-iostreams1.74-dev==1.74.0+ds1-21 +libboost-iostreams1.74.0==1.74.0+ds1-21 +libboost-locale-dev==1.74.0.3 +libboost-locale1.74-dev==1.74.0+ds1-21 +libboost-locale1.74.0==1.74.0+ds1-21 +libboost-log-dev==1.74.0.3 +libboost-log1.74-dev==1.74.0+ds1-21 +libboost-log1.74.0==1.74.0+ds1-21 +libboost-math-dev==1.74.0.3 +libboost-math1.74-dev==1.74.0+ds1-21 +libboost-math1.74.0==1.74.0+ds1-21 +libboost-mpi-dev==1.74.0.3 +libboost-mpi-python-dev==1.74.0.3 +libboost-mpi-python1.74-dev==1.74.0+ds1-21 +libboost-mpi-python1.74.0==1.74.0+ds1-21 +libboost-mpi1.74-dev==1.74.0+ds1-21 +libboost-mpi1.74.0==1.74.0+ds1-21 +libboost-nowide-dev==1.74.0.3 +libboost-nowide1.74-dev==1.74.0+ds1-21 +libboost-nowide1.74.0==1.74.0+ds1-21 +libboost-numpy-dev==1.74.0.3 +libboost-numpy1.74-dev==1.74.0+ds1-21 +libboost-numpy1.74.0==1.74.0+ds1-21 +libboost-program-options-dev==1.74.0.3 +libboost-program-options1.74-dev==1.74.0+ds1-21 +libboost-program-options1.74.0==1.74.0+ds1-21 +libboost-python-dev==1.74.0.3 +libboost-python1.74-dev==1.74.0+ds1-21 +libboost-python1.74.0==1.74.0+ds1-21 +libboost-random-dev==1.74.0.3 +libboost-random1.74-dev==1.74.0+ds1-21 +libboost-random1.74.0==1.74.0+ds1-21 +libboost-regex-dev==1.74.0.3 +libboost-regex1.74-dev==1.74.0+ds1-21 libboost-regex1.74.0==1.74.0+ds1-21 +libboost-serialization-dev==1.74.0.3 +libboost-serialization1.74-dev==1.74.0+ds1-21 +libboost-stacktrace-dev==1.74.0.3 +libboost-stacktrace1.74-dev==1.74.0+ds1-21 +libboost-stacktrace1.74.0==1.74.0+ds1-21 +libboost-system-dev==1.74.0.3 +libboost-system1.74-dev==1.74.0+ds1-21 +libboost-system1.74.0==1.74.0+ds1-21 +libboost-test-dev==1.74.0.3 +libboost-test1.74-dev==1.74.0+ds1-21 +libboost-test1.74.0==1.74.0+ds1-21 +libboost-thread-dev==1.74.0.3 +libboost-thread1.74-dev==1.74.0+ds1-21 +libboost-thread1.74.0==1.74.0+ds1-21 +libboost-timer-dev==1.74.0.3 +libboost-timer1.74-dev==1.74.0+ds1-21 +libboost-timer1.74.0==1.74.0+ds1-21 +libboost-tools-dev==1.74.0.3 +libboost-type-erasure-dev==1.74.0.3 +libboost-type-erasure1.74-dev==1.74.0+ds1-21 +libboost-type-erasure1.74.0==1.74.0+ds1-21 +libboost-wave-dev==1.74.0.3 +libboost-wave1.74-dev==1.74.0+ds1-21 +libboost-wave1.74.0==1.74.0+ds1-21 +libboost1.74-dev==1.74.0+ds1-21 +libboost1.74-tools-dev==1.74.0+ds1-21 +libbpf-dev==1:1.1.0-1 +libc-ares-dev==1.18.1-3 +libc-ares2==1.18.1-3 +libc-dev-bin==2.36-9+deb12u7 +libc6-dev==2.36-9+deb12u7 libcbor0.8==0.8.0-2+b1 +libcc1-0==12.2.0-14 +libclang-common-14-dev==1:14.0.6-12 +libclang-cpp14==1:14.0.6-12 +libclang1-14==1:14.0.6-12 +libctf-nobfd0==2.40-2 +libctf0==2.40-2 libcurl3-gnutls==7.88.1-10+deb12u5 +libcurl3-nss==7.88.1-10+deb12u5 +libdbus-1-dev==1.14.10-1~deb12u1 libdebuginfod-common==0.188-2.1 libdebuginfod1==0.188-2.1 +libdouble-conversion3==3.2.1-1 libdw1==0.188-2.1 libedit2==3.1-20221030-2 +libelf-dev==0.188-2.1 +libevent-2.1-7==2.1.12-stable-8 +libevent-core-2.1-7==2.1.12-stable-8 +libevent-dev==2.1.12-stable-8 +libevent-extra-2.1-7==2.1.12-stable-8 +libevent-openssl-2.1-7==2.1.12-stable-8 +libevent-pthreads-2.1-7==2.1.12-stable-8 +libexpat1-dev==2.5.0-1 +libfabric1==1.17.0-3 libfido2-1==1.12.0-2+b1 +libfl-dev==2.6.4-8.2 +libfl2==2.6.4-8.2 +libgc-dev==1:8.2.2-3 +libgc1==1:8.2.2-3 +libgcc-12-dev==12.2.0-14 +libgfortran-12-dev==12.2.0-14 +libgfortran5==12.2.0-14 libglib2.0-0==2.74.6-2+deb12u2 +libgmp-dev==2:6.2.1+dfsg1-1.1 +libgmpxx4ldbl==2:6.2.1+dfsg1-1.1 +libgomp1==12.2.0-14 libgpm2==1.20.7-10+b1 +libgprofng0==2.40-2 +libgrpc++-dev==1.51.1-3+b1 +libgrpc++1.51==1.51.1-3+b1 +libgrpc-dev==1.51.1-3+b1 +libgrpc29==1.51.1-3+b1 +libhwloc-dev==2.9.0-1 +libhwloc-plugins==2.9.0-1 +libhwloc15==2.9.0-1 +libibverbs-dev==44.0-2 +libibverbs1==44.0-2 +libicu-dev==72.1-3 libicu72==72.1-3 libipt2==2.0.5-1 +libisl23==0.25-1.1 +libitm1==12.2.0-14 +libjs-jquery-ui==1.13.2+dfsg-1 +libjs-sphinxdoc==5.3.0-4 +libjs-underscore==1.13.4~dfsg+~1.11.4-3 +libllvm14==1:14.0.6-12 +liblsan0==12.2.0-14 +libltdl-dev==2.4.7-5 +libltdl7==2.4.7-5 +libmagic-mgc==1:5.44-3 +libmagic1==1:5.44-3 +libmpc3==1.3.1-1 libmpfr6==4.2.0-1 +libmunge2==0.5.15-2 +libnanomsg-dev==1.1.5+dfsg-1.1+b1 +libnanomsg5==1.1.5+dfsg-1.1+b1 +libnl-3-dev==3.5.0-1 +libnl-route-3-dev==3.5.0-1 +libnsl-dev==1.3.0-2 +libnspr4==2:4.35-1 +libnss3==2:3.87.1-1 +libnuma-dev==2.0.16-1 +libnuma1==2.0.16-1 +libobjc-12-dev==12.2.0-14 +libobjc4==12.2.0-14 +libopenmpi-dev==4.1.4-3+b1 +libopenmpi3==4.1.4-3+b1 +libpcap-dev==1.10.3-1 +libpcap0.8==1.10.3-1 +libpcap0.8-dev==1.10.3-1 +libpciaccess0==0.17-2 +libpcre2-16-0==10.42-1 +libpfm4==4.13.0-1 +libpkgconf3==1.8.1-1 +libpmix-dev==4.2.2-1+deb12u1 +libpmix2==4.2.2-1+deb12u1 +libprotobuf-dev==3.21.12-3 +libprotobuf-lite32==3.21.12-3 +libprotobuf32==3.21.12-3 +libprotoc-dev==3.21.12-3 +libprotoc32==3.21.12-3 +libpsm-infinipath1==3.3+20.604758e7-6.2 +libpsm2-2==11.2.185-2 +libpython3-dev==3.11.2-1+b1 +libpython3.11-dev==3.11.2-6 +libqt5core5a==5.15.8+dfsg-11 +libqt5dbus5==5.15.8+dfsg-11 +libqt5network5==5.15.8+dfsg-11 +libquadmath0==12.2.0-14 +librdmacm1==44.0-2 +libre2-9==20220601+dfsg-1+b1 +libre2-dev==20220601+dfsg-1+b1 +libsai==1.0.0 libsaimetadata==1.0.0 libsaimetadata-dbgsym==1.0.0 libsairedis==1.0.0 @@ -22,14 +233,71 @@ libsaivs==1.0.0 libsaivs-dbgsym==1.0.0 libsource-highlight-common==3.1.9-4.2 libsource-highlight4v5==3.1.9-4.2+b3 +libssl-dev==3.0.11-1~deb12u2 +libstdc++-12-dev==12.2.0-14 libswsscommon-dbgsym==1.0.0 +libthrift-0.17.0==0.17.0-2+b2 +libthrift-dev==0.17.0-2+b2 +libtirpc-dev==1.3.3+ds-1 +libtool==2.4.7-5 +libtsan2==12.2.0-14 +libubsan1==12.2.0-14 +libucx0==1.13.1-1 libunwind8==1.6.2-3 +libx11-6==2:1.8.4-2+deb12u2 +libx11-data==2:1.8.4-2+deb12u2 +libxau6==1:1.0.9-1 +libxcb1==1.15-1 +libxdmcp6==1:1.1.2-3 +libxext6==2:1.3.4-1+b1 +libxml2==2.9.14+dfsg-1.3~deb12u1 +libxnvctrl0==525.85.05-3~deb12u1 +libz3-4==4.8.12-3.1 +linux-libc-dev==6.1.90-1 +llvm==1:14.0-55.7~deb12u1 +llvm-14==1:14.0.6-12 +llvm-14-linker-tools==1:14.0.6-12 +llvm-14-runtime==1:14.0.6-12 +llvm-runtime==1:14.0-55.7~deb12u1 +m4==1.4.19-3 +mpi-default-bin==1.14 +mpi-default-dev==1.14 +netbase==6.4 +nss-plugin-pem==1.0.8+1-1 +ocl-icd-libopencl1==2.3.1-1 +openmpi-bin==4.1.4-3+b1 +openmpi-common==4.1.4-3 openssh-client==1:9.2p1-2+deb12u2 +p4lang-bmv2==1.15.0-7 +p4lang-p4c==1.2.4.2-2 +p4lang-pi==0.1.0-15 +pkg-config==1.8.1-1 +pkgconf==1.8.1-1 +pkgconf-bin==1.8.1-1 +protobuf-compiler==3.21.12-3 +protobuf-compiler-grpc==1.51.1-3+b1 +python3-dev==3.11.2-1+b1 +python3-grpcio==1.51.1-3+b1 +python3-ply==3.11-5 +python3-protobuf==3.21.12-3 +python3-psutil==5.9.4-1+b1 +python3-pyroute2==0.7.2-2 +python3-scapy==2.5.0+dfsg-2 +python3-six==1.16.0-4 +python3-thrift==0.17.0-2+b2 +python3.11-dev==3.11.2-6 +rpcsvc-proto==1.4.3-1 sensible-utils==0.0.17+nmu1 +sgml-base==1.31 +shared-mime-info==2.2-1 sshpass==1.09-1+b1 strace==6.1-0.1 syncd-vs==1.0.0 syncd-vs-dbgsym==1.0.0 +tcpdump==4.99.3-1 +thrift-compiler==0.17.0-2+b2 ucf==3.0043+nmu1 vim==2:9.0.1378-2 vim-runtime==2:9.0.1378-2 +xml-core==0.18+nmu1 +zlib1g-dev==1:1.2.13.dfsg-1 diff --git a/files/build/versions/dockers/docker-gbsyncd-vs/versions-py3 b/files/build/versions/dockers/docker-gbsyncd-vs/versions-py3 new file mode 100644 index 000000000000..ed18794433e3 --- /dev/null +++ b/files/build/versions/dockers/docker-gbsyncd-vs/versions-py3 @@ -0,0 +1,7 @@ +grpcio==1.51.1 +ply==3.11 +protobuf==4.21.12 +psutil==5.9.4 +pyroute2==0.7.2 +scapy==2.5.0 +thrift==0.17.0 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm index ce7883fa9d43..066fa012d545 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm @@ -34,8 +34,10 @@ libharfbuzz0b==6.0.0+dfsg-3 libi2c0==4.3-2+b3 libicu72==72.1-3 libipt2==2.0.5-1 +libjson-c5==0.16-2 libkmod2==30+20221128-1 libmpfr6==4.2.0-1 +libnvme1==1.3-1 libpango-1.0-0==1.50.12+ds-1 libpangocairo-1.0-0==1.50.12+ds-1 libpangoft2-1.0-0==1.50.12+ds-1 @@ -65,6 +67,7 @@ libxml2==2.9.14+dfsg-1.3~deb12u1 libxrender1==1:0.9.10-1.1 lm-sensors==1:3.6.0-7.1 lm-sensors-dbgsym==1:3.6.0-7.1 +nvme-cli==2.4+really2.3-3 openssh-client==1:9.2p1-2+deb12u2 pci.ids==0.0~2023.04.11-1 pciutils==1:3.9.0-4 @@ -89,5 +92,6 @@ sxd-libs==1.mlnx.4.6.3064 sxd-libs-dev==1.mlnx.4.6.3064 ucf==3.0043+nmu1 udev==252.22-1~deb12u1 +uuid-runtime==2.38.1-5+deb12u1 vim==2:9.0.1378-2 vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bookworm b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bookworm new file mode 100644 index 000000000000..78de7f716989 --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bookworm @@ -0,0 +1,29 @@ +gdb==13.1-3 +gdbserver==13.1-3 +libbabeltrace1==1.5.11-1+b2 +libboost-regex1.74.0==1.74.0+ds1-21 +libcbor0.8==0.8.0-2+b1 +libcurl3-gnutls==7.88.1-10+deb12u5 +libdebuginfod-common==0.188-2.1 +libdebuginfod1==0.188-2.1 +libdw1==0.188-2.1 +libedit2==3.1-20221030-2 +libfido2-1==1.12.0-2+b1 +libglib2.0-0==2.74.6-2+deb12u2 +libgpm2==1.20.7-10+b1 +libicu72==72.1-3 +libipt2==2.0.5-1 +libmpfr6==4.2.0-1 +libsource-highlight-common==3.1.9-4.2 +libsource-highlight4v5==3.1.9-4.2+b3 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.6.2-3 +openssh-client==1:9.2p1-2+deb12u2 +sensible-utils==0.0.17+nmu1 +sonic-gnmi==0.1 +sonic-mgmt-common==1.0.0 +sshpass==1.09-1+b1 +strace==6.1-0.1 +ucf==3.0043+nmu1 +vim==2:9.0.1378-2 +vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye deleted file mode 100644 index 40e96a175a43..000000000000 --- a/files/build/versions/dockers/docker-sonic-gnmi/versions-deb-bullseye +++ /dev/null @@ -1,26 +0,0 @@ -gdb==10.1-1.7 -gdbserver==10.1-1.7 -libbabeltrace1==1.5.8-1+b3 -libboost-regex1.74.0==1.74.0-9 -libcbor0==0.5.0+dfsg-2 -libcurl3-gnutls==7.74.0-1.3+deb11u11 -libdebuginfod1==0.183-1 -libdw1==0.183-1 -libedit2==3.1-20191231-2+b1 -libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u3 -libgpm2==1.20.7-8 -libicu67==67.1-7 -libipt2==2.0.3-1 -libmpfr6==4.1.0-3 -libsource-highlight-common==3.1.9-3 -libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbgsym==1.0.0 -libunwind8==1.3.2-2 -openssh-client==1:8.4p1-5+deb11u3 -sonic-gnmi==0.1 -sonic-mgmt-common==1.0.0 -sshpass==1.09-1+b1 -strace==5.10-1 -vim==2:8.2.2434-3+deb11u1 -vim-runtime==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-bookworm b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-bookworm new file mode 100644 index 000000000000..4ac805e33146 --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-bookworm @@ -0,0 +1,34 @@ +gdb==13.1-3 +gdbserver==13.1-3 +libbabeltrace1==1.5.11-1+b2 +libboost-regex1.74.0==1.74.0+ds1-21 +libcbor0.8==0.8.0-2+b1 +libcjson-dev==1.7.15-1 +libcjson1==1.7.15-1 +libcurl3-gnutls==7.88.1-10+deb12u5 +libcurl4-openssl-dev==7.88.1-10+deb12u5 +libdebuginfod-common==0.188-2.1 +libdebuginfod1==0.188-2.1 +libdw1==0.188-2.1 +libedit2==3.1-20221030-2 +libfido2-1==1.12.0-2+b1 +libglib2.0-0==2.74.6-2+deb12u2 +libgpm2==1.20.7-10+b1 +libicu72==72.1-3 +libipt2==2.0.5-1 +libmpfr6==4.2.0-1 +libsource-highlight-common==3.1.9-4.2 +libsource-highlight4v5==3.1.9-4.2+b3 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.6.2-3 +libxml2==2.9.14+dfsg-1.3~deb12u1 +openssh-client==1:9.2p1-2+deb12u2 +sensible-utils==0.0.17+nmu1 +sonic-mgmt-common==1.0.0 +sonic-mgmt-framework==1.0-01 +sonic-mgmt-framework-dbg==1.0-01 +sshpass==1.09-1+b1 +strace==6.1-0.1 +ucf==3.0043+nmu1 +vim==2:9.0.1378-2 +vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster deleted file mode 100644 index 9515fdc04786..000000000000 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster +++ /dev/null @@ -1,25 +0,0 @@ -gdb==8.2.1-2+b3 -gdbserver==8.2.1-2+b3 -libbabeltrace1==1.5.6-2+deb10u1 -libbsd0==0.9.1-2+deb10u1 -libcjson-dev==1.7.10-1.1+deb10u2 -libcjson1==1.7.10-1.1+deb10u2 -libcurl3-gnutls==7.64.0-4+deb10u9 -libdw1==0.176-1.1+deb10u1 -libedit2==3.1-20181209-1 -libglib2.0-0==2.58.3-2+deb10u6 -libgpm2==1.20.7-5 -libicu63==63.1-6+deb10u3 -libipt2==2.0-2 -libpopt0==1.16-12 -libswsscommon-dbgsym==1.0.0 -libunwind8==1.2.1-10~deb10u1 -libxml2==2.9.4+dfsg1-7+deb10u6 -openssh-client==1:7.9p1-10+deb10u4 -sonic-mgmt-common==1.0.0 -sonic-mgmt-framework==1.0-01 -sonic-mgmt-framework-dbg==1.0-01 -sshpass==1.06-1 -strace==4.26-0.2 -vim==2:8.1.0875-5+deb10u6 -vim-runtime==2:8.1.0875-5+deb10u6 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 index 6bcdc5559870..2179078d0ed6 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -1,30 +1,5 @@ -attrs==23.2.0 -certifi==2017.4.17 +certifi==2024.2.2 charset-normalizer==3.3.2 -click==8.1.7 -clickclick==20.10.2 -connexion==2.7.0 -flask==2.2.5 -grpcio==1.58.0 -grpcio-tools==1.20.0 idna==3.7 -importlib-resources==5.12.0 -inflection==0.5.1 -itsdangerous==2.1.2 -jsonschema==4.17.3 -jsonschema-spec==0.1.6 -lazy-object-proxy==1.9.0 -openapi-schema-validator==0.4.4 -openapi-spec-validator==0.5.7 -pathable==0.4.3 -pkgutil_resolve_name==1.3.10 -protobuf==4.24.4 -pyrsistent==0.19.3 -python-dateutil==2.6.0 requests==2.31.0 -rfc3339-validator==0.1.4 -setuptools==21.0.0 -six==1.11.0 -typing_extensions==4.5.0 -urllib3==1.26.5 -werkzeug==2.2.3 +urllib3==2.2.1 diff --git a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bookworm b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bookworm index afd567e7c4ae..616dcecd80a9 100644 --- a/files/build/versions/dockers/docker-syncd-vs/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-syncd-vs/versions-deb-bookworm @@ -1,19 +1,230 @@ +autoconf==2.71-3 +automake==1:1.16.5-1.3 +autotools-dev==20220109.1 +binutils==2.40-2 +binutils-x86-64-linux-gnu==2.40-2 +clang==1:14.0-55.7~deb12u1 +clang-14==1:14.0.6-12 +cpp==4:12.2.0-3 +cpp-12==12.2.0-14 +file==1:5.44-3 +flex==2.6.4-8.2 +gcc==4:12.2.0-3 +gcc-12==12.2.0-14 gdb==13.1-3 gdbserver==13.1-3 +gfortran-12==12.2.0-14 +ibverbs-providers==44.0-2 +icu-devtools==72.1-3 +libabsl-dev==20220623.1-1 +libabsl20220623==20220623.1-1 +libasan8==12.2.0-14 libbabeltrace1==1.5.11-1+b2 +libbinutils==2.40-2 +libboost-all-dev==1.74.0.3 +libboost-atomic-dev==1.74.0.3 +libboost-atomic1.74-dev==1.74.0+ds1-21 +libboost-atomic1.74.0==1.74.0+ds1-21 +libboost-chrono-dev==1.74.0.3 +libboost-chrono1.74-dev==1.74.0+ds1-21 +libboost-chrono1.74.0==1.74.0+ds1-21 +libboost-container-dev==1.74.0.3 +libboost-container1.74-dev==1.74.0+ds1-21 +libboost-container1.74.0==1.74.0+ds1-21 +libboost-context-dev==1.74.0.3 +libboost-context1.74-dev==1.74.0+ds1-21 +libboost-context1.74.0==1.74.0+ds1-21 +libboost-coroutine-dev==1.74.0.3 +libboost-coroutine1.74-dev==1.74.0+ds1-21 +libboost-coroutine1.74.0==1.74.0+ds1-21 +libboost-date-time-dev==1.74.0.3 +libboost-date-time1.74-dev==1.74.0+ds1-21 +libboost-date-time1.74.0==1.74.0+ds1-21 +libboost-dev==1.74.0.3 +libboost-exception-dev==1.74.0.3 +libboost-exception1.74-dev==1.74.0+ds1-21 +libboost-fiber-dev==1.74.0.3 +libboost-fiber1.74-dev==1.74.0+ds1-21 +libboost-fiber1.74.0==1.74.0+ds1-21 +libboost-filesystem-dev==1.74.0.3 +libboost-filesystem1.74-dev==1.74.0+ds1-21 +libboost-filesystem1.74.0==1.74.0+ds1-21 +libboost-graph-dev==1.74.0.3 +libboost-graph-parallel-dev==1.74.0.3 +libboost-graph-parallel1.74-dev==1.74.0+ds1-21 +libboost-graph-parallel1.74.0==1.74.0+ds1-21 +libboost-graph1.74-dev==1.74.0+ds1-21 +libboost-graph1.74.0==1.74.0+ds1-21 +libboost-iostreams-dev==1.74.0.3 +libboost-iostreams1.74-dev==1.74.0+ds1-21 +libboost-iostreams1.74.0==1.74.0+ds1-21 +libboost-locale-dev==1.74.0.3 +libboost-locale1.74-dev==1.74.0+ds1-21 +libboost-locale1.74.0==1.74.0+ds1-21 +libboost-log-dev==1.74.0.3 +libboost-log1.74-dev==1.74.0+ds1-21 +libboost-log1.74.0==1.74.0+ds1-21 +libboost-math-dev==1.74.0.3 +libboost-math1.74-dev==1.74.0+ds1-21 +libboost-math1.74.0==1.74.0+ds1-21 +libboost-mpi-dev==1.74.0.3 +libboost-mpi-python-dev==1.74.0.3 +libboost-mpi-python1.74-dev==1.74.0+ds1-21 +libboost-mpi-python1.74.0==1.74.0+ds1-21 +libboost-mpi1.74-dev==1.74.0+ds1-21 +libboost-mpi1.74.0==1.74.0+ds1-21 +libboost-nowide-dev==1.74.0.3 +libboost-nowide1.74-dev==1.74.0+ds1-21 +libboost-nowide1.74.0==1.74.0+ds1-21 +libboost-numpy-dev==1.74.0.3 +libboost-numpy1.74-dev==1.74.0+ds1-21 +libboost-numpy1.74.0==1.74.0+ds1-21 +libboost-program-options-dev==1.74.0.3 +libboost-program-options1.74-dev==1.74.0+ds1-21 +libboost-program-options1.74.0==1.74.0+ds1-21 +libboost-python-dev==1.74.0.3 +libboost-python1.74-dev==1.74.0+ds1-21 +libboost-python1.74.0==1.74.0+ds1-21 +libboost-random-dev==1.74.0.3 +libboost-random1.74-dev==1.74.0+ds1-21 +libboost-random1.74.0==1.74.0+ds1-21 +libboost-regex-dev==1.74.0.3 +libboost-regex1.74-dev==1.74.0+ds1-21 libboost-regex1.74.0==1.74.0+ds1-21 +libboost-serialization-dev==1.74.0.3 +libboost-serialization1.74-dev==1.74.0+ds1-21 +libboost-stacktrace-dev==1.74.0.3 +libboost-stacktrace1.74-dev==1.74.0+ds1-21 +libboost-stacktrace1.74.0==1.74.0+ds1-21 +libboost-system-dev==1.74.0.3 +libboost-system1.74-dev==1.74.0+ds1-21 +libboost-system1.74.0==1.74.0+ds1-21 +libboost-test-dev==1.74.0.3 +libboost-test1.74-dev==1.74.0+ds1-21 +libboost-test1.74.0==1.74.0+ds1-21 +libboost-thread-dev==1.74.0.3 +libboost-thread1.74-dev==1.74.0+ds1-21 +libboost-thread1.74.0==1.74.0+ds1-21 +libboost-timer-dev==1.74.0.3 +libboost-timer1.74-dev==1.74.0+ds1-21 +libboost-timer1.74.0==1.74.0+ds1-21 +libboost-tools-dev==1.74.0.3 +libboost-type-erasure-dev==1.74.0.3 +libboost-type-erasure1.74-dev==1.74.0+ds1-21 +libboost-type-erasure1.74.0==1.74.0+ds1-21 +libboost-wave-dev==1.74.0.3 +libboost-wave1.74-dev==1.74.0+ds1-21 +libboost-wave1.74.0==1.74.0+ds1-21 +libboost1.74-dev==1.74.0+ds1-21 +libboost1.74-tools-dev==1.74.0+ds1-21 +libbpf-dev==1:1.1.0-1 +libc-ares-dev==1.18.1-3 +libc-ares2==1.18.1-3 +libc-dev-bin==2.36-9+deb12u7 +libc6-dev==2.36-9+deb12u7 libcbor0.8==0.8.0-2+b1 +libcc1-0==12.2.0-14 +libclang-common-14-dev==1:14.0.6-12 +libclang-cpp14==1:14.0.6-12 +libclang1-14==1:14.0.6-12 +libctf-nobfd0==2.40-2 +libctf0==2.40-2 libcurl3-gnutls==7.88.1-10+deb12u5 +libcurl3-nss==7.88.1-10+deb12u5 +libdbus-1-dev==1.14.10-1~deb12u1 libdebuginfod-common==0.188-2.1 libdebuginfod1==0.188-2.1 +libdouble-conversion3==3.2.1-1 libdw1==0.188-2.1 libedit2==3.1-20221030-2 +libelf-dev==0.188-2.1 +libevent-2.1-7==2.1.12-stable-8 +libevent-core-2.1-7==2.1.12-stable-8 +libevent-dev==2.1.12-stable-8 +libevent-extra-2.1-7==2.1.12-stable-8 +libevent-openssl-2.1-7==2.1.12-stable-8 +libevent-pthreads-2.1-7==2.1.12-stable-8 +libexpat1-dev==2.5.0-1 +libfabric1==1.17.0-3 libfido2-1==1.12.0-2+b1 +libfl-dev==2.6.4-8.2 +libfl2==2.6.4-8.2 +libgc-dev==1:8.2.2-3 +libgc1==1:8.2.2-3 +libgcc-12-dev==12.2.0-14 +libgfortran-12-dev==12.2.0-14 +libgfortran5==12.2.0-14 libglib2.0-0==2.74.6-2+deb12u2 +libgmp-dev==2:6.2.1+dfsg1-1.1 +libgmpxx4ldbl==2:6.2.1+dfsg1-1.1 +libgomp1==12.2.0-14 libgpm2==1.20.7-10+b1 +libgprofng0==2.40-2 +libgrpc++-dev==1.51.1-3+b1 +libgrpc++1.51==1.51.1-3+b1 +libgrpc-dev==1.51.1-3+b1 +libgrpc29==1.51.1-3+b1 +libhwloc-dev==2.9.0-1 +libhwloc-plugins==2.9.0-1 +libhwloc15==2.9.0-1 +libibverbs-dev==44.0-2 +libibverbs1==44.0-2 +libicu-dev==72.1-3 libicu72==72.1-3 libipt2==2.0.5-1 +libisl23==0.25-1.1 +libitm1==12.2.0-14 +libjs-jquery-ui==1.13.2+dfsg-1 +libjs-sphinxdoc==5.3.0-4 +libjs-underscore==1.13.4~dfsg+~1.11.4-3 +libllvm14==1:14.0.6-12 +liblsan0==12.2.0-14 +libltdl-dev==2.4.7-5 +libltdl7==2.4.7-5 +libmagic-mgc==1:5.44-3 +libmagic1==1:5.44-3 +libmpc3==1.3.1-1 libmpfr6==4.2.0-1 +libmunge2==0.5.15-2 +libnanomsg-dev==1.1.5+dfsg-1.1+b1 +libnanomsg5==1.1.5+dfsg-1.1+b1 +libnl-3-dev==3.5.0-1 +libnl-route-3-dev==3.5.0-1 +libnsl-dev==1.3.0-2 +libnspr4==2:4.35-1 +libnss3==2:3.87.1-1 +libnuma-dev==2.0.16-1 +libnuma1==2.0.16-1 +libobjc-12-dev==12.2.0-14 +libobjc4==12.2.0-14 +libopenmpi-dev==4.1.4-3+b1 +libopenmpi3==4.1.4-3+b1 +libpcap-dev==1.10.3-1 +libpcap0.8==1.10.3-1 +libpcap0.8-dev==1.10.3-1 +libpciaccess0==0.17-2 +libpcre2-16-0==10.42-1 +libpfm4==4.13.0-1 +libpkgconf3==1.8.1-1 +libpmix-dev==4.2.2-1+deb12u1 +libpmix2==4.2.2-1+deb12u1 +libprotobuf-dev==3.21.12-3 +libprotobuf-lite32==3.21.12-3 +libprotobuf32==3.21.12-3 +libprotoc-dev==3.21.12-3 +libprotoc32==3.21.12-3 +libpsm-infinipath1==3.3+20.604758e7-6.2 +libpsm2-2==11.2.185-2 +libpython3-dev==3.11.2-1+b1 +libpython3.11-dev==3.11.2-6 +libqt5core5a==5.15.8+dfsg-11 +libqt5dbus5==5.15.8+dfsg-11 +libqt5network5==5.15.8+dfsg-11 +libquadmath0==12.2.0-14 +librdmacm1==44.0-2 +libre2-9==20220601+dfsg-1+b1 +libre2-dev==20220601+dfsg-1+b1 +libsai==1.0.0 libsaimetadata==1.0.0 libsaimetadata-dbgsym==1.0.0 libsairedis==1.0.0 @@ -22,14 +233,71 @@ libsaivs==1.0.0 libsaivs-dbgsym==1.0.0 libsource-highlight-common==3.1.9-4.2 libsource-highlight4v5==3.1.9-4.2+b3 +libssl-dev==3.0.11-1~deb12u2 +libstdc++-12-dev==12.2.0-14 libswsscommon-dbgsym==1.0.0 +libthrift-0.17.0==0.17.0-2+b2 +libthrift-dev==0.17.0-2+b2 +libtirpc-dev==1.3.3+ds-1 +libtool==2.4.7-5 +libtsan2==12.2.0-14 +libubsan1==12.2.0-14 +libucx0==1.13.1-1 libunwind8==1.6.2-3 +libx11-6==2:1.8.4-2+deb12u2 +libx11-data==2:1.8.4-2+deb12u2 +libxau6==1:1.0.9-1 +libxcb1==1.15-1 +libxdmcp6==1:1.1.2-3 +libxext6==2:1.3.4-1+b1 +libxml2==2.9.14+dfsg-1.3~deb12u1 +libxnvctrl0==525.85.05-3~deb12u1 +libz3-4==4.8.12-3.1 +linux-libc-dev==6.1.90-1 +llvm==1:14.0-55.7~deb12u1 +llvm-14==1:14.0.6-12 +llvm-14-linker-tools==1:14.0.6-12 +llvm-14-runtime==1:14.0.6-12 +llvm-runtime==1:14.0-55.7~deb12u1 +m4==1.4.19-3 +mpi-default-bin==1.14 +mpi-default-dev==1.14 +netbase==6.4 +nss-plugin-pem==1.0.8+1-1 +ocl-icd-libopencl1==2.3.1-1 +openmpi-bin==4.1.4-3+b1 +openmpi-common==4.1.4-3 openssh-client==1:9.2p1-2+deb12u2 +p4lang-bmv2==1.15.0-7 +p4lang-p4c==1.2.4.2-2 +p4lang-pi==0.1.0-15 +pkg-config==1.8.1-1 +pkgconf==1.8.1-1 +pkgconf-bin==1.8.1-1 +protobuf-compiler==3.21.12-3 +protobuf-compiler-grpc==1.51.1-3+b1 +python3-dev==3.11.2-1+b1 +python3-grpcio==1.51.1-3+b1 +python3-ply==3.11-5 +python3-protobuf==3.21.12-3 +python3-psutil==5.9.4-1+b1 +python3-pyroute2==0.7.2-2 +python3-scapy==2.5.0+dfsg-2 +python3-six==1.16.0-4 +python3-thrift==0.17.0-2+b2 +python3.11-dev==3.11.2-6 +rpcsvc-proto==1.4.3-1 sensible-utils==0.0.17+nmu1 +sgml-base==1.31 +shared-mime-info==2.2-1 sshpass==1.09-1+b1 strace==6.1-0.1 syncd-vs==1.0.0 syncd-vs-dbgsym==1.0.0 +tcpdump==4.99.3-1 +thrift-compiler==0.17.0-2+b2 ucf==3.0043+nmu1 vim==2:9.0.1378-2 vim-runtime==2:9.0.1378-2 +xml-core==0.18+nmu1 +zlib1g-dev==1:1.2.13.dfsg-1 diff --git a/files/build/versions/dockers/docker-syncd-vs/versions-py3 b/files/build/versions/dockers/docker-syncd-vs/versions-py3 new file mode 100644 index 000000000000..ed18794433e3 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-vs/versions-py3 @@ -0,0 +1,7 @@ +grpcio==1.51.1 +ply==3.11 +protobuf==4.21.12 +psutil==5.9.4 +pyroute2==0.7.2 +scapy==2.5.0 +thrift==0.17.0 diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm b/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm index af573272f4f8..7b30e7e95527 100644 --- a/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm @@ -110,7 +110,7 @@ docbook-xml==4.5-12 docker-buildx-plugin==0.10.5-1~debian.12~bookworm docker-ce==5:24.0.2-1~debian.12~bookworm docker-ce-cli==5:24.0.2-1~debian.12~bookworm -docker-ce-rootless-extras==5:26.1.2-1~debian.12~bookworm +docker-ce-rootless-extras==5:26.1.3-1~debian.12~bookworm docker-compose-plugin==2.18.1-1~debian.12~bookworm docutils-common==0.19+dfsg-6 dosfstools==4.2-1 @@ -143,6 +143,7 @@ fonts-font-awesome==5.0.10+really4.7.0~dfsg-4.1 fonts-lato==2.0-2.1 fonts-liberation2==2.1.5-1 fonts-lmodern==2.005-1 +fonts-lyx==2.3.7-1 fonts-noto-mono==20201225-1 fonts-texgyre==20180621-6 fonts-texgyre-math==20180621-6 @@ -164,7 +165,9 @@ gem2deb==2.1 gem2deb-test-runner==2.1 gettext==0.21-12 gettext-base==0.21-12 -ghostscript==10.0.0~dfsg-11+deb12u3 +gfortran==4:12.2.0-3 +gfortran-12==12.2.0-14 +ghostscript==10.0.0~dfsg-11+deb12u4 gir1.2-atk-1.0==2.46.0-5 gir1.2-atspi-2.0==2.46.0-5 gir1.2-freedesktop==1.74.0-3 @@ -233,7 +236,10 @@ intltool-debian==0.35.0+20060710.6 iproute2==6.1.0-3 iptables==1.8.9-2 ipxe-qemu==1.0.0+git-20190125.36a4c85-5.1 +ipython3==8.5.0-4 iso-codes==4.15.0-1 +isympy-common==1.11.1-1 +isympy3==1.11.1-1 j2cli==0.3.12b-4 java-common==0.74 java-wrappers==0.4 @@ -333,6 +339,7 @@ libbit-vector-perl==7.4-2+b1 libblas3==3.11.0-2 libblkid-dev==2.38.1-5+deb12u1 libbluray2==1:1.3.4-1 +libboost-all-dev==1.74.0.3 libboost-atomic-dev==1.74.0.3 libboost-atomic1.74-dev==1.74.0+ds1-21 libboost-atomic1.74.0==1.74.0+ds1-21 @@ -355,37 +362,83 @@ libboost-date-time-dev==1.74.0.3 libboost-date-time1.74-dev==1.74.0+ds1-21 libboost-date-time1.74.0==1.74.0+ds1-21 libboost-dev==1.74.0.3 +libboost-exception-dev==1.74.0.3 +libboost-exception1.74-dev==1.74.0+ds1-21 libboost-fiber-dev==1.74.0.3 libboost-fiber1.74-dev==1.74.0+ds1-21 libboost-fiber1.74.0==1.74.0+ds1-21 libboost-filesystem-dev==1.74.0.3 libboost-filesystem1.74-dev==1.74.0+ds1-21 libboost-filesystem1.74.0==1.74.0+ds1-21 +libboost-graph-dev==1.74.0.3 libboost-graph-parallel-dev==1.74.0.3 libboost-graph-parallel1.74-dev==1.74.0+ds1-21 libboost-graph-parallel1.74.0==1.74.0+ds1-21 +libboost-graph1.74-dev==1.74.0+ds1-21 +libboost-graph1.74.0==1.74.0+ds1-21 +libboost-iostreams-dev==1.74.0.3 +libboost-iostreams1.74-dev==1.74.0+ds1-21 libboost-iostreams1.74.0==1.74.0+ds1-21 +libboost-locale-dev==1.74.0.3 +libboost-locale1.74-dev==1.74.0+ds1-21 +libboost-locale1.74.0==1.74.0+ds1-21 libboost-log-dev==1.74.0.3 libboost-log1.74-dev==1.74.0+ds1-21 libboost-log1.74.0==1.74.0+ds1-21 +libboost-math-dev==1.74.0.3 +libboost-math1.74-dev==1.74.0+ds1-21 +libboost-math1.74.0==1.74.0+ds1-21 +libboost-mpi-dev==1.74.0.3 +libboost-mpi-python-dev==1.74.0.3 +libboost-mpi-python1.74-dev==1.74.0+ds1-21 +libboost-mpi-python1.74.0==1.74.0+ds1-21 +libboost-mpi1.74-dev==1.74.0+ds1-21 libboost-mpi1.74.0==1.74.0+ds1-21 +libboost-nowide-dev==1.74.0.3 +libboost-nowide1.74-dev==1.74.0+ds1-21 +libboost-nowide1.74.0==1.74.0+ds1-21 +libboost-numpy-dev==1.74.0.3 +libboost-numpy1.74-dev==1.74.0+ds1-21 +libboost-numpy1.74.0==1.74.0+ds1-21 libboost-program-options-dev==1.74.0.3 libboost-program-options1.74-dev==1.74.0+ds1-21 libboost-program-options1.74.0==1.74.0+ds1-21 +libboost-python-dev==1.74.0.3 +libboost-python1.74-dev==1.74.0+ds1-21 +libboost-python1.74.0==1.74.0+ds1-21 +libboost-random-dev==1.74.0.3 +libboost-random1.74-dev==1.74.0+ds1-21 +libboost-random1.74.0==1.74.0+ds1-21 libboost-regex-dev==1.74.0.3 libboost-regex1.74-dev==1.74.0+ds1-21 libboost-regex1.74.0==1.74.0+ds1-21 +libboost-serialization-dev==1.74.0.3 libboost-serialization1.74-dev==1.74.0+ds1-21 libboost-serialization1.74.0==1.74.0+ds1-21 +libboost-stacktrace-dev==1.74.0.3 +libboost-stacktrace1.74-dev==1.74.0+ds1-21 +libboost-stacktrace1.74.0==1.74.0+ds1-21 libboost-system-dev==1.74.0.3 libboost-system1.74-dev==1.74.0+ds1-21 libboost-system1.74.0==1.74.0+ds1-21 +libboost-test-dev==1.74.0.3 libboost-test1.74-dev==1.74.0+ds1-21 libboost-test1.74.0==1.74.0+ds1-21 libboost-thread-dev==1.74.0.3 libboost-thread1.74-dev==1.74.0+ds1-21 libboost-thread1.74.0==1.74.0+ds1-21 +libboost-timer-dev==1.74.0.3 +libboost-timer1.74-dev==1.74.0+ds1-21 +libboost-timer1.74.0==1.74.0+ds1-21 +libboost-tools-dev==1.74.0.3 +libboost-type-erasure-dev==1.74.0.3 +libboost-type-erasure1.74-dev==1.74.0+ds1-21 +libboost-type-erasure1.74.0==1.74.0+ds1-21 +libboost-wave-dev==1.74.0.3 +libboost-wave1.74-dev==1.74.0+ds1-21 +libboost-wave1.74.0==1.74.0+ds1-21 libboost1.74-dev==1.74.0+ds1-21 +libboost1.74-tools-dev==1.74.0+ds1-21 libbpf-dev==1:1.1.0-1 libbpf1==1:1.1.0-1 libbrlapi0.8==6.5-7+deb12u1 @@ -412,6 +465,7 @@ libc6-i386==2.36-9+deb12u7 libc6-x32==2.36-9+deb12u7 libcaca0==0.99.beta20-3 libcacard0==1:2.8.0-3 +libcaf-openmpi-3==2.10.1-1+b1 libcairo-gobject2==1.16.0-7 libcairo-script-interpreter2==1.16.0-7 libcairo2==1.16.0-7 @@ -452,6 +506,8 @@ libclass-xsaccessor-perl==1.19-4+b1 libclone-perl==0.46-1 libcmocka-dev==1.1.5-2.1 libcmocka0==1.1.5-2.1 +libcoarrays-dev==2.10.1-1+b1 +libcoarrays-openmpi-dev==2.10.1-1+b1 libcodec2-1.0==1.0.5-1 libcolord2==1.4.6-2.2 libcommon-sense-perl==3.75-3 @@ -639,6 +695,7 @@ libgail-common==2.24.33-2 libgail18==2.24.33-2 libgav1-1==0.18.0-1+b1 libgbm1==22.3.6-1+deb12u1 +libgc-dev==1:8.2.2-3 libgc1==1:8.2.2-3 libgcc-12-dev==12.2.0-14 libgcc-12-dev-armhf-cross==12.2.0-14cross1 @@ -655,6 +712,7 @@ libgeronimo-annotation-1.3-spec-java==1.3-1 libgeronimo-interceptor-3.0-spec-java==1.0.1-4 libgetopt-long-descriptive-perl==0.111-1 libgfapi0==10.3-5 +libgfortran-12-dev==12.2.0-14 libgfortran5==12.2.0-14 libgfrpc0==10.3-5 libgfxdr0==10.3-5 @@ -698,9 +756,13 @@ libgpm2==1.20.7-10+b1 libgprofng0==2.40-2 libgraphite2-3==1.3.14-1 libgraphite2-dev==1.3.14-1 -libgs-common==10.0.0~dfsg-11+deb12u3 -libgs10==10.0.0~dfsg-11+deb12u3 -libgs10-common==10.0.0~dfsg-11+deb12u3 +libgrpc++-dev==1.51.1-3+b1 +libgrpc++1.51==1.51.1-3+b1 +libgrpc-dev==1.51.1-3+b1 +libgrpc29==1.51.1-3+b1 +libgs-common==10.0.0~dfsg-11+deb12u4 +libgs10==10.0.0~dfsg-11+deb12u4 +libgs10-common==10.0.0~dfsg-11+deb12u4 libgsl27==2.7.1+dfsg-5 libgslcblas0==2.7.1+dfsg-5 libgsm1==1.0.22-1 @@ -753,10 +815,12 @@ libhttpclient-java==4.5.14-1 libhttpcore-java==4.4.16-1 libhunspell-1.7-0==1.7.1-1 libhwasan0==12.2.0-14 +libhwloc-dev==2.9.0-1 libhwloc-plugins==2.9.0-1 libhwloc15==2.9.0-1 libhwy1==1.0.3-3+deb12u1 libiberty-dev==20230104-1 +libibverbs-dev==44.0-2 libibverbs1==44.0-2 libice-dev==2:1.0.10-1 libice6==2:1.0.10-1 @@ -822,6 +886,7 @@ libjs-jquery-isonscreen==1.2.0-1.1 libjs-jquery-metadata==12-4 libjs-jquery-tablesorter==1:2.31.3+dfsg1-3 libjs-jquery-throttle-debounce==1.1+dfsg.1-2 +libjs-jquery-ui==1.13.2+dfsg-1 libjs-popper.js==1.16.1+ds-6 libjs-sizzle==2.3.6+ds+~2.3.3-2 libjs-sphinxdoc==5.3.0-4 @@ -855,6 +920,7 @@ libkrb5support0==1.20.1-2+deb12u1 libksba8==1.6.3-2 liblab-gamut1==2.42.2-7+b3 liblapack3==3.11.0-2 +liblbfgsb0==3.0+dfsg.4-1 liblcms2-2==2.14-2 libldap-2.5-0==2.5.13+dfsg-5 libldap-common==2.5.13+dfsg-5 @@ -979,7 +1045,9 @@ libnftnl-dev==1.2.4-2 libnftnl11==1.2.4-2 libnghttp2-14==1.52.0-1+deb12u1 libnl-3-200==3.7.0-0.2+b1 +libnl-3-dev==3.7.0-0.2+b1 libnl-route-3-200==3.7.0-0.2+b1 +libnl-route-3-dev==3.7.0-0.2+b1 libnode108==18.19.0+dfsg-6~deb12u1 libnorm-dev==1.5.9+dfsg-2 libnorm1==1.5.9+dfsg-2 @@ -998,12 +1066,17 @@ libobject-pad-perl==0.78-1 libogg0==1.3.5-3 libole-storage-lite-perl==0.20-2 libonig5==6.9.8-1 +libopenblas-dev==0.3.21+ds-4 +libopenblas-pthread-dev==0.3.21+ds-4 +libopenblas0==0.3.21+ds-4 +libopenblas0-pthread==0.3.21+ds-4 libopencsd-dev==1.3.3-1 libopencsd1==1.3.3-1 libopenexr-3-1-30==3.1.5-5 libopengl-dev==1.6.0-1 libopengl0==1.6.0-1 libopenjp2-7==2.5.0-2 +libopenmpi-dev==4.1.4-3+b1 libopenmpi3==4.1.4-3+b1 libopenmpt0==0.6.9-1 libopentest4j-java==1.2.0-4 @@ -1087,6 +1160,7 @@ libplexus-sec-dispatcher-java==2.0-3 libplexus-utils2-java==3.4.2-1 libplexus-velocity-java==1.2-3.1 libpmem1==1.12.1-2 +libpmix-dev==4.2.2-1+deb12u1 libpmix2==4.2.2-1+deb12u1 libpng-dev==1.6.39-2 libpng-tools==1.6.39-2 @@ -1108,6 +1182,7 @@ libprotobuf-c1==1.4.1-1+b1 libprotobuf-dev==3.21.12-3 libprotobuf-lite32==3.21.12-3 libprotobuf32==3.21.12-3 +libprotoc-dev==3.21.12-3 libprotoc32==3.21.12-3 libproxy1v5==0.4.18-1.2 libpsl5==0.21.2-1 @@ -1128,6 +1203,7 @@ libpython3.11-minimal==3.11.2-6 libpython3.11-stdlib==3.11.2-6 libqdox-java==1.12.1-3 libqdox2-java==2.0.3-1 +libqhull-r8.0==2020.2-5 libqt5concurrent5==5.15.8+dfsg-11 libqt5core5a==5.15.8+dfsg-11 libqt5dbus5==5.15.8+dfsg-11 @@ -1157,6 +1233,7 @@ librbd1==16.2.11+ds-2 librdmacm1==44.0-2 libre-engine-re2-perl==0.17+ds-1 libre2-9==20220601+dfsg-1+b1 +libre2-dev==20220601+dfsg-1+b1 libreadline-dev==8.2-1.3 libreadline8==8.2-1.3 libreadonly-perl==2.050-3 @@ -1495,6 +1572,7 @@ libxrender1==1:0.9.10-1.1 libxs-parse-keyword-perl==0.33-1 libxs-parse-sublike-perl==0.16-1+b2 libxshmfence1==1.3-1 +libxsimd-dev==8.1.0-7 libxslt1-dev==1.1.35-1 libxslt1.1==1.1.35-1 libxss1==1:1.2.3-1 @@ -1537,11 +1615,13 @@ linux-headers-arm64==6.1.90-1 linux-kbuild-6.1==6.1.90-1 linux-libc-dev==6.1.90-1 linuxdoc-tools==0.9.82-1 +llvm==1:14.0-55.7~deb12u1 llvm-14==1:14.0.6-12 llvm-14-dev==1:14.0.6-12 llvm-14-linker-tools==1:14.0.6-12 llvm-14-runtime==1:14.0.6-12 llvm-14-tools==1:14.0.6-12 +llvm-runtime==1:14.0-55.7~deb12u1 lmodern==2.005-1 locales==2.36-9+deb12u7 logrotate==3.21.0-1 @@ -1574,9 +1654,12 @@ meson==1.0.1-5 mime-support==3.66 module-assistant==0.11.11 mokutil==0.6.0-2 +mpi-default-bin==1.14 +mpi-default-dev==1.14 mupdf-tools==1.21.1+ds2-1+b4 mysql-common==5.8+1.1.0 ncurses-term==6.4-4 +net-tools==2.10-0.1 netbase==6.4 netpbm==2:11.01.00-2 nftables==1.0.6-2+deb12u2 @@ -1597,6 +1680,8 @@ openjdk-17-jdk==17.0.11+9-1~deb12u1 openjdk-17-jdk-headless==17.0.11+9-1~deb12u1 openjdk-17-jre==17.0.11+9-1~deb12u1 openjdk-17-jre-headless==17.0.11+9-1~deb12u1 +openmpi-bin==4.1.4-3+b1 +openmpi-common==4.1.4-3 opensp==1.5.2-13+b2 openssh-client==1:9.2p1-2+deb12u2 openssh-server==1:9.2p1-2+deb12u2 @@ -1676,6 +1761,7 @@ pristine-tar==1.50 procmail==3.22-27 procps==2:4.0.2-3 protobuf-compiler==3.21.12-3 +protobuf-compiler-grpc==1.51.1-3+b1 psmisc==23.6-1 psutils==1.17.dfsg-4 publicsuffix==20230209.2326-1 @@ -1683,18 +1769,24 @@ pylint==2.16.2-2 python-apt-common==2.6.0 python-babel-localedata==2.10.3-1 python-is-python3==3.11.1-3 +python-matplotlib-data==3.6.3-1 python3==3.11.2-1+b1 python3-alabaster==0.7.12-1 python3-all==3.11.2-1+b1 python3-all-dbg==3.11.2-1+b1 python3-all-dev==3.11.2-1+b1 +python3-appdirs==1.4.4-3 python3-apt==2.6.0 python3-astroid==2.14.2-1 +python3-asttokens==2.2.1-1 python3-attr==22.2.0-1 python3-automat==22.10.0-1 python3-babel==2.10.3-1 +python3-backcall==0.2.0-4 python3-bcrypt==3.2.2-1 +python3-beniget==0.4.1-3 python3-blinker==1.5-1 +python3-brotli==1.0.9-2+b6 python3-bs4==4.11.2-2 python3-build==0.9.0-1 python3-certifi==2022.9.24-1 @@ -1704,20 +1796,28 @@ python3-charset-normalizer==3.0.1-2 python3-click==8.1.3-2 python3-colorama==0.4.6-2 python3-constantly==15.1.0-4 +python3-contourpy==1.0.7-1+b1 python3-coverage==6.5.0+dfsg1-2+b1 python3-cryptography==38.0.4-3 python3-cssselect==1.2.0-2 +python3-cycler==0.11.0-1 python3-dateutil==2.8.2-2 python3-dbg==3.11.2-1+b1 python3-dbus==1.3.2-4+b1 python3-debian==0.1.49 +python3-decorator==5.1.1-3 python3-dev==3.11.2-1+b1 python3-dill==0.3.6-1 python3-distro==1.8.0-1 python3-distutils==3.11.2-3 python3-docutils==0.19+dfsg-6 +python3-executing==1.2.0-2 +python3-fonttools==4.38.0-1+b1 +python3-fs==2.4.16-2 +python3-gast==0.5.2-2 python3-gi==3.42.2-3+b1 python3-gpg==1.18.0-3+b1 +python3-grpcio==1.51.1-3+b1 python3-hamcrest==2.0.3-2 python3-html5lib==1.1-3 python3-httplib2==0.20.4-3 @@ -1727,23 +1827,30 @@ python3-imagesize==1.4.1-1 python3-importlib-metadata==4.12.0-1 python3-incremental==21.3.0-2 python3-iniconfig==1.1.1-2 +python3-ipython==8.5.0-4 python3-isort==5.6.4-1 +python3-jedi==0.18.2-1 python3-jinja2==3.1.2-1 python3-jwt==2.6.0-1 +python3-kiwisolver==1.4.4-1+b1 python3-lazr.restfulclient==0.14.5-1 python3-lazr.uri==1.0.6-3 python3-lazy-object-proxy==1.9.0-1+b1 python3-lib2to3==3.11.2-3 python3-logilab-common==1.9.8-1 python3-lxml==4.9.2-1+b1 +python3-lz4==4.0.2+dfsg-1+b2 python3-m2crypto==0.38.0-4+b1 python3-magic==2:0.4.26-3 python3-mako==1.2.4+ds-1 python3-markdown==3.4.1-2 python3-markupsafe==2.1.2-1+b1 +python3-matplotlib==3.6.3-1+b1 +python3-matplotlib-inline==0.1.6-2 python3-mccabe==0.7.0-1 python3-minimal==3.11.2-1+b1 python3-more-itertools==8.10.0-2 +python3-mpmath==1.2.1-2 python3-mypy-extensions==0.4.3-4 python3-nose==1.3.7-9 python3-numpy==1:1.24.2-1 @@ -1753,24 +1860,36 @@ python3-openssl==23.0.0-1 python3-packaging==23.0-1 python3-parameterized==0.8.1-6 python3-parse==1.19.0-0.2 +python3-parso==0.8.3-1 python3-pep517==0.13.0-2 python3-pexpect==4.8.0-4 +python3-pickleshare==0.7.5-5 python3-pil==9.4.0-1.1+b1 +python3-pil.imagetk==9.4.0-1.1+b1 python3-pip-whl==23.0.1+dfsg-1 python3-pkg-resources==66.1.1-1 python3-platformdirs==2.6.0-1 python3-pluggy==1.0.0+repack-1 +python3-ply==3.11-5 +python3-prompt-toolkit==3.0.36-2 +python3-protobuf==3.21.12-3 +python3-psutil==5.9.4-1+b1 python3-ptyprocess==0.7.0-5 +python3-pure-eval==0.2.2-1 python3-py==1.11.0-1 python3-pyasn1==0.4.8-3 python3-pyasn1-modules==0.2.8-1 python3-pyelftools==0.29-1 python3-pygments==2.14.0+dfsg-1 python3-pyparsing==3.0.9-1 +python3-pyroute2==0.7.2-2 python3-pytest==7.2.1-2 python3-pytest-cov==4.0.0-1 +python3-pythran==0.11.0+ds-7 python3-requests==2.28.1+dfsg-1 python3-roman==3.3-3 +python3-scapy==2.5.0+dfsg-2 +python3-scipy==1.10.1-2 python3-scour==0.38.2-2 python3-service-identity==18.1.0-8 python3-setuptools==66.1.1-1 @@ -1781,19 +1900,24 @@ python3-software-properties==0.99.30-4 python3-soupsieve==2.3.2-1 python3-sphinx==5.3.0-4 python3-sphinx-rtd-theme==1.2.0+dfsg-1 +python3-stack-data==0.6.2-3 python3-stdeb==0.10.0-2 +python3-sympy==1.11.1-1 python3-thrift==0.17.0-2+b2 python3-tk==3.11.2-3 python3-toml==0.10.2-1 python3-tomli==2.0.1-2 python3-tomlkit==0.11.7-1 +python3-traitlets==5.5.0-1 python3-twisted==22.4.0-4 python3-typing-extensions==4.4.0-1 python3-tz==2022.7.1-4 +python3-ufolib2==0.14.0+dfsg1-1 python3-unidiff==0.7.3-1 python3-urllib3==1.26.12-1 python3-venv==3.11.2-1+b1 python3-wadllib==1.3.6-4 +python3-wcwidth==0.2.5+dfsg1-1.1 python3-webencodings==0.5.1-5 python3-wheel==0.38.4-2 python3-wrapt==1.14.1-2+b2 @@ -1873,6 +1997,7 @@ systemd-timesyncd==252.22-1~deb12u1 t1utils==1.41-4 tcl==8.6.13 tcl8.6==8.6.13+dfsg-2 +tcpdump==4.99.3-1 teckit==2.5.11+ds1-1+b1 telnet==0.17+2.4-2+deb12u1 tex-common==6.18 @@ -1897,6 +2022,7 @@ tk8.6==8.6.13-2 tk8.6-blt2.5==2.5.3+dfsg-4.1 ucf==3.0043+nmu1 udev==252.22-1~deb12u1 +unicode-data==15.0.0-1 unzip==6.0-28 usb.ids==2024.01.20-0+deb12u1 uuid-dev==2.38.1-5+deb12u1 diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 index 0f751c5881ed..97db75c96ebf 100644 --- a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3 @@ -1,13 +1,18 @@ alabaster==0.7.12 +appdirs==1.4.4 astroid==2.14.2 +asttokens==2.2.1 async-timeout==4.0.3 attrs==22.2.0 automat==22.10.0 babel==2.10.3 +backcall==0.2.0 bcrypt==3.2.2 beautifulsoup4==4.11.2 +beniget==0.4.1 bitarray==2.9.2 blinker==1.5 +brotli==1.0.9 build==0.9.0 certifi==2022.9.24 chardet==5.1.0 @@ -15,18 +20,25 @@ charset-normalizer==3.0.1 click==8.1.3 colorama==0.4.6 constantly==15.1.0 +contourpy==1.0.7 coverage==6.5.0 crc16==0.1.1 cryptography==38.0.4 cssselect==1.2.0 ctypesgen==1.0.2 +cycler==0.11.0 cython==0.29.32 dbus-python==1.3.2 +decorator==5.1.1 devscripts==2.23.4+deb12u1 dill==0.3.6 distro==1.8.0 docutils==0.19 +executing==1.2.0 fastentrypoints==0.12 +fonttools==4.38.0 +fs==2.4.16 +gast==0.5.2 gbp==0.9.30 gcovr==5.2 gpg==1.18.0 @@ -40,24 +52,32 @@ imagesize==1.4.1 importlib-metadata==4.12.0 incremental==21.3.0 iniconfig==1.1.1 +ipython==8.5.0 isort==5.6.4 j2cli==0.3.12b0 +jedi==0.18.2 jinja2==3.1.2 +jsonpath-ng==1.6.1 +kiwisolver==0.0.0 lazr.restfulclient==0.14.5 lazr.uri==1.0.6 lazy-object-proxy==1.9.0 logilab-common==1.9.8 lxml==4.9.2 +lz4==4.0.2+dfsg m2crypto==0.38.0 mako==1.2.4.dev0 markdown==3.4.1 markupsafe==2.1.2 +matplotlib==3.6.3 +matplotlib-inline==0.1.6 mccabe==0.7.0 meson==1.0.1 mmh3==2.5.1 mock==5.1.0 mockredispy==2.9.3 more-itertools==8.10.0 +mpmath==0.0.0 mypy-extensions==0.4.3 nose==1.3.7 numpy==1.24.2 @@ -66,14 +86,20 @@ olefile==0.46 packaging==23.0 parameterized==0.8.1 parse==1.19.0 +parso==0.8.3 pep517==0.13.0 pexpect==4.8.0 +pickleshare==0.7.5 pillow==10.0.0 pip==24.0 platformdirs==2.6.0 pluggy==1.0.0+repack -protobuf==4.25.3 +ply==3.11 +prompt-toolkit==3.0.36 +protobuf==4.21.12 +psutil==5.9.4 ptyprocess==0.7.0 +pure-eval==0.0.0 py==1.11.0 pyang==2.4.0 pyangbind==0.8.2 @@ -89,6 +115,7 @@ pylint==2.16.2 pympler==1.0 pyopenssl==23.0.0 pyparsing==3.0.9 +pyroute2==0.7.2 pytest==7.2.1 pytest-cov==4.0.0 pytest-runner==5.2 @@ -96,13 +123,16 @@ python-apt==2.6.0 python-dateutil==2.8.2 python-debian==0.1.49 python-magic==0.4.26 +pythran==0.11.0 pytz==2022.7.1 pyxdg==0.28 pyyaml==6.0 redis==5.0.4 -regex==2024.5.10 +regex==2024.5.15 requests==2.28.1 roman==3.3 +scapy==2.5.0 +scipy==1.10.1 scour==0.38.2 service-identity==18.1.0 setuptools==66.1.1 @@ -113,17 +143,22 @@ snowballstemmer==2.2.0 soupsieve==2.3.2 sphinx==5.3.0 sphinx-rtd-theme==1.2.0 +stack-data==0.6.2 stdeb==0.10.0 stgit==0.19 +sympy==1.11.1 thrift==0.17.0 toml==0.10.2 tomli==2.0.1 tomlkit==0.11.7 +traitlets==5.5.0 twisted==22.4.0 typing_extensions==4.4.0 +ufolib2==0.14.0 unidiff==0.7.3 urllib3==1.26.12 wadllib==1.3.6 +wcwidth==0.2.5 webencodings==0.5.1 wheel==0.38.4 wrapt==1.14.1 diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-arm64 b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-arm64 new file mode 100644 index 000000000000..9a6fae8cbf18 --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-arm64 @@ -0,0 +1 @@ +protobuf==4.25.3 diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-armhf b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-armhf new file mode 100644 index 000000000000..9a6fae8cbf18 --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-armhf @@ -0,0 +1 @@ +protobuf==4.25.3 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye index 527521bb3b30..7e60275d0189 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -63,6 +63,7 @@ cpp-arm-linux-gnueabihf==4:10.2.1-1 cppcheck==2.3-1 cron==3.0pl1-137 curl==7.74.0-1.3+deb11u11 +cython3==0.29.21-3+b1 dblatex==0.3.12py3-1 dblatex-doc==0.3.12py3-1 dbus==1.12.28-0+deb11u1 @@ -105,7 +106,7 @@ docbook-xsl==1.79.2+dfsg-1 docker-buildx-plugin==0.10.5-1~debian.11~bullseye docker-ce==5:24.0.2-1~debian.11~bullseye docker-ce-cli==5:24.0.2-1~debian.11~bullseye -docker-ce-rootless-extras==5:26.1.2-1~debian.11~bullseye +docker-ce-rootless-extras==5:26.1.3-1~debian.11~bullseye docker-compose-plugin==2.18.1-1~debian.11~bullseye docutils-common==0.16+dfsg-4 dosfstools==4.2-1 @@ -163,7 +164,9 @@ gem2deb==1.4 gem2deb-test-runner==1.4 gettext==0.21-4 gettext-base==0.21-4 -ghostscript==9.53.3~dfsg-7+deb11u6 +gfortran==4:10.2.1-1 +gfortran-10==10.2.1-6 +ghostscript==9.53.3~dfsg-7+deb11u7 gir1.2-atk-1.0==2.36.0-2 gir1.2-atspi-2.0==2.38.0-4+deb11u1 gir1.2-freedesktop==1.66.1-1+b1 @@ -222,6 +225,7 @@ intltool-debian==0.35.0+20060710.5 iproute2==5.10.0-4 iptables==1.8.7-1 ipxe-qemu==1.0.0+git-20190125.36a4c85-5.1 +ipython3==7.20.0-1+deb11u1 iso-codes==4.6.0-1 java-common==0.72 java-wrappers==0.3 @@ -319,6 +323,7 @@ libbit-vector-perl==7.4-1+b7 libblas3==3.9.0-3+deb11u1 libblkid-dev==2.36.1-8+deb11u2 libbluray2==1:1.2.1-4+deb11u2 +libboost-all-dev==1.74.0.3 libboost-atomic-dev==1.74.0.3 libboost-atomic1.74-dev==1.74.0-9 libboost-atomic1.74.0==1.74.0-9 @@ -341,36 +346,83 @@ libboost-date-time-dev==1.74.0.3 libboost-date-time1.74-dev==1.74.0-9 libboost-date-time1.74.0==1.74.0-9 libboost-dev==1.74.0.3 +libboost-exception-dev==1.74.0.3 +libboost-exception1.74-dev==1.74.0-9 libboost-fiber-dev==1.74.0.3 libboost-fiber1.74-dev==1.74.0-9 libboost-fiber1.74.0==1.74.0-9 libboost-filesystem-dev==1.74.0.3 libboost-filesystem1.74-dev==1.74.0-9 libboost-filesystem1.74.0==1.74.0-9 +libboost-graph-dev==1.74.0.3 libboost-graph-parallel-dev==1.74.0.3 libboost-graph-parallel1.74-dev==1.74.0-9 libboost-graph-parallel1.74.0==1.74.0-9 +libboost-graph1.74-dev==1.74.0-9 +libboost-graph1.74.0==1.74.0-9 +libboost-iostreams-dev==1.74.0.3 +libboost-iostreams1.74-dev==1.74.0-9 +libboost-iostreams1.74.0==1.74.0-9 +libboost-locale-dev==1.74.0.3 +libboost-locale1.74-dev==1.74.0-9 +libboost-locale1.74.0==1.74.0-9 libboost-log-dev==1.74.0.3 libboost-log1.74-dev==1.74.0-9 libboost-log1.74.0==1.74.0-9 +libboost-math-dev==1.74.0.3 +libboost-math1.74-dev==1.74.0-9 +libboost-math1.74.0==1.74.0-9 +libboost-mpi-dev==1.74.0.3 +libboost-mpi-python-dev==1.74.0.3 +libboost-mpi-python1.74-dev==1.74.0-9 +libboost-mpi-python1.74.0==1.74.0-9 +libboost-mpi1.74-dev==1.74.0-9 libboost-mpi1.74.0==1.74.0-9 +libboost-nowide-dev==1.74.0.3 +libboost-nowide1.74-dev==1.74.0-9 +libboost-nowide1.74.0==1.74.0-9 +libboost-numpy-dev==1.74.0.3 +libboost-numpy1.74-dev==1.74.0-9 +libboost-numpy1.74.0==1.74.0-9 libboost-program-options-dev==1.74.0.3 libboost-program-options1.74-dev==1.74.0-9 libboost-program-options1.74.0==1.74.0-9 +libboost-python-dev==1.74.0.3 +libboost-python1.74-dev==1.74.0-9 +libboost-python1.74.0==1.74.0-9 +libboost-random-dev==1.74.0.3 +libboost-random1.74-dev==1.74.0-9 +libboost-random1.74.0==1.74.0-9 libboost-regex-dev==1.74.0.3 libboost-regex1.74-dev==1.74.0-9 libboost-regex1.74.0==1.74.0-9 +libboost-serialization-dev==1.74.0.3 libboost-serialization1.74-dev==1.74.0-9 libboost-serialization1.74.0==1.74.0-9 +libboost-stacktrace-dev==1.74.0.3 +libboost-stacktrace1.74-dev==1.74.0-9 +libboost-stacktrace1.74.0==1.74.0-9 libboost-system-dev==1.74.0.3 libboost-system1.74-dev==1.74.0-9 libboost-system1.74.0==1.74.0-9 +libboost-test-dev==1.74.0.3 libboost-test1.74-dev==1.74.0-9 libboost-test1.74.0==1.74.0-9 libboost-thread-dev==1.74.0.3 libboost-thread1.74-dev==1.74.0-9 libboost-thread1.74.0==1.74.0-9 +libboost-timer-dev==1.74.0.3 +libboost-timer1.74-dev==1.74.0-9 +libboost-timer1.74.0==1.74.0-9 +libboost-tools-dev==1.74.0.3 +libboost-type-erasure-dev==1.74.0.3 +libboost-type-erasure1.74-dev==1.74.0-9 +libboost-type-erasure1.74.0==1.74.0-9 +libboost-wave-dev==1.74.0.3 +libboost-wave1.74-dev==1.74.0-9 +libboost-wave1.74.0==1.74.0-9 libboost1.74-dev==1.74.0-9 +libboost1.74-tools-dev==1.74.0-9 libbpf-dev==1:0.3-2 libbpf0==1:0.3-2 libbrlapi0.8==6.3+dfsg-1+deb11u1 @@ -396,6 +448,7 @@ libc6-i386==2.31-13+deb11u10 libc6-x32==2.31-13+deb11u10 libcaca0==0.99.beta19-2.2 libcacard0==1:2.8.0-3 +libcaf-openmpi-3==2.9.2-3 libcairo-gobject2==1.16.0-5 libcairo-script-interpreter2==1.16.0-5 libcairo2==1.16.0-5 @@ -434,6 +487,8 @@ libclass-xsaccessor-perl==1.19-3+b7 libclone-perl==0.45-1+b1 libcmocka-dev==1.1.5-2 libcmocka0==1.1.5-2 +libcoarrays-dev==2.9.2-3 +libcoarrays-openmpi-dev==2.9.2-3 libcodec2-0.9==0.9.2-4 libcolord2==1.4.5-3 libcommon-sense-perl==3.75-1+b4 @@ -599,6 +654,7 @@ libfribidi-dev==1.0.8-2+deb11u1 libfribidi0==1.0.8-2+deb11u1 libfstrm0==0.6.0-1+b1 libgbm1==20.3.5-1 +libgc-dev==1:8.0.4-3 libgc1==1:8.0.4-3 libgcc-10-dev==10.2.1-6 libgcc-10-dev-armhf-cross==10.2.1-6cross1 @@ -614,6 +670,9 @@ libgdk-pixbuf2.0-common==2.42.2+dfsg-1+deb11u1 libgeronimo-annotation-1.3-spec-java==1.3-1 libgeronimo-interceptor-3.0-spec-java==1.0.1-4 libgetopt-long-descriptive-perl==0.105-1 +libgflags-dev==2.2.2-2 +libgflags2.2==2.2.2-2 +libgfortran-10-dev==10.2.1-6 libgfortran5==10.2.1-6 libgif7==5.1.9-2 libgirepository-1.0-1==1.66.1-1+b1 @@ -647,6 +706,7 @@ libgnutls-dane0==3.7.1-5+deb11u4 libgomp1==10.2.1-6 libgomp1-armhf-cross==10.2.1-6cross1 libgoogle-gson-java==2.8.6-1+deb11u1 +libgoogle-perftools-dev==2.8.1-1 libgoogle-perftools4==2.8.1-1 libgpgme11==1.14.0-1+b2 libgpm2==1.20.7-8 @@ -654,8 +714,8 @@ libgraphite2-3==1.3.14-1 libgraphite2-dev==1.3.14-1 libgrpc++1==1.30.2-3 libgrpc10==1.30.2-3 -libgs9==9.53.3~dfsg-7+deb11u6 -libgs9-common==9.53.3~dfsg-7+deb11u6 +libgs9==9.53.3~dfsg-7+deb11u7 +libgs9-common==9.53.3~dfsg-7+deb11u7 libgsasl7==1.10.0-4+deb11u1 libgsm1==1.0.18-2 libgssrpc4==1.18.3-6+deb11u4 @@ -697,9 +757,11 @@ libhttp-server-simple-perl==0.52-1.1 libhttp-tiny-multipart-perl==0.08-1.1 libhttpclient-java==4.5.13-2 libhttpcore-java==4.4.14-1 +libhwloc-dev==2.4.1+dfsg-1 libhwloc-plugins==2.4.1+dfsg-1 libhwloc15==2.4.1+dfsg-1 libiberty-dev==20210106-1 +libibverbs-dev==33.2-1 libibverbs1==33.2-1 libice-dev==2:1.0.10-1 libice6==2:1.0.10-1 @@ -757,11 +819,15 @@ libjq1==1.6-2.1 libjs-bootstrap4==4.5.2+dfsg1-8~deb11u1 libjs-d3==3.5.17-4 libjs-jquery==3.5.1+dfsg+~3.5.5-7 +libjs-jquery-easing==12-3 +libjs-jquery-fancybox==12-3 libjs-jquery-hotkeys==0~20130707+git2d51e3a9+dfsg-2.1 libjs-jquery-isonscreen==1.2.0-1.1 libjs-jquery-metadata==12-3 +libjs-jquery-mousewheel==1:3.1.13-2 libjs-jquery-tablesorter==1:2.31.3+dfsg1-1 libjs-jquery-throttle-debounce==1.1+dfsg.1-1.1 +libjs-jquery-ui==1.12.1+dfsg-8+deb11u2 libjs-popper.js==1.16.1+ds-3 libjs-sizzle==2.3.5+ds-2 libjs-sphinxdoc==3.4.3-2 @@ -911,7 +977,9 @@ libnftnl-dev==1.1.9-1 libnftnl11==1.1.9-1 libnghttp2-14==1.43.0-1+deb11u1 libnl-3-200==3.4.0-1+b1 +libnl-3-dev==3.4.0-1+b1 libnl-route-3-200==3.4.0-1+b1 +libnl-route-3-dev==3.4.0-1+b1 libnorm-dev==1.5.9+dfsg-2 libnorm1==1.5.9+dfsg-2 libnpth0==1.6-3 @@ -937,6 +1005,7 @@ libopenexr25==2.5.4-2+deb11u1 libopengl-dev==1.3.2-1 libopengl0==1.3.2-1 libopenjp2-7==2.4.0-3 +libopenmpi-dev==4.1.0-10 libopenmpi3==4.1.0-10 libopenmpt0==0.4.11-1 libopentest4j-java==1.2.0-2 @@ -1018,6 +1087,7 @@ libplexus-sec-dispatcher-java==1.4-4 libplexus-utils2-java==3.3.0-1 libplexus-velocity-java==1.2-3.1 libpmem1==1.10-2+deb11u1 +libpmix-dev==4.0.0-4.1+deb11u1 libpmix2==4.0.0-4.1+deb11u1 libpng-dev==1.6.37-3 libpng-tools==1.6.37-3 @@ -1201,6 +1271,8 @@ libthai-data==0.1.28-3 libthai-dev==0.1.28-3 libthai0==0.1.28-3 libtheora0==1.1.1+dfsg.1-15 +libthrift-0.13.0==0.13.0-6 +libthrift-dev==0.13.0-6 libtie-ixhash-perl==1.23-2.1 libtiff5==4.2.0-1+deb11u5 libtime-duration-perl==1.21-1 @@ -1428,8 +1500,10 @@ linux-headers-arm64==5.10.216-1 linux-kbuild-5.10==5.10.216-1 linux-libc-dev==5.10.216-1 linuxdoc-tools==0.9.82-1 +llvm==1:11.0-51+nmu5 llvm-11==1:11.0.1-2 llvm-11-runtime==1:11.0.1-2 +llvm-runtime==1:11.0-51+nmu5 lmodern==2.004.5-6.1 locales==2.31-13+deb11u10 logrotate==3.18.0-2+deb11u2 @@ -1464,8 +1538,11 @@ mesa-vdpau-drivers==20.3.5-1 mesa-vulkan-drivers==20.3.5-1 mime-support==3.66 module-assistant==0.11.10 +mpi-default-bin==1.13 +mpi-default-dev==1.13 mysql-common==5.8+1.0.7 ncurses-term==6.2+20201114-2+deb11u2 +net-tools==1.60+git20181103.0eebece-1 netbase==6.3 netpbm==2:10.0-15.4 nftables==0.9.8-3.1+deb11u2 @@ -1478,6 +1555,8 @@ openjdk-11-jdk==11.0.23+9-1~deb11u1 openjdk-11-jdk-headless==11.0.23+9-1~deb11u1 openjdk-11-jre==11.0.23+9-1~deb11u1 openjdk-11-jre-headless==11.0.23+9-1~deb11u1 +openmpi-bin==4.1.0-10 +openmpi-common==4.1.0-10 opensp==1.5.2-13+b2 openssh-client==1:8.4p1-5+deb11u3 openssh-server==1:8.4p1-5+deb11u3 @@ -1581,6 +1660,7 @@ python3-astroid==2.5.1-1 python3-attr==20.3.0-1 python3-automat==20.2.0-1 python3-babel==2.8.0+dfsg.1-7 +python3-backcall==0.2.0-1 python3-bcrypt==3.1.7-4 python3-bs4==4.9.3-1 python3-certifi==2020.6.20-1 @@ -1596,6 +1676,7 @@ python3-dateutil==2.8.1-6 python3-dbg==3.9.2-3 python3-dbus==1.2.16-5 python3-debian==0.1.39 +python3-decorator==4.4.2-2 python3-dev==3.9.2-3 python3-distro-info==1.0+deb11u1 python3-distutils==3.9.2-1 @@ -1611,7 +1692,10 @@ python3-importlib-metadata==1.6.0-2 python3-incremental==17.5.0-1 python3-iniconfig==1.1.1-1 python3-ipaddr==2.2.0-4 +python3-ipython==7.20.0-1+deb11u1 +python3-ipython-genutils==0.2.0-4 python3-isort==5.6.4-1 +python3-jedi==0.18.0-1 python3-jinja2==2.11.3-1 python3-lazy-object-proxy==1.5.2-1 python3-lib2to3==3.9.2-1 @@ -1630,19 +1714,28 @@ python3-olefile==0.46-3 python3-openssl==20.0.1-1 python3-packaging==20.9-2 python3-parse==1.6.6-0.2 +python3-parso==0.8.1-1 +python3-pexpect==4.8.0-2 +python3-pickleshare==0.7.5-3 python3-pil==8.1.2+dfsg-0.3+deb11u1 python3-pkg-resources==52.0.0-4 python3-pluggy==0.13.0-6 +python3-ply==3.11-4 +python3-prompt-toolkit==3.0.14-1 +python3-psutil==5.8.0-1 +python3-ptyprocess==0.7.0-1 python3-py==1.10.0-1 python3-pyasn1==0.4.8-1 python3-pyasn1-modules==0.2.1-1 python3-pycurl==7.43.0.6-5 python3-pygments==2.7.1+dfsg-2.1 python3-pyparsing==2.4.7-1 +python3-pyroute2==0.5.14-2 python3-pytest==6.0.2-2 python3-pytest-cov==2.10.1-1 python3-requests==2.25.1+dfsg-2 python3-roman==2.0.0-5 +python3-scapy==2.4.4-4 python3-service-identity==18.1.0-6 python3-setuptools==52.0.0-4 python3-six==1.16.0-2 @@ -1652,8 +1745,10 @@ python3-soupsieve==2.2.1-1 python3-sphinx==3.4.3-2 python3-sphinx-rtd-theme==0.5.1+dfsg-1 python3-stdeb==0.10.0-1 +python3-thrift==0.13.0-6 python3-tk==3.9.2-1 python3-toml==0.10.1-1 +python3-traitlets==5.0.5-1 python3-twisted==20.3.0-7+deb11u1 python3-twisted-bin==20.3.0-7+deb11u1 python3-typing-extensions==3.7.4.3-1 @@ -1661,6 +1756,7 @@ python3-tz==2021.1-1 python3-unidiff==0.5.5-2 python3-urllib3==1.26.5-1~exp1 python3-venv==3.9.2-3 +python3-wcwidth==0.1.9+dfsg1-2 python3-webencodings==0.5.1-2 python3-wheel==0.34.2-1 python3-wrapt==1.12.1-4+b1 @@ -1693,18 +1789,37 @@ rrdtool==1.7.2-3+b7 rsync==3.2.3-4+deb11u1 rsyslog==8.2102.0-2+deb11u1 ruby==1:2.7+2 +ruby-addressable==2.7.0-2 ruby-all-dev==1:2.7+2 ruby-asciidoctor==2.0.12-2 ruby-diff-lcs==1.4.4-1 +ruby-docile==1.1.5-2 +ruby-faraday==1.1.0-6 +ruby-google-protobuf==3.12.4-1+deb11u1 +ruby-googleapis-common-protos-types==1.0.1-1.1 +ruby-googleauth==0.13.0-3 +ruby-jwt==2.2.2-1 +ruby-little-plugger==1.1.4-1 +ruby-logging==2.2.2-1 +ruby-memoist==0.16.2-2 ruby-minitest==5.13.0-1 +ruby-multi-json==1.14.1-1 +ruby-multipart-post==2.0.0-1 ruby-net-telnet==0.1.1-2 +ruby-oj==3.11.0-1 +ruby-os==0.9.6-1.1 ruby-power-assert==1.1.7-2 +ruby-public-suffix==3.0.3+ds-1 ruby-rspec==3.9.0c2e2m1s3-2 ruby-rspec-core==3.9.0c2e2m1s3-2 ruby-rspec-expectations==3.9.0c2e2m1s3-2 ruby-rspec-mocks==3.9.0c2e2m1s3-2 ruby-rspec-support==3.9.0c2e2m1s3-2 +ruby-ruby2-keywords==0.0.2-2 ruby-rubygems==3.2.5-2 +ruby-signet==0.14.0-4 +ruby-simplecov==0.19.1-1 +ruby-simplecov-html==0.12.3-1 ruby-test-unit==3.3.9-1 ruby-xmlrpc==0.3.0-2 ruby2.7==2.7.4-1+deb11u1 @@ -1737,6 +1852,7 @@ systemd-timesyncd==247.3-7+deb11u4 t1utils==1.41-4 tcl==8.6.11+1 tcl8.6==8.6.11+dfsg-1 +tcpdump==4.99.0-2+deb11u1 teckit==2.5.10+ds1-3 telnet==0.17-42 termit==3.1-1 @@ -1761,6 +1877,7 @@ texlive-plain-generic==2020.20210202-3 texlive-science==2020.20210202-3 texlive-xetex==2020.20210202-3 thin-provisioning-tools==0.9.0-1 +thrift-compiler==0.13.0-6 time==1.9-0.1 tipa==2:1.3-20.1 tk==8.6.11+1 @@ -1771,6 +1888,8 @@ unattended-upgrades==2.8 unzip==6.0-26+deb11u1 uuid-dev==2.36.1-8+deb11u2 va-driver-all==2.10.0-1 +valgrind==1:3.16.1-1 +valgrind-dbg==1:3.16.1-1 vdpau-driver-all==1.4-3 velocity==1.7-6 vim==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 index 9481bff74f72..4bfb6d46bc44 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-py3 @@ -4,6 +4,7 @@ async-timeout==4.0.3 attrs==20.3.0 automat==20.2.0 babel==2.8.0 +backcall==0.2.0 bcrypt==3.1.7 beautifulsoup4==4.9.3 bitarray==2.9.2 @@ -17,8 +18,10 @@ coverage==5.1 crc16==0.1.1 cryptography==3.3.2 ctypesgen==1.0.2 +cython==0.29.21 dblatex==0.3.12 dbus-python==1.2.16 +decorator==4.4.2 devscripts==2.21.3+deb11u1 distro-info==1.0+deb11u1 docutils==0.16 @@ -36,9 +39,13 @@ importlib-metadata==1.6.0 incremental==17.5.0 iniconfig==0.0.0 ipaddr==2.2.0 +ipython==7.20.0 +ipython_genutils==0.2.0 isort==5.6.4 j2cli==0.3.10 +jedi==0.18.0 jinja2==2.11.3 +jsonpath-ng==1.6.1 lazy-object-proxy==0.0.0 logilab-common==1.8.1 lxml==4.9.1 @@ -58,11 +65,16 @@ olefile==0.46 packaging==20.9 parameterized==0.8.1 parse==1.6.6 +parso==0.8.1 pexpect==4.8.0 +pickleshare==0.7.5 pillow==9.4.0 pip==24.0 pluggy==0.13.0 +ply==3.11 +prompt-toolkit==3.0.14 protobuf==4.25.3 +psutil==5.8.0 ptyprocess==0.7.0 py==1.10.0 pyang==2.4.0 @@ -78,6 +90,7 @@ pylint==2.7.2 pympler==0.8 pyopenssl==20.0.1 pyparsing==2.4.7 +pyroute2==0.5.14 pytest==6.0.2 pytest-cov==2.10.1 pytest-runner==5.2 @@ -89,9 +102,10 @@ pytz==2021.1 pyxdg==0.27 pyyaml==5.4.1 redis==5.0.4 -regex==2024.5.10 +regex==2024.5.15 requests==2.25.1 roman==2.0.0 +scapy==2.4.4 service-identity==18.1.0 setuptools==49.6.0 six==1.16.0 @@ -101,12 +115,15 @@ sphinx==3.4.3 sphinx-rtd-theme==0.5.1 stdeb==0.10.0 stgit==0.19 +thrift==0.13.0 toml==0.10.1 +traitlets==5.0.5 twisted==20.3.0 typing-extensions==3.7.4.3 unattended-upgrades==0.1 unidiff==0.5.5 urllib3==1.26.5 +wcwidth==0.1.9 webencodings==0.5.1 wheel==0.38.1 wrapt==1.12.1 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index 18c959d3ad97..202bd02c061e 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -95,7 +95,7 @@ docbook-xml==4.5-8 docker-buildx-plugin==0.10.5-1~debian.10~buster docker-ce==5:24.0.2-1~debian.10~buster docker-ce-cli==5:24.0.2-1~debian.10~buster -docker-ce-rootless-extras==5:26.1.2-1~debian.10~buster +docker-ce-rootless-extras==5:26.1.3-1~debian.10~buster docker-compose-plugin==2.18.1-1~debian.10~buster docutils-common==0.14+dfsg-4 docutils-doc==0.14+dfsg-4 diff --git a/files/build/versions/host-image/versions-deb-bookworm b/files/build/versions/host-image/versions-deb-bookworm index 360701181fb0..242ff4bb7c27 100644 --- a/files/build/versions/host-image/versions-deb-bookworm +++ b/files/build/versions/host-image/versions-deb-bookworm @@ -196,6 +196,7 @@ libnss-ldapd==0.9.12-4 libnss-radius==1.0.1-1 libnss-tacplus==1.0.4-1 libnuma1==2.0.16-1 +libnvme1==1.3-1 libonig5==6.9.8-1 libopencsd1==1.3.3-1 libpam-ldapd==0.9.12-4 @@ -303,10 +304,11 @@ ntpsec==1.2.2+dfsg1-1+deb12u1 ntpsec-ntpdate==1.2.2+dfsg1-1+deb12u1 ntpsec-ntpdig==1.2.2+dfsg1-1+deb12u1 ntpstat==0.0.0.1-2+b1 +nvme-cli==2.4+really2.3-3 opennsl-modules==7.1.0.0 -openssh-client==1:9.2p1-2+deb12u2 -openssh-server==1:9.2p1-2+deb12u2 -openssh-sftp-server==1:9.2p1-2+deb12u2 +openssh-client==1:9.2p1-2+deb12u1 +openssh-server==1:9.2p1-2+deb12u1 +openssh-sftp-server==1:9.2p1-2+deb12u1 openssl==3.0.11-1~deb12u2 pci.ids==0.0~2023.04.11-1 pciutils==1:3.9.0-4 @@ -381,6 +383,7 @@ unzip==6.0-28 usbutils==1:014-1+deb12u1 util-linux==2.38.1-5+deb12u1 util-linux-extra==2.38.1-5+deb12u1 +uuid-runtime==2.38.1-5+deb12u1 vim==2:9.0.1378-2 vim-common==2:9.0.1378-2 vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/host-image/versions-deb-bookworm-arm64 b/files/build/versions/host-image/versions-deb-bookworm-arm64 index dcb0fd7d844b..d82ad88387ea 100644 --- a/files/build/versions/host-image/versions-deb-bookworm-arm64 +++ b/files/build/versions/host-image/versions-deb-bookworm-arm64 @@ -1,6 +1,3 @@ mrvlprestera==1.0 ntpstat==0.0.0.1-2 -openssh-client==1:9.2p1-2+deb12u1 -openssh-server==1:9.2p1-2+deb12u1 -openssh-sftp-server==1:9.2p1-2+deb12u1 tsingma-bsp==1.0 diff --git a/files/build/versions/host-image/versions-deb-bookworm-armhf b/files/build/versions/host-image/versions-deb-bookworm-armhf index 4ad526a0d456..85aa015ee127 100644 --- a/files/build/versions/host-image/versions-deb-bookworm-armhf +++ b/files/build/versions/host-image/versions-deb-bookworm-armhf @@ -2,7 +2,4 @@ binutils-arm-linux-gnueabihf==2.40-2 linux-image-6.1.0-11-2-armmp==6.1.38-4 mrvlprestera==1.0 ntpstat==0.0.0.1-2 -openssh-client==1:9.2p1-2+deb12u1 -openssh-server==1:9.2p1-2+deb12u1 -openssh-sftp-server==1:9.2p1-2+deb12u1 python3-gi==3.42.2-3+b1 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index 1200e659ac4c..eae03d6c4970 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -58,9 +58,9 @@ pynacl==1.5.0 pyroute2==0.5.19 python-apt==2.6.0 python-dateutil==2.9.0.post0 -pyyaml==5.4.1 +pyyaml==6.0.1 redis==3.5.3 -regex==2024.5.10 +regex==2024.5.15 requests==2.31.0 scapy==2.4.4 semantic-version==2.10.0 diff --git a/files/build/versions/host-image/versions-py3-all-arm64 b/files/build/versions/host-image/versions-py3-all-arm64 deleted file mode 100644 index cf39afa6b4c0..000000000000 --- a/files/build/versions/host-image/versions-py3-all-arm64 +++ /dev/null @@ -1 +0,0 @@ -pyyaml==6.0.1 diff --git a/files/build/versions/host-image/versions-py3-all-armhf b/files/build/versions/host-image/versions-py3-all-armhf index 947ac1b1616e..fe39c407f7f6 100644 --- a/files/build/versions/host-image/versions-py3-all-armhf +++ b/files/build/versions/host-image/versions-py3-all-armhf @@ -1,2 +1 @@ pygobject==3.42.2 -pyyaml==6.0.1 From 2fb29d39fd0ba6221a2536db86f3ad732b91e099 Mon Sep 17 00:00:00 2001 From: Ashwin Srinivasan <93744978+assrinivasan@users.noreply.github.com> Date: Sat, 18 May 2024 12:32:12 -0700 Subject: [PATCH 128/282] [pmon]: Adds a bind mount from host to /usr/share/stormond/ directory on pmon container (#18122) Why I did it This is a part of a larger commit that adds a storage monitoring daemon to SONiC. This commit is needed to that storagemon daemon can save FS stats JSON file to disk in the event of planned reboots and unintentional powercycles. SONiC Storage Monitoring Daemon HLD Also added psutil module to perform process and system monitoring operations pythonically. Microsoft ADO (number only): 17468992 How I did it Added a rule to create the directory on the pmon container Added a rule to create a bind-mount How to verify it Flash a switch with image containing the changes. Run: root@str2-7050cx3-acs-13:~# docker inspect pmon and verify the following parameters in the "mounts" section: "Mounts": [ . . . { "Type": "bind", "Source": "/host/pmon/stormond", "Destination": "/usr/share/stormond", "Mode": "rw", "RW": true, "Propagation": "rprivate" }, . . . ] Additionally, you can run the following steps: Navigate to /host/pmon/stormond directory on the host and create an empty file Enter the pmon container and navigate to /usr/share/stormond Verify that the file created in the host is seen here Add text to this file Exit the docker container cat the file on the host and verify that the text you added is seen here root@str2-7050cx3-acs-13:/host# cd pmon/ root@str2-7050cx3-acs-13:/host/pmon# ls stormond root@str2-7050cx3-acs-13:/host/pmon# cd stormond/ root@str2-7050cx3-acs-13:/host/pmon/stormond# touch ashwin.txt root@str2-7050cx3-acs-13:/host/pmon/stormond# docker exec -it pmon bash root@str2-7050cx3-acs-13:/# cd /usr/share/stormond/ root@str2-7050cx3-acs-13:/usr/share/stormond# ls ashwin.txt root@str2-7050cx3-acs-13:/usr/share/stormond# ls -al total 8 drwxr-xr-x 2 root root 4096 Feb 19 04:06 . drwxr-xr-x 3 root root 4096 Feb 19 02:04 .. -rw-r--r-- 1 root root 0 Feb 19 04:06 ashwin.txt root@str2-7050cx3-acs-13:/usr/share/stormond# echo "Bind mount successful?" > ashwin.txt root@str2-7050cx3-acs-13:/usr/share/stormond# exit exit root@str2-7050cx3-acs-13:/host/pmon/stormond# cat ashwin.txt Bind mount successful? root@str2-7050cx3-acs-13:/host/pmon/stormond# As a third test: Run ls -alirth in both the /host/pmon/stormond dir on the host and /usr/share/stormond dir in the pmon container and verify that the inode numbers match. root@str2-7050cx3-acs-13:/host/pmon/stormond# ls -alirth total 12K 129546 drwxr-xr-x 3 root root 4.0K Feb 19 04:06 .. 129554 drwxr-xr-x 2 root root 4.0K Feb 19 04:06 . 129555 -rw-r--r-- 1 root root 23 Feb 19 04:07 ashwin.txt root@str2-7050cx3-acs-13:/host/pmon/stormond# docker exec -it pmon bash root@str2-7050cx3-acs-13:/# cd /usr/share/stormond/ root@str2-7050cx3-acs-13:/usr/share/stormond# ls -alirth total 12K 33618 drwxr-xr-x 3 root root 4.0K Feb 19 02:04 .. 129554 drwxr-xr-x 2 root root 4.0K Feb 19 04:06 . 129555 -rw-r--r-- 1 root root 23 Feb 19 04:07 ashwin.txt root@str2-7050cx3-acs-13:/usr/share/stormond# --- dockers/docker-platform-monitor/Dockerfile.j2 | 4 ++++ rules/docker-platform-monitor.mk | 1 + sonic-slave-bookworm/Dockerfile.j2 | 1 + 3 files changed, 6 insertions(+) diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index a4e01237e053..8c9deb02f129 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -49,6 +49,9 @@ RUN pip3 install requests # We install the libpci module in order to be able to do PCI transactions RUN pip3 install libpci +# Install psutil for process and system monitoring operations +RUN pip3 install psutil + {% if docker_platform_monitor_debs.strip() -%} # Copy locally-built Debian package dependencies {{ copy_files("debs/", docker_platform_monitor_debs.split(' '), "/debs/") }} @@ -92,6 +95,7 @@ COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor"] COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"] +RUN mkdir -p /usr/share/stormond RUN sonic-cfggen -a "{\"CONFIGURED_PLATFORM\":\"{{CONFIGURED_PLATFORM}}\"}" -t /usr/share/sonic/templates/docker_init.j2 > /usr/bin/docker_init.sh RUN rm -f /usr/share/sonic/templates/docker_init.j2 RUN chmod 755 /usr/bin/docker_init.sh diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index 99cca6f70084..4f060ec04f34 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -53,6 +53,7 @@ $(DOCKER_PLATFORM_MONITOR)_CONTAINER_NAME = pmon $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += --privileged -t $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/timezone:/etc/timezone:ro +$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /host/pmon/stormond:/usr/share/stormond:rw $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /var/run/platform_cache:/var/run/platform_cache:ro $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /usr/share/sonic/device/pddf:/usr/share/sonic/device/pddf:ro diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 6b749b5e8f40..2c1b0e375f68 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -562,6 +562,7 @@ RUN pip3 uninstall -y enum34 # For sonic-platform-common testing RUN pip3 install redis +RUN pip3 install psutil # For sonic-swss-common testing RUN pip3 install Pympler==1.0 From 1fd869b41647f2d8501be8bf50b398e97abe1b5a Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Sat, 18 May 2024 18:13:04 -0400 Subject: [PATCH 129/282] [master][ethtool] Install ethtool to localhost (#18241) Signed-off-by: mlok --- build_debian.sh | 1 + dockers/docker-platform-monitor/Dockerfile.j2 | 5 +++-- rules/docker-platform-monitor.mk | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index bc927fbb36d6..2e054e71675f 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -406,6 +406,7 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in sysstat \ xxd \ wireless-regdb \ + ethtool \ zstd \ nvme-cli diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index 8c9deb02f129..9f44ca004594 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -27,9 +27,10 @@ RUN apt-get update && \ iputils-ping \ pciutils \ nvme-cli \ - ethtool && \ + ethtool + # smartmontools version should match the installed smartmontools in sonic_debian_extension build template - apt-get install -y -t bookworm-backports \ +RUN apt-get install -y -t bookworm-backports \ smartmontools # On Arista devices, the sonic_platform wheel is not installed in the container. diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index 4f060ec04f34..bf72808e00ad 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -65,7 +65,6 @@ $(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python3/dist-packages/so $(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/bin/sensors $(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/sbin/iSmart $(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/sbin/SmartCmd -$(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/bin/ethtool $(DOCKER_PLATFORM_MONITOR)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) SONIC_BOOKWORM_DOCKERS += $(DOCKER_PLATFORM_MONITOR) From 21eadf5594048338df6d76ea1ecb41b07c6da3d2 Mon Sep 17 00:00:00 2001 From: Mati Alfaro Date: Sun, 19 May 2024 01:29:19 +0300 Subject: [PATCH 130/282] [yang-models] Add missing constraints in VLAN yang model. Fixes #12256 (#18292) Fix #12256 Implement constraints as described in https://github.com/sonic-net/sonic-buildimage/issues/12256 1. **Don't allow write of default vlan (vid = 1)** - Change range from 1..4094 to 2..4094 2. **If vlan id already exists, do not allow duplicitous write to ConfigDB** No change is needed, name is key so it will be unique 3. **Do not allow removal of vlan interface if vlan has IP address assigned** No chnage is needed since both VLAN_INTERFACE_LIST and VLAN_INTERFACE_IPPREFIX_LIST reference /vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name - Added IP_PREFIX_WITHOUT_CREATNG_VLAN test 4. **Don't allow removal of vlan if there are members assigned** No chnage is needed since VLAN_MEMBER_LIST refereces "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name" - Added test VLAN_MEMBERS_WITHOUT_CREATING_VLAN 5. **If interface naming mode is alias, make sure corresponding port name exists** sonic-yang doesn't support adding a ports using alias 6. **Make sure port is not configured as a mirror destination port** - must "not(/sms:sonic-mirror-session/sms:MIRROR_SESSION/sms:MIRROR_SESSION_LIST[sms:dst_port=current()])" - Fixed MIRROR_SESSION in sonic-yang-models\tests\files\sample_config_db.json (Ethernet2 is in Vlan111) - Test MIRROR_SESSION_ON_VLAN_MEMBER_PORT 7. **Make sure port is not already a vlan member** No change is needed, is the key for VLAN_MEMBER_LIST 8. **Make sure port is not a router interface** - must "not(/intf:sonic-interface/intf:INTERFACE/intf:INTERFACE_LIST[intf:name=current()])" - Test VLAN_ADD_PORT_THAT_IS_ROUTER_INTERFACE 9. **Make sure port is not already a portchannel member** - must "not(/lag:sonic-portchannel/lag:PORTCHANNEL_MEMBER/lag:PORTCHANNEL_MEMBER_LIST[lag:port=current()]/lag:name)" - Test VLAN_ADD_PORT_CHANNEL_MEMBER 10. **Make sure port is not already an untagged member** - must "not(/vlan:sonic-vlan/vlan:VLAN_MEMBER/vlan:VLAN_MEMBER_LIST[vlan:port=current() and vlan:tagging_mode='untagged' and vlan:name!=current()/../name])" - Test VLAN_ADD_PORT_THAT_IS_UNTAGGED **Verify Vlan name matches vlanid** - must "substring-after(../name, 'Vlan') = current()" - Test VLAN_CREATE_VLAN_WITH_MISSMATCHING_NAME Signed-off-by: matiAlfaro --- ...imple-sample-graph-case-remap-disabled.xml | 2 +- ...ase-remap-enabled-no-tunnel-attributes.xml | 2 +- ...simple-sample-graph-case-remap-enabled.xml | 2 +- .../tests/simple-sample-graph-case.xml | 2 +- .../tests/t0-sample-graph-two-mgmt.xml | 2 +- .../tests/t0-sample-graph.xml | 2 +- .../tests/test_minigraph_case.py | 2 +- .../tests/files/sample_config_db.json | 7 +- .../tests/yang_model_tests/test_yang_model.py | 5 +- .../tests/yang_model_tests/tests/vlan.json | 28 ++ .../yang_model_tests/tests_config/vlan.json | 243 ++++++++++++++++++ .../yang-models/sonic-vlan.yang | 62 +++-- 12 files changed, 326 insertions(+), 33 deletions(-) diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml index 4ae1b33023ac..2d26bc910617 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml @@ -142,7 +142,7 @@ ab2 - fortyGigE0/4 + PortChannel01 192.0.0.1 fc02:2000::3;fc02:2000::4 2000 diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml index 6bc2a6db1ba9..650f56e4defa 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml @@ -142,7 +142,7 @@ ab2 - fortyGigE0/4 + PortChannel01 192.0.0.1 fc02:2000::3;fc02:2000::4 2000 diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml index 8c69f04962ae..b290eb7c6cd1 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml @@ -142,7 +142,7 @@ ab2 - fortyGigE0/4 + PortChannel01 192.0.0.1 fc02:2000::3;fc02:2000::4 2000 diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case.xml b/src/sonic-config-engine/tests/simple-sample-graph-case.xml index ddb5f03c58b5..008719c85bf6 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -143,7 +143,7 @@ ab2 - fortyGigE0/4 + PortChannel01 192.0.0.1 fc02:2000::3;fc02:2000::4 2000 diff --git a/src/sonic-config-engine/tests/t0-sample-graph-two-mgmt.xml b/src/sonic-config-engine/tests/t0-sample-graph-two-mgmt.xml index da1b56fe1309..5d201cc3e234 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph-two-mgmt.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph-two-mgmt.xml @@ -281,7 +281,7 @@ Vlan2000 - fortyGigE0/112;fortyGigE0/116;fortyGigE0/120 + PortChannel01;PortChannel02;PortChannel03 False 0.0.0.0/0 diff --git a/src/sonic-config-engine/tests/t0-sample-graph.xml b/src/sonic-config-engine/tests/t0-sample-graph.xml index 05db8246ec0a..b343a8b5e398 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph.xml @@ -265,7 +265,7 @@ Vlan2000 - fortyGigE0/112;fortyGigE0/116;fortyGigE0/120 + PortChannel01;PortChannel02;PortChannel03 False 0.0.0.0/0 diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index 8bad0f5f3560..a5578b841df4 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -129,7 +129,7 @@ def test_minigraph_vlan_members(self): output = self.run_script(argument) expected = { 'Vlan1000|Ethernet8': {'tagging_mode': 'untagged'}, - 'Vlan2000|Ethernet4': {'tagging_mode': 'untagged'} + 'Vlan2000|PortChannel01': {'tagging_mode': 'untagged'} } self.assertEqual( utils.to_dict(output.strip()), diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index b6e6ef07045c..db159a93c0e0 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1197,10 +1197,7 @@ "Vlan111|Ethernet0": { "tagging_mode": "untagged" }, - "Vlan111|Ethernet1": { - "tagging_mode": "untagged" - }, - "Vlan111|Ethernet2": { + "Vlan111|PortChannel0004": { "tagging_mode": "untagged" }, "Vlan111|Ethernet3": { @@ -2297,7 +2294,7 @@ "span": { "direction": "RX", "type": "SPAN", - "dst_port": "Ethernet2", + "dst_port": "Ethernet7", "src_port": "Ethernet3,Ethernet4" } }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py b/src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py index d46d03623250..22cad816b115 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py +++ b/src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py @@ -234,8 +234,9 @@ def runVlanSpecialTest(self, test): desc = self.SpecialTests[test]['desc'] self.logStartTest(desc) jInput = json.loads(self.readJsonInput(test)) - # check all Vlan from 1 to 4094 - for i in range(1,4095): + # check all Vlan from 2 to 4094 + for i in range(2,4095): + vlan = 'Vlan'+str(i) jInput["sonic-vlan:sonic-vlan"]["sonic-vlan:VLAN"]["VLAN_LIST"]\ [0]["name"] = vlan diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/vlan.json b/src/sonic-yang-models/tests/yang_model_tests/tests/vlan.json index 7f1cb4eb3523..a795a7e3b3c2 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/vlan.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/vlan.json @@ -86,5 +86,33 @@ "VLAN_INTERFACE_INVALID_ENABLE_IPV6_LINK_LOCAL": { "desc": "Enable the ipv6 link-local as true.", "eStr": "Invalid value \"true\" in \"ipv6_use_link_local_only\" element." + }, + "VLAN_MEMBERS_WITHOUT_CREATING_VLAN":{ + "desc": "Vlan members without Creating Vlan", + "eStrKey": "LeafRef" + }, + "VLAN_CREATE_VLAN_WITH_MISSMATCHING_NAME": { + "desc": "Create Vlan so that name doesn't match id", + "eStr": "The vlanid must correspond to the VLAN name" + }, + "IP_PREFIX_WITHOUT_CREATNG_VLAN": { + "desc": "Create IP on not created Vlan", + "eStrKey": "LeafRef" + }, + "MIRROR_SESSION_ON_VLAN_MEMBER_PORT": { + "desc": "Set mirror dst port to a Vlan member", + "eStr": "Port is used as a destination port in a mirror session" + }, + "VLAN_ADD_PORT_CHANNEL_MEMBER": { + "desc": "Add port channel member to Vlan", + "eStr": "Port is a member of a port channel" + }, + "VLAN_ADD_PORT_THAT_IS_UNTAGGED": { + "desc": "Add port that is already untagged", + "eStr": "Port can be untagged in at most one VLAN" + }, + "VLAN_ADD_PORT_THAT_IS_ROUTER_INTERFACE": { + "desc": "Add to Vlan port that is router interface", + "eStr": "Port is a router interface" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan.json index 9f3086b60c48..b4288472cfa3 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vlan.json @@ -719,5 +719,248 @@ ] } } + }, + + "VLAN_MEMBERS_WITHOUT_CREATING_VLAN": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "name": "Ethernet0" + } + ] + } + }, + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN_MEMBER": { + "VLAN_MEMBER_LIST": [ + { + "port": "Ethernet0", + "tagging_mode": "tagged", + "name": "Vlan100" + } + ] + } + } + }, + "VLAN_CREATE_VLAN_WITH_MISSMATCHING_NAME": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan10", + "vlanid":11 + } + ] + } + } + }, + "IP_PREFIX_WITHOUT_CREATNG_VLAN": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "description": "server_vlan", + "name": "Vlan10" + } + ] + }, + "sonic-vlan:VLAN_INTERFACE": { + "VLAN_INTERFACE_IPPREFIX_LIST": [ + { + "family": "IPv4", + "ip-prefix": "20.0.0.1/24", + "scope": "global", + "name": "Vlan100" + } + ], + "VLAN_INTERFACE_LIST": [ + { + "name": "Vlan100" + } + ] + } + } + }, + "MIRROR_SESSION_ON_VLAN_MEMBER_PORT": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "name": "Ethernet1", + "speed": 25000, + "lanes": "1" + }, + { + "admin_status": "up", + "name": "Ethernet2", + "speed": 25000, + "lanes": "1" + } + ] + } + }, + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan10" + } + ] + }, + "sonic-vlan:VLAN_MEMBER": { + "VLAN_MEMBER_LIST": [ + { + "port": "Ethernet2", + "tagging_mode": "tagged", + "name": "Vlan10" + } + ] + } + }, + "sonic-mirror-session:sonic-mirror-session": { + "sonic-mirror-session:MIRROR_SESSION": { + "MIRROR_SESSION_LIST": [ { + "name":"mirror_session_dscp", + "type": "SPAN", + "src_port": "Ethernet1", + "dst_port": "Ethernet2" + }] + } + } + }, + "VLAN_ADD_PORT_CHANNEL_MEMBER": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [{ + "admin_status": "up", + "name": "Ethernet1", + "speed": 25000, + "lanes": "1" + }] + } + }, + "sonic-portchannel:sonic-portchannel": { + "sonic-portchannel:PORTCHANNEL": { + "PORTCHANNEL_LIST": [ + { + "admin_status": "up", + "min_links": "1", + "mtu": "9100", + "tpid": "0x8100", + "lacp_key": "auto", + "name": "PortChannel0001", + "fast_rate": "false", + "fallback" : "false", + "mode" : "routed" + } + ] + }, + "sonic-portchannel:PORTCHANNEL_MEMBER": { + "PORTCHANNEL_MEMBER_LIST": [ + { + "name": "PortChannel0001", + "port": "Ethernet1" + } + ] + } + }, + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan10" + } + ] + }, + "sonic-vlan:VLAN_MEMBER": { + "VLAN_MEMBER_LIST": [ + { + "port": "Ethernet1", + "tagging_mode": "tagged", + "name": "Vlan10" + } + ] + } + } + }, + "VLAN_ADD_PORT_THAT_IS_UNTAGGED": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [{ + "admin_status": "up", + "name": "Ethernet1", + "speed": 25000, + "lanes": "1" + }] + } + }, + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan10" + }, + { + "name": "Vlan11" + } + ] + }, + "sonic-vlan:VLAN_MEMBER": { + "VLAN_MEMBER_LIST": [ + { + "port": "Ethernet1", + "tagging_mode": "untagged", + "name": "Vlan10" + }, + { + "port": "Ethernet1", + "tagging_mode": "untagged", + "name": "Vlan11" + } + ] + } + } + }, + "VLAN_ADD_PORT_THAT_IS_ROUTER_INTERFACE": { + "sonic-interface:sonic-interface": { + "sonic-interface:INTERFACE": { + "INTERFACE_LIST": [ + { + "name": "Ethernet1" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [{ + "admin_status": "up", + "name": "Ethernet1", + "speed": 25000, + "lanes": "1" + }] + } + }, + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan10" + } + ] + }, + "sonic-vlan:VLAN_MEMBER": { + "VLAN_MEMBER_LIST": [ + { + "port": "Ethernet1", + "tagging_mode": "untagged", + "name": "Vlan10" + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-vlan.yang b/src/sonic-yang-models/yang-models/sonic-vlan.yang index 1e2361adef44..ff3a1f2f64af 100644 --- a/src/sonic-yang-models/yang-models/sonic-vlan.yang +++ b/src/sonic-yang-models/yang-models/sonic-vlan.yang @@ -1,6 +1,6 @@ module sonic-vlan { - yang-version 1.1; + yang-version 1.1; namespace "http://github.com/sonic-net/sonic-vlan"; prefix vlan; @@ -34,8 +34,19 @@ module sonic-vlan { prefix vrf; } + import sonic-mirror-session { + prefix sms; + } + import sonic-interface { + prefix intf; + } + description "VLAN yang Module for SONiC OS"; + + revision 2024-03-07 { + description "Add Constraints that are implemented in CLI"; + } revision 2021-04-28 { description "Modify Vlan name constraint to allow only legal Vlan names"; } @@ -66,7 +77,7 @@ module sonic-vlan { leaf name { type leafref { - path /vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name; + path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name"; } } @@ -84,7 +95,7 @@ module sonic-vlan { error-app-tag nat-zone-invalid; } } - default "0"; + default "0"; } leaf mpls { description "Enable/disable MPLS routing for the vlan interface"; @@ -113,10 +124,10 @@ module sonic-vlan { } - leaf loopback_action { - description "Packet action when a packet ingress and gets routed on the same IP interface"; - type stypes:loopback_action; - } + leaf loopback_action { + description "Packet action when a packet ingress and gets routed on the same IP interface"; + type stypes:loopback_action; + } } /* end of VLAN_INTERFACE_LIST */ @@ -153,9 +164,9 @@ module sonic-vlan { leaf family { /* family leaf needed for backward compatibility - Both ip4 and ip6 address are string in IETF RFC 6021, - so must statement can check based on : or ., family - should be IPv4 or IPv6 according. + Both ip4 and ip6 address are string in IETF RFC 6021, + so must statement can check based on : or ., family + should be IPv4 or IPv6 according. */ must "(contains(../ip-prefix, ':') and current()='IPv6') or @@ -168,7 +179,7 @@ module sonic-vlan { type boolean; } } - /* end of VLAN_INTERFACE_LIST */ + /* end of VLAN_INTERFACE_IPPREFIX_LIST */ } /* end of VLAN_INTERFACE container */ @@ -182,13 +193,15 @@ module sonic-vlan { leaf name { type string { - pattern 'Vlan(409[0-5]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{2}|[1-9][0-9]|[1-9])'; + pattern 'Vlan(409[0-5]|40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{2}|[1-9][0-9]|[2-9])'; } } - leaf vlanid { type uint16 { - range 1..4094; + range 2..4094; + } + must "substring-after(../name, 'Vlan') = current()"{ + error-message "The vlanid must correspond to the VLAN name"; } } @@ -243,7 +256,6 @@ module sonic-vlan { path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name"; } } - leaf port { /* key elements are mandatory by default */ type union { @@ -254,17 +266,29 @@ module sonic-vlan { path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name"; } } + must "not(/sms:sonic-mirror-session/sms:MIRROR_SESSION/sms:MIRROR_SESSION_LIST[sms:dst_port=current()])" + { + error-message "Port is used as a destination port in a mirror session."; + } + must "not(/lag:sonic-portchannel/lag:PORTCHANNEL_MEMBER/lag:PORTCHANNEL_MEMBER_LIST[lag:port=current()]/lag:name)" { + error-message "Port is a member of a port channel."; + } + must "not(/intf:sonic-interface/intf:INTERFACE/intf:INTERFACE_LIST[intf:name=current()])" { + error-message "Port is a router interface."; + } + must "count(../../vlan:VLAN_MEMBER_LIST[vlan:port=current() and vlan:tagging_mode='untagged']) <= 1" { + error-message "Port can be untagged in at most one VLAN."; + } } - leaf tagging_mode { mandatory true; type stypes:vlan_tagging_mode; } } - /* end of list VLAN_MEMBER_LIST */ + /* end of list VLAN_MEMBER_LIST */ } - /* end of container VLAN_MEMBER */ + /* end of container VLAN_MEMBER */ } - /* end of container sonic-vlan */ + /* end of container sonic-vlan */ } /* end of module sonic-vlan */ From de18ccc08d3e9de5c7ae8ce7489114eb5f5b06d8 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Sat, 18 May 2024 20:53:12 -0700 Subject: [PATCH 131/282] [doc]: add 202311 build badge (#19002) Signed-off-by: Guohan Lu --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 1fbcb128c539..36a91619dde5 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,17 @@ [![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=master&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=master) [![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=master&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=master) +*202311 builds*: + +[![Broadcom](https://dev.azure.com/mssonic/build/_apis/build/status/broadcom/Azure.sonic-buildimage.official.broadcom?branchName=202311&label=Broadcom)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=138&branchName=202311) +[![Centec](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec?branchName=202311&label=Centec)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=143&branchName=202311) +[![Centec(arm64)](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec-arm64?branchName=202311&label=Centec-arm64)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=140&branchName=202311) +[![Innovium](https://dev.azure.com/mssonic/build/_apis/build/status/innovium/Azure.sonic-buildimage.official.innovium?branchName=202311&label=Innovium)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=148&branchName=202311) +[![Mellanox](https://dev.azure.com/mssonic/build/_apis/build/status/mellanox/Azure.sonic-buildimage.official.mellanox?branchName=202311&label=Mellanox)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=139&branchName=202311) +[![Marvell(armhf)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-armhf?branchName=202311&label=Marvell-armhf)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=141&branchName=202311) +[![Marvell(arm64)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-arm64?branchName=202311&label=Marvell-arm64)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=999&branchName=202311) +[![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=202311&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=202311) + *202305 builds*: [![Barefoot](https://dev.azure.com/mssonic/build/_apis/build/status/barefoot/Azure.sonic-buildimage.official.barefoot?branchName=202205&label=Barefoot)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=146&branchName=202305) From a0b2f0ad38042c444239b81e0fc324c436eb0a6b Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Sat, 18 May 2024 23:43:38 -0700 Subject: [PATCH 132/282] [doc]: add pensando master build badge (#19003) remove barefoot master build badge as it is no longer supported. Signed-off-by: Guohan Lu --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36a91619dde5..ae76a8937316 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ *master builds*: -[![Barefoot](https://dev.azure.com/mssonic/build/_apis/build/status/barefoot/Azure.sonic-buildimage.official.barefoot?branchName=master&label=Barefoot)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=146&branchName=master) [![Broadcom](https://dev.azure.com/mssonic/build/_apis/build/status/broadcom/Azure.sonic-buildimage.official.broadcom?branchName=master&label=Broadcom)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=138&branchName=master) [![Centec](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec?branchName=master&label=Centec)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=143&branchName=master) [![Centec(arm64)](https://dev.azure.com/mssonic/build/_apis/build/status/centec/Azure.sonic-buildimage.official.centec-arm64?branchName=master&label=Centec-arm64)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=140&branchName=master) @@ -9,6 +8,7 @@ [![Marvell(armhf)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-armhf?branchName=master&label=Marvell-armhf)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=141&branchName=master) [![Marvell(arm64)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-arm64?branchName=master&label=Marvell-arm64)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=999&branchName=master) [![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=master&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=master) +[![Pensando](https://dev.azure.com/mssonic/build/_apis/build/status/pensando/Azure.sonic-buildimage.official.pensando?branchName=master&label=Pensando)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=1366&branchName=master) [![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=master&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=master) *202311 builds*: From 6164d586ffaeabea175e05993855dc0fea41b623 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Sun, 19 May 2024 09:59:20 +0300 Subject: [PATCH 133/282] [Build]: fix DPKG cache for frr (#17475) Fix #16713 Variable SMDEP_FILES is empty and smdep file is not generated for sonic-frr. --- rules/frr.dep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/frr.dep b/rules/frr.dep index d113202cf30a..0e23860fcb29 100644 --- a/rules/frr.dep +++ b/rules/frr.dep @@ -9,7 +9,7 @@ DEP_FILES += $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files |grep - FRR_SPATH := $(SPATH)/frr SMDEP_FILES := $(addprefix $(FRR_SPATH)/,$(shell cd $(FRR_SPATH) && git ls-files \ | grep -Ev -e 'debian/changelog$$$$' \ - -e "$(find -L tests/ -xtype l)" \ + -e "$$(find -L tests/ -xtype l)" \ )) $(FRR)_CACHE_MODE := GIT_CONTENT_SHA From 3b3fa200aba2988bc59750800865e469c49e1b6d Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Sun, 19 May 2024 10:01:13 +0300 Subject: [PATCH 134/282] [build]: execute make reset only once (#17644) It's enough to execute make reset only once. Now it's executed 3 times. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5318ce84cf47..ca2192f66fea 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ ifeq ($(NOBUSTER), 0) $(MAKE) -f Makefile.work bullseye endif -init: +init reset: @echo "+++ Making $@ +++" $(MAKE) -f Makefile.work $@ @@ -108,7 +108,7 @@ $(PLATFORM_PATH): configure : $(PLATFORM_PATH) $(call make_work, $@) -clean reset showtag docker-cleanup sonic-slave-build sonic-slave-bash : +clean showtag docker-cleanup sonic-slave-build sonic-slave-bash : $(call make_work, $@) # Freeze the versions, see more detail options: scripts/versions_manager.py freeze -h From d31e84ab348452e0f49bb5eff8740d21be29a057 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Sun, 19 May 2024 10:02:34 +0300 Subject: [PATCH 135/282] [build] enable pigz by default (#16959) Why I did it pigz, which stands for parallel implementation of gzip, is a fully functional replacement for gzip that exploits multiple processors and multiple cores to the hilt when compressing data. We can use it for compression instead of gzip to speed up builds. It reduces build time (especially at final stage where we compress whole file system). But solution with special option GZ_COMPRESS_PROGRAM is not good, because it's hard to maintain (developers need to pass this flag to every script). I think it's better to remove this option at all and use pigz directly where it's possible. How I did it Remove config flag GZ_COMPRESS_PROGRAM Use pigz directly instead of gzip where it's possible. How to verify it I have tested builds with pigz almost 1 year and no issues were detected. So I think it's better to enable it by default for all builds. If we found some issues we can always replace pigz with gzip. --- Makefile.work | 9 --------- build_debian.sh | 8 +++----- build_image.sh | 4 ++-- rules/config | 4 ---- slave.mk | 4 +--- sonic-slave-bookworm/Dockerfile.j2 | 3 ++- sonic-slave-bullseye/Dockerfile.j2 | 3 ++- sonic-slave-buster/Dockerfile.j2 | 3 ++- sonic-slave-stretch/Dockerfile.j2 | 3 ++- 9 files changed, 14 insertions(+), 27 deletions(-) diff --git a/Makefile.work b/Makefile.work index d66774ddcf28..58266149dbbb 100644 --- a/Makefile.work +++ b/Makefile.work @@ -54,9 +54,6 @@ # * ENABLE_BOOTCHART: Enable SONiC bootchart # * Default: n # * Values: y,n -# * GZ_COMPRESS_PROGRAM: Select pigz to reduce build time -# * Default: gzip -# * Values: pigz,gzip # * UNATTENDED: Don't wait for interactive input from terminal, setting this # * value to anything will enable it # * Default: unset @@ -157,10 +154,6 @@ ifeq ($(LEGACY_SONIC_MGMT_DOCKER),) override LEGACY_SONIC_MGMT_DOCKER = y endif -ifneq ($(GZ_COMPRESS_PROGRAM), pigz) -override GZ_COMPRESS_PROGRAM = gzip -endif - ifeq ($(CONFIGURED_ARCH),amd64) SLAVE_BASE_IMAGE = $(SLAVE_DIR) MULTIARCH_QEMU_ENVIRON = n @@ -229,7 +222,6 @@ $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \ INCLUDE_FIPS=$(INCLUDE_FIPS) \ DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) \ DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \ - GZ_COMPRESS_PROGRAM=$(GZ_COMPRESS_PROGRAM) \ j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile) $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \ @@ -587,7 +579,6 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ SONIC_SLAVE_DOCKER_DRIVER=$(SONIC_SLAVE_DOCKER_DRIVER) \ MIRROR_URLS=$(MIRROR_URLS) \ MIRROR_SECURITY_URLS=$(MIRROR_SECURITY_URLS) \ - GZ_COMPRESS_PROGRAM=$(GZ_COMPRESS_PROGRAM) \ MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \ SONIC_VERSION_CONTROL_COMPONENTS=$(SONIC_VERSION_CONTROL_COMPONENTS) \ ONIE_IMAGE_PART_SIZE=$(ONIE_IMAGE_PART_SIZE) \ diff --git a/build_debian.sh b/build_debian.sh index 2e054e71675f..a34f92c01a32 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -150,9 +150,7 @@ else fi ## docker and mkinitramfs on target system will use pigz/unpigz automatically -if [[ $GZ_COMPRESS_PROGRAM == pigz ]]; then - sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install pigz -fi +sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install pigz ## Install initramfs-tools and linux kernel ## Note: initramfs-tools recommends depending on busybox, and we really want busybox for @@ -879,8 +877,8 @@ if [[ $MULTIARCH_QEMU_ENVIRON == y || $CROSS_BUILD_ENVIRON == y ]]; then fi ## Compress docker files -pushd $FILESYSTEM_ROOT && sudo tar -I $GZ_COMPRESS_PROGRAM -cf $OLDPWD/$FILESYSTEM_DOCKERFS -C ${DOCKERFS_PATH}var/lib/docker .; popd +pushd $FILESYSTEM_ROOT && sudo tar -I pigz -cf $OLDPWD/$FILESYSTEM_DOCKERFS -C ${DOCKERFS_PATH}var/lib/docker .; popd ## Compress together with /boot, /var/lib/docker and $PLATFORM_DIR as an installer payload zip file -pushd $FILESYSTEM_ROOT && sudo tar -I $GZ_COMPRESS_PROGRAM -cf platform.tar.gz -C $PLATFORM_DIR . && sudo zip -n .gz $OLDPWD/$INSTALLER_PAYLOAD -r boot/ platform.tar.gz; popd +pushd $FILESYSTEM_ROOT && sudo tar -I pigz -cf platform.tar.gz -C $PLATFORM_DIR . && sudo zip -n .gz $OLDPWD/$INSTALLER_PAYLOAD -r boot/ platform.tar.gz; popd sudo zip -g -n .squashfs:.gz $INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS $FILESYSTEM_DOCKERFS diff --git a/build_image.sh b/build_image.sh index fe75bcaf332f..571febe5cbaa 100755 --- a/build_image.sh +++ b/build_image.sh @@ -60,10 +60,10 @@ generate_kvm_image() exit 1 } - $GZ_COMPRESS_PROGRAM $KVM_IMAGE_DISK + pigz $KVM_IMAGE_DISK [ -r $KVM_IMAGE_DISK.gz ] || { - echo "Error : $GZ_COMPRESS_PROGRAM $KVM_IMAGE_DISK failed!" + echo "Error : pigz $KVM_IMAGE_DISK failed!" exit 1 } diff --git a/rules/config b/rules/config index 2996d0f46f35..c54424c569cb 100644 --- a/rules/config +++ b/rules/config @@ -307,10 +307,6 @@ ENABLE_FIPS ?= n # SONIC_SLAVE_DOCKER_DRIVER - set the sonic slave docker storage driver SONIC_SLAVE_DOCKER_DRIVER ?= vfs -# GZ_COMPRESS_PROGRAM - select pigz (a parallel implementation of gzip) to reduce a build time -# and speed up a decompression of docker images on target system -GZ_COMPRESS_PROGRAM ?= gzip - # SONIC_OS_VERSION - sonic os version SONIC_OS_VERSION ?= 12 diff --git a/slave.mk b/slave.mk index 783ca1ac0b75..b6eb08fee051 100644 --- a/slave.mk +++ b/slave.mk @@ -92,7 +92,6 @@ export DOCKER_BASE_ARCH export CROSS_BUILD_ENVIRON export BLDENV export BUILD_WORKDIR -export GZ_COMPRESS_PROGRAM export MIRROR_SNAPSHOT export SONIC_OS_VERSION export FILES_PATH @@ -461,7 +460,6 @@ ifeq ($(CONFIGURED_PLATFORM),vs) $(info "BUILD_MULTIASIC_KVM" : "$(BUILD_MULTIASIC_KVM)") endif $(info "CROSS_BUILD_ENVIRON" : "$(CROSS_BUILD_ENVIRON)") -$(info "GZ_COMPRESS_PROGRAM" : "$(GZ_COMPRESS_PROGRAM)") $(info "LEGACY_SONIC_MGMT_DOCKER" : "$(LEGACY_SONIC_MGMT_DOCKER)") $(info "INCLUDE_EXTERNAL_PATCHES" : "$(INCLUDE_EXTERNAL_PATCHES)") $(info "PTF_ENV_PY_VER" : "$(PTF_ENV_PY_VER)") @@ -553,7 +551,7 @@ define docker-image-save @echo "Tagging docker image $(1)-$(DOCKER_USERNAME):$(DOCKER_USERTAG) as $(1):$(call docker-get-tag,$(1))" $(LOG) docker tag $(1)-$(DOCKER_USERNAME):$(DOCKER_USERTAG) $(1):$(call docker-get-tag,$(1)) $(LOG) @echo "Saving docker image $(1):$(call docker-get-tag,$(1))" $(LOG) - docker save $(1):$(call docker-get-tag,$(1)) | $(GZ_COMPRESS_PROGRAM) -c > $(2) + docker save $(1):$(call docker-get-tag,$(1)) | pigz -c > $(2) if [ x$(SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD) == x"y" ]; then @echo "Removing docker image $(1):$(call docker-get-tag,$(1))" $(LOG) docker rmi -f $(1):$(call docker-get-tag,$(1)) $(LOG) diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 2c1b0e375f68..05f282f61e15 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -88,7 +88,8 @@ RUN apt-get update && apt-get install -y \ curl \ wget \ unzip \ - {{ GZ_COMPRESS_PROGRAM }} \ + gzip \ + pigz \ git \ build-essential \ remake \ diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 2e9a3b2e6db6..a0b453d4d89d 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -94,7 +94,8 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install curl \ wget \ unzip \ - {{ GZ_COMPRESS_PROGRAM }} \ + gzip \ + pigz \ git \ build-essential \ remake \ diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index ac4108fac0b9..151df8243ed3 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -90,7 +90,8 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install curl \ wget \ unzip \ - {{ GZ_COMPRESS_PROGRAM }} \ + gzip \ + pigz \ git \ build-essential \ remake \ diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index 5d2d345e23a9..280c8404aba2 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -23,7 +23,8 @@ RUN apt-get update && apt-get install -y \ curl \ wget \ unzip \ - {{ GZ_COMPRESS_PROGRAM }} \ + gzip \ + pigz \ git \ build-essential \ libtool \ From 881abd309a2968ef3c89a763a70f7225fbc495d6 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Sun, 19 May 2024 10:08:06 +0300 Subject: [PATCH 136/282] enable MIRROR_SNAPSHOT if SONIC_VERSION_CONTROL_COMPONENTS includes deb (#17148) Fix #17113 If we set MIRROR_SNAPSHOT=y in build_mirror_config.sh then we have incorrect value of MIRROR_SNAPSHOT in other places like buildinfo/config/buildinfo.config How I did it Override MIRROR_SNAPSHOT=y in rules/config if SONIC_VERSION_CONTROL_COMPONENTS=all or SONIC_VERSION_CONTROL_COMPONENTS includes deb component. How to verify it Start to build with different values of SONIC_VERSION_CONTROL_COMPONENTS and MIRROR_SNAPSHOT in cmdline and check value of MIRROR_SNAPSHOT in buildinfo.config and debian mirrors in sources.list files --- rules/config | 8 ++++++++ scripts/build_mirror_config.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/rules/config b/rules/config index c54424c569cb..d081fd5aab91 100644 --- a/rules/config +++ b/rules/config @@ -262,6 +262,14 @@ TRUSTED_GPG_URLS = https://packages.trafficmanager.net/debian/public_key.gpg,htt # docker: docker base images SONIC_VERSION_CONTROL_COMPONENTS ?= none +ifeq ($(SONIC_VERSION_CONTROL_COMPONENTS),all) +override MIRROR_SNAPSHOT = y +endif + +ifneq (,$(findstring deb,$(SONIC_VERSION_CONTROL_COMPONENTS))) +override MIRROR_SNAPSHOT = y +endif + # MIRROR_SNAPSHOT - support mirror snapshot flag MIRROR_SNAPSHOT ?= n diff --git a/scripts/build_mirror_config.sh b/scripts/build_mirror_config.sh index 971390d0045f..be67052ced4c 100755 --- a/scripts/build_mirror_config.sh +++ b/scripts/build_mirror_config.sh @@ -11,7 +11,7 @@ export APT_RETRIES_COUNT DEFAULT_MIRROR_URL_PREFIX=http://packages.trafficmanager.net MIRROR_VERSION_FILE= -[[ "$SONIC_VERSION_CONTROL_COMPONENTS" == *deb* || $SONIC_VERSION_CONTROL_COMPONENTS == *all* ]] && MIRROR_VERSION_FILE=files/build/versions/default/versions-mirror && MIRROR_SNAPSHOT=y +[[ "$SONIC_VERSION_CONTROL_COMPONENTS" == *deb* || $SONIC_VERSION_CONTROL_COMPONENTS == *all* ]] && MIRROR_VERSION_FILE=files/build/versions/default/versions-mirror [ -f target/versions/default/versions-mirror ] && MIRROR_VERSION_FILE=target/versions/default/versions-mirror # The default mirror urls From 60b1440f58476278d771b2a1d5e0044297985db7 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Sun, 19 May 2024 10:18:26 +0300 Subject: [PATCH 137/282] [Build]: Fix dpkg lock (#15735) Fix #15722 We don't need to use a lock file every time we call dpkg. For some commands, like dpkg --print-architecture or dpkg --compare-versions, this action is not required. Moreover, sometimes these commands are called by apt-get and dpkg -i, and we get a deadlock in this case. How I did it Use dpkg lock only for dpkg commands that use /var/lib/dpkg/lock or /var/lib/dpkg/lock-frontend. I mean dpkg -i, dpkg -P, ... How to verify it Check there is no dpkg lock errors in build log. Check build time of docker-sonic-vs.gz: old: 08:57:14[ building ] [ target/docker-sonic-vs.gz ] 09:12:47 [ finished ] [ target/docker-sonic-vs.gz ] new: 01:45:12[ building ] [ target/docker-sonic-vs.gz ] 01:50:39 [ finished ] [ target/docker-sonic-vs.gz ] --- src/sonic-build-hooks/hooks/dpkg | 13 +++----- .../scripts/buildinfo_base.sh | 33 +++++++++++++++++++ 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/sonic-build-hooks/hooks/dpkg b/src/sonic-build-hooks/hooks/dpkg index 294cb19f4c1f..da810d2acb6e 100755 --- a/src/sonic-build-hooks/hooks/dpkg +++ b/src/sonic-build-hooks/hooks/dpkg @@ -2,17 +2,14 @@ . /usr/local/share/buildinfo/scripts/buildinfo_base.sh REAL_COMMAND=$(get_command dpkg) -COMMAND_INFO="Locked by command: $REAL_COMMAND $@" -NEED_RELEASE_LOCK=n -if [[ "$DPKG_HOOK_LOCKED" != "y" ]];then +COMMAND_INFO="Locked by command: $REAL_COMMAND $*" +DPKG_NEED_LOCK=$(check_dpkg_need_lock "$@") + +if [ "$DPKG_NEED_LOCK" == "y" ]; then lock_result=$(acquire_apt_installation_lock "$COMMAND_INFO" ) - export DPKG_HOOK_LOCKED=y - NEED_RELEASE_LOCK=y fi + $REAL_COMMAND "$@" command_result=$? -if [[ "$NEED_RELEASE_LOCK" == "y" ]];then - unset DPKG_HOOK_LOCKED -fi [ "$lock_result" == y ] && release_apt_installation_lock exit $command_result diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index bb64a2466bfc..9adcb1d3b500 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -388,6 +388,39 @@ check_apt_install() done } +# Check if we need to use apt_installation_lock for this dpkg command +check_dpkg_need_lock() +{ + for para in "$@" + do + if [ "$para" == "-i" ] || [ "$para" == "--install" ]; then + echo y + break + fi + + if [ "$para" == "-P" ] || [ "$para" == "--purge" ]; then + echo y + break + fi + + if [ "$para" == "-r" ] || [ "$para" == "--remove" ]; then + echo y + break + fi + + if [ "$para" == "--unpack" ] || [ "$para" == "--configure" ]; then + echo y + break + fi + + if [ "$para" == "--update-avail" ] || [ "$para" == "--merge-avail" ] || [ "$para" == "--clear-avail" ]; then + echo y + break + fi + + done +} + # Print warning message if a debian package version not specified when debian version control enabled. check_apt_version() { From 021a383bd0839ba212965036318653fcdc5515e4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 19 May 2024 16:01:02 +0800 Subject: [PATCH 138/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19000) #### Why I did it src/sonic-swss ``` * 536f43a9 - (HEAD -> master, origin/master, origin/HEAD) [Orchagent] Recursive nexthop group enhancement (#3105) (10 hours ago) [Utpal] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 84ce1a7c9cf5..536f43a93900 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 84ce1a7c9cf50bf6719d710f3ee3e5286998bf8b +Subproject commit 536f43a93900c4d684f9defea922d495b6157be9 From 1b0e40762c0536ebebaf1d3f8541479893620409 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 19 May 2024 16:01:13 +0800 Subject: [PATCH 139/282] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#18992) #### Why I did it src/sonic-host-services ``` * 246f2d2 - (HEAD -> master, origin/master, origin/HEAD) Added a try block to prevent JSON decoder errors (#126) (30 hours ago) [Ashwin Srinivasan] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index 10bfa901a78d..246f2d2e6299 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 10bfa901a78d678edc7ed00187f7d97870b22e26 +Subproject commit 246f2d2e629947c1f77a9caa8fd6bfd0725b1a77 From 11b80b110a9f99c898bf8587f2c32a09a49d3d3b Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Sun, 19 May 2024 09:41:36 -0700 Subject: [PATCH 140/282] [redis]: Update save disable code for new Redis version (#18979) With the upgrade of docker-database to Bookworm and the new Redis version that was brought in, database saves are enabled by default. However, we don't use (and maybe don't want, at this time) those database saves. Restore the old behavior by modifying `/etc/redis/redis.conf` to not save at all. Signed-off-by: Saikrishna Arcot --- dockers/docker-database/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-database/Dockerfile.j2 b/dockers/docker-database/Dockerfile.j2 index b73762da59e1..6f39d0ac5f58 100644 --- a/dockers/docker-database/Dockerfile.j2 +++ b/dockers/docker-database/Dockerfile.j2 @@ -28,7 +28,7 @@ RUN apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ rm -rf /debs ~/.cache && \ - sed -ri 's/^(save .*$)/# \1/g; \ + sed -ri 's/^# save ""$/save ""/g; \ s/^daemonize yes$/daemonize no/; \ s/^logfile .*$/logfile ""/; \ s/^# syslog-enabled no$/syslog-enabled no/; \ From 1da090aa3c84fdd91d4bbb211a4611dda007c94a Mon Sep 17 00:00:00 2001 From: Yutong Zhang <90831468+yutongzhang-microsoft@users.noreply.github.com> Date: Mon, 20 May 2024 16:07:09 +0800 Subject: [PATCH 141/282] Add a separate non-blocking PR check for onboarding new tests(T0). (#18944) We are going to onboard a batch of test cases into PR test recently. To achieve this without disrupting the existing PR test processes, we add a separate non-blocking PR checker for onboarding new tests. --- azure-pipelines.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cafd813e5e92..b87dfc41c0b1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -261,6 +261,21 @@ stages: MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) MGMT_BRANCH: $(BUILD_BRANCH) + - job: onboarding_elastictest_t0 + displayName: "onboarding testcases by Elastictest" + timeoutInMinutes: 240 + continueOnError: true + pool: ubuntu-20.04 + steps: + - template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt + parameters: + TOPOLOGY: t0 + MIN_WORKER: $(T0_ONBOARDING_SONIC_INSTANCE_NUM) + MAX_WORKER: $(T0_ONBOARDING_SONIC_INSTANCE_NUM) + KVM_IMAGE_BRANCH: $(BUILD_BRANCH) + MGMT_BRANCH: $(BUILD_BRANCH) + TEST_SET: onboarding_t0 + # - job: wan_elastictest # displayName: "kvmtest-wan by Elastictest" From db50ce970d017d4684762b3ef93a30e80ef71caa Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Tue, 21 May 2024 10:32:56 +0800 Subject: [PATCH 142/282] [build] docker-gnmi is migrate to bookworm. Fix the dependency. (#19011) Why I did it docker-telemetry depends on gnmi. gnmi migrates from bullseye to bookworm. It breaks the build for docker telemetry. Work item tracking Microsoft ADO (number only): 28133591 How I did it How to verify it --- rules/docker-telemetry.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/docker-telemetry.mk b/rules/docker-telemetry.mk index 8f2324080ca6..4ccd2781b014 100644 --- a/rules/docker-telemetry.mk +++ b/rules/docker-telemetry.mk @@ -16,7 +16,7 @@ $(DOCKER_TELEMETRY)_PACKAGE_NAME = telemetry $(DOCKER_TELEMETRY)_DBG_IMAGE_PACKAGES = $($(DOCKER_GNMI)_DBG_IMAGE_PACKAGES) SONIC_DOCKER_IMAGES += $(DOCKER_TELEMETRY) -SONIC_BULLSEYE_DOCKERS += $(DOCKER_TELEMETRY) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_TELEMETRY) ifeq ($(INCLUDE_SYSTEM_TELEMETRY), y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_TELEMETRY) endif From 7eb6cd81b6cb1537d4e5e20bcb21984c8553594e Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Tue, 21 May 2024 12:04:55 +0800 Subject: [PATCH 143/282] [bgp] Remove unnecessary print in bgpcfd ut (#19010) Why I did it Remove unnecessary print introduced by #18764 Work item tracking Microsoft ADO (number only): 27801007 How I did it Remove unnecessary print introduced by #18764 How to verify it UT passed --- src/sonic-bgpcfgd/tests/test_sonic-cfggen.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py index b5685b7332f0..acbd3b53cc2f 100644 --- a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py +++ b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py @@ -24,9 +24,6 @@ def run_test(name, template_path, json_path, match_path): with open(match_path) as result_fp: raw_saved_result = result_fp.read() canonical_saved_result = ConfigMgr.to_canonical(raw_saved_result) - print(canonical_generated_result) - print("----") - print(canonical_saved_result) assert canonical_saved_result == canonical_generated_result, "Test %s" % name From bf556c5cd72b328692403756d35972a28211ad39 Mon Sep 17 00:00:00 2001 From: Yuanzhe <150663541+yuazhe@users.noreply.github.com> Date: Tue, 21 May 2024 13:52:33 +0800 Subject: [PATCH 144/282] [Mellanox] Fix 4600c sensors.conf inverted psu number designation (#18722) - Why I did it This PR is used to standardize several sensors.conf psu section I. Fix 4600/4600c inverted psu number designation II. Fix 5600 second psu miss set_power_cap label III. Standardized comments - How to verify it check sensors command output Signed-off-by: Yuanzhe, Liu --- .../x86_64-mlnx_msn2010-r0/sensors.conf | 2 +- .../x86_64-mlnx_msn4600-r0/sensors.conf | 28 +++++++-------- .../x86_64-mlnx_msn4600c-r0/sensors.conf | 34 +++++++++---------- .../sensors_respin.conf | 34 +++++++++---------- .../x86_64-nvidia_sn2201-r0/sensors.conf | 2 +- .../x86_64-nvidia_sn5600-r0/sensors.conf | 1 + 6 files changed, 51 insertions(+), 50 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf index 9bcfcbe21138..92d742c18453 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf @@ -15,7 +15,7 @@ bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "lm75-i2c-*-4b" label temp1 "Ambient Fan Side Temp (air intake)" -# Power supplies +# Power controllers bus "i2c-5" "i2c-1-mux (chan_id 4)" chip "tps53679-i2c-*-70" label in1 "PMIC-1 PSU 12V Rail (in1)" diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf index 8443e1b11c82..4c374a839be9 100644 --- a/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf @@ -162,20 +162,6 @@ bus "i2c-15" "i2c-1-mux (chan_id 6)" # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" - label in1 "PSU-1(L) 220V Rail (in)" - ignore in2 - label in3 "PSU-1(L) 12V Rail (out)" - label fan1 "PSU-1(L) Fan 1" - ignore fan2 - ignore fan3 - label temp1 "PSU-1(L) Temp 1" - label temp2 "PSU-1(L) Temp 2" - label temp3 "PSU-1(L) Temp 3" - label power1 "PSU-1(L) 220V Rail Pwr (in)" - label power2 "PSU-1(L) 12V Rail Pwr (out)" - label curr1 "PSU-1(L) 220V Rail Curr (in)" - label curr2 "PSU-1(L) 12V Rail Curr (out)" - chip "dps460-i2c-*-59" label in1 "PSU-2(R) 220V Rail (in)" ignore in2 label in3 "PSU-2(R) 12V Rail (out)" @@ -189,6 +175,20 @@ bus "i2c-4" "i2c-1-mux (chan_id 3)" label power2 "PSU-2(R) 12V Rail Pwr (out)" label curr1 "PSU-2(R) 220V Rail Curr (in)" label curr2 "PSU-2(R) 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" # Chassis fans chip "mlxreg_fan-isa-*" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf index 02f811b6c795..4f60ceb02167 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf @@ -220,23 +220,6 @@ bus "i2c-15" "i2c-1-mux (chan_id 6)" # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" - label in1 "PSU-1(L) 220V Rail (in)" - ignore in2 - label in3 "PSU-1(L) 12V Rail (out)" - label fan1 "PSU-1(L) Fan 1" - ignore fan2 - ignore fan3 - label temp1 "PSU-1(L) Temp 1" - label temp2 "PSU-1(L) Temp 2" - label temp3 "PSU-1(L) Temp 3" - label power1 "PSU-1(L) 220V Rail Pwr (in)" - label power2 "PSU-1(L) 12V Rail Pwr (out)" - label curr1 "PSU-1(L) 220V Rail Curr (in)" - label curr2 "PSU-1(L) 12V Rail Curr (out)" - set in3_lcrit in3_crit * 0.662 - set in3_min in3_crit * 0.745 - set in3_max in3_crit * 0.952 - chip "dps460-i2c-*-59" label in1 "PSU-2(R) 220V Rail (in)" ignore in2 label in3 "PSU-2(R) 12V Rail (out)" @@ -253,6 +236,23 @@ bus "i2c-4" "i2c-1-mux (chan_id 3)" set in3_lcrit in3_crit * 0.662 set in3_min in3_crit * 0.745 set in3_max in3_crit * 0.952 + chip "dps460-i2c-*-59" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + set in3_lcrit in3_crit * 0.662 + set in3_min in3_crit * 0.745 + set in3_max in3_crit * 0.952 # Chassis fans chip "mlxreg_fan-isa-*" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf index 4cf7b71ef80b..0e346b31e28f 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf @@ -255,23 +255,6 @@ bus "i2c-15" "i2c-1-mux (chan_id 6)" # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" - label in1 "PSU-1(L) 220V Rail (in)" - ignore in2 - label in3 "PSU-1(L) 12V Rail (out)" - label fan1 "PSU-1(L) Fan 1" - ignore fan2 - ignore fan3 - label temp1 "PSU-1(L) Temp 1" - label temp2 "PSU-1(L) Temp 2" - label temp3 "PSU-1(L) Temp 3" - label power1 "PSU-1(L) 220V Rail Pwr (in)" - label power2 "PSU-1(L) 12V Rail Pwr (out)" - label curr1 "PSU-1(L) 220V Rail Curr (in)" - label curr2 "PSU-1(L) 12V Rail Curr (out)" - set in3_lcrit in3_crit * 0.662 - set in3_min in3_crit * 0.745 - set in3_max in3_crit * 0.952 - chip "dps460-i2c-*-59" label in1 "PSU-2(R) 220V Rail (in)" ignore in2 label in3 "PSU-2(R) 12V Rail (out)" @@ -288,6 +271,23 @@ bus "i2c-4" "i2c-1-mux (chan_id 3)" set in3_lcrit in3_crit * 0.662 set in3_min in3_crit * 0.745 set in3_max in3_crit * 0.952 + chip "dps460-i2c-*-59" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + set in3_lcrit in3_crit * 0.662 + set in3_min in3_crit * 0.745 + set in3_max in3_crit * 0.952 # Chassis fans chip "mlxreg_fan-isa-*" diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf index 908ebe7c1ccd..5024abd70017 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf @@ -130,7 +130,7 @@ bus "i2c-8" "i2c-1-mux (chan_id 6)" label in8 "MONITOR CPU Board V1P8" label in9 "MONITOR CPU Board V1P24" -# PSU PMBus sensors +# Power supplies bus "i2c-3" "i2c-1-mux (chan_id 1)" chip "pmbus-i2c-3-58" label in1 "PSU-1 220V Rail(in)" diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf index 2a78b7cd65f2..e64aabae645f 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf @@ -288,6 +288,7 @@ chip "dps460-i2c-*-5a" label power2 "PSU-2(R) 12V Rail Pwr (out)" label curr1 "PSU-2(R) 220V Rail Curr (in)" label curr2 "PSU-2(R) 12V Rail Curr (out)" + set power2_cap 0 # Power converters chip "pmbus-i2c-*-10" From 44d16d1fd950a51716e70a9c31d4c53b0a97e215 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Tue, 21 May 2024 21:57:28 +0800 Subject: [PATCH 145/282] [Mellanox] Avoid returning NoneType while reading 0 byte from SPF's EEPROM (#18964) - Why I did it Avoid returning NoneType while reading 0 byte from SFP's EEPROM In CMIS CDB it is possible to read 0 byte from SFP's EEPROM. It will throw an exception if the platform API returns' NoneType'. We would like to return bytearray(0) here to avoid such exceptions. Signed-off-by: Stephen Sun --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 2 +- platform/mellanox/mlnx-platform-api/tests/test_sfp.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 35d5904a12fe..e7874a658968 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -507,7 +507,7 @@ def _read_eeprom(self, offset, num_bytes, log_on_error=True): Returns: bytearray: the content of EEPROM """ - result = None + result = bytearray(0) while num_bytes > 0: _, page, page_offset = self._get_page_and_page_offset(offset) if not page: diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 98246c2959a4..92f5d0d51616 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -149,6 +149,8 @@ def test_sfp_read_eeprom(self, mock_get_page): mo = mock.mock_open() with mock.patch('sonic_platform.sfp.open', mo): handle = mo() + assert sfp.read_eeprom(0, 0) == bytearray(0) + handle.read.return_value = b'\x00' assert sfp.read_eeprom(0, 1) == bytearray([0]) handle.seek.assert_called_once_with(0) From 518c3bc7a9cf5293fcc2a0c76298f83073b1a974 Mon Sep 17 00:00:00 2001 From: Kumaresh Perumal Date: Tue, 21 May 2024 12:16:06 -0700 Subject: [PATCH 146/282] [swss]: Add default ECMP/LAG hash offset values for T0 and T1 (#18912) To avoid ECMP polarization, hash offset values are set from orchagent. Earlier, vendor SDK sets the hash_offset value internally with the same value as hash_seed. After introduction of SAI attributes(SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_OFFSET/SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_OFFSET), those changes in SDK were removed causing imbalance of traffic in T1s. This change will pass the ECMP/LAG HASH_OFFSET values from orchagent to SAI and set them in ASIC. Different ECMP/LAG hash_offset values are set for T0 and T1 in swss switch.json(ecmp_hash_offset and lag_hash_offset). Values are different for T0 and T1 to avoid ECMP/LAG hash polarization. As part of switch initialization, these values are passed to switch orchagent. Switch orchagent process these values and call SAI switch API to set these values. Will be merged after swss changes: sonic-net/sonic-swss#3138 sonic-mgmt - sonic-net/sonic-mgmt#12765 Microsoft ADO (number only): 25873808 --- dockers/docker-orchagent/switch.json.j2 | 6 ++++++ .../tests/sample_output/t0-switch-masic1.json | 2 ++ .../tests/sample_output/t0-switch-masic3.json | 2 ++ src/sonic-config-engine/tests/sample_output/t0-switch.json | 2 ++ src/sonic-config-engine/tests/sample_output/t1-switch.json | 2 ++ 5 files changed, 14 insertions(+) diff --git a/dockers/docker-orchagent/switch.json.j2 b/dockers/docker-orchagent/switch.json.j2 index 5816cecacc1f..565d6b5005e4 100644 --- a/dockers/docker-orchagent/switch.json.j2 +++ b/dockers/docker-orchagent/switch.json.j2 @@ -2,11 +2,15 @@ {# set default hash seed to 0 #} {% set hash_seed = 0 %} {% set hash_seed_offset = 0 %} +{% set ecmp_hash_offset_value = 0 %} +{% set lag_hash_offset_value = 0 %} {% if DEVICE_METADATA.localhost.type %} {% if "ToRRouter" in DEVICE_METADATA.localhost.type or DEVICE_METADATA.localhost.type in ["EPMS", "MgmtTsToR"] %} {% set hash_seed = 0 %} {% elif "LeafRouter" in DEVICE_METADATA.localhost.type %} {% set hash_seed = 10 %} +{% set ecmp_hash_offset_value = 10 %} +{% set lag_hash_offset_value = 10 %} {% elif "SpineRouter" in DEVICE_METADATA.localhost.type %} {% set hash_seed = 25 %} {% endif %} @@ -22,6 +26,8 @@ "ecmp_hash_seed": "{{ hash_seed_value }}", "lag_hash_seed": "{{ hash_seed_value }}", "fdb_aging_time": "600", + "ecmp_hash_offset": "{{ ecmp_hash_offset_value }}", + "lag_hash_offset": "{{ lag_hash_offset_value }}", {% if DEVICE_METADATA.localhost.type and "LeafRouter" in DEVICE_METADATA.localhost.type %} "ordered_ecmp": "true" {% else %} diff --git a/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json b/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json index 83ca9f50aed5..d64c5070fe0d 100644 --- a/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json +++ b/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json @@ -4,6 +4,8 @@ "ecmp_hash_seed": "11", "lag_hash_seed": "11", "fdb_aging_time": "600", + "ecmp_hash_offset": "10", + "lag_hash_offset": "10", "ordered_ecmp": "true" }, "OP": "SET" diff --git a/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json b/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json index db5d1b6e4aee..2f91d5664d57 100644 --- a/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json +++ b/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json @@ -4,6 +4,8 @@ "ecmp_hash_seed": "13", "lag_hash_seed": "13", "fdb_aging_time": "600", + "ecmp_hash_offset": "10", + "lag_hash_offset": "10", "ordered_ecmp": "true" }, "OP": "SET" diff --git a/src/sonic-config-engine/tests/sample_output/t0-switch.json b/src/sonic-config-engine/tests/sample_output/t0-switch.json index d585ca2a52f6..1dda7c549c4a 100644 --- a/src/sonic-config-engine/tests/sample_output/t0-switch.json +++ b/src/sonic-config-engine/tests/sample_output/t0-switch.json @@ -4,6 +4,8 @@ "ecmp_hash_seed": "0", "lag_hash_seed": "0", "fdb_aging_time": "600", + "ecmp_hash_offset": "0", + "lag_hash_offset": "0", "ordered_ecmp": "false" }, "OP": "SET" diff --git a/src/sonic-config-engine/tests/sample_output/t1-switch.json b/src/sonic-config-engine/tests/sample_output/t1-switch.json index 3b3b7959191b..bc5a02b2165a 100644 --- a/src/sonic-config-engine/tests/sample_output/t1-switch.json +++ b/src/sonic-config-engine/tests/sample_output/t1-switch.json @@ -4,6 +4,8 @@ "ecmp_hash_seed": "10", "lag_hash_seed": "10", "fdb_aging_time": "600", + "ecmp_hash_offset": "10", + "lag_hash_offset": "10", "ordered_ecmp": "true" }, "OP": "SET" From 8132fbad38f30b54291cb4c40955049b36c3d30e Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 22 May 2024 18:27:31 +0800 Subject: [PATCH 147/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19026) #### Why I did it src/sonic-swss ``` * a280e367 - (HEAD -> master, origin/master, origin/HEAD) [COPP]Fix coppmgr when there are multiple features using same trap (#3144) (10 hours ago) [Sudharsan Dhamal Gopalarathnam] * 1ff61602 - revert requests from 2.32.0 to 2.31.0 (#3154) (11 hours ago) [Liu Shilong] * 9e80dc82 - Update setHostTxReady() to receive Port instead of portId (#3133) (35 hours ago) [noaOrMlnx] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 536f43a93900..a280e367564c 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 536f43a93900c4d684f9defea922d495b6157be9 +Subproject commit a280e367564cce6d8138fe39a0ce031b516c5699 From 64646f43ff3b56ef26e1bf618b1933c35fb27d64 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 22 May 2024 18:27:41 +0800 Subject: [PATCH 148/282] [submodule] Update submodule sonic-mgmt-common to the latest HEAD automatically (#19024) #### Why I did it src/sonic-mgmt-common ``` * 1e12744 - (HEAD -> master, origin/master, origin/HEAD) Interface and Ethernet Counter support (#139) (31 hours ago) [Satoru Shinohara] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-mgmt-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-common b/src/sonic-mgmt-common index 328d8063c169..1e127441522a 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit 328d8063c1692ef402a15b5228b2a3c71b9dc53c +Subproject commit 1e127441522a2fab99fc5d102853baed209131d4 From c2b0c7b9e3ef411a8a9083cc207d7b8d4feae5dc Mon Sep 17 00:00:00 2001 From: noaOrMlnx <58519608+noaOrMlnx@users.noreply.github.com> Date: Wed, 22 May 2024 17:37:16 +0300 Subject: [PATCH 149/282] Add the ability to enable CMIS host mgmt. feature to Mellanox-SN4700-O8C48, Mellanox-SN4700-O8V48 SKUs (#18737) - Why I did it To enable CMIS host mgmt feature - How I did it Update information on the relevant fields on each SKU - How to verify it Load the system with the relevant SKU, verify CMIS host management is enabled, and per supported module check SW control is on. --- .../Mellanox-SN4700-O8C48/media_settings.json | 506 ++++++++++++++++++ .../optics_si_settings.json | 108 ++++ .../pmon_daemon_control.json | 6 + .../Mellanox-SN4700-O8V48/media_settings.json | 506 ++++++++++++++++++ .../optics_si_settings.json | 108 ++++ .../pmon_daemon_control.json | 6 + 6 files changed, 1240 insertions(+) create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json new file mode 100644 index 000000000000..372b1cb2861c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/media_settings.json @@ -0,0 +1,506 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "QSFP-DD-sm_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + }, + "speed:100GAUI-2": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa" + } + } + }, + "QSFP-DD-active_cable_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + }, + "speed:CAUI-4": { + "idriver": { + "lane0": "0x00000028", + "lane1": "0x00000028", + "lane2": "0x00000028", + "lane3": "0x00000028", + "lane4": "0x00000028", + "lane5": "0x00000028", + "lane6": "0x00000028", + "lane7": "0x00000028" + }, + "pre1": { + "lane0": "0xfffffff3", + "lane1": "0xfffffff3", + "lane2": "0xfffffff3", + "lane3": "0xfffffff3", + "lane4": "0xfffffff3", + "lane5": "0xfffffff3", + "lane6": "0xfffffff3", + "lane7": "0xfffffff3" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000033", + "lane1": "0x00000033", + "lane2": "0x00000033", + "lane3": "0x00000033", + "lane4": "0x00000033", + "lane5": "0x00000033", + "lane6": "0x00000033", + "lane7": "0x00000033" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_m2lp": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000050", + "lane1": "0x00000050", + "lane2": "0x00000050", + "lane3": "0x00000050", + "lane4": "0x00000050", + "lane5": "0x00000050", + "lane6": "0x00000050", + "lane7": "0x00000050" + }, + "obnlev": { + "lane0": "0x00000078", + "lane1": "0x00000078", + "lane2": "0x00000078", + "lane3": "0x00000078", + "lane4": "0x00000078", + "lane5": "0x00000078", + "lane6": "0x00000078", + "lane7": "0x00000078" + }, + "regn_bfm1p": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "regn_bfm1n": { + "lane0": "0x0000008c", + "lane1": "0x0000008c", + "lane2": "0x0000008c", + "lane3": "0x0000008c", + "lane4": "0x0000008c", + "lane5": "0x0000008c", + "lane6": "0x0000008c", + "lane7": "0x0000008c" + } + } + }, + "QSFP+-active_cable_media_interface": { + "speed:CAUI-4": { + "idriver": { + "lane0": "0x00000028", + "lane1": "0x00000028", + "lane2": "0x00000028", + "lane3": "0x00000028", + "lane4": "0x00000028", + "lane5": "0x00000028", + "lane6": "0x00000028", + "lane7": "0x00000028" + }, + "pre1": { + "lane0": "0xfffffff3", + "lane1": "0xfffffff3", + "lane2": "0xfffffff3", + "lane3": "0xfffffff3", + "lane4": "0xfffffff3", + "lane5": "0xfffffff3", + "lane6": "0xfffffff3", + "lane7": "0xfffffff3" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000033", + "lane1": "0x00000033", + "lane2": "0x00000033", + "lane3": "0x00000033", + "lane4": "0x00000033", + "lane5": "0x00000033", + "lane6": "0x00000033", + "lane7": "0x00000033" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_m2lp": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000050", + "lane1": "0x00000050", + "lane2": "0x00000050", + "lane3": "0x00000050", + "lane4": "0x00000050", + "lane5": "0x00000050", + "lane6": "0x00000050", + "lane7": "0x00000050" + }, + "obnlev": { + "lane0": "0x00000078", + "lane1": "0x00000078", + "lane2": "0x00000078", + "lane3": "0x00000078", + "lane4": "0x00000078", + "lane5": "0x00000078", + "lane6": "0x00000078", + "lane7": "0x00000078" + }, + "regn_bfm1p": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "regn_bfm1n": { + "lane0": "0x0000008c", + "lane1": "0x0000008c", + "lane2": "0x0000008c", + "lane3": "0x0000008c", + "lane4": "0x0000008c", + "lane5": "0x0000008c", + "lane6": "0x0000008c", + "lane7": "0x0000008c" + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json new file mode 100644 index 000000000000..bf71e818a869 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/optics_si_settings.json @@ -0,0 +1,108 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "50G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "25G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "10G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json new file mode 100644 index 000000000000..ac8cc05f63dc --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json @@ -0,0 +1,6 @@ +{ + "skip_ledd": true, + "skip_fancontrol": true, + "delay_xcvrd": true, + "skip_xcvrd_cmis_mgr": false +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json new file mode 100644 index 000000000000..372b1cb2861c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/media_settings.json @@ -0,0 +1,506 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "QSFP-DD-sm_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + }, + "speed:100GAUI-2": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa" + } + } + }, + "QSFP-DD-active_cable_media_interface": { + "speed:400GAUI-8": { + "idriver": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "pre1": { + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000020", + "lane1": "0x00000020", + "lane2": "0x00000020", + "lane3": "0x00000020", + "lane4": "0x00000020", + "lane5": "0x00000020", + "lane6": "0x00000020", + "lane7": "0x00000020" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006", + "lane4": "0x00000006", + "lane5": "0x00000006", + "lane6": "0x00000006", + "lane7": "0x00000006" + }, + "ob_m2lp": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "obnlev": { + "lane0": "0x0000005f", + "lane1": "0x0000005f", + "lane2": "0x0000005f", + "lane3": "0x0000005f", + "lane4": "0x0000005f", + "lane5": "0x0000005f", + "lane6": "0x0000005f", + "lane7": "0x0000005f" + }, + "regn_bfm1p": { + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "regn_bfm1n": { + "lane0": "0x000000aa", + "lane1": "0x000000aa", + "lane2": "0x000000aa", + "lane3": "0x000000aa", + "lane4": "0x000000aa", + "lane5": "0x000000aa", + "lane6": "0x000000aa", + "lane7": "0x000000aa" + } + }, + "speed:CAUI-4": { + "idriver": { + "lane0": "0x00000028", + "lane1": "0x00000028", + "lane2": "0x00000028", + "lane3": "0x00000028", + "lane4": "0x00000028", + "lane5": "0x00000028", + "lane6": "0x00000028", + "lane7": "0x00000028" + }, + "pre1": { + "lane0": "0xfffffff3", + "lane1": "0xfffffff3", + "lane2": "0xfffffff3", + "lane3": "0xfffffff3", + "lane4": "0xfffffff3", + "lane5": "0xfffffff3", + "lane6": "0xfffffff3", + "lane7": "0xfffffff3" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000033", + "lane1": "0x00000033", + "lane2": "0x00000033", + "lane3": "0x00000033", + "lane4": "0x00000033", + "lane5": "0x00000033", + "lane6": "0x00000033", + "lane7": "0x00000033" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_m2lp": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000050", + "lane1": "0x00000050", + "lane2": "0x00000050", + "lane3": "0x00000050", + "lane4": "0x00000050", + "lane5": "0x00000050", + "lane6": "0x00000050", + "lane7": "0x00000050" + }, + "obnlev": { + "lane0": "0x00000078", + "lane1": "0x00000078", + "lane2": "0x00000078", + "lane3": "0x00000078", + "lane4": "0x00000078", + "lane5": "0x00000078", + "lane6": "0x00000078", + "lane7": "0x00000078" + }, + "regn_bfm1p": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "regn_bfm1n": { + "lane0": "0x0000008c", + "lane1": "0x0000008c", + "lane2": "0x0000008c", + "lane3": "0x0000008c", + "lane4": "0x0000008c", + "lane5": "0x0000008c", + "lane6": "0x0000008c", + "lane7": "0x0000008c" + } + } + }, + "QSFP+-active_cable_media_interface": { + "speed:CAUI-4": { + "idriver": { + "lane0": "0x00000028", + "lane1": "0x00000028", + "lane2": "0x00000028", + "lane3": "0x00000028", + "lane4": "0x00000028", + "lane5": "0x00000028", + "lane6": "0x00000028", + "lane7": "0x00000028" + }, + "pre1": { + "lane0": "0xfffffff3", + "lane1": "0xfffffff3", + "lane2": "0xfffffff3", + "lane3": "0xfffffff3", + "lane4": "0xfffffff3", + "lane5": "0xfffffff3", + "lane6": "0xfffffff3", + "lane7": "0xfffffff3" + }, + "pre2": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "main": { + "lane0": "0x00000033", + "lane1": "0x00000033", + "lane2": "0x00000033", + "lane3": "0x00000033", + "lane4": "0x00000033", + "lane5": "0x00000033", + "lane6": "0x00000033", + "lane7": "0x00000033" + }, + "post1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_m2lp": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "ob_alev_out": { + "lane0": "0x0000000f", + "lane1": "0x0000000f", + "lane2": "0x0000000f", + "lane3": "0x0000000f", + "lane4": "0x0000000f", + "lane5": "0x0000000f", + "lane6": "0x0000000f", + "lane7": "0x0000000f" + }, + "obplev": { + "lane0": "0x00000050", + "lane1": "0x00000050", + "lane2": "0x00000050", + "lane3": "0x00000050", + "lane4": "0x00000050", + "lane5": "0x00000050", + "lane6": "0x00000050", + "lane7": "0x00000050" + }, + "obnlev": { + "lane0": "0x00000078", + "lane1": "0x00000078", + "lane2": "0x00000078", + "lane3": "0x00000078", + "lane4": "0x00000078", + "lane5": "0x00000078", + "lane6": "0x00000078", + "lane7": "0x00000078" + }, + "regn_bfm1p": { + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "regn_bfm1n": { + "lane0": "0x0000008c", + "lane1": "0x0000008c", + "lane2": "0x0000008c", + "lane3": "0x0000008c", + "lane4": "0x0000008c", + "lane5": "0x0000008c", + "lane6": "0x0000008c", + "lane7": "0x0000008c" + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json new file mode 100644 index 000000000000..bf71e818a869 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/optics_si_settings.json @@ -0,0 +1,108 @@ +{ + "GLOBAL_MEDIA_SETTINGS": { + "1-32": { + "50G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "25G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + }, + "10G_SPEED": { + "Default": { + "OutputAmplitudeTargetRx": { + "OutputAmplitudeTargetRx1": 0, + "OutputAmplitudeTargetRx2": 0, + "OutputAmplitudeTargetRx3": 0, + "OutputAmplitudeTargetRx4": 0, + "OutputAmplitudeTargetRx5": 0, + "OutputAmplitudeTargetRx6": 0, + "OutputAmplitudeTargetRx7": 0, + "OutputAmplitudeTargetRx8": 0 + }, + "OutputEqPreCursorTargetRx": { + "OutputEqPreCursorTargetRx1": 0, + "OutputEqPreCursorTargetRx2": 0, + "OutputEqPreCursorTargetRx3": 0, + "OutputEqPreCursorTargetRx4": 0, + "OutputEqPreCursorTargetRx5": 0, + "OutputEqPreCursorTargetRx6": 0, + "OutputEqPreCursorTargetRx7": 0, + "OutputEqPreCursorTargetRx8": 0 + }, + "OutputEqPostCursorTargetRx": { + "OutputEqPostCursorTargetRx1": 0, + "OutputEqPostCursorTargetRx2": 0, + "OutputEqPostCursorTargetRx3": 0, + "OutputEqPostCursorTargetRx4": 0, + "OutputEqPostCursorTargetRx5": 0, + "OutputEqPostCursorTargetRx6": 0, + "OutputEqPostCursorTargetRx7": 0, + "OutputEqPostCursorTargetRx8": 0 + } + } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json new file mode 100644 index 000000000000..ac8cc05f63dc --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json @@ -0,0 +1,6 @@ +{ + "skip_ledd": true, + "skip_fancontrol": true, + "delay_xcvrd": true, + "skip_xcvrd_cmis_mgr": false +} From 3a8ba71bc08dfebcded21ffd6af3feceb7c6f445 Mon Sep 17 00:00:00 2001 From: Vivek Date: Wed, 22 May 2024 08:42:41 -0700 Subject: [PATCH 150/282] Fix rasdaemon crash during bootup on AMD CPU (#19023) - Why I did it Booting SONiC on a AMD EPYC 16-Core CPU is causing rasdaemon to crash. This is not a major blocker because rasdaemon eventually restarts and is stable after a point. Coredump stack trace: [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `/usr/sbin/rasdaemon -f -r'. Program terminated with signal SIGBUS, Bus error. #0 0x00007f74f62af7f4 in sqlite3_finalize () from /lib/x86_64-linux-gnu/libsqlite3.so.0 [Current thread is 1 (Thread 0x7f73c8ff96c0 (LWP 17416))] Known issue for rasdaemon: mchehab/rasdaemon#77 Fixed here: mchehab/rasdaemon@f1ea763 Unfortunately this fix is not present in the default bookworm version. So, backported the fix and compiled rasdaemon from source Here is the patch: https://sources.debian.org/patches/rasdaemon/0.8.0-2/0001-Check-CPUs-online-not-configured.patch/ - How I did it - How to verify it Booted the image built with these changes and no issue in observed Signed-off-by: Vivek Reddy --- build_debian.sh | 6 --- .../build_templates/sonic_debian_extension.j2 | 5 +++ rules/rasdaemon.dep | 10 +++++ rules/rasdaemon.mk | 8 ++++ slave.mk | 1 + sonic-slave-bookworm/Dockerfile.j2 | 3 ++ ...001-Check-CPUs-online-not-configured.patch | 38 +++++++++++++++++++ src/rasdaemon/Makefile | 23 +++++++++++ 8 files changed, 88 insertions(+), 6 deletions(-) create mode 100644 rules/rasdaemon.dep create mode 100644 rules/rasdaemon.mk create mode 100644 src/rasdaemon/0001-Check-CPUs-online-not-configured.patch create mode 100644 src/rasdaemon/Makefile diff --git a/build_debian.sh b/build_debian.sh index a34f92c01a32..352c642caecf 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -420,12 +420,6 @@ EOF # override tcpdump profile to allow tcpdump access TACACS config file. sudo cp files/apparmor/usr.bin.tcpdump $FILESYSTEM_ROOT/etc/apparmor.d/local/usr.bin.tcpdump -if [[ $CONFIGURED_ARCH == amd64 ]]; then -## Pre-install the fundamental packages for amd64 (x86) -sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install \ - rasdaemon -fi - ## Set /etc/shadow permissions to -rw-------. sudo LANG=c chroot $FILESYSTEM_ROOT chmod 600 /etc/shadow diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 74865bf571e0..2557d2b6da9a 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -510,6 +510,11 @@ sudo cp $IMAGE_CONFIGS/corefile_uploader/core_analyzer.rc.json $FILESYSTEM_ROOT_ sudo chmod og-rw $FILESYSTEM_ROOT_ETC_SONIC/core_analyzer.rc.json if [[ $CONFIGURED_ARCH == amd64 ]]; then + # Install rasdaemon package + # NOTE: Can be installed from debian directly when we move to trixie + sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/rasdaemon_*.deb || \ + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f + # Rasdaemon service configuration. Use timer to start rasdaemon with a delay for better fast/warm boot performance sudo cp $IMAGE_CONFIGS/rasdaemon/rasdaemon.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT systemctl disable rasdaemon.service diff --git a/rules/rasdaemon.dep b/rules/rasdaemon.dep new file mode 100644 index 000000000000..40621f3054ba --- /dev/null +++ b/rules/rasdaemon.dep @@ -0,0 +1,10 @@ + +SPATH := $($(RASDAEMON)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/rasdaemon.mk rules/rasdaemon.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(SPATH)) + +$(RASDAEMON)_CACHE_MODE := GIT_CONTENT_SHA +$(RASDAEMON)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(RASDAEMON)_DEP_FILES := $(DEP_FILES) + diff --git a/rules/rasdaemon.mk b/rules/rasdaemon.mk new file mode 100644 index 000000000000..82486d6a151c --- /dev/null +++ b/rules/rasdaemon.mk @@ -0,0 +1,8 @@ +# rasdaemon package + +RASDAEMON_VERSION = 0.6.8-1 +export RASDAEMON_VERSION + +RASDAEMON = rasdaemon_$(RASDAEMON_VERSION)_$(CONFIGURED_ARCH).deb +$(RASDAEMON)_SRC_PATH = $(SRC_PATH)/rasdaemon +SONIC_MAKE_DEBS += $(RASDAEMON) diff --git a/slave.mk b/slave.mk index b6eb08fee051..29f6baa25694 100644 --- a/slave.mk +++ b/slave.mk @@ -1393,6 +1393,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_API_PY3)) \ $(if $(findstring y,$(PDDF_SUPPORT)),$(addprefix $(PYTHON_WHEELS_PATH)/,$(PDDF_PLATFORM_API_BASE_PY2))) \ $(if $(findstring y,$(PDDF_SUPPORT)),$(addprefix $(PYTHON_WHEELS_PATH)/,$(PDDF_PLATFORM_API_BASE_PY3))) \ + $(if $(findstring amd64,$(CONFIGURED_ARCH)),$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(RASDAEMON))) \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_YANG_MODELS_PY3)) \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CTRMGRD)) \ $(addprefix $(FILES_PATH)/,$($(SONIC_CTRMGRD)_FILES)) \ diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 05f282f61e15..56ced720bd08 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -337,6 +337,9 @@ RUN apt-get update && apt-get install -y \ qemu-kvm \ libvirt-clients \ python3-pexpect \ +# For rasdaemon build + libsqlite3-dev \ + libgettextpo-dev \ {%- endif %} # For ntp autogen \ diff --git a/src/rasdaemon/0001-Check-CPUs-online-not-configured.patch b/src/rasdaemon/0001-Check-CPUs-online-not-configured.patch new file mode 100644 index 000000000000..c7c703fdb0d4 --- /dev/null +++ b/src/rasdaemon/0001-Check-CPUs-online-not-configured.patch @@ -0,0 +1,38 @@ +From f1ea76375281001cdf4a048c1a4a24d86c6fbe48 Mon Sep 17 00:00:00 2001 +From: Zeph / Liz Loss-Cutler-Hull +Date: Sun, 9 Jul 2023 04:57:19 -0700 +Subject: [PATCH] Check CPUs online, not configured. + +When the number of CPUs detected is greater than the number of CPUs in +the system, rasdaemon will crash when it receives some events. + +Looking deeper, we also fail to use the poll method for similar reasons +in this case. + +All of this can be prevented by checking to see how many CPUs are +currently online (sysconf(_SC_NPROCESSORS_ONLN)) instead of how many +CPUs the current kernel was configured to support +(sysconf(_SC_NPROCESSORS_CONF)). + +For the kernel side of the discussion, see https://lore.kernel.org/lkml/CAM6Wdxft33zLeeXHhmNX5jyJtfGTLiwkQSApc=10fqf+rQh9DA@mail.gmail.com/T/ +Signed-off-by: Mauro Carvalho Chehab +--- + ras-events.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ras-events.c b/ras-events.c +index a82dab2..5935163 100644 +--- a/ras-events.c ++++ b/ras-events.c +@@ -350,7 +350,7 @@ static void parse_ras_data(struct pthread_data *pdata, struct kbuffer *kbuf, + + static int get_num_cpus(struct ras_events *ras) + { +- return sysconf(_SC_NPROCESSORS_CONF); ++ return sysconf(_SC_NPROCESSORS_ONLN); + #if 0 + char fname[MAX_PATH + 1]; + int num_cpus = 0; +-- +2.36.1 + diff --git a/src/rasdaemon/Makefile b/src/rasdaemon/Makefile new file mode 100644 index 000000000000..15e6bbebe809 --- /dev/null +++ b/src/rasdaemon/Makefile @@ -0,0 +1,23 @@ +.ONESHELL: +SHELL = /bin/bash +.SHELLFLAGS += -e + +MAIN_TARGET = rasdaemon_$(RASDAEMON_VERSION)_$(CONFIGURED_ARCH).deb + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + rm -rf rasdaemon/ + + # Checkout Repository + git clone https://salsa.debian.org/tai271828/rasdaemon.git -b debian/$(RASDAEMON_VERSION) + + pushd ./rasdaemon + # Patch + git apply ../0001-Check-CPUs-online-not-configured.patch +ifeq ($(CROSS_BUILD_ENVIRON), y) + dpkg-buildpackage -rfakeroot -b -us -uc -a$(CONFIGURED_ARCH) -Pcross,nocheck -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +else + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +endif + popd + + mv $* $(DEST)/ From 90ade42b81887c22f182eddef9368bc019589d8d Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 22 May 2024 23:52:59 +0800 Subject: [PATCH 151/282] [Mellanox] Block setting the watchdog in the case that watchdog period is longer than the max period supported by the platform #18980) - Why I did it Currently the platform API will arm the watchdog w/o checking the required watchdog period. If the watchdog period is longer than the max period supported by the platform, it will cause issue on some specific platform. - How I did it Verify whether the required watchdog period is longer than the max period supported, if yes then return failure. - How to verify it test with watchdog util to set the watchdog period to different values including larger than the max supported period, all case passed. Signed-off-by: Kebo Liu --- .../sonic_platform/device_data.py | 21 +++++++++++++++++++ .../sonic_platform/watchdog.py | 5 +++-- .../mlnx-platform-api/tests/test_watchdog.py | 4 +++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py index d6f846a30e7a..9ee37af9981d 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -21,6 +21,8 @@ from . import utils +DEFAULT_WD_PERIOD = 65535 + DEVICE_DATA = { 'x86_64-mlnx_msn2700-r0': { 'thermal': { @@ -54,6 +56,9 @@ "cpu_pack": False, "comex_amb": False } + }, + 'watchdog': { + "max_period": 32 } }, 'x86_64-mlnx_msn2410-r0': { @@ -69,6 +74,9 @@ "cpu_pack": False, "comex_amb": False } + }, + 'watchdog': { + "max_period": 32 } }, 'x86_64-mlnx_msn4700_simx-r0': { @@ -284,3 +292,16 @@ def wait_platform_ready(cls): for sysfs_node in sysfs_nodes: conditions.append(lambda: os.path.exists(f'/sys/module/sx_core/asic0/module{sfp_index}/{sysfs_node}')) return utils.wait_until_conditions(conditions, 300, 1) + + @classmethod + @utils.read_only_cache() + def get_watchdog_max_period(cls): + platform_data = DEVICE_DATA.get(cls.get_platform_name(), None) + if not platform_data: + return DEFAULT_WD_PERIOD + + watchdog_data = platform_data.get('watchdog', None) + if not watchdog_data: + return DEFAULT_WD_PERIOD + + return watchdog_data.get('max_period', None) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py index 9e16b6d69cf8..efa626e548ad 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,6 +28,7 @@ from sonic_platform_base.watchdog_base import WatchdogBase from . import utils +from .device_data import DeviceDataManager """ ioctl constants """ IO_WRITE = 0x40000000 @@ -150,7 +151,7 @@ def arm(self, seconds): """ ret = WD_COMMON_ERROR - if seconds < 0: + if seconds < 0 or seconds > DeviceDataManager.get_watchdog_max_period(): return ret try: diff --git a/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py b/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py index 6e925d594708..4b5f6c972293 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -97,9 +97,11 @@ def test_is_armed(self, mock_read): @mock.patch('sonic_platform.watchdog.WatchdogImplBase.open_handle', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.fcntl.ioctl', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.WatchdogImplBase.is_armed') + @mock.patch('sonic_platform.device_data.DeviceDataManager.get_watchdog_max_period', mock.MagicMock(return_value=32)) def test_arm_disarm_watchdog2(self, mock_is_armed): watchdog = WatchdogType2('watchdog2') assert watchdog.arm(-1) == -1 + assert watchdog.arm(33) == -1 mock_is_armed.return_value = False watchdog.arm(10) mock_is_armed.return_value = True From b1edfc60713ee05c7c30e12cfde4d636552eede3 Mon Sep 17 00:00:00 2001 From: Gagan Punathil Ellath Date: Wed, 22 May 2024 09:33:43 -0700 Subject: [PATCH 152/282] [Mellanox] Add bfb image installation script to the switch image (#18923) - Why I did it In order to install the bfb image from the switch to all the dpus we need a script to execute the bfb_install script on all the detected rshim device parallely. The sonic-bfb-installer can be used to install bfb images on the DPUs from the switch using the rshim drivers - How I did it Added new makefile and script files for installation of bfb image - How to verify it sonic-bfb-installer.sh -b -r all sonic-bfb-installer.sh -b -r rshim1,rshim0 --- .../build_templates/sonic_debian_extension.j2 | 1 + platform/mellanox/mlnx-sonic-bfb-installer.mk | 26 +++ platform/mellanox/rules.mk | 1 + platform/mellanox/sonic-bfb-installer.sh | 163 ++++++++++++++++++ 4 files changed, 191 insertions(+) create mode 100644 platform/mellanox/mlnx-sonic-bfb-installer.mk create mode 100755 platform/mellanox/sonic-bfb-installer.sh diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 2557d2b6da9a..72abfec167fa 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -1043,6 +1043,7 @@ sudo cp $files_path/$COMPONENT_VERSIONS_FILE $FILESYSTEM_ROOT/etc/mlnx/component sudo cp $files_path/$MLNX_FFB_SCRIPT $FILESYSTEM_ROOT/usr/bin/mlnx-ffb.sh sudo cp $files_path/$MLNX_ONIE_FW_UPDATE $FILESYSTEM_ROOT/usr/bin/$MLNX_ONIE_FW_UPDATE sudo cp $files_path/$MLNX_SSD_FW_UPDATE $FILESYSTEM_ROOT/usr/bin/$MLNX_SSD_FW_UPDATE +sudo cp $files_path/$MLNX_SONIC_BFB_INSTALL $FILESYSTEM_ROOT/usr/bin/$MLNX_SONIC_BFB_INSTALL sudo cp $files_path/$MLNX_INSTALL_PENDING_FW $FILESYSTEM_ROOT/usr/bin/$MLNX_INSTALL_PENDING_FW sudo mkdir -p $FILESYSTEM_ROOT/etc/mlnx/cpld/ for MLNX_CPLD_ARCHIVE in $MLNX_CPLD_ARCHIVES; do diff --git a/platform/mellanox/mlnx-sonic-bfb-installer.mk b/platform/mellanox/mlnx-sonic-bfb-installer.mk new file mode 100644 index 000000000000..b247c044561c --- /dev/null +++ b/platform/mellanox/mlnx-sonic-bfb-installer.mk @@ -0,0 +1,26 @@ +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Mellanox specific Tool for installing bfb image on all DPUs attached to SmartSwitch + +MLNX_SONIC_BFB_INSTALL = sonic-bfb-installer.sh +$(MLNX_SONIC_BFB_INSTALL)_PATH = $(PLATFORM_PATH)/ +MLNX_BFB_FILES = $(MLNX_SONIC_BFB_INSTALL) +SONIC_COPY_FILES += $(MLNX_BFB_FILES) +MLNX_FILES += $(MLNX_BFB_FILES) + +export MLNX_SONIC_BFB_INSTALL diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index f7a10bc82b61..19e83b7c30c0 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -36,6 +36,7 @@ include $(PLATFORM_PATH)/install-pending-fw.mk include $(PLATFORM_PATH)/integration-scripts.mk include $(PLATFORM_PATH)/component-versions.mk include $(PLATFORM_PATH)/rshim.mk +include $(PLATFORM_PATH)/mlnx-sonic-bfb-installer.mk SONIC_ALL += $(SONIC_ONE_IMAGE) \ $(DOCKER_FPM) diff --git a/platform/mellanox/sonic-bfb-installer.sh b/platform/mellanox/sonic-bfb-installer.sh new file mode 100755 index 000000000000..57930d991c64 --- /dev/null +++ b/platform/mellanox/sonic-bfb-installer.sh @@ -0,0 +1,163 @@ +#!/bin/bash +# +# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +# Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +command_name="sonic-bfb-installer.sh" +usage(){ + echo "Syntax: $command_name -b|--bfb --rshim|-r --verbose|-v --config|-c --help|h" + echo "Arguments:" + echo "-b Provide custom path for bfb image" + echo "-r Install only on DPUs connected to rshim interfaces provided, mention all if installation is requried on all connected DPUs" + echo "-v Verbose installation result output" + echo "-c Config file" + echo "-h Help" +} + +bfb_install_call(){ + #Example:sudo bfb-install -b -r rshim + local result_file=$(mktemp "/tmp/result_file.XXXXX") + trap "rm -f $result_file" EXIT + local cmd="timeout 300s bfb-install -b $2 -r $1 $appendix" + echo "Installing bfb image on DPU connected to $1 using $cmd" + local indicator="$1:" + eval "$cmd" > "$result_file" 2>&1 > >(while IFS= read -r line; do echo "$indicator $line"; done > "$result_file") + local exit_status=$? + if [ $exit_status -ne 0 ]; then + echo "$1: Error: Installation failed on connected DPU!" + else + echo "$1: Installation Successful" + fi + if [ $exit_status -ne 0 ] ||[ $verbose = true ]; then + cat "$result_file" + fi + rm -f $result_file +} + +validate_rshim(){ + local provided_list=("$@") + for item1 in "${provided_list[@]}"; do + local found=0 + for item2 in "${dev_names_det[@]}"; do + if [[ "$item1" = "$item2" ]]; then + found=1 + break + fi + done + if [[ $found -eq 0 ]]; then + echo "$item1 is not detected! Please provide proper rshim interface list!" + exit 1 + fi + done +} + +check_for_root(){ + if [ "$EUID" -ne 0 ] + then echo "Please run the script in sudo mode" + exit + fi +} + + + +main(){ + check_for_root + local config= + while [ "$1" != "--" ] && [ -n "$1" ]; do + case $1 in + --help|-h) + usage; + exit 0 + ;; + --bfb|-b) + shift; + bfb=$1 + ;; + --rshim|-r) + shift; + rshim_dev=$1 + ;; + --config|-c) + shift; + config=$1 + ;; + --verbose|-v) + verbose=true + ;; + esac + shift + done + if [ -z "$bfb" ]; then + echo "Error : bfb image is not provided." + usage + exit 1 + fi + if [[ -f ${config} ]]; then + echo "Using ${config} file" + appendix="-c ${config}" + fi + dev_names_det+=($( + ls /dev/rshim* | awk -F'/' '/^\/dev\/rshim/ {gsub(/:/,"",$NF); print $NF}' + )) + if [ "${#dev_names_det[@]}" -eq 0 ]; then + echo "No rshim interfaces detected! Make sure to run the $command_name script from the host device/ switch!" + exit 1 + fi + if [ -z "$rshim_dev" ]; then + echo "No rshim interfaces provided!" + usage + exit 1 + else + if [ "$rshim_dev" = "all" ]; then + dev_names=("${dev_names_det[@]}") + echo "${#dev_names_det[@]} rshim interfaces detected:" + echo "${dev_names_det[@]}" + else + IFS=',' read -ra dev_names <<< "$rshim_dev" + validate_rshim $dev_names + fi + fi + trap 'kill_ch_procs' SIGINT SIGTERM SIGHUP + for i in "${dev_names[@]}" + do + : + bfb_install_call $i $bfb & + done + wait +} + +kill_all_descendant_procs() { + local pid="$1" + local self_kill="${2:-false}" + if children="$(pgrep -P "$pid")"; then + for child in $children; do + kill_all_descendant_procs "$child" true + done + fi + if [[ "$self_kill" == true ]]; then + kill -15 "$pid" > /dev/null 2>&1 + fi +} + + +kill_ch_procs(){ + echo "" + echo "Installation Interrupted.. killing All child procs" + kill_all_descendant_procs $$ +} +appendix= +verbose=false +main "$@" From 9c18b27802185d2dcf5bcb6dc62cdcf8308e1cbe Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Thu, 23 May 2024 00:50:25 +0800 Subject: [PATCH 153/282] [docker]: Fix docker-wait-any script crash issue (#19009) Fix docker-wait-any script crash issue. Why I did it docker-wait-any script will create a waiting thread for multiple containers. When any container thread exit, g_thread_exit_event will set, and main thread will exit. However when this happen, some thread may still waiting container with following code: docker_client.wait(container_name) Because docker_client will be destroyed when main thread exist, some time wait method will throw TypeError, and this will cause swss.sh crash then swss container can't start: <30>May 13 07:11:22 DEVICE_NAME swss.sh[13603]: Traceback (most recent call last): <30>May 13 07:11:22 DEVICE_NAME swss.sh[13603]: Exception in thread Thread-1: ... <30>May 13 07:11:22 DEVICE_NAME swss.sh[13603]: while docker_client.inspect_container(container_name)['State']['Status'] != "running": ... <30>May 13 07:11:23 DEVICE_NAME swss.sh[13603]: TypeError: 'NoneType' object is not callable <13>May 13 07:11:23 DEVICE_NAME root: Stopping swss service... This PR is based on analyze result of following PR: #10812 Microsoft ADO: 28052815 --- files/image_config/misc/docker-wait-any | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/files/image_config/misc/docker-wait-any b/files/image_config/misc/docker-wait-any index f4001d7e02c5..a76efc0d8c16 100755 --- a/files/image_config/misc/docker-wait-any +++ b/files/image_config/misc/docker-wait-any @@ -49,8 +49,16 @@ def wait_for_container(docker_client, container_name): log.log_info("Waiting on container '{}'".format(container_name)) while True: - docker_client.wait(container_name) - + try: + docker_client.wait(container_name) + except TypeError as e: + if g_thread_exit_event.is_set(): + # When other thread exist, main thread will exit and docker_client will be destoryed + log.log_info("Container {} wait thread get exception: {}".format(container_name, e)) + return + else: + raise e + log.log_info("No longer waiting on container '{}'".format(container_name)) # If this is a dependent service and warm restart is enabled for the system/container, From f7d0fa8f5653461d6aa9d5f67d7ed02a5aea4532 Mon Sep 17 00:00:00 2001 From: DavidZagury <32644413+DavidZagury@users.noreply.github.com> Date: Wed, 22 May 2024 19:51:48 +0300 Subject: [PATCH 154/282] [Mellanox] Update pcie yaml file for SN5600 and SN5400 (#19015) Remove I2C Controller from pcie yaml file for SN5600 and SN5400 --- device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml | 6 ------ device/mellanox/x86_64-nvidia_sn5600-r0/pcie.yaml | 8 +------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml b/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml index 7c08d0aa1e0d..0741f00f1062 100644 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/pcie.yaml @@ -56,12 +56,6 @@ fn: '2' id: a36f name: 'RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)' -- bus: '00' - dev: '15' - fn: '0' - id: a368 - name: 'Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO - I2C Controller #0 (rev 10)' - bus: '00' dev: '16' fn: '0' diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/pcie.yaml b/device/mellanox/x86_64-nvidia_sn5600-r0/pcie.yaml index 30c6a23773d1..ef0d1b3c70d1 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/pcie.yaml +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/pcie.yaml @@ -1,5 +1,5 @@ ## -## Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. +## Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. ## Apache-2.0 ## ## Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,12 +56,6 @@ fn: '2' id: a36f name: 'RAM memory: Intel Corporation Cannon Lake PCH Shared SRAM (rev 10)' -- bus: '00' - dev: '15' - fn: '0' - id: a368 - name: 'Serial bus controller [0c80]: Intel Corporation Cannon Lake PCH Serial IO - I2C Controller #0 (rev 10)' - bus: '00' dev: '16' fn: '0' From 7d7332a6448c53856978db845685892507d27abe Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Wed, 22 May 2024 09:52:13 -0700 Subject: [PATCH 155/282] [ci]: build nvidia bluefield dpu image (#19004) Signed-off-by: Guohan Lu --- .azure-pipelines/azure-pipelines-UpgrateVersion.yml | 5 +++-- .azure-pipelines/azure-pipelines-build.yml | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index d2be6dcbd313..cb1b0744ccbd 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -41,6 +41,7 @@ parameters: - marvell-arm64 - mellanox - pensando + - nvidia-bluefield stages: - stage: Prepare @@ -117,7 +118,7 @@ stages: echo "artifacts$artifacts" cp -r $(Pipeline.Workspace)/sonic-buildimage.${default_platform}/target/versions target/ make freeze FREEZE_VERSION_OPTIONS=-r - find files/build/versions + find files/build/versions ordered_artifacts=$(echo "$artifacts" | grep -v -E "arm64|armhf" && echo "$artifacts" | grep -E "arm64|armhf") for artifact in $ordered_artifacts do @@ -179,4 +180,4 @@ stages: - publish: $(System.DefaultWorkingDirectory)/files/build/versions artifact: 'sonic-buildimage.versions' displayName: 'Archive SONiC versions' - + diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index cf2b8404162e..9ef929530d50 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -121,6 +121,11 @@ jobs: variables: PLATFORM_ARCH: arm64 + - name: nvidia-bluefield + pool: sonicbld-arm64 + variables: + PLATFORM_ARCH: arm64 + buildSteps: - template: .azure-pipelines/template-skipvstest.yml@buildimage - template: .azure-pipelines/template-daemon.yml@buildimage @@ -170,7 +175,7 @@ jobs: make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-dnx-rpc.gz pushd ./src/sonic-sairedis/SAI git stash - popd + popd fi fi if [ $(syncd_rpc_image) == yes ]; then From 8db0a1f1b03d8dcfbc7a4885c5f5ea742da4f5ce Mon Sep 17 00:00:00 2001 From: Ashwin Srinivasan <93744978+assrinivasan@users.noreply.github.com> Date: Wed, 22 May 2024 16:30:52 -0700 Subject: [PATCH 156/282] Adds YANG models for configurable intervals in CONFIG_DB for stormond (#18657) #### Why I did it This is part of a larger feature: [SONiC Storage Monitoring Daemon](https://github.com/sonic-net/SONiC/pull/1481) -- this commit adds the option to configure the daemon's polling interval and fsstats file sync interval (in seconds) of the daemon via config_db by introducing YANG models. #### How I did it Gives userside the option to dynamically a new table 'STORMOND' with key INTERVALS and fields 'daemon_polling_interval' with default value of '3600' seconds and 'fsstats_sync_interval' with default value of '86400' seconds as defined in the YANG model. #### How to verify it Flash image onto a DUT and add the aforementioned table to the CONFIG_DB. Verify that `stormond` has picked up your config intervals. --- src/sonic-yang-models/doc/Configuration.md | 21 +++++ .../tests/files/sample_config_db.json | 6 ++ .../yang_model_tests/tests/stormond.json | 29 +++++++ .../tests_config/stormond.json | 79 +++++++++++++++++++ .../yang-models/sonic-stormond-config.yang | 40 ++++++++++ 5 files changed, 175 insertions(+) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/stormond.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/stormond.json create mode 100644 src/sonic-yang-models/yang-models/sonic-stormond-config.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 37f193e1c5b9..db1709f47e53 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -2072,6 +2072,27 @@ key - name | collector_port | Destination L4 port of the Sflow collector | | 6343 | | | collector_vrf | Specify the Collector VRF. In this revision, it is either default VRF or Management VRF.| | | | +### Storage Monitoring Daemon Interval Configuration + +These options are used to configure the daemon polling and sync-to-disk interval +of the Storage Monitoring Daemon (stormond) + +**Config Sample** +``` +{ + "STORMOND_CONFIG": { + "INTERVALS": { + "daemon_polling_interval" : "60", + "fsstats_sync_interval" : "360" + } + } +} +``` + +* `daemon_polling_interval` - Determines how often stormond queries the disk for relevant information and posts to STATE_DB +* `fsstats_sync_interval` - Determines how often key information from the STATE_DB is synced to a file on disk + + ### Syslog Global Configuration These configuration options are used to configure rsyslog utility and the way diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index db159a93c0e0..36814657de41 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2683,5 +2683,11 @@ "global": { } } + }, + "STORMOND_CONFIG": { + "INTERVALS": { + "daemon_polling_interval" : "3600", + "fsstats_sync_interval" : "86400" + } } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/stormond.json b/src/sonic-yang-models/tests/yang_model_tests/tests/stormond.json new file mode 100644 index 000000000000..de8c699c49d0 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/stormond.json @@ -0,0 +1,29 @@ +{ + "STORMOND_CONFIG_TABLE": { + "desc": "Config DB interval parameters for Storage Monitoring Daemon" + }, + "STORMOND_INVALID_POLLING_INTERVAL": { + "desc": "Configure an invalid daemon polling interval", + "eStrKey" : "InvalidValue" + }, + "STORMOND_INVALID_SYNC_INTERVAL": { + "desc": "Configure an invalid fsstats file sync interval", + "eStrKey" : "InvalidValue" + }, + "STORMOND_POLLING_INTVL_BAD_LEN_MAX": { + "desc": "Configure an invalid daemon polling interval: out of range value", + "eStrKey" : "InvalidValue" + }, + "STORMOND_SYNC_INTVL_BAD_LEN_MAX": { + "desc": "Configure an invalid fsstats file sync interval: out of range value", + "eStrKey" : "InvalidValue" + }, + "STORMOND_SYNC_INTVL_EMPTY_VALUE": { + "desc": "Configure an empty file sync interval", + "eStrKey" : "InvalidValue" + }, + "STORMOND_POLLING_INTVL_EMPTY_VALUE": { + "desc": "Configure an empty file sync interval", + "eStrKey" : "InvalidValue" + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/stormond.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/stormond.json new file mode 100644 index 000000000000..225e6db22696 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/stormond.json @@ -0,0 +1,79 @@ +{ + "STORMOND_CONFIG_TABLE": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "3600", + "fsstats_sync_interval" : "86400" + + } + } + } + }, + "STORMOND_INVALID_POLLING_INTERVAL": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "-1", + "fsstats_sync_interval" : "86400" + + } + } + } + }, + "STORMOND_INVALID_SYNC_INTERVAL": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "3600", + "fsstats_sync_interval" : "five_thousand_two_hundred_seconds" + + } + } + } + }, + "STORMOND_POLLING_INTVL_BAD_LEN_MAX": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "360036003600360036003600360036003", + "fsstats_sync_interval" : "86400" + + } + } + } + }, + "STORMOND_SYNC_INTVL_BAD_LEN_MAX": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "3600", + "fsstats_sync_interval" : "864008640086400864008640086400864" + + } + } + } + }, + "STORMOND_SYNC_INTVL_EMPTY_VALUE": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "3600", + "fsstats_sync_interval" : "" + + } + } + } + }, + "STORMOND_POLLING_INTVL_EMPTY_VALUE": { + "sonic-stormond-config:sonic-stormond-config": { + "sonic-stormond-config:STORMOND_CONFIG": { + "INTERVALS":{ + "daemon_polling_interval" : "", + "fsstats_sync_interval" : "86400" + + } + } + } + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-stormond-config.yang b/src/sonic-yang-models/yang-models/sonic-stormond-config.yang new file mode 100644 index 000000000000..3b50c6be21a3 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-stormond-config.yang @@ -0,0 +1,40 @@ +module sonic-stormond-config{ + + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-stormond-config"; + prefix stormond-config; + + import sonic-types { + prefix stypes; + } + + description "STORMOND_CONFIG Table yang Module for SONiC"; + + container sonic-stormond-config { + + container STORMOND_CONFIG { + + description "stormond_config table in config_db.json"; + + container INTERVALS { + + leaf daemon_polling_interval { + description "Polling inerval for Storage Monitoring Daemon in STORMOND_CONFIG table"; + type uint32 { + range "1..4294967295"; + } + default "3600"; + } + + leaf fsstats_sync_interval { + description "FSSTATS JSON file syncing interval for the Storage Monitoring Daemon in STORMOND_CONFIG table"; + type uint32 { + range "1..4294967295"; + } + default "86400"; + } + } + } + } +} From eef4f1ea9a17cfd1038f3e0e6242c04661c5bf77 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 23 May 2024 19:00:47 +0800 Subject: [PATCH 157/282] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#19038) #### Why I did it src/sonic-gnmi ``` * 585f441 - (HEAD -> master, origin/master, origin/HEAD) Add SaveOnSet (#108) (28 hours ago) [Ryan Lucus] * 81174c0 - Fix full config update (#240) (2 days ago) [ganglv] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index 692f967d4fb2..585f4419f983 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit 692f967d4fb2d55593267663a722826186ddf0d1 +Subproject commit 585f4419f983b8d931121fdcb8acfe549bb06fba From 74317df1b07f778d8b7b21159afc92a7583c1760 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 23 May 2024 19:00:52 +0800 Subject: [PATCH 158/282] [submodule] Update submodule sonic-dbsyncd to the latest HEAD automatically (#19036) #### Why I did it src/sonic-dbsyncd ``` * d5fa793 - (HEAD -> master, origin/master, origin/HEAD) Handle exception to avoid lldp_syncd crash (#65) (2 hours ago) [Zhaohui Sun] * bc63571 - Fix pipeline issue. (#66) (25 hours ago) [Liu Shilong] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-dbsyncd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-dbsyncd b/src/sonic-dbsyncd index 4d627eed8173..d5fa7937a4e3 160000 --- a/src/sonic-dbsyncd +++ b/src/sonic-dbsyncd @@ -1 +1 @@ -Subproject commit 4d627eed8173ceab02bf9070cd5360c8ad0d42d7 +Subproject commit d5fa7937a4e38ce0356368977ab4ba89090b2209 From 65c4a7d10a2aa97b25c32745b58b7929a6d9b2c3 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 24 May 2024 00:30:27 +0800 Subject: [PATCH 159/282] Support OpenSSL 3.0 SymCrypt provider for bookworm (#18088) Support OpenSSL 3.0 SymCrypt provider and engine for bookworm Restore the feature support for SymCrypt-OpenSSL. For bookworm, using OpenSSL 3.0.11, it supports both provider and engine. The engine is in deprecating, it will be deprecated in the long term. Currently, some of the applications which still use the low-level OpenSSL APIs are not ready to migrate to OpenSSL provider, so OpenSSL engine will still be used for some time. The OpenSSL SymCrypt provider and engine are included in the openssl-symcrypt debian package (>=1.0-preview). Microsoft ADO (number only): 27655936 --- Makefile.work | 15 ++-------- azure-pipelines.yml | 2 +- dockers/docker-base-bookworm/Dockerfile.j2 | 3 +- .../build_templates/sonic_debian_extension.j2 | 7 +++++ rules/sonic-fips.mk | 30 ++++++++++++++++--- sonic-slave-bookworm/Dockerfile.j2 | 8 ++--- sonic-slave-bullseye/Dockerfile.j2 | 4 +-- 7 files changed, 44 insertions(+), 25 deletions(-) diff --git a/Makefile.work b/Makefile.work index 58266149dbbb..69cf6e5b180f 100644 --- a/Makefile.work +++ b/Makefile.work @@ -141,6 +141,7 @@ rules/config.user: include rules/config -include rules/config.user +include rules/sonic-fips.mk ifneq ($(DEFAULT_CONTAINER_REGISTRY),) override DEFAULT_CONTAINER_REGISTRY := $(DEFAULT_CONTAINER_REGISTRY)/ @@ -177,18 +178,6 @@ endif SLAVE_IMAGE = $(SLAVE_BASE_IMAGE)-$(USER_LC) DOCKER_ROOT = $(PWD)/fsroot.docker.$(BLDENV) -# Support FIPS feature, armhf not supported yet -ifeq ($(PLATFORM_ARCH),armhf) -INCLUDE_FIPS := n -ENABLE_FIPS := n -endif - -# FIPS not yet available on Bookworm -ifeq ($(BLDENV),bookworm) -$(warning FIPS support not yet available on Bookworm) -INCLUDE_FIPS := n -endif - ifeq ($(INCLUDE_FIPS), n) ifeq ($(ENABLE_FIPS), y) $(error Cannot set fips config ENABLE_FIPS=y when INCLUDE_FIPS=n) @@ -222,6 +211,8 @@ $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \ INCLUDE_FIPS=$(INCLUDE_FIPS) \ DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) \ DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \ + FIPS_VERSION=$(FIPS_VERSION) \ + FIPS_GOLANG_VERSION=$(FIPS_GOLANG_VERSION) \ j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile) $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b87dfc41c0b1..18ed0c58b653 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,7 +42,7 @@ variables: - name: CACHE_MODE value: rcache - name: ENABLE_FIPS - value: n + value: y - name: BUILD_BRANCH ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: value: $(System.PullRequest.TargetBranch) diff --git a/dockers/docker-base-bookworm/Dockerfile.j2 b/dockers/docker-base-bookworm/Dockerfile.j2 index e500259bb9ac..2a3388d770d5 100644 --- a/dockers/docker-base-bookworm/Dockerfile.j2 +++ b/dockers/docker-base-bookworm/Dockerfile.j2 @@ -60,7 +60,8 @@ RUN apt update && \ jq \ # for sairedis zmq rpc channel libzmq5 \ - libwrap0 + libwrap0 \ + libatomic1 # Add a config file to allow pip to install packages outside of apt/the Debian repos COPY ["pip.conf", "/etc/pip.conf"] diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 72abfec167fa..b540f39d4f07 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -732,6 +732,13 @@ exit 101 EOF sudo chmod a+x $FILESYSTEM_ROOT/usr/sbin/policy-rc.d +if [ "$INCLUDE_FIPS" == y ]; then + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install libatomic1 + # The package openssh-client 9.2 is conflict with FIPS, the line below can be removed when the openssh-client version>=9.4 + # The package will be reinstalled when isntalling the FIPS packages + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y remove openssh-client +fi + {% if installer_debs.strip() -%} {% for deb in installer_debs.strip().split(' ') -%} sudo dpkg --root=$FILESYSTEM_ROOT -i {{deb}} || sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f diff --git a/rules/sonic-fips.mk b/rules/sonic-fips.mk index b6c0d1743ff2..0ec82b26690d 100644 --- a/rules/sonic-fips.mk +++ b/rules/sonic-fips.mk @@ -1,6 +1,18 @@ # fips packages -FIPS_VERSION = 0.10 +ifeq ($(BLDENV), bookworm) +FIPS_VERSION = 1.4.3-preview +FIPS_OPENSSL_VERSION = 3.0.11-1~deb12u2+fips +FIPS_OPENSSH_VERSION = 9.2p1-2+deb12u2+fips +FIPS_PYTHON_MAIN_VERSION = 3.11 +FIPS_PYTHON_VERSION = 3.11.2-6+fips +FIPS_GOLANG_MAIN_VERSION = 1.19 +FIPS_GOLANG_VERSION = 1.19.8-2+fips +FIPS_KRB5_VERSION = 1.20.1-2+deb12u1+fips +endif + +ifeq ($(BLDENV), bullseye) +FIPS_VERSION = 0.12 FIPS_OPENSSL_VERSION = 1.1.1n-0+deb11u5+fips FIPS_OPENSSH_VERSION = 8.4p1-5+deb11u2+fips FIPS_PYTHON_MAIN_VERSION = 3.9 @@ -8,6 +20,8 @@ FIPS_PYTHON_VERSION = 3.9.2-1+fips FIPS_GOLANG_MAIN_VERSION = 1.15 FIPS_GOLANG_VERSION = 1.15.15-1~deb11u4+fips FIPS_KRB5_VERSION = 1.18.3-6+deb11u4+fips +endif + FIPS_URL_PREFIX = https://sonicstorage.blob.core.windows.net/public/fips/$(BLDENV)/$(FIPS_VERSION)/$(CONFIGURED_ARCH) SYMCRYPT_OPENSSL_NAME = symcrypt-openssl @@ -15,16 +29,20 @@ SYMCRYPT_OPENSSL = $(SYMCRYPT_OPENSSL_NAME)_$(FIPS_VERSION)_$(CONFIGURED_ARCH).d $(SYMCRYPT_OPENSSL)_SRC_PATH = $(SRC_PATH)/sonic-fips FIPS_OPENSSL = openssl_$(FIPS_OPENSSL_VERSION)_$(CONFIGURED_ARCH).deb +ifeq ($(BLDENV), bookworm) +FIPS_OPENSSL_LIBSSL = libssl3_$(FIPS_OPENSSL_VERSION)_$(CONFIGURED_ARCH).deb +else FIPS_OPENSSL_LIBSSL = libssl1.1_$(FIPS_OPENSSL_VERSION)_$(CONFIGURED_ARCH).deb +endif FIPS_OPENSSL_LIBSSL_DEV = libssl-dev_$(FIPS_OPENSSL_VERSION)_$(CONFIGURED_ARCH).deb FIPS_OPENSSL_LIBSSL_DOC = libssl-doc_$(FIPS_OPENSSL_VERSION)_all.deb FIPS_OPENSSL_ALL = $(FIPS_OPENSSL) $(FIPS_OPENSSL_LIBSSL) $(FIPS_OPENSSL_LIBSSL_DEV) $(FIPS_OPENSSL_LIBSSL_DOC) -FIPS_OPENSSH = ssh_$(FIPS_OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb +FIPS_OPENSSH = ssh_$(FIPS_OPENSSH_VERSION)_all.deb FIPS_OPENSSH_CLIENT = openssh-client_$(FIPS_OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb FIPS_OPENSSH_SFTP_SERVER = openssh-sftp-server_$(FIPS_OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb FIPS_OPENSSH_SERVER = openssh-server_$(FIPS_OPENSSH_VERSION)_$(CONFIGURED_ARCH).deb -FIPS_OPENSSH_ALL = $(FIPS_SSH) $(FIPS_OPENSSH_CLIENT) $(FIPS_OPENSSH_SFTP_SERVER) $(FIPS_OPENSSH_SERVER) +FIPS_OPENSSH_ALL = $(FIPS_OPENSSH_CLIENT) $(FIPS_OPENSSH_SFTP_SERVER) $(FIPS_OPENSSH_SERVER) $(FIPS_OPENSSH) FIPS_PYTHON = python$(FIPS_PYTHON_MAIN_VERSION)_$(FIPS_PYTHON_VERSION)_$(CONFIGURED_ARCH).deb FIPS_PYTHON_MINIMAL = python$(FIPS_PYTHON_MAIN_VERSION)-minimal_$(FIPS_PYTHON_VERSION)_$(CONFIGURED_ARCH).deb @@ -35,7 +53,11 @@ FIPS_PYTHON_ALL = $(FIPS_PYTHON) $(FIPS_PYTHON_MINIMAL) $(FIPS_LIBPYTHON) $(FIPS FIPS_GOLANG = golang-$(FIPS_GOLANG_MAIN_VERSION)_$(FIPS_GOLANG_VERSION)_all.deb FIPS_GOLANG_GO = golang-$(FIPS_GOLANG_MAIN_VERSION)-go_$(FIPS_GOLANG_VERSION)_$(CONFIGURED_ARCH).deb +ifeq ($(BLDENV), bookworm) +FIPS_GOLANG_SRC = golang-$(FIPS_GOLANG_MAIN_VERSION)-src_$(FIPS_GOLANG_VERSION)_all.deb +else FIPS_GOLANG_SRC = golang-$(FIPS_GOLANG_MAIN_VERSION)-src_$(FIPS_GOLANG_VERSION)_$(CONFIGURED_ARCH).deb +endif FIPS_GOLANG_DOC = golang-$(FIPS_GOLANG_MAIN_VERSION)-doc_$(FIPS_GOLANG_VERSION)_all.deb FIPS_GOLANG_ALL = $(FIPS_GOLANG) $(FIPS_GOLANG_GO) $(FIPS_GOLANG_SRC) $(FIPS_GOLANG_DOC) @@ -55,7 +77,7 @@ FIPS_PACKAGE_ALL = $(SYMCRYPT_OPENSSL) $(FIPS_DERIVED_TARGET) ifeq ($(INCLUDE_FIPS), y) - FIPS_BASEIMAGE_INSTALLERS = $(FIPS_OPENSSL_LIBSSL) $(FIPS_OPENSSL_LIBSSL_DEV) $(FIPS_OPENSSL) $(SYMCRYPT_OPENSSL) $(FIPS_OPENSSH) $(FIPS_OPENSSH_CLIENT) $(FIPS_OPENSSH_SFTP_SERVER) $(FIPS_OPENSSH_SERVER) $(FIPS_KRB5) + FIPS_BASEIMAGE_INSTALLERS = $(FIPS_OPENSSL_LIBSSL) $(FIPS_OPENSSL_LIBSSL_DEV) $(FIPS_OPENSSL) $(SYMCRYPT_OPENSSL) $(FIPS_OPENSSH_CLIENT) $(FIPS_OPENSSH) $(FIPS_OPENSSH_SFTP_SERVER) $(FIPS_OPENSSH_SERVER) $(FIPS_KRB5) SONIC_MAKE_DEBS += $(SYMCRYPT_OPENSSL) $(foreach package,$(FIPS_DERIVED_TARGET),$(eval $(call add_extra_package,$(SYMCRYPT_OPENSSL),$(package)))) diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 56ced720bd08..fd9184218e00 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -510,12 +510,10 @@ RUN apt-get install -y kernel-wedge # For gobgp and telemetry build RUN apt-get install -y golang {%- if INCLUDE_FIPS == "y" %} -# FIPS not yet available -RUN false -RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bookworm/0.1/{{ CONFIGURED_ARCH }}/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_{{ CONFIGURED_ARCH }}.deb' \ - && wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bookworm/0.1/{{ CONFIGURED_ARCH }}/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_{{ CONFIGURED_ARCH }}.deb' \ +RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bookworm/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.19-go_{{ FIPS_GOLANG_VERSION }}_{{ CONFIGURED_ARCH }}.deb' \ + && wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bookworm/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.19-src_{{ FIPS_GOLANG_VERSION }}_all.deb' \ && dpkg -i golang-go.deb golang-src.deb \ - && ln -sf /usr/lib/go-1.15 /usr/local/go \ + && ln -sf /usr/lib/go-1.19 /usr/local/go \ && rm golang-go.deb golang-src.deb {%- else %} RUN apt-get install -y golang-go \ diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index a0b453d4d89d..2272dac60f94 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -514,8 +514,8 @@ RUN eatmydata apt-get install -y kernel-wedge # For gobgp and telemetry build RUN eatmydata apt-get install -y golang-1.15 && ln -s /usr/lib/go-1.15 /usr/local/go {%- if INCLUDE_FIPS == "y" %} -RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/{{ CONFIGURED_ARCH }}/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_{{ CONFIGURED_ARCH }}.deb' \ - && wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/{{ CONFIGURED_ARCH }}/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_{{ CONFIGURED_ARCH }}.deb' \ +RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.15-go_{{ FIPS_GOLANG_VERSION }}_{{ CONFIGURED_ARCH }}.deb' \ + && wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bullseye/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.15-src_{{ FIPS_GOLANG_VERSION }}_{{ CONFIGURED_ARCH }}.deb' \ && eatmydata dpkg -i golang-go.deb golang-src.deb \ && ln -sf /usr/lib/go-1.15 /usr/local/go \ && rm golang-go.deb golang-src.deb From d6ccd2d10a2f8ea0983aadb623a814aab0fedae6 Mon Sep 17 00:00:00 2001 From: siqbal1986 Date: Thu, 23 May 2024 09:39:40 -0700 Subject: [PATCH 160/282] [Yang][Bugfix] Vxlan tunnel yang model to support dest_ip and name length. (#18966) Fixed the Vxlan tunnel yang model to add support for 1) Tunnel name length restriction has been removed 2) dst_ip field. #### Why I did it The yand modle was misisng an element and supported tunnel anme was very small. #### How to verify it run yang model tests --- src/sonic-yang-models/doc/Configuration.md | 3 +- .../tests/yang_model_tests/tests/vxlan.json | 13 ++ .../yang_model_tests/tests_config/vxlan.json | 170 +++++++++++++++--- .../yang-models/sonic-vxlan.yang | 14 +- 4 files changed, 169 insertions(+), 31 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index db1709f47e53..0017abaa570e 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -2508,7 +2508,8 @@ VXLAN_EVPN_NVO holds the VXLAN_TUNNEL object to be used for BGP-EVPN discovered { "VXLAN_TUNNEL": { "vtep1": { - "src_ip": "10.10.10.10" + "src_ip": "10.10.10.10", + "dst_ip": "12.12.12.12" } } "VXLAN_TUNNEL_MAP" : { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json b/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json index 880d0c015d0c..778ab68a644f 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json @@ -16,5 +16,18 @@ "VXLAN_MAP_OOR_VNI": { "desc": "VNI Out of Range in VXLAN_TUNNEL_MAP TABLE", "eStrKey": "Range" + }, + "VXLAN_TUNNEL_NAME_VALID_TEST": { + "desc": "Tunnel Name string length 30 is valid" + }, + "VXLAN_TUNNEL_NAME_INVALID_TEST": { + "desc": "Tunnel Name string length 0 is invalid", + "eStrKey": "Must" + }, + "VXLAN_TUNNEL_NAME_VALID_DST_IPV4_TEST": { + "desc": "Valid IPv4 Destination Address" + }, + "VXLAN_TUNNEL_NAME_VALID_DST_IPV6_TEST": { + "desc": "Valid IPv6 Destination Address" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json index 117d626ca4c2..64c26d3e9ef7 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json @@ -8,7 +8,7 @@ } ] } - }, + }, "sonic-vxlan:sonic-vxlan": { "sonic-vxlan:VXLAN_TUNNEL": { "VXLAN_TUNNEL_LIST": [ @@ -17,7 +17,7 @@ "src_ip": "1.2.3.4" } ] - }, + }, "sonic-vxlan:VXLAN_EVPN_NVO": { "VXLAN_EVPN_NVO_LIST": [ { @@ -25,7 +25,7 @@ "source_vtep": "vtep1" } ] - }, + }, "sonic-vxlan:VXLAN_TUNNEL_MAP": { "VXLAN_TUNNEL_MAP_LIST": [ { @@ -35,8 +35,8 @@ "vni": "100" } ] - } - } + } + } }, "VXLAN_VALID_V6_TUNNEL_TEST": { "sonic-vlan:sonic-vlan": { @@ -47,7 +47,7 @@ } ] } - }, + }, "sonic-vxlan:sonic-vxlan": { "sonic-vxlan:VXLAN_TUNNEL": { "VXLAN_TUNNEL_LIST": [ @@ -56,7 +56,7 @@ "src_ip": "2001::1:2:3:4" } ] - }, + }, "sonic-vxlan:VXLAN_EVPN_NVO": { "VXLAN_EVPN_NVO_LIST": [ { @@ -64,7 +64,7 @@ "source_vtep": "vtep1" } ] - }, + }, "sonic-vxlan:VXLAN_TUNNEL_MAP": { "VXLAN_TUNNEL_MAP_LIST": [ { @@ -74,8 +74,8 @@ "vni": "100" } ] - } - } + } + } }, "VXLAN_EVPN_NVO_WITHOUT_VTEP": { "sonic-vxlan:sonic-vxlan": { @@ -86,8 +86,8 @@ "source_vtep": "vtep1" } ] - } - } + } + } }, "VXLAN_MAP_WITHOUT_VTEP": { "sonic-vlan:sonic-vlan": { @@ -98,7 +98,7 @@ } ] } - }, + }, "sonic-vxlan:sonic-vxlan": { "sonic-vxlan:VXLAN_TUNNEL_MAP": { "VXLAN_TUNNEL_MAP_LIST": [ @@ -109,8 +109,8 @@ "vni": "100" } ] - } - } + } + } }, "VXLAN_MAP_WITHOUT_VLAN": { "sonic-vxlan:sonic-vxlan": { @@ -121,7 +121,7 @@ "src_ip": "1.2.3.4" } ] - }, + }, "sonic-vxlan:VXLAN_TUNNEL_MAP": { "VXLAN_TUNNEL_MAP_LIST": [ { @@ -131,8 +131,8 @@ "vni": "100" } ] - } - } + } + } }, "VXLAN_MAP_OOR_VNI": { "sonic-vlan:sonic-vlan": { @@ -143,7 +143,7 @@ } ] } - }, + }, "sonic-vxlan:sonic-vxlan": { "sonic-vxlan:VXLAN_TUNNEL": { "VXLAN_TUNNEL_LIST": [ @@ -152,7 +152,7 @@ "src_ip": "1.2.3.4" } ] - }, + }, "sonic-vxlan:VXLAN_TUNNEL_MAP": { "VXLAN_TUNNEL_MAP_LIST": [ { @@ -162,7 +162,133 @@ "vni": "16777299" } ] - } - } + } + } + }, + "VXLAN_TUNNEL_NAME_VALID_TEST": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan100" + } + ] + } + }, + "sonic-vxlan:sonic-vxlan": { + "sonic-vxlan:VXLAN_TUNNEL": { + "VXLAN_TUNNEL_LIST": [ + { + "name": "30CharachterLongName1234567890", + "src_ip": "1.2.3.4" + } + ] + }, + "sonic-vxlan:VXLAN_TUNNEL_MAP": { + "VXLAN_TUNNEL_MAP_LIST": [ + { + "name": "30CharachterLongName1234567890", + "mapname": "map_100_Vlan100", + "vlan": "Vlan100", + "vni": "16777214" + } + ] + } + } + }, + "VXLAN_TUNNEL_NAME_INVALID_TEST": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan100" + } + ] + } + }, + "sonic-vxlan:sonic-vxlan": { + "sonic-vxlan:VXLAN_TUNNEL": { + "VXLAN_TUNNEL_LIST": [ + { + "name": "", + "src_ip": "1.2.3.4" + } + ] + }, + "sonic-vxlan:VXLAN_TUNNEL_MAP": { + "VXLAN_TUNNEL_MAP_LIST": [ + { + "name": "", + "mapname": "map_100_Vlan100", + "vlan": "Vlan100", + "vni": "16777214" + } + ] + } + } + }, + "VXLAN_TUNNEL_NAME_VALID_DST_IPV4_TEST": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan100" + } + ] + } + }, + "sonic-vxlan:sonic-vxlan": { + "sonic-vxlan:VXLAN_TUNNEL": { + "VXLAN_TUNNEL_LIST": [ + { + "name": "30CharachterLongName1234567890", + "src_ip": "1.2.3.4", + "dst_ip": "1.2.3.4" + } + ] + }, + "sonic-vxlan:VXLAN_TUNNEL_MAP": { + "VXLAN_TUNNEL_MAP_LIST": [ + { + "name": "30CharachterLongName1234567890", + "mapname": "map_100_Vlan100", + "vlan": "Vlan100", + "vni": "16777214" + } + ] + } + } + }, + "VXLAN_TUNNEL_NAME_VALID_DST_IPV6_TEST": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan100" + } + ] + } + }, + "sonic-vxlan:sonic-vxlan": { + "sonic-vxlan:VXLAN_TUNNEL": { + "VXLAN_TUNNEL_LIST": [ + { + "name": "tunnel1", + "src_ip": "1.2.3.4", + "dst_ip": "2001::1:2:3:4" + } + ] + }, + "sonic-vxlan:VXLAN_TUNNEL_MAP": { + "VXLAN_TUNNEL_MAP_LIST": [ + { + "name": "tunnel1", + "mapname": "map_100_Vlan100", + "vlan": "Vlan100", + "vni": "16777214" + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-vxlan.yang b/src/sonic-yang-models/yang-models/sonic-vxlan.yang index f35276f23d92..7e0b0339561c 100644 --- a/src/sonic-yang-models/yang-models/sonic-vxlan.yang +++ b/src/sonic-yang-models/yang-models/sonic-vxlan.yang @@ -49,19 +49,17 @@ module sonic-vxlan { max-elements 1; leaf name { - /* vni devices are created of the form 'name'-vlanid - The kernel has a max limit of 15 chars for netdevices. - keeping aside 5 chars for hyphen and vlanid the - name should have a max of 10 chars */ - - type string { - length 1..10; - } + type string; } + must "string-length(name) != 0"; leaf src_ip { type inet:ip-address; } + + leaf dst_ip { + type inet:ip-address; + } } } From de1a73f57b89dbc81de42a451b0952995d0d4b2f Mon Sep 17 00:00:00 2001 From: anamehra <54692434+anamehra@users.noreply.github.com> Date: Thu, 23 May 2024 09:59:23 -0700 Subject: [PATCH 161/282] [multi-asic] Use asic_id/asic_name for APIs to get port config data (#18452) Fixes: https://github.com/sonic-net/sonic-buildimage/issues/18431 #### Why I did it sonic-cfggen misses handling for namespace at couple of locations. Due to this, when port config is fetched, it returns data from global config and not the namespace. The function calls for get_path_to_port_config_file get_port_config needs to be fixed to handle namespace for multi-asic. #### How I did it 1.Pass asic_id as argument when calling get_path_to_port_config_file() For single asic, asic_id is None and the function returns the correct port_config.ini file path. For multi-asic, using asic_id provides the correct file path for the asic. 2. Pass asic_name as argument when calling get_port_config() #### How to verify it sonic-cfggen -H --print -n -k This command should return the correct port config for the namespace. --- src/sonic-config-engine/sonic-cfggen | 4 ++-- .../tests/test_multinpu_cfggen.py | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index a3b54c756425..e3314d34fa42 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -359,9 +359,9 @@ def main(): }}} deep_update(data, hardware_data) if args.port_config is None: - args.port_config = device_info.get_path_to_port_config_file(hwsku) + args.port_config = device_info.get_path_to_port_config_file(hwsku, asic_id) load_namespace_config() - (ports, _, _) = get_port_config(hwsku, platform, args.port_config, asic_id) + (ports, _, _) = get_port_config(hwsku, platform, args.port_config, hwsku_config_file=args.hwsku_config, asic_name=asic_name) if ports is None: print('Failed to get port config', file=sys.stderr) sys.exit(1) diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index bc4227f85d52..665f2b9719a9 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -3,6 +3,7 @@ import os import shutil import subprocess +import sys import unittest import yaml import tests.common_utils as utils @@ -10,6 +11,10 @@ from unittest import TestCase from sonic_py_common.general import getstatusoutput_noshell +if sys.version_info.major == 3: + from unittest import mock +else: + import mock SKU = 'multi-npu-01' ASIC_SKU = 'multi-npu-asic' @@ -27,6 +32,7 @@ def setUp(self): self.sample_graph = os.path.join(self.test_data_dir, 'sample-minigraph.xml') self.sample_graph1 = os.path.join(self.test_data_dir, 'sample-minigraph-noportchannel.xml') self.sample_port_config = os.path.join(self.test_data_dir, 'sample_port_config.ini') + self.sample_port_config_0 = os.path.join(self.test_data_dir, 'sample_port_config-0.ini') self.port_config = [] for asic in range(NUM_ASIC): self.port_config.append(os.path.join(self.test_data_dir, "sample_port_config-{}.ini".format(asic))) @@ -227,6 +233,24 @@ def test_frontend_asic_ports(self): "Ethernet-BP8": { "admin_status": "up", "alias": "Eth6-ASIC0", "asic_port_name": "Eth6-ASIC0", "description": "ASIC3:Eth0-ASIC3", "index": "2", "lanes": "21,22,23,24", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, "Ethernet-BP12": { "admin_status": "up", "alias": "Eth7-ASIC0", "asic_port_name": "Eth7-ASIC0", "description": "ASIC3:Eth1-ASIC3", "index": "3", "lanes": "25,26,27,28", "mtu": "9100", "tpid": "0x8100", "pfc_asym": "off", "role": "Int", "speed": "40000" }}) + def test_hwsku_option_port_list_port_config_ini(self): + mock.patch('device_info.get_path_to_port_config_file', mock.MagicMock(return_value=self.sample_port_config_0)) + argument = ["-k", ASIC_SKU, "-n", "asic0", "-v", "PORT.keys()|list"] + output = self.run_script(argument) + self.assertEqual( + utils.liststr_to_dict(output.strip()), + utils.liststr_to_dict("['Ethernet0','Ethernet4','Ethernet8','Ethernet12','Ethernet-BP0','Ethernet-BP4','Ethernet-BP8','Ethernet-BP12']") + ) + + def test_hwsku_option_port_list_configdb(self): + mock.patch('device_info.get_path_to_port_config_file', mock.MagicMock(return_value=None)) + argument = ["-k", ASIC_SKU, "-n", "asic0", "-v", "PORT.keys()|list"] + output = self.run_script(argument) + self.assertEqual( + utils.liststr_to_dict(output.strip()), + utils.liststr_to_dict("['Ethernet0','Ethernet4','Ethernet8','Ethernet12','Ethernet-BP0','Ethernet-BP4','Ethernet-BP8','Ethernet-BP12']") + ) + def test_frontend_asic_ports_config_db(self): argument = ["-m", self.sample_graph, "-p", self.port_config[0], "-n", "asic0", "--var-json", "PORT"] output = json.loads(self.run_script(argument)) From 3ae0d8789bb2fa0b3d9a747f0d8975667944b591 Mon Sep 17 00:00:00 2001 From: Wenda Chu <32250288+w1nda@users.noreply.github.com> Date: Fri, 24 May 2024 01:15:44 +0800 Subject: [PATCH 162/282] Update dhcpservd.py (#19029) After dump new config, send SIGHUP to kea-dhcp4 process to force refresh config. --- .../dhcp_utilities/dhcpservd/dhcpservd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py index 7a9b65092aec..e8341e436b7c 100644 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcpservd.py @@ -59,8 +59,8 @@ def dump_dhcp4_config(self): self.used_options = used_options with open(self.kea_dhcp4_config_path, "w") as write_file: write_file.write(kea_dhcp4_config) - # After refresh kea-config, we need to SIGHUP kea-dhcp4 process to read new config - self._notify_kea_dhcp4_proc() + # After refresh kea-config, we need to SIGHUP kea-dhcp4 process to read new config + self._notify_kea_dhcp4_proc() def _update_dhcp_server_ip(self): """ From 3acd509826e48d8406d6dd37d0af473409368e55 Mon Sep 17 00:00:00 2001 From: Fei Zhou <156348280+fzhou-nokia@users.noreply.github.com> Date: Thu, 23 May 2024 13:25:30 -0400 Subject: [PATCH 163/282] [Nokia-7220 IXR] Add support for NOKIA 7220 IXR-H3, H4-32D, H5-64D platforms (#18497) * [Nokia-7220-H3] Add support for NOKIA 7220 IXR-H3 platform Add support for NOKIA 7220 IXR-H3: Platform: x86_64-nokia_ixr7220_h3-r0 HwSKU: Nokia-IXR7220-H3 ASIC: Broadcom Port Config: 32x400G + 2x10G --- .../Nokia-IXR7220-H3/ixr7220-h3.bcm | 284 +++ .../Nokia-IXR7220-H3/port_config.ini | 36 + .../Nokia-IXR7220-H3/profile.ini | 1 + .../Nokia-IXR7220-H3/sai.profile | 1 + .../x86_64-nokia_ixr7220_h3-r0/default_sku | 1 + .../x86_64-nokia_ixr7220_h3-r0/installer.conf | 4 + .../x86_64-nokia_ixr7220_h3-r0/pcie.yaml | 166 ++ .../x86_64-nokia_ixr7220_h3-r0/platform.json | 410 ++++ .../x86_64-nokia_ixr7220_h3-r0/platform_asic | 1 + .../plugins/eeprom.py | 20 + .../plugins/led_control.py | 110 ++ .../system_health_monitoring_config.json | 16 + .../thermal_policy.json | 67 + .../Nokia-IXR7220-H4-32D/ixr7220_h4_32d.bcm | 1645 +++++++++++++++++ .../Nokia-IXR7220-H4-32D/port_config.ini | 34 + .../Nokia-IXR7220-H4-32D/profile.ini | 1 + .../Nokia-IXR7220-H4-32D/sai.profile | 1 + .../default_sku | 1 + .../installer.conf | 1 + .../x86_64-nokia_ixr7220_h4_32d-r0/pcie.yaml | 119 ++ .../platform.json | 440 +++++ .../platform_asic | 1 + .../plugins/eeprom.py | 16 + .../plugins/led_control.py | 125 ++ .../system_health_monitoring_config.json | 14 + .../thermal_policy.json | 67 + .../Nokia-IXR7220-H5-64D/h5_64Dx400g.yml | 1121 +++++++++++ .../Nokia-IXR7220-H5-64D/port_config.ini | 68 + .../Nokia-IXR7220-H5-64D/profile.ini | 1 + .../Nokia-IXR7220-H5-64D/sai.profile | 1 + .../default_sku | 1 + .../installer.conf | 0 .../platform.json | 464 +++++ .../platform_asic | 1 + .../plugins/eeprom.py | 16 + .../plugins/led_control.py | 125 ++ .../system_health_monitoring_config.json | 14 + .../thermal_policy.json | 67 + platform/broadcom/one-image.mk | 3 + platform/broadcom/platform-modules-nokia.mk | 21 +- .../broadcom/sonic-platform-modules-nokia | 2 +- 41 files changed, 5485 insertions(+), 2 deletions(-) create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/ixr7220-h3.bcm create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/port_config.ini create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/profile.ini create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/sai.profile create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/default_sku create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/installer.conf create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/pcie.yaml create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/platform.json create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/platform_asic create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/plugins/eeprom.py create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/plugins/led_control.py create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/system_health_monitoring_config.json create mode 100644 device/nokia/x86_64-nokia_ixr7220_h3-r0/thermal_policy.json create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/ixr7220_h4_32d.bcm create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/port_config.ini create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/profile.ini create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/sai.profile create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/default_sku create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/installer.conf create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/pcie.yaml create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform_asic create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/plugins/eeprom.py create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/plugins/led_control.py create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/system_health_monitoring_config.json create mode 100644 device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/thermal_policy.json create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/h5_64Dx400g.yml create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/port_config.ini create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/profile.ini create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/sai.profile create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/default_sku create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/installer.conf create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform_asic create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/plugins/eeprom.py create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/plugins/led_control.py create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/system_health_monitoring_config.json create mode 100644 device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/thermal_policy.json diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/ixr7220-h3.bcm b/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/ixr7220-h3.bcm new file mode 100644 index 000000000000..bd0af5a7b9fd --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/ixr7220-h3.bcm @@ -0,0 +1,284 @@ +######################################### +## cfg for NOKIA IXR7220 H3 +######################################### +pbmp_xport_xe=0x8000f8000fc000f8000f8000f8000fc000f8001e +ccm_dma_enable=0 +ccmdma_intr_enable=0 +ctr_evict_enable=0 +mem_cache_enable=0 +parity_correction=0 +parity_enable=0 +phy_enable=0 +phy_null=1 +pll_bypass=1 +init_all_modules=0 +sai_tunnel_global_sip_mask_enable=1 +bcm_tunnel_term_compatible_mode=1 +l3_alpm_enable=2 +l3_mem_entries=16384 +################################################################################ +# Pipe 0 +portmap_1=1:400 +portmap_2=9:400 +portmap_3=17:400 +portmap_4=25:400 + +#loopback port +portmap_19=259:10 +################################################################################ +# Pipe 1 +portmap_20=33:400 +portmap_21=41:400 +portmap_22=49:400 +portmap_23=57:400 + +#management port +portmap_38=257:10 + +#loopback port +portmap_39=260:10 +################################################################################ +# Pipe 2 +portmap_40=65:400 +portmap_41=73:400 +portmap_42=81:400 +portmap_43=89:400 + +#loopback port +portmap_59=261:10 +################################################################################ +# Pipe 3 +portmap_60=97:400 +portmap_61=105:400 +portmap_62=113:400 +portmap_63=121:400 + +#loopback port +portmap_79=262:10 +################################################################################ +# Pipe 4 +portmap_80=129:400 +portmap_81=137:400 +portmap_82=145:400 +portmap_83=153:400 + +#loopback port +portmap_99=263:10 +################################################################################ +# Pipe 5 +portmap_100=161:400 +portmap_101=169:400 +portmap_102=177:400 +portmap_103=185:400 + +#management port +portmap_118=258:10 + +#loopback port +portmap_119=264:10 +################################################################################ +# Pipe 6 +portmap_120=193:400 +portmap_121=201:400 +portmap_122=209:400 +portmap_123=217:400 + +#loopback port +portmap_139=265:10 +################################################################################ +# Pipe 7 +portmap_140=225:400 +portmap_141=233:400 +portmap_142=241:400 +portmap_143=249:400 + +#loopback port +portmap_159=266:10 +################################################################################ +dport_map_enable=1 + +dport_map_port_1=3 +dport_map_port_2=4 +dport_map_port_3=1 +dport_map_port_4=2 +dport_map_port_20=7 +dport_map_port_21=8 +dport_map_port_22=5 +dport_map_port_23=6 +dport_map_port_40=11 +dport_map_port_41=12 +dport_map_port_42=9 +dport_map_port_43=10 +dport_map_port_60=15 +dport_map_port_61=16 +dport_map_port_62=13 +dport_map_port_63=14 +dport_map_port_80=17 +dport_map_port_81=18 +dport_map_port_82=19 +dport_map_port_83=20 +dport_map_port_100=21 +dport_map_port_101=22 +dport_map_port_102=23 +dport_map_port_103=24 +dport_map_port_120=25 +dport_map_port_121=26 +dport_map_port_122=27 +dport_map_port_123=28 +dport_map_port_140=29 +dport_map_port_141=30 +dport_map_port_142=31 +dport_map_port_143=32 + +dport_map_port_38=33 +dport_map_port_118=34 +################################################################################ +# tx_lane map +phy_chain_tx_lane_map_physical{1.0}=0x14762350 +phy_chain_tx_lane_map_physical{9.0}=0x36104527 +phy_chain_tx_lane_map_physical{17.0}=0x17053624 +phy_chain_tx_lane_map_physical{25.0}=0x57314602 +phy_chain_tx_lane_map_physical{33.0}=0x46302517 +phy_chain_tx_lane_map_physical{41.0}=0x76203514 +phy_chain_tx_lane_map_physical{49.0}=0x26143507 +phy_chain_tx_lane_map_physical{57.0}=0x74236510 +phy_chain_tx_lane_map_physical{65.0}=0x75021436 +phy_chain_tx_lane_map_physical{73.0}=0x67210435 +phy_chain_tx_lane_map_physical{81.0}=0x26143507 +phy_chain_tx_lane_map_physical{89.0}=0x75436120 +phy_chain_tx_lane_map_physical{97.0}=0x54621730 +phy_chain_tx_lane_map_physical{105.0}=0x64310725 +phy_chain_tx_lane_map_physical{113.0}=0x07352416 +phy_chain_tx_lane_map_physical{121.0}=0x13762054 +phy_chain_tx_lane_map_physical{129.0}=0x13427506 +phy_chain_tx_lane_map_physical{137.0}=0x54307612 +phy_chain_tx_lane_map_physical{145.0}=0x76103524 +phy_chain_tx_lane_map_physical{153.0}=0x67103425 +phy_chain_tx_lane_map_physical{161.0}=0x15402637 +phy_chain_tx_lane_map_physical{169.0}=0x76135420 +phy_chain_tx_lane_map_physical{177.0}=0x67052431 +phy_chain_tx_lane_map_physical{185.0}=0x57103624 +phy_chain_tx_lane_map_physical{193.0}=0x15402637 +phy_chain_tx_lane_map_physical{201.0}=0x54137620 +phy_chain_tx_lane_map_physical{209.0}=0x56012734 +phy_chain_tx_lane_map_physical{217.0}=0x57301426 +phy_chain_tx_lane_map_physical{225.0}=0x07352641 +phy_chain_tx_lane_map_physical{233.0}=0x57236401 +phy_chain_tx_lane_map_physical{241.0}=0x16543720 +phy_chain_tx_lane_map_physical{249.0}=0x50273416 + +# rx_lane_map +phy_chain_rx_lane_map_physical{1.0}=0x42305761 +phy_chain_rx_lane_map_physical{9.0}=0x13605472 +phy_chain_rx_lane_map_physical{17.0}=0x41730652 +phy_chain_rx_lane_map_physical{25.0}=0x71206534 +phy_chain_rx_lane_map_physical{33.0}=0x62170453 +phy_chain_rx_lane_map_physical{41.0}=0x27641305 +phy_chain_rx_lane_map_physical{49.0}=0x53604271 +phy_chain_rx_lane_map_physical{57.0}=0x31607425 +phy_chain_rx_lane_map_physical{65.0}=0x47612350 +phy_chain_rx_lane_map_physical{73.0}=0x23471605 +phy_chain_rx_lane_map_physical{81.0}=0x43710265 +phy_chain_rx_lane_map_physical{89.0}=0x31706425 +phy_chain_rx_lane_map_physical{97.0}=0x60317425 +phy_chain_rx_lane_map_physical{105.0}=0x40635172 +phy_chain_rx_lane_map_physical{113.0}=0x20573146 +phy_chain_rx_lane_map_physical{121.0}=0x51204637 +phy_chain_rx_lane_map_physical{129.0}=0x34102567 +phy_chain_rx_lane_map_physical{137.0}=0x70143526 +phy_chain_rx_lane_map_physical{145.0}=0x20316574 +phy_chain_rx_lane_map_physical{153.0}=0x13572046 +phy_chain_rx_lane_map_physical{161.0}=0x61253074 +phy_chain_rx_lane_map_physical{169.0}=0x61043527 +phy_chain_rx_lane_map_physical{177.0}=0x43617250 +phy_chain_rx_lane_map_physical{185.0}=0x31067425 +phy_chain_rx_lane_map_physical{193.0}=0x35162074 +phy_chain_rx_lane_map_physical{201.0}=0x30146527 +phy_chain_rx_lane_map_physical{209.0}=0x73506241 +phy_chain_rx_lane_map_physical{217.0}=0x73241605 +phy_chain_rx_lane_map_physical{225.0}=0x26573140 +phy_chain_rx_lane_map_physical{233.0}=0x46213750 +phy_chain_rx_lane_map_physical{241.0}=0x13650274 +phy_chain_rx_lane_map_physical{249.0}=0x42305167 + +# tx polarity +serdes_core_tx_polarity_flip_physical{1}=0x5d +serdes_core_tx_polarity_flip_physical{9}=0x9c +serdes_core_tx_polarity_flip_physical{17}=0x72 +serdes_core_tx_polarity_flip_physical{25}=0xad +serdes_core_tx_polarity_flip_physical{33}=0x38 +serdes_core_tx_polarity_flip_physical{41}=0x86 +serdes_core_tx_polarity_flip_physical{49}=0xaf +serdes_core_tx_polarity_flip_physical{57}=0xc6 +serdes_core_tx_polarity_flip_physical{65}=0x70 +serdes_core_tx_polarity_flip_physical{73}=0xc7 +serdes_core_tx_polarity_flip_physical{81}=0xae +serdes_core_tx_polarity_flip_physical{89}=0xe0 +serdes_core_tx_polarity_flip_physical{97}=0xf1 +serdes_core_tx_polarity_flip_physical{105}=0x0c +serdes_core_tx_polarity_flip_physical{113}=0xc8 +serdes_core_tx_polarity_flip_physical{121}=0x3f +serdes_core_tx_polarity_flip_physical{129}=0x8b +serdes_core_tx_polarity_flip_physical{137}=0x77 +serdes_core_tx_polarity_flip_physical{145}=0x39 +serdes_core_tx_polarity_flip_physical{153}=0xa5 +serdes_core_tx_polarity_flip_physical{161}=0xd8 +serdes_core_tx_polarity_flip_physical{169}=0x8b +serdes_core_tx_polarity_flip_physical{177}=0x29 +serdes_core_tx_polarity_flip_physical{185}=0x30 +serdes_core_tx_polarity_flip_physical{193}=0xf8 +serdes_core_tx_polarity_flip_physical{201}=0x8a +serdes_core_tx_polarity_flip_physical{209}=0xb8 +serdes_core_tx_polarity_flip_physical{217}=0x08 +serdes_core_tx_polarity_flip_physical{225}=0xb3 +serdes_core_tx_polarity_flip_physical{233}=0x62 +serdes_core_tx_polarity_flip_physical{241}=0x70 +serdes_core_tx_polarity_flip_physical{249}=0xd2 + +# rx poplarity +serdes_core_rx_polarity_flip_physical{1}=0x18 +serdes_core_rx_polarity_flip_physical{9}=0xa0 +serdes_core_rx_polarity_flip_physical{17}=0x9c +serdes_core_rx_polarity_flip_physical{25}=0x47 +serdes_core_rx_polarity_flip_physical{33}=0xf5 +serdes_core_rx_polarity_flip_physical{41}=0x38 +serdes_core_rx_polarity_flip_physical{49}=0x87 +serdes_core_rx_polarity_flip_physical{57}=0x1a +serdes_core_rx_polarity_flip_physical{65}=0xf0 +serdes_core_rx_polarity_flip_physical{73}=0x68 +serdes_core_rx_polarity_flip_physical{81}=0x96 +serdes_core_rx_polarity_flip_physical{89}=0x32 +serdes_core_rx_polarity_flip_physical{97}=0x5a +serdes_core_rx_polarity_flip_physical{105}=0xb4 +serdes_core_rx_polarity_flip_physical{113}=0xe1 +serdes_core_rx_polarity_flip_physical{121}=0x4a +serdes_core_rx_polarity_flip_physical{129}=0xf3 +serdes_core_rx_polarity_flip_physical{137}=0xc3 +serdes_core_rx_polarity_flip_physical{145}=0x12 +serdes_core_rx_polarity_flip_physical{153}=0xb4 +serdes_core_rx_polarity_flip_physical{161}=0xf0 +serdes_core_rx_polarity_flip_physical{169}=0xa7 +serdes_core_rx_polarity_flip_physical{177}=0xe1 +serdes_core_rx_polarity_flip_physical{185}=0x90 +serdes_core_rx_polarity_flip_physical{193}=0x0a +serdes_core_rx_polarity_flip_physical{201}=0x4e +serdes_core_rx_polarity_flip_physical{209}=0x5a +serdes_core_rx_polarity_flip_physical{217}=0x98 +serdes_core_rx_polarity_flip_physical{225}=0x2f +serdes_core_rx_polarity_flip_physical{233}=0x5b +serdes_core_rx_polarity_flip_physical{241}=0xf4 +serdes_core_rx_polarity_flip_physical{249}=0x1d +################################################################################ +#firmware load, use fast load +load_firmware=0x2 + +core_clock_frequency=1325 +dpr_clock_frequency=1000 +device_clock_frequency=1325 +port_flex_enable=1 + + +################################################################################ +serdes_tx_taps_cd=pam4:-20:142:0:0:6:0 + +sai_tunnel_global_sip_mask_enable=1 diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/port_config.ini b/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/port_config.ini new file mode 100644 index 000000000000..f5a81b7f6cd8 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/port_config.ini @@ -0,0 +1,36 @@ +# name lanes alias index speed +Ethernet0 17,18,19,20,21,22,23,24 fourhundredGigE1/1 1 400000 +Ethernet4 25,26,27,28,29,30,31,32 fourhundredGigE1/2 2 400000 +Ethernet8 1,2,3,4,5,6,7,8 fourhundredGigE1/3 3 400000 +Ethernet12 9,10,11,12,13,14,15,16 fourhundredGigE1/4 4 400000 +Ethernet16 49,50,51,52,53,54,55,56 fourhundredGigE1/5 5 400000 +Ethernet20 57,58,59,60,61,62,63,64 fourhundredGigE1/6 6 400000 +Ethernet24 33,34,35,36,37,38,39,40 fourhundredGigE1/7 7 400000 +Ethernet28 41,42,43,44,45,46,47,48 fourhundredGigE1/8 8 400000 +Ethernet32 81,82,83,84,85,86,87,88 fourhundredGigE1/9 9 400000 +Ethernet36 89,90,91,92,93,94,95,96 fourhundredGigE1/10 10 400000 +Ethernet40 65,66,67,68,69,70,71,72 fourhundredGigE1/11 11 400000 +Ethernet44 73,74,75,76,77,78,79,80 fourhundredGigE1/12 12 400000 +Ethernet48 113,114,115,116,117,118,119,120 fourhundredGigE1/13 13 400000 +Ethernet52 121,122,123,124,125,126,127,128 fourhundredGigE1/14 14 400000 +Ethernet56 97,98,99,100,101,102,103,104 fourhundredGigE1/15 15 400000 +Ethernet60 105,106,107,108,109,110,111,112 fourhundredGigE1/16 16 400000 +Ethernet64 129,130,131,132,133,134,135,136 fourhundredGigE1/17 17 400000 +Ethernet68 137,138,139,140,141,142,143,144 fourhundredGigE1/18 18 400000 +Ethernet72 145,146,147,148,149,150,151,152 fourhundredGigE1/19 19 400000 +Ethernet76 153,154,155,156,157,158,159,160 fourhundredGigE1/20 20 400000 +Ethernet80 161,162,163,164,165,166,167,168 fourhundredGigE1/21 21 400000 +Ethernet84 169,170,171,172,173,174,175,176 fourhundredGigE1/22 22 400000 +Ethernet88 177,178,179,180,181,182,183,184 fourhundredGigE1/23 23 400000 +Ethernet92 185,186,187,188,189,190,191,192 fourhundredGigE1/24 24 400000 +Ethernet96 193,194,195,196,197,198,199,200 fourhundredGigE1/25 25 400000 +Ethernet100 201,202,203,204,205,206,207,208 fourhundredGigE1/26 26 400000 +Ethernet104 209,210,211,212,213,214,215,216 fourhundredGigE1/27 27 400000 +Ethernet108 217,218,219,220,221,222,223,224 fourhundredGigE1/28 28 400000 +Ethernet112 225,226,227,228,229,230,231,232 fourhundredGigE1/29 29 400000 +Ethernet116 233,234,235,236,237,238,239,240 fourhundredGigE1/30 30 400000 +Ethernet120 241,242,243,244,245,246,247,248 fourhundredGigE1/31 31 400000 +Ethernet124 249,250,251,252,253,254,255,256 fourhundredGigE1/32 32 400000 +Ethernet128 257 tenGigE1/33 33 10000 +Ethernet132 258 tenGigE1/34 34 10000 + diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/profile.ini b/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/profile.ini new file mode 100644 index 000000000000..4eda67c91a69 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/profile.ini @@ -0,0 +1 @@ +switchMacAddress=XX:XX:XX:XX:XX:XX diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/sai.profile b/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/sai.profile new file mode 100644 index 000000000000..cb4b923638f6 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/Nokia-IXR7220-H3/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/ixr7220-h3.bcm diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/default_sku b/device/nokia/x86_64-nokia_ixr7220_h3-r0/default_sku new file mode 100644 index 000000000000..e9b60ed08521 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/default_sku @@ -0,0 +1 @@ +Nokia-IXR7220-H3 t1 diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/installer.conf b/device/nokia/x86_64-nokia_ixr7220_h3-r0/installer.conf new file mode 100644 index 000000000000..1605db9e6fd8 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/installer.conf @@ -0,0 +1,4 @@ +CONSOLE_PORT=0x3f8 +CONSOLE_DEV=0 +CONSOLE_SPEED=115200 +#ONIE_PLATFORM_EXTRA_CMDLINE_LINUX=" intel_iommu=off" diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/pcie.yaml b/device/nokia/x86_64-nokia_ixr7220_h3-r0/pcie.yaml new file mode 100644 index 000000000000..755b4f2a0ab0 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/pcie.yaml @@ -0,0 +1,166 @@ +- bus: '00' + dev: '00' + fn: '0' + id: '1980' + name: 'Host bridge: Intel Corporation Atom Processor C3000 Series System Agent (rev + 11)' +- bus: '00' + dev: '04' + fn: '0' + id: 19a1 + name: 'Host bridge: Intel Corporation Atom Processor C3000 Series Error Registers + (rev 11)' +- bus: '00' + dev: '05' + fn: '0' + id: 19a2 + name: 'Generic system peripheral [0807]: Intel Corporation Atom Processor C3000 + Series Root Complex Event Collector (rev 11)' +- bus: '00' + dev: '06' + fn: '0' + id: 19a3 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated QAT + Root Port (rev 11)' +- bus: '00' + dev: 09 + fn: '0' + id: 19a4 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #0 (rev 11)' +- bus: '00' + dev: 0b + fn: '0' + id: 19a6 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #2 (rev 11)' +- bus: '00' + dev: 0e + fn: '0' + id: 19a8 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #4 (rev 11)' +- bus: '00' + dev: 0f + fn: '0' + id: 19a9 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #5 (rev 11)' +- bus: '00' + dev: '10' + fn: '0' + id: 19aa + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #6 (rev 11)' +- bus: '00' + dev: '11' + fn: '0' + id: 19ab + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #7 (rev 11)' +- bus: '00' + dev: '12' + fn: '0' + id: 19ac + name: 'System peripheral: Intel Corporation Atom Processor C3000 Series SMBus Contoller + - Host (rev 11)' +- bus: '00' + dev: '14' + fn: '0' + id: 19c2 + name: 'SATA controller: Intel Corporation Atom Processor C3000 Series SATA Controller + 1 (rev 11)' +- bus: '00' + dev: '15' + fn: '0' + id: 19d0 + name: 'USB controller: Intel Corporation Atom Processor C3000 Series USB 3.0 xHCI + Controller (rev 11)' +- bus: '00' + dev: '16' + fn: '0' + id: 19d1 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated LAN + Root Port #0 (rev 11)' +- bus: '00' + dev: '17' + fn: '0' + id: 19d2 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated LAN + Root Port #1 (rev 11)' +- bus: '00' + dev: '18' + fn: '0' + id: 19d3 + name: 'Communication controller: Intel Corporation Atom Processor C3000 Series ME + HECI 1 (rev 11)' +- bus: '00' + dev: 1c + fn: '0' + id: 19db + name: 'SD Host controller: Intel Corporation Device 19db (rev 11)' +- bus: '00' + dev: 1f + fn: '0' + id: 19dc + name: 'ISA bridge: Intel Corporation Atom Processor C3000 Series LPC or eSPI (rev + 11)' +- bus: '00' + dev: 1f + fn: '2' + id: 19de + name: 'Memory controller: Intel Corporation Atom Processor C3000 Series Power Management + Controller (rev 11)' +- bus: '00' + dev: 1f + fn: '4' + id: 19df + name: 'SMBus: Intel Corporation Atom Processor C3000 Series SMBus controller (rev + 11)' +- bus: '00' + dev: 1f + fn: '5' + id: 19e0 + name: 'Serial bus controller [0c80]: Intel Corporation Atom Processor C3000 Series + SPI Controller (rev 11)' +- bus: '01' + dev: '00' + fn: '0' + id: 19e2 + name: 'Co-processor: Intel Corporation Atom Processor C3000 Series QuickAssist Technology + (rev 11)' +- bus: '02' + dev: '00' + fn: '0' + id: b980 + name: 'Ethernet controller: Broadcom Inc. and subsidiaries Device b980 (rev 11)' +- bus: '04' + dev: '00' + fn: '0' + id: '1533' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 03)' +- bus: 08 + dev: '00' + fn: '0' + id: 15e4 + name: 'Ethernet controller: Intel Corporation Ethernet Connection X553 1GbE (rev + 11)' +- bus: 08 + dev: '00' + fn: '1' + id: 15e4 + name: 'Ethernet controller: Intel Corporation Ethernet Connection X553 1GbE (rev + 11)' +- bus: 09 + dev: '00' + fn: '0' + id: 15c3 + name: 'Ethernet controller: Intel Corporation Ethernet Connection X553 Backplane + (rev 11)' +- bus: 09 + dev: '00' + fn: '1' + id: 15c3 + name: 'Ethernet controller: Intel Corporation Ethernet Connection X553 Backplane + (rev 11)' diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/platform.json b/device/nokia/x86_64-nokia_ixr7220_h3-r0/platform.json new file mode 100644 index 000000000000..ae1a111fe0d4 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/platform.json @@ -0,0 +1,410 @@ +{ + "chassis": { + "name": "7220 IXR-H3", + "components": [ + { + "name": "CPU-PLD" + }, + { + "name": "SW1-PLD" + }, + { + "name": "SW2-PLD" + }, + { + "name": "SW3-PLD" + } + ], + "fans": [ + { + "name": "Fan1", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan2", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan3", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan4", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan5", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan6", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan7", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan8", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan9", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan10", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan11", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan12", + "status_led": { + "controllable": false + } + } + ], + "fan_drawers": [ + { + "name": "drawer1", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan1", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan2", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer2", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan3", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan4", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer3", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan5", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan6", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer4", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan7", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan8", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer5", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan9", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan10", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer6", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan11", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan12", + "status_led": { + "controllable": false + } + } + ] + } + ], + "psus": [ + { + "name": "PSU1", + "status_led": { + "controllable": false + }, + "current": false, + "power": false, + "max_power": false, + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "temperature": false + }, + { + "name": "PSU2", + "status_led": { + "controllable": false + }, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "temperature": false + } + ], + "thermals": [ + { + "name": "cpu", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "fan board", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MAC top", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MAC down", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "main board1", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "main board2", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MAC internal", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + } + ], + "sfps": [ + { + "name": "QSFPDD_1" + }, + { + "name": "QSFPDD_2" + }, + { + "name": "QSFPDD_3" + }, + { + "name": "QSFPDD_4" + }, + { + "name": "QSFPDD_5" + }, + { + "name": "QSFPDD_6" + }, + { + "name": "QSFPDD_7" + }, + { + "name": "QSFPDD_8" + }, + { + "name": "QSFPDD_9" + }, + { + "name": "QSFPDD_10" + }, + { + "name": "QSFPDD_11" + }, + { + "name": "QSFPDD_12" + }, + { + "name": "QSFPDD_13" + }, + { + "name": "QSFPDD_14" + }, + { + "name": "QSFPDD_15" + }, + { + "name": "QSFPDD_16" + }, + { + "name": "QSFPDD_17" + }, + { + "name": "QSFPDD_18" + }, + { + "name": "QSFPDD_19" + }, + { + "name": "QSFPDD_20" + }, + { + "name": "QSFPDD_21" + }, + { + "name": "QSFPDD_22" + }, + { + "name": "QSFPDD_23" + }, + { + "name": "QSFPDD_24" + }, + { + "name": "QSFPDD_25" + }, + { + "name": "QSFPDD_26" + }, + { + "name": "QSFPDD_27" + }, + { + "name": "QSFPDD_28" + }, + { + "name": "QSFPDD_29" + }, + { + "name": "QSFPDD_30" + }, + { + "name": "QSFPDD_31" + }, + { + "name": "QSFPDD_32" + }, + { + "name": "SFP+_0" + }, + { + "name": "SFP+_1" + } + ] + }, + "interfaces": {} +} diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/platform_asic b/device/nokia/x86_64-nokia_ixr7220_h3-r0/platform_asic new file mode 100644 index 000000000000..960467652765 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/platform_asic @@ -0,0 +1 @@ +broadcom diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/plugins/eeprom.py b/device/nokia/x86_64-nokia_ixr7220_h3-r0/plugins/eeprom.py new file mode 100644 index 000000000000..aba8801bdc21 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/plugins/eeprom.py @@ -0,0 +1,20 @@ +try: + import os + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class board(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self, name, path, cpld_root, ro): + self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0053/eeprom" + if not os.path.exists(self.eeprom_path): + file = "/sys/class/i2c-adapter/i2c-0/new_device" + with open(file, 'w') as f: + f.write('24c02 0x53\n') + super(board, self).__init__(self.eeprom_path, 0, '', True) + + # def __init__(self, name, path, cpld_root, ro): + # self.eeprom_path = "/etc/sonic/nokia/syseeprom.bin" + # super(board, self).__init__(self.eeprom_path, 0, '', True) \ No newline at end of file diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/plugins/led_control.py b/device/nokia/x86_64-nokia_ixr7220_h3-r0/plugins/led_control.py new file mode 100644 index 000000000000..f61527504969 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/plugins/led_control.py @@ -0,0 +1,110 @@ +# +# led_control.py +# +# Platform-specific LED control functionality for SONiC +# + +try: + from sonic_led.led_control_base import LedControlBase + import os + import time + import syslog + import sonic_platform.platform + import sonic_platform.chassis +except ImportError as e: + raise ImportError(str(e) + " - required module not found") + +SWPLD1_DIR = "/sys/bus/i2c/devices/17-0032/" +MAX_7220H3_FAN_DRAWERS = 6 +MAX_7220H3_FANS_PER_DRAWER = 2 + +def DBG_PRINT(str): + syslog.openlog("nokia-led") + syslog.syslog(syslog.LOG_INFO, str) + syslog.closelog() + + +class LedControl(LedControlBase): + """Platform specific LED control class""" + + # Constructor + def __init__(self): + self.chassis = sonic_platform.platform.Platform().get_chassis() + self._initDefaultConfig() + + def _initDefaultConfig(self): + # The fan tray leds and system led managed by new chassis class API + # leaving only a couple other front panel leds to be done old style + DBG_PRINT("starting system leds") + self._initSystemLed() + DBG_PRINT(" led done") + + def _read_sysfs_file(self, sysfs_file): + # On successful read, returns the value read from given + # reg_name and on failure returns 'ERR' + rv = 'ERR' + + if (not os.path.isfile(sysfs_file)): + return rv + try: + with open(sysfs_file, 'r') as fd: + rv = fd.read() + except Exception as e: + rv = 'ERR' + + rv = rv.rstrip('\r\n') + rv = rv.lstrip(" ") + return rv + + def _write_sysfs_file(self, sysfs_file, value): + # On successful write, the value read will be written on + # reg_name and on failure returns 'ERR' + rv = 'ERR' + + if (not os.path.isfile(sysfs_file)): + return rv + try: + with open(sysfs_file, 'w') as fd: + rv = fd.write(str(value)) + except Exception as e: + rv = 'ERR' + + return rv + + def _initSystemLed(self): + # Front Panel System LEDs setting + oldfan = 0xf # 0=amber, 1=green + oldpsu = 0xf # 0=amber, 1=green + + # Write sys led + status = self._write_sysfs_file(SWPLD1_DIR+"led_sys", "1") + if status == "ERR": + DBG_PRINT(" System LED NOT set correctly") + else: + DBG_PRINT(" System LED set O.K. ") + + # Timer loop to monitor and set front panel Status, Fan, and PSU LEDs + while True: + # Front Panel FAN Panel LED setting + good_fan = 0 + for fan in self.chassis._fan_list: + if fan.get_status() == True: + good_fan = good_fan + 1 + + if (good_fan == MAX_7220H3_FAN_DRAWERS * MAX_7220H3_FANS_PER_DRAWER): + if (os.path.isfile(SWPLD1_DIR+"led_fan")): + if oldfan != 0x1: + self._write_sysfs_file(SWPLD1_DIR+"led_fan", "1") + oldfan = 0x1 + else: + oldfan = 0xf + else: + if (os.path.isfile(SWPLD1_DIR+"led_fan")): + if oldfan != 0x0: + self._write_sysfs_file(SWPLD1_DIR+"led_fan", "2") + oldfan = 0x0 + else: + oldfan = 0xf + + time.sleep(6) + diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/system_health_monitoring_config.json b/device/nokia/x86_64-nokia_ixr7220_h3-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..b4c438a104d9 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/system_health_monitoring_config.json @@ -0,0 +1,16 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.temperature", + "fan", + "psu" + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "amber", + "normal": "green", + "booting": "blinking green" + } +} diff --git a/device/nokia/x86_64-nokia_ixr7220_h3-r0/thermal_policy.json b/device/nokia/x86_64-nokia_ixr7220_h3-r0/thermal_policy.json new file mode 100644 index 000000000000..667d82dac0a3 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h3-r0/thermal_policy.json @@ -0,0 +1,67 @@ +{ + "thermal_control_algorithm": { + "run_at_boot_up": "false", + "fan_speed_when_suspend": "65" + }, + "info_types": [ + { + "type": "fan_info" + }, + { + "type": "thermal_info" + }, + { + "type": "chassis_info" + } + ], + "policies": [ + { + "name": "any fan absence", + "conditions": [ + { + "type": "fan.any.absence" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "false" + }, + { + "type": "fan.all.set_speed", + "speed": "100" + } + ] + }, + { + "name": "all fan presence", + "conditions": [ + { + "type": "fan.all.presence" + } + ], + "actions": [ + { + "type": "thermal.temp_check_and_set_all_fan_speed", + "default_speed": "40", + "threshold1_speed": "55", + "threshold2_speed": "80", + "hightemp_speed": "100" + } + ] + }, + { + "name": "temp over high critical threshold", + "conditions": [ + { + "type": "thermal.over.high_critical_threshold" + } + ], + "actions": [ + { + "type": "switch.shutdown" + } + ] + } + ] +} diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/ixr7220_h4_32d.bcm b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/ixr7220_h4_32d.bcm new file mode 100644 index 000000000000..bf354d4526e4 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/ixr7220_h4_32d.bcm @@ -0,0 +1,1645 @@ +# $Copyright: Broadcom Ltd.$ +# $Copyright: Nokia +# +# BCM56993 32x400g port configuration. +# Support pipe numbers: 0, 1, 2, 3, 12, 13, 14, 15 +# +# configuration yaml file +# device: +# : +#
: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + + # vxlan + l3_alpm_template: 1 + riot_overlay_l3_egress_mem_size: 16384 + riot_overlay_l3_intf_mem_size: 4096 + l3_ecmp_member_first_lkup_mem_size: 12288 + bcm_tunnel_term_compatible_mode: 1 + shared_l2_tunnel: 1 + sai_tunnel_support: 10 + sai_tunnel_underlay_route_mode: 2 + sai_tunnel_ecmp_sharing_mode: 0 # change to 2 if SAI_NEXT_HOP_GROUP_ATTR_LEVEL_1 used + + # bfd + #bfd_enable: 1 + #bfd_sha1_keys: 5 + #bfd_num_sessions: 2048 + #bfd_simple_password_keys: 5 + #num_queues_pci: 47 + #num_queues_uc0: 1 + #bfd_feature_enable: 1 + #bfd_use_endpoint_id_as_discriminator: 1 + #bfd_tx_raw_ingress_enable: 1 + #sai_eapp_config_file: "/usr/share/sonic/device/x86_64-broadcom_common/eapps/eapp_config.json" +--- +device: + 0: + PC_SERDES_CONFIG: + PKG_SWAP_BYPASS: 1 + + PC_PM_CORE: + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x72306451 + TX_LANE_MAP: 0x14670235 + RX_POLARITY_FLIP: 0xff + TX_POLARITY_FLIP: 0xab + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x20635471 + TX_LANE_MAP: 0x26134705 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0xfc + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x46217035 + TX_LANE_MAP: 0x40536172 + RX_POLARITY_FLIP: 0xf3 + TX_POLARITY_FLIP: 0x80 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x25643170 + TX_LANE_MAP: 0x20751364 + RX_POLARITY_FLIP: 0xfb + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x07623415 + TX_LANE_MAP: 0x02746153 + RX_POLARITY_FLIP: 0xeb + TX_POLARITY_FLIP: 0x68 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x37640215 + TX_LANE_MAP: 0x67130524 + RX_POLARITY_FLIP: 0x40 + TX_POLARITY_FLIP: 0x45 + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17320645 + TX_LANE_MAP: 0x71536240 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x28 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x30716245 + TX_LANE_MAP: 0x64107523 + RX_POLARITY_FLIP: 0x7e + TX_POLARITY_FLIP: 0x14 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x46712350 + TX_LANE_MAP: 0x74031526 + RX_POLARITY_FLIP: 0x9d + TX_POLARITY_FLIP: 0x08 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76125340 + TX_LANE_MAP: 0x13645072 + RX_POLARITY_FLIP: 0x40 + TX_POLARITY_FLIP: 0xd9 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x43601275 + TX_LANE_MAP: 0x36251407 + RX_POLARITY_FLIP: 0xdF + TX_POLARITY_FLIP: 0x29 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x65423170 + TX_LANE_MAP: 0x23170465 + RX_POLARITY_FLIP: 0xfe + TX_POLARITY_FLIP: 0x54 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71306245 + TX_LANE_MAP: 0x45721630 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0xec + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62514370 + TX_LANE_MAP: 0x31745260 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0x74 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x20574136 + TX_LANE_MAP: 0x17352406 + RX_POLARITY_FLIP: 0x45 + TX_POLARITY_FLIP: 0x10 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x07561423 + TX_LANE_MAP: 0x56137402 + RX_POLARITY_FLIP: 0xfb + TX_POLARITY_FLIP: 0x33 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13240576 + TX_LANE_MAP: 0x31524706 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x95 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32450716 + TX_LANE_MAP: 0x42610573 + RX_POLARITY_FLIP: 0x05 + TX_POLARITY_FLIP: 0xcc + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x74632150 + TX_LANE_MAP: 0x12704365 + RX_POLARITY_FLIP: 0x3a + TX_POLARITY_FLIP: 0xd8 + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23564107 + TX_LANE_MAP: 0x76023514 + RX_POLARITY_FLIP: 0xcc + TX_POLARITY_FLIP: 0x7e + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x35726041 + TX_LANE_MAP: 0x40156273 + RX_POLARITY_FLIP: 0x28 + TX_POLARITY_FLIP: 0x7e + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x34016257 + TX_LANE_MAP: 0x76534012 + RX_POLARITY_FLIP: 0x80 + TX_POLARITY_FLIP: 0x22 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x16743520 + TX_LANE_MAP: 0x23416075 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0x26 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x64037152 + TX_LANE_MAP: 0x64732150 + RX_POLARITY_FLIP: 0x77 + TX_POLARITY_FLIP: 0x6a + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x42537061 + TX_LANE_MAP: 0x50246173 + RX_POLARITY_FLIP: 0x32 + TX_POLARITY_FLIP: 0x5e + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31207564 + TX_LANE_MAP: 0x01734562 + RX_POLARITY_FLIP: 0x08 + TX_POLARITY_FLIP: 0x23 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x51473062 + TX_LANE_MAP: 0x62705341 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62471305 + TX_LANE_MAP: 0x43506172 + RX_POLARITY_FLIP: 0x7f + TX_POLARITY_FLIP: 0x07 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x53024617 + TX_LANE_MAP: 0x50627143 + RX_POLARITY_FLIP: 0x8f + TX_POLARITY_FLIP: 0x6b + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x62537041 + TX_LANE_MAP: 0x02761345 + RX_POLARITY_FLIP: 0x7c + TX_POLARITY_FLIP: 0xa2 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x20653174 + TX_LANE_MAP: 0x06714523 + RX_POLARITY_FLIP: 0x26 + TX_POLARITY_FLIP: 0x20 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x74516320 + TX_LANE_MAP: 0x53170426 + RX_POLARITY_FLIP: 0xef + TX_POLARITY_FLIP: 0xef +... +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + # CPU port + PORT_ID: 0 + : + PC_PHYS_PORT_ID: 0 + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 5 + ? + PORT_ID: 3 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 4 + : + PC_PHYS_PORT_ID: 13 + ? + PORT_ID: 17 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 18 + : + PC_PHYS_PORT_ID: 21 + ? + PORT_ID: 19 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 20 + : + PC_PHYS_PORT_ID: 29 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 35 + : + PC_PHYS_PORT_ID: 37 + ? + PORT_ID: 36 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 37 + : + PC_PHYS_PORT_ID: 45 + ? + PORT_ID: 51 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 52 + : + PC_PHYS_PORT_ID: 53 + ? + PORT_ID: 53 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 54 + : + PC_PHYS_PORT_ID: 61 + ? + PORT_ID: 204 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 205 + : + PC_PHYS_PORT_ID: 197 + ? + PORT_ID: 206 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 207 + : + PC_PHYS_PORT_ID: 205 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 222 + : + PC_PHYS_PORT_ID: 213 + ? + PORT_ID: 223 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 224 + : + PC_PHYS_PORT_ID: 221 + ? + PORT_ID: 238 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 239 + : + PC_PHYS_PORT_ID: 229 + ? + PORT_ID: 240 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 241 + : + PC_PHYS_PORT_ID: 237 + ? + PORT_ID: 255 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 256 + : + PC_PHYS_PORT_ID: 245 + ? + PORT_ID: 257 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 258 + : + PC_PHYS_PORT_ID: 253 + ? + PORT_ID: 50 + : + PC_PHYS_PORT_ID: 258 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: 0 + : + &port_mode_10g + ENABLE: 1 + SPEED: 10000 + NUM_LANES: 1 + ? + PORT_ID: [[50, 50]] + : + ENABLE: 0 + MAX_FRAME_SIZE: 9416 + SPEED: 10000 + NUM_LANES: 1 + ? + PORT_ID: [[1, 4], + [17, 20], + [34, 37], + [51, 54], + [204, 207], + [221, 224], + [238, 241], + [255, 258]] + : + ENABLE: 0 + SPEED: 400000 + NUM_LANES: 8 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # Per pipe flex state configuration + #FLEX_STATE_CONFIG: + # FLEX_STATE_ING_OPERMODE_PIPEUNIQUE: 0 + # FLEX_STATE_EGR_OPERMODE_PIPEUNIQUE: 1 + + # Lossy vs Lossless mode + TM_THD_CONFIG: + THRESHOLD_MODE: LOSSLESS + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + TM_THD_CONFIG: + SKIP_BUFFER_RESERVATION: 1 + THRESHOLD_MODE: LOSSY_AND_LOSSLESS + + TM_SCHEDULER_CONFIG: + NUM_MC_Q: NUM_MC_Q_2 +... +--- +device: + 0: + TM_ING_THD_PORT_PRI_GRP: + ? + PORT_ID: [[0,67], [204,219], [221,253],[255,271]] + TM_PRI_GRP_ID: [[0,7]] + : + MIN_GUARANTEE_CELLS: 0 + DYNAMIC_SHARED_LIMITS: 0 + SHARED_LIMIT_CELLS_STATIC: 0 + HEADROOM_LIMIT_CELLS: 0 + + TM_ING_THD_PORT_SERVICE_POOL: + ? + PORT_ID: [[0,67], [204,219], [221,253],[255,271]] + TM_ING_SERVICE_POOL_ID: [[0,3]] + : + MIN_GUARANTEE_CELLS: 0 + SHARED_LIMIT_CELLS: 0 + + TM_ING_THD_HEADROOM_POOL: + ? + BUFFER_POOL: 0 + TM_HEADROOM_POOL_ID: [[0,3]] + : + LIMIT_CELLS: 0 + + TM_THD_UC_Q: + ? + PORT_ID: [[1,67], [204,219], [221,253],[255,271]] + TM_UC_Q_ID: [[0,11]] + : + MIN_GUARANTEE_CELLS: 0 + SHARED_LIMITS: 1 + DYNAMIC_SHARED_LIMITS: 0 + SHARED_LIMIT_CELLS_STATIC: 0 + + TM_THD_MC_Q: + ? + PORT_ID: 0 + TM_MC_Q_ID: [[0,47]] + : + MIN_GUARANTEE_CELLS: 0 + ? + PORT_ID: [[1,67], [204,219], [221,253],[255,271]] + TM_MC_Q_ID: [[0,5]] + : + MIN_GUARANTEE_CELLS: 0 + SHARED_LIMITS: 1 + DYNAMIC_SHARED_LIMITS: 0 + SHARED_LIMIT_CELLS_STATIC: 0 + + TM_THD_Q_GRP: + ? + PORT_ID: [[0,67], [204,219], [221,253],[255,271]] + : + UC_Q_GRP_MIN_GUARANTEE_CELLS: 0 + MC_Q_GRP_MIN_GUARANTEE_CELLS: 0 +... +--- +device: + 0: + TM_ING_PORT: + ? + PORT_ID: [[0,67], [204,219], [221,253],[255,271]] + : + PAUSE: 0 + + TM_ING_PORT_PRI_GRP: + ? + PORT_ID: [[0,67], [204,219], [221,253],[255,271]] + TM_PRI_GRP_ID: [[0,7]] + : + PFC: 0 + LOSSLESS: 0 + ING_MIN_MODE: USE_PRI_GRP_MIN + + TM_PORT_UC_Q_TO_SERVICE_POOL: + ? + PORT_ID: [[1,67], [204,219], [221,253],[255,271]] + TM_UC_Q_ID: [[0,11]] + : + USE_QGROUP_MIN: 0 + + TM_PORT_MC_Q_TO_SERVICE_POOL: + ? + PORT_ID: 0 + TM_MC_Q_ID: [[0,47]] + : + USE_QGROUP_MIN: 0 + ? + PORT_ID: [[1,67], [204,219], [221,253],[255,271]] + TM_MC_Q_ID: [[0,5]] + : + USE_QGROUP_MIN: 0 +... +--- +device: + 0: + TM_ING_THD_HEADROOM_POOL: + ? + BUFFER_POOL: 0 + TM_HEADROOM_POOL_ID: [[0,3]] + : + LIMIT_CELLS: 0 + + TM_ING_THD_SERVICE_POOL: + ? + BUFFER_POOL: 0 + TM_ING_SERVICE_POOL_ID: [[0,3]] + : + SHARED_LIMIT_CELLS: 0 + SHARED_RESUME_OFFSET_CELLS: 0 + COLOR_SPECIFIC_LIMITS: 0 + + TM_EGR_THD_SERVICE_POOL: + ? + BUFFER_POOL: 0 + TM_EGR_SERVICE_POOL_ID: [[0,3]] + : + SHARED_LIMIT_CELLS: 0 + SHARED_RESUME_LIMIT_CELLS: 0 + COLOR_SPECIFIC_LIMITS: 0 + YELLOW_SHARED_LIMIT_CELLS: 0 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 0 + RED_SHARED_LIMIT_CELLS: 0 + RED_SHARED_RESUME_LIMIT_CELLS: 0 + + TM_THD_MC_EGR_SERVICE_POOL: + ? + BUFFER_POOL: 0 + TM_EGR_SERVICE_POOL_ID: [[0,3]] + : + SHARED_LIMIT_CELLS: 0 + SHARED_RESUME_LIMIT_CELLS: 0 + COLOR_SPECIFIC_LIMITS: 0 + YELLOW_SHARED_LIMIT_CELLS: 0 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 0 + RED_SHARED_LIMIT_CELLS: 0 + RED_SHARED_RESUME_LIMIT_CELLS: 0 +... + +### Mapping +--- +device: + 0: + TM_ING_UC_ING_PRI_MAP: + ? + # Profile 1 + TM_ING_UC_ING_PRI_MAP_ID: 1 + ING_PRI: [0, 1, 2, 5, 6, [8,15]] + : + TM_PRI_GRP_ID: 0 + ? + TM_ING_UC_ING_PRI_MAP_ID: 1 + ING_PRI: 3 + : + TM_PRI_GRP_ID: 3 + ? + TM_ING_UC_ING_PRI_MAP_ID: 1 + ING_PRI: 4 + : + TM_PRI_GRP_ID: 4 + ? + TM_ING_UC_ING_PRI_MAP_ID: 1 + ING_PRI: 7 + : + TM_PRI_GRP_ID: 7 + ? + # Profile 2 + TM_ING_UC_ING_PRI_MAP_ID: 1 + ING_PRI: [0, 1, 5, [8,15]] + : + TM_PRI_GRP_ID: 0 + ? + TM_ING_UC_ING_PRI_MAP_ID: 2 + ING_PRI: 2 + : + TM_PRI_GRP_ID: 2 + ? + TM_ING_UC_ING_PRI_MAP_ID: 2 + ING_PRI: 3 + : + TM_PRI_GRP_ID: 3 + ? + TM_ING_UC_ING_PRI_MAP_ID: 2 + ING_PRI: 4 + : + TM_PRI_GRP_ID: 4 + ? + TM_ING_UC_ING_PRI_MAP_ID: 2 + ING_PRI: 6 + : + TM_PRI_GRP_ID: 6 + ? + TM_ING_UC_ING_PRI_MAP_ID: 2 + ING_PRI: 7 + : + TM_PRI_GRP_ID: 7 + ? + # Profile 3 + TM_ING_UC_ING_PRI_MAP_ID: 3 + ING_PRI: [[0,15]] + : + TM_PRI_GRP_ID: 7 + + TM_ING_NONUC_ING_PRI_MAP: + ? + # Profile 1 + TM_ING_NONUC_ING_PRI_MAP_ID: 1 + ING_PRI: [0, 1, 2, 5, 6, [8,15]] + : + TM_PRI_GRP_ID: 0 + ? + TM_ING_NONUC_ING_PRI_MAP_ID: 1 + ING_PRI: 3 + : + TM_PRI_GRP_ID: 3 + ? + TM_ING_NONUC_ING_PRI_MAP_ID: 1 + ING_PRI: 4 + : + TM_PRI_GRP_ID: 4 + ? + TM_ING_NONUC_ING_PRI_MAP_ID: 1 + ING_PRI: 7 + : + TM_PRI_GRP_ID: 7 + ? + # Profile 2 + TM_ING_NONUC_ING_PRI_MAP_ID: 1 + ING_PRI: [0, 1, 5, [8,15]] + : + TM_PRI_GRP_ID: 0 + ? + TM_ING_NONUC_ING_PRI_MAP_ID: 2 + ING_PRI: 2 + : + TM_PRI_GRP_ID: 2 + ? + TM_ING_NONUC_ING_PRI_MAP_ID: 2 + ING_PRI: 3 + : + TM_PRI_GRP_ID: 3 + ? + TM_ING_NONUC_ING_PRI_MAP_ID: 2 + ING_PRI: 4 + : + TM_PRI_GRP_ID: 4 + ? + TM_ING_NONUC_ING_PRI_MAP_ID: 2 + ING_PRI: 6 + : + TM_PRI_GRP_ID: 6 + ? + TM_ING_NONUC_ING_PRI_MAP_ID: 2 + ING_PRI: 7 + : + TM_PRI_GRP_ID: 7 + ? + # Profile 3 + TM_ING_NONUC_ING_PRI_MAP_ID: 3 + ING_PRI: [[0,15]] + : + TM_PRI_GRP_ID: 7 + + TM_PRI_GRP_POOL_MAP: + ? + TM_PRI_GRP_POOL_MAP_ID: 1 + TM_PRI_GRP_ID: [[0,6]] + : + TM_ING_SERVICE_POOL_ID: 0 + TM_HEADROOM_POOL_ID: 0 + ? + TM_PRI_GRP_POOL_MAP_ID: 1 + TM_PRI_GRP_ID: 7 + : + TM_ING_SERVICE_POOL_ID: 1 + TM_HEADROOM_POOL_ID: 1 + + TM_ING_PORT: + ? + PORT_ID: [0] + : + ING_PRI_MAP_ID: 3 + PRI_GRP_MAP_ID: 1 + ? + PORT_ID: [[1,4], [204,207]] + : + ING_PRI_MAP_ID: 1 + PRI_GRP_MAP_ID: 1 + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + : + ING_PRI_MAP_ID: 2 + PRI_GRP_MAP_ID: 1 + ? + PORT_ID: [50] + : + ING_PRI_MAP_ID: 1 + PRI_GRP_MAP_ID: 1 + ? + PORT_ID: [33, 67, 237, 271] + : + ING_PRI_MAP_ID: 1 + PRI_GRP_MAP_ID: 1 + + TM_PORT_UC_Q_TO_SERVICE_POOL: + ? + PORT_ID: [[1,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_UC_Q_ID: [[0,6], [8,9]] + : + TM_EGR_SERVICE_POOL_ID: 0 + ? + PORT_ID: [[1,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_UC_Q_ID: 7 + : + TM_EGR_SERVICE_POOL_ID: 1 + + TM_PORT_MC_Q_TO_SERVICE_POOL: + ? + PORT_ID: [0] + TM_MC_Q_ID: [[0,47]] + : + TM_EGR_SERVICE_POOL_ID: 1 + ? + PORT_ID: [[1,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_MC_Q_ID: [[0,1]] + : + TM_EGR_SERVICE_POOL_ID: 0 +... + +### Scheduler +--- +device: + 0: + TM_SCHEDULER_PROFILE: + ? + TM_SCHEDULER_PROFILE_ID: 1 + TM_SCHEDULER_NODE_ID: [0, 1] + : + NUM_UC_Q: 1 + NUM_MC_Q: 1 + FLOW_CTRL_UC: 0 + ? + TM_SCHEDULER_PROFILE_ID: 1 + TM_SCHEDULER_NODE_ID: [2, 5, 6, 7, 8, 9] + : + NUM_UC_Q: 1 + NUM_MC_Q: 0 + FLOW_CTRL_UC: 0 + ? + TM_SCHEDULER_PROFILE_ID: 1 + TM_SCHEDULER_NODE_ID: [3, 4] + : + NUM_UC_Q: 1 + NUM_MC_Q: 0 + FLOW_CTRL_UC: 1 + ? + TM_SCHEDULER_PROFILE_ID: 1 + TM_SCHEDULER_NODE_ID: [10, 11] + : + NUM_UC_Q: 0 + NUM_MC_Q: 0 + FLOW_CTRL_UC: 0 + + TM_SCHEDULER_PROFILE: + ? + TM_SCHEDULER_PROFILE_ID: 2 + TM_SCHEDULER_NODE_ID: [0, 1] + : + NUM_UC_Q: 1 + NUM_MC_Q: 1 + FLOW_CTRL_UC: 0 + ? + TM_SCHEDULER_PROFILE_ID: 2 + TM_SCHEDULER_NODE_ID: [5, 7, 8, 9] + : + NUM_UC_Q: 1 + NUM_MC_Q: 0 + FLOW_CTRL_UC: 0 + ? + TM_SCHEDULER_PROFILE_ID: 2 + TM_SCHEDULER_NODE_ID: [2, 3, 4, 6] + : + NUM_UC_Q: 1 + NUM_MC_Q: 0 + FLOW_CTRL_UC: 1 + ? + TM_SCHEDULER_PROFILE_ID: 2 + TM_SCHEDULER_NODE_ID: [10, 11] + : + NUM_UC_Q: 0 + NUM_MC_Q: 0 + FLOW_CTRL_UC: 0 +... +--- +device: + 0: + TM_SCHEDULER_PORT_PROFILE: + ? + PORT_ID: [[1,4], [204,207]] + : + TM_SCHEDULER_PROFILE_ID: 1 + WRR: 0 + TM_SCHEDULER_PORT_PROFILE: + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + : + TM_SCHEDULER_PROFILE_ID: 2 + WRR: 0 +... + +### Pools +### hard code service pool size for TH4 per architecture requirement. +--- +device: + 0: + TM_ING_THD_HEADROOM_POOL: + ? + BUFFER_POOL: 0 + TM_HEADROOM_POOL_ID: 0 + : + LIMIT_CELLS: 45696 + + TM_ING_THD_SERVICE_POOL: + ? + BUFFER_POOL: 0 + TM_ING_SERVICE_POOL_ID: 0 + : + SHARED_LIMIT_CELLS: 173222 + SHARED_RESUME_OFFSET_CELLS: 74 + COLOR_SPECIFIC_LIMITS: 0 + ? + BUFFER_POOL: 0 + TM_ING_SERVICE_POOL_ID: 1 + : + SHARED_LIMIT_CELLS: 605 + SHARED_RESUME_OFFSET_CELLS: 74 + COLOR_SPECIFIC_LIMITS: 0 + + TM_EGR_THD_SERVICE_POOL: + ? + BUFFER_POOL: 0 + TM_EGR_SERVICE_POOL_ID: 0 + : + SHARED_LIMIT_CELLS: 173222 + SHARED_RESUME_LIMIT_CELLS: 21643 + COLOR_SPECIFIC_LIMITS: 1 + YELLOW_SHARED_LIMIT_CELLS: 16240 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 16230 + RED_SHARED_LIMIT_CELLS: 13533 + RED_SHARED_RESUME_LIMIT_CELLS: 13523 + ? + BUFFER_POOL: 0 + TM_EGR_SERVICE_POOL_ID: 1 + : + SHARED_LIMIT_CELLS: 605 + SHARED_RESUME_LIMIT_CELLS: 73 + COLOR_SPECIFIC_LIMITS: 1 + YELLOW_SHARED_LIMIT_CELLS: 57 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 55 + RED_SHARED_LIMIT_CELLS: 48 + RED_SHARED_RESUME_LIMIT_CELLS: 46 + + TM_THD_MC_EGR_SERVICE_POOL: + ? + BUFFER_POOL: 0 + TM_EGR_SERVICE_POOL_ID: 0 + : + SHARED_LIMIT_CELLS: 15779 + SHARED_RESUME_LIMIT_CELLS: 1962 + COLOR_SPECIFIC_LIMITS: 1 + YELLOW_SHARED_LIMIT_CELLS: 1480 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 1470 + RED_SHARED_LIMIT_CELLS: 1233 + RED_SHARED_RESUME_LIMIT_CELLS: 1223 + ? + BUFFER_POOL: 0 + TM_EGR_SERVICE_POOL_ID: 1 + : + SHARED_LIMIT_CELLS: 605 + SHARED_RESUME_LIMIT_CELLS: 73 + COLOR_SPECIFIC_LIMITS: 1 + YELLOW_SHARED_LIMIT_CELLS: 57 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 55 + RED_SHARED_LIMIT_CELLS: 46 + RED_SHARED_RESUME_LIMIT_CELLS: 46 +... + +### Thresholds +###################################### +--- +device: + 0: + TM_ING_THD_PORT_PRI_GRP: + ? + PORT_ID: [[0,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_PRI_GRP_ID: [0, 1, 5, 7] + : + SHARED_LIMIT_CELLS_STATIC: 227317 + MIN_GUARANTEE_CELLS: 0 + DYNAMIC_SHARED_LIMITS: 0 + RESUME_OFFSET_CELLS: 0 + RESUME_FLOOR_CELLS: 0 + HEADROOM_LIMIT_AUTO: 0 + HEADROOM_LIMIT_CELLS: 0 + ? + PORT_ID: [[1,4], [204,207]] + TM_PRI_GRP_ID: [2, 3, 4, 6] + : + MIN_GUARANTEE_CELLS: 18 + DYNAMIC_SHARED_LIMITS: 1 + SHARED_LIMIT_DYNAMIC: ALPHA_1_4 + RESUME_OFFSET_CELLS: 18 + RESUME_FLOOR_CELLS: 0 + HEADROOM_LIMIT_AUTO: 0 + HEADROOM_LIMIT_CELLS: 2874 + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + TM_PRI_GRP_ID: [2, 3, 4, 6] + : + MIN_GUARANTEE_CELLS: 18 + DYNAMIC_SHARED_LIMITS: 1 + SHARED_LIMIT_DYNAMIC: ALPHA_1_4 + RESUME_OFFSET_CELLS: 18 + RESUME_FLOOR_CELLS: 0 + HEADROOM_LIMIT_AUTO: 0 + HEADROOM_LIMIT_CELLS: 675 + ? + PORT_ID: [50] + TM_PRI_GRP_ID: [2, 3, 4, 6] + : + MIN_GUARANTEE_CELLS: 0 + DYNAMIC_SHARED_LIMITS: 1 + SHARED_LIMIT_DYNAMIC: ALPHA_1_4 + RESUME_OFFSET_CELLS: 0 + RESUME_FLOOR_CELLS: 0 + HEADROOM_LIMIT_AUTO: 0 + ? + PORT_ID: [33, 67, 237, 271] + TM_PRI_GRP_ID: [2, 3, 4, 6] + : + MIN_GUARANTEE_CELLS: 0 + DYNAMIC_SHARED_LIMITS: 1 + SHARED_LIMIT_DYNAMIC: ALPHA_1_4 + RESUME_OFFSET_CELLS: 0 + RESUME_FLOOR_CELLS: 0 + HEADROOM_LIMIT_AUTO: 0 + ? + PORT_ID: [0] + TM_PRI_GRP_ID: [2, 3, 4, 6] + : + MIN_GUARANTEE_CELLS: 0 + DYNAMIC_SHARED_LIMITS: 1 + SHARED_LIMIT_DYNAMIC: ALPHA_1_4 + RESUME_OFFSET_CELLS: 0 + RESUME_FLOOR_CELLS: 0 + HEADROOM_LIMIT_AUTO: 0 + + TM_ING_THD_PORT_SERVICE_POOL: + ? + PORT_ID: [[0,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_ING_SERVICE_POOL_ID: [0, 1] + : + MIN_GUARANTEE_CELLS: 0 + SHARED_LIMIT_CELLS: 227317 + RESUME_LIMIT_CELLS: 227317 + + TM_THD_UC_Q: + ? + PORT_ID: [[1,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_UC_Q_ID: [0, 1, 5, 7, 8, 9] + : + SHARED_LIMITS: 1 + COLOR_SPECIFIC_LIMITS: 1 + RED_LIMIT_DYNAMIC: PERCENTAGE_675 + YELLOW_LIMIT_DYNAMIC: PERCENTAGE_750 + COLOR_SPECIFIC_DYNAMIC_LIMITS: 1 + MIN_GUARANTEE_CELLS: 7 + DYNAMIC_SHARED_LIMITS: 1 + SHARED_LIMIT_DYNAMIC: ALPHA_1 + RESUME_OFFSET_CELLS: 2 + ? + PORT_ID: [[1,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_UC_Q_ID: [2, 3, 4, 6] + : + SHARED_LIMITS: 0 + COLOR_SPECIFIC_LIMITS: 0 + COLOR_SPECIFIC_DYNAMIC_LIMITS: 0 + MIN_GUARANTEE_CELLS: 0 + DYNAMIC_SHARED_LIMITS: 0 + SHARED_LIMIT_CELLS_STATIC: 227317 + RESUME_OFFSET_CELLS: 2 + + TM_THD_MC_Q: + ? + PORT_ID: [0] + TM_MC_Q_ID: [0, 1, 2, 3] + : + MIN_GUARANTEE_CELLS: 37 + DYNAMIC_SHARED_LIMITS: 1 + SHARED_LIMIT_DYNAMIC: ALPHA_2 + COLOR_SPECIFIC_LIMITS: 1 + COLOR_SPECIFIC_DYNAMIC_LIMITS: 1 + YELLOW_LIMIT_DYNAMIC: PERCENTAGE_750 + RED_LIMIT_DYNAMIC: PERCENTAGE_675 + RESUME_OFFSET_CELLS: 2 + ? + PORT_ID: [0] + TM_MC_Q_ID: [4, 5, 6, 7, 8, 9] + : + MIN_GUARANTEE_CELLS: 7 + SHARED_LIMITS: 1 + DYNAMIC_SHARED_LIMITS: 1 + SHARED_LIMIT_DYNAMIC: ALPHA_1_4 + COLOR_SPECIFIC_LIMITS: 1 + COLOR_SPECIFIC_DYNAMIC_LIMITS: 1 + YELLOW_LIMIT_DYNAMIC: PERCENTAGE_750 + RED_LIMIT_DYNAMIC: PERCENTAGE_675 + RESUME_OFFSET_CELLS: 2 + ? + PORT_ID: [[1,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_MC_Q_ID: [0, 1] + : + SHARED_LIMITS: 1 + DYNAMIC_SHARED_LIMITS: 1 + SHARED_LIMIT_DYNAMIC: ALPHA_1 + COLOR_SPECIFIC_LIMITS: 1 + COLOR_SPECIFIC_DYNAMIC_LIMITS: 1 + YELLOW_LIMIT_DYNAMIC: PERCENTAGE_750 + RED_LIMIT_DYNAMIC: PERCENTAGE_675 + RESUME_OFFSET_CELLS: 2 + + TM_EGR_THD_UC_PORT_SERVICE_POOL: + ? + PORT_ID: [[1,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_EGR_SERVICE_POOL_ID: 0 + : + SHARED_LIMIT_CELLS: 173222 + SHARED_RESUME_LIMIT_CELLS: 21651 + COLOR_SPECIFIC_LIMITS: 1 + YELLOW_SHARED_LIMIT_CELLS: 16239 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 16237 + RED_SHARED_LIMIT_CELLS: 13532 + RED_SHARED_RESUME_LIMIT_CELLS: 13530 + ? + PORT_ID: [[1,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_EGR_SERVICE_POOL_ID: 1 + : + SHARED_LIMIT_CELLS: 605 + SHARED_RESUME_LIMIT_CELLS: 73 + COLOR_SPECIFIC_LIMITS: 1 + YELLOW_SHARED_LIMIT_CELLS: 56 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 54 + RED_SHARED_LIMIT_CELLS: 47 + RED_SHARED_RESUME_LIMIT_CELLS: 45 + + TM_EGR_THD_MC_PORT_SERVICE_POOL: + ? + PORT_ID: [[0,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_EGR_SERVICE_POOL_ID: 0 + : + COLOR_SPECIFIC_LIMITS: 1 + RED_SHARED_LIMIT_CELLS: 1232 + YELLOW_SHARED_LIMIT_CELLS: 1479 + SHARED_LIMIT_CELLS: 15779 + RED_SHARED_RESUME_LIMIT_CELLS: 1230 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 1477 + SHARED_RESUME_LIMIT_CELLS: 1970 + ? + PORT_ID: [[0,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + TM_EGR_SERVICE_POOL_ID: 1 + : + COLOR_SPECIFIC_LIMITS: 1 + RED_SHARED_LIMIT_CELLS: 47 + YELLOW_SHARED_LIMIT_CELLS: 56 + SHARED_LIMIT_CELLS: 605 + RED_SHARED_RESUME_LIMIT_CELLS: 45 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 54 + SHARED_RESUME_LIMIT_CELLS: 73 + + +... +### THDR Limits +--- +device: + 0: + TM_THD_REPL_SERVICE_POOL: + COLOR_SPECIFIC_LIMITS: 1 + SHARED_LIMIT_CELLS: 2961 + SHARED_RESUME_LIMIT_CELLS: 2947 + YELLOW_SHARED_LIMIT_CELLS: 2220 + YELLOW_SHARED_RESUME_LIMIT_CELLS: 2206 + RED_SHARED_LIMIT_CELLS: 1850 + RED_SHARED_RESUME_LIMIT_CELLS: 1836 + + TM_THD_REPL_Q: + ? + REPL_Q_NUM: [0,8] + : + COLOR_SPECIFIC_LIMITS: 1 + COLOR_SPECIFIC_DYNAMIC_LIMITS: 1 + SHARED_LIMITS: 1 + DYNAMIC_SHARED_LIMITS: 1 + RESUME_OFFSET_CELLS: 14 + SHARED_LIMIT_DYNAMIC: ALPHA_1 + YELLOW_LIMIT_DYNAMIC: PERCENTAGE_750 + RED_LIMIT_DYNAMIC: PERCENTAGE_675 + RESUME_OFFSET_YELLOW_CELLS: 14 + RESUME_OFFSET_RED_CELLS: 14 + + TM_THD_REPL_Q: + ? + REPL_Q_NUM: [0,5] + : + MIN_GUARANTEE_CELLS: 0 + ? + REPL_Q_NUM: [6,8] + : + MIN_GUARANTEE_CELLS: 37 + +... +### Mirror-on-drop +--- +device: + 0: + TM_MIRROR_ON_DROP_CONTROL: + RESERVED_LIMIT_CELLS: 2580 + + TM_MIRROR_ON_DROP_PROFILE: + ? + TM_MIRROR_ON_DROP_PROFILE_ID: 0 + : + PERCENTAGE_0_25: 65535 + PERCENTAGE_25_50: 65535 + PERCENTAGE_50_75: 65535 + PERCENTAGE_75_100: 65535 + + TM_MIRROR_ON_DROP_DESTINATION: + ? + TM_MIRROR_ON_DROP_DESTINATION_ID: 0 + : + TM_MC_Q_ID: 1 + PORT_ID: 1 +... + +### OBM +--- +device: + 0: + TM_OBM_PORT_PKT_PARSE: + ? + PORT_ID: [[1,4], [204,207]] + : + DSCP_MAP: 1 + HEADER_TYPE: OBM_HEADER_TYPE_ETHERNET + DEFAULT_PKT_PRI: 0 + + TM_OBM_PORT_PKT_PARSE: + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + : + DSCP_MAP: 1 + HEADER_TYPE: OBM_HEADER_TYPE_ETHERNET + DEFAULT_PKT_PRI: 0 + + TM_OBM_PORT_PKT_PRI_TC_MAP: + ? + PORT_ID: [[1,4], [204,207]] + PKT_PRI_TYPE: PKT_PRI_TYPE_DSCP + PKT_PRI: [3, 4] + : + TRAFFIC_CLASS: OBM_TC_LOSSLESS0 + + TM_OBM_PORT_PKT_PRI_TC_MAP: + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + PKT_PRI_TYPE: PKT_PRI_TYPE_DSCP + PKT_PRI: [2, 3, 4, 6] + : + TRAFFIC_CLASS: OBM_TC_LOSSLESS0 + + TM_OBM_THD_PORT: + ? + PORT_ID: [[1,4], [204,207]] + : + THD_AUTO: 0 + LOSSY_LOW_MAX_BYTES: 37376 + LOSSLESS0_MAX_BYTES: 235264 + MAX_BYTES: 235264 + + TM_OBM_THD_PORT: + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + : + THD_AUTO: 0 + LOSSY_LOW_MAX_BYTES: 37376 + LOSSLESS0_MAX_BYTES: 235264 + MAX_BYTES: 235264 + + TM_OBM_THD_PORT_FLOW_CTRL: + ? + PORT_ID: [[1,4], [204,207]] + : + THD_AUTO: 0 + LOSSLESS0_XOFF_BYTES: 5184 + LOSSLESS0_XON_BYTES: 4672 + XOFF_BYTES: 5184 + XON_BYTES: 4672 + + TM_OBM_THD_PORT_FLOW_CTRL: + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + : + THD_AUTO: 0 + LOSSLESS0_XOFF_BYTES: 5184 + LOSSLESS0_XON_BYTES: 4672 + XOFF_BYTES: 5184 + XON_BYTES: 4672 + + TM_OBM_PORT_FLOW_CTRL: + ? + PORT_ID: [[1,4], [204,207]] + : + FLOW_CTRL: 1 + FLOW_CTRL_TYPE: PFC + LOSSLESS0_FLOW_CTRL: 1 + + TM_OBM_PORT_FLOW_CTRL: + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + : + FLOW_CTRL: 1 + FLOW_CTRL_TYPE: PFC + LOSSLESS0_FLOW_CTRL: 1 +... + +### PFC +--- +device: + 0: + PC_MAC_CONTROL: + ? + PORT_ID: [[1,4], [17,20], [33,37], [50,54], 67, [204,207], [221,224], [237,241], [255,258], 271] + : + PAUSE_TX: 0 + PAUSE_RX: 0 + + TM_PFC_EGR: + ? + PORT_ID: [[1,4], [204,207]] + : + TM_PFC_PRI_PROFILE_ID: 1 + + TM_PFC_EGR: + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + : + TM_PFC_PRI_PROFILE_ID: 2 +... +--- +device: + 0: + TM_PFC_PRI_TO_PRI_GRP_MAP: + ? + TM_PFC_PRI_TO_PRI_GRP_MAP_ID: 1 + PFC_PRI: 3 + : + TM_PRI_GRP_ID: 3 + + TM_PFC_PRI_TO_PRI_GRP_MAP: + ? + TM_PFC_PRI_TO_PRI_GRP_MAP_ID: 1 + PFC_PRI: 4 + : + TM_PRI_GRP_ID: 4 + + TM_PFC_PRI_TO_PRI_GRP_MAP: + ? + TM_PFC_PRI_TO_PRI_GRP_MAP_ID: 2 + PFC_PRI: 2 + : + TM_PRI_GRP_ID: 2 + + TM_PFC_PRI_TO_PRI_GRP_MAP: + ? + TM_PFC_PRI_TO_PRI_GRP_MAP_ID: 2 + PFC_PRI: 3 + : + TM_PRI_GRP_ID: 3 + + TM_PFC_PRI_TO_PRI_GRP_MAP: + ? + TM_PFC_PRI_TO_PRI_GRP_MAP_ID: 2 + PFC_PRI: 4 + : + TM_PRI_GRP_ID: 4 + + TM_PFC_PRI_TO_PRI_GRP_MAP: + ? + TM_PFC_PRI_TO_PRI_GRP_MAP_ID: 2 + PFC_PRI: 6 + : + TM_PRI_GRP_ID: 6 + + TM_PFC_PRI_PROFILE: + ? + TM_PFC_PRI_PROFILE_ID: 1 + PFC_PRI: 3 + : + PFC: 1 + COS_LIST: [0, 0, 0, 1, 0, 0, 0, 0, 0, 0] + + TM_PFC_PRI_PROFILE: + ? + TM_PFC_PRI_PROFILE_ID: 1 + PFC_PRI: 4 + : + PFC: 1 + COS_LIST: [0, 0, 0, 0, 1, 0, 0, 0, 0, 0] + + TM_PFC_PRI_PROFILE: + ? + TM_PFC_PRI_PROFILE_ID: 2 + PFC_PRI: 2 + : + PFC: 1 + COS_LIST: [0, 0, 1, 0, 0, 0, 0, 0, 0, 0] + + TM_PFC_PRI_PROFILE: + ? + TM_PFC_PRI_PROFILE_ID: 2 + PFC_PRI: 3 + : + PFC: 1 + COS_LIST: [0, 0, 0, 1, 0, 0, 0, 0, 0, 0] + + TM_PFC_PRI_PROFILE: + ? + TM_PFC_PRI_PROFILE_ID: 2 + PFC_PRI: 4 + : + PFC: 1 + COS_LIST: [0, 0, 0, 0, 1, 0, 0, 0, 0, 0] + + TM_PFC_PRI_PROFILE: + ? + TM_PFC_PRI_PROFILE_ID: 2 + PFC_PRI: 6 + : + PFC: 1 + COS_LIST: [0, 0, 0, 0, 0, 0, 1, 0, 0, 0] + + TM_ING_PORT_PRI_GRP: + ? + PORT_ID: [[1,4], [204,207]] + TM_PRI_GRP_ID: [3, 4] + : + PFC: 1 + LOSSLESS: 1 + + TM_ING_PORT_PRI_GRP: + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + TM_PRI_GRP_ID: [2, 3, 4, 6] + : + PFC: 1 + LOSSLESS: 1 + + PC_PFC: + ? + PORT_ID: [[1,4], [204,207]] + : + ENABLE_RX: 1 + ENABLE_TX: 1 + + PC_PFC: + ? + PORT_ID: [[17,20], [34,37], [51,54], [221,224], [238,241], [255,258]] + : + ENABLE_RX: 1 + ENABLE_TX: 1 +... diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/port_config.ini b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/port_config.ini new file mode 100644 index 000000000000..98a2de236a84 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/port_config.ini @@ -0,0 +1,34 @@ +# name lanes alias index speed +Ethernet0 1,2,3,4,5,6,7,8 fourhundredGigE1/1 1 400000 +Ethernet4 9,10,11,12,13,14,15,16 fourhundredGigE1/2 2 400000 +Ethernet8 17,18,19,20,21,22,23,24 fourhundredGigE1/3 3 400000 +Ethernet12 25,26,27,28,29,30,31,32 fourhundredGigE1/4 4 400000 +Ethernet16 33,34,35,36,37,38,39,40 fourhundredGigE1/5 5 400000 +Ethernet20 41,42,43,44,45,46,47,48 fourhundredGigE1/6 6 400000 +Ethernet24 49,50,51,52,53,54,55,56 fourhundredGigE1/7 7 400000 +Ethernet28 57,58,59,60,61,62,63,64 fourhundredGigE1/8 8 400000 +Ethernet32 65,66,67,68,69,70,71,72 fourhundredGigE1/9 9 400000 +Ethernet36 73,74,75,76,77,78,79,80 fourhundredGigE1/10 10 400000 +Ethernet40 81,82,83,84,85,86,87,88 fourhundredGigE1/11 11 400000 +Ethernet44 89,90,91,92,93,94,95,96 fourhundredGigE1/12 12 400000 +Ethernet48 97,98,99,100,101,102,103,104 fourhundredGigE1/13 13 400000 +Ethernet52 105,106,107,108,109,110,111,112 fourhundredGigE1/14 14 400000 +Ethernet56 113,114,115,116,117,118,119,120 fourhundredGigE1/15 15 400000 +Ethernet60 121,122,123,124,125,126,127,128 fourhundredGigE1/16 16 400000 +Ethernet64 385,386,387,388,389,390,391,392 fourhundredGigE1/17 17 400000 +Ethernet68 393,394,395,396,397,398,399,400 fourhundredGigE1/18 18 400000 +Ethernet72 401,402,403,404,405,406,407,408 fourhundredGigE1/19 19 400000 +Ethernet76 409,410,411,412,413,414,415,416 fourhundredGigE1/20 20 400000 +Ethernet80 417,418,419,420,421,422,423,424 fourhundredGigE1/21 21 400000 +Ethernet84 425,426,427,428,429,430,431,432 fourhundredGigE1/22 22 400000 +Ethernet88 433,434,435,436,437,438,439,440 fourhundredGigE1/23 23 400000 +Ethernet92 441,442,443,444,445,446,447,448 fourhundredGigE1/24 24 400000 +Ethernet96 449,450,451,452,453,454,455,456 fourhundredGigE1/25 25 400000 +Ethernet100 457,458,459,460,461,462,463,464 fourhundredGigE1/26 26 400000 +Ethernet104 465,466,467,468,469,470,471,472 fourhundredGigE1/27 27 400000 +Ethernet108 473,474,475,476,477,478,479,480 fourhundredGigE1/28 28 400000 +Ethernet112 481,482,483,484,485,486,487,488 fourhundredGigE1/29 29 400000 +Ethernet116 489,490,491,492,493,494,495,496 fourhundredGigE1/30 30 400000 +Ethernet120 497,498,499,500,501,502,503,504 fourhundredGigE1/31 31 400000 +Ethernet124 505,506,507,508,509,510,511,512 fourhundredGigE1/32 32 400000 +Ethernet128 513 tenGigE1/33 33 10000 diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/profile.ini b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/profile.ini new file mode 100644 index 000000000000..4eda67c91a69 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/profile.ini @@ -0,0 +1 @@ +switchMacAddress=XX:XX:XX:XX:XX:XX diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/sai.profile b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/sai.profile new file mode 100644 index 000000000000..28f89146b620 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/Nokia-IXR7220-H4-32D/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/ixr7220_h4_32d.bcm diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/default_sku b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/default_sku new file mode 100644 index 000000000000..10de48e89420 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/default_sku @@ -0,0 +1 @@ +Nokia-IXR7220-H4-32D t1 diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/installer.conf b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/installer.conf new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/installer.conf @@ -0,0 +1 @@ + diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/pcie.yaml b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/pcie.yaml new file mode 100644 index 000000000000..408155571953 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/pcie.yaml @@ -0,0 +1,119 @@ +- bus: '00' + dev: '00' + fn: '0' + id: '1980' + name: 'Host bridge: Intel Corporation Atom Processor C3000 Series System Agent (rev + 11)' +- bus: '00' + dev: '04' + fn: '0' + id: 19a1 + name: 'Host bridge: Intel Corporation Atom Processor C3000 Series Error Registers + (rev 11)' +- bus: '00' + dev: '05' + fn: '0' + id: 19a2 + name: 'Generic system peripheral [0807]: Intel Corporation Atom Processor C3000 + Series Root Complex Event Collector (rev 11)' +- bus: '00' + dev: '06' + fn: '0' + id: 19a3 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series Integrated QAT + Root Port (rev 11)' +- bus: '00' + dev: 0b + fn: '0' + id: 19a6 + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #2 (rev 11)' +- bus: '00' + dev: '10' + fn: '0' + id: 19aa + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #6 (rev 11)' +- bus: '00' + dev: '11' + fn: '0' + id: 19ab + name: 'PCI bridge: Intel Corporation Atom Processor C3000 Series PCI Express Root + Port #7 (rev 11)' +- bus: '00' + dev: '12' + fn: '0' + id: 19ac + name: 'System peripheral: Intel Corporation Atom Processor C3000 Series SMBus Contoller + - Host (rev 11)' +- bus: '00' + dev: '14' + fn: '0' + id: 19c2 + name: 'SATA controller: Intel Corporation Atom Processor C3000 Series SATA Controller + 1 (rev 11)' +- bus: '00' + dev: '15' + fn: '0' + id: 19d0 + name: 'USB controller: Intel Corporation Atom Processor C3000 Series USB 3.0 xHCI + Controller (rev 11)' +- bus: '00' + dev: '18' + fn: '0' + id: 19d3 + name: 'Communication controller: Intel Corporation Atom Processor C3000 Series ME + HECI 1 (rev 11)' +- bus: '00' + dev: 1c + fn: '0' + id: 19db + name: 'SD Host controller: Intel Corporation Device 19db (rev 11)' +- bus: '00' + dev: 1f + fn: '0' + id: 19dc + name: 'ISA bridge: Intel Corporation Atom Processor C3000 Series LPC or eSPI (rev + 11)' +- bus: '00' + dev: 1f + fn: '2' + id: 19de + name: 'Memory controller: Intel Corporation Atom Processor C3000 Series Power Management + Controller (rev 11)' +- bus: '00' + dev: 1f + fn: '4' + id: 19df + name: 'SMBus: Intel Corporation Atom Processor C3000 Series SMBus controller (rev + 11)' +- bus: '00' + dev: 1f + fn: '5' + id: 19e0 + name: 'Serial bus controller: Intel Corporation Atom Processor C3000 Series SPI + Controller (rev 11)' +- bus: '01' + dev: '00' + fn: '0' + id: 19e2 + name: 'Co-processor: Intel Corporation Atom Processor C3000 Series QuickAssist Technology + (rev 11)' +- bus: '02' + dev: '00' + fn: '0' + id: b993 + name: 'Ethernet controller: Broadcom Inc. and subsidiaries BCM56993 Switch ASIC + [Tomahawk4] (rev 11)' +- bus: '03' + dev: '00' + fn: '0' + id: 9c1d + name: 'Unassigned class [ff00]: Lattice Semiconductor Corporation Device 9c1d (rev + 01)' +- bus: '04' + dev: '00' + fn: '0' + id: '1533' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 02)' diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json new file mode 100644 index 000000000000..915b83c2ea5b --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform.json @@ -0,0 +1,440 @@ +{ + "chassis": { + "name": "7220 IXR-H4-32D", + "components": [ + { + "name": "CPUPLD" + }, + { + "name": "SysFPGA" + }, + { + "name": "SWPLD2" + }, + { + "name": "SWPLD3" + } + ], + "fans": [ + { + "name": "Fan1", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan2", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan3", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan4", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan5", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan6", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan7", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan8", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan9", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan10", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan11", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan12", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan13", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan14", + "status_led": { + "controllable": false + } + } + ], + "fan_drawers": [ + { + "name": "drawer1", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan1", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan2", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer2", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan3", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan4", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer3", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan5", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan6", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer4", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan7", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan8", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer5", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan9", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan10", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer6", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan11", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan12", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer7", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan13", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan14", + "status_led": { + "controllable": false + } + } + ] + } + ], + "psus": [ + { + "name": "PSU1", + "status_led": { + "controllable": false + }, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "temperature": false + }, + { + "name": "PSU2", + "status_led": { + "controllable": false + }, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "temperature": false + } + ], + "thermals": [ + { + "name": "CPU Board", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "Fan Board", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MAC Right", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MAC Left1", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MAC Left2", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "Mac Front", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "ASIC TH4", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + } + ], + "sfps": [ + { + "name": "QSFPDD_1" + }, + { + "name": "QSFPDD_2" + }, + { + "name": "QSFPDD_3" + }, + { + "name": "QSFPDD_4" + }, + { + "name": "QSFPDD_5" + }, + { + "name": "QSFPDD_6" + }, + { + "name": "QSFPDD_7" + }, + { + "name": "QSFPDD_8" + }, + { + "name": "QSFPDD_9" + }, + { + "name": "QSFPDD_10" + }, + { + "name": "QSFPDD_11" + }, + { + "name": "QSFPDD_12" + }, + { + "name": "QSFPDD_13" + }, + { + "name": "QSFPDD_14" + }, + { + "name": "QSFPDD_15" + }, + { + "name": "QSFPDD_16" + }, + { + "name": "QSFPDD_17" + }, + { + "name": "QSFPDD_18" + }, + { + "name": "QSFPDD_19" + }, + { + "name": "QSFPDD_20" + }, + { + "name": "QSFPDD_21" + }, + { + "name": "QSFPDD_22" + }, + { + "name": "QSFPDD_23" + }, + { + "name": "QSFPDD_24" + }, + { + "name": "QSFPDD_25" + }, + { + "name": "QSFPDD_26" + }, + { + "name": "QSFPDD_27" + }, + { + "name": "QSFPDD_28" + }, + { + "name": "QSFPDD_29" + }, + { + "name": "QSFPDD_30" + }, + { + "name": "QSFPDD_31" + }, + { + "name": "QSFPDD_32" + }, + { + "name": "SFP+_1" + } + ] + }, + "interfaces": {} +} diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform_asic b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform_asic new file mode 100644 index 000000000000..960467652765 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/platform_asic @@ -0,0 +1 @@ +broadcom diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/plugins/eeprom.py b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/plugins/eeprom.py new file mode 100644 index 000000000000..1adc2802ab64 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/plugins/eeprom.py @@ -0,0 +1,16 @@ +try: + import os + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class board(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self, name, path, cpld_root, ro): + self.eeprom_path = "/sys/class/i2c-adapter/i2c-1/1-0053/eeprom" + if not os.path.exists(self.eeprom_path): + file = "/sys/class/i2c-adapter/i2c-1/new_device" + with open(file, 'w') as f: + f.write('24c02 0x53\n') + super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/plugins/led_control.py b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/plugins/led_control.py new file mode 100644 index 000000000000..88acf9f119d2 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/plugins/led_control.py @@ -0,0 +1,125 @@ +# +# led_control.py +# +# Platform-specific LED control functionality for SONiC +# + +try: + from sonic_led.led_control_base import LedControlBase + import os + import time + import syslog + import struct + from mmap import * + import sonic_platform.platform + import sonic_platform.chassis +except ImportError as e: + raise ImportError(str(e) + " - required module not found") + +H4_32D_FAN_DRAWERS = 7 +H4_32D_FANS_PER_DRAWER = 2 +RESOURCE = "/sys/bus/pci/devices/0000:03:00.0/resource0" +REG_FRONT_SYSLED = 0x0084 +REG_FRONT_FANLED = 0x0088 + +def DBG_PRINT(str): + syslog.openlog("nokia-led") + syslog.syslog(syslog.LOG_INFO, str) + syslog.closelog() + + +class LedControl(LedControlBase): + """Platform specific LED control class""" + + # Constructor + def __init__(self): + self.chassis = sonic_platform.platform.Platform().get_chassis() + self._initDefaultConfig() + + def _initDefaultConfig(self): + # The fan tray leds and system led managed by new chassis class API + # leaving only a couple other front panel leds to be done old style + DBG_PRINT("starting system leds") + self._initSystemLed() + DBG_PRINT(" led done") + + def _read_sysfs_file(self, sysfs_file): + # On successful read, returns the value read from given + # reg_name and on failure returns 'ERR' + rv = 'ERR' + + if (not os.path.isfile(sysfs_file)): + return rv + try: + with open(sysfs_file, 'r') as fd: + rv = fd.read() + except Exception as e: + rv = 'ERR' + + rv = rv.rstrip('\r\n') + rv = rv.lstrip(" ") + return rv + + def _write_sysfs_file(self, sysfs_file, value): + # On successful write, the value read will be written on + # reg_name and on failure returns 'ERR' + rv = 'ERR' + + if (not os.path.isfile(sysfs_file)): + return rv + try: + with open(sysfs_file, 'w') as fd: + rv = fd.write(str(value)) + except Exception as e: + rv = 'ERR' + + return rv + + def _pci_set_value(self, resource, data, offset): + fd = open(resource, O_RDWR) + mm = mmap(fd, 0) + mm.seek(offset) + mm.write(struct.pack('I', data)) + mm.close() + close(fd) + + def _pci_get_value(self, resource, offset): + fd = open(resource, O_RDWR) + mm = mmap(fd, 0) + mm.seek(offset) + read_data_stream = mm.read(4) + reg_val = struct.unpack('I', read_data_stream) + mm.close() + close(fd) + return reg_val + + def _initSystemLed(self): + # Front Panel System LEDs setting + oldfan = 0xf # 0=amber, 1=green + oldpsu = 0xf # 0=amber, 1=green + + # Write sys led + self._pci_set_value(RESOURCE, 1, REG_FRONT_SYSLED) + + # Timer loop to monitor and set front panel Status, Fan, and PSU LEDs + while True: + # Front Panel FAN Panel LED setting + good_fan = 0 + for fan in self.chassis._fan_list: + if fan.get_status() == True: + good_fan = good_fan + 1 + + if (good_fan == H4_32D_FAN_DRAWERS * H4_32D_FANS_PER_DRAWER): + if oldfan != 0x1: + self._pci_set_value(RESOURCE, 1, REG_FRONT_FANLED) + oldfan = 0x1 + + else: + if oldfan != 0x0: + self._pci_set_value(RESOURCE, 0, REG_FRONT_FANLED) + oldfan = 0x0 + + + + time.sleep(6) + diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/system_health_monitoring_config.json b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..d5f3a7b98304 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/system_health_monitoring_config.json @@ -0,0 +1,14 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.temperature" + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "amber", + "normal": "green", + "booting": "blinking green" + } +} diff --git a/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/thermal_policy.json b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/thermal_policy.json new file mode 100644 index 000000000000..667d82dac0a3 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h4_32d-r0/thermal_policy.json @@ -0,0 +1,67 @@ +{ + "thermal_control_algorithm": { + "run_at_boot_up": "false", + "fan_speed_when_suspend": "65" + }, + "info_types": [ + { + "type": "fan_info" + }, + { + "type": "thermal_info" + }, + { + "type": "chassis_info" + } + ], + "policies": [ + { + "name": "any fan absence", + "conditions": [ + { + "type": "fan.any.absence" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "false" + }, + { + "type": "fan.all.set_speed", + "speed": "100" + } + ] + }, + { + "name": "all fan presence", + "conditions": [ + { + "type": "fan.all.presence" + } + ], + "actions": [ + { + "type": "thermal.temp_check_and_set_all_fan_speed", + "default_speed": "40", + "threshold1_speed": "55", + "threshold2_speed": "80", + "hightemp_speed": "100" + } + ] + }, + { + "name": "temp over high critical threshold", + "conditions": [ + { + "type": "thermal.over.high_critical_threshold" + } + ], + "actions": [ + { + "type": "switch.shutdown" + } + ] + } + ] +} diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/h5_64Dx400g.yml b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/h5_64Dx400g.yml new file mode 100644 index 000000000000..a3efe8918d0e --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/h5_64Dx400g.yml @@ -0,0 +1,1121 @@ +# +# $Copyright: (c) 2022-2023 Delta Electronics, INC. +# Delta Electronics, INC. Proprietary and Confidential. All rights reserved. +# + +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x35712460 + TX_LANE_MAP: 0x34702561 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x2E + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17530642 + TX_LANE_MAP: 0x35712460 + RX_POLARITY_FLIP: 0xC2 + TX_POLARITY_FLIP: 0x6A + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17530642 + TX_LANE_MAP: 0x35712460 + RX_POLARITY_FLIP: 0x9A + TX_POLARITY_FLIP: 0x3F + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17530642 + TX_LANE_MAP: 0x16520743 + RX_POLARITY_FLIP: 0x9A + TX_POLARITY_FLIP: 0xDE + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x10762435 + TX_LANE_MAP: 0x04153627 + RX_POLARITY_FLIP: 0xCD + TX_POLARITY_FLIP: 0x2D + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0x27 + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x62517043 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0xCD + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x67205143 + TX_LANE_MAP: 0x34071526 + RX_POLARITY_FLIP: 0x4E + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0x27 + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x62517043 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0xC9 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x67205143 + TX_LANE_MAP: 0x34071526 + RX_POLARITY_FLIP: 0x4E + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0x27 + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x62517043 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0xC9 + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31670524 + TX_LANE_MAP: 0x70634251 + RX_POLARITY_FLIP: 0xDB + TX_POLARITY_FLIP: 0xD3 + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x72614053 + RX_POLARITY_FLIP: 0xBD + TX_POLARITY_FLIP: 0x97 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x72614053 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x68 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x15243607 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x34 + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31670524 + TX_LANE_MAP: 0x70634251 + RX_POLARITY_FLIP: 0xDB + TX_POLARITY_FLIP: 0xD3 + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x72614053 + RX_POLARITY_FLIP: 0xBD + TX_POLARITY_FLIP: 0x97 + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x72614053 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x68 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x15243607 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x34 + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31670524 + TX_LANE_MAP: 0x70634251 + RX_POLARITY_FLIP: 0xDB + TX_POLARITY_FLIP: 0xD3 + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x72614053 + RX_POLARITY_FLIP: 0xBD + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x20461537 + TX_LANE_MAP: 0x51627340 + RX_POLARITY_FLIP: 0x24 + TX_POLARITY_FLIP: 0xC5 + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x15243607 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x34 + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x53174206 + TX_LANE_MAP: 0x52164307 + RX_POLARITY_FLIP: 0x3F + TX_POLARITY_FLIP: 0x74 + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71356024 + TX_LANE_MAP: 0x53174206 + RX_POLARITY_FLIP: 0xCF + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71356024 + TX_LANE_MAP: 0x53174206 + RX_POLARITY_FLIP: 0xCA + TX_POLARITY_FLIP: 0x3F + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71356024 + TX_LANE_MAP: 0x70346125 + RX_POLARITY_FLIP: 0xCA + TX_POLARITY_FLIP: 0xDE + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71356024 + TX_LANE_MAP: 0x70346125 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0xD1 + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71356024 + TX_LANE_MAP: 0x53174206 + RX_POLARITY_FLIP: 0x30 + TX_POLARITY_FLIP: 0x9A + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x71356024 + TX_LANE_MAP: 0x53174206 + RX_POLARITY_FLIP: 0x35 + TX_POLARITY_FLIP: 0xC0 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x53174206 + TX_LANE_MAP: 0x52164307 + RX_POLARITY_FLIP: 0xCA + TX_POLARITY_FLIP: 0x84 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x15243607 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x34 + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x72614053 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x20461537 + TX_LANE_MAP: 0x51627340 + RX_POLARITY_FLIP: 0xDB + TX_POLARITY_FLIP: 0x3A + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31670524 + TX_LANE_MAP: 0x70634251 + RX_POLARITY_FLIP: 0xDB + TX_POLARITY_FLIP: 0xD3 + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x15243607 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x34 + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x72614053 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x68 + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x72614053 + RX_POLARITY_FLIP: 0xBD + TX_POLARITY_FLIP: 0x97 + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31670524 + TX_LANE_MAP: 0x70634251 + RX_POLARITY_FLIP: 0xDB + TX_POLARITY_FLIP: 0xD3 + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x15243607 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x34 + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x72614053 + RX_POLARITY_FLIP: 0x42 + TX_POLARITY_FLIP: 0x68 + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x76134250 + TX_LANE_MAP: 0x72614053 + RX_POLARITY_FLIP: 0xBD + TX_POLARITY_FLIP: 0x97 + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31670524 + TX_LANE_MAP: 0x70634251 + RX_POLARITY_FLIP: 0xDB + TX_POLARITY_FLIP: 0xD3 + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x62517043 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0xC9 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0x27 + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x67205143 + TX_LANE_MAP: 0x34071526 + RX_POLARITY_FLIP: 0x4E + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x62517043 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0xC9 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0x27 + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x67205143 + TX_LANE_MAP: 0x34071526 + RX_POLARITY_FLIP: 0x4E + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x67015342 + TX_LANE_MAP: 0x72635140 + RX_POLARITY_FLIP: 0xC4 + TX_POLARITY_FLIP: 0x4B + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0xD8 + TX_POLARITY_FLIP: 0x93 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x02763415 + TX_LANE_MAP: 0x35061427 + RX_POLARITY_FLIP: 0x27 + TX_POLARITY_FLIP: 0x6C + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x67205143 + TX_LANE_MAP: 0x34071526 + RX_POLARITY_FLIP: 0x4E + TX_POLARITY_FLIP: 0x4C + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17530642 + TX_LANE_MAP: 0x16520743 + RX_POLARITY_FLIP: 0x3F + TX_POLARITY_FLIP: 0x8B + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17530642 + TX_LANE_MAP: 0x35712460 + RX_POLARITY_FLIP: 0x3D + TX_POLARITY_FLIP: 0x95 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x17530642 + TX_LANE_MAP: 0x35712460 + RX_POLARITY_FLIP: 0x65 + TX_POLARITY_FLIP: 0xC0 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x35712460 + TX_LANE_MAP: 0x34702561 + RX_POLARITY_FLIP: 0x6A + TX_POLARITY_FLIP: 0x84 +... +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + # CPU port + PORT_ID: 0 + : + PC_PHYS_PORT_ID: 0 + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 505 + # mgmt port + ? + PORT_ID: 76 + : + PC_PHYS_PORT_ID: 513 + ? + PORT_ID: 164 + : + PC_PHYS_PORT_ID: 514 + ? + PORT_ID: 186 + : + PC_PHYS_PORT_ID: 516 + ? + PORT_ID: 274 + : + PC_PHYS_PORT_ID: 515 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: 0 + : + &port_mode_10g + ENABLE: 1 + SPEED: 10000 + NUM_LANES: 1 + ? + PORT_ID: [[1, 2], + [11, 12], + [22, 23], + [33, 34], + [44, 45], + [55, 56], + [66, 67], + [77, 78], + [88, 89], + [99, 100], + [110, 111], + [121, 122], + [132, 133], + [143, 144], + [154, 155], + [165, 166], + [176, 177], + [187, 188], + [198, 199], + [209, 210], + [220, 221], + [231, 232], + [242, 243], + [253, 254], + [264, 265], + [275, 276], + [286, 287], + [297, 298], + [308, 309], + [319, 320], + [330, 331], + [341, 342]] + : + ENABLE: 1 + SPEED: 400000 + NUM_LANES: 8 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 + LINK_TRAINING: 1 + ? + PORT_ID: [76, 164, 186, 274] + : + ENABLE: 1 + SPEED: 10000 + NUM_LANES: 1 + MAX_FRAME_SIZE: 9416 + +... diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/port_config.ini b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/port_config.ini new file mode 100644 index 000000000000..40e197e5fc26 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/port_config.ini @@ -0,0 +1,68 @@ +# name lanes alias index speed +Ethernet0 17,18,19,20,21,22,23,24 fourhundredGigE1/1 1 400000 +Ethernet4 25,26,27,28,29,30,31,32 fourhundredGigE1/2 2 400000 +Ethernet8 1,2,3,4,5,6,7,8 fourhundredGigE1/3 3 400000 +Ethernet12 9,10,11,12,13,14,15,16 fourhundredGigE1/4 4 400000 +Ethernet16 49,50,51,52,53,54,55,56 fourhundredGigE1/5 5 400000 +Ethernet20 57,58,59,60,61,62,63,64 fourhundredGigE1/6 6 400000 +Ethernet24 33,34,35,36,37,38,39,40 fourhundredGigE1/7 7 400000 +Ethernet28 41,42,43,44,45,46,47,48 fourhundredGigE1/8 8 400000 +Ethernet32 81,82,83,84,85,86,87,88 fourhundredGigE1/9 9 400000 +Ethernet36 89,90,91,92,93,94,95,96 fourhundredGigE1/10 10 400000 +Ethernet40 65,66,67,68,69,70,71,72 fourhundredGigE1/11 11 400000 +Ethernet44 73,74,75,76,77,78,79,80 fourhundredGigE1/12 12 400000 +Ethernet48 113,114,115,116,117,118,119,120 fourhundredGigE1/13 13 400000 +Ethernet52 121,122,123,124,125,126,127,128 fourhundredGigE1/14 14 400000 +Ethernet56 97,98,99,100,101,102,103,104 fourhundredGigE1/15 15 400000 +Ethernet60 105,106,107,108,109,110,111,112 fourhundredGigE1/16 16 400000 +Ethernet64 129,130,131,132,133,134,135,136 fourhundredGigE1/17 17 400000 +Ethernet68 137,138,139,140,141,142,143,144 fourhundredGigE1/18 18 400000 +Ethernet72 145,146,147,148,149,150,151,152 fourhundredGigE1/19 19 400000 +Ethernet76 153,154,155,156,157,158,159,160 fourhundredGigE1/20 20 400000 +Ethernet80 161,162,163,164,165,166,167,168 fourhundredGigE1/21 21 400000 +Ethernet84 169,170,171,172,173,174,175,176 fourhundredGigE1/22 22 400000 +Ethernet88 177,178,179,180,181,182,183,184 fourhundredGigE1/23 23 400000 +Ethernet92 185,186,187,188,189,190,191,192 fourhundredGigE1/24 24 400000 +Ethernet96 193,194,195,196,197,198,199,200 fourhundredGigE1/25 25 400000 +Ethernet100 201,202,203,204,205,206,207,208 fourhundredGigE1/26 26 400000 +Ethernet104 209,210,211,212,213,214,215,216 fourhundredGigE1/27 27 400000 +Ethernet108 217,218,219,220,221,222,223,224 fourhundredGigE1/28 28 400000 +Ethernet112 225,226,227,228,229,230,231,232 fourhundredGigE1/29 29 400000 +Ethernet116 233,234,235,236,237,238,239,240 fourhundredGigE1/30 30 400000 +Ethernet120 241,242,243,244,245,246,247,248 fourhundredGigE1/31 31 400000 +Ethernet124 249,250,251,252,253,254,255,256 fourhundredGigE1/32 32 400000 +Ethernet128 257,258,259,260,261,262,263,264 fourhundredGigE1/33 33 400000 +Ethernet132 265,266,267,268,269,270,271,272 fourhundredGigE1/34 34 400000 +Ethernet136 273,274,275,276,277,278,279,280 fourhundredGigE1/35 35 400000 +Ethernet140 281,282,283,284,285,286,287,288 fourhundredGigE1/36 36 400000 +Ethernet144 289,290,291,292,293,294,295,296 fourhundredGigE1/37 37 400000 +Ethernet148 297,298,299,300,301,302,303,304 fourhundredGigE1/38 38 400000 +Ethernet152 305,306,307,308,309,310,311,312 fourhundredGigE1/39 39 400000 +Ethernet156 313,314,315,316,317,318,319,320 fourhundredGigE1/40 40 400000 +Ethernet160 321,322,323,324,325,326,327,328 fourhundredGigE1/41 41 400000 +Ethernet164 329,330,331,332,333,334,335,336 fourhundredGigE1/42 42 400000 +Ethernet168 337,338,339,340,341,342,343,344 fourhundredGigE1/43 43 400000 +Ethernet172 345,346,347,348,349,350,351,352 fourhundredGigE1/44 44 400000 +Ethernet176 353,354,355,356,357,358,359,360 fourhundredGigE1/45 45 400000 +Ethernet180 361,362,363,364,365,366,367,368 fourhundredGigE1/46 46 400000 +Ethernet184 369,370,371,372,373,374,375,376 fourhundredGigE1/47 47 400000 +Ethernet188 377,378,379,380,381,382,383,384 fourhundredGigE1/48 48 400000 +Ethernet192 385,386,387,388,389,390,391,392 fourhundredGigE1/49 49 400000 +Ethernet196 393,394,395,396,397,398,399,400 fourhundredGigE1/50 50 400000 +Ethernet200 401,402,403,404,405,406,407,408 fourhundredGigE1/51 51 400000 +Ethernet204 409,410,411,412,413,414,415,416 fourhundredGigE1/52 52 400000 +Ethernet208 417,418,419,420,421,422,423,424 fourhundredGigE1/53 53 400000 +Ethernet212 425,426,427,428,429,430,431,432 fourhundredGigE1/54 54 400000 +Ethernet216 433,434,435,436,437,438,439,440 fourhundredGigE1/55 55 400000 +Ethernet220 441,442,443,444,445,446,447,448 fourhundredGigE1/56 56 400000 +Ethernet224 449,450,451,452,453,454,455,456 fourhundredGigE1/57 57 400000 +Ethernet228 457,458,459,460,461,462,463,464 fourhundredGigE1/58 58 400000 +Ethernet232 465,466,467,468,469,470,471,472 fourhundredGigE1/59 59 400000 +Ethernet236 473,474,475,476,477,478,479,480 fourhundredGigE1/60 60 400000 +Ethernet240 481,482,483,484,485,486,487,488 fourhundredGigE1/61 61 400000 +Ethernet244 489,490,491,492,493,494,495,496 fourhundredGigE1/62 62 400000 +Ethernet248 497,498,499,500,501,502,503,504 fourhundredGigE1/63 63 400000 +Ethernet252 505,506,507,508,509,510,511,512 fourhundredGigE1/64 64 400000 +Ethernet256 513 tenGigE1/65 65 10000 +Ethernet257 514 tenGigE1/66 66 10000 + diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/profile.ini b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/profile.ini new file mode 100644 index 000000000000..4eda67c91a69 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/profile.ini @@ -0,0 +1 @@ +switchMacAddress=XX:XX:XX:XX:XX:XX diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/sai.profile b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/sai.profile new file mode 100644 index 000000000000..dbdfc2c4791e --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/Nokia-IXR7220-H5-64D/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/h5_64dx400g.yml diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/default_sku b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/default_sku new file mode 100644 index 000000000000..15bb786fc9ca --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/default_sku @@ -0,0 +1 @@ +Nokia-IXR7220-H5-64D t1 diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/installer.conf b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/installer.conf new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json new file mode 100644 index 000000000000..63f55d3eb01a --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform.json @@ -0,0 +1,464 @@ +{ + "chassis": { + "name": "7220 IXR-H5-64D", + "components": [ + { + "name": "CPUPLD" + }, + { + "name": "SysFPGA" + }, + { + "name": "SWPLD2" + }, + { + "name": "SWPLD3" + } + ], + "fans": [ + { + "name": "Fan1", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan2", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan3", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan4", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan5", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan6", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan7", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan8", + "status_led": { + "controllable": false + } + } + ], + "fan_drawers": [ + { + "name": "drawer1", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan1", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan2", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer2", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan3", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan4", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer3", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan5", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan6", + "status_led": { + "controllable": false + } + } + ] + }, + { + "name": "drawer4", + "status_led": { + "controllable": false + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan7", + "status_led": { + "controllable": false + } + }, + { + "name": "Fan8", + "status_led": { + "controllable": false + } + } + ] + } + ], + "psus": [ + { + "name": "PSU1", + "status_led": { + "controllable": false + }, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "temperature": false + }, + { + "name": "PSU2", + "status_led": { + "controllable": false + }, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "temperature": false + } + ], + "thermals": [ + { + "name": "MB Left", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MB Front", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MB Right", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MB MAC", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "PSU top", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "PSU Bottom", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "CPU Board", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "Fan Left", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "Fan Right", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + }, + { + "name": "MAC internal", + "controllable": false, + "low-threshold": false, + "high-threshold": true, + "low-crit-threshold": false, + "high-crit-threshold": true + } + ], + "sfps": [ + { + "name": "QSFPDD_1" + }, + { + "name": "QSFPDD_2" + }, + { + "name": "QSFPDD_3" + }, + { + "name": "QSFPDD_4" + }, + { + "name": "QSFPDD_5" + }, + { + "name": "QSFPDD_6" + }, + { + "name": "QSFPDD_7" + }, + { + "name": "QSFPDD_8" + }, + { + "name": "QSFPDD_9" + }, + { + "name": "QSFPDD_10" + }, + { + "name": "QSFPDD_11" + }, + { + "name": "QSFPDD_12" + }, + { + "name": "QSFPDD_13" + }, + { + "name": "QSFPDD_14" + }, + { + "name": "QSFPDD_15" + }, + { + "name": "QSFPDD_16" + }, + { + "name": "QSFPDD_17" + }, + { + "name": "QSFPDD_18" + }, + { + "name": "QSFPDD_19" + }, + { + "name": "QSFPDD_20" + }, + { + "name": "QSFPDD_21" + }, + { + "name": "QSFPDD_22" + }, + { + "name": "QSFPDD_23" + }, + { + "name": "QSFPDD_24" + }, + { + "name": "QSFPDD_25" + }, + { + "name": "QSFPDD_26" + }, + { + "name": "QSFPDD_27" + }, + { + "name": "QSFPDD_28" + }, + { + "name": "QSFPDD_29" + }, + { + "name": "QSFPDD_30" + }, + { + "name": "QSFPDD_31" + }, + { + "name": "QSFPDD_32" + }, + { + "name": "QSFPDD_33" + }, + { + "name": "QSFPDD_34" + }, + { + "name": "QSFPDD_35" + }, + { + "name": "QSFPDD_36" + }, + { + "name": "QSFPDD_37" + }, + { + "name": "QSFPDD_38" + }, + { + "name": "QSFPDD_39" + }, + { + "name": "QSFPDD_40" + }, + { + "name": "QSFPDD_41" + }, + { + "name": "QSFPDD_42" + }, + { + "name": "QSFPDD_43" + }, + { + "name": "QSFPDD_44" + }, + { + "name": "QSFPDD_45" + }, + { + "name": "QSFPDD_46" + }, + { + "name": "QSFPDD_47" + }, + { + "name": "QSFPDD_48" + }, + { + "name": "QSFPDD_49" + }, + { + "name": "QSFPDD_50" + }, + { + "name": "QSFPDD_51" + }, + { + "name": "QSFPDD_52" + }, + { + "name": "QSFPDD_53" + }, + { + "name": "QSFPDD_54" + }, + { + "name": "QSFPDD_55" + }, + { + "name": "QSFPDD_56" + }, + { + "name": "QSFPDD_57" + }, + { + "name": "QSFPDD_58" + }, + { + "name": "QSFPDD_59" + }, + { + "name": "QSFPDD_60" + }, + { + "name": "QSFPDD_64" + }, + { + "name": "QSFPDD_62" + }, + { + "name": "QSFPDD_63" + }, + { + "name": "QSFPDD_64" + }, + { + "name": "SFP+_0" + }, + { + "name": "SFP+_1" + } + ] + }, + "interfaces": {} +} diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform_asic b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform_asic new file mode 100644 index 000000000000..960467652765 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/platform_asic @@ -0,0 +1 @@ +broadcom diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/plugins/eeprom.py b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/plugins/eeprom.py new file mode 100644 index 000000000000..12a1bbe5d2aa --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/plugins/eeprom.py @@ -0,0 +1,16 @@ +try: + import os + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class board(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self, name, path, cpld_root, ro): + self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0053/eeprom" + if not os.path.exists(self.eeprom_path): + file = "/sys/class/i2c-adapter/i2c-0/new_device" + with open(file, 'w') as f: + f.write('24c02 0x53\n') + super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/plugins/led_control.py b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/plugins/led_control.py new file mode 100644 index 000000000000..eb1dbeb347a0 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/plugins/led_control.py @@ -0,0 +1,125 @@ +# +# led_control.py +# +# Platform-specific LED control functionality for SONiC +# + +try: + from sonic_led.led_control_base import LedControlBase + import os + import time + import syslog + import struct + from mmap import * + import sonic_platform.platform + import sonic_platform.chassis +except ImportError as e: + raise ImportError(str(e) + " - required module not found") + +H5_64D_FAN_DRAWERS = 4 +H5_64D_FANS_PER_DRAWER = 2 +RESOURCE = "/sys/bus/pci/devices/0000:02:00.0/resource0" +REG_FRONT_SYSLED = 0x0084 +REG_FRONT_FANLED = 0x0088 + +def DBG_PRINT(str): + syslog.openlog("nokia-led") + syslog.syslog(syslog.LOG_INFO, str) + syslog.closelog() + + +class LedControl(LedControlBase): + """Platform specific LED control class""" + + # Constructor + def __init__(self): + self.chassis = sonic_platform.platform.Platform().get_chassis() + self._initDefaultConfig() + + def _initDefaultConfig(self): + # The fan tray leds and system led managed by new chassis class API + # leaving only a couple other front panel leds to be done old style + DBG_PRINT("starting system leds") + self._initSystemLed() + DBG_PRINT(" led done") + + def _read_sysfs_file(self, sysfs_file): + # On successful read, returns the value read from given + # reg_name and on failure returns 'ERR' + rv = 'ERR' + + if (not os.path.isfile(sysfs_file)): + return rv + try: + with open(sysfs_file, 'r') as fd: + rv = fd.read() + except Exception as e: + rv = 'ERR' + + rv = rv.rstrip('\r\n') + rv = rv.lstrip(" ") + return rv + + def _write_sysfs_file(self, sysfs_file, value): + # On successful write, the value read will be written on + # reg_name and on failure returns 'ERR' + rv = 'ERR' + + if (not os.path.isfile(sysfs_file)): + return rv + try: + with open(sysfs_file, 'w') as fd: + rv = fd.write(str(value)) + except Exception as e: + rv = 'ERR' + + return rv + + def _pci_set_value(self, resource, data, offset): + fd = open(resource, O_RDWR) + mm = mmap(fd, 0) + mm.seek(offset) + mm.write(struct.pack('I', data)) + mm.close() + close(fd) + + def _pci_get_value(self, resource, offset): + fd = open(resource, O_RDWR) + mm = mmap(fd, 0) + mm.seek(offset) + read_data_stream = mm.read(4) + reg_val = struct.unpack('I', read_data_stream) + mm.close() + close(fd) + return reg_val + + def _initSystemLed(self): + # Front Panel System LEDs setting + oldfan = 0xf # 0=amber, 1=green + oldpsu = 0xf # 0=amber, 1=green + + # Write sys led + self._pci_set_value(RESOURCE, 1, REG_FRONT_SYSLED) + + # Timer loop to monitor and set front panel Status, Fan, and PSU LEDs + while True: + # Front Panel FAN Panel LED setting + good_fan = 0 + for fan in self.chassis._fan_list: + if fan.get_status() == True: + good_fan = good_fan + 1 + + if (good_fan == H5_64D_FAN_DRAWERS * H5_64D_FANS_PER_DRAWER): + if oldfan != 0x1: + self._pci_set_value(RESOURCE, 1, REG_FRONT_FANLED) + oldfan = 0x1 + + else: + if oldfan != 0x0: + self._pci_set_value(RESOURCE, 0, REG_FRONT_FANLED) + oldfan = 0x0 + + + + time.sleep(6) + diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/system_health_monitoring_config.json b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..d5f3a7b98304 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/system_health_monitoring_config.json @@ -0,0 +1,14 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.temperature" + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "amber", + "normal": "green", + "booting": "blinking green" + } +} diff --git a/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/thermal_policy.json b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/thermal_policy.json new file mode 100644 index 000000000000..667d82dac0a3 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7220_h5_64d-r0/thermal_policy.json @@ -0,0 +1,67 @@ +{ + "thermal_control_algorithm": { + "run_at_boot_up": "false", + "fan_speed_when_suspend": "65" + }, + "info_types": [ + { + "type": "fan_info" + }, + { + "type": "thermal_info" + }, + { + "type": "chassis_info" + } + ], + "policies": [ + { + "name": "any fan absence", + "conditions": [ + { + "type": "fan.any.absence" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "false" + }, + { + "type": "fan.all.set_speed", + "speed": "100" + } + ] + }, + { + "name": "all fan presence", + "conditions": [ + { + "type": "fan.all.presence" + } + ], + "actions": [ + { + "type": "thermal.temp_check_and_set_all_fan_speed", + "default_speed": "40", + "threshold1_speed": "55", + "threshold2_speed": "80", + "hightemp_speed": "100" + } + ] + }, + { + "name": "temp over high critical threshold", + "conditions": [ + { + "type": "thermal.over.high_critical_threshold" + } + ], + "actions": [ + { + "type": "switch.shutdown" + } + ] + } + ] +} diff --git a/platform/broadcom/one-image.mk b/platform/broadcom/one-image.mk index c9660299ed7e..f5a1f68f4e26 100755 --- a/platform/broadcom/one-image.mk +++ b/platform/broadcom/one-image.mk @@ -80,6 +80,9 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \ $(RUIJIE_B6510_48VS8CQ_PLATFORM_MODULE) \ $(RAGILE_RA_B6510_48V8C_PLATFORM_MODULE) \ $(NOKIA_IXR7250_PLATFORM_MODULE) \ + $(NOKIA_IXR7220H3_PLATFORM_MODULE) \ + $(NOKIA_IXR7220H4_32D_PLATFORM_MODULE) \ + $(NOKIA_IXR7220H5_64D_PLATFORM_MODULE) \ $(TENCENT_TCS8400_PLATFORM_MODULE) \ $(TENCENT_TCS9400_PLATFORM_MODULE) \ $(UFISPACE_S9300_32D_PLATFORM_MODULE) \ diff --git a/platform/broadcom/platform-modules-nokia.mk b/platform/broadcom/platform-modules-nokia.mk index fb5199375e5e..10c556917c8d 100644 --- a/platform/broadcom/platform-modules-nokia.mk +++ b/platform/broadcom/platform-modules-nokia.mk @@ -1,9 +1,14 @@ # Nokia Platform modules NOKIA_IXR7250_PLATFORM_MODULE_VERSION = 1.0 +NOKIA_IXR7220H3_PLATFORM_MODULE_VERSION = 1.0 +NOKIA_IXR7220H4_32D_PLATFORM_MODULE_VERSION = 1.0 +NOKIA_IXR7220H5_64D_PLATFORM_MODULE_VERSION = 1.0 export NOKIA_IXR7250_PLATFORM_MODULE_VERSION - +export NOKIA_IXR7220H3_PLATFORM_MODULE_VERSION +export NOKIA_IXR7220H4_32D_PLATFORM_MODULE_VERSION +export NOKIA_IXR7220H5_64D_PLATFORM_MODULE_VERSION NOKIA_IXR7250_PLATFORM_MODULE = sonic-platform-nokia-chassis_$(NOKIA_IXR7250_PLATFORM_MODULE_VERSION)_amd64.deb $(NOKIA_IXR7250_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-nokia @@ -12,3 +17,17 @@ $(NOKIA_IXR7250_PLATFORM_MODULE)_PLATFORM = x86_64-nokia_ixr7250e_sup-r0 $(NOKIA_IXR7250_PLATFORM_MODULE)_PLATFORM += x86_64-nokia_ixr7250e_36x400g-r0 SONIC_DPKG_DEBS += $(NOKIA_IXR7250_PLATFORM_MODULE) +NOKIA_IXR7220H3_PLATFORM_MODULE = sonic-platform-nokia-ixr7220h3_$(NOKIA_IXR7220H3_PLATFORM_MODULE_VERSION)_amd64.deb +$(NOKIA_IXR7220H3_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(NOKIA_IXR7220H3_PLATFORM_MODULE)_PLATFORM = x86_64-nokia_ixr7220_h3-r0 +$(eval $(call add_extra_package,$(NOKIA_IXR7250_PLATFORM_MODULE),$(NOKIA_IXR7220H3_PLATFORM_MODULE))) + +NOKIA_IXR7220H4_32D_PLATFORM_MODULE = sonic-platform-nokia-ixr7220h4-32d_$(NOKIA_IXR7220H4_32D_PLATFORM_MODULE_VERSION)_amd64.deb +$(NOKIA_IXR7220H4_32D_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(NOKIA_IXR7220H4_32D_PLATFORM_MODULE)_PLATFORM = x86_64-nokia_ixr7220_h4_32d-r0 +$(eval $(call add_extra_package,$(NOKIA_IXR7250_PLATFORM_MODULE),$(NOKIA_IXR7220H4_32D_PLATFORM_MODULE))) + +NOKIA_IXR7220H5_64D_PLATFORM_MODULE = sonic-platform-nokia-ixr7220h5-64d_$(NOKIA_IXR7220H5_64D_PLATFORM_MODULE_VERSION)_amd64.deb +$(NOKIA_IXR7220H5_64D_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(NOKIA_IXR7220H5_64D_PLATFORM_MODULE)_PLATFORM = x86_64-nokia_ixr7220_h5_64d-r0 +$(eval $(call add_extra_package,$(NOKIA_IXR7250_PLATFORM_MODULE),$(NOKIA_IXR7220H5_64D_PLATFORM_MODULE))) diff --git a/platform/broadcom/sonic-platform-modules-nokia b/platform/broadcom/sonic-platform-modules-nokia index 84092782791e..20f82d0144b4 160000 --- a/platform/broadcom/sonic-platform-modules-nokia +++ b/platform/broadcom/sonic-platform-modules-nokia @@ -1 +1 @@ -Subproject commit 84092782791ecc42b4f597fbea0c16204e4a8f9d +Subproject commit 20f82d0144b4afb71389f82636ba0e98a09c07a6 From 0528ae19d94feb48814ae7764c1dd353d4dd9a56 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Thu, 23 May 2024 21:11:01 +0200 Subject: [PATCH 164/282] [Arista] Update platform library submodules (#19050) Add SFP+ support for 7060X6 --- platform/barefoot/sonic-platform-modules-arista | 2 +- platform/broadcom/sonic-platform-modules-arista | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/barefoot/sonic-platform-modules-arista b/platform/barefoot/sonic-platform-modules-arista index c8924f32a3cf..af03fbd9f672 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit c8924f32a3cff45e35dcdfd9f0b7dd9d37cecf60 +Subproject commit af03fbd9f67260ba764c833aaaa65b2ff07762d7 diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index c8924f32a3cf..af03fbd9f672 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit c8924f32a3cff45e35dcdfd9f0b7dd9d37cecf60 +Subproject commit af03fbd9f67260ba764c833aaaa65b2ff07762d7 From e240bc79fb479cdc97f5e11b8f6ad6f4e8615f41 Mon Sep 17 00:00:00 2001 From: vmittal-msft <46945843+vmittal-msft@users.noreply.github.com> Date: Thu, 23 May 2024 12:16:12 -0700 Subject: [PATCH 165/282] [yang]: adding Buffer pool enum type both for sonic chassis (#18956) --- .../tests/yang_model_tests/tests/buffer_pool.json | 3 +++ .../yang_model_tests/tests_config/buffer_pool.json | 14 ++++++++++++++ .../yang-models/sonic-buffer-pool.yang | 1 + 3 files changed, 18 insertions(+) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_pool.json b/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_pool.json index 907fa9101ab3..974ece55dd79 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_pool.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/buffer_pool.json @@ -5,6 +5,9 @@ "BUFFER_POOL_CORRECT_TYPE_EGRESS_VALUE": { "desc": "BUFFER_POOL_CORRECT_TYPE_EGRESS_VALUE no failure." }, + "BUFFER_POOL_CORRECT_TYPE_BOTH_VALUE": { + "desc": "BUFFER_POOL_CORRECT_TYPE_BOTH_VALUE no failure." + }, "BUFFER_POOL_WRONG_TYPE_VALUE": { "desc": "BUFFER_POOL_WRONG_TYPE_VALUE pattern failure.", "eStr": "wrong" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_pool.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_pool.json index 8a0005305faa..a2a4d6fc1f0e 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_pool.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/buffer_pool.json @@ -27,6 +27,20 @@ } } }, + "BUFFER_POOL_CORRECT_TYPE_BOTH_VALUE": { + "sonic-buffer-pool:sonic-buffer-pool": { + "sonic-buffer-pool:BUFFER_POOL": { + "BUFFER_POOL_LIST": [ + { + "name": "Ethernet4", + "mode": "static", + "size": "12766208", + "type": "both" + } + ] + } + } + }, "BUFFER_POOL_WRONG_TYPE_VALUE": { "sonic-buffer-pool:sonic-buffer-pool": { "sonic-buffer-pool:BUFFER_POOL": { diff --git a/src/sonic-yang-models/yang-models/sonic-buffer-pool.yang b/src/sonic-yang-models/yang-models/sonic-buffer-pool.yang index fd83218573b5..dd8c74c13ab5 100644 --- a/src/sonic-yang-models/yang-models/sonic-buffer-pool.yang +++ b/src/sonic-yang-models/yang-models/sonic-buffer-pool.yang @@ -33,6 +33,7 @@ module sonic-buffer-pool { type enumeration { enum ingress; enum egress; + enum both; } description "Buffer Pool Type"; } From 65cbd12542e9b5f2a5b7f60bb7eee503c35e19eb Mon Sep 17 00:00:00 2001 From: Tejaswini Chadaga <85581939+tjchadaga@users.noreply.github.com> Date: Thu, 23 May 2024 13:02:13 -0700 Subject: [PATCH 166/282] Yang model changes for Sequential IDF isolation (#18597) #### Why I did it To define a field to track isolation state for the IDF to which the T2 device belongs #### How I did it Added yang model definition, unit tests, sample config and documentation for the table #### How to verify it Validated config tree generation using "pyang -Vf tree -p /usr/local/share/yang/modules/ietf ./yang-models/sonic-voq-inband-interface.yang" Built the below python-wheels to validate unit tests and other changes target/python-wheels/bullseye/sonic_yang_mgmt-1.0-py3-none-any.whl target/python-wheels/bullseye/sonic_yang_models-1.0-py3-none-any.whl target/python-wheels/bullseye/sonic_config_engine-1.0-py3-none-any.whl --- files/build_templates/init_cfg.json.j2 | 3 +- src/sonic-yang-models/doc/Configuration.md | 12 +++-- .../tests/files/sample_config_db.json | 3 +- .../tests/bgp_device_global.json | 18 ++++++- .../tests_config/bgp_device_global.json | 54 +++++++++++++++++-- .../yang-models/sonic-bgp-device-global.yang | 14 +++++ 6 files changed, 90 insertions(+), 14 deletions(-) diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index ae382263bb18..f31b5a22f5bb 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -30,7 +30,8 @@ }, "BGP_DEVICE_GLOBAL": { "STATE": { - "tsa_enabled": "false" + "tsa_enabled": "false", + "idf_isolation_state": "unisolated" } }, {%- set features = [("bgp", "{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}disabled{% else %}enabled{% endif %}", false, "enabled"), diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 0017abaa570e..f1bc162cb831 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -407,16 +407,18 @@ ASIC/SDK health event related configuration is defined in **SUPPRESS_ASIC_SDK_HE ### BGP Device Global -The **BGP_DEVICE_GLOBAL** table contains device-level BGP global state. -It has a STATE object containing device state like **tsa_enabled** -which is set to true if device is currently isolated using -traffic-shift-away (TSA) route-maps in BGP +The **BGP_DEVICE_GLOBAL** table contains device-level BGP global state. +It has a STATE object containing device state like **tsa_enabled** +which is set to true if device is currently isolated using +traffic-shift-away (TSA) route-maps in BGP. It also holds IDF isolation state +which could be one of isolated_no_export, isolated_withdraw_all or unisolated ``` { "BGP_DEVICE_GLOBAL": { "STATE": { - "tsa_enabled": "true" + "tsa_enabled": "true", + "idf_isolation_state": "isolated_no_export" } } ``` diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 36814657de41..42c40ab36b0a 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1707,7 +1707,8 @@ }, "BGP_DEVICE_GLOBAL": { "STATE": { - "tsa_enabled": "false" + "tsa_enabled": "false", + "idf_isolation_state": "unisolated" } }, "BGP_PEER_RANGE": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json index 233f23f3d62a..3c3a8559b3e6 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json @@ -8,9 +8,23 @@ "BGP_DEVICE_GLOBAL_WITH_TSB_TEST": { "desc": "Load bgp device global table with tsa_enabled set to false" }, - "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE": { + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_1": { + "desc": "Load bgp device global table with idf_isolation_state set to isolated_no_export" + }, + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_2": { + "desc": "Load bgp device global table with idf_isolation_state set to isolated_withdraw_all" + }, + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_3": { + "desc": "Load bgp device global table with idf_isolation_state set to unisolated" + }, + "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE_1": { "desc": "Load bgp device global table with invalid value", "eStrKey": "InvalidValue", "eStr": ["tsa_enabled"] + }, + "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE_2": { + "desc": "Load bgp device global table with invalid value", + "eStrKey": "InvalidValue", + "eStr": ["idf_isolation_state"] } -} +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_device_global.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_device_global.json index f96de59df390..b9bb4fe007c0 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_device_global.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_device_global.json @@ -3,7 +3,8 @@ "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "false" + "tsa_enabled": "false", + "idf_isolation_state": "unisolated" } } } @@ -12,7 +13,8 @@ "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "true" + "tsa_enabled": "true", + "idf_isolation_state": "unisolated" } } } @@ -21,16 +23,58 @@ "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "false" + "tsa_enabled": "false", + "idf_isolation_state": "unisolated" } } } }, - "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE": { + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_1": { "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "FALSE" + "tsa_enabled": "true", + "idf_isolation_state": "isolated_no_export" + } + } + } + }, + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_2": { + "sonic-bgp-device-global:sonic-bgp-device-global": { + "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { + "STATE":{ + "tsa_enabled": "false", + "idf_isolation_state": "isolated_withdraw_all" + } + } + } + }, + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_3": { + "sonic-bgp-device-global:sonic-bgp-device-global": { + "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { + "STATE":{ + "tsa_enabled": "false", + "idf_isolation_state": "unisolated" + } + } + } + }, + "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE_1": { + "sonic-bgp-device-global:sonic-bgp-device-global": { + "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { + "STATE":{ + "tsa_enabled": "FALSE", + "idf_isolation_state": "unisolated" + } + } + } + }, + "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE_2": { + "sonic-bgp-device-global:sonic-bgp-device-global": { + "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { + "STATE":{ + "tsa_enabled": "false", + "idf_isolation_state": "isolated" } } } diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-device-global.yang b/src/sonic-yang-models/yang-models/sonic-bgp-device-global.yang index 277be6870922..07e763735f8f 100644 --- a/src/sonic-yang-models/yang-models/sonic-bgp-device-global.yang +++ b/src/sonic-yang-models/yang-models/sonic-bgp-device-global.yang @@ -27,6 +27,20 @@ module sonic-bgp-device-global { description "When set to true, Traffic is shifted away (TSA), i.e, BGP routes are not advertised to neighboring routers"; } + leaf idf_isolation_state { + type enumeration { + enum isolated_no_export { + description "IDF isolated using no-export community tag"; + } + enum isolated_withdraw_all { + description "IDF isolated by withdrawing routes"; + } + enum unisolated { + description "IDF un-isolated"; + } + } + default unisolated; + } } /* end of STATE container */ } /* end of BGP_DEVICE_GLOBAL container */ From a7ab698f1c7218b4ddc4db63c42918a8c3eb9eb4 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 24 May 2024 19:00:57 +0800 Subject: [PATCH 167/282] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#19063) #### Why I did it src/sonic-sairedis ``` * a83b083 - (HEAD -> master, origin/master, origin/HEAD) Update pipeline (#1382) (16 hours ago) [Kamil Cudnik] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 256ce7dc546e..a83b083a6e1c 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 256ce7dc546e99dbeeb43404c4157ed7136e2932 +Subproject commit a83b083a6e1cb71127bf09c0778673b2934d4891 From c5c54c61983dc74a839e8ac6196f6499f86d8b13 Mon Sep 17 00:00:00 2001 From: Arvindsrinivasan Lakshmi Narasimhan <55814491+arlakshm@users.noreply.github.com> Date: Fri, 24 May 2024 08:02:19 -0700 Subject: [PATCH 168/282] [yang]: add chassis hostname to device metadata (#19019) Add chassis-hostname leaf to the sonic-device_metadata.yang --- src/sonic-yang-models/tests/files/sample_config_db.json | 3 ++- .../tests/yang_model_tests/tests/device_metadata.json | 3 +++ .../yang_model_tests/tests_config/device_metadata.json | 9 +++++++++ .../yang-models/sonic-device_metadata.yang | 5 +++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 42c40ab36b0a..2d2c2e63d4ec 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -369,7 +369,8 @@ "yang_config_validation": "disable", "rack_mgmt_map": "dummy_value", "timezone": "Europe/Kiev", - "bgp_router_id": "8.8.8.8" + "bgp_router_id": "8.8.8.8", + "chassis_hostname": "str-sonic-chassis-1" } }, "VLAN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 226107109944..5f81f02a3c7e 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -169,5 +169,8 @@ "DEVICE_METADATA_INVALID_BGP_ROUTER_ID": { "desc": "Verifying invalid bgp_router_id configuration.", "eStrKey": "Pattern" + }, + "DEVICE_METADATA_VALID_CHASSIS_HOSTNAME": { + "desc": "Verifying valid chassis hostname configuration." } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index cda0eef26e23..75d08694a5a5 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -462,5 +462,14 @@ } } } + }, + "DEVICE_METADATA_VALID_CHASSIS_HOSTNAME": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "chassis_hostname": "sonic-chassis-1" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 02f81283cf7d..e201b4bfde81 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -254,6 +254,11 @@ module sonic-device_metadata { type inet:ipv4-address; description "BGP Router identifier"; } + + leaf chassis_hostname { + description "hostname of the chassis to which this linecard or supervisor belongs to"; + type stypes:hostname; + } } /* end of container localhost */ } From e42dccb2fca9a1cbe7883aa8477fa01c71e244bb Mon Sep 17 00:00:00 2001 From: andywongarista <78833093+andywongarista@users.noreply.github.com> Date: Fri, 24 May 2024 08:17:26 -0700 Subject: [PATCH 169/282] [devices]: Add buffers_defaults_t1 to D108C8 (#18845) This symlink is required else config-setup fails --- .../Arista-7260CX3-D108C8/buffers_defaults_t1.j2 | 1 + 1 file changed, 1 insertion(+) create mode 120000 device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t1.j2 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file From 7fb369efd30cb5a0fd9cd780431d68329f6d3e4e Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Thu, 16 May 2024 03:04:43 -0700 Subject: [PATCH 170/282] Add support for the SFP ports on Quicksilver --- .../Arista-7060X6-64DE-256x200G/hwsku.json | 6 + .../port_config.ini | 2 + .../th5-a7060x6-64de.config.bcm | 15 ++ .../Arista-7060X6-64DE-64x400G/hwsku.json | 6 + .../port_config.ini | 2 + .../Arista-7060X6-64DE/hwsku.json | 6 + .../Arista-7060X6-64DE/port_config.ini | 2 + .../th5-a7060x6-64de.config.bcm | 15 ++ .../x86_64-arista_7060x6_64de/platform.json | 26 ++- .../Arista-7060X6-64PE/hwsku.json | 202 ++++++++++++++++++ .../Arista-7060X6-64PE/port_config.ini | 2 + .../th5-a7060x6-64pe.config.bcm | 15 ++ .../x86_64-arista_7060x6_64pe/platform.json | 26 ++- 13 files changed, 323 insertions(+), 2 deletions(-) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/hwsku.json diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json index f30bfc4a06f2..5b1282251efc 100644 --- a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/hwsku.json @@ -191,6 +191,12 @@ }, "Ethernet504": { "default_brkout_mode": "4x200G" + }, + "Ethernet512": { + "default_brkout_mode": "1x10G" + }, + "Ethernet513": { + "default_brkout_mode": "1x10G" } } } diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini index 323b8e2612eb..86b32b0bfd91 100644 --- a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/port_config.ini @@ -255,3 +255,5 @@ Ethernet504 497,498 Ethernet64/1 64 200000 rs Ethernet506 499,500 Ethernet64/3 64 200000 rs Ethernet508 501,502 Ethernet64/5 64 200000 rs Ethernet510 503,504 Ethernet64/7 64 200000 rs +Ethernet512 513 Ethernet65 65 10000 none +Ethernet513 515 Ethernet66 66 10000 none diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm index b418d4965799..79ebb0dfe5df 100644 --- a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-256x200G/th5-a7060x6-64de.config.bcm @@ -1842,6 +1842,14 @@ device: PORT_ID: 348 : PC_PHYS_PORT_ID: 511 + ? + PORT_ID: 76 + : + PC_PHYS_PORT_ID: 513 + ? + PORT_ID: 274 + : + PC_PHYS_PORT_ID: 515 ... --- device: @@ -1886,6 +1894,13 @@ device: NUM_LANES: 2 FEC_MODE: PC_FEC_RS544_2XN MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [[76, 76], [274, 274]] + : + ENABLE: 0 + MAX_FRAME_SIZE: 9416 + SPEED: 10000 + NUM_LANES: 1 ... --- bcm_device: diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/hwsku.json b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/hwsku.json index 84e39004f9da..155c1da1d139 100644 --- a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/hwsku.json +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/hwsku.json @@ -191,6 +191,12 @@ }, "Ethernet504": { "default_brkout_mode": "1x400G" + }, + "Ethernet512": { + "default_brkout_mode": "1x10G" + }, + "Ethernet513": { + "default_brkout_mode": "1x10G" } } } diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/port_config.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/port_config.ini index dfb191acec93..d29a307ac8ff 100644 --- a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/port_config.ini +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/port_config.ini @@ -63,3 +63,5 @@ Ethernet480 505,506,507,508,509,510,511,512 Ethernet61/1 61 400000 rs Ethernet488 489,490,491,492,493,494,495,496 Ethernet62/1 62 400000 rs Ethernet496 481,482,483,484,485,486,487,488 Ethernet63/1 63 400000 rs Ethernet504 497,498,499,500,501,502,503,504 Ethernet64/1 64 400000 rs +Ethernet512 513 Ethernet65 65 10000 none +Ethernet513 515 Ethernet66 66 10000 none diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/hwsku.json b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/hwsku.json index 74df314829bd..62b564403fdc 100644 --- a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/hwsku.json +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/hwsku.json @@ -191,6 +191,12 @@ }, "Ethernet504": { "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet512": { + "default_brkout_mode": "1x10G" + }, + "Ethernet513": { + "default_brkout_mode": "1x10G" } } } diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/port_config.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/port_config.ini index 48d2519c0ca4..881462c0626b 100644 --- a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/port_config.ini +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/port_config.ini @@ -63,3 +63,5 @@ Ethernet480 505,506,507,508,509,510,511,512 Ethernet61/1 61 800000 rs Ethernet488 489,490,491,492,493,494,495,496 Ethernet62/1 62 800000 rs Ethernet496 481,482,483,484,485,486,487,488 Ethernet63/1 63 800000 rs Ethernet504 497,498,499,500,501,502,503,504 Ethernet64/1 64 800000 rs +Ethernet512 513 Ethernet65 65 10000 none +Ethernet513 515 Ethernet66 66 10000 none diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/th5-a7060x6-64de.config.bcm b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/th5-a7060x6-64de.config.bcm index 33fa541ca59d..afe53dfe8ad6 100644 --- a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/th5-a7060x6-64de.config.bcm +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/th5-a7060x6-64de.config.bcm @@ -1074,6 +1074,14 @@ device: PORT_ID: 342 : PC_PHYS_PORT_ID: 505 + ? + PORT_ID: 76 + : + PC_PHYS_PORT_ID: 513 + ? + PORT_ID: 274 + : + PC_PHYS_PORT_ID: 515 ... --- device: @@ -1118,6 +1126,13 @@ device: NUM_LANES: 8 FEC_MODE: PC_FEC_RS544_2XN MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [[76, 76], [274, 274]] + : + ENABLE: 0 + MAX_FRAME_SIZE: 9416 + SPEED: 10000 + NUM_LANES: 1 ... --- bcm_device: diff --git a/device/arista/x86_64-arista_7060x6_64de/platform.json b/device/arista/x86_64-arista_7060x6_64de/platform.json index 6af55dd4f738..2bf04ce30aef 100644 --- a/device/arista/x86_64-arista_7060x6_64de/platform.json +++ b/device/arista/x86_64-arista_7060x6_64de/platform.json @@ -308,6 +308,12 @@ }, { "name": "osfp64" + }, + { + "name": "sfp65" + }, + { + "name": "sfp66" } ] }, @@ -1719,6 +1725,24 @@ "Ethernet64/7" ] } + }, + "Ethernet512": { + "index": "65", + "lanes": "513", + "breakout_modes": { + "1x10G": [ + "Ethernet65" + ] + } + }, + "Ethernet513": { + "index": "66", + "lanes": "515", + "breakout_modes": { + "1x10G": [ + "Ethernet66" + ] + } } } -} \ No newline at end of file +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/hwsku.json b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/hwsku.json new file mode 100644 index 000000000000..62b564403fdc --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/hwsku.json @@ -0,0 +1,202 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet8": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet16": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet24": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet32": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet40": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet48": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet56": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet64": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet72": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet80": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet88": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet96": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet104": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet112": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet120": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet128": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet136": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet144": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet152": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet160": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet168": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet176": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet184": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet192": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet200": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet208": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet216": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet224": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet232": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet240": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet248": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet256": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet264": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet272": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet280": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet288": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet296": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet304": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet312": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet320": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet328": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet336": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet344": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet352": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet360": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet368": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet376": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet384": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet392": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet400": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet408": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet416": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet424": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet432": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet440": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet448": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet456": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet464": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet472": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet480": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet488": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet496": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet504": { + "default_brkout_mode": "1x800G[400G]" + }, + "Ethernet512": { + "default_brkout_mode": "1x10G" + }, + "Ethernet513": { + "default_brkout_mode": "1x10G" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini index 48d2519c0ca4..881462c0626b 100644 --- a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/port_config.ini @@ -63,3 +63,5 @@ Ethernet480 505,506,507,508,509,510,511,512 Ethernet61/1 61 800000 rs Ethernet488 489,490,491,492,493,494,495,496 Ethernet62/1 62 800000 rs Ethernet496 481,482,483,484,485,486,487,488 Ethernet63/1 63 800000 rs Ethernet504 497,498,499,500,501,502,503,504 Ethernet64/1 64 800000 rs +Ethernet512 513 Ethernet65 65 10000 none +Ethernet513 515 Ethernet66 66 10000 none diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm index 015f79440198..2db52548e224 100644 --- a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/th5-a7060x6-64pe.config.bcm @@ -1074,6 +1074,14 @@ device: PORT_ID: 342 : PC_PHYS_PORT_ID: 505 + ? + PORT_ID: 76 + : + PC_PHYS_PORT_ID: 513 + ? + PORT_ID: 274 + : + PC_PHYS_PORT_ID: 515 ... --- device: @@ -1118,6 +1126,13 @@ device: NUM_LANES: 8 FEC_MODE: PC_FEC_RS544_2XN MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [[76, 76], [274, 274]] + : + ENABLE: 0 + MAX_FRAME_SIZE: 9416 + SPEED: 10000 + NUM_LANES: 1 ... --- bcm_device: diff --git a/device/arista/x86_64-arista_7060x6_64pe/platform.json b/device/arista/x86_64-arista_7060x6_64pe/platform.json index 45c564a126f9..1d8ef14e4a93 100644 --- a/device/arista/x86_64-arista_7060x6_64pe/platform.json +++ b/device/arista/x86_64-arista_7060x6_64pe/platform.json @@ -304,6 +304,12 @@ }, { "name": "osfp64" + }, + { + "name": "sfp65" + }, + { + "name": "sfp66" } ] }, @@ -1715,6 +1721,24 @@ "Ethernet64/7" ] } + }, + "Ethernet512": { + "index": "65", + "lanes": "513", + "breakout_modes": { + "1x10G": [ + "Ethernet65" + ] + } + }, + "Ethernet513": { + "index": "66", + "lanes": "515", + "breakout_modes": { + "1x10G": [ + "Ethernet66" + ] + } } } -} \ No newline at end of file +} From 676a87ca59399012046b7232ac1655f98506c204 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Wed, 1 May 2024 09:57:26 -0700 Subject: [PATCH 171/282] Add a 256x200G profile for QuicksilverP --- .../Arista-7060X6-64PE-256x200G/hwsku.json | 202 ++++++++++++++++++ .../port_config.ini | 2 + .../th5-a7060x6-64pe.config.bcm | 15 ++ 3 files changed, 219 insertions(+) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/hwsku.json diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/hwsku.json b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/hwsku.json new file mode 100644 index 000000000000..5b1282251efc --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/hwsku.json @@ -0,0 +1,202 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "4x200G" + }, + "Ethernet8": { + "default_brkout_mode": "4x200G" + }, + "Ethernet16": { + "default_brkout_mode": "4x200G" + }, + "Ethernet24": { + "default_brkout_mode": "4x200G" + }, + "Ethernet32": { + "default_brkout_mode": "4x200G" + }, + "Ethernet40": { + "default_brkout_mode": "4x200G" + }, + "Ethernet48": { + "default_brkout_mode": "4x200G" + }, + "Ethernet56": { + "default_brkout_mode": "4x200G" + }, + "Ethernet64": { + "default_brkout_mode": "4x200G" + }, + "Ethernet72": { + "default_brkout_mode": "4x200G" + }, + "Ethernet80": { + "default_brkout_mode": "4x200G" + }, + "Ethernet88": { + "default_brkout_mode": "4x200G" + }, + "Ethernet96": { + "default_brkout_mode": "4x200G" + }, + "Ethernet104": { + "default_brkout_mode": "4x200G" + }, + "Ethernet112": { + "default_brkout_mode": "4x200G" + }, + "Ethernet120": { + "default_brkout_mode": "4x200G" + }, + "Ethernet128": { + "default_brkout_mode": "4x200G" + }, + "Ethernet136": { + "default_brkout_mode": "4x200G" + }, + "Ethernet144": { + "default_brkout_mode": "4x200G" + }, + "Ethernet152": { + "default_brkout_mode": "4x200G" + }, + "Ethernet160": { + "default_brkout_mode": "4x200G" + }, + "Ethernet168": { + "default_brkout_mode": "4x200G" + }, + "Ethernet176": { + "default_brkout_mode": "4x200G" + }, + "Ethernet184": { + "default_brkout_mode": "4x200G" + }, + "Ethernet192": { + "default_brkout_mode": "4x200G" + }, + "Ethernet200": { + "default_brkout_mode": "4x200G" + }, + "Ethernet208": { + "default_brkout_mode": "4x200G" + }, + "Ethernet216": { + "default_brkout_mode": "4x200G" + }, + "Ethernet224": { + "default_brkout_mode": "4x200G" + }, + "Ethernet232": { + "default_brkout_mode": "4x200G" + }, + "Ethernet240": { + "default_brkout_mode": "4x200G" + }, + "Ethernet248": { + "default_brkout_mode": "4x200G" + }, + "Ethernet256": { + "default_brkout_mode": "4x200G" + }, + "Ethernet264": { + "default_brkout_mode": "4x200G" + }, + "Ethernet272": { + "default_brkout_mode": "4x200G" + }, + "Ethernet280": { + "default_brkout_mode": "4x200G" + }, + "Ethernet288": { + "default_brkout_mode": "4x200G" + }, + "Ethernet296": { + "default_brkout_mode": "4x200G" + }, + "Ethernet304": { + "default_brkout_mode": "4x200G" + }, + "Ethernet312": { + "default_brkout_mode": "4x200G" + }, + "Ethernet320": { + "default_brkout_mode": "4x200G" + }, + "Ethernet328": { + "default_brkout_mode": "4x200G" + }, + "Ethernet336": { + "default_brkout_mode": "4x200G" + }, + "Ethernet344": { + "default_brkout_mode": "4x200G" + }, + "Ethernet352": { + "default_brkout_mode": "4x200G" + }, + "Ethernet360": { + "default_brkout_mode": "4x200G" + }, + "Ethernet368": { + "default_brkout_mode": "4x200G" + }, + "Ethernet376": { + "default_brkout_mode": "4x200G" + }, + "Ethernet384": { + "default_brkout_mode": "4x200G" + }, + "Ethernet392": { + "default_brkout_mode": "4x200G" + }, + "Ethernet400": { + "default_brkout_mode": "4x200G" + }, + "Ethernet408": { + "default_brkout_mode": "4x200G" + }, + "Ethernet416": { + "default_brkout_mode": "4x200G" + }, + "Ethernet424": { + "default_brkout_mode": "4x200G" + }, + "Ethernet432": { + "default_brkout_mode": "4x200G" + }, + "Ethernet440": { + "default_brkout_mode": "4x200G" + }, + "Ethernet448": { + "default_brkout_mode": "4x200G" + }, + "Ethernet456": { + "default_brkout_mode": "4x200G" + }, + "Ethernet464": { + "default_brkout_mode": "4x200G" + }, + "Ethernet472": { + "default_brkout_mode": "4x200G" + }, + "Ethernet480": { + "default_brkout_mode": "4x200G" + }, + "Ethernet488": { + "default_brkout_mode": "4x200G" + }, + "Ethernet496": { + "default_brkout_mode": "4x200G" + }, + "Ethernet504": { + "default_brkout_mode": "4x200G" + }, + "Ethernet512": { + "default_brkout_mode": "1x10G" + }, + "Ethernet513": { + "default_brkout_mode": "1x10G" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini index 323b8e2612eb..86b32b0bfd91 100644 --- a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/port_config.ini @@ -255,3 +255,5 @@ Ethernet504 497,498 Ethernet64/1 64 200000 rs Ethernet506 499,500 Ethernet64/3 64 200000 rs Ethernet508 501,502 Ethernet64/5 64 200000 rs Ethernet510 503,504 Ethernet64/7 64 200000 rs +Ethernet512 513 Ethernet65 65 10000 none +Ethernet513 515 Ethernet66 66 10000 none diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm index 997636fdcc58..103fff69eb34 100644 --- a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/th5-a7060x6-64pe.config.bcm @@ -1842,6 +1842,14 @@ device: PORT_ID: 348 : PC_PHYS_PORT_ID: 511 + ? + PORT_ID: 76 + : + PC_PHYS_PORT_ID: 513 + ? + PORT_ID: 274 + : + PC_PHYS_PORT_ID: 515 ... --- device: @@ -1886,6 +1894,13 @@ device: NUM_LANES: 2 FEC_MODE: PC_FEC_RS544_2XN MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [[76, 76], [274, 274]] + : + ENABLE: 0 + MAX_FRAME_SIZE: 9416 + SPEED: 10000 + NUM_LANES: 1 ... --- bcm_device: From 48c2cde05630e5a50c3f850192681782b1e3be36 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Tue, 7 May 2024 11:18:18 -0700 Subject: [PATCH 172/282] Add new 128x400G HwSku for QuicksilverP --- .../Arista-7060X6-64PE-128x400G/hwsku.json | 202 +++ .../port_config.ini | 131 ++ .../Arista-7060X6-64PE-128x400G/sai.profile | 1 + .../th5-a7060x6-64pe.config.bcm | 1416 +++++++++++++++++ 4 files changed, 1750 insertions(+) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/hwsku.json create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/hwsku.json b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/hwsku.json new file mode 100644 index 000000000000..b40939ff01fd --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/hwsku.json @@ -0,0 +1,202 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "2x400G" + }, + "Ethernet8": { + "default_brkout_mode": "2x400G" + }, + "Ethernet16": { + "default_brkout_mode": "2x400G" + }, + "Ethernet24": { + "default_brkout_mode": "2x400G" + }, + "Ethernet32": { + "default_brkout_mode": "2x400G" + }, + "Ethernet40": { + "default_brkout_mode": "2x400G" + }, + "Ethernet48": { + "default_brkout_mode": "2x400G" + }, + "Ethernet56": { + "default_brkout_mode": "2x400G" + }, + "Ethernet64": { + "default_brkout_mode": "2x400G" + }, + "Ethernet72": { + "default_brkout_mode": "2x400G" + }, + "Ethernet80": { + "default_brkout_mode": "2x400G" + }, + "Ethernet88": { + "default_brkout_mode": "2x400G" + }, + "Ethernet96": { + "default_brkout_mode": "2x400G" + }, + "Ethernet104": { + "default_brkout_mode": "2x400G" + }, + "Ethernet112": { + "default_brkout_mode": "2x400G" + }, + "Ethernet120": { + "default_brkout_mode": "2x400G" + }, + "Ethernet128": { + "default_brkout_mode": "2x400G" + }, + "Ethernet136": { + "default_brkout_mode": "2x400G" + }, + "Ethernet144": { + "default_brkout_mode": "2x400G" + }, + "Ethernet152": { + "default_brkout_mode": "2x400G" + }, + "Ethernet160": { + "default_brkout_mode": "2x400G" + }, + "Ethernet168": { + "default_brkout_mode": "2x400G" + }, + "Ethernet176": { + "default_brkout_mode": "2x400G" + }, + "Ethernet184": { + "default_brkout_mode": "2x400G" + }, + "Ethernet192": { + "default_brkout_mode": "2x400G" + }, + "Ethernet200": { + "default_brkout_mode": "2x400G" + }, + "Ethernet208": { + "default_brkout_mode": "2x400G" + }, + "Ethernet216": { + "default_brkout_mode": "2x400G" + }, + "Ethernet224": { + "default_brkout_mode": "2x400G" + }, + "Ethernet232": { + "default_brkout_mode": "2x400G" + }, + "Ethernet240": { + "default_brkout_mode": "2x400G" + }, + "Ethernet248": { + "default_brkout_mode": "2x400G" + }, + "Ethernet256": { + "default_brkout_mode": "2x400G" + }, + "Ethernet264": { + "default_brkout_mode": "2x400G" + }, + "Ethernet272": { + "default_brkout_mode": "2x400G" + }, + "Ethernet280": { + "default_brkout_mode": "2x400G" + }, + "Ethernet288": { + "default_brkout_mode": "2x400G" + }, + "Ethernet296": { + "default_brkout_mode": "2x400G" + }, + "Ethernet304": { + "default_brkout_mode": "2x400G" + }, + "Ethernet312": { + "default_brkout_mode": "2x400G" + }, + "Ethernet320": { + "default_brkout_mode": "2x400G" + }, + "Ethernet328": { + "default_brkout_mode": "2x400G" + }, + "Ethernet336": { + "default_brkout_mode": "2x400G" + }, + "Ethernet344": { + "default_brkout_mode": "2x400G" + }, + "Ethernet352": { + "default_brkout_mode": "2x400G" + }, + "Ethernet360": { + "default_brkout_mode": "2x400G" + }, + "Ethernet368": { + "default_brkout_mode": "2x400G" + }, + "Ethernet376": { + "default_brkout_mode": "2x400G" + }, + "Ethernet384": { + "default_brkout_mode": "2x400G" + }, + "Ethernet392": { + "default_brkout_mode": "2x400G" + }, + "Ethernet400": { + "default_brkout_mode": "2x400G" + }, + "Ethernet408": { + "default_brkout_mode": "2x400G" + }, + "Ethernet416": { + "default_brkout_mode": "2x400G" + }, + "Ethernet424": { + "default_brkout_mode": "2x400G" + }, + "Ethernet432": { + "default_brkout_mode": "2x400G" + }, + "Ethernet440": { + "default_brkout_mode": "2x400G" + }, + "Ethernet448": { + "default_brkout_mode": "2x400G" + }, + "Ethernet456": { + "default_brkout_mode": "2x400G" + }, + "Ethernet464": { + "default_brkout_mode": "2x400G" + }, + "Ethernet472": { + "default_brkout_mode": "2x400G" + }, + "Ethernet480": { + "default_brkout_mode": "2x400G" + }, + "Ethernet488": { + "default_brkout_mode": "2x400G" + }, + "Ethernet496": { + "default_brkout_mode": "2x400G" + }, + "Ethernet504": { + "default_brkout_mode": "2x400G" + }, + "Ethernet512": { + "default_brkout_mode": "1x10G" + }, + "Ethernet513": { + "default_brkout_mode": "1x10G" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/port_config.ini new file mode 100644 index 000000000000..4fee0c95baef --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/port_config.ini @@ -0,0 +1,131 @@ +# name lanes alias index speed fec +Ethernet0 17,18,19,20 Ethernet1/1 1 400000 rs +Ethernet4 21,22,23,24 Ethernet1/5 1 400000 rs +Ethernet8 1,2,3,4 Ethernet2/1 2 400000 rs +Ethernet12 5,6,7,8 Ethernet2/5 2 400000 rs +Ethernet16 9,10,11,12 Ethernet3/1 3 400000 rs +Ethernet20 13,14,15,16 Ethernet3/5 3 400000 rs +Ethernet24 25,26,27,28 Ethernet4/1 4 400000 rs +Ethernet28 29,30,31,32 Ethernet4/5 4 400000 rs +Ethernet32 57,58,59,60 Ethernet5/1 5 400000 rs +Ethernet36 61,62,63,64 Ethernet5/5 5 400000 rs +Ethernet40 41,42,43,44 Ethernet6/1 6 400000 rs +Ethernet44 45,46,47,48 Ethernet6/5 6 400000 rs +Ethernet48 33,34,35,36 Ethernet7/1 7 400000 rs +Ethernet52 37,38,39,40 Ethernet7/5 7 400000 rs +Ethernet56 49,50,51,52 Ethernet8/1 8 400000 rs +Ethernet60 53,54,55,56 Ethernet8/5 8 400000 rs +Ethernet64 89,90,91,92 Ethernet9/1 9 400000 rs +Ethernet68 93,94,95,96 Ethernet9/5 9 400000 rs +Ethernet72 73,74,75,76 Ethernet10/1 10 400000 rs +Ethernet76 77,78,79,80 Ethernet10/5 10 400000 rs +Ethernet80 65,66,67,68 Ethernet11/1 11 400000 rs +Ethernet84 69,70,71,72 Ethernet11/5 11 400000 rs +Ethernet88 81,82,83,84 Ethernet12/1 12 400000 rs +Ethernet92 85,86,87,88 Ethernet12/5 12 400000 rs +Ethernet96 121,122,123,124 Ethernet13/1 13 400000 rs +Ethernet100 125,126,127,128 Ethernet13/5 13 400000 rs +Ethernet104 105,106,107,108 Ethernet14/1 14 400000 rs +Ethernet108 109,110,111,112 Ethernet14/5 14 400000 rs +Ethernet112 97,98,99,100 Ethernet15/1 15 400000 rs +Ethernet116 101,102,103,104 Ethernet15/5 15 400000 rs +Ethernet120 113,114,115,116 Ethernet16/1 16 400000 rs +Ethernet124 117,118,119,120 Ethernet16/5 16 400000 rs +Ethernet128 153,154,155,156 Ethernet17/1 17 400000 rs +Ethernet132 157,158,159,160 Ethernet17/5 17 400000 rs +Ethernet136 137,138,139,140 Ethernet18/1 18 400000 rs +Ethernet140 141,142,143,144 Ethernet18/5 18 400000 rs +Ethernet144 129,130,131,132 Ethernet19/1 19 400000 rs +Ethernet148 133,134,135,136 Ethernet19/5 19 400000 rs +Ethernet152 145,146,147,148 Ethernet20/1 20 400000 rs +Ethernet156 149,150,151,152 Ethernet20/5 20 400000 rs +Ethernet160 185,186,187,188 Ethernet21/1 21 400000 rs +Ethernet164 189,190,191,192 Ethernet21/5 21 400000 rs +Ethernet168 169,170,171,172 Ethernet22/1 22 400000 rs +Ethernet172 173,174,175,176 Ethernet22/5 22 400000 rs +Ethernet176 161,162,163,164 Ethernet23/1 23 400000 rs +Ethernet180 165,166,167,168 Ethernet23/5 23 400000 rs +Ethernet184 177,178,179,180 Ethernet24/1 24 400000 rs +Ethernet188 181,182,183,184 Ethernet24/5 24 400000 rs +Ethernet192 217,218,219,220 Ethernet25/1 25 400000 rs +Ethernet196 221,222,223,224 Ethernet25/5 25 400000 rs +Ethernet200 201,202,203,204 Ethernet26/1 26 400000 rs +Ethernet204 205,206,207,208 Ethernet26/5 26 400000 rs +Ethernet208 193,194,195,196 Ethernet27/1 27 400000 rs +Ethernet212 197,198,199,200 Ethernet27/5 27 400000 rs +Ethernet216 209,210,211,212 Ethernet28/1 28 400000 rs +Ethernet220 213,214,215,216 Ethernet28/5 28 400000 rs +Ethernet224 249,250,251,252 Ethernet29/1 29 400000 rs +Ethernet228 253,254,255,256 Ethernet29/5 29 400000 rs +Ethernet232 233,234,235,236 Ethernet30/1 30 400000 rs +Ethernet236 237,238,239,240 Ethernet30/5 30 400000 rs +Ethernet240 225,226,227,228 Ethernet31/1 31 400000 rs +Ethernet244 229,230,231,232 Ethernet31/5 31 400000 rs +Ethernet248 241,242,243,244 Ethernet32/1 32 400000 rs +Ethernet252 245,246,247,248 Ethernet32/5 32 400000 rs +Ethernet256 273,274,275,276 Ethernet33/1 33 400000 rs +Ethernet260 277,278,279,280 Ethernet33/5 33 400000 rs +Ethernet264 257,258,259,260 Ethernet34/1 34 400000 rs +Ethernet268 261,262,263,264 Ethernet34/5 34 400000 rs +Ethernet272 265,266,267,268 Ethernet35/1 35 400000 rs +Ethernet276 269,270,271,272 Ethernet35/5 35 400000 rs +Ethernet280 281,282,283,284 Ethernet36/1 36 400000 rs +Ethernet284 285,286,287,288 Ethernet36/5 36 400000 rs +Ethernet288 313,314,315,316 Ethernet37/1 37 400000 rs +Ethernet292 317,318,319,320 Ethernet37/5 37 400000 rs +Ethernet296 297,298,299,300 Ethernet38/1 38 400000 rs +Ethernet300 301,302,303,304 Ethernet38/5 38 400000 rs +Ethernet304 289,290,291,292 Ethernet39/1 39 400000 rs +Ethernet308 293,294,295,296 Ethernet39/5 39 400000 rs +Ethernet312 305,306,307,308 Ethernet40/1 40 400000 rs +Ethernet316 309,310,311,312 Ethernet40/5 40 400000 rs +Ethernet320 345,346,347,348 Ethernet41/1 41 400000 rs +Ethernet324 349,350,351,352 Ethernet41/5 41 400000 rs +Ethernet328 329,330,331,332 Ethernet42/1 42 400000 rs +Ethernet332 333,334,335,336 Ethernet42/5 42 400000 rs +Ethernet336 321,322,323,324 Ethernet43/1 43 400000 rs +Ethernet340 325,326,327,328 Ethernet43/5 43 400000 rs +Ethernet344 337,338,339,340 Ethernet44/1 44 400000 rs +Ethernet348 341,342,343,344 Ethernet44/5 44 400000 rs +Ethernet352 377,378,379,380 Ethernet45/1 45 400000 rs +Ethernet356 381,382,381,382 Ethernet45/5 45 400000 rs +Ethernet360 361,362,363,364 Ethernet46/1 46 400000 rs +Ethernet364 365,366,367,368 Ethernet46/5 46 400000 rs +Ethernet368 353,354,355,356 Ethernet47/1 47 400000 rs +Ethernet372 357,358,359,360 Ethernet47/5 47 400000 rs +Ethernet376 369,370,371,372 Ethernet48/1 48 400000 rs +Ethernet380 373,374,375,376 Ethernet48/5 48 400000 rs +Ethernet384 409,410,411,412 Ethernet49/1 49 400000 rs +Ethernet388 413,414,415,416 Ethernet49/5 49 400000 rs +Ethernet392 393,394,395,396 Ethernet50/1 50 400000 rs +Ethernet396 397,398,399,400 Ethernet50/5 50 400000 rs +Ethernet400 385,386,387,388 Ethernet51/1 51 400000 rs +Ethernet404 389,390,391,392 Ethernet51/5 51 400000 rs +Ethernet408 401,402,403,404 Ethernet52/1 52 400000 rs +Ethernet412 405,406,407,408 Ethernet52/5 52 400000 rs +Ethernet416 441,442,443,444 Ethernet53/1 53 400000 rs +Ethernet420 445,446,447,448 Ethernet53/5 53 400000 rs +Ethernet424 425,426,427,428 Ethernet54/1 54 400000 rs +Ethernet428 429,430,431,432 Ethernet54/5 54 400000 rs +Ethernet432 417,418,419,420 Ethernet55/1 55 400000 rs +Ethernet436 421,422,423,424 Ethernet55/5 55 400000 rs +Ethernet440 433,434,435,436 Ethernet56/1 56 400000 rs +Ethernet444 437,438,439,430 Ethernet56/5 56 400000 rs +Ethernet448 473,474,475,476 Ethernet57/1 57 400000 rs +Ethernet452 477,478,479,480 Ethernet57/5 57 400000 rs +Ethernet456 457,458,459,460 Ethernet58/1 58 400000 rs +Ethernet460 461,462,463,464 Ethernet58/5 58 400000 rs +Ethernet464 449,450,451,452 Ethernet59/1 59 400000 rs +Ethernet468 453,454,453,454 Ethernet59/5 59 400000 rs +Ethernet472 465,466,467,468 Ethernet60/1 60 400000 rs +Ethernet476 469,470,471,472 Ethernet60/5 60 400000 rs +Ethernet480 505,506,507,508 Ethernet61/1 61 400000 rs +Ethernet484 509,510,511,512 Ethernet61/5 61 400000 rs +Ethernet488 489,490,491,492 Ethernet62/1 62 400000 rs +Ethernet492 493,494,495,496 Ethernet62/5 62 400000 rs +Ethernet496 481,482,483,483 Ethernet63/1 63 400000 rs +Ethernet500 485,486,487,488 Ethernet63/5 63 400000 rs +Ethernet504 497,498,499,500 Ethernet64/1 64 400000 rs +Ethernet508 501,502,503,504 Ethernet64/5 64 400000 rs +Ethernet512 513 Ethernet65 65 10000 none +Ethernet513 515 Ethernet66 66 10000 none diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/sai.profile b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/sai.profile new file mode 100644 index 000000000000..50c136d97b24 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/th5-a7060x6-64pe.config.bcm new file mode 100644 index 000000000000..6915862e1966 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/th5-a7060x6-64pe.config.bcm @@ -0,0 +1,1416 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +#
: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x26 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x67 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 5 + ? + PORT_ID: 3 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 4 + : + PC_PHYS_PORT_ID: 13 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 21 + ? + PORT_ID: 13 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 14 + : + PC_PHYS_PORT_ID: 29 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 37 + ? + PORT_ID: 24 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 25 + : + PC_PHYS_PORT_ID: 45 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 53 + ? + PORT_ID: 35 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 36 + : + PC_PHYS_PORT_ID: 61 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 69 + ? + PORT_ID: 46 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 47 + : + PC_PHYS_PORT_ID: 77 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 85 + ? + PORT_ID: 57 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 58 + : + PC_PHYS_PORT_ID: 93 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 101 + ? + PORT_ID: 68 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 69 + : + PC_PHYS_PORT_ID: 109 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 117 + ? + PORT_ID: 79 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 80 + : + PC_PHYS_PORT_ID: 125 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 133 + ? + PORT_ID: 90 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 91 + : + PC_PHYS_PORT_ID: 141 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 149 + ? + PORT_ID: 101 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 102 + : + PC_PHYS_PORT_ID: 157 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 165 + ? + PORT_ID: 112 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 113 + : + PC_PHYS_PORT_ID: 173 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 181 + ? + PORT_ID: 123 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 124 + : + PC_PHYS_PORT_ID: 189 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 197 + ? + PORT_ID: 134 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 135 + : + PC_PHYS_PORT_ID: 205 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 213 + ? + PORT_ID: 145 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 146 + : + PC_PHYS_PORT_ID: 221 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 229 + ? + PORT_ID: 156 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 157 + : + PC_PHYS_PORT_ID: 237 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 245 + ? + PORT_ID: 167 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 168 + : + PC_PHYS_PORT_ID: 253 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 261 + ? + PORT_ID: 178 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 179 + : + PC_PHYS_PORT_ID: 269 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 277 + ? + PORT_ID: 189 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 190 + : + PC_PHYS_PORT_ID: 285 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 293 + ? + PORT_ID: 200 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 201 + : + PC_PHYS_PORT_ID: 301 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 309 + ? + PORT_ID: 211 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 212 + : + PC_PHYS_PORT_ID: 317 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 325 + ? + PORT_ID: 222 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 223 + : + PC_PHYS_PORT_ID: 333 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 341 + ? + PORT_ID: 233 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 234 + : + PC_PHYS_PORT_ID: 349 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 357 + ? + PORT_ID: 244 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 245 + : + PC_PHYS_PORT_ID: 365 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 373 + ? + PORT_ID: 255 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 256 + : + PC_PHYS_PORT_ID: 381 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 389 + ? + PORT_ID: 266 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 267 + : + PC_PHYS_PORT_ID: 397 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 405 + ? + PORT_ID: 277 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 278 + : + PC_PHYS_PORT_ID: 413 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 421 + ? + PORT_ID: 288 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 289 + : + PC_PHYS_PORT_ID: 429 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 437 + ? + PORT_ID: 299 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 300 + : + PC_PHYS_PORT_ID: 445 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 453 + ? + PORT_ID: 310 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 311 + : + PC_PHYS_PORT_ID: 461 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 469 + ? + PORT_ID: 321 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 322 + : + PC_PHYS_PORT_ID: 477 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 485 + ? + PORT_ID: 332 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 333 + : + PC_PHYS_PORT_ID: 493 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 501 + ? + PORT_ID: 343 + : + PC_PHYS_PORT_ID: 505 + ? + PORT_ID: 344 + : + PC_PHYS_PORT_ID: 509 + ? + PORT_ID: 76 + : + PC_PHYS_PORT_ID: 513 + ? + PORT_ID: 274 + : + PC_PHYS_PORT_ID: 515 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 4], + [11, 14], + [22, 25], + [33, 36], + [44, 47], + [55, 58], + [66, 69], + [77, 80], + [88, 91], + [99, 102], + [110, 113], + [121, 124], + [132, 135], + [143, 146], + [154, 157], + [165, 168], + [176, 179], + [187, 190], + [198, 201], + [209, 212], + [220, 223], + [231, 234], + [242, 245], + [253, 256], + [264, 267], + [275, 278], + [286, 289], + [297, 300], + [308, 311], + [319, 322], + [330, 333], + [341, 344]] + : + ENABLE: 0 + SPEED: 400000 + NUM_LANES: 4 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [[76, 76], [274, 274]] + : + ENABLE: 0 + MAX_FRAME_SIZE: 9416 + SPEED: 10000 + NUM_LANES: 1 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... From 3e1043bc8452b6a6c91f11712a0bd8378e38aa07 Mon Sep 17 00:00:00 2001 From: David Meggy Date: Wed, 8 May 2024 10:10:18 -0700 Subject: [PATCH 173/282] Add new 64x400G HwSku for QuicksilverP --- .../Arista-7060X6-64PE-64x400G/hwsku.json | 202 +++ .../port_config.ini | 67 + .../Arista-7060X6-64PE-64x400G/sai.profile | 1 + .../th5-a7060x6-64pe.config.bcm | 1160 +++++++++++++++++ 4 files changed, 1430 insertions(+) create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/hwsku.json create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/port_config.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/sai.profile create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/hwsku.json b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/hwsku.json new file mode 100644 index 000000000000..155c1da1d139 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/hwsku.json @@ -0,0 +1,202 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x400G" + }, + "Ethernet8": { + "default_brkout_mode": "1x400G" + }, + "Ethernet16": { + "default_brkout_mode": "1x400G" + }, + "Ethernet24": { + "default_brkout_mode": "1x400G" + }, + "Ethernet32": { + "default_brkout_mode": "1x400G" + }, + "Ethernet40": { + "default_brkout_mode": "1x400G" + }, + "Ethernet48": { + "default_brkout_mode": "1x400G" + }, + "Ethernet56": { + "default_brkout_mode": "1x400G" + }, + "Ethernet64": { + "default_brkout_mode": "1x400G" + }, + "Ethernet72": { + "default_brkout_mode": "1x400G" + }, + "Ethernet80": { + "default_brkout_mode": "1x400G" + }, + "Ethernet88": { + "default_brkout_mode": "1x400G" + }, + "Ethernet96": { + "default_brkout_mode": "1x400G" + }, + "Ethernet104": { + "default_brkout_mode": "1x400G" + }, + "Ethernet112": { + "default_brkout_mode": "1x400G" + }, + "Ethernet120": { + "default_brkout_mode": "1x400G" + }, + "Ethernet128": { + "default_brkout_mode": "1x400G" + }, + "Ethernet136": { + "default_brkout_mode": "1x400G" + }, + "Ethernet144": { + "default_brkout_mode": "1x400G" + }, + "Ethernet152": { + "default_brkout_mode": "1x400G" + }, + "Ethernet160": { + "default_brkout_mode": "1x400G" + }, + "Ethernet168": { + "default_brkout_mode": "1x400G" + }, + "Ethernet176": { + "default_brkout_mode": "1x400G" + }, + "Ethernet184": { + "default_brkout_mode": "1x400G" + }, + "Ethernet192": { + "default_brkout_mode": "1x400G" + }, + "Ethernet200": { + "default_brkout_mode": "1x400G" + }, + "Ethernet208": { + "default_brkout_mode": "1x400G" + }, + "Ethernet216": { + "default_brkout_mode": "1x400G" + }, + "Ethernet224": { + "default_brkout_mode": "1x400G" + }, + "Ethernet232": { + "default_brkout_mode": "1x400G" + }, + "Ethernet240": { + "default_brkout_mode": "1x400G" + }, + "Ethernet248": { + "default_brkout_mode": "1x400G" + }, + "Ethernet256": { + "default_brkout_mode": "1x400G" + }, + "Ethernet264": { + "default_brkout_mode": "1x400G" + }, + "Ethernet272": { + "default_brkout_mode": "1x400G" + }, + "Ethernet280": { + "default_brkout_mode": "1x400G" + }, + "Ethernet288": { + "default_brkout_mode": "1x400G" + }, + "Ethernet296": { + "default_brkout_mode": "1x400G" + }, + "Ethernet304": { + "default_brkout_mode": "1x400G" + }, + "Ethernet312": { + "default_brkout_mode": "1x400G" + }, + "Ethernet320": { + "default_brkout_mode": "1x400G" + }, + "Ethernet328": { + "default_brkout_mode": "1x400G" + }, + "Ethernet336": { + "default_brkout_mode": "1x400G" + }, + "Ethernet344": { + "default_brkout_mode": "1x400G" + }, + "Ethernet352": { + "default_brkout_mode": "1x400G" + }, + "Ethernet360": { + "default_brkout_mode": "1x400G" + }, + "Ethernet368": { + "default_brkout_mode": "1x400G" + }, + "Ethernet376": { + "default_brkout_mode": "1x400G" + }, + "Ethernet384": { + "default_brkout_mode": "1x400G" + }, + "Ethernet392": { + "default_brkout_mode": "1x400G" + }, + "Ethernet400": { + "default_brkout_mode": "1x400G" + }, + "Ethernet408": { + "default_brkout_mode": "1x400G" + }, + "Ethernet416": { + "default_brkout_mode": "1x400G" + }, + "Ethernet424": { + "default_brkout_mode": "1x400G" + }, + "Ethernet432": { + "default_brkout_mode": "1x400G" + }, + "Ethernet440": { + "default_brkout_mode": "1x400G" + }, + "Ethernet448": { + "default_brkout_mode": "1x400G" + }, + "Ethernet456": { + "default_brkout_mode": "1x400G" + }, + "Ethernet464": { + "default_brkout_mode": "1x400G" + }, + "Ethernet472": { + "default_brkout_mode": "1x400G" + }, + "Ethernet480": { + "default_brkout_mode": "1x400G" + }, + "Ethernet488": { + "default_brkout_mode": "1x400G" + }, + "Ethernet496": { + "default_brkout_mode": "1x400G" + }, + "Ethernet504": { + "default_brkout_mode": "1x400G" + }, + "Ethernet512": { + "default_brkout_mode": "1x10G" + }, + "Ethernet513": { + "default_brkout_mode": "1x10G" + } + } +} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/port_config.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/port_config.ini new file mode 100644 index 000000000000..d29a307ac8ff --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/port_config.ini @@ -0,0 +1,67 @@ +# name lanes alias index speed fec +Ethernet0 17,18,19,20,21,22,23,24 Ethernet1/1 1 400000 rs +Ethernet8 1,2,3,4,5,6,7,8 Ethernet2/1 2 400000 rs +Ethernet16 9,10,11,12,13,14,15,16 Ethernet3/1 3 400000 rs +Ethernet24 25,26,27,28,29,30,31,32 Ethernet4/1 4 400000 rs +Ethernet32 57,58,59,60,61,62,63,64 Ethernet5/1 5 400000 rs +Ethernet40 41,42,43,44,45,46,47,48 Ethernet6/1 6 400000 rs +Ethernet48 33,34,35,36,37,38,39,40 Ethernet7/1 7 400000 rs +Ethernet56 49,50,51,52,53,54,55,56 Ethernet8/1 8 400000 rs +Ethernet64 89,90,91,92,93,94,95,96 Ethernet9/1 9 400000 rs +Ethernet72 73,74,75,76,77,78,79,80 Ethernet10/1 10 400000 rs +Ethernet80 65,66,67,68,69,70,71,72 Ethernet11/1 11 400000 rs +Ethernet88 81,82,83,84,85,86,87,88 Ethernet12/1 12 400000 rs +Ethernet96 121,122,123,124,125,126,127,128 Ethernet13/1 13 400000 rs +Ethernet104 105,106,107,108,109,110,111,112 Ethernet14/1 14 400000 rs +Ethernet112 97,98,99,100,101,102,103,104 Ethernet15/1 15 400000 rs +Ethernet120 113,114,115,116,117,118,119,120 Ethernet16/1 16 400000 rs +Ethernet128 153,154,155,156,157,158,159,160 Ethernet17/1 17 400000 rs +Ethernet136 137,138,139,140,141,142,143,144 Ethernet18/1 18 400000 rs +Ethernet144 129,130,131,132,133,134,135,136 Ethernet19/1 19 400000 rs +Ethernet152 145,146,147,148,149,150,151,152 Ethernet20/1 20 400000 rs +Ethernet160 185,186,187,188,189,190,191,192 Ethernet21/1 21 400000 rs +Ethernet168 169,170,171,172,173,174,175,176 Ethernet22/1 22 400000 rs +Ethernet176 161,162,163,164,165,166,167,168 Ethernet23/1 23 400000 rs +Ethernet184 177,178,179,180,181,182,183,184 Ethernet24/1 24 400000 rs +Ethernet192 217,218,219,220,221,222,223,224 Ethernet25/1 25 400000 rs +Ethernet200 201,202,203,204,205,206,207,208 Ethernet26/1 26 400000 rs +Ethernet208 193,194,195,196,197,198,199,200 Ethernet27/1 27 400000 rs +Ethernet216 209,210,211,212,213,214,215,216 Ethernet28/1 28 400000 rs +Ethernet224 249,250,251,252,253,254,255,256 Ethernet29/1 29 400000 rs +Ethernet232 233,234,235,236,237,238,239,240 Ethernet30/1 30 400000 rs +Ethernet240 225,226,227,228,229,230,231,232 Ethernet31/1 31 400000 rs +Ethernet248 241,242,243,244,245,246,247,248 Ethernet32/1 32 400000 rs +Ethernet256 273,274,275,276,277,278,279,280 Ethernet33/1 33 400000 rs +Ethernet264 257,258,259,260,261,262,263,264 Ethernet34/1 34 400000 rs +Ethernet272 265,266,267,268,269,270,271,272 Ethernet35/1 35 400000 rs +Ethernet280 281,282,283,284,285,286,287,288 Ethernet36/1 36 400000 rs +Ethernet288 313,314,315,316,317,318,319,320 Ethernet37/1 37 400000 rs +Ethernet296 297,298,299,300,301,302,303,304 Ethernet38/1 38 400000 rs +Ethernet304 289,290,291,292,293,294,295,296 Ethernet39/1 39 400000 rs +Ethernet312 305,306,307,308,309,310,311,312 Ethernet40/1 40 400000 rs +Ethernet320 345,346,347,348,349,350,351,352 Ethernet41/1 41 400000 rs +Ethernet328 329,330,331,332,333,334,335,336 Ethernet42/1 42 400000 rs +Ethernet336 321,322,323,324,325,326,327,328 Ethernet43/1 43 400000 rs +Ethernet344 337,338,339,340,341,342,343,344 Ethernet44/1 44 400000 rs +Ethernet352 377,378,379,380,381,382,383,384 Ethernet45/1 45 400000 rs +Ethernet360 361,362,363,364,365,366,367,368 Ethernet46/1 46 400000 rs +Ethernet368 353,354,355,356,357,358,359,360 Ethernet47/1 47 400000 rs +Ethernet376 369,370,371,372,373,374,375,376 Ethernet48/1 48 400000 rs +Ethernet384 409,410,411,412,413,414,415,416 Ethernet49/1 49 400000 rs +Ethernet392 393,394,395,396,397,398,399,400 Ethernet50/1 50 400000 rs +Ethernet400 385,386,387,388,389,390,391,392 Ethernet51/1 51 400000 rs +Ethernet408 401,402,403,404,405,406,407,408 Ethernet52/1 52 400000 rs +Ethernet416 441,442,443,444,445,446,447,448 Ethernet53/1 53 400000 rs +Ethernet424 425,426,427,428,429,430,431,432 Ethernet54/1 54 400000 rs +Ethernet432 417,418,419,420,421,422,423,424 Ethernet55/1 55 400000 rs +Ethernet440 433,434,435,436,437,438,439,440 Ethernet56/1 56 400000 rs +Ethernet448 473,474,475,476,477,478,479,480 Ethernet57/1 57 400000 rs +Ethernet456 457,458,459,460,461,462,463,464 Ethernet58/1 58 400000 rs +Ethernet464 449,450,451,452,453,454,455,456 Ethernet59/1 59 400000 rs +Ethernet472 465,466,467,468,469,470,471,472 Ethernet60/1 60 400000 rs +Ethernet480 505,506,507,508,509,510,511,512 Ethernet61/1 61 400000 rs +Ethernet488 489,490,491,492,493,494,495,496 Ethernet62/1 62 400000 rs +Ethernet496 481,482,483,484,485,486,487,488 Ethernet63/1 63 400000 rs +Ethernet504 497,498,499,500,501,502,503,504 Ethernet64/1 64 400000 rs +Ethernet512 513 Ethernet65 65 10000 none +Ethernet513 515 Ethernet66 66 10000 none diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/sai.profile b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/sai.profile new file mode 100644 index 000000000000..50c136d97b24 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th5-a7060x6-64pe.config.bcm diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/th5-a7060x6-64pe.config.bcm b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/th5-a7060x6-64pe.config.bcm new file mode 100644 index 000000000000..a8f3023f96ce --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/th5-a7060x6-64pe.config.bcm @@ -0,0 +1,1160 @@ +# +# $Copyright: (c) 2022 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# +# BCM78900 64x800g port configuration. +# +# configuration yaml file +# device: +# : +#
: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +bcm_device: + 0: + global: + pktio_mode: 1 + default_cpu_tx_queue: 7 + vlan_flooding_l2mc_num_reserved: 0 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + # LTSW uses value 1 for ALPM combined mode + l3_alpm_template: 1 + l3_alpm_hit_skip: 1 + sai_feat_tail_timestamp : 1 + sai_port_phy_time_sync_en : 1 + sai_field_group_auto_prioritize: 1 + #l3_intf_vlan_split_egress for MTU at L3IF + l3_intf_vlan_split_egress : 1 + pfc_deadlock_seq_control : 1 + sai_tunnel_support: 2 + bcm_tunnel_term_compatible_mode: 1 + l3_ecmp_member_first_lkup_mem_size: 12288 +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x26 + TX_POLARITY_FLIP: 0xaa + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x55 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 24 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 22 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 21 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 23 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 28 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 26 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 25 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 27 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 32 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 30 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0xff + ? + PC_PM_ID: 29 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 31 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 35 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 33 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0x33 + TX_POLARITY_FLIP: 0x00 + ? + PC_PM_ID: 34 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 36 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 40 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 38 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0x9a + ? + PC_PM_ID: 37 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x31204675 + TX_LANE_MAP: 0x47561203 + RX_POLARITY_FLIP: 0x11 + TX_POLARITY_FLIP: 0x2b + ? + PC_PM_ID: 39 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 44 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 42 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 41 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 43 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 48 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 46 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x2137654 + TX_LANE_MAP: 0x30217654 + RX_POLARITY_FLIP: 0xdd + TX_POLARITY_FLIP: 0xda + ? + PC_PM_ID: 45 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 47 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761302 + TX_LANE_MAP: 0x54762130 + RX_POLARITY_FLIP: 0x88 + TX_POLARITY_FLIP: 0x58 + ? + PC_PM_ID: 52 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 50 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 49 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 51 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 56 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 54 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 53 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 55 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 60 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23016745 + TX_LANE_MAP: 0x54670123 + RX_POLARITY_FLIP: 0x97 + TX_POLARITY_FLIP: 0x35 + ? + PC_PM_ID: 58 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54760213 + TX_LANE_MAP: 0x74563021 + RX_POLARITY_FLIP: 0xc6 + TX_POLARITY_FLIP: 0x65 + ? + PC_PM_ID: 57 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 59 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13027654 + TX_LANE_MAP: 0x21305674 + RX_POLARITY_FLIP: 0x6c + TX_POLARITY_FLIP: 0xb6 + ? + PC_PM_ID: 64 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x67 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 62 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32107654 + TX_LANE_MAP: 0x54761032 + RX_POLARITY_FLIP: 0x66 + TX_POLARITY_FLIP: 0x55 + ? + PC_PM_ID: 61 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 + ? + PC_PM_ID: 63 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54761032 + TX_LANE_MAP: 0x32107654 + RX_POLARITY_FLIP: 0xaa + TX_POLARITY_FLIP: 0x66 +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 11 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 12 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 33 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 34 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 55 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 56 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 66 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 67 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 77 + : + PC_PHYS_PORT_ID: 113 + ? + PORT_ID: 78 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 88 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 89 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 99 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 100 + : + PC_PHYS_PORT_ID: 153 + ? + PORT_ID: 110 + : + PC_PHYS_PORT_ID: 161 + ? + PORT_ID: 111 + : + PC_PHYS_PORT_ID: 169 + ? + PORT_ID: 121 + : + PC_PHYS_PORT_ID: 177 + ? + PORT_ID: 122 + : + PC_PHYS_PORT_ID: 185 + ? + PORT_ID: 132 + : + PC_PHYS_PORT_ID: 193 + ? + PORT_ID: 133 + : + PC_PHYS_PORT_ID: 201 + ? + PORT_ID: 143 + : + PC_PHYS_PORT_ID: 209 + ? + PORT_ID: 144 + : + PC_PHYS_PORT_ID: 217 + ? + PORT_ID: 154 + : + PC_PHYS_PORT_ID: 225 + ? + PORT_ID: 155 + : + PC_PHYS_PORT_ID: 233 + ? + PORT_ID: 165 + : + PC_PHYS_PORT_ID: 241 + ? + PORT_ID: 166 + : + PC_PHYS_PORT_ID: 249 + ? + PORT_ID: 176 + : + PC_PHYS_PORT_ID: 257 + ? + PORT_ID: 177 + : + PC_PHYS_PORT_ID: 265 + ? + PORT_ID: 187 + : + PC_PHYS_PORT_ID: 273 + ? + PORT_ID: 188 + : + PC_PHYS_PORT_ID: 281 + ? + PORT_ID: 198 + : + PC_PHYS_PORT_ID: 289 + ? + PORT_ID: 199 + : + PC_PHYS_PORT_ID: 297 + ? + PORT_ID: 209 + : + PC_PHYS_PORT_ID: 305 + ? + PORT_ID: 210 + : + PC_PHYS_PORT_ID: 313 + ? + PORT_ID: 220 + : + PC_PHYS_PORT_ID: 321 + ? + PORT_ID: 221 + : + PC_PHYS_PORT_ID: 329 + ? + PORT_ID: 231 + : + PC_PHYS_PORT_ID: 337 + ? + PORT_ID: 232 + : + PC_PHYS_PORT_ID: 345 + ? + PORT_ID: 242 + : + PC_PHYS_PORT_ID: 353 + ? + PORT_ID: 243 + : + PC_PHYS_PORT_ID: 361 + ? + PORT_ID: 253 + : + PC_PHYS_PORT_ID: 369 + ? + PORT_ID: 254 + : + PC_PHYS_PORT_ID: 377 + ? + PORT_ID: 264 + : + PC_PHYS_PORT_ID: 385 + ? + PORT_ID: 265 + : + PC_PHYS_PORT_ID: 393 + ? + PORT_ID: 275 + : + PC_PHYS_PORT_ID: 401 + ? + PORT_ID: 276 + : + PC_PHYS_PORT_ID: 409 + ? + PORT_ID: 286 + : + PC_PHYS_PORT_ID: 417 + ? + PORT_ID: 287 + : + PC_PHYS_PORT_ID: 425 + ? + PORT_ID: 297 + : + PC_PHYS_PORT_ID: 433 + ? + PORT_ID: 298 + : + PC_PHYS_PORT_ID: 441 + ? + PORT_ID: 308 + : + PC_PHYS_PORT_ID: 449 + ? + PORT_ID: 309 + : + PC_PHYS_PORT_ID: 457 + ? + PORT_ID: 319 + : + PC_PHYS_PORT_ID: 465 + ? + PORT_ID: 320 + : + PC_PHYS_PORT_ID: 473 + ? + PORT_ID: 330 + : + PC_PHYS_PORT_ID: 481 + ? + PORT_ID: 331 + : + PC_PHYS_PORT_ID: 489 + ? + PORT_ID: 341 + : + PC_PHYS_PORT_ID: 497 + ? + PORT_ID: 342 + : + PC_PHYS_PORT_ID: 505 + ? + PORT_ID: 76 + : + PC_PHYS_PORT_ID: 513 + ? + PORT_ID: 274 + : + PC_PHYS_PORT_ID: 515 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: [[1, 2], + [11, 12], + [22, 23], + [33, 34], + [44, 45], + [55, 56], + [66, 67], + [77, 78], + [88, 89], + [99, 100], + [110, 111], + [121, 122], + [132, 133], + [143, 144], + [154, 155], + [165, 166], + [176, 177], + [187, 188], + [198, 199], + [209, 210], + [220, 221], + [231, 232], + [242, 243], + [253, 254], + [264, 265], + [275, 276], + [286, 287], + [297, 298], + [308, 309], + [319, 320], + [330, 331], + [341, 342]] + : + ENABLE: 1 + SPEED: 400000 + NUM_LANES: 8 + FEC_MODE: PC_FEC_RS544_2XN + MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [[76, 76], [274, 274]] + : + ENABLE: 0 + MAX_FRAME_SIZE: 9416 + SPEED: 10000 + NUM_LANES: 1 +... +--- +bcm_device: + 0: + global: + ftem_mem_entries: 65536 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 + + # IFP mode + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +device: + 0: + DEVICE_CONFIG: + AUTOLOAD_BOARD_SETTINGS: 0 +... From 7d42d490e7d9c75de1572b5137377c86a5871a76 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 26 May 2024 16:01:20 +0800 Subject: [PATCH 174/282] [submodule] Update submodule linkmgrd to the latest HEAD automatically (#19079) #### Why I did it src/linkmgrd ``` * f96d40c - (HEAD -> master, origin/master, origin/HEAD) [active-standby] add knob to enable/disable oscillation (#250) (17 hours ago) [Jing Zhang] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index dd618447e2cc..f96d40cfbe4a 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit dd618447e2cc1838431d94f1f8bffa807ef65d89 +Subproject commit f96d40cfbe4a771c60579935998ae2c52816c4ea From e1eb9e9854708e6c126e553cdd8f6d0e4f71d399 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 26 May 2024 16:01:34 +0800 Subject: [PATCH 175/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19064) #### Why I did it src/sonic-swss ``` * 3ee73618 - (HEAD -> master, origin/master, origin/HEAD) [orchagent] Add support for Path Tracing Midpoint (#2903) (34 hours ago) [Carmine Scarpitta] * 5ffb0b50 - [Bridge] Disable MAC learning for Link Local Mulitcast Frames on the kernel bridge (#3162) (2 days ago) [Gord Chen] * de9baac1 - [Marvell] PFC Detect lua script (#3160) (2 days ago) [Rajkumar-Marvell] * 31d9d6c1 - Add fabric counter rate mbps command handling. (#3129) (2 days ago) [jfeng-arista] * 425a8526 - Parse subport value added to config_db (#3161) (2 days ago) [Bobby McGonigle] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index a280e367564c..3ee73618d410 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit a280e367564cce6d8138fe39a0ce031b516c5699 +Subproject commit 3ee73618d41052ff24234a34e75551f12b5ba940 From 8c35340964cd33111aaf70ef6551806ef4ed0104 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 26 May 2024 19:00:53 +0800 Subject: [PATCH 176/282] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#19074) #### Why I did it src/sonic-sairedis ``` * c3ad5ce - (HEAD -> master, origin/master, origin/HEAD) [saiproxy] Add SAI proxy library (#1363) (10 hours ago) [Kamil Cudnik] * d4a085f - Skip ASIC_TEMPERATURE attributes from sairedis recording (#1375) (19 hours ago) [saksarav-nokia] * 456780e - [nvidia] update config_syncd_nvidia_bluefield() (#1380) (22 hours ago) [Yakiv Huryk] * 79b27c0 - Add check for global SAI api used (#1379) (30 hours ago) [Kamil Cudnik] * 0adbe25 - (origin/202405) [submodule] Update SAI submodule to v1.14 (#1381) (2 days ago) [Kamil Cudnik] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index a83b083a6e1c..c3ad5ce62e48 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit a83b083a6e1cb71127bf09c0778673b2934d4891 +Subproject commit c3ad5ce62e48fd6afcc19672c57258388fd6fedb From c9135945de2e8b56fce6beed471e39f7f576cf5a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 26 May 2024 19:00:58 +0800 Subject: [PATCH 177/282] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#19073) #### Why I did it src/sonic-linux-kernel ``` * 9770e13 - (HEAD -> master, origin/master, origin/HEAD) Add patch of SONiC Linux kernel DTS file to support Supermicro SSE-G3748 board. (#394) (27 hours ago) [Erich Yen] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index f182d03e9155..9770e1382add 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit f182d03e9155a429d62a0dbf08ad8f5a33f2bc83 +Subproject commit 9770e1382add4f667d1e809a7d03de76e69a6c60 From d3fbec017efe9f33b588802563cd535abacb8766 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 27 May 2024 19:00:39 +0800 Subject: [PATCH 178/282] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#19086) #### Why I did it src/sonic-sairedis ``` * 20bcfe1 - (HEAD -> master, origin/master, origin/HEAD) [SaiInterface] Support sai_query_api_version api (#1383) (10 hours ago) [Kamil Cudnik] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index c3ad5ce62e48..20bcfe1965a8 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit c3ad5ce62e48fd6afcc19672c57258388fd6fedb +Subproject commit 20bcfe1965a8f9f64e25355783994165b780839a From 3debe78879bf4e00e88a03155e281764babfc8a0 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Mon, 27 May 2024 20:39:27 +0800 Subject: [PATCH 179/282] [build] Fix docker-telemetry dependency issue. (#19089) Why I did it PR#19011 forget to migrate docker-sonic-telemetry-dbg to bookworm. It breaks docker-sonic-telemetry's debug image build. Work item tracking Microsoft ADO (number only): 28202870 How I did it How to verify it --- rules/docker-telemetry.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/docker-telemetry.mk b/rules/docker-telemetry.mk index 4ccd2781b014..f710eedd572a 100644 --- a/rules/docker-telemetry.mk +++ b/rules/docker-telemetry.mk @@ -22,7 +22,7 @@ SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_TELEMETRY) endif SONIC_DOCKER_DBG_IMAGES += $(DOCKER_TELEMETRY_DBG) -SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_TELEMETRY_DBG) +SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_TELEMETRY_DBG) ifeq ($(INCLUDE_SYSTEM_TELEMETRY), y) SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_TELEMETRY_DBG) endif From d1875c66ea0d15b218c011f572ed8884a389176d Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Tue, 28 May 2024 14:51:26 +0800 Subject: [PATCH 180/282] [bgp] Add dependency in bgpcfgd (#19088) Why I did it These 2 dependencies were removed by #18764 and #18727 for decoupling hard dependency between Loopback IPv4 address and BGP. Actually, these dependencies are to make sure existence of Loopback interface, no need to remove. Work item tracking Microsoft ADO (number only): 28210625 How I did it Add dependency back How to verify it UT passed. --- src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py index 26202ebc5016..de85a2f84a92 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py @@ -106,6 +106,7 @@ def __init__(self, common_objs, db_name, table_name, peer_type, check_neig_meta) deps = [ ("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"), + ("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0"), ("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"), ("LOCAL", "local_addresses", ""), ("LOCAL", "interfaces", ""), @@ -128,6 +129,9 @@ def __init__(self, common_objs, db_name, table_name, peer_type, check_neig_meta) if self.check_deployment_id: deps.append(("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/deployment_id")) + if self.peer_type == 'internal': + deps.append(("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback4096")) + super(BGPPeerMgrBase, self).__init__( common_objs, deps, From 10e0df97d84a8cd11c88befab1e726a34be8950b Mon Sep 17 00:00:00 2001 From: Tomer Shalvi <116184476+tshalvi@users.noreply.github.com> Date: Tue, 28 May 2024 14:01:01 +0300 Subject: [PATCH 181/282] [Mellanox] Verify the value of the control type sysfs before changing it to FW control (#19046) - Why I did it On Mellanox platforms, changing the control type sysfs value is not supported for ports that are set to firmware control. Therefore, attempting to change this value to firmware control will result in an error log, which we want to avoid. - How I did it I added a check to ensure that the control sysfs value is set to firmware control only if it is not already in firmware control. - How to verify it Ensure that after a warm reboot on the Mellanox platform (an attempt to change the sysfs value from fw_control to fw_control is only applicable in this scenario), the following error does not appear: sxd_kernel: [error] sx_core_set_module_control: Failed control change: module is dependent (FW control). --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index e7874a658968..7b21f22ca110 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -1492,8 +1492,9 @@ def action_on_sw_control(cls, sfp): @classmethod def action_on_fw_control(cls, sfp): - logger.log_info(f'SFP {sfp.sdk_index} is set to firmware control') - sfp.set_control_type(SFP_FW_CONTROL) + if sfp.get_control_type() != SFP_FW_CONTROL: + logger.log_info(f'SFP {sfp.sdk_index} is set to firmware control') + sfp.set_control_type(SFP_FW_CONTROL) @classmethod def action_on_cancel_wait(cls, sfp): From 319c02472278c009856d79c08d784126c74b3003 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 28 May 2024 22:01:00 +0800 Subject: [PATCH 182/282] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#19096) #### Why I did it src/sonic-swss-common ``` * 3750752 - (HEAD -> master, origin/master, origin/HEAD) [ci] Use requests==2.31.0 instead of latest version to avoid test failure. (#877) (14 hours ago) [Liu Shilong] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 00445404fff6..3750752dfaf6 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 00445404fff6d3673464e2a5defca1dc97ab3a43 +Subproject commit 3750752dfaf68d3d2cecf49ad77cdadde3c9a955 From d0548cfe7b36c8bd95e5cc473e46fc9b92dda27b Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Wed, 29 May 2024 05:59:24 +0800 Subject: [PATCH 183/282] Update orchagent.sh (#19062) Fix Orchagent crash during boot because of eth0 not config address. #### Why I did it Fix https://github.com/sonic-net/sonic-buildimage/issues/19044 On SmartSwitch DPU the eth0 might not config any address ##### Work item tracking - Microsoft ADO: 28188952 #### How I did it Fix Orchagent crash during boot because of eth0 not config address. #### How to verify it Pass all UT. Manually verified the orchagent not crash when eth not config address: root 20026 8.3 1.2 748344 49512 pts/0 Sl 06:25 0:03 /usr/bin/orchagent -d /var/log/swss -b 1024 -s -m 22:48:23:27:33:d8 -q tcp://127.0.0.1:8100 #### Description for the changelog Fix Orchagent crash during boot because of eth0 not config address. --- dockers/docker-orchagent/orchagent.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-orchagent/orchagent.sh b/dockers/docker-orchagent/orchagent.sh index 1b2a1b88ab72..df29c6a258b5 100755 --- a/dockers/docker-orchagent/orchagent.sh +++ b/dockers/docker-orchagent/orchagent.sh @@ -82,7 +82,7 @@ if [[ x"${LOCALHOST_SUBTYPE}" == x"SmartSwitch" ]]; then if [[ $midplane_ip != "" ]]; then # Enable ZMQ with eth0-midplane address ORCHAGENT_ARGS+=" -q tcp://${midplane_mgmt_ip}:8100" - elif [[ $mgmt_ip != "" ]]; then + elif [[ $mgmt_ip != "" ]] && [[ $mgmt_ip != "null" ]]; then # If eth0-midplane interface does not exist, enable ZMQ with eth0 address ORCHAGENT_ARGS+=" -q tcp://${mgmt_ip}:8100" else From f7793790b731b03235d9ecc12049de1fb5b50641 Mon Sep 17 00:00:00 2001 From: Arvindsrinivasan Lakshmi Narasimhan <55814491+arlakshm@users.noreply.github.com> Date: Tue, 28 May 2024 22:28:08 -0700 Subject: [PATCH 184/282] [chassis] Minigraph parser changes (#19018) Update the minigraph parser to support chassis production minigraph Microsoft ADO 28223907: How I did it Make changes the following changes in the parser to parse production minigraph for sonic T2 chassis and generate the configuration required for SONiC T2 - Support parsing of the system-ports for voq chassis from the production minigraph - Generate the chassis level port alias for all the ports in the chassis from the minigraph - Generate the chassis hostname in the device metadata for all the linecards from the minigraph - Generate the voqinband interface for voq chassis. - Update the actual port speed for linecards based on the minigraph. - Add UT for voq and packet chassis minigraphs. --- src/sonic-config-engine/minigraph.py | 658 +- .../packet-chassis-port-config-1.ini | 49 + .../packet_chassis_sup.xml | 53496 ++++++++++++++++ .../voq_chassis_data/system_ports.json | 3170 + .../voq-sample-port-config-1.ini | 51 + .../voq-sample-port-config-2.ini | 21 + .../voq_chassis_lc_multi_asic.xml | 48338 ++++++++++++++ .../voq_chassis_lc_single_asic.xml | 46215 +++++++++++++ .../voq_chassis_data/voq_chassis_sup.xml | 52726 +++++++++++++++ .../tests/test_chassis_cfggen.py | 1159 + .../tests/test_multinpu_cfggen.py | 20 +- 11 files changed, 205843 insertions(+), 60 deletions(-) create mode 100644 src/sonic-config-engine/tests/chassis_data/packet_chassis_data/packet-chassis-port-config-1.ini create mode 100644 src/sonic-config-engine/tests/chassis_data/packet_chassis_data/packet_chassis_sup.xml create mode 100644 src/sonic-config-engine/tests/chassis_data/voq_chassis_data/system_ports.json create mode 100644 src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq-sample-port-config-1.ini create mode 100644 src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq-sample-port-config-2.ini create mode 100644 src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_multi_asic.xml create mode 100644 src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_single_asic.xml create mode 100644 src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_sup.xml create mode 100644 src/sonic-config-engine/tests/test_chassis_cfggen.py diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 5bfbeb650379..390410067feb 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -9,6 +9,7 @@ import subprocess from collections import defaultdict + from lxml import etree as ET from lxml.etree import QName @@ -16,7 +17,7 @@ from portconfig import get_port_config, get_fabric_port_config, get_fabric_monitor_config from sonic_py_common.interface import backplane_prefix -from sonic_py_common.multi_asic import is_multi_asic +from sonic_py_common.multi_asic import is_multi_asic, get_asic_id_from_name # TODO: Remove this once we no longer support Python 2 if sys.version_info.major == 3: @@ -24,6 +25,14 @@ else: UNICODE_TYPE = unicode +try: + if os.environ["CFGGEN_UNIT_TESTING_TOPOLOGY"] == "multi_asic": + import mock + is_multi_asic = mock.MagicMock(return_value=True) +except KeyError: + pass + + """minigraph.py version_added: "1.9" author: Guohan Lu (gulv@microsoft.com) @@ -53,7 +62,7 @@ FRONTEND_ASIC_SUB_ROLE = 'FrontEnd' BACKEND_ASIC_SUB_ROLE = 'BackEnd' - +FABRIC_ASIC_SUB_ROLE = 'Fabric' dualtor_cable_types = ["active-active", "active-standby"] # Default Virtual Network Index (VNI) @@ -72,6 +81,102 @@ "MATCHES": ["SRC_IPV6", "DST_IPV6", "ETHER_TYPE", "IP_TYPE", "IP_PROTOCOL", "IN_PORTS", "L4_SRC_PORT", "L4_DST_PORT", "L4_SRC_PORT_RANGE", "L4_DST_PORT_RANGE", "ICMPV6_TYPE", "ICMPV6_CODE", "TCP_FLAGS"] } } +# Chassis card type +CHASSIS_CARD_VOQ = 'VoQ' +CHASSIS_CARD_PACKET = 'chassis-packet' +CHASSIS_CARD_FABRIC = 'Fabric' +voq_internal_intfs = ['cpu', 'recirc', 'inband'] + +def get_asic_switch_id(slot_index, asic_name): + asic_id = 0 + if slot_index is None: + return None + if asic_name is not None: + asic_id = int(asic_name[len('ASIC'):]) + switch_id = 2*(2*(int(slot_index)-1) + asic_id) + return switch_id + +def get_asic_hostname_from_asic_name(chassis_type, asic_name, hostname): + if is_multi_asic() == True and asic_name is None: + return asic_name + + if is_minigraph_for_chassis(chassis_type): + # for chassis in the minigraph the asic hostname is - + if is_multi_asic(): + asic_id = get_asic_id_from_name(asic_name) + else: + asic_id = '0' + asic_hostname = "{}-ASIC{:02d}".format(hostname, int(asic_id )) + else: + # for multi_asic pizza boxes the asic_hostname is same as asic_name + asic_hostname = asic_name + + return asic_hostname + +def get_linecard_slot_index(hostname, chassis_linecard_info): + for lc_slot, lc_name in chassis_linecard_info.items(): + if hostname.lower() == lc_name['hostname'].lower(): + return lc_slot + return None + +def get_voq_intf_attributes(ports): + voq_intf_attributes = {} + for port in ports: + role = ports.get(port, {}).get('role', None) + if role.lower() == 'inb' or role.lower() == 'rec': + core_id = None + core_port_index = None + speed = None + for k,v in ports.get(port, {}).items(): + if k.lower() == 'coreid': + core_id = v + if k.lower() == 'coreportid': + core_port_index = v + if k.lower() == 'speed': + speed = v + voq_intf_attributes.setdefault(role.lower(), {}).update({'core_id': core_id, 'core_port_index': core_port_index, 'speed' : speed}) + + return voq_intf_attributes + +def get_chassis_type_and_hostname(root, hname): + chassis_type = None + chassis_hostname = None + for child in root: + if child.tag == str(QName(ns, "MetadataDeclaration")): + devices = child.find(str(QName(ns, "Devices"))) + for device_meta in devices.findall(str(QName(ns1, "DeviceMetadata"))): + device_name = device_meta.find(str(QName(ns1, "Name"))).text + if device_name != hname: + continue + properties = device_meta.find(str(QName(ns1, "Properties"))) + for device_property in properties.findall(str(QName(ns1, "DeviceProperty"))): + name = device_property.find(str(QName(ns1, "Name"))).text + value = device_property.find(str(QName(ns1, "Value"))).text + if name == "ForwardingMethod": + chassis_type = value + if name == "ParentRouter": + chassis_hostname = value + return chassis_type, chassis_hostname + +def is_minigraph_for_chassis(chassis_type): + if chassis_type in [CHASSIS_CARD_VOQ, CHASSIS_CARD_PACKET]: + return True + return False + + +def normailize_port_map_for_chassis(asic_name, port_map): + if asic_name is None: + return port_map + + new_port_map = {} + for k,v in port_map.items(): + if asic_name.lower() in v.lower(): + v = v.split('-')[0] + if asic_name.lower() in k.lower(): + k = k.split('-')[0] + new_port_map.update({k:v}) + + return new_port_map ############################################################################### # @@ -79,6 +184,249 @@ # ############################################################################### +def parse_chassis_metadata(root,hname, lcname): + """ + Parses the chassis metadata from the XML root. + + This function iterates over the XML root to find the metadata declaration. It then extracts the device metadata, + specifically the name, properties, and slot index. If the device name matches the provided hostname or linecard name, + it extracts the total count of VoQ and the max count of cores. The function also updates a dictionary with slot indices + and corresponding hostnames. + + Args: + root: The root of the minigraph.xml. + hname (str): chassis hostname. + lcname (str): The linecard name or supervisor hostname. + + Returns: + max_num_core (int): The maximum number of cores, only appliable for voq chassis + num_voq (int): The total count of VoQ per port, only appliable for voq chassis + chassis_linecards (dict): A dictionary of slot indices and corresponding LC hostnames. + """ + chassis_linecards = {} + max_num_core = None + num_voq = None + for child in root: + if child.tag == str(QName(ns, "MetadataDeclaration")): + devices = child.find(str(QName(ns, "Devices"))) + for device_meta in devices.findall(str(QName(ns1, "DeviceMetadata"))): + slot_index = None + device_name = device_meta.find(str(QName(ns1, "Name"))).text + + properties = device_meta.find(str(QName(ns1, "Properties"))) + for device_property in properties.findall(str(QName(ns1, "DeviceProperty"))): + name = device_property.find(str(QName(ns1, "Name"))).text + value = device_property.find(str(QName(ns1, "Value"))).text + if device_name == hname or device_name == lcname: + if name == "TotalCountOfVoQ": + num_voq = value + if name == "MaxCountOfCores": + max_num_core = 64 + if name == "SlotIndex": + slot_index = value + if slot_index is not None: + chassis_linecards.update({slot_index:{'hostname':device_name}}) + + return max_num_core, num_voq, chassis_linecards + + +def parse_chassis_deviceinfo_intf_metadata(device_info, chassis_linecards_info, chassis_hwsku, num_voq, chassis_type, chassis_intf_map, voq_intf_attributes): + """ + This function iterates InterfaceMetadata for every port in the chassis and genetate the configuration for + systemport, chassis port alias and port default speeds.d. + + Args: + device_info: The XML element containing device info. + chassis_linecards_info (dict): A dictionary mapping slot indices to hostnames. + chassis_hwsku (str): The hardware SKU of the chassis. + num_voq (str): The number of VoQ. + chassis_type (str): The type of the chassis. + chassis_intf_map (dict): A dictionary mapping interface names to their properties. + voq_intf_attributes (dict): A dictionary mapping VoQ interface names to their properties. + + Returns: + system_ports (dict): A dictionary of system ports, only for voq chassis + chassis_port_alias (dict): A dictionary of chassis port aliases. + port_default_speed (dict): A dictionary of port default speeds. + """ + system_ports = {} + chassis_port_alias = {} + port_default_speed = {} + system_port_id = 1 + + interface_metadata = device_info.find(str(QName(ns, "InterfaceMetadata"))) + for interface in interface_metadata.findall(str(QName(ns1, "DeviceInterfaceMetadata"))): + linecard_name = None + asic_name = None + core_port_id = None + core_id = None + switch_id = None + slot_index = None + intf_name = interface.find(str(QName(ns1, "InterfaceName"))).text + # ignore the managment interfaces + if any(mgmt_intf in intf_name for mgmt_intf in ['Management', 'console']) == True: + continue + + if intf_name not in chassis_intf_map: + print('Warning cannot find metadata for interface {}'.format( + intf_name), file=sys.stderr) + continue + + intf_sonic_name = chassis_intf_map[intf_name].get('sonic_name', None) + if intf_sonic_name is None: + print('Warning cannot find sonic name for interface {}'.format( + intf_name), file=sys.stderr) + continue + + intf_speed = chassis_intf_map[intf_name].get('speed', None) + if intf_speed is None: + print('Warning cannot find speed for interface' % + (intf_name), file=sys.stderr) + continue + + intf_properties = interface.find(str(QName(ns1, "Properties"))) + if intf_properties is None: + print('Warning cannot find interface porperties for interface' % + (intf_name), file=sys.stderr) + continue + + for intf_property in intf_properties.findall(str(QName(ns1, "InterfaceProperty"))): + + name = intf_property.find(str(QName(ns1, "Name"))).text + value = intf_property.find(str(QName(ns1, "Value"))).text + if name == "CoreId": + core_id = value + if name == "SlotIndex": + slot_index = value + if name == "ProviderChipName": + asic_name = value + if name == "LineCardSku": + lc_sku = value + if name == "AsicInterfaceIndex": + core_port_id = value + if name == "AsicSwitchId": + switch_id = value + + if intf_sonic_name.startswith('cpu'): + core_id = 0 + core_port_id = 0 + speed = 10000 + asic_id = intf_name.split('/')[1] + asic_name = 'ASIC{}'.format(asic_id) + if intf_sonic_name.startswith('Ethernet-IB'): + core_id = voq_intf_attributes.get('inb', {}).get('core_id', None) + core_port_id = voq_intf_attributes.get( + 'inb', {}).get('core_port_index', None) + intf_speed = voq_intf_attributes.get('inb', {}).get('speed', None) + asic_id = intf_name.split('/')[1] + asic_name = 'ASIC{}'.format(asic_id) + if intf_sonic_name.startswith('Ethernet-Rec'): + # continue + core_id = voq_intf_attributes.get('rec', {}).get('core_id', None) + core_port_id = voq_intf_attributes.get( + 'rec', {}).get('core_port_index', None) + intf_speed = voq_intf_attributes.get('rec', {}).get('speed', None) + asic_id = intf_name.split('/')[1] + asic_name = 'ASIC{}'.format(asic_id) + + switch_id = get_asic_switch_id(slot_index, asic_name) + linecard_name = chassis_linecards_info.get( + slot_index, {}).get('hostname', None) + if linecard_name is None: + continue + + if chassis_type == CHASSIS_CARD_VOQ: + key = intf_sonic_name + if asic_name is not None: + key = "%s|%s" % (asic_name, key) + if linecard_name is not None: + key = "%s|%s" % (linecard_name, key) + system_ports[key] = { + "system_port_id": system_port_id, + "switch_id": switch_id, + "core_index": core_id, + "core_port_index": core_port_id, + "speed": intf_speed, + "num_voq": num_voq + } + system_port_id += 1 + + chassis_port_alias.setdefault(slot_index, {}).update( + {(intf_sonic_name, intf_speed): intf_name}) + # For Some Vendor we can have multiple speed define for same port with different alias. + # Example Port serving 400G alias will be FoutHundredGig0/0/0/0 and same port as 100G will be HundredGig0/0/0/0 + # So to get port default speed get the max speed possible. + try: + if int(intf_speed) > int(port_default_speed[slot_index][intf_sonic_name]): + port_default_speed[slot_index][intf_sonic_name] = intf_speed + except: + port_default_speed.setdefault(slot_index, {}).update( + {intf_sonic_name: intf_speed}) + + return system_ports, chassis_port_alias, port_default_speed + + + +def parse_chassis_deviceinfo_voq_int_intfs(device_info): + backend_intf_map = {} + backend_interfaces = device_info.find(str(QName(ns, "BackendFabricInterfaces"))).findall( + str(QName(ns1, "BackendFabricInterface"))) + voq_internal_intf_attr = {} + for backend_interface in backend_interfaces: + intf_name = backend_interface.find(str(QName(ns, "InterfaceName"))).text + if any(voq_intf in intf_name.lower() for voq_intf in voq_internal_intfs) == True: + sonic_name = backend_interface.find(str(QName(ns, "SonicName"))).text + speed = backend_interface.find(str(QName(ns, "Speed"))).text + backend_intf_map[intf_name] = {'sonic_name': sonic_name, 'speed': speed} + return backend_intf_map + + +def parse_chassis_deviceinfo_intfs(device_info): + interface_map = {} + + interfaces = device_info.find(str(QName(ns, "EthernetInterfaces"))).findall( + str(QName(ns1, "EthernetInterface"))) + + for interface in interfaces: + # the interface name is at the chassis level, so the interface name will have + # the slot information. It will be of format + # Ethernet/port + intf_name = interface.find(str(QName(ns, "InterfaceName"))).text + sonic_name = interface.find(str(QName(ns, "SonicName"))).text + speed = interface.find(str(QName(ns, "Speed"))).text + interface_map[intf_name] = {'sonic_name': sonic_name, 'speed': speed} + return interface_map + + +def parse_chassis_deviceinfo(deviceinfos, chassis_linecards_info, chassis_hwsku, num_voq, chassis_type, voq_intf_attributes): + system_ports = {} + chassis_port_alias = {} + chassis_name = None + port_default_speed = {} + + for device_info in deviceinfos.findall(str(QName(ns, "DeviceInfo"))): + dev_sku = device_info.find(str(QName(ns, "HwSku"))).text + if dev_sku == chassis_hwsku: + # The chassis device_info for sonic chassiss will 3 sections + # level information + # 1. EthernetInterfaces, which contains all the front panel ports present in the chassis + # 2. BackendFabricInterfaces, which contains all the internal/fabric ports present in the chassis + # this includes, cpu, Inband and recirc ports for all linecards + # 3. InterfaceMetadata which contains Metadata for the ports. + # In case of Voq chassis, the system port properties are presnent in this section + + chassis_intf_map = parse_chassis_deviceinfo_intfs(device_info) + + if chassis_type == CHASSIS_CARD_VOQ: + chassis_internal_intf_map = parse_chassis_deviceinfo_voq_int_intfs( + device_info) + chassis_intf_map.update(chassis_internal_intf_map) + + system_ports, chassis_port_alias, port_default_speed = parse_chassis_deviceinfo_intf_metadata( + device_info, chassis_linecards_info, chassis_hwsku, num_voq, chassis_type, chassis_intf_map, voq_intf_attributes) + return system_ports, chassis_port_alias, port_default_speed + + class minigraph_encoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, ( @@ -513,9 +861,26 @@ def parse_dpg(dpg, hname): intfs = {} ip_intfs_map = {} for ipintf in ipintfs.findall(str(QName(ns, "IPInterface"))): + ipprefix = ipintf.find(str(QName(ns, "Prefix"))).text + ipintf_name = ipintf.find(str(QName(ns, "Name"))).text intfalias = ipintf.find(str(QName(ns, "AttachTo"))).text + """ + VoqInband interfaces are special ip interfaces needed on inter linecard + control plane communications on Voq Chassis + """ + if ipintf_name in ["v6VoqInband", "VoqInband"]: + if intfalias.startswith("Ethernet"): + voq_intf_type = "Port" + # Vlan interface is not used, adding to be future proof + elif intfalias.startswith("Vlan"): + voq_intf_type = "Vlan" + if intfalias not in voq_inband_intfs: + voq_inband_intfs[intfalias] = {'inband_type': voq_intf_type} + + voq_inband_intfs["%s|%s" % (intfalias, ipprefix)] = {} + + continue intfname = port_alias_map.get(intfalias, intfalias) - ipprefix = ipintf.find(str(QName(ns, "Prefix"))).text intfs[(intfname, ipprefix)] = {} ip_intfs_map[ipprefix] = intfalias lo_intfs = parse_loopback_intf(child) @@ -547,7 +912,6 @@ def parse_dpg(dpg, hname): mgmt_intf[(intfname, ipprefix)] = {'gwaddr': gwaddr} voqinbandintfs = child.find(str(QName(ns, "VoqInbandInterfaces"))) - voq_inband_intfs = {} if voqinbandintfs: for voqintf in voqinbandintfs.findall(str(QName(ns1, "VoqInbandInterface"))): intfname = voqintf.find(str(QName(ns, "Name"))).text @@ -927,11 +1291,31 @@ def parse_cpg(cpg, hname, local_devices=[]): nhopself = 1 if session.find(str(QName(ns, "NextHopSelf"))) is not None else 0 # choose the right table and admin_status for the peer - chassis_internal_ibgp = session.find(str(QName(ns, "ChassisInternal"))) - if chassis_internal_ibgp is not None and chassis_internal_ibgp.text == "voq": + chassis_internal_ibgp = None + if session.find(str(QName(ns, "ChassisInternal")))is not None: + + chassis_internal_ibgp = session.find(str(QName(ns, "ChassisInternal"))).text + else: + if session.find(str(QName(ns, "BgpGroup"))) is not None: + chassis_internal_ibgp_group = session.find(str(QName(ns, "BgpGroup"))) + start_group_peer = None + end_group_peer = None + + if chassis_internal_ibgp_group.find(str(QName(ns, "Start"))) is not None: + start_group_peer = chassis_internal_ibgp_group.find(str(QName(ns, "Start"))).text + if chassis_internal_ibgp_group.find(str(QName(ns, "End"))) is not None: + end_group_peer = chassis_internal_ibgp_group.find(str(QName(ns, "End"))).text + + if start_group_peer == CHASSIS_CARD_VOQ and end_group_peer == CHASSIS_CARD_VOQ: + chassis_internal_ibgp = "voq" + elif start_group_peer == CHASSIS_CARD_PACKET and end_group_peer == CHASSIS_CARD_PACKET: + chassis_internal_ibgp = "chassis-packet" + + + if chassis_internal_ibgp == "voq": table = bgp_voq_chassis_sessions admin_status = 'up' - elif chassis_internal_ibgp is not None and chassis_internal_ibgp.text == "chassis-packet": + elif chassis_internal_ibgp == "chassis-packet": table = bgp_internal_sessions admin_status = 'up' elif end_router.lower() in local_devices and start_router.lower() in local_devices: @@ -1015,6 +1399,46 @@ def filter_bad_asn(table): return bgp_sessions, bgp_internal_sessions, bgp_voq_chassis_sessions, myasn, bgp_peers_with_range, bgp_monitors, bgp_sentinel_sessions +def parse_chassis_meta(meta, hname): + syslog_servers = [] + ntp_servers = [] + tacacs_servers = [] + mgmt_routes = [] + erspan_dst = [] + deployment_id = None + region = None + macsec_profile = {} + qos_profile = None + + device_metas = meta.find(str(QName(ns, "Devices"))) + for device in device_metas.findall(str(QName(ns1, "DeviceMetadata"))): + if device.find(str(QName(ns1, "Name"))).text.lower() == hname.lower(): + properties = device.find(str(QName(ns1, "Properties"))) + for device_property in properties.findall(str(QName(ns1, "DeviceProperty"))): + name = device_property.find(str(QName(ns1, "Name"))).text + value = device_property.find(str(QName(ns1, "Value"))).text + value_group = value.strip().split(';') if value and value != "" else [] + if name == "NtpResources": + ntp_servers = value_group + elif name == "SyslogResources": + syslog_servers = value_group + elif name == "TacacsServer": + tacacs_servers = value_group + mgmt_routes.extend(value_group) + elif name == "ForcedMgmtRoutes": + mgmt_routes.extend(value_group) + elif name == "ErspanDestinationIpv4": + erspan_dst = value_group + elif name == "DeploymentId": + deployment_id = value + elif name == "Region": + region = value + elif name == 'MacSecProfile': + macsec_profile = parse_macsec_profile(value) + elif name == "SonicQosProfile": + qos_profile = value + + return syslog_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, macsec_profile def parse_meta(meta, hname): syslog_servers = [] @@ -1170,6 +1594,25 @@ def parse_macsec_profile(val_string): return macsec_profile +def parse_global_info(root): + + hwsku = hostname = None + docker_routing_config_mode = "separated" + + hwsku_qn = QName(ns, "HwSku") + hostname_qn = QName(ns, "Hostname") + docker_routing_config_mode_qn = QName(ns, "DockerRoutingConfigMode") + for child in root: + if child.tag == str(hwsku_qn): + hwsku = child.text + if child.tag == str(hostname_qn): + hostname = child.text + if child.tag == str(docker_routing_config_mode_qn): + docker_routing_config_mode = child.text + + chassis_type, chassis_hostname = get_chassis_type_and_hostname(root, hostname) + return hwsku, hostname, docker_routing_config_mode, chassis_type, chassis_hostname + def parse_asic_meta(meta, hname): sub_role = None switch_id = None @@ -1186,7 +1629,7 @@ def parse_asic_meta(meta, hname): value = device_property.find(str(QName(ns1, "Value"))).text if name == "SubRole": sub_role = value - elif name == "SwitchId": + elif name == "SwitchId" or name == "AsicSwitchId": switch_id = value elif name == "SwitchType": switch_type = value @@ -1566,6 +2009,12 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw redundancy_type = None qos_profile = None rack_mgmt_map = None + chassis_linecards_info = {} + chassis_hwsku = None + chassis_port_alias = {} + slot_index = None + max_num_cores = None + card_type = None hwsku_qn = QName(ns, "HwSku") hostname_qn = QName(ns, "Hostname") @@ -1578,17 +2027,29 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if child.tag == str(docker_routing_config_mode_qn): docker_routing_config_mode = child.text + hwsku, hostname, docker_routing_config_mode, chassis_type, chassis_hostname = parse_global_info(root) + (ports, alias_map, alias_asic_map) = get_port_config(hwsku=hwsku, platform=platform, port_config_file=port_config_file, asic_name=asic_name, hwsku_config_file=hwsku_config_file) + asic_hostname = get_asic_hostname_from_asic_name(chassis_type, asic_name, hostname) + + if is_minigraph_for_chassis(chassis_type): + alias_map = normailize_port_map_for_chassis(asic_name, alias_map) + alias_asic_map = normailize_port_map_for_chassis(asic_name, alias_asic_map) + (max_num_cores, num_voq, chassis_linecards_info) = parse_chassis_metadata(root, chassis_hostname, hostname) + chassis_hwsku = parse_chassis_hwsku(root, chassis_hostname) + voq_intf_attributes = get_voq_intf_attributes(ports) + port_names_map.update(ports) port_alias_map.update(alias_map) port_alias_asic_map.update(alias_asic_map) + slot_index = get_linecard_slot_index(hostname, chassis_linecards_info) # Get the local device node from DeviceMetadata local_devices = parse_asic_meta_get_devices(root) for child in root: - if asic_name is None: + if asic_hostname is None: if child.tag == str(QName(ns, "DpgDec")): (intfs, lo_intfs, mvrf, mgmt_intf, voq_inband_intfs, vlans, vlan_members, dhcp_relay_table, pcs, pc_members, acls, acl_table_types, vni, tunnel_intfs, dpg_ecmp_content, static_routes, tunnel_intfs_qos_remap_config) = parse_dpg(child, hostname) elif child.tag == str(QName(ns, "CpgDec")): @@ -1605,31 +2066,50 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw (port_speeds_default, port_descriptions, sys_ports) = parse_deviceinfo(child, hwsku) else: if child.tag == str(QName(ns, "DpgDec")): - (intfs, lo_intfs, mvrf, mgmt_intf, voq_inband_intfs, vlans, vlan_members, dhcp_relay_table, pcs, pc_members, acls, acl_table_types, vni, tunnel_intfs, dpg_ecmp_content, static_routes, tunnel_intfs_qos_remap_config) = parse_dpg(child, asic_name) + (intfs, lo_intfs, mvrf, mgmt_intf, voq_inband_intfs, vlans, vlan_members, dhcp_relay_table, pcs, pc_members, acls, acl_table_types, vni, tunnel_intfs, dpg_ecmp_content, static_routes, tunnel_intfs_qos_remap_config) = parse_dpg(child, asic_hostname) host_lo_intfs = parse_host_loopback(child, hostname) elif child.tag == str(QName(ns, "CpgDec")): - (bgp_sessions, bgp_internal_sessions, bgp_voq_chassis_sessions, bgp_asn, bgp_peers_with_range, bgp_monitors, bgp_sentinel_sessions) = parse_cpg(child, asic_name, local_devices) + (bgp_sessions, bgp_internal_sessions, bgp_voq_chassis_sessions, bgp_asn, bgp_peers_with_range, bgp_monitors, bgp_sentinel_sessions) = parse_cpg(child, asic_hostname, local_devices) elif child.tag == str(QName(ns, "PngDec")): - (neighbors, devices, port_speed_png) = parse_asic_png(child, asic_name, hostname) + (neighbors, devices, port_speed_png) = parse_asic_png(child, asic_hostname, hostname) elif child.tag == str(QName(ns, "MetadataDeclaration")): - (sub_role, switch_id, switch_type, max_cores, deployment_id, macsec_profile) = parse_asic_meta(child, asic_name) + (sub_role, switch_id, switch_type, max_cores, deployment_id, macsec_profile) = parse_asic_meta(child, asic_hostname) elif child.tag == str(QName(ns, "LinkMetadataDeclaration")): linkmetas = parse_linkmeta(child, hostname) elif child.tag == str(QName(ns, "DeviceInfos")): (port_speeds_default, port_descriptions, sys_ports) = parse_deviceinfo(child, hwsku) + if chassis_hostname: + if child.tag == str(QName(ns, "DeviceInfos")): + if asic_hostname is not None: + (sys_ports, chassis_port_alias, port_speeds_default) = parse_chassis_deviceinfo(child, chassis_linecards_info, chassis_hwsku, num_voq, chassis_type, voq_intf_attributes) + elif child.tag == str(QName(ns, "MetadataDeclaration")): + (syslog_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, macsec_profile) = parse_chassis_meta(child, chassis_hostname) + elif child.tag == str(QName(ns, "LinkMetadataDeclaration")): + linkmetas = parse_linkmeta(child, chassis_hostname) + select_mmu_profiles(qos_profile, platform, hwsku) - # set the host device type in asic metadata also - device_type = [devices[key]['type'] for key in devices if key.lower() == hostname.lower()][0] - if asic_name is None: + + # for chassis get the device type from chassis metadata not the asic or linecard type + if chassis_hostname: + device_type = devices.get(chassis_hostname, {}).get('type', None) + card_type = [devices[key]['type'] for key in devices if key.lower() == hostname.lower()][0] + else: + device_type = [devices[key]['type'] for key in devices if key.lower() == hostname.lower()][0] + + if asic_hostname is None: current_device = [devices[key] for key in devices if key.lower() == hostname.lower()][0] else: try: current_device = [devices[key] for key in devices if key.lower() == asic_name.lower()][0] except: - print("Warning: no asic configuration found for {} in minigraph".format(asic_name), file=sys.stderr) current_device = {} + # on single asic linecards, parse_dpg() will not get the mmanagement interface information + # check here and get the linecard managment interface information + if chassis_hostname and not mgmt_intf: + mgmt_intf = parse_linecard_mgmt_ip(root, hostname) + results = {} results['DEVICE_METADATA'] = {'localhost': { 'bgp_asn': bgp_asn, @@ -1644,6 +2124,9 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw } } + if chassis_hostname: + results['DEVICE_METADATA']['localhost']['chassis_hostname'] = chassis_hostname + if deployment_id is not None: results['DEVICE_METADATA']['localhost']['deployment_id'] = deployment_id @@ -1685,27 +2168,49 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if len(system_defaults) > 0: results['SYSTEM_DEFAULTS'] = system_defaults + + if asic_name is not None: + results['DEVICE_METADATA']['localhost']['asic_name'] = asic_name + + # for single asic Voq Linecards the asic_name needs to populated to "Asic0" + if switch_type == "voq" or chassis_type in [CHASSIS_CARD_VOQ]: + if not is_multi_asic(): + results['DEVICE_METADATA']['localhost']['asic_name'] = "Asic0" - # for this hostname, if sub_role is defined, add sub_role in - # device_metadata if sub_role is not None: - current_device['sub_role'] = sub_role results['DEVICE_METADATA']['localhost']['sub_role'] = sub_role - results['DEVICE_METADATA']['localhost']['asic_name'] = asic_name - elif switch_type == "voq": - # On Voq switches asic_name is mandatory even on single-asic devices - results['DEVICE_METADATA']['localhost']['asic_name'] = 'Asic0' + elif switch_type == "voq" or chassis_type in [CHASSIS_CARD_VOQ] and card_type == "Supervisor": + results['DEVICE_METADATA']['localhost']['sub_role'] = 'fabric' + elif chassis_type == "chassis-packet": + results['DEVICE_METADATA']['localhost']['sub_role'] = BACKEND_ASIC_SUB_ROLE + + if chassis_type == CHASSIS_CARD_VOQ and 'sub_role' in results['DEVICE_METADATA']['localhost'] and FABRIC_ASIC_SUB_ROLE.lower() == results['DEVICE_METADATA']['localhost']['sub_role'].lower(): + results['DEVICE_METADATA']['localhost']['switch_type'] = 'fabric' + else: + # on Voq system each asic has a switch_type + if chassis_type is not None: + results['DEVICE_METADATA']['localhost']['switch_type'] = chassis_type.lower() - # on Voq system each asic has a switch_id - if switch_id is not None: - results['DEVICE_METADATA']['localhost']['switch_id'] = switch_id # on Voq system each asic has a switch_type if switch_type is not None: results['DEVICE_METADATA']['localhost']['switch_type'] = switch_type + # #voq switch_id for asic + # switch_id = chassis_metadata.get(asic_hostname, {}).get('asic_switch_id', None) + # on Voq system each asic has a switch_id + if switch_id is not None: + if sub_role is not None and FRONTEND_ASIC_SUB_ROLE == sub_role: + if slot_index is not None: + switch_id = get_asic_switch_id(slot_index, asic_name) + + results['DEVICE_METADATA']['localhost']['switch_id'] = switch_id # on Voq system each asic has a max_cores if max_cores is not None: results['DEVICE_METADATA']['localhost']['max_cores'] = max_cores + # on Voq system each asic has a max_cores + if max_num_cores is not None: + results['DEVICE_METADATA']['localhost']['max_cores'] = max_num_cores + # Voq systems have an inband interface if voq_inband_intfs is not None: results['VOQ_INBAND_INTERFACE'] = {} @@ -1822,6 +2327,15 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if sys_ports: results['SYSTEM_PORT'] = sys_ports + if chassis_port_alias: + slot_index = get_linecard_slot_index(hostname, chassis_linecards_info) + for port in ports.keys(): + # Try first to get Chassis port alias based on port bandwidth/configured speed and if exception use port default speed. + try: + ports[port]['alias'] = chassis_port_alias.get(slot_index, {})[(port, port_speed_png[port])] + except KeyError: + ports[port]['alias'] = chassis_port_alias.get(slot_index, {}).get((port, ports[port]['speed']), ports[port]['alias']) + for port_name in port_speeds_default: # ignore port not in port_config.ini if port_name not in ports: @@ -1841,7 +2355,12 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if port_name in mgmt_alias_reverse_mapping.keys(): continue - port_default_speed = port_speeds_default.get(port_name, None) + # Get the port_default_speed based on chassis_type/switch_type is non None + if chassis_type: + slot_index = get_linecard_slot_index(hostname, chassis_linecards_info) + port_default_speed = port_speeds_default.get(slot_index, {}).get(port_name, None) + else: + port_default_speed = port_speeds_default.get(port_name, None) port_png_speed = port_speed_png[port_name] # set Port Speed before lane update @@ -2071,36 +2590,37 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw print("Warning: ignore interface '%s' in DEVICE_NEIGHBOR as it is not in the port_config.ini" % nghbr, file=sys.stderr) del neighbors[nghbr] results['DEVICE_NEIGHBOR'] = neighbors - if asic_name is None: + if is_multi_asic() == False or asic_name is None: results['DEVICE_NEIGHBOR_METADATA'] = { key:devices[key] for key in devices if key.lower() != hostname.lower() } else: results['DEVICE_NEIGHBOR_METADATA'] = { key:devices[key] for key in devices if key in {device['name'] for device in neighbors.values()} } - results['SYSLOG_SERVER'] = dict((item, {}) for item in syslog_servers) - results['DHCP_SERVER'] = dict((item, {}) for item in dhcp_servers) - results['DHCP_RELAY'] = dhcp_relay_table - results['NTP_SERVER'] = dict((item, {}) for item in ntp_servers) - # Set default DNS nameserver from dns.j2 - results['DNS_NAMESERVER'] = {} - if os.environ.get("CFGGEN_UNIT_TESTING", "0") == "2": - dns_conf = os.path.join(os.path.dirname(__file__), "tests/", "dns.j2") - else: - dns_conf = "/usr/share/sonic/templates/dns.j2" - if os.path.isfile(dns_conf): - text = "" - with open(dns_conf) as template_file: - # Semgrep does not allow to use jinja2 directly, but we do need jinja2 for SONiC - environment = jinja2.Environment(trim_blocks=True) # nosemgrep - dns_template = environment.from_string(template_file.read()) - text = dns_template.render(results) - try: - dns_res = json.loads(text) - except ValueError as e: - sys.exit("Error: fail to load dns configuration, %s" % str(e)) + if is_multi_asic() == False or asic_name is None: + results['SYSLOG_SERVER'] = dict((item, {}) for item in syslog_servers) + results['DHCP_SERVER'] = dict((item, {}) for item in dhcp_servers) + results['DHCP_RELAY'] = dhcp_relay_table + results['NTP_SERVER'] = dict((item, {}) for item in ntp_servers) + # Set default DNS nameserver from dns.j2 + results['DNS_NAMESERVER'] = {} + if os.environ.get("CFGGEN_UNIT_TESTING", "0") == "2": + dns_conf = os.path.join(os.path.dirname(__file__), "tests/", "dns.j2") else: - dns_nameservers = dns_res.get('DNS_NAMESERVER', {}) - for k in dns_nameservers.keys(): - results['DNS_NAMESERVER'][str(k)] = {} - results['TACPLUS_SERVER'] = dict((item, {'priority': '1', 'tcp_port': '49'}) for item in tacacs_servers) + dns_conf = "/usr/share/sonic/templates/dns.j2" + if os.path.isfile(dns_conf): + text = "" + with open(dns_conf) as template_file: + # Semgrep does not allow to use jinja2 directly, but we do need jinja2 for SONiC + environment = jinja2.Environment(trim_blocks=True) # nosemgrep + dns_template = environment.from_string(template_file.read()) + text = dns_template.render(results) + try: + dns_res = json.loads(text) + except ValueError as e: + sys.exit("Error: fail to load dns configuration, %s" % str(e)) + else: + dns_nameservers = dns_res.get('DNS_NAMESERVER', {}) + for k in dns_nameservers.keys(): + results['DNS_NAMESERVER'][str(k)] = {} + results['TACPLUS_SERVER'] = dict((item, {'priority': '1', 'tcp_port': '49'}) for item in tacacs_servers) if len(acl_table_types) > 0: results['ACL_TABLE_TYPE'] = acl_table_types results['ACL_TABLE'] = filter_acl_table_bindings(acls, neighbors, pcs, pc_members, sub_role, current_device['type'] if current_device else None, is_storage_device, vlan_members) @@ -2359,6 +2879,36 @@ def parse_asic_meta_get_devices(root): return local_devices +def parse_chassis_hwsku(root,chassis_hostname): + for child in root: + if child.tag == str(QName(ns, "PngDec")): + devices = child.find(str(QName(ns, "Devices"))) + for device in devices.findall(str(QName(ns, "Device"))): + if chassis_hostname.lower() == device.find(str(QName(ns, "Hostname"))).text.lower(): + hwsku = device.find(str(QName(ns, "HwSku"))).text + return hwsku + return None + +def parse_mgmt_intf(child): + mgmt_intf = {} + for mgmtintf in child.find(str(QName(ns, "ManagementIPInterfaces"))).findall(str(QName(ns1, "ManagementIPInterface"))): + intfname = mgmtintf.find(str(QName(ns, "AttachTo"))).text + ipprefix = mgmtintf.find(str(QName(ns1, "PrefixStr"))).text + mgmtipn = ipaddress.ip_network(UNICODE_TYPE(ipprefix), False) + gwaddr = ipaddress.ip_address(next(mgmtipn.hosts())) + mgmt_intf[(intfname, ipprefix)] = {'gwaddr': gwaddr} + return mgmt_intf + +def parse_linecard_mgmt_ip(root, hname): + linecard_mgmt_intfs = {} + dpg = root.find(str(QName(ns, "DpgDec"))) + for child in dpg: + hostname = child.find(str(QName(ns, "Hostname"))) + if hostname.text.lower() != hname.lower(): + continue + linecard_mgmt_intfs = parse_mgmt_intf(child) + return linecard_mgmt_intfs + port_names_map = {} port_alias_map = {} port_alias_asic_map = {} diff --git a/src/sonic-config-engine/tests/chassis_data/packet_chassis_data/packet-chassis-port-config-1.ini b/src/sonic-config-engine/tests/chassis_data/packet_chassis_data/packet-chassis-port-config-1.ini new file mode 100644 index 000000000000..2d8df25cb04a --- /dev/null +++ b/src/sonic-config-engine/tests/chassis_data/packet_chassis_data/packet-chassis-port-config-1.ini @@ -0,0 +1,49 @@ +# name lanes alias index speed asic_port_name role +Ethernet-BP0 0,1 Eth0-ASIC0 0 100000 Eth0-ASIC0 Int +Ethernet-BP6 6,7 Eth6-ASIC0 3 100000 Eth6-ASIC0 Int +Ethernet-BP8 8,9 Eth8-ASIC0 4 100000 Eth8-ASIC0 Int +Ethernet-BP10 10,11 Eth10-ASIC0 5 100000 Eth10-ASIC0 Int +Ethernet-BP26 258,259 Eth26-ASIC0 13 100000 Eth26-ASIC0 Int +Ethernet-BP28 260,261 Eth28-ASIC0 14 100000 Eth28-ASIC0 Int +Ethernet-BP32 264,265 Eth32-ASIC0 16 100000 Eth32-ASIC0 Int +Ethernet-BP38 270,271 Eth38-ASIC0 19 100000 Eth38-ASIC0 Int +Ethernet-BP48 512,513 Eth48-ASIC0 24 100000 Eth48-ASIC0 Int +Ethernet-BP50 514,515 Eth50-ASIC0 25 100000 Eth50-ASIC0 Int +Ethernet-BP58 522,523 Eth58-ASIC0 29 100000 Eth58-ASIC0 Int +Ethernet-BP60 524,525 Eth60-ASIC0 30 100000 Eth60-ASIC0 Int +Ethernet-BP72 768,769 Eth72-ASIC0 36 100000 Eth72-ASIC0 Int +Ethernet-BP80 776,777 Eth80-ASIC0 40 100000 Eth80-ASIC0 Int +Ethernet-BP82 778,779 Eth82-ASIC0 41 100000 Eth82-ASIC0 Int +Ethernet-BP86 782,783 Eth86-ASIC0 43 100000 Eth86-ASIC0 Int +Ethernet-BP90 1026,1027 Eth90-ASIC0 45 100000 Eth90-ASIC0 Int +Ethernet-BP92 1028,1029 Eth92-ASIC0 46 100000 Eth92-ASIC0 Int +Ethernet-BP96 1032,1033 Eth96-ASIC0 48 100000 Eth96-ASIC0 Int +Ethernet-BP102 1038,1039 Eth102-ASIC0 51 100000 Eth102-ASIC0 Int +Ethernet-BP104 1280,1281 Eth104-ASIC0 52 100000 Eth104-ASIC0 Int +Ethernet-BP106 1282,1283 Eth106-ASIC0 53 100000 Eth106-ASIC0 Int +Ethernet-BP114 1290,1291 Eth114-ASIC0 57 100000 Eth114-ASIC0 Int +Ethernet-BP116 1292,1293 Eth116-ASIC0 58 100000 Eth116-ASIC0 Int +Ethernet-BP128 1536,1537,1538,1539 Eth128-ASIC0 64 200000 Eth128-ASIC0 Int +Ethernet-BP132 1540,1541,1542,1543 Eth132-ASIC0 66 200000 Eth132-ASIC0 Int +Ethernet-BP136 1544,1545,1546,1547 Eth136-ASIC0 68 200000 Eth136-ASIC0 Int +Ethernet-BP140 1548,1549,1550,1551 Eth140-ASIC0 70 200000 Eth140-ASIC0 Int +Ethernet-BP154 1794,1795 Eth154-ASIC0 77 100000 Eth154-ASIC0 Int +Ethernet-BP156 1796,1797 Eth156-ASIC0 78 100000 Eth156-ASIC0 Int +Ethernet-BP160 1800,1801,1802,1803 Eth160-ASIC0 80 200000 Eth160-ASIC0 Int +Ethernet-BP164 1804,1805,1806,1807 Eth164-ASIC0 82 200000 Eth164-ASIC0 Int +Ethernet-BP168 2048,2049 Eth168-ASIC0 84 100000 Eth168-ASIC0 Int +Ethernet-BP170 2050,2051 Eth170-ASIC0 85 100000 Eth170-ASIC0 Int +Ethernet-BP178 2058,2059 Eth178-ASIC0 89 100000 Eth178-ASIC0 Int +Ethernet-BP180 2060,2061 Eth180-ASIC0 90 100000 Eth180-ASIC0 Int +Ethernet-BP184 2304,2305 Eth184-ASIC0 92 100000 Eth184-ASIC0 Int +Ethernet-BP190 2310,2311 Eth190-ASIC0 95 100000 Eth190-ASIC0 Int +Ethernet-BP192 2312,2313 Eth192-ASIC0 96 100000 Eth192-ASIC0 Int +Ethernet-BP194 2314,2315 Eth194-ASIC0 97 100000 Eth194-ASIC0 Int +Ethernet-BP208 2560,2561 Eth208-ASIC0 104 100000 Eth208-ASIC0 Int +Ethernet-BP214 2566,2567 Eth214-ASIC0 107 100000 Eth214-ASIC0 Int +Ethernet-BP218 2570,2571 Eth218-ASIC0 109 100000 Eth218-ASIC0 Int +Ethernet-BP220 2572,2573 Eth220-ASIC0 110 100000 Eth220-ASIC0 Int +Ethernet-BP232 2816,2817 Eth232-ASIC0 116 100000 Eth232-ASIC0 Int +Ethernet-BP234 2818,2819 Eth234-ASIC0 117 100000 Eth234-ASIC0 Int +Ethernet-BP242 2826,2827 Eth242-ASIC0 121 100000 Eth242-ASIC0 Int +Ethernet-BP244 2828,2829 Eth244-ASIC0 122 100000 Eth244-ASIC0 Int \ No newline at end of file diff --git a/src/sonic-config-engine/tests/chassis_data/packet_chassis_data/packet_chassis_sup.xml b/src/sonic-config-engine/tests/chassis_data/packet_chassis_data/packet_chassis_sup.xml new file mode 100644 index 000000000000..798d498f14fe --- /dev/null +++ b/src/sonic-config-engine/tests/chassis_data/packet_chassis_data/packet_chassis_sup.xml @@ -0,0 +1,53496 @@ + + + + + + + + + + + + + + Sonic-T2-base-sku + + + + DeviceInterface + + false + 1 + FourHundredGigE0/0/0/0 + false + + Ethernet0 + 400000 + + + DeviceInterface + + false + 2 + HundredGigE0/0/0/0 + false + + Ethernet0 + 100000 + + + DeviceInterface + + false + 3 + FourHundredGigE0/0/0/1 + false + + Ethernet8 + 400000 + + + DeviceInterface + + false + 4 + HundredGigE0/0/0/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + + false + 5 + FourHundredGigE0/0/0/2 + false + + Ethernet16 + 400000 + + + DeviceInterface + + false + 6 + HundredGigE0/0/0/2 + false + + Ethernet16 + 100000 + + + DeviceInterface + + false + 7 + FourHundredGigE0/0/0/3 + false + + Ethernet24 + 400000 + + + DeviceInterface + + false + 8 + HundredGigE0/0/0/3 + false + + Ethernet24 + 100000 + + + DeviceInterface + + false + 9 + FourHundredGigE0/0/0/4 + false + + Ethernet32 + 400000 + + + DeviceInterface + + false + 10 + HundredGigE0/0/0/4 + false + + Ethernet32 + 100000 + + + DeviceInterface + + false + 11 + FourHundredGigE0/0/0/5 + false + + Ethernet40 + 400000 + + + DeviceInterface + + false + 12 + HundredGigE0/0/0/5 + false + + Ethernet40 + 100000 + + + DeviceInterface + + false + 13 + FourHundredGigE0/0/0/6 + false + + Ethernet48 + 400000 + + + DeviceInterface + + false + 14 + HundredGigE0/0/0/6 + false + + Ethernet48 + 100000 + + + DeviceInterface + + false + 15 + FourHundredGigE0/0/0/7 + false + + Ethernet56 + 400000 + + + DeviceInterface + + false + 16 + HundredGigE0/0/0/7 + false + + Ethernet56 + 100000 + + + DeviceInterface + + false + 17 + FourHundredGigE0/0/0/8 + false + + Ethernet64 + 400000 + + + DeviceInterface + + false + 18 + HundredGigE0/0/0/8 + false + + Ethernet64 + 100000 + + + DeviceInterface + + false + 19 + FourHundredGigE0/0/0/9 + false + + Ethernet72 + 400000 + + + DeviceInterface + + false + 20 + HundredGigE0/0/0/9 + false + + Ethernet72 + 100000 + + + DeviceInterface + + false + 21 + FourHundredGigE0/0/0/10 + false + + Ethernet80 + 400000 + + + DeviceInterface + + false + 22 + HundredGigE0/0/0/10 + false + + Ethernet80 + 100000 + + + DeviceInterface + + false + 23 + FourHundredGigE0/0/0/11 + false + + Ethernet88 + 400000 + + + DeviceInterface + + false + 24 + HundredGigE0/0/0/11 + false + + Ethernet88 + 100000 + + + DeviceInterface + + false + 25 + FourHundredGigE0/0/0/12 + false + + Ethernet96 + 400000 + + + DeviceInterface + + false + 26 + HundredGigE0/0/0/12 + false + + Ethernet96 + 100000 + + + DeviceInterface + + false + 27 + FourHundredGigE0/0/0/13 + false + + Ethernet104 + 400000 + + + DeviceInterface + + false + 28 + HundredGigE0/0/0/13 + false + + Ethernet104 + 100000 + + + DeviceInterface + + false + 29 + FourHundredGigE0/0/0/14 + false + + Ethernet112 + 400000 + + + DeviceInterface + + false + 30 + HundredGigE0/0/0/14 + false + + Ethernet112 + 100000 + + + DeviceInterface + + false + 31 + FourHundredGigE0/0/0/15 + false + + Ethernet120 + 400000 + + + DeviceInterface + + false + 32 + HundredGigE0/0/0/15 + false + + Ethernet120 + 100000 + + + DeviceInterface + + false + 33 + FourHundredGigE0/0/0/16 + false + + Ethernet128 + 400000 + + + DeviceInterface + + false + 34 + HundredGigE0/0/0/16 + false + + Ethernet128 + 100000 + + + DeviceInterface + + false + 35 + FourHundredGigE0/0/0/17 + false + + Ethernet136 + 400000 + + + DeviceInterface + + false + 36 + HundredGigE0/0/0/17 + false + + Ethernet136 + 100000 + + + DeviceInterface + + false + 37 + FourHundredGigE0/0/0/18 + false + + Ethernet144 + 400000 + + + DeviceInterface + + false + 38 + HundredGigE0/0/0/18 + false + + Ethernet144 + 100000 + + + DeviceInterface + + false + 39 + FourHundredGigE0/0/0/19 + false + + Ethernet152 + 400000 + + + DeviceInterface + + false + 40 + HundredGigE0/0/0/19 + false + + Ethernet152 + 100000 + + + DeviceInterface + + false + 41 + FourHundredGigE0/0/0/20 + false + + Ethernet160 + 400000 + + + DeviceInterface + + false + 42 + HundredGigE0/0/0/20 + false + + Ethernet160 + 100000 + + + DeviceInterface + + false + 43 + FourHundredGigE0/0/0/21 + false + + Ethernet168 + 400000 + + + DeviceInterface + + false + 44 + HundredGigE0/0/0/21 + false + + Ethernet168 + 100000 + + + DeviceInterface + + false + 45 + FourHundredGigE0/0/0/22 + false + + Ethernet176 + 400000 + + + DeviceInterface + + false + 46 + HundredGigE0/0/0/22 + false + + Ethernet176 + 100000 + + + DeviceInterface + + false + 47 + FourHundredGigE0/0/0/23 + false + + Ethernet184 + 400000 + + + DeviceInterface + + false + 48 + HundredGigE0/0/0/23 + false + + Ethernet184 + 100000 + + + DeviceInterface + + false + 49 + FourHundredGigE0/0/0/24 + false + + Ethernet192 + 400000 + + + DeviceInterface + + false + 50 + HundredGigE0/0/0/24 + false + + Ethernet192 + 100000 + + + DeviceInterface + + false + 51 + FourHundredGigE0/0/0/25 + false + + Ethernet200 + 400000 + + + DeviceInterface + + false + 52 + HundredGigE0/0/0/25 + false + + Ethernet200 + 100000 + + + DeviceInterface + + false + 53 + FourHundredGigE0/0/0/26 + false + + Ethernet208 + 400000 + + + DeviceInterface + + false + 54 + HundredGigE0/0/0/26 + false + + Ethernet208 + 100000 + + + DeviceInterface + + false + 55 + FourHundredGigE0/0/0/27 + false + + Ethernet216 + 400000 + + + DeviceInterface + + false + 56 + HundredGigE0/0/0/27 + false + + Ethernet216 + 100000 + + + DeviceInterface + + false + 57 + FourHundredGigE0/0/0/28 + false + + Ethernet224 + 400000 + + + DeviceInterface + + false + 58 + HundredGigE0/0/0/28 + false + + Ethernet224 + 100000 + + + DeviceInterface + + false + 59 + FourHundredGigE0/0/0/29 + false + + Ethernet232 + 400000 + + + DeviceInterface + + false + 60 + HundredGigE0/0/0/29 + false + + Ethernet232 + 100000 + + + DeviceInterface + + false + 61 + FourHundredGigE0/0/0/30 + false + + Ethernet240 + 400000 + + + DeviceInterface + + false + 62 + HundredGigE0/0/0/30 + false + + Ethernet240 + 100000 + + + DeviceInterface + + false + 63 + FourHundredGigE0/0/0/31 + false + + Ethernet248 + 400000 + + + DeviceInterface + + false + 64 + HundredGigE0/0/0/31 + false + + Ethernet248 + 100000 + + + DeviceInterface + + false + 65 + FourHundredGigE0/0/0/32 + false + + Ethernet256 + 400000 + + + DeviceInterface + + false + 66 + HundredGigE0/0/0/32 + false + + Ethernet256 + 100000 + + + DeviceInterface + + false + 67 + FourHundredGigE0/0/0/33 + false + + Ethernet264 + 400000 + + + DeviceInterface + + false + 68 + HundredGigE0/0/0/33 + false + + Ethernet264 + 100000 + + + DeviceInterface + + false + 69 + FourHundredGigE0/0/0/34 + false + + Ethernet272 + 400000 + + + DeviceInterface + + false + 70 + HundredGigE0/0/0/34 + false + + Ethernet272 + 100000 + + + DeviceInterface + + false + 71 + FourHundredGigE0/0/0/35 + false + + Ethernet280 + 400000 + + + DeviceInterface + + false + 72 + HundredGigE0/0/0/35 + false + + Ethernet280 + 100000 + + + DeviceInterface + + false + 73 + HundredGigE0/1/0/0 + false + + Ethernet0 + 100000 + + + DeviceInterface + + false + 74 + FortyGigE0/1/0/0 + false + + Ethernet0 + 40000 + + + DeviceInterface + + false + 75 + HundredGigE0/1/0/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + + false + 76 + FortyGigE0/1/0/1 + false + + Ethernet4 + 40000 + + + DeviceInterface + + false + 77 + HundredGigE0/1/0/2 + false + + Ethernet8 + 100000 + + + DeviceInterface + + false + 78 + FortyGigE0/1/0/2 + false + + Ethernet8 + 40000 + + + DeviceInterface + + false + 79 + HundredGigE0/1/0/3 + false + + Ethernet12 + 100000 + + + DeviceInterface + + false + 80 + FortyGigE0/1/0/3 + false + + Ethernet12 + 40000 + + + DeviceInterface + + false + 81 + HundredGigE0/1/0/4 + false + + Ethernet16 + 100000 + + + DeviceInterface + + false + 82 + FortyGigE0/1/0/4 + false + + Ethernet16 + 40000 + + + DeviceInterface + + false + 83 + HundredGigE0/1/0/5 + false + + Ethernet20 + 100000 + + + DeviceInterface + + false + 84 + FortyGigE0/1/0/5 + false + + Ethernet20 + 40000 + + + DeviceInterface + + false + 85 + HundredGigE0/1/0/6 + false + + Ethernet24 + 100000 + + + DeviceInterface + + false + 86 + FortyGigE0/1/0/6 + false + + Ethernet24 + 40000 + + + DeviceInterface + + false + 87 + HundredGigE0/1/0/7 + false + + Ethernet28 + 100000 + + + DeviceInterface + + false + 88 + FortyGigE0/1/0/7 + false + + Ethernet28 + 40000 + + + DeviceInterface + + false + 89 + HundredGigE0/1/0/8 + false + + Ethernet32 + 100000 + + + DeviceInterface + + false + 90 + FortyGigE0/1/0/8 + false + + Ethernet32 + 40000 + + + DeviceInterface + + false + 91 + HundredGigE0/1/0/9 + false + + Ethernet36 + 100000 + + + DeviceInterface + + false + 92 + FortyGigE0/1/0/9 + false + + Ethernet36 + 40000 + + + DeviceInterface + + false + 93 + HundredGigE0/1/0/10 + false + + Ethernet40 + 100000 + + + DeviceInterface + + false + 94 + FortyGigE0/1/0/10 + false + + Ethernet40 + 40000 + + + DeviceInterface + + false + 95 + HundredGigE0/1/0/11 + false + + Ethernet44 + 100000 + + + DeviceInterface + + false + 96 + FortyGigE0/1/0/11 + false + + Ethernet44 + 40000 + + + DeviceInterface + + false + 97 + HundredGigE0/1/0/12 + false + + Ethernet48 + 100000 + + + DeviceInterface + + false + 98 + FortyGigE0/1/0/12 + false + + Ethernet48 + 40000 + + + DeviceInterface + + false + 99 + HundredGigE0/1/0/13 + false + + Ethernet52 + 100000 + + + DeviceInterface + + false + 100 + FortyGigE0/1/0/13 + false + + Ethernet52 + 40000 + + + DeviceInterface + + false + 101 + HundredGigE0/1/0/14 + false + + Ethernet56 + 100000 + + + DeviceInterface + + false + 102 + FortyGigE0/1/0/14 + false + + Ethernet56 + 40000 + + + DeviceInterface + + false + 103 + HundredGigE0/1/0/15 + false + + Ethernet60 + 100000 + + + DeviceInterface + + false + 104 + FortyGigE0/1/0/15 + false + + Ethernet60 + 40000 + + + DeviceInterface + + false + 105 + HundredGigE0/1/0/16 + false + + Ethernet64 + 100000 + + + DeviceInterface + + false + 106 + FortyGigE0/1/0/16 + false + + Ethernet64 + 40000 + + + DeviceInterface + + false + 107 + HundredGigE0/1/0/17 + false + + Ethernet68 + 100000 + + + DeviceInterface + + false + 108 + FortyGigE0/1/0/17 + false + + Ethernet68 + 40000 + + + DeviceInterface + + false + 109 + HundredGigE0/1/0/18 + false + + Ethernet72 + 100000 + + + DeviceInterface + + false + 110 + FortyGigE0/1/0/18 + false + + Ethernet72 + 40000 + + + DeviceInterface + + false + 111 + HundredGigE0/1/0/19 + false + + Ethernet76 + 100000 + + + DeviceInterface + + false + 112 + FortyGigE0/1/0/19 + false + + Ethernet76 + 40000 + + + DeviceInterface + + false + 113 + HundredGigE0/1/0/20 + false + + Ethernet80 + 100000 + + + DeviceInterface + + false + 114 + FortyGigE0/1/0/20 + false + + Ethernet80 + 40000 + + + DeviceInterface + + false + 115 + HundredGigE0/1/0/21 + false + + Ethernet84 + 100000 + + + DeviceInterface + + false + 116 + FortyGigE0/1/0/21 + false + + Ethernet84 + 40000 + + + DeviceInterface + + false + 117 + HundredGigE0/1/0/22 + false + + Ethernet88 + 100000 + + + DeviceInterface + + false + 118 + FortyGigE0/1/0/22 + false + + Ethernet88 + 40000 + + + DeviceInterface + + false + 119 + HundredGigE0/1/0/23 + false + + Ethernet92 + 100000 + + + DeviceInterface + + false + 120 + FortyGigE0/1/0/23 + false + + Ethernet92 + 40000 + + + DeviceInterface + + false + 121 + HundredGigE0/1/0/24 + false + + Ethernet96 + 100000 + + + DeviceInterface + + false + 122 + FortyGigE0/1/0/24 + false + + Ethernet96 + 40000 + + + DeviceInterface + + false + 123 + HundredGigE0/1/0/25 + false + + Ethernet100 + 100000 + + + DeviceInterface + + false + 124 + FortyGigE0/1/0/25 + false + + Ethernet100 + 40000 + + + DeviceInterface + + false + 125 + HundredGigE0/1/0/26 + false + + Ethernet104 + 100000 + + + DeviceInterface + + false + 126 + FortyGigE0/1/0/26 + false + + Ethernet104 + 40000 + + + DeviceInterface + + false + 127 + HundredGigE0/1/0/27 + false + + Ethernet108 + 100000 + + + DeviceInterface + + false + 128 + FortyGigE0/1/0/27 + false + + Ethernet108 + 40000 + + + DeviceInterface + + false + 129 + HundredGigE0/1/0/28 + false + + Ethernet112 + 100000 + + + DeviceInterface + + false + 130 + FortyGigE0/1/0/28 + false + + Ethernet112 + 40000 + + + DeviceInterface + + false + 131 + HundredGigE0/1/0/29 + false + + Ethernet116 + 100000 + + + DeviceInterface + + false + 132 + FortyGigE0/1/0/29 + false + + Ethernet116 + 40000 + + + DeviceInterface + + false + 133 + HundredGigE0/1/0/30 + false + + Ethernet120 + 100000 + + + DeviceInterface + + false + 134 + FortyGigE0/1/0/30 + false + + Ethernet120 + 40000 + + + DeviceInterface + + false + 135 + HundredGigE0/1/0/31 + false + + Ethernet124 + 100000 + + + DeviceInterface + + false + 136 + FortyGigE0/1/0/31 + false + + Ethernet124 + 40000 + + + DeviceInterface + + false + 137 + HundredGigE0/1/0/32 + false + + Ethernet128 + 100000 + + + DeviceInterface + + false + 138 + FortyGigE0/1/0/32 + false + + Ethernet128 + 40000 + + + DeviceInterface + + false + 139 + HundredGigE0/1/0/33 + false + + Ethernet132 + 100000 + + + DeviceInterface + + false + 140 + FortyGigE0/1/0/33 + false + + Ethernet132 + 40000 + + + DeviceInterface + + false + 141 + HundredGigE0/1/0/34 + false + + Ethernet136 + 100000 + + + DeviceInterface + + false + 142 + FortyGigE0/1/0/34 + false + + Ethernet136 + 40000 + + + DeviceInterface + + false + 143 + HundredGigE0/1/0/35 + false + + Ethernet140 + 100000 + + + DeviceInterface + + false + 144 + FortyGigE0/1/0/35 + false + + Ethernet140 + 40000 + + + DeviceInterface + + false + 145 + HundredGigE0/1/0/36 + false + + Ethernet144 + 100000 + + + DeviceInterface + + false + 146 + FortyGigE0/1/0/36 + false + + Ethernet144 + 40000 + + + DeviceInterface + + false + 147 + HundredGigE0/1/0/37 + false + + Ethernet148 + 100000 + + + DeviceInterface + + false + 148 + FortyGigE0/1/0/37 + false + + Ethernet148 + 40000 + + + DeviceInterface + + false + 149 + HundredGigE0/1/0/38 + false + + Ethernet152 + 100000 + + + DeviceInterface + + false + 150 + FortyGigE0/1/0/38 + false + + Ethernet152 + 40000 + + + DeviceInterface + + false + 151 + HundredGigE0/1/0/39 + false + + Ethernet156 + 100000 + + + DeviceInterface + + false + 152 + FortyGigE0/1/0/39 + false + + Ethernet156 + 40000 + + + DeviceInterface + + false + 153 + HundredGigE0/1/0/40 + false + + Ethernet160 + 100000 + + + DeviceInterface + + false + 154 + FortyGigE0/1/0/40 + false + + Ethernet160 + 40000 + + + DeviceInterface + + false + 155 + HundredGigE0/1/0/41 + false + + Ethernet164 + 100000 + + + DeviceInterface + + false + 156 + FortyGigE0/1/0/41 + false + + Ethernet164 + 40000 + + + DeviceInterface + + false + 157 + HundredGigE0/1/0/42 + false + + Ethernet168 + 100000 + + + DeviceInterface + + false + 158 + FortyGigE0/1/0/42 + false + + Ethernet168 + 40000 + + + DeviceInterface + + false + 159 + HundredGigE0/1/0/43 + false + + Ethernet172 + 100000 + + + DeviceInterface + + false + 160 + FortyGigE0/1/0/43 + false + + Ethernet172 + 40000 + + + DeviceInterface + + false + 161 + HundredGigE0/1/0/44 + false + + Ethernet176 + 100000 + + + DeviceInterface + + false + 162 + FortyGigE0/1/0/44 + false + + Ethernet176 + 40000 + + + DeviceInterface + + false + 163 + HundredGigE0/1/0/45 + false + + Ethernet180 + 100000 + + + DeviceInterface + + false + 164 + FortyGigE0/1/0/45 + false + + Ethernet180 + 40000 + + + DeviceInterface + + false + 165 + HundredGigE0/1/0/46 + false + + Ethernet184 + 100000 + + + DeviceInterface + + false + 166 + FortyGigE0/1/0/46 + false + + Ethernet184 + 40000 + + + DeviceInterface + + false + 167 + HundredGigE0/1/0/47 + false + + Ethernet188 + 100000 + + + DeviceInterface + + false + 168 + FortyGigE0/1/0/47 + false + + Ethernet188 + 40000 + + + DeviceInterface + + false + 169 + HundredGigE0/2/0/0 + false + + Ethernet0 + 100000 + + + DeviceInterface + + false + 170 + FortyGigE0/2/0/0 + false + + Ethernet0 + 40000 + + + DeviceInterface + + false + 171 + HundredGigE0/2/0/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + + false + 172 + FortyGigE0/2/0/1 + false + + Ethernet4 + 40000 + + + DeviceInterface + + false + 173 + HundredGigE0/2/0/2 + false + + Ethernet8 + 100000 + + + DeviceInterface + + false + 174 + FortyGigE0/2/0/2 + false + + Ethernet8 + 40000 + + + DeviceInterface + + false + 175 + HundredGigE0/2/0/3 + false + + Ethernet12 + 100000 + + + DeviceInterface + + false + 176 + FortyGigE0/2/0/3 + false + + Ethernet12 + 40000 + + + DeviceInterface + + false + 177 + HundredGigE0/2/0/4 + false + + Ethernet16 + 100000 + + + DeviceInterface + + false + 178 + FortyGigE0/2/0/4 + false + + Ethernet16 + 40000 + + + DeviceInterface + + false + 179 + HundredGigE0/2/0/5 + false + + Ethernet20 + 100000 + + + DeviceInterface + + false + 180 + FortyGigE0/2/0/5 + false + + Ethernet20 + 40000 + + + DeviceInterface + + false + 181 + HundredGigE0/2/0/6 + false + + Ethernet24 + 100000 + + + DeviceInterface + + false + 182 + FortyGigE0/2/0/6 + false + + Ethernet24 + 40000 + + + DeviceInterface + + false + 183 + HundredGigE0/2/0/7 + false + + Ethernet28 + 100000 + + + DeviceInterface + + false + 184 + FortyGigE0/2/0/7 + false + + Ethernet28 + 40000 + + + DeviceInterface + + false + 185 + HundredGigE0/2/0/8 + false + + Ethernet32 + 100000 + + + DeviceInterface + + false + 186 + FortyGigE0/2/0/8 + false + + Ethernet32 + 40000 + + + DeviceInterface + + false + 187 + HundredGigE0/2/0/9 + false + + Ethernet36 + 100000 + + + DeviceInterface + + false + 188 + FortyGigE0/2/0/9 + false + + Ethernet36 + 40000 + + + DeviceInterface + + false + 189 + HundredGigE0/2/0/10 + false + + Ethernet40 + 100000 + + + DeviceInterface + + false + 190 + FortyGigE0/2/0/10 + false + + Ethernet40 + 40000 + + + DeviceInterface + + false + 191 + HundredGigE0/2/0/11 + false + + Ethernet44 + 100000 + + + DeviceInterface + + false + 192 + FortyGigE0/2/0/11 + false + + Ethernet44 + 40000 + + + DeviceInterface + + false + 193 + HundredGigE0/2/0/12 + false + + Ethernet48 + 100000 + + + DeviceInterface + + false + 194 + FortyGigE0/2/0/12 + false + + Ethernet48 + 40000 + + + DeviceInterface + + false + 195 + HundredGigE0/2/0/13 + false + + Ethernet52 + 100000 + + + DeviceInterface + + false + 196 + FortyGigE0/2/0/13 + false + + Ethernet52 + 40000 + + + DeviceInterface + + false + 197 + HundredGigE0/2/0/14 + false + + Ethernet56 + 100000 + + + DeviceInterface + + false + 198 + FortyGigE0/2/0/14 + false + + Ethernet56 + 40000 + + + DeviceInterface + + false + 199 + HundredGigE0/2/0/15 + false + + Ethernet60 + 100000 + + + DeviceInterface + + false + 200 + FortyGigE0/2/0/15 + false + + Ethernet60 + 40000 + + + DeviceInterface + + false + 201 + HundredGigE0/2/0/16 + false + + Ethernet64 + 100000 + + + DeviceInterface + + false + 202 + FortyGigE0/2/0/16 + false + + Ethernet64 + 40000 + + + DeviceInterface + + false + 203 + HundredGigE0/2/0/17 + false + + Ethernet68 + 100000 + + + DeviceInterface + + false + 204 + FortyGigE0/2/0/17 + false + + Ethernet68 + 40000 + + + DeviceInterface + + false + 205 + HundredGigE0/2/0/18 + false + + Ethernet72 + 100000 + + + DeviceInterface + + false + 206 + FortyGigE0/2/0/18 + false + + Ethernet72 + 40000 + + + DeviceInterface + + false + 207 + HundredGigE0/2/0/19 + false + + Ethernet76 + 100000 + + + DeviceInterface + + false + 208 + FortyGigE0/2/0/19 + false + + Ethernet76 + 40000 + + + DeviceInterface + + false + 209 + HundredGigE0/2/0/20 + false + + Ethernet80 + 100000 + + + DeviceInterface + + false + 210 + FortyGigE0/2/0/20 + false + + Ethernet80 + 40000 + + + DeviceInterface + + false + 211 + HundredGigE0/2/0/21 + false + + Ethernet84 + 100000 + + + DeviceInterface + + false + 212 + FortyGigE0/2/0/21 + false + + Ethernet84 + 40000 + + + DeviceInterface + + false + 213 + HundredGigE0/2/0/22 + false + + Ethernet88 + 100000 + + + DeviceInterface + + false + 214 + FortyGigE0/2/0/22 + false + + Ethernet88 + 40000 + + + DeviceInterface + + false + 215 + HundredGigE0/2/0/23 + false + + Ethernet92 + 100000 + + + DeviceInterface + + false + 216 + FortyGigE0/2/0/23 + false + + Ethernet92 + 40000 + + + DeviceInterface + + false + 217 + HundredGigE0/2/0/24 + false + + Ethernet96 + 100000 + + + DeviceInterface + + false + 218 + FortyGigE0/2/0/24 + false + + Ethernet96 + 40000 + + + DeviceInterface + + false + 219 + HundredGigE0/2/0/25 + false + + Ethernet100 + 100000 + + + DeviceInterface + + false + 220 + FortyGigE0/2/0/25 + false + + Ethernet100 + 40000 + + + DeviceInterface + + false + 221 + HundredGigE0/2/0/26 + false + + Ethernet104 + 100000 + + + DeviceInterface + + false + 222 + FortyGigE0/2/0/26 + false + + Ethernet104 + 40000 + + + DeviceInterface + + false + 223 + HundredGigE0/2/0/27 + false + + Ethernet108 + 100000 + + + DeviceInterface + + false + 224 + FortyGigE0/2/0/27 + false + + Ethernet108 + 40000 + + + DeviceInterface + + false + 225 + HundredGigE0/2/0/28 + false + + Ethernet112 + 100000 + + + DeviceInterface + + false + 226 + FortyGigE0/2/0/28 + false + + Ethernet112 + 40000 + + + DeviceInterface + + false + 227 + HundredGigE0/2/0/29 + false + + Ethernet116 + 100000 + + + DeviceInterface + + false + 228 + FortyGigE0/2/0/29 + false + + Ethernet116 + 40000 + + + DeviceInterface + + false + 229 + HundredGigE0/2/0/30 + false + + Ethernet120 + 100000 + + + DeviceInterface + + false + 230 + FortyGigE0/2/0/30 + false + + Ethernet120 + 40000 + + + DeviceInterface + + false + 231 + HundredGigE0/2/0/31 + false + + Ethernet124 + 100000 + + + DeviceInterface + + false + 232 + FortyGigE0/2/0/31 + false + + Ethernet124 + 40000 + + + DeviceInterface + + false + 233 + HundredGigE0/2/0/32 + false + + Ethernet128 + 100000 + + + DeviceInterface + + false + 234 + FortyGigE0/2/0/32 + false + + Ethernet128 + 40000 + + + DeviceInterface + + false + 235 + HundredGigE0/2/0/33 + false + + Ethernet132 + 100000 + + + DeviceInterface + + false + 236 + FortyGigE0/2/0/33 + false + + Ethernet132 + 40000 + + + DeviceInterface + + false + 237 + HundredGigE0/2/0/34 + false + + Ethernet136 + 100000 + + + DeviceInterface + + false + 238 + FortyGigE0/2/0/34 + false + + Ethernet136 + 40000 + + + DeviceInterface + + false + 239 + HundredGigE0/2/0/35 + false + + Ethernet140 + 100000 + + + DeviceInterface + + false + 240 + FortyGigE0/2/0/35 + false + + Ethernet140 + 40000 + + + DeviceInterface + + false + 241 + HundredGigE0/2/0/36 + false + + Ethernet144 + 100000 + + + DeviceInterface + + false + 242 + FortyGigE0/2/0/36 + false + + Ethernet144 + 40000 + + + DeviceInterface + + false + 243 + HundredGigE0/2/0/37 + false + + Ethernet148 + 100000 + + + DeviceInterface + + false + 244 + FortyGigE0/2/0/37 + false + + Ethernet148 + 40000 + + + DeviceInterface + + false + 245 + HundredGigE0/2/0/38 + false + + Ethernet152 + 100000 + + + DeviceInterface + + false + 246 + FortyGigE0/2/0/38 + false + + Ethernet152 + 40000 + + + DeviceInterface + + false + 247 + HundredGigE0/2/0/39 + false + + Ethernet156 + 100000 + + + DeviceInterface + + false + 248 + FortyGigE0/2/0/39 + false + + Ethernet156 + 40000 + + + DeviceInterface + + false + 249 + HundredGigE0/2/0/40 + false + + Ethernet160 + 100000 + + + DeviceInterface + + false + 250 + FortyGigE0/2/0/40 + false + + Ethernet160 + 40000 + + + DeviceInterface + + false + 251 + HundredGigE0/2/0/41 + false + + Ethernet164 + 100000 + + + DeviceInterface + + false + 252 + FortyGigE0/2/0/41 + false + + Ethernet164 + 40000 + + + DeviceInterface + + false + 253 + HundredGigE0/2/0/42 + false + + Ethernet168 + 100000 + + + DeviceInterface + + false + 254 + FortyGigE0/2/0/42 + false + + Ethernet168 + 40000 + + + DeviceInterface + + false + 255 + HundredGigE0/2/0/43 + false + + Ethernet172 + 100000 + + + DeviceInterface + + false + 256 + FortyGigE0/2/0/43 + false + + Ethernet172 + 40000 + + + DeviceInterface + + false + 257 + HundredGigE0/2/0/44 + false + + Ethernet176 + 100000 + + + DeviceInterface + + false + 258 + FortyGigE0/2/0/44 + false + + Ethernet176 + 40000 + + + DeviceInterface + + false + 259 + HundredGigE0/2/0/45 + false + + Ethernet180 + 100000 + + + DeviceInterface + + false + 260 + FortyGigE0/2/0/45 + false + + Ethernet180 + 40000 + + + DeviceInterface + + false + 261 + HundredGigE0/2/0/46 + false + + Ethernet184 + 100000 + + + DeviceInterface + + false + 262 + FortyGigE0/2/0/46 + false + + Ethernet184 + 40000 + + + DeviceInterface + + false + 263 + HundredGigE0/2/0/47 + false + + Ethernet188 + 100000 + + + DeviceInterface + + false + 264 + FortyGigE0/2/0/47 + false + + Ethernet188 + 40000 + + + DeviceInterface + + false + 265 + HundredGigE0/3/0/0 + false + + Ethernet0 + 100000 + + + DeviceInterface + + false + 266 + FortyGigE0/3/0/0 + false + + Ethernet0 + 40000 + + + DeviceInterface + + false + 267 + FourHundredGigE0/3/0/0 + false + + Ethernet0 + 400000 + + + DeviceInterface + + false + 268 + HundredGigE0/3/0/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + + false + 269 + FortyGigE0/3/0/1 + false + + Ethernet8 + 40000 + + + DeviceInterface + + false + 270 + FourHundredGigE0/3/0/1 + false + + Ethernet8 + 400000 + + + DeviceInterface + + false + 271 + HundredGigE0/3/0/2 + false + + Ethernet16 + 100000 + + + DeviceInterface + + false + 272 + FortyGigE0/3/0/2 + false + + Ethernet16 + 40000 + + + DeviceInterface + + false + 273 + FourHundredGigE0/3/0/2 + false + + Ethernet16 + 400000 + + + DeviceInterface + + false + 274 + HundredGigE0/3/0/3 + false + + Ethernet24 + 100000 + + + DeviceInterface + + false + 275 + FortyGigE0/3/0/3 + false + + Ethernet24 + 40000 + + + DeviceInterface + + false + 276 + FourHundredGigE0/3/0/3 + false + + Ethernet24 + 400000 + + + DeviceInterface + + false + 277 + HundredGigE0/3/0/4 + false + + Ethernet32 + 100000 + + + DeviceInterface + + false + 278 + FortyGigE0/3/0/4 + false + + Ethernet32 + 40000 + + + DeviceInterface + + false + 279 + FourHundredGigE0/3/0/4 + false + + Ethernet32 + 400000 + + + DeviceInterface + + false + 280 + HundredGigE0/3/0/5 + false + + Ethernet40 + 100000 + + + DeviceInterface + + false + 281 + FortyGigE0/3/0/5 + false + + Ethernet40 + 40000 + + + DeviceInterface + + false + 282 + FourHundredGigE0/3/0/5 + false + + Ethernet40 + 400000 + + + DeviceInterface + + false + 283 + HundredGigE0/3/0/6 + false + + Ethernet48 + 100000 + + + DeviceInterface + + false + 284 + FortyGigE0/3/0/6 + false + + Ethernet48 + 40000 + + + DeviceInterface + + false + 285 + FourHundredGigE0/3/0/6 + false + + Ethernet48 + 400000 + + + DeviceInterface + + false + 286 + HundredGigE0/3/0/7 + false + + Ethernet56 + 100000 + + + DeviceInterface + + false + 287 + FortyGigE0/3/0/7 + false + + Ethernet56 + 40000 + + + DeviceInterface + + false + 288 + FourHundredGigE0/3/0/7 + false + + Ethernet56 + 400000 + + + DeviceInterface + + false + 289 + HundredGigE0/3/0/8 + false + + Ethernet64 + 100000 + + + DeviceInterface + + false + 290 + FortyGigE0/3/0/8 + false + + Ethernet64 + 40000 + + + DeviceInterface + + false + 291 + FourHundredGigE0/3/0/8 + false + + Ethernet64 + 400000 + + + DeviceInterface + + false + 292 + HundredGigE0/3/0/9 + false + + Ethernet72 + 100000 + + + DeviceInterface + + false + 293 + FortyGigE0/3/0/9 + false + + Ethernet72 + 40000 + + + DeviceInterface + + false + 294 + FourHundredGigE0/3/0/9 + false + + Ethernet72 + 400000 + + + DeviceInterface + + false + 295 + HundredGigE0/3/0/10 + false + + Ethernet80 + 100000 + + + DeviceInterface + + false + 296 + FortyGigE0/3/0/10 + false + + Ethernet80 + 40000 + + + DeviceInterface + + false + 297 + FourHundredGigE0/3/0/10 + false + + Ethernet80 + 400000 + + + DeviceInterface + + false + 298 + HundredGigE0/3/0/11 + false + + Ethernet88 + 100000 + + + DeviceInterface + + false + 299 + FortyGigE0/3/0/11 + false + + Ethernet88 + 40000 + + + DeviceInterface + + false + 300 + FourHundredGigE0/3/0/11 + false + + Ethernet88 + 400000 + + + DeviceInterface + + false + 301 + HundredGigE0/3/0/12 + false + + Ethernet96 + 100000 + + + DeviceInterface + + false + 302 + FortyGigE0/3/0/12 + false + + Ethernet96 + 40000 + + + DeviceInterface + + false + 303 + FourHundredGigE0/3/0/12 + false + + Ethernet96 + 400000 + + + DeviceInterface + + false + 304 + HundredGigE0/3/0/13 + false + + Ethernet104 + 100000 + + + DeviceInterface + + false + 305 + FortyGigE0/3/0/13 + false + + Ethernet104 + 40000 + + + DeviceInterface + + false + 306 + FourHundredGigE0/3/0/13 + false + + Ethernet104 + 400000 + + + DeviceInterface + + false + 307 + HundredGigE0/3/0/14 + false + + Ethernet112 + 100000 + + + DeviceInterface + + false + 308 + FortyGigE0/3/0/14 + false + + Ethernet112 + 40000 + + + DeviceInterface + + false + 309 + FourHundredGigE0/3/0/14 + false + + Ethernet112 + 400000 + + + DeviceInterface + + false + 310 + HundredGigE0/3/0/15 + false + + Ethernet120 + 100000 + + + DeviceInterface + + false + 311 + FortyGigE0/3/0/15 + false + + Ethernet120 + 40000 + + + DeviceInterface + + false + 312 + FourHundredGigE0/3/0/15 + false + + Ethernet120 + 400000 + + + DeviceInterface + + false + 313 + HundredGigE0/3/0/16 + false + + Ethernet128 + 100000 + + + DeviceInterface + + false + 314 + FortyGigE0/3/0/16 + false + + Ethernet128 + 40000 + + + DeviceInterface + + false + 315 + FourHundredGigE0/3/0/16 + false + + Ethernet128 + 400000 + + + DeviceInterface + + false + 316 + HundredGigE0/3/0/17 + false + + Ethernet136 + 100000 + + + DeviceInterface + + false + 317 + FortyGigE0/3/0/17 + false + + Ethernet136 + 40000 + + + DeviceInterface + + false + 318 + FourHundredGigE0/3/0/17 + false + + Ethernet136 + 400000 + + + DeviceInterface + + false + 319 + HundredGigE0/3/0/18 + false + + Ethernet144 + 100000 + + + DeviceInterface + + false + 320 + FortyGigE0/3/0/18 + false + + Ethernet144 + 40000 + + + DeviceInterface + + false + 321 + FourHundredGigE0/3/0/18 + false + + Ethernet144 + 400000 + + + DeviceInterface + + false + 322 + HundredGigE0/3/0/19 + false + + Ethernet152 + 100000 + + + DeviceInterface + + false + 323 + FortyGigE0/3/0/19 + false + + Ethernet152 + 40000 + + + DeviceInterface + + false + 324 + FourHundredGigE0/3/0/19 + false + + Ethernet152 + 400000 + + + DeviceInterface + + false + 325 + HundredGigE0/3/0/20 + false + + Ethernet160 + 100000 + + + DeviceInterface + + false + 326 + FortyGigE0/3/0/20 + false + + Ethernet160 + 40000 + + + DeviceInterface + + false + 327 + FourHundredGigE0/3/0/20 + false + + Ethernet160 + 400000 + + + DeviceInterface + + false + 328 + HundredGigE0/3/0/21 + false + + Ethernet168 + 100000 + + + DeviceInterface + + false + 329 + FortyGigE0/3/0/21 + false + + Ethernet168 + 40000 + + + DeviceInterface + + false + 330 + FourHundredGigE0/3/0/21 + false + + Ethernet168 + 400000 + + + DeviceInterface + + false + 331 + HundredGigE0/3/0/22 + false + + Ethernet176 + 100000 + + + DeviceInterface + + false + 332 + FortyGigE0/3/0/22 + false + + Ethernet176 + 40000 + + + DeviceInterface + + false + 333 + FourHundredGigE0/3/0/22 + false + + Ethernet176 + 400000 + + + DeviceInterface + + false + 334 + HundredGigE0/3/0/23 + false + + Ethernet184 + 100000 + + + DeviceInterface + + false + 335 + FortyGigE0/3/0/23 + false + + Ethernet184 + 40000 + + + DeviceInterface + + false + 336 + FourHundredGigE0/3/0/23 + false + + Ethernet184 + 400000 + + + DeviceInterface + + false + 337 + HundredGigE0/3/0/24 + false + + Ethernet192 + 100000 + + + DeviceInterface + + false + 338 + FortyGigE0/3/0/24 + false + + Ethernet192 + 40000 + + + DeviceInterface + + false + 339 + FourHundredGigE0/3/0/24 + false + + Ethernet192 + 400000 + + + DeviceInterface + + false + 340 + HundredGigE0/3/0/25 + false + + Ethernet200 + 100000 + + + DeviceInterface + + false + 341 + FortyGigE0/3/0/25 + false + + Ethernet200 + 40000 + + + DeviceInterface + + false + 342 + FourHundredGigE0/3/0/25 + false + + Ethernet200 + 400000 + + + DeviceInterface + + false + 343 + HundredGigE0/3/0/26 + false + + Ethernet208 + 100000 + + + DeviceInterface + + false + 344 + FortyGigE0/3/0/26 + false + + Ethernet208 + 40000 + + + DeviceInterface + + false + 345 + FourHundredGigE0/3/0/26 + false + + Ethernet208 + 400000 + + + DeviceInterface + + false + 346 + HundredGigE0/3/0/27 + false + + Ethernet216 + 100000 + + + DeviceInterface + + false + 347 + FortyGigE0/3/0/27 + false + + Ethernet216 + 40000 + + + DeviceInterface + + false + 348 + FourHundredGigE0/3/0/27 + false + + Ethernet216 + 400000 + + + DeviceInterface + + false + 349 + HundredGigE0/3/0/28 + false + + Ethernet224 + 100000 + + + DeviceInterface + + false + 350 + FortyGigE0/3/0/28 + false + + Ethernet224 + 40000 + + + DeviceInterface + + false + 351 + FourHundredGigE0/3/0/28 + false + + Ethernet224 + 400000 + + + DeviceInterface + + false + 352 + HundredGigE0/3/0/29 + false + + Ethernet232 + 100000 + + + DeviceInterface + + false + 353 + FortyGigE0/3/0/29 + false + + Ethernet232 + 40000 + + + DeviceInterface + + false + 354 + FourHundredGigE0/3/0/29 + false + + Ethernet232 + 400000 + + + DeviceInterface + + false + 355 + HundredGigE0/3/0/30 + false + + Ethernet240 + 100000 + + + DeviceInterface + + false + 356 + FortyGigE0/3/0/30 + false + + Ethernet240 + 40000 + + + DeviceInterface + + false + 357 + FourHundredGigE0/3/0/30 + false + + Ethernet240 + 400000 + + + DeviceInterface + + false + 358 + HundredGigE0/3/0/31 + false + + Ethernet248 + 100000 + + + DeviceInterface + + false + 359 + FortyGigE0/3/0/31 + false + + Ethernet248 + 40000 + + + DeviceInterface + + false + 360 + FourHundredGigE0/3/0/31 + false + + Ethernet248 + 400000 + + + DeviceInterface + + false + 361 + HundredGigE0/3/0/32 + false + + Ethernet256 + 100000 + + + DeviceInterface + + false + 362 + FortyGigE0/3/0/32 + false + + Ethernet256 + 40000 + + + DeviceInterface + + false + 363 + FourHundredGigE0/3/0/32 + false + + Ethernet256 + 400000 + + + DeviceInterface + + false + 364 + HundredGigE0/3/0/33 + false + + Ethernet264 + 100000 + + + DeviceInterface + + false + 365 + FortyGigE0/3/0/33 + false + + Ethernet264 + 40000 + + + DeviceInterface + + false + 366 + FourHundredGigE0/3/0/33 + false + + Ethernet264 + 400000 + + + DeviceInterface + + false + 367 + HundredGigE0/3/0/34 + false + + Ethernet272 + 100000 + + + DeviceInterface + + false + 368 + FortyGigE0/3/0/34 + false + + Ethernet272 + 40000 + + + DeviceInterface + + false + 369 + FourHundredGigE0/3/0/34 + false + + Ethernet272 + 400000 + + + DeviceInterface + + false + 370 + HundredGigE0/3/0/35 + false + + Ethernet280 + 100000 + + + DeviceInterface + + false + 371 + FortyGigE0/3/0/35 + false + + Ethernet280 + 40000 + + + DeviceInterface + + false + 372 + FourHundredGigE0/3/0/35 + false + + Ethernet280 + 400000 + + + DeviceInterface + + false + 373 + FourHundredGigE0/4/0/0 + false + + Ethernet0 + 400000 + + + DeviceInterface + + false + 374 + HundredGigE0/4/0/0 + false + + Ethernet0 + 100000 + + + DeviceInterface + + false + 375 + FourHundredGigE0/4/0/1 + false + + Ethernet8 + 400000 + + + DeviceInterface + + false + 376 + HundredGigE0/4/0/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + + false + 377 + FourHundredGigE0/4/0/2 + false + + Ethernet16 + 400000 + + + DeviceInterface + + false + 378 + HundredGigE0/4/0/2 + false + + Ethernet16 + 100000 + + + DeviceInterface + + false + 379 + FourHundredGigE0/4/0/3 + false + + Ethernet24 + 400000 + + + DeviceInterface + + false + 380 + HundredGigE0/4/0/3 + false + + Ethernet24 + 100000 + + + DeviceInterface + + false + 381 + FourHundredGigE0/4/0/4 + false + + Ethernet32 + 400000 + + + DeviceInterface + + false + 382 + HundredGigE0/4/0/4 + false + + Ethernet32 + 100000 + + + DeviceInterface + + false + 383 + FourHundredGigE0/4/0/5 + false + + Ethernet40 + 400000 + + + DeviceInterface + + false + 384 + HundredGigE0/4/0/5 + false + + Ethernet40 + 100000 + + + DeviceInterface + + false + 385 + FourHundredGigE0/4/0/6 + false + + Ethernet48 + 400000 + + + DeviceInterface + + false + 386 + HundredGigE0/4/0/6 + false + + Ethernet48 + 100000 + + + DeviceInterface + + false + 387 + FourHundredGigE0/4/0/7 + false + + Ethernet56 + 400000 + + + DeviceInterface + + false + 388 + HundredGigE0/4/0/7 + false + + Ethernet56 + 100000 + + + DeviceInterface + + false + 389 + FourHundredGigE0/4/0/8 + false + + Ethernet64 + 400000 + + + DeviceInterface + + false + 390 + HundredGigE0/4/0/8 + false + + Ethernet64 + 100000 + + + DeviceInterface + + false + 391 + FourHundredGigE0/4/0/9 + false + + Ethernet72 + 400000 + + + DeviceInterface + + false + 392 + HundredGigE0/4/0/9 + false + + Ethernet72 + 100000 + + + DeviceInterface + + false + 393 + FourHundredGigE0/4/0/10 + false + + Ethernet80 + 400000 + + + DeviceInterface + + false + 394 + HundredGigE0/4/0/10 + false + + Ethernet80 + 100000 + + + DeviceInterface + + false + 395 + FourHundredGigE0/4/0/11 + false + + Ethernet88 + 400000 + + + DeviceInterface + + false + 396 + HundredGigE0/4/0/11 + false + + Ethernet88 + 100000 + + + DeviceInterface + + false + 397 + FourHundredGigE0/4/0/12 + false + + Ethernet96 + 400000 + + + DeviceInterface + + false + 398 + HundredGigE0/4/0/12 + false + + Ethernet96 + 100000 + + + DeviceInterface + + false + 399 + FourHundredGigE0/4/0/13 + false + + Ethernet104 + 400000 + + + DeviceInterface + + false + 400 + HundredGigE0/4/0/13 + false + + Ethernet104 + 100000 + + + DeviceInterface + + false + 401 + FourHundredGigE0/4/0/14 + false + + Ethernet112 + 400000 + + + DeviceInterface + + false + 402 + HundredGigE0/4/0/14 + false + + Ethernet112 + 100000 + + + DeviceInterface + + false + 403 + FourHundredGigE0/4/0/15 + false + + Ethernet120 + 400000 + + + DeviceInterface + + false + 404 + HundredGigE0/4/0/15 + false + + Ethernet120 + 100000 + + + DeviceInterface + + false + 405 + FourHundredGigE0/4/0/16 + false + + Ethernet128 + 400000 + + + DeviceInterface + + false + 406 + HundredGigE0/4/0/16 + false + + Ethernet128 + 100000 + + + DeviceInterface + + false + 407 + FourHundredGigE0/4/0/17 + false + + Ethernet136 + 400000 + + + DeviceInterface + + false + 408 + HundredGigE0/4/0/17 + false + + Ethernet136 + 100000 + + + DeviceInterface + + false + 409 + FourHundredGigE0/4/0/18 + false + + Ethernet144 + 400000 + + + DeviceInterface + + false + 410 + HundredGigE0/4/0/18 + false + + Ethernet144 + 100000 + + + DeviceInterface + + false + 411 + FourHundredGigE0/4/0/19 + false + + Ethernet152 + 400000 + + + DeviceInterface + + false + 412 + HundredGigE0/4/0/19 + false + + Ethernet152 + 100000 + + + DeviceInterface + + false + 413 + FourHundredGigE0/4/0/20 + false + + Ethernet160 + 400000 + + + DeviceInterface + + false + 414 + HundredGigE0/4/0/20 + false + + Ethernet160 + 100000 + + + DeviceInterface + + false + 415 + FourHundredGigE0/4/0/21 + false + + Ethernet168 + 400000 + + + DeviceInterface + + false + 416 + HundredGigE0/4/0/21 + false + + Ethernet168 + 100000 + + + DeviceInterface + + false + 417 + FourHundredGigE0/4/0/22 + false + + Ethernet176 + 400000 + + + DeviceInterface + + false + 418 + HundredGigE0/4/0/22 + false + + Ethernet176 + 100000 + + + DeviceInterface + + false + 419 + FourHundredGigE0/4/0/23 + false + + Ethernet184 + 400000 + + + DeviceInterface + + false + 420 + HundredGigE0/4/0/23 + false + + Ethernet184 + 100000 + + + DeviceInterface + + false + 421 + FourHundredGigE0/4/0/24 + false + + Ethernet192 + 400000 + + + DeviceInterface + + false + 422 + HundredGigE0/4/0/24 + false + + Ethernet192 + 100000 + + + DeviceInterface + + false + 423 + FourHundredGigE0/4/0/25 + false + + Ethernet200 + 400000 + + + DeviceInterface + + false + 424 + HundredGigE0/4/0/25 + false + + Ethernet200 + 100000 + + + DeviceInterface + + false + 425 + FourHundredGigE0/4/0/26 + false + + Ethernet208 + 400000 + + + DeviceInterface + + false + 426 + HundredGigE0/4/0/26 + false + + Ethernet208 + 100000 + + + DeviceInterface + + false + 427 + FourHundredGigE0/4/0/27 + false + + Ethernet216 + 400000 + + + DeviceInterface + + false + 428 + HundredGigE0/4/0/27 + false + + Ethernet216 + 100000 + + + DeviceInterface + + false + 429 + FourHundredGigE0/4/0/28 + false + + Ethernet224 + 400000 + + + DeviceInterface + + false + 430 + HundredGigE0/4/0/28 + false + + Ethernet224 + 100000 + + + DeviceInterface + + false + 431 + FourHundredGigE0/4/0/29 + false + + Ethernet232 + 400000 + + + DeviceInterface + + false + 432 + HundredGigE0/4/0/29 + false + + Ethernet232 + 100000 + + + DeviceInterface + + false + 433 + FourHundredGigE0/4/0/30 + false + + Ethernet240 + 400000 + + + DeviceInterface + + false + 434 + HundredGigE0/4/0/30 + false + + Ethernet240 + 100000 + + + DeviceInterface + + false + 435 + FourHundredGigE0/4/0/31 + false + + Ethernet248 + 400000 + + + DeviceInterface + + false + 436 + HundredGigE0/4/0/31 + false + + Ethernet248 + 100000 + + + DeviceInterface + + false + 437 + FourHundredGigE0/4/0/32 + false + + Ethernet256 + 400000 + + + DeviceInterface + + false + 438 + HundredGigE0/4/0/32 + false + + Ethernet256 + 100000 + + + DeviceInterface + + false + 439 + FourHundredGigE0/4/0/33 + false + + Ethernet264 + 400000 + + + DeviceInterface + + false + 440 + HundredGigE0/4/0/33 + false + + Ethernet264 + 100000 + + + DeviceInterface + + false + 441 + FourHundredGigE0/4/0/34 + false + + Ethernet272 + 400000 + + + DeviceInterface + + false + 442 + HundredGigE0/4/0/34 + false + + Ethernet272 + 100000 + + + DeviceInterface + + false + 443 + FourHundredGigE0/4/0/35 + false + + Ethernet280 + 400000 + + + DeviceInterface + + false + 444 + HundredGigE0/4/0/35 + false + + Ethernet280 + 100000 + + + false + 0 + Sonic-packet-chassis-sku + + + + FourHundredGigE0/0/0/0 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:0:0:0 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + HundredGigE0/0/0/0 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:0:0:0 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/1 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:0:0:1 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + HundredGigE0/0/0/1 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:0:0:1 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/2 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:0:0:2 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + HundredGigE0/0/0/2 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:0:0:2 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/3 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:0:0:3 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + HundredGigE0/0/0/3 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:0:0:3 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/4 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:0:0:4 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + HundredGigE0/0/0/4 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:0:0:4 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/5 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:0:0:5 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + HundredGigE0/0/0/5 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:0:0:5 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/6 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:0:0:6 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + HundredGigE0/0/0/6 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:0:0:6 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/7 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:0:0:7 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + HundredGigE0/0/0/7 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:0:0:7 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/8 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:0:0:8 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + HundredGigE0/0/0/8 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:0:0:8 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/9 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:0:0:9 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + HundredGigE0/0/0/9 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:0:0:9 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/10 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:0:0:10 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + HundredGigE0/0/0/10 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:0:0:10 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/11 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:0:0:11 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + HundredGigE0/0/0/11 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:0:0:11 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + FourHundredGigE0/0/0/12 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:0:0:12 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + HundredGigE0/0/0/12 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:0:0:12 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/13 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:0:0:13 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + HundredGigE0/0/0/13 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:0:0:13 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/14 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:0:0:14 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + HundredGigE0/0/0/14 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:0:0:14 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/15 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:0:0:15 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + HundredGigE0/0/0/15 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:0:0:15 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/16 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:0:0:16 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + HundredGigE0/0/0/16 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:0:0:16 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/17 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:0:0:17 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + HundredGigE0/0/0/17 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:0:0:17 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/18 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:0:0:18 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + HundredGigE0/0/0/18 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:0:0:18 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/19 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:0:0:19 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + HundredGigE0/0/0/19 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:0:0:19 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/20 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:0:0:20 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + HundredGigE0/0/0/20 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:0:0:20 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/21 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:0:0:21 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + HundredGigE0/0/0/21 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:0:0:21 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/22 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:0:0:22 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + HundredGigE0/0/0/22 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:0:0:22 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/23 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:0:0:23 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + HundredGigE0/0/0/23 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:0:0:23 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + FourHundredGigE0/0/0/24 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:0:0:24 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 1 + + + CoreId + 2 + + + + + HundredGigE0/0/0/24 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:0:0:24 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 1 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/25 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:0:0:25 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 2 + + + CoreId + 2 + + + + + HundredGigE0/0/0/25 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:0:0:25 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 2 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/26 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:0:0:26 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 3 + + + CoreId + 2 + + + + + HundredGigE0/0/0/26 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:0:0:26 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 3 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/27 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:0:0:27 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 4 + + + CoreId + 2 + + + + + HundredGigE0/0/0/27 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:0:0:27 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 4 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/28 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:0:0:28 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 5 + + + CoreId + 2 + + + + + HundredGigE0/0/0/28 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:0:0:28 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 5 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/29 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:0:0:29 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 6 + + + CoreId + 2 + + + + + HundredGigE0/0/0/29 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:0:0:29 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 6 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/30 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:0:0:30 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 7 + + + CoreId + 2 + + + + + HundredGigE0/0/0/30 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:0:0:30 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 7 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/31 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:0:0:31 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 8 + + + CoreId + 2 + + + + + HundredGigE0/0/0/31 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:0:0:31 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 8 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/32 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:0:0:32 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 9 + + + CoreId + 2 + + + + + HundredGigE0/0/0/32 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:0:0:32 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 9 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/33 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:0:0:33 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 10 + + + CoreId + 2 + + + + + HundredGigE0/0/0/33 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:0:0:33 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 10 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/34 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:0:0:34 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 11 + + + CoreId + 2 + + + + + HundredGigE0/0/0/34 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:0:0:34 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 11 + + + CoreId + 2 + + + + + FourHundredGigE0/0/0/35 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:0:0:35 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 12 + + + CoreId + 2 + + + + + HundredGigE0/0/0/35 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 0 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:0:0:35 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicInterfaceIndex + 12 + + + CoreId + 2 + + + + + HundredGigE0/1/0/0 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:1:0:0 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + FortyGigE0/1/0/0 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:1:0:0 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + HundredGigE0/1/0/1 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:1:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + FortyGigE0/1/0/1 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:1:0:1 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + HundredGigE0/1/0/2 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:1:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + FortyGigE0/1/0/2 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:1:0:2 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + HundredGigE0/1/0/3 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:1:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + FortyGigE0/1/0/3 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:1:0:3 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + HundredGigE0/1/0/4 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:1:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + FortyGigE0/1/0/4 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:1:0:4 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + HundredGigE0/1/0/5 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:1:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + FortyGigE0/1/0/5 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:1:0:5 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + HundredGigE0/1/0/6 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:1:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + FortyGigE0/1/0/6 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:1:0:6 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + HundredGigE0/1/0/7 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:1:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + FortyGigE0/1/0/7 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:1:0:7 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + HundredGigE0/1/0/8 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:1:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + FortyGigE0/1/0/8 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:1:0:8 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + HundredGigE0/1/0/9 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:1:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + FortyGigE0/1/0/9 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:1:0:9 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + HundredGigE0/1/0/10 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:1:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + FortyGigE0/1/0/10 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:1:0:10 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + HundredGigE0/1/0/11 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:1:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + FortyGigE0/1/0/11 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:1:0:11 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + HundredGigE0/1/0/12 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:1:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + FortyGigE0/1/0/12 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:1:0:12 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + HundredGigE0/1/0/13 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:1:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + FortyGigE0/1/0/13 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:1:0:13 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + HundredGigE0/1/0/14 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:1:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + FortyGigE0/1/0/14 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:1:0:14 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + HundredGigE0/1/0/15 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:1:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + FortyGigE0/1/0/15 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:1:0:15 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + HundredGigE0/1/0/16 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:1:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + FortyGigE0/1/0/16 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:1:0:16 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + HundredGigE0/1/0/17 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:1:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + FortyGigE0/1/0/17 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:1:0:17 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + HundredGigE0/1/0/18 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:1:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + FortyGigE0/1/0/18 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:1:0:18 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + HundredGigE0/1/0/19 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:1:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + FortyGigE0/1/0/19 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:1:0:19 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + HundredGigE0/1/0/20 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:1:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + FortyGigE0/1/0/20 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:1:0:20 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + HundredGigE0/1/0/21 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:1:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + FortyGigE0/1/0/21 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:1:0:21 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + HundredGigE0/1/0/22 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:1:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + FortyGigE0/1/0/22 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:1:0:22 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + HundredGigE0/1/0/23 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:1:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + FortyGigE0/1/0/23 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:1:0:23 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + HundredGigE0/1/0/24 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:1:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + FortyGigE0/1/0/24 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:1:0:24 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + HundredGigE0/1/0/25 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:1:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + FortyGigE0/1/0/25 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:1:0:25 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + HundredGigE0/1/0/26 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:1:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + FortyGigE0/1/0/26 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:1:0:26 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + HundredGigE0/1/0/27 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:1:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + FortyGigE0/1/0/27 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:1:0:27 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + HundredGigE0/1/0/28 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:1:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + FortyGigE0/1/0/28 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:1:0:28 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + HundredGigE0/1/0/29 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:1:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + FortyGigE0/1/0/29 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:1:0:29 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + HundredGigE0/1/0/30 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:1:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + FortyGigE0/1/0/30 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:1:0:30 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + HundredGigE0/1/0/31 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:1:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 13 + + + CoreId + 1 + + + + + FortyGigE0/1/0/31 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:1:0:31 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 13 + + + CoreId + 1 + + + + + HundredGigE0/1/0/32 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:1:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 14 + + + CoreId + 1 + + + + + FortyGigE0/1/0/32 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:1:0:32 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 14 + + + CoreId + 1 + + + + + HundredGigE0/1/0/33 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:1:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + FortyGigE0/1/0/33 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:1:0:33 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + HundredGigE0/1/0/34 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:1:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 15 + + + CoreId + 1 + + + + + FortyGigE0/1/0/34 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:1:0:34 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 15 + + + CoreId + 1 + + + + + HundredGigE0/1/0/35 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:1:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 16 + + + CoreId + 1 + + + + + FortyGigE0/1/0/35 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:1:0:35 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 16 + + + CoreId + 1 + + + + + HundredGigE0/1/0/36 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:1:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + FortyGigE0/1/0/36 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:1:0:36 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + HundredGigE0/1/0/37 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:1:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 17 + + + CoreId + 1 + + + + + FortyGigE0/1/0/37 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:1:0:37 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 17 + + + CoreId + 1 + + + + + HundredGigE0/1/0/38 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:1:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 18 + + + CoreId + 1 + + + + + FortyGigE0/1/0/38 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:1:0:38 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 18 + + + CoreId + 1 + + + + + HundredGigE0/1/0/39 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:1:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + FortyGigE0/1/0/39 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:1:0:39 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + HundredGigE0/1/0/40 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:1:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 19 + + + CoreId + 1 + + + + + FortyGigE0/1/0/40 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:1:0:40 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 19 + + + CoreId + 1 + + + + + HundredGigE0/1/0/41 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:1:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 20 + + + CoreId + 1 + + + + + FortyGigE0/1/0/41 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:1:0:41 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 20 + + + CoreId + 1 + + + + + HundredGigE0/1/0/42 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:1:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + FortyGigE0/1/0/42 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:1:0:42 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + HundredGigE0/1/0/43 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:1:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 21 + + + CoreId + 1 + + + + + FortyGigE0/1/0/43 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:1:0:43 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 21 + + + CoreId + 1 + + + + + HundredGigE0/1/0/44 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:1:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 22 + + + CoreId + 1 + + + + + FortyGigE0/1/0/44 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:1:0:44 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 22 + + + CoreId + 1 + + + + + HundredGigE0/1/0/45 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:1:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + FortyGigE0/1/0/45 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:1:0:45 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 0 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + HundredGigE0/1/0/46 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:1:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 23 + + + CoreId + 1 + + + + + FortyGigE0/1/0/46 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:1:0:46 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 23 + + + CoreId + 1 + + + + + HundredGigE0/1/0/47 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:1:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 24 + + + CoreId + 1 + + + + + FortyGigE0/1/0/47 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 1 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:1:0:47 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 1 + + + AsicInterfaceIndex + 24 + + + CoreId + 1 + + + + + HundredGigE0/2/0/0 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:2:0:0 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + FortyGigE0/2/0/0 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:2:0:0 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + HundredGigE0/2/0/1 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:2:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + FortyGigE0/2/0/1 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:2:0:1 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + HundredGigE0/2/0/2 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:2:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + FortyGigE0/2/0/2 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:2:0:2 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + HundredGigE0/2/0/3 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:2:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + FortyGigE0/2/0/3 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:2:0:3 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + HundredGigE0/2/0/4 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:2:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + FortyGigE0/2/0/4 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:2:0:4 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + HundredGigE0/2/0/5 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:2:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + FortyGigE0/2/0/5 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:2:0:5 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + HundredGigE0/2/0/6 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:2:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + FortyGigE0/2/0/6 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:2:0:6 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + HundredGigE0/2/0/7 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:2:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + FortyGigE0/2/0/7 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:2:0:7 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + HundredGigE0/2/0/8 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:2:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + FortyGigE0/2/0/8 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:2:0:8 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + HundredGigE0/2/0/9 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:2:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + FortyGigE0/2/0/9 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:2:0:9 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + HundredGigE0/2/0/10 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:2:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + FortyGigE0/2/0/10 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:2:0:10 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + HundredGigE0/2/0/11 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:2:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + FortyGigE0/2/0/11 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:2:0:11 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + HundredGigE0/2/0/12 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:2:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + FortyGigE0/2/0/12 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:2:0:12 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + HundredGigE0/2/0/13 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:2:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + FortyGigE0/2/0/13 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:2:0:13 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + HundredGigE0/2/0/14 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:2:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + FortyGigE0/2/0/14 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:2:0:14 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + HundredGigE0/2/0/15 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:2:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + FortyGigE0/2/0/15 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:2:0:15 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + HundredGigE0/2/0/16 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:2:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + FortyGigE0/2/0/16 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:2:0:16 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + HundredGigE0/2/0/17 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:2:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + FortyGigE0/2/0/17 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:2:0:17 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + HundredGigE0/2/0/18 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:2:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + FortyGigE0/2/0/18 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:2:0:18 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + HundredGigE0/2/0/19 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:2:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + FortyGigE0/2/0/19 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:2:0:19 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + HundredGigE0/2/0/20 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:2:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + FortyGigE0/2/0/20 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:2:0:20 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + HundredGigE0/2/0/21 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:2:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + FortyGigE0/2/0/21 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:2:0:21 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + HundredGigE0/2/0/22 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:2:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + FortyGigE0/2/0/22 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:2:0:22 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + HundredGigE0/2/0/23 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:2:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + FortyGigE0/2/0/23 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:2:0:23 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + HundredGigE0/2/0/24 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:2:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + FortyGigE0/2/0/24 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:2:0:24 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + HundredGigE0/2/0/25 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:2:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + FortyGigE0/2/0/25 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:2:0:25 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + HundredGigE0/2/0/26 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:2:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + FortyGigE0/2/0/26 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:2:0:26 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + HundredGigE0/2/0/27 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:2:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + FortyGigE0/2/0/27 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:2:0:27 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + HundredGigE0/2/0/28 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:2:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + FortyGigE0/2/0/28 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:2:0:28 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + HundredGigE0/2/0/29 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:2:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + FortyGigE0/2/0/29 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:2:0:29 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + HundredGigE0/2/0/30 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:2:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + FortyGigE0/2/0/30 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:2:0:30 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + HundredGigE0/2/0/31 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:2:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 13 + + + CoreId + 1 + + + + + FortyGigE0/2/0/31 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:2:0:31 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 13 + + + CoreId + 1 + + + + + HundredGigE0/2/0/32 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:2:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 14 + + + CoreId + 1 + + + + + FortyGigE0/2/0/32 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:2:0:32 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 14 + + + CoreId + 1 + + + + + HundredGigE0/2/0/33 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:2:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + FortyGigE0/2/0/33 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:2:0:33 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + HundredGigE0/2/0/34 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:2:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 15 + + + CoreId + 1 + + + + + FortyGigE0/2/0/34 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:2:0:34 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 15 + + + CoreId + 1 + + + + + HundredGigE0/2/0/35 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:2:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 16 + + + CoreId + 1 + + + + + FortyGigE0/2/0/35 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:2:0:35 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 16 + + + CoreId + 1 + + + + + HundredGigE0/2/0/36 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:2:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + FortyGigE0/2/0/36 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:2:0:36 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + HundredGigE0/2/0/37 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:2:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 17 + + + CoreId + 1 + + + + + FortyGigE0/2/0/37 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:2:0:37 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 17 + + + CoreId + 1 + + + + + HundredGigE0/2/0/38 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:2:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 18 + + + CoreId + 1 + + + + + FortyGigE0/2/0/38 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:2:0:38 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 18 + + + CoreId + 1 + + + + + HundredGigE0/2/0/39 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:2:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + FortyGigE0/2/0/39 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:2:0:39 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + HundredGigE0/2/0/40 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:2:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 19 + + + CoreId + 1 + + + + + FortyGigE0/2/0/40 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:2:0:40 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 19 + + + CoreId + 1 + + + + + HundredGigE0/2/0/41 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:2:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 20 + + + CoreId + 1 + + + + + FortyGigE0/2/0/41 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:2:0:41 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 20 + + + CoreId + 1 + + + + + HundredGigE0/2/0/42 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:2:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + FortyGigE0/2/0/42 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:2:0:42 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + HundredGigE0/2/0/43 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:2:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 21 + + + CoreId + 1 + + + + + FortyGigE0/2/0/43 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:2:0:43 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 21 + + + CoreId + 1 + + + + + HundredGigE0/2/0/44 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:2:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 22 + + + CoreId + 1 + + + + + FortyGigE0/2/0/44 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:2:0:44 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 22 + + + CoreId + 1 + + + + + HundredGigE0/2/0/45 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:2:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + FortyGigE0/2/0/45 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:2:0:45 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 4 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + HundredGigE0/2/0/46 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:2:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 23 + + + CoreId + 1 + + + + + FortyGigE0/2/0/46 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:2:0:46 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 23 + + + CoreId + 1 + + + + + HundredGigE0/2/0/47 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:2:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 24 + + + CoreId + 1 + + + + + FortyGigE0/2/0/47 + + + LineCardSku + sonic-100g-lc-sku + + + SlotIndex + 2 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:2:0:47 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 5 + + + AsicInterfaceIndex + 24 + + + CoreId + 1 + + + + + HundredGigE0/3/0/0 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:3:0:0 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + FortyGigE0/3/0/0 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:3:0:0 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/0 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:3:0:0 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + HundredGigE0/3/0/1 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:3:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + FortyGigE0/3/0/1 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:3:0:1 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/1 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:3:0:1 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + HundredGigE0/3/0/2 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:3:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + FortyGigE0/3/0/2 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:3:0:2 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/2 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:3:0:2 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + HundredGigE0/3/0/3 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:3:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + FortyGigE0/3/0/3 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:3:0:3 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/3 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:3:0:3 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + HundredGigE0/3/0/4 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:3:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + FortyGigE0/3/0/4 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:3:0:4 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/4 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:3:0:4 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + HundredGigE0/3/0/5 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:3:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + FortyGigE0/3/0/5 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:3:0:5 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/5 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:3:0:5 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + HundredGigE0/3/0/6 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:3:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + FortyGigE0/3/0/6 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:3:0:6 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/6 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:3:0:6 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + HundredGigE0/3/0/7 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:3:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + FortyGigE0/3/0/7 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:3:0:7 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/7 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:3:0:7 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + HundredGigE0/3/0/8 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:3:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + FortyGigE0/3/0/8 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:3:0:8 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/8 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:3:0:8 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + HundredGigE0/3/0/9 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:3:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + FortyGigE0/3/0/9 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:3:0:9 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/9 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:3:0:9 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + HundredGigE0/3/0/10 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:3:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + FortyGigE0/3/0/10 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:3:0:10 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/10 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:3:0:10 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + HundredGigE0/3/0/11 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:3:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + FortyGigE0/3/0/11 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:3:0:11 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + FourHundredGigE0/3/0/11 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:3:0:11 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + HundredGigE0/3/0/12 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:3:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + FortyGigE0/3/0/12 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:3:0:12 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/12 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:3:0:12 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + HundredGigE0/3/0/13 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:3:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + FortyGigE0/3/0/13 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:3:0:13 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/13 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:3:0:13 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + HundredGigE0/3/0/14 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:3:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + FortyGigE0/3/0/14 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:3:0:14 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/14 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:3:0:14 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + HundredGigE0/3/0/15 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:3:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + FortyGigE0/3/0/15 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:3:0:15 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/15 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:3:0:15 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + HundredGigE0/3/0/16 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:3:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + FortyGigE0/3/0/16 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:3:0:16 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/16 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:3:0:16 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + HundredGigE0/3/0/17 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:3:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + FortyGigE0/3/0/17 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:3:0:17 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/17 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:3:0:17 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + HundredGigE0/3/0/18 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:3:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + FortyGigE0/3/0/18 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:3:0:18 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/18 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:3:0:18 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + HundredGigE0/3/0/19 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:3:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + FortyGigE0/3/0/19 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:3:0:19 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/19 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:3:0:19 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + HundredGigE0/3/0/20 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:3:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + FortyGigE0/3/0/20 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:3:0:20 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/20 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:3:0:20 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + HundredGigE0/3/0/21 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:3:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + FortyGigE0/3/0/21 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:3:0:21 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/21 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:3:0:21 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + HundredGigE0/3/0/22 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:3:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + FortyGigE0/3/0/22 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:3:0:22 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/22 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:3:0:22 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + HundredGigE0/3/0/23 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:3:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + FortyGigE0/3/0/23 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:3:0:23 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + FourHundredGigE0/3/0/23 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:3:0:23 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + HundredGigE0/3/0/24 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:3:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 1 + + + CoreId + 2 + + + + + FortyGigE0/3/0/24 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:3:0:24 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 1 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/24 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:3:0:24 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 1 + + + CoreId + 2 + + + + + HundredGigE0/3/0/25 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:3:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 2 + + + CoreId + 2 + + + + + FortyGigE0/3/0/25 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:3:0:25 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 2 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/25 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:3:0:25 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 2 + + + CoreId + 2 + + + + + HundredGigE0/3/0/26 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:3:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 3 + + + CoreId + 2 + + + + + FortyGigE0/3/0/26 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:3:0:26 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 3 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/26 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:3:0:26 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 3 + + + CoreId + 2 + + + + + HundredGigE0/3/0/27 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:3:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 4 + + + CoreId + 2 + + + + + FortyGigE0/3/0/27 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:3:0:27 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 4 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/27 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:3:0:27 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 4 + + + CoreId + 2 + + + + + HundredGigE0/3/0/28 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:3:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 5 + + + CoreId + 2 + + + + + FortyGigE0/3/0/28 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:3:0:28 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 5 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/28 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:3:0:28 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 5 + + + CoreId + 2 + + + + + HundredGigE0/3/0/29 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:3:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 6 + + + CoreId + 2 + + + + + FortyGigE0/3/0/29 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:3:0:29 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 6 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/29 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:3:0:29 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 6 + + + CoreId + 2 + + + + + HundredGigE0/3/0/30 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:3:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 7 + + + CoreId + 2 + + + + + FortyGigE0/3/0/30 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:3:0:30 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 7 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/30 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:3:0:30 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 7 + + + CoreId + 2 + + + + + HundredGigE0/3/0/31 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:3:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 8 + + + CoreId + 2 + + + + + FortyGigE0/3/0/31 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:3:0:31 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 8 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/31 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:3:0:31 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 8 + + + CoreId + 2 + + + + + HundredGigE0/3/0/32 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:3:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 9 + + + CoreId + 2 + + + + + FortyGigE0/3/0/32 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:3:0:32 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 9 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/32 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:3:0:32 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 9 + + + CoreId + 2 + + + + + HundredGigE0/3/0/33 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:3:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 10 + + + CoreId + 2 + + + + + FortyGigE0/3/0/33 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:3:0:33 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 10 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/33 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:3:0:33 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 10 + + + CoreId + 2 + + + + + HundredGigE0/3/0/34 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:3:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 11 + + + CoreId + 2 + + + + + FortyGigE0/3/0/34 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:3:0:34 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 11 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/34 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:3:0:34 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 11 + + + CoreId + 2 + + + + + HundredGigE0/3/0/35 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:3:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 12 + + + CoreId + 2 + + + + + FortyGigE0/3/0/35 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:3:0:35 + + + InterfaceSubGroupIndex + 2 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 12 + + + CoreId + 2 + + + + + FourHundredGigE0/3/0/35 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:3:0:35 + + + InterfaceSubGroupIndex + 3 + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 10 + + + AsicInterfaceIndex + 12 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/0 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:4:0:0 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + HundredGigE0/4/0/0 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 0 + + + InterfaceGroupIndex + 0:4:0:0 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/1 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:4:0:1 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + HundredGigE0/4/0/1 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:4:0:1 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/2 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:4:0:2 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + HundredGigE0/4/0/2 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:4:0:2 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/3 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:4:0:3 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + HundredGigE0/4/0/3 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:4:0:3 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/4 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:4:0:4 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + HundredGigE0/4/0/4 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:4:0:4 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/5 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:4:0:5 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + HundredGigE0/4/0/5 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:4:0:5 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/6 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:4:0:6 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + HundredGigE0/4/0/6 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:4:0:6 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/7 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:4:0:7 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + HundredGigE0/4/0/7 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:4:0:7 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/8 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:4:0:8 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + HundredGigE0/4/0/8 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:4:0:8 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/9 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:4:0:9 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + HundredGigE0/4/0/9 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:4:0:9 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/10 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:4:0:10 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + HundredGigE0/4/0/10 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:4:0:10 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/11 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:4:0:11 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + HundredGigE0/4/0/11 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:4:0:11 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + FourHundredGigE0/4/0/12 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:4:0:12 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + HundredGigE0/4/0/12 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:4:0:12 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/13 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:4:0:13 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + HundredGigE0/4/0/13 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:4:0:13 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/14 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:4:0:14 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + HundredGigE0/4/0/14 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:4:0:14 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/15 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:4:0:15 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + HundredGigE0/4/0/15 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:4:0:15 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/16 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:4:0:16 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + HundredGigE0/4/0/16 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:4:0:16 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/17 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:4:0:17 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + HundredGigE0/4/0/17 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:4:0:17 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/18 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:4:0:18 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + HundredGigE0/4/0/18 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:4:0:18 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/19 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:4:0:19 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + HundredGigE0/4/0/19 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:4:0:19 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/20 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:4:0:20 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + HundredGigE0/4/0/20 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:4:0:20 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/21 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:4:0:21 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + HundredGigE0/4/0/21 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:4:0:21 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 10 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/22 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:4:0:22 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + HundredGigE0/4/0/22 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:4:0:22 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 11 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/23 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:4:0:23 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + HundredGigE0/4/0/23 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:4:0:23 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 13 + + + AsicInterfaceIndex + 12 + + + CoreId + 1 + + + + + FourHundredGigE0/4/0/24 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:4:0:24 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 1 + + + CoreId + 2 + + + + + HundredGigE0/4/0/24 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:4:0:24 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 1 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/25 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:4:0:25 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 2 + + + CoreId + 2 + + + + + HundredGigE0/4/0/25 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:4:0:25 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 2 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/26 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:4:0:26 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 3 + + + CoreId + 2 + + + + + HundredGigE0/4/0/26 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:4:0:26 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 3 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/27 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:4:0:27 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 4 + + + CoreId + 2 + + + + + HundredGigE0/4/0/27 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:4:0:27 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 4 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/28 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:4:0:28 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 5 + + + CoreId + 2 + + + + + HundredGigE0/4/0/28 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:4:0:28 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 5 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/29 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:4:0:29 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 6 + + + CoreId + 2 + + + + + HundredGigE0/4/0/29 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:4:0:29 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 6 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/30 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:4:0:30 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 7 + + + CoreId + 2 + + + + + HundredGigE0/4/0/30 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:4:0:30 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 7 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/31 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:4:0:31 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 8 + + + CoreId + 2 + + + + + HundredGigE0/4/0/31 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:4:0:31 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 8 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/32 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:4:0:32 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 9 + + + CoreId + 2 + + + + + HundredGigE0/4/0/32 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:4:0:32 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 9 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/33 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:4:0:33 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 10 + + + CoreId + 2 + + + + + HundredGigE0/4/0/33 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:4:0:33 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 10 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/34 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:4:0:34 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 11 + + + CoreId + 2 + + + + + HundredGigE0/4/0/34 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:4:0:34 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 11 + + + CoreId + 2 + + + + + FourHundredGigE0/4/0/35 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:4:0:35 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 12 + + + CoreId + 2 + + + + + HundredGigE0/4/0/35 + + + LineCardSku + sonic-400g-lc-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:4:0:35 + + + InterfaceSubGroupIndex + 2 + + + MacSecEnabled + True + + + ProviderChipName + ASIC2 + + + AsicSwitchId + 14 + + + AsicInterfaceIndex + 12 + + + CoreId + 2 + + + + + + + DeviceInterface + + false + 1 + MgmtEth0/RP0/CPU0/0 + false + + + 1000 + + + + + DeviceInterface + + false + 1 + FourHundredGigE0/0/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 2 + FourHundredGigE0/0/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 3 + FourHundredGigE0/0/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 4 + HundredGigE0/0/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 5 + HundredGigE0/0/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 6 + HundredGigE0/0/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 7 + FourHundredGigE0/0/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 8 + FourHundredGigE0/0/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 9 + FourHundredGigE0/0/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 10 + HundredGigE0/0/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 11 + HundredGigE0/0/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 12 + HundredGigE0/0/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 13 + FourHundredGigE0/0/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 14 + FourHundredGigE0/0/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 15 + FourHundredGigE0/0/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 16 + HundredGigE0/0/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 17 + HundredGigE0/0/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 18 + HundredGigE0/0/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 19 + FourHundredGigE0/0/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 20 + FourHundredGigE0/0/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 21 + FourHundredGigE0/0/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 22 + HundredGigE0/0/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 23 + HundredGigE0/0/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 24 + HundredGigE0/0/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 25 + FourHundredGigE0/0/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 26 + FourHundredGigE0/0/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 27 + FourHundredGigE0/0/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 28 + HundredGigE0/0/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 29 + HundredGigE0/0/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 30 + HundredGigE0/0/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 31 + FourHundredGigE0/0/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 32 + FourHundredGigE0/0/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 33 + FourHundredGigE0/0/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 34 + HundredGigE0/0/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 35 + HundredGigE0/0/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 36 + HundredGigE0/0/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 37 + FourHundredGigE0/0/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 38 + FourHundredGigE0/0/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 39 + FourHundredGigE0/0/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 40 + HundredGigE0/0/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 41 + HundredGigE0/0/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 42 + HundredGigE0/0/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 43 + FourHundredGigE0/0/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 44 + FourHundredGigE0/0/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 45 + FourHundredGigE0/0/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 46 + HundredGigE0/0/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 47 + HundredGigE0/0/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 48 + HundredGigE0/0/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 49 + FourHundredGigE0/0/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 50 + FourHundredGigE0/0/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 51 + FourHundredGigE0/0/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 52 + HundredGigE0/0/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 53 + HundredGigE0/0/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 54 + HundredGigE0/0/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 55 + FourHundredGigE0/0/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 56 + FourHundredGigE0/0/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 57 + FourHundredGigE0/0/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 58 + HundredGigE0/0/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 59 + HundredGigE0/0/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 60 + HundredGigE0/0/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 61 + FourHundredGigE0/0/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 62 + FourHundredGigE0/0/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 63 + FourHundredGigE0/0/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 64 + HundredGigE0/0/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 65 + HundredGigE0/0/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 66 + HundredGigE0/0/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 67 + FourHundredGigE0/0/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 68 + FourHundredGigE0/0/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 69 + FourHundredGigE0/0/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 70 + HundredGigE0/0/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 71 + HundredGigE0/0/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 72 + HundredGigE0/0/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 73 + FourHundredGigE0/0/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 74 + FourHundredGigE0/0/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 75 + FourHundredGigE0/0/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 76 + HundredGigE0/0/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 77 + HundredGigE0/0/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 78 + HundredGigE0/0/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 79 + FourHundredGigE0/0/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 80 + FourHundredGigE0/0/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 81 + FourHundredGigE0/0/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 82 + HundredGigE0/0/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 83 + HundredGigE0/0/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 84 + HundredGigE0/0/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 85 + FourHundredGigE0/0/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 86 + FourHundredGigE0/0/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 87 + FourHundredGigE0/0/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 88 + HundredGigE0/0/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 89 + HundredGigE0/0/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 90 + HundredGigE0/0/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 91 + FourHundredGigE0/0/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 92 + FourHundredGigE0/0/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 93 + FourHundredGigE0/0/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 94 + HundredGigE0/0/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 95 + HundredGigE0/0/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 96 + HundredGigE0/0/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 97 + FourHundredGigE0/0/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 98 + FourHundredGigE0/0/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 99 + FourHundredGigE0/0/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 100 + HundredGigE0/0/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 101 + HundredGigE0/0/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 102 + HundredGigE0/0/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 103 + FourHundredGigE0/0/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 104 + FourHundredGigE0/0/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 105 + FourHundredGigE0/0/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 106 + HundredGigE0/0/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 107 + HundredGigE0/0/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 108 + HundredGigE0/0/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 109 + FourHundredGigE0/0/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 110 + FourHundredGigE0/0/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 111 + FourHundredGigE0/0/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 112 + HundredGigE0/0/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 113 + HundredGigE0/0/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 114 + HundredGigE0/0/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 115 + FourHundredGigE0/0/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 116 + FourHundredGigE0/0/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 117 + FourHundredGigE0/0/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 118 + HundredGigE0/0/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 119 + HundredGigE0/0/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 120 + HundredGigE0/0/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 121 + FourHundredGigE0/0/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 122 + FourHundredGigE0/0/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 123 + FourHundredGigE0/0/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 124 + HundredGigE0/0/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 125 + HundredGigE0/0/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 126 + HundredGigE0/0/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 127 + FourHundredGigE0/0/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 128 + FourHundredGigE0/0/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 129 + FourHundredGigE0/0/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 130 + HundredGigE0/0/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 131 + HundredGigE0/0/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 132 + HundredGigE0/0/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 133 + FourHundredGigE0/0/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 134 + FourHundredGigE0/0/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 135 + FourHundredGigE0/0/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 136 + HundredGigE0/0/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 137 + HundredGigE0/0/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 138 + HundredGigE0/0/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 139 + FourHundredGigE0/0/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 140 + FourHundredGigE0/0/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 141 + FourHundredGigE0/0/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 142 + HundredGigE0/0/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 143 + HundredGigE0/0/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 144 + HundredGigE0/0/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 145 + FourHundredGigE0/0/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 146 + FourHundredGigE0/0/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 147 + FourHundredGigE0/0/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 148 + HundredGigE0/0/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 149 + HundredGigE0/0/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 150 + HundredGigE0/0/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 151 + FourHundredGigE0/0/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 152 + FourHundredGigE0/0/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 153 + FourHundredGigE0/0/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 154 + HundredGigE0/0/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 155 + HundredGigE0/0/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 156 + HundredGigE0/0/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 157 + FourHundredGigE0/0/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 158 + FourHundredGigE0/0/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 159 + FourHundredGigE0/0/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 160 + HundredGigE0/0/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 161 + HundredGigE0/0/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 162 + HundredGigE0/0/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 163 + FourHundredGigE0/0/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 164 + FourHundredGigE0/0/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 165 + FourHundredGigE0/0/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 166 + HundredGigE0/0/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 167 + HundredGigE0/0/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 168 + HundredGigE0/0/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 169 + FourHundredGigE0/0/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 170 + FourHundredGigE0/0/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 171 + FourHundredGigE0/0/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 172 + HundredGigE0/0/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 173 + HundredGigE0/0/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 174 + HundredGigE0/0/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 175 + FourHundredGigE0/0/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 176 + FourHundredGigE0/0/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 177 + FourHundredGigE0/0/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 178 + HundredGigE0/0/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 179 + HundredGigE0/0/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 180 + HundredGigE0/0/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 181 + FourHundredGigE0/0/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 182 + FourHundredGigE0/0/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 183 + FourHundredGigE0/0/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 184 + HundredGigE0/0/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 185 + HundredGigE0/0/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 186 + HundredGigE0/0/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 187 + FourHundredGigE0/0/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 188 + FourHundredGigE0/0/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 189 + FourHundredGigE0/0/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 190 + HundredGigE0/0/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 191 + HundredGigE0/0/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 192 + HundredGigE0/0/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 193 + FourHundredGigE0/0/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 194 + FourHundredGigE0/0/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 195 + FourHundredGigE0/0/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 196 + HundredGigE0/0/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 197 + HundredGigE0/0/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 198 + HundredGigE0/0/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 199 + FourHundredGigE0/0/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 200 + FourHundredGigE0/0/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 201 + FourHundredGigE0/0/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 202 + HundredGigE0/0/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 203 + HundredGigE0/0/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 204 + HundredGigE0/0/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 205 + FourHundredGigE0/0/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 206 + FourHundredGigE0/0/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 207 + FourHundredGigE0/0/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 208 + HundredGigE0/0/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 209 + HundredGigE0/0/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 210 + HundredGigE0/0/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 211 + FourHundredGigE0/0/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 212 + FourHundredGigE0/0/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 213 + FourHundredGigE0/0/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 214 + HundredGigE0/0/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 215 + HundredGigE0/0/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 216 + HundredGigE0/0/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 217 + HundredGigE0/1/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 218 + HundredGigE0/1/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 219 + HundredGigE0/1/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 220 + FortyGigE0/1/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 221 + FortyGigE0/1/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 222 + FortyGigE0/1/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 223 + HundredGigE0/1/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 224 + HundredGigE0/1/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 225 + HundredGigE0/1/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 226 + FortyGigE0/1/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 227 + FortyGigE0/1/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 228 + FortyGigE0/1/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 229 + HundredGigE0/1/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 230 + HundredGigE0/1/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 231 + HundredGigE0/1/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 232 + FortyGigE0/1/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 233 + FortyGigE0/1/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 234 + FortyGigE0/1/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 235 + HundredGigE0/1/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 236 + HundredGigE0/1/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 237 + HundredGigE0/1/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 238 + FortyGigE0/1/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 239 + FortyGigE0/1/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 240 + FortyGigE0/1/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 241 + HundredGigE0/1/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 242 + HundredGigE0/1/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 243 + HundredGigE0/1/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 244 + FortyGigE0/1/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 245 + FortyGigE0/1/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 246 + FortyGigE0/1/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 247 + HundredGigE0/1/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 248 + HundredGigE0/1/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 249 + HundredGigE0/1/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 250 + FortyGigE0/1/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 251 + FortyGigE0/1/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 252 + FortyGigE0/1/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 253 + HundredGigE0/1/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 254 + HundredGigE0/1/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 255 + HundredGigE0/1/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 256 + FortyGigE0/1/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 257 + FortyGigE0/1/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 258 + FortyGigE0/1/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 259 + HundredGigE0/1/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 260 + HundredGigE0/1/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 261 + HundredGigE0/1/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 262 + FortyGigE0/1/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 263 + FortyGigE0/1/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 264 + FortyGigE0/1/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 265 + HundredGigE0/1/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 266 + HundredGigE0/1/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 267 + HundredGigE0/1/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 268 + FortyGigE0/1/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 269 + FortyGigE0/1/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 270 + FortyGigE0/1/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 271 + HundredGigE0/1/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 272 + HundredGigE0/1/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 273 + HundredGigE0/1/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 274 + FortyGigE0/1/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 275 + FortyGigE0/1/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 276 + FortyGigE0/1/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 277 + HundredGigE0/1/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 278 + HundredGigE0/1/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 279 + HundredGigE0/1/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 280 + FortyGigE0/1/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 281 + FortyGigE0/1/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 282 + FortyGigE0/1/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 283 + HundredGigE0/1/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 284 + HundredGigE0/1/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 285 + HundredGigE0/1/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 286 + FortyGigE0/1/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 287 + FortyGigE0/1/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 288 + FortyGigE0/1/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 289 + HundredGigE0/1/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 290 + HundredGigE0/1/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 291 + HundredGigE0/1/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 292 + FortyGigE0/1/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 293 + FortyGigE0/1/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 294 + FortyGigE0/1/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 295 + HundredGigE0/1/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 296 + HundredGigE0/1/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 297 + HundredGigE0/1/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 298 + FortyGigE0/1/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 299 + FortyGigE0/1/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 300 + FortyGigE0/1/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 301 + HundredGigE0/1/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 302 + HundredGigE0/1/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 303 + HundredGigE0/1/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 304 + FortyGigE0/1/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 305 + FortyGigE0/1/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 306 + FortyGigE0/1/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 307 + HundredGigE0/1/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 308 + HundredGigE0/1/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 309 + HundredGigE0/1/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 310 + FortyGigE0/1/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 311 + FortyGigE0/1/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 312 + FortyGigE0/1/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 313 + HundredGigE0/1/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 314 + HundredGigE0/1/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 315 + HundredGigE0/1/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 316 + FortyGigE0/1/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 317 + FortyGigE0/1/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 318 + FortyGigE0/1/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 319 + HundredGigE0/1/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 320 + HundredGigE0/1/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 321 + HundredGigE0/1/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 322 + FortyGigE0/1/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 323 + FortyGigE0/1/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 324 + FortyGigE0/1/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 325 + HundredGigE0/1/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 326 + HundredGigE0/1/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 327 + HundredGigE0/1/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 328 + FortyGigE0/1/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 329 + FortyGigE0/1/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 330 + FortyGigE0/1/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 331 + HundredGigE0/1/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 332 + HundredGigE0/1/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 333 + HundredGigE0/1/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 334 + FortyGigE0/1/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 335 + FortyGigE0/1/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 336 + FortyGigE0/1/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 337 + HundredGigE0/1/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 338 + HundredGigE0/1/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 339 + HundredGigE0/1/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 340 + FortyGigE0/1/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 341 + FortyGigE0/1/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 342 + FortyGigE0/1/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 343 + HundredGigE0/1/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 344 + HundredGigE0/1/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 345 + HundredGigE0/1/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 346 + FortyGigE0/1/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 347 + FortyGigE0/1/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 348 + FortyGigE0/1/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 349 + HundredGigE0/1/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 350 + HundredGigE0/1/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 351 + HundredGigE0/1/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 352 + FortyGigE0/1/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 353 + FortyGigE0/1/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 354 + FortyGigE0/1/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 355 + HundredGigE0/1/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 356 + HundredGigE0/1/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 357 + HundredGigE0/1/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 358 + FortyGigE0/1/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 359 + FortyGigE0/1/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 360 + FortyGigE0/1/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 361 + HundredGigE0/1/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 362 + HundredGigE0/1/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 363 + HundredGigE0/1/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 364 + FortyGigE0/1/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 365 + FortyGigE0/1/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 366 + FortyGigE0/1/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 367 + HundredGigE0/1/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 368 + HundredGigE0/1/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 369 + HundredGigE0/1/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 370 + FortyGigE0/1/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 371 + FortyGigE0/1/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 372 + FortyGigE0/1/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 373 + HundredGigE0/1/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 374 + HundredGigE0/1/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 375 + HundredGigE0/1/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 376 + FortyGigE0/1/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 377 + FortyGigE0/1/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 378 + FortyGigE0/1/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 379 + HundredGigE0/1/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 380 + HundredGigE0/1/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 381 + HundredGigE0/1/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 382 + FortyGigE0/1/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 383 + FortyGigE0/1/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 384 + FortyGigE0/1/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 385 + HundredGigE0/1/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 386 + HundredGigE0/1/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 387 + HundredGigE0/1/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 388 + FortyGigE0/1/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 389 + FortyGigE0/1/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 390 + FortyGigE0/1/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 391 + HundredGigE0/1/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 392 + HundredGigE0/1/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 393 + HundredGigE0/1/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 394 + FortyGigE0/1/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 395 + FortyGigE0/1/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 396 + FortyGigE0/1/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 397 + HundredGigE0/1/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 398 + HundredGigE0/1/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 399 + HundredGigE0/1/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 400 + FortyGigE0/1/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 401 + FortyGigE0/1/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 402 + FortyGigE0/1/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 403 + HundredGigE0/1/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 404 + HundredGigE0/1/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 405 + HundredGigE0/1/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 406 + FortyGigE0/1/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 407 + FortyGigE0/1/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 408 + FortyGigE0/1/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 409 + HundredGigE0/1/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 410 + HundredGigE0/1/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 411 + HundredGigE0/1/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 412 + FortyGigE0/1/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 413 + FortyGigE0/1/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 414 + FortyGigE0/1/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 415 + HundredGigE0/1/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 416 + HundredGigE0/1/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 417 + HundredGigE0/1/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 418 + FortyGigE0/1/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 419 + FortyGigE0/1/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 420 + FortyGigE0/1/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 421 + HundredGigE0/1/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 422 + HundredGigE0/1/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 423 + HundredGigE0/1/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 424 + FortyGigE0/1/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 425 + FortyGigE0/1/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 426 + FortyGigE0/1/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 427 + HundredGigE0/1/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 428 + HundredGigE0/1/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 429 + HundredGigE0/1/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 430 + FortyGigE0/1/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 431 + FortyGigE0/1/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 432 + FortyGigE0/1/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 433 + HundredGigE0/1/0/36 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 434 + HundredGigE0/1/0/36 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 435 + HundredGigE0/1/0/36 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 436 + FortyGigE0/1/0/36 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 437 + FortyGigE0/1/0/36 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 438 + FortyGigE0/1/0/36 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 439 + HundredGigE0/1/0/37 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 440 + HundredGigE0/1/0/37 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 441 + HundredGigE0/1/0/37 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 442 + FortyGigE0/1/0/37 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 443 + FortyGigE0/1/0/37 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 444 + FortyGigE0/1/0/37 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 445 + HundredGigE0/1/0/38 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 446 + HundredGigE0/1/0/38 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 447 + HundredGigE0/1/0/38 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 448 + FortyGigE0/1/0/38 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 449 + FortyGigE0/1/0/38 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 450 + FortyGigE0/1/0/38 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 451 + HundredGigE0/1/0/39 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 452 + HundredGigE0/1/0/39 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 453 + HundredGigE0/1/0/39 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 454 + FortyGigE0/1/0/39 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 455 + FortyGigE0/1/0/39 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 456 + FortyGigE0/1/0/39 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 457 + HundredGigE0/1/0/40 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 458 + HundredGigE0/1/0/40 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 459 + HundredGigE0/1/0/40 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 460 + FortyGigE0/1/0/40 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 461 + FortyGigE0/1/0/40 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 462 + FortyGigE0/1/0/40 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 463 + HundredGigE0/1/0/41 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 464 + HundredGigE0/1/0/41 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 465 + HundredGigE0/1/0/41 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 466 + FortyGigE0/1/0/41 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 467 + FortyGigE0/1/0/41 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 468 + FortyGigE0/1/0/41 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 469 + HundredGigE0/1/0/42 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 470 + HundredGigE0/1/0/42 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 471 + HundredGigE0/1/0/42 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 472 + FortyGigE0/1/0/42 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 473 + FortyGigE0/1/0/42 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 474 + FortyGigE0/1/0/42 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 475 + HundredGigE0/1/0/43 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 476 + HundredGigE0/1/0/43 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 477 + HundredGigE0/1/0/43 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 478 + FortyGigE0/1/0/43 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 479 + FortyGigE0/1/0/43 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 480 + FortyGigE0/1/0/43 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 481 + HundredGigE0/1/0/44 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 482 + HundredGigE0/1/0/44 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 483 + HundredGigE0/1/0/44 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 484 + FortyGigE0/1/0/44 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 485 + FortyGigE0/1/0/44 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 486 + FortyGigE0/1/0/44 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 487 + HundredGigE0/1/0/45 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 488 + HundredGigE0/1/0/45 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 489 + HundredGigE0/1/0/45 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 490 + FortyGigE0/1/0/45 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 491 + FortyGigE0/1/0/45 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 492 + FortyGigE0/1/0/45 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 493 + HundredGigE0/1/0/46 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 494 + HundredGigE0/1/0/46 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 495 + HundredGigE0/1/0/46 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 496 + FortyGigE0/1/0/46 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 497 + FortyGigE0/1/0/46 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 498 + FortyGigE0/1/0/46 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 499 + HundredGigE0/1/0/47 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 500 + HundredGigE0/1/0/47 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 501 + HundredGigE0/1/0/47 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 502 + FortyGigE0/1/0/47 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 503 + FortyGigE0/1/0/47 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 504 + FortyGigE0/1/0/47 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 505 + HundredGigE0/2/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 506 + HundredGigE0/2/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 507 + HundredGigE0/2/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 508 + FortyGigE0/2/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 509 + FortyGigE0/2/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 510 + FortyGigE0/2/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 511 + HundredGigE0/2/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 512 + HundredGigE0/2/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 513 + HundredGigE0/2/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 514 + FortyGigE0/2/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 515 + FortyGigE0/2/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 516 + FortyGigE0/2/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 517 + HundredGigE0/2/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 518 + HundredGigE0/2/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 519 + HundredGigE0/2/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 520 + FortyGigE0/2/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 521 + FortyGigE0/2/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 522 + FortyGigE0/2/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 523 + HundredGigE0/2/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 524 + HundredGigE0/2/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 525 + HundredGigE0/2/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 526 + FortyGigE0/2/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 527 + FortyGigE0/2/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 528 + FortyGigE0/2/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 529 + HundredGigE0/2/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 530 + HundredGigE0/2/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 531 + HundredGigE0/2/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 532 + FortyGigE0/2/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 533 + FortyGigE0/2/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 534 + FortyGigE0/2/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 535 + HundredGigE0/2/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 536 + HundredGigE0/2/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 537 + HundredGigE0/2/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 538 + FortyGigE0/2/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 539 + FortyGigE0/2/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 540 + FortyGigE0/2/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 541 + HundredGigE0/2/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 542 + HundredGigE0/2/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 543 + HundredGigE0/2/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 544 + FortyGigE0/2/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 545 + FortyGigE0/2/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 546 + FortyGigE0/2/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 547 + HundredGigE0/2/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 548 + HundredGigE0/2/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 549 + HundredGigE0/2/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 550 + FortyGigE0/2/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 551 + FortyGigE0/2/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 552 + FortyGigE0/2/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 553 + HundredGigE0/2/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 554 + HundredGigE0/2/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 555 + HundredGigE0/2/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 556 + FortyGigE0/2/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 557 + FortyGigE0/2/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 558 + FortyGigE0/2/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 559 + HundredGigE0/2/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 560 + HundredGigE0/2/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 561 + HundredGigE0/2/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 562 + FortyGigE0/2/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 563 + FortyGigE0/2/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 564 + FortyGigE0/2/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 565 + HundredGigE0/2/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 566 + HundredGigE0/2/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 567 + HundredGigE0/2/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 568 + FortyGigE0/2/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 569 + FortyGigE0/2/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 570 + FortyGigE0/2/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 571 + HundredGigE0/2/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 572 + HundredGigE0/2/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 573 + HundredGigE0/2/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 574 + FortyGigE0/2/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 575 + FortyGigE0/2/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 576 + FortyGigE0/2/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 577 + HundredGigE0/2/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 578 + HundredGigE0/2/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 579 + HundredGigE0/2/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 580 + FortyGigE0/2/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 581 + FortyGigE0/2/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 582 + FortyGigE0/2/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 583 + HundredGigE0/2/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 584 + HundredGigE0/2/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 585 + HundredGigE0/2/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 586 + FortyGigE0/2/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 587 + FortyGigE0/2/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 588 + FortyGigE0/2/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 589 + HundredGigE0/2/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 590 + HundredGigE0/2/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 591 + HundredGigE0/2/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 592 + FortyGigE0/2/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 593 + FortyGigE0/2/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 594 + FortyGigE0/2/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 595 + HundredGigE0/2/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 596 + HundredGigE0/2/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 597 + HundredGigE0/2/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 598 + FortyGigE0/2/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 599 + FortyGigE0/2/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 600 + FortyGigE0/2/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 601 + HundredGigE0/2/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 602 + HundredGigE0/2/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 603 + HundredGigE0/2/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 604 + FortyGigE0/2/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 605 + FortyGigE0/2/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 606 + FortyGigE0/2/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 607 + HundredGigE0/2/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 608 + HundredGigE0/2/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 609 + HundredGigE0/2/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 610 + FortyGigE0/2/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 611 + FortyGigE0/2/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 612 + FortyGigE0/2/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 613 + HundredGigE0/2/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 614 + HundredGigE0/2/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 615 + HundredGigE0/2/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 616 + FortyGigE0/2/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 617 + FortyGigE0/2/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 618 + FortyGigE0/2/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 619 + HundredGigE0/2/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 620 + HundredGigE0/2/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 621 + HundredGigE0/2/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 622 + FortyGigE0/2/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 623 + FortyGigE0/2/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 624 + FortyGigE0/2/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 625 + HundredGigE0/2/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 626 + HundredGigE0/2/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 627 + HundredGigE0/2/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 628 + FortyGigE0/2/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 629 + FortyGigE0/2/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 630 + FortyGigE0/2/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 631 + HundredGigE0/2/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 632 + HundredGigE0/2/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 633 + HundredGigE0/2/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 634 + FortyGigE0/2/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 635 + FortyGigE0/2/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 636 + FortyGigE0/2/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 637 + HundredGigE0/2/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 638 + HundredGigE0/2/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 639 + HundredGigE0/2/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 640 + FortyGigE0/2/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 641 + FortyGigE0/2/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 642 + FortyGigE0/2/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 643 + HundredGigE0/2/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 644 + HundredGigE0/2/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 645 + HundredGigE0/2/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 646 + FortyGigE0/2/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 647 + FortyGigE0/2/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 648 + FortyGigE0/2/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 649 + HundredGigE0/2/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 650 + HundredGigE0/2/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 651 + HundredGigE0/2/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 652 + FortyGigE0/2/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 653 + FortyGigE0/2/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 654 + FortyGigE0/2/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 655 + HundredGigE0/2/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 656 + HundredGigE0/2/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 657 + HundredGigE0/2/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 658 + FortyGigE0/2/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 659 + FortyGigE0/2/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 660 + FortyGigE0/2/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 661 + HundredGigE0/2/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 662 + HundredGigE0/2/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 663 + HundredGigE0/2/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 664 + FortyGigE0/2/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 665 + FortyGigE0/2/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 666 + FortyGigE0/2/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 667 + HundredGigE0/2/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 668 + HundredGigE0/2/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 669 + HundredGigE0/2/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 670 + FortyGigE0/2/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 671 + FortyGigE0/2/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 672 + FortyGigE0/2/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 673 + HundredGigE0/2/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 674 + HundredGigE0/2/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 675 + HundredGigE0/2/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 676 + FortyGigE0/2/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 677 + FortyGigE0/2/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 678 + FortyGigE0/2/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 679 + HundredGigE0/2/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 680 + HundredGigE0/2/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 681 + HundredGigE0/2/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 682 + FortyGigE0/2/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 683 + FortyGigE0/2/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 684 + FortyGigE0/2/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 685 + HundredGigE0/2/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 686 + HundredGigE0/2/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 687 + HundredGigE0/2/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 688 + FortyGigE0/2/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 689 + FortyGigE0/2/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 690 + FortyGigE0/2/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 691 + HundredGigE0/2/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 692 + HundredGigE0/2/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 693 + HundredGigE0/2/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 694 + FortyGigE0/2/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 695 + FortyGigE0/2/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 696 + FortyGigE0/2/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 697 + HundredGigE0/2/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 698 + HundredGigE0/2/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 699 + HundredGigE0/2/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 700 + FortyGigE0/2/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 701 + FortyGigE0/2/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 702 + FortyGigE0/2/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 703 + HundredGigE0/2/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 704 + HundredGigE0/2/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 705 + HundredGigE0/2/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 706 + FortyGigE0/2/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 707 + FortyGigE0/2/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 708 + FortyGigE0/2/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 709 + HundredGigE0/2/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 710 + HundredGigE0/2/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 711 + HundredGigE0/2/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 712 + FortyGigE0/2/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 713 + FortyGigE0/2/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 714 + FortyGigE0/2/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 715 + HundredGigE0/2/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 716 + HundredGigE0/2/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 717 + HundredGigE0/2/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 718 + FortyGigE0/2/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 719 + FortyGigE0/2/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 720 + FortyGigE0/2/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 721 + HundredGigE0/2/0/36 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 722 + HundredGigE0/2/0/36 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 723 + HundredGigE0/2/0/36 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 724 + FortyGigE0/2/0/36 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 725 + FortyGigE0/2/0/36 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 726 + FortyGigE0/2/0/36 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 727 + HundredGigE0/2/0/37 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 728 + HundredGigE0/2/0/37 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 729 + HundredGigE0/2/0/37 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 730 + FortyGigE0/2/0/37 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 731 + FortyGigE0/2/0/37 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 732 + FortyGigE0/2/0/37 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 733 + HundredGigE0/2/0/38 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 734 + HundredGigE0/2/0/38 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 735 + HundredGigE0/2/0/38 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 736 + FortyGigE0/2/0/38 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 737 + FortyGigE0/2/0/38 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 738 + FortyGigE0/2/0/38 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 739 + HundredGigE0/2/0/39 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 740 + HundredGigE0/2/0/39 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 741 + HundredGigE0/2/0/39 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 742 + FortyGigE0/2/0/39 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 743 + FortyGigE0/2/0/39 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 744 + FortyGigE0/2/0/39 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 745 + HundredGigE0/2/0/40 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 746 + HundredGigE0/2/0/40 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 747 + HundredGigE0/2/0/40 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 748 + FortyGigE0/2/0/40 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 749 + FortyGigE0/2/0/40 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 750 + FortyGigE0/2/0/40 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 751 + HundredGigE0/2/0/41 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 752 + HundredGigE0/2/0/41 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 753 + HundredGigE0/2/0/41 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 754 + FortyGigE0/2/0/41 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 755 + FortyGigE0/2/0/41 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 756 + FortyGigE0/2/0/41 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 757 + HundredGigE0/2/0/42 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 758 + HundredGigE0/2/0/42 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 759 + HundredGigE0/2/0/42 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 760 + FortyGigE0/2/0/42 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 761 + FortyGigE0/2/0/42 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 762 + FortyGigE0/2/0/42 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 763 + HundredGigE0/2/0/43 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 764 + HundredGigE0/2/0/43 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 765 + HundredGigE0/2/0/43 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 766 + FortyGigE0/2/0/43 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 767 + FortyGigE0/2/0/43 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 768 + FortyGigE0/2/0/43 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 769 + HundredGigE0/2/0/44 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 770 + HundredGigE0/2/0/44 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 771 + HundredGigE0/2/0/44 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 772 + FortyGigE0/2/0/44 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 773 + FortyGigE0/2/0/44 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 774 + FortyGigE0/2/0/44 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 775 + HundredGigE0/2/0/45 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 776 + HundredGigE0/2/0/45 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 777 + HundredGigE0/2/0/45 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 778 + FortyGigE0/2/0/45 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 779 + FortyGigE0/2/0/45 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 780 + FortyGigE0/2/0/45 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 781 + HundredGigE0/2/0/46 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 782 + HundredGigE0/2/0/46 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 783 + HundredGigE0/2/0/46 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 784 + FortyGigE0/2/0/46 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 785 + FortyGigE0/2/0/46 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 786 + FortyGigE0/2/0/46 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 787 + HundredGigE0/2/0/47 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 788 + HundredGigE0/2/0/47 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 789 + HundredGigE0/2/0/47 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 790 + FortyGigE0/2/0/47 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 791 + FortyGigE0/2/0/47 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 792 + FortyGigE0/2/0/47 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 793 + HundredGigE0/3/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 794 + HundredGigE0/3/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 795 + HundredGigE0/3/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 796 + FortyGigE0/3/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 797 + FortyGigE0/3/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 798 + FortyGigE0/3/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 799 + FourHundredGigE0/3/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 800 + FourHundredGigE0/3/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 801 + FourHundredGigE0/3/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 802 + HundredGigE0/3/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 803 + HundredGigE0/3/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 804 + HundredGigE0/3/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 805 + FortyGigE0/3/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 806 + FortyGigE0/3/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 807 + FortyGigE0/3/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 808 + FourHundredGigE0/3/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 809 + FourHundredGigE0/3/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 810 + FourHundredGigE0/3/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 811 + HundredGigE0/3/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 812 + HundredGigE0/3/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 813 + HundredGigE0/3/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 814 + FortyGigE0/3/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 815 + FortyGigE0/3/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 816 + FortyGigE0/3/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 817 + FourHundredGigE0/3/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 818 + FourHundredGigE0/3/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 819 + FourHundredGigE0/3/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 820 + HundredGigE0/3/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 821 + HundredGigE0/3/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 822 + HundredGigE0/3/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 823 + FortyGigE0/3/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 824 + FortyGigE0/3/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 825 + FortyGigE0/3/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 826 + FourHundredGigE0/3/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 827 + FourHundredGigE0/3/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 828 + FourHundredGigE0/3/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 829 + HundredGigE0/3/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 830 + HundredGigE0/3/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 831 + HundredGigE0/3/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 832 + FortyGigE0/3/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 833 + FortyGigE0/3/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 834 + FortyGigE0/3/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 835 + FourHundredGigE0/3/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 836 + FourHundredGigE0/3/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 837 + FourHundredGigE0/3/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 838 + HundredGigE0/3/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 839 + HundredGigE0/3/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 840 + HundredGigE0/3/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 841 + FortyGigE0/3/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 842 + FortyGigE0/3/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 843 + FortyGigE0/3/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 844 + FourHundredGigE0/3/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 845 + FourHundredGigE0/3/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 846 + FourHundredGigE0/3/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 847 + HundredGigE0/3/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 848 + HundredGigE0/3/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 849 + HundredGigE0/3/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 850 + FortyGigE0/3/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 851 + FortyGigE0/3/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 852 + FortyGigE0/3/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 853 + FourHundredGigE0/3/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 854 + FourHundredGigE0/3/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 855 + FourHundredGigE0/3/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 856 + HundredGigE0/3/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 857 + HundredGigE0/3/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 858 + HundredGigE0/3/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 859 + FortyGigE0/3/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 860 + FortyGigE0/3/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 861 + FortyGigE0/3/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 862 + FourHundredGigE0/3/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 863 + FourHundredGigE0/3/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 864 + FourHundredGigE0/3/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 865 + HundredGigE0/3/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 866 + HundredGigE0/3/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 867 + HundredGigE0/3/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 868 + FortyGigE0/3/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 869 + FortyGigE0/3/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 870 + FortyGigE0/3/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 871 + FourHundredGigE0/3/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 872 + FourHundredGigE0/3/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 873 + FourHundredGigE0/3/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 874 + HundredGigE0/3/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 875 + HundredGigE0/3/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 876 + HundredGigE0/3/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 877 + FortyGigE0/3/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 878 + FortyGigE0/3/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 879 + FortyGigE0/3/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 880 + FourHundredGigE0/3/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 881 + FourHundredGigE0/3/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 882 + FourHundredGigE0/3/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 883 + HundredGigE0/3/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 884 + HundredGigE0/3/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 885 + HundredGigE0/3/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 886 + FortyGigE0/3/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 887 + FortyGigE0/3/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 888 + FortyGigE0/3/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 889 + FourHundredGigE0/3/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 890 + FourHundredGigE0/3/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 891 + FourHundredGigE0/3/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 892 + HundredGigE0/3/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 893 + HundredGigE0/3/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 894 + HundredGigE0/3/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 895 + FortyGigE0/3/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 896 + FortyGigE0/3/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 897 + FortyGigE0/3/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 898 + FourHundredGigE0/3/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 899 + FourHundredGigE0/3/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 900 + FourHundredGigE0/3/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 901 + HundredGigE0/3/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 902 + HundredGigE0/3/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 903 + HundredGigE0/3/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 904 + FortyGigE0/3/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 905 + FortyGigE0/3/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 906 + FortyGigE0/3/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 907 + FourHundredGigE0/3/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 908 + FourHundredGigE0/3/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 909 + FourHundredGigE0/3/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 910 + HundredGigE0/3/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 911 + HundredGigE0/3/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 912 + HundredGigE0/3/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 913 + FortyGigE0/3/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 914 + FortyGigE0/3/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 915 + FortyGigE0/3/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 916 + FourHundredGigE0/3/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 917 + FourHundredGigE0/3/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 918 + FourHundredGigE0/3/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 919 + HundredGigE0/3/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 920 + HundredGigE0/3/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 921 + HundredGigE0/3/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 922 + FortyGigE0/3/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 923 + FortyGigE0/3/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 924 + FortyGigE0/3/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 925 + FourHundredGigE0/3/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 926 + FourHundredGigE0/3/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 927 + FourHundredGigE0/3/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 928 + HundredGigE0/3/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 929 + HundredGigE0/3/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 930 + HundredGigE0/3/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 931 + FortyGigE0/3/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 932 + FortyGigE0/3/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 933 + FortyGigE0/3/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 934 + FourHundredGigE0/3/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 935 + FourHundredGigE0/3/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 936 + FourHundredGigE0/3/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 937 + HundredGigE0/3/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 938 + HundredGigE0/3/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 939 + HundredGigE0/3/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 940 + FortyGigE0/3/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 941 + FortyGigE0/3/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 942 + FortyGigE0/3/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 943 + FourHundredGigE0/3/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 944 + FourHundredGigE0/3/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 945 + FourHundredGigE0/3/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 946 + HundredGigE0/3/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 947 + HundredGigE0/3/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 948 + HundredGigE0/3/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 949 + FortyGigE0/3/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 950 + FortyGigE0/3/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 951 + FortyGigE0/3/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 952 + FourHundredGigE0/3/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 953 + FourHundredGigE0/3/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 954 + FourHundredGigE0/3/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 955 + HundredGigE0/3/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 956 + HundredGigE0/3/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 957 + HundredGigE0/3/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 958 + FortyGigE0/3/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 959 + FortyGigE0/3/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 960 + FortyGigE0/3/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 961 + FourHundredGigE0/3/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 962 + FourHundredGigE0/3/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 963 + FourHundredGigE0/3/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 964 + HundredGigE0/3/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 965 + HundredGigE0/3/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 966 + HundredGigE0/3/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 967 + FortyGigE0/3/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 968 + FortyGigE0/3/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 969 + FortyGigE0/3/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 970 + FourHundredGigE0/3/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 971 + FourHundredGigE0/3/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 972 + FourHundredGigE0/3/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 973 + HundredGigE0/3/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 974 + HundredGigE0/3/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 975 + HundredGigE0/3/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 976 + FortyGigE0/3/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 977 + FortyGigE0/3/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 978 + FortyGigE0/3/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 979 + FourHundredGigE0/3/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 980 + FourHundredGigE0/3/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 981 + FourHundredGigE0/3/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 982 + HundredGigE0/3/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 983 + HundredGigE0/3/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 984 + HundredGigE0/3/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 985 + FortyGigE0/3/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 986 + FortyGigE0/3/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 987 + FortyGigE0/3/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 988 + FourHundredGigE0/3/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 989 + FourHundredGigE0/3/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 990 + FourHundredGigE0/3/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 991 + HundredGigE0/3/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 992 + HundredGigE0/3/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 993 + HundredGigE0/3/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 994 + FortyGigE0/3/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 995 + FortyGigE0/3/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 996 + FortyGigE0/3/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 997 + FourHundredGigE0/3/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 998 + FourHundredGigE0/3/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 999 + FourHundredGigE0/3/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1000 + HundredGigE0/3/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1001 + HundredGigE0/3/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1002 + HundredGigE0/3/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1003 + FortyGigE0/3/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1004 + FortyGigE0/3/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1005 + FortyGigE0/3/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1006 + FourHundredGigE0/3/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1007 + FourHundredGigE0/3/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1008 + FourHundredGigE0/3/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1009 + HundredGigE0/3/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1010 + HundredGigE0/3/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1011 + HundredGigE0/3/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1012 + FortyGigE0/3/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1013 + FortyGigE0/3/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1014 + FortyGigE0/3/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1015 + FourHundredGigE0/3/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1016 + FourHundredGigE0/3/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1017 + FourHundredGigE0/3/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1018 + HundredGigE0/3/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1019 + HundredGigE0/3/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1020 + HundredGigE0/3/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1021 + FortyGigE0/3/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1022 + FortyGigE0/3/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1023 + FortyGigE0/3/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1024 + FourHundredGigE0/3/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1025 + FourHundredGigE0/3/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1026 + FourHundredGigE0/3/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1027 + HundredGigE0/3/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1028 + HundredGigE0/3/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1029 + HundredGigE0/3/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1030 + FortyGigE0/3/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1031 + FortyGigE0/3/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1032 + FortyGigE0/3/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1033 + FourHundredGigE0/3/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1034 + FourHundredGigE0/3/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1035 + FourHundredGigE0/3/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1036 + HundredGigE0/3/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1037 + HundredGigE0/3/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1038 + HundredGigE0/3/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1039 + FortyGigE0/3/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1040 + FortyGigE0/3/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1041 + FortyGigE0/3/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1042 + FourHundredGigE0/3/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1043 + FourHundredGigE0/3/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1044 + FourHundredGigE0/3/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1045 + HundredGigE0/3/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1046 + HundredGigE0/3/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1047 + HundredGigE0/3/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1048 + FortyGigE0/3/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1049 + FortyGigE0/3/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1050 + FortyGigE0/3/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1051 + FourHundredGigE0/3/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1052 + FourHundredGigE0/3/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1053 + FourHundredGigE0/3/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1054 + HundredGigE0/3/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1055 + HundredGigE0/3/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1056 + HundredGigE0/3/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1057 + FortyGigE0/3/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1058 + FortyGigE0/3/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1059 + FortyGigE0/3/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1060 + FourHundredGigE0/3/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1061 + FourHundredGigE0/3/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1062 + FourHundredGigE0/3/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1063 + HundredGigE0/3/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1064 + HundredGigE0/3/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1065 + HundredGigE0/3/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1066 + FortyGigE0/3/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1067 + FortyGigE0/3/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1068 + FortyGigE0/3/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1069 + FourHundredGigE0/3/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1070 + FourHundredGigE0/3/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1071 + FourHundredGigE0/3/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1072 + HundredGigE0/3/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1073 + HundredGigE0/3/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1074 + HundredGigE0/3/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1075 + FortyGigE0/3/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1076 + FortyGigE0/3/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1077 + FortyGigE0/3/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1078 + FourHundredGigE0/3/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1079 + FourHundredGigE0/3/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1080 + FourHundredGigE0/3/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1081 + HundredGigE0/3/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1082 + HundredGigE0/3/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1083 + HundredGigE0/3/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1084 + FortyGigE0/3/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1085 + FortyGigE0/3/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1086 + FortyGigE0/3/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1087 + FourHundredGigE0/3/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1088 + FourHundredGigE0/3/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1089 + FourHundredGigE0/3/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1090 + HundredGigE0/3/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1091 + HundredGigE0/3/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1092 + HundredGigE0/3/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1093 + FortyGigE0/3/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1094 + FortyGigE0/3/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1095 + FortyGigE0/3/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1096 + FourHundredGigE0/3/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1097 + FourHundredGigE0/3/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1098 + FourHundredGigE0/3/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1099 + HundredGigE0/3/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1100 + HundredGigE0/3/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1101 + HundredGigE0/3/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1102 + FortyGigE0/3/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1103 + FortyGigE0/3/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1104 + FortyGigE0/3/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1105 + FourHundredGigE0/3/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1106 + FourHundredGigE0/3/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1107 + FourHundredGigE0/3/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1108 + HundredGigE0/3/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1109 + HundredGigE0/3/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1110 + HundredGigE0/3/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1111 + FortyGigE0/3/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1112 + FortyGigE0/3/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1113 + FortyGigE0/3/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1114 + FourHundredGigE0/3/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1115 + FourHundredGigE0/3/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1116 + FourHundredGigE0/3/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1117 + FourHundredGigE0/4/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1118 + FourHundredGigE0/4/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1119 + FourHundredGigE0/4/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1120 + HundredGigE0/4/0/0 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1121 + HundredGigE0/4/0/0 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1122 + HundredGigE0/4/0/0 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1123 + FourHundredGigE0/4/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1124 + FourHundredGigE0/4/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1125 + FourHundredGigE0/4/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1126 + HundredGigE0/4/0/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1127 + HundredGigE0/4/0/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1128 + HundredGigE0/4/0/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1129 + FourHundredGigE0/4/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1130 + FourHundredGigE0/4/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1131 + FourHundredGigE0/4/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1132 + HundredGigE0/4/0/2 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1133 + HundredGigE0/4/0/2 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1134 + HundredGigE0/4/0/2 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1135 + FourHundredGigE0/4/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1136 + FourHundredGigE0/4/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1137 + FourHundredGigE0/4/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1138 + HundredGigE0/4/0/3 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1139 + HundredGigE0/4/0/3 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1140 + HundredGigE0/4/0/3 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1141 + FourHundredGigE0/4/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1142 + FourHundredGigE0/4/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1143 + FourHundredGigE0/4/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1144 + HundredGigE0/4/0/4 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1145 + HundredGigE0/4/0/4 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1146 + HundredGigE0/4/0/4 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1147 + FourHundredGigE0/4/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1148 + FourHundredGigE0/4/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1149 + FourHundredGigE0/4/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1150 + HundredGigE0/4/0/5 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1151 + HundredGigE0/4/0/5 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1152 + HundredGigE0/4/0/5 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1153 + FourHundredGigE0/4/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1154 + FourHundredGigE0/4/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1155 + FourHundredGigE0/4/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1156 + HundredGigE0/4/0/6 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1157 + HundredGigE0/4/0/6 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1158 + HundredGigE0/4/0/6 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1159 + FourHundredGigE0/4/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1160 + FourHundredGigE0/4/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1161 + FourHundredGigE0/4/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1162 + HundredGigE0/4/0/7 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1163 + HundredGigE0/4/0/7 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1164 + HundredGigE0/4/0/7 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1165 + FourHundredGigE0/4/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1166 + FourHundredGigE0/4/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1167 + FourHundredGigE0/4/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1168 + HundredGigE0/4/0/8 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1169 + HundredGigE0/4/0/8 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1170 + HundredGigE0/4/0/8 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1171 + FourHundredGigE0/4/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1172 + FourHundredGigE0/4/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1173 + FourHundredGigE0/4/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1174 + HundredGigE0/4/0/9 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1175 + HundredGigE0/4/0/9 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1176 + HundredGigE0/4/0/9 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1177 + FourHundredGigE0/4/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1178 + FourHundredGigE0/4/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1179 + FourHundredGigE0/4/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1180 + HundredGigE0/4/0/10 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1181 + HundredGigE0/4/0/10 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1182 + HundredGigE0/4/0/10 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1183 + FourHundredGigE0/4/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1184 + FourHundredGigE0/4/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1185 + FourHundredGigE0/4/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1186 + HundredGigE0/4/0/11 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1187 + HundredGigE0/4/0/11 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1188 + HundredGigE0/4/0/11 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1189 + FourHundredGigE0/4/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1190 + FourHundredGigE0/4/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1191 + FourHundredGigE0/4/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1192 + HundredGigE0/4/0/12 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1193 + HundredGigE0/4/0/12 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1194 + HundredGigE0/4/0/12 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1195 + FourHundredGigE0/4/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1196 + FourHundredGigE0/4/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1197 + FourHundredGigE0/4/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1198 + HundredGigE0/4/0/13 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1199 + HundredGigE0/4/0/13 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1200 + HundredGigE0/4/0/13 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1201 + FourHundredGigE0/4/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1202 + FourHundredGigE0/4/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1203 + FourHundredGigE0/4/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1204 + HundredGigE0/4/0/14 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1205 + HundredGigE0/4/0/14 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1206 + HundredGigE0/4/0/14 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1207 + FourHundredGigE0/4/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1208 + FourHundredGigE0/4/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1209 + FourHundredGigE0/4/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1210 + HundredGigE0/4/0/15 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1211 + HundredGigE0/4/0/15 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1212 + HundredGigE0/4/0/15 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1213 + FourHundredGigE0/4/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1214 + FourHundredGigE0/4/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1215 + FourHundredGigE0/4/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1216 + HundredGigE0/4/0/16 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1217 + HundredGigE0/4/0/16 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1218 + HundredGigE0/4/0/16 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1219 + FourHundredGigE0/4/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1220 + FourHundredGigE0/4/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1221 + FourHundredGigE0/4/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1222 + HundredGigE0/4/0/17 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1223 + HundredGigE0/4/0/17 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1224 + HundredGigE0/4/0/17 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1225 + FourHundredGigE0/4/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1226 + FourHundredGigE0/4/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1227 + FourHundredGigE0/4/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1228 + HundredGigE0/4/0/18 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1229 + HundredGigE0/4/0/18 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1230 + HundredGigE0/4/0/18 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1231 + FourHundredGigE0/4/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1232 + FourHundredGigE0/4/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1233 + FourHundredGigE0/4/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1234 + HundredGigE0/4/0/19 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1235 + HundredGigE0/4/0/19 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1236 + HundredGigE0/4/0/19 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1237 + FourHundredGigE0/4/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1238 + FourHundredGigE0/4/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1239 + FourHundredGigE0/4/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1240 + HundredGigE0/4/0/20 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1241 + HundredGigE0/4/0/20 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1242 + HundredGigE0/4/0/20 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1243 + FourHundredGigE0/4/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1244 + FourHundredGigE0/4/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1245 + FourHundredGigE0/4/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1246 + HundredGigE0/4/0/21 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1247 + HundredGigE0/4/0/21 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1248 + HundredGigE0/4/0/21 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1249 + FourHundredGigE0/4/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1250 + FourHundredGigE0/4/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1251 + FourHundredGigE0/4/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1252 + HundredGigE0/4/0/22 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1253 + HundredGigE0/4/0/22 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1254 + HundredGigE0/4/0/22 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1255 + FourHundredGigE0/4/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1256 + FourHundredGigE0/4/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1257 + FourHundredGigE0/4/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1258 + HundredGigE0/4/0/23 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1259 + HundredGigE0/4/0/23 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1260 + HundredGigE0/4/0/23 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1261 + FourHundredGigE0/4/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1262 + FourHundredGigE0/4/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1263 + FourHundredGigE0/4/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1264 + HundredGigE0/4/0/24 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1265 + HundredGigE0/4/0/24 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1266 + HundredGigE0/4/0/24 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1267 + FourHundredGigE0/4/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1268 + FourHundredGigE0/4/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1269 + FourHundredGigE0/4/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1270 + HundredGigE0/4/0/25 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1271 + HundredGigE0/4/0/25 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1272 + HundredGigE0/4/0/25 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1273 + FourHundredGigE0/4/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1274 + FourHundredGigE0/4/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1275 + FourHundredGigE0/4/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1276 + HundredGigE0/4/0/26 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1277 + HundredGigE0/4/0/26 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1278 + HundredGigE0/4/0/26 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1279 + FourHundredGigE0/4/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1280 + FourHundredGigE0/4/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1281 + FourHundredGigE0/4/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1282 + HundredGigE0/4/0/27 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1283 + HundredGigE0/4/0/27 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1284 + HundredGigE0/4/0/27 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1285 + FourHundredGigE0/4/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1286 + FourHundredGigE0/4/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1287 + FourHundredGigE0/4/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1288 + HundredGigE0/4/0/28 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1289 + HundredGigE0/4/0/28 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1290 + HundredGigE0/4/0/28 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1291 + FourHundredGigE0/4/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1292 + FourHundredGigE0/4/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1293 + FourHundredGigE0/4/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1294 + HundredGigE0/4/0/29 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1295 + HundredGigE0/4/0/29 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1296 + HundredGigE0/4/0/29 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1297 + FourHundredGigE0/4/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1298 + FourHundredGigE0/4/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1299 + FourHundredGigE0/4/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1300 + HundredGigE0/4/0/30 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1301 + HundredGigE0/4/0/30 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1302 + HundredGigE0/4/0/30 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1303 + FourHundredGigE0/4/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1304 + FourHundredGigE0/4/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1305 + FourHundredGigE0/4/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1306 + HundredGigE0/4/0/31 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1307 + HundredGigE0/4/0/31 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1308 + HundredGigE0/4/0/31 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1309 + FourHundredGigE0/4/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1310 + FourHundredGigE0/4/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1311 + FourHundredGigE0/4/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1312 + HundredGigE0/4/0/32 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1313 + HundredGigE0/4/0/32 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1314 + HundredGigE0/4/0/32 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1315 + FourHundredGigE0/4/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1316 + FourHundredGigE0/4/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1317 + FourHundredGigE0/4/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1318 + HundredGigE0/4/0/33 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1319 + HundredGigE0/4/0/33 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1320 + HundredGigE0/4/0/33 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1321 + FourHundredGigE0/4/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1322 + FourHundredGigE0/4/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1323 + FourHundredGigE0/4/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1324 + HundredGigE0/4/0/34 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1325 + HundredGigE0/4/0/34 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1326 + HundredGigE0/4/0/34 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1327 + FourHundredGigE0/4/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1328 + FourHundredGigE0/4/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1329 + FourHundredGigE0/4/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + false + 1330 + HundredGigE0/4/0/35 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + false + 1331 + HundredGigE0/4/0/35 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + false + 1332 + HundredGigE0/4/0/35 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + + + DeviceInterface + + false + 1 + power0 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 2 + power1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 3 + power0 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 4 + power1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 5 + power0 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 6 + power1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 7 + power0 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 8 + power1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 9 + power0 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 10 + power1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 11 + power0 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + false + 12 + power1 + false + + + 0 + + C19 + C19 + true + + + + + + DeviceInterface + + false + 1 + rp0-console0 + false + console + + 115200 + false + + + + DeviceInterface + + false + 2 + logical0 + false + logical0 + + 115200 + true + 0 + + + DeviceInterface + + false + 3 + logical1 + false + logical1 + + 115200 + true + 1 + + + DeviceInterface + + false + 4 + logical2 + false + logical2 + + 115200 + true + 2 + + + DeviceInterface + + false + 5 + logical3 + false + logical3 + + 115200 + true + 3 + + + DeviceInterface + + false + 6 + logical4 + false + logical4 + + 115200 + true + 4 + + + DeviceInterface + + false + 7 + logical5 + false + logical5 + + 115200 + true + 5 + + + DeviceInterface + + false + 8 + logical6 + false + logical6 + + 115200 + true + 6 + + + DeviceInterface + + false + 9 + logical7 + false + logical7 + + 115200 + true + 7 + + + DeviceInterface + + false + 10 + logical8 + false + logical8 + + 115200 + true + 8 + + + DeviceInterface + + false + 11 + logical9 + false + logical9 + + 115200 + true + 9 + + + DeviceInterface + + false + 12 + logical10 + false + logical10 + + 115200 + true + 10 + + + DeviceInterface + + false + 13 + logical11 + false + logical11 + + 115200 + true + 11 + + + DeviceInterface + + false + 14 + logical12 + false + logical12 + + 115200 + true + 12 + + + + Sonic + + + + + + + + + + + + str-sonic-sup00-ASIC00 + + + PortChannelInterface + PortChannel5001 + Eth96;Eth100 + + + + PortChannelInterface + PortChannel5002 + Eth104;Eth108 + + + + PortChannelInterface + PortChannel5003 + Eth112;Eth116 + + + + PortChannelInterface + PortChannel5004 + Eth128;Eth132 + + + + PortChannelInterface + PortChannel5005 + Eth136;Eth140 + + + + PortChannelInterface + PortChannel5006 + Eth154;Eth168;Eth178 + + + + PortChannelInterface + PortChannel5007 + Eth156;Eth170;Eth180 + + + + PortChannelInterface + PortChannel5008 + Eth160;Eth164 + + + + PortChannelInterface + PortChannel5009 + Eth184;Eth194;Eth220 + + + + PortChannelInterface + PortChannel5010 + Eth190;Eth192;Eth218 + + + + PortChannelInterface + PortChannel5011 + Eth208;Eth212 + + + + PortChannelInterface + PortChannel5012 + Eth232;Eth236 + + + + PortChannelInterface + PortChannel5013 + Eth240;Eth244 + + + + + + + VlanInterface + Vlan2 + PortChannel5001;PortChannel5002;PortChannel5003;PortChannel5004;PortChannel5005;PortChannel5006;PortChannel5007;PortChannel5008;PortChannel5009;PortChannel5010;PortChannel5011;PortChannel5012;PortChannel5013 + + UnTagged + 2 + 2 + 10.235.96.0/25;fc00:34::a:eb60:1/113 + + + + + + + + + + + + + + + + + + + + str-sonic-sup00-ASIC01 + + + PortChannelInterface + PortChannel5014 + Eth96;Eth100 + + + + PortChannelInterface + PortChannel5015 + Eth104;Eth108 + + + + PortChannelInterface + PortChannel5016 + Eth112;Eth116 + + + + PortChannelInterface + PortChannel5017 + Eth128;Eth132 + + + + PortChannelInterface + PortChannel5018 + Eth136;Eth140 + + + + PortChannelInterface + PortChannel5019 + Eth152;Eth156 + + + + PortChannelInterface + PortChannel5020 + Eth160;Eth164 + + + + PortChannelInterface + PortChannel5021 + Eth168;Eth172 + + + + PortChannelInterface + PortChannel5022 + Eth176;Eth180 + + + + PortChannelInterface + PortChannel5023 + Eth184;Eth188;Eth194;Eth216 + + + + PortChannelInterface + PortChannel5024 + Eth190;Eth192;Eth196;Eth222 + + + + PortChannelInterface + PortChannel5025 + Eth208;Eth212;Eth234;Eth244 + + + + PortChannelInterface + PortChannel5026 + Eth214;Eth232;Eth236;Eth242 + + + + + + + VlanInterface + Vlan2 + PortChannel5014;PortChannel5015;PortChannel5016;PortChannel5017;PortChannel5018;PortChannel5019;PortChannel5020;PortChannel5021;PortChannel5022;PortChannel5023;PortChannel5024;PortChannel5025;PortChannel5026 + + UnTagged + 2 + 2 + 10.235.96.128/25;fc00:34::a:eb60:8001/113 + + + + + + + + + + + + + + + + + + + + str-sonic-sup00-ASIC04 + + + PortChannelInterface + PortChannel5027 + Eth96;Eth100 + + + + PortChannelInterface + PortChannel5028 + Eth104;Eth108 + + + + PortChannelInterface + PortChannel5029 + Eth112;Eth116 + + + + PortChannelInterface + PortChannel5030 + Eth128;Eth132 + + + + PortChannelInterface + PortChannel5031 + Eth136;Eth140 + + + + PortChannelInterface + PortChannel5032 + Eth154;Eth168;Eth178 + + + + PortChannelInterface + PortChannel5033 + Eth156;Eth170;Eth180 + + + + PortChannelInterface + PortChannel5034 + Eth160;Eth164 + + + + PortChannelInterface + PortChannel5035 + Eth184;Eth194;Eth220 + + + + PortChannelInterface + PortChannel5036 + Eth190;Eth192;Eth218 + + + + PortChannelInterface + PortChannel5037 + Eth208;Eth212 + + + + PortChannelInterface + PortChannel5038 + Eth232;Eth236 + + + + PortChannelInterface + PortChannel5039 + Eth240;Eth244 + + + + + + + VlanInterface + Vlan2 + PortChannel5027;PortChannel5028;PortChannel5029;PortChannel5030;PortChannel5031;PortChannel5032;PortChannel5033;PortChannel5034;PortChannel5035;PortChannel5036;PortChannel5037;PortChannel5038;PortChannel5039 + + UnTagged + 2 + 2 + 10.235.97.0/25;fc00:34::a:eb61:1/113 + + + + + + + + + + + + + + + + + + + + str-sonic-sup00-ASIC05 + + + PortChannelInterface + PortChannel5040 + Eth96;Eth100 + + + + PortChannelInterface + PortChannel5041 + Eth104;Eth108 + + + + PortChannelInterface + PortChannel5042 + Eth112;Eth116 + + + + PortChannelInterface + PortChannel5043 + Eth128;Eth132 + + + + PortChannelInterface + PortChannel5044 + Eth136;Eth140 + + + + PortChannelInterface + PortChannel5045 + Eth152;Eth156 + + + + PortChannelInterface + PortChannel5046 + Eth160;Eth164 + + + + PortChannelInterface + PortChannel5047 + Eth168;Eth172 + + + + PortChannelInterface + PortChannel5048 + Eth176;Eth180 + + + + PortChannelInterface + PortChannel5049 + Eth184;Eth188;Eth194;Eth216 + + + + PortChannelInterface + PortChannel5050 + Eth190;Eth192;Eth196;Eth222 + + + + PortChannelInterface + PortChannel5051 + Eth208;Eth212;Eth234;Eth244 + + + + PortChannelInterface + PortChannel5052 + Eth214;Eth232;Eth236;Eth242 + + + + + + + VlanInterface + Vlan2 + PortChannel5040;PortChannel5041;PortChannel5042;PortChannel5043;PortChannel5044;PortChannel5045;PortChannel5046;PortChannel5047;PortChannel5048;PortChannel5049;PortChannel5050;PortChannel5051;PortChannel5052 + + UnTagged + 2 + 2 + 10.235.97.128/25;fc00:34::a:eb61:8001/113 + + + + + + + + + + + + + + + + + + + + str-sonic-sup00-ASIC08 + + + PortChannelInterface + PortChannel5053 + Eth96;Eth100 + + + + PortChannelInterface + PortChannel5054 + Eth104;Eth108 + + + + PortChannelInterface + PortChannel5055 + Eth112;Eth116 + + + + PortChannelInterface + PortChannel5056 + Eth128;Eth132 + + + + PortChannelInterface + PortChannel5057 + Eth136;Eth140 + + + + PortChannelInterface + PortChannel5058 + Eth154;Eth168;Eth178 + + + + PortChannelInterface + PortChannel5059 + Eth156;Eth170;Eth180 + + + + PortChannelInterface + PortChannel5060 + Eth160;Eth164 + + + + PortChannelInterface + PortChannel5061 + Eth184;Eth194;Eth220 + + + + PortChannelInterface + PortChannel5062 + Eth190;Eth192;Eth218 + + + + PortChannelInterface + PortChannel5063 + Eth208;Eth212 + + + + PortChannelInterface + PortChannel5064 + Eth232;Eth236 + + + + PortChannelInterface + PortChannel5065 + Eth240;Eth244 + + + + + + + VlanInterface + Vlan2 + PortChannel5053;PortChannel5054;PortChannel5055;PortChannel5056;PortChannel5057;PortChannel5058;PortChannel5059;PortChannel5060;PortChannel5061;PortChannel5062;PortChannel5063;PortChannel5064;PortChannel5065 + + UnTagged + 2 + 2 + 10.235.98.0/25;fc00:34::a:eb62:1/113 + + + + + + + + + + + + + + + + + + + + str-sonic-sup00-ASIC09 + + + PortChannelInterface + PortChannel5066 + Eth96;Eth100 + + + + PortChannelInterface + PortChannel5067 + Eth104;Eth108 + + + + PortChannelInterface + PortChannel5068 + Eth112;Eth116 + + + + PortChannelInterface + PortChannel5069 + Eth128;Eth132 + + + + PortChannelInterface + PortChannel5070 + Eth136;Eth140 + + + + PortChannelInterface + PortChannel5071 + Eth152;Eth156 + + + + PortChannelInterface + PortChannel5072 + Eth160;Eth164 + + + + PortChannelInterface + PortChannel5073 + Eth168;Eth172 + + + + PortChannelInterface + PortChannel5074 + Eth176;Eth180 + + + + PortChannelInterface + PortChannel5075 + Eth184;Eth188;Eth194;Eth216 + + + + PortChannelInterface + PortChannel5076 + Eth190;Eth192;Eth196;Eth222 + + + + PortChannelInterface + PortChannel5077 + Eth208;Eth212;Eth234;Eth244 + + + + PortChannelInterface + PortChannel5078 + Eth214;Eth232;Eth236;Eth242 + + + + + + + VlanInterface + Vlan2 + PortChannel5066;PortChannel5067;PortChannel5068;PortChannel5069;PortChannel5070;PortChannel5071;PortChannel5072;PortChannel5073;PortChannel5074;PortChannel5075;PortChannel5076;PortChannel5077;PortChannel5078 + + UnTagged + 2 + 2 + 10.235.98.128/25;fc00:34::a:eb62:8001/113 + + + + + + + + + + + + + + + + + + + + str-sonic-sup00-ASIC10 + + + PortChannelInterface + PortChannel5079 + Eth96;Eth100 + + + + PortChannelInterface + PortChannel5080 + Eth104;Eth108 + + + + PortChannelInterface + PortChannel5081 + Eth112;Eth116 + + + + PortChannelInterface + PortChannel5082 + Eth128;Eth132 + + + + PortChannelInterface + PortChannel5083 + Eth136;Eth140 + + + + PortChannelInterface + PortChannel5084 + Eth154;Eth168;Eth178 + + + + PortChannelInterface + PortChannel5085 + Eth156;Eth170;Eth180 + + + + PortChannelInterface + PortChannel5086 + Eth160;Eth164 + + + + PortChannelInterface + PortChannel5087 + Eth184;Eth194;Eth220 + + + + PortChannelInterface + PortChannel5088 + Eth190;Eth192;Eth218 + + + + PortChannelInterface + PortChannel5089 + Eth208;Eth212 + + + + PortChannelInterface + PortChannel5090 + Eth232;Eth236 + + + + PortChannelInterface + PortChannel5091 + Eth240;Eth244 + + + + + + + VlanInterface + Vlan2 + PortChannel5079;PortChannel5080;PortChannel5081;PortChannel5082;PortChannel5083;PortChannel5084;PortChannel5085;PortChannel5086;PortChannel5087;PortChannel5088;PortChannel5089;PortChannel5090;PortChannel5091 + + UnTagged + 2 + 2 + 10.235.99.0/25;fc00:34::a:eb63:1/113 + + + + + + + + + + + + + + + + + + + + str-sonic-sup00-ASIC11 + + + PortChannelInterface + PortChannel5092 + Eth96;Eth100 + + + + PortChannelInterface + PortChannel5093 + Eth104;Eth108 + + + + PortChannelInterface + PortChannel5094 + Eth112;Eth116 + + + + PortChannelInterface + PortChannel5095 + Eth128;Eth132 + + + + PortChannelInterface + PortChannel5096 + Eth136;Eth140 + + + + PortChannelInterface + PortChannel5097 + Eth152;Eth156 + + + + PortChannelInterface + PortChannel5098 + Eth160;Eth164 + + + + PortChannelInterface + PortChannel5099 + Eth168;Eth172 + + + + PortChannelInterface + PortChannel5100 + Eth176;Eth180 + + + + PortChannelInterface + PortChannel5101 + Eth184;Eth188;Eth194;Eth216 + + + + PortChannelInterface + PortChannel5102 + Eth190;Eth192;Eth196;Eth222 + + + + PortChannelInterface + PortChannel5103 + Eth208;Eth212;Eth234;Eth244 + + + + PortChannelInterface + PortChannel5104 + Eth214;Eth232;Eth236;Eth242 + + + + + + + VlanInterface + Vlan2 + PortChannel5092;PortChannel5093;PortChannel5094;PortChannel5095;PortChannel5096;PortChannel5097;PortChannel5098;PortChannel5099;PortChannel5100;PortChannel5101;PortChannel5102;PortChannel5103;PortChannel5104 + + UnTagged + 2 + 2 + 10.235.99.128/25;fc00:34::a:eb63:8001/113 + + + + + + + + + + + + + + + + + + + + str-sonic-sup00-ASIC12 + + + PortChannelInterface + PortChannel5105 + Eth96;Eth100 + + + + PortChannelInterface + PortChannel5106 + Eth104;Eth108 + + + + PortChannelInterface + PortChannel5107 + Eth112;Eth116 + + + + PortChannelInterface + PortChannel5108 + Eth128;Eth132 + + + + PortChannelInterface + PortChannel5109 + Eth136;Eth140 + + + + PortChannelInterface + PortChannel5110 + Eth154;Eth168;Eth178 + + + + PortChannelInterface + PortChannel5111 + Eth156;Eth170;Eth180 + + + + PortChannelInterface + PortChannel5112 + Eth160;Eth164 + + + + PortChannelInterface + PortChannel5113 + Eth184;Eth194;Eth220 + + + + PortChannelInterface + PortChannel5114 + Eth190;Eth192;Eth218 + + + + PortChannelInterface + PortChannel5115 + Eth208;Eth212 + + + + PortChannelInterface + PortChannel5116 + Eth232;Eth236 + + + + PortChannelInterface + PortChannel5117 + Eth240;Eth244 + + + + + + + VlanInterface + Vlan2 + PortChannel5105;PortChannel5106;PortChannel5107;PortChannel5108;PortChannel5109;PortChannel5110;PortChannel5111;PortChannel5112;PortChannel5113;PortChannel5114;PortChannel5115;PortChannel5116;PortChannel5117 + + UnTagged + 2 + 2 + 10.235.100.0/25;fc00:34::a:eb64:1/113 + + + + + + + + + + + + + + + + + + + + str-sonic-sup00-ASIC13 + + + PortChannelInterface + PortChannel5118 + Eth96;Eth100 + + + + PortChannelInterface + PortChannel5119 + Eth104;Eth108 + + + + PortChannelInterface + PortChannel5120 + Eth112;Eth116 + + + + PortChannelInterface + PortChannel5121 + Eth128;Eth132 + + + + PortChannelInterface + PortChannel5122 + Eth136;Eth140 + + + + PortChannelInterface + PortChannel5123 + Eth152;Eth156 + + + + PortChannelInterface + PortChannel5124 + Eth160;Eth164 + + + + PortChannelInterface + PortChannel5125 + Eth168;Eth172 + + + + PortChannelInterface + PortChannel5126 + Eth176;Eth180 + + + + PortChannelInterface + PortChannel5127 + Eth184;Eth188;Eth194;Eth216 + + + + PortChannelInterface + PortChannel5128 + Eth190;Eth192;Eth196;Eth222 + + + + PortChannelInterface + PortChannel5129 + Eth208;Eth212;Eth234;Eth244 + + + + PortChannelInterface + PortChannel5130 + Eth214;Eth232;Eth236;Eth242 + + + + + + + VlanInterface + Vlan2 + PortChannel5118;PortChannel5119;PortChannel5120;PortChannel5121;PortChannel5122;PortChannel5123;PortChannel5124;PortChannel5125;PortChannel5126;PortChannel5127;PortChannel5128;PortChannel5129;PortChannel5130 + + UnTagged + 2 + 2 + 10.235.100.128/25;fc00:34::a:eb64:8001/113 + + + + + + + + + + + + + + + + LoopbackInterface + HostIP + Loopback0 + + 10.3.0.5/32 + + 10.3.0.5/32 + + + LoopbackInterface + HostIP1 + Loopback0 + + fc00:34::1/128 + + fc00:34::1/128 + + + + + ManagementInterface + ManagementIP + Management1/1 + + 10.3.146.198/24 + + 10.3.146.198/24 + + + + ManagementInterface + v6ManagementIP + Management1/1 + + 2a01:111:e210:3000::a03:92c6/64 + + 2a01:111:e210:3000::a03:92c6/64 + + + + + + + + str-sonic-sup00 + + + + + + + + + + + + + + + str-sonic-sup00:console;str-console-194:port 27 + + + FlowControl + + False + + + str-sonic:rp0-console0;str-console-194:port 27 + + + + + + + + str-sonic-sup00-ASIC00 + + + ForwardingMethod + + chassis-packet + + + ParentHardwareFabricSkuName + + sonic-sup-sku + + + SubRole + + BackEnd + + + ProviderLineCard + + str-sonic-fc00 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC01 + + + ForwardingMethod + + chassis-packet + + + ParentHardwareFabricSkuName + + sonic-sup-sku + + + SubRole + + BackEnd + + + ProviderLineCard + + str-sonic-fc00 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC04 + + + ForwardingMethod + + chassis-packet + + + ParentHardwareFabricSkuName + + sonic-sup-sku + + + SubRole + + BackEnd + + + AsicSwitchId + + 8 + + + ProviderLineCard + + str-sonic-fc02 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC05 + + + ForwardingMethod + + chassis-packet + + + ParentHardwareFabricSkuName + + sonic-sup-sku + + + SubRole + + BackEnd + + + AsicSwitchId + + 9 + + + ProviderLineCard + + str-sonic-fc02 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC08 + + + ForwardingMethod + + chassis-packet + + + ParentHardwareFabricSkuName + + sonic-sup-sku + + + SubRole + + BackEnd + + + AsicSwitchId + + 20 + + + ProviderLineCard + + str-sonic-fc04 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC09 + + + ForwardingMethod + + chassis-packet + + + ParentHardwareFabricSkuName + + sonic-sup-sku + + + SubRole + + BackEnd + + + AsicSwitchId + + 21 + + + ProviderLineCard + + str-sonic-fc04 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC10 + + + ForwardingMethod + + chassis-packet + + + ParentHardwareFabricSkuName + + sonic-sup-sku + + + SubRole + + BackEnd + + + AsicSwitchId + + 26 + + + ProviderLineCard + + str-sonic-fc05 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC11 + + + ForwardingMethod + + chassis-packet + + + ParentHardwareFabricSkuName + + sonic-sup-sku + + + SubRole + + BackEnd + + + AsicSwitchId + + 27 + + + ProviderLineCard + + str-sonic-fc05 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC12 + + + ForwardingMethod + + chassis-packet + + + ParentHardwareFabricSkuName + + sonic-sup-sku + + + SubRole + + BackEnd + + + AsicSwitchId + + 32 + + + ProviderLineCard + + str-sonic-fc06 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC13 + + + ForwardingMethod + + chassis-packet + + + ParentHardwareFabricSkuName + + sonic-sup-sku + + + SubRole + + BackEnd + + + AsicSwitchId + + 33 + + + ProviderLineCard + + str-sonic-fc06 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00 + + + FirmwareProfile + + SONiC-sonic-sup-sku-sup + + + ForwardingMethod + + chassis-packet + + + OsVersion + + SONiC.20220532.45 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-sup00-ASIC00;str-sonic-sup00-ASIC01;str-sonic-sup00-ASIC04;str-sonic-sup00-ASIC05;str-sonic-sup00-ASIC08;str-sonic-sup00-ASIC09;str-sonic-sup00-ASIC10;str-sonic-sup00-ASIC11;str-sonic-sup00-ASIC12;str-sonic-sup00-ASIC13 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic + + + CloudType + + Public + + + ConfigDbAclFile + + SonicNativeAcl.liquid + + + ConfigTemplateFile + + Sonic.xml + + + DNSServers + + 10.64.5.5;10.64.6.6;10.64.6.7 + + + DcCode + + STR + + + DeploymentId + + 3 + + + ErspanDestinationIpv4 + + 10.20.6.4 + + + FirmwareProfile + + SONiC-sonic-sup-sku-sup + + + Function + + LabTest + + + Group + + str:-1848794319 + + + InitConfigTemplateFile + + Sonic.init.xml + + + Location + + TBD + + + Loopback0Ipv4 + + 10.3.0.1/32;10.3.0.2/32;10.3.0.3/32;10.3.0.4/32;10.3.0.5/32 + + + Loopback0Ipv6 + + fc00:30::1/128;fc00:31::1/128;fc00:32::1/128;fc00:33::1/128;fc00:34::1/128 + + + Loopback4096Ipv4 + + 192.0.0.1/32;192.0.0.2/32;192.0.0.3/32;192.0.0.4/32;192.0.0.5/32;192.0.0.6/32;192.0.0.7/32;192.0.0.8/32;192.0.0.9/32;192.0.0.10/32;192.0.0.11/32;192.0.0.12/32;192.0.0.13/32 + + + Loopback4096Ipv6 + + 2603:10e2:400::1/128;2603:10e2:400::2/128;2603:10e2:400::3/128;2603:10e2:400::4/128;2603:10e2:400::5/128;2603:10e2:400::6/128;2603:10e2:400::7/128;2603:10e2:400::8/128;2603:10e2:400::9/128;2603:10e2:400::a/128;2603:10e2:400::b/128;2603:10e2:400::c/128;2603:10e2:400::d/128 + + + MacSecEnabled + + True + + + MacSecProfile + usstagee.Sonic.MacSec + PrimaryKey="macsec-profile-two" FallbackKey="macsec-profile" MacsecPolicy="" + + + ManagementIpv4 + + 10.3.146.199/24;10.3.146.200/24;10.3.146.201/24;10.3.146.205/24;10.3.146.214/24 + + + ManagementIpv6 + + 2a01:111:e210:3000::a03:92c7/64;2a01:111:e210:3000::a03:92c8/64;2a01:111:e210:3000::a03:92c9/64;2a01:111:e210:3000::a03:92cd/64;2a01:111:e210:3000::a03:92d6/64 + + + MaxCountOfCores + + 64 + + + NtpResources + Public.Ntp + 17.39.1.129;17.39.1.130 + + + QosProfile + + VerlaineLongHaul + + + RemoteAuthenticationProtocol + + Tacacs + + + SnmpResources + + 10.52.180.161;10.3.157.12 + + + SonicConfigTemplateFile + + Sonic.xml + + + SonicEnabled + + True + + + SyslogResources + + 10.52.180.161;10.3.157.12 + + + SyslogServer + + 10.20.4.167;10.20.7.33;10.20.6.16;10.20.6.84 + + + TacacsKey + + $Secrets.TacacsKey + + + TacacsSecurityLevel + + 7 + + + TacacsServer + + 123.46.98.21 + + + OsVersion + + SONiC.20220532.45 + + + Region + + test + + + ChassisEnabled + + true + + + + + + + + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth96 + true + str-sonic-lc04-ASIC00 + Eth396 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth100 + true + str-sonic-lc04-ASIC00 + Eth392 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth104 + true + str-sonic-lc04-ASIC01 + Eth404 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth108 + true + str-sonic-lc04-ASIC01 + Eth400 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth112 + true + str-sonic-lc04-ASIC02 + Eth392 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth116 + true + str-sonic-lc04-ASIC02 + Eth396 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth128 + true + str-sonic-lc03-ASIC00 + Eth396 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth132 + true + str-sonic-lc03-ASIC00 + Eth392 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth136 + true + str-sonic-lc03-ASIC01 + Eth404 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth140 + true + str-sonic-lc03-ASIC01 + Eth400 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth154 + true + str-sonic-lc02-ASIC01 + Eth288 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth156 + true + str-sonic-lc02-ASIC00 + Eth294 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth160 + true + str-sonic-lc03-ASIC02 + Eth396 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth164 + true + str-sonic-lc03-ASIC02 + Eth392 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth168 + true + str-sonic-lc02-ASIC01 + Eth292 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth170 + true + str-sonic-lc02-ASIC00 + Eth290 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth178 + true + str-sonic-lc02-ASIC01 + Eth294 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth180 + true + str-sonic-lc02-ASIC00 + Eth292 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth184 + true + str-sonic-lc01-ASIC00 + Eth294 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth190 + true + str-sonic-lc01-ASIC01 + Eth288 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth192 + true + str-sonic-lc01-ASIC01 + Eth292 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth194 + true + str-sonic-lc01-ASIC00 + Eth290 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth208 + true + str-sonic-lc00-ASIC00 + Eth396 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth212 + true + str-sonic-lc00-ASIC00 + Eth392 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth218 + true + str-sonic-lc01-ASIC01 + Eth294 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC00 + Eth220 + true + str-sonic-lc01-ASIC00 + Eth292 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth232 + true + str-sonic-lc00-ASIC01 + Eth404 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth236 + true + str-sonic-lc00-ASIC01 + Eth400 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth240 + true + str-sonic-lc00-ASIC02 + Eth392 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC00 + Eth244 + true + str-sonic-lc00-ASIC02 + Eth396 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth96 + true + str-sonic-lc04-ASIC00 + Eth404 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth100 + true + str-sonic-lc04-ASIC00 + Eth400 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth104 + true + str-sonic-lc04-ASIC01 + Eth396 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth108 + true + str-sonic-lc04-ASIC01 + Eth392 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth112 + true + str-sonic-lc04-ASIC02 + Eth400 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth116 + true + str-sonic-lc04-ASIC02 + Eth404 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth128 + true + str-sonic-lc03-ASIC00 + Eth404 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth132 + true + str-sonic-lc03-ASIC00 + Eth400 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth136 + true + str-sonic-lc03-ASIC01 + Eth396 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth140 + true + str-sonic-lc03-ASIC01 + Eth392 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth152 + true + str-sonic-lc00-ASIC02 + Eth400 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth156 + true + str-sonic-lc00-ASIC02 + Eth404 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth160 + true + str-sonic-lc03-ASIC02 + Eth400 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth164 + true + str-sonic-lc03-ASIC02 + Eth404 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth168 + true + str-sonic-lc00-ASIC00 + Eth404 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth172 + true + str-sonic-lc00-ASIC00 + Eth400 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth176 + true + str-sonic-lc00-ASIC01 + Eth396 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC01 + Eth180 + true + str-sonic-lc00-ASIC01 + Eth392 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth184 + true + str-sonic-lc02-ASIC00 + Eth286 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth188 + true + str-sonic-lc02-ASIC00 + Eth288 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth190 + true + str-sonic-lc02-ASIC01 + Eth192 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth192 + true + str-sonic-lc02-ASIC01 + Eth302 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth194 + true + str-sonic-lc02-ASIC00 + Eth192 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth196 + true + str-sonic-lc02-ASIC01 + Eth290 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth208 + true + str-sonic-lc01-ASIC00 + Eth286 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth212 + true + str-sonic-lc01-ASIC00 + Eth288 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth214 + true + str-sonic-lc01-ASIC01 + Eth192 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth216 + true + str-sonic-lc02-ASIC00 + Eth302 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth222 + true + str-sonic-lc02-ASIC01 + Eth286 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth232 + true + str-sonic-lc01-ASIC01 + Eth302 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth234 + true + str-sonic-lc01-ASIC00 + Eth192 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth236 + true + str-sonic-lc01-ASIC01 + Eth290 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth242 + true + str-sonic-lc01-ASIC01 + Eth286 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC01 + Eth244 + true + str-sonic-lc01-ASIC00 + Eth302 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth96 + true + str-sonic-lc04-ASIC00 + Eth380 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth100 + true + str-sonic-lc04-ASIC00 + Eth376 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth104 + true + str-sonic-lc04-ASIC01 + Eth380 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth108 + true + str-sonic-lc04-ASIC01 + Eth376 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth112 + true + str-sonic-lc04-ASIC02 + Eth376 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth116 + true + str-sonic-lc04-ASIC02 + Eth380 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth128 + true + str-sonic-lc03-ASIC00 + Eth380 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth132 + true + str-sonic-lc03-ASIC00 + Eth376 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth136 + true + str-sonic-lc03-ASIC01 + Eth380 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth140 + true + str-sonic-lc03-ASIC01 + Eth376 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth154 + true + str-sonic-lc02-ASIC01 + Eth282 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth156 + true + str-sonic-lc02-ASIC00 + Eth264 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth160 + true + str-sonic-lc03-ASIC02 + Eth380 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth164 + true + str-sonic-lc03-ASIC02 + Eth376 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth168 + true + str-sonic-lc02-ASIC01 + Eth266 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth170 + true + str-sonic-lc02-ASIC00 + Eth282 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth178 + true + str-sonic-lc02-ASIC01 + Eth264 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth180 + true + str-sonic-lc02-ASIC00 + Eth266 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth184 + true + str-sonic-lc01-ASIC00 + Eth264 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth190 + true + str-sonic-lc01-ASIC01 + Eth282 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth192 + true + str-sonic-lc01-ASIC01 + Eth266 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth194 + true + str-sonic-lc01-ASIC00 + Eth282 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth208 + true + str-sonic-lc00-ASIC00 + Eth380 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth212 + true + str-sonic-lc00-ASIC00 + Eth376 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth218 + true + str-sonic-lc01-ASIC01 + Eth264 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC04 + Eth220 + true + str-sonic-lc01-ASIC00 + Eth266 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth232 + true + str-sonic-lc00-ASIC01 + Eth380 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth236 + true + str-sonic-lc00-ASIC01 + Eth376 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth240 + true + str-sonic-lc00-ASIC02 + Eth376 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC04 + Eth244 + true + str-sonic-lc00-ASIC02 + Eth380 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth96 + true + str-sonic-lc04-ASIC00 + Eth388 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth100 + true + str-sonic-lc04-ASIC00 + Eth384 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth104 + true + str-sonic-lc04-ASIC01 + Eth388 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth108 + true + str-sonic-lc04-ASIC01 + Eth384 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth112 + true + str-sonic-lc04-ASIC02 + Eth384 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth116 + true + str-sonic-lc04-ASIC02 + Eth388 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth128 + true + str-sonic-lc03-ASIC00 + Eth388 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth132 + true + str-sonic-lc03-ASIC00 + Eth384 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth136 + true + str-sonic-lc03-ASIC01 + Eth388 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth140 + true + str-sonic-lc03-ASIC01 + Eth384 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth152 + true + str-sonic-lc00-ASIC02 + Eth384 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth156 + true + str-sonic-lc00-ASIC02 + Eth388 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth160 + true + str-sonic-lc03-ASIC02 + Eth384 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth164 + true + str-sonic-lc03-ASIC02 + Eth388 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth168 + true + str-sonic-lc00-ASIC00 + Eth388 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth172 + true + str-sonic-lc00-ASIC00 + Eth384 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth176 + true + str-sonic-lc00-ASIC01 + Eth388 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC05 + Eth180 + true + str-sonic-lc00-ASIC01 + Eth384 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth184 + true + str-sonic-lc02-ASIC00 + Eth280 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth188 + true + str-sonic-lc02-ASIC00 + Eth284 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth190 + true + str-sonic-lc02-ASIC01 + Eth276 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth192 + true + str-sonic-lc02-ASIC01 + Eth278 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth194 + true + str-sonic-lc02-ASIC00 + Eth276 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth196 + true + str-sonic-lc02-ASIC01 + Eth284 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth208 + true + str-sonic-lc01-ASIC00 + Eth280 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth212 + true + str-sonic-lc01-ASIC00 + Eth284 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth214 + true + str-sonic-lc01-ASIC01 + Eth276 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth216 + true + str-sonic-lc02-ASIC00 + Eth278 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth222 + true + str-sonic-lc02-ASIC01 + Eth280 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth232 + true + str-sonic-lc01-ASIC01 + Eth278 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth234 + true + str-sonic-lc01-ASIC00 + Eth276 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth236 + true + str-sonic-lc01-ASIC01 + Eth284 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth242 + true + str-sonic-lc01-ASIC01 + Eth280 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC05 + Eth244 + true + str-sonic-lc01-ASIC00 + Eth278 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth96 + true + str-sonic-lc04-ASIC00 + Eth364 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth100 + true + str-sonic-lc04-ASIC00 + Eth360 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth104 + true + str-sonic-lc04-ASIC01 + Eth364 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth108 + true + str-sonic-lc04-ASIC01 + Eth360 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth112 + true + str-sonic-lc04-ASIC02 + Eth360 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth116 + true + str-sonic-lc04-ASIC02 + Eth364 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth128 + true + str-sonic-lc03-ASIC00 + Eth364 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth132 + true + str-sonic-lc03-ASIC00 + Eth360 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth136 + true + str-sonic-lc03-ASIC01 + Eth364 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth140 + true + str-sonic-lc03-ASIC01 + Eth360 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth154 + true + str-sonic-lc02-ASIC01 + Eth242 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth156 + true + str-sonic-lc02-ASIC00 + Eth236 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth160 + true + str-sonic-lc03-ASIC02 + Eth364 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth164 + true + str-sonic-lc03-ASIC02 + Eth360 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth168 + true + str-sonic-lc02-ASIC01 + Eth238 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth170 + true + str-sonic-lc02-ASIC00 + Eth242 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth178 + true + str-sonic-lc02-ASIC01 + Eth236 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth180 + true + str-sonic-lc02-ASIC00 + Eth238 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth184 + true + str-sonic-lc01-ASIC00 + Eth236 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth190 + true + str-sonic-lc01-ASIC01 + Eth242 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth192 + true + str-sonic-lc01-ASIC01 + Eth238 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth194 + true + str-sonic-lc01-ASIC00 + Eth242 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth208 + true + str-sonic-lc00-ASIC00 + Eth364 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth212 + true + str-sonic-lc00-ASIC00 + Eth360 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth218 + true + str-sonic-lc01-ASIC01 + Eth236 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC08 + Eth220 + true + str-sonic-lc01-ASIC00 + Eth238 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth232 + true + str-sonic-lc00-ASIC01 + Eth364 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth236 + true + str-sonic-lc00-ASIC01 + Eth360 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth240 + true + str-sonic-lc00-ASIC02 + Eth360 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC08 + Eth244 + true + str-sonic-lc00-ASIC02 + Eth364 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth96 + true + str-sonic-lc04-ASIC00 + Eth328 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth100 + true + str-sonic-lc04-ASIC00 + Eth332 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth104 + true + str-sonic-lc04-ASIC01 + Eth328 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth108 + true + str-sonic-lc04-ASIC01 + Eth332 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth112 + true + str-sonic-lc04-ASIC02 + Eth328 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth116 + true + str-sonic-lc04-ASIC02 + Eth332 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth128 + true + str-sonic-lc03-ASIC00 + Eth328 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth132 + true + str-sonic-lc03-ASIC00 + Eth332 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth136 + true + str-sonic-lc03-ASIC01 + Eth328 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth140 + true + str-sonic-lc03-ASIC01 + Eth332 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth152 + true + str-sonic-lc00-ASIC02 + Eth328 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth156 + true + str-sonic-lc00-ASIC02 + Eth332 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth160 + true + str-sonic-lc03-ASIC02 + Eth328 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth164 + true + str-sonic-lc03-ASIC02 + Eth332 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth168 + true + str-sonic-lc00-ASIC00 + Eth328 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth172 + true + str-sonic-lc00-ASIC00 + Eth332 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth176 + true + str-sonic-lc00-ASIC01 + Eth328 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC09 + Eth180 + true + str-sonic-lc00-ASIC01 + Eth332 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth184 + true + str-sonic-lc02-ASIC00 + Eth244 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth188 + true + str-sonic-lc02-ASIC00 + Eth240 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth190 + true + str-sonic-lc02-ASIC01 + Eth248 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth192 + true + str-sonic-lc02-ASIC01 + Eth246 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth194 + true + str-sonic-lc02-ASIC00 + Eth248 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth196 + true + str-sonic-lc02-ASIC01 + Eth240 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth208 + true + str-sonic-lc01-ASIC00 + Eth244 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth212 + true + str-sonic-lc01-ASIC00 + Eth240 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth214 + true + str-sonic-lc01-ASIC01 + Eth248 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth216 + true + str-sonic-lc02-ASIC00 + Eth246 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth222 + true + str-sonic-lc02-ASIC01 + Eth244 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth232 + true + str-sonic-lc01-ASIC01 + Eth246 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth234 + true + str-sonic-lc01-ASIC00 + Eth248 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth236 + true + str-sonic-lc01-ASIC01 + Eth240 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth242 + true + str-sonic-lc01-ASIC01 + Eth244 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC09 + Eth244 + true + str-sonic-lc01-ASIC00 + Eth246 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth96 + true + str-sonic-lc04-ASIC00 + Eth336 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth100 + true + str-sonic-lc04-ASIC00 + Eth340 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth104 + true + str-sonic-lc04-ASIC01 + Eth336 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth108 + true + str-sonic-lc04-ASIC01 + Eth340 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth112 + true + str-sonic-lc04-ASIC02 + Eth336 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth116 + true + str-sonic-lc04-ASIC02 + Eth340 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth128 + true + str-sonic-lc03-ASIC00 + Eth336 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth132 + true + str-sonic-lc03-ASIC00 + Eth340 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth136 + true + str-sonic-lc03-ASIC01 + Eth336 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth140 + true + str-sonic-lc03-ASIC01 + Eth340 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth154 + true + str-sonic-lc02-ASIC01 + Eth218 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth156 + true + str-sonic-lc02-ASIC00 + Eth222 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth160 + true + str-sonic-lc03-ASIC02 + Eth340 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth164 + true + str-sonic-lc03-ASIC02 + Eth336 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth168 + true + str-sonic-lc02-ASIC01 + Eth214 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth170 + true + str-sonic-lc02-ASIC00 + Eth218 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth178 + true + str-sonic-lc02-ASIC01 + Eth222 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth180 + true + str-sonic-lc02-ASIC00 + Eth214 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth184 + true + str-sonic-lc01-ASIC00 + Eth222 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth190 + true + str-sonic-lc01-ASIC01 + Eth218 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth192 + true + str-sonic-lc01-ASIC01 + Eth214 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth194 + true + str-sonic-lc01-ASIC00 + Eth218 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth208 + true + str-sonic-lc00-ASIC00 + Eth336 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth212 + true + str-sonic-lc00-ASIC00 + Eth340 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth218 + true + str-sonic-lc01-ASIC01 + Eth222 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC10 + Eth220 + true + str-sonic-lc01-ASIC00 + Eth214 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth232 + true + str-sonic-lc00-ASIC01 + Eth336 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth236 + true + str-sonic-lc00-ASIC01 + Eth340 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth240 + true + str-sonic-lc00-ASIC02 + Eth336 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC10 + Eth244 + true + str-sonic-lc00-ASIC02 + Eth340 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth96 + true + str-sonic-lc04-ASIC00 + Eth316 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth100 + true + str-sonic-lc04-ASIC00 + Eth312 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth104 + true + str-sonic-lc04-ASIC01 + Eth316 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth108 + true + str-sonic-lc04-ASIC01 + Eth312 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth112 + true + str-sonic-lc04-ASIC02 + Eth312 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth116 + true + str-sonic-lc04-ASIC02 + Eth316 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth128 + true + str-sonic-lc03-ASIC00 + Eth316 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth132 + true + str-sonic-lc03-ASIC00 + Eth312 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth136 + true + str-sonic-lc03-ASIC01 + Eth316 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth140 + true + str-sonic-lc03-ASIC01 + Eth312 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth152 + true + str-sonic-lc00-ASIC02 + Eth312 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth156 + true + str-sonic-lc00-ASIC02 + Eth316 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth160 + true + str-sonic-lc03-ASIC02 + Eth312 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth164 + true + str-sonic-lc03-ASIC02 + Eth316 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth168 + true + str-sonic-lc00-ASIC00 + Eth316 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth172 + true + str-sonic-lc00-ASIC00 + Eth312 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth176 + true + str-sonic-lc00-ASIC01 + Eth316 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC11 + Eth180 + true + str-sonic-lc00-ASIC01 + Eth312 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth184 + true + str-sonic-lc02-ASIC00 + Eth220 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth188 + true + str-sonic-lc02-ASIC00 + Eth216 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth190 + true + str-sonic-lc02-ASIC01 + Eth234 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth192 + true + str-sonic-lc02-ASIC01 + Eth232 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth194 + true + str-sonic-lc02-ASIC00 + Eth234 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth196 + true + str-sonic-lc02-ASIC01 + Eth216 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth208 + true + str-sonic-lc01-ASIC00 + Eth220 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth212 + true + str-sonic-lc01-ASIC00 + Eth216 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth214 + true + str-sonic-lc01-ASIC01 + Eth234 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth216 + true + str-sonic-lc02-ASIC00 + Eth232 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth222 + true + str-sonic-lc02-ASIC01 + Eth220 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth232 + true + str-sonic-lc01-ASIC01 + Eth232 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth234 + true + str-sonic-lc01-ASIC00 + Eth234 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth236 + true + str-sonic-lc01-ASIC01 + Eth216 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth242 + true + str-sonic-lc01-ASIC01 + Eth220 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC11 + Eth244 + true + str-sonic-lc01-ASIC00 + Eth232 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth96 + true + str-sonic-lc04-ASIC00 + Eth320 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth100 + true + str-sonic-lc04-ASIC00 + Eth324 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth104 + true + str-sonic-lc04-ASIC01 + Eth324 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth108 + true + str-sonic-lc04-ASIC01 + Eth320 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth112 + true + str-sonic-lc04-ASIC02 + Eth320 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth116 + true + str-sonic-lc04-ASIC02 + Eth324 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth128 + true + str-sonic-lc03-ASIC00 + Eth320 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth132 + true + str-sonic-lc03-ASIC00 + Eth324 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth136 + true + str-sonic-lc03-ASIC01 + Eth324 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth140 + true + str-sonic-lc03-ASIC01 + Eth320 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth154 + true + str-sonic-lc02-ASIC01 + Eth204 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth156 + true + str-sonic-lc02-ASIC00 + Eth208 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth160 + true + str-sonic-lc03-ASIC02 + Eth324 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth164 + true + str-sonic-lc03-ASIC02 + Eth320 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth168 + true + str-sonic-lc02-ASIC01 + Eth206 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth170 + true + str-sonic-lc02-ASIC00 + Eth230 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth178 + true + str-sonic-lc02-ASIC01 + Eth208 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth180 + true + str-sonic-lc02-ASIC00 + Eth206 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth184 + true + str-sonic-lc01-ASIC00 + Eth208 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth190 + true + str-sonic-lc01-ASIC01 + Eth204 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth192 + true + str-sonic-lc01-ASIC01 + Eth206 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth194 + true + str-sonic-lc01-ASIC00 + Eth230 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth208 + true + str-sonic-lc00-ASIC00 + Eth320 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth212 + true + str-sonic-lc00-ASIC00 + Eth324 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth218 + true + str-sonic-lc01-ASIC01 + Eth208 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC12 + Eth220 + true + str-sonic-lc01-ASIC00 + Eth206 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth232 + true + str-sonic-lc00-ASIC01 + Eth324 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth236 + true + str-sonic-lc00-ASIC01 + Eth320 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth240 + true + str-sonic-lc00-ASIC02 + Eth320 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC12 + Eth244 + true + str-sonic-lc00-ASIC02 + Eth324 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth96 + true + str-sonic-lc04-ASIC00 + Eth292 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth100 + true + str-sonic-lc04-ASIC00 + Eth288 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth104 + true + str-sonic-lc04-ASIC01 + Eth292 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth108 + true + str-sonic-lc04-ASIC01 + Eth288 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth112 + true + str-sonic-lc04-ASIC02 + Eth288 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth116 + true + str-sonic-lc04-ASIC02 + Eth292 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth128 + true + str-sonic-lc03-ASIC00 + Eth292 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth132 + true + str-sonic-lc03-ASIC00 + Eth288 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth136 + true + str-sonic-lc03-ASIC01 + Eth292 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth140 + true + str-sonic-lc03-ASIC01 + Eth288 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth152 + true + str-sonic-lc00-ASIC02 + Eth288 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth156 + true + str-sonic-lc00-ASIC02 + Eth292 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth160 + true + str-sonic-lc03-ASIC02 + Eth288 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth164 + true + str-sonic-lc03-ASIC02 + Eth292 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth168 + true + str-sonic-lc00-ASIC00 + Eth292 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth172 + true + str-sonic-lc00-ASIC00 + Eth288 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth176 + true + str-sonic-lc00-ASIC01 + Eth292 + true + + + BackendFabricLink + 200000 + false + str-sonic-sup00-ASIC13 + Eth180 + true + str-sonic-lc00-ASIC01 + Eth288 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth184 + true + str-sonic-lc02-ASIC00 + Eth228 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth188 + true + str-sonic-lc02-ASIC00 + Eth204 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth190 + true + str-sonic-lc02-ASIC01 + Eth224 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth192 + true + str-sonic-lc02-ASIC01 + Eth226 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth194 + true + str-sonic-lc02-ASIC00 + Eth224 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth196 + true + str-sonic-lc02-ASIC01 + Eth230 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth208 + true + str-sonic-lc01-ASIC00 + Eth228 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth212 + true + str-sonic-lc01-ASIC00 + Eth204 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth214 + true + str-sonic-lc01-ASIC01 + Eth224 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth216 + true + str-sonic-lc02-ASIC00 + Eth226 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth222 + true + str-sonic-lc02-ASIC01 + Eth228 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth232 + true + str-sonic-lc01-ASIC01 + Eth226 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth234 + true + str-sonic-lc01-ASIC00 + Eth224 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth236 + true + str-sonic-lc01-ASIC01 + Eth230 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth242 + true + str-sonic-lc01-ASIC01 + Eth228 + true + + + BackendFabricLink + 100000 + false + str-sonic-sup00-ASIC13 + Eth244 + true + str-sonic-lc01-ASIC00 + Eth226 + true + + + DeviceSerialLink + 115200 + true + str-console-194 + port 27 + true + str-sonic-sup00 + console + true + 27 + + + DeviceSerialLink + 115200 + true + str-sonic-sup00 + logical0 + true + str-sonic-lc00 + console + true + 0 + + + DeviceSerialLink + 115200 + true + str-sonic-sup00 + logical1 + true + str-sonic-lc01 + console + true + 1 + + + DeviceSerialLink + 115200 + true + str-sonic-sup00 + logical2 + true + str-sonic-lc02 + console + true + 2 + + + DeviceSerialLink + 115200 + true + str-sonic-sup00 + logical3 + true + str-sonic-lc03 + console + true + 3 + + + DeviceSerialLink + 115200 + true + str-sonic-sup00 + logical4 + true + str-sonic-lc04 + console + true + 4 + + + + + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC00 + sonic-fabric-asic-sku +
+ + LinecardAsic +
+ 10.3.0.5/32 +
+ + fc00:34::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc04-ASIC00 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.5/32 +
+ + fc00:34::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc04-ASIC01 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.5/32 +
+ + fc00:34::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc04-ASIC02 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.4/32 +
+ + fc00:33::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc03-ASIC00 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.4/32 +
+ + fc00:33::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc03-ASIC01 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.3/32 +
+ + fc00:32::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc02-ASIC01 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.3/32 +
+ + fc00:32::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc02-ASIC00 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.4/32 +
+ + fc00:33::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc03-ASIC02 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.2/32 +
+ + fc00:31::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc01-ASIC00 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.2/32 +
+ + fc00:31::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc01-ASIC01 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.1/32 +
+ + fc00:30::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc00-ASIC00 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.1/32 +
+ + fc00:30::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc00-ASIC01 + sonic-lc-asic +
+ + LinecardAsic +
+ 10.3.0.1/32 +
+ + fc00:30::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc00-ASIC02 + sonic-lc-asic +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC01 + sonic-fabric-asic-sku +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC04 + sonic-fabric-asic-sku +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC05 + sonic-fabric-asic-sku +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC08 + sonic-fabric-asic-sku +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC09 + sonic-fabric-asic-sku +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC10 + sonic-fabric-asic-sku +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC11 + sonic-fabric-asic-sku +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC12 + sonic-fabric-asic-sku +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC13 + sonic-fabric-asic-sku +
+ + Supervisor +
+ 10.3.0.5/32 +
+ + fc00:34::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.198/24 + + + 2a01:111:e210:3000::a03:92c6/64 + + + + str-sonic-sup00 + sonic-sup-sku +
+ + MiniTs +
+ 0.0.0.0/0 +
+ + ::/0 + + + starlabDefaultSlice + None + + + 3 + + STARLab + + 10.3.145.194/24 + + + ::/0 + + + + str-console-194 + Digi-CM48 +
+ + Linecard +
+ 10.3.0.1/32 +
+ + fc00:30::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.199/24 + + + 2a01:111:e210:3000::a03:92c7/64 + + + + str-sonic-lc00 + sonic-400g-lc-sku +
+ + Linecard +
+ 10.3.0.2/32 +
+ + fc00:31::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.200/24 + + + 2a01:111:e210:3000::a03:92c8/64 + + + + str-sonic-lc01 + sonic-100g-lc-sku +
+ + Linecard +
+ 10.3.0.3/32 +
+ + fc00:32::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.201/24 + + + 2a01:111:e210:3000::a03:92c9/64 + + + + str-sonic-lc02 + sonic-100g-lc-sku +
+ + Linecard +
+ 10.3.0.4/32 +
+ + fc00:33::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.205/24 + + + 2a01:111:e210:3000::a03:92cd/64 + + + + str-sonic-lc03 + sonic-400g-lc-sku +
+ + Linecard +
+ 10.3.0.5/32 +
+ + fc00:34::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.214/24 + + + 2a01:111:e210:3000::a03:92d6/64 + + + + str-sonic-lc04 + sonic-400g-lc-sku +
+ + SpineRouter +
+ 10.3.0.5/32 +
+ + fc00:34::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.198/24 + + + 2a01:111:e210:3000::a03:92c6/64 + + + + str-sonic + Sonic-packet-chassis-sku + 0 +
+
+
+ str-sonic-sup00 + sonic-sup-sku + 1.0.1388.35303 + +
diff --git a/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/system_ports.json b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/system_ports.json new file mode 100644 index 000000000000..0cb7e777b943 --- /dev/null +++ b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/system_ports.json @@ -0,0 +1,3170 @@ +{ + "str-sonic-lc03|ASIC0|Ethernet0": { + "system_port_id": 1, + "switch_id": 8, + "core_index": "1", + "core_port_index": "1", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet8": { + "system_port_id": 2, + "switch_id": 8, + "core_index": "1", + "core_port_index": "2", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet16": { + "system_port_id": 3, + "switch_id": 8, + "core_index": "1", + "core_port_index": "3", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet24": { + "system_port_id": 4, + "switch_id": 8, + "core_index": "1", + "core_port_index": "4", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet32": { + "system_port_id": 5, + "switch_id": 8, + "core_index": "1", + "core_port_index": "5", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet40": { + "system_port_id": 6, + "switch_id": 8, + "core_index": "1", + "core_port_index": "6", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet48": { + "system_port_id": 7, + "switch_id": 8, + "core_index": "1", + "core_port_index": "7", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet56": { + "system_port_id": 8, + "switch_id": 8, + "core_index": "1", + "core_port_index": "8", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet64": { + "system_port_id": 9, + "switch_id": 8, + "core_index": "1", + "core_port_index": "9", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet72": { + "system_port_id": 10, + "switch_id": 8, + "core_index": "0", + "core_port_index": "10", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet80": { + "system_port_id": 11, + "switch_id": 8, + "core_index": "0", + "core_port_index": "11", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet88": { + "system_port_id": 12, + "switch_id": 8, + "core_index": "0", + "core_port_index": "12", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet96": { + "system_port_id": 13, + "switch_id": 8, + "core_index": "0", + "core_port_index": "13", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet104": { + "system_port_id": 14, + "switch_id": 8, + "core_index": "0", + "core_port_index": "14", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet112": { + "system_port_id": 15, + "switch_id": 8, + "core_index": "0", + "core_port_index": "15", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet120": { + "system_port_id": 16, + "switch_id": 8, + "core_index": "0", + "core_port_index": "16", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet128": { + "system_port_id": 17, + "switch_id": 8, + "core_index": "0", + "core_port_index": "17", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet136": { + "system_port_id": 18, + "switch_id": 8, + "core_index": "0", + "core_port_index": "18", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet144": { + "system_port_id": 19, + "switch_id": 10, + "core_index": "1", + "core_port_index": "1", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet152": { + "system_port_id": 20, + "switch_id": 10, + "core_index": "1", + "core_port_index": "2", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet160": { + "system_port_id": 21, + "switch_id": 10, + "core_index": "1", + "core_port_index": "3", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet168": { + "system_port_id": 22, + "switch_id": 10, + "core_index": "1", + "core_port_index": "4", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet176": { + "system_port_id": 23, + "switch_id": 10, + "core_index": "1", + "core_port_index": "5", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet184": { + "system_port_id": 24, + "switch_id": 10, + "core_index": "1", + "core_port_index": "6", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet192": { + "system_port_id": 25, + "switch_id": 10, + "core_index": "1", + "core_port_index": "7", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet200": { + "system_port_id": 26, + "switch_id": 10, + "core_index": "1", + "core_port_index": "8", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet208": { + "system_port_id": 27, + "switch_id": 10, + "core_index": "1", + "core_port_index": "9", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet216": { + "system_port_id": 28, + "switch_id": 10, + "core_index": "0", + "core_port_index": "10", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet224": { + "system_port_id": 29, + "switch_id": 10, + "core_index": "0", + "core_port_index": "11", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet232": { + "system_port_id": 30, + "switch_id": 10, + "core_index": "0", + "core_port_index": "12", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet240": { + "system_port_id": 31, + "switch_id": 10, + "core_index": "0", + "core_port_index": "13", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet248": { + "system_port_id": 32, + "switch_id": 10, + "core_index": "0", + "core_port_index": "14", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet256": { + "system_port_id": 33, + "switch_id": 10, + "core_index": "0", + "core_port_index": "15", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet264": { + "system_port_id": 34, + "switch_id": 10, + "core_index": "0", + "core_port_index": "16", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet272": { + "system_port_id": 35, + "switch_id": 10, + "core_index": "0", + "core_port_index": "17", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet280": { + "system_port_id": 36, + "switch_id": 10, + "core_index": "0", + "core_port_index": "18", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|cpu0": { + "system_port_id": 37, + "switch_id": 8, + "core_index": 0, + "core_port_index": 0, + "speed": "10000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|cpu1": { + "system_port_id": 38, + "switch_id": 10, + "core_index": 0, + "core_port_index": 0, + "speed": "10000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet-Rec0": { + "system_port_id": 39, + "switch_id": 8, + "core_index": "0", + "core_port_index": "49", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet-Rec1": { + "system_port_id": 40, + "switch_id": 10, + "core_index": "0", + "core_port_index": "49", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC0|Ethernet-IB0": { + "system_port_id": 41, + "switch_id": 8, + "core_index": "1", + "core_port_index": "50", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc03|ASIC1|Ethernet-IB1": { + "system_port_id": 42, + "switch_id": 10, + "core_index": "1", + "core_port_index": "50", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet0": { + "system_port_id": 43, + "switch_id": 12, + "core_index": "0", + "core_port_index": "1", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet4": { + "system_port_id": 44, + "switch_id": 12, + "core_index": "0", + "core_port_index": "2", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet8": { + "system_port_id": 45, + "switch_id": 12, + "core_index": "0", + "core_port_index": "3", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet12": { + "system_port_id": 46, + "switch_id": 12, + "core_index": "0", + "core_port_index": "4", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet16": { + "system_port_id": 47, + "switch_id": 12, + "core_index": "0", + "core_port_index": "5", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet20": { + "system_port_id": 48, + "switch_id": 12, + "core_index": "0", + "core_port_index": "6", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet24": { + "system_port_id": 49, + "switch_id": 12, + "core_index": "0", + "core_port_index": "7", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet28": { + "system_port_id": 50, + "switch_id": 12, + "core_index": "0", + "core_port_index": "8", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet32": { + "system_port_id": 51, + "switch_id": 12, + "core_index": "0", + "core_port_index": "9", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet36": { + "system_port_id": 52, + "switch_id": 12, + "core_index": "0", + "core_port_index": "10", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet40": { + "system_port_id": 53, + "switch_id": 12, + "core_index": "0", + "core_port_index": "11", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet44": { + "system_port_id": 54, + "switch_id": 12, + "core_index": "0", + "core_port_index": "12", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet48": { + "system_port_id": 55, + "switch_id": 12, + "core_index": "0", + "core_port_index": "13", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet52": { + "system_port_id": 56, + "switch_id": 12, + "core_index": "0", + "core_port_index": "14", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet56": { + "system_port_id": 57, + "switch_id": 12, + "core_index": "0", + "core_port_index": "15", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet60": { + "system_port_id": 58, + "switch_id": 12, + "core_index": "0", + "core_port_index": "16", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet64": { + "system_port_id": 59, + "switch_id": 12, + "core_index": "0", + "core_port_index": "17", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet68": { + "system_port_id": 60, + "switch_id": 12, + "core_index": "0", + "core_port_index": "18", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet72": { + "system_port_id": 61, + "switch_id": 12, + "core_index": "0", + "core_port_index": "19", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet76": { + "system_port_id": 62, + "switch_id": 12, + "core_index": "0", + "core_port_index": "20", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet80": { + "system_port_id": 63, + "switch_id": 12, + "core_index": "0", + "core_port_index": "21", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet84": { + "system_port_id": 64, + "switch_id": 12, + "core_index": "0", + "core_port_index": "22", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet88": { + "system_port_id": 65, + "switch_id": 12, + "core_index": "0", + "core_port_index": "23", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet92": { + "system_port_id": 66, + "switch_id": 12, + "core_index": "0", + "core_port_index": "24", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet96": { + "system_port_id": 67, + "switch_id": 12, + "core_index": "1", + "core_port_index": "25", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet100": { + "system_port_id": 68, + "switch_id": 12, + "core_index": "1", + "core_port_index": "26", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet104": { + "system_port_id": 69, + "switch_id": 12, + "core_index": "1", + "core_port_index": "27", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet108": { + "system_port_id": 70, + "switch_id": 12, + "core_index": "1", + "core_port_index": "28", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet112": { + "system_port_id": 71, + "switch_id": 12, + "core_index": "1", + "core_port_index": "29", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet116": { + "system_port_id": 72, + "switch_id": 12, + "core_index": "1", + "core_port_index": "30", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet120": { + "system_port_id": 73, + "switch_id": 12, + "core_index": "1", + "core_port_index": "31", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet124": { + "system_port_id": 74, + "switch_id": 12, + "core_index": "1", + "core_port_index": "32", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet128": { + "system_port_id": 75, + "switch_id": 12, + "core_index": "1", + "core_port_index": "33", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet132": { + "system_port_id": 76, + "switch_id": 12, + "core_index": "1", + "core_port_index": "34", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet136": { + "system_port_id": 77, + "switch_id": 12, + "core_index": "1", + "core_port_index": "35", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet140": { + "system_port_id": 78, + "switch_id": 12, + "core_index": "1", + "core_port_index": "36", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet144": { + "system_port_id": 79, + "switch_id": 12, + "core_index": "1", + "core_port_index": "37", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet148": { + "system_port_id": 80, + "switch_id": 12, + "core_index": "1", + "core_port_index": "38", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet152": { + "system_port_id": 81, + "switch_id": 12, + "core_index": "1", + "core_port_index": "39", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet156": { + "system_port_id": 82, + "switch_id": 12, + "core_index": "1", + "core_port_index": "40", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet160": { + "system_port_id": 83, + "switch_id": 12, + "core_index": "1", + "core_port_index": "41", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet164": { + "system_port_id": 84, + "switch_id": 12, + "core_index": "1", + "core_port_index": "42", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet168": { + "system_port_id": 85, + "switch_id": 12, + "core_index": "1", + "core_port_index": "43", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet172": { + "system_port_id": 86, + "switch_id": 12, + "core_index": "1", + "core_port_index": "44", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet176": { + "system_port_id": 87, + "switch_id": 12, + "core_index": "1", + "core_port_index": "45", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet180": { + "system_port_id": 88, + "switch_id": 12, + "core_index": "1", + "core_port_index": "46", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet184": { + "system_port_id": 89, + "switch_id": 12, + "core_index": "1", + "core_port_index": "47", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet188": { + "system_port_id": 90, + "switch_id": 12, + "core_index": "1", + "core_port_index": "48", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|cpu0": { + "system_port_id": 91, + "switch_id": 12, + "core_index": 0, + "core_port_index": 0, + "speed": "10000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet-Rec0": { + "system_port_id": 92, + "switch_id": 12, + "core_index": "0", + "core_port_index": "49", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc04|ASIC0|Ethernet-IB0": { + "system_port_id": 93, + "switch_id": 12, + "core_index": "1", + "core_port_index": "50", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet0": { + "system_port_id": 94, + "switch_id": 16, + "core_index": "0", + "core_port_index": "1", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet4": { + "system_port_id": 95, + "switch_id": 16, + "core_index": "0", + "core_port_index": "2", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet8": { + "system_port_id": 96, + "switch_id": 16, + "core_index": "0", + "core_port_index": "3", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet12": { + "system_port_id": 97, + "switch_id": 16, + "core_index": "0", + "core_port_index": "4", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet16": { + "system_port_id": 98, + "switch_id": 16, + "core_index": "0", + "core_port_index": "5", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet20": { + "system_port_id": 99, + "switch_id": 16, + "core_index": "0", + "core_port_index": "6", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet24": { + "system_port_id": 100, + "switch_id": 16, + "core_index": "0", + "core_port_index": "7", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet28": { + "system_port_id": 101, + "switch_id": 16, + "core_index": "0", + "core_port_index": "8", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet32": { + "system_port_id": 102, + "switch_id": 16, + "core_index": "0", + "core_port_index": "9", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet36": { + "system_port_id": 103, + "switch_id": 16, + "core_index": "0", + "core_port_index": "10", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet40": { + "system_port_id": 104, + "switch_id": 16, + "core_index": "0", + "core_port_index": "11", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet44": { + "system_port_id": 105, + "switch_id": 16, + "core_index": "0", + "core_port_index": "12", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet48": { + "system_port_id": 106, + "switch_id": 16, + "core_index": "0", + "core_port_index": "13", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet52": { + "system_port_id": 107, + "switch_id": 16, + "core_index": "0", + "core_port_index": "14", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet56": { + "system_port_id": 108, + "switch_id": 16, + "core_index": "0", + "core_port_index": "15", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet60": { + "system_port_id": 109, + "switch_id": 16, + "core_index": "0", + "core_port_index": "16", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet64": { + "system_port_id": 110, + "switch_id": 16, + "core_index": "0", + "core_port_index": "17", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet68": { + "system_port_id": 111, + "switch_id": 16, + "core_index": "0", + "core_port_index": "18", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet72": { + "system_port_id": 112, + "switch_id": 16, + "core_index": "0", + "core_port_index": "19", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet76": { + "system_port_id": 113, + "switch_id": 16, + "core_index": "0", + "core_port_index": "20", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet80": { + "system_port_id": 114, + "switch_id": 16, + "core_index": "0", + "core_port_index": "21", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet84": { + "system_port_id": 115, + "switch_id": 16, + "core_index": "0", + "core_port_index": "22", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet88": { + "system_port_id": 116, + "switch_id": 16, + "core_index": "0", + "core_port_index": "23", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet92": { + "system_port_id": 117, + "switch_id": 16, + "core_index": "0", + "core_port_index": "24", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet96": { + "system_port_id": 118, + "switch_id": 16, + "core_index": "1", + "core_port_index": "25", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet100": { + "system_port_id": 119, + "switch_id": 16, + "core_index": "1", + "core_port_index": "26", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet104": { + "system_port_id": 120, + "switch_id": 16, + "core_index": "1", + "core_port_index": "27", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet108": { + "system_port_id": 121, + "switch_id": 16, + "core_index": "1", + "core_port_index": "28", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet112": { + "system_port_id": 122, + "switch_id": 16, + "core_index": "1", + "core_port_index": "29", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet116": { + "system_port_id": 123, + "switch_id": 16, + "core_index": "1", + "core_port_index": "30", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet120": { + "system_port_id": 124, + "switch_id": 16, + "core_index": "1", + "core_port_index": "31", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet124": { + "system_port_id": 125, + "switch_id": 16, + "core_index": "1", + "core_port_index": "32", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet128": { + "system_port_id": 126, + "switch_id": 16, + "core_index": "1", + "core_port_index": "33", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet132": { + "system_port_id": 127, + "switch_id": 16, + "core_index": "1", + "core_port_index": "34", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet136": { + "system_port_id": 128, + "switch_id": 16, + "core_index": "1", + "core_port_index": "35", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet140": { + "system_port_id": 129, + "switch_id": 16, + "core_index": "1", + "core_port_index": "36", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet144": { + "system_port_id": 130, + "switch_id": 16, + "core_index": "1", + "core_port_index": "37", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet148": { + "system_port_id": 131, + "switch_id": 16, + "core_index": "1", + "core_port_index": "38", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet152": { + "system_port_id": 132, + "switch_id": 16, + "core_index": "1", + "core_port_index": "39", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet156": { + "system_port_id": 133, + "switch_id": 16, + "core_index": "1", + "core_port_index": "40", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet160": { + "system_port_id": 134, + "switch_id": 16, + "core_index": "1", + "core_port_index": "41", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet164": { + "system_port_id": 135, + "switch_id": 16, + "core_index": "1", + "core_port_index": "42", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet168": { + "system_port_id": 136, + "switch_id": 16, + "core_index": "1", + "core_port_index": "43", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet172": { + "system_port_id": 137, + "switch_id": 16, + "core_index": "1", + "core_port_index": "44", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet176": { + "system_port_id": 138, + "switch_id": 16, + "core_index": "1", + "core_port_index": "45", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet180": { + "system_port_id": 139, + "switch_id": 16, + "core_index": "1", + "core_port_index": "46", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet184": { + "system_port_id": 140, + "switch_id": 16, + "core_index": "1", + "core_port_index": "47", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet188": { + "system_port_id": 141, + "switch_id": 16, + "core_index": "1", + "core_port_index": "48", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|cpu0": { + "system_port_id": 142, + "switch_id": 16, + "core_index": 0, + "core_port_index": 0, + "speed": "10000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet-Rec0": { + "system_port_id": 143, + "switch_id": 16, + "core_index": "0", + "core_port_index": "49", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc05|ASIC0|Ethernet-IB0": { + "system_port_id": 144, + "switch_id": 16, + "core_index": "1", + "core_port_index": "50", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet0": { + "system_port_id": 145, + "switch_id": 20, + "core_index": "0", + "core_port_index": "1", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet4": { + "system_port_id": 146, + "switch_id": 20, + "core_index": "0", + "core_port_index": "2", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet8": { + "system_port_id": 147, + "switch_id": 20, + "core_index": "0", + "core_port_index": "3", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet12": { + "system_port_id": 148, + "switch_id": 20, + "core_index": "0", + "core_port_index": "4", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet16": { + "system_port_id": 149, + "switch_id": 20, + "core_index": "0", + "core_port_index": "5", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet20": { + "system_port_id": 150, + "switch_id": 20, + "core_index": "0", + "core_port_index": "6", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet24": { + "system_port_id": 151, + "switch_id": 20, + "core_index": "0", + "core_port_index": "7", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet28": { + "system_port_id": 152, + "switch_id": 20, + "core_index": "0", + "core_port_index": "8", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet32": { + "system_port_id": 153, + "switch_id": 20, + "core_index": "0", + "core_port_index": "9", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet36": { + "system_port_id": 154, + "switch_id": 20, + "core_index": "0", + "core_port_index": "10", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet40": { + "system_port_id": 155, + "switch_id": 20, + "core_index": "0", + "core_port_index": "11", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet44": { + "system_port_id": 156, + "switch_id": 20, + "core_index": "0", + "core_port_index": "12", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet48": { + "system_port_id": 157, + "switch_id": 20, + "core_index": "0", + "core_port_index": "13", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet52": { + "system_port_id": 158, + "switch_id": 20, + "core_index": "0", + "core_port_index": "14", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet56": { + "system_port_id": 159, + "switch_id": 20, + "core_index": "0", + "core_port_index": "15", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet60": { + "system_port_id": 160, + "switch_id": 20, + "core_index": "0", + "core_port_index": "16", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet64": { + "system_port_id": 161, + "switch_id": 20, + "core_index": "0", + "core_port_index": "17", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet68": { + "system_port_id": 162, + "switch_id": 20, + "core_index": "0", + "core_port_index": "18", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet72": { + "system_port_id": 163, + "switch_id": 20, + "core_index": "0", + "core_port_index": "19", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet76": { + "system_port_id": 164, + "switch_id": 20, + "core_index": "0", + "core_port_index": "20", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet80": { + "system_port_id": 165, + "switch_id": 20, + "core_index": "0", + "core_port_index": "21", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet84": { + "system_port_id": 166, + "switch_id": 20, + "core_index": "0", + "core_port_index": "22", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet88": { + "system_port_id": 167, + "switch_id": 20, + "core_index": "0", + "core_port_index": "23", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet92": { + "system_port_id": 168, + "switch_id": 20, + "core_index": "0", + "core_port_index": "24", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet96": { + "system_port_id": 169, + "switch_id": 20, + "core_index": "1", + "core_port_index": "25", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet100": { + "system_port_id": 170, + "switch_id": 20, + "core_index": "1", + "core_port_index": "26", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet104": { + "system_port_id": 171, + "switch_id": 20, + "core_index": "1", + "core_port_index": "27", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet108": { + "system_port_id": 172, + "switch_id": 20, + "core_index": "1", + "core_port_index": "28", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet112": { + "system_port_id": 173, + "switch_id": 20, + "core_index": "1", + "core_port_index": "29", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet116": { + "system_port_id": 174, + "switch_id": 20, + "core_index": "1", + "core_port_index": "30", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet120": { + "system_port_id": 175, + "switch_id": 20, + "core_index": "1", + "core_port_index": "31", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet124": { + "system_port_id": 176, + "switch_id": 20, + "core_index": "1", + "core_port_index": "32", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet128": { + "system_port_id": 177, + "switch_id": 20, + "core_index": "1", + "core_port_index": "33", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet132": { + "system_port_id": 178, + "switch_id": 20, + "core_index": "1", + "core_port_index": "34", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet136": { + "system_port_id": 179, + "switch_id": 20, + "core_index": "1", + "core_port_index": "35", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet140": { + "system_port_id": 180, + "switch_id": 20, + "core_index": "1", + "core_port_index": "36", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet144": { + "system_port_id": 181, + "switch_id": 20, + "core_index": "1", + "core_port_index": "37", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet148": { + "system_port_id": 182, + "switch_id": 20, + "core_index": "1", + "core_port_index": "38", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet152": { + "system_port_id": 183, + "switch_id": 20, + "core_index": "1", + "core_port_index": "39", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet156": { + "system_port_id": 184, + "switch_id": 20, + "core_index": "1", + "core_port_index": "40", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet160": { + "system_port_id": 185, + "switch_id": 20, + "core_index": "1", + "core_port_index": "41", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet164": { + "system_port_id": 186, + "switch_id": 20, + "core_index": "1", + "core_port_index": "42", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet168": { + "system_port_id": 187, + "switch_id": 20, + "core_index": "1", + "core_port_index": "43", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet172": { + "system_port_id": 188, + "switch_id": 20, + "core_index": "1", + "core_port_index": "44", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet176": { + "system_port_id": 189, + "switch_id": 20, + "core_index": "1", + "core_port_index": "45", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet180": { + "system_port_id": 190, + "switch_id": 20, + "core_index": "1", + "core_port_index": "46", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet184": { + "system_port_id": 191, + "switch_id": 20, + "core_index": "1", + "core_port_index": "47", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet188": { + "system_port_id": 192, + "switch_id": 20, + "core_index": "1", + "core_port_index": "48", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|cpu0": { + "system_port_id": 193, + "switch_id": 20, + "core_index": 0, + "core_port_index": 0, + "speed": "10000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet-Rec0": { + "system_port_id": 194, + "switch_id": 20, + "core_index": "0", + "core_port_index": "49", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc06|ASIC0|Ethernet-IB0": { + "system_port_id": 195, + "switch_id": 20, + "core_index": "1", + "core_port_index": "50", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet0": { + "system_port_id": 196, + "switch_id": 24, + "core_index": "0", + "core_port_index": "1", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet4": { + "system_port_id": 197, + "switch_id": 24, + "core_index": "0", + "core_port_index": "2", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet8": { + "system_port_id": 198, + "switch_id": 24, + "core_index": "0", + "core_port_index": "3", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet12": { + "system_port_id": 199, + "switch_id": 24, + "core_index": "0", + "core_port_index": "4", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet16": { + "system_port_id": 200, + "switch_id": 24, + "core_index": "0", + "core_port_index": "5", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet20": { + "system_port_id": 201, + "switch_id": 24, + "core_index": "0", + "core_port_index": "6", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet24": { + "system_port_id": 202, + "switch_id": 24, + "core_index": "0", + "core_port_index": "7", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet28": { + "system_port_id": 203, + "switch_id": 24, + "core_index": "0", + "core_port_index": "8", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet32": { + "system_port_id": 204, + "switch_id": 24, + "core_index": "0", + "core_port_index": "9", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet36": { + "system_port_id": 205, + "switch_id": 24, + "core_index": "0", + "core_port_index": "10", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet40": { + "system_port_id": 206, + "switch_id": 24, + "core_index": "0", + "core_port_index": "11", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet44": { + "system_port_id": 207, + "switch_id": 24, + "core_index": "0", + "core_port_index": "12", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet48": { + "system_port_id": 208, + "switch_id": 24, + "core_index": "0", + "core_port_index": "13", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet52": { + "system_port_id": 209, + "switch_id": 24, + "core_index": "0", + "core_port_index": "14", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet56": { + "system_port_id": 210, + "switch_id": 24, + "core_index": "0", + "core_port_index": "15", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet60": { + "system_port_id": 211, + "switch_id": 24, + "core_index": "0", + "core_port_index": "16", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet64": { + "system_port_id": 212, + "switch_id": 24, + "core_index": "0", + "core_port_index": "17", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet68": { + "system_port_id": 213, + "switch_id": 24, + "core_index": "0", + "core_port_index": "18", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet72": { + "system_port_id": 214, + "switch_id": 24, + "core_index": "0", + "core_port_index": "19", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet76": { + "system_port_id": 215, + "switch_id": 24, + "core_index": "0", + "core_port_index": "20", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet80": { + "system_port_id": 216, + "switch_id": 24, + "core_index": "0", + "core_port_index": "21", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet84": { + "system_port_id": 217, + "switch_id": 24, + "core_index": "0", + "core_port_index": "22", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet88": { + "system_port_id": 218, + "switch_id": 24, + "core_index": "0", + "core_port_index": "23", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet92": { + "system_port_id": 219, + "switch_id": 24, + "core_index": "0", + "core_port_index": "24", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet96": { + "system_port_id": 220, + "switch_id": 24, + "core_index": "1", + "core_port_index": "25", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet100": { + "system_port_id": 221, + "switch_id": 24, + "core_index": "1", + "core_port_index": "26", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet104": { + "system_port_id": 222, + "switch_id": 24, + "core_index": "1", + "core_port_index": "27", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet108": { + "system_port_id": 223, + "switch_id": 24, + "core_index": "1", + "core_port_index": "28", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet112": { + "system_port_id": 224, + "switch_id": 24, + "core_index": "1", + "core_port_index": "29", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet116": { + "system_port_id": 225, + "switch_id": 24, + "core_index": "1", + "core_port_index": "30", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet120": { + "system_port_id": 226, + "switch_id": 24, + "core_index": "1", + "core_port_index": "31", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet124": { + "system_port_id": 227, + "switch_id": 24, + "core_index": "1", + "core_port_index": "32", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet128": { + "system_port_id": 228, + "switch_id": 24, + "core_index": "1", + "core_port_index": "33", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet132": { + "system_port_id": 229, + "switch_id": 24, + "core_index": "1", + "core_port_index": "34", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet136": { + "system_port_id": 230, + "switch_id": 24, + "core_index": "1", + "core_port_index": "35", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet140": { + "system_port_id": 231, + "switch_id": 24, + "core_index": "1", + "core_port_index": "36", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet144": { + "system_port_id": 232, + "switch_id": 24, + "core_index": "1", + "core_port_index": "37", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet148": { + "system_port_id": 233, + "switch_id": 24, + "core_index": "1", + "core_port_index": "38", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet152": { + "system_port_id": 234, + "switch_id": 24, + "core_index": "1", + "core_port_index": "39", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet156": { + "system_port_id": 235, + "switch_id": 24, + "core_index": "1", + "core_port_index": "40", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet160": { + "system_port_id": 236, + "switch_id": 24, + "core_index": "1", + "core_port_index": "41", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet164": { + "system_port_id": 237, + "switch_id": 24, + "core_index": "1", + "core_port_index": "42", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet168": { + "system_port_id": 238, + "switch_id": 24, + "core_index": "1", + "core_port_index": "43", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet172": { + "system_port_id": 239, + "switch_id": 24, + "core_index": "1", + "core_port_index": "44", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet176": { + "system_port_id": 240, + "switch_id": 24, + "core_index": "1", + "core_port_index": "45", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet180": { + "system_port_id": 241, + "switch_id": 24, + "core_index": "1", + "core_port_index": "46", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet184": { + "system_port_id": 242, + "switch_id": 24, + "core_index": "1", + "core_port_index": "47", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet188": { + "system_port_id": 243, + "switch_id": 24, + "core_index": "1", + "core_port_index": "48", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|cpu0": { + "system_port_id": 244, + "switch_id": 24, + "core_index": 0, + "core_port_index": 0, + "speed": "10000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet-Rec0": { + "system_port_id": 245, + "switch_id": 24, + "core_index": "0", + "core_port_index": "49", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc07|ASIC0|Ethernet-IB0": { + "system_port_id": 246, + "switch_id": 24, + "core_index": "1", + "core_port_index": "50", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet0": { + "system_port_id": 247, + "switch_id": 28, + "core_index": "0", + "core_port_index": "1", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet4": { + "system_port_id": 248, + "switch_id": 28, + "core_index": "0", + "core_port_index": "2", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet8": { + "system_port_id": 249, + "switch_id": 28, + "core_index": "0", + "core_port_index": "3", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet12": { + "system_port_id": 250, + "switch_id": 28, + "core_index": "0", + "core_port_index": "4", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet16": { + "system_port_id": 251, + "switch_id": 28, + "core_index": "0", + "core_port_index": "5", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet20": { + "system_port_id": 252, + "switch_id": 28, + "core_index": "0", + "core_port_index": "6", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet24": { + "system_port_id": 253, + "switch_id": 28, + "core_index": "0", + "core_port_index": "7", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet28": { + "system_port_id": 254, + "switch_id": 28, + "core_index": "0", + "core_port_index": "8", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet32": { + "system_port_id": 255, + "switch_id": 28, + "core_index": "0", + "core_port_index": "9", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet36": { + "system_port_id": 256, + "switch_id": 28, + "core_index": "0", + "core_port_index": "10", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet40": { + "system_port_id": 257, + "switch_id": 28, + "core_index": "0", + "core_port_index": "11", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet44": { + "system_port_id": 258, + "switch_id": 28, + "core_index": "0", + "core_port_index": "12", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet48": { + "system_port_id": 259, + "switch_id": 28, + "core_index": "0", + "core_port_index": "13", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet52": { + "system_port_id": 260, + "switch_id": 28, + "core_index": "0", + "core_port_index": "14", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet56": { + "system_port_id": 261, + "switch_id": 28, + "core_index": "0", + "core_port_index": "15", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet60": { + "system_port_id": 262, + "switch_id": 28, + "core_index": "0", + "core_port_index": "16", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet64": { + "system_port_id": 263, + "switch_id": 28, + "core_index": "0", + "core_port_index": "17", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet68": { + "system_port_id": 264, + "switch_id": 28, + "core_index": "0", + "core_port_index": "18", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet72": { + "system_port_id": 265, + "switch_id": 28, + "core_index": "0", + "core_port_index": "19", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet76": { + "system_port_id": 266, + "switch_id": 28, + "core_index": "0", + "core_port_index": "20", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet80": { + "system_port_id": 267, + "switch_id": 28, + "core_index": "0", + "core_port_index": "21", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet84": { + "system_port_id": 268, + "switch_id": 28, + "core_index": "0", + "core_port_index": "22", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet88": { + "system_port_id": 269, + "switch_id": 28, + "core_index": "0", + "core_port_index": "23", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet92": { + "system_port_id": 270, + "switch_id": 28, + "core_index": "0", + "core_port_index": "24", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet96": { + "system_port_id": 271, + "switch_id": 28, + "core_index": "1", + "core_port_index": "25", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet100": { + "system_port_id": 272, + "switch_id": 28, + "core_index": "1", + "core_port_index": "26", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet104": { + "system_port_id": 273, + "switch_id": 28, + "core_index": "1", + "core_port_index": "27", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet108": { + "system_port_id": 274, + "switch_id": 28, + "core_index": "1", + "core_port_index": "28", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet112": { + "system_port_id": 275, + "switch_id": 28, + "core_index": "1", + "core_port_index": "29", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet116": { + "system_port_id": 276, + "switch_id": 28, + "core_index": "1", + "core_port_index": "30", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet120": { + "system_port_id": 277, + "switch_id": 28, + "core_index": "1", + "core_port_index": "31", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet124": { + "system_port_id": 278, + "switch_id": 28, + "core_index": "1", + "core_port_index": "32", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet128": { + "system_port_id": 279, + "switch_id": 28, + "core_index": "1", + "core_port_index": "33", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet132": { + "system_port_id": 280, + "switch_id": 28, + "core_index": "1", + "core_port_index": "34", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet136": { + "system_port_id": 281, + "switch_id": 28, + "core_index": "1", + "core_port_index": "35", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet140": { + "system_port_id": 282, + "switch_id": 28, + "core_index": "1", + "core_port_index": "36", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet144": { + "system_port_id": 283, + "switch_id": 28, + "core_index": "1", + "core_port_index": "37", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet148": { + "system_port_id": 284, + "switch_id": 28, + "core_index": "1", + "core_port_index": "38", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet152": { + "system_port_id": 285, + "switch_id": 28, + "core_index": "1", + "core_port_index": "39", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet156": { + "system_port_id": 286, + "switch_id": 28, + "core_index": "1", + "core_port_index": "40", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet160": { + "system_port_id": 287, + "switch_id": 28, + "core_index": "1", + "core_port_index": "41", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet164": { + "system_port_id": 288, + "switch_id": 28, + "core_index": "1", + "core_port_index": "42", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet168": { + "system_port_id": 289, + "switch_id": 28, + "core_index": "1", + "core_port_index": "43", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet172": { + "system_port_id": 290, + "switch_id": 28, + "core_index": "1", + "core_port_index": "44", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet176": { + "system_port_id": 291, + "switch_id": 28, + "core_index": "1", + "core_port_index": "45", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet180": { + "system_port_id": 292, + "switch_id": 28, + "core_index": "1", + "core_port_index": "46", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet184": { + "system_port_id": 293, + "switch_id": 28, + "core_index": "1", + "core_port_index": "47", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet188": { + "system_port_id": 294, + "switch_id": 28, + "core_index": "1", + "core_port_index": "48", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|cpu0": { + "system_port_id": 295, + "switch_id": 28, + "core_index": 0, + "core_port_index": 0, + "speed": "10000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet-Rec0": { + "system_port_id": 296, + "switch_id": 28, + "core_index": "0", + "core_port_index": "49", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc08|ASIC0|Ethernet-IB0": { + "system_port_id": 297, + "switch_id": 28, + "core_index": "1", + "core_port_index": "50", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet0": { + "system_port_id": 298, + "switch_id": 32, + "core_index": "0", + "core_port_index": "1", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet4": { + "system_port_id": 299, + "switch_id": 32, + "core_index": "0", + "core_port_index": "2", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet8": { + "system_port_id": 300, + "switch_id": 32, + "core_index": "0", + "core_port_index": "3", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet12": { + "system_port_id": 301, + "switch_id": 32, + "core_index": "0", + "core_port_index": "4", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet16": { + "system_port_id": 302, + "switch_id": 32, + "core_index": "0", + "core_port_index": "5", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet20": { + "system_port_id": 303, + "switch_id": 32, + "core_index": "0", + "core_port_index": "6", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet24": { + "system_port_id": 304, + "switch_id": 32, + "core_index": "0", + "core_port_index": "7", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet28": { + "system_port_id": 305, + "switch_id": 32, + "core_index": "0", + "core_port_index": "8", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet32": { + "system_port_id": 306, + "switch_id": 32, + "core_index": "0", + "core_port_index": "9", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet36": { + "system_port_id": 307, + "switch_id": 32, + "core_index": "0", + "core_port_index": "10", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet40": { + "system_port_id": 308, + "switch_id": 32, + "core_index": "0", + "core_port_index": "11", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet44": { + "system_port_id": 309, + "switch_id": 32, + "core_index": "0", + "core_port_index": "12", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet48": { + "system_port_id": 310, + "switch_id": 32, + "core_index": "0", + "core_port_index": "13", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet52": { + "system_port_id": 311, + "switch_id": 32, + "core_index": "0", + "core_port_index": "14", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet56": { + "system_port_id": 312, + "switch_id": 32, + "core_index": "0", + "core_port_index": "15", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet60": { + "system_port_id": 313, + "switch_id": 32, + "core_index": "0", + "core_port_index": "16", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet64": { + "system_port_id": 314, + "switch_id": 32, + "core_index": "0", + "core_port_index": "17", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet68": { + "system_port_id": 315, + "switch_id": 32, + "core_index": "0", + "core_port_index": "18", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet72": { + "system_port_id": 316, + "switch_id": 32, + "core_index": "0", + "core_port_index": "19", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet76": { + "system_port_id": 317, + "switch_id": 32, + "core_index": "0", + "core_port_index": "20", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet80": { + "system_port_id": 318, + "switch_id": 32, + "core_index": "0", + "core_port_index": "21", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet84": { + "system_port_id": 319, + "switch_id": 32, + "core_index": "0", + "core_port_index": "22", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet88": { + "system_port_id": 320, + "switch_id": 32, + "core_index": "0", + "core_port_index": "23", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet92": { + "system_port_id": 321, + "switch_id": 32, + "core_index": "0", + "core_port_index": "24", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet96": { + "system_port_id": 322, + "switch_id": 32, + "core_index": "1", + "core_port_index": "25", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet100": { + "system_port_id": 323, + "switch_id": 32, + "core_index": "1", + "core_port_index": "26", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet104": { + "system_port_id": 324, + "switch_id": 32, + "core_index": "1", + "core_port_index": "27", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet108": { + "system_port_id": 325, + "switch_id": 32, + "core_index": "1", + "core_port_index": "28", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet112": { + "system_port_id": 326, + "switch_id": 32, + "core_index": "1", + "core_port_index": "29", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet116": { + "system_port_id": 327, + "switch_id": 32, + "core_index": "1", + "core_port_index": "30", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet120": { + "system_port_id": 328, + "switch_id": 32, + "core_index": "1", + "core_port_index": "31", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet124": { + "system_port_id": 329, + "switch_id": 32, + "core_index": "1", + "core_port_index": "32", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet128": { + "system_port_id": 330, + "switch_id": 32, + "core_index": "1", + "core_port_index": "33", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet132": { + "system_port_id": 331, + "switch_id": 32, + "core_index": "1", + "core_port_index": "34", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet136": { + "system_port_id": 332, + "switch_id": 32, + "core_index": "1", + "core_port_index": "35", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet140": { + "system_port_id": 333, + "switch_id": 32, + "core_index": "1", + "core_port_index": "36", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet144": { + "system_port_id": 334, + "switch_id": 32, + "core_index": "1", + "core_port_index": "37", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet148": { + "system_port_id": 335, + "switch_id": 32, + "core_index": "1", + "core_port_index": "38", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet152": { + "system_port_id": 336, + "switch_id": 32, + "core_index": "1", + "core_port_index": "39", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet156": { + "system_port_id": 337, + "switch_id": 32, + "core_index": "1", + "core_port_index": "40", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet160": { + "system_port_id": 338, + "switch_id": 32, + "core_index": "1", + "core_port_index": "41", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet164": { + "system_port_id": 339, + "switch_id": 32, + "core_index": "1", + "core_port_index": "42", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet168": { + "system_port_id": 340, + "switch_id": 32, + "core_index": "1", + "core_port_index": "43", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet172": { + "system_port_id": 341, + "switch_id": 32, + "core_index": "1", + "core_port_index": "44", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet176": { + "system_port_id": 342, + "switch_id": 32, + "core_index": "1", + "core_port_index": "45", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet180": { + "system_port_id": 343, + "switch_id": 32, + "core_index": "1", + "core_port_index": "46", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet184": { + "system_port_id": 344, + "switch_id": 32, + "core_index": "1", + "core_port_index": "47", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc09|ASIC0|Ethernet188": { + "system_port_id": 345, + "switch_id": 32, + "core_index": "1", + "core_port_index": "48", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet0": { + "system_port_id": 346, + "switch_id": 36, + "core_index": "0", + "core_port_index": "1", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet4": { + "system_port_id": 347, + "switch_id": 36, + "core_index": "0", + "core_port_index": "2", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet8": { + "system_port_id": 348, + "switch_id": 36, + "core_index": "0", + "core_port_index": "3", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet12": { + "system_port_id": 349, + "switch_id": 36, + "core_index": "0", + "core_port_index": "4", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet16": { + "system_port_id": 350, + "switch_id": 36, + "core_index": "0", + "core_port_index": "5", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet20": { + "system_port_id": 351, + "switch_id": 36, + "core_index": "0", + "core_port_index": "6", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet24": { + "system_port_id": 352, + "switch_id": 36, + "core_index": "0", + "core_port_index": "7", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet28": { + "system_port_id": 353, + "switch_id": 36, + "core_index": "0", + "core_port_index": "8", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet32": { + "system_port_id": 354, + "switch_id": 36, + "core_index": "0", + "core_port_index": "9", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet36": { + "system_port_id": 355, + "switch_id": 36, + "core_index": "0", + "core_port_index": "10", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet40": { + "system_port_id": 356, + "switch_id": 36, + "core_index": "0", + "core_port_index": "11", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet44": { + "system_port_id": 357, + "switch_id": 36, + "core_index": "0", + "core_port_index": "12", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet48": { + "system_port_id": 358, + "switch_id": 36, + "core_index": "0", + "core_port_index": "13", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet52": { + "system_port_id": 359, + "switch_id": 36, + "core_index": "0", + "core_port_index": "14", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet56": { + "system_port_id": 360, + "switch_id": 36, + "core_index": "0", + "core_port_index": "15", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet60": { + "system_port_id": 361, + "switch_id": 36, + "core_index": "0", + "core_port_index": "16", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet64": { + "system_port_id": 362, + "switch_id": 36, + "core_index": "0", + "core_port_index": "17", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet68": { + "system_port_id": 363, + "switch_id": 36, + "core_index": "0", + "core_port_index": "18", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet72": { + "system_port_id": 364, + "switch_id": 36, + "core_index": "0", + "core_port_index": "19", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet76": { + "system_port_id": 365, + "switch_id": 36, + "core_index": "0", + "core_port_index": "20", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet80": { + "system_port_id": 366, + "switch_id": 36, + "core_index": "0", + "core_port_index": "21", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet84": { + "system_port_id": 367, + "switch_id": 36, + "core_index": "0", + "core_port_index": "22", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet88": { + "system_port_id": 368, + "switch_id": 36, + "core_index": "0", + "core_port_index": "23", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet92": { + "system_port_id": 369, + "switch_id": 36, + "core_index": "0", + "core_port_index": "24", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet96": { + "system_port_id": 370, + "switch_id": 36, + "core_index": "1", + "core_port_index": "25", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet100": { + "system_port_id": 371, + "switch_id": 36, + "core_index": "1", + "core_port_index": "26", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet104": { + "system_port_id": 372, + "switch_id": 36, + "core_index": "1", + "core_port_index": "27", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet108": { + "system_port_id": 373, + "switch_id": 36, + "core_index": "1", + "core_port_index": "28", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet112": { + "system_port_id": 374, + "switch_id": 36, + "core_index": "1", + "core_port_index": "29", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet116": { + "system_port_id": 375, + "switch_id": 36, + "core_index": "1", + "core_port_index": "30", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet120": { + "system_port_id": 376, + "switch_id": 36, + "core_index": "1", + "core_port_index": "31", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet124": { + "system_port_id": 377, + "switch_id": 36, + "core_index": "1", + "core_port_index": "32", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet128": { + "system_port_id": 378, + "switch_id": 36, + "core_index": "1", + "core_port_index": "33", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet132": { + "system_port_id": 379, + "switch_id": 36, + "core_index": "1", + "core_port_index": "34", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet136": { + "system_port_id": 380, + "switch_id": 36, + "core_index": "1", + "core_port_index": "35", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet140": { + "system_port_id": 381, + "switch_id": 36, + "core_index": "1", + "core_port_index": "36", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet144": { + "system_port_id": 382, + "switch_id": 36, + "core_index": "1", + "core_port_index": "37", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet148": { + "system_port_id": 383, + "switch_id": 36, + "core_index": "1", + "core_port_index": "38", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet152": { + "system_port_id": 384, + "switch_id": 36, + "core_index": "1", + "core_port_index": "39", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet156": { + "system_port_id": 385, + "switch_id": 36, + "core_index": "1", + "core_port_index": "40", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet160": { + "system_port_id": 386, + "switch_id": 36, + "core_index": "1", + "core_port_index": "41", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet164": { + "system_port_id": 387, + "switch_id": 36, + "core_index": "1", + "core_port_index": "42", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet168": { + "system_port_id": 388, + "switch_id": 36, + "core_index": "1", + "core_port_index": "43", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet172": { + "system_port_id": 389, + "switch_id": 36, + "core_index": "1", + "core_port_index": "44", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet176": { + "system_port_id": 390, + "switch_id": 36, + "core_index": "1", + "core_port_index": "45", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet180": { + "system_port_id": 391, + "switch_id": 36, + "core_index": "1", + "core_port_index": "46", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet184": { + "system_port_id": 392, + "switch_id": 36, + "core_index": "1", + "core_port_index": "47", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet188": { + "system_port_id": 393, + "switch_id": 36, + "core_index": "1", + "core_port_index": "48", + "speed": "100000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|cpu0": { + "system_port_id": 394, + "switch_id": 36, + "core_index": 0, + "core_port_index": 0, + "speed": "10000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet-Rec0": { + "system_port_id": 395, + "switch_id": 36, + "core_index": "0", + "core_port_index": "49", + "speed": "400000", + "num_voq": "8" + }, + "str-sonic-lc10|ASIC0|Ethernet-IB0": { + "system_port_id": 396, + "switch_id": 36, + "core_index": "1", + "core_port_index": "50", + "speed": "400000", + "num_voq": "8" + } +} diff --git a/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq-sample-port-config-1.ini b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq-sample-port-config-1.ini new file mode 100644 index 000000000000..0accaf10769a --- /dev/null +++ b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq-sample-port-config-1.ini @@ -0,0 +1,51 @@ +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq +Ethernet0 6,7 Ethernet1/1 1 Ext 100000 Eth0 0 1 8 +Ethernet4 2,3 Ethernet2/1 2 Ext 100000 Eth4 0 2 8 +Ethernet8 4,5 Ethernet3/1 3 Ext 100000 Eth8 0 3 8 +Ethernet12 0,1 Ethernet4/1 4 Ext 100000 Eth12 0 4 8 +Ethernet16 14,15 Ethernet5/1 5 Ext 100000 Eth16 0 5 8 +Ethernet20 10,11 Ethernet6/1 6 Ext 100000 Eth20 0 6 8 +Ethernet24 12,13 Ethernet7/1 7 Ext 100000 Eth24 0 7 8 +Ethernet28 8,9 Ethernet8/1 8 Ext 100000 Eth28 0 8 8 +Ethernet32 22,23 Ethernet9/1 9 Ext 100000 Eth32 0 9 8 +Ethernet36 18,19 Ethernet10/1 10 Ext 100000 Eth36 0 10 8 +Ethernet40 20,21 Ethernet11/1 11 Ext 100000 Eth40 0 11 8 +Ethernet44 16,17 Ethernet12/1 12 Ext 100000 Eth44 0 12 8 +Ethernet48 30,31 Ethernet13/1 13 Ext 100000 Eth48 0 13 8 +Ethernet52 26,27 Ethernet14/1 14 Ext 100000 Eth52 0 14 8 +Ethernet56 28,29 Ethernet15/1 15 Ext 100000 Eth56 0 15 8 +Ethernet60 24,25 Ethernet16/1 16 Ext 100000 Eth60 0 16 8 +Ethernet64 38,39 Ethernet17/1 17 Ext 100000 Eth64 0 17 8 +Ethernet68 34,35 Ethernet18/1 18 Ext 100000 Eth68 0 18 8 +Ethernet72 36,37 Ethernet19/1 19 Ext 100000 Eth72 0 19 8 +Ethernet76 32,33 Ethernet20/1 20 Ext 100000 Eth76 0 20 8 +Ethernet80 46,47 Ethernet21/1 21 Ext 100000 Eth80 0 21 8 +Ethernet84 42,43 Ethernet22/1 22 Ext 100000 Eth84 0 22 8 +Ethernet88 44,45 Ethernet23/1 23 Ext 100000 Eth88 0 23 8 +Ethernet92 40,41 Ethernet24/1 24 Ext 100000 Eth92 0 24 8 +Ethernet96 94,95 Ethernet25/1 25 Ext 100000 Eth96 1 25 8 +Ethernet100 90,91 Ethernet26/1 26 Ext 100000 Eth100 1 26 8 +Ethernet104 92,93 Ethernet27/1 27 Ext 100000 Eth104 1 27 8 +Ethernet108 88,89 Ethernet28/1 28 Ext 100000 Eth108 1 28 8 +Ethernet112 86,87 Ethernet29/1 29 Ext 100000 Eth112 1 29 8 +Ethernet116 82,83 Ethernet30/1 30 Ext 100000 Eth116 1 30 8 +Ethernet120 84,85 Ethernet31/1 31 Ext 100000 Eth120 1 31 8 +Ethernet124 80,81 Ethernet32/1 32 Ext 100000 Eth124 1 32 8 +Ethernet128 78,79 Ethernet33/1 33 Ext 100000 Eth128 1 33 8 +Ethernet132 74,75 Ethernet34/1 34 Ext 100000 Eth132 1 34 8 +Ethernet136 76,77 Ethernet35/1 35 Ext 100000 Eth136 1 35 8 +Ethernet140 72,73 Ethernet36/1 36 Ext 100000 Eth140 1 36 8 +Ethernet144 70,71 Ethernet37/1 37 Ext 100000 Eth144 1 37 8 +Ethernet148 66,67 Ethernet38/1 38 Ext 100000 Eth148 1 38 8 +Ethernet152 68,69 Ethernet39/1 39 Ext 100000 Eth152 1 39 8 +Ethernet156 64,65 Ethernet40/1 40 Ext 100000 Eth156 1 40 8 +Ethernet160 62,63 Ethernet41/1 41 Ext 100000 Eth160 1 41 8 +Ethernet164 58,59 Ethernet42/1 42 Ext 100000 Eth164 1 42 8 +Ethernet168 60,61 Ethernet43/1 43 Ext 100000 Eth168 1 43 8 +Ethernet172 56,57 Ethernet44/1 44 Ext 100000 Eth172 1 44 8 +Ethernet176 54,55 Ethernet45/1 45 Ext 100000 Eth176 1 45 8 +Ethernet180 50,51 Ethernet46/1 46 Ext 100000 Eth180 1 46 8 +Ethernet184 52,53 Ethernet47/1 47 Ext 100000 Eth184 1 47 8 +Ethernet188 48,49 Ethernet48/1 48 Ext 100000 Eth188 1 48 8 +Ethernet-Rec0 249 Recirc0/0 51 Rec 400000 Rcy0 0 49 8 +Ethernet-IB0 250 Recirc0/1 52 Inb 400000 Rcy1 1 50 8 \ No newline at end of file diff --git a/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq-sample-port-config-2.ini b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq-sample-port-config-2.ini new file mode 100644 index 000000000000..223eb915a20f --- /dev/null +++ b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq-sample-port-config-2.ini @@ -0,0 +1,21 @@ +# name lanes alias index role speed asic_port_name core_id core_port_id num_voq +Ethernet0 72,73,74,75,76,77,78,79 Ethernet1/1 1 Ext 400000 Eth0 1 1 8 +Ethernet8 80,81,82,83,84,85,86,87 Ethernet2/1 2 Ext 400000 Eth8 1 2 8 +Ethernet16 88,89,90,91,92,93,94,95 Ethernet3/1 3 Ext 400000 Eth16 1 3 8 +Ethernet24 96,97,98,99,100,101,102,103 Ethernet4/1 4 Ext 400000 Eth24 1 4 8 +Ethernet32 104,105,106,107,108,109,110,111 Ethernet5/1 5 Ext 400000 Eth32 1 5 8 +Ethernet40 112,113,114,115,116,117,118,119 Ethernet6/1 6 Ext 400000 Eth40 1 6 8 +Ethernet48 120,121,122,123,124,125,126,127 Ethernet7/1 7 Ext 400000 Eth48 1 7 8 +Ethernet56 128,129,130,131,132,133,134,135 Ethernet8/1 8 Ext 400000 Eth56 1 8 8 +Ethernet64 136,137,138,139,140,141,142,143 Ethernet9/1 9 Ext 400000 Eth64 1 9 8 +Ethernet72 64,65,66,67,68,69,70,71 Ethernet10/1 10 Ext 400000 Eth72 0 10 8 +Ethernet80 56,57,58,59,60,61,62,63 Ethernet11/1 11 Ext 400000 Eth80 0 11 8 +Ethernet88 48,49,50,51,52,53,54,55 Ethernet12/1 12 Ext 400000 Eth88 0 12 8 +Ethernet96 40,41,42,43,44,45,46,47 Ethernet13/1 13 Ext 400000 Eth96 0 13 8 +Ethernet104 32,33,34,35,36,37,38,39 Ethernet14/1 14 Ext 400000 Eth104 0 14 8 +Ethernet112 24,25,26,27,28,29,30,31 Ethernet15/1 15 Ext 400000 Eth112 0 15 8 +Ethernet120 16,17,18,19,20,21,22,23 Ethernet16/1 16 Ext 400000 Eth120 0 16 8 +Ethernet128 8,9,10,11,12,13,14,15 Ethernet17/1 17 Ext 400000 Eth128 0 17 8 +Ethernet136 0,1,2,3,4,5,6,7 Ethernet18/1 18 Ext 400000 Eth136 0 18 8 +Ethernet-Rec0 249 Recirc0/0 37 Rec 400000 Rcy0 0 49 8 +Ethernet-IB0 250 Recirc0/1 38 Inb 400000 Rcy1 1 50 8 \ No newline at end of file diff --git a/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_multi_asic.xml b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_multi_asic.xml new file mode 100644 index 000000000000..2bbf8868da5e --- /dev/null +++ b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_multi_asic.xml @@ -0,0 +1,48338 @@ + + + + + + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 10.241.88.0 + str-sonic-lc03-ASIC01 + 10.241.88.1 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 2a01:111:e210:5e:0:a:f158:0 + str-sonic-lc03-ASIC01 + 2a01:111:e210:5e:0:a:f158:100 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 10.241.88.0 + str-sonic-lc04-ASIC00 + 10.241.88.2 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 2a01:111:e210:5e:0:a:f158:0 + str-sonic-lc04-ASIC00 + 2a01:111:e210:5e:0:a:f158:200 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 10.241.88.0 + str-sonic-lc05-ASIC00 + 10.241.88.3 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 2a01:111:e210:5e:0:a:f158:0 + str-sonic-lc05-ASIC00 + 2a01:111:e210:5e:0:a:f158:300 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 10.241.88.0 + str-sonic-lc06-ASIC00 + 10.241.88.4 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 2a01:111:e210:5e:0:a:f158:0 + str-sonic-lc06-ASIC00 + 2a01:111:e210:5e:0:a:f158:400 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 10.241.88.0 + str-sonic-lc07-ASIC00 + 10.241.88.5 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 2a01:111:e210:5e:0:a:f158:0 + str-sonic-lc07-ASIC00 + 2a01:111:e210:5e:0:a:f158:500 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 10.241.88.0 + str-sonic-lc08-ASIC00 + 10.241.88.6 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 2a01:111:e210:5e:0:a:f158:0 + str-sonic-lc08-ASIC00 + 2a01:111:e210:5e:0:a:f158:600 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 10.241.88.0 + str-sonic-lc09-ASIC00 + 10.241.88.7 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 2a01:111:e210:5e:0:a:f158:0 + str-sonic-lc09-ASIC00 + 2a01:111:e210:5e:0:a:f158:700 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 10.241.88.0 + str-sonic-lc10-ASIC00 + 10.241.88.8 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 2a01:111:e210:5e:0:a:f158:0 + str-sonic-lc10-ASIC00 + 2a01:111:e210:5e:0:a:f158:800 + 1 + 0 + 0 + + + BGPSession + false + str-sonic-lc03-ASIC00 + 10.0.0.0 + ARISTA91T3 + 10.0.0.1 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + 10.0.0.4 + ARISTA93T3 + 10.0.0.5 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + 10.0.0.8 + ARISTA05T3 + 10.0.0.9 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + 10.0.0.12 + ARISTA07T3 + 10.0.0.13 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + 10.0.0.16 + ARISTA09T3 + 10.0.0.17 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + 10.0.0.20 + ARISTA11T3 + 10.0.0.21 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + 10.0.0.24 + ARISTA18T3 + 10.0.0.25 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + 10.0.0.28 + ARISTA15T3 + 10.0.0.29 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + fc00::1 + ARISTA91T3 + fc00::2 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + fc00::9 + ARISTA93T3 + fc00::a + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + fc00::11 + ARISTA05T3 + fc00::12 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + fc00::19 + ARISTA07T3 + fc00::1a + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + fc00::21 + ARISTA09T3 + fc00::22 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + fc00::29 + ARISTA11T3 + fc00::2a + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + fc00::31 + ARISTA18T3 + fc00::32 + 1 + 10 + 3 + + + BGPSession + false + str-sonic-lc03-ASIC00 + fc00::39 + ARISTA15T3 + fc00::3a + 1 + 10 + 3 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 10.241.88.1 + str-sonic-lc04-ASIC00 + 10.241.88.2 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 2a01:111:e210:5e:0:a:f158:100 + str-sonic-lc04-ASIC00 + 2a01:111:e210:5e:0:a:f158:200 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 10.241.88.1 + str-sonic-lc05-ASIC00 + 10.241.88.3 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 2a01:111:e210:5e:0:a:f158:100 + str-sonic-lc05-ASIC00 + 2a01:111:e210:5e:0:a:f158:300 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 10.241.88.1 + str-sonic-lc06-ASIC00 + 10.241.88.4 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 2a01:111:e210:5e:0:a:f158:100 + str-sonic-lc06-ASIC00 + 2a01:111:e210:5e:0:a:f158:400 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 10.241.88.1 + str-sonic-lc07-ASIC00 + 10.241.88.5 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 2a01:111:e210:5e:0:a:f158:100 + str-sonic-lc07-ASIC00 + 2a01:111:e210:5e:0:a:f158:500 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 10.241.88.1 + str-sonic-lc08-ASIC00 + 10.241.88.6 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 2a01:111:e210:5e:0:a:f158:100 + str-sonic-lc08-ASIC00 + 2a01:111:e210:5e:0:a:f158:600 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 10.241.88.1 + str-sonic-lc09-ASIC00 + 10.241.88.7 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 2a01:111:e210:5e:0:a:f158:100 + str-sonic-lc09-ASIC00 + 2a01:111:e210:5e:0:a:f158:700 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 10.241.88.1 + str-sonic-lc10-ASIC00 + 10.241.88.8 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 2a01:111:e210:5e:0:a:f158:100 + str-sonic-lc10-ASIC00 + 2a01:111:e210:5e:0:a:f158:800 + 1 + 0 + 0 + + + + + 65100 + + + BGPGroup + 10.241.88.0;2a01:111:e210:5e:0:a:f158:0 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc03-ASIC00 + + + BGPPeer +
10.241.88.0
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:0
+ + + +
+ + BGPPeer +
10.0.0.0
+ + + +
+ + BGPPeer +
10.0.0.4
+ + + +
+ + BGPPeer +
10.0.0.8
+ + + +
+ + BGPPeer +
10.0.0.12
+ + + +
+ + BGPPeer +
10.0.0.16
+ + + +
+ + BGPPeer +
10.0.0.20
+ + + +
+ + BGPPeer +
10.0.0.24
+ + + +
+ + BGPPeer +
10.0.0.28
+ + + +
+ + BGPPeer +
fc00::1
+ + + +
+ + BGPPeer +
fc00::9
+ + + +
+ + BGPPeer +
fc00::11
+ + + +
+ + BGPPeer +
fc00::19
+ + + +
+ + BGPPeer +
fc00::21
+ + + +
+ + BGPPeer +
fc00::29
+ + + +
+ + BGPPeer +
fc00::31
+ + + +
+ + BGPPeer +
fc00::39
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.1;2a01:111:e210:5e:0:a:f158:100 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc03-ASIC01 + + + BGPPeer +
10.241.88.1
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:100
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.2;2a01:111:e210:5e:0:a:f158:200 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc04-ASIC00 + + + BGPPeer +
10.241.88.2
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:200
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.3;2a01:111:e210:5e:0:a:f158:300 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc05-ASIC00 + + + BGPPeer +
10.241.88.3
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:300
+ + + +
+ + BGPPeer +
10.0.0.72
+ + + +
+ + BGPPeer +
fc00::91
+ + + +
+ + BGPPeer +
10.0.0.76
+ + + +
+ + BGPPeer +
fc00::99
+ + + +
+ + BGPPeer +
10.0.0.80
+ + + +
+ + BGPPeer +
fc00::a1
+ + + +
+ + BGPPeer +
10.0.0.84
+ + + +
+ + BGPPeer +
fc00::a9
+ + + +
+ + BGPPeer +
10.0.0.88
+ + + +
+ + BGPPeer +
fc00::b1
+ + + +
+ + BGPPeer +
10.0.0.92
+ + + +
+ + BGPPeer +
fc00::b9
+ + + +
+ + BGPPeer +
10.0.0.64
+ + + +
+ + BGPPeer +
fc00::81
+ + + +
+ + BGPPeer +
10.0.0.68
+ + + +
+ + BGPPeer +
fc00::89
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.4;2a01:111:e210:5e:0:a:f158:400 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc06-ASIC00 + + + BGPPeer +
10.241.88.4
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:400
+ + + +
+ + BGPPeer +
10.0.0.128
+ + + +
+ + BGPPeer +
fc00::101
+ + + +
+ + BGPPeer +
10.0.0.132
+ + + +
+ + BGPPeer +
fc00::109
+ + + +
+ + BGPPeer +
10.0.0.136
+ + + +
+ + BGPPeer +
fc00::111
+ + + +
+ + BGPPeer +
10.0.0.140
+ + + +
+ + BGPPeer +
fc00::119
+ + + +
+ + BGPPeer +
10.0.0.144
+ + + +
+ + BGPPeer +
fc00::121
+ + + +
+ + BGPPeer +
10.0.0.148
+ + + +
+ + BGPPeer +
fc00::129
+ + + +
+ + BGPPeer +
10.0.0.152
+ + + +
+ + BGPPeer +
fc00::131
+ + + +
+ + BGPPeer +
10.0.0.156
+ + + +
+ + BGPPeer +
fc00::139
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.5;2a01:111:e210:5e:0:a:f158:500 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc07-ASIC00 + + + BGPPeer +
10.241.88.5
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:500
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.6;2a01:111:e210:5e:0:a:f158:600 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc08-ASIC00 + + + BGPPeer +
10.241.88.6
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:600
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.7;2a01:111:e210:5e:0:a:f158:700 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc09-ASIC00 + + + BGPPeer +
10.241.88.7
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:700
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.8;2a01:111:e210:5e:0:a:f158:800 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc10-ASIC00 + + + BGPPeer +
10.241.88.8
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:800
+ + + +
+
+ + +
+ + 65203 + + + ARISTA91T3 + + + BGPPeer +
10.0.0.1
+ + + +
+ + BGPPeer +
fc00::2
+ + + +
+
+ + +
+ + 65204 + + + ARISTA93T3 + + + BGPPeer +
10.0.0.5
+ + + +
+ + BGPPeer +
fc00::a
+ + + +
+
+ + +
+ + 65205 + + + ARISTA05T3 + + + BGPPeer +
10.0.0.9
+ + + +
+ + BGPPeer +
fc00::12
+ + + +
+
+ + +
+ + 65206 + + + ARISTA07T3 + + + BGPPeer +
10.0.0.13
+ + + +
+ + BGPPeer +
fc00::1a
+ + + +
+
+ + +
+ + 65207 + + + ARISTA09T3 + + + BGPPeer +
10.0.0.17
+ + + +
+ + BGPPeer +
fc00::22
+ + + +
+
+ + +
+ + 65208 + + + ARISTA11T3 + + + BGPPeer +
10.0.0.21
+ + + +
+ + BGPPeer +
fc00::2a
+ + + +
+
+ + +
+ + 65213 + + + ARISTA18T3 + + + BGPPeer +
10.0.0.25
+ + + +
+ + BGPPeer +
fc00::32
+ + + +
+
+ + +
+ + 65211 + + + ARISTA15T3 + + + BGPPeer +
10.0.0.29
+ + + +
+ + BGPPeer +
fc00::3a
+ + + +
+
+ + +
+
+ +
+ + + + + + DeviceInterface + + true + 1 + cpu3/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 2 + cpu3/1 + false + + cpu1 + 10000 + + + + + DeviceInterface + + true + 3 + Recirc3/0/0 + false + + Ethernet-Rec0 + 10000 + + + + + DeviceInterface + + true + 4 + Recirc3/1/0 + false + + Ethernet-Rec1 + 10000 + + + + + DeviceInterface + + true + 5 + Recirc3/0/1 + false + + Ethernet-IB0 + 10000 + + + + + DeviceInterface + + true + 6 + Recirc3/1/1 + false + + Ethernet-IB1 + 10000 + + + + + DeviceInterface + + true + 7 + cpu4/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 8 + Recirc4/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 9 + Recirc4/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 10 + cpu5/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 11 + Recirc5/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 12 + Recirc5/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 13 + cpu6/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 14 + Recirc6/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 15 + Recirc6/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 16 + cpu7/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 17 + Recirc7/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 18 + Recirc7/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 19 + cpu8/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 20 + Recirc8/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 21 + Recirc8/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 22 + cpu10/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 23 + Recirc10/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 24 + Recirc10/0/1 + false + + Ethernet-IB0 + 400000 + + + + + Sonic-T2-Base-sku + + + + DeviceInterface + 100000 + true + 1 + Ethernet3/1/1 + false + + Ethernet0 + 400000 + + + DeviceInterface + 100000 + true + 2 + Ethernet3/2/1 + false + + Ethernet8 + 400000 + + + DeviceInterface + 100000 + true + 3 + Ethernet3/3/1 + false + + Ethernet16 + 400000 + + + DeviceInterface + 100000 + true + 4 + Ethernet3/4/1 + false + + Ethernet24 + 400000 + + + DeviceInterface + 100000 + true + 5 + Ethernet3/5/1 + false + + Ethernet32 + 400000 + + + DeviceInterface + 100000 + true + 6 + Ethernet3/6/1 + false + + Ethernet40 + 400000 + + + DeviceInterface + 100000 + true + 7 + Ethernet3/7/1 + false + + Ethernet48 + 400000 + + + DeviceInterface + 100000 + true + 8 + Ethernet3/8/1 + false + + Ethernet56 + 400000 + + + DeviceInterface + 100000 + true + 9 + Ethernet3/9/1 + false + + Ethernet64 + 400000 + + + DeviceInterface + 100000 + true + 10 + Ethernet3/10/1 + false + + Ethernet72 + 400000 + + + DeviceInterface + 100000 + true + 11 + Ethernet3/11/1 + false + + Ethernet80 + 400000 + + + DeviceInterface + 100000 + true + 12 + Ethernet3/12/1 + false + + Ethernet88 + 400000 + + + DeviceInterface + 100000 + true + 13 + Ethernet3/13/1 + false + + Ethernet96 + 400000 + + + DeviceInterface + 100000 + true + 14 + Ethernet3/14/1 + false + + Ethernet104 + 400000 + + + DeviceInterface + 100000 + true + 15 + Ethernet3/15/1 + false + + Ethernet112 + 400000 + + + DeviceInterface + 100000 + true + 16 + Ethernet3/16/1 + false + + Ethernet120 + 400000 + + + DeviceInterface + 100000 + true + 17 + Ethernet3/17/1 + false + + Ethernet128 + 400000 + + + DeviceInterface + 100000 + true + 18 + Ethernet3/18/1 + false + + Ethernet136 + 400000 + + + DeviceInterface + 100000 + true + 19 + Ethernet3/19/1 + false + + Ethernet144 + 400000 + + + DeviceInterface + 100000 + true + 20 + Ethernet3/20/1 + false + + Ethernet152 + 400000 + + + DeviceInterface + 100000 + true + 21 + Ethernet3/21/1 + false + + Ethernet160 + 400000 + + + DeviceInterface + 100000 + true + 22 + Ethernet3/22/1 + false + + Ethernet168 + 400000 + + + DeviceInterface + 100000 + true + 23 + Ethernet3/23/1 + false + + Ethernet176 + 400000 + + + DeviceInterface + 100000 + true + 24 + Ethernet3/24/1 + false + + Ethernet184 + 400000 + + + DeviceInterface + 100000 + true + 25 + Ethernet3/25/1 + false + + Ethernet192 + 400000 + + + DeviceInterface + 100000 + true + 26 + Ethernet3/26/1 + false + + Ethernet200 + 400000 + + + DeviceInterface + 100000 + true + 27 + Ethernet3/27/1 + false + + Ethernet208 + 400000 + + + DeviceInterface + 100000 + true + 28 + Ethernet3/28/1 + false + + Ethernet216 + 400000 + + + DeviceInterface + 100000 + true + 29 + Ethernet3/29/1 + false + + Ethernet224 + 400000 + + + DeviceInterface + 100000 + true + 30 + Ethernet3/30/1 + false + + Ethernet232 + 400000 + + + DeviceInterface + 100000 + true + 31 + Ethernet3/31/1 + false + + Ethernet240 + 400000 + + + DeviceInterface + 100000 + true + 32 + Ethernet3/32/1 + false + + Ethernet248 + 400000 + + + DeviceInterface + 100000 + true + 33 + Ethernet3/33/1 + false + + Ethernet256 + 400000 + + + DeviceInterface + 100000 + true + 34 + Ethernet3/34/1 + false + + Ethernet264 + 400000 + + + DeviceInterface + 100000 + true + 35 + Ethernet3/35/1 + false + + Ethernet272 + 400000 + + + DeviceInterface + 100000 + true + 36 + Ethernet3/36/1 + false + + Ethernet280 + 400000 + + + DeviceInterface + 40000 + true + 37 + Ethernet4/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 38 + Ethernet4/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 39 + Ethernet4/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 40 + Ethernet4/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 41 + Ethernet4/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 42 + Ethernet4/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 43 + Ethernet4/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 44 + Ethernet4/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 45 + Ethernet4/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 46 + Ethernet4/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 47 + Ethernet4/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 48 + Ethernet4/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 49 + Ethernet4/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 50 + Ethernet4/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 51 + Ethernet4/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 52 + Ethernet4/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 53 + Ethernet4/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 54 + Ethernet4/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 55 + Ethernet4/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 56 + Ethernet4/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 57 + Ethernet4/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 58 + Ethernet4/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 59 + Ethernet4/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 60 + Ethernet4/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 61 + Ethernet4/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 62 + Ethernet4/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 63 + Ethernet4/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 64 + Ethernet4/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 65 + Ethernet4/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 66 + Ethernet4/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 67 + Ethernet4/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 68 + Ethernet4/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 69 + Ethernet4/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 70 + Ethernet4/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 71 + Ethernet4/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 72 + Ethernet4/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 73 + Ethernet4/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 74 + Ethernet4/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 75 + Ethernet4/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 76 + Ethernet4/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 77 + Ethernet4/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 78 + Ethernet4/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 79 + Ethernet4/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 80 + Ethernet4/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 81 + Ethernet4/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 82 + Ethernet4/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 83 + Ethernet4/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 84 + Ethernet4/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 85 + Ethernet5/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 86 + Ethernet5/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 87 + Ethernet5/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 88 + Ethernet5/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 89 + Ethernet5/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 90 + Ethernet5/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 91 + Ethernet5/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 92 + Ethernet5/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 93 + Ethernet5/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 94 + Ethernet5/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 95 + Ethernet5/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 96 + Ethernet5/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 97 + Ethernet5/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 98 + Ethernet5/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 99 + Ethernet5/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 100 + Ethernet5/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 101 + Ethernet5/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 102 + Ethernet5/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 103 + Ethernet5/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 104 + Ethernet5/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 105 + Ethernet5/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 106 + Ethernet5/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 107 + Ethernet5/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 108 + Ethernet5/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 109 + Ethernet5/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 110 + Ethernet5/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 111 + Ethernet5/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 112 + Ethernet5/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 113 + Ethernet5/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 114 + Ethernet5/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 115 + Ethernet5/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 116 + Ethernet5/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 117 + Ethernet5/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 118 + Ethernet5/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 119 + Ethernet5/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 120 + Ethernet5/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 121 + Ethernet5/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 122 + Ethernet5/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 123 + Ethernet5/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 124 + Ethernet5/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 125 + Ethernet5/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 126 + Ethernet5/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 127 + Ethernet5/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 128 + Ethernet5/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 129 + Ethernet5/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 130 + Ethernet5/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 131 + Ethernet5/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 132 + Ethernet5/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 133 + Ethernet6/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 134 + Ethernet6/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 135 + Ethernet6/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 136 + Ethernet6/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 137 + Ethernet6/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 138 + Ethernet6/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 139 + Ethernet6/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 140 + Ethernet6/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 141 + Ethernet6/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 142 + Ethernet6/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 143 + Ethernet6/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 144 + Ethernet6/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 145 + Ethernet6/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 146 + Ethernet6/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 147 + Ethernet6/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 148 + Ethernet6/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 149 + Ethernet6/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 150 + Ethernet6/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 151 + Ethernet6/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 152 + Ethernet6/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 153 + Ethernet6/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 154 + Ethernet6/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 155 + Ethernet6/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 156 + Ethernet6/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 157 + Ethernet6/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 158 + Ethernet6/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 159 + Ethernet6/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 160 + Ethernet6/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 161 + Ethernet6/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 162 + Ethernet6/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 163 + Ethernet6/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 164 + Ethernet6/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 165 + Ethernet6/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 166 + Ethernet6/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 167 + Ethernet6/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 168 + Ethernet6/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 169 + Ethernet6/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 170 + Ethernet6/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 171 + Ethernet6/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 172 + Ethernet6/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 173 + Ethernet6/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 174 + Ethernet6/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 175 + Ethernet6/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 176 + Ethernet6/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 177 + Ethernet6/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 178 + Ethernet6/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 179 + Ethernet6/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 180 + Ethernet6/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 181 + Ethernet7/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 182 + Ethernet7/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 183 + Ethernet7/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 184 + Ethernet7/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 185 + Ethernet7/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 186 + Ethernet7/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 187 + Ethernet7/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 188 + Ethernet7/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 189 + Ethernet7/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 190 + Ethernet7/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 191 + Ethernet7/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 192 + Ethernet7/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 193 + Ethernet7/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 194 + Ethernet7/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 195 + Ethernet7/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 196 + Ethernet7/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 197 + Ethernet7/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 198 + Ethernet7/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 199 + Ethernet7/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 200 + Ethernet7/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 201 + Ethernet7/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 202 + Ethernet7/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 203 + Ethernet7/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 204 + Ethernet7/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 205 + Ethernet7/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 206 + Ethernet7/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 207 + Ethernet7/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 208 + Ethernet7/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 209 + Ethernet7/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 210 + Ethernet7/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 211 + Ethernet7/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 212 + Ethernet7/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 213 + Ethernet7/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 214 + Ethernet7/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 215 + Ethernet7/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 216 + Ethernet7/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 217 + Ethernet7/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 218 + Ethernet7/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 219 + Ethernet7/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 220 + Ethernet7/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 221 + Ethernet7/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 222 + Ethernet7/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 223 + Ethernet7/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 224 + Ethernet7/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 225 + Ethernet7/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 226 + Ethernet7/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 227 + Ethernet7/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 228 + Ethernet7/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 229 + Ethernet8/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 230 + Ethernet8/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 231 + Ethernet8/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 232 + Ethernet8/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 233 + Ethernet8/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 234 + Ethernet8/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 235 + Ethernet8/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 236 + Ethernet8/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 237 + Ethernet8/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 238 + Ethernet8/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 239 + Ethernet8/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 240 + Ethernet8/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 241 + Ethernet8/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 242 + Ethernet8/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 243 + Ethernet8/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 244 + Ethernet8/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 245 + Ethernet8/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 246 + Ethernet8/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 247 + Ethernet8/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 248 + Ethernet8/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 249 + Ethernet8/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 250 + Ethernet8/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 251 + Ethernet8/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 252 + Ethernet8/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 253 + Ethernet8/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 254 + Ethernet8/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 255 + Ethernet8/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 256 + Ethernet8/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 257 + Ethernet8/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 258 + Ethernet8/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 259 + Ethernet8/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 260 + Ethernet8/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 261 + Ethernet8/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 262 + Ethernet8/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 263 + Ethernet8/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 264 + Ethernet8/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 265 + Ethernet8/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 266 + Ethernet8/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 267 + Ethernet8/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 268 + Ethernet8/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 269 + Ethernet8/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 270 + Ethernet8/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 271 + Ethernet8/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 272 + Ethernet8/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 273 + Ethernet8/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 274 + Ethernet8/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 275 + Ethernet8/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 276 + Ethernet8/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 277 + Ethernet9/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 278 + Ethernet9/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 279 + Ethernet9/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 280 + Ethernet9/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 281 + Ethernet9/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 282 + Ethernet9/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 283 + Ethernet9/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 284 + Ethernet9/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 285 + Ethernet9/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 286 + Ethernet9/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 287 + Ethernet9/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 288 + Ethernet9/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 289 + Ethernet9/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 290 + Ethernet9/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 291 + Ethernet9/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 292 + Ethernet9/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 293 + Ethernet9/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 294 + Ethernet9/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 295 + Ethernet9/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 296 + Ethernet9/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 297 + Ethernet9/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 298 + Ethernet9/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 299 + Ethernet9/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 300 + Ethernet9/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 301 + Ethernet9/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 302 + Ethernet9/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 303 + Ethernet9/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 304 + Ethernet9/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 305 + Ethernet9/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 306 + Ethernet9/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 307 + Ethernet9/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 308 + Ethernet9/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 309 + Ethernet9/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 310 + Ethernet9/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 311 + Ethernet9/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 312 + Ethernet9/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 313 + Ethernet9/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 314 + Ethernet9/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 315 + Ethernet9/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 316 + Ethernet9/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 317 + Ethernet9/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 318 + Ethernet9/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 319 + Ethernet9/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 320 + Ethernet9/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 321 + Ethernet9/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 322 + Ethernet9/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 323 + Ethernet9/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 324 + Ethernet9/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 325 + Ethernet10/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 326 + Ethernet10/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 327 + Ethernet10/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 328 + Ethernet10/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 329 + Ethernet10/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 330 + Ethernet10/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 331 + Ethernet10/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 332 + Ethernet10/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 333 + Ethernet10/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 334 + Ethernet10/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 335 + Ethernet10/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 336 + Ethernet10/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 337 + Ethernet10/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 338 + Ethernet10/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 339 + Ethernet10/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 340 + Ethernet10/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 341 + Ethernet10/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 342 + Ethernet10/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 343 + Ethernet10/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 344 + Ethernet10/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 345 + Ethernet10/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 346 + Ethernet10/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 347 + Ethernet10/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 348 + Ethernet10/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 349 + Ethernet10/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 350 + Ethernet10/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 351 + Ethernet10/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 352 + Ethernet10/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 353 + Ethernet10/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 354 + Ethernet10/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 355 + Ethernet10/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 356 + Ethernet10/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 357 + Ethernet10/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 358 + Ethernet10/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 359 + Ethernet10/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 360 + Ethernet10/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 361 + Ethernet10/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 362 + Ethernet10/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 363 + Ethernet10/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 364 + Ethernet10/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 365 + Ethernet10/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 366 + Ethernet10/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 367 + Ethernet10/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 368 + Ethernet10/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 369 + Ethernet10/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 370 + Ethernet10/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 371 + Ethernet10/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 372 + Ethernet10/48/1 + false + + Ethernet188 + 100000 + + + true + 0 + Sonic-Chassis-sku + + + + Ethernet3/1/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:3:0:1 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + Ethernet3/2/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:3:0:2 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + Ethernet3/3/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:3:0:3 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + Ethernet3/4/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:3:0:4 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + Ethernet3/5/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:3:0:5 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + Ethernet3/6/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:3:0:6 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + Ethernet3/7/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:3:0:7 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + Ethernet3/8/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:3:0:8 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + Ethernet3/9/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:3:0:9 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + Ethernet3/10/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:3:0:10 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet3/11/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:3:0:11 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet3/12/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:3:0:12 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet3/13/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:3:0:13 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet3/14/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:3:0:14 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet3/15/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:3:0:15 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet3/16/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:3:0:16 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet3/17/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:3:0:17 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet3/18/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:3:0:18 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet3/19/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:3:0:19 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + Ethernet3/20/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:3:0:20 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + Ethernet3/21/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:3:0:21 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + Ethernet3/22/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:3:0:22 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + Ethernet3/23/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:3:0:23 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + Ethernet3/24/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:3:0:24 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + Ethernet3/25/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:3:0:25 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + Ethernet3/26/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:3:0:26 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + Ethernet3/27/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:3:0:27 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + Ethernet3/28/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:3:0:28 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet3/29/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:3:0:29 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet3/30/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:3:0:30 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet3/31/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:3:0:31 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet3/32/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:3:0:32 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet3/33/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:3:0:33 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet3/34/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:3:0:34 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet3/35/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:3:0:35 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet3/36/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:3:0:36 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + cpu3/0 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:3:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + cpu3/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:3:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Recirc3/0/0 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:3:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Recirc3/1/0 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:3:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Recirc3/0/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:3:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 19 + + + CoreId + 1 + + + + + Recirc3/1/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:3:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 19 + + + CoreId + 1 + + + + + Ethernet4/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:4:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet4/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:4:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet4/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:4:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet4/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:4:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet4/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:4:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet4/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:4:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet4/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:4:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet4/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:4:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet4/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:4:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet4/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:4:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet4/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:4:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet4/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:4:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet4/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:4:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet4/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:4:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet4/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:4:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet4/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:4:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet4/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:4:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet4/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:4:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet4/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:4:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet4/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:4:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet4/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:4:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet4/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:4:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet4/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:4:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet4/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:4:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet4/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:4:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet4/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:4:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet4/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:4:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet4/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:4:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet4/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:4:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet4/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:4:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet4/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:4:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet4/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:4:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet4/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:4:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet4/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:4:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet4/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:4:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet4/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:4:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet4/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:4:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet4/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:4:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet4/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:4:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet4/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:4:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet4/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:4:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet4/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:4:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet4/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:4:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet4/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:4:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet4/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:4:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet4/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:4:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet4/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:4:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet4/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:4:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu4/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:4:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc4/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:4:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc4/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:4:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet5/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:5:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet5/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:5:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet5/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:5:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet5/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:5:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet5/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:5:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet5/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:5:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet5/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:5:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet5/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:5:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet5/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:5:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet5/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:5:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet5/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:5:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet5/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:5:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet5/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:5:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet5/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:5:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet5/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:5:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet5/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:5:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet5/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:5:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet5/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:5:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet5/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:5:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet5/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:5:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet5/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:5:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet5/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:5:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet5/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:5:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet5/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:5:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet5/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:5:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet5/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:5:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet5/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:5:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet5/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:5:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet5/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:5:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet5/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:5:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet5/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:5:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet5/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:5:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet5/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:5:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet5/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:5:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet5/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:5:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet5/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:5:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet5/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:5:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet5/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:5:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet5/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:5:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet5/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:5:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet5/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:5:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet5/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:5:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet5/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:5:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet5/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:5:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet5/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:5:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet5/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:5:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet5/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:5:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet5/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:5:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu5/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:5:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc5/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:5:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc5/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:5:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet6/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:6:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet6/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:6:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet6/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:6:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet6/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:6:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet6/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:6:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet6/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:6:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet6/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:6:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet6/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:6:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet6/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:6:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet6/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:6:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet6/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:6:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet6/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:6:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet6/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:6:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet6/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:6:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet6/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:6:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet6/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:6:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet6/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:6:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet6/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:6:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet6/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:6:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet6/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:6:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet6/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:6:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet6/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:6:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet6/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:6:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet6/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:6:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet6/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:6:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet6/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:6:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet6/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:6:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet6/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:6:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet6/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:6:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet6/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:6:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet6/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:6:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet6/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:6:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet6/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:6:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet6/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:6:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet6/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:6:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet6/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:6:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet6/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:6:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet6/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:6:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet6/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:6:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet6/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:6:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet6/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:6:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet6/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:6:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet6/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:6:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet6/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:6:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet6/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:6:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet6/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:6:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet6/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:6:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet6/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:6:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu6/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:6:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc6/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:6:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc6/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:6:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet7/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:7:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet7/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:7:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet7/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:7:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet7/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:7:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet7/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:7:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet7/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:7:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet7/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:7:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet7/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:7:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet7/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:7:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet7/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:7:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet7/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:7:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet7/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:7:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet7/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:7:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet7/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:7:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet7/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:7:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet7/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:7:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet7/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:7:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet7/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:7:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet7/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:7:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet7/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:7:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet7/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:7:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet7/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:7:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet7/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:7:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet7/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:7:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet7/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:7:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet7/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:7:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet7/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:7:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet7/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:7:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet7/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:7:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet7/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:7:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet7/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:7:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet7/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:7:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet7/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:7:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet7/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:7:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet7/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:7:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet7/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:7:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet7/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:7:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet7/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:7:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet7/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:7:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet7/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:7:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet7/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:7:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet7/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:7:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet7/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:7:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet7/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:7:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet7/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:7:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet7/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:7:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet7/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:7:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet7/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:7:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu7/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:7:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc7/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:7:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc7/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:7:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet8/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:8:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet8/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:8:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet8/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:8:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet8/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:8:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet8/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:8:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet8/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:8:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet8/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:8:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet8/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:8:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet8/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:8:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet8/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:8:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet8/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:8:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet8/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:8:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet8/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:8:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet8/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:8:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet8/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:8:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet8/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:8:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet8/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:8:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet8/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:8:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet8/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:8:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet8/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:8:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet8/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:8:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet8/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:8:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet8/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:8:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet8/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:8:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet8/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:8:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet8/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:8:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet8/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:8:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet8/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:8:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet8/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:8:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet8/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:8:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet8/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:8:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet8/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:8:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet8/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:8:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet8/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:8:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet8/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:8:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet8/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:8:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet8/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:8:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet8/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:8:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet8/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:8:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet8/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:8:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet8/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:8:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet8/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:8:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet8/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:8:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet8/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:8:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet8/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:8:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet8/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:8:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet8/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:8:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet8/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:8:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu8/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:8:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc8/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:8:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc8/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:8:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet9/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:9:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet9/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:9:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet9/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:9:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet9/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:9:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet9/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:9:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet9/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:9:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet9/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:9:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet9/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:9:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet9/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:9:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet9/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:9:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet9/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:9:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet9/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:9:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet9/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:9:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet9/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:9:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet9/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:9:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet9/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:9:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet9/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:9:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet9/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:9:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet9/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:9:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet9/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:9:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet9/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:9:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet9/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:9:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet9/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:9:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet9/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:9:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet9/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:9:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet9/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:9:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet9/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:9:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet9/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:9:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet9/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:9:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet9/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:9:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet9/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:9:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet9/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:9:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet9/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:9:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet9/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:9:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet9/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:9:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet9/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:9:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet9/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:9:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet9/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:9:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet9/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:9:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet9/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:9:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet9/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:9:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet9/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:9:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet9/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:9:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet9/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:9:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet9/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:9:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet9/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:9:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet9/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:9:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet9/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:9:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + Ethernet10/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:10:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet10/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:10:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet10/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:10:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet10/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:10:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet10/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:10:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet10/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:10:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet10/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:10:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet10/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:10:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet10/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:10:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet10/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:10:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet10/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:10:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet10/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:10:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet10/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:10:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet10/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:10:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet10/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:10:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet10/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:10:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet10/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:10:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet10/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:10:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet10/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:10:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet10/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:10:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet10/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:10:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet10/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:10:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet10/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:10:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet10/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:10:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet10/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:10:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet10/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:10:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet10/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:10:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet10/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:10:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet10/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:10:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet10/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:10:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet10/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:10:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet10/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:10:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet10/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:10:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet10/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:10:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet10/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:10:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet10/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:10:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet10/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:10:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet10/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:10:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet10/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:10:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet10/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:10:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet10/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:10:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet10/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:10:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet10/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:10:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet10/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:10:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet10/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:10:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet10/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:10:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet10/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:10:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet10/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:10:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu10/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:10:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc10/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:10:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc10/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:10:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + + + DeviceInterface + + true + 1 + Management1/1 + false + + + 1000 + + + + + DeviceInterface + + true + 1 + Ethernet3/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 2 + Ethernet3/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 3 + Ethernet3/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 4 + Ethernet3/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 5 + Ethernet3/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 6 + Ethernet3/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 7 + Ethernet3/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 8 + Ethernet3/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 9 + Ethernet3/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 10 + Ethernet3/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 11 + Ethernet3/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 12 + Ethernet3/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 13 + Ethernet3/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 14 + Ethernet3/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 15 + Ethernet3/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 16 + Ethernet3/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 17 + Ethernet3/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 18 + Ethernet3/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 19 + Ethernet3/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 20 + Ethernet3/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 21 + Ethernet3/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 22 + Ethernet3/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 23 + Ethernet3/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 24 + Ethernet3/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 25 + Ethernet3/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 26 + Ethernet3/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 27 + Ethernet3/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 28 + Ethernet3/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 29 + Ethernet3/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 30 + Ethernet3/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 31 + Ethernet3/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 32 + Ethernet3/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 33 + Ethernet3/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 34 + Ethernet3/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 35 + Ethernet3/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 36 + Ethernet3/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 37 + Ethernet3/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 38 + Ethernet3/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 39 + Ethernet3/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 40 + Ethernet3/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 41 + Ethernet3/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 42 + Ethernet3/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 43 + Ethernet3/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 44 + Ethernet3/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 45 + Ethernet3/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 46 + Ethernet3/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 47 + Ethernet3/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 48 + Ethernet3/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 49 + Ethernet3/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 50 + Ethernet3/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 51 + Ethernet3/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 52 + Ethernet3/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 53 + Ethernet3/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 54 + Ethernet3/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 55 + Ethernet3/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 56 + Ethernet3/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 57 + Ethernet3/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 58 + Ethernet3/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 59 + Ethernet3/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 60 + Ethernet3/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 61 + Ethernet3/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 62 + Ethernet3/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 63 + Ethernet3/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 64 + Ethernet3/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 65 + Ethernet3/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 66 + Ethernet3/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 67 + Ethernet3/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 68 + Ethernet3/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 69 + Ethernet3/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 70 + Ethernet3/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 71 + Ethernet3/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 72 + Ethernet3/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 73 + Ethernet3/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 74 + Ethernet3/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 75 + Ethernet3/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 76 + Ethernet3/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 77 + Ethernet3/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 78 + Ethernet3/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 79 + Ethernet3/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 80 + Ethernet3/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 81 + Ethernet3/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 82 + Ethernet3/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 83 + Ethernet3/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 84 + Ethernet3/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 85 + Ethernet3/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 86 + Ethernet3/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 87 + Ethernet3/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 88 + Ethernet3/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 89 + Ethernet3/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 90 + Ethernet3/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 91 + Ethernet3/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 92 + Ethernet3/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 93 + Ethernet3/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 94 + Ethernet3/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 95 + Ethernet3/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 96 + Ethernet3/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 97 + Ethernet3/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 98 + Ethernet3/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 99 + Ethernet3/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 100 + Ethernet3/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 101 + Ethernet3/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 102 + Ethernet3/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 103 + Ethernet3/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 104 + Ethernet3/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 105 + Ethernet3/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 106 + Ethernet3/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 107 + Ethernet3/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 108 + Ethernet3/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 109 + Ethernet4/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 110 + Ethernet4/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 111 + Ethernet4/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 112 + Ethernet4/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 113 + Ethernet4/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 114 + Ethernet4/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 115 + Ethernet4/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 116 + Ethernet4/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 117 + Ethernet4/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 118 + Ethernet4/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 119 + Ethernet4/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 120 + Ethernet4/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 121 + Ethernet4/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 122 + Ethernet4/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 123 + Ethernet4/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 124 + Ethernet4/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 125 + Ethernet4/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 126 + Ethernet4/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 127 + Ethernet4/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 128 + Ethernet4/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 129 + Ethernet4/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 130 + Ethernet4/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 131 + Ethernet4/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 132 + Ethernet4/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 133 + Ethernet4/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 134 + Ethernet4/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 135 + Ethernet4/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 136 + Ethernet4/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 137 + Ethernet4/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 138 + Ethernet4/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 139 + Ethernet4/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 140 + Ethernet4/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 141 + Ethernet4/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 142 + Ethernet4/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 143 + Ethernet4/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 144 + Ethernet4/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 145 + Ethernet4/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 146 + Ethernet4/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 147 + Ethernet4/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 148 + Ethernet4/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 149 + Ethernet4/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 150 + Ethernet4/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 151 + Ethernet4/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 152 + Ethernet4/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 153 + Ethernet4/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 154 + Ethernet4/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 155 + Ethernet4/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 156 + Ethernet4/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 157 + Ethernet4/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 158 + Ethernet4/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 159 + Ethernet4/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 160 + Ethernet4/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 161 + Ethernet4/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 162 + Ethernet4/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 163 + Ethernet4/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 164 + Ethernet4/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 165 + Ethernet4/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 166 + Ethernet4/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 167 + Ethernet4/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 168 + Ethernet4/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 169 + Ethernet4/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 170 + Ethernet4/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 171 + Ethernet4/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 172 + Ethernet4/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 173 + Ethernet4/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 174 + Ethernet4/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 175 + Ethernet4/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 176 + Ethernet4/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 177 + Ethernet4/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 178 + Ethernet4/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 179 + Ethernet4/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 180 + Ethernet4/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 181 + Ethernet4/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 182 + Ethernet4/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 183 + Ethernet4/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 184 + Ethernet4/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 185 + Ethernet4/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 186 + Ethernet4/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 187 + Ethernet4/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 188 + Ethernet4/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 189 + Ethernet4/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 190 + Ethernet4/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 191 + Ethernet4/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 192 + Ethernet4/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 193 + Ethernet4/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 194 + Ethernet4/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 195 + Ethernet4/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 196 + Ethernet4/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 197 + Ethernet4/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 198 + Ethernet4/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 199 + Ethernet4/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 200 + Ethernet4/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 201 + Ethernet4/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 202 + Ethernet4/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 203 + Ethernet4/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 204 + Ethernet4/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 205 + Ethernet4/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 206 + Ethernet4/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 207 + Ethernet4/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 208 + Ethernet4/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 209 + Ethernet4/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 210 + Ethernet4/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 211 + Ethernet4/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 212 + Ethernet4/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 213 + Ethernet4/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 214 + Ethernet4/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 215 + Ethernet4/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 216 + Ethernet4/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 217 + Ethernet4/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 218 + Ethernet4/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 219 + Ethernet4/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 220 + Ethernet4/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 221 + Ethernet4/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 222 + Ethernet4/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 223 + Ethernet4/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 224 + Ethernet4/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 225 + Ethernet4/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 226 + Ethernet4/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 227 + Ethernet4/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 228 + Ethernet4/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 229 + Ethernet4/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 230 + Ethernet4/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 231 + Ethernet4/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 232 + Ethernet4/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 233 + Ethernet4/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 234 + Ethernet4/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 235 + Ethernet4/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 236 + Ethernet4/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 237 + Ethernet4/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 238 + Ethernet4/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 239 + Ethernet4/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 240 + Ethernet4/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 241 + Ethernet4/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 242 + Ethernet4/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 243 + Ethernet4/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 244 + Ethernet4/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 245 + Ethernet4/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 246 + Ethernet4/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 247 + Ethernet4/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 248 + Ethernet4/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 249 + Ethernet4/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 250 + Ethernet4/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 251 + Ethernet4/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 252 + Ethernet4/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 253 + Ethernet5/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 254 + Ethernet5/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 255 + Ethernet5/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 256 + Ethernet5/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 257 + Ethernet5/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 258 + Ethernet5/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 259 + Ethernet5/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 260 + Ethernet5/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 261 + Ethernet5/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 262 + Ethernet5/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 263 + Ethernet5/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 264 + Ethernet5/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 265 + Ethernet5/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 266 + Ethernet5/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 267 + Ethernet5/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 268 + Ethernet5/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 269 + Ethernet5/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 270 + Ethernet5/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 271 + Ethernet5/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 272 + Ethernet5/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 273 + Ethernet5/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 274 + Ethernet5/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 275 + Ethernet5/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 276 + Ethernet5/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 277 + Ethernet5/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 278 + Ethernet5/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 279 + Ethernet5/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 280 + Ethernet5/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 281 + Ethernet5/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 282 + Ethernet5/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 283 + Ethernet5/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 284 + Ethernet5/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 285 + Ethernet5/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 286 + Ethernet5/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 287 + Ethernet5/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 288 + Ethernet5/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 289 + Ethernet5/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 290 + Ethernet5/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 291 + Ethernet5/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 292 + Ethernet5/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 293 + Ethernet5/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 294 + Ethernet5/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 295 + Ethernet5/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 296 + Ethernet5/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 297 + Ethernet5/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 298 + Ethernet5/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 299 + Ethernet5/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 300 + Ethernet5/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 301 + Ethernet5/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 302 + Ethernet5/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 303 + Ethernet5/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 304 + Ethernet5/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 305 + Ethernet5/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 306 + Ethernet5/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 307 + Ethernet5/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 308 + Ethernet5/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 309 + Ethernet5/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 310 + Ethernet5/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 311 + Ethernet5/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 312 + Ethernet5/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 313 + Ethernet5/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 314 + Ethernet5/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 315 + Ethernet5/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 316 + Ethernet5/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 317 + Ethernet5/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 318 + Ethernet5/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 319 + Ethernet5/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 320 + Ethernet5/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 321 + Ethernet5/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 322 + Ethernet5/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 323 + Ethernet5/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 324 + Ethernet5/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 325 + Ethernet5/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 326 + Ethernet5/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 327 + Ethernet5/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 328 + Ethernet5/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 329 + Ethernet5/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 330 + Ethernet5/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 331 + Ethernet5/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 332 + Ethernet5/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 333 + Ethernet5/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 334 + Ethernet5/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 335 + Ethernet5/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 336 + Ethernet5/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 337 + Ethernet5/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 338 + Ethernet5/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 339 + Ethernet5/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 340 + Ethernet5/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 341 + Ethernet5/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 342 + Ethernet5/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 343 + Ethernet5/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 344 + Ethernet5/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 345 + Ethernet5/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 346 + Ethernet5/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 347 + Ethernet5/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 348 + Ethernet5/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 349 + Ethernet5/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 350 + Ethernet5/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 351 + Ethernet5/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 352 + Ethernet5/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 353 + Ethernet5/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 354 + Ethernet5/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 355 + Ethernet5/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 356 + Ethernet5/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 357 + Ethernet5/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 358 + Ethernet5/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 359 + Ethernet5/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 360 + Ethernet5/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 361 + Ethernet5/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 362 + Ethernet5/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 363 + Ethernet5/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 364 + Ethernet5/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 365 + Ethernet5/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 366 + Ethernet5/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 367 + Ethernet5/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 368 + Ethernet5/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 369 + Ethernet5/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 370 + Ethernet5/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 371 + Ethernet5/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 372 + Ethernet5/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 373 + Ethernet5/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 374 + Ethernet5/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 375 + Ethernet5/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 376 + Ethernet5/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 377 + Ethernet5/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 378 + Ethernet5/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 379 + Ethernet5/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 380 + Ethernet5/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 381 + Ethernet5/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 382 + Ethernet5/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 383 + Ethernet5/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 384 + Ethernet5/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 385 + Ethernet5/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 386 + Ethernet5/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 387 + Ethernet5/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 388 + Ethernet5/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 389 + Ethernet5/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 390 + Ethernet5/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 391 + Ethernet5/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 392 + Ethernet5/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 393 + Ethernet5/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 394 + Ethernet5/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 395 + Ethernet5/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 396 + Ethernet5/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 397 + Ethernet6/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 398 + Ethernet6/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 399 + Ethernet6/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 400 + Ethernet6/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 401 + Ethernet6/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 402 + Ethernet6/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 403 + Ethernet6/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 404 + Ethernet6/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 405 + Ethernet6/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 406 + Ethernet6/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 407 + Ethernet6/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 408 + Ethernet6/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 409 + Ethernet6/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 410 + Ethernet6/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 411 + Ethernet6/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 412 + Ethernet6/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 413 + Ethernet6/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 414 + Ethernet6/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 415 + Ethernet6/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 416 + Ethernet6/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 417 + Ethernet6/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 418 + Ethernet6/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 419 + Ethernet6/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 420 + Ethernet6/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 421 + Ethernet6/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 422 + Ethernet6/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 423 + Ethernet6/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 424 + Ethernet6/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 425 + Ethernet6/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 426 + Ethernet6/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 427 + Ethernet6/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 428 + Ethernet6/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 429 + Ethernet6/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 430 + Ethernet6/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 431 + Ethernet6/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 432 + Ethernet6/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 433 + Ethernet6/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 434 + Ethernet6/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 435 + Ethernet6/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 436 + Ethernet6/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 437 + Ethernet6/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 438 + Ethernet6/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 439 + Ethernet6/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 440 + Ethernet6/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 441 + Ethernet6/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 442 + Ethernet6/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 443 + Ethernet6/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 444 + Ethernet6/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 445 + Ethernet6/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 446 + Ethernet6/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 447 + Ethernet6/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 448 + Ethernet6/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 449 + Ethernet6/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 450 + Ethernet6/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 451 + Ethernet6/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 452 + Ethernet6/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 453 + Ethernet6/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 454 + Ethernet6/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 455 + Ethernet6/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 456 + Ethernet6/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 457 + Ethernet6/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 458 + Ethernet6/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 459 + Ethernet6/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 460 + Ethernet6/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 461 + Ethernet6/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 462 + Ethernet6/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 463 + Ethernet6/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 464 + Ethernet6/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 465 + Ethernet6/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 466 + Ethernet6/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 467 + Ethernet6/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 468 + Ethernet6/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 469 + Ethernet6/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 470 + Ethernet6/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 471 + Ethernet6/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 472 + Ethernet6/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 473 + Ethernet6/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 474 + Ethernet6/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 475 + Ethernet6/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 476 + Ethernet6/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 477 + Ethernet6/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 478 + Ethernet6/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 479 + Ethernet6/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 480 + Ethernet6/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 481 + Ethernet6/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 482 + Ethernet6/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 483 + Ethernet6/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 484 + Ethernet6/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 485 + Ethernet6/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 486 + Ethernet6/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 487 + Ethernet6/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 488 + Ethernet6/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 489 + Ethernet6/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 490 + Ethernet6/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 491 + Ethernet6/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 492 + Ethernet6/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 493 + Ethernet6/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 494 + Ethernet6/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 495 + Ethernet6/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 496 + Ethernet6/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 497 + Ethernet6/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 498 + Ethernet6/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 499 + Ethernet6/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 500 + Ethernet6/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 501 + Ethernet6/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 502 + Ethernet6/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 503 + Ethernet6/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 504 + Ethernet6/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 505 + Ethernet6/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 506 + Ethernet6/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 507 + Ethernet6/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 508 + Ethernet6/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 509 + Ethernet6/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 510 + Ethernet6/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 511 + Ethernet6/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 512 + Ethernet6/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 513 + Ethernet6/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 514 + Ethernet6/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 515 + Ethernet6/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 516 + Ethernet6/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 517 + Ethernet6/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 518 + Ethernet6/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 519 + Ethernet6/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 520 + Ethernet6/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 521 + Ethernet6/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 522 + Ethernet6/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 523 + Ethernet6/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 524 + Ethernet6/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 525 + Ethernet6/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 526 + Ethernet6/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 527 + Ethernet6/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 528 + Ethernet6/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 529 + Ethernet6/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 530 + Ethernet6/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 531 + Ethernet6/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 532 + Ethernet6/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 533 + Ethernet6/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 534 + Ethernet6/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 535 + Ethernet6/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 536 + Ethernet6/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 537 + Ethernet6/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 538 + Ethernet6/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 539 + Ethernet6/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 540 + Ethernet6/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 541 + Ethernet7/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 542 + Ethernet7/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 543 + Ethernet7/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 544 + Ethernet7/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 545 + Ethernet7/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 546 + Ethernet7/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 547 + Ethernet7/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 548 + Ethernet7/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 549 + Ethernet7/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 550 + Ethernet7/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 551 + Ethernet7/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 552 + Ethernet7/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 553 + Ethernet7/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 554 + Ethernet7/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 555 + Ethernet7/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 556 + Ethernet7/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 557 + Ethernet7/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 558 + Ethernet7/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 559 + Ethernet7/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 560 + Ethernet7/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 561 + Ethernet7/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 562 + Ethernet7/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 563 + Ethernet7/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 564 + Ethernet7/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 565 + Ethernet7/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 566 + Ethernet7/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 567 + Ethernet7/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 568 + Ethernet7/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 569 + Ethernet7/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 570 + Ethernet7/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 571 + Ethernet7/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 572 + Ethernet7/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 573 + Ethernet7/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 574 + Ethernet7/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 575 + Ethernet7/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 576 + Ethernet7/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 577 + Ethernet7/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 578 + Ethernet7/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 579 + Ethernet7/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 580 + Ethernet7/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 581 + Ethernet7/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 582 + Ethernet7/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 583 + Ethernet7/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 584 + Ethernet7/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 585 + Ethernet7/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 586 + Ethernet7/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 587 + Ethernet7/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 588 + Ethernet7/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 589 + Ethernet7/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 590 + Ethernet7/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 591 + Ethernet7/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 592 + Ethernet7/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 593 + Ethernet7/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 594 + Ethernet7/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 595 + Ethernet7/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 596 + Ethernet7/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 597 + Ethernet7/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 598 + Ethernet7/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 599 + Ethernet7/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 600 + Ethernet7/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 601 + Ethernet7/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 602 + Ethernet7/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 603 + Ethernet7/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 604 + Ethernet7/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 605 + Ethernet7/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 606 + Ethernet7/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 607 + Ethernet7/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 608 + Ethernet7/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 609 + Ethernet7/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 610 + Ethernet7/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 611 + Ethernet7/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 612 + Ethernet7/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 613 + Ethernet7/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 614 + Ethernet7/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 615 + Ethernet7/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 616 + Ethernet7/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 617 + Ethernet7/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 618 + Ethernet7/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 619 + Ethernet7/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 620 + Ethernet7/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 621 + Ethernet7/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 622 + Ethernet7/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 623 + Ethernet7/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 624 + Ethernet7/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 625 + Ethernet7/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 626 + Ethernet7/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 627 + Ethernet7/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 628 + Ethernet7/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 629 + Ethernet7/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 630 + Ethernet7/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 631 + Ethernet7/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 632 + Ethernet7/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 633 + Ethernet7/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 634 + Ethernet7/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 635 + Ethernet7/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 636 + Ethernet7/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 637 + Ethernet7/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 638 + Ethernet7/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 639 + Ethernet7/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 640 + Ethernet7/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 641 + Ethernet7/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 642 + Ethernet7/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 643 + Ethernet7/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 644 + Ethernet7/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 645 + Ethernet7/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 646 + Ethernet7/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 647 + Ethernet7/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 648 + Ethernet7/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 649 + Ethernet7/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 650 + Ethernet7/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 651 + Ethernet7/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 652 + Ethernet7/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 653 + Ethernet7/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 654 + Ethernet7/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 655 + Ethernet7/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 656 + Ethernet7/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 657 + Ethernet7/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 658 + Ethernet7/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 659 + Ethernet7/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 660 + Ethernet7/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 661 + Ethernet7/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 662 + Ethernet7/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 663 + Ethernet7/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 664 + Ethernet7/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 665 + Ethernet7/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 666 + Ethernet7/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 667 + Ethernet7/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 668 + Ethernet7/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 669 + Ethernet7/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 670 + Ethernet7/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 671 + Ethernet7/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 672 + Ethernet7/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 673 + Ethernet7/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 674 + Ethernet7/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 675 + Ethernet7/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 676 + Ethernet7/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 677 + Ethernet7/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 678 + Ethernet7/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 679 + Ethernet7/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 680 + Ethernet7/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 681 + Ethernet7/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 682 + Ethernet7/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 683 + Ethernet7/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 684 + Ethernet7/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 685 + Ethernet8/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 686 + Ethernet8/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 687 + Ethernet8/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 688 + Ethernet8/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 689 + Ethernet8/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 690 + Ethernet8/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 691 + Ethernet8/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 692 + Ethernet8/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 693 + Ethernet8/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 694 + Ethernet8/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 695 + Ethernet8/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 696 + Ethernet8/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 697 + Ethernet8/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 698 + Ethernet8/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 699 + Ethernet8/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 700 + Ethernet8/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 701 + Ethernet8/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 702 + Ethernet8/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 703 + Ethernet8/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 704 + Ethernet8/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 705 + Ethernet8/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 706 + Ethernet8/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 707 + Ethernet8/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 708 + Ethernet8/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 709 + Ethernet8/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 710 + Ethernet8/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 711 + Ethernet8/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 712 + Ethernet8/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 713 + Ethernet8/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 714 + Ethernet8/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 715 + Ethernet8/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 716 + Ethernet8/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 717 + Ethernet8/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 718 + Ethernet8/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 719 + Ethernet8/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 720 + Ethernet8/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 721 + Ethernet8/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 722 + Ethernet8/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 723 + Ethernet8/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 724 + Ethernet8/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 725 + Ethernet8/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 726 + Ethernet8/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 727 + Ethernet8/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 728 + Ethernet8/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 729 + Ethernet8/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 730 + Ethernet8/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 731 + Ethernet8/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 732 + Ethernet8/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 733 + Ethernet8/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 734 + Ethernet8/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 735 + Ethernet8/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 736 + Ethernet8/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 737 + Ethernet8/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 738 + Ethernet8/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 739 + Ethernet8/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 740 + Ethernet8/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 741 + Ethernet8/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 742 + Ethernet8/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 743 + Ethernet8/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 744 + Ethernet8/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 745 + Ethernet8/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 746 + Ethernet8/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 747 + Ethernet8/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 748 + Ethernet8/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 749 + Ethernet8/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 750 + Ethernet8/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 751 + Ethernet8/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 752 + Ethernet8/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 753 + Ethernet8/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 754 + Ethernet8/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 755 + Ethernet8/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 756 + Ethernet8/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 757 + Ethernet8/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 758 + Ethernet8/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 759 + Ethernet8/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 760 + Ethernet8/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 761 + Ethernet8/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 762 + Ethernet8/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 763 + Ethernet8/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 764 + Ethernet8/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 765 + Ethernet8/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 766 + Ethernet8/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 767 + Ethernet8/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 768 + Ethernet8/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 769 + Ethernet8/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 770 + Ethernet8/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 771 + Ethernet8/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 772 + Ethernet8/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 773 + Ethernet8/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 774 + Ethernet8/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 775 + Ethernet8/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 776 + Ethernet8/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 777 + Ethernet8/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 778 + Ethernet8/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 779 + Ethernet8/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 780 + Ethernet8/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 781 + Ethernet8/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 782 + Ethernet8/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 783 + Ethernet8/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 784 + Ethernet8/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 785 + Ethernet8/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 786 + Ethernet8/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 787 + Ethernet8/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 788 + Ethernet8/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 789 + Ethernet8/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 790 + Ethernet8/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 791 + Ethernet8/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 792 + Ethernet8/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 793 + Ethernet8/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 794 + Ethernet8/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 795 + Ethernet8/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 796 + Ethernet8/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 797 + Ethernet8/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 798 + Ethernet8/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 799 + Ethernet8/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 800 + Ethernet8/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 801 + Ethernet8/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 802 + Ethernet8/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 803 + Ethernet8/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 804 + Ethernet8/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 805 + Ethernet8/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 806 + Ethernet8/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 807 + Ethernet8/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 808 + Ethernet8/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 809 + Ethernet8/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 810 + Ethernet8/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 811 + Ethernet8/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 812 + Ethernet8/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 813 + Ethernet8/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 814 + Ethernet8/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 815 + Ethernet8/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 816 + Ethernet8/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 817 + Ethernet8/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 818 + Ethernet8/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 819 + Ethernet8/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 820 + Ethernet8/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 821 + Ethernet8/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 822 + Ethernet8/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 823 + Ethernet8/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 824 + Ethernet8/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 825 + Ethernet8/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 826 + Ethernet8/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 827 + Ethernet8/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 828 + Ethernet8/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 829 + Ethernet9/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 830 + Ethernet9/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 831 + Ethernet9/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 832 + Ethernet9/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 833 + Ethernet9/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 834 + Ethernet9/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 835 + Ethernet9/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 836 + Ethernet9/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 837 + Ethernet9/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 838 + Ethernet9/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 839 + Ethernet9/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 840 + Ethernet9/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 841 + Ethernet9/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 842 + Ethernet9/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 843 + Ethernet9/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 844 + Ethernet9/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 845 + Ethernet9/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 846 + Ethernet9/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 847 + Ethernet9/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 848 + Ethernet9/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 849 + Ethernet9/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 850 + Ethernet9/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 851 + Ethernet9/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 852 + Ethernet9/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 853 + Ethernet9/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 854 + Ethernet9/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 855 + Ethernet9/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 856 + Ethernet9/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 857 + Ethernet9/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 858 + Ethernet9/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 859 + Ethernet9/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 860 + Ethernet9/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 861 + Ethernet9/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 862 + Ethernet9/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 863 + Ethernet9/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 864 + Ethernet9/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 865 + Ethernet9/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 866 + Ethernet9/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 867 + Ethernet9/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 868 + Ethernet9/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 869 + Ethernet9/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 870 + Ethernet9/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 871 + Ethernet9/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 872 + Ethernet9/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 873 + Ethernet9/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 874 + Ethernet9/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 875 + Ethernet9/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 876 + Ethernet9/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 877 + Ethernet9/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 878 + Ethernet9/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 879 + Ethernet9/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 880 + Ethernet9/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 881 + Ethernet9/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 882 + Ethernet9/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 883 + Ethernet9/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 884 + Ethernet9/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 885 + Ethernet9/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 886 + Ethernet9/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 887 + Ethernet9/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 888 + Ethernet9/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 889 + Ethernet9/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 890 + Ethernet9/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 891 + Ethernet9/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 892 + Ethernet9/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 893 + Ethernet9/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 894 + Ethernet9/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 895 + Ethernet9/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 896 + Ethernet9/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 897 + Ethernet9/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 898 + Ethernet9/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 899 + Ethernet9/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 900 + Ethernet9/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 901 + Ethernet9/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 902 + Ethernet9/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 903 + Ethernet9/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 904 + Ethernet9/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 905 + Ethernet9/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 906 + Ethernet9/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 907 + Ethernet9/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 908 + Ethernet9/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 909 + Ethernet9/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 910 + Ethernet9/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 911 + Ethernet9/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 912 + Ethernet9/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 913 + Ethernet9/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 914 + Ethernet9/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 915 + Ethernet9/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 916 + Ethernet9/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 917 + Ethernet9/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 918 + Ethernet9/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 919 + Ethernet9/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 920 + Ethernet9/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 921 + Ethernet9/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 922 + Ethernet9/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 923 + Ethernet9/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 924 + Ethernet9/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 925 + Ethernet9/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 926 + Ethernet9/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 927 + Ethernet9/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 928 + Ethernet9/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 929 + Ethernet9/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 930 + Ethernet9/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 931 + Ethernet9/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 932 + Ethernet9/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 933 + Ethernet9/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 934 + Ethernet9/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 935 + Ethernet9/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 936 + Ethernet9/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 937 + Ethernet9/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 938 + Ethernet9/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 939 + Ethernet9/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 940 + Ethernet9/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 941 + Ethernet9/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 942 + Ethernet9/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 943 + Ethernet9/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 944 + Ethernet9/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 945 + Ethernet9/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 946 + Ethernet9/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 947 + Ethernet9/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 948 + Ethernet9/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 949 + Ethernet9/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 950 + Ethernet9/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 951 + Ethernet9/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 952 + Ethernet9/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 953 + Ethernet9/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 954 + Ethernet9/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 955 + Ethernet9/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 956 + Ethernet9/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 957 + Ethernet9/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 958 + Ethernet9/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 959 + Ethernet9/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 960 + Ethernet9/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 961 + Ethernet9/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 962 + Ethernet9/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 963 + Ethernet9/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 964 + Ethernet9/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 965 + Ethernet9/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 966 + Ethernet9/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 967 + Ethernet9/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 968 + Ethernet9/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 969 + Ethernet9/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 970 + Ethernet9/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 971 + Ethernet9/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 972 + Ethernet9/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 973 + Ethernet10/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 974 + Ethernet10/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 975 + Ethernet10/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 976 + Ethernet10/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 977 + Ethernet10/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 978 + Ethernet10/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 979 + Ethernet10/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 980 + Ethernet10/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 981 + Ethernet10/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 982 + Ethernet10/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 983 + Ethernet10/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 984 + Ethernet10/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 985 + Ethernet10/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 986 + Ethernet10/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 987 + Ethernet10/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 988 + Ethernet10/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 989 + Ethernet10/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 990 + Ethernet10/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 991 + Ethernet10/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 992 + Ethernet10/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 993 + Ethernet10/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 994 + Ethernet10/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 995 + Ethernet10/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 996 + Ethernet10/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 997 + Ethernet10/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 998 + Ethernet10/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 999 + Ethernet10/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1000 + Ethernet10/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1001 + Ethernet10/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1002 + Ethernet10/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1003 + Ethernet10/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1004 + Ethernet10/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1005 + Ethernet10/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1006 + Ethernet10/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1007 + Ethernet10/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1008 + Ethernet10/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1009 + Ethernet10/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1010 + Ethernet10/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1011 + Ethernet10/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1012 + Ethernet10/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1013 + Ethernet10/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1014 + Ethernet10/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1015 + Ethernet10/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1016 + Ethernet10/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1017 + Ethernet10/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1018 + Ethernet10/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1019 + Ethernet10/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1020 + Ethernet10/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1021 + Ethernet10/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1022 + Ethernet10/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1023 + Ethernet10/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1024 + Ethernet10/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1025 + Ethernet10/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1026 + Ethernet10/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1027 + Ethernet10/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1028 + Ethernet10/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1029 + Ethernet10/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1030 + Ethernet10/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1031 + Ethernet10/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1032 + Ethernet10/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1033 + Ethernet10/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1034 + Ethernet10/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1035 + Ethernet10/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1036 + Ethernet10/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1037 + Ethernet10/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1038 + Ethernet10/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1039 + Ethernet10/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1040 + Ethernet10/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1041 + Ethernet10/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1042 + Ethernet10/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1043 + Ethernet10/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1044 + Ethernet10/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1045 + Ethernet10/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1046 + Ethernet10/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1047 + Ethernet10/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1048 + Ethernet10/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1049 + Ethernet10/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1050 + Ethernet10/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1051 + Ethernet10/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1052 + Ethernet10/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1053 + Ethernet10/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1054 + Ethernet10/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1055 + Ethernet10/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1056 + Ethernet10/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1057 + Ethernet10/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1058 + Ethernet10/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1059 + Ethernet10/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1060 + Ethernet10/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1061 + Ethernet10/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1062 + Ethernet10/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1063 + Ethernet10/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1064 + Ethernet10/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1065 + Ethernet10/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1066 + Ethernet10/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1067 + Ethernet10/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1068 + Ethernet10/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1069 + Ethernet10/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1070 + Ethernet10/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1071 + Ethernet10/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1072 + Ethernet10/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1073 + Ethernet10/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1074 + Ethernet10/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1075 + Ethernet10/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1076 + Ethernet10/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1077 + Ethernet10/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1078 + Ethernet10/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1079 + Ethernet10/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1080 + Ethernet10/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1081 + Ethernet10/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1082 + Ethernet10/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1083 + Ethernet10/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1084 + Ethernet10/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1085 + Ethernet10/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1086 + Ethernet10/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1087 + Ethernet10/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1088 + Ethernet10/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1089 + Ethernet10/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1090 + Ethernet10/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1091 + Ethernet10/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1092 + Ethernet10/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1093 + Ethernet10/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1094 + Ethernet10/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1095 + Ethernet10/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1096 + Ethernet10/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1097 + Ethernet10/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1098 + Ethernet10/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1099 + Ethernet10/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1100 + Ethernet10/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1101 + Ethernet10/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1102 + Ethernet10/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1103 + Ethernet10/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1104 + Ethernet10/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1105 + Ethernet10/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1106 + Ethernet10/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1107 + Ethernet10/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1108 + Ethernet10/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1109 + Ethernet10/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1110 + Ethernet10/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1111 + Ethernet10/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1112 + Ethernet10/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1113 + Ethernet10/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1114 + Ethernet10/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1115 + Ethernet10/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1116 + Ethernet10/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + + + DeviceInterface + + true + 1 + power1/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 2 + power1/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 3 + power2/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 4 + power2/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 5 + power3/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 6 + power3/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 7 + power4/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 8 + power4/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 9 + power7/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 10 + power7/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 11 + power8/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 12 + power8/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 13 + power9/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 14 + power9/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 15 + power10/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 16 + power10/1 + false + + + 0 + + C19 + C19 + true + + + + + + DeviceInterface + + true + 1 + console + false + console + + 9600 + false + + + + DeviceInterface + + false + 2 + logical1 + false + logical1 + + 9600 + true + 1 + + + DeviceInterface + + false + 3 + logical2 + false + logical2 + + 9600 + true + 2 + + + DeviceInterface + + false + 4 + logical3 + false + logical3 + + 9600 + true + 3 + + + DeviceInterface + + false + 5 + logical4 + false + logical4 + + 9600 + true + 4 + + + DeviceInterface + + false + 6 + logical5 + false + logical5 + + 9600 + true + 5 + + + DeviceInterface + + false + 7 + logical6 + false + logical6 + + 9600 + true + 6 + + + DeviceInterface + + false + 8 + logical7 + false + logical7 + + 9600 + true + 7 + + + DeviceInterface + + false + 9 + logical8 + false + logical8 + + 9600 + true + 8 + + + DeviceInterface + + false + 10 + logical9 + false + logical9 + + 9600 + true + 9 + + + DeviceInterface + + false + 11 + logical10 + false + logical10 + + 9600 + true + 10 + + + DeviceInterface + + false + 12 + logical11 + false + logical11 + + 9600 + true + 11 + + + DeviceInterface + + false + 13 + logical12 + false + logical12 + + 9600 + true + 12 + + + + Arista + + + + + + + + LoopbackInterface + HostIP + Loopback0 + + 10.2.0.1/32 + + 10.2.0.1/32 + + + LoopbackInterface + HostIP1 + Loopback0 + + fc00:20::1/128 + + fc00:20::1/128 + + + LoopbackInterface + Loopback4096 + Loopback4096 + + 192.0.0.1/32 + + 192.0.0.1/32 + + + LoopbackInterface + v6Loopback4096 + Loopback4096 + + 2603:10e2:400::1/128 + + 2603:10e2:400::1/128 + + + + + + + + str-sonic-lc03-ASIC00 + + + PortChannelInterface + PortChannel102 + Eth0;Eth8 + + + + PortChannelInterface + PortChannel104 + Eth16;Eth24 + + + + PortChannelInterface + PortChannel106 + Eth32;Eth40 + + + + PortChannelInterface + PortChannel108 + Eth48;Eth56 + + + + PortChannelInterface + PortChannel1010 + Eth72;Eth64 + + + + PortChannelInterface + PortChannel1012 + Eth80;Eth88 + + + + PortChannelInterface + PortChannel1016 + Eth104;Eth112 + + + + PortChannelInterface + PortChannel1020 + Eth128;Eth136 + + + + + + + + IPInterface + VoqInband + Ethernet-IB0 + 10.241.88.0/32 + + + IPInterface + v6VoqInband + Ethernet-IB0 + 2a01:111:e210:5e:0:a:f158:0/128 + + + IPInterface + + PortChannel102 + 10.0.0.0/31 + + + IPInterface + + PortChannel102 + fc00::1/126 + + + IPInterface + + PortChannel104 + 10.0.0.4/31 + + + IPInterface + + PortChannel104 + fc00::9/126 + + + IPInterface + + PortChannel106 + 10.0.0.8/31 + + + IPInterface + + PortChannel106 + fc00::11/126 + + + IPInterface + + PortChannel108 + 10.0.0.12/31 + + + IPInterface + + PortChannel108 + fc00::19/126 + + + IPInterface + + PortChannel1010 + 10.0.0.16/31 + + + IPInterface + + PortChannel1010 + fc00::21/126 + + + IPInterface + + PortChannel1012 + 10.0.0.20/31 + + + IPInterface + + PortChannel1012 + fc00::29/126 + + + IPInterface + + PortChannel1016 + 10.0.0.28/31 + + + IPInterface + + PortChannel1016 + fc00::39/126 + + + IPInterface + + PortChannel1020 + 10.0.0.24/31 + + + IPInterface + + PortChannel1020 + fc00::31/126 + + + + + + + + + + + + + LoopbackInterface + HostIP + Loopback0 + + 10.2.0.1/32 + + 10.2.0.1/32 + + + LoopbackInterface + HostIP1 + Loopback0 + + fc00:20::1/128 + + fc00:20::1/128 + + + LoopbackInterface + Loopback4096 + Loopback4096 + + 192.0.0.2/32 + + 192.0.0.2/32 + + + LoopbackInterface + v6Loopback4096 + Loopback4096 + + 2603:10e2:400::2/128 + + 2603:10e2:400::2/128 + + + + + + + + str-sonic-lc03-ASIC01 + + + + + + IPInterface + VoqInband + Ethernet-IB1 + 10.241.88.1/32 + + + IPInterface + v6VoqInband + Ethernet-IB1 + 2a01:111:e210:5e:0:a:f158:100/128 + + + + + + + + + + + + + LoopbackInterface + HostIP + Loopback0 + + 10.2.0.1/32 + + 10.2.0.1/32 + + + LoopbackInterface + HostIP1 + Loopback0 + + fc00:20::1/128 + + fc00:20::1/128 + + + + + ManagementInterface + ManagementIP + Management1/1 + + 10.3.146.58/24 + + 10.3.146.58/24 + + + + ManagementInterface + v6ManagementIP + Management1/1 + + 2a01:111:e210:3000::a03:923a/64 + + 2a01:111:e210:3000::a03:923a/64 + + + + + + + + str-sonic-lc03 + + + + + + + + + + + + + + + str-sonic-lc03-ASIC00:Eth0;ARISTA91T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/1/1#0:3:0:1#1 + + + str-sonic:Ethernet3/1/1;ARISTA91T3:Ethernet1 + + + str-sonic-lc03-ASIC00:Eth8;ARISTA91T3:Ethernet2 + + + EndItfKey + + Ethernet2#0:1:0:2#1 + + + StartItfKey + + Ethernet3/2/1#0:3:0:2#1 + + + EndOpticalTerminalDevice + + Sonic-OMT + + + FiberDistance + + 20.3 + + + Frequency + + 196.025 + + + MacSecEnabled + + True + + + Modulation + + 16QAM + + + OpticSkuA + + optic-sku-01 + + + OpticSkuZ + + optic-sku-02 + + + OpticalCircuitID + + optical-circuit-01 + + + RxPower + + -6 + + + SolutionId + + span01 + + + Speed + + 400000 + + + StartOpticalTerminalDevice + + optical-sku-01 + + + TxPower + + -10 + + + str-sonic:Ethernet3/2/1;ARISTA91T3:Ethernet2 + + + str-sonic-lc03-ASIC00:Eth16;ARISTA93T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/3/1#0:3:0:3#1 + + + str-sonic:Ethernet3/3/1;ARISTA93T3:Ethernet1 + + + str-sonic-lc03-ASIC00:Eth24;ARISTA93T3:Ethernet2 + + + EndItfKey + + Ethernet2#0:1:0:2#1 + + + StartItfKey + + Ethernet3/4/1#0:3:0:4#1 + + + str-sonic:Ethernet3/4/1;ARISTA93T3:Ethernet2 + + + str-sonic-lc03-ASIC00:Eth32;ARISTA05T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/5/1#0:3:0:5#1 + + + str-sonic:Ethernet3/5/1;ARISTA05T3:Ethernet1 + + + str-sonic-lc03-ASIC00:Eth40;ARISTA05T3:Ethernet2 + + + EndItfKey + + Ethernet2#0:1:0:2#1 + + + StartItfKey + + Ethernet3/6/1#0:3:0:6#1 + + + str-sonic:Ethernet3/6/1;ARISTA05T3:Ethernet2 + + + str-sonic-lc03-ASIC00:Eth48;ARISTA07T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/7/1#0:3:0:7#1 + + + str-sonic:Ethernet3/7/1;ARISTA07T3:Ethernet1 + + + str-sonic-lc03-ASIC00:Eth56;ARISTA07T3:Ethernet2 + + + EndItfKey + + Ethernet2#0:1:0:2#1 + + + StartItfKey + + Ethernet3/8/1#0:3:0:8#1 + + + str-sonic:Ethernet3/8/1;ARISTA07T3:Ethernet2 + + + str-sonic-lc03-ASIC00:Eth64;ARISTA09T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/9/1#0:3:0:9#1 + + + str-sonic:Ethernet3/9/1;ARISTA09T3:Ethernet1 + + + str-sonic-lc03-ASIC00:Eth72;ARISTA09T3:Ethernet2 + + + EndItfKey + + Ethernet2#0:1:0:2#1 + + + StartItfKey + + Ethernet3/10/1#0:3:0:10#1 + + + str-sonic:Ethernet3/10/1;ARISTA09T3:Ethernet2 + + + str-sonic-lc03-ASIC00:Eth80;ARISTA11T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/11/1#0:3:0:11#1 + + + str-sonic:Ethernet3/11/1;ARISTA11T3:Ethernet1 + + + str-sonic-lc03-ASIC00:Eth88;ARISTA11T3:Ethernet2 + + + EndItfKey + + Ethernet2#0:1:0:2#1 + + + StartItfKey + + Ethernet3/12/1#0:3:0:12#1 + + + str-sonic:Ethernet3/12/1;ARISTA11T3:Ethernet2 + + + str-sonic-lc03-ASIC00:Eth96;ARISTA13T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/13/1#0:3:0:13#1 + + + str-sonic:Ethernet3/13/1;ARISTA13T3:Ethernet1 + + + str-sonic-lc03-ASIC00:Eth104;ARISTA15T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/14/1#0:3:0:14#1 + + + str-sonic:Ethernet3/14/1;ARISTA15T3:Ethernet1 + + + str-sonic-lc03-ASIC00:Eth112;ARISTA15T3:Ethernet2 + + + EndItfKey + + Ethernet2#0:1:0:2#1 + + + StartItfKey + + Ethernet3/15/1#0:3:0:15#1 + + + str-sonic:Ethernet3/15/1;ARISTA15T3:Ethernet2 + + + str-sonic-lc03-ASIC00:Eth120;ARISTA17T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/16/1#0:3:0:16#1 + + + str-sonic:Ethernet3/16/1;ARISTA17T3:Ethernet1 + + + str-sonic-lc03-ASIC00:Eth128;ARISTA18T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/17/1#0:3:0:17#1 + + + str-sonic:Ethernet3/17/1;ARISTA18T3:Ethernet1 + + + str-sonic-lc03-ASIC00:Eth136;ARISTA18T3:Ethernet2 + + + EndItfKey + + Ethernet2#0:1:0:2#1 + + + StartItfKey + + Ethernet3/18/1#0:3:0:18#1 + + + str-sonic:Ethernet3/18/1;ARISTA18T3:Ethernet2 + + + str-sonic-lc03-ASIC01:Eth0;ARISTA19T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/19/1#0:3:0:19#1 + + + str-sonic:Ethernet3/19/1;ARISTA19T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth8;ARISTA20T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/20/1#0:3:0:20#1 + + + str-sonic:Ethernet3/20/1;ARISTA20T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth16;ARISTA21T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/21/1#0:3:0:21#1 + + + str-sonic:Ethernet3/21/1;ARISTA21T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth24;ARISTA22T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/22/1#0:3:0:22#1 + + + str-sonic:Ethernet3/22/1;ARISTA22T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth32;ARISTA23T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/23/1#0:3:0:23#1 + + + str-sonic:Ethernet3/23/1;ARISTA23T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth40;ARISTA24T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/24/1#0:3:0:24#1 + + + str-sonic:Ethernet3/24/1;ARISTA24T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth48;ARISTA25T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/25/1#0:3:0:25#1 + + + str-sonic:Ethernet3/25/1;ARISTA25T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth56;ARISTA26T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/26/1#0:3:0:26#1 + + + str-sonic:Ethernet3/26/1;ARISTA26T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth64;ARISTA27T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/27/1#0:3:0:27#1 + + + str-sonic:Ethernet3/27/1;ARISTA27T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth72;ARISTA28T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/28/1#0:3:0:28#1 + + + str-sonic:Ethernet3/28/1;ARISTA28T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth80;ARISTA29T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/29/1#0:3:0:29#1 + + + str-sonic:Ethernet3/29/1;ARISTA29T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth88;ARISTA30T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/30/1#0:3:0:30#1 + + + str-sonic:Ethernet3/30/1;ARISTA30T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth96;ARISTA31T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/31/1#0:3:0:31#1 + + + str-sonic:Ethernet3/31/1;ARISTA31T3:Ethernet1 + + + str-sonic-lc03-ASIC01:Eth104;ARISTA32T3:Ethernet1 + + + EndItfKey + + Ethernet1#0:1:0:1#1 + + + StartItfKey + + Ethernet3/32/1#0:3:0:32#1 + + + str-sonic:Ethernet3/32/1;ARISTA32T3:Ethernet1 + + + + + + + + str-sonic-lc04 + + + FirmwareProfile + + Sonic-lc-100g-sku + + + ForwardingMethod + + VoQ + + + SlotIndex + + 4 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc04-ASIC00 + + + SiblingLineCards + + + str-sonic-lc03;str-sonic-lc05;str-sonic-lc06;str-sonic-lc07;str-sonic-lc08;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc05 + + + FirmwareProfile + + Sonic-lc-100g-sku + + + ForwardingMethod + + VoQ + + + SlotIndex + + 5 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc05-ASIC00 + + + SiblingLineCards + + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc06;str-sonic-lc07;str-sonic-lc08;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc06 + + + FirmwareProfile + + Sonic-lc-100g-sku + + + ForwardingMethod + + VoQ + + + SlotIndex + + 6 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc06-ASIC00 + + + SiblingLineCards + + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc05;str-sonic-lc07;str-sonic-lc08;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc07 + + + FirmwareProfile + + Sonic-lc-100g-sku + + + ForwardingMethod + + VoQ + + + SlotIndex + + 7 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc07-ASIC00 + + + SiblingLineCards + + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc05;str-sonic-lc06;str-sonic-lc08;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc08 + + + FirmwareProfile + + Sonic-lc-100g-sku + + + ForwardingMethod + + VoQ + + + SlotIndex + + 8 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc08-ASIC00 + + + SiblingLineCards + + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc05;str-sonic-lc06;str-sonic-lc07;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc09 + + + FirmwareProfile + + Sonic-lc-400g-sku + + + ForwardingMethod + + VoQ + + + SlotIndex + + 9 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc09-ASIC00 + + + SiblingLineCards + + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc05;str-sonic-lc06;str-sonic-lc07;str-sonic-lc08;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc10 + + + FirmwareProfile + + Sonic-lc-100g-sku + + + ForwardingMethod + + VoQ + + + SlotIndex + + 10 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc10-ASIC00 + + + SiblingLineCards + + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc05;str-sonic-lc06;str-sonic-lc07;str-sonic-lc08;str-sonic-lc09 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc03-ASIC00 + + + ForwardingMethod + + VoQ + + + SubRole + + FrontEnd + + + AsicSwitchId + + 8 + + + ProviderLineCard + + str-sonic-lc03 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc03-ASIC01 + + + ForwardingMethod + + VoQ + + + SubRole + + FrontEnd + + + AsicSwitchId + + 9 + + + ProviderLineCard + + str-sonic-lc03 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc03 + + + FirmwareProfile + + SONiC-Sonic-400g-lc-sku-lc + + + ForwardingMethod + + VoQ + + + SlotIndex + + 3 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + True + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc03-ASIC00;str-sonic-lc03-ASIC01 + + + SiblingLineCards + + + str-sonic-lc04;str-sonic-lc05;str-sonic-lc06;str-sonic-lc07;str-sonic-lc08;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic + + + CloudType + + Public + + + ConfigDbAclFile + + SonicNativeAcl.liquid + + + ConfigTemplateFile + + Sonic.xml + + + DNSServers + + 10.64.5.5;10.64.6.6;10.64.6.7 + + + DcCode + + STR + + + DeploymentId + + 3 + + + EnableStreamingTelemetry + + true + + + ErspanDestinationIpv4 + + 10.20.6.4 + + + FirmwareProfile + + Sonic-sup-sku + + + Function + + LabTest + + + Group + + str:542907040 + + + InitConfigTemplateFile + + Sonic.init.xml + + + Location + + TBD + + + Loopback0Ipv4 + + 10.2.0.1/32;10.2.0.2/32;10.2.0.3/32;10.2.0.4/32 + + + Loopback0Ipv6 + + fc00:20::1/128;fc00:21::1/128;fc00:22::1/128;fc00:23::1/128 + + + Loopback4096Ipv4 + + 192.0.0.1/32;192.0.0.2/32;192.0.0.8/32;192.0.0.9/32 + + + Loopback4096Ipv6 + + + 2603:10e2:400::1/128;2603:10e2:400::2/128;2603:10e2:400::8/128;2603:10e2:400::9/128 + + + MacSecEnabled + + True + + + MacSecProfile + usstagee.Sonic.MacSec + PrimaryKey="macsec-profile-two" FallbackKey="macsec-profile" + MacsecPolicy="" + + + ManagementIpv4 + + + 10.3.146.58/24;10.3.146.71/24;10.3.146.72/24;10.3.146.74/24;10.3.146.75/24;10.3.146.80/24;10.3.146.81/24;10.3.146.83/24 + + + ManagementIpv6 + + + 2a01:111:e210:3000::a03:923a/64;2a01:111:e210:3000::a03:9247/64;2a01:111:e210:3000::a03:9248/64;2a01:111:e210:3000::a03:924a/64;2a01:111:e210:3000::a03:924b/64;2a01:111:e210:3000::a03:9250/64;2a01:111:e210:3000::a03:9251/64;2a01:111:e210:3000::a03:9253/64 + + + MaxCountOfCores + + 64 + + + NtpResources + Public.Ntp + 17.39.1.129;17.39.1.130 + + + QosProfile + + VerlaineLongHaul + + + RemoteAuthenticationProtocol + + Tacacs + + + SnmpResources + + 10.52.180.161;10.3.157.12 + + + SonicConfigTemplateFile + + Sonic.xml + + + SonicEnabled + + True + + + SyslogResources + + 10.52.180.161;10.3.157.12 + + + SyslogServer + + 10.20.4.167;10.20.7.33;10.20.6.16;10.20.6.84 + + + TacacsKey + + $Secrets.TacacsKey + + + TacacsSecurityLevel + + 7 + + + TacacsServer + + 123.46.98.21 + + + TotalCountOfVoQ + + 8 + + + Region + + test + + + ChassisEnabled + + true + + + + + + + + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth81 + true + str-sonic-lc03-ASIC00 + Eth384 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth45 + true + str-sonic-lc03-ASIC00 + Eth385 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth42 + true + str-sonic-lc03-ASIC00 + Eth386 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth88 + true + str-sonic-lc03-ASIC00 + Eth387 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth33 + true + str-sonic-lc03-ASIC00 + Eth388 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth45 + true + str-sonic-lc03-ASIC00 + Eth389 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth39 + true + str-sonic-lc03-ASIC00 + Eth390 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth33 + true + str-sonic-lc03-ASIC00 + Eth391 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth27 + true + str-sonic-lc03-ASIC00 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth31 + true + str-sonic-lc03-ASIC00 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth24 + true + str-sonic-lc03-ASIC00 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth27 + true + str-sonic-lc03-ASIC00 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth34 + true + str-sonic-lc03-ASIC00 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth28 + true + str-sonic-lc03-ASIC00 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth36 + true + str-sonic-lc03-ASIC00 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth36 + true + str-sonic-lc03-ASIC00 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth44 + true + str-sonic-lc03-ASIC00 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth82 + true + str-sonic-lc03-ASIC00 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth25 + true + str-sonic-lc03-ASIC00 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth46 + true + str-sonic-lc03-ASIC00 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth89 + true + str-sonic-lc03-ASIC00 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth46 + true + str-sonic-lc03-ASIC00 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth44 + true + str-sonic-lc03-ASIC00 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth42 + true + str-sonic-lc03-ASIC00 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth40 + true + str-sonic-lc03-ASIC00 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth21 + true + str-sonic-lc03-ASIC00 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth88 + true + str-sonic-lc03-ASIC00 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth22 + true + str-sonic-lc03-ASIC00 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth20 + true + str-sonic-lc03-ASIC00 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth82 + true + str-sonic-lc03-ASIC00 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth94 + true + str-sonic-lc03-ASIC00 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth81 + true + str-sonic-lc03-ASIC00 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth28 + true + str-sonic-lc03-ASIC00 + Eth424 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth39 + true + str-sonic-lc03-ASIC00 + Eth425 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth31 + true + str-sonic-lc03-ASIC00 + Eth426 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth24 + true + str-sonic-lc03-ASIC00 + Eth427 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth94 + true + str-sonic-lc03-ASIC00 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth43 + true + str-sonic-lc03-ASIC00 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth41 + true + str-sonic-lc03-ASIC00 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth89 + true + str-sonic-lc03-ASIC00 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth20 + true + str-sonic-lc03-ASIC00 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth21 + true + str-sonic-lc03-ASIC00 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth33 + true + str-sonic-lc03-ASIC00 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth36 + true + str-sonic-lc03-ASIC00 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth43 + true + str-sonic-lc03-ASIC00 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth45 + true + str-sonic-lc03-ASIC00 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth34 + true + str-sonic-lc03-ASIC00 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth81 + true + str-sonic-lc03-ASIC00 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth40 + true + str-sonic-lc03-ASIC00 + Eth440 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth42 + true + str-sonic-lc03-ASIC00 + Eth441 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth24 + true + str-sonic-lc03-ASIC00 + Eth442 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth46 + true + str-sonic-lc03-ASIC00 + Eth443 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth88 + true + str-sonic-lc03-ASIC00 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth27 + true + str-sonic-lc03-ASIC00 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth44 + true + str-sonic-lc03-ASIC00 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth82 + true + str-sonic-lc03-ASIC00 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth89 + true + str-sonic-lc03-ASIC00 + Eth456 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth36 + true + str-sonic-lc03-ASIC00 + Eth457 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth25 + true + str-sonic-lc03-ASIC00 + Eth458 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth94 + true + str-sonic-lc03-ASIC00 + Eth459 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth33 + true + str-sonic-lc03-ASIC00 + Eth460 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth27 + true + str-sonic-lc03-ASIC00 + Eth461 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth20 + true + str-sonic-lc03-ASIC00 + Eth462 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth45 + true + str-sonic-lc03-ASIC00 + Eth463 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth22 + true + str-sonic-lc03-ASIC00 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth21 + true + str-sonic-lc03-ASIC00 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth42 + true + str-sonic-lc03-ASIC00 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth40 + true + str-sonic-lc03-ASIC00 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth41 + true + str-sonic-lc03-ASIC00 + Eth468 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth46 + true + str-sonic-lc03-ASIC00 + Eth469 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth43 + true + str-sonic-lc03-ASIC00 + Eth470 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth40 + true + str-sonic-lc03-ASIC00 + Eth471 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth44 + true + str-sonic-lc03-ASIC00 + Eth472 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth24 + true + str-sonic-lc03-ASIC00 + Eth473 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth41 + true + str-sonic-lc03-ASIC00 + Eth474 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth28 + true + str-sonic-lc03-ASIC00 + Eth475 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth81 + true + str-sonic-lc03-ASIC00 + Eth476 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth36 + true + str-sonic-lc03-ASIC00 + Eth477 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth27 + true + str-sonic-lc03-ASIC00 + Eth478 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth31 + true + str-sonic-lc03-ASIC00 + Eth479 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth25 + true + str-sonic-lc03-ASIC00 + Eth497 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth31 + true + str-sonic-lc03-ASIC00 + Eth512 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth28 + true + str-sonic-lc03-ASIC00 + Eth513 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth39 + true + str-sonic-lc03-ASIC00 + Eth515 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth34 + true + str-sonic-lc03-ASIC00 + Eth516 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth22 + true + str-sonic-lc03-ASIC00 + Eth518 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth22 + true + str-sonic-lc03-ASIC00 + Eth530 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth25 + true + str-sonic-lc03-ASIC00 + Eth531 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth41 + true + str-sonic-lc03-ASIC00 + Eth533 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth39 + true + str-sonic-lc03-ASIC00 + Eth534 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth28 + true + str-sonic-lc03-ASIC00 + Eth535 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth34 + true + str-sonic-lc03-ASIC00 + Eth537 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth31 + true + str-sonic-lc03-ASIC00 + Eth539 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth40 + true + str-sonic-lc03-ASIC00 + Eth540 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth43 + true + str-sonic-lc03-ASIC00 + Eth542 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth24 + true + str-sonic-lc03-ASIC00 + Eth543 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth82 + true + str-sonic-lc03-ASIC00 + Eth552 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth43 + true + str-sonic-lc03-ASIC00 + Eth553 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth94 + true + str-sonic-lc03-ASIC00 + Eth554 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth20 + true + str-sonic-lc03-ASIC00 + Eth555 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth41 + true + str-sonic-lc03-ASIC00 + Eth556 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth25 + true + str-sonic-lc03-ASIC00 + Eth557 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth21 + true + str-sonic-lc03-ASIC00 + Eth558 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth21 + true + str-sonic-lc03-ASIC00 + Eth559 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth89 + true + str-sonic-lc03-ASIC00 + Eth560 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth46 + true + str-sonic-lc03-ASIC00 + Eth561 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth20 + true + str-sonic-lc03-ASIC00 + Eth562 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth88 + true + str-sonic-lc03-ASIC00 + Eth563 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth42 + true + str-sonic-lc03-ASIC00 + Eth564 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth94 + true + str-sonic-lc03-ASIC00 + Eth565 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth81 + true + str-sonic-lc03-ASIC00 + Eth566 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth45 + true + str-sonic-lc03-ASIC00 + Eth567 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth89 + true + str-sonic-lc03-ASIC00 + Eth568 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth44 + true + str-sonic-lc03-ASIC00 + Eth569 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth33 + true + str-sonic-lc03-ASIC00 + Eth570 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth88 + true + str-sonic-lc03-ASIC00 + Eth571 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth82 + true + str-sonic-lc03-ASIC00 + Eth572 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth34 + true + str-sonic-lc03-ASIC00 + Eth573 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth39 + true + str-sonic-lc03-ASIC00 + Eth574 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth22 + true + str-sonic-lc03-ASIC00 + Eth575 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA91T3 + Ethernet1 + true + str-sonic-lc03-ASIC00 + Eth0 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA91T3 + Ethernet2 + true + str-sonic-lc03-ASIC00 + Eth8 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA93T3 + Ethernet1 + true + str-sonic-lc03-ASIC00 + Eth16 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA93T3 + Ethernet2 + true + str-sonic-lc03-ASIC00 + Eth24 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA05T3 + Ethernet1 + true + str-sonic-lc03-ASIC00 + Eth32 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA05T3 + Ethernet2 + true + str-sonic-lc03-ASIC00 + Eth40 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA07T3 + Ethernet1 + true + str-sonic-lc03-ASIC00 + Eth48 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA07T3 + Ethernet2 + true + str-sonic-lc03-ASIC00 + Eth56 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA09T3 + Ethernet1 + true + str-sonic-lc03-ASIC00 + Eth64 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA09T3 + Ethernet2 + true + str-sonic-lc03-ASIC00 + Eth72 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA11T3 + Ethernet1 + true + str-sonic-lc03-ASIC00 + Eth80 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA11T3 + Ethernet2 + true + str-sonic-lc03-ASIC00 + Eth88 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA13T3 + Ethernet1 + true + str-sonic-lc03-ASIC00 + Eth96 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA15T3 + Ethernet1 + true + str-sonic-lc03-ASIC00 + Eth104 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA15T3 + Ethernet2 + true + str-sonic-lc03-ASIC00 + Eth112 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA17T3 + Ethernet1 + true + str-sonic-lc03-ASIC00 + Eth120 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA18T3 + Ethernet1 + true + str-sonic-lc03-ASIC00 + Eth128 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA18T3 + Ethernet2 + true + str-sonic-lc03-ASIC00 + Eth136 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth32 + true + str-sonic-lc03-ASIC01 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth29 + true + str-sonic-lc03-ASIC01 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth25 + true + str-sonic-lc03-ASIC01 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth30 + true + str-sonic-lc03-ASIC01 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth38 + true + str-sonic-lc03-ASIC01 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth45 + true + str-sonic-lc03-ASIC01 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth37 + true + str-sonic-lc03-ASIC01 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth42 + true + str-sonic-lc03-ASIC01 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth29 + true + str-sonic-lc03-ASIC01 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth32 + true + str-sonic-lc03-ASIC01 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth45 + true + str-sonic-lc03-ASIC01 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth44 + true + str-sonic-lc03-ASIC01 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth26 + true + str-sonic-lc03-ASIC01 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth39 + true + str-sonic-lc03-ASIC01 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth25 + true + str-sonic-lc03-ASIC01 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth44 + true + str-sonic-lc03-ASIC01 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth39 + true + str-sonic-lc03-ASIC01 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth40 + true + str-sonic-lc03-ASIC01 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth42 + true + str-sonic-lc03-ASIC01 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth43 + true + str-sonic-lc03-ASIC01 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth90 + true + str-sonic-lc03-ASIC01 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth29 + true + str-sonic-lc03-ASIC01 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth32 + true + str-sonic-lc03-ASIC01 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth41 + true + str-sonic-lc03-ASIC01 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth91 + true + str-sonic-lc03-ASIC01 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth83 + true + str-sonic-lc03-ASIC01 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth44 + true + str-sonic-lc03-ASIC01 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth42 + true + str-sonic-lc03-ASIC01 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth95 + true + str-sonic-lc03-ASIC01 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth45 + true + str-sonic-lc03-ASIC01 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth25 + true + str-sonic-lc03-ASIC01 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth39 + true + str-sonic-lc03-ASIC01 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth24 + true + str-sonic-lc03-ASIC01 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth38 + true + str-sonic-lc03-ASIC01 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth29 + true + str-sonic-lc03-ASIC01 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth448 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth32 + true + str-sonic-lc03-ASIC01 + Eth449 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth46 + true + str-sonic-lc03-ASIC01 + Eth450 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth46 + true + str-sonic-lc03-ASIC01 + Eth451 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth452 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth26 + true + str-sonic-lc03-ASIC01 + Eth453 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth40 + true + str-sonic-lc03-ASIC01 + Eth454 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth37 + true + str-sonic-lc03-ASIC01 + Eth455 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth456 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth30 + true + str-sonic-lc03-ASIC01 + Eth457 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth458 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth90 + true + str-sonic-lc03-ASIC01 + Eth459 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth38 + true + str-sonic-lc03-ASIC01 + Eth460 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth43 + true + str-sonic-lc03-ASIC01 + Eth461 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth95 + true + str-sonic-lc03-ASIC01 + Eth462 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth37 + true + str-sonic-lc03-ASIC01 + Eth463 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth41 + true + str-sonic-lc03-ASIC01 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth24 + true + str-sonic-lc03-ASIC01 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth26 + true + str-sonic-lc03-ASIC01 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth91 + true + str-sonic-lc03-ASIC01 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth45 + true + str-sonic-lc03-ASIC01 + Eth468 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth469 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth83 + true + str-sonic-lc03-ASIC01 + Eth470 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth44 + true + str-sonic-lc03-ASIC01 + Eth471 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth24 + true + str-sonic-lc03-ASIC01 + Eth482 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth485 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth46 + true + str-sonic-lc03-ASIC01 + Eth487 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth91 + true + str-sonic-lc03-ASIC01 + Eth496 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth95 + true + str-sonic-lc03-ASIC01 + Eth501 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth83 + true + str-sonic-lc03-ASIC01 + Eth502 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth90 + true + str-sonic-lc03-ASIC01 + Eth507 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth41 + true + str-sonic-lc03-ASIC01 + Eth508 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth43 + true + str-sonic-lc03-ASIC01 + Eth514 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth40 + true + str-sonic-lc03-ASIC01 + Eth517 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth519 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth39 + true + str-sonic-lc03-ASIC01 + Eth520 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth42 + true + str-sonic-lc03-ASIC01 + Eth521 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth523 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth26 + true + str-sonic-lc03-ASIC01 + Eth524 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth527 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth37 + true + str-sonic-lc03-ASIC01 + Eth528 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth38 + true + str-sonic-lc03-ASIC01 + Eth529 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth530 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth46 + true + str-sonic-lc03-ASIC01 + Eth531 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth30 + true + str-sonic-lc03-ASIC01 + Eth532 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth83 + true + str-sonic-lc03-ASIC01 + Eth533 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth44 + true + str-sonic-lc03-ASIC01 + Eth534 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth45 + true + str-sonic-lc03-ASIC01 + Eth535 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth46 + true + str-sonic-lc03-ASIC01 + Eth536 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth91 + true + str-sonic-lc03-ASIC01 + Eth537 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth538 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth539 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth24 + true + str-sonic-lc03-ASIC01 + Eth540 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth24 + true + str-sonic-lc03-ASIC01 + Eth541 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth40 + true + str-sonic-lc03-ASIC01 + Eth542 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth95 + true + str-sonic-lc03-ASIC01 + Eth543 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth32 + true + str-sonic-lc03-ASIC01 + Eth552 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth95 + true + str-sonic-lc03-ASIC01 + Eth553 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth90 + true + str-sonic-lc03-ASIC01 + Eth554 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth26 + true + str-sonic-lc03-ASIC01 + Eth555 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth83 + true + str-sonic-lc03-ASIC01 + Eth556 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth41 + true + str-sonic-lc03-ASIC01 + Eth557 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth38 + true + str-sonic-lc03-ASIC01 + Eth558 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth91 + true + str-sonic-lc03-ASIC01 + Eth559 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth43 + true + str-sonic-lc03-ASIC01 + Eth560 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth29 + true + str-sonic-lc03-ASIC01 + Eth561 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth90 + true + str-sonic-lc03-ASIC01 + Eth562 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth563 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth25 + true + str-sonic-lc03-ASIC01 + Eth564 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth41 + true + str-sonic-lc03-ASIC01 + Eth565 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth37 + true + str-sonic-lc03-ASIC01 + Eth566 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth567 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth568 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth30 + true + str-sonic-lc03-ASIC01 + Eth569 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth40 + true + str-sonic-lc03-ASIC01 + Eth570 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth39 + true + str-sonic-lc03-ASIC01 + Eth571 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth42 + true + str-sonic-lc03-ASIC01 + Eth572 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth30 + true + str-sonic-lc03-ASIC01 + Eth573 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth43 + true + str-sonic-lc03-ASIC01 + Eth574 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth25 + true + str-sonic-lc03-ASIC01 + Eth575 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA19T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth0 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA20T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth8 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA21T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth16 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA22T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth24 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA23T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth32 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA24T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth40 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA25T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth48 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA26T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth56 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA27T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth64 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA28T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth72 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA29T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth80 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA30T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth88 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA31T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth96 + true + + + DeviceInterfaceLink + 100000 + true + ARISTA32T3 + Ethernet1 + true + str-sonic-lc03-ASIC01 + Eth104 + true + + + DeviceSerialLink + 9600 + true + str-sonic-sup00 + logical3 + true + str-sonic-lc03 + logical + true + 3 + + + + + LinecardAsic +
+ 10.2.0.1/32 +
+ + fc00:20::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc03-ASIC00 + Broadcom-Jericho2cplus +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC02 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC03 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC09 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC08 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC05 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC04 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC10 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC11 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC06 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC07 + Broadcom-Ramon +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.10/17 + + + ::/0 + + + + ARISTA91T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.11/17 + + + ::/0 + + + + ARISTA93T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.12/17 + + + ::/0 + + + + ARISTA05T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.13/17 + + + ::/0 + + + + ARISTA07T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.14/17 + + + ::/0 + + + + ARISTA09T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.15/17 + + + ::/0 + + + + ARISTA11T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.16/17 + + + ::/0 + + + + ARISTA13T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.17/17 + + + ::/0 + + + + ARISTA15T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.18/17 + + + ::/0 + + + + ARISTA17T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.19/17 + + + ::/0 + + + + ARISTA18T3 + Sonic-T3-sku +
+ + LinecardAsic +
+ 10.2.0.1/32 +
+ + fc00:20::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc03-ASIC01 + Broadcom-Jericho2cplus +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.20/17 + + + ::/0 + + + + ARISTA19T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.21/17 + + + ::/0 + + + + ARISTA20T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.22/17 + + + ::/0 + + + + ARISTA21T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.23/17 + + + ::/0 + + + + ARISTA22T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.24/17 + + + ::/0 + + + + ARISTA23T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.25/17 + + + ::/0 + + + + ARISTA24T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.26/17 + + + ::/0 + + + + ARISTA25T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.27/17 + + + ::/0 + + + + ARISTA26T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.28/17 + + + ::/0 + + + + ARISTA27T3 + Sonic-T3-sku +
+ + RegionalHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.29/17 + + + ::/0 + + + + ARISTA28T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.30/17 + + + ::/0 + + + + ARISTA29T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.31/17 + + + ::/0 + + + + ARISTA30T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.32/17 + + + ::/0 + + + + ARISTA31T3 + Sonic-T3-sku +
+ + AZNGHub +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.33/17 + + + ::/0 + + + + ARISTA32T3 + Sonic-T3-sku +
+ + Linecard +
+ 10.2.0.1/32 +
+ + fc00:20::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.58/24 + + + 2a01:111:e210:3000::a03:923a/64 + + + + str-sonic-lc03 + Sonic-400g-lc-sku +
+ + Supervisor +
+ 10.152.0.46/32 +
+ + 2a01:111:e210:5e::/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.111/24 + + + 2a01:111:e210:3000::a03:926f/64 + + + + str-sonic-sup00 + sonic-sup-sku +
+ + SpineRouter +
+ 10.152.0.46/32 +
+ + 2a01:111:e210:5e::/128 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.111/24 + + + 2a01:111:e210:3000::a03:926f/64 + + + + str-sonic + Sonic-Chassis-sku + 0 +
+
+
+ str-sonic-lc03 + Sonic-400g-lc-sku + 1.0.1388.35297 + +
\ No newline at end of file diff --git a/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_single_asic.xml b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_single_asic.xml new file mode 100644 index 000000000000..1e80a5bcbd58 --- /dev/null +++ b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_single_asic.xml @@ -0,0 +1,46215 @@ + + + + + + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc06-ASIC00 + 10.241.88.4 + str-sonic-lc07-ASIC00 + 10.241.88.5 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc06-ASIC00 + 2a01:111:e210:5e:0:a:f158:400 + str-sonic-lc07-ASIC00 + 2a01:111:e210:5e:0:a:f158:500 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc06-ASIC00 + 10.241.88.4 + str-sonic-lc08-ASIC00 + 10.241.88.6 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc06-ASIC00 + 2a01:111:e210:5e:0:a:f158:400 + str-sonic-lc08-ASIC00 + 2a01:111:e210:5e:0:a:f158:600 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc06-ASIC00 + 10.241.88.4 + str-sonic-lc09-ASIC00 + 10.241.88.7 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc06-ASIC00 + 2a01:111:e210:5e:0:a:f158:400 + str-sonic-lc09-ASIC00 + 2a01:111:e210:5e:0:a:f158:700 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc06-ASIC00 + 10.241.88.4 + str-sonic-lc10-ASIC00 + 10.241.88.8 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc06-ASIC00 + 2a01:111:e210:5e:0:a:f158:400 + str-sonic-lc10-ASIC00 + 2a01:111:e210:5e:0:a:f158:800 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 10.241.88.0 + str-sonic-lc06-ASIC00 + 10.241.88.4 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC00 + 2a01:111:e210:5e:0:a:f158:0 + str-sonic-lc06-ASIC00 + 2a01:111:e210:5e:0:a:f158:400 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 10.241.88.1 + str-sonic-lc06-ASIC00 + 10.241.88.4 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc03-ASIC01 + 2a01:111:e210:5e:0:a:f158:100 + str-sonic-lc06-ASIC00 + 2a01:111:e210:5e:0:a:f158:400 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc04-ASIC00 + 10.241.88.2 + str-sonic-lc06-ASIC00 + 10.241.88.4 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc04-ASIC00 + 2a01:111:e210:5e:0:a:f158:200 + str-sonic-lc06-ASIC00 + 2a01:111:e210:5e:0:a:f158:400 + 1 + 0 + 0 + + + BGPSessionstr-soni + + VoQ + VoQ + + false + str-sonic-lc05-ASIC00 + 10.241.88.3 + str-sonic-lc06-ASIC00 + 10.241.88.4 + 1 + 0 + 0 + + + BGPSession + + VoQ + VoQ + + false + str-sonic-lc05-ASIC00 + 2a01:111:e210:5e:0:a:f158:300 + str-sonic-lc06-ASIC00 + 2a01:111:e210:5e:0:a:f158:400 + 1 + 0 + 0 + + + BGPSession + false + ARISTA33T1 + 10.0.0.129 + str-sonic-lc06-ASIC00 + 10.0.0.128 + 1 + 10 + 3 + + + BGPSession + false + ARISTA33T1 + fc00::102 + str-sonic-lc06-ASIC00 + fc00::101 + 1 + 10 + 3 + + + BGPSession + false + ARISTA35T1 + 10.0.0.133 + str-sonic-lc06-ASIC00 + 10.0.0.132 + 1 + 10 + 3 + + + BGPSession + false + ARISTA35T1 + fc00::10a + str-sonic-lc06-ASIC00 + fc00::109 + 1 + 10 + 3 + + + BGPSession + false + ARISTA37T1 + 10.0.0.137 + str-sonic-lc06-ASIC00 + 10.0.0.136 + 1 + 10 + 3 + + + BGPSession + false + ARISTA37T1 + fc00::112 + str-sonic-lc06-ASIC00 + fc00::111 + 1 + 10 + 3 + + + BGPSession + false + ARISTA39T1 + 10.0.0.141 + str-sonic-lc06-ASIC00 + 10.0.0.140 + 1 + 10 + 3 + + + BGPSession + false + ARISTA39T1 + fc00::11a + str-sonic-lc06-ASIC00 + fc00::119 + 1 + 10 + 3 + + + BGPSession + false + ARISTA41T1 + 10.0.0.145 + str-sonic-lc06-ASIC00 + 10.0.0.144 + 1 + 10 + 3 + + + BGPSession + false + ARISTA41T1 + fc00::122 + str-sonic-lc06-ASIC00 + fc00::121 + 1 + 10 + 3 + + + BGPSession + false + ARISTA43T1 + 10.0.0.149 + str-sonic-lc06-ASIC00 + 10.0.0.148 + 1 + 10 + 3 + + + BGPSession + false + ARISTA43T1 + fc00::12a + str-sonic-lc06-ASIC00 + fc00::129 + 1 + 10 + 3 + + + BGPSession + false + ARISTA47T1 + 10.0.0.153 + str-sonic-lc06-ASIC00 + 10.0.0.152 + 1 + 10 + 3 + + + BGPSession + false + ARISTA47T1 + fc00::132 + str-sonic-lc06-ASIC00 + fc00::131 + 1 + 10 + 3 + + + BGPSession + false + ARISTA50T1 + 10.0.0.157 + str-sonic-lc06-ASIC00 + 10.0.0.156 + 1 + 10 + 3 + + + BGPSession + false + ARISTA50T1 + fc00::13a + str-sonic-lc06-ASIC00 + fc00::139 + 1 + 10 + 3 + + + + + 65100 + + + BGPGroup + 10.241.88.4;2a01:111:e210:5e:0:a:f158:400 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc06-ASIC00 + + + BGPPeer +
10.241.88.4
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:400
+ + + +
+ + BGPPeer +
10.0.0.128
+ + + +
+ + BGPPeer +
fc00::101
+ + + +
+ + BGPPeer +
10.0.0.132
+ + + +
+ + BGPPeer +
fc00::109
+ + + +
+ + BGPPeer +
10.0.0.136
+ + + +
+ + BGPPeer +
fc00::111
+ + + +
+ + BGPPeer +
10.0.0.140
+ + + +
+ + BGPPeer +
fc00::119
+ + + +
+ + BGPPeer +
10.0.0.144
+ + + +
+ + BGPPeer +
fc00::121
+ + + +
+ + BGPPeer +
10.0.0.148
+ + + +
+ + BGPPeer +
fc00::129
+ + + +
+ + BGPPeer +
10.0.0.152
+ + + +
+ + BGPPeer +
fc00::131
+ + + +
+ + BGPPeer +
10.0.0.156
+ + + +
+ + BGPPeer +
fc00::139
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.5;2a01:111:e210:5e:0:a:f158:500 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc07-ASIC00 + + + BGPPeer +
10.241.88.5
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:500
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.6;2a01:111:e210:5e:0:a:f158:600 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc08-ASIC00 + + + BGPPeer +
10.241.88.6
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:600
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.7;2a01:111:e210:5e:0:a:f158:700 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc09-ASIC00 + + + BGPPeer +
10.241.88.7
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:700
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.8;2a01:111:e210:5e:0:a:f158:800 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc10-ASIC00 + + + BGPPeer +
10.241.88.8
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:800
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.0;2a01:111:e210:5e:0:a:f158:0 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc03-ASIC00 + + + BGPPeer +
10.241.88.0
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:0
+ + + +
+ + BGPPeer +
10.0.0.0
+ + + +
+ + BGPPeer +
10.0.0.4
+ + + +
+ + BGPPeer +
10.0.0.8
+ + + +
+ + BGPPeer +
10.0.0.12
+ + + +
+ + BGPPeer +
10.0.0.16
+ + + +
+ + BGPPeer +
10.0.0.20
+ + + +
+ + BGPPeer +
10.0.0.24
+ + + +
+ + BGPPeer +
10.0.0.28
+ + + +
+ + BGPPeer +
fc00::1
+ + + +
+ + BGPPeer +
fc00::9
+ + + +
+ + BGPPeer +
fc00::11
+ + + +
+ + BGPPeer +
fc00::19
+ + + +
+ + BGPPeer +
fc00::21
+ + + +
+ + BGPPeer +
fc00::29
+ + + +
+ + BGPPeer +
fc00::31
+ + + +
+ + BGPPeer +
fc00::39
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.1;2a01:111:e210:5e:0:a:f158:100 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc03-ASIC01 + + + BGPPeer +
10.241.88.1
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:100
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.2;2a01:111:e210:5e:0:a:f158:200 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc04-ASIC00 + + + BGPPeer +
10.241.88.2
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:200
+ + + +
+
+ + +
+ + 65100 + + + BGPGroup + 10.241.88.3;2a01:111:e210:5e:0:a:f158:300 + eBGP + + + + + + 0 + + false + false + VoQ + 0 + 0 + 0 + + + + str-sonic-lc05-ASIC00 + + + BGPPeer +
10.241.88.3
+ + + +
+ + BGPPeer +
2a01:111:e210:5e:0:a:f158:300
+ + + +
+ + BGPPeer +
10.0.0.72
+ + + +
+ + BGPPeer +
fc00::91
+ + + +
+ + BGPPeer +
10.0.0.76
+ + + +
+ + BGPPeer +
fc00::99
+ + + +
+ + BGPPeer +
10.0.0.80
+ + + +
+ + BGPPeer +
fc00::a1
+ + + +
+ + BGPPeer +
10.0.0.84
+ + + +
+ + BGPPeer +
fc00::a9
+ + + +
+ + BGPPeer +
10.0.0.88
+ + + +
+ + BGPPeer +
fc00::b1
+ + + +
+ + BGPPeer +
10.0.0.92
+ + + +
+ + BGPPeer +
fc00::b9
+ + + +
+ + BGPPeer +
10.0.0.64
+ + + +
+ + BGPPeer +
fc00::81
+ + + +
+ + BGPPeer +
10.0.0.68
+ + + +
+ + BGPPeer +
fc00::89
+ + + +
+
+ + +
+ + 65338 + + + ARISTA33T1 + + + BGPPeer +
10.0.0.129
+ + + +
+ + BGPPeer +
fc00::102
+ + + +
+
+ + +
+ + 65339 + + + ARISTA35T1 + + + BGPPeer +
10.0.0.133
+ + + +
+ + BGPPeer +
fc00::10a
+ + + +
+
+ + +
+ + 65340 + + + ARISTA37T1 + + + BGPPeer +
10.0.0.137
+ + + +
+ + BGPPeer +
fc00::112
+ + + +
+
+ + +
+ + 65341 + + + ARISTA39T1 + + + BGPPeer +
10.0.0.141
+ + + +
+ + BGPPeer +
fc00::11a
+ + + +
+
+ + +
+ + 65342 + + + ARISTA41T1 + + + BGPPeer +
10.0.0.145
+ + + +
+ + BGPPeer +
fc00::122
+ + + +
+
+ + +
+ + 65343 + + + ARISTA43T1 + + + BGPPeer +
10.0.0.149
+ + + +
+ + BGPPeer +
fc00::12a
+ + + +
+
+ + +
+ + 65345 + + + ARISTA47T1 + + + BGPPeer +
10.0.0.153
+ + + +
+ + BGPPeer +
fc00::132
+ + + +
+
+ + +
+ + 65347 + + + ARISTA50T1 + + + BGPPeer +
10.0.0.157
+ + + +
+ + BGPPeer +
fc00::13a
+ + + +
+
+ + +
+
+ +
+ + + + + + DeviceInterface + + true + 1 + cpu3/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 2 + cpu3/1 + false + + cpu1 + 10000 + + + + + DeviceInterface + + true + 3 + Recirc3/0/0 + false + + Ethernet-Rec0 + 10000 + + + + + DeviceInterface + + true + 4 + Recirc3/1/0 + false + + Ethernet-Rec1 + 10000 + + + + + DeviceInterface + + true + 5 + Recirc3/0/1 + false + + Ethernet-IB0 + 10000 + + + + + DeviceInterface + + true + 6 + Recirc3/1/1 + false + + Ethernet-IB1 + 10000 + + + + + DeviceInterface + + true + 7 + cpu4/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 8 + Recirc4/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 9 + Recirc4/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 10 + cpu5/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 11 + Recirc5/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 12 + Recirc5/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 13 + cpu6/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 14 + Recirc6/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 15 + Recirc6/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 16 + cpu7/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 17 + Recirc7/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 18 + Recirc7/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 19 + cpu8/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 20 + Recirc8/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 21 + Recirc8/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 22 + cpu10/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 23 + Recirc10/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 24 + Recirc10/0/1 + false + + Ethernet-IB0 + 400000 + + + + + Sonic-T2-Base-sku + + + + DeviceInterface + 100000 + true + 1 + Ethernet3/1/1 + false + + Ethernet0 + 400000 + + + DeviceInterface + 100000 + true + 2 + Ethernet3/2/1 + false + + Ethernet8 + 400000 + + + DeviceInterface + 100000 + true + 3 + Ethernet3/3/1 + false + + Ethernet16 + 400000 + + + DeviceInterface + 100000 + true + 4 + Ethernet3/4/1 + false + + Ethernet24 + 400000 + + + DeviceInterface + 100000 + true + 5 + Ethernet3/5/1 + false + + Ethernet32 + 400000 + + + DeviceInterface + 100000 + true + 6 + Ethernet3/6/1 + false + + Ethernet40 + 400000 + + + DeviceInterface + 100000 + true + 7 + Ethernet3/7/1 + false + + Ethernet48 + 400000 + + + DeviceInterface + 100000 + true + 8 + Ethernet3/8/1 + false + + Ethernet56 + 400000 + + + DeviceInterface + 100000 + true + 9 + Ethernet3/9/1 + false + + Ethernet64 + 400000 + + + DeviceInterface + 100000 + true + 10 + Ethernet3/10/1 + false + + Ethernet72 + 400000 + + + DeviceInterface + 100000 + true + 11 + Ethernet3/11/1 + false + + Ethernet80 + 400000 + + + DeviceInterface + 100000 + true + 12 + Ethernet3/12/1 + false + + Ethernet88 + 400000 + + + DeviceInterface + 100000 + true + 13 + Ethernet3/13/1 + false + + Ethernet96 + 400000 + + + DeviceInterface + 100000 + true + 14 + Ethernet3/14/1 + false + + Ethernet104 + 400000 + + + DeviceInterface + 100000 + true + 15 + Ethernet3/15/1 + false + + Ethernet112 + 400000 + + + DeviceInterface + 100000 + true + 16 + Ethernet3/16/1 + false + + Ethernet120 + 400000 + + + DeviceInterface + 100000 + true + 17 + Ethernet3/17/1 + false + + Ethernet128 + 400000 + + + DeviceInterface + 100000 + true + 18 + Ethernet3/18/1 + false + + Ethernet136 + 400000 + + + DeviceInterface + 100000 + true + 19 + Ethernet3/19/1 + false + + Ethernet144 + 400000 + + + DeviceInterface + 100000 + true + 20 + Ethernet3/20/1 + false + + Ethernet152 + 400000 + + + DeviceInterface + 100000 + true + 21 + Ethernet3/21/1 + false + + Ethernet160 + 400000 + + + DeviceInterface + 100000 + true + 22 + Ethernet3/22/1 + false + + Ethernet168 + 400000 + + + DeviceInterface + 100000 + true + 23 + Ethernet3/23/1 + false + + Ethernet176 + 400000 + + + DeviceInterface + 100000 + true + 24 + Ethernet3/24/1 + false + + Ethernet184 + 400000 + + + DeviceInterface + 100000 + true + 25 + Ethernet3/25/1 + false + + Ethernet192 + 400000 + + + DeviceInterface + 100000 + true + 26 + Ethernet3/26/1 + false + + Ethernet200 + 400000 + + + DeviceInterface + 100000 + true + 27 + Ethernet3/27/1 + false + + Ethernet208 + 400000 + + + DeviceInterface + 100000 + true + 28 + Ethernet3/28/1 + false + + Ethernet216 + 400000 + + + DeviceInterface + 100000 + true + 29 + Ethernet3/29/1 + false + + Ethernet224 + 400000 + + + DeviceInterface + 100000 + true + 30 + Ethernet3/30/1 + false + + Ethernet232 + 400000 + + + DeviceInterface + 100000 + true + 31 + Ethernet3/31/1 + false + + Ethernet240 + 400000 + + + DeviceInterface + 100000 + true + 32 + Ethernet3/32/1 + false + + Ethernet248 + 400000 + + + DeviceInterface + 100000 + true + 33 + Ethernet3/33/1 + false + + Ethernet256 + 400000 + + + DeviceInterface + 100000 + true + 34 + Ethernet3/34/1 + false + + Ethernet264 + 400000 + + + DeviceInterface + 100000 + true + 35 + Ethernet3/35/1 + false + + Ethernet272 + 400000 + + + DeviceInterface + 100000 + true + 36 + Ethernet3/36/1 + false + + Ethernet280 + 400000 + + + DeviceInterface + 40000 + true + 37 + Ethernet4/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 38 + Ethernet4/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 39 + Ethernet4/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 40 + Ethernet4/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 41 + Ethernet4/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 42 + Ethernet4/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 43 + Ethernet4/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 44 + Ethernet4/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 45 + Ethernet4/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 46 + Ethernet4/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 47 + Ethernet4/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 48 + Ethernet4/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 49 + Ethernet4/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 50 + Ethernet4/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 51 + Ethernet4/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 52 + Ethernet4/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 53 + Ethernet4/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 54 + Ethernet4/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 55 + Ethernet4/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 56 + Ethernet4/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 57 + Ethernet4/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 58 + Ethernet4/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 59 + Ethernet4/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 60 + Ethernet4/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 61 + Ethernet4/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 62 + Ethernet4/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 63 + Ethernet4/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 64 + Ethernet4/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 65 + Ethernet4/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 66 + Ethernet4/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 67 + Ethernet4/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 68 + Ethernet4/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 69 + Ethernet4/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 70 + Ethernet4/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 71 + Ethernet4/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 72 + Ethernet4/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 73 + Ethernet4/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 74 + Ethernet4/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 75 + Ethernet4/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 76 + Ethernet4/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 77 + Ethernet4/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 78 + Ethernet4/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 79 + Ethernet4/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 80 + Ethernet4/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 81 + Ethernet4/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 82 + Ethernet4/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 83 + Ethernet4/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 84 + Ethernet4/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 85 + Ethernet5/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 86 + Ethernet5/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 87 + Ethernet5/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 88 + Ethernet5/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 89 + Ethernet5/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 90 + Ethernet5/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 91 + Ethernet5/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 92 + Ethernet5/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 93 + Ethernet5/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 94 + Ethernet5/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 95 + Ethernet5/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 96 + Ethernet5/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 97 + Ethernet5/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 98 + Ethernet5/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 99 + Ethernet5/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 100 + Ethernet5/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 101 + Ethernet5/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 102 + Ethernet5/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 103 + Ethernet5/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 104 + Ethernet5/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 105 + Ethernet5/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 106 + Ethernet5/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 107 + Ethernet5/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 108 + Ethernet5/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 109 + Ethernet5/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 110 + Ethernet5/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 111 + Ethernet5/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 112 + Ethernet5/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 113 + Ethernet5/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 114 + Ethernet5/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 115 + Ethernet5/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 116 + Ethernet5/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 117 + Ethernet5/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 118 + Ethernet5/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 119 + Ethernet5/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 120 + Ethernet5/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 121 + Ethernet5/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 122 + Ethernet5/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 123 + Ethernet5/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 124 + Ethernet5/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 125 + Ethernet5/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 126 + Ethernet5/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 127 + Ethernet5/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 128 + Ethernet5/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 129 + Ethernet5/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 130 + Ethernet5/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 131 + Ethernet5/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 132 + Ethernet5/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 133 + Ethernet6/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 134 + Ethernet6/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 135 + Ethernet6/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 136 + Ethernet6/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 137 + Ethernet6/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 138 + Ethernet6/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 139 + Ethernet6/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 140 + Ethernet6/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 141 + Ethernet6/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 142 + Ethernet6/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 143 + Ethernet6/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 144 + Ethernet6/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 145 + Ethernet6/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 146 + Ethernet6/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 147 + Ethernet6/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 148 + Ethernet6/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 149 + Ethernet6/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 150 + Ethernet6/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 151 + Ethernet6/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 152 + Ethernet6/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 153 + Ethernet6/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 154 + Ethernet6/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 155 + Ethernet6/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 156 + Ethernet6/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 157 + Ethernet6/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 158 + Ethernet6/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 159 + Ethernet6/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 160 + Ethernet6/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 161 + Ethernet6/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 162 + Ethernet6/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 163 + Ethernet6/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 164 + Ethernet6/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 165 + Ethernet6/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 166 + Ethernet6/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 167 + Ethernet6/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 168 + Ethernet6/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 169 + Ethernet6/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 170 + Ethernet6/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 171 + Ethernet6/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 172 + Ethernet6/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 173 + Ethernet6/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 174 + Ethernet6/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 175 + Ethernet6/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 176 + Ethernet6/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 177 + Ethernet6/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 178 + Ethernet6/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 179 + Ethernet6/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 180 + Ethernet6/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 181 + Ethernet7/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 182 + Ethernet7/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 183 + Ethernet7/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 184 + Ethernet7/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 185 + Ethernet7/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 186 + Ethernet7/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 187 + Ethernet7/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 188 + Ethernet7/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 189 + Ethernet7/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 190 + Ethernet7/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 191 + Ethernet7/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 192 + Ethernet7/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 193 + Ethernet7/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 194 + Ethernet7/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 195 + Ethernet7/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 196 + Ethernet7/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 197 + Ethernet7/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 198 + Ethernet7/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 199 + Ethernet7/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 200 + Ethernet7/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 201 + Ethernet7/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 202 + Ethernet7/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 203 + Ethernet7/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 204 + Ethernet7/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 205 + Ethernet7/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 206 + Ethernet7/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 207 + Ethernet7/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 208 + Ethernet7/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 209 + Ethernet7/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 210 + Ethernet7/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 211 + Ethernet7/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 212 + Ethernet7/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 213 + Ethernet7/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 214 + Ethernet7/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 215 + Ethernet7/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 216 + Ethernet7/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 217 + Ethernet7/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 218 + Ethernet7/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 219 + Ethernet7/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 220 + Ethernet7/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 221 + Ethernet7/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 222 + Ethernet7/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 223 + Ethernet7/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 224 + Ethernet7/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 225 + Ethernet7/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 226 + Ethernet7/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 227 + Ethernet7/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 228 + Ethernet7/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 229 + Ethernet8/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 230 + Ethernet8/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 231 + Ethernet8/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 232 + Ethernet8/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 233 + Ethernet8/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 234 + Ethernet8/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 235 + Ethernet8/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 236 + Ethernet8/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 237 + Ethernet8/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 238 + Ethernet8/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 239 + Ethernet8/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 240 + Ethernet8/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 241 + Ethernet8/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 242 + Ethernet8/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 243 + Ethernet8/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 244 + Ethernet8/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 245 + Ethernet8/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 246 + Ethernet8/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 247 + Ethernet8/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 248 + Ethernet8/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 249 + Ethernet8/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 250 + Ethernet8/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 251 + Ethernet8/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 252 + Ethernet8/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 253 + Ethernet8/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 254 + Ethernet8/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 255 + Ethernet8/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 256 + Ethernet8/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 257 + Ethernet8/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 258 + Ethernet8/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 259 + Ethernet8/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 260 + Ethernet8/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 261 + Ethernet8/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 262 + Ethernet8/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 263 + Ethernet8/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 264 + Ethernet8/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 265 + Ethernet8/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 266 + Ethernet8/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 267 + Ethernet8/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 268 + Ethernet8/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 269 + Ethernet8/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 270 + Ethernet8/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 271 + Ethernet8/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 272 + Ethernet8/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 273 + Ethernet8/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 274 + Ethernet8/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 275 + Ethernet8/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 276 + Ethernet8/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 277 + Ethernet9/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 278 + Ethernet9/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 279 + Ethernet9/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 280 + Ethernet9/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 281 + Ethernet9/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 282 + Ethernet9/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 283 + Ethernet9/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 284 + Ethernet9/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 285 + Ethernet9/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 286 + Ethernet9/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 287 + Ethernet9/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 288 + Ethernet9/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 289 + Ethernet9/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 290 + Ethernet9/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 291 + Ethernet9/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 292 + Ethernet9/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 293 + Ethernet9/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 294 + Ethernet9/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 295 + Ethernet9/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 296 + Ethernet9/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 297 + Ethernet9/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 298 + Ethernet9/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 299 + Ethernet9/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 300 + Ethernet9/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 301 + Ethernet9/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 302 + Ethernet9/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 303 + Ethernet9/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 304 + Ethernet9/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 305 + Ethernet9/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 306 + Ethernet9/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 307 + Ethernet9/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 308 + Ethernet9/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 309 + Ethernet9/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 310 + Ethernet9/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 311 + Ethernet9/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 312 + Ethernet9/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 313 + Ethernet9/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 314 + Ethernet9/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 315 + Ethernet9/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 316 + Ethernet9/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 317 + Ethernet9/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 318 + Ethernet9/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 319 + Ethernet9/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 320 + Ethernet9/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 321 + Ethernet9/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 322 + Ethernet9/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 323 + Ethernet9/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 324 + Ethernet9/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 325 + Ethernet10/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 326 + Ethernet10/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 327 + Ethernet10/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 328 + Ethernet10/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 329 + Ethernet10/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 330 + Ethernet10/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 331 + Ethernet10/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 332 + Ethernet10/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 333 + Ethernet10/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 334 + Ethernet10/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 335 + Ethernet10/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 336 + Ethernet10/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 337 + Ethernet10/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 338 + Ethernet10/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 339 + Ethernet10/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 340 + Ethernet10/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 341 + Ethernet10/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 342 + Ethernet10/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 343 + Ethernet10/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 344 + Ethernet10/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 345 + Ethernet10/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 346 + Ethernet10/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 347 + Ethernet10/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 348 + Ethernet10/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 349 + Ethernet10/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 350 + Ethernet10/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 351 + Ethernet10/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 352 + Ethernet10/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 353 + Ethernet10/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 354 + Ethernet10/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 355 + Ethernet10/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 356 + Ethernet10/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 357 + Ethernet10/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 358 + Ethernet10/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 359 + Ethernet10/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 360 + Ethernet10/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 361 + Ethernet10/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 362 + Ethernet10/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 363 + Ethernet10/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 364 + Ethernet10/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 365 + Ethernet10/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 366 + Ethernet10/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 367 + Ethernet10/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 368 + Ethernet10/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 369 + Ethernet10/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 370 + Ethernet10/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 371 + Ethernet10/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 372 + Ethernet10/48/1 + false + + Ethernet188 + 100000 + + + true + 0 + Sonic-Chassis-sku + + + + Ethernet3/1/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:3:0:1 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + Ethernet3/2/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:3:0:2 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + Ethernet3/3/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:3:0:3 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + Ethernet3/4/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:3:0:4 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + Ethernet3/5/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:3:0:5 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + Ethernet3/6/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:3:0:6 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + Ethernet3/7/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:3:0:7 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + Ethernet3/8/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:3:0:8 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + Ethernet3/9/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:3:0:9 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + Ethernet3/10/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:3:0:10 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet3/11/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:3:0:11 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet3/12/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:3:0:12 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet3/13/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:3:0:13 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet3/14/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:3:0:14 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet3/15/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:3:0:15 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet3/16/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:3:0:16 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet3/17/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:3:0:17 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet3/18/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:3:0:18 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet3/19/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:3:0:19 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + Ethernet3/20/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:3:0:20 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + Ethernet3/21/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:3:0:21 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + Ethernet3/22/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:3:0:22 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + Ethernet3/23/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:3:0:23 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + Ethernet3/24/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:3:0:24 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + Ethernet3/25/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:3:0:25 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + Ethernet3/26/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:3:0:26 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + Ethernet3/27/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:3:0:27 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + Ethernet3/28/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:3:0:28 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet3/29/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:3:0:29 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet3/30/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:3:0:30 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet3/31/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:3:0:31 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet3/32/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:3:0:32 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet3/33/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:3:0:33 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet3/34/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:3:0:34 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet3/35/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:3:0:35 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet3/36/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:3:0:36 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + cpu3/0 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:3:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + cpu3/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:3:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Recirc3/0/0 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:3:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Recirc3/1/0 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:3:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Recirc3/0/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:3:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 19 + + + CoreId + 1 + + + + + Recirc3/1/1 + + + LineCardSku + Sonic-400g-lc-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:3:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 19 + + + CoreId + 1 + + + + + Ethernet4/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:4:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet4/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:4:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet4/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:4:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet4/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:4:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet4/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:4:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet4/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:4:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet4/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:4:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet4/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:4:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet4/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:4:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet4/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:4:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet4/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:4:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet4/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:4:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet4/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:4:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet4/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:4:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet4/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:4:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet4/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:4:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet4/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:4:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet4/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:4:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet4/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:4:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet4/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:4:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet4/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:4:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet4/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:4:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet4/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:4:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet4/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:4:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet4/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:4:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet4/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:4:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet4/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:4:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet4/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:4:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet4/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:4:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet4/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:4:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet4/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:4:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet4/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:4:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet4/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:4:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet4/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:4:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet4/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:4:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet4/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:4:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet4/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:4:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet4/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:4:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet4/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:4:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet4/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:4:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet4/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:4:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet4/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:4:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet4/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:4:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet4/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:4:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet4/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:4:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet4/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:4:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet4/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:4:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet4/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:4:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu4/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:4:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc4/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:4:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc4/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:4:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet5/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:5:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet5/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:5:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet5/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:5:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet5/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:5:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet5/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:5:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet5/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:5:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet5/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:5:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet5/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:5:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet5/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:5:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet5/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:5:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet5/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:5:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet5/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:5:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet5/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:5:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet5/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:5:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet5/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:5:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet5/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:5:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet5/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:5:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet5/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:5:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet5/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:5:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet5/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:5:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet5/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:5:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet5/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:5:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet5/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:5:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet5/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:5:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet5/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:5:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet5/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:5:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet5/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:5:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet5/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:5:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet5/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:5:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet5/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:5:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet5/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:5:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet5/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:5:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet5/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:5:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet5/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:5:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet5/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:5:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet5/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:5:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet5/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:5:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet5/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:5:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet5/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:5:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet5/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:5:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet5/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:5:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet5/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:5:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet5/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:5:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet5/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:5:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet5/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:5:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet5/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:5:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet5/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:5:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet5/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:5:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu5/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:5:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc5/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:5:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc5/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:5:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet6/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:6:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet6/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:6:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet6/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:6:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet6/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:6:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet6/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:6:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet6/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:6:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet6/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:6:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet6/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:6:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet6/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:6:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet6/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:6:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet6/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:6:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet6/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:6:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet6/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:6:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet6/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:6:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet6/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:6:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet6/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:6:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet6/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:6:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet6/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:6:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet6/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:6:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet6/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:6:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet6/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:6:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet6/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:6:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet6/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:6:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet6/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:6:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet6/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:6:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet6/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:6:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet6/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:6:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet6/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:6:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet6/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:6:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet6/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:6:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet6/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:6:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet6/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:6:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet6/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:6:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet6/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:6:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet6/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:6:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet6/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:6:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet6/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:6:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet6/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:6:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet6/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:6:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet6/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:6:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet6/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:6:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet6/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:6:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet6/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:6:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet6/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:6:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet6/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:6:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet6/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:6:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet6/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:6:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet6/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:6:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu6/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:6:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc6/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:6:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc6/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:6:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet7/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:7:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet7/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:7:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet7/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:7:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet7/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:7:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet7/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:7:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet7/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:7:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet7/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:7:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet7/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:7:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet7/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:7:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet7/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:7:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet7/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:7:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet7/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:7:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet7/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:7:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet7/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:7:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet7/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:7:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet7/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:7:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet7/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:7:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet7/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:7:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet7/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:7:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet7/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:7:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet7/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:7:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet7/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:7:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet7/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:7:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet7/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:7:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet7/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:7:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet7/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:7:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet7/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:7:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet7/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:7:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet7/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:7:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet7/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:7:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet7/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:7:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet7/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:7:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet7/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:7:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet7/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:7:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet7/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:7:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet7/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:7:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet7/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:7:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet7/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:7:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet7/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:7:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet7/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:7:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet7/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:7:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet7/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:7:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet7/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:7:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet7/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:7:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet7/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:7:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet7/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:7:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet7/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:7:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet7/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:7:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu7/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:7:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc7/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:7:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc7/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:7:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet8/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:8:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet8/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:8:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet8/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:8:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet8/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:8:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet8/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:8:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet8/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:8:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet8/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:8:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet8/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:8:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet8/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:8:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet8/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:8:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet8/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:8:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet8/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:8:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet8/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:8:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet8/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:8:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet8/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:8:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet8/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:8:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet8/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:8:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet8/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:8:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet8/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:8:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet8/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:8:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet8/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:8:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet8/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:8:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet8/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:8:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet8/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:8:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet8/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:8:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet8/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:8:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet8/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:8:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet8/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:8:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet8/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:8:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet8/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:8:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet8/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:8:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet8/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:8:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet8/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:8:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet8/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:8:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet8/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:8:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet8/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:8:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet8/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:8:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet8/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:8:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet8/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:8:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet8/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:8:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet8/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:8:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet8/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:8:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet8/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:8:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet8/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:8:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet8/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:8:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet8/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:8:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet8/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:8:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet8/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:8:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu8/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:8:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc8/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:8:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc8/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:8:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet9/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:9:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet9/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:9:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet9/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:9:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet9/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:9:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet9/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:9:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet9/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:9:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet9/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:9:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet9/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:9:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet9/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:9:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet9/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:9:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet9/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:9:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet9/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:9:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet9/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:9:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet9/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:9:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet9/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:9:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet9/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:9:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet9/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:9:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet9/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:9:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet9/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:9:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet9/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:9:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet9/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:9:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet9/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:9:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet9/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:9:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet9/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:9:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet9/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:9:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet9/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:9:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet9/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:9:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet9/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:9:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet9/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:9:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet9/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:9:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet9/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:9:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet9/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:9:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet9/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:9:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet9/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:9:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet9/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:9:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet9/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:9:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet9/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:9:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet9/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:9:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet9/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:9:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet9/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:9:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet9/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:9:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet9/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:9:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet9/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:9:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet9/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:9:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet9/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:9:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet9/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:9:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet9/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:9:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet9/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:9:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + Ethernet10/1/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:10:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet10/2/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:10:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet10/3/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:10:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet10/4/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:10:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet10/5/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:10:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet10/6/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:10:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet10/7/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:10:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet10/8/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:10:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet10/9/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:10:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet10/10/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:10:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet10/11/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:10:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet10/12/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:10:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet10/13/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:10:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet10/14/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:10:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet10/15/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:10:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet10/16/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:10:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet10/17/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:10:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet10/18/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:10:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet10/19/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:10:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet10/20/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:10:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet10/21/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:10:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet10/22/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:10:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet10/23/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:10:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet10/24/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:10:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet10/25/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:10:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet10/26/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:10:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet10/27/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:10:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet10/28/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:10:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet10/29/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:10:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet10/30/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:10:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet10/31/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:10:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet10/32/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:10:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet10/33/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:10:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet10/34/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:10:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet10/35/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:10:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet10/36/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:10:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet10/37/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:10:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet10/38/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:10:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet10/39/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:10:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet10/40/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:10:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet10/41/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:10:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet10/42/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:10:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet10/43/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:10:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet10/44/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:10:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet10/45/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:10:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet10/46/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:10:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet10/47/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:10:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet10/48/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:10:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu10/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:10:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc10/0/0 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:10:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc10/0/1 + + + LineCardSku + Sonic-lc-100g-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:10:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + + + DeviceInterface + + true + 1 + Management1/1 + false + + + 1000 + + + + + DeviceInterface + + true + 1 + Ethernet3/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 2 + Ethernet3/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 3 + Ethernet3/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 4 + Ethernet3/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 5 + Ethernet3/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 6 + Ethernet3/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 7 + Ethernet3/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 8 + Ethernet3/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 9 + Ethernet3/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 10 + Ethernet3/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 11 + Ethernet3/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 12 + Ethernet3/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 13 + Ethernet3/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 14 + Ethernet3/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 15 + Ethernet3/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 16 + Ethernet3/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 17 + Ethernet3/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 18 + Ethernet3/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 19 + Ethernet3/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 20 + Ethernet3/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 21 + Ethernet3/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 22 + Ethernet3/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 23 + Ethernet3/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 24 + Ethernet3/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 25 + Ethernet3/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 26 + Ethernet3/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 27 + Ethernet3/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 28 + Ethernet3/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 29 + Ethernet3/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 30 + Ethernet3/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 31 + Ethernet3/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 32 + Ethernet3/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 33 + Ethernet3/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 34 + Ethernet3/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 35 + Ethernet3/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 36 + Ethernet3/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 37 + Ethernet3/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 38 + Ethernet3/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 39 + Ethernet3/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 40 + Ethernet3/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 41 + Ethernet3/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 42 + Ethernet3/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 43 + Ethernet3/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 44 + Ethernet3/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 45 + Ethernet3/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 46 + Ethernet3/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 47 + Ethernet3/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 48 + Ethernet3/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 49 + Ethernet3/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 50 + Ethernet3/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 51 + Ethernet3/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 52 + Ethernet3/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 53 + Ethernet3/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 54 + Ethernet3/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 55 + Ethernet3/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 56 + Ethernet3/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 57 + Ethernet3/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 58 + Ethernet3/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 59 + Ethernet3/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 60 + Ethernet3/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 61 + Ethernet3/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 62 + Ethernet3/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 63 + Ethernet3/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 64 + Ethernet3/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 65 + Ethernet3/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 66 + Ethernet3/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 67 + Ethernet3/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 68 + Ethernet3/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 69 + Ethernet3/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 70 + Ethernet3/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 71 + Ethernet3/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 72 + Ethernet3/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 73 + Ethernet3/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 74 + Ethernet3/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 75 + Ethernet3/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 76 + Ethernet3/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 77 + Ethernet3/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 78 + Ethernet3/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 79 + Ethernet3/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 80 + Ethernet3/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 81 + Ethernet3/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 82 + Ethernet3/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 83 + Ethernet3/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 84 + Ethernet3/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 85 + Ethernet3/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 86 + Ethernet3/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 87 + Ethernet3/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 88 + Ethernet3/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 89 + Ethernet3/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 90 + Ethernet3/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 91 + Ethernet3/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 92 + Ethernet3/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 93 + Ethernet3/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 94 + Ethernet3/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 95 + Ethernet3/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 96 + Ethernet3/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 97 + Ethernet3/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 98 + Ethernet3/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 99 + Ethernet3/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 100 + Ethernet3/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 101 + Ethernet3/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 102 + Ethernet3/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 103 + Ethernet3/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 104 + Ethernet3/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 105 + Ethernet3/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 106 + Ethernet3/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 107 + Ethernet3/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 108 + Ethernet3/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 109 + Ethernet4/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 110 + Ethernet4/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 111 + Ethernet4/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 112 + Ethernet4/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 113 + Ethernet4/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 114 + Ethernet4/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 115 + Ethernet4/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 116 + Ethernet4/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 117 + Ethernet4/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 118 + Ethernet4/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 119 + Ethernet4/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 120 + Ethernet4/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 121 + Ethernet4/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 122 + Ethernet4/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 123 + Ethernet4/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 124 + Ethernet4/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 125 + Ethernet4/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 126 + Ethernet4/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 127 + Ethernet4/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 128 + Ethernet4/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 129 + Ethernet4/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 130 + Ethernet4/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 131 + Ethernet4/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 132 + Ethernet4/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 133 + Ethernet4/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 134 + Ethernet4/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 135 + Ethernet4/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 136 + Ethernet4/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 137 + Ethernet4/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 138 + Ethernet4/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 139 + Ethernet4/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 140 + Ethernet4/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 141 + Ethernet4/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 142 + Ethernet4/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 143 + Ethernet4/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 144 + Ethernet4/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 145 + Ethernet4/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 146 + Ethernet4/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 147 + Ethernet4/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 148 + Ethernet4/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 149 + Ethernet4/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 150 + Ethernet4/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 151 + Ethernet4/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 152 + Ethernet4/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 153 + Ethernet4/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 154 + Ethernet4/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 155 + Ethernet4/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 156 + Ethernet4/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 157 + Ethernet4/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 158 + Ethernet4/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 159 + Ethernet4/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 160 + Ethernet4/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 161 + Ethernet4/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 162 + Ethernet4/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 163 + Ethernet4/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 164 + Ethernet4/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 165 + Ethernet4/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 166 + Ethernet4/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 167 + Ethernet4/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 168 + Ethernet4/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 169 + Ethernet4/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 170 + Ethernet4/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 171 + Ethernet4/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 172 + Ethernet4/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 173 + Ethernet4/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 174 + Ethernet4/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 175 + Ethernet4/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 176 + Ethernet4/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 177 + Ethernet4/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 178 + Ethernet4/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 179 + Ethernet4/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 180 + Ethernet4/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 181 + Ethernet4/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 182 + Ethernet4/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 183 + Ethernet4/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 184 + Ethernet4/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 185 + Ethernet4/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 186 + Ethernet4/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 187 + Ethernet4/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 188 + Ethernet4/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 189 + Ethernet4/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 190 + Ethernet4/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 191 + Ethernet4/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 192 + Ethernet4/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 193 + Ethernet4/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 194 + Ethernet4/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 195 + Ethernet4/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 196 + Ethernet4/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 197 + Ethernet4/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 198 + Ethernet4/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 199 + Ethernet4/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 200 + Ethernet4/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 201 + Ethernet4/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 202 + Ethernet4/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 203 + Ethernet4/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 204 + Ethernet4/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 205 + Ethernet4/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 206 + Ethernet4/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 207 + Ethernet4/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 208 + Ethernet4/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 209 + Ethernet4/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 210 + Ethernet4/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 211 + Ethernet4/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 212 + Ethernet4/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 213 + Ethernet4/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 214 + Ethernet4/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 215 + Ethernet4/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 216 + Ethernet4/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 217 + Ethernet4/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 218 + Ethernet4/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 219 + Ethernet4/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 220 + Ethernet4/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 221 + Ethernet4/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 222 + Ethernet4/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 223 + Ethernet4/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 224 + Ethernet4/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 225 + Ethernet4/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 226 + Ethernet4/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 227 + Ethernet4/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 228 + Ethernet4/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 229 + Ethernet4/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 230 + Ethernet4/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 231 + Ethernet4/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 232 + Ethernet4/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 233 + Ethernet4/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 234 + Ethernet4/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 235 + Ethernet4/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 236 + Ethernet4/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 237 + Ethernet4/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 238 + Ethernet4/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 239 + Ethernet4/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 240 + Ethernet4/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 241 + Ethernet4/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 242 + Ethernet4/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 243 + Ethernet4/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 244 + Ethernet4/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 245 + Ethernet4/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 246 + Ethernet4/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 247 + Ethernet4/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 248 + Ethernet4/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 249 + Ethernet4/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 250 + Ethernet4/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 251 + Ethernet4/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 252 + Ethernet4/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 253 + Ethernet5/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 254 + Ethernet5/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 255 + Ethernet5/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 256 + Ethernet5/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 257 + Ethernet5/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 258 + Ethernet5/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 259 + Ethernet5/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 260 + Ethernet5/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 261 + Ethernet5/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 262 + Ethernet5/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 263 + Ethernet5/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 264 + Ethernet5/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 265 + Ethernet5/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 266 + Ethernet5/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 267 + Ethernet5/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 268 + Ethernet5/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 269 + Ethernet5/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 270 + Ethernet5/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 271 + Ethernet5/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 272 + Ethernet5/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 273 + Ethernet5/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 274 + Ethernet5/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 275 + Ethernet5/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 276 + Ethernet5/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 277 + Ethernet5/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 278 + Ethernet5/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 279 + Ethernet5/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 280 + Ethernet5/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 281 + Ethernet5/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 282 + Ethernet5/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 283 + Ethernet5/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 284 + Ethernet5/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 285 + Ethernet5/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 286 + Ethernet5/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 287 + Ethernet5/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 288 + Ethernet5/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 289 + Ethernet5/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 290 + Ethernet5/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 291 + Ethernet5/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 292 + Ethernet5/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 293 + Ethernet5/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 294 + Ethernet5/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 295 + Ethernet5/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 296 + Ethernet5/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 297 + Ethernet5/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 298 + Ethernet5/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 299 + Ethernet5/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 300 + Ethernet5/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 301 + Ethernet5/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 302 + Ethernet5/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 303 + Ethernet5/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 304 + Ethernet5/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 305 + Ethernet5/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 306 + Ethernet5/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 307 + Ethernet5/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 308 + Ethernet5/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 309 + Ethernet5/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 310 + Ethernet5/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 311 + Ethernet5/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 312 + Ethernet5/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 313 + Ethernet5/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 314 + Ethernet5/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 315 + Ethernet5/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 316 + Ethernet5/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 317 + Ethernet5/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 318 + Ethernet5/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 319 + Ethernet5/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 320 + Ethernet5/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 321 + Ethernet5/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 322 + Ethernet5/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 323 + Ethernet5/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 324 + Ethernet5/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 325 + Ethernet5/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 326 + Ethernet5/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 327 + Ethernet5/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 328 + Ethernet5/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 329 + Ethernet5/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 330 + Ethernet5/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 331 + Ethernet5/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 332 + Ethernet5/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 333 + Ethernet5/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 334 + Ethernet5/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 335 + Ethernet5/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 336 + Ethernet5/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 337 + Ethernet5/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 338 + Ethernet5/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 339 + Ethernet5/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 340 + Ethernet5/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 341 + Ethernet5/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 342 + Ethernet5/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 343 + Ethernet5/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 344 + Ethernet5/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 345 + Ethernet5/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 346 + Ethernet5/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 347 + Ethernet5/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 348 + Ethernet5/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 349 + Ethernet5/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 350 + Ethernet5/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 351 + Ethernet5/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 352 + Ethernet5/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 353 + Ethernet5/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 354 + Ethernet5/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 355 + Ethernet5/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 356 + Ethernet5/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 357 + Ethernet5/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 358 + Ethernet5/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 359 + Ethernet5/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 360 + Ethernet5/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 361 + Ethernet5/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 362 + Ethernet5/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 363 + Ethernet5/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 364 + Ethernet5/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 365 + Ethernet5/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 366 + Ethernet5/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 367 + Ethernet5/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 368 + Ethernet5/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 369 + Ethernet5/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 370 + Ethernet5/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 371 + Ethernet5/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 372 + Ethernet5/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 373 + Ethernet5/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 374 + Ethernet5/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 375 + Ethernet5/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 376 + Ethernet5/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 377 + Ethernet5/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 378 + Ethernet5/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 379 + Ethernet5/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 380 + Ethernet5/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 381 + Ethernet5/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 382 + Ethernet5/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 383 + Ethernet5/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 384 + Ethernet5/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 385 + Ethernet5/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 386 + Ethernet5/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 387 + Ethernet5/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 388 + Ethernet5/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 389 + Ethernet5/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 390 + Ethernet5/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 391 + Ethernet5/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 392 + Ethernet5/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 393 + Ethernet5/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 394 + Ethernet5/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 395 + Ethernet5/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 396 + Ethernet5/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 397 + Ethernet6/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 398 + Ethernet6/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 399 + Ethernet6/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 400 + Ethernet6/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 401 + Ethernet6/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 402 + Ethernet6/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 403 + Ethernet6/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 404 + Ethernet6/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 405 + Ethernet6/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 406 + Ethernet6/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 407 + Ethernet6/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 408 + Ethernet6/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 409 + Ethernet6/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 410 + Ethernet6/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 411 + Ethernet6/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 412 + Ethernet6/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 413 + Ethernet6/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 414 + Ethernet6/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 415 + Ethernet6/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 416 + Ethernet6/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 417 + Ethernet6/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 418 + Ethernet6/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 419 + Ethernet6/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 420 + Ethernet6/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 421 + Ethernet6/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 422 + Ethernet6/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 423 + Ethernet6/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 424 + Ethernet6/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 425 + Ethernet6/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 426 + Ethernet6/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 427 + Ethernet6/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 428 + Ethernet6/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 429 + Ethernet6/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 430 + Ethernet6/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 431 + Ethernet6/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 432 + Ethernet6/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 433 + Ethernet6/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 434 + Ethernet6/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 435 + Ethernet6/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 436 + Ethernet6/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 437 + Ethernet6/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 438 + Ethernet6/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 439 + Ethernet6/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 440 + Ethernet6/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 441 + Ethernet6/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 442 + Ethernet6/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 443 + Ethernet6/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 444 + Ethernet6/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 445 + Ethernet6/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 446 + Ethernet6/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 447 + Ethernet6/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 448 + Ethernet6/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 449 + Ethernet6/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 450 + Ethernet6/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 451 + Ethernet6/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 452 + Ethernet6/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 453 + Ethernet6/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 454 + Ethernet6/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 455 + Ethernet6/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 456 + Ethernet6/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 457 + Ethernet6/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 458 + Ethernet6/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 459 + Ethernet6/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 460 + Ethernet6/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 461 + Ethernet6/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 462 + Ethernet6/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 463 + Ethernet6/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 464 + Ethernet6/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 465 + Ethernet6/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 466 + Ethernet6/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 467 + Ethernet6/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 468 + Ethernet6/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 469 + Ethernet6/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 470 + Ethernet6/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 471 + Ethernet6/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 472 + Ethernet6/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 473 + Ethernet6/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 474 + Ethernet6/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 475 + Ethernet6/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 476 + Ethernet6/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 477 + Ethernet6/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 478 + Ethernet6/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 479 + Ethernet6/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 480 + Ethernet6/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 481 + Ethernet6/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 482 + Ethernet6/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 483 + Ethernet6/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 484 + Ethernet6/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 485 + Ethernet6/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 486 + Ethernet6/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 487 + Ethernet6/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 488 + Ethernet6/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 489 + Ethernet6/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 490 + Ethernet6/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 491 + Ethernet6/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 492 + Ethernet6/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 493 + Ethernet6/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 494 + Ethernet6/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 495 + Ethernet6/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 496 + Ethernet6/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 497 + Ethernet6/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 498 + Ethernet6/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 499 + Ethernet6/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 500 + Ethernet6/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 501 + Ethernet6/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 502 + Ethernet6/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 503 + Ethernet6/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 504 + Ethernet6/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 505 + Ethernet6/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 506 + Ethernet6/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 507 + Ethernet6/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 508 + Ethernet6/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 509 + Ethernet6/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 510 + Ethernet6/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 511 + Ethernet6/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 512 + Ethernet6/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 513 + Ethernet6/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 514 + Ethernet6/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 515 + Ethernet6/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 516 + Ethernet6/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 517 + Ethernet6/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 518 + Ethernet6/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 519 + Ethernet6/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 520 + Ethernet6/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 521 + Ethernet6/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 522 + Ethernet6/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 523 + Ethernet6/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 524 + Ethernet6/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 525 + Ethernet6/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 526 + Ethernet6/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 527 + Ethernet6/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 528 + Ethernet6/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 529 + Ethernet6/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 530 + Ethernet6/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 531 + Ethernet6/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 532 + Ethernet6/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 533 + Ethernet6/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 534 + Ethernet6/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 535 + Ethernet6/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 536 + Ethernet6/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 537 + Ethernet6/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 538 + Ethernet6/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 539 + Ethernet6/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 540 + Ethernet6/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 541 + Ethernet7/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 542 + Ethernet7/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 543 + Ethernet7/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 544 + Ethernet7/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 545 + Ethernet7/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 546 + Ethernet7/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 547 + Ethernet7/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 548 + Ethernet7/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 549 + Ethernet7/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 550 + Ethernet7/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 551 + Ethernet7/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 552 + Ethernet7/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 553 + Ethernet7/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 554 + Ethernet7/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 555 + Ethernet7/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 556 + Ethernet7/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 557 + Ethernet7/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 558 + Ethernet7/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 559 + Ethernet7/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 560 + Ethernet7/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 561 + Ethernet7/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 562 + Ethernet7/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 563 + Ethernet7/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 564 + Ethernet7/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 565 + Ethernet7/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 566 + Ethernet7/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 567 + Ethernet7/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 568 + Ethernet7/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 569 + Ethernet7/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 570 + Ethernet7/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 571 + Ethernet7/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 572 + Ethernet7/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 573 + Ethernet7/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 574 + Ethernet7/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 575 + Ethernet7/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 576 + Ethernet7/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 577 + Ethernet7/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 578 + Ethernet7/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 579 + Ethernet7/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 580 + Ethernet7/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 581 + Ethernet7/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 582 + Ethernet7/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 583 + Ethernet7/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 584 + Ethernet7/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 585 + Ethernet7/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 586 + Ethernet7/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 587 + Ethernet7/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 588 + Ethernet7/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 589 + Ethernet7/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 590 + Ethernet7/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 591 + Ethernet7/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 592 + Ethernet7/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 593 + Ethernet7/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 594 + Ethernet7/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 595 + Ethernet7/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 596 + Ethernet7/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 597 + Ethernet7/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 598 + Ethernet7/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 599 + Ethernet7/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 600 + Ethernet7/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 601 + Ethernet7/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 602 + Ethernet7/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 603 + Ethernet7/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 604 + Ethernet7/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 605 + Ethernet7/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 606 + Ethernet7/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 607 + Ethernet7/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 608 + Ethernet7/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 609 + Ethernet7/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 610 + Ethernet7/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 611 + Ethernet7/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 612 + Ethernet7/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 613 + Ethernet7/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 614 + Ethernet7/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 615 + Ethernet7/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 616 + Ethernet7/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 617 + Ethernet7/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 618 + Ethernet7/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 619 + Ethernet7/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 620 + Ethernet7/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 621 + Ethernet7/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 622 + Ethernet7/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 623 + Ethernet7/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 624 + Ethernet7/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 625 + Ethernet7/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 626 + Ethernet7/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 627 + Ethernet7/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 628 + Ethernet7/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 629 + Ethernet7/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 630 + Ethernet7/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 631 + Ethernet7/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 632 + Ethernet7/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 633 + Ethernet7/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 634 + Ethernet7/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 635 + Ethernet7/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 636 + Ethernet7/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 637 + Ethernet7/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 638 + Ethernet7/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 639 + Ethernet7/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 640 + Ethernet7/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 641 + Ethernet7/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 642 + Ethernet7/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 643 + Ethernet7/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 644 + Ethernet7/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 645 + Ethernet7/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 646 + Ethernet7/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 647 + Ethernet7/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 648 + Ethernet7/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 649 + Ethernet7/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 650 + Ethernet7/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 651 + Ethernet7/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 652 + Ethernet7/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 653 + Ethernet7/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 654 + Ethernet7/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 655 + Ethernet7/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 656 + Ethernet7/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 657 + Ethernet7/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 658 + Ethernet7/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 659 + Ethernet7/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 660 + Ethernet7/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 661 + Ethernet7/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 662 + Ethernet7/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 663 + Ethernet7/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 664 + Ethernet7/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 665 + Ethernet7/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 666 + Ethernet7/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 667 + Ethernet7/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 668 + Ethernet7/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 669 + Ethernet7/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 670 + Ethernet7/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 671 + Ethernet7/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 672 + Ethernet7/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 673 + Ethernet7/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 674 + Ethernet7/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 675 + Ethernet7/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 676 + Ethernet7/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 677 + Ethernet7/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 678 + Ethernet7/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 679 + Ethernet7/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 680 + Ethernet7/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 681 + Ethernet7/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 682 + Ethernet7/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 683 + Ethernet7/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 684 + Ethernet7/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 685 + Ethernet8/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 686 + Ethernet8/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 687 + Ethernet8/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 688 + Ethernet8/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 689 + Ethernet8/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 690 + Ethernet8/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 691 + Ethernet8/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 692 + Ethernet8/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 693 + Ethernet8/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 694 + Ethernet8/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 695 + Ethernet8/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 696 + Ethernet8/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 697 + Ethernet8/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 698 + Ethernet8/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 699 + Ethernet8/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 700 + Ethernet8/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 701 + Ethernet8/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 702 + Ethernet8/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 703 + Ethernet8/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 704 + Ethernet8/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 705 + Ethernet8/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 706 + Ethernet8/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 707 + Ethernet8/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 708 + Ethernet8/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 709 + Ethernet8/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 710 + Ethernet8/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 711 + Ethernet8/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 712 + Ethernet8/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 713 + Ethernet8/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 714 + Ethernet8/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 715 + Ethernet8/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 716 + Ethernet8/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 717 + Ethernet8/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 718 + Ethernet8/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 719 + Ethernet8/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 720 + Ethernet8/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 721 + Ethernet8/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 722 + Ethernet8/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 723 + Ethernet8/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 724 + Ethernet8/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 725 + Ethernet8/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 726 + Ethernet8/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 727 + Ethernet8/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 728 + Ethernet8/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 729 + Ethernet8/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 730 + Ethernet8/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 731 + Ethernet8/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 732 + Ethernet8/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 733 + Ethernet8/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 734 + Ethernet8/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 735 + Ethernet8/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 736 + Ethernet8/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 737 + Ethernet8/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 738 + Ethernet8/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 739 + Ethernet8/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 740 + Ethernet8/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 741 + Ethernet8/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 742 + Ethernet8/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 743 + Ethernet8/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 744 + Ethernet8/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 745 + Ethernet8/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 746 + Ethernet8/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 747 + Ethernet8/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 748 + Ethernet8/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 749 + Ethernet8/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 750 + Ethernet8/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 751 + Ethernet8/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 752 + Ethernet8/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 753 + Ethernet8/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 754 + Ethernet8/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 755 + Ethernet8/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 756 + Ethernet8/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 757 + Ethernet8/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 758 + Ethernet8/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 759 + Ethernet8/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 760 + Ethernet8/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 761 + Ethernet8/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 762 + Ethernet8/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 763 + Ethernet8/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 764 + Ethernet8/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 765 + Ethernet8/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 766 + Ethernet8/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 767 + Ethernet8/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 768 + Ethernet8/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 769 + Ethernet8/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 770 + Ethernet8/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 771 + Ethernet8/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 772 + Ethernet8/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 773 + Ethernet8/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 774 + Ethernet8/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 775 + Ethernet8/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 776 + Ethernet8/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 777 + Ethernet8/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 778 + Ethernet8/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 779 + Ethernet8/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 780 + Ethernet8/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 781 + Ethernet8/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 782 + Ethernet8/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 783 + Ethernet8/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 784 + Ethernet8/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 785 + Ethernet8/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 786 + Ethernet8/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 787 + Ethernet8/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 788 + Ethernet8/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 789 + Ethernet8/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 790 + Ethernet8/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 791 + Ethernet8/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 792 + Ethernet8/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 793 + Ethernet8/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 794 + Ethernet8/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 795 + Ethernet8/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 796 + Ethernet8/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 797 + Ethernet8/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 798 + Ethernet8/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 799 + Ethernet8/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 800 + Ethernet8/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 801 + Ethernet8/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 802 + Ethernet8/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 803 + Ethernet8/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 804 + Ethernet8/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 805 + Ethernet8/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 806 + Ethernet8/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 807 + Ethernet8/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 808 + Ethernet8/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 809 + Ethernet8/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 810 + Ethernet8/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 811 + Ethernet8/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 812 + Ethernet8/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 813 + Ethernet8/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 814 + Ethernet8/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 815 + Ethernet8/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 816 + Ethernet8/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 817 + Ethernet8/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 818 + Ethernet8/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 819 + Ethernet8/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 820 + Ethernet8/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 821 + Ethernet8/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 822 + Ethernet8/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 823 + Ethernet8/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 824 + Ethernet8/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 825 + Ethernet8/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 826 + Ethernet8/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 827 + Ethernet8/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 828 + Ethernet8/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 829 + Ethernet9/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 830 + Ethernet9/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 831 + Ethernet9/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 832 + Ethernet9/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 833 + Ethernet9/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 834 + Ethernet9/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 835 + Ethernet9/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 836 + Ethernet9/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 837 + Ethernet9/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 838 + Ethernet9/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 839 + Ethernet9/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 840 + Ethernet9/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 841 + Ethernet9/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 842 + Ethernet9/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 843 + Ethernet9/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 844 + Ethernet9/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 845 + Ethernet9/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 846 + Ethernet9/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 847 + Ethernet9/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 848 + Ethernet9/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 849 + Ethernet9/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 850 + Ethernet9/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 851 + Ethernet9/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 852 + Ethernet9/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 853 + Ethernet9/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 854 + Ethernet9/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 855 + Ethernet9/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 856 + Ethernet9/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 857 + Ethernet9/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 858 + Ethernet9/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 859 + Ethernet9/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 860 + Ethernet9/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 861 + Ethernet9/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 862 + Ethernet9/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 863 + Ethernet9/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 864 + Ethernet9/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 865 + Ethernet9/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 866 + Ethernet9/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 867 + Ethernet9/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 868 + Ethernet9/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 869 + Ethernet9/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 870 + Ethernet9/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 871 + Ethernet9/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 872 + Ethernet9/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 873 + Ethernet9/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 874 + Ethernet9/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 875 + Ethernet9/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 876 + Ethernet9/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 877 + Ethernet9/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 878 + Ethernet9/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 879 + Ethernet9/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 880 + Ethernet9/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 881 + Ethernet9/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 882 + Ethernet9/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 883 + Ethernet9/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 884 + Ethernet9/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 885 + Ethernet9/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 886 + Ethernet9/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 887 + Ethernet9/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 888 + Ethernet9/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 889 + Ethernet9/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 890 + Ethernet9/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 891 + Ethernet9/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 892 + Ethernet9/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 893 + Ethernet9/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 894 + Ethernet9/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 895 + Ethernet9/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 896 + Ethernet9/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 897 + Ethernet9/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 898 + Ethernet9/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 899 + Ethernet9/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 900 + Ethernet9/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 901 + Ethernet9/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 902 + Ethernet9/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 903 + Ethernet9/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 904 + Ethernet9/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 905 + Ethernet9/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 906 + Ethernet9/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 907 + Ethernet9/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 908 + Ethernet9/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 909 + Ethernet9/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 910 + Ethernet9/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 911 + Ethernet9/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 912 + Ethernet9/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 913 + Ethernet9/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 914 + Ethernet9/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 915 + Ethernet9/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 916 + Ethernet9/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 917 + Ethernet9/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 918 + Ethernet9/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 919 + Ethernet9/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 920 + Ethernet9/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 921 + Ethernet9/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 922 + Ethernet9/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 923 + Ethernet9/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 924 + Ethernet9/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 925 + Ethernet9/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 926 + Ethernet9/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 927 + Ethernet9/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 928 + Ethernet9/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 929 + Ethernet9/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 930 + Ethernet9/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 931 + Ethernet9/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 932 + Ethernet9/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 933 + Ethernet9/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 934 + Ethernet9/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 935 + Ethernet9/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 936 + Ethernet9/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 937 + Ethernet9/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 938 + Ethernet9/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 939 + Ethernet9/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 940 + Ethernet9/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 941 + Ethernet9/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 942 + Ethernet9/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 943 + Ethernet9/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 944 + Ethernet9/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 945 + Ethernet9/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 946 + Ethernet9/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 947 + Ethernet9/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 948 + Ethernet9/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 949 + Ethernet9/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 950 + Ethernet9/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 951 + Ethernet9/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 952 + Ethernet9/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 953 + Ethernet9/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 954 + Ethernet9/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 955 + Ethernet9/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 956 + Ethernet9/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 957 + Ethernet9/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 958 + Ethernet9/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 959 + Ethernet9/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 960 + Ethernet9/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 961 + Ethernet9/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 962 + Ethernet9/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 963 + Ethernet9/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 964 + Ethernet9/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 965 + Ethernet9/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 966 + Ethernet9/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 967 + Ethernet9/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 968 + Ethernet9/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 969 + Ethernet9/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 970 + Ethernet9/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 971 + Ethernet9/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 972 + Ethernet9/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 973 + Ethernet10/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 974 + Ethernet10/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 975 + Ethernet10/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 976 + Ethernet10/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 977 + Ethernet10/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 978 + Ethernet10/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 979 + Ethernet10/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 980 + Ethernet10/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 981 + Ethernet10/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 982 + Ethernet10/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 983 + Ethernet10/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 984 + Ethernet10/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 985 + Ethernet10/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 986 + Ethernet10/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 987 + Ethernet10/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 988 + Ethernet10/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 989 + Ethernet10/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 990 + Ethernet10/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 991 + Ethernet10/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 992 + Ethernet10/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 993 + Ethernet10/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 994 + Ethernet10/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 995 + Ethernet10/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 996 + Ethernet10/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 997 + Ethernet10/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 998 + Ethernet10/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 999 + Ethernet10/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1000 + Ethernet10/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1001 + Ethernet10/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1002 + Ethernet10/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1003 + Ethernet10/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1004 + Ethernet10/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1005 + Ethernet10/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1006 + Ethernet10/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1007 + Ethernet10/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1008 + Ethernet10/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1009 + Ethernet10/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1010 + Ethernet10/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1011 + Ethernet10/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1012 + Ethernet10/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1013 + Ethernet10/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1014 + Ethernet10/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1015 + Ethernet10/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1016 + Ethernet10/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1017 + Ethernet10/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1018 + Ethernet10/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1019 + Ethernet10/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1020 + Ethernet10/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1021 + Ethernet10/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1022 + Ethernet10/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1023 + Ethernet10/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1024 + Ethernet10/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1025 + Ethernet10/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1026 + Ethernet10/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1027 + Ethernet10/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1028 + Ethernet10/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1029 + Ethernet10/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1030 + Ethernet10/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1031 + Ethernet10/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1032 + Ethernet10/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1033 + Ethernet10/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1034 + Ethernet10/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1035 + Ethernet10/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1036 + Ethernet10/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1037 + Ethernet10/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1038 + Ethernet10/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1039 + Ethernet10/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1040 + Ethernet10/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1041 + Ethernet10/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1042 + Ethernet10/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1043 + Ethernet10/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1044 + Ethernet10/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1045 + Ethernet10/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1046 + Ethernet10/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1047 + Ethernet10/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1048 + Ethernet10/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1049 + Ethernet10/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1050 + Ethernet10/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1051 + Ethernet10/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1052 + Ethernet10/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1053 + Ethernet10/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1054 + Ethernet10/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1055 + Ethernet10/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1056 + Ethernet10/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1057 + Ethernet10/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1058 + Ethernet10/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1059 + Ethernet10/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1060 + Ethernet10/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1061 + Ethernet10/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1062 + Ethernet10/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1063 + Ethernet10/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1064 + Ethernet10/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1065 + Ethernet10/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1066 + Ethernet10/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1067 + Ethernet10/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1068 + Ethernet10/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1069 + Ethernet10/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1070 + Ethernet10/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1071 + Ethernet10/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1072 + Ethernet10/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1073 + Ethernet10/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1074 + Ethernet10/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1075 + Ethernet10/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1076 + Ethernet10/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1077 + Ethernet10/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1078 + Ethernet10/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1079 + Ethernet10/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1080 + Ethernet10/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1081 + Ethernet10/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1082 + Ethernet10/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1083 + Ethernet10/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1084 + Ethernet10/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1085 + Ethernet10/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1086 + Ethernet10/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1087 + Ethernet10/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1088 + Ethernet10/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1089 + Ethernet10/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1090 + Ethernet10/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1091 + Ethernet10/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1092 + Ethernet10/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1093 + Ethernet10/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1094 + Ethernet10/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1095 + Ethernet10/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1096 + Ethernet10/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1097 + Ethernet10/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1098 + Ethernet10/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1099 + Ethernet10/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1100 + Ethernet10/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1101 + Ethernet10/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1102 + Ethernet10/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1103 + Ethernet10/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1104 + Ethernet10/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1105 + Ethernet10/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1106 + Ethernet10/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1107 + Ethernet10/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1108 + Ethernet10/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1109 + Ethernet10/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1110 + Ethernet10/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1111 + Ethernet10/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1112 + Ethernet10/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1113 + Ethernet10/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1114 + Ethernet10/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1115 + Ethernet10/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1116 + Ethernet10/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + + + DeviceInterface + + true + 1 + power1/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 2 + power1/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 3 + power2/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 4 + power2/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 5 + power3/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 6 + power3/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 7 + power4/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 8 + power4/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 9 + power7/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 10 + power7/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 11 + power8/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 12 + power8/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 13 + power9/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 14 + power9/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 15 + power10/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 16 + power10/1 + false + + + 0 + + C19 + C19 + true + + + + + + DeviceInterface + + true + 1 + console + false + console + + 9600 + false + + + + DeviceInterface + + false + 2 + logical1 + false + logical1 + + 9600 + true + 1 + + + DeviceInterface + + false + 3 + logical2 + false + logical2 + + 9600 + true + 2 + + + DeviceInterface + + false + 4 + logical3 + false + logical3 + + 9600 + true + 3 + + + DeviceInterface + + false + 5 + logical4 + false + logical4 + + 9600 + true + 4 + + + DeviceInterface + + false + 6 + logical5 + false + logical5 + + 9600 + true + 5 + + + DeviceInterface + + false + 7 + logical6 + false + logical6 + + 9600 + true + 6 + + + DeviceInterface + + false + 8 + logical7 + false + logical7 + + 9600 + true + 7 + + + DeviceInterface + + false + 9 + logical8 + false + logical8 + + 9600 + true + 8 + + + DeviceInterface + + false + 10 + logical9 + false + logical9 + + 9600 + true + 9 + + + DeviceInterface + + false + 11 + logical10 + false + logical10 + + 9600 + true + 10 + + + DeviceInterface + + false + 12 + logical11 + false + logical11 + + 9600 + true + 11 + + + DeviceInterface + + false + 13 + logical12 + false + logical12 + + 9600 + true + 12 + + + + Arista + + + + + + + + + + + + str-sonic-lc06-ASIC00 + + + PortChannelInterface + PortChannel1049 + Eth0;Eth4 + + + + PortChannelInterface + PortChannel1050 + Eth8;Eth12 + + + + PortChannelInterface + PortChannel1051 + Eth16;Eth20 + + + + PortChannelInterface + PortChannel1052 + Eth24;Eth28 + + + + PortChannelInterface + PortChannel1053 + Eth36;Eth32 + + + + PortChannelInterface + PortChannel1054 + Eth40;Eth44 + + + + PortChannelInterface + PortChannel1056 + Eth52;Eth56 + + + + PortChannelInterface + PortChannel1058 + Eth64;Eth68 + + + + + + + + IPInterface + VoqInband + Ethernet-IB0 + 10.241.88.4/32 + + + IPInterface + v6VoqInband + Ethernet-IB0 + 2a01:111:e210:5e:0:a:f158:400/128 + + + IPInterface + + PortChannel1049 + 10.0.0.128/31 + + + IPInterface + + PortChannel1049 + fc00::101/126 + + + IPInterface + + PortChannel1050 + 10.0.0.132/31 + + + IPInterface + + PortChannel1050 + fc00::109/126 + + + IPInterface + + PortChannel1051 + 10.0.0.136/31 + + + IPInterface + + PortChannel1051 + fc00::111/126 + + + IPInterface + + PortChannel1052 + 10.0.0.140/31 + + + IPInterface + + PortChannel1052 + fc00::119/126 + + + IPInterface + + PortChannel1053 + 10.0.0.144/31 + + + IPInterface + + PortChannel1053 + fc00::121/126 + + + IPInterface + + PortChannel1054 + 10.0.0.148/31 + + + IPInterface + + PortChannel1054 + fc00::129/126 + + + IPInterface + + PortChannel1056 + 10.0.0.152/31 + + + IPInterface + + PortChannel1056 + fc00::131/126 + + + IPInterface + + PortChannel1058 + 10.0.0.156/31 + + + IPInterface + + PortChannel1058 + fc00::139/126 + + + + + + + + + + + + + LoopbackInterface + HostIP + Loopback0 + + 10.2.0.4/32 + + 10.2.0.4/32 + + + LoopbackInterface + HostIP1 + Loopback0 + + fc00:23::1/128 + + fc00:23::1/128 + + + + + ManagementInterface + ManagementIP + Management1/1 + + 10.3.146.74/24 + + 10.3.146.74/24 + + + + ManagementInterface + v6ManagementIP + Management1/1 + + 2a01:111:e210:3000::a03:924a/64 + + 2a01:111:e210:3000::a03:924a/64 + + + + + + + + str-sonic-lc06 + + + + + + + + + + + + + + + ARISTA33T1:Ethernet1;str-sonic-lc06-ASIC00:Eth0 + + + EndItfKey + + Ethernet6/1/1#0:6:0:1#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA33T1:Ethernet1;str-sonic:Ethernet6/1/1 + + + ARISTA33T1:Ethernet2;str-sonic-lc06-ASIC00:Eth4 + + + EndItfKey + + Ethernet6/2/1#0:6:0:2#1 + + + StartItfKey + + Ethernet2#0:1:0:2#1 + + + ARISTA33T1:Ethernet2;str-sonic:Ethernet6/2/1 + + + ARISTA35T1:Ethernet1;str-sonic-lc06-ASIC00:Eth8 + + + EndItfKey + + Ethernet6/3/1#0:6:0:3#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA35T1:Ethernet1;str-sonic:Ethernet6/3/1 + + + ARISTA35T1:Ethernet2;str-sonic-lc06-ASIC00:Eth12 + + + EndItfKey + + Ethernet6/4/1#0:6:0:4#1 + + + StartItfKey + + Ethernet2#0:1:0:2#1 + + + ARISTA35T1:Ethernet2;str-sonic:Ethernet6/4/1 + + + ARISTA37T1:Ethernet1;str-sonic-lc06-ASIC00:Eth16 + + + EndItfKey + + Ethernet6/5/1#0:6:0:5#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA37T1:Ethernet1;str-sonic:Ethernet6/5/1 + + + ARISTA37T1:Ethernet2;str-sonic-lc06-ASIC00:Eth20 + + + EndItfKey + + Ethernet6/6/1#0:6:0:6#1 + + + StartItfKey + + Ethernet2#0:1:0:2#1 + + + ARISTA37T1:Ethernet2;str-sonic:Ethernet6/6/1 + + + ARISTA39T1:Ethernet1;str-sonic-lc06-ASIC00:Eth24 + + + EndItfKey + + Ethernet6/7/1#0:6:0:7#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA39T1:Ethernet1;str-sonic:Ethernet6/7/1 + + + ARISTA39T1:Ethernet2;str-sonic-lc06-ASIC00:Eth28 + + + EndItfKey + + Ethernet6/8/1#0:6:0:8#1 + + + StartItfKey + + Ethernet2#0:1:0:2#1 + + + ARISTA39T1:Ethernet2;str-sonic:Ethernet6/8/1 + + + ARISTA41T1:Ethernet1;str-sonic-lc06-ASIC00:Eth32 + + + EndItfKey + + Ethernet6/9/1#0:6:0:9#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA41T1:Ethernet1;str-sonic:Ethernet6/9/1 + + + ARISTA41T1:Ethernet2;str-sonic-lc06-ASIC00:Eth36 + + + EndItfKey + + Ethernet6/10/1#0:6:0:10#1 + + + StartItfKey + + Ethernet2#0:1:0:2#1 + + + ARISTA41T1:Ethernet2;str-sonic:Ethernet6/10/1 + + + ARISTA43T1:Ethernet1;str-sonic-lc06-ASIC00:Eth40 + + + EndItfKey + + Ethernet6/11/1#0:6:0:11#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA43T1:Ethernet1;str-sonic:Ethernet6/11/1 + + + ARISTA43T1:Ethernet2;str-sonic-lc06-ASIC00:Eth44 + + + EndItfKey + + Ethernet6/12/1#0:6:0:12#1 + + + StartItfKey + + Ethernet2#0:1:0:2#1 + + + ARISTA43T1:Ethernet2;str-sonic:Ethernet6/12/1 + + + ARISTA45T1:Ethernet1;str-sonic-lc06-ASIC00:Eth48 + + + EndItfKey + + Ethernet6/13/1#0:6:0:13#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA45T1:Ethernet1;str-sonic:Ethernet6/13/1 + + + ARISTA47T1:Ethernet1;str-sonic-lc06-ASIC00:Eth52 + + + EndItfKey + + Ethernet6/14/1#0:6:0:14#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA47T1:Ethernet1;str-sonic:Ethernet6/14/1 + + + ARISTA47T1:Ethernet2;str-sonic-lc06-ASIC00:Eth56 + + + EndItfKey + + Ethernet6/15/1#0:6:0:15#1 + + + StartItfKey + + Ethernet2#0:1:0:2#1 + + + ARISTA47T1:Ethernet2;str-sonic:Ethernet6/15/1 + + + ARISTA49T1:Ethernet1;str-sonic-lc06-ASIC00:Eth60 + + + EndItfKey + + Ethernet6/16/1#0:6:0:16#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA49T1:Ethernet1;str-sonic:Ethernet6/16/1 + + + ARISTA50T1:Ethernet1;str-sonic-lc06-ASIC00:Eth64 + + + EndItfKey + + Ethernet6/17/1#0:6:0:17#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA50T1:Ethernet1;str-sonic:Ethernet6/17/1 + + + ARISTA50T1:Ethernet2;str-sonic-lc06-ASIC00:Eth68 + + + EndItfKey + + Ethernet6/18/1#0:6:0:18#1 + + + StartItfKey + + Ethernet2#0:1:0:2#1 + + + ARISTA50T1:Ethernet2;str-sonic:Ethernet6/18/1 + + + ARISTA51T1:Ethernet1;str-sonic-lc06-ASIC00:Eth72 + + + EndItfKey + + Ethernet6/19/1#0:6:0:19#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA51T1:Ethernet1;str-sonic:Ethernet6/19/1 + + + ARISTA52T1:Ethernet1;str-sonic-lc06-ASIC00:Eth76 + + + EndItfKey + + Ethernet6/20/1#0:6:0:20#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA52T1:Ethernet1;str-sonic:Ethernet6/20/1 + + + ARISTA53T1:Ethernet1;str-sonic-lc06-ASIC00:Eth80 + + + EndItfKey + + Ethernet6/21/1#0:6:0:21#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA53T1:Ethernet1;str-sonic:Ethernet6/21/1 + + + ARISTA54T1:Ethernet1;str-sonic-lc06-ASIC00:Eth84 + + + EndItfKey + + Ethernet6/22/1#0:6:0:22#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA54T1:Ethernet1;str-sonic:Ethernet6/22/1 + + + ARISTA55T1:Ethernet1;str-sonic-lc06-ASIC00:Eth88 + + + EndItfKey + + Ethernet6/23/1#0:6:0:23#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA55T1:Ethernet1;str-sonic:Ethernet6/23/1 + + + ARISTA56T1:Ethernet1;str-sonic-lc06-ASIC00:Eth92 + + + EndItfKey + + Ethernet6/24/1#0:6:0:24#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA56T1:Ethernet1;str-sonic:Ethernet6/24/1 + + + ARISTA57T1:Ethernet1;str-sonic-lc06-ASIC00:Eth96 + + + EndItfKey + + Ethernet6/25/1#0:6:0:25#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA57T1:Ethernet1;str-sonic:Ethernet6/25/1 + + + ARISTA58T1:Ethernet1;str-sonic-lc06-ASIC00:Eth100 + + + EndItfKey + + Ethernet6/26/1#0:6:0:26#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA58T1:Ethernet1;str-sonic:Ethernet6/26/1 + + + ARISTA59T1:Ethernet1;str-sonic-lc06-ASIC00:Eth104 + + + EndItfKey + + Ethernet6/27/1#0:6:0:27#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA59T1:Ethernet1;str-sonic:Ethernet6/27/1 + + + ARISTA60T1:Ethernet1;str-sonic-lc06-ASIC00:Eth108 + + + EndItfKey + + Ethernet6/28/1#0:6:0:28#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA60T1:Ethernet1;str-sonic:Ethernet6/28/1 + + + ARISTA61T1:Ethernet1;str-sonic-lc06-ASIC00:Eth112 + + + EndItfKey + + Ethernet6/29/1#0:6:0:29#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA61T1:Ethernet1;str-sonic:Ethernet6/29/1 + + + ARISTA62T1:Ethernet1;str-sonic-lc06-ASIC00:Eth116 + + + EndItfKey + + Ethernet6/30/1#0:6:0:30#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA62T1:Ethernet1;str-sonic:Ethernet6/30/1 + + + ARISTA63T1:Ethernet1;str-sonic-lc06-ASIC00:Eth120 + + + EndItfKey + + Ethernet6/31/1#0:6:0:31#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA63T1:Ethernet1;str-sonic:Ethernet6/31/1 + + + ARISTA64T1:Ethernet1;str-sonic-lc06-ASIC00:Eth124 + + + EndItfKey + + Ethernet6/32/1#0:6:0:32#1 + + + StartItfKey + + Ethernet1#0:1:0:1#1 + + + ARISTA64T1:Ethernet1;str-sonic:Ethernet6/32/1 + + + + + + + + str-sonic-lc03 + + + FirmwareProfile + + SONiC-Sonic-400g-lc-sku-lc + + + ForwardingMethod + + VoQ + + + SlotIndex + + 3 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + True + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc03-ASIC00;str-sonic-lc03-ASIC01 + + + SiblingLineCards + + str-sonic-lc04;str-sonic-lc05;str-sonic-lc06;str-sonic-lc07;str-sonic-lc08;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc04 + + + FirmwareProfile + + SONiC-Sonic-lc-100g-sku-lc + + + ForwardingMethod + + VoQ + + + SlotIndex + + 4 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc04-ASIC00 + + + SiblingLineCards + + str-sonic-lc03;str-sonic-lc05;str-sonic-lc06;str-sonic-lc07;str-sonic-lc08;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc05 + + + FirmwareProfile + + SONiC-Sonic-lc-100g-sku-lc + + + ForwardingMethod + + VoQ + + + SlotIndex + + 5 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc05-ASIC00 + + + SiblingLineCards + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc06;str-sonic-lc07;str-sonic-lc08;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc07 + + + FirmwareProfile + + SONiC-Sonic-lc-100g-sku-lc + + + ForwardingMethod + + VoQ + + + SlotIndex + + 7 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc07-ASIC00 + + + SiblingLineCards + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc05;str-sonic-lc06;str-sonic-lc08;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc08 + + + FirmwareProfile + + SONiC-Sonic-lc-100g-sku-lc + + + ForwardingMethod + + VoQ + + + SlotIndex + + 8 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc08-ASIC00 + + + SiblingLineCards + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc05;str-sonic-lc06;str-sonic-lc07;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc09 + + + FirmwareProfile + + SONiC-Sonic-lc-100g-sku-lc + + + ForwardingMethod + + VoQ + + + SlotIndex + + 9 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc09-ASIC00 + + + SiblingLineCards + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc05;str-sonic-lc06;str-sonic-lc07;str-sonic-lc08;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc10 + + + FirmwareProfile + + SONiC-Sonic-lc-100g-sku-lc + + + ForwardingMethod + + VoQ + + + SlotIndex + + 10 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc10-ASIC00 + + + SiblingLineCards + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc05;str-sonic-lc06;str-sonic-lc07;str-sonic-lc08;str-sonic-lc09 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc06-ASIC00 + + + ForwardingMethod + + VoQ + + + SubRole + + FrontEnd + + + AsicSwitchId + + 20 + + + ProviderLineCard + + str-sonic-lc06 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-lc06 + + + FirmwareProfile + + SONiC-Sonic-lc-100g-sku-lc + + + ForwardingMethod + + VoQ + + + SlotIndex + + 6 + + + TotalCountOfVoQ + + 8 + + + MaxCountOfCores + + 64 + + + MacSecEnabled + + False + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-lc06-ASIC00 + + + SiblingLineCards + + str-sonic-lc03;str-sonic-lc04;str-sonic-lc05;str-sonic-lc07;str-sonic-lc08;str-sonic-lc09;str-sonic-lc10 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic + + + CloudType + + Public + + + ConfigDbAclFile + + SonicNativeAcl.liquid + + + ConfigTemplateFile + + Sonic.xml + + + DNSServers + + 10.64.5.5;10.64.6.6;10.64.6.7 + + + DcCode + + STR + + + DeploymentId + + 3 + + + EnableStreamingTelemetry + + true + + + ErspanDestinationIpv4 + + 10.20.6.4 + + + FirmwareProfile + + sonic-T2-profile + + + Function + + LabTest + + + Group + + str:542907040 + + + InitConfigTemplateFile + + Sonic.init.xml + + + Location + + TBD + + + Loopback0Ipv4 + + 10.2.0.1/32;10.2.0.2/32;10.2.0.3/32;10.2.0.4/32 + + + Loopback0Ipv6 + + fc00:20::1/128;fc00:21::1/128;fc00:22::1/128;fc00:23::1/128 + + + Loopback4096Ipv4 + + 192.0.0.1/32;192.0.0.2/32;192.0.0.8/32;192.0.0.9/32 + + + Loopback4096Ipv6 + + 2603:10e2:400::1/128;2603:10e2:400::2/128;2603:10e2:400::8/128;2603:10e2:400::9/128 + + + MacSecEnabled + + True + + + MacSecProfile + usstagee.Sonic.MacSec + PrimaryKey="macsec-profile-two" FallbackKey="macsec-profile" MacsecPolicy="" + + + ManagementIpv4 + + 10.3.146.58/24;10.3.146.71/24;10.3.146.72/24;10.3.146.74/24;10.3.146.75/24;10.3.146.80/24;10.3.146.81/24;10.3.146.83/24 + + + ManagementIpv6 + + 2a01:111:e210:3000::a03:923a/64;2a01:111:e210:3000::a03:9247/64;2a01:111:e210:3000::a03:9248/64;2a01:111:e210:3000::a03:924a/64;2a01:111:e210:3000::a03:924b/64;2a01:111:e210:3000::a03:9250/64;2a01:111:e210:3000::a03:9251/64;2a01:111:e210:3000::a03:9253/64 + + + MaxCountOfCores + + 64 + + + NtpResources + Public.Ntp + 17.39.1.130;17.39.1.129 + + + QosProfile + + VerlaineLongHaul + + + RemoteAuthenticationProtocol + + Tacacs + + + SnmpResources + + 10.52.180.161;10.3.157.12 + + + SonicConfigTemplateFile + + Sonic.xml + + + SonicEnabled + + True + + + SyslogResources + + 10.52.180.161;10.3.157.12 + + + SyslogServer + + 10.20.4.167;10.20.7.33;10.20.6.16;10.20.6.84 + + + TacacsKey + + $Secrets.TacacsKey + + + TacacsSecurityLevel + + 7 + + + TacacsServer + + 123.46.98.21 + + + TotalCountOfVoQ + + 8 + + + Region + + test + + + ChassisEnabled + + true + + + + + + + + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth384 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth178 + true + str-sonic-lc06-ASIC00 + Eth385 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth386 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth186 + true + str-sonic-lc06-ASIC00 + Eth387 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth186 + true + str-sonic-lc06-ASIC00 + Eth388 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth389 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth390 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth178 + true + str-sonic-lc06-ASIC00 + Eth391 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth151 + true + str-sonic-lc06-ASIC00 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth179 + true + str-sonic-lc06-ASIC00 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth168 + true + str-sonic-lc06-ASIC00 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth179 + true + str-sonic-lc06-ASIC00 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth164 + true + str-sonic-lc06-ASIC00 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth170 + true + str-sonic-lc06-ASIC00 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth181 + true + str-sonic-lc06-ASIC00 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth164 + true + str-sonic-lc06-ASIC00 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth160 + true + str-sonic-lc06-ASIC00 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth182 + true + str-sonic-lc06-ASIC00 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth160 + true + str-sonic-lc06-ASIC00 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth181 + true + str-sonic-lc06-ASIC00 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth177 + true + str-sonic-lc06-ASIC00 + Eth408 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth409 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth182 + true + str-sonic-lc06-ASIC00 + Eth410 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth411 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth412 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth177 + true + str-sonic-lc06-ASIC00 + Eth413 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth414 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth188 + true + str-sonic-lc06-ASIC00 + Eth415 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth178 + true + str-sonic-lc06-ASIC00 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth187 + true + str-sonic-lc06-ASIC00 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth188 + true + str-sonic-lc06-ASIC00 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth187 + true + str-sonic-lc06-ASIC00 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth178 + true + str-sonic-lc06-ASIC00 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth424 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth186 + true + str-sonic-lc06-ASIC00 + Eth425 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth426 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth427 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth170 + true + str-sonic-lc06-ASIC00 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth186 + true + str-sonic-lc06-ASIC00 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth179 + true + str-sonic-lc06-ASIC00 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth160 + true + str-sonic-lc06-ASIC00 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth151 + true + str-sonic-lc06-ASIC00 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth164 + true + str-sonic-lc06-ASIC00 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth179 + true + str-sonic-lc06-ASIC00 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth151 + true + str-sonic-lc06-ASIC00 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth160 + true + str-sonic-lc06-ASIC00 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth177 + true + str-sonic-lc06-ASIC00 + Eth440 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth188 + true + str-sonic-lc06-ASIC00 + Eth441 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth187 + true + str-sonic-lc06-ASIC00 + Eth442 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth443 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth182 + true + str-sonic-lc06-ASIC00 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth179 + true + str-sonic-lc06-ASIC00 + Eth448 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth160 + true + str-sonic-lc06-ASIC00 + Eth449 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth164 + true + str-sonic-lc06-ASIC00 + Eth450 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth181 + true + str-sonic-lc06-ASIC00 + Eth451 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth168 + true + str-sonic-lc06-ASIC00 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth151 + true + str-sonic-lc06-ASIC00 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth178 + true + str-sonic-lc06-ASIC00 + Eth472 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth473 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth186 + true + str-sonic-lc06-ASIC00 + Eth474 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth475 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth187 + true + str-sonic-lc06-ASIC00 + Eth476 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth479 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth177 + true + str-sonic-lc06-ASIC00 + Eth480 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth187 + true + str-sonic-lc06-ASIC00 + Eth481 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth182 + true + str-sonic-lc06-ASIC00 + Eth482 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth188 + true + str-sonic-lc06-ASIC00 + Eth483 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth188 + true + str-sonic-lc06-ASIC00 + Eth484 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth177 + true + str-sonic-lc06-ASIC00 + Eth485 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth182 + true + str-sonic-lc06-ASIC00 + Eth486 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth487 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth181 + true + str-sonic-lc06-ASIC00 + Eth488 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth489 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth490 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth491 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth492 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth164 + true + str-sonic-lc06-ASIC00 + Eth493 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth494 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth181 + true + str-sonic-lc06-ASIC00 + Eth495 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth0 + true + ARISTA33T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth4 + true + ARISTA33T1 + Ethernet2 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth8 + true + ARISTA35T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth12 + true + ARISTA35T1 + Ethernet2 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth16 + true + ARISTA37T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth20 + true + ARISTA37T1 + Ethernet2 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth24 + true + ARISTA39T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth28 + true + ARISTA39T1 + Ethernet2 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth32 + true + ARISTA41T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth36 + true + ARISTA41T1 + Ethernet2 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth40 + true + ARISTA43T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth44 + true + ARISTA43T1 + Ethernet2 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth48 + true + ARISTA45T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth52 + true + ARISTA47T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth56 + true + ARISTA47T1 + Ethernet2 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth60 + true + ARISTA49T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth64 + true + ARISTA50T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth68 + true + ARISTA50T1 + Ethernet2 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth72 + true + ARISTA51T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth76 + true + ARISTA52T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth80 + true + ARISTA53T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth84 + true + ARISTA54T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth88 + true + ARISTA55T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth92 + true + ARISTA56T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth96 + true + ARISTA57T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth100 + true + ARISTA58T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth104 + true + ARISTA59T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth108 + true + ARISTA60T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth112 + true + ARISTA61T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth116 + true + ARISTA62T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth120 + true + ARISTA63T1 + Ethernet1 + true + + + DeviceInterfaceLink + 100000 + true + str-sonic-lc06-ASIC00 + Eth124 + true + ARISTA64T1 + Ethernet1 + true + + + DeviceSerialLink + 9600 + true + str-sonic-sup00 + logical6 + true + str-sonic-lc06 + logical + true + 6 + + + + + LinecardAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc06-ASIC00 + Broadcom-Jericho2 +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC08 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC02 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC09 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC03 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC10 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC04 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC07 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC06 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC05 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC11 + Broadcom-Ramon +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.58/17 + + + ::/0 + + + + ARISTA33T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.59/17 + + + ::/0 + + + + ARISTA35T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.60/17 + + + ::/0 + + + + ARISTA37T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.61/17 + + + ::/0 + + + + ARISTA39T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.62/17 + + + ::/0 + + + + ARISTA41T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.63/17 + + + ::/0 + + + + ARISTA43T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.64/17 + + + ::/0 + + + + ARISTA45T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.65/17 + + + ::/0 + + + + ARISTA47T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.66/17 + + + ::/0 + + + + ARISTA49T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.67/17 + + + ::/0 + + + + ARISTA50T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.68/17 + + + ::/0 + + + + ARISTA51T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.69/17 + + + ::/0 + + + + ARISTA52T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.70/17 + + + ::/0 + + + + ARISTA53T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.71/17 + + + ::/0 + + + + ARISTA54T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.72/17 + + + ::/0 + + + + ARISTA55T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.73/17 + + + ::/0 + + + + ARISTA56T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.74/17 + + + ::/0 + + + + ARISTA57T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.75/17 + + + ::/0 + + + + ARISTA58T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.76/17 + + + ::/0 + + + + ARISTA59T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.77/17 + + + ::/0 + + + + ARISTA60T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.78/17 + + + ::/0 + + + + ARISTA61T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.79/17 + + + ::/0 + + + + ARISTA62T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.80/17 + + + ::/0 + + + + ARISTA63T1 + Sonic-T1-sku +
+ + LeafRouter +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 172.16.191.81/17 + + + ::/0 + + + + ARISTA64T1 + Sonic-T1-sku +
+ + Linecard +
+ 10.2.0.4/32 +
+ + fc00:23::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.74/24 + + + 2a01:111:e210:3000::a03:924a/64 + + + + str-sonic-lc06 + Sonic-lc-100g-sku +
+ + Supervisor +
+ 10.152.0.46/32 +
+ + 2a01:111:e210:5e::/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.111/24 + + + 2a01:111:e210:3000::a03:926f/64 + + + + str-sonic-sup00 + Sonic-sup-sku +
+ + SpineRouter +
+ 10.152.0.46/32 +
+ + 2a01:111:e210:5e::/128 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.111/24 + + + 2a01:111:e210:3000::a03:926f/64 + + + + str-sonic + Sonic-Chassis-sku + 0 +
+
+
+ str-sonic-lc06 + Sonic-lc-100g-sku + 1.0.1388.35294 + +
diff --git a/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_sup.xml b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_sup.xml new file mode 100644 index 000000000000..1b4599924374 --- /dev/null +++ b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_sup.xml @@ -0,0 +1,52726 @@ + + + + + + + + + + + + + + + DeviceInterface + + true + 1 + cpu3/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 2 + cpu3/1 + false + + cpu1 + 10000 + + + + + DeviceInterface + + true + 3 + Recirc3/0/0 + false + + Ethernet-Rec0 + 10000 + + + + + DeviceInterface + + true + 4 + Recirc3/1/0 + false + + Ethernet-Rec1 + 10000 + + + + + DeviceInterface + + true + 5 + Recirc3/0/1 + false + + Ethernet-IB0 + 10000 + + + + + DeviceInterface + + true + 6 + Recirc3/1/1 + false + + Ethernet-IB1 + 10000 + + + + + DeviceInterface + + true + 7 + cpu4/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 8 + Recirc4/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 9 + Recirc4/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 10 + cpu5/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 11 + Recirc5/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 12 + Recirc5/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 13 + cpu6/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 14 + Recirc6/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 15 + Recirc6/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 16 + cpu7/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 17 + Recirc7/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 18 + Recirc7/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 19 + cpu8/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 20 + Recirc8/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 21 + Recirc8/0/1 + false + + Ethernet-IB0 + 400000 + + + + + DeviceInterface + + true + 22 + cpu10/0 + false + + cpu0 + 10000 + + + + + DeviceInterface + + true + 23 + Recirc10/0/0 + false + + Ethernet-Rec0 + 400000 + + + + + DeviceInterface + + true + 24 + Recirc10/0/1 + false + + Ethernet-IB0 + 400000 + + + + + Sonic-T2-Base-sku + + + + DeviceInterface + 100000 + true + 1 + Ethernet3/1/1 + false + + Ethernet0 + 400000 + + + DeviceInterface + 100000 + true + 2 + Ethernet3/2/1 + false + + Ethernet8 + 400000 + + + DeviceInterface + 100000 + true + 3 + Ethernet3/3/1 + false + + Ethernet16 + 400000 + + + DeviceInterface + 100000 + true + 4 + Ethernet3/4/1 + false + + Ethernet24 + 400000 + + + DeviceInterface + 100000 + true + 5 + Ethernet3/5/1 + false + + Ethernet32 + 400000 + + + DeviceInterface + 100000 + true + 6 + Ethernet3/6/1 + false + + Ethernet40 + 400000 + + + DeviceInterface + 100000 + true + 7 + Ethernet3/7/1 + false + + Ethernet48 + 400000 + + + DeviceInterface + 100000 + true + 8 + Ethernet3/8/1 + false + + Ethernet56 + 400000 + + + DeviceInterface + 100000 + true + 9 + Ethernet3/9/1 + false + + Ethernet64 + 400000 + + + DeviceInterface + 100000 + true + 10 + Ethernet3/10/1 + false + + Ethernet72 + 400000 + + + DeviceInterface + 100000 + true + 11 + Ethernet3/11/1 + false + + Ethernet80 + 400000 + + + DeviceInterface + 100000 + true + 12 + Ethernet3/12/1 + false + + Ethernet88 + 400000 + + + DeviceInterface + 100000 + true + 13 + Ethernet3/13/1 + false + + Ethernet96 + 400000 + + + DeviceInterface + 100000 + true + 14 + Ethernet3/14/1 + false + + Ethernet104 + 400000 + + + DeviceInterface + 100000 + true + 15 + Ethernet3/15/1 + false + + Ethernet112 + 400000 + + + DeviceInterface + 100000 + true + 16 + Ethernet3/16/1 + false + + Ethernet120 + 400000 + + + DeviceInterface + 100000 + true + 17 + Ethernet3/17/1 + false + + Ethernet128 + 400000 + + + DeviceInterface + 100000 + true + 18 + Ethernet3/18/1 + false + + Ethernet136 + 400000 + + + DeviceInterface + 100000 + true + 19 + Ethernet3/19/1 + false + + Ethernet144 + 400000 + + + DeviceInterface + 100000 + true + 20 + Ethernet3/20/1 + false + + Ethernet152 + 400000 + + + DeviceInterface + 100000 + true + 21 + Ethernet3/21/1 + false + + Ethernet160 + 400000 + + + DeviceInterface + 100000 + true + 22 + Ethernet3/22/1 + false + + Ethernet168 + 400000 + + + DeviceInterface + 100000 + true + 23 + Ethernet3/23/1 + false + + Ethernet176 + 400000 + + + DeviceInterface + 100000 + true + 24 + Ethernet3/24/1 + false + + Ethernet184 + 400000 + + + DeviceInterface + 100000 + true + 25 + Ethernet3/25/1 + false + + Ethernet192 + 400000 + + + DeviceInterface + 100000 + true + 26 + Ethernet3/26/1 + false + + Ethernet200 + 400000 + + + DeviceInterface + 100000 + true + 27 + Ethernet3/27/1 + false + + Ethernet208 + 400000 + + + DeviceInterface + 100000 + true + 28 + Ethernet3/28/1 + false + + Ethernet216 + 400000 + + + DeviceInterface + 100000 + true + 29 + Ethernet3/29/1 + false + + Ethernet224 + 400000 + + + DeviceInterface + 100000 + true + 30 + Ethernet3/30/1 + false + + Ethernet232 + 400000 + + + DeviceInterface + 100000 + true + 31 + Ethernet3/31/1 + false + + Ethernet240 + 400000 + + + DeviceInterface + 100000 + true + 32 + Ethernet3/32/1 + false + + Ethernet248 + 400000 + + + DeviceInterface + 100000 + true + 33 + Ethernet3/33/1 + false + + Ethernet256 + 400000 + + + DeviceInterface + 100000 + true + 34 + Ethernet3/34/1 + false + + Ethernet264 + 400000 + + + DeviceInterface + 100000 + true + 35 + Ethernet3/35/1 + false + + Ethernet272 + 400000 + + + DeviceInterface + 100000 + true + 36 + Ethernet3/36/1 + false + + Ethernet280 + 400000 + + + DeviceInterface + 40000 + true + 37 + Ethernet4/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 38 + Ethernet4/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 39 + Ethernet4/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 40 + Ethernet4/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 41 + Ethernet4/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 42 + Ethernet4/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 43 + Ethernet4/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 44 + Ethernet4/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 45 + Ethernet4/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 46 + Ethernet4/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 47 + Ethernet4/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 48 + Ethernet4/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 49 + Ethernet4/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 50 + Ethernet4/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 51 + Ethernet4/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 52 + Ethernet4/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 53 + Ethernet4/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 54 + Ethernet4/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 55 + Ethernet4/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 56 + Ethernet4/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 57 + Ethernet4/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 58 + Ethernet4/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 59 + Ethernet4/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 60 + Ethernet4/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 61 + Ethernet4/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 62 + Ethernet4/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 63 + Ethernet4/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 64 + Ethernet4/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 65 + Ethernet4/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 66 + Ethernet4/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 67 + Ethernet4/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 68 + Ethernet4/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 69 + Ethernet4/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 70 + Ethernet4/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 71 + Ethernet4/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 72 + Ethernet4/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 73 + Ethernet4/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 74 + Ethernet4/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 75 + Ethernet4/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 76 + Ethernet4/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 77 + Ethernet4/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 78 + Ethernet4/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 79 + Ethernet4/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 80 + Ethernet4/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 81 + Ethernet4/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 82 + Ethernet4/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 83 + Ethernet4/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 84 + Ethernet4/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 85 + Ethernet5/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 86 + Ethernet5/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 87 + Ethernet5/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 88 + Ethernet5/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 89 + Ethernet5/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 90 + Ethernet5/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 91 + Ethernet5/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 92 + Ethernet5/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 93 + Ethernet5/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 94 + Ethernet5/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 95 + Ethernet5/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 96 + Ethernet5/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 97 + Ethernet5/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 98 + Ethernet5/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 99 + Ethernet5/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 100 + Ethernet5/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 101 + Ethernet5/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 102 + Ethernet5/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 103 + Ethernet5/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 104 + Ethernet5/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 105 + Ethernet5/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 106 + Ethernet5/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 107 + Ethernet5/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 108 + Ethernet5/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 109 + Ethernet5/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 110 + Ethernet5/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 111 + Ethernet5/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 112 + Ethernet5/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 113 + Ethernet5/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 114 + Ethernet5/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 115 + Ethernet5/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 116 + Ethernet5/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 117 + Ethernet5/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 118 + Ethernet5/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 119 + Ethernet5/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 120 + Ethernet5/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 121 + Ethernet5/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 122 + Ethernet5/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 123 + Ethernet5/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 124 + Ethernet5/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 125 + Ethernet5/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 126 + Ethernet5/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 127 + Ethernet5/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 128 + Ethernet5/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 129 + Ethernet5/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 130 + Ethernet5/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 131 + Ethernet5/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 132 + Ethernet5/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 133 + Ethernet6/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 134 + Ethernet6/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 135 + Ethernet6/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 136 + Ethernet6/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 137 + Ethernet6/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 138 + Ethernet6/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 139 + Ethernet6/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 140 + Ethernet6/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 141 + Ethernet6/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 142 + Ethernet6/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 143 + Ethernet6/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 144 + Ethernet6/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 145 + Ethernet6/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 146 + Ethernet6/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 147 + Ethernet6/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 148 + Ethernet6/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 149 + Ethernet6/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 150 + Ethernet6/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 151 + Ethernet6/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 152 + Ethernet6/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 153 + Ethernet6/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 154 + Ethernet6/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 155 + Ethernet6/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 156 + Ethernet6/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 157 + Ethernet6/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 158 + Ethernet6/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 159 + Ethernet6/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 160 + Ethernet6/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 161 + Ethernet6/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 162 + Ethernet6/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 163 + Ethernet6/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 164 + Ethernet6/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 165 + Ethernet6/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 166 + Ethernet6/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 167 + Ethernet6/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 168 + Ethernet6/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 169 + Ethernet6/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 170 + Ethernet6/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 171 + Ethernet6/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 172 + Ethernet6/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 173 + Ethernet6/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 174 + Ethernet6/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 175 + Ethernet6/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 176 + Ethernet6/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 177 + Ethernet6/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 178 + Ethernet6/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 179 + Ethernet6/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 180 + Ethernet6/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 181 + Ethernet7/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 182 + Ethernet7/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 183 + Ethernet7/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 184 + Ethernet7/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 185 + Ethernet7/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 186 + Ethernet7/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 187 + Ethernet7/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 188 + Ethernet7/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 189 + Ethernet7/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 190 + Ethernet7/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 191 + Ethernet7/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 192 + Ethernet7/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 193 + Ethernet7/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 194 + Ethernet7/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 195 + Ethernet7/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 196 + Ethernet7/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 197 + Ethernet7/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 198 + Ethernet7/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 199 + Ethernet7/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 200 + Ethernet7/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 201 + Ethernet7/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 202 + Ethernet7/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 203 + Ethernet7/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 204 + Ethernet7/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 205 + Ethernet7/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 206 + Ethernet7/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 207 + Ethernet7/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 208 + Ethernet7/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 209 + Ethernet7/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 210 + Ethernet7/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 211 + Ethernet7/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 212 + Ethernet7/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 213 + Ethernet7/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 214 + Ethernet7/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 215 + Ethernet7/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 216 + Ethernet7/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 217 + Ethernet7/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 218 + Ethernet7/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 219 + Ethernet7/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 220 + Ethernet7/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 221 + Ethernet7/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 222 + Ethernet7/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 223 + Ethernet7/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 224 + Ethernet7/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 225 + Ethernet7/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 226 + Ethernet7/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 227 + Ethernet7/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 228 + Ethernet7/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 229 + Ethernet8/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 230 + Ethernet8/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 231 + Ethernet8/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 232 + Ethernet8/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 233 + Ethernet8/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 234 + Ethernet8/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 235 + Ethernet8/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 236 + Ethernet8/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 237 + Ethernet8/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 238 + Ethernet8/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 239 + Ethernet8/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 240 + Ethernet8/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 241 + Ethernet8/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 242 + Ethernet8/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 243 + Ethernet8/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 244 + Ethernet8/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 245 + Ethernet8/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 246 + Ethernet8/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 247 + Ethernet8/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 248 + Ethernet8/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 249 + Ethernet8/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 250 + Ethernet8/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 251 + Ethernet8/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 252 + Ethernet8/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 253 + Ethernet8/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 254 + Ethernet8/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 255 + Ethernet8/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 256 + Ethernet8/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 257 + Ethernet8/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 258 + Ethernet8/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 259 + Ethernet8/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 260 + Ethernet8/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 261 + Ethernet8/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 262 + Ethernet8/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 263 + Ethernet8/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 264 + Ethernet8/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 265 + Ethernet8/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 266 + Ethernet8/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 267 + Ethernet8/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 268 + Ethernet8/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 269 + Ethernet8/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 270 + Ethernet8/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 271 + Ethernet8/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 272 + Ethernet8/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 273 + Ethernet8/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 274 + Ethernet8/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 275 + Ethernet8/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 276 + Ethernet8/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 277 + Ethernet9/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 278 + Ethernet9/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 279 + Ethernet9/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 280 + Ethernet9/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 281 + Ethernet9/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 282 + Ethernet9/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 283 + Ethernet9/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 284 + Ethernet9/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 285 + Ethernet9/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 286 + Ethernet9/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 287 + Ethernet9/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 288 + Ethernet9/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 289 + Ethernet9/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 290 + Ethernet9/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 291 + Ethernet9/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 292 + Ethernet9/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 293 + Ethernet9/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 294 + Ethernet9/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 295 + Ethernet9/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 296 + Ethernet9/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 297 + Ethernet9/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 298 + Ethernet9/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 299 + Ethernet9/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 300 + Ethernet9/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 301 + Ethernet9/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 302 + Ethernet9/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 303 + Ethernet9/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 304 + Ethernet9/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 305 + Ethernet9/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 306 + Ethernet9/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 307 + Ethernet9/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 308 + Ethernet9/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 309 + Ethernet9/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 310 + Ethernet9/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 311 + Ethernet9/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 312 + Ethernet9/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 313 + Ethernet9/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 314 + Ethernet9/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 315 + Ethernet9/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 316 + Ethernet9/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 317 + Ethernet9/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 318 + Ethernet9/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 319 + Ethernet9/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 320 + Ethernet9/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 321 + Ethernet9/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 322 + Ethernet9/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 323 + Ethernet9/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 324 + Ethernet9/48/1 + false + + Ethernet188 + 100000 + + + DeviceInterface + 40000 + true + 325 + Ethernet10/1/1 + false + + Ethernet0 + 100000 + + + DeviceInterface + 40000 + true + 326 + Ethernet10/2/1 + false + + Ethernet4 + 100000 + + + DeviceInterface + 40000 + true + 327 + Ethernet10/3/1 + false + + Ethernet8 + 100000 + + + DeviceInterface + 40000 + true + 328 + Ethernet10/4/1 + false + + Ethernet12 + 100000 + + + DeviceInterface + 40000 + true + 329 + Ethernet10/5/1 + false + + Ethernet16 + 100000 + + + DeviceInterface + 40000 + true + 330 + Ethernet10/6/1 + false + + Ethernet20 + 100000 + + + DeviceInterface + 40000 + true + 331 + Ethernet10/7/1 + false + + Ethernet24 + 100000 + + + DeviceInterface + 40000 + true + 332 + Ethernet10/8/1 + false + + Ethernet28 + 100000 + + + DeviceInterface + 40000 + true + 333 + Ethernet10/9/1 + false + + Ethernet32 + 100000 + + + DeviceInterface + 40000 + true + 334 + Ethernet10/10/1 + false + + Ethernet36 + 100000 + + + DeviceInterface + 40000 + true + 335 + Ethernet10/11/1 + false + + Ethernet40 + 100000 + + + DeviceInterface + 40000 + true + 336 + Ethernet10/12/1 + false + + Ethernet44 + 100000 + + + DeviceInterface + 40000 + true + 337 + Ethernet10/13/1 + false + + Ethernet48 + 100000 + + + DeviceInterface + 40000 + true + 338 + Ethernet10/14/1 + false + + Ethernet52 + 100000 + + + DeviceInterface + 40000 + true + 339 + Ethernet10/15/1 + false + + Ethernet56 + 100000 + + + DeviceInterface + 40000 + true + 340 + Ethernet10/16/1 + false + + Ethernet60 + 100000 + + + DeviceInterface + 40000 + true + 341 + Ethernet10/17/1 + false + + Ethernet64 + 100000 + + + DeviceInterface + 40000 + true + 342 + Ethernet10/18/1 + false + + Ethernet68 + 100000 + + + DeviceInterface + 40000 + true + 343 + Ethernet10/19/1 + false + + Ethernet72 + 100000 + + + DeviceInterface + 40000 + true + 344 + Ethernet10/20/1 + false + + Ethernet76 + 100000 + + + DeviceInterface + 40000 + true + 345 + Ethernet10/21/1 + false + + Ethernet80 + 100000 + + + DeviceInterface + 40000 + true + 346 + Ethernet10/22/1 + false + + Ethernet84 + 100000 + + + DeviceInterface + 40000 + true + 347 + Ethernet10/23/1 + false + + Ethernet88 + 100000 + + + DeviceInterface + 40000 + true + 348 + Ethernet10/24/1 + false + + Ethernet92 + 100000 + + + DeviceInterface + 40000 + true + 349 + Ethernet10/25/1 + false + + Ethernet96 + 100000 + + + DeviceInterface + 40000 + true + 350 + Ethernet10/26/1 + false + + Ethernet100 + 100000 + + + DeviceInterface + 40000 + true + 351 + Ethernet10/27/1 + false + + Ethernet104 + 100000 + + + DeviceInterface + 40000 + true + 352 + Ethernet10/28/1 + false + + Ethernet108 + 100000 + + + DeviceInterface + 40000 + true + 353 + Ethernet10/29/1 + false + + Ethernet112 + 100000 + + + DeviceInterface + 40000 + true + 354 + Ethernet10/30/1 + false + + Ethernet116 + 100000 + + + DeviceInterface + 40000 + true + 355 + Ethernet10/31/1 + false + + Ethernet120 + 100000 + + + DeviceInterface + 40000 + true + 356 + Ethernet10/32/1 + false + + Ethernet124 + 100000 + + + DeviceInterface + 40000 + true + 357 + Ethernet10/33/1 + false + + Ethernet128 + 100000 + + + DeviceInterface + 40000 + true + 358 + Ethernet10/34/1 + false + + Ethernet132 + 100000 + + + DeviceInterface + 40000 + true + 359 + Ethernet10/35/1 + false + + Ethernet136 + 100000 + + + DeviceInterface + 40000 + true + 360 + Ethernet10/36/1 + false + + Ethernet140 + 100000 + + + DeviceInterface + 40000 + true + 361 + Ethernet10/37/1 + false + + Ethernet144 + 100000 + + + DeviceInterface + 40000 + true + 362 + Ethernet10/38/1 + false + + Ethernet148 + 100000 + + + DeviceInterface + 40000 + true + 363 + Ethernet10/39/1 + false + + Ethernet152 + 100000 + + + DeviceInterface + 40000 + true + 364 + Ethernet10/40/1 + false + + Ethernet156 + 100000 + + + DeviceInterface + 40000 + true + 365 + Ethernet10/41/1 + false + + Ethernet160 + 100000 + + + DeviceInterface + 40000 + true + 366 + Ethernet10/42/1 + false + + Ethernet164 + 100000 + + + DeviceInterface + 40000 + true + 367 + Ethernet10/43/1 + false + + Ethernet168 + 100000 + + + DeviceInterface + 40000 + true + 368 + Ethernet10/44/1 + false + + Ethernet172 + 100000 + + + DeviceInterface + 40000 + true + 369 + Ethernet10/45/1 + false + + Ethernet176 + 100000 + + + DeviceInterface + 40000 + true + 370 + Ethernet10/46/1 + false + + Ethernet180 + 100000 + + + DeviceInterface + 40000 + true + 371 + Ethernet10/47/1 + false + + Ethernet184 + 100000 + + + DeviceInterface + 40000 + true + 372 + Ethernet10/48/1 + false + + Ethernet188 + 100000 + + + true + 0 + Sonic-T2-sku + + + + Ethernet3/1/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:3:0:1 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + Ethernet3/2/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:3:0:2 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + Ethernet3/3/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:3:0:3 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + Ethernet3/4/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:3:0:4 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + Ethernet3/5/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:3:0:5 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + Ethernet3/6/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:3:0:6 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + Ethernet3/7/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:3:0:7 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + Ethernet3/8/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:3:0:8 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + Ethernet3/9/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:3:0:9 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + Ethernet3/10/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:3:0:10 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet3/11/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:3:0:11 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet3/12/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:3:0:12 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet3/13/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:3:0:13 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet3/14/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:3:0:14 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet3/15/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:3:0:15 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet3/16/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:3:0:16 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet3/17/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:3:0:17 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet3/18/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:3:0:18 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet3/19/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:3:0:19 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 1 + + + CoreId + 1 + + + + + Ethernet3/20/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:3:0:20 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 2 + + + CoreId + 1 + + + + + Ethernet3/21/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:3:0:21 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 3 + + + CoreId + 1 + + + + + Ethernet3/22/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:3:0:22 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 4 + + + CoreId + 1 + + + + + Ethernet3/23/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:3:0:23 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 5 + + + CoreId + 1 + + + + + Ethernet3/24/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:3:0:24 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 6 + + + CoreId + 1 + + + + + Ethernet3/25/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:3:0:25 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 7 + + + CoreId + 1 + + + + + Ethernet3/26/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:3:0:26 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 8 + + + CoreId + 1 + + + + + Ethernet3/27/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:3:0:27 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 9 + + + CoreId + 1 + + + + + Ethernet3/28/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:3:0:28 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet3/29/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:3:0:29 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet3/30/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:3:0:30 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet3/31/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:3:0:31 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet3/32/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:3:0:32 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet3/33/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:3:0:33 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet3/34/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:3:0:34 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet3/35/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:3:0:35 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet3/36/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:3:0:36 + + + InterfaceSubGroupIndex + 1 + + + MacSecEnabled + True + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + cpu3/0 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:3:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + cpu3/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:3:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Recirc3/0/0 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:3:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Recirc3/1/0 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:3:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 8 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Recirc3/0/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:3:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 19 + + + CoreId + 1 + + + + + Recirc3/1/1 + + + LineCardSku + Sonic-400G-sku + + + SlotIndex + 3 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:3:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC1 + + + AsicSwitchId + 9 + + + AsicInterfaceIndex + 19 + + + CoreId + 1 + + + + + Ethernet4/1/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:4:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet4/2/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:4:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet4/3/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:4:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet4/4/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:4:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet4/5/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:4:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet4/6/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:4:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet4/7/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:4:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet4/8/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:4:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet4/9/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:4:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet4/10/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:4:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet4/11/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:4:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet4/12/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:4:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet4/13/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:4:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet4/14/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:4:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet4/15/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:4:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet4/16/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:4:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet4/17/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:4:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet4/18/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:4:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet4/19/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:4:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet4/20/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:4:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet4/21/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:4:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet4/22/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:4:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet4/23/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:4:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet4/24/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:4:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet4/25/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:4:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet4/26/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:4:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet4/27/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:4:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet4/28/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:4:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet4/29/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:4:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet4/30/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:4:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet4/31/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:4:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet4/32/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:4:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet4/33/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:4:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet4/34/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:4:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet4/35/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:4:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet4/36/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:4:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet4/37/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:4:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet4/38/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:4:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet4/39/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:4:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet4/40/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:4:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet4/41/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:4:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet4/42/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:4:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet4/43/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:4:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet4/44/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:4:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet4/45/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:4:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet4/46/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:4:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet4/47/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:4:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet4/48/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:4:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu4/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:4:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc4/0/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:4:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc4/0/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 4 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:4:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 12 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet5/1/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:5:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet5/2/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:5:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet5/3/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:5:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet5/4/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:5:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet5/5/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:5:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet5/6/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:5:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet5/7/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:5:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet5/8/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:5:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet5/9/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:5:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet5/10/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:5:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet5/11/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:5:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet5/12/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:5:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet5/13/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:5:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet5/14/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:5:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet5/15/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:5:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet5/16/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:5:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet5/17/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:5:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet5/18/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:5:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet5/19/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:5:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet5/20/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:5:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet5/21/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:5:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet5/22/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:5:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet5/23/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:5:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet5/24/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:5:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet5/25/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:5:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet5/26/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:5:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet5/27/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:5:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet5/28/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:5:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet5/29/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:5:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet5/30/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:5:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet5/31/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:5:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet5/32/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:5:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet5/33/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:5:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet5/34/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:5:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet5/35/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:5:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet5/36/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:5:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet5/37/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:5:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet5/38/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:5:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet5/39/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:5:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet5/40/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:5:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet5/41/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:5:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet5/42/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:5:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet5/43/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:5:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet5/44/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:5:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet5/45/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:5:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet5/46/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:5:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet5/47/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:5:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet5/48/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:5:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu5/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:5:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc5/0/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:5:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc5/0/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 5 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:5:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 16 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet6/1/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:6:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet6/2/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:6:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet6/3/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:6:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet6/4/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:6:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet6/5/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:6:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet6/6/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:6:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet6/7/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:6:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet6/8/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:6:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet6/9/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:6:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet6/10/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:6:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet6/11/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:6:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet6/12/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:6:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet6/13/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:6:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet6/14/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:6:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet6/15/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:6:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet6/16/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:6:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet6/17/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:6:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet6/18/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:6:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet6/19/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:6:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet6/20/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:6:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet6/21/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:6:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet6/22/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:6:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet6/23/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:6:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet6/24/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:6:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet6/25/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:6:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet6/26/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:6:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet6/27/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:6:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet6/28/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:6:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet6/29/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:6:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet6/30/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:6:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet6/31/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:6:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet6/32/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:6:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet6/33/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:6:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet6/34/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:6:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet6/35/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:6:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet6/36/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:6:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet6/37/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:6:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet6/38/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:6:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet6/39/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:6:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet6/40/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:6:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet6/41/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:6:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet6/42/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:6:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet6/43/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:6:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet6/44/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:6:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet6/45/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:6:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet6/46/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:6:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet6/47/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:6:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet6/48/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:6:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu6/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:6:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc6/0/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:6:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc6/0/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 6 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:6:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 20 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet7/1/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:7:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet7/2/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:7:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet7/3/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:7:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet7/4/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:7:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet7/5/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:7:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet7/6/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:7:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet7/7/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:7:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet7/8/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:7:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet7/9/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:7:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet7/10/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:7:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet7/11/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:7:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet7/12/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:7:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet7/13/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:7:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet7/14/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:7:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet7/15/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:7:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet7/16/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:7:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet7/17/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:7:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet7/18/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:7:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet7/19/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:7:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet7/20/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:7:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet7/21/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:7:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet7/22/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:7:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet7/23/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:7:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet7/24/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:7:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet7/25/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:7:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet7/26/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:7:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet7/27/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:7:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet7/28/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:7:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet7/29/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:7:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet7/30/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:7:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet7/31/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:7:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet7/32/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:7:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet7/33/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:7:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet7/34/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:7:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet7/35/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:7:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet7/36/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:7:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet7/37/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:7:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet7/38/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:7:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet7/39/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:7:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet7/40/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:7:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet7/41/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:7:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet7/42/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:7:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet7/43/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:7:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet7/44/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:7:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet7/45/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:7:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet7/46/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:7:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet7/47/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:7:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet7/48/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:7:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu7/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:7:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc7/0/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:7:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc7/0/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 7 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:7:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 24 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet8/1/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:8:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet8/2/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:8:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet8/3/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:8:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet8/4/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:8:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet8/5/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:8:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet8/6/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:8:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet8/7/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:8:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet8/8/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:8:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet8/9/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:8:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet8/10/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:8:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet8/11/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:8:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet8/12/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:8:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet8/13/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:8:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet8/14/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:8:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet8/15/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:8:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet8/16/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:8:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet8/17/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:8:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet8/18/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:8:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet8/19/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:8:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet8/20/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:8:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet8/21/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:8:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet8/22/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:8:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet8/23/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:8:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet8/24/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:8:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet8/25/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:8:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet8/26/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:8:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet8/27/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:8:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet8/28/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:8:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet8/29/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:8:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet8/30/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:8:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet8/31/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:8:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet8/32/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:8:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet8/33/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:8:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet8/34/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:8:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet8/35/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:8:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet8/36/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:8:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet8/37/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:8:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet8/38/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:8:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet8/39/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:8:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet8/40/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:8:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet8/41/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:8:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet8/42/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:8:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet8/43/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:8:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet8/44/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:8:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet8/45/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:8:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet8/46/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:8:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet8/47/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:8:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet8/48/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:8:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu8/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:8:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc8/0/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:8:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc8/0/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 8 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:8:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 28 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + Ethernet9/1/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:9:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet9/2/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:9:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet9/3/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:9:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet9/4/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:9:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet9/5/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:9:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet9/6/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:9:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet9/7/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:9:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet9/8/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:9:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet9/9/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:9:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet9/10/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:9:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet9/11/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:9:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet9/12/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:9:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet9/13/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:9:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet9/14/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:9:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet9/15/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:9:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet9/16/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:9:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet9/17/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:9:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet9/18/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:9:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet9/19/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:9:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet9/20/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:9:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet9/21/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:9:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet9/22/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:9:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet9/23/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:9:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet9/24/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:9:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet9/25/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:9:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet9/26/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:9:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet9/27/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:9:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet9/28/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:9:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet9/29/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:9:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet9/30/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:9:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet9/31/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:9:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet9/32/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:9:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet9/33/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:9:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet9/34/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:9:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet9/35/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:9:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet9/36/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:9:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet9/37/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:9:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet9/38/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:9:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet9/39/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:9:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet9/40/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:9:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet9/41/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:9:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet9/42/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:9:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet9/43/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:9:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet9/44/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:9:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet9/45/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:9:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet9/46/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:9:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet9/47/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:9:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet9/48/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 9 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:9:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 32 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + Ethernet10/1/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 1 + + + InterfaceGroupIndex + 0:10:0:1 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 1 + + + CoreId + 0 + + + + + Ethernet10/2/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 2 + + + InterfaceGroupIndex + 0:10:0:2 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 2 + + + CoreId + 0 + + + + + Ethernet10/3/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 3 + + + InterfaceGroupIndex + 0:10:0:3 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 3 + + + CoreId + 0 + + + + + Ethernet10/4/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 4 + + + InterfaceGroupIndex + 0:10:0:4 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 4 + + + CoreId + 0 + + + + + Ethernet10/5/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 5 + + + InterfaceGroupIndex + 0:10:0:5 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 5 + + + CoreId + 0 + + + + + Ethernet10/6/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 6 + + + InterfaceGroupIndex + 0:10:0:6 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 6 + + + CoreId + 0 + + + + + Ethernet10/7/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 7 + + + InterfaceGroupIndex + 0:10:0:7 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 7 + + + CoreId + 0 + + + + + Ethernet10/8/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 8 + + + InterfaceGroupIndex + 0:10:0:8 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 8 + + + CoreId + 0 + + + + + Ethernet10/9/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 9 + + + InterfaceGroupIndex + 0:10:0:9 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 9 + + + CoreId + 0 + + + + + Ethernet10/10/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 10 + + + InterfaceGroupIndex + 0:10:0:10 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 10 + + + CoreId + 0 + + + + + Ethernet10/11/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 11 + + + InterfaceGroupIndex + 0:10:0:11 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 11 + + + CoreId + 0 + + + + + Ethernet10/12/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 12 + + + InterfaceGroupIndex + 0:10:0:12 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 12 + + + CoreId + 0 + + + + + Ethernet10/13/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 13 + + + InterfaceGroupIndex + 0:10:0:13 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 13 + + + CoreId + 0 + + + + + Ethernet10/14/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 14 + + + InterfaceGroupIndex + 0:10:0:14 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 14 + + + CoreId + 0 + + + + + Ethernet10/15/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 15 + + + InterfaceGroupIndex + 0:10:0:15 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 15 + + + CoreId + 0 + + + + + Ethernet10/16/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 16 + + + InterfaceGroupIndex + 0:10:0:16 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 16 + + + CoreId + 0 + + + + + Ethernet10/17/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 17 + + + InterfaceGroupIndex + 0:10:0:17 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 17 + + + CoreId + 0 + + + + + Ethernet10/18/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 18 + + + InterfaceGroupIndex + 0:10:0:18 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 18 + + + CoreId + 0 + + + + + Ethernet10/19/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 19 + + + InterfaceGroupIndex + 0:10:0:19 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 19 + + + CoreId + 0 + + + + + Ethernet10/20/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 20 + + + InterfaceGroupIndex + 0:10:0:20 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 20 + + + CoreId + 0 + + + + + Ethernet10/21/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 21 + + + InterfaceGroupIndex + 0:10:0:21 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 21 + + + CoreId + 0 + + + + + Ethernet10/22/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 22 + + + InterfaceGroupIndex + 0:10:0:22 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 22 + + + CoreId + 0 + + + + + Ethernet10/23/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 23 + + + InterfaceGroupIndex + 0:10:0:23 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 23 + + + CoreId + 0 + + + + + Ethernet10/24/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 24 + + + InterfaceGroupIndex + 0:10:0:24 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 24 + + + CoreId + 0 + + + + + Ethernet10/25/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 25 + + + InterfaceGroupIndex + 0:10:0:25 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 25 + + + CoreId + 1 + + + + + Ethernet10/26/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 26 + + + InterfaceGroupIndex + 0:10:0:26 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 26 + + + CoreId + 1 + + + + + Ethernet10/27/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 27 + + + InterfaceGroupIndex + 0:10:0:27 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 27 + + + CoreId + 1 + + + + + Ethernet10/28/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 28 + + + InterfaceGroupIndex + 0:10:0:28 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 28 + + + CoreId + 1 + + + + + Ethernet10/29/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 29 + + + InterfaceGroupIndex + 0:10:0:29 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 29 + + + CoreId + 1 + + + + + Ethernet10/30/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 30 + + + InterfaceGroupIndex + 0:10:0:30 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 30 + + + CoreId + 1 + + + + + Ethernet10/31/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 31 + + + InterfaceGroupIndex + 0:10:0:31 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 31 + + + CoreId + 1 + + + + + Ethernet10/32/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 32 + + + InterfaceGroupIndex + 0:10:0:32 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 32 + + + CoreId + 1 + + + + + Ethernet10/33/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 33 + + + InterfaceGroupIndex + 0:10:0:33 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 33 + + + CoreId + 1 + + + + + Ethernet10/34/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 34 + + + InterfaceGroupIndex + 0:10:0:34 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 34 + + + CoreId + 1 + + + + + Ethernet10/35/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 35 + + + InterfaceGroupIndex + 0:10:0:35 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 35 + + + CoreId + 1 + + + + + Ethernet10/36/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 36 + + + InterfaceGroupIndex + 0:10:0:36 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 36 + + + CoreId + 1 + + + + + Ethernet10/37/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 37 + + + InterfaceGroupIndex + 0:10:0:37 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 37 + + + CoreId + 1 + + + + + Ethernet10/38/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 38 + + + InterfaceGroupIndex + 0:10:0:38 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 38 + + + CoreId + 1 + + + + + Ethernet10/39/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 39 + + + InterfaceGroupIndex + 0:10:0:39 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 39 + + + CoreId + 1 + + + + + Ethernet10/40/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 40 + + + InterfaceGroupIndex + 0:10:0:40 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 40 + + + CoreId + 1 + + + + + Ethernet10/41/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 41 + + + InterfaceGroupIndex + 0:10:0:41 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 41 + + + CoreId + 1 + + + + + Ethernet10/42/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 42 + + + InterfaceGroupIndex + 0:10:0:42 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 42 + + + CoreId + 1 + + + + + Ethernet10/43/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 43 + + + InterfaceGroupIndex + 0:10:0:43 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 43 + + + CoreId + 1 + + + + + Ethernet10/44/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 44 + + + InterfaceGroupIndex + 0:10:0:44 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 44 + + + CoreId + 1 + + + + + Ethernet10/45/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 45 + + + InterfaceGroupIndex + 0:10:0:45 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 45 + + + CoreId + 1 + + + + + Ethernet10/46/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 46 + + + InterfaceGroupIndex + 0:10:0:46 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 46 + + + CoreId + 1 + + + + + Ethernet10/47/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 47 + + + InterfaceGroupIndex + 0:10:0:47 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 47 + + + CoreId + 1 + + + + + Ethernet10/48/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 48 + + + InterfaceGroupIndex + 0:10:0:48 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 48 + + + CoreId + 1 + + + + + cpu10/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 49 + + + InterfaceGroupIndex + 0:10:0:49 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 49 + + + CoreId + 0 + + + + + Recirc10/0/0 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 50 + + + InterfaceGroupIndex + 0:10:0:50 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 50 + + + CoreId + 0 + + + + + Recirc10/0/1 + + + LineCardSku + Sonic-100G-sku + + + SlotIndex + 10 + + + ChassisIndex + 0 + + + PortIndex + 51 + + + InterfaceGroupIndex + 0:10:0:51 + + + InterfaceSubGroupIndex + 1 + + + ProviderChipName + ASIC0 + + + AsicSwitchId + 36 + + + AsicInterfaceIndex + 51 + + + CoreId + 0 + + + + + + + DeviceInterface + + true + 1 + Management1/1 + false + + + 1000 + + + + + DeviceInterface + + true + 1 + Ethernet3/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 2 + Ethernet3/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 3 + Ethernet3/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 4 + Ethernet3/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 5 + Ethernet3/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 6 + Ethernet3/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 7 + Ethernet3/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 8 + Ethernet3/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 9 + Ethernet3/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 10 + Ethernet3/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 11 + Ethernet3/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 12 + Ethernet3/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 13 + Ethernet3/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 14 + Ethernet3/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 15 + Ethernet3/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 16 + Ethernet3/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 17 + Ethernet3/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 18 + Ethernet3/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 19 + Ethernet3/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 20 + Ethernet3/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 21 + Ethernet3/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 22 + Ethernet3/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 23 + Ethernet3/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 24 + Ethernet3/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 25 + Ethernet3/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 26 + Ethernet3/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 27 + Ethernet3/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 28 + Ethernet3/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 29 + Ethernet3/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 30 + Ethernet3/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 31 + Ethernet3/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 32 + Ethernet3/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 33 + Ethernet3/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 34 + Ethernet3/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 35 + Ethernet3/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 36 + Ethernet3/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 37 + Ethernet3/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 38 + Ethernet3/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 39 + Ethernet3/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 40 + Ethernet3/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 41 + Ethernet3/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 42 + Ethernet3/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 43 + Ethernet3/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 44 + Ethernet3/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 45 + Ethernet3/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 46 + Ethernet3/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 47 + Ethernet3/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 48 + Ethernet3/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 49 + Ethernet3/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 50 + Ethernet3/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 51 + Ethernet3/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 52 + Ethernet3/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 53 + Ethernet3/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 54 + Ethernet3/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 55 + Ethernet3/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 56 + Ethernet3/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 57 + Ethernet3/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 58 + Ethernet3/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 59 + Ethernet3/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 60 + Ethernet3/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 61 + Ethernet3/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 62 + Ethernet3/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 63 + Ethernet3/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 64 + Ethernet3/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 65 + Ethernet3/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 66 + Ethernet3/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 67 + Ethernet3/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 68 + Ethernet3/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 69 + Ethernet3/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 70 + Ethernet3/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 71 + Ethernet3/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 72 + Ethernet3/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 73 + Ethernet3/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 74 + Ethernet3/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 75 + Ethernet3/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 76 + Ethernet3/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 77 + Ethernet3/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 78 + Ethernet3/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 79 + Ethernet3/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 80 + Ethernet3/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 81 + Ethernet3/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 82 + Ethernet3/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 83 + Ethernet3/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 84 + Ethernet3/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 85 + Ethernet3/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 86 + Ethernet3/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 87 + Ethernet3/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 88 + Ethernet3/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 89 + Ethernet3/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 90 + Ethernet3/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 91 + Ethernet3/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 92 + Ethernet3/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 93 + Ethernet3/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 94 + Ethernet3/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 95 + Ethernet3/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 96 + Ethernet3/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 97 + Ethernet3/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 98 + Ethernet3/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 99 + Ethernet3/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 100 + Ethernet3/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 101 + Ethernet3/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 102 + Ethernet3/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 103 + Ethernet3/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 104 + Ethernet3/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 105 + Ethernet3/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 106 + Ethernet3/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 107 + Ethernet3/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 108 + Ethernet3/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 109 + Ethernet4/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 110 + Ethernet4/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 111 + Ethernet4/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 112 + Ethernet4/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 113 + Ethernet4/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 114 + Ethernet4/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 115 + Ethernet4/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 116 + Ethernet4/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 117 + Ethernet4/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 118 + Ethernet4/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 119 + Ethernet4/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 120 + Ethernet4/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 121 + Ethernet4/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 122 + Ethernet4/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 123 + Ethernet4/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 124 + Ethernet4/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 125 + Ethernet4/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 126 + Ethernet4/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 127 + Ethernet4/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 128 + Ethernet4/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 129 + Ethernet4/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 130 + Ethernet4/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 131 + Ethernet4/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 132 + Ethernet4/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 133 + Ethernet4/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 134 + Ethernet4/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 135 + Ethernet4/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 136 + Ethernet4/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 137 + Ethernet4/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 138 + Ethernet4/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 139 + Ethernet4/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 140 + Ethernet4/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 141 + Ethernet4/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 142 + Ethernet4/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 143 + Ethernet4/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 144 + Ethernet4/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 145 + Ethernet4/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 146 + Ethernet4/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 147 + Ethernet4/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 148 + Ethernet4/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 149 + Ethernet4/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 150 + Ethernet4/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 151 + Ethernet4/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 152 + Ethernet4/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 153 + Ethernet4/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 154 + Ethernet4/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 155 + Ethernet4/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 156 + Ethernet4/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 157 + Ethernet4/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 158 + Ethernet4/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 159 + Ethernet4/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 160 + Ethernet4/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 161 + Ethernet4/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 162 + Ethernet4/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 163 + Ethernet4/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 164 + Ethernet4/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 165 + Ethernet4/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 166 + Ethernet4/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 167 + Ethernet4/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 168 + Ethernet4/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 169 + Ethernet4/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 170 + Ethernet4/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 171 + Ethernet4/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 172 + Ethernet4/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 173 + Ethernet4/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 174 + Ethernet4/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 175 + Ethernet4/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 176 + Ethernet4/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 177 + Ethernet4/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 178 + Ethernet4/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 179 + Ethernet4/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 180 + Ethernet4/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 181 + Ethernet4/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 182 + Ethernet4/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 183 + Ethernet4/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 184 + Ethernet4/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 185 + Ethernet4/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 186 + Ethernet4/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 187 + Ethernet4/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 188 + Ethernet4/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 189 + Ethernet4/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 190 + Ethernet4/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 191 + Ethernet4/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 192 + Ethernet4/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 193 + Ethernet4/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 194 + Ethernet4/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 195 + Ethernet4/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 196 + Ethernet4/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 197 + Ethernet4/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 198 + Ethernet4/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 199 + Ethernet4/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 200 + Ethernet4/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 201 + Ethernet4/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 202 + Ethernet4/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 203 + Ethernet4/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 204 + Ethernet4/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 205 + Ethernet4/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 206 + Ethernet4/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 207 + Ethernet4/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 208 + Ethernet4/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 209 + Ethernet4/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 210 + Ethernet4/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 211 + Ethernet4/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 212 + Ethernet4/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 213 + Ethernet4/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 214 + Ethernet4/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 215 + Ethernet4/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 216 + Ethernet4/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 217 + Ethernet4/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 218 + Ethernet4/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 219 + Ethernet4/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 220 + Ethernet4/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 221 + Ethernet4/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 222 + Ethernet4/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 223 + Ethernet4/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 224 + Ethernet4/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 225 + Ethernet4/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 226 + Ethernet4/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 227 + Ethernet4/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 228 + Ethernet4/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 229 + Ethernet4/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 230 + Ethernet4/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 231 + Ethernet4/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 232 + Ethernet4/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 233 + Ethernet4/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 234 + Ethernet4/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 235 + Ethernet4/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 236 + Ethernet4/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 237 + Ethernet4/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 238 + Ethernet4/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 239 + Ethernet4/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 240 + Ethernet4/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 241 + Ethernet4/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 242 + Ethernet4/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 243 + Ethernet4/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 244 + Ethernet4/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 245 + Ethernet4/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 246 + Ethernet4/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 247 + Ethernet4/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 248 + Ethernet4/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 249 + Ethernet4/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 250 + Ethernet4/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 251 + Ethernet4/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 252 + Ethernet4/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 253 + Ethernet5/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 254 + Ethernet5/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 255 + Ethernet5/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 256 + Ethernet5/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 257 + Ethernet5/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 258 + Ethernet5/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 259 + Ethernet5/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 260 + Ethernet5/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 261 + Ethernet5/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 262 + Ethernet5/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 263 + Ethernet5/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 264 + Ethernet5/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 265 + Ethernet5/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 266 + Ethernet5/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 267 + Ethernet5/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 268 + Ethernet5/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 269 + Ethernet5/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 270 + Ethernet5/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 271 + Ethernet5/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 272 + Ethernet5/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 273 + Ethernet5/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 274 + Ethernet5/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 275 + Ethernet5/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 276 + Ethernet5/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 277 + Ethernet5/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 278 + Ethernet5/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 279 + Ethernet5/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 280 + Ethernet5/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 281 + Ethernet5/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 282 + Ethernet5/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 283 + Ethernet5/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 284 + Ethernet5/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 285 + Ethernet5/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 286 + Ethernet5/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 287 + Ethernet5/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 288 + Ethernet5/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 289 + Ethernet5/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 290 + Ethernet5/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 291 + Ethernet5/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 292 + Ethernet5/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 293 + Ethernet5/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 294 + Ethernet5/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 295 + Ethernet5/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 296 + Ethernet5/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 297 + Ethernet5/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 298 + Ethernet5/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 299 + Ethernet5/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 300 + Ethernet5/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 301 + Ethernet5/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 302 + Ethernet5/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 303 + Ethernet5/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 304 + Ethernet5/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 305 + Ethernet5/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 306 + Ethernet5/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 307 + Ethernet5/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 308 + Ethernet5/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 309 + Ethernet5/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 310 + Ethernet5/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 311 + Ethernet5/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 312 + Ethernet5/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 313 + Ethernet5/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 314 + Ethernet5/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 315 + Ethernet5/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 316 + Ethernet5/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 317 + Ethernet5/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 318 + Ethernet5/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 319 + Ethernet5/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 320 + Ethernet5/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 321 + Ethernet5/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 322 + Ethernet5/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 323 + Ethernet5/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 324 + Ethernet5/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 325 + Ethernet5/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 326 + Ethernet5/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 327 + Ethernet5/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 328 + Ethernet5/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 329 + Ethernet5/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 330 + Ethernet5/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 331 + Ethernet5/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 332 + Ethernet5/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 333 + Ethernet5/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 334 + Ethernet5/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 335 + Ethernet5/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 336 + Ethernet5/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 337 + Ethernet5/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 338 + Ethernet5/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 339 + Ethernet5/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 340 + Ethernet5/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 341 + Ethernet5/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 342 + Ethernet5/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 343 + Ethernet5/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 344 + Ethernet5/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 345 + Ethernet5/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 346 + Ethernet5/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 347 + Ethernet5/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 348 + Ethernet5/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 349 + Ethernet5/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 350 + Ethernet5/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 351 + Ethernet5/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 352 + Ethernet5/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 353 + Ethernet5/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 354 + Ethernet5/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 355 + Ethernet5/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 356 + Ethernet5/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 357 + Ethernet5/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 358 + Ethernet5/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 359 + Ethernet5/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 360 + Ethernet5/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 361 + Ethernet5/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 362 + Ethernet5/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 363 + Ethernet5/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 364 + Ethernet5/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 365 + Ethernet5/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 366 + Ethernet5/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 367 + Ethernet5/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 368 + Ethernet5/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 369 + Ethernet5/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 370 + Ethernet5/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 371 + Ethernet5/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 372 + Ethernet5/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 373 + Ethernet5/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 374 + Ethernet5/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 375 + Ethernet5/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 376 + Ethernet5/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 377 + Ethernet5/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 378 + Ethernet5/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 379 + Ethernet5/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 380 + Ethernet5/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 381 + Ethernet5/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 382 + Ethernet5/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 383 + Ethernet5/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 384 + Ethernet5/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 385 + Ethernet5/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 386 + Ethernet5/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 387 + Ethernet5/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 388 + Ethernet5/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 389 + Ethernet5/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 390 + Ethernet5/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 391 + Ethernet5/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 392 + Ethernet5/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 393 + Ethernet5/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 394 + Ethernet5/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 395 + Ethernet5/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 396 + Ethernet5/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 397 + Ethernet6/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 398 + Ethernet6/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 399 + Ethernet6/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 400 + Ethernet6/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 401 + Ethernet6/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 402 + Ethernet6/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 403 + Ethernet6/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 404 + Ethernet6/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 405 + Ethernet6/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 406 + Ethernet6/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 407 + Ethernet6/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 408 + Ethernet6/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 409 + Ethernet6/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 410 + Ethernet6/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 411 + Ethernet6/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 412 + Ethernet6/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 413 + Ethernet6/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 414 + Ethernet6/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 415 + Ethernet6/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 416 + Ethernet6/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 417 + Ethernet6/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 418 + Ethernet6/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 419 + Ethernet6/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 420 + Ethernet6/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 421 + Ethernet6/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 422 + Ethernet6/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 423 + Ethernet6/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 424 + Ethernet6/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 425 + Ethernet6/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 426 + Ethernet6/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 427 + Ethernet6/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 428 + Ethernet6/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 429 + Ethernet6/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 430 + Ethernet6/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 431 + Ethernet6/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 432 + Ethernet6/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 433 + Ethernet6/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 434 + Ethernet6/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 435 + Ethernet6/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 436 + Ethernet6/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 437 + Ethernet6/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 438 + Ethernet6/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 439 + Ethernet6/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 440 + Ethernet6/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 441 + Ethernet6/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 442 + Ethernet6/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 443 + Ethernet6/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 444 + Ethernet6/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 445 + Ethernet6/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 446 + Ethernet6/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 447 + Ethernet6/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 448 + Ethernet6/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 449 + Ethernet6/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 450 + Ethernet6/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 451 + Ethernet6/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 452 + Ethernet6/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 453 + Ethernet6/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 454 + Ethernet6/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 455 + Ethernet6/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 456 + Ethernet6/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 457 + Ethernet6/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 458 + Ethernet6/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 459 + Ethernet6/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 460 + Ethernet6/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 461 + Ethernet6/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 462 + Ethernet6/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 463 + Ethernet6/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 464 + Ethernet6/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 465 + Ethernet6/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 466 + Ethernet6/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 467 + Ethernet6/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 468 + Ethernet6/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 469 + Ethernet6/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 470 + Ethernet6/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 471 + Ethernet6/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 472 + Ethernet6/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 473 + Ethernet6/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 474 + Ethernet6/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 475 + Ethernet6/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 476 + Ethernet6/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 477 + Ethernet6/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 478 + Ethernet6/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 479 + Ethernet6/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 480 + Ethernet6/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 481 + Ethernet6/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 482 + Ethernet6/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 483 + Ethernet6/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 484 + Ethernet6/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 485 + Ethernet6/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 486 + Ethernet6/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 487 + Ethernet6/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 488 + Ethernet6/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 489 + Ethernet6/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 490 + Ethernet6/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 491 + Ethernet6/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 492 + Ethernet6/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 493 + Ethernet6/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 494 + Ethernet6/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 495 + Ethernet6/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 496 + Ethernet6/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 497 + Ethernet6/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 498 + Ethernet6/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 499 + Ethernet6/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 500 + Ethernet6/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 501 + Ethernet6/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 502 + Ethernet6/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 503 + Ethernet6/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 504 + Ethernet6/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 505 + Ethernet6/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 506 + Ethernet6/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 507 + Ethernet6/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 508 + Ethernet6/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 509 + Ethernet6/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 510 + Ethernet6/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 511 + Ethernet6/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 512 + Ethernet6/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 513 + Ethernet6/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 514 + Ethernet6/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 515 + Ethernet6/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 516 + Ethernet6/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 517 + Ethernet6/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 518 + Ethernet6/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 519 + Ethernet6/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 520 + Ethernet6/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 521 + Ethernet6/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 522 + Ethernet6/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 523 + Ethernet6/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 524 + Ethernet6/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 525 + Ethernet6/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 526 + Ethernet6/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 527 + Ethernet6/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 528 + Ethernet6/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 529 + Ethernet6/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 530 + Ethernet6/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 531 + Ethernet6/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 532 + Ethernet6/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 533 + Ethernet6/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 534 + Ethernet6/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 535 + Ethernet6/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 536 + Ethernet6/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 537 + Ethernet6/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 538 + Ethernet6/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 539 + Ethernet6/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 540 + Ethernet6/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 541 + Ethernet7/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 542 + Ethernet7/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 543 + Ethernet7/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 544 + Ethernet7/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 545 + Ethernet7/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 546 + Ethernet7/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 547 + Ethernet7/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 548 + Ethernet7/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 549 + Ethernet7/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 550 + Ethernet7/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 551 + Ethernet7/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 552 + Ethernet7/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 553 + Ethernet7/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 554 + Ethernet7/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 555 + Ethernet7/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 556 + Ethernet7/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 557 + Ethernet7/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 558 + Ethernet7/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 559 + Ethernet7/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 560 + Ethernet7/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 561 + Ethernet7/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 562 + Ethernet7/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 563 + Ethernet7/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 564 + Ethernet7/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 565 + Ethernet7/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 566 + Ethernet7/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 567 + Ethernet7/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 568 + Ethernet7/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 569 + Ethernet7/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 570 + Ethernet7/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 571 + Ethernet7/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 572 + Ethernet7/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 573 + Ethernet7/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 574 + Ethernet7/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 575 + Ethernet7/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 576 + Ethernet7/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 577 + Ethernet7/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 578 + Ethernet7/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 579 + Ethernet7/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 580 + Ethernet7/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 581 + Ethernet7/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 582 + Ethernet7/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 583 + Ethernet7/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 584 + Ethernet7/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 585 + Ethernet7/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 586 + Ethernet7/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 587 + Ethernet7/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 588 + Ethernet7/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 589 + Ethernet7/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 590 + Ethernet7/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 591 + Ethernet7/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 592 + Ethernet7/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 593 + Ethernet7/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 594 + Ethernet7/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 595 + Ethernet7/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 596 + Ethernet7/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 597 + Ethernet7/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 598 + Ethernet7/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 599 + Ethernet7/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 600 + Ethernet7/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 601 + Ethernet7/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 602 + Ethernet7/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 603 + Ethernet7/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 604 + Ethernet7/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 605 + Ethernet7/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 606 + Ethernet7/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 607 + Ethernet7/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 608 + Ethernet7/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 609 + Ethernet7/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 610 + Ethernet7/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 611 + Ethernet7/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 612 + Ethernet7/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 613 + Ethernet7/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 614 + Ethernet7/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 615 + Ethernet7/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 616 + Ethernet7/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 617 + Ethernet7/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 618 + Ethernet7/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 619 + Ethernet7/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 620 + Ethernet7/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 621 + Ethernet7/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 622 + Ethernet7/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 623 + Ethernet7/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 624 + Ethernet7/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 625 + Ethernet7/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 626 + Ethernet7/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 627 + Ethernet7/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 628 + Ethernet7/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 629 + Ethernet7/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 630 + Ethernet7/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 631 + Ethernet7/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 632 + Ethernet7/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 633 + Ethernet7/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 634 + Ethernet7/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 635 + Ethernet7/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 636 + Ethernet7/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 637 + Ethernet7/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 638 + Ethernet7/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 639 + Ethernet7/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 640 + Ethernet7/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 641 + Ethernet7/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 642 + Ethernet7/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 643 + Ethernet7/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 644 + Ethernet7/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 645 + Ethernet7/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 646 + Ethernet7/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 647 + Ethernet7/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 648 + Ethernet7/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 649 + Ethernet7/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 650 + Ethernet7/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 651 + Ethernet7/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 652 + Ethernet7/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 653 + Ethernet7/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 654 + Ethernet7/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 655 + Ethernet7/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 656 + Ethernet7/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 657 + Ethernet7/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 658 + Ethernet7/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 659 + Ethernet7/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 660 + Ethernet7/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 661 + Ethernet7/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 662 + Ethernet7/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 663 + Ethernet7/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 664 + Ethernet7/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 665 + Ethernet7/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 666 + Ethernet7/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 667 + Ethernet7/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 668 + Ethernet7/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 669 + Ethernet7/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 670 + Ethernet7/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 671 + Ethernet7/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 672 + Ethernet7/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 673 + Ethernet7/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 674 + Ethernet7/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 675 + Ethernet7/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 676 + Ethernet7/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 677 + Ethernet7/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 678 + Ethernet7/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 679 + Ethernet7/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 680 + Ethernet7/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 681 + Ethernet7/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 682 + Ethernet7/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 683 + Ethernet7/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 684 + Ethernet7/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 685 + Ethernet8/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 686 + Ethernet8/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 687 + Ethernet8/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 688 + Ethernet8/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 689 + Ethernet8/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 690 + Ethernet8/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 691 + Ethernet8/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 692 + Ethernet8/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 693 + Ethernet8/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 694 + Ethernet8/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 695 + Ethernet8/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 696 + Ethernet8/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 697 + Ethernet8/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 698 + Ethernet8/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 699 + Ethernet8/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 700 + Ethernet8/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 701 + Ethernet8/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 702 + Ethernet8/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 703 + Ethernet8/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 704 + Ethernet8/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 705 + Ethernet8/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 706 + Ethernet8/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 707 + Ethernet8/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 708 + Ethernet8/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 709 + Ethernet8/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 710 + Ethernet8/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 711 + Ethernet8/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 712 + Ethernet8/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 713 + Ethernet8/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 714 + Ethernet8/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 715 + Ethernet8/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 716 + Ethernet8/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 717 + Ethernet8/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 718 + Ethernet8/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 719 + Ethernet8/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 720 + Ethernet8/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 721 + Ethernet8/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 722 + Ethernet8/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 723 + Ethernet8/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 724 + Ethernet8/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 725 + Ethernet8/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 726 + Ethernet8/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 727 + Ethernet8/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 728 + Ethernet8/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 729 + Ethernet8/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 730 + Ethernet8/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 731 + Ethernet8/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 732 + Ethernet8/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 733 + Ethernet8/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 734 + Ethernet8/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 735 + Ethernet8/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 736 + Ethernet8/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 737 + Ethernet8/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 738 + Ethernet8/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 739 + Ethernet8/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 740 + Ethernet8/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 741 + Ethernet8/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 742 + Ethernet8/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 743 + Ethernet8/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 744 + Ethernet8/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 745 + Ethernet8/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 746 + Ethernet8/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 747 + Ethernet8/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 748 + Ethernet8/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 749 + Ethernet8/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 750 + Ethernet8/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 751 + Ethernet8/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 752 + Ethernet8/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 753 + Ethernet8/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 754 + Ethernet8/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 755 + Ethernet8/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 756 + Ethernet8/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 757 + Ethernet8/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 758 + Ethernet8/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 759 + Ethernet8/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 760 + Ethernet8/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 761 + Ethernet8/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 762 + Ethernet8/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 763 + Ethernet8/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 764 + Ethernet8/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 765 + Ethernet8/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 766 + Ethernet8/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 767 + Ethernet8/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 768 + Ethernet8/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 769 + Ethernet8/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 770 + Ethernet8/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 771 + Ethernet8/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 772 + Ethernet8/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 773 + Ethernet8/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 774 + Ethernet8/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 775 + Ethernet8/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 776 + Ethernet8/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 777 + Ethernet8/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 778 + Ethernet8/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 779 + Ethernet8/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 780 + Ethernet8/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 781 + Ethernet8/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 782 + Ethernet8/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 783 + Ethernet8/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 784 + Ethernet8/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 785 + Ethernet8/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 786 + Ethernet8/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 787 + Ethernet8/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 788 + Ethernet8/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 789 + Ethernet8/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 790 + Ethernet8/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 791 + Ethernet8/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 792 + Ethernet8/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 793 + Ethernet8/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 794 + Ethernet8/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 795 + Ethernet8/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 796 + Ethernet8/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 797 + Ethernet8/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 798 + Ethernet8/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 799 + Ethernet8/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 800 + Ethernet8/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 801 + Ethernet8/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 802 + Ethernet8/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 803 + Ethernet8/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 804 + Ethernet8/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 805 + Ethernet8/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 806 + Ethernet8/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 807 + Ethernet8/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 808 + Ethernet8/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 809 + Ethernet8/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 810 + Ethernet8/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 811 + Ethernet8/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 812 + Ethernet8/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 813 + Ethernet8/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 814 + Ethernet8/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 815 + Ethernet8/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 816 + Ethernet8/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 817 + Ethernet8/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 818 + Ethernet8/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 819 + Ethernet8/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 820 + Ethernet8/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 821 + Ethernet8/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 822 + Ethernet8/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 823 + Ethernet8/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 824 + Ethernet8/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 825 + Ethernet8/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 826 + Ethernet8/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 827 + Ethernet8/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 828 + Ethernet8/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 829 + Ethernet9/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 830 + Ethernet9/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 831 + Ethernet9/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 832 + Ethernet9/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 833 + Ethernet9/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 834 + Ethernet9/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 835 + Ethernet9/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 836 + Ethernet9/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 837 + Ethernet9/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 838 + Ethernet9/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 839 + Ethernet9/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 840 + Ethernet9/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 841 + Ethernet9/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 842 + Ethernet9/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 843 + Ethernet9/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 844 + Ethernet9/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 845 + Ethernet9/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 846 + Ethernet9/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 847 + Ethernet9/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 848 + Ethernet9/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 849 + Ethernet9/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 850 + Ethernet9/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 851 + Ethernet9/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 852 + Ethernet9/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 853 + Ethernet9/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 854 + Ethernet9/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 855 + Ethernet9/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 856 + Ethernet9/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 857 + Ethernet9/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 858 + Ethernet9/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 859 + Ethernet9/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 860 + Ethernet9/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 861 + Ethernet9/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 862 + Ethernet9/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 863 + Ethernet9/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 864 + Ethernet9/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 865 + Ethernet9/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 866 + Ethernet9/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 867 + Ethernet9/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 868 + Ethernet9/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 869 + Ethernet9/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 870 + Ethernet9/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 871 + Ethernet9/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 872 + Ethernet9/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 873 + Ethernet9/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 874 + Ethernet9/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 875 + Ethernet9/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 876 + Ethernet9/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 877 + Ethernet9/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 878 + Ethernet9/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 879 + Ethernet9/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 880 + Ethernet9/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 881 + Ethernet9/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 882 + Ethernet9/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 883 + Ethernet9/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 884 + Ethernet9/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 885 + Ethernet9/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 886 + Ethernet9/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 887 + Ethernet9/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 888 + Ethernet9/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 889 + Ethernet9/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 890 + Ethernet9/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 891 + Ethernet9/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 892 + Ethernet9/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 893 + Ethernet9/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 894 + Ethernet9/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 895 + Ethernet9/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 896 + Ethernet9/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 897 + Ethernet9/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 898 + Ethernet9/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 899 + Ethernet9/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 900 + Ethernet9/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 901 + Ethernet9/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 902 + Ethernet9/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 903 + Ethernet9/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 904 + Ethernet9/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 905 + Ethernet9/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 906 + Ethernet9/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 907 + Ethernet9/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 908 + Ethernet9/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 909 + Ethernet9/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 910 + Ethernet9/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 911 + Ethernet9/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 912 + Ethernet9/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 913 + Ethernet9/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 914 + Ethernet9/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 915 + Ethernet9/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 916 + Ethernet9/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 917 + Ethernet9/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 918 + Ethernet9/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 919 + Ethernet9/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 920 + Ethernet9/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 921 + Ethernet9/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 922 + Ethernet9/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 923 + Ethernet9/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 924 + Ethernet9/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 925 + Ethernet9/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 926 + Ethernet9/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 927 + Ethernet9/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 928 + Ethernet9/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 929 + Ethernet9/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 930 + Ethernet9/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 931 + Ethernet9/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 932 + Ethernet9/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 933 + Ethernet9/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 934 + Ethernet9/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 935 + Ethernet9/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 936 + Ethernet9/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 937 + Ethernet9/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 938 + Ethernet9/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 939 + Ethernet9/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 940 + Ethernet9/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 941 + Ethernet9/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 942 + Ethernet9/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 943 + Ethernet9/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 944 + Ethernet9/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 945 + Ethernet9/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 946 + Ethernet9/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 947 + Ethernet9/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 948 + Ethernet9/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 949 + Ethernet9/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 950 + Ethernet9/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 951 + Ethernet9/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 952 + Ethernet9/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 953 + Ethernet9/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 954 + Ethernet9/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 955 + Ethernet9/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 956 + Ethernet9/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 957 + Ethernet9/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 958 + Ethernet9/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 959 + Ethernet9/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 960 + Ethernet9/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 961 + Ethernet9/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 962 + Ethernet9/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 963 + Ethernet9/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 964 + Ethernet9/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 965 + Ethernet9/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 966 + Ethernet9/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 967 + Ethernet9/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 968 + Ethernet9/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 969 + Ethernet9/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 970 + Ethernet9/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 971 + Ethernet9/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 972 + Ethernet9/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 973 + Ethernet10/1/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 974 + Ethernet10/1/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 975 + Ethernet10/1/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 976 + Ethernet10/2/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 977 + Ethernet10/2/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 978 + Ethernet10/2/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 979 + Ethernet10/3/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 980 + Ethernet10/3/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 981 + Ethernet10/3/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 982 + Ethernet10/4/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 983 + Ethernet10/4/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 984 + Ethernet10/4/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 985 + Ethernet10/5/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 986 + Ethernet10/5/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 987 + Ethernet10/5/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 988 + Ethernet10/6/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 989 + Ethernet10/6/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 990 + Ethernet10/6/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 991 + Ethernet10/7/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 992 + Ethernet10/7/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 993 + Ethernet10/7/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 994 + Ethernet10/8/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 995 + Ethernet10/8/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 996 + Ethernet10/8/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 997 + Ethernet10/9/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 998 + Ethernet10/9/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 999 + Ethernet10/9/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1000 + Ethernet10/10/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1001 + Ethernet10/10/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1002 + Ethernet10/10/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1003 + Ethernet10/11/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1004 + Ethernet10/11/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1005 + Ethernet10/11/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1006 + Ethernet10/12/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1007 + Ethernet10/12/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1008 + Ethernet10/12/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1009 + Ethernet10/13/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1010 + Ethernet10/13/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1011 + Ethernet10/13/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1012 + Ethernet10/14/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1013 + Ethernet10/14/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1014 + Ethernet10/14/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1015 + Ethernet10/15/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1016 + Ethernet10/15/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1017 + Ethernet10/15/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1018 + Ethernet10/16/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1019 + Ethernet10/16/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1020 + Ethernet10/16/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1021 + Ethernet10/17/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1022 + Ethernet10/17/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1023 + Ethernet10/17/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1024 + Ethernet10/18/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1025 + Ethernet10/18/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1026 + Ethernet10/18/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1027 + Ethernet10/19/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1028 + Ethernet10/19/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1029 + Ethernet10/19/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1030 + Ethernet10/20/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1031 + Ethernet10/20/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1032 + Ethernet10/20/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1033 + Ethernet10/21/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1034 + Ethernet10/21/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1035 + Ethernet10/21/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1036 + Ethernet10/22/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1037 + Ethernet10/22/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1038 + Ethernet10/22/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1039 + Ethernet10/23/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1040 + Ethernet10/23/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1041 + Ethernet10/23/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1042 + Ethernet10/24/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1043 + Ethernet10/24/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1044 + Ethernet10/24/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1045 + Ethernet10/25/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1046 + Ethernet10/25/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1047 + Ethernet10/25/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1048 + Ethernet10/26/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1049 + Ethernet10/26/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1050 + Ethernet10/26/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1051 + Ethernet10/27/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1052 + Ethernet10/27/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1053 + Ethernet10/27/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1054 + Ethernet10/28/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1055 + Ethernet10/28/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1056 + Ethernet10/28/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1057 + Ethernet10/29/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1058 + Ethernet10/29/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1059 + Ethernet10/29/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1060 + Ethernet10/30/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1061 + Ethernet10/30/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1062 + Ethernet10/30/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1063 + Ethernet10/31/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1064 + Ethernet10/31/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1065 + Ethernet10/31/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1066 + Ethernet10/32/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1067 + Ethernet10/32/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1068 + Ethernet10/32/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1069 + Ethernet10/33/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1070 + Ethernet10/33/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1071 + Ethernet10/33/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1072 + Ethernet10/34/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1073 + Ethernet10/34/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1074 + Ethernet10/34/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1075 + Ethernet10/35/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1076 + Ethernet10/35/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1077 + Ethernet10/35/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1078 + Ethernet10/36/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1079 + Ethernet10/36/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1080 + Ethernet10/36/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1081 + Ethernet10/37/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1082 + Ethernet10/37/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1083 + Ethernet10/37/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1084 + Ethernet10/38/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1085 + Ethernet10/38/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1086 + Ethernet10/38/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1087 + Ethernet10/39/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1088 + Ethernet10/39/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1089 + Ethernet10/39/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1090 + Ethernet10/40/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1091 + Ethernet10/40/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1092 + Ethernet10/40/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1093 + Ethernet10/41/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1094 + Ethernet10/41/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1095 + Ethernet10/41/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1096 + Ethernet10/42/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1097 + Ethernet10/42/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1098 + Ethernet10/42/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1099 + Ethernet10/43/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1100 + Ethernet10/43/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1101 + Ethernet10/43/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1102 + Ethernet10/44/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1103 + Ethernet10/44/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1104 + Ethernet10/44/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1105 + Ethernet10/45/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1106 + Ethernet10/45/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1107 + Ethernet10/45/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1108 + Ethernet10/46/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1109 + Ethernet10/46/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1110 + Ethernet10/46/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1111 + Ethernet10/47/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1112 + Ethernet10/47/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1113 + Ethernet10/47/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + DeviceInterface + + true + 1114 + Ethernet10/48/1 + false + + + 0 + egress + none + 0 + + 0 + + + DeviceInterface + + true + 1115 + Ethernet10/48/1 + false + + + 0 + ingress + none + 0 + + 0 + + + DeviceInterface + + true + 1116 + Ethernet10/48/1 + false + + + 0 + Bidirectional + none + 0 + + 0 + + + + + DeviceInterface + + true + 1 + power1/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 2 + power1/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 3 + power2/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 4 + power2/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 5 + power3/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 6 + power3/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 7 + power4/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 8 + power4/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 9 + power7/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 10 + power7/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 11 + power8/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 12 + power8/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 13 + power9/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 14 + power9/1 + false + + + 0 + + C19 + C19 + true + + + DeviceInterface + + true + 15 + power10/0 + false + + + 0 + + C19 + C19 + false + + + DeviceInterface + + true + 16 + power10/1 + false + + + 0 + + C19 + C19 + true + + + + + + DeviceInterface + + true + 1 + console + false + console + + 9600 + false + + + + DeviceInterface + + false + 2 + logical1 + false + logical1 + + 9600 + true + 1 + + + DeviceInterface + + false + 3 + logical2 + false + logical2 + + 9600 + true + 2 + + + DeviceInterface + + false + 4 + logical3 + false + logical3 + + 9600 + true + 3 + + + DeviceInterface + + false + 5 + logical4 + false + logical4 + + 9600 + true + 4 + + + DeviceInterface + + false + 6 + logical5 + false + logical5 + + 9600 + true + 5 + + + DeviceInterface + + false + 7 + logical6 + false + logical6 + + 9600 + true + 6 + + + DeviceInterface + + false + 8 + logical7 + false + logical7 + + 9600 + true + 7 + + + DeviceInterface + + false + 9 + logical8 + false + logical8 + + 9600 + true + 8 + + + DeviceInterface + + false + 10 + logical9 + false + logical9 + + 9600 + true + 9 + + + DeviceInterface + + false + 11 + logical10 + false + logical10 + + 9600 + true + 10 + + + DeviceInterface + + false + 12 + logical11 + false + logical11 + + 9600 + true + 11 + + + DeviceInterface + + false + 13 + logical12 + false + logical12 + + 9600 + true + 12 + + + + Sonic + + + + + + + + LoopbackInterface + HostIP + Loopback0 + + 10.152.0.46/32 + + 10.152.0.46/32 + + + LoopbackInterface + HostIP1 + Loopback0 + + 2a01:111:e210:5e::/128 + + 2a01:111:e210:5e::/128 + + + + + ManagementInterface + ManagementIP + Management1/1 + + 10.3.146.111/24 + + 10.3.146.111/24 + + + + ManagementInterface + v6ManagementIP + Management1/1 + + 2a01:111:e210:3000::a03:926f/64 + + 2a01:111:e210:3000::a03:926f/64 + + + + + + + + str-sonic-sup00 + + + + + + + + + + + + + + + str-sonic-sup00:console;str-console-197:port 10 + + + FlowControl + + False + + + str-sonic:console;str-console-197:port 10 + + + + + + + + str-sonic-sup00-ASIC00 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + ProviderLineCard + + str-sonic-fc00 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC01 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + ProviderLineCard + + str-sonic-fc00 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC02 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + AsicSwitchId + + 2 + + + ProviderLineCard + + str-sonic-fc01 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC03 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + AsicSwitchId + + 3 + + + ProviderLineCard + + str-sonic-fc01 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC04 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + AsicSwitchId + + 8 + + + ProviderLineCard + + str-sonic-fc02 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC05 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + AsicSwitchId + + 9 + + + ProviderLineCard + + str-sonic-fc02 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC06 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + AsicSwitchId + + 14 + + + ProviderLineCard + + str-sonic-fc03 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC07 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + AsicSwitchId + + 15 + + + ProviderLineCard + + str-sonic-fc03 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC08 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + AsicSwitchId + + 20 + + + ProviderLineCard + + str-sonic-fc04 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC09 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + AsicSwitchId + + 21 + + + ProviderLineCard + + str-sonic-fc04 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC10 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + AsicSwitchId + + 26 + + + ProviderLineCard + + str-sonic-fc05 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00-ASIC11 + + + ForwardingMethod + + VoQ + + + ParentHardwareFabricSkuName + + Sonic-supvisor-sku + + + SubRole + + Fabric + + + AsicSwitchId + + 27 + + + ProviderLineCard + + str-sonic-fc05 + + + ParentRouter + + str-sonic-sup00 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic-sup00 + + + FirmwareProfile + + SONiC-Sonic-supvisor-sku-sup + + + ForwardingMethod + + VoQ + + + OsVersion + + SONiC.20220532.60 + + + ParentRouter + + str-sonic + + + SubDevices + + str-sonic-sup00-ASIC00;str-sonic-sup00-ASIC01;str-sonic-sup00-ASIC02;str-sonic-sup00-ASIC03;str-sonic-sup00-ASIC04;str-sonic-sup00-ASIC05;str-sonic-sup00-ASIC06;str-sonic-sup00-ASIC07;str-sonic-sup00-ASIC08;str-sonic-sup00-ASIC09;str-sonic-sup00-ASIC10;str-sonic-sup00-ASIC11 + + + Group + + str-sonic + + + DcCode + + STR + + + CloudType + + Public + + + Location + + TBD + + + Function + + LabTest + + + DeploymentId + + 3 + + + SonicEnabled + + True + + + Region + + test + + + + + str-sonic + + + CloudType + + Public + + + ConfigDbAclFile + + SonicNativeAcl.liquid + + + ConfigTemplateFile + + Sonic.xml + + + DNSServers + + 10.64.5.5;10.64.6.6;10.64.6.7 + + + DcCode + + STR + + + DeploymentId + + 3 + + + EnableStreamingTelemetry + + true + + + ErspanDestinationIpv4 + + 10.20.6.4 + + + Function + + LabTest + + + Group + + str:542907040 + + + InitConfigTemplateFile + + Sonic.init.xml + + + Location + + TBD + + + Loopback0Ipv4 + + 10.2.0.1/32;10.2.0.2/32;10.2.0.3/32;10.2.0.4/32 + + + Loopback0Ipv6 + + fc00:20::1/128;fc00:21::1/128;fc00:22::1/128;fc00:23::1/128 + + + Loopback4096Ipv4 + + 192.0.0.1/32;192.0.0.2/32;192.0.0.8/32;192.0.0.9/32 + + + Loopback4096Ipv6 + + 2603:10e2:400::1/128;2603:10e2:400::2/128;2603:10e2:400::8/128;2603:10e2:400::9/128 + + + MacSecEnabled + + True + + + MacSecProfile + usstagee.Sonic.MacSec + PrimaryKey="macsec-profile-two" FallbackKey="macsec-profile" MacsecPolicy="" + + + ManagementIpv4 + + 10.3.146.58/24;10.3.146.71/24;10.3.146.72/24;10.3.146.74/24;10.3.146.75/24;10.3.146.80/24;10.3.146.81/24;10.3.146.83/24 + + + ManagementIpv6 + + 2a01:111:e210:3000::a03:923a/64;2a01:111:e210:3000::a03:9247/64;2a01:111:e210:3000::a03:9248/64;2a01:111:e210:3000::a03:924a/64;2a01:111:e210:3000::a03:924b/64;2a01:111:e210:3000::a03:9250/64;2a01:111:e210:3000::a03:9251/64;2a01:111:e210:3000::a03:9253/64 + + + MaxCountOfCores + + 64 + + + NtpResources + Public.Ntp + 17.39.1.129;17.39.1.130 + + + QosProfile + + VerlaineLongHaul + + + RemoteAuthenticationProtocol + + Tacacs + + + SnmpResources + + 10.52.180.161;10.3.157.12 + + + SonicConfigTemplateFile + + Sonic.xml + + + SonicEnabled + + True + + + SyslogResources + + 10.52.180.161;10.3.157.12 + + + SyslogServer + + 10.20.4.167;10.20.7.33;10.20.6.16;10.20.6.84 + + + TacacsKey + + $Secrets.TacacsKey + + + TacacsSecurityLevel + + 7 + + + TacacsServer + + 123.46.98.21 + + + TotalCountOfVoQ + + 8 + + + Region + + test + + + ChassisEnabled + + true + + + + + + + + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth0 + true + str-sonic-lc05-ASIC00 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth2 + true + str-sonic-lc05-ASIC00 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth5 + true + str-sonic-lc05-ASIC00 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth12 + true + str-sonic-lc04-ASIC00 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth13 + true + str-sonic-lc04-ASIC00 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth14 + true + str-sonic-lc04-ASIC00 + Eth391 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth17 + true + str-sonic-lc04-ASIC00 + Eth389 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth18 + true + str-sonic-lc04-ASIC00 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth20 + true + str-sonic-lc03-ASIC00 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth21 + true + str-sonic-lc03-ASIC00 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth22 + true + str-sonic-lc03-ASIC00 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth24 + true + str-sonic-lc03-ASIC01 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth25 + true + str-sonic-lc03-ASIC00 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth26 + true + str-sonic-lc04-ASIC00 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth29 + true + str-sonic-lc04-ASIC00 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth33 + true + str-sonic-lc10-ASIC00 + Eth388 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth34 + true + str-sonic-lc10-ASIC00 + Eth390 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth37 + true + str-sonic-lc04-ASIC00 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth39 + true + str-sonic-lc03-ASIC01 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth40 + true + str-sonic-lc03-ASIC00 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth41 + true + str-sonic-lc03-ASIC00 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth42 + true + str-sonic-lc03-ASIC01 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth43 + true + str-sonic-lc03-ASIC00 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth44 + true + str-sonic-lc03-ASIC01 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth45 + true + str-sonic-lc03-ASIC01 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth46 + true + str-sonic-lc03-ASIC01 + Eth451 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth448 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth49 + true + str-sonic-lc09-ASIC00 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth50 + true + str-sonic-lc08-ASIC00 + Eth388 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth52 + true + str-sonic-lc09-ASIC00 + Eth389 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth54 + true + str-sonic-lc08-ASIC00 + Eth390 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth55 + true + str-sonic-lc09-ASIC00 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth57 + true + str-sonic-lc09-ASIC00 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth59 + true + str-sonic-lc09-ASIC00 + Eth391 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth64 + true + str-sonic-lc10-ASIC00 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth65 + true + str-sonic-lc10-ASIC00 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth66 + true + str-sonic-lc10-ASIC00 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth72 + true + str-sonic-lc10-ASIC00 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth74 + true + str-sonic-lc10-ASIC00 + Eth389 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth75 + true + str-sonic-lc10-ASIC00 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth80 + true + str-sonic-lc09-ASIC00 + Eth388 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth81 + true + str-sonic-lc03-ASIC00 + Eth384 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth82 + true + str-sonic-lc03-ASIC00 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth83 + true + str-sonic-lc03-ASIC01 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth84 + true + str-sonic-lc10-ASIC00 + Eth391 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth86 + true + str-sonic-lc10-ASIC00 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth88 + true + str-sonic-lc03-ASIC00 + Eth387 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth89 + true + str-sonic-lc03-ASIC00 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth90 + true + str-sonic-lc03-ASIC01 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth91 + true + str-sonic-lc03-ASIC01 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth92 + true + str-sonic-lc09-ASIC00 + Eth390 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth94 + true + str-sonic-lc03-ASIC00 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth95 + true + str-sonic-lc03-ASIC01 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth96 + true + str-sonic-lc09-ASIC00 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth98 + true + str-sonic-lc09-ASIC00 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth103 + true + str-sonic-lc09-ASIC00 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth108 + true + str-sonic-lc08-ASIC00 + Eth391 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth109 + true + str-sonic-lc08-ASIC00 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth113 + true + str-sonic-lc08-ASIC00 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth114 + true + str-sonic-lc08-ASIC00 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth115 + true + str-sonic-lc08-ASIC00 + Eth389 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth116 + true + str-sonic-lc08-ASIC00 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth121 + true + str-sonic-lc08-ASIC00 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth125 + true + str-sonic-lc07-ASIC00 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth126 + true + str-sonic-lc08-ASIC00 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth127 + true + str-sonic-lc07-ASIC00 + Eth391 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth129 + true + str-sonic-lc07-ASIC00 + Eth389 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth131 + true + str-sonic-lc07-ASIC00 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth132 + true + str-sonic-lc07-ASIC00 + Eth390 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth136 + true + str-sonic-lc07-ASIC00 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth138 + true + str-sonic-lc07-ASIC00 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth141 + true + str-sonic-lc07-ASIC00 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth143 + true + str-sonic-lc07-ASIC00 + Eth388 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth145 + true + str-sonic-lc05-ASIC00 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth147 + true + str-sonic-lc05-ASIC00 + Eth389 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth148 + true + str-sonic-lc05-ASIC00 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth153 + true + str-sonic-lc04-ASIC00 + Eth388 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth154 + true + str-sonic-lc04-ASIC00 + Eth390 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth156 + true + str-sonic-lc05-ASIC00 + Eth391 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth157 + true + str-sonic-lc05-ASIC00 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth160 + true + str-sonic-lc06-ASIC00 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth161 + true + str-sonic-lc05-ASIC00 + Eth388 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth164 + true + str-sonic-lc06-ASIC00 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth170 + true + str-sonic-lc06-ASIC00 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth171 + true + str-sonic-lc05-ASIC00 + Eth390 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth389 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth178 + true + str-sonic-lc06-ASIC00 + Eth391 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth179 + true + str-sonic-lc06-ASIC00 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth181 + true + str-sonic-lc06-ASIC00 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth390 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth186 + true + str-sonic-lc06-ASIC00 + Eth388 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC02 + Eth190 + true + str-sonic-lc07-ASIC00 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth3 + true + str-sonic-lc04-ASIC00 + Eth415 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth6 + true + str-sonic-lc04-ASIC00 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth7 + true + str-sonic-lc04-ASIC00 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth9 + true + str-sonic-lc04-ASIC00 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth13 + true + str-sonic-lc04-ASIC00 + Eth413 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth17 + true + str-sonic-lc04-ASIC00 + Eth412 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth19 + true + str-sonic-lc04-ASIC00 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth22 + true + str-sonic-lc04-ASIC00 + Eth414 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth24 + true + str-sonic-lc03-ASIC00 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth25 + true + str-sonic-lc03-ASIC01 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth26 + true + str-sonic-lc03-ASIC01 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth27 + true + str-sonic-lc03-ASIC00 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth28 + true + str-sonic-lc03-ASIC00 + Eth397 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth29 + true + str-sonic-lc03-ASIC01 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth30 + true + str-sonic-lc03-ASIC01 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth31 + true + str-sonic-lc03-ASIC00 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth32 + true + str-sonic-lc03-ASIC01 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth33 + true + str-sonic-lc03-ASIC00 + Eth388 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth34 + true + str-sonic-lc03-ASIC00 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth36 + true + str-sonic-lc03-ASIC00 + Eth399 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth37 + true + str-sonic-lc03-ASIC01 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth38 + true + str-sonic-lc03-ASIC01 + Eth396 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth39 + true + str-sonic-lc03-ASIC00 + Eth390 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth40 + true + str-sonic-lc03-ASIC01 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth41 + true + str-sonic-lc03-ASIC01 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth42 + true + str-sonic-lc03-ASIC00 + Eth407 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth43 + true + str-sonic-lc03-ASIC01 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth44 + true + str-sonic-lc03-ASIC00 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth45 + true + str-sonic-lc03-ASIC00 + Eth385 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth46 + true + str-sonic-lc03-ASIC00 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth49 + true + str-sonic-lc09-ASIC00 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth50 + true + str-sonic-lc09-ASIC00 + Eth412 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth54 + true + str-sonic-lc09-ASIC00 + Eth414 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth59 + true + str-sonic-lc09-ASIC00 + Eth413 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth61 + true + str-sonic-lc09-ASIC00 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth67 + true + str-sonic-lc09-ASIC00 + Eth415 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth68 + true + str-sonic-lc09-ASIC00 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth71 + true + str-sonic-lc09-ASIC00 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth72 + true + str-sonic-lc10-ASIC00 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth73 + true + str-sonic-lc10-ASIC00 + Eth412 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth77 + true + str-sonic-lc10-ASIC00 + Eth414 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth81 + true + str-sonic-lc10-ASIC00 + Eth413 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth87 + true + str-sonic-lc10-ASIC00 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth88 + true + str-sonic-lc10-ASIC00 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth90 + true + str-sonic-lc10-ASIC00 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth94 + true + str-sonic-lc10-ASIC00 + Eth415 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth98 + true + str-sonic-lc08-ASIC00 + Eth415 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth100 + true + str-sonic-lc08-ASIC00 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth101 + true + str-sonic-lc08-ASIC00 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth107 + true + str-sonic-lc08-ASIC00 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth111 + true + str-sonic-lc08-ASIC00 + Eth413 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth112 + true + str-sonic-lc08-ASIC00 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth113 + true + str-sonic-lc08-ASIC00 + Eth412 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth116 + true + str-sonic-lc08-ASIC00 + Eth414 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth123 + true + str-sonic-lc07-ASIC00 + Eth415 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth124 + true + str-sonic-lc07-ASIC00 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth125 + true + str-sonic-lc07-ASIC00 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth129 + true + str-sonic-lc07-ASIC00 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth134 + true + str-sonic-lc07-ASIC00 + Eth413 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth139 + true + str-sonic-lc07-ASIC00 + Eth414 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth140 + true + str-sonic-lc07-ASIC00 + Eth412 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth143 + true + str-sonic-lc07-ASIC00 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth144 + true + str-sonic-lc05-ASIC00 + Eth412 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth145 + true + str-sonic-lc05-ASIC00 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth149 + true + str-sonic-lc05-ASIC00 + Eth414 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth154 + true + str-sonic-lc05-ASIC00 + Eth413 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth158 + true + str-sonic-lc05-ASIC00 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth163 + true + str-sonic-lc05-ASIC00 + Eth415 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth164 + true + str-sonic-lc05-ASIC00 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth167 + true + str-sonic-lc05-ASIC00 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth412 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth414 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth177 + true + str-sonic-lc06-ASIC00 + Eth413 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth182 + true + str-sonic-lc06-ASIC00 + Eth404 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth187 + true + str-sonic-lc06-ASIC00 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC03 + Eth188 + true + str-sonic-lc06-ASIC00 + Eth415 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth0 + true + str-sonic-lc05-ASIC00 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth2 + true + str-sonic-lc05-ASIC00 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth5 + true + str-sonic-lc05-ASIC00 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth12 + true + str-sonic-lc04-ASIC00 + Eth488 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth13 + true + str-sonic-lc04-ASIC00 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth14 + true + str-sonic-lc04-ASIC00 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth15 + true + str-sonic-lc05-ASIC00 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth17 + true + str-sonic-lc04-ASIC00 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth18 + true + str-sonic-lc04-ASIC00 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth20 + true + str-sonic-lc03-ASIC00 + Eth462 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth21 + true + str-sonic-lc03-ASIC00 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth22 + true + str-sonic-lc03-ASIC00 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth24 + true + str-sonic-lc03-ASIC01 + Eth541 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth25 + true + str-sonic-lc03-ASIC00 + Eth458 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth26 + true + str-sonic-lc04-ASIC00 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth29 + true + str-sonic-lc04-ASIC00 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth33 + true + str-sonic-lc10-ASIC00 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth34 + true + str-sonic-lc10-ASIC00 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth37 + true + str-sonic-lc04-ASIC00 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth38 + true + str-sonic-lc04-ASIC00 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth39 + true + str-sonic-lc03-ASIC01 + Eth420 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth40 + true + str-sonic-lc03-ASIC00 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth41 + true + str-sonic-lc03-ASIC00 + Eth468 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth42 + true + str-sonic-lc03-ASIC01 + Eth422 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth43 + true + str-sonic-lc03-ASIC00 + Eth470 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth44 + true + str-sonic-lc03-ASIC01 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth45 + true + str-sonic-lc03-ASIC01 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth46 + true + str-sonic-lc03-ASIC01 + Eth536 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth538 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth49 + true + str-sonic-lc09-ASIC00 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth50 + true + str-sonic-lc08-ASIC00 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth52 + true + str-sonic-lc09-ASIC00 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth54 + true + str-sonic-lc08-ASIC00 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth55 + true + str-sonic-lc09-ASIC00 + Eth488 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth57 + true + str-sonic-lc09-ASIC00 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth58 + true + str-sonic-lc10-ASIC00 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth59 + true + str-sonic-lc09-ASIC00 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth64 + true + str-sonic-lc10-ASIC00 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth65 + true + str-sonic-lc10-ASIC00 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth66 + true + str-sonic-lc10-ASIC00 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth72 + true + str-sonic-lc10-ASIC00 + Eth488 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth74 + true + str-sonic-lc10-ASIC00 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth75 + true + str-sonic-lc10-ASIC00 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth80 + true + str-sonic-lc09-ASIC00 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth81 + true + str-sonic-lc03-ASIC00 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth82 + true + str-sonic-lc03-ASIC00 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth83 + true + str-sonic-lc03-ASIC01 + Eth556 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth84 + true + str-sonic-lc10-ASIC00 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth86 + true + str-sonic-lc10-ASIC00 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth88 + true + str-sonic-lc03-ASIC00 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth89 + true + str-sonic-lc03-ASIC00 + Eth456 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth90 + true + str-sonic-lc03-ASIC01 + Eth562 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth91 + true + str-sonic-lc03-ASIC01 + Eth559 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth92 + true + str-sonic-lc09-ASIC00 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth94 + true + str-sonic-lc03-ASIC00 + Eth459 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth95 + true + str-sonic-lc03-ASIC01 + Eth553 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth96 + true + str-sonic-lc09-ASIC00 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth98 + true + str-sonic-lc09-ASIC00 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth100 + true + str-sonic-lc09-ASIC00 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth103 + true + str-sonic-lc09-ASIC00 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth108 + true + str-sonic-lc08-ASIC00 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth109 + true + str-sonic-lc08-ASIC00 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth113 + true + str-sonic-lc08-ASIC00 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth114 + true + str-sonic-lc08-ASIC00 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth115 + true + str-sonic-lc08-ASIC00 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth116 + true + str-sonic-lc08-ASIC00 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth121 + true + str-sonic-lc08-ASIC00 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth125 + true + str-sonic-lc07-ASIC00 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth126 + true + str-sonic-lc08-ASIC00 + Eth488 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth127 + true + str-sonic-lc07-ASIC00 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth129 + true + str-sonic-lc07-ASIC00 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth131 + true + str-sonic-lc07-ASIC00 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth132 + true + str-sonic-lc07-ASIC00 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth135 + true + str-sonic-lc08-ASIC00 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth136 + true + str-sonic-lc07-ASIC00 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth138 + true + str-sonic-lc07-ASIC00 + Eth488 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth141 + true + str-sonic-lc07-ASIC00 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth143 + true + str-sonic-lc07-ASIC00 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth145 + true + str-sonic-lc05-ASIC00 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth147 + true + str-sonic-lc05-ASIC00 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth148 + true + str-sonic-lc05-ASIC00 + Eth488 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth151 + true + str-sonic-lc06-ASIC00 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth153 + true + str-sonic-lc04-ASIC00 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth154 + true + str-sonic-lc04-ASIC00 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth156 + true + str-sonic-lc05-ASIC00 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth157 + true + str-sonic-lc05-ASIC00 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth160 + true + str-sonic-lc06-ASIC00 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth161 + true + str-sonic-lc05-ASIC00 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth164 + true + str-sonic-lc06-ASIC00 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth170 + true + str-sonic-lc06-ASIC00 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth171 + true + str-sonic-lc05-ASIC00 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth178 + true + str-sonic-lc06-ASIC00 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth179 + true + str-sonic-lc06-ASIC00 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth181 + true + str-sonic-lc06-ASIC00 + Eth488 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth186 + true + str-sonic-lc06-ASIC00 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth187 + true + str-sonic-lc07-ASIC00 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC04 + Eth190 + true + str-sonic-lc07-ASIC00 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth3 + true + str-sonic-lc04-ASIC00 + Eth483 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth6 + true + str-sonic-lc04-ASIC00 + Eth481 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth7 + true + str-sonic-lc04-ASIC00 + Eth475 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth9 + true + str-sonic-lc04-ASIC00 + Eth482 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth13 + true + str-sonic-lc04-ASIC00 + Eth480 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth17 + true + str-sonic-lc04-ASIC00 + Eth491 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth19 + true + str-sonic-lc04-ASIC00 + Eth490 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth22 + true + str-sonic-lc04-ASIC00 + Eth489 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth24 + true + str-sonic-lc03-ASIC00 + Eth427 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth25 + true + str-sonic-lc03-ASIC01 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth26 + true + str-sonic-lc03-ASIC01 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth27 + true + str-sonic-lc03-ASIC00 + Eth461 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth28 + true + str-sonic-lc03-ASIC00 + Eth424 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth29 + true + str-sonic-lc03-ASIC01 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth30 + true + str-sonic-lc03-ASIC01 + Eth457 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth31 + true + str-sonic-lc03-ASIC00 + Eth426 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth32 + true + str-sonic-lc03-ASIC01 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth33 + true + str-sonic-lc03-ASIC00 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth34 + true + str-sonic-lc03-ASIC00 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth469 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth36 + true + str-sonic-lc03-ASIC00 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth37 + true + str-sonic-lc03-ASIC01 + Eth463 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth38 + true + str-sonic-lc03-ASIC01 + Eth460 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth39 + true + str-sonic-lc03-ASIC00 + Eth425 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth40 + true + str-sonic-lc03-ASIC01 + Eth570 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth41 + true + str-sonic-lc03-ASIC01 + Eth565 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth42 + true + str-sonic-lc03-ASIC00 + Eth441 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth43 + true + str-sonic-lc03-ASIC01 + Eth574 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth44 + true + str-sonic-lc03-ASIC00 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth45 + true + str-sonic-lc03-ASIC00 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth46 + true + str-sonic-lc03-ASIC00 + Eth443 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth568 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth49 + true + str-sonic-lc09-ASIC00 + Eth490 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth50 + true + str-sonic-lc09-ASIC00 + Eth491 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth54 + true + str-sonic-lc09-ASIC00 + Eth489 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth59 + true + str-sonic-lc09-ASIC00 + Eth480 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth61 + true + str-sonic-lc09-ASIC00 + Eth482 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth67 + true + str-sonic-lc09-ASIC00 + Eth483 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth68 + true + str-sonic-lc09-ASIC00 + Eth475 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth71 + true + str-sonic-lc09-ASIC00 + Eth481 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth72 + true + str-sonic-lc10-ASIC00 + Eth490 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth73 + true + str-sonic-lc10-ASIC00 + Eth491 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth77 + true + str-sonic-lc10-ASIC00 + Eth489 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth81 + true + str-sonic-lc10-ASIC00 + Eth480 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth87 + true + str-sonic-lc10-ASIC00 + Eth482 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth88 + true + str-sonic-lc10-ASIC00 + Eth475 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth90 + true + str-sonic-lc10-ASIC00 + Eth481 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth94 + true + str-sonic-lc10-ASIC00 + Eth483 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth98 + true + str-sonic-lc08-ASIC00 + Eth483 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth100 + true + str-sonic-lc08-ASIC00 + Eth475 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth101 + true + str-sonic-lc08-ASIC00 + Eth481 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth107 + true + str-sonic-lc08-ASIC00 + Eth482 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth111 + true + str-sonic-lc08-ASIC00 + Eth480 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth112 + true + str-sonic-lc08-ASIC00 + Eth490 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth113 + true + str-sonic-lc08-ASIC00 + Eth491 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth116 + true + str-sonic-lc08-ASIC00 + Eth489 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth123 + true + str-sonic-lc07-ASIC00 + Eth483 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth124 + true + str-sonic-lc07-ASIC00 + Eth475 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth125 + true + str-sonic-lc07-ASIC00 + Eth481 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth129 + true + str-sonic-lc07-ASIC00 + Eth482 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth134 + true + str-sonic-lc07-ASIC00 + Eth480 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth139 + true + str-sonic-lc07-ASIC00 + Eth489 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth140 + true + str-sonic-lc07-ASIC00 + Eth491 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth143 + true + str-sonic-lc07-ASIC00 + Eth490 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth144 + true + str-sonic-lc05-ASIC00 + Eth491 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth145 + true + str-sonic-lc05-ASIC00 + Eth490 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth149 + true + str-sonic-lc05-ASIC00 + Eth489 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth154 + true + str-sonic-lc05-ASIC00 + Eth480 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth158 + true + str-sonic-lc05-ASIC00 + Eth482 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth163 + true + str-sonic-lc05-ASIC00 + Eth483 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth164 + true + str-sonic-lc05-ASIC00 + Eth475 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth167 + true + str-sonic-lc05-ASIC00 + Eth481 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth491 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth490 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth489 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth177 + true + str-sonic-lc06-ASIC00 + Eth480 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth182 + true + str-sonic-lc06-ASIC00 + Eth482 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth475 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth187 + true + str-sonic-lc06-ASIC00 + Eth481 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC05 + Eth188 + true + str-sonic-lc06-ASIC00 + Eth483 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth0 + true + str-sonic-lc05-ASIC00 + Eth449 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth1 + true + str-sonic-lc05-ASIC00 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth5 + true + str-sonic-lc05-ASIC00 + Eth450 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth12 + true + str-sonic-lc04-ASIC00 + Eth451 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth13 + true + str-sonic-lc04-ASIC00 + Eth448 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth14 + true + str-sonic-lc04-ASIC00 + Eth472 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth15 + true + str-sonic-lc05-ASIC00 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth17 + true + str-sonic-lc04-ASIC00 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth18 + true + str-sonic-lc04-ASIC00 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth20 + true + str-sonic-lc03-ASIC00 + Eth555 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth21 + true + str-sonic-lc03-ASIC00 + Eth558 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth22 + true + str-sonic-lc03-ASIC00 + Eth575 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth24 + true + str-sonic-lc03-ASIC01 + Eth482 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth25 + true + str-sonic-lc03-ASIC00 + Eth557 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth27 + true + str-sonic-lc04-ASIC00 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth29 + true + str-sonic-lc04-ASIC00 + Eth449 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth33 + true + str-sonic-lc10-ASIC00 + Eth474 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth34 + true + str-sonic-lc10-ASIC00 + Eth473 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth37 + true + str-sonic-lc04-ASIC00 + Eth450 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth38 + true + str-sonic-lc04-ASIC00 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth39 + true + str-sonic-lc03-ASIC01 + Eth439 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth40 + true + str-sonic-lc03-ASIC00 + Eth471 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth41 + true + str-sonic-lc03-ASIC00 + Eth474 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth42 + true + str-sonic-lc03-ASIC01 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth43 + true + str-sonic-lc03-ASIC00 + Eth542 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth44 + true + str-sonic-lc03-ASIC01 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth45 + true + str-sonic-lc03-ASIC01 + Eth437 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth46 + true + str-sonic-lc03-ASIC01 + Eth487 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth485 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth49 + true + str-sonic-lc09-ASIC00 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth50 + true + str-sonic-lc08-ASIC00 + Eth474 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth51 + true + str-sonic-lc09-ASIC00 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth52 + true + str-sonic-lc09-ASIC00 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth54 + true + str-sonic-lc08-ASIC00 + Eth473 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth55 + true + str-sonic-lc09-ASIC00 + Eth451 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth57 + true + str-sonic-lc09-ASIC00 + Eth448 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth58 + true + str-sonic-lc10-ASIC00 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth59 + true + str-sonic-lc09-ASIC00 + Eth472 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth64 + true + str-sonic-lc10-ASIC00 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth66 + true + str-sonic-lc10-ASIC00 + Eth449 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth69 + true + str-sonic-lc10-ASIC00 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth72 + true + str-sonic-lc10-ASIC00 + Eth451 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth74 + true + str-sonic-lc10-ASIC00 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth75 + true + str-sonic-lc10-ASIC00 + Eth450 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth80 + true + str-sonic-lc09-ASIC00 + Eth474 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth81 + true + str-sonic-lc03-ASIC00 + Eth566 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth82 + true + str-sonic-lc03-ASIC00 + Eth552 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth83 + true + str-sonic-lc03-ASIC01 + Eth502 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth84 + true + str-sonic-lc10-ASIC00 + Eth472 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth86 + true + str-sonic-lc10-ASIC00 + Eth448 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth88 + true + str-sonic-lc03-ASIC00 + Eth563 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth89 + true + str-sonic-lc03-ASIC00 + Eth560 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth90 + true + str-sonic-lc03-ASIC01 + Eth507 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth91 + true + str-sonic-lc03-ASIC01 + Eth496 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth92 + true + str-sonic-lc09-ASIC00 + Eth473 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth94 + true + str-sonic-lc03-ASIC00 + Eth554 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth95 + true + str-sonic-lc03-ASIC01 + Eth501 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth96 + true + str-sonic-lc09-ASIC00 + Eth449 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth100 + true + str-sonic-lc09-ASIC00 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth103 + true + str-sonic-lc09-ASIC00 + Eth450 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth108 + true + str-sonic-lc08-ASIC00 + Eth472 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth109 + true + str-sonic-lc08-ASIC00 + Eth448 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth113 + true + str-sonic-lc08-ASIC00 + Eth449 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth114 + true + str-sonic-lc08-ASIC00 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth115 + true + str-sonic-lc08-ASIC00 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth118 + true + str-sonic-lc08-ASIC00 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth121 + true + str-sonic-lc08-ASIC00 + Eth450 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth125 + true + str-sonic-lc07-ASIC00 + Eth448 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth126 + true + str-sonic-lc08-ASIC00 + Eth451 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth127 + true + str-sonic-lc07-ASIC00 + Eth472 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth129 + true + str-sonic-lc07-ASIC00 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth132 + true + str-sonic-lc07-ASIC00 + Eth473 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth135 + true + str-sonic-lc08-ASIC00 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth136 + true + str-sonic-lc07-ASIC00 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth138 + true + str-sonic-lc07-ASIC00 + Eth451 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth139 + true + str-sonic-lc07-ASIC00 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth141 + true + str-sonic-lc07-ASIC00 + Eth449 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth143 + true + str-sonic-lc07-ASIC00 + Eth474 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth145 + true + str-sonic-lc05-ASIC00 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth147 + true + str-sonic-lc05-ASIC00 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth148 + true + str-sonic-lc05-ASIC00 + Eth451 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth151 + true + str-sonic-lc06-ASIC00 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth153 + true + str-sonic-lc04-ASIC00 + Eth474 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth154 + true + str-sonic-lc04-ASIC00 + Eth473 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth156 + true + str-sonic-lc05-ASIC00 + Eth472 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth157 + true + str-sonic-lc05-ASIC00 + Eth448 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth160 + true + str-sonic-lc06-ASIC00 + Eth449 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth161 + true + str-sonic-lc05-ASIC00 + Eth474 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth164 + true + str-sonic-lc06-ASIC00 + Eth450 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth168 + true + str-sonic-lc06-ASIC00 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth171 + true + str-sonic-lc05-ASIC00 + Eth473 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth178 + true + str-sonic-lc06-ASIC00 + Eth472 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth179 + true + str-sonic-lc06-ASIC00 + Eth448 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth181 + true + str-sonic-lc06-ASIC00 + Eth451 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth473 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth186 + true + str-sonic-lc06-ASIC00 + Eth474 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth187 + true + str-sonic-lc07-ASIC00 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC06 + Eth190 + true + str-sonic-lc07-ASIC00 + Eth450 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth3 + true + str-sonic-lc04-ASIC00 + Eth441 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth6 + true + str-sonic-lc04-ASIC00 + Eth442 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth7 + true + str-sonic-lc04-ASIC00 + Eth443 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth9 + true + str-sonic-lc04-ASIC00 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth13 + true + str-sonic-lc04-ASIC00 + Eth440 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth17 + true + str-sonic-lc04-ASIC00 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth19 + true + str-sonic-lc04-ASIC00 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth22 + true + str-sonic-lc04-ASIC00 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth24 + true + str-sonic-lc03-ASIC00 + Eth473 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth25 + true + str-sonic-lc03-ASIC01 + Eth438 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth26 + true + str-sonic-lc03-ASIC01 + Eth524 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth27 + true + str-sonic-lc03-ASIC00 + Eth478 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth28 + true + str-sonic-lc03-ASIC00 + Eth475 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth29 + true + str-sonic-lc03-ASIC01 + Eth429 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth30 + true + str-sonic-lc03-ASIC01 + Eth532 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth31 + true + str-sonic-lc03-ASIC00 + Eth479 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth32 + true + str-sonic-lc03-ASIC01 + Eth430 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth33 + true + str-sonic-lc03-ASIC00 + Eth570 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth34 + true + str-sonic-lc03-ASIC00 + Eth573 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth527 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth36 + true + str-sonic-lc03-ASIC00 + Eth477 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth37 + true + str-sonic-lc03-ASIC01 + Eth528 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth38 + true + str-sonic-lc03-ASIC01 + Eth529 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth39 + true + str-sonic-lc03-ASIC00 + Eth574 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth40 + true + str-sonic-lc03-ASIC01 + Eth517 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth41 + true + str-sonic-lc03-ASIC01 + Eth508 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth42 + true + str-sonic-lc03-ASIC00 + Eth564 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth43 + true + str-sonic-lc03-ASIC01 + Eth514 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth44 + true + str-sonic-lc03-ASIC00 + Eth569 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth45 + true + str-sonic-lc03-ASIC00 + Eth567 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth46 + true + str-sonic-lc03-ASIC00 + Eth561 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth519 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth49 + true + str-sonic-lc09-ASIC00 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth50 + true + str-sonic-lc09-ASIC00 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth54 + true + str-sonic-lc09-ASIC00 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth59 + true + str-sonic-lc09-ASIC00 + Eth440 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth61 + true + str-sonic-lc09-ASIC00 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth67 + true + str-sonic-lc09-ASIC00 + Eth441 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth68 + true + str-sonic-lc09-ASIC00 + Eth443 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth71 + true + str-sonic-lc09-ASIC00 + Eth442 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth72 + true + str-sonic-lc10-ASIC00 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth73 + true + str-sonic-lc10-ASIC00 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth77 + true + str-sonic-lc10-ASIC00 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth81 + true + str-sonic-lc10-ASIC00 + Eth440 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth87 + true + str-sonic-lc10-ASIC00 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth88 + true + str-sonic-lc10-ASIC00 + Eth443 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth90 + true + str-sonic-lc10-ASIC00 + Eth442 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth94 + true + str-sonic-lc10-ASIC00 + Eth441 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth98 + true + str-sonic-lc08-ASIC00 + Eth441 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth100 + true + str-sonic-lc08-ASIC00 + Eth443 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth101 + true + str-sonic-lc08-ASIC00 + Eth442 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth107 + true + str-sonic-lc08-ASIC00 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth111 + true + str-sonic-lc08-ASIC00 + Eth440 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth112 + true + str-sonic-lc08-ASIC00 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth113 + true + str-sonic-lc08-ASIC00 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth116 + true + str-sonic-lc08-ASIC00 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth123 + true + str-sonic-lc07-ASIC00 + Eth441 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth124 + true + str-sonic-lc07-ASIC00 + Eth443 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth125 + true + str-sonic-lc07-ASIC00 + Eth442 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth129 + true + str-sonic-lc07-ASIC00 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth134 + true + str-sonic-lc07-ASIC00 + Eth440 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth139 + true + str-sonic-lc07-ASIC00 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth140 + true + str-sonic-lc07-ASIC00 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth143 + true + str-sonic-lc07-ASIC00 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth144 + true + str-sonic-lc05-ASIC00 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth145 + true + str-sonic-lc05-ASIC00 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth149 + true + str-sonic-lc05-ASIC00 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth154 + true + str-sonic-lc05-ASIC00 + Eth440 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth158 + true + str-sonic-lc05-ASIC00 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth163 + true + str-sonic-lc05-ASIC00 + Eth441 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth164 + true + str-sonic-lc05-ASIC00 + Eth443 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth167 + true + str-sonic-lc05-ASIC00 + Eth442 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth177 + true + str-sonic-lc06-ASIC00 + Eth440 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth182 + true + str-sonic-lc06-ASIC00 + Eth444 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth443 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth187 + true + str-sonic-lc06-ASIC00 + Eth442 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC07 + Eth188 + true + str-sonic-lc06-ASIC00 + Eth441 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth0 + true + str-sonic-lc05-ASIC00 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth1 + true + str-sonic-lc05-ASIC00 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth5 + true + str-sonic-lc05-ASIC00 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth12 + true + str-sonic-lc04-ASIC00 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth13 + true + str-sonic-lc04-ASIC00 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth14 + true + str-sonic-lc04-ASIC00 + Eth385 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth15 + true + str-sonic-lc05-ASIC00 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth17 + true + str-sonic-lc04-ASIC00 + Eth386 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth18 + true + str-sonic-lc04-ASIC00 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth20 + true + str-sonic-lc03-ASIC00 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth21 + true + str-sonic-lc03-ASIC00 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth22 + true + str-sonic-lc03-ASIC00 + Eth530 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth24 + true + str-sonic-lc03-ASIC01 + Eth465 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth25 + true + str-sonic-lc03-ASIC00 + Eth531 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth27 + true + str-sonic-lc04-ASIC00 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth29 + true + str-sonic-lc04-ASIC00 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth33 + true + str-sonic-lc10-ASIC00 + Eth387 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth34 + true + str-sonic-lc10-ASIC00 + Eth384 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth567 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth37 + true + str-sonic-lc04-ASIC00 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth38 + true + str-sonic-lc04-ASIC00 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth39 + true + str-sonic-lc03-ASIC01 + Eth571 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth40 + true + str-sonic-lc03-ASIC00 + Eth540 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth41 + true + str-sonic-lc03-ASIC00 + Eth533 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth42 + true + str-sonic-lc03-ASIC01 + Eth572 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth43 + true + str-sonic-lc03-ASIC00 + Eth436 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth44 + true + str-sonic-lc03-ASIC01 + Eth471 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth45 + true + str-sonic-lc03-ASIC01 + Eth468 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth46 + true + str-sonic-lc03-ASIC01 + Eth450 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth458 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth49 + true + str-sonic-lc09-ASIC00 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth50 + true + str-sonic-lc08-ASIC00 + Eth387 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth51 + true + str-sonic-lc09-ASIC00 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth52 + true + str-sonic-lc09-ASIC00 + Eth386 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth54 + true + str-sonic-lc08-ASIC00 + Eth384 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth55 + true + str-sonic-lc09-ASIC00 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth57 + true + str-sonic-lc09-ASIC00 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth58 + true + str-sonic-lc10-ASIC00 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth59 + true + str-sonic-lc09-ASIC00 + Eth385 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth64 + true + str-sonic-lc10-ASIC00 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth66 + true + str-sonic-lc10-ASIC00 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth69 + true + str-sonic-lc10-ASIC00 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth72 + true + str-sonic-lc10-ASIC00 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth74 + true + str-sonic-lc10-ASIC00 + Eth386 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth75 + true + str-sonic-lc10-ASIC00 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth80 + true + str-sonic-lc09-ASIC00 + Eth387 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth81 + true + str-sonic-lc03-ASIC00 + Eth423 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth82 + true + str-sonic-lc03-ASIC00 + Eth421 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth83 + true + str-sonic-lc03-ASIC01 + Eth470 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth84 + true + str-sonic-lc10-ASIC00 + Eth385 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth86 + true + str-sonic-lc10-ASIC00 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth88 + true + str-sonic-lc03-ASIC00 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth89 + true + str-sonic-lc03-ASIC00 + Eth431 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth90 + true + str-sonic-lc03-ASIC01 + Eth459 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth91 + true + str-sonic-lc03-ASIC01 + Eth467 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth92 + true + str-sonic-lc09-ASIC00 + Eth384 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth94 + true + str-sonic-lc03-ASIC00 + Eth428 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth95 + true + str-sonic-lc03-ASIC01 + Eth462 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth96 + true + str-sonic-lc09-ASIC00 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth100 + true + str-sonic-lc09-ASIC00 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth103 + true + str-sonic-lc09-ASIC00 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth108 + true + str-sonic-lc08-ASIC00 + Eth385 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth109 + true + str-sonic-lc08-ASIC00 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth113 + true + str-sonic-lc08-ASIC00 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth114 + true + str-sonic-lc08-ASIC00 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth115 + true + str-sonic-lc08-ASIC00 + Eth386 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth118 + true + str-sonic-lc08-ASIC00 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth121 + true + str-sonic-lc08-ASIC00 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth125 + true + str-sonic-lc07-ASIC00 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth126 + true + str-sonic-lc08-ASIC00 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth127 + true + str-sonic-lc07-ASIC00 + Eth385 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth129 + true + str-sonic-lc07-ASIC00 + Eth386 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth132 + true + str-sonic-lc07-ASIC00 + Eth384 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth135 + true + str-sonic-lc08-ASIC00 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth136 + true + str-sonic-lc07-ASIC00 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth138 + true + str-sonic-lc07-ASIC00 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth139 + true + str-sonic-lc07-ASIC00 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth141 + true + str-sonic-lc07-ASIC00 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth143 + true + str-sonic-lc07-ASIC00 + Eth387 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth145 + true + str-sonic-lc05-ASIC00 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth147 + true + str-sonic-lc05-ASIC00 + Eth386 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth148 + true + str-sonic-lc05-ASIC00 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth151 + true + str-sonic-lc06-ASIC00 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth153 + true + str-sonic-lc04-ASIC00 + Eth387 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth154 + true + str-sonic-lc04-ASIC00 + Eth384 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth156 + true + str-sonic-lc05-ASIC00 + Eth385 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth157 + true + str-sonic-lc05-ASIC00 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth160 + true + str-sonic-lc06-ASIC00 + Eth403 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth161 + true + str-sonic-lc05-ASIC00 + Eth387 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth164 + true + str-sonic-lc06-ASIC00 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth168 + true + str-sonic-lc06-ASIC00 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth393 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth171 + true + str-sonic-lc05-ASIC00 + Eth384 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth386 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth178 + true + str-sonic-lc06-ASIC00 + Eth385 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth179 + true + str-sonic-lc06-ASIC00 + Eth394 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth181 + true + str-sonic-lc06-ASIC00 + Eth401 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth384 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth186 + true + str-sonic-lc06-ASIC00 + Eth387 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth187 + true + str-sonic-lc07-ASIC00 + Eth392 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC08 + Eth190 + true + str-sonic-lc07-ASIC00 + Eth402 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth3 + true + str-sonic-lc04-ASIC00 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth6 + true + str-sonic-lc04-ASIC00 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth7 + true + str-sonic-lc04-ASIC00 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth9 + true + str-sonic-lc04-ASIC00 + Eth410 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth13 + true + str-sonic-lc04-ASIC00 + Eth408 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth17 + true + str-sonic-lc04-ASIC00 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth19 + true + str-sonic-lc04-ASIC00 + Eth411 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth22 + true + str-sonic-lc04-ASIC00 + Eth409 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth24 + true + str-sonic-lc03-ASIC00 + Eth543 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth25 + true + str-sonic-lc03-ASIC01 + Eth575 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth26 + true + str-sonic-lc03-ASIC01 + Eth453 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth27 + true + str-sonic-lc03-ASIC00 + Eth395 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth28 + true + str-sonic-lc03-ASIC00 + Eth535 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth29 + true + str-sonic-lc03-ASIC01 + Eth447 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth30 + true + str-sonic-lc03-ASIC01 + Eth573 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth31 + true + str-sonic-lc03-ASIC00 + Eth539 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth32 + true + str-sonic-lc03-ASIC01 + Eth449 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth33 + true + str-sonic-lc03-ASIC00 + Eth391 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth34 + true + str-sonic-lc03-ASIC00 + Eth537 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth452 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth36 + true + str-sonic-lc03-ASIC00 + Eth398 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth37 + true + str-sonic-lc03-ASIC01 + Eth455 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth38 + true + str-sonic-lc03-ASIC01 + Eth446 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth39 + true + str-sonic-lc03-ASIC00 + Eth534 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth40 + true + str-sonic-lc03-ASIC01 + Eth454 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth41 + true + str-sonic-lc03-ASIC01 + Eth464 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth42 + true + str-sonic-lc03-ASIC00 + Eth386 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth43 + true + str-sonic-lc03-ASIC01 + Eth461 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth44 + true + str-sonic-lc03-ASIC00 + Eth406 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth45 + true + str-sonic-lc03-ASIC00 + Eth389 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth46 + true + str-sonic-lc03-ASIC00 + Eth405 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth456 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth49 + true + str-sonic-lc09-ASIC00 + Eth411 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth50 + true + str-sonic-lc09-ASIC00 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth54 + true + str-sonic-lc09-ASIC00 + Eth409 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth59 + true + str-sonic-lc09-ASIC00 + Eth408 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth61 + true + str-sonic-lc09-ASIC00 + Eth410 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth67 + true + str-sonic-lc09-ASIC00 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth68 + true + str-sonic-lc09-ASIC00 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth71 + true + str-sonic-lc09-ASIC00 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth72 + true + str-sonic-lc10-ASIC00 + Eth411 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth73 + true + str-sonic-lc10-ASIC00 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth77 + true + str-sonic-lc10-ASIC00 + Eth409 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth81 + true + str-sonic-lc10-ASIC00 + Eth408 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth87 + true + str-sonic-lc10-ASIC00 + Eth410 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth88 + true + str-sonic-lc10-ASIC00 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth90 + true + str-sonic-lc10-ASIC00 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth94 + true + str-sonic-lc10-ASIC00 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth98 + true + str-sonic-lc08-ASIC00 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth100 + true + str-sonic-lc08-ASIC00 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth101 + true + str-sonic-lc08-ASIC00 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth107 + true + str-sonic-lc08-ASIC00 + Eth410 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth111 + true + str-sonic-lc08-ASIC00 + Eth408 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth112 + true + str-sonic-lc08-ASIC00 + Eth411 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth113 + true + str-sonic-lc08-ASIC00 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth116 + true + str-sonic-lc08-ASIC00 + Eth409 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth123 + true + str-sonic-lc07-ASIC00 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth124 + true + str-sonic-lc07-ASIC00 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth125 + true + str-sonic-lc07-ASIC00 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth129 + true + str-sonic-lc07-ASIC00 + Eth410 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth134 + true + str-sonic-lc07-ASIC00 + Eth408 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth139 + true + str-sonic-lc07-ASIC00 + Eth409 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth140 + true + str-sonic-lc07-ASIC00 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth143 + true + str-sonic-lc07-ASIC00 + Eth411 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth144 + true + str-sonic-lc05-ASIC00 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth145 + true + str-sonic-lc05-ASIC00 + Eth411 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth149 + true + str-sonic-lc05-ASIC00 + Eth409 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth154 + true + str-sonic-lc05-ASIC00 + Eth408 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth158 + true + str-sonic-lc05-ASIC00 + Eth410 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth163 + true + str-sonic-lc05-ASIC00 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth164 + true + str-sonic-lc05-ASIC00 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth167 + true + str-sonic-lc05-ASIC00 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth400 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth411 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth409 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth177 + true + str-sonic-lc06-ASIC00 + Eth408 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth182 + true + str-sonic-lc06-ASIC00 + Eth410 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth418 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth187 + true + str-sonic-lc06-ASIC00 + Eth417 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC09 + Eth188 + true + str-sonic-lc06-ASIC00 + Eth419 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth0 + true + str-sonic-lc05-ASIC00 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth5 + true + str-sonic-lc05-ASIC00 + Eth493 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth12 + true + str-sonic-lc04-ASIC00 + Eth495 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth13 + true + str-sonic-lc04-ASIC00 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth14 + true + str-sonic-lc04-ASIC00 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth15 + true + str-sonic-lc05-ASIC00 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth17 + true + str-sonic-lc04-ASIC00 + Eth426 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth18 + true + str-sonic-lc04-ASIC00 + Eth427 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth20 + true + str-sonic-lc03-ASIC00 + Eth562 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth21 + true + str-sonic-lc03-ASIC00 + Eth559 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth22 + true + str-sonic-lc03-ASIC00 + Eth518 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth23 + true + str-sonic-lc04-ASIC00 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth24 + true + str-sonic-lc03-ASIC01 + Eth540 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth25 + true + str-sonic-lc03-ASIC00 + Eth497 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth29 + true + str-sonic-lc04-ASIC00 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth33 + true + str-sonic-lc10-ASIC00 + Eth425 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth34 + true + str-sonic-lc10-ASIC00 + Eth424 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth523 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth37 + true + str-sonic-lc04-ASIC00 + Eth493 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth38 + true + str-sonic-lc04-ASIC00 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth39 + true + str-sonic-lc03-ASIC01 + Eth520 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth40 + true + str-sonic-lc03-ASIC00 + Eth440 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth41 + true + str-sonic-lc03-ASIC00 + Eth556 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth42 + true + str-sonic-lc03-ASIC01 + Eth521 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth43 + true + str-sonic-lc03-ASIC00 + Eth553 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth44 + true + str-sonic-lc03-ASIC01 + Eth534 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth45 + true + str-sonic-lc03-ASIC01 + Eth535 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth46 + true + str-sonic-lc03-ASIC01 + Eth531 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth530 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth49 + true + str-sonic-lc09-ASIC00 + Eth427 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth50 + true + str-sonic-lc08-ASIC00 + Eth425 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth52 + true + str-sonic-lc09-ASIC00 + Eth426 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth54 + true + str-sonic-lc08-ASIC00 + Eth424 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth55 + true + str-sonic-lc09-ASIC00 + Eth495 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth57 + true + str-sonic-lc09-ASIC00 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth58 + true + str-sonic-lc10-ASIC00 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth59 + true + str-sonic-lc09-ASIC00 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth64 + true + str-sonic-lc10-ASIC00 + Eth427 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth66 + true + str-sonic-lc10-ASIC00 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth72 + true + str-sonic-lc10-ASIC00 + Eth495 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth74 + true + str-sonic-lc10-ASIC00 + Eth426 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth75 + true + str-sonic-lc10-ASIC00 + Eth493 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth80 + true + str-sonic-lc09-ASIC00 + Eth425 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth81 + true + str-sonic-lc03-ASIC00 + Eth476 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth82 + true + str-sonic-lc03-ASIC00 + Eth572 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth83 + true + str-sonic-lc03-ASIC01 + Eth533 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth84 + true + str-sonic-lc10-ASIC00 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth86 + true + str-sonic-lc10-ASIC00 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth87 + true + str-sonic-lc09-ASIC00 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth88 + true + str-sonic-lc03-ASIC00 + Eth571 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth89 + true + str-sonic-lc03-ASIC00 + Eth568 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth90 + true + str-sonic-lc03-ASIC01 + Eth554 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth91 + true + str-sonic-lc03-ASIC01 + Eth537 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth92 + true + str-sonic-lc09-ASIC00 + Eth424 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth93 + true + str-sonic-lc10-ASIC00 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth94 + true + str-sonic-lc03-ASIC00 + Eth565 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth95 + true + str-sonic-lc03-ASIC01 + Eth543 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth96 + true + str-sonic-lc09-ASIC00 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth100 + true + str-sonic-lc09-ASIC00 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth103 + true + str-sonic-lc09-ASIC00 + Eth493 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth105 + true + str-sonic-lc08-ASIC00 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth108 + true + str-sonic-lc08-ASIC00 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth109 + true + str-sonic-lc08-ASIC00 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth113 + true + str-sonic-lc08-ASIC00 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth114 + true + str-sonic-lc08-ASIC00 + Eth427 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth115 + true + str-sonic-lc08-ASIC00 + Eth426 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth121 + true + str-sonic-lc08-ASIC00 + Eth493 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth125 + true + str-sonic-lc07-ASIC00 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth126 + true + str-sonic-lc08-ASIC00 + Eth495 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth127 + true + str-sonic-lc07-ASIC00 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth129 + true + str-sonic-lc07-ASIC00 + Eth426 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth132 + true + str-sonic-lc07-ASIC00 + Eth424 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth135 + true + str-sonic-lc08-ASIC00 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth136 + true + str-sonic-lc07-ASIC00 + Eth427 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth138 + true + str-sonic-lc07-ASIC00 + Eth495 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth141 + true + str-sonic-lc07-ASIC00 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth143 + true + str-sonic-lc07-ASIC00 + Eth425 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth145 + true + str-sonic-lc05-ASIC00 + Eth427 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth147 + true + str-sonic-lc05-ASIC00 + Eth426 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth148 + true + str-sonic-lc05-ASIC00 + Eth495 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth151 + true + str-sonic-lc06-ASIC00 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth153 + true + str-sonic-lc04-ASIC00 + Eth425 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth154 + true + str-sonic-lc04-ASIC00 + Eth424 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth155 + true + str-sonic-lc05-ASIC00 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth156 + true + str-sonic-lc05-ASIC00 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth157 + true + str-sonic-lc05-ASIC00 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth160 + true + str-sonic-lc06-ASIC00 + Eth434 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth161 + true + str-sonic-lc05-ASIC00 + Eth425 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth164 + true + str-sonic-lc06-ASIC00 + Eth493 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth427 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth171 + true + str-sonic-lc05-ASIC00 + Eth424 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth426 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth178 + true + str-sonic-lc06-ASIC00 + Eth416 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth179 + true + str-sonic-lc06-ASIC00 + Eth433 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth181 + true + str-sonic-lc06-ASIC00 + Eth495 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth424 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth185 + true + str-sonic-lc07-ASIC00 + Eth432 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth186 + true + str-sonic-lc06-ASIC00 + Eth425 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth187 + true + str-sonic-lc07-ASIC00 + Eth435 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC10 + Eth190 + true + str-sonic-lc07-ASIC00 + Eth493 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth3 + true + str-sonic-lc04-ASIC00 + Eth484 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth6 + true + str-sonic-lc04-ASIC00 + Eth476 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth7 + true + str-sonic-lc04-ASIC00 + Eth479 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth9 + true + str-sonic-lc04-ASIC00 + Eth486 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth13 + true + str-sonic-lc04-ASIC00 + Eth485 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth17 + true + str-sonic-lc04-ASIC00 + Eth494 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth19 + true + str-sonic-lc04-ASIC00 + Eth492 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth22 + true + str-sonic-lc04-ASIC00 + Eth487 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth24 + true + str-sonic-lc03-ASIC00 + Eth442 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth25 + true + str-sonic-lc03-ASIC01 + Eth564 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth26 + true + str-sonic-lc03-ASIC01 + Eth555 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth27 + true + str-sonic-lc03-ASIC00 + Eth445 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth28 + true + str-sonic-lc03-ASIC00 + Eth513 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth29 + true + str-sonic-lc03-ASIC01 + Eth561 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth30 + true + str-sonic-lc03-ASIC01 + Eth569 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth31 + true + str-sonic-lc03-ASIC00 + Eth512 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth32 + true + str-sonic-lc03-ASIC01 + Eth552 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth33 + true + str-sonic-lc03-ASIC00 + Eth460 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth34 + true + str-sonic-lc03-ASIC00 + Eth516 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth35 + true + str-sonic-lc03-ASIC01 + Eth563 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth36 + true + str-sonic-lc03-ASIC00 + Eth457 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth37 + true + str-sonic-lc03-ASIC01 + Eth566 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth38 + true + str-sonic-lc03-ASIC01 + Eth558 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth39 + true + str-sonic-lc03-ASIC00 + Eth515 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth40 + true + str-sonic-lc03-ASIC01 + Eth542 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth41 + true + str-sonic-lc03-ASIC01 + Eth557 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth42 + true + str-sonic-lc03-ASIC00 + Eth466 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth43 + true + str-sonic-lc03-ASIC01 + Eth560 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth44 + true + str-sonic-lc03-ASIC00 + Eth472 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth45 + true + str-sonic-lc03-ASIC00 + Eth463 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth46 + true + str-sonic-lc03-ASIC00 + Eth469 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth47 + true + str-sonic-lc03-ASIC01 + Eth539 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth49 + true + str-sonic-lc09-ASIC00 + Eth492 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth50 + true + str-sonic-lc09-ASIC00 + Eth494 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth54 + true + str-sonic-lc09-ASIC00 + Eth487 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth59 + true + str-sonic-lc09-ASIC00 + Eth485 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth61 + true + str-sonic-lc09-ASIC00 + Eth486 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth67 + true + str-sonic-lc09-ASIC00 + Eth484 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth68 + true + str-sonic-lc09-ASIC00 + Eth479 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth71 + true + str-sonic-lc09-ASIC00 + Eth476 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth72 + true + str-sonic-lc10-ASIC00 + Eth492 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth73 + true + str-sonic-lc10-ASIC00 + Eth494 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth77 + true + str-sonic-lc10-ASIC00 + Eth487 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth81 + true + str-sonic-lc10-ASIC00 + Eth485 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth87 + true + str-sonic-lc10-ASIC00 + Eth486 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth88 + true + str-sonic-lc10-ASIC00 + Eth479 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth90 + true + str-sonic-lc10-ASIC00 + Eth476 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth94 + true + str-sonic-lc10-ASIC00 + Eth484 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth98 + true + str-sonic-lc08-ASIC00 + Eth484 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth100 + true + str-sonic-lc08-ASIC00 + Eth479 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth101 + true + str-sonic-lc08-ASIC00 + Eth476 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth107 + true + str-sonic-lc08-ASIC00 + Eth486 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth111 + true + str-sonic-lc08-ASIC00 + Eth485 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth112 + true + str-sonic-lc08-ASIC00 + Eth492 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth113 + true + str-sonic-lc08-ASIC00 + Eth494 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth116 + true + str-sonic-lc08-ASIC00 + Eth487 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth123 + true + str-sonic-lc07-ASIC00 + Eth484 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth124 + true + str-sonic-lc07-ASIC00 + Eth479 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth125 + true + str-sonic-lc07-ASIC00 + Eth476 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth129 + true + str-sonic-lc07-ASIC00 + Eth486 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth134 + true + str-sonic-lc07-ASIC00 + Eth485 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth139 + true + str-sonic-lc07-ASIC00 + Eth487 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth140 + true + str-sonic-lc07-ASIC00 + Eth494 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth143 + true + str-sonic-lc07-ASIC00 + Eth492 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth144 + true + str-sonic-lc05-ASIC00 + Eth494 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth145 + true + str-sonic-lc05-ASIC00 + Eth492 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth149 + true + str-sonic-lc05-ASIC00 + Eth487 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth154 + true + str-sonic-lc05-ASIC00 + Eth485 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth158 + true + str-sonic-lc05-ASIC00 + Eth486 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth163 + true + str-sonic-lc05-ASIC00 + Eth484 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth164 + true + str-sonic-lc05-ASIC00 + Eth479 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth167 + true + str-sonic-lc05-ASIC00 + Eth476 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth169 + true + str-sonic-lc06-ASIC00 + Eth494 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth172 + true + str-sonic-lc06-ASIC00 + Eth492 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth173 + true + str-sonic-lc06-ASIC00 + Eth487 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth177 + true + str-sonic-lc06-ASIC00 + Eth485 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth182 + true + str-sonic-lc06-ASIC00 + Eth486 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth184 + true + str-sonic-lc06-ASIC00 + Eth479 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth187 + true + str-sonic-lc06-ASIC00 + Eth476 + true + + + BackendFabricLink + 50000 + false + str-sonic-sup00-ASIC11 + Eth188 + true + str-sonic-lc06-ASIC00 + Eth484 + true + + + DeviceSerialLink + 9600 + true + str-console-197 + port 10 + true + str-sonic-sup00 + console + true + 10 + + + DeviceSerialLink + 9600 + true + str-sonic-sup00 + logical3 + true + str-sonic-lc03 + logical + true + 3 + + + DeviceSerialLink + 9600 + true + str-sonic-sup00 + logical4 + true + str-sonic-lc04 + logical + true + 4 + + + DeviceSerialLink + 9600 + true + str-sonic-sup00 + logical5 + true + str-sonic-lc05 + logical + true + 5 + + + DeviceSerialLink + 9600 + true + str-sonic-sup00 + logical6 + true + str-sonic-lc06 + logical + true + 6 + + + DeviceSerialLink + 9600 + true + str-sonic-sup00 + logical7 + true + str-sonic-lc07 + logical + true + 7 + + + DeviceSerialLink + 9600 + true + str-sonic-sup00 + logical8 + true + str-sonic-lc08 + logical + true + 8 + + + DeviceSerialLink + 9600 + true + str-sonic-sup00 + logical10 + true + str-sonic-lc10 + logical + true + 10 + + + + + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC00 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC01 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC02 + Broadcom-Ramon +
+ + LinecardAsic +
+ 10.2.0.3/32 +
+ + fc00:22::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc05-ASIC00 + Broadcom-Jericho2 +
+ + LinecardAsic +
+ 10.2.0.2/32 +
+ + fc00:21::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc04-ASIC00 + Broadcom-Jericho2 +
+ + LinecardAsic +
+ 10.2.0.1/32 +
+ + fc00:20::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc03-ASIC00 + Broadcom-Jericho2cplus +
+ + LinecardAsic +
+ 10.2.0.1/32 +
+ + fc00:20::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc03-ASIC01 + Broadcom-Jericho2cplus +
+ + LinecardAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc10-ASIC00 + Broadcom-Jericho2 +
+ + LinecardAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc09-ASIC00 + Broadcom-Jericho2 +
+ + LinecardAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc08-ASIC00 + Broadcom-Jericho2 +
+ + LinecardAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc07-ASIC00 + Broadcom-Jericho2 +
+ + LinecardAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc06-ASIC00 + Broadcom-Jericho2 +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC03 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC04 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC05 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC06 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC07 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC08 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC09 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC10 + Broadcom-Ramon +
+ + FabricAsic +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-sup00-ASIC11 + Broadcom-Ramon +
+ + Supervisor +
+ 10.152.0.46/32 +
+ + 2a01:111:e210:5e::/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.111/24 + + + 2a01:111:e210:3000::a03:926f/64 + + + + str-sonic-sup00 + Sonic-supvisor-sku +
+ + ConsoleServer +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-console-197 + Digi-CM48 +
+ + Linecard +
+ 10.2.0.1/32 +
+ + fc00:20::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.58/24 + + + 2a01:111:e210:3000::a03:923a/64 + + + + str-sonic-lc03 + Sonic-400G-sku +
+ + Linecard +
+ 10.2.0.2/32 +
+ + fc00:21::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.71/24 + + + 2a01:111:e210:3000::a03:9247/64 + + + + str-sonic-lc04 + Sonic-100G-sku +
+ + Linecard +
+ 10.2.0.3/32 +
+ + fc00:22::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.72/24 + + + 2a01:111:e210:3000::a03:9248/64 + + + + str-sonic-lc05 + Sonic-100G-sku +
+ + Linecard +
+ 10.2.0.4/32 +
+ + fc00:23::1/128 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.74/24 + + + 2a01:111:e210:3000::a03:924a/64 + + + + str-sonic-lc06 + Sonic-100G-sku +
+ + Linecard +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc07 + Sonic-100G-sku +
+ + Linecard +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc08 + Sonic-100G-sku +
+ + Linecard +
+ 0.0.0.0/0 +
+ + ::/0 + + TestbedForstr-sonic + TestbedForstr-sonic + + + TestbedForstr-sonic + 3 + + STARLab + + 0.0.0.0/0 + + + ::/0 + + + + str-sonic-lc10 + Sonic-100G-sku +
+ + SpineRouter +
+ 10.152.0.46/32 +
+ + 2a01:111:e210:5e::/128 + + TestbedForstr-sonic + TestbedForstr-sonic + None + + TestbedForstr-sonic + 3 + + STARLab + + 10.3.146.111/24 + + + 2a01:111:e210:3000::a03:926f/64 + + + + str-sonic + Sonic-T2-sku + 0 +
+
+
+ str-sonic-sup00 + Sonic-supvisor-sku + 1.0.1388.35297 + +
diff --git a/src/sonic-config-engine/tests/test_chassis_cfggen.py b/src/sonic-config-engine/tests/test_chassis_cfggen.py new file mode 100644 index 000000000000..b4cd571bd577 --- /dev/null +++ b/src/sonic-config-engine/tests/test_chassis_cfggen.py @@ -0,0 +1,1159 @@ +import json +import os +import subprocess +import yaml +import tests.common_utils as utils + +from unittest import TestCase +from sonic_py_common.general import getstatusoutput_noshell + + +class TestChassis(TestCase): + + def setUp(self): + self.yang = utils.YangWrapper() + self.test_dir = os.path.dirname(os.path.realpath(__file__)) + self.script_file = [utils.PYTHON_INTERPRETTER, + os.path.join(self.test_dir, '..', 'sonic-cfggen')] + self.output_file = os.path.join(self.test_dir, 'output') + self.macsec_profile = os.path.join( + self.test_dir, 'macsec_profile.json') + + def run_script(self, argument, check_stderr=True, output_file=None, validateYang=True, ignore_warning=False): + print('\n Running sonic-cfggen ' + ' '.join(argument)) + # if validateYang: + # self.assertTrue(self.yang.validate(argument)) + if check_stderr: + output = subprocess.check_output( + self.script_file + argument, stderr=subprocess.STDOUT) + else: + output = subprocess.check_output(self.script_file + argument) + + if utils.PY3x: + output = output.decode() + if output_file: + with open(output_file, 'w') as f: + f.write(output) + + if ignore_warning: + output_without_warning = [] + for line in output.split('\n'): + if line.startswith("Warning"): + continue + output_without_warning.append(line) + output = '\n'.join(output_without_warning) + + linecount = output.strip().count('\n') + if linecount <= 0: + print(' Output: ' + output.strip()) + else: + print(' Output: ({0} lines, {1} bytes)'.format( + linecount + 1, len(output))) + + return output + + def run_diff(self, file1, file2): + _, output = getstatusoutput_noshell(['diff', '-u', file1, file2]) + return output + + +class TestVoqChassisSingleAsic(TestChassis): + def setUp(self): + super().setUp() + self.test_data_dir = os.path.join( + self.test_dir, 'chassis_data/voq_chassis_data') + self.sample_graph = os.path.join( + self.test_data_dir, 'voq_chassis_lc_single_asic.xml') + self.sample_port_config = os.path.join( + self.test_data_dir, 'voq-sample-port-config-1.ini') + os.environ['CFGGEN_UNIT_TESTING'] = '2' + + def test_dummy_run(self): + argument = [] + output = self.run_script(argument) + self.assertEqual(output, '') + + def test_print_data(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--print-data'] + output = self.run_script(argument) + self.assertGreater(len(output.strip()), 0) + + def test_read_yaml(self): + argument = ['-v', 'yml_item', '-y', + os.path.join(self.test_dir, 'test.yml')] + output = yaml.safe_load(self.run_script(argument)) + self.assertListEqual(output, ['value1', 'value2']) + + def test_render_template(self): + argument = ['-y', os.path.join(self.test_dir, 'test.yml'), + '-t', os.path.join(self.test_dir, 'test.j2')] + output = self.run_script(argument) + self.assertEqual(output.strip(), 'value1\nvalue2') + + def test_tacacs(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'TACPLUS_SERVER'] + output = json.loads(self.run_script(argument)) + self.assertDictEqual( + output, {'123.46.98.21': {'priority': '1', 'tcp_port': '49'}}) + # TACPLUS_SERVER not present in the asic configuration. + argument = ['-m', self.sample_graph, '--var-json', 'TACPLUS_SERVER'] + + def test_ntp(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'NTP_SERVER'] + output = json.loads(self.run_script(argument)) + self.assertDictEqual(output, {'17.39.1.130': {}, '17.39.1.129': {}}) + # NTP data is present only in the host config + argument = ['-m', self.sample_graph, '--var-json', 'NTP_SERVER'] + + def test_mgmt_port(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'MGMT_PORT'] + output = json.loads(self.run_script(argument)) + self.assertDictEqual( + output, {'eth0': {'alias': 'Management1/1', 'admin_status': 'up'}}) + + def test_device_metadata(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'DEVICE_METADATA'] + output = json.loads(self.run_script(argument)) + print(output['localhost']) + self.assertDictEqual(output['localhost'], { + 'bgp_asn': '65100', + 'region': 'test', + 'cloudtype': None, + 'docker_routing_config_mode': 'separated', + 'hostname': 'str-sonic-lc06', + 'hwsku': 'Sonic-lc-100g-sku', + 'type': 'SpineRouter', + 'synchronous_mode': 'enable', + 'yang_config_validation': 'disable', + 'chassis_hostname': 'str-sonic', + 'deployment_id': '3', + 'cluster': 'TestbedForstr-sonic', + 'asic_name': 'Asic0', + 'sub_role': 'FrontEnd', + 'switch_type': 'voq', + 'switch_id': 20, + 'max_cores': 64}) + + def test_port(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '-v', "PORT[\'Ethernet0\']"] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{'lanes': '6,7',\ + 'alias': 'Ethernet6/1/1',\ + 'index': '1',\ + 'role': 'Ext',\ + 'speed': '100000', \ + 'asic_port_name': 'Eth0',\ + 'core_id': '0', \ + 'core_port_id': '1',\ + 'num_voq': '8', \ + 'fec': 'rs', \ + 'description': 'ARISTA33T1:Ethernet1',\ + 'mtu': '9100',\ + 'tpid': '0x8100',\ + 'pfc_asym': 'off',\ + 'admin_status': 'up'\ + }") + ) + + def test_voq_inband_intf(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'VOQ_INBAND_INTERFACE'] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{'Ethernet-IB0': {'inband_type': 'Port'},\ + 'Ethernet-IB0|10.241.88.4/32': {},\ + 'Ethernet-IB0|2a01:111:e210:5e:0:a:f158:400/128': {}}")) + + def test_system_port(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'SYSTEM_PORT'] + expected_output_file = os.path.join( + self.test_data_dir, 'system_ports.json') + self.run_script(argument, output_file=self.output_file) + self.assertTrue(self.run_diff(expected_output_file, self.output_file)) + if os.path.exists(self.output_file): + os.remove(self.output_file) + + def test_device_neighbor(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'DEVICE_NEIGHBOR'] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{'Ethernet0': {'name': 'ARISTA33T1', 'port':'Ethernet1'},\ + 'Ethernet4': {'name': 'ARISTA33T1', 'port':'Ethernet2'},\ + 'Ethernet8': {'name': 'ARISTA35T1', 'port':'Ethernet1'},\ + 'Ethernet12': {'name': 'ARISTA35T1', 'port':'Ethernet2'},\ + 'Ethernet16': {'name': 'ARISTA37T1', 'port':'Ethernet1'},\ + 'Ethernet20': {'name': 'ARISTA37T1', 'port':'Ethernet2'},\ + 'Ethernet24': {'name': 'ARISTA39T1', 'port':'Ethernet1'},\ + 'Ethernet28': {'name': 'ARISTA39T1', 'port':'Ethernet2'},\ + 'Ethernet32': {'name': 'ARISTA41T1', 'port':'Ethernet1'},\ + 'Ethernet36': {'name': 'ARISTA41T1', 'port':'Ethernet2'},\ + 'Ethernet40': {'name': 'ARISTA43T1', 'port':'Ethernet1'},\ + 'Ethernet44': {'name': 'ARISTA43T1', 'port':'Ethernet2'},\ + 'Ethernet48': {'name': 'ARISTA45T1', 'port':'Ethernet1'},\ + 'Ethernet52': {'name': 'ARISTA47T1', 'port':'Ethernet1'},\ + 'Ethernet56': {'name': 'ARISTA47T1', 'port':'Ethernet2'},\ + 'Ethernet60': {'name': 'ARISTA49T1', 'port':'Ethernet1'},\ + 'Ethernet64': {'name': 'ARISTA50T1', 'port':'Ethernet1'},\ + 'Ethernet68': {'name': 'ARISTA50T1', 'port':'Ethernet2'},\ + 'Ethernet72': {'name': 'ARISTA51T1', 'port':'Ethernet1'},\ + 'Ethernet76': {'name': 'ARISTA52T1', 'port':'Ethernet1'},\ + 'Ethernet80': {'name': 'ARISTA53T1', 'port':'Ethernet1'},\ + 'Ethernet84': {'name': 'ARISTA54T1', 'port':'Ethernet1'},\ + 'Ethernet88': {'name': 'ARISTA55T1', 'port':'Ethernet1'},\ + 'Ethernet92': {'name': 'ARISTA56T1', 'port':'Ethernet1'},\ + 'Ethernet96': {'name': 'ARISTA57T1', 'port':'Ethernet1'},\ + 'Ethernet100': {'name': 'ARISTA58T1', 'port':'Ethernet1'},\ + 'Ethernet104': {'name': 'ARISTA59T1', 'port':'Ethernet1'},\ + 'Ethernet108': {'name': 'ARISTA60T1', 'port':'Ethernet1'},\ + 'Ethernet112': {'name': 'ARISTA61T1', 'port':'Ethernet1'},\ + 'Ethernet116': {'name': 'ARISTA62T1', 'port':'Ethernet1'},\ + 'Ethernet120': {'name': 'ARISTA63T1', 'port':'Ethernet1'},\ + 'Ethernet124': {'name': 'ARISTA64T1', 'port': 'Ethernet1'}}")) + + def test_device_neighbor_metadata(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '-v', "DEVICE_NEIGHBOR_METADATA[\'ARISTA33T1\']"] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{'hwsku': 'Sonic-T1-sku',\ + 'cluster': 'TestbedForstr-sonic',\ + 'deployment_id': '3',\ + 'lo_addr': '0.0.0.0/0',\ + 'lo_addr_v6': '::/0',\ + 'mgmt_addr': '172.16.191.58/17',\ + 'mgmt_addr_v6': '::/0',\ + 'type': 'LeafRouter'}")) + + def test_bgp_neighbors(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '-v', 'BGP_NEIGHBOR'] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{'10.0.0.129': {'name': 'ARISTA33T1', 'local_addr': '10.0.0.128', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65338'},\ + 'fc00::102': {'name': 'ARISTA33T1', 'local_addr': 'fc00::101', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65338'},\ + '10.0.0.133': {'name': 'ARISTA35T1', 'local_addr': '10.0.0.132', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65339'},\ + 'fc00::10a': {'name': 'ARISTA35T1', 'local_addr': 'fc00::109', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65339'},\ + '10.0.0.137': {'name': 'ARISTA37T1', 'local_addr': '10.0.0.136', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65340'},\ + 'fc00::112': {'name': 'ARISTA37T1', 'local_addr': 'fc00::111', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65340'},\ + '10.0.0.141': {'name': 'ARISTA39T1', 'local_addr': '10.0.0.140', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65341'},\ + 'fc00::11a': {'name': 'ARISTA39T1', 'local_addr': 'fc00::119', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65341'},\ + '10.0.0.145': {'name': 'ARISTA41T1', 'local_addr': '10.0.0.144', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65342'},\ + 'fc00::122': {'name': 'ARISTA41T1', 'local_addr': 'fc00::121', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65342'},\ + '10.0.0.149': {'name': 'ARISTA43T1', 'local_addr': '10.0.0.148', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65343'},\ + 'fc00::12a': {'name': 'ARISTA43T1', 'local_addr': 'fc00::129', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65343'},\ + '10.0.0.153': {'name': 'ARISTA47T1', 'local_addr': '10.0.0.152', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65345'},\ + 'fc00::132': {'name': 'ARISTA47T1', 'local_addr': 'fc00::131', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65345'},\ + '10.0.0.157': {'name': 'ARISTA50T1', 'local_addr': '10.0.0.156', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65347'},\ + 'fc00::13a': {'name': 'ARISTA50T1', 'local_addr': 'fc00::139', 'rrclient': 0, 'holdtime': '10', 'keepalive': '3', 'nhopself': 0, 'asn': '65347'}}")) + + def test_voq_bgp_neighbors(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '-v', 'BGP_VOQ_CHASSIS_NEIGHBOR'] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{'10.241.88.5': {'name': 'str-sonic-lc07-ASIC00', 'local_addr': '10.241.88.4', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'2a01:111:e210:5e:0:a:f158:500': {'name': 'str-sonic-lc07-ASIC00', 'local_addr': '2a01:111:e210:5e:0:a:f158:400', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'10.241.88.6': {'name': 'str-sonic-lc08-ASIC00', 'local_addr': '10.241.88.4', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'2a01:111:e210:5e:0:a:f158:600': {'name': 'str-sonic-lc08-ASIC00', 'local_addr': '2a01:111:e210:5e:0:a:f158:400', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'10.241.88.7': {'name': 'str-sonic-lc09-ASIC00', 'local_addr': '10.241.88.4', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'2a01:111:e210:5e:0:a:f158:700': {'name': 'str-sonic-lc09-ASIC00', 'local_addr': '2a01:111:e210:5e:0:a:f158:400', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'10.241.88.8': {'name': 'str-sonic-lc10-ASIC00', 'local_addr': '10.241.88.4', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'2a01:111:e210:5e:0:a:f158:800': {'name': 'str-sonic-lc10-ASIC00', 'local_addr': '2a01:111:e210:5e:0:a:f158:400', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'10.241.88.0': {'name': 'str-sonic-lc03-ASIC00', 'local_addr': '10.241.88.4', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'2a01:111:e210:5e:0:a:f158:0': {'name': 'str-sonic-lc03-ASIC00', 'local_addr': '2a01:111:e210:5e:0:a:f158:400', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'10.241.88.1': {'name': 'str-sonic-lc03-ASIC01', 'local_addr': '10.241.88.4', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'2a01:111:e210:5e:0:a:f158:100': {'name': 'str-sonic-lc03-ASIC01', 'local_addr': '2a01:111:e210:5e:0:a:f158:400', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'10.241.88.2': {'name': 'str-sonic-lc04-ASIC00', 'local_addr': '10.241.88.4', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'2a01:111:e210:5e:0:a:f158:200': {'name': 'str-sonic-lc04-ASIC00', 'local_addr': '2a01:111:e210:5e:0:a:f158:400', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'10.241.88.3': {'name': 'str-sonic-lc05-ASIC00', 'local_addr': '10.241.88.4', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}, " + "'2a01:111:e210:5e:0:a:f158:300': {'name': 'str-sonic-lc05-ASIC00', 'local_addr': '2a01:111:e210:5e:0:a:f158:400', 'rrclient': 0, 'holdtime': '0', 'keepalive': '0', 'nhopself': 0, 'admin_status': 'up', 'asn': '65100'}}") + ) + + def test_port_channel(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '-v', "PORTCHANNEL[\'PortChannel1058\']"] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{'min_links': '2', 'lacp_key': 'auto', 'mtu': '9100', 'tpid': '0x8100', 'admin_status': 'up'}")) + + def test_port_channel_member(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '-v', "PORTCHANNEL_MEMBER.keys()|list"] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.liststr_to_dict(output.strip()), + utils.liststr_to_dict("[('PortChannel1049', 'Ethernet0'),\ + ('PortChannel1049', 'Ethernet4'),\ + ('PortChannel1050', 'Ethernet8'),\ + ('PortChannel1050', 'Ethernet12'),\ + ('PortChannel1051', 'Ethernet16'),\ + ('PortChannel1051', 'Ethernet20'),\ + ('PortChannel1052', 'Ethernet24'),\ + ('PortChannel1052', 'Ethernet28'),\ + ('PortChannel1053', 'Ethernet36'),\ + ('PortChannel1053', 'Ethernet32'),\ + ('PortChannel1054', 'Ethernet40'),\ + ('PortChannel1054', 'Ethernet44'),\ + ('PortChannel1056', 'Ethernet52'),\ + ('PortChannel1056', 'Ethernet56'),\ + ('PortChannel1058', 'Ethernet64'),\ + ('PortChannel1058', 'Ethernet68')]") + ) + + def test_port_channel_interface(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '-v', "PORTCHANNEL_INTERFACE.keys()|list"] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.liststr_to_dict(output.strip()), + utils.liststr_to_dict("\ + [('PortChannel1049', '10.0.0.128/31'),\ + 'PortChannel1049',\ + ('PortChannel1049', 'fc00::101/126'),\ + ('PortChannel1050', '10.0.0.132/31'),\ + 'PortChannel1050',\ + ('PortChannel1050', 'fc00::109/126'),\ + ('PortChannel1051', '10.0.0.136/31'),\ + 'PortChannel1051',\ + ('PortChannel1051', 'fc00::111/126'),\ + ('PortChannel1052', '10.0.0.140/31'),\ + 'PortChannel1052',\ + ('PortChannel1052', 'fc00::119/126'),\ + ('PortChannel1053', '10.0.0.144/31'),\ + 'PortChannel1053',\ + ('PortChannel1053', 'fc00::121/126'),\ + ('PortChannel1054', '10.0.0.148/31'),\ + 'PortChannel1054',\ + ('PortChannel1054', 'fc00::129/126'),\ + ('PortChannel1056', '10.0.0.152/31'),\ + 'PortChannel1056',\ + ('PortChannel1056', 'fc00::131/126'),\ + ('PortChannel1058', '10.0.0.156/31'),\ + 'PortChannel1058',\ + ('PortChannel1058', 'fc00::139/126')\ + ]") + ) + + def tearDown(self): + os.environ['CFGGEN_UNIT_TESTING'] = '' + if os.path.exists(self.output_file): + os.remove(self.output_file) + + +class TestVoqChassisMultiAsic(TestChassis): + + def setUp(self): + super().setUp() + self.test_data_dir = os.path.join( + self.test_dir, 'chassis_data/voq_chassis_data') + self.sample_graph = os.path.join( + self.test_data_dir, 'voq_chassis_lc_multi_asic.xml') + self.sample_port_config = os.path.join( + self.test_data_dir, 'voq-sample-port-config-2.ini') + os.environ['CFGGEN_UNIT_TESTING'] = '2' + os.environ["CFGGEN_UNIT_TESTING_TOPOLOGY"] = "multi_asic" + + def test_dummy_run(self): + argument = [] + output = self.run_script(argument) + self.assertEqual(output, '') + + def test_print_data(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--print-data'] + output = self.run_script(argument) + self.assertGreater(len(output.strip()), 0) + + def test_read_yaml(self): + argument = ['-v', 'yml_item', '-y', + os.path.join(self.test_dir, 'test.yml')] + output = yaml.safe_load(self.run_script(argument)) + self.assertListEqual(output, ['value1', 'value2']) + + def test_render_template(self): + argument = ['-y', os.path.join(self.test_dir, 'test.yml'), + '-t', os.path.join(self.test_dir, 'test.j2')] + output = self.run_script(argument) + self.assertEqual(output.strip(), 'value1\nvalue2') + + def test_tacacs(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'TACPLUS_SERVER'] + output = json.loads(self.run_script(argument)) + self.assertDictEqual( + output, {'123.46.98.21': {'priority': '1', 'tcp_port': '49'}}) + # TACPLUS_SERVER not present in the asic configuration. + argument = ['-m', self.sample_graph, '--var-json', 'TACPLUS_SERVER'] + + def test_ntp(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'NTP_SERVER'] + output = json.loads(self.run_script(argument)) + self.assertDictEqual(output, {'17.39.1.130': {}, '17.39.1.129': {}}) + # NTP data is present only in the host config + argument = ['-m', self.sample_graph, '--var-json', 'NTP_SERVER'] + + def test_mgmt_port(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'MGMT_PORT'] + output = json.loads(self.run_script(argument)) + self.assertDictEqual( + output, {'eth0': {'alias': 'Management1/1', 'admin_status': 'up'}}) + + def test_device_metadata(self): + argument = ['-m', self.sample_graph, '-p', + self.sample_port_config, '--var-json', 'DEVICE_METADATA'] + output = json.loads(self.run_script(argument)) + print(output['localhost']) + self.assertDictEqual(output['localhost'], { + 'bgp_asn': None, + 'region': 'test', + 'cloudtype': 'Public', + 'docker_routing_config_mode': 'separated', + 'hostname': 'str-sonic-lc03', + 'hwsku': 'Sonic-400g-lc-sku', + 'type': 'SpineRouter', + 'synchronous_mode': 'enable', + 'yang_config_validation': 'disable', + 'chassis_hostname': 'str-sonic', + 'deployment_id': '3', + 'cluster': 'TestbedForstr-sonic', + 'switch_type': 'voq', + 'max_cores': 64}) + + def test_device_metadata_for_namespace(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '--var-json', 'DEVICE_METADATA' + ] + output = json.loads(self.run_script(argument)) + print(output['localhost']) + self.assertDictEqual(output['localhost'], { + 'bgp_asn': '65100', + 'region': 'test', + 'cloudtype': None, + 'docker_routing_config_mode': 'separated', + 'hostname': 'str-sonic-lc03', + 'hwsku': 'Sonic-400g-lc-sku', + 'type': 'SpineRouter', + 'synchronous_mode': 'enable', + 'yang_config_validation': 'disable', + 'chassis_hostname': 'str-sonic', + 'deployment_id': '3', 'cluster': + 'TestbedForstr-sonic', + 'sub_role': 'FrontEnd', + 'asic_name': 'asic0', + 'switch_type': 'voq', + 'switch_id': 8, + 'max_cores': 64}) + + def test_system_port(self): + argument = ['-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '--var-json', 'DEVICE_METADATA'] + expected_output_file = os.path.join( + self.test_data_dir, 'system_ports.json') + self.run_script(argument, output_file=self.output_file) + self.assertTrue(self.run_diff(expected_output_file, self.output_file)) + if os.path.exists(self.output_file): + os.remove(self.output_file) + + def test_port(self): + argument = [ + '-j', self.macsec_profile, + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '-v', "PORT[\'Ethernet8\']" + ] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{" + "'lanes': '80,81,82,83', " + "'alias': 'Ethernet3/2/1', " + "'index': '2', " + "'role': 'Ext', " + "'speed': '100000', " + "'asic_port_name': 'Eth8', " + "'core_id': '1', " + "'core_port_id': '2', " + "'num_voq': '8', " + "'fec': 'rs', " + "'macsec': 'macsec-profile-two', " + "'tx_power': '-10', " + "'laser_freq': 196025, " + "'description': 'ARISTA91T3:Ethernet2', " + "'mtu': '9100', " + "'tpid': '0x8100', " + "'pfc_asym': 'off', " + "'admin_status': 'up'" + "}" + ) + ) + + def test_voq_inband_intf(self): + argument = [ + '-j', self.macsec_profile, + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic1', + '--var-json', 'VOQ_INBAND_INTERFACE' + ] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{'Ethernet-IB1': {'inband_type': 'Port'},\ + 'Ethernet-IB1|10.241.88.1/32': {},\ + 'Ethernet-IB1|2a01:111:e210:5e:0:a:f158:100/128': {}}")) + + def test_voq_bgp_neighbors(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '--var-json', 'BGP_VOQ_CHASSIS_NEIGHBOR' + ] + output = json.loads(self.run_script(argument)) + print(output) + self.assertDictEqual(output, + { + "10.241.88.1": { + "name": "str-sonic-lc03-ASIC01", + "local_addr": "10.241.88.0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "2a01:111:e210:5e:0:a:f158:100": { + "name": "str-sonic-lc03-ASIC01", + "local_addr": "2a01:111:e210:5e:0:a:f158:0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "10.241.88.2": { + "name": "str-sonic-lc04-ASIC00", + "local_addr": "10.241.88.0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "2a01:111:e210:5e:0:a:f158:200": { + "name": "str-sonic-lc04-ASIC00", + "local_addr": "2a01:111:e210:5e:0:a:f158:0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "10.241.88.3": { + "name": "str-sonic-lc05-ASIC00", + "local_addr": "10.241.88.0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "2a01:111:e210:5e:0:a:f158:300": { + "name": "str-sonic-lc05-ASIC00", + "local_addr": "2a01:111:e210:5e:0:a:f158:0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "10.241.88.4": { + "name": "str-sonic-lc06-ASIC00", + "local_addr": "10.241.88.0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "2a01:111:e210:5e:0:a:f158:400": { + "name": "str-sonic-lc06-ASIC00", + "local_addr": "2a01:111:e210:5e:0:a:f158:0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "10.241.88.5": { + "name": "str-sonic-lc07-ASIC00", + "local_addr": "10.241.88.0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "2a01:111:e210:5e:0:a:f158:500": { + "name": "str-sonic-lc07-ASIC00", + "local_addr": "2a01:111:e210:5e:0:a:f158:0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "10.241.88.6": { + "name": "str-sonic-lc08-ASIC00", + "local_addr": "10.241.88.0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "2a01:111:e210:5e:0:a:f158:600": { + "name": "str-sonic-lc08-ASIC00", + "local_addr": "2a01:111:e210:5e:0:a:f158:0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "10.241.88.7": { + "name": "str-sonic-lc09-ASIC00", + "local_addr": "10.241.88.0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "2a01:111:e210:5e:0:a:f158:700": { + "name": "str-sonic-lc09-ASIC00", + "local_addr": "2a01:111:e210:5e:0:a:f158:0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "10.241.88.8": { + "name": "str-sonic-lc10-ASIC00", + "local_addr": "10.241.88.0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + }, + "2a01:111:e210:5e:0:a:f158:800": { + "name": "str-sonic-lc10-ASIC00", + "local_addr": "2a01:111:e210:5e:0:a:f158:0", + "rrclient": 0, + "holdtime": "0", + "keepalive": "0", + "nhopself": 0, + "admin_status": "up", + "asn": "65100" + } + }) + + + def test_device_neighbor(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '-v', "DEVICE_NEIGHBOR[\'Ethernet0\']"] + + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{'name': 'ARISTA91T3', 'port': 'Ethernet1'}")) + + def test_device_neighbor_metadata(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '-v', "DEVICE_NEIGHBOR_METADATA['ARISTA91T3']" + ] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{'hwsku': 'Sonic-T3-sku', 'cluster': 'TestbedForstr-sonic', " + "'deployment_id': '3', 'lo_addr': '0.0.0.0/0', " + "'lo_addr_v6': '::/0', 'mgmt_addr': '172.16.191.10/17', " + "'mgmt_addr_v6': '::/0', 'type': 'RegionalHub'}" + ) + ) + + def test_port_channel(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '-v', "PORTCHANNEL[\'PortChannel102\']" + ] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict("{'min_links': '2', 'lacp_key': 'auto', 'mtu': '9100', 'tpid': '0x8100', 'admin_status': 'up'}")) + + def test_port_channel_member(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '-v', "PORTCHANNEL_MEMBER.keys()|list" + ] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.liststr_to_dict(output.strip()), + utils.liststr_to_dict("[('PortChannel102', 'Ethernet0'),\ + ('PortChannel102', 'Ethernet8'),\ + ('PortChannel104', 'Ethernet16'),\ + ('PortChannel104', 'Ethernet24'),\ + ('PortChannel106', 'Ethernet32'),\ + ('PortChannel106', 'Ethernet40'),\ + ('PortChannel108', 'Ethernet48'),\ + ('PortChannel108', 'Ethernet56'),\ + ('PortChannel1010', 'Ethernet72'),\ + ('PortChannel1010', 'Ethernet64'),\ + ('PortChannel1012', 'Ethernet80'),\ + ('PortChannel1012', 'Ethernet88'),\ + ('PortChannel1016', 'Ethernet104'),\ + ('PortChannel1016', 'Ethernet112'),\ + ('PortChannel1020', 'Ethernet128'),\ + ('PortChannel1020', 'Ethernet136')]") + ) + + def test_port_channel_interface(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '-v', "PORTCHANNEL_INTERFACE.keys()|list" + ] + output = self.run_script(argument) + print(output) + self.assertEqual( + utils.liststr_to_dict(output.strip()), + utils.liststr_to_dict("[('PortChannel102', '10.0.0.0/31'),\ + 'PortChannel102',\ + ('PortChannel102', 'fc00::1/126'),\ + ('PortChannel104', '10.0.0.4/31'),\ + 'PortChannel104',\ + ('PortChannel104', 'fc00::9/126'),\ + ('PortChannel106', '10.0.0.8/31'),\ + 'PortChannel106',\ + ('PortChannel106','fc00::11/126'),\ + ('PortChannel108', '10.0.0.12/31'),\ + 'PortChannel108',\ + ('PortChannel108', 'fc00::19/126'),\ + ('PortChannel1010', '10.0.0.16/31'),\ + 'PortChannel1010',\ + ('PortChannel1010', 'fc00::21/126'),\ + ('PortChannel1012', '10.0.0.20/31'),\ + 'PortChannel1012',\ + ('PortChannel1012', 'fc00::29/126'),\ + ('PortChannel1016', '10.0.0.28/31'),\ + 'PortChannel1016', \ + ('PortChannel1016', 'fc00::39/126'),\ + ('PortChannel1020', '10.0.0.24/31'),\ + 'PortChannel1020',\ + ('PortChannel1020', 'fc00::31/126')]") + ) + def tearDown(self): + os.environ['CFGGEN_UNIT_TESTING'] = '' + os.environ["CFGGEN_UNIT_TESTING_TOPOLOGY"] = "" + if os.path.exists(self.output_file): + os.remove(self.output_file) + + +class TestVoqChassisSup(TestChassis): + + def setUp(self): + super().setUp() + self.test_data_dir = os.path.join( + self.test_dir, 'chassis_data/voq_chassis_data') + self.sample_graph = os.path.join( + self.test_data_dir, 'voq_chassis_sup.xml') + self.sample_port_config = "" + os.environ['CFGGEN_UNIT_TESTING'] = '2' + os.environ["CFGGEN_UNIT_TESTING_TOPOLOGY"] = "multi_asic" + + def test_dummy_run(self): + argument = [] + output = self.run_script(argument) + self.assertEqual(output, '') + + def test_print_data(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '--print-data' + ] + output = self.run_script(argument) + self.assertGreater(len(output.strip()), 0) + + def test_read_yaml(self): + argument = ['-v', 'yml_item', '-y', + os.path.join(self.test_dir, 'test.yml')] + output = yaml.safe_load(self.run_script(argument)) + self.assertListEqual(output, ['value1', 'value2']) + + def test_render_template(self): + argument = ['-y', os.path.join(self.test_dir, 'test.yml'), + '-t', os.path.join(self.test_dir, 'test.j2')] + output = self.run_script(argument) + self.assertEqual(output.strip(), 'value1\nvalue2') + + def test_tacacs(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '--var-json', 'TACPLUS_SERVER' + ] + output = json.loads(self.run_script(argument)) + self.assertDictEqual( + output, {'123.46.98.21': {'priority': '1', 'tcp_port': '49'}}) + + def test_ntp(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '--var-json', 'NTP_SERVER' + ] + output = json.loads(self.run_script(argument)) + self.assertDictEqual(output, {'17.39.1.130': {}, '17.39.1.129': {}}) + + + def test_mgmt_port(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '--var-json', 'MGMT_PORT' + ] + output = json.loads(self.run_script(argument)) + self.assertDictEqual( + output, {'eth0': {'alias': 'Management1/1', 'admin_status': 'up'}}) + + def test_device_metadata(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '--var-json', 'DEVICE_METADATA' + ] + out =(self.run_script(argument)) + print(out) + output = json.loads(out) + print(output['localhost']) + self.assertDictEqual(output['localhost'], + { + "bgp_asn": None, + "region": "test", + "cloudtype": "Public", + "docker_routing_config_mode": "separated", + "hostname": "str-sonic-sup00", + "hwsku": "Sonic-supvisor-sku", + "type": "SpineRouter", + "synchronous_mode": "enable", + "yang_config_validation": "disable", + "chassis_hostname": "str-sonic", + "deployment_id": "3", + "cluster": "TestbedForstr-sonic", + "switch_type": "fabric", + "sub_role": "fabric", + "max_cores": 64 + } + ) + + def test_device_metadata_for_namespace(self): + argument = [ + '-m', self.sample_graph, + '-n', 'asic0', + '--var-json', 'DEVICE_METADATA' + ] + output = json.loads(self.run_script(argument)) + print(output['localhost']) + self.assertDictEqual(output['localhost'], + { + "bgp_asn": None, + "region": "test", + "cloudtype": None, + "docker_routing_config_mode": "separated", + "hostname": "str-sonic-sup00", + "hwsku": "Sonic-supvisor-sku", + "type": "SpineRouter", + "synchronous_mode": "enable", + "yang_config_validation": "disable", + "chassis_hostname": "str-sonic", + "deployment_id": "3", + "cluster": "TestbedForstr-sonic", + "sub_role": "Fabric", + "asic_name": "asic0", + "switch_type": "fabric", + "max_cores": 64 + } + ) + + + def tearDown(self): + os.environ['CFGGEN_UNIT_TESTING'] = '' + os.environ['CFGGEN_UNIT_TESTING_TOPOLOGY'] = '' + if os.path.exists(self.output_file): + os.remove(self.output_file) + + +class TestPacketChassisSup(TestChassis): + + def setUp(self): + super().setUp() + self.test_data_dir = os.path.join( + self.test_dir, 'chassis_data/packet_chassis_data') + self.sample_graph = os.path.join( + self.test_data_dir, 'packet_chassis_sup.xml') + self.sample_port_config = os.path.join( + self.test_data_dir, 'packet-chassis-port-config-1.ini') + os.environ['CFGGEN_UNIT_TESTING'] = '2' + os.environ["CFGGEN_UNIT_TESTING_TOPOLOGY"] = "multi_asic" + + def test_dummy_run(self): + argument = [] + output = self.run_script(argument) + self.assertEqual(output, '') + + def test_print_data(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '--print-data'] + output = self.run_script(argument) + self.assertGreater(len(output.strip()), 0) + + def test_read_yaml(self): + argument = ['-v', 'yml_item', '-y', + os.path.join(self.test_dir, 'test.yml')] + output = yaml.safe_load(self.run_script(argument)) + self.assertListEqual(output, ['value1', 'value2']) + + def test_render_template(self): + argument = ['-y', os.path.join(self.test_dir, 'test.yml'), + '-t', os.path.join(self.test_dir, 'test.j2')] + output = self.run_script(argument) + self.assertEqual(output.strip(), 'value1\nvalue2') + + def test_tacacs(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '--var-json', 'TACPLUS_SERVER' + ] + output = json.loads(self.run_script(argument)) + self.assertDictEqual( + output, {'123.46.98.21': {'priority': '1', 'tcp_port': '49'}}) + # TACPLUS_SERVER not present in the asic configuration. + argument = ['-m', self.sample_graph, '--var-json', 'TACPLUS_SERVER'] + + def test_ntp(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '--var-json', 'NTP_SERVER' + ] + output = json.loads(self.run_script(argument)) + self.assertDictEqual(output, {'17.39.1.130': {}, '17.39.1.129': {}}) + # NTP data is present only in the host config + argument = ['-m', self.sample_graph, '--var-json', 'NTP_SERVER'] + + def test_mgmt_port(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '--var-json', 'MGMT_PORT' + ] + output = json.loads(self.run_script(argument)) + self.assertDictEqual( + output, {'eth0': {'alias': 'Management1/1', 'admin_status': 'up'}}) + + def test_device_metadata(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '--var-json', 'DEVICE_METADATA' + ] + output = json.loads(self.run_script(argument)) + print(output['localhost']) + self.assertDictEqual(output['localhost'], + { + "bgp_asn": None, + "region": "test", + "cloudtype": "Public", + "docker_routing_config_mode": "separated", + "hostname": "str-sonic-sup00", + "hwsku": "sonic-sup-sku", + "type": "SpineRouter", + "synchronous_mode": "enable", + "yang_config_validation": "disable", + "chassis_hostname": "str-sonic", + "deployment_id": "3", + "cluster": "TestbedForstr-sonic", + "switch_type": "chassis-packet", + "sub_role": "BackEnd", + "max_cores": 64 + } + ) + + def test_device_metadata_for_namespace(self): + argument = [ + '-m', self.sample_graph, + '-n', 'asic0', + '--var-json', 'DEVICE_METADATA' + ] + output = json.loads(self.run_script(argument)) + print(output['localhost']) + self.assertDictEqual(output['localhost'], + { + "bgp_asn": None, + "region": "test", + "cloudtype": None, + "docker_routing_config_mode": "separated", + "hostname": "str-sonic-sup00", + "hwsku": "sonic-sup-sku", + "type": "SpineRouter", + "synchronous_mode": "enable", + "yang_config_validation": "disable", + "chassis_hostname": "str-sonic", + "deployment_id": "3", + "cluster": "TestbedForstr-sonic", + "sub_role": "BackEnd", + "asic_name": "asic0", + "switch_type": "chassis-packet", + "max_cores": 64 + } + ) + + def test_port(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '-v', "PORT[\'Ethernet-BP244\']" + ] + output = self.run_script(argument, ignore_warning=True) + print(output) + self.assertEqual( + output.strip(), + "{'lanes': '2828,2829', 'alias': 'Eth244-ASIC0', 'index': '122', 'speed': '100000', 'asic_port_name': 'Eth244-ASIC0', 'role': 'Int', 'fec': 'rs', 'description': 'Eth244-ASIC0', 'mtu': '9100', 'tpid': '0x8100', 'pfc_asym': 'off', 'admin_status': 'up'}" + ) + + def test_port_channel(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '-v', "PORTCHANNEL[\'PortChannel5004\']" + ] + output = self.run_script(argument, ignore_warning=True) + print(output) + self.assertEqual( + output.strip(), + """{'min_links': '2', 'lacp_key': 'auto', 'mtu': '9100', 'tpid': '0x8100', 'admin_status': 'up'}""") + + def test_port_channel_member(self): + argument = [ + '-m', self.sample_graph, + '-p', self.sample_port_config, + '-n', 'asic0', + '-v', "PORTCHANNEL_MEMBER.keys()|list" + ] + output = self.run_script(argument, ignore_warning=True) + print(output) + self.assertEqual( + utils.liststr_to_dict(output.strip()), + utils.liststr_to_dict( + "[('PortChannel5004', 'Ethernet-BP128'), " + "('PortChannel5004', 'Ethernet-BP132'), " + "('PortChannel5005', 'Ethernet-BP136'), " + "('PortChannel5005', 'Ethernet-BP140'), " + "('PortChannel5006', 'Ethernet-BP154'), " + "('PortChannel5006', 'Ethernet-BP168'), " + "('PortChannel5006', 'Ethernet-BP178'), " + "('PortChannel5007', 'Ethernet-BP156'), " + "('PortChannel5007', 'Ethernet-BP170'), " + "('PortChannel5007', 'Ethernet-BP180'), " + "('PortChannel5008', 'Ethernet-BP160'), " + "('PortChannel5008', 'Ethernet-BP164'), " + "('PortChannel5009', 'Ethernet-BP184'), " + "('PortChannel5009', 'Ethernet-BP194'), " + "('PortChannel5009', 'Ethernet-BP220'), " + "('PortChannel5010', 'Ethernet-BP190'), " + "('PortChannel5010', 'Ethernet-BP192'), " + "('PortChannel5010', 'Ethernet-BP218')]" + ) + ) + + def tearDown(self): + os.environ['CFGGEN_UNIT_TESTING'] = '' + os.environ['CFGGEN_UNIT_TESTING_TOPOLOGY'] = '' + if os.path.exists(self.output_file): + os.remove(self.output_file) \ No newline at end of file diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index 665f2b9719a9..bba0adeae752 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -7,6 +7,7 @@ import unittest import yaml import tests.common_utils as utils +from unittest import mock from unittest import TestCase from sonic_py_common.general import getstatusoutput_noshell @@ -16,6 +17,7 @@ else: import mock + SKU = 'multi-npu-01' ASIC_SKU = 'multi-npu-asic' NUM_ASIC = 4 @@ -39,6 +41,7 @@ def setUp(self): self.sample_no_asic_port_config = os.path.join(self.test_data_dir, 'sample_port_config-4.ini') self.output_file = os.path.join(self.test_dir, 'output') os.environ["CFGGEN_UNIT_TESTING"] = "2" + os.environ["CFGGEN_UNIT_TESTING_TOPOLOGY"] = "multi_asic" def run_script(self, argument, check_stderr=True, output_file=None, validateYang=True): print('\n Running sonic-cfggen ' + ' '.join(argument)) @@ -142,8 +145,8 @@ def test_metadata_tacacs(self): #TACPLUS_SERVER not present in the asic configuration. argument = ['-m', self.sample_graph, '--var-json', "TACPLUS_SERVER"] for asic in range(NUM_ASIC): - output = json.loads(self.run_script_for_asic(argument, asic, self.port_config[asic])) - self.assertDictEqual(output, {}) + output = self.run_script_for_asic(argument, asic, self.port_config[asic]) + self.assertEqual(output.strip(), '') def test_metadata_ntp(self): argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', "NTP_SERVER"] @@ -152,9 +155,9 @@ def test_metadata_ntp(self): #NTP data is present only in the host config argument = ['-m', self.sample_graph, '--var-json', "NTP_SERVER"] for asic in range(NUM_ASIC): - output = json.loads(self.run_script_for_asic(argument, asic, self.port_config[asic])) - print("Log:asic{} sku {}".format(asic,output)) - self.assertDictEqual(output, {}) + output = self.run_script_for_asic(argument, asic, self.port_config[asic]) + self.assertEqual(output.strip(), '') + def test_mgmt_port(self): argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', "MGMT_PORT"] @@ -174,12 +177,14 @@ def test_frontend_asic_portchannels(self): 'PortChannel4002': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'}}) def test_backend_asic_portchannels(self): + argument = ["-m", self.sample_graph, "-p", self.port_config[3], "-n", "asic3", "--var-json", "PORTCHANNEL"] output = json.loads(self.run_script(argument)) self.assertDictEqual(output, \ {'PortChannel4013': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'}, - 'PortChannel4014': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'}}) + 'PortChannel4014': {'admin_status': 'up', 'min_links': '2', 'mtu': '9100', 'tpid': '0x8100', 'lacp_key': 'auto'}}) + def test_frontend_asic_portchannel_mem(self): argument = ["-m", self.sample_graph, "-p", self.port_config[0], "-n", "asic0", "-v", "PORTCHANNEL_MEMBER.keys()|list"] output = self.run_script(argument) @@ -293,6 +298,8 @@ def test_backend_asic_device_neigh(self): 'Ethernet-BP392': {'name': 'ASIC1', 'port': 'Eth6-ASIC1'}, 'Ethernet-BP388': {'name': 'ASIC0', 'port': 'Eth7-ASIC0'}}) + + #@mock.patch("sonic_py_common.multi_asic.is_multi_asic", mock.MagicMock(return_value=True)) def test_backend_device_neigh_metadata(self): argument = ["-m", self.sample_graph, "-p", self.port_config[3], "-n", "asic3", "--var-json", "DEVICE_NEIGHBOR_METADATA"] output = json.loads(self.run_script(argument)) @@ -575,3 +582,4 @@ def test_no_asic_in_graph(self): def tearDown(self): os.environ["CFGGEN_UNIT_TESTING"] = "" + os.environ["CFGGEN_UNIT_TESTING_TOPOLOGY"] = "" From a55bb32f743256c01275174553f3a7fb3ced5094 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 29 May 2024 16:02:33 +0800 Subject: [PATCH 185/282] [submodule] Update submodule sonic-mgmt-common to the latest HEAD automatically (#19119) #### Why I did it src/sonic-mgmt-common ``` * 8b18795 - (HEAD -> master, origin/master, origin/HEAD) fix for the nil check in the subscribe request (#141) (6 hours ago) [Balachandar Mani] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-mgmt-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-common b/src/sonic-mgmt-common index 1e127441522a..8b18795325b2 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit 1e127441522a2fab99fc5d102853baed209131d4 +Subproject commit 8b18795325b2b47f8863ab9497fa844501a2f08c From b385b1b4b4333583801fa75f484f1b92f03d9ffc Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 29 May 2024 16:02:38 +0800 Subject: [PATCH 186/282] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#19118) #### Why I did it src/sonic-host-services ``` * 36e410d - (HEAD -> master, origin/master, origin/HEAD) Made Global and ASIC Scope Handling only for multi-asic only. (#130) (5 hours ago) [abdosi] * fd638d4 - Added support to render Feature Table has_global_scope field. (#120) (7 days ago) [abdosi] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index 246f2d2e6299..36e410d24e66 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 246f2d2e629947c1f77a9caa8fd6bfd0725b1a77 +Subproject commit 36e410d24e66ab717c3c83e95630436cc6efb729 From c198057fad0caed1a908c775842a33cb4911c7f4 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 29 May 2024 18:30:36 +0800 Subject: [PATCH 187/282] [Mellanox] enlarge the eeprom ready timeout from 20 to 60 (#18983) - Why I did it Service like ZTP accesses EEPROM very early at the boot stage. It could cause an issue that EEPROM is not ready. The PR enlarge EEPROM ready timeout from 20s to 60s. - How I did it Enlarge EEPROM ready timeout from 20s to 60s. - How to verify it Manual test --- platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py b/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py index b273afb9c114..8bf632de2847 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py @@ -52,7 +52,7 @@ os.makedirs(os.path.dirname(EEPROM_SYMLINK)) subprocess.check_call(['/usr/bin/xxd', '-r', '-p', 'syseeprom.hex', EEPROM_SYMLINK], cwd=platform_path) -WAIT_EEPROM_READY_SEC = 20 +WAIT_EEPROM_READY_SEC = 60 class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): From 180d5f9cb272bc15fb6513783e77ebfedfb51477 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 29 May 2024 19:01:01 +0800 Subject: [PATCH 188/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19120) #### Why I did it src/sonic-swss ``` * 835e576d - (HEAD -> master, origin/master, origin/HEAD) [tests] mark suppress-fib-pending VS test as expected to fail (6 hours ago) [Stepan Blyshchak] * 353ab92c - [subnet_decap] Add subnet decap (#3117) (10 hours ago) [Longxiang Lyu] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 3ee73618d410..835e576dbaca 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 3ee73618d41052ff24234a34e75551f12b5ba940 +Subproject commit 835e576dbaca4391277002f1856db629f91d783f From 5d43adb3648ab6c0c43d0fbfdd997039a58f8f5a Mon Sep 17 00:00:00 2001 From: Philo <135693886+philo-micas@users.noreply.github.com> Date: Thu, 30 May 2024 00:49:20 +0800 Subject: [PATCH 189/282] [Micas]: Add new centec platform m2-w6010 (#16088) Why I did it Add new platform m2-w6010(Centec) ASIC Vendor: Centec Switch ASIC: Centec Port Config: 48x1G+4x10G Work item tracking Microsoft ADO (number only): How I did it Provide device and platform related files. How to verify it show platform fan show platform ssdhealth show platform psustatus show platform summary show platform syseeprom show platform temperature show interface status Signed-off-by: philo --- .../M2-w6010-48gt4x-fa-board.json | 868 ++++++++ .../M2-w6010-48gt4x-fa-p-chip-profile.txt | 96 + .../M2-w6010-48gt4x-fa-p-datapath.txt | 281 +++ .../M2-W6010-48GT4X-FA/default_sku | 1 + .../M2-W6010-48GT4X-FA/phy_mapping.cfg | 198 ++ .../M2-W6010-48GT4X-FA/platform_asic | 1 + .../M2-W6010-48GT4X-FA/port_config.ini | 53 + .../M2-W6010-48GT4X-FA/sai.profile | 4 + .../M2-W6010-48GT4X-FA/start_up.cfg | 48 + .../default_sku | 1 + .../installer.conf | 9 + .../platform.json | 173 ++ .../platform_asic | 1 + .../plugins/sfputil.py | 428 ++++ .../plugins/ssd_util.py | 112 + .../pmon_daemon_control.json | 7 + .../system_health_monitoring_config.json | 0 .../M2-w6010-48gt4x-ra-board.json | 868 ++++++++ .../M2-w6010-48gt4x-ra-p-chip-profile.txt | 96 + .../M2-w6010-48gt4x-ra-p-datapath.txt | 281 +++ .../M2-W6010-48GT4X-RA/default_sku | 1 + .../M2-W6010-48GT4X-RA/phy_mapping.cfg | 198 ++ .../M2-W6010-48GT4X-RA/platform_asic | 1 + .../M2-W6010-48GT4X-RA/port_config.ini | 53 + .../M2-W6010-48GT4X-RA/sai.profile | 4 + .../M2-W6010-48GT4X-RA/start_up.cfg | 48 + .../default_sku | 1 + .../installer.conf | 9 + .../platform.json | 173 ++ .../platform_asic | 1 + .../plugins/sfputil.py | 428 ++++ .../plugins/ssd_util.py | 112 + .../pmon_daemon_control.json | 7 + .../system_health_monitoring_config.json | 0 .../centec-arm64/platform-modules-micas.dep | 9 + .../centec-arm64/platform-modules-micas.mk | 9 + .../sonic-platform-modules-micas/LICENSE | 15 + .../sonic-platform-modules-micas/README.md | 1 + .../common/Makefile | 49 + .../common/app/Makefile | 26 + .../common/lib/eepromutil/__init__.py | 0 .../common/lib/eepromutil/fantlv.py | 210 ++ .../common/lib/eepromutil/fru.py | 957 ++++++++ .../common/lib/wbutil/__init__.py | 0 .../common/lib/wbutil/baseutil.py | 23 + .../common/lib/wbutil/logutil.py | 67 + .../common/lib/wbutil/smbus.py | 774 +++++++ .../common/modules/COPYING | 20 + .../common/modules/GPL-2.0 | 359 +++ .../common/modules/Makefile | 23 + .../common/modules/dfd_tlveeprom.c | 521 +++++ .../common/modules/dfd_tlveeprom.h | 121 ++ .../common/modules/platform.h | 155 ++ .../common/modules/platform_common_module.c | 210 ++ .../common/modules/wb_platform.c | 79 + .../common/script/device_i2c.py | 283 +++ .../common/script/fancontrol.py | 495 +++++ .../common/script/interface.py | 77 + .../common/script/platform_common.py | 1303 +++++++++++ .../common/script/platform_config.py | 196 ++ .../common/script/platform_sensors.py | 92 + .../common/script/platform_util.py | 1934 +++++++++++++++++ .../common/script/sensors | 8 + .../common/service/device_i2c.service | 15 + .../common/service/fancontrol.service | 12 + .../common_custom/common_micas/Makefile | 24 + .../common_micas/lib/logutil/__init__.py | 0 .../common_micas/lib/logutil/logutil.py | 64 + .../lib/redfishutil/redfish_api.py | 304 +++ .../common_micas/lib/sonic_fwmgr/__init__.py | 0 .../lib/sonic_fwmgr/fwgmr_base.py | 141 ++ .../common_micas/lib/wbutil/__init__.py | 0 .../common_micas/lib/wbutil/platformutil.py | 290 +++ .../common_custom/common_micas/script/ctccmd | 3 + .../common_micas/script/privatenetwork.py | 50 + .../common_micas/script/privatenetwork.sh | 26 + .../script/update_machine_config.sh | 24 + .../service/privatenetwork.service | 13 + .../debian/changelog | 6 + .../debian/compat | 1 + .../debian/control | 14 + ...form-modules-micas-m2-w6010-48gt4x-fa.init | 61 + ...m-modules-micas-m2-w6010-48gt4x-fa.install | 2 + ...-modules-micas-m2-w6010-48gt4x-fa.postinst | 8 + ...form-modules-micas-m2-w6010-48gt4x-ra.init | 61 + ...m-modules-micas-m2-w6010-48gt4x-ra.install | 2 + ...-modules-micas-m2-w6010-48gt4x-ra.postinst | 8 + .../sonic-platform-modules-micas/debian/rules | 114 + ...rm64_micas_m2_w6010_48gt4x_fa_r0_config.py | 89 + .../config/fan_ctrl_cfg.json | 40 + .../service/m2-w6010-48gt4x_platform.service | 13 + .../m2-w6010-48gt4x-fa/setup.py | 15 + .../sonic_platform/__init__.py | 3 + .../sonic_platform/chassis.py | 444 ++++ .../sonic_platform/component.py | 93 + .../sonic_platform/eeprom.py | 38 + .../m2-w6010-48gt4x-fa/sonic_platform/fan.py | 178 ++ .../sonic_platform/fan_drawer.py | 124 ++ .../sonic_platform/hwaccess.py | 46 + .../sonic_platform/platform.py | 15 + .../m2-w6010-48gt4x-fa/sonic_platform/psu.py | 231 ++ .../sonic_platform/redfish_api.py | 304 +++ .../m2-w6010-48gt4x-fa/sonic_platform/sfp.py | 325 +++ .../sonic_platform/thermal.py | 172 ++ ...rm64_micas_m2_w6010_48gt4x_ra_r0_config.py | 90 + .../config/fan_ctrl_cfg.json | 40 + .../service/m2-w6010-48gt4x_platform.service | 13 + .../m2-w6010-48gt4x-ra/setup.py | 15 + .../sonic_platform/__init__.py | 3 + .../sonic_platform/chassis.py | 444 ++++ .../sonic_platform/component.py | 93 + .../sonic_platform/eeprom.py | 38 + .../m2-w6010-48gt4x-ra/sonic_platform/fan.py | 178 ++ .../sonic_platform/fan_drawer.py | 125 ++ .../sonic_platform/hwaccess.py | 46 + .../sonic_platform/platform.py | 15 + .../m2-w6010-48gt4x-ra/sonic_platform/psu.py | 231 ++ .../sonic_platform/redfish_api.py | 304 +++ .../m2-w6010-48gt4x-ra/sonic_platform/sfp.py | 325 +++ .../sonic_platform/thermal.py | 172 ++ platform/centec-arm64/sonic_fit.its | 24 + .../centec-arm64/tsingma-bsp/debian/rules | 2 + .../tsingma-bsp/debian/tsingma-bsp.install | 1 + .../tsingma-bsp/src/m2-w6010-48gt4x/Makefile | 5 + .../tsingma-bsp/src/m2-w6010-48gt4x/arm-gic.h | 23 + .../src/m2-w6010-48gt4x/ctc5236-clks.h | 25 + .../src/m2-w6010-48gt4x/ctc5236-clock.dtsi | 63 + .../src/m2-w6010-48gt4x/ctc5236.dtsi | 428 ++++ .../tsingma-bsp/src/m2-w6010-48gt4x/irq.h | 20 + .../m2-w6010-48gt4x/m2-w6010-48gt4x-r0.dts | 331 +++ 130 files changed, 19005 insertions(+) create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-board.json create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-p-chip-profile.txt create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-p-datapath.txt create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/default_sku create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/phy_mapping.cfg create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/platform_asic create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/port_config.ini create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/sai.profile create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/start_up.cfg create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/default_sku create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/installer.conf create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/platform.json create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/platform_asic create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/sfputil.py create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/ssd_util.py create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/pmon_daemon_control.json create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/system_health_monitoring_config.json create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-board.json create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-p-chip-profile.txt create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-p-datapath.txt create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/default_sku create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/phy_mapping.cfg create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/platform_asic create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/port_config.ini create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/sai.profile create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/start_up.cfg create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/default_sku create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/installer.conf create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/platform.json create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/platform_asic create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/sfputil.py create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/ssd_util.py create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/pmon_daemon_control.json create mode 100644 device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/system_health_monitoring_config.json create mode 100644 platform/centec-arm64/platform-modules-micas.dep create mode 100644 platform/centec-arm64/platform-modules-micas.mk create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/LICENSE create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/README.md create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/Makefile create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/app/Makefile create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/__init__.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/fantlv.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/fru.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/__init__.py create mode 100755 platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/baseutil.py create mode 100755 platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/logutil.py create mode 100755 platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/smbus.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/modules/COPYING create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/modules/GPL-2.0 create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/modules/Makefile create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.c create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.h create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/modules/platform.h create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/modules/platform_common_module.c create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/modules/wb_platform.c create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/script/device_i2c.py create mode 100755 platform/centec-arm64/sonic-platform-modules-micas/common/script/fancontrol.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/script/interface.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_common.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_config.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_sensors.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_util.py create mode 100755 platform/centec-arm64/sonic-platform-modules-micas/common/script/sensors create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/service/device_i2c.service create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common/service/fancontrol.service create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/Makefile create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/logutil/__init__.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/logutil/logutil.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/redfishutil/redfish_api.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/sonic_fwmgr/__init__.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/sonic_fwmgr/fwgmr_base.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/wbutil/__init__.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/wbutil/platformutil.py create mode 100755 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/ctccmd create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/privatenetwork.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/privatenetwork.sh create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/update_machine_config.sh create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/service/privatenetwork.service create mode 100755 platform/centec-arm64/sonic-platform-modules-micas/debian/changelog create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/debian/compat create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/debian/control create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.init create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.install create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.postinst create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.init create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.install create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.postinst create mode 100755 platform/centec-arm64/sonic-platform-modules-micas/debian/rules create mode 100755 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/config/arm64_micas_m2_w6010_48gt4x_fa_r0_config.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/config/fan_ctrl_cfg.json create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/service/m2-w6010-48gt4x_platform.service create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/setup.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/__init__.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/chassis.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/component.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/eeprom.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/fan.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/fan_drawer.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/hwaccess.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/platform.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/psu.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/redfish_api.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/sfp.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/thermal.py create mode 100755 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/config/arm64_micas_m2_w6010_48gt4x_ra_r0_config.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/config/fan_ctrl_cfg.json create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/service/m2-w6010-48gt4x_platform.service create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/setup.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/__init__.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/chassis.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/component.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/eeprom.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/fan.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/fan_drawer.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/hwaccess.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/platform.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/psu.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/redfish_api.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/sfp.py create mode 100644 platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/thermal.py create mode 100755 platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/Makefile create mode 100755 platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/arm-gic.h create mode 100755 platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236-clks.h create mode 100755 platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236-clock.dtsi create mode 100755 platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236.dtsi create mode 100755 platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/irq.h create mode 100755 platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/m2-w6010-48gt4x-r0.dts diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-board.json b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-board.json new file mode 100644 index 000000000000..80fb22238078 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-board.json @@ -0,0 +1,868 @@ +{ + "macleds" : { + "polarity" : 1, + "freq" : 2500, + "interval" : 50000000, + "maps" : [ + { + "port_id" : 0, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port1/brightness" + }, + { + "port_id" : 1, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port2/brightness" + }, + { + "port_id" : 2, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port3/brightness" + }, + { + "port_id" : 3, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port4/brightness" + }, + { + "port_id" : 4, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port5/brightness" + }, + { + "port_id" : 5, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port6/brightness" + }, + { + "port_id" : 6, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port7/brightness" + }, + { + "port_id" : 7, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port8/brightness" + }, + { + "port_id" : 16, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port9/brightness" + }, + { + "port_id" : 17, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port10/brightness" + }, + { + "port_id" : 18, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port11/brightness" + }, + { + "port_id" : 19, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port12/brightness" + }, + { + "port_id" : 20, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port13/brightness" + }, + { + "port_id" : 21, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port14/brightness" + }, + { + "port_id" : 22, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port15/brightness" + }, + { + "port_id" : 23, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port16/brightness" + }, + { + "port_id" : 8, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port17/brightness" + }, + { + "port_id" : 9, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port18/brightness" + }, + { + "port_id" : 10, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port19/brightness" + }, + { + "port_id" : 11, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port20/brightness" + }, + { + "port_id" : 32, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port21/brightness" + }, + { + "port_id" : 33, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port22/brightness" + }, + { + "port_id" : 34, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port23/brightness" + }, + { + "port_id" : 35, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port24/brightness" + }, + { + "port_id" : 36, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port25/brightness" + }, + { + "port_id" : 37, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port26/brightness" + }, + { + "port_id" : 38, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port27/brightness" + }, + { + "port_id" : 39, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port28/brightness" + }, + { + "port_id" : 40, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port29/brightness" + }, + { + "port_id" : 41, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port30/brightness" + }, + { + "port_id" : 42, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port31/brightness" + }, + { + "port_id" : 43, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port32/brightness" + }, + { + "port_id" : 24, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port33/brightness" + }, + { + "port_id" : 25, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port34/brightness" + }, + { + "port_id" : 26, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port35/brightness" + }, + { + "port_id" : 27, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port36/brightness" + }, + { + "port_id" : 48, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port37/brightness" + }, + { + "port_id" : 49, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port38/brightness" + }, + { + "port_id" : 50, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port39/brightness" + }, + { + "port_id" : 51, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port40/brightness" + }, + { + "port_id" : 52, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port41/brightness" + }, + { + "port_id" : 53, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port42/brightness" + }, + { + "port_id" : 54, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port43/brightness" + }, + { + "port_id" : 55, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port44/brightness" + }, + { + "port_id" : 56, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port45/brightness" + }, + { + "port_id" : 57, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port46/brightness" + }, + { + "port_id" : 58, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port47/brightness" + }, + { + "port_id" : 59, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port48/brightness" + }, + { + "port_id" : 12, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port49/brightness" + }, + { + "port_id" : 13, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port50/brightness" + }, + { + "port_id" : 14, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port51/brightness" + }, + { + "port_id" : 15, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port52/brightness" + } + ] + }, + "phys" : [ + { + "macid" : 0, + "busid" : 0, + "addr" : 0, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 1, + "busid" : 0, + "addr" : 1, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 2, + "busid" : 0, + "addr" : 2, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 3, + "busid" : 0, + "addr" : 3, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 4, + "busid" : 0, + "addr" : 4, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 5, + "busid" : 0, + "addr" : 5, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 6, + "busid" : 0, + "addr" : 6, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 7, + "busid" : 0, + "addr" : 7, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 16, + "busid" : 0, + "addr" : 8, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 17, + "busid" : 0, + "addr" : 9, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 18, + "busid" : 0, + "addr" : 10, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 19, + "busid" : 0, + "addr" : 11, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 20, + "busid" : 0, + "addr" : 12, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 21, + "busid" : 0, + "addr" : 13, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 22, + "busid" : 0, + "addr" : 14, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 23, + "busid" : 0, + "addr" : 15, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 8, + "busid" : 0, + "addr" : 16, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 9, + "busid" : 0, + "addr" : 17, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 10, + "busid" : 0, + "addr" : 18, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 11, + "busid" : 0, + "addr" : 19, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 32, + "busid" : 0, + "addr" : 20, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 33, + "busid" : 0, + "addr" : 21, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 34, + "busid" : 0, + "addr" : 22, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 35, + "busid" : 0, + "addr" : 23, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 36, + "busid" : 1, + "addr" : 0, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 37, + "busid" : 1, + "addr" : 1, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 38, + "busid" : 1, + "addr" : 2, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 39, + "busid" : 1, + "addr" : 3, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 40, + "busid" : 1, + "addr" : 4, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 41, + "busid" : 1, + "addr" : 5, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 42, + "busid" : 1, + "addr" : 6, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 43, + "busid" : 1, + "addr" : 7, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 24, + "busid" : 1, + "addr" : 8, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 25, + "busid" : 1, + "addr" : 9, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 26, + "busid" : 1, + "addr" : 10, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 27, + "busid" : 1, + "addr" : 11, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 48, + "busid" : 1, + "addr" : 12, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 49, + "busid" : 1, + "addr" : 13, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 50, + "busid" : 1, + "addr" : 14, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 51, + "busid" : 1, + "addr" : 15, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 52, + "busid" : 1, + "addr" : 16, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 53, + "busid" : 1, + "addr" : 17, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 54, + "busid" : 1, + "addr" : 18, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 55, + "busid" : 1, + "addr" : 19, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 56, + "busid" : 1, + "addr" : 20, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 57, + "busid" : 1, + "addr" : 21, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 58, + "busid" : 1, + "addr" : 22, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 59, + "busid" : 1, + "addr" : 23, + "base_port": 1, + "last_port": 4 + } + ], + "ffe" : { + "board_material" : "BOARD_MATERIAL_M4", + "config" : [ + { + "serdes_id" : [0], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 255, 10, 0] + }, + { + "serdes_id" : [1], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 240, 10, 0] + }, + { + "serdes_id" : [2], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 230, 10, 0] + }, + { + "serdes_id" : [3], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 220, 7, 0] + }, + { + "serdes_id" : [4], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 220, 8, 0] + }, + { + "serdes_id" : [5], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 210, 6, 0] + }, + { + "serdes_id" : [6], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 180, 6, 0] + }, + { + "serdes_id" : [7], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 180, 5, 0] + }, + { + "serdes_id" : [8], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [2, 160, 4, 0] + }, + { + "serdes_id" : [9], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [2, 160, 4, 0] + }, + { + "serdes_id" : [10], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [3, 140, 9, 0] + }, + { + "serdes_id" : [11], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [3, 140, 5, 0] + }, + { + "serdes_id" : [12, 13, 14, 15], + "is_dac" : 0, + "speed" : [10000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [3, 94, 15, 0] + } + ] + }, + "ctle" : { + "config" : [ + { + "serdes_id" : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], + "auto-en" : 0, + "cfg" : [6, 14, 2] + } + ] + } +} diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-p-chip-profile.txt b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-p-chip-profile.txt new file mode 100644 index 000000000000..2373e27f5f8b --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-p-chip-profile.txt @@ -0,0 +1,96 @@ +#----------------- SDK Feature Support -------------- +[MPLS_SUPPORT] = 1; +[APS_SUPPORT] = 1; +[OAM_SUPPORT] = 1; +[PTP_SUPPORT] = 0; +[SYNCE_SUPPORT] = 0; +[STACKING_SUPPORT] = 1; +[BPE_SUPPORT] = 0; +[IPFIX_SUPPORT] = 1; +[MONITOR_SUPPORT] = 1; +[OVERLAY_SUPPORT] = 1; +[EFD_SUPPORT] = 1; +[FCOE_SUPPORT] = 0; +[TRILL_SUPPORT] = 0; +[WLAN_SUPPORT] = 1; +[NPM_SUPPORT] = 1; +[DOT1AE_SUPPORT] = 1; + +#----------------- Chip Init Parameter -------------- +#Local chip number and global chip id +[Local chip_num] = 1 +[Local chip0] = 0 +[Local chip1] = 1 + +#Cut through mode 0: Disable; 1:10/40/100G; 2:1/10/100G; 3:1/10/40G; other:Flex, refer to CUT_THROUGH_BITMAP +[CUT_THROUGH_SPEED] = 0 +#Flex cut through mode, speed enable by bitmap, refer to ctc_port_speed_t, Notice: 10M/100M/1G treat as the same speed +[CUT_THROUGH_BITMAP] = 0 + +#Network cpu port +[CPU_NETWORK_PORT_EN] = 0 +[CPU_NETWORK_PORT_ID] = 47 + +#Enable parity error and multi-bit ecc recover +[ECC_RECOVER_EN] = 0 +[TCAM_SCAN_EN] = 0 + +#----------------- Interrupt Init Parameter -------------- +#0: pin, 1: msi +[Interrupt_mode] = 0 +[IRQ] = 69 + +#----------------- NextHop Init Parameter -------------- +#0: SDK work in pizzbox (single chip system), 1: SDK work in multi-chip system +[Nexthop Edit Mode] = 0 +[External Nexthop Number] = 16384 +[MPLS Tunnel Number] = 1024 + +#----------------- L2 Init Parameter -------------- +[FDB Hw Learning] = 1 +[Logic Port Num] = 1024 +#0: 128 instance per port, 1: 64 instance per port, 2: 32 instance per port +[STP MODE] = 0 +[MAX_FID_NUM] = 5120 + +#----------------- Stats Init Parameter -------------- +[STATS_PORT_EN] = 0 +[STATS_ECMP_EN] = 0 + +#----------------- BPE Init Parameter -------------- +[BPE_BR_PORT_EXTENDER_EN] = 0 +[BPE_BR_UC_MAX_ECID] = 1024 +[BPE_BR_MC_MAX_ECID] = 4096 +[BPE_BR_PORT_BASE] = 0 + +#----------------- Ipuc Init Parameter -------------- +#0: tcam use prefix 16; 1: tcam use prefix 8 +[IPUC_TCAM_PREFIX_8] = 1 + +#----------------- QoS Init Parameter -------------- +#QoS policer number support 1K/2K/4K/8K, default 4K +[QOS_POLICER_NUM] = 4096 +#QoS port queue number support 16/8/8 BPE/4 BPE, +#When resrc_profile.cfg exist, queue number valid, +#Default 8 queue mode +#8 queue = 8 +#16 queue = 16 +#4 queue BPE = 17 +#8 queue BPE = 18 +[QOS_PORT_QUEUE_NUM] = 8 +#QoS port extend queue number support 0/4, default 0 +[QOS_PORT_EXT_QUEUE_NUM] = 0 +#QoS CPU reason queue number support 128/64/32, default 128 +[QOS_CPU_QUEUE_NUM] = 128 +[QOS_INGRESS_VLAN_POLICER_NUM] = 0 +[QOS_EGRESS_VLAN_POLICER_NUM] = 0 +[QOS_POLICER_MERGE_MODE] = 0 +#QOS service queue mode, default 0,0:logic scr port + dstport enq 1:service id + dstport enq +[QOS_SERVICE_QUEUE_MODE] = 0 +#Global enable logic dst port + dstport enq +[QOS_SERVICE_QUEUE_EGRESS_EN] = 0 + +#----------------- Stacking Init Parameter -------------- +#0: normal mode; 1: spine-leaf mode +[FABRIC MODE] = 0 +[STACKING VERSION] = 1 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-p-datapath.txt b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-p-datapath.txt new file mode 100644 index 000000000000..959b97a150cc --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/M2-w6010-48gt4x-fa-p-datapath.txt @@ -0,0 +1,281 @@ +#Generated by 'CTC DataPath Tools' on Fri Dec 18 19:15:31 2020 +#Version 1.0, Supported by TsingMa SDK + + +#SERDES_MODE : 0-NONE, 1-XFI, 2-SGMII, 3-Not Support, 4-QSGMII, 5-XAUI, 6-DXAUI, 7-XLG, 8-CG, 9-SGMII2G5 +# 10-USXGMII-S, 11-USXGMII-M2G5, 12-USXGMII-M5G, 13-XXVG, 14-LG, 15-100BASE-FX +#SERDES_RX_POLY: 0-Normal, 1-Inverse +#SERDES_SWITCH : 0-Not Support Dynamic Switch, 1-Support Dynamic Switch + +[WLAN_ENABLE] = 1 +[DOT1AE_ENABLE] = 1 + +[CORE_PLLA] = 600 +#{ +[SERDES_ITEM] +#repeat 32 step 6 +[SERDES_ID] = 0 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 1 +[SERDES_TX_POLY] = 1 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 1 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 2 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 1 +[SERDES_TX_POLY] = 1 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 3 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 4 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 5 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 6 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 7 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 1 +[SERDES_TX_POLY] = 1 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 8 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 1 +[SERDES_TX_POLY] = 1 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 9 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 10 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 11 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 12 +[SERDES_MODE] = 1 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 1 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 13 +[SERDES_MODE] = 1 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 1 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 14 +[SERDES_MODE] = 1 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 1 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 15 +[SERDES_MODE] = 1 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 1 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 16 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 17 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 18 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 19 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 20 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 21 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 22 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 23 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 24 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 25 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 26 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 1 + +[SERDES_ID] = 27 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 1 + +[SERDES_ID] = 28 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 29 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 30 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 1 + +[SERDES_ID] = 31 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 1 + +#repeat end +#} + + +#[SERDES_TO_LPORT] +#{ +# | QSGMII/USXGMII-M2G5 | USXGMII-M5G | USXGMII-S | 100BASE-FX | SGMII/SGMII2G5/XFI | XAUI/DXAUI | XLG | XXVG | LG | CG +#---------|---------------------|-------------|-----------|------------|--------------------|------------|-----|------|----|--- +#serdes 0 |0 /1 /2 /3 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 1 |4 /5 /6 /7 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 2 |16/17/18/19 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 3 |20/21/22/23 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 4 |8 /9 /10/11 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 5 |32/33/34/35 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 6 |36/37/38/39 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 7 |40/41/42/43 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 8 |24/25/26/27 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 9 |48/49/50/51 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 10|52/53/54/55 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 11|56/57/58/59 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 12|NA |NA |NA |12 |12 |12 |12 |NA |NA |NA +#serdes 13|NA |NA |NA |13 |13 |12 |12 |NA |NA |NA +#serdes 14|NA |NA |NA |14 |14 |12 |12 |NA |NA |NA +#serdes 15|NA |NA |NA |15 |15 |12 |12 |NA |NA |NA +#serdes 16|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 17|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 18|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 19|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 20|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 21|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 22|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 23|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 24|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 25|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 26|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 27|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 28|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 29|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 30|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 31|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#} diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/default_sku b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/default_sku new file mode 100644 index 000000000000..c29b09ab9378 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/default_sku @@ -0,0 +1 @@ +M2-W6010-48GT4X-FA l1 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/phy_mapping.cfg b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/phy_mapping.cfg new file mode 100644 index 000000000000..eefd67e9c28b --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/phy_mapping.cfg @@ -0,0 +1,198 @@ +#######################PHY_MAPPING_48+4####################### + +#{ +[PHY_MAPPING_ITEM] + +[API_PORT] = 0 +[PHY_ADDR] = 0 +[MDIO_BUS] = 0 + +[API_PORT] = 1 +[PHY_ADDR] = 1 +[MDIO_BUS] = 0 + +[API_PORT] = 2 +[PHY_ADDR] = 2 +[MDIO_BUS] = 0 + +[API_PORT] = 3 +[PHY_ADDR] = 3 +[MDIO_BUS] = 0 + +[API_PORT] = 4 +[PHY_ADDR] = 4 +[MDIO_BUS] = 0 + +[API_PORT] = 5 +[PHY_ADDR] = 5 +[MDIO_BUS] = 0 + +[API_PORT] = 6 +[PHY_ADDR] = 6 +[MDIO_BUS] = 0 + +[API_PORT] = 7 +[PHY_ADDR] = 7 +[MDIO_BUS] = 0 + +[API_PORT] = 16 +[PHY_ADDR] = 8 +[MDIO_BUS] = 0 + +[API_PORT] = 17 +[PHY_ADDR] = 9 +[MDIO_BUS] = 0 + +[API_PORT] = 18 +[PHY_ADDR] = 10 +[MDIO_BUS] = 0 + +[API_PORT] = 19 +[PHY_ADDR] = 11 +[MDIO_BUS] = 0 + +[API_PORT] = 20 +[PHY_ADDR] = 12 +[MDIO_BUS] = 0 + +[API_PORT] = 21 +[PHY_ADDR] = 13 +[MDIO_BUS] = 0 + +[API_PORT] = 22 +[PHY_ADDR] = 14 +[MDIO_BUS] = 0 + +[API_PORT] = 23 +[PHY_ADDR] = 15 +[MDIO_BUS] = 0 + +[API_PORT] = 8 +[PHY_ADDR] = 16 +[MDIO_BUS] = 0 + +[API_PORT] = 9 +[PHY_ADDR] = 17 +[MDIO_BUS] = 0 + +[API_PORT] = 10 +[PHY_ADDR] = 18 +[MDIO_BUS] = 0 + +[API_PORT] = 11 +[PHY_ADDR] = 19 +[MDIO_BUS] = 0 + +[API_PORT] = 32 +[PHY_ADDR] = 20 +[MDIO_BUS] = 0 + +[API_PORT] = 33 +[PHY_ADDR] = 21 +[MDIO_BUS] = 0 + +[API_PORT] = 34 +[PHY_ADDR] = 22 +[MDIO_BUS] = 0 + +[API_PORT] = 35 +[PHY_ADDR] = 23 +[MDIO_BUS] = 0 + +[API_PORT] = 36 +[PHY_ADDR] = 0 +[MDIO_BUS] = 1 + +[API_PORT] = 37 +[PHY_ADDR] = 1 +[MDIO_BUS] = 1 + +[API_PORT] = 38 +[PHY_ADDR] = 2 +[MDIO_BUS] = 1 + +[API_PORT] = 39 +[PHY_ADDR] = 3 +[MDIO_BUS] = 1 + +[API_PORT] = 40 +[PHY_ADDR] = 4 +[MDIO_BUS] = 1 + +[API_PORT] = 41 +[PHY_ADDR] = 5 +[MDIO_BUS] = 1 + +[API_PORT] = 42 +[PHY_ADDR] = 6 +[MDIO_BUS] = 1 + +[API_PORT] = 43 +[PHY_ADDR] = 7 +[MDIO_BUS] = 1 + +[API_PORT] = 24 +[PHY_ADDR] = 8 +[MDIO_BUS] = 1 + +[API_PORT] = 25 +[PHY_ADDR] = 9 +[MDIO_BUS] = 1 + +[API_PORT] = 26 +[PHY_ADDR] = 10 +[MDIO_BUS] = 1 + +[API_PORT] = 27 +[PHY_ADDR] = 11 +[MDIO_BUS] = 1 + +[API_PORT] = 48 +[PHY_ADDR] = 12 +[MDIO_BUS] = 1 + +[API_PORT] = 49 +[PHY_ADDR] = 13 +[MDIO_BUS] = 1 + +[API_PORT] = 50 +[PHY_ADDR] = 14 +[MDIO_BUS] = 1 + +[API_PORT] = 51 +[PHY_ADDR] = 15 +[MDIO_BUS] = 1 + +[API_PORT] = 52 +[PHY_ADDR] = 16 +[MDIO_BUS] = 1 + +[API_PORT] = 53 +[PHY_ADDR] = 17 +[MDIO_BUS] = 1 + +[API_PORT] = 54 +[PHY_ADDR] = 18 +[MDIO_BUS] = 1 + +[API_PORT] = 55 +[PHY_ADDR] = 19 +[MDIO_BUS] = 1 + +[API_PORT] = 56 +[PHY_ADDR] = 20 +[MDIO_BUS] = 1 + +[API_PORT] = 57 +[PHY_ADDR] = 21 +[MDIO_BUS] = 1 + +[API_PORT] = 58 +[PHY_ADDR] = 22 +[MDIO_BUS] = 1 + +[API_PORT] = 59 +[PHY_ADDR] = 23 +[MDIO_BUS] = 1 + +#} diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/platform_asic b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/platform_asic new file mode 100644 index 000000000000..0815c8a78c0b --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/platform_asic @@ -0,0 +1 @@ +centec-arm64 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/port_config.ini b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/port_config.ini new file mode 100644 index 000000000000..cd9f488c53b2 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/port_config.ini @@ -0,0 +1,53 @@ +# name lanes alias index speed admin_status +Ethernet1 0 eth-0-1 1 1000 up +Ethernet2 1 eth-0-2 2 1000 up +Ethernet3 2 eth-0-3 3 1000 up +Ethernet4 3 eth-0-4 4 1000 up +Ethernet5 4 eth-0-5 5 1000 up +Ethernet6 5 eth-0-6 6 1000 up +Ethernet7 6 eth-0-7 7 1000 up +Ethernet8 7 eth-0-8 8 1000 up +Ethernet9 16 eth-0-9 9 1000 up +Ethernet10 17 eth-0-10 10 1000 up +Ethernet11 18 eth-0-11 11 1000 up +Ethernet12 19 eth-0-12 12 1000 up +Ethernet13 20 eth-0-13 13 1000 up +Ethernet14 21 eth-0-14 14 1000 up +Ethernet15 22 eth-0-15 15 1000 up +Ethernet16 23 eth-0-16 16 1000 up +Ethernet17 8 eth-0-17 17 1000 up +Ethernet18 9 eth-0-18 18 1000 up +Ethernet19 10 eth-0-19 19 1000 up +Ethernet20 11 eth-0-20 20 1000 up +Ethernet21 32 eth-0-21 21 1000 up +Ethernet22 33 eth-0-22 22 1000 up +Ethernet23 34 eth-0-23 23 1000 up +Ethernet24 35 eth-0-24 24 1000 up +Ethernet25 36 eth-0-25 25 1000 up +Ethernet26 37 eth-0-26 26 1000 up +Ethernet27 38 eth-0-27 27 1000 up +Ethernet28 39 eth-0-28 28 1000 up +Ethernet29 40 eth-0-29 29 1000 up +Ethernet30 41 eth-0-30 30 1000 up +Ethernet31 42 eth-0-31 31 1000 up +Ethernet32 43 eth-0-32 32 1000 up +Ethernet33 24 eth-0-33 33 1000 up +Ethernet34 25 eth-0-34 34 1000 up +Ethernet35 26 eth-0-35 35 1000 up +Ethernet36 27 eth-0-36 36 1000 up +Ethernet37 48 eth-0-37 37 1000 up +Ethernet38 49 eth-0-38 38 1000 up +Ethernet39 50 eth-0-39 39 1000 up +Ethernet40 51 eth-0-40 40 1000 up +Ethernet41 52 eth-0-41 41 1000 up +Ethernet42 53 eth-0-42 42 1000 up +Ethernet43 54 eth-0-43 43 1000 up +Ethernet44 55 eth-0-44 44 1000 up +Ethernet45 56 eth-0-45 45 1000 up +Ethernet46 57 eth-0-46 46 1000 up +Ethernet47 58 eth-0-47 47 1000 up +Ethernet48 59 eth-0-48 48 1000 up +Ethernet49 12 eth-0-49 49 10000 up +Ethernet50 13 eth-0-50 50 10000 up +Ethernet51 14 eth-0-51 51 10000 up +Ethernet52 15 eth-0-52 52 10000 up diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/sai.profile b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/sai.profile new file mode 100644 index 000000000000..edeaddd8e482 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/sai.profile @@ -0,0 +1,4 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/M2-w6010-48gt4x-fa-p-chip-profile.txt +SAI_HW_PORT_PROFILE_ID_CONFIG_FILE=/usr/share/sonic/hwsku/M2-w6010-48gt4x-fa-p-datapath.txt +SAI_PLATFORM_CFG_FILE=/usr/share/sonic/hwsku/M2-w6010-48gt4x-fa-board.json +SAI_PHY_DRIVER_PATH=/usr/share/sonic/hwsku/phy_drv \ No newline at end of file diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/start_up.cfg b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/start_up.cfg new file mode 100644 index 000000000000..b012adedb252 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA/start_up.cfg @@ -0,0 +1,48 @@ + +chip set serdes 0 ffe mode user-define c0 0 c1 255 c2 10 c3 0 c4 0 +chip set serdes 1 ffe mode user-define c0 0 c1 240 c2 10 c3 0 c4 0 +chip set serdes 2 ffe mode user-define c0 0 c1 230 c2 10 c3 0 c4 0 +chip set serdes 3 ffe mode user-define c0 0 c1 220 c2 7 c3 0 c4 0 +chip set serdes 4 ffe mode user-define c0 0 c1 220 c2 8 c3 0 c4 0 +chip set serdes 5 ffe mode user-define c0 0 c1 210 c2 6 c3 0 c4 0 +chip set serdes 6 ffe mode user-define c0 0 c1 180 c2 6 c3 0 c4 0 +chip set serdes 7 ffe mode user-define c0 0 c1 180 c2 5 c3 0 c4 0 +chip set serdes 8 ffe mode user-define c0 2 c1 160 c2 4 c3 0 c4 0 +chip set serdes 9 ffe mode user-define c0 2 c1 160 c2 4 c3 0 c4 0 +chip set serdes 10 ffe mode user-define c0 3 c1 140 c2 9 c3 0 c4 0 +chip set serdes 11 ffe mode user-define c0 3 c1 140 c2 5 c3 0 c4 0 +chip set serdes 12 ffe mode user-define c0 3 c1 94 c2 15 c3 0 c4 0 +chip set serdes 13 ffe mode user-define c0 3 c1 94 c2 15 c3 0 c4 0 +chip set serdes 14 ffe mode user-define c0 3 c1 94 c2 15 c3 0 c4 0 +chip set serdes 15 ffe mode user-define c0 3 c1 94 c2 15 c3 0 c4 0 + + +chip set serdes 0 ctle 6 14 2 +chip set serdes 1 ctle 6 14 2 +chip set serdes 2 ctle 6 14 2 +chip set serdes 3 ctle 6 14 2 +chip set serdes 4 ctle 6 14 2 +chip set serdes 5 ctle 6 14 2 +chip set serdes 6 ctle 6 14 2 +chip set serdes 7 ctle 6 14 2 +chip set serdes 8 ctle 6 14 2 +chip set serdes 9 ctle 6 14 2 +chip set serdes 10 ctle 6 14 2 +chip set serdes 11 ctle 6 14 2 + + + +# rtk eye param, post_amp|main_amp|pre_amp +port 0 phy-attr type 2001 value 0x1c1e00 +port 4 phy-attr type 2001 value 0x101600 +port 16 phy-attr type 2001 value 0x111500 +port 20 phy-attr type 2001 value 0x0e1100 +port 8 phy-attr type 2001 value 0x0f1000 +port 32 phy-attr type 2001 value 0x0e0f00 +port 36 phy-attr type 2001 value 0x0a0a00 +port 40 phy-attr type 2001 value 0x0a0900 +port 24 phy-attr type 2001 value 0x000c00 +port 48 phy-attr type 2001 value 0x000b00 +port 52 phy-attr type 2001 value 0x000b00 +port 56 phy-attr type 2001 value 0x000a00 + diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/default_sku b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/default_sku new file mode 100644 index 000000000000..c29b09ab9378 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/default_sku @@ -0,0 +1 @@ +M2-W6010-48GT4X-FA l1 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/installer.conf b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/installer.conf new file mode 100644 index 000000000000..6e00c7ff77f1 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/installer.conf @@ -0,0 +1,9 @@ +CONSOLE_SPEED=115200 + +#fix env +config_env(){ + dd if=/dev/mtd1 of=env.bin + flashcp -v env.bin /dev/mtd4 +} +trap_push "config_env || true" + diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/platform.json b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/platform.json new file mode 100644 index 000000000000..36f541f1ef02 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/platform.json @@ -0,0 +1,173 @@ +{ + "chassis": { + "name": "M2-W6010-48GT4X-FA", + "thermal_manager": false, + "status_led": { + "controllable": false, + "colors": ["green", "blinking_green", "amber", "blinking_amber"] + }, + "components": [ + { + "name": "CPU CPLD" + }, + { + "name": "MAC1 CPLD" + } + ], + "fans": [ + { + "name": "Fantray1_1", + "speed": { + "controllable": true, + "minimum": 30, + "maximum": 99 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + }, + { + "name": "Fantray2_1", + "speed": { + "controllable": true, + "minimum": 30, + "maximum": 99 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + } + ], + "fan_drawers":[ + { + "name": "Fantray1", + "num_fans" : 1, + "status_led": { + "controllable": false, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "FanTray1_1", + "speed": { + "controllable": true, + "minimum": 30, + "maximum": 99 + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "Fantray2", + "num_fans" : 1, + "status_led": { + "controllable": false, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "FanTray2_1", + "speed": { + "controllable": true, + "minimum": 30, + "maximum": 99 + }, + "status_led": { + "available": false + } + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "voltage": true, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": true, + "voltage_low_threshold": true, + "temperature": true, + "fans_target_speed": false, + "status_led": { + "controllable": false + } + }, + { + "name": "PSU 2", + "voltage": true, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": true, + "voltage_low_threshold": true, + "temperature": true, + "fans_target_speed": false, + "status_led": { + "controllable": false + } + } + ], + "thermals": [ + { + "name": "ASIC_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "CPU_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "INLET_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "OUTLET_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "TPS53688_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + } + ], + "modules": [], + "sfps": [] + }, + "interfaces": {} +} diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/platform_asic b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/platform_asic new file mode 100644 index 000000000000..0815c8a78c0b --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/platform_asic @@ -0,0 +1 @@ +centec-arm64 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/sfputil.py b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/sfputil.py new file mode 100644 index 000000000000..c4fdbe2c3a8c --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/sfputil.py @@ -0,0 +1,428 @@ +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# + +try: + import time + import subprocess + import re + import os + import threading + 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 = 49 + PORT_END = 52 + PORTS_IN_BLOCK = 53 + EEPROM_OFFSET = 9 + SFP_DEVICE_TYPE = "optoe2" + QSFP_DEVICE_TYPE = "optoe1" + I2C_MAX_ATTEMPT = 3 + + SFP_STATUS_INSERTED = '1' + SFP_STATUS_REMOVED = '0' + + TXWRT_PROTECT = 0X4E + TXWRT_NO_PROTECT = 0X59 + + _port_to_eeprom_mapping = {} + port_to_i2cbus_mapping ={} + port_dict = {} + port_presence_info = {} + port_reset_info = {} + port_txdis_info = {} + port_txwrt_info = {} + port_led_info = {} + + port_rxlos_info = {} + port_txfault_info = {} + port_drop_info = {} + + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END + + @property + def sfp_ports(self): + return list(range(self.PORT_START, self.PORTS_IN_BLOCK)) + + @property + def qsfp_ports(self): + return [] + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): + for x in range(self.PORT_START, self.PORTS_IN_BLOCK): + self.port_to_i2cbus_mapping[x] = (x - self.PORT_START + self.EEPROM_OFFSET) + self.port_presence_info["/sys/bus/i2c/devices/3-0030/sfp_presence1"] = [49, 50, 51, 52] + self.port_txdis_info["/sys/bus/i2c/devices/3-0030/tx_disable"] = [49, 50, 51, 52] + self.port_txwrt_info["/sys/bus/i2c/devices/3-0030/tx_write_protect"] = [49, 50, 51, 52] + + # bit 1: los + self.port_rxlos_info["/sys/bus/i2c/devices/3-0030/sfp_rx_loss1"] = [49, 50, 51, 52] + + # bit 1: fault + self.port_txfault_info["/sys/bus/i2c/devices/3-0030/sfp_tx_fault1"] = [49, 50, 51, 52] + + # bit 1: drop + self.port_drop_info["/sys/bus/i2c/devices/3-0030/sfp_drop_record1"] = [49, 50, 51, 52] + + SfpUtilBase.__init__(self) + + def _sfp_read_file_path(self, file_path, offset, num_bytes): + attempts = 0 + while attempts < self.I2C_MAX_ATTEMPT: + try: + file_path.seek(offset) + read_buf = file_path.read(num_bytes) + except Exception: + attempts += 1 + time.sleep(0.05) + else: + return True, read_buf + return False, None + + def _sfp_eeprom_present(self, sysfs_sfp_i2c_client_eeprompath, offset): + """Tries to read the eeprom file to determine if the + device/sfp is present or not. If sfp present, the read returns + valid bytes. If not, read returns error 'Connection timed out""" + + if not os.path.exists(sysfs_sfp_i2c_client_eeprompath): + return False + else: + with open(sysfs_sfp_i2c_client_eeprompath, "rb", buffering=0) as sysfsfile: + rv, buf = self._sfp_read_file_path(sysfsfile, offset, 1) + return rv + + def _add_new_sfp_device(self, sysfs_sfp_i2c_adapter_path, devaddr, devtype): + try: + sysfs_nd_path = "%s/new_device" % sysfs_sfp_i2c_adapter_path + + # Write device address to new_device file + nd_file = open(sysfs_nd_path, "w") + nd_str = "%s %s" % (devtype, hex(devaddr)) + nd_file.write(nd_str) + nd_file.close() + + except Exception as err: + print(("Error writing to new device file: %s" % str(err))) + return 1 + else: + return 0 + + def _get_port_eeprom_path(self, port_num, devid): + if port_num in list(self.port_to_eeprom_mapping.keys()): + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[port_num] + else: + sysfs_i2c_adapter_base_path = "/sys/class/i2c-adapter" + + i2c_adapter_id = self._get_port_i2c_adapter_id(port_num) + if i2c_adapter_id is None: + print("Error getting i2c bus num") + return None + + # Get i2c virtual bus path for the sfp + sysfs_sfp_i2c_adapter_path = "%s/i2c-%s" % (sysfs_i2c_adapter_base_path, + str(i2c_adapter_id)) + + # If i2c bus for port does not exist + if not os.path.exists(sysfs_sfp_i2c_adapter_path): + print(("Could not find i2c bus %s. Driver not loaded?" % sysfs_sfp_i2c_adapter_path)) + return None + + sysfs_sfp_i2c_client_path = "%s/%s-00%s" % (sysfs_sfp_i2c_adapter_path, + str(i2c_adapter_id), + hex(devid)[-2:]) + + # If sfp device is not present on bus, Add it + if not os.path.exists(sysfs_sfp_i2c_client_path): + if port_num in self.qsfp_ports: + ret = self._add_new_sfp_device( + sysfs_sfp_i2c_adapter_path, devid, self.QSFP_DEVICE_TYPE) + else: + ret = self._add_new_sfp_device( + sysfs_sfp_i2c_adapter_path, devid, self.SFP_DEVICE_TYPE) + if ret != 0: + print("Error adding sfp device") + return None + + sysfs_sfp_i2c_client_eeprom_path = "%s/eeprom" % sysfs_sfp_i2c_client_path + return sysfs_sfp_i2c_client_eeprom_path + + def _read_eeprom_specific_bytes(self, sysfsfile_eeprom, offset, num_bytes): + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + rv, raw = self._sfp_read_file_path(sysfsfile_eeprom, offset, num_bytes) + if rv == False: + return None + + try: + if isinstance(raw, str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except Exception as err: + return None + return eeprom_raw + + def get_eeprom_dom_raw(self, port_num): + if port_num in self.qsfp_ports: + # QSFP DOM EEPROM is also at addr 0x50 and thus also stored in eeprom_ifraw + return None + else: + # Read dom eeprom at addr 0x51 + return self._read_eeprom_devid(port_num, self.IDENTITY_EEPROM_ADDR, 256) + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + presence_path = None + for presence_key in self.port_presence_info: + if port_num in self.port_presence_info[presence_key]: + presence_path = presence_key + presence_offset = self.port_presence_info[presence_key].index(port_num) + break + if presence_path == None: + return False + + try: + data = open(presence_path, "rb") + except IOError: + return False + + presence_data = data.read(2) + if presence_data == "": + return False + result = int(presence_data, 16) + data.close() + + # ModPrsL is active low + if result & (1 << presence_offset) == 0: + return True + + return False + + def get_low_power_mode(self, port_num): + return False + + def set_low_power_mode(self, port_num, lpmode): + return False + + def reset(self, port_num): + return False + + def reset_all(self): + return False + + def _do_write_file(self, file_handle, offset, value): + file_handle.seek(offset) + file_handle.write(hex(value)) + + def get_transceiver_change_event(self, timeout=0): + + start_time = time.time() + currernt_port_dict = {} + forever = False + + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + print(("get_transceiver_change_event:Invalid timeout value", timeout)) + return False, {} + + end_time = start_time + timeout + if start_time > end_time: + print(('get_transceiver_change_event:' \ + 'time wrap / invalid timeout value', timeout)) + + return False, {} # Time wrap or possibly incorrect timeout + + while timeout >= 0: + # Check for OIR events and return updated port_dict + for x in range(self.PORT_START, self.PORTS_IN_BLOCK): + if self.get_presence(x): + currernt_port_dict[x] = self.SFP_STATUS_INSERTED + else: + currernt_port_dict[x] = self.SFP_STATUS_REMOVED + if (currernt_port_dict == self.port_dict): + if forever: + time.sleep(1) + else: + timeout = end_time - time.time() + if timeout >= 1: + time.sleep(1) # We poll at 1 second granularity + else: + if timeout > 0: + time.sleep(timeout) + return True, {} + else: + # Update reg value + self.port_dict = currernt_port_dict + return True, self.port_dict + print ("get_transceiver_change_event: Should not reach here.") + return False, {} + + def tx_disable(self, port_num, disable): + if not self.get_presence(port_num): + return False + + if port_num in self.sfp_ports: + txwrt_path = None + txdis_path = None + txdis_offset = 0 + + for key in self.port_txwrt_info: + if port_num in self.port_txwrt_info[key]: + txwrt_path = key + break + if txwrt_path == None: + return False + + for key in self.port_txdis_info: + if port_num in self.port_txdis_info[key]: + txdis_path = key + txdis_offset = self.port_txdis_info[key].index(port_num) + break + if txdis_path == None: + return False + + + try: + with open(txwrt_path, "r+") as sys_file: + sres = hex(self.TXWRT_NO_PROTECT)[2:] + sys_file.write(sres) + + with open(txdis_path, "r+") as sys_file: + txdis_data = sys_file.read(2) + if not txdis_data: + return False + result = int(txdis_data, 16) + if disable: + result = result | (1 << txdis_offset) + else: + result = result & (~(1 << txdis_offset)) + sys_file.seek(0) + sres = hex(result)[2:] + print(result,sres) + sys_file.write(sres) + + with open(txwrt_path, "r+") as sys_file: + sres = hex(self.TXWRT_PROTECT)[2:] + sys_file.write(sres) + except Exception as err: + print(err) + return False + + return True + else: + return False + +########### sysdiag ########### + def _get_cpld_info(self, port_num, info): + path = None + offset = 0 + for key in info: + if port_num in info[key]: + path = key + offset = info[key].index(port_num) + break + return path, offset + + def get_tx_disable(self, port_num): + # cur only support sfp moudle + if port_num not in self.sfp_ports: + return False + + if not self.get_presence(port_num): + return False + + path, offset = self._get_cpld_info(port_num, self.port_txdis_info) + if path == None: + return False + + result = 0 + try: + with open(path, "r") as sys_file: + data = sys_file.read(2) + result = int(data, 16) + except Exception as e: + print((str(e))) + return False + + # 1: disable + if result & (1 << offset): + return True + else: + return False + + def get_rx_los(self, port_num): + # cur only support sfp moudle + if port_num not in self.sfp_ports: + return False + + path, offset = self._get_cpld_info(port_num, self.port_rxlos_info) + if path == None: + return False + + result = 0 + try: + with open(path, "r") as sys_file: + data = sys_file.read(2) + result = int(data, 16) + except Exception as e: + print((str(e))) + return False + + # 1: los + if result & (1 << offset): + return True + else: + return False + + def get_tx_fault(self, port_num): + # cur only support sfp moudle + if port_num not in self.sfp_ports: + return False + + if not self.get_presence(port_num): + return False + + path, offset = self._get_cpld_info(port_num, self.port_txfault_info) + if path == None: + return False + + result = 0 + try: + with open(path, "r") as sys_file: + data = sys_file.read(2) + result = int(data, 16) + except Exception as e: + print((str(e))) + return False + + # 1: fault + if result & (1 << offset): + return True + + return False diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/ssd_util.py b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/ssd_util.py new file mode 100644 index 000000000000..95ca23e8b351 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/ssd_util.py @@ -0,0 +1,112 @@ +# +# ssd_util.py +# +# Generic implementation of the SSD health API +# SSD models supported: +# - InnoDisk +# - StorFly +# - Virtium + +try: + import subprocess + from sonic_platform_base.sonic_ssd.ssd_base import SsdBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +HEALTH_CMD = "cat /sys/kernel/debug/mmc0/mmc0:0001/ext_csd | cut -c 537-538" +SERIAL_CMD = "cat /sys/bus/mmc/devices/mmc0\\:0001/serial" +FIRMWARE_CMD = "cat /sys/kernel/debug/mmc0/mmc0:0001/ext_csd | cut -c 509-522" +NOT_AVAILABLE = "N/A" + +class SsdUtil(SsdBase): + """ + Generic implementation of the SSD health API + """ + def __init__(self, diskdev): + self.model = "KLMCG4JETD-B041" + self.temperature = NOT_AVAILABLE + self.vendor_ssd_info = "====No vendor information====" + self.health_list = [100,90,80,70,60,50,40,30,20,10,0] + try: + life_time = self._execute_shell(HEALTH_CMD) + if int(life_time) in range(1,12): + self.health = self.health_list[int(life_time) - 1] + else: + self.health = NOT_AVAILABLE + except Exception as e: + self.health = NOT_AVAILABLE + + try: + self.firmware = self._execute_shell(FIRMWARE_CMD) + except Exception as e: + self.firmware = NOT_AVAILABLE + + try: + serial = self._execute_shell(SERIAL_CMD) + self.serial = serial.replace("0x",'') + except Exception as e: + self.serial = NOT_AVAILABLE + + def _execute_shell(self, cmd): + status, output = subprocess.getstatusoutput(cmd) + if status: + return None + + return output + + def get_health(self): + """ + Retrieves current disk health in percentages + + Returns: + A float number of current ssd health + e.g. 83.5 + """ + return self.health + + def get_temperature(self): + """ + Retrieves current disk temperature in Celsius + + Returns: + A float number of current temperature in Celsius + e.g. 40.1 + """ + return self.temperature + + def get_model(self): + """ + Retrieves model for the given disk device + + Returns: + A string holding disk model as provided by the manufacturer + """ + return self.model + + def get_firmware(self): + """ + Retrieves firmware version for the given disk device + + Returns: + A string holding disk firmware version as provided by the manufacturer + """ + return self.firmware + + def get_serial(self): + """ + Retrieves serial number for the given disk device + + Returns: + A string holding disk serial number as provided by the manufacturer + """ + return self.serial + + def get_vendor_output(self): + """ + Retrieves vendor specific data for the given disk device + + Returns: + A string holding some vendor specific disk information + """ + return self.vendor_ssd_info + diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/pmon_daemon_control.json b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..5fdf83f1b9e6 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/pmon_daemon_control.json @@ -0,0 +1,7 @@ +{ + "skip_ledd": true, + "skip_xcvrd": false, + "skip_syseepromd": false, + "skip_thermalctld": false, + "skip_psud": false +} diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/system_health_monitoring_config.json b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-board.json b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-board.json new file mode 100644 index 000000000000..80fb22238078 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-board.json @@ -0,0 +1,868 @@ +{ + "macleds" : { + "polarity" : 1, + "freq" : 2500, + "interval" : 50000000, + "maps" : [ + { + "port_id" : 0, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port1/brightness" + }, + { + "port_id" : 1, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port2/brightness" + }, + { + "port_id" : 2, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port3/brightness" + }, + { + "port_id" : 3, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port4/brightness" + }, + { + "port_id" : 4, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port5/brightness" + }, + { + "port_id" : 5, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port6/brightness" + }, + { + "port_id" : 6, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port7/brightness" + }, + { + "port_id" : 7, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port8/brightness" + }, + { + "port_id" : 16, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port9/brightness" + }, + { + "port_id" : 17, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port10/brightness" + }, + { + "port_id" : 18, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port11/brightness" + }, + { + "port_id" : 19, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port12/brightness" + }, + { + "port_id" : 20, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port13/brightness" + }, + { + "port_id" : 21, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port14/brightness" + }, + { + "port_id" : 22, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port15/brightness" + }, + { + "port_id" : 23, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port16/brightness" + }, + { + "port_id" : 8, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port17/brightness" + }, + { + "port_id" : 9, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port18/brightness" + }, + { + "port_id" : 10, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port19/brightness" + }, + { + "port_id" : 11, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port20/brightness" + }, + { + "port_id" : 32, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port21/brightness" + }, + { + "port_id" : 33, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port22/brightness" + }, + { + "port_id" : 34, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port23/brightness" + }, + { + "port_id" : 35, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port24/brightness" + }, + { + "port_id" : 36, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port25/brightness" + }, + { + "port_id" : 37, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port26/brightness" + }, + { + "port_id" : 38, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port27/brightness" + }, + { + "port_id" : 39, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port28/brightness" + }, + { + "port_id" : 40, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port29/brightness" + }, + { + "port_id" : 41, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port30/brightness" + }, + { + "port_id" : 42, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port31/brightness" + }, + { + "port_id" : 43, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port32/brightness" + }, + { + "port_id" : 24, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port33/brightness" + }, + { + "port_id" : 25, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port34/brightness" + }, + { + "port_id" : 26, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port35/brightness" + }, + { + "port_id" : 27, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port36/brightness" + }, + { + "port_id" : 48, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port37/brightness" + }, + { + "port_id" : 49, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port38/brightness" + }, + { + "port_id" : 50, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port39/brightness" + }, + { + "port_id" : 51, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port40/brightness" + }, + { + "port_id" : 52, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port41/brightness" + }, + { + "port_id" : 53, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port42/brightness" + }, + { + "port_id" : 54, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port43/brightness" + }, + { + "port_id" : 55, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port44/brightness" + }, + { + "port_id" : 56, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port45/brightness" + }, + { + "port_id" : 57, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port46/brightness" + }, + { + "port_id" : 58, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port47/brightness" + }, + { + "port_id" : 59, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port48/brightness" + }, + { + "port_id" : 12, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port49/brightness" + }, + { + "port_id" : 13, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port50/brightness" + }, + { + "port_id" : 14, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port51/brightness" + }, + { + "port_id" : 15, + "lchip" : 0, + "ctl_id" : 0, + "mode" : "LED_MODE_1_RXLNK_BIACT", + "fixed" : 0, + "sysfs_path" : "/sys/class/leds/port52/brightness" + } + ] + }, + "phys" : [ + { + "macid" : 0, + "busid" : 0, + "addr" : 0, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 1, + "busid" : 0, + "addr" : 1, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 2, + "busid" : 0, + "addr" : 2, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 3, + "busid" : 0, + "addr" : 3, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 4, + "busid" : 0, + "addr" : 4, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 5, + "busid" : 0, + "addr" : 5, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 6, + "busid" : 0, + "addr" : 6, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 7, + "busid" : 0, + "addr" : 7, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 16, + "busid" : 0, + "addr" : 8, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 17, + "busid" : 0, + "addr" : 9, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 18, + "busid" : 0, + "addr" : 10, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 19, + "busid" : 0, + "addr" : 11, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 20, + "busid" : 0, + "addr" : 12, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 21, + "busid" : 0, + "addr" : 13, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 22, + "busid" : 0, + "addr" : 14, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 23, + "busid" : 0, + "addr" : 15, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 8, + "busid" : 0, + "addr" : 16, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 9, + "busid" : 0, + "addr" : 17, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 10, + "busid" : 0, + "addr" : 18, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 11, + "busid" : 0, + "addr" : 19, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 32, + "busid" : 0, + "addr" : 20, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 33, + "busid" : 0, + "addr" : 21, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 34, + "busid" : 0, + "addr" : 22, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 35, + "busid" : 0, + "addr" : 23, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 36, + "busid" : 1, + "addr" : 0, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 37, + "busid" : 1, + "addr" : 1, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 38, + "busid" : 1, + "addr" : 2, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 39, + "busid" : 1, + "addr" : 3, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 40, + "busid" : 1, + "addr" : 4, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 41, + "busid" : 1, + "addr" : 5, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 42, + "busid" : 1, + "addr" : 6, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 43, + "busid" : 1, + "addr" : 7, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 24, + "busid" : 1, + "addr" : 8, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 25, + "busid" : 1, + "addr" : 9, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 26, + "busid" : 1, + "addr" : 10, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 27, + "busid" : 1, + "addr" : 11, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 48, + "busid" : 1, + "addr" : 12, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 49, + "busid" : 1, + "addr" : 13, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 50, + "busid" : 1, + "addr" : 14, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 51, + "busid" : 1, + "addr" : 15, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 52, + "busid" : 1, + "addr" : 16, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 53, + "busid" : 1, + "addr" : 17, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 54, + "busid" : 1, + "addr" : 18, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 55, + "busid" : 1, + "addr" : 19, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 56, + "busid" : 1, + "addr" : 20, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 57, + "busid" : 1, + "addr" : 21, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 58, + "busid" : 1, + "addr" : 22, + "base_port": 1, + "last_port": 4 + }, + { + "macid" : 59, + "busid" : 1, + "addr" : 23, + "base_port": 1, + "last_port": 4 + } + ], + "ffe" : { + "board_material" : "BOARD_MATERIAL_M4", + "config" : [ + { + "serdes_id" : [0], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 255, 10, 0] + }, + { + "serdes_id" : [1], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 240, 10, 0] + }, + { + "serdes_id" : [2], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 230, 10, 0] + }, + { + "serdes_id" : [3], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 220, 7, 0] + }, + { + "serdes_id" : [4], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 220, 8, 0] + }, + { + "serdes_id" : [5], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 210, 6, 0] + }, + { + "serdes_id" : [6], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 180, 6, 0] + }, + { + "serdes_id" : [7], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [0, 180, 5, 0] + }, + { + "serdes_id" : [8], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [2, 160, 4, 0] + }, + { + "serdes_id" : [9], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [2, 160, 4, 0] + }, + { + "serdes_id" : [10], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [3, 140, 9, 0] + }, + { + "serdes_id" : [11], + "is_dac" : 0, + "speed" : [1000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [3, 140, 5, 0] + }, + { + "serdes_id" : [12, 13, 14, 15], + "is_dac" : 0, + "speed" : [10000], + "mode" : "CTC_CHIP_SERDES_FFE_MODE_DEFINE", + "cfg" : [3, 94, 15, 0] + } + ] + }, + "ctle" : { + "config" : [ + { + "serdes_id" : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], + "auto-en" : 0, + "cfg" : [6, 14, 2] + } + ] + } +} diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-p-chip-profile.txt b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-p-chip-profile.txt new file mode 100644 index 000000000000..2373e27f5f8b --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-p-chip-profile.txt @@ -0,0 +1,96 @@ +#----------------- SDK Feature Support -------------- +[MPLS_SUPPORT] = 1; +[APS_SUPPORT] = 1; +[OAM_SUPPORT] = 1; +[PTP_SUPPORT] = 0; +[SYNCE_SUPPORT] = 0; +[STACKING_SUPPORT] = 1; +[BPE_SUPPORT] = 0; +[IPFIX_SUPPORT] = 1; +[MONITOR_SUPPORT] = 1; +[OVERLAY_SUPPORT] = 1; +[EFD_SUPPORT] = 1; +[FCOE_SUPPORT] = 0; +[TRILL_SUPPORT] = 0; +[WLAN_SUPPORT] = 1; +[NPM_SUPPORT] = 1; +[DOT1AE_SUPPORT] = 1; + +#----------------- Chip Init Parameter -------------- +#Local chip number and global chip id +[Local chip_num] = 1 +[Local chip0] = 0 +[Local chip1] = 1 + +#Cut through mode 0: Disable; 1:10/40/100G; 2:1/10/100G; 3:1/10/40G; other:Flex, refer to CUT_THROUGH_BITMAP +[CUT_THROUGH_SPEED] = 0 +#Flex cut through mode, speed enable by bitmap, refer to ctc_port_speed_t, Notice: 10M/100M/1G treat as the same speed +[CUT_THROUGH_BITMAP] = 0 + +#Network cpu port +[CPU_NETWORK_PORT_EN] = 0 +[CPU_NETWORK_PORT_ID] = 47 + +#Enable parity error and multi-bit ecc recover +[ECC_RECOVER_EN] = 0 +[TCAM_SCAN_EN] = 0 + +#----------------- Interrupt Init Parameter -------------- +#0: pin, 1: msi +[Interrupt_mode] = 0 +[IRQ] = 69 + +#----------------- NextHop Init Parameter -------------- +#0: SDK work in pizzbox (single chip system), 1: SDK work in multi-chip system +[Nexthop Edit Mode] = 0 +[External Nexthop Number] = 16384 +[MPLS Tunnel Number] = 1024 + +#----------------- L2 Init Parameter -------------- +[FDB Hw Learning] = 1 +[Logic Port Num] = 1024 +#0: 128 instance per port, 1: 64 instance per port, 2: 32 instance per port +[STP MODE] = 0 +[MAX_FID_NUM] = 5120 + +#----------------- Stats Init Parameter -------------- +[STATS_PORT_EN] = 0 +[STATS_ECMP_EN] = 0 + +#----------------- BPE Init Parameter -------------- +[BPE_BR_PORT_EXTENDER_EN] = 0 +[BPE_BR_UC_MAX_ECID] = 1024 +[BPE_BR_MC_MAX_ECID] = 4096 +[BPE_BR_PORT_BASE] = 0 + +#----------------- Ipuc Init Parameter -------------- +#0: tcam use prefix 16; 1: tcam use prefix 8 +[IPUC_TCAM_PREFIX_8] = 1 + +#----------------- QoS Init Parameter -------------- +#QoS policer number support 1K/2K/4K/8K, default 4K +[QOS_POLICER_NUM] = 4096 +#QoS port queue number support 16/8/8 BPE/4 BPE, +#When resrc_profile.cfg exist, queue number valid, +#Default 8 queue mode +#8 queue = 8 +#16 queue = 16 +#4 queue BPE = 17 +#8 queue BPE = 18 +[QOS_PORT_QUEUE_NUM] = 8 +#QoS port extend queue number support 0/4, default 0 +[QOS_PORT_EXT_QUEUE_NUM] = 0 +#QoS CPU reason queue number support 128/64/32, default 128 +[QOS_CPU_QUEUE_NUM] = 128 +[QOS_INGRESS_VLAN_POLICER_NUM] = 0 +[QOS_EGRESS_VLAN_POLICER_NUM] = 0 +[QOS_POLICER_MERGE_MODE] = 0 +#QOS service queue mode, default 0,0:logic scr port + dstport enq 1:service id + dstport enq +[QOS_SERVICE_QUEUE_MODE] = 0 +#Global enable logic dst port + dstport enq +[QOS_SERVICE_QUEUE_EGRESS_EN] = 0 + +#----------------- Stacking Init Parameter -------------- +#0: normal mode; 1: spine-leaf mode +[FABRIC MODE] = 0 +[STACKING VERSION] = 1 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-p-datapath.txt b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-p-datapath.txt new file mode 100644 index 000000000000..959b97a150cc --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/M2-w6010-48gt4x-ra-p-datapath.txt @@ -0,0 +1,281 @@ +#Generated by 'CTC DataPath Tools' on Fri Dec 18 19:15:31 2020 +#Version 1.0, Supported by TsingMa SDK + + +#SERDES_MODE : 0-NONE, 1-XFI, 2-SGMII, 3-Not Support, 4-QSGMII, 5-XAUI, 6-DXAUI, 7-XLG, 8-CG, 9-SGMII2G5 +# 10-USXGMII-S, 11-USXGMII-M2G5, 12-USXGMII-M5G, 13-XXVG, 14-LG, 15-100BASE-FX +#SERDES_RX_POLY: 0-Normal, 1-Inverse +#SERDES_SWITCH : 0-Not Support Dynamic Switch, 1-Support Dynamic Switch + +[WLAN_ENABLE] = 1 +[DOT1AE_ENABLE] = 1 + +[CORE_PLLA] = 600 +#{ +[SERDES_ITEM] +#repeat 32 step 6 +[SERDES_ID] = 0 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 1 +[SERDES_TX_POLY] = 1 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 1 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 2 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 1 +[SERDES_TX_POLY] = 1 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 3 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 4 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 5 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 6 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 7 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 1 +[SERDES_TX_POLY] = 1 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 8 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 1 +[SERDES_TX_POLY] = 1 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 9 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 10 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 11 +[SERDES_MODE] = 4 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 12 +[SERDES_MODE] = 1 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 1 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 13 +[SERDES_MODE] = 1 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 1 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 14 +[SERDES_MODE] = 1 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 1 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 15 +[SERDES_MODE] = 1 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 1 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 16 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 17 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 18 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 19 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 20 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 21 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 22 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 23 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 24 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 25 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 26 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 1 + +[SERDES_ID] = 27 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 1 + +[SERDES_ID] = 28 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 29 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 0 + +[SERDES_ID] = 30 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 1 + +[SERDES_ID] = 31 +[SERDES_MODE] = 3 +[SERDES_RX_POLY] = 0 +[SERDES_TX_POLY] = 0 +[SERDES_SWITCH] = 0 +[SERDES_GROUP] = 1 + +#repeat end +#} + + +#[SERDES_TO_LPORT] +#{ +# | QSGMII/USXGMII-M2G5 | USXGMII-M5G | USXGMII-S | 100BASE-FX | SGMII/SGMII2G5/XFI | XAUI/DXAUI | XLG | XXVG | LG | CG +#---------|---------------------|-------------|-----------|------------|--------------------|------------|-----|------|----|--- +#serdes 0 |0 /1 /2 /3 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 1 |4 /5 /6 /7 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 2 |16/17/18/19 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 3 |20/21/22/23 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 4 |8 /9 /10/11 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 5 |32/33/34/35 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 6 |36/37/38/39 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 7 |40/41/42/43 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 8 |24/25/26/27 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 9 |48/49/50/51 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 10|52/53/54/55 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 11|56/57/58/59 |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 12|NA |NA |NA |12 |12 |12 |12 |NA |NA |NA +#serdes 13|NA |NA |NA |13 |13 |12 |12 |NA |NA |NA +#serdes 14|NA |NA |NA |14 |14 |12 |12 |NA |NA |NA +#serdes 15|NA |NA |NA |15 |15 |12 |12 |NA |NA |NA +#serdes 16|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 17|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 18|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 19|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 20|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 21|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 22|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 23|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 24|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 25|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 26|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 27|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 28|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 29|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 30|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#serdes 31|NA |NA |NA |NA |NA |NA |NA |NA |NA |NA +#} diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/default_sku b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/default_sku new file mode 100644 index 000000000000..c9a5806d0236 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/default_sku @@ -0,0 +1 @@ +M2-W6010-48GT4X-RA l1 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/phy_mapping.cfg b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/phy_mapping.cfg new file mode 100644 index 000000000000..eefd67e9c28b --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/phy_mapping.cfg @@ -0,0 +1,198 @@ +#######################PHY_MAPPING_48+4####################### + +#{ +[PHY_MAPPING_ITEM] + +[API_PORT] = 0 +[PHY_ADDR] = 0 +[MDIO_BUS] = 0 + +[API_PORT] = 1 +[PHY_ADDR] = 1 +[MDIO_BUS] = 0 + +[API_PORT] = 2 +[PHY_ADDR] = 2 +[MDIO_BUS] = 0 + +[API_PORT] = 3 +[PHY_ADDR] = 3 +[MDIO_BUS] = 0 + +[API_PORT] = 4 +[PHY_ADDR] = 4 +[MDIO_BUS] = 0 + +[API_PORT] = 5 +[PHY_ADDR] = 5 +[MDIO_BUS] = 0 + +[API_PORT] = 6 +[PHY_ADDR] = 6 +[MDIO_BUS] = 0 + +[API_PORT] = 7 +[PHY_ADDR] = 7 +[MDIO_BUS] = 0 + +[API_PORT] = 16 +[PHY_ADDR] = 8 +[MDIO_BUS] = 0 + +[API_PORT] = 17 +[PHY_ADDR] = 9 +[MDIO_BUS] = 0 + +[API_PORT] = 18 +[PHY_ADDR] = 10 +[MDIO_BUS] = 0 + +[API_PORT] = 19 +[PHY_ADDR] = 11 +[MDIO_BUS] = 0 + +[API_PORT] = 20 +[PHY_ADDR] = 12 +[MDIO_BUS] = 0 + +[API_PORT] = 21 +[PHY_ADDR] = 13 +[MDIO_BUS] = 0 + +[API_PORT] = 22 +[PHY_ADDR] = 14 +[MDIO_BUS] = 0 + +[API_PORT] = 23 +[PHY_ADDR] = 15 +[MDIO_BUS] = 0 + +[API_PORT] = 8 +[PHY_ADDR] = 16 +[MDIO_BUS] = 0 + +[API_PORT] = 9 +[PHY_ADDR] = 17 +[MDIO_BUS] = 0 + +[API_PORT] = 10 +[PHY_ADDR] = 18 +[MDIO_BUS] = 0 + +[API_PORT] = 11 +[PHY_ADDR] = 19 +[MDIO_BUS] = 0 + +[API_PORT] = 32 +[PHY_ADDR] = 20 +[MDIO_BUS] = 0 + +[API_PORT] = 33 +[PHY_ADDR] = 21 +[MDIO_BUS] = 0 + +[API_PORT] = 34 +[PHY_ADDR] = 22 +[MDIO_BUS] = 0 + +[API_PORT] = 35 +[PHY_ADDR] = 23 +[MDIO_BUS] = 0 + +[API_PORT] = 36 +[PHY_ADDR] = 0 +[MDIO_BUS] = 1 + +[API_PORT] = 37 +[PHY_ADDR] = 1 +[MDIO_BUS] = 1 + +[API_PORT] = 38 +[PHY_ADDR] = 2 +[MDIO_BUS] = 1 + +[API_PORT] = 39 +[PHY_ADDR] = 3 +[MDIO_BUS] = 1 + +[API_PORT] = 40 +[PHY_ADDR] = 4 +[MDIO_BUS] = 1 + +[API_PORT] = 41 +[PHY_ADDR] = 5 +[MDIO_BUS] = 1 + +[API_PORT] = 42 +[PHY_ADDR] = 6 +[MDIO_BUS] = 1 + +[API_PORT] = 43 +[PHY_ADDR] = 7 +[MDIO_BUS] = 1 + +[API_PORT] = 24 +[PHY_ADDR] = 8 +[MDIO_BUS] = 1 + +[API_PORT] = 25 +[PHY_ADDR] = 9 +[MDIO_BUS] = 1 + +[API_PORT] = 26 +[PHY_ADDR] = 10 +[MDIO_BUS] = 1 + +[API_PORT] = 27 +[PHY_ADDR] = 11 +[MDIO_BUS] = 1 + +[API_PORT] = 48 +[PHY_ADDR] = 12 +[MDIO_BUS] = 1 + +[API_PORT] = 49 +[PHY_ADDR] = 13 +[MDIO_BUS] = 1 + +[API_PORT] = 50 +[PHY_ADDR] = 14 +[MDIO_BUS] = 1 + +[API_PORT] = 51 +[PHY_ADDR] = 15 +[MDIO_BUS] = 1 + +[API_PORT] = 52 +[PHY_ADDR] = 16 +[MDIO_BUS] = 1 + +[API_PORT] = 53 +[PHY_ADDR] = 17 +[MDIO_BUS] = 1 + +[API_PORT] = 54 +[PHY_ADDR] = 18 +[MDIO_BUS] = 1 + +[API_PORT] = 55 +[PHY_ADDR] = 19 +[MDIO_BUS] = 1 + +[API_PORT] = 56 +[PHY_ADDR] = 20 +[MDIO_BUS] = 1 + +[API_PORT] = 57 +[PHY_ADDR] = 21 +[MDIO_BUS] = 1 + +[API_PORT] = 58 +[PHY_ADDR] = 22 +[MDIO_BUS] = 1 + +[API_PORT] = 59 +[PHY_ADDR] = 23 +[MDIO_BUS] = 1 + +#} diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/platform_asic b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/platform_asic new file mode 100644 index 000000000000..0815c8a78c0b --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/platform_asic @@ -0,0 +1 @@ +centec-arm64 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/port_config.ini b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/port_config.ini new file mode 100644 index 000000000000..cd9f488c53b2 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/port_config.ini @@ -0,0 +1,53 @@ +# name lanes alias index speed admin_status +Ethernet1 0 eth-0-1 1 1000 up +Ethernet2 1 eth-0-2 2 1000 up +Ethernet3 2 eth-0-3 3 1000 up +Ethernet4 3 eth-0-4 4 1000 up +Ethernet5 4 eth-0-5 5 1000 up +Ethernet6 5 eth-0-6 6 1000 up +Ethernet7 6 eth-0-7 7 1000 up +Ethernet8 7 eth-0-8 8 1000 up +Ethernet9 16 eth-0-9 9 1000 up +Ethernet10 17 eth-0-10 10 1000 up +Ethernet11 18 eth-0-11 11 1000 up +Ethernet12 19 eth-0-12 12 1000 up +Ethernet13 20 eth-0-13 13 1000 up +Ethernet14 21 eth-0-14 14 1000 up +Ethernet15 22 eth-0-15 15 1000 up +Ethernet16 23 eth-0-16 16 1000 up +Ethernet17 8 eth-0-17 17 1000 up +Ethernet18 9 eth-0-18 18 1000 up +Ethernet19 10 eth-0-19 19 1000 up +Ethernet20 11 eth-0-20 20 1000 up +Ethernet21 32 eth-0-21 21 1000 up +Ethernet22 33 eth-0-22 22 1000 up +Ethernet23 34 eth-0-23 23 1000 up +Ethernet24 35 eth-0-24 24 1000 up +Ethernet25 36 eth-0-25 25 1000 up +Ethernet26 37 eth-0-26 26 1000 up +Ethernet27 38 eth-0-27 27 1000 up +Ethernet28 39 eth-0-28 28 1000 up +Ethernet29 40 eth-0-29 29 1000 up +Ethernet30 41 eth-0-30 30 1000 up +Ethernet31 42 eth-0-31 31 1000 up +Ethernet32 43 eth-0-32 32 1000 up +Ethernet33 24 eth-0-33 33 1000 up +Ethernet34 25 eth-0-34 34 1000 up +Ethernet35 26 eth-0-35 35 1000 up +Ethernet36 27 eth-0-36 36 1000 up +Ethernet37 48 eth-0-37 37 1000 up +Ethernet38 49 eth-0-38 38 1000 up +Ethernet39 50 eth-0-39 39 1000 up +Ethernet40 51 eth-0-40 40 1000 up +Ethernet41 52 eth-0-41 41 1000 up +Ethernet42 53 eth-0-42 42 1000 up +Ethernet43 54 eth-0-43 43 1000 up +Ethernet44 55 eth-0-44 44 1000 up +Ethernet45 56 eth-0-45 45 1000 up +Ethernet46 57 eth-0-46 46 1000 up +Ethernet47 58 eth-0-47 47 1000 up +Ethernet48 59 eth-0-48 48 1000 up +Ethernet49 12 eth-0-49 49 10000 up +Ethernet50 13 eth-0-50 50 10000 up +Ethernet51 14 eth-0-51 51 10000 up +Ethernet52 15 eth-0-52 52 10000 up diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/sai.profile b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/sai.profile new file mode 100644 index 000000000000..0194d4ecdd3a --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/sai.profile @@ -0,0 +1,4 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/M2-w6010-48gt4x-ra-p-chip-profile.txt +SAI_HW_PORT_PROFILE_ID_CONFIG_FILE=/usr/share/sonic/hwsku/M2-w6010-48gt4x-ra-p-datapath.txt +SAI_PLATFORM_CFG_FILE=/usr/share/sonic/hwsku/M2-w6010-48gt4x-ra-board.json +SAI_PHY_DRIVER_PATH=/usr/share/sonic/hwsku/phy_drv \ No newline at end of file diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/start_up.cfg b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/start_up.cfg new file mode 100644 index 000000000000..b012adedb252 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA/start_up.cfg @@ -0,0 +1,48 @@ + +chip set serdes 0 ffe mode user-define c0 0 c1 255 c2 10 c3 0 c4 0 +chip set serdes 1 ffe mode user-define c0 0 c1 240 c2 10 c3 0 c4 0 +chip set serdes 2 ffe mode user-define c0 0 c1 230 c2 10 c3 0 c4 0 +chip set serdes 3 ffe mode user-define c0 0 c1 220 c2 7 c3 0 c4 0 +chip set serdes 4 ffe mode user-define c0 0 c1 220 c2 8 c3 0 c4 0 +chip set serdes 5 ffe mode user-define c0 0 c1 210 c2 6 c3 0 c4 0 +chip set serdes 6 ffe mode user-define c0 0 c1 180 c2 6 c3 0 c4 0 +chip set serdes 7 ffe mode user-define c0 0 c1 180 c2 5 c3 0 c4 0 +chip set serdes 8 ffe mode user-define c0 2 c1 160 c2 4 c3 0 c4 0 +chip set serdes 9 ffe mode user-define c0 2 c1 160 c2 4 c3 0 c4 0 +chip set serdes 10 ffe mode user-define c0 3 c1 140 c2 9 c3 0 c4 0 +chip set serdes 11 ffe mode user-define c0 3 c1 140 c2 5 c3 0 c4 0 +chip set serdes 12 ffe mode user-define c0 3 c1 94 c2 15 c3 0 c4 0 +chip set serdes 13 ffe mode user-define c0 3 c1 94 c2 15 c3 0 c4 0 +chip set serdes 14 ffe mode user-define c0 3 c1 94 c2 15 c3 0 c4 0 +chip set serdes 15 ffe mode user-define c0 3 c1 94 c2 15 c3 0 c4 0 + + +chip set serdes 0 ctle 6 14 2 +chip set serdes 1 ctle 6 14 2 +chip set serdes 2 ctle 6 14 2 +chip set serdes 3 ctle 6 14 2 +chip set serdes 4 ctle 6 14 2 +chip set serdes 5 ctle 6 14 2 +chip set serdes 6 ctle 6 14 2 +chip set serdes 7 ctle 6 14 2 +chip set serdes 8 ctle 6 14 2 +chip set serdes 9 ctle 6 14 2 +chip set serdes 10 ctle 6 14 2 +chip set serdes 11 ctle 6 14 2 + + + +# rtk eye param, post_amp|main_amp|pre_amp +port 0 phy-attr type 2001 value 0x1c1e00 +port 4 phy-attr type 2001 value 0x101600 +port 16 phy-attr type 2001 value 0x111500 +port 20 phy-attr type 2001 value 0x0e1100 +port 8 phy-attr type 2001 value 0x0f1000 +port 32 phy-attr type 2001 value 0x0e0f00 +port 36 phy-attr type 2001 value 0x0a0a00 +port 40 phy-attr type 2001 value 0x0a0900 +port 24 phy-attr type 2001 value 0x000c00 +port 48 phy-attr type 2001 value 0x000b00 +port 52 phy-attr type 2001 value 0x000b00 +port 56 phy-attr type 2001 value 0x000a00 + diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/default_sku b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/default_sku new file mode 100644 index 000000000000..c9a5806d0236 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/default_sku @@ -0,0 +1 @@ +M2-W6010-48GT4X-RA l1 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/installer.conf b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/installer.conf new file mode 100644 index 000000000000..6e00c7ff77f1 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/installer.conf @@ -0,0 +1,9 @@ +CONSOLE_SPEED=115200 + +#fix env +config_env(){ + dd if=/dev/mtd1 of=env.bin + flashcp -v env.bin /dev/mtd4 +} +trap_push "config_env || true" + diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/platform.json b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/platform.json new file mode 100644 index 000000000000..53a47b144c4f --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/platform.json @@ -0,0 +1,173 @@ +{ + "chassis": { + "name": "M2-W6010-48GT4X-RA", + "thermal_manager": false, + "status_led": { + "controllable": false, + "colors": ["green", "blinking_green", "amber", "blinking_amber"] + }, + "components": [ + { + "name": "CPU CPLD" + }, + { + "name": "MAC1 CPLD" + } + ], + "fans": [ + { + "name": "Fantray1_1", + "speed": { + "controllable": true, + "minimum": 30, + "maximum": 99 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + }, + { + "name": "Fantray2_1", + "speed": { + "controllable": true, + "minimum": 30, + "maximum": 99 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + } + ], + "fan_drawers":[ + { + "name": "Fantray1", + "num_fans" : 1, + "status_led": { + "controllable": false, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "FanTray1_1", + "speed": { + "controllable": true, + "minimum": 30, + "maximum": 99 + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "Fantray2", + "num_fans" : 1, + "status_led": { + "controllable": false, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "FanTray2_1", + "speed": { + "controllable": true, + "minimum": 30, + "maximum": 99 + }, + "status_led": { + "available": false + } + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "voltage": true, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": true, + "voltage_low_threshold": true, + "temperature": true, + "fans_target_speed": false, + "status_led": { + "controllable": false + } + }, + { + "name": "PSU 2", + "voltage": true, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": true, + "voltage_low_threshold": true, + "temperature": true, + "fans_target_speed": false, + "status_led": { + "controllable": false + } + } + ], + "thermals": [ + { + "name": "ASIC_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "CPU_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "INLET_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "OUTLET_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "TPS53688_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + } + ], + "modules": [], + "sfps": [] + }, + "interfaces": {} +} diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/platform_asic b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/platform_asic new file mode 100644 index 000000000000..0815c8a78c0b --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/platform_asic @@ -0,0 +1 @@ +centec-arm64 diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/sfputil.py b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/sfputil.py new file mode 100644 index 000000000000..c4fdbe2c3a8c --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/sfputil.py @@ -0,0 +1,428 @@ +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# + +try: + import time + import subprocess + import re + import os + import threading + 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 = 49 + PORT_END = 52 + PORTS_IN_BLOCK = 53 + EEPROM_OFFSET = 9 + SFP_DEVICE_TYPE = "optoe2" + QSFP_DEVICE_TYPE = "optoe1" + I2C_MAX_ATTEMPT = 3 + + SFP_STATUS_INSERTED = '1' + SFP_STATUS_REMOVED = '0' + + TXWRT_PROTECT = 0X4E + TXWRT_NO_PROTECT = 0X59 + + _port_to_eeprom_mapping = {} + port_to_i2cbus_mapping ={} + port_dict = {} + port_presence_info = {} + port_reset_info = {} + port_txdis_info = {} + port_txwrt_info = {} + port_led_info = {} + + port_rxlos_info = {} + port_txfault_info = {} + port_drop_info = {} + + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END + + @property + def sfp_ports(self): + return list(range(self.PORT_START, self.PORTS_IN_BLOCK)) + + @property + def qsfp_ports(self): + return [] + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): + for x in range(self.PORT_START, self.PORTS_IN_BLOCK): + self.port_to_i2cbus_mapping[x] = (x - self.PORT_START + self.EEPROM_OFFSET) + self.port_presence_info["/sys/bus/i2c/devices/3-0030/sfp_presence1"] = [49, 50, 51, 52] + self.port_txdis_info["/sys/bus/i2c/devices/3-0030/tx_disable"] = [49, 50, 51, 52] + self.port_txwrt_info["/sys/bus/i2c/devices/3-0030/tx_write_protect"] = [49, 50, 51, 52] + + # bit 1: los + self.port_rxlos_info["/sys/bus/i2c/devices/3-0030/sfp_rx_loss1"] = [49, 50, 51, 52] + + # bit 1: fault + self.port_txfault_info["/sys/bus/i2c/devices/3-0030/sfp_tx_fault1"] = [49, 50, 51, 52] + + # bit 1: drop + self.port_drop_info["/sys/bus/i2c/devices/3-0030/sfp_drop_record1"] = [49, 50, 51, 52] + + SfpUtilBase.__init__(self) + + def _sfp_read_file_path(self, file_path, offset, num_bytes): + attempts = 0 + while attempts < self.I2C_MAX_ATTEMPT: + try: + file_path.seek(offset) + read_buf = file_path.read(num_bytes) + except Exception: + attempts += 1 + time.sleep(0.05) + else: + return True, read_buf + return False, None + + def _sfp_eeprom_present(self, sysfs_sfp_i2c_client_eeprompath, offset): + """Tries to read the eeprom file to determine if the + device/sfp is present or not. If sfp present, the read returns + valid bytes. If not, read returns error 'Connection timed out""" + + if not os.path.exists(sysfs_sfp_i2c_client_eeprompath): + return False + else: + with open(sysfs_sfp_i2c_client_eeprompath, "rb", buffering=0) as sysfsfile: + rv, buf = self._sfp_read_file_path(sysfsfile, offset, 1) + return rv + + def _add_new_sfp_device(self, sysfs_sfp_i2c_adapter_path, devaddr, devtype): + try: + sysfs_nd_path = "%s/new_device" % sysfs_sfp_i2c_adapter_path + + # Write device address to new_device file + nd_file = open(sysfs_nd_path, "w") + nd_str = "%s %s" % (devtype, hex(devaddr)) + nd_file.write(nd_str) + nd_file.close() + + except Exception as err: + print(("Error writing to new device file: %s" % str(err))) + return 1 + else: + return 0 + + def _get_port_eeprom_path(self, port_num, devid): + if port_num in list(self.port_to_eeprom_mapping.keys()): + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[port_num] + else: + sysfs_i2c_adapter_base_path = "/sys/class/i2c-adapter" + + i2c_adapter_id = self._get_port_i2c_adapter_id(port_num) + if i2c_adapter_id is None: + print("Error getting i2c bus num") + return None + + # Get i2c virtual bus path for the sfp + sysfs_sfp_i2c_adapter_path = "%s/i2c-%s" % (sysfs_i2c_adapter_base_path, + str(i2c_adapter_id)) + + # If i2c bus for port does not exist + if not os.path.exists(sysfs_sfp_i2c_adapter_path): + print(("Could not find i2c bus %s. Driver not loaded?" % sysfs_sfp_i2c_adapter_path)) + return None + + sysfs_sfp_i2c_client_path = "%s/%s-00%s" % (sysfs_sfp_i2c_adapter_path, + str(i2c_adapter_id), + hex(devid)[-2:]) + + # If sfp device is not present on bus, Add it + if not os.path.exists(sysfs_sfp_i2c_client_path): + if port_num in self.qsfp_ports: + ret = self._add_new_sfp_device( + sysfs_sfp_i2c_adapter_path, devid, self.QSFP_DEVICE_TYPE) + else: + ret = self._add_new_sfp_device( + sysfs_sfp_i2c_adapter_path, devid, self.SFP_DEVICE_TYPE) + if ret != 0: + print("Error adding sfp device") + return None + + sysfs_sfp_i2c_client_eeprom_path = "%s/eeprom" % sysfs_sfp_i2c_client_path + return sysfs_sfp_i2c_client_eeprom_path + + def _read_eeprom_specific_bytes(self, sysfsfile_eeprom, offset, num_bytes): + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + rv, raw = self._sfp_read_file_path(sysfsfile_eeprom, offset, num_bytes) + if rv == False: + return None + + try: + if isinstance(raw, str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except Exception as err: + return None + return eeprom_raw + + def get_eeprom_dom_raw(self, port_num): + if port_num in self.qsfp_ports: + # QSFP DOM EEPROM is also at addr 0x50 and thus also stored in eeprom_ifraw + return None + else: + # Read dom eeprom at addr 0x51 + return self._read_eeprom_devid(port_num, self.IDENTITY_EEPROM_ADDR, 256) + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + presence_path = None + for presence_key in self.port_presence_info: + if port_num in self.port_presence_info[presence_key]: + presence_path = presence_key + presence_offset = self.port_presence_info[presence_key].index(port_num) + break + if presence_path == None: + return False + + try: + data = open(presence_path, "rb") + except IOError: + return False + + presence_data = data.read(2) + if presence_data == "": + return False + result = int(presence_data, 16) + data.close() + + # ModPrsL is active low + if result & (1 << presence_offset) == 0: + return True + + return False + + def get_low_power_mode(self, port_num): + return False + + def set_low_power_mode(self, port_num, lpmode): + return False + + def reset(self, port_num): + return False + + def reset_all(self): + return False + + def _do_write_file(self, file_handle, offset, value): + file_handle.seek(offset) + file_handle.write(hex(value)) + + def get_transceiver_change_event(self, timeout=0): + + start_time = time.time() + currernt_port_dict = {} + forever = False + + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + print(("get_transceiver_change_event:Invalid timeout value", timeout)) + return False, {} + + end_time = start_time + timeout + if start_time > end_time: + print(('get_transceiver_change_event:' \ + 'time wrap / invalid timeout value', timeout)) + + return False, {} # Time wrap or possibly incorrect timeout + + while timeout >= 0: + # Check for OIR events and return updated port_dict + for x in range(self.PORT_START, self.PORTS_IN_BLOCK): + if self.get_presence(x): + currernt_port_dict[x] = self.SFP_STATUS_INSERTED + else: + currernt_port_dict[x] = self.SFP_STATUS_REMOVED + if (currernt_port_dict == self.port_dict): + if forever: + time.sleep(1) + else: + timeout = end_time - time.time() + if timeout >= 1: + time.sleep(1) # We poll at 1 second granularity + else: + if timeout > 0: + time.sleep(timeout) + return True, {} + else: + # Update reg value + self.port_dict = currernt_port_dict + return True, self.port_dict + print ("get_transceiver_change_event: Should not reach here.") + return False, {} + + def tx_disable(self, port_num, disable): + if not self.get_presence(port_num): + return False + + if port_num in self.sfp_ports: + txwrt_path = None + txdis_path = None + txdis_offset = 0 + + for key in self.port_txwrt_info: + if port_num in self.port_txwrt_info[key]: + txwrt_path = key + break + if txwrt_path == None: + return False + + for key in self.port_txdis_info: + if port_num in self.port_txdis_info[key]: + txdis_path = key + txdis_offset = self.port_txdis_info[key].index(port_num) + break + if txdis_path == None: + return False + + + try: + with open(txwrt_path, "r+") as sys_file: + sres = hex(self.TXWRT_NO_PROTECT)[2:] + sys_file.write(sres) + + with open(txdis_path, "r+") as sys_file: + txdis_data = sys_file.read(2) + if not txdis_data: + return False + result = int(txdis_data, 16) + if disable: + result = result | (1 << txdis_offset) + else: + result = result & (~(1 << txdis_offset)) + sys_file.seek(0) + sres = hex(result)[2:] + print(result,sres) + sys_file.write(sres) + + with open(txwrt_path, "r+") as sys_file: + sres = hex(self.TXWRT_PROTECT)[2:] + sys_file.write(sres) + except Exception as err: + print(err) + return False + + return True + else: + return False + +########### sysdiag ########### + def _get_cpld_info(self, port_num, info): + path = None + offset = 0 + for key in info: + if port_num in info[key]: + path = key + offset = info[key].index(port_num) + break + return path, offset + + def get_tx_disable(self, port_num): + # cur only support sfp moudle + if port_num not in self.sfp_ports: + return False + + if not self.get_presence(port_num): + return False + + path, offset = self._get_cpld_info(port_num, self.port_txdis_info) + if path == None: + return False + + result = 0 + try: + with open(path, "r") as sys_file: + data = sys_file.read(2) + result = int(data, 16) + except Exception as e: + print((str(e))) + return False + + # 1: disable + if result & (1 << offset): + return True + else: + return False + + def get_rx_los(self, port_num): + # cur only support sfp moudle + if port_num not in self.sfp_ports: + return False + + path, offset = self._get_cpld_info(port_num, self.port_rxlos_info) + if path == None: + return False + + result = 0 + try: + with open(path, "r") as sys_file: + data = sys_file.read(2) + result = int(data, 16) + except Exception as e: + print((str(e))) + return False + + # 1: los + if result & (1 << offset): + return True + else: + return False + + def get_tx_fault(self, port_num): + # cur only support sfp moudle + if port_num not in self.sfp_ports: + return False + + if not self.get_presence(port_num): + return False + + path, offset = self._get_cpld_info(port_num, self.port_txfault_info) + if path == None: + return False + + result = 0 + try: + with open(path, "r") as sys_file: + data = sys_file.read(2) + result = int(data, 16) + except Exception as e: + print((str(e))) + return False + + # 1: fault + if result & (1 << offset): + return True + + return False diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/ssd_util.py b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/ssd_util.py new file mode 100644 index 000000000000..95ca23e8b351 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/ssd_util.py @@ -0,0 +1,112 @@ +# +# ssd_util.py +# +# Generic implementation of the SSD health API +# SSD models supported: +# - InnoDisk +# - StorFly +# - Virtium + +try: + import subprocess + from sonic_platform_base.sonic_ssd.ssd_base import SsdBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +HEALTH_CMD = "cat /sys/kernel/debug/mmc0/mmc0:0001/ext_csd | cut -c 537-538" +SERIAL_CMD = "cat /sys/bus/mmc/devices/mmc0\\:0001/serial" +FIRMWARE_CMD = "cat /sys/kernel/debug/mmc0/mmc0:0001/ext_csd | cut -c 509-522" +NOT_AVAILABLE = "N/A" + +class SsdUtil(SsdBase): + """ + Generic implementation of the SSD health API + """ + def __init__(self, diskdev): + self.model = "KLMCG4JETD-B041" + self.temperature = NOT_AVAILABLE + self.vendor_ssd_info = "====No vendor information====" + self.health_list = [100,90,80,70,60,50,40,30,20,10,0] + try: + life_time = self._execute_shell(HEALTH_CMD) + if int(life_time) in range(1,12): + self.health = self.health_list[int(life_time) - 1] + else: + self.health = NOT_AVAILABLE + except Exception as e: + self.health = NOT_AVAILABLE + + try: + self.firmware = self._execute_shell(FIRMWARE_CMD) + except Exception as e: + self.firmware = NOT_AVAILABLE + + try: + serial = self._execute_shell(SERIAL_CMD) + self.serial = serial.replace("0x",'') + except Exception as e: + self.serial = NOT_AVAILABLE + + def _execute_shell(self, cmd): + status, output = subprocess.getstatusoutput(cmd) + if status: + return None + + return output + + def get_health(self): + """ + Retrieves current disk health in percentages + + Returns: + A float number of current ssd health + e.g. 83.5 + """ + return self.health + + def get_temperature(self): + """ + Retrieves current disk temperature in Celsius + + Returns: + A float number of current temperature in Celsius + e.g. 40.1 + """ + return self.temperature + + def get_model(self): + """ + Retrieves model for the given disk device + + Returns: + A string holding disk model as provided by the manufacturer + """ + return self.model + + def get_firmware(self): + """ + Retrieves firmware version for the given disk device + + Returns: + A string holding disk firmware version as provided by the manufacturer + """ + return self.firmware + + def get_serial(self): + """ + Retrieves serial number for the given disk device + + Returns: + A string holding disk serial number as provided by the manufacturer + """ + return self.serial + + def get_vendor_output(self): + """ + Retrieves vendor specific data for the given disk device + + Returns: + A string holding some vendor specific disk information + """ + return self.vendor_ssd_info + diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/pmon_daemon_control.json b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..5fdf83f1b9e6 --- /dev/null +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/pmon_daemon_control.json @@ -0,0 +1,7 @@ +{ + "skip_ledd": true, + "skip_xcvrd": false, + "skip_syseepromd": false, + "skip_thermalctld": false, + "skip_psud": false +} diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/system_health_monitoring_config.json b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/centec-arm64/platform-modules-micas.dep b/platform/centec-arm64/platform-modules-micas.dep new file mode 100644 index 000000000000..ad741d08d3d6 --- /dev/null +++ b/platform/centec-arm64/platform-modules-micas.dep @@ -0,0 +1,9 @@ +MPATH := $($(MICAS_M2_W6010_48GT4X_PLATFORM_MODULE)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/centec-arm64/platform-modules-micas.mk platform/centec-arm64/platform-modules-micas.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(addprefix $(MPATH)/,$(shell cd $(MPATH) && git ls-files)) + +$(MICAS_M2_W6010_48GT4X_PLATFORM_MODULE)_CACHE_MODE := GIT_CONTENT_SHA +$(MICAS_M2_W6010_48GT4X_PLATFORM_MODULE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(MICAS_M2_W6010_48GT4X_PLATFORM_MODULE)_DEP_FILES := $(DEP_FILES) + diff --git a/platform/centec-arm64/platform-modules-micas.mk b/platform/centec-arm64/platform-modules-micas.mk new file mode 100644 index 000000000000..ad741d08d3d6 --- /dev/null +++ b/platform/centec-arm64/platform-modules-micas.mk @@ -0,0 +1,9 @@ +MPATH := $($(MICAS_M2_W6010_48GT4X_PLATFORM_MODULE)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/centec-arm64/platform-modules-micas.mk platform/centec-arm64/platform-modules-micas.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(addprefix $(MPATH)/,$(shell cd $(MPATH) && git ls-files)) + +$(MICAS_M2_W6010_48GT4X_PLATFORM_MODULE)_CACHE_MODE := GIT_CONTENT_SHA +$(MICAS_M2_W6010_48GT4X_PLATFORM_MODULE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(MICAS_M2_W6010_48GT4X_PLATFORM_MODULE)_DEP_FILES := $(DEP_FILES) + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/LICENSE b/platform/centec-arm64/sonic-platform-modules-micas/LICENSE new file mode 100644 index 000000000000..2d14d2b7785f --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/LICENSE @@ -0,0 +1,15 @@ +Copyright (C) 2019 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. diff --git a/platform/centec-arm64/sonic-platform-modules-micas/README.md b/platform/centec-arm64/sonic-platform-modules-micas/README.md new file mode 100644 index 000000000000..a02f791fa68c --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/README.md @@ -0,0 +1 @@ +Platform drivers for Centec E530 for the SONiC project. diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/Makefile b/platform/centec-arm64/sonic-platform-modules-micas/common/Makefile new file mode 100644 index 000000000000..7d687765dada --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/Makefile @@ -0,0 +1,49 @@ +PWD = $(shell pwd) +CC ?=gcc +INSTALL_MOD_DIR ?=extra +KVERSION ?= $(shell uname -r) +KERNEL_SRC ?= /lib/modules/$(KVERSION) +EXTRA_CFLAGS:= -I$(M)/include +EXTRA_CFLAGS+= -Wall +ifdef ENABLE_GCOV +ifeq ($(ENABLE_GCOV), y) +EXTRA_CFLAGS+= -fprofile-arcs -ftest-coverage -lgcov +endif +endif # ENABLE_GCOV +SUB_BUILD_DIR = $(PWD)/build +DIR_KERNEL_SRC = $(PWD)/modules +SCRIPT_DIR = $(PWD)/script +SERVICE_DIR = $(PWD)/service +BLACK_DRIVER_CONF_DIR = $(PWD)/modprobe_conf + +app_dir = $(PWD)/app +app_build_dir = $(app_dir)/build +modules_build_dir = $(DIR_KERNEL_SRC)/build + +INSTALL_MODULE_DIR = $(SUB_BUILD_DIR)/$(KERNEL_SRC)/$(INSTALL_MOD_DIR) +INSTALL_SCRIPT_DIR = $(SUB_BUILD_DIR)/usr/local/bin +INSTALL_SERVICE_DIR = $(SUB_BUILD_DIR)/lib/systemd/system +INSTALL_LIB_DIR = $(SUB_BUILD_DIR)/usr/lib/python3.9/dist-packages +INSTALL_BLACK_DRIVER = $(SUB_BUILD_DIR)/etc/modprobe.d +CTC_48GT4X_PHY_DIR = $(SUB_BUILD_DIR)/usr/share/sonic/device/arm64-micas_m2-w6010-48gt4x-fa-r0/M2-W6010-48GT4X-FA +CTC_48GT4X_R_PHY_DIR = $(SUB_BUILD_DIR)/usr/share/sonic/device/arm64-micas_m2-w6010-48gt4x-ra-r0/M2-W6010-48GT4X-RA + +all: + $(MAKE) -C $(app_dir) + $(MAKE) -C $(DIR_KERNEL_SRC) + @if [ ! -d ${INSTALL_MODULE_DIR} ]; then mkdir -p ${INSTALL_MODULE_DIR} ;fi + @if [ ! -d ${INSTALL_SCRIPT_DIR} ]; then mkdir -p ${INSTALL_SCRIPT_DIR} ;fi + @if [ ! -d ${INSTALL_SERVICE_DIR} ]; then mkdir -p ${INSTALL_SERVICE_DIR} ;fi + @if [ ! -d ${CTC_48GT4X_PHY_DIR} ]; then mkdir -p ${CTC_48GT4X_PHY_DIR}/phy_drv ;fi + @if [ ! -d ${CTC_48GT4X_R_PHY_DIR} ]; then mkdir -p ${CTC_48GT4X_R_PHY_DIR}/phy_drv ;fi + @if [ ! -d ${INSTALL_LIB_DIR} ]; then mkdir -p ${INSTALL_LIB_DIR} ;fi + @if [ -d $(PWD)/lib/ ]; then cp -r $(PWD)/lib/* ${INSTALL_LIB_DIR} ;fi + cp -r $(app_dir)/*.so $(CTC_48GT4X_PHY_DIR)/phy_drv + cp -r $(app_dir)/*.so $(CTC_48GT4X_R_PHY_DIR)/phy_drv + cp -r $(modules_build_dir)/*.ko $(INSTALL_MODULE_DIR) + cp -r $(app_dir)/build/app/* $(INSTALL_SCRIPT_DIR) + if [ -d $(SCRIPT_DIR) ]; then cp -r $(SCRIPT_DIR)/* $(INSTALL_SCRIPT_DIR) ;fi + if [ -d $(SERVICE_DIR) ]; then cp -r $(SERVICE_DIR)/* $(INSTALL_SERVICE_DIR) ;fi + @if [ -d $(INSTALL_SCRIPT_DIR) ]; then chmod +x $(INSTALL_SCRIPT_DIR)/* ;fi +clean: + rm -rf $(SUB_BUILD_DIR) diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/app/Makefile b/platform/centec-arm64/sonic-platform-modules-micas/common/app/Makefile new file mode 100644 index 000000000000..2d86cdf4c429 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/app/Makefile @@ -0,0 +1,26 @@ +pes_parent_dir:=$(shell pwd)/$(lastword $(MAKEFILE_LIST)) +pes_parent_dir:=$(shell dirname $(pes_parent_dir)) + +SUBDIRS=$(shell ls -l | grep ^d | awk '{if($$9 != "build") print $$9}') +INC = -I./inc + +COMMON_OUT_PUT := $(shell pwd)/build +common_out_put_dir := $(COMMON_OUT_PUT)/app +common_module_dir := $(COMMON_OUT_PUT)/module/ +export common_out_put_dir common_module_dir + +all : CHECK $(SUBDIRS) +CHECK : + @echo $(pes_parent_dir) + +$(SUBDIRS):ECHO +# make all + #@echo $@ + make -C $@ + +ECHO: + @echo $(SUBDIRS) + +.PHONY : clean +clean : + -rm -rf $(COMMON_OUT_PUT) diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/__init__.py b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/fantlv.py b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/fantlv.py new file mode 100644 index 000000000000..fa480bb50abb --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/fantlv.py @@ -0,0 +1,210 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +class FantlvException(Exception): + def __init__(self, message='fantlverror', code=-100): + err = 'errcode: {0} message:{1}'.format(code, message) + Exception.__init__(self, err) + self.code = code + self.message = message + +class fan_tlv(object): + HEAD_INFO = "\x01\x7e\x01\xf1" + VERSION = 0x01 # E2PROM file init version is 0x01 + FLAG = 0x7E # new version E2PROM mark as 0x7E + HW_VER = 0X01 # consists of master version and revised version + TYPE = 0xf1 # hardware type define + TLV_LEN = 00 # vaild data length(16bit) + _FAN_TLV_HDR_LEN = 6 + _FAN_TLV_CRC_LEN = 2 + + _FAN_TLV_TYPE_NAME = 0x02 + _FAN_TLV_TYPE_SN = 0x03 + _FAN_TLV_TYPE_HW_INFO = 0x05 + _FAN_TLV_TYPE_DEV_TYPE = 0x06 + + _fandecodetime = 0 + + @property + def dstatus(self): + return self._dstatus + + @property + def typename(self): + return self._typename + + @property + def typesn(self): + return self._typesn + + @property + def typehwinfo(self): + return self._typehwinfo + + @property + def typedevtype(self): + return self._typedevtype + + @property + def fanbus(self): + return self._fanbus + + @property + def fanloc(self): + return self._fanloc + + @property + def fandecodetime(self): + return self._fandecodetime + + def __init__(self): + self._typename = "" + self._typesn = "" + self._typehwinfo = "" + self._typedevtype = "" + self._dstatus = 0 + + def strtoarr(self, str): + s = [] + if str is not None: + for index in range(len(str)): + s.append(str[index]) + return s + + def str_to_hex(self,rest_v): + value = 0 + for index in range(len(rest_v)): + value |= ord(rest_v[index]) << ((len(rest_v) - index - 1) * 8) + return value + + def hex_to_str(self,s): + len_t = len(s) + if len_t % 2 != 0: + return 0 + ret = "" + for t in range(0, int(len_t / 2)): + ret += chr(int(s[2 * t:2 * t + 2], 16)) + return ret + + def generate_fan_value(self): + bin_buffer = [chr(0xff)] * 256 + bin_buffer[0] = chr(self.VERSION) + bin_buffer[1] = chr(self.FLAG) + bin_buffer[2] = chr(self.HW_VER) + bin_buffer[3] = chr(self.TYPE) + + temp_t = "%08x" % self.typedevtype # handle devtype first + typedevtype_t = self.hex_to_str(temp_t) + total_len = len(self.typename) + len(self.typesn) + \ + len(self.typehwinfo) + len(typedevtype_t) + 8 + + bin_buffer[4] = chr(total_len >> 8) + bin_buffer[5] = chr(total_len & 0x00FF) + + index_start = 6 + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_NAME) + bin_buffer[index_start + 1] = chr(len(self.typename)) + bin_buffer[index_start + 2: index_start + 2 + + len(self.typename)] = self.strtoarr(self.typename) + index_start = index_start + 2 + len(self.typename) + + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_SN) + bin_buffer[index_start + 1] = chr(len(self.typesn)) + bin_buffer[index_start + 2:index_start + 2 + + len(self.typesn)] = self.strtoarr(self.typesn) + index_start = index_start + 2 + len(self.typesn) + + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_HW_INFO) + bin_buffer[index_start + 1] = chr(len(self.typehwinfo)) + bin_buffer[index_start + 2:index_start + 2 + + len(self.typehwinfo)] = self.strtoarr(self.typehwinfo) + index_start = index_start + 2 + len(self.typehwinfo) + + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_DEV_TYPE) + bin_buffer[index_start + 1] = chr(len(typedevtype_t)) + bin_buffer[index_start + 2:index_start + 2 + + len(typedevtype_t)] = self.strtoarr(typedevtype_t) + index_start = index_start + 2 + len(typedevtype_t) + + crcs = fan_tlv.fancrc(''.join(bin_buffer[0:index_start])) # 2bytes checking + bin_buffer[index_start] = chr(crcs >> 8) + bin_buffer[index_start + 1] = chr(crcs & 0x00ff) + # printvalue(bin_buffer) + return bin_buffer + + def decode(self, e2): + if e2[0:4] != self.HEAD_INFO: + raise FantlvException("Fan tlv head info error,not fan tlv type", -10) + ret = [] + self.VERSION = ord(e2[0]) + self.FLAG = ord(e2[1]) + self.HW_VER = ord(e2[2]) + self.TYPE = ord(e2[3]) + self.TLV_LEN = (ord(e2[4]) << 8) | ord(e2[5]) + + tlv_index = self._FAN_TLV_HDR_LEN + tlv_end = self._FAN_TLV_HDR_LEN + self.TLV_LEN + + # check sum + if len(e2) < self._FAN_TLV_HDR_LEN + self.TLV_LEN + 2: + raise FantlvException("Fan tlv eeprom len error!", -2) + sumcrc = fan_tlv.fancrc(e2[0:self._FAN_TLV_HDR_LEN + self.TLV_LEN]) + readcrc = ord(e2[self._FAN_TLV_HDR_LEN + self.TLV_LEN] + ) << 8 | ord(e2[self._FAN_TLV_HDR_LEN + self.TLV_LEN + 1]) + if sumcrc != readcrc: + raise FantlvException("Fan tlv eeprom checksum error!", -1) + else: + self._dstatus = 0 + while (tlv_index + 2) < len(e2) and tlv_index < tlv_end: + s = self.decoder( + e2[tlv_index:tlv_index + 2 + ord(e2[tlv_index + 1])]) + tlv_index += ord(e2[tlv_index + 1]) + 2 + ret.append(s) + + return ret + + @staticmethod + def fancrc(t): + sum = 0 + for index in range(len(t)): + sum += ord(t[index]) + return sum + + def decoder(self, t): + try: + name = "" + value = "" + _len = ord(t[1]) + if ord(t[0]) == self._FAN_TLV_TYPE_NAME: + name = "Product Name" + value = t[2:2 + ord(t[1])] + self._typename = value + elif ord(t[0]) == self._FAN_TLV_TYPE_SN: + name = "serial Number" + value = t[2:2 + ord(t[1])] + self._typesn = value + elif ord(t[0]) == self._FAN_TLV_TYPE_HW_INFO: + name = "hardware info" + value = t[2:2 + ord(t[1])] + self._typehwinfo = value + elif ord(t[0]) == self._FAN_TLV_TYPE_DEV_TYPE: + name = "dev type" + value = "0x" + for c in t[2:2 + ord(t[1])]: + value += "%02X" % (ord(c),) + self._typedevtype = int(value,16) + return {"name": name, "code": ord(t[0]), "value": value,"lens": _len} + except Exception as e: + print(e) + return None + + def __str__(self): + formatstr = "VERSION : 0x%02x \n" \ + " FLAG : 0x%02x \n" \ + " HW_VER : 0x%02x \n" \ + " TYPE : 0x%02x \n" \ + "typename : %s \n" \ + "typesn : %s \n" \ + "typehwinfo : %s \n" + return formatstr % (self.VERSION, self.FLAG, self.HW_VER, self.TYPE, self.typename, self.typesn, self.typehwinfo) + + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/fru.py b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/fru.py new file mode 100644 index 000000000000..4848530a8eaa --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/eepromutil/fru.py @@ -0,0 +1,957 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +import collections +from bitarray import bitarray +from datetime import datetime, timedelta +import sys + +__all__ = ["FruException", "FruUtil", "BaseArea", "BoardInfoArea", "ProductInfoArea", + "MultiRecordArea", "Field", "ipmifru"] + +__DEBUG__ = "N" + + +class FruException(Exception): + def __init__(self, message='fruerror', code=-100): + err = 'errcode: {0} message:{1}'.format(code, message) + Exception.__init__(self, err) + self.code = code + self.message = message + + +def e_print(err): + print("ERROR: " + err) + + +def d_print(debug_info): + if(__DEBUG__ == "Y"): + print(debug_info) + + +class FruUtil(): + @staticmethod + def decodeLength(value): + a = bitarray(8) + a.setall(True) + a[0:1] = 0 + a[1:2] = 0 + x = ord(a.tobytes()) + return x & ord(value) + + @staticmethod + def minToData(): + starttime = datetime(1996, 1, 1, 0, 0, 0) + endtime = datetime.now() + seconds = (endtime - starttime).total_seconds() + mins = seconds / 60 + m = int(round(mins)) + return m + + @staticmethod + def getTimeFormat(): + return datetime.now().strftime('%Y-%m-%d') + + @staticmethod + def getTypeLength(value): + if value is None: + return 0 + a = bitarray(8) + a.setall(False) + a[0:1] = 1 + a[1:2] = 1 + x = ord(a.tobytes()) + return x | len(value) + + @staticmethod + def checksum(b): + result = 0 + for i in range(len(b)): + result += ord(b[i]) + return (0x100 - (result & 0xff)) & 0xff + + +class BaseArea(object): + SUGGESTED_SIZE_COMMON_HEADER = 8 + SUGGESTED_SIZE_INTERNAL_USE_AREA = 72 + SUGGESTED_SIZE_CHASSIS_INFO_AREA = 32 + SUGGESTED_SIZE_BOARD_INFO_AREA = 80 + SUGGESTED_SIZE_PRODUCT_INFO_AREA = 80 + + INITVALUE = b'\x00' + resultvalue = INITVALUE * 256 + COMMON_HEAD_VERSION = b'\x01' + __childList = None + + def __init__(self, name="", size=0, offset=0): + self.__childList = [] + self._offset = offset + self.name = name + self._size = size + self._isPresent = False + self._data = b'\x00' * size + self.__dataoffset = 0 + + @property + def childList(self): + return self.__childList + + @childList.setter + def childList(self, value): + self.__childList = value + + @property + def offset(self): + return self._offset + + @offset.setter + def offset(self, value): + self._offset = value + + @property + def size(self): + return self._size + + @size.setter + def size(self, value): + self._size = value + + @property + def data(self): + return self._data + + @data.setter + def data(self, value): + self._data = value + + @property + def isPresent(self): + return self._isPresent + + @isPresent.setter + def isPresent(self, value): + self._isPresent = value + + +class InternalUseArea(BaseArea): + pass + + +class ChassisInfoArea(BaseArea): + pass + + +class BoardInfoArea(BaseArea): + _boardTime = None + _fields = None + _mfg_date = None + + def __str__(self): + formatstr = "version : %x\n" \ + "length : %d \n" \ + "language : %x \n" \ + "mfg_date : %s \n" \ + "boardManufacturer : %s \n" \ + "boardProductName : %s \n" \ + "boardSerialNumber : %s \n" \ + "boardPartNumber : %s \n" \ + "fruFileId : %s \n" + + tmpstr = formatstr % (ord(self.boardversion), self.size, + self.language, self.getMfgRealData(), + self.boardManufacturer, self.boardProductName, + self.boardSerialNumber, self.boardPartNumber, + self.fruFileId) + for i in range(1, 11): + valtmp = "boardextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + tmpstr += "boardextra%d : %s \n" % (i, valtmpval) + else: + break + + return tmpstr + + def todict(self): + dic = collections.OrderedDict() + dic["boardversion"] = ord(self.boardversion) + dic["boardlength"] = self.size + dic["boardlanguage"] = self.language + dic["boardmfg_date"] = self.getMfgRealData() + dic["boardManufacturer"] = self.boardManufacturer + dic["boardProductName"] = self.boardProductName + dic["boardSerialNumber"] = self.boardSerialNumber + dic["boardPartNumber"] = self.boardPartNumber + dic["boardfruFileId"] = self.fruFileId + for i in range(1, 11): + valtmp = "boardextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + dic[valtmp] = valtmpval + else: + break + return dic + + def decodedata(self): + index = 0 + self.areaversion = self.data[index] + index += 1 + d_print("decode length :%d class size:%d" % + ((ord(self.data[index]) * 8), self.size)) + index += 2 + + timetmp = self.data[index: index + 3] + self.mfg_date = ord(timetmp[0]) | ( + ord(timetmp[1]) << 8) | (ord(timetmp[2]) << 16) + d_print("decode getMfgRealData :%s" % self.getMfgRealData()) + index += 3 + + templen = FruUtil.decodeLength(self.data[index]) + self.boardManufacturer = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardManufacturer:%s" % self.boardManufacturer) + + templen = FruUtil.decodeLength(self.data[index]) + self.boardProductName = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardProductName:%s" % self.boardProductName) + + templen = FruUtil.decodeLength(self.data[index]) + self.boardSerialNumber = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardSerialNumber:%s" % self.boardSerialNumber) + + templen = FruUtil.decodeLength(self.data[index]) + self.boardPartNumber = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardPartNumber:%s" % self.boardPartNumber) + + templen = FruUtil.decodeLength(self.data[index]) + self.fruFileId = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode fruFileId:%s" % self.fruFileId) + + + for i in range(1, 11): + valtmp = "boardextra%d" % i + if self.data[index] != chr(0xc1): + templen = FruUtil.decodeLength(self.data[index]) + tmpval = self.data[index + 1: index + templen + 1] + setattr(self, valtmp, tmpval) + index += templen + 1 + d_print("decode boardextra%d:%s" % (i, tmpval)) + else: + break + + def recalcute(self): + d_print("boardInfoArea version:%x" % ord(self.boardversion)) + d_print("boardInfoArea length:%d" % self.size) + d_print("boardInfoArea language:%x" % self.language) + self.mfg_date = FruUtil.minToData() + d_print("boardInfoArea mfg_date:%x" % self.mfg_date) + + self.data = chr(ord(self.boardversion)) + \ + chr(self.size / 8) + chr(self.language) + + self.data += chr(self.mfg_date & 0xFF) + self.data += chr((self.mfg_date >> 8) & 0xFF) + self.data += chr((self.mfg_date >> 16) & 0xFF) + + d_print("boardInfoArea boardManufacturer:%s" % self.boardManufacturer) + typelength = FruUtil.getTypeLength(self.boardManufacturer) + self.data += chr(typelength) + self.data += self.boardManufacturer + + d_print("boardInfoArea boardProductName:%s" % self.boardProductName) + self.data += chr(FruUtil.getTypeLength(self.boardProductName)) + self.data += self.boardProductName + + d_print("boardInfoArea boardSerialNumber:%s" % self.boardSerialNumber) + self.data += chr(FruUtil.getTypeLength(self.boardSerialNumber)) + self.data += self.boardSerialNumber + + d_print("boardInfoArea boardPartNumber:%s" % self.boardPartNumber) + self.data += chr(FruUtil.getTypeLength(self.boardPartNumber)) + self.data += self.boardPartNumber + + d_print("boardInfoArea fruFileId:%s" % self.fruFileId) + self.data += chr(FruUtil.getTypeLength(self.fruFileId)) + self.data += self.fruFileId + + for i in range(1, 11): + valtmp = "boardextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + d_print("boardInfoArea boardextra%d:%s" % (i, valtmpval)) + self.data += chr(FruUtil.getTypeLength(valtmpval)) + if valtmpval is None: + pass + else: + self.data += valtmpval + else: + break + + self.data += chr(0xc1) + + if len(self.data) > (self.size - 1): + incr = (len(self.data) - self.size) / 8 + 1 + self.size += incr * 8 + + self.data = self.data[0:1] + chr(self.size / 8) + self.data[2:] + d_print("self data:%d" % len(self.data)) + d_print("self size:%d" % self.size) + d_print("adjust size:%d" % (self.size - len(self.data) - 1)) + self.data = self.data.ljust((self.size - 1), self.INITVALUE) + + # checksum + checksum = FruUtil.checksum(self.data) + d_print("board info checksum:%x" % checksum) + self.data += chr(checksum) + + def getMfgRealData(self): + starttime = datetime(1996, 1, 1, 0, 0, 0) + mactime = starttime + timedelta(minutes=self.mfg_date) + return mactime + + @property + def language(self): + self._language = 25 + return self._language + + @property + def mfg_date(self): + return self._mfg_date + + @mfg_date.setter + def mfg_date(self, val): + self._mfg_date = val + + @property + def boardversion(self): + self._boardversion = self.COMMON_HEAD_VERSION + return self._boardversion + + @property + def fruFileId(self): + return self._FRUFileID + + @fruFileId.setter + def fruFileId(self, val): + self._FRUFileID = val + + @property + def boardPartNumber(self): + return self._boardPartNumber + + @boardPartNumber.setter + def boardPartNumber(self, val): + self._boardPartNumber = val + + @property + def boardSerialNumber(self): + return self._boardSerialNumber + + @boardSerialNumber.setter + def boardSerialNumber(self, val): + self._boardSerialNumber = val + + @property + def boardProductName(self): + return self._boradProductName + + @boardProductName.setter + def boardProductName(self, val): + self._boradProductName = val + + @property + def boardManufacturer(self): + return self._boardManufacturer + + @boardManufacturer.setter + def boardManufacturer(self, val): + self._boardManufacturer = val + + @property + def boardTime(self): + return self._boardTime + + @boardTime.setter + def boardTime(self, val): + self._boardTime = val + + @property + def fields(self): + return self._fields + + @fields.setter + def fields(self, val): + self._fields = val + + +class ProductInfoArea(BaseArea): + _productManufacturer = None + _productAssetTag = None + _FRUFileID = None + + def __str__(self): + formatstr = "version : %x\n" \ + "length : %d \n" \ + "language : %x \n" \ + "productManufacturer : %s \n" \ + "productName : %s \n" \ + "productPartModelName: %s \n" \ + "productVersion : %s \n" \ + "productSerialNumber : %s \n" \ + "productAssetTag : %s \n" \ + "fruFileId : %s \n" + + tmpstr = formatstr % (ord(self.areaversion), self.size, + self.language, self.productManufacturer, + self.productName, self.productPartModelName, + self.productVersion, self.productSerialNumber, + self.productAssetTag, self.fruFileId) + + for i in range(1, 11): + valtmp = "productextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + tmpstr += "productextra%d : %s \n" % (i, valtmpval) + else: + break + + return tmpstr + + def todict(self): + dic = collections.OrderedDict() + dic["productversion"] = ord(self.areaversion) + dic["productlength"] = self.size + dic["productlanguage"] = self.language + dic["productManufacturer"] = self.productManufacturer + dic["productName"] = self.productName + dic["productPartModelName"] = self.productPartModelName + dic["productVersion"] = int(self.productVersion, 16) + dic["productSerialNumber"] = self.productSerialNumber + dic["productAssetTag"] = self.productAssetTag + dic["productfruFileId"] = self.fruFileId + for i in range(1, 11): + valtmp = "productextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + dic[valtmp] = valtmpval + else: + break + return dic + + def decodedata(self): + index = 0 + self.areaversion = self.data[index] # 0 + index += 1 + d_print("decode length %d" % (ord(self.data[index]) * 8)) + d_print("class size %d" % self.size) + index += 2 + + templen = FruUtil.decodeLength(self.data[index]) + self.productManufacturer = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productManufacturer:%s" % self.productManufacturer) + + templen = FruUtil.decodeLength(self.data[index]) + self.productName = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productName:%s" % self.productName) + + templen = FruUtil.decodeLength(self.data[index]) + self.productPartModelName = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productPartModelName:%s" % self.productPartModelName) + + templen = FruUtil.decodeLength(self.data[index]) + self.productVersion = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productVersion:%s" % self.productVersion) + + templen = FruUtil.decodeLength(self.data[index]) + self.productSerialNumber = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productSerialNumber:%s" % self.productSerialNumber) + + templen = FruUtil.decodeLength(self.data[index]) + self.productAssetTag = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productAssetTag:%s" % self.productAssetTag) + + templen = FruUtil.decodeLength(self.data[index]) + self.fruFileId = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode fruFileId:%s" % self.fruFileId) + + for i in range(1, 11): + valtmp = "productextra%d" % i + if self.data[index] != chr(0xc1) and index < self.size - 1: + templen = FruUtil.decodeLength(self.data[index]) + if templen == 0: + break + tmpval = self.data[index + 1: index + templen + 1] + d_print("decode boardextra%d:%s" % (i, tmpval)) + setattr(self, valtmp, tmpval) + index += templen + 1 + else: + break + + @property + def productVersion(self): + return self._productVersion + + @productVersion.setter + def productVersion(self, name): + self._productVersion = name + + @property + def areaversion(self): + self._areaversion = self.COMMON_HEAD_VERSION + return self._areaversion + + @areaversion.setter + def areaversion(self, name): + self._areaversion = name + + @property + def language(self): + self._language = 25 + return self._language + + @property + def productManufacturer(self): + return self._productManufacturer + + @productManufacturer.setter + def productManufacturer(self, name): + self._productManufacturer = name + + @property + def productName(self): + return self._productName + + @productName.setter + def productName(self, name): + self._productName = name + + @property + def productPartModelName(self): + return self._productPartModelName + + @productPartModelName.setter + def productPartModelName(self, name): + self._productPartModelName = name + + @property + def productSerialNumber(self): + return self._productSerialNumber + + @productSerialNumber.setter + def productSerialNumber(self, name): + self._productSerialNumber = name + + @property + def productAssetTag(self): + return self._productAssetTag + + @productAssetTag.setter + def productAssetTag(self, name): + self._productAssetTag = name + + @property + def fruFileId(self): + return self._FRUFileID + + @fruFileId.setter + def fruFileId(self, name): + self._FRUFileID = name + + def recalcute(self): + d_print("product version:%x" % ord(self.areaversion)) + d_print("product length:%d" % self.size) + d_print("product language:%x" % self.language) + self.data = chr(ord(self.areaversion)) + \ + chr(self.size / 8) + chr(self.language) + + typelength = FruUtil.getTypeLength(self.productManufacturer) + self.data += chr(typelength) + self.data += self.productManufacturer + + self.data += chr(FruUtil.getTypeLength(self.productName)) + self.data += self.productName + + self.data += chr(FruUtil.getTypeLength(self.productPartModelName)) + self.data += self.productPartModelName + + self.data += chr(FruUtil.getTypeLength(self.productVersion)) + self.data += self.productVersion + + self.data += chr(FruUtil.getTypeLength(self.productSerialNumber)) + self.data += self.productSerialNumber + + self.data += chr(FruUtil.getTypeLength(self.productAssetTag)) + if self.productAssetTag is not None: + self.data += self.productAssetTag + + self.data += chr(FruUtil.getTypeLength(self.fruFileId)) + self.data += self.fruFileId + + # whether the extended field exists or not + for i in range(1, 11): + valtmp = "productextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + d_print("boardInfoArea productextra%d:%s" % (i, valtmpval)) + self.data += chr(FruUtil.getTypeLength(valtmpval)) + if valtmpval is None: + pass + else: + self.data += valtmpval + else: + break + + self.data += chr(0xc1) + if len(self.data) > (self.size - 1): + incr = (len(self.data) - self.size) / 8 + 1 + self.size += incr * 8 + d_print("self.data:%d" % len(self.data)) + d_print("self.size:%d" % self.size) + + self.data = self.data[0:1] + chr(self.size / 8) + self.data[2:] + self.data = self.data.ljust((self.size - 1), self.INITVALUE) + checksum = FruUtil.checksum(self.data) + d_print("board info checksum:%x" % checksum) + self.data += chr(checksum) + + +class MultiRecordArea(BaseArea): + pass + + +class Field(object): + + def __init__(self, fieldType="ASCII", fieldData=""): + self.fieldData = fieldData + self.fieldType = fieldType + + @property + def data(self): + return self._data + + @property + def fieldType(self): + return self._fieldType + + @property + def fieldData(self): + return self._fieldData + + +class ipmifru(BaseArea): + _BoardInfoArea = None + _ProductInfoArea = None + _InternalUseArea = None + _ChassisInfoArea = None + _multiRecordArea = None + _productinfoAreaOffset = BaseArea.INITVALUE + _boardInfoAreaOffset = BaseArea.INITVALUE + _internalUserAreaOffset = BaseArea.INITVALUE + _chassicInfoAreaOffset = BaseArea.INITVALUE + _multiRecordAreaOffset = BaseArea.INITVALUE + _bindata = None + _bodybin = None + _version = BaseArea.COMMON_HEAD_VERSION + _zeroCheckSum = None + _frusize = 256 + + def __str__(self): + tmpstr = "" + if self.boardInfoArea.isPresent: + tmpstr += "\nboardinfoarea: \n" + tmpstr += self.boardInfoArea.__str__() + if self.productInfoArea.isPresent: + tmpstr += "\nproductinfoarea: \n" + tmpstr += self.productInfoArea.__str__() + return tmpstr + + def decodeBin(self, eeprom): + commonHead = eeprom[0:8] + d_print("decode version %x" % ord(commonHead[0])) + if self.COMMON_HEAD_VERSION != commonHead[0]: + raise FruException("HEAD VERSION error,not Fru format!", -10) + if FruUtil.checksum(commonHead[0:7]) != ord(commonHead[7]): + strtemp = "check header checksum error [cal:%02x data:%02x]" % ( + FruUtil.checksum(commonHead[0:7]), ord(commonHead[7])) + raise FruException(strtemp, -3) + if commonHead[1] != self.INITVALUE: + d_print("Internal Use Area is present") + self.internalUseArea = InternalUseArea( + name="Internal Use Area", size=self.SUGGESTED_SIZE_INTERNAL_USE_AREA) + self.internalUseArea.isPresent = True + self.internalUserAreaOffset = ord(commonHead[1]) + self.internalUseArea.data = eeprom[self.internalUserAreaOffset * 8: ( + self.internalUserAreaOffset * 8 + self.internalUseArea.size)] + if commonHead[2] != self.INITVALUE: + d_print("Chassis Info Area is present") + self.chassisInfoArea = ChassisInfoArea( + name="Chassis Info Area", size=self.SUGGESTED_SIZE_CHASSIS_INFO_AREA) + self.chassisInfoArea.isPresent = True + self.chassicInfoAreaOffset = ord(commonHead[2]) + self.chassisInfoArea.data = eeprom[self.chassicInfoAreaOffset * 8: ( + self.chassicInfoAreaOffset * 8 + self.chassisInfoArea.size)] + if commonHead[3] != self.INITVALUE: + self.boardInfoArea = BoardInfoArea( + name="Board Info Area", size=self.SUGGESTED_SIZE_BOARD_INFO_AREA) + self.boardInfoArea.isPresent = True + self.boardInfoAreaOffset = ord(commonHead[3]) + self.boardInfoArea.size = ord( + eeprom[self.boardInfoAreaOffset * 8 + 1]) * 8 + d_print("Board Info Area is present size:%d" % + (self.boardInfoArea.size)) + self.boardInfoArea.data = eeprom[self.boardInfoAreaOffset * 8: ( + self.boardInfoAreaOffset * 8 + self.boardInfoArea.size)] + if FruUtil.checksum(self.boardInfoArea.data[:-1]) != ord(self.boardInfoArea.data[-1:]): + strtmp = "check boardInfoArea checksum error[cal:%02x data:%02x]" % \ + (FruUtil.checksum( + self.boardInfoArea.data[:-1]), ord(self.boardInfoArea.data[-1:])) + raise FruException(strtmp, -3) + self.boardInfoArea.decodedata() + if commonHead[4] != self.INITVALUE: + d_print("Product Info Area is present") + self.productInfoArea = ProductInfoArea( + name="Product Info Area ", size=self.SUGGESTED_SIZE_PRODUCT_INFO_AREA) + self.productInfoArea.isPresent = True + self.productinfoAreaOffset = ord(commonHead[4]) + d_print("length offset value: %02x" % + ord(eeprom[self.productinfoAreaOffset * 8 + 1])) + self.productInfoArea.size = ord( + eeprom[self.productinfoAreaOffset * 8 + 1]) * 8 + d_print("Product Info Area is present size:%d" % + (self.productInfoArea.size)) + + self.productInfoArea.data = eeprom[self.productinfoAreaOffset * 8: ( + self.productinfoAreaOffset * 8 + self.productInfoArea.size)] + if FruUtil.checksum(self.productInfoArea.data[:-1]) != ord(self.productInfoArea.data[-1:]): + strtmp = "check productInfoArea checksum error [cal:%02x data:%02x]" % ( + FruUtil.checksum(self.productInfoArea.data[:-1]), ord(self.productInfoArea.data[-1:])) + raise FruException(strtmp, -3) + self.productInfoArea.decodedata() + if commonHead[5] != self.INITVALUE: + self.multiRecordArea = MultiRecordArea( + name="MultiRecord record Area ") + d_print("MultiRecord record present") + self.multiRecordArea.isPresent = True + self.multiRecordAreaOffset = ord(commonHead[5]) + self.multiRecordArea.data = eeprom[self.multiRecordAreaOffset * 8: ( + self.multiRecordAreaOffset * 8 + self.multiRecordArea.size)] + + def initDefault(self): + self.version = self.COMMON_HEAD_VERSION + self.internalUserAreaOffset = self.INITVALUE + self.chassicInfoAreaOffset = self.INITVALUE + self.boardInfoAreaOffset = self.INITVALUE + self.productinfoAreaOffset = self.INITVALUE + self.multiRecordAreaOffset = self.INITVALUE + self.PAD = self.INITVALUE + self.zeroCheckSum = self.INITVALUE + self.offset = self.SUGGESTED_SIZE_COMMON_HEADER + self.productInfoArea = None + self.internalUseArea = None + self.boardInfoArea = None + self.chassisInfoArea = None + self.multiRecordArea = None + # self.recalcute() + + @property + def version(self): + return self._version + + @version.setter + def version(self, name): + self._version = name + + @property + def internalUserAreaOffset(self): + return self._internalUserAreaOffset + + @internalUserAreaOffset.setter + def internalUserAreaOffset(self, obj): + self._internalUserAreaOffset = obj + + @property + def chassicInfoAreaOffset(self): + return self._chassicInfoAreaOffset + + @chassicInfoAreaOffset.setter + def chassicInfoAreaOffset(self, obj): + self._chassicInfoAreaOffset = obj + + @property + def productinfoAreaOffset(self): + return self._productinfoAreaOffset + + @productinfoAreaOffset.setter + def productinfoAreaOffset(self, obj): + self._productinfoAreaOffset = obj + + @property + def boardInfoAreaOffset(self): + return self._boardInfoAreaOffset + + @boardInfoAreaOffset.setter + def boardInfoAreaOffset(self, obj): + self._boardInfoAreaOffset = obj + + @property + def multiRecordAreaOffset(self): + return self._multiRecordAreaOffset + + @multiRecordAreaOffset.setter + def multiRecordAreaOffset(self, obj): + self._multiRecordAreaOffset = obj + + @property + def zeroCheckSum(self): + return self._zeroCheckSum + + @zeroCheckSum.setter + def zeroCheckSum(self, obj): + self._zeroCheckSum = obj + + @property + def productInfoArea(self): + return self._ProductInfoArea + + @productInfoArea.setter + def productInfoArea(self, obj): + self._ProductInfoArea = obj + + @property + def internalUseArea(self): + return self._InternalUseArea + + @internalUseArea.setter + def internalUseArea(self, obj): + self.internalUseArea = obj + + @property + def boardInfoArea(self): + return self._BoardInfoArea + + @boardInfoArea.setter + def boardInfoArea(self, obj): + self._BoardInfoArea = obj + + @property + def chassisInfoArea(self): + return self._ChassisInfoArea + + @chassisInfoArea.setter + def chassisInfoArea(self, obj): + self._ChassisInfoArea = obj + + @property + def multiRecordArea(self): + return self._multiRecordArea + + @multiRecordArea.setter + def multiRecordArea(self, obj): + self._multiRecordArea = obj + + @property + def bindata(self): + return self._bindata + + @bindata.setter + def bindata(self, obj): + self._bindata = obj + + @property + def bodybin(self): + return self._bodybin + + @bodybin.setter + def bodybin(self, obj): + self._bodybin = obj + + def recalcuteCommonHead(self): + self.bindata = "" + self.offset = self.SUGGESTED_SIZE_COMMON_HEADER + d_print("common Header %d" % self.offset) + d_print("fru eeprom size %d" % self._frusize) + if self.internalUseArea is not None and self.internalUseArea.isPresent: + self.internalUserAreaOffset = self.offset / 8 + self.offset += self.internalUseArea.size + d_print("internalUseArea is present offset:%d" % self.offset) + + if self.chassisInfoArea is not None and self.chassisInfoArea.isPresent: + self.chassicInfoAreaOffset = self.offset / 8 + self.offset += self.chassisInfoArea.size + d_print("chassisInfoArea is present offset:%d" % self.offset) + + if self.boardInfoArea is not None and self.boardInfoArea.isPresent: + self.boardInfoAreaOffset = self.offset / 8 + self.offset += self.boardInfoArea.size + d_print("boardInfoArea is present offset:%d" % self.offset) + d_print("boardInfoArea is present size:%d" % + self.boardInfoArea.size) + + if self.productInfoArea is not None and self.productInfoArea.isPresent: + self.productinfoAreaOffset = self.offset / 8 + self.offset += self.productInfoArea.size + d_print("productInfoArea is present offset:%d" % self.offset) + + if self.multiRecordArea is not None and self.multiRecordArea.isPresent: + self.multiRecordAreaOffset = self.offset / 8 + d_print("multiRecordArea is present offset:%d" % self.offset) + + if self.internalUserAreaOffset == self.INITVALUE: + self.internalUserAreaOffset = 0 + if self.productinfoAreaOffset == self.INITVALUE: + self.productinfoAreaOffset = 0 + if self.chassicInfoAreaOffset == self.INITVALUE: + self.chassicInfoAreaOffset = 0 + if self.boardInfoAreaOffset == self.INITVALUE: + self.boardInfoAreaOffset = 0 + if self.multiRecordAreaOffset == self.INITVALUE: + self.multiRecordAreaOffset = 0 + + self.zeroCheckSum = (0x100 - ord(self.version) - self.internalUserAreaOffset - self.chassicInfoAreaOffset - self.productinfoAreaOffset + - self.boardInfoAreaOffset - self.multiRecordAreaOffset) & 0xff + d_print("zerochecksum:%x" % self.zeroCheckSum) + self.data = self.version + chr(self.internalUserAreaOffset) + chr(self.chassicInfoAreaOffset) + chr( + self.boardInfoAreaOffset) + chr(self.productinfoAreaOffset) + chr(self.multiRecordAreaOffset) + self.INITVALUE + chr(self.zeroCheckSum) + + self.bindata = self.data + self.bodybin + totallen = len(self.bindata) + d_print("totallen %d" % totallen) + if (totallen < self._frusize): + self.bindata = self.bindata.ljust(self._frusize, self.INITVALUE) + else: + raise FruException('bin data more than %d' % self._frusize, -2) + + def recalcutebin(self): + self.bodybin = "" + if self.internalUseArea is not None and self.internalUseArea.isPresent: + d_print("internalUseArea present") + self.bodybin += self.internalUseArea.data + if self.chassisInfoArea is not None and self.chassisInfoArea.isPresent: + d_print("chassisInfoArea present") + self.bodybin += self.chassisInfoArea.data + if self.boardInfoArea is not None and self.boardInfoArea.isPresent: + d_print("boardInfoArea present") + self.boardInfoArea.recalcute() + self.bodybin += self.boardInfoArea.data + if self.productInfoArea is not None and self.productInfoArea.isPresent: + d_print("productInfoAreapresent") + self.productInfoArea.recalcute() + self.bodybin += self.productInfoArea.data + if self.multiRecordArea is not None and self.multiRecordArea.isPresent: + d_print("multiRecordArea present") + self.bodybin += self.productInfoArea.data + + def recalcute(self, fru_eeprom_size = 256): + self._frusize = fru_eeprom_size + self.recalcutebin() + self.recalcuteCommonHead() diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/__init__.py b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/baseutil.py b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/baseutil.py new file mode 100755 index 000000000000..1cf74d32d22f --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/baseutil.py @@ -0,0 +1,23 @@ +# -*- coding: UTF-8 -*- +import os + +def get_machine_info(): + if not os.path.isfile('/host/machine.conf'): + return None + machine_vars = {} + with open('/host/machine.conf') as machine_file: + for line in machine_file: + tokens = line.split('=') + if len(tokens) < 2: + continue + machine_vars[tokens[0]] = tokens[1].strip() + return machine_vars + +def get_platform_info(machine_info): + if machine_info != None: + if 'onie_platform' in machine_info: + return machine_info['onie_platform'] + elif 'aboot_platform' in machine_info: + return machine_info['aboot_platform'] + return None + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/logutil.py b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/logutil.py new file mode 100755 index 000000000000..2b001f21d72c --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/logutil.py @@ -0,0 +1,67 @@ +# -*- coding: UTF-8 -*- + +import logging +from syslog import ( + syslog, + openlog, + LOG_WARNING, + LOG_CRIT, + LOG_DEBUG, + LOG_ERR, + LOG_PID, + LOG_INFO, +) + +class Logger(): + def __init__(self, prefix, filepath=None, syslog=False, dbg_mask=0x0): + self.logger = None + if syslog is False: + if filepath is None: + raise AttributeError("filepath needed") + + # init logging + formatter = logging.Formatter( "%(asctime)s %(levelname)s %(filename)s[%(funcName)s][%(lineno)s]: %(message)s") + handler = logging.FileHandler(self.filepath) + handler.setFormatter(formatter) + self.logger = logging.getLogger(__name__) + self.logger.setLevel(logging.DEBUG) + self.logger.addHandler(handler) + + self.prefix = prefix + self.use_syslog = syslog + self.dbg_mask = dbg_mask + + def info(self, s): + if self.use_syslog: + self._syslog(s, LOG_INFO) + else: + self.logger.info(s) + + def debug(self, dbg_lvl, s): + if dbg_lvl & self.dbg_mask: + if self.use_syslog: + self._syslog(s, LOG_DEBUG) + else: + self.logger.debug(s) + + def warn(self, s): + if self.use_syslog: + self._syslog(s, LOG_WARNING) + else: + self.logger.warning(s) + + def error(self, s): + if self.use_syslog: + self._syslog(s, LOG_ERR) + else: + self.logger.error(s) + + def crit(self, s): + if self.use_syslog: + self._syslog(s, LOG_CRIT) + else: + self.logger.critical(s) + + def _syslog(self, s, t): + openlog(self.prefix, LOG_PID) + syslog(t, s) diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/smbus.py b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/smbus.py new file mode 100755 index 000000000000..cfef713c3b9d --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/lib/wbutil/smbus.py @@ -0,0 +1,774 @@ +"""smbus2 - A drop-in replacement for smbus-cffi/smbus-python""" +# The MIT License (MIT) +# Copyright (c) 2017 Karl-Petter Lindegaard +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import os +import sys +from fcntl import ioctl +from ctypes import c_uint32, c_uint8, c_uint16, c_char, POINTER, Structure, Array, Union, create_string_buffer, string_at + + +# Commands from uapi/linux/i2c-dev.h +I2C_SLAVE = 0x0703 # Use this slave address +I2C_SLAVE_FORCE = 0x0706 # Use this slave address, even if it is already in use by a driver! +I2C_FUNCS = 0x0705 # Get the adapter functionality mask +I2C_RDWR = 0x0707 # Combined R/W transfer (one STOP only) +I2C_SMBUS = 0x0720 # SMBus transfer. Takes pointer to i2c_smbus_ioctl_data +I2C_PEC = 0x0708 + +# SMBus transfer read or write markers from uapi/linux/i2c.h +I2C_SMBUS_WRITE = 0 +I2C_SMBUS_READ = 1 + +# Size identifiers uapi/linux/i2c.h +I2C_SMBUS_QUICK = 0 +I2C_SMBUS_BYTE = 1 +I2C_SMBUS_BYTE_DATA = 2 +I2C_SMBUS_WORD_DATA = 3 +I2C_SMBUS_PROC_CALL = 4 +I2C_SMBUS_BLOCK_DATA = 5 # This isn't supported by Pure-I2C drivers with SMBUS emulation, like those in RaspberryPi, OrangePi, etc :( +I2C_SMBUS_BLOCK_PROC_CALL = 7 # Like I2C_SMBUS_BLOCK_DATA, it isn't supported by Pure-I2C drivers either. +I2C_SMBUS_I2C_BLOCK_DATA = 8 +I2C_SMBUS_BLOCK_MAX = 32 + +# To determine what functionality is present (uapi/linux/i2c.h) +try: + from enum import IntFlag +except ImportError: + IntFlag = int + + +class I2cFunc(IntFlag): + """ + These flags identify the operations supported by an I2C/SMBus device. + + You can test these flags on your `smbus.funcs` + + On newer python versions, I2cFunc is an IntFlag enum, but it + falls back to class with a bunch of int constants on older releases. + """ + I2C = 0x00000001 + ADDR_10BIT = 0x00000002 + PROTOCOL_MANGLING = 0x00000004 # I2C_M_IGNORE_NAK etc. + SMBUS_PEC = 0x00000008 + NOSTART = 0x00000010 # I2C_M_NOSTART + SLAVE = 0x00000020 + SMBUS_BLOCK_PROC_CALL = 0x00008000 # SMBus 2.0 + SMBUS_QUICK = 0x00010000 + SMBUS_READ_BYTE = 0x00020000 + SMBUS_WRITE_BYTE = 0x00040000 + SMBUS_READ_BYTE_DATA = 0x00080000 + SMBUS_WRITE_BYTE_DATA = 0x00100000 + SMBUS_READ_WORD_DATA = 0x00200000 + SMBUS_WRITE_WORD_DATA = 0x00400000 + SMBUS_PROC_CALL = 0x00800000 + SMBUS_READ_BLOCK_DATA = 0x01000000 + SMBUS_WRITE_BLOCK_DATA = 0x02000000 + SMBUS_READ_I2C_BLOCK = 0x04000000 # I2C-like block xfer + SMBUS_WRITE_I2C_BLOCK = 0x08000000 # w/ 1-byte reg. addr. + SMBUS_HOST_NOTIFY = 0x10000000 + + SMBUS_BYTE = 0x00060000 + SMBUS_BYTE_DATA = 0x00180000 + SMBUS_WORD_DATA = 0x00600000 + SMBUS_BLOCK_DATA = 0x03000000 + SMBUS_I2C_BLOCK = 0x0c000000 + SMBUS_EMUL = 0x0eff0008 + + +# i2c_msg flags from uapi/linux/i2c.h +I2C_M_RD = 0x0001 + +# Pointer definitions +LP_c_uint8 = POINTER(c_uint8) +LP_c_uint16 = POINTER(c_uint16) +LP_c_uint32 = POINTER(c_uint32) + + +############################################################# +# Type definitions as in i2c.h + + +class i2c_smbus_data(Array): + """ + Adaptation of the i2c_smbus_data union in ``i2c.h``. + + Data for SMBus messages. + """ + _length_ = I2C_SMBUS_BLOCK_MAX + 2 + _type_ = c_uint8 + + +class union_i2c_smbus_data(Union): + _fields_ = [ + ("byte", c_uint8), + ("word", c_uint16), + ("block", i2c_smbus_data) + ] + + +union_pointer_type = POINTER(union_i2c_smbus_data) + + +class i2c_smbus_ioctl_data(Structure): + """ + As defined in ``i2c-dev.h``. + """ + _fields_ = [ + ('read_write', c_uint8), + ('command', c_uint8), + ('size', c_uint32), + ('data', union_pointer_type)] + __slots__ = [name for name, type in _fields_] + + @staticmethod + def create(read_write=I2C_SMBUS_READ, command=0, size=I2C_SMBUS_BYTE_DATA): + u = union_i2c_smbus_data() + return i2c_smbus_ioctl_data( + read_write=read_write, command=command, size=size, + data=union_pointer_type(u)) + + +############################################################# +# Type definitions for i2c_rdwr combined transactions + + +class i2c_msg(Structure): + """ + As defined in ``i2c.h``. + """ + _fields_ = [ + ('addr', c_uint16), + ('flags', c_uint16), + ('len', c_uint16), + ('buf', POINTER(c_char))] + + def __iter__(self): + """ Iterator / Generator + + :return: iterates over :py:attr:`buf` + :rtype: :py:class:`generator` which returns int values + """ + idx = 0 + while idx < self.len: + yield ord(self.buf[idx]) + idx += 1 + + def __len__(self): + return self.len + + def __bytes__(self): + return string_at(self.buf, self.len) + + def __repr__(self): + return 'i2c_msg(%d,%d,%r)' % (self.addr, self.flags, self.__bytes__()) + + def __str__(self): + s = self.__bytes__() + if sys.version_info.major >= 3: + s = ''.join(map(chr, s)) + return s + + @staticmethod + def read(address, length): + """ + Prepares an i2c read transaction. + + :param address: Slave address. + :type: address: int + :param length: Number of bytes to read. + :type: length: int + :return: New :py:class:`i2c_msg` instance for read operation. + :rtype: :py:class:`i2c_msg` + """ + arr = create_string_buffer(length) + return i2c_msg( + addr=address, flags=I2C_M_RD, len=length, + buf=arr) + + @staticmethod + def write(address, buf): + """ + Prepares an i2c write transaction. + + :param address: Slave address. + :type address: int + :param buf: Bytes to write. Either list of values or str. + :type buf: list + :return: New :py:class:`i2c_msg` instance for write operation. + :rtype: :py:class:`i2c_msg` + """ + if sys.version_info.major >= 3: + if type(buf) is str: + buf = bytes(map(ord, buf)) + else: + buf = bytes(buf) + else: + if type(buf) is not str: + buf = ''.join([chr(x) for x in buf]) + arr = create_string_buffer(buf, len(buf)) + return i2c_msg( + addr=address, flags=0, len=len(arr), + buf=arr) + + +class i2c_rdwr_ioctl_data(Structure): + """ + As defined in ``i2c-dev.h``. + """ + _fields_ = [ + ('msgs', POINTER(i2c_msg)), + ('nmsgs', c_uint32) + ] + __slots__ = [name for name, type in _fields_] + + @staticmethod + def create(*i2c_msg_instances): + """ + Factory method for creating a i2c_rdwr_ioctl_data struct that can + be called with ``ioctl(fd, I2C_RDWR, data)``. + + :param i2c_msg_instances: Up to 42 i2c_msg instances + :rtype: i2c_rdwr_ioctl_data + """ + n_msg = len(i2c_msg_instances) + msg_array = (i2c_msg * n_msg)(*i2c_msg_instances) + return i2c_rdwr_ioctl_data( + msgs=msg_array, + nmsgs=n_msg + ) + + +############################################################# + + +class SMBus(object): + + def __init__(self, bus=None, force=False): + """ + Initialize and (optionally) open an i2c bus connection. + + :param bus: i2c bus number (e.g. 0 or 1) + or an absolute file path (e.g. `/dev/i2c-42`). + If not given, a subsequent call to ``open()`` is required. + :type bus: int or str + :param force: force using the slave address even when driver is + already using it. + :type force: boolean + """ + self.fd = None + self.funcs = I2cFunc(0) + if bus is not None: + self.open(bus) + self.address = None + self.force = force + self._force_last = None + + def __enter__(self): + """Enter handler.""" + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + """Exit handler.""" + self.close() + + def open(self, bus): + """ + Open a given i2c bus. + + :param bus: i2c bus number (e.g. 0 or 1) + or an absolute file path (e.g. '/dev/i2c-42'). + :type bus: int or str + :raise TypeError: if type(bus) is not in (int, str) + """ + if isinstance(bus, int): + filepath = "/dev/i2c-{}".format(bus) + elif isinstance(bus, str): + filepath = bus + else: + raise TypeError("Unexpected type(bus)={}".format(type(bus))) + + self.fd = os.open(filepath, os.O_RDWR) + self.funcs = self._get_funcs() + + def close(self): + """ + Close the i2c connection. + """ + if self.fd: + os.close(self.fd) + self.fd = None + + def _set_address(self, address, force=None): + """ + Set i2c slave address to use for subsequent calls. + + :param address: + :type address: int + :param force: + :type force: Boolean + """ + force = force if force is not None else self.force + if self.address != address or self._force_last != force: + if force is True: + ioctl(self.fd, I2C_SLAVE_FORCE, address) + else: + ioctl(self.fd, I2C_SLAVE, address) + self.address = address + self._force_last = force + + def _get_funcs(self): + """ + Returns a 32-bit value stating supported I2C functions. + + :rtype: int + """ + f = c_uint32() + ioctl(self.fd, I2C_FUNCS, f) + return f.value + + def write_quick(self, i2c_addr, force=None): + """ + Perform quick transaction. Throws IOError if unsuccessful. + :param i2c_addr: i2c address + :type i2c_addr: int + :param force: + :type force: Boolean + """ + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=0, size=I2C_SMBUS_QUICK) + ioctl(self.fd, I2C_SMBUS, msg) + + def read_byte(self, i2c_addr, force=None): + """ + Read a single byte from a device. + + :rtype: int + :param i2c_addr: i2c address + :type i2c_addr: int + :param force: + :type force: Boolean + :return: Read byte value + """ + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_READ, command=0, size=I2C_SMBUS_BYTE + ) + ioctl(self.fd, I2C_SMBUS, msg) + return msg.data.contents.byte + + def write_byte(self, i2c_addr, value, force=None): + """ + Write a single byte to a device. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param value: value to write + :type value: int + :param force: + :type force: Boolean + """ + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=value, size=I2C_SMBUS_BYTE + ) + ioctl(self.fd, I2C_SMBUS, msg) + + def read_byte_data(self, i2c_addr, register, force=None): + """ + Read a single byte from a designated register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to read + :type register: int + :param force: + :type force: Boolean + :return: Read byte value + :rtype: int + """ + val_t = -1 + returnmsg="" + try: + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_READ, command=register, size=I2C_SMBUS_BYTE_DATA + ) + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + self.close() + returnmsg = str(e) + if val_t < 0: + return False, returnmsg + else: + return True, msg.data.contents.byte + + def write_byte_data(self, i2c_addr, register, value, force=None): + """ + Write a byte to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to write to + :type register: int + :param value: Byte value to transmit + :type value: int + :param force: + :type force: Boolean + :rtype: None + """ + val_t = -1 + returnmsg = "" + try: + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_BYTE_DATA + ) + msg.data.contents.byte = value + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + returnmsg = str(e) + self.close() + if val_t < 0: + return False, returnmsg or "" + else: + return True, "" + + def write_byte_data_pec(self, i2c_addr, register, value, force=None): + """ + Write a byte to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to write to + :type register: int + :param value: Byte value to transmit + :type value: int + :param force: + :type force: Boolean + :rtype: None + """ + val_t = -1 + returnmsg = "" + try: + val_t = ioctl(self.fd, I2C_PEC, 1) + if val_t < 0: + raise Exception("set pec mod error") + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_BYTE_DATA + ) + msg.data.contents.byte = value + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + returnmsg = str(e) + self.close() + if val_t < 0: + return False, returnmsg or "" + else: + return True, "" + + def read_word_data(self, i2c_addr, register, force=None): + """ + Read a single word (2 bytes) from a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to read + :type register: int + :param force: + :type force: Boolean + :return: 2-byte word + :rtype: int + """ + val_t = -1 + returnmsg = "" + try: + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_READ, command=register, size=I2C_SMBUS_WORD_DATA + ) + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + returnmsg = str(e) + self.close() + if val_t < 0: + return False, returnmsg or "" + else: + return True, msg.data.contents.word + + def write_word_data_pec(self, i2c_addr, register, value, force=None): + """ + Write a byte to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to write to + :type register: int + :param value: Word value to transmit + :type value: int + :param force: + :type force: Boolean + :rtype: None + """ + val_t = -1 + returnmsg = "" + try: + val_t = ioctl(self.fd, I2C_PEC, 1) + if val_t < 0: + raise Exception("set pec mod error") + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_WORD_DATA + ) + msg.data.contents.word = value + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + returnmsg = str(e) + self.close() + if val_t < 0: + return False, returnmsg or "" + else: + return True, "" + + def write_word_data(self, i2c_addr, register, value, force=None): + """ + Write a byte to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to write to + :type register: int + :param value: Word value to transmit + :type value: int + :param force: + :type force: Boolean + :rtype: None + """ + val_t = -1 + returnmsg = "" + try: + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_WORD_DATA + ) + msg.data.contents.word = value + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + returnmsg = str(e) + self.close() + if val_t < 0: + return False, returnmsg or "" + else: + return True, "" + + def process_call(self, i2c_addr, register, value, force=None): + """ + Executes a SMBus Process Call, sending a 16-bit value and receiving a 16-bit response + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to read/write to + :type register: int + :param value: Word value to transmit + :type value: int + :param force: + :type force: Boolean + :rtype: int + """ + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_PROC_CALL + ) + msg.data.contents.word = value + ioctl(self.fd, I2C_SMBUS, msg) + return msg.data.contents.word + + def read_block_data(self, i2c_addr, register, force=None): + """ + Read a block of up to 32-bytes from a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Start register + :type register: int + :param force: + :type force: Boolean + :return: List of bytes + :rtype: list + """ + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_READ, command=register, size=I2C_SMBUS_BLOCK_DATA + ) + ioctl(self.fd, I2C_SMBUS, msg) + length = msg.data.contents.block[0] + return msg.data.contents.block[1:length + 1] + + def write_block_data(self, i2c_addr, register, data, force=None): + """ + Write a block of byte data to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Start register + :type register: int + :param data: List of bytes + :type data: list + :param force: + :type force: Boolean + :rtype: None + """ + length = len(data) + if length > I2C_SMBUS_BLOCK_MAX: + raise ValueError("Data length cannot exceed %d bytes" % I2C_SMBUS_BLOCK_MAX) + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_BLOCK_DATA + ) + msg.data.contents.block[0] = length + msg.data.contents.block[1:length + 1] = data + ioctl(self.fd, I2C_SMBUS, msg) + + def block_process_call(self, i2c_addr, register, data, force=None): + """ + Executes a SMBus Block Process Call, sending a variable-size data + block and receiving another variable-size response + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to read/write to + :type register: int + :param data: List of bytes + :type data: list + :param force: + :type force: Boolean + :return: List of bytes + :rtype: list + """ + length = len(data) + if length > I2C_SMBUS_BLOCK_MAX: + raise ValueError("Data length cannot exceed %d bytes" % I2C_SMBUS_BLOCK_MAX) + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_BLOCK_PROC_CALL + ) + msg.data.contents.block[0] = length + msg.data.contents.block[1:length + 1] = data + ioctl(self.fd, I2C_SMBUS, msg) + length = msg.data.contents.block[0] + return msg.data.contents.block[1:length + 1] + + def read_i2c_block_data(self, i2c_addr, register, length, force=None): + """ + Read a block of byte data from a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Start register + :type register: int + :param length: Desired block length + :type length: int + :param force: + :type force: Boolean + :return: List of bytes + :rtype: list + """ + if length > I2C_SMBUS_BLOCK_MAX: + raise ValueError("Desired block length over %d bytes" % I2C_SMBUS_BLOCK_MAX) + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_READ, command=register, size=I2C_SMBUS_I2C_BLOCK_DATA + ) + msg.data.contents.byte = length + ioctl(self.fd, I2C_SMBUS, msg) + return msg.data.contents.block[1:length + 1] + + def write_i2c_block_data(self, i2c_addr, register, data, force=None): + """ + Write a block of byte data to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Start register + :type register: int + :param data: List of bytes + :type data: list + :param force: + :type force: Boolean + :rtype: None + """ + length = len(data) + if length > I2C_SMBUS_BLOCK_MAX: + raise ValueError("Data length cannot exceed %d bytes" % I2C_SMBUS_BLOCK_MAX) + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_I2C_BLOCK_DATA + ) + msg.data.contents.block[0] = length + msg.data.contents.block[1:length + 1] = data + ioctl(self.fd, I2C_SMBUS, msg) + + def i2c_rdwr(self, *i2c_msgs): + """ + Combine a series of i2c read and write operations in a single + transaction (with repeated start bits but no stop bits in between). + + This method takes i2c_msg instances as input, which must be created + first with :py:meth:`i2c_msg.read` or :py:meth:`i2c_msg.write`. + + :param i2c_msgs: One or more i2c_msg class instances. + :type i2c_msgs: i2c_msg + :rtype: None + """ + ioctl_data = i2c_rdwr_ioctl_data.create(*i2c_msgs) + ioctl(self.fd, I2C_RDWR, ioctl_data) + + +class SMBusWrapper: + """ + Wrapper class around the SMBus. + Deprecated as of version 0.3.0. Please replace with :py:class:`SMBus`. + + Enables the user to wrap access to the :py:class:`SMBus` class in a + "with" statement. If auto_cleanup is True (default), the + :py:class:`SMBus` handle will be automatically closed + upon exit of the ``with`` block. + """ + def __init__(self, bus_number=0, auto_cleanup=True, force=False): + """ + :param auto_cleanup: Close bus when leaving scope. + :type auto_cleanup: Boolean + :param force: Force using the slave address even when driver is already using it. + :type force: Boolean + """ + self.bus_number = bus_number + self.auto_cleanup = auto_cleanup + self.force = force + + def __enter__(self): + self.bus = SMBus(bus=self.bus_number, force=self.force) + return self.bus + + def __exit__(self, exc_type, exc_val, exc_tb): + if self.auto_cleanup: + self.bus.close() diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/modules/COPYING b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/COPYING new file mode 100644 index 000000000000..a635a38ef940 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/COPYING @@ -0,0 +1,20 @@ +The Linux Kernel is provided under: + + SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note + +Being under the terms of the GNU General Public License version 2 only, +according with: + + LICENSES/preferred/GPL-2.0 + +With an explicit syscall exception, as stated at: + + LICENSES/exceptions/Linux-syscall-note + +In addition, other licenses may also apply. Please see: + + Documentation/process/license-rules.rst + +for more details. + +All contributions to the Linux Kernel are subject to this COPYING file. diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/modules/GPL-2.0 b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/GPL-2.0 new file mode 100644 index 000000000000..ff0812fd89cc --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/GPL-2.0 @@ -0,0 +1,359 @@ +Valid-License-Identifier: GPL-2.0 +Valid-License-Identifier: GPL-2.0-only +Valid-License-Identifier: GPL-2.0+ +Valid-License-Identifier: GPL-2.0-or-later +SPDX-URL: https://spdx.org/licenses/GPL-2.0.html +Usage-Guide: + To use this license in source code, put one of the following SPDX + tag/value pairs into a comment according to the placement + guidelines in the licensing rules documentation. + For 'GNU General Public License (GPL) version 2 only' use: + SPDX-License-Identifier: GPL-2.0 + or + SPDX-License-Identifier: GPL-2.0-only + For 'GNU General Public License (GPL) version 2 or any later version' use: + SPDX-License-Identifier: GPL-2.0+ + or + SPDX-License-Identifier: GPL-2.0-or-later +License-Text: + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/modules/Makefile b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/Makefile new file mode 100644 index 000000000000..66f388763f5e --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/Makefile @@ -0,0 +1,23 @@ +PWD = $(shell pwd) +EXTRA_CFLAGS:= -I$(M)/include +EXTRA_CFLAGS+= -Wall +KVERSION ?= $(shell uname -r) +KERNEL_SRC ?= /lib/modules/$(KVERSION) + +module_out_put_dir := $(PWD)/build +export module_out_put_dir + +platform_common-objs := platform_common_module.o dfd_tlveeprom.o +obj-m += wb_platform.o +obj-m += platform_common.o + +all : + $(MAKE) -C $(KERNEL_SRC)/build M=$(PWD) modules + @if [ ! -d $(module_out_put_dir) ]; then mkdir -p $(module_out_put_dir) ;fi + cp -p $(PWD)/*.ko $(module_out_put_dir) + +clean : + rm -rf $(module_out_put_dir) + rm -f ${PWD}/*.o ${PWD}/*.ko ${PWD}/*.mod.c ${PWD}/.*.cmd ${PWD}/.*.o.d + rm -f ${PWD}/Module.markers ${PWD}/Module.symvers ${PWD}/modules.order + rm -rf ${PWD}/.tmp_versions diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.c b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.c new file mode 100644 index 000000000000..f6f9df1f6e73 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.c @@ -0,0 +1,521 @@ +/* + * Copyright (C) 2003-2014 FreeIPMI Core Team + * + * 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 3 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, see . + * + */ +/*****************************************************************************\ + * Copyright (C) 2007-2014 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Albert Chu + * UCRL-CODE-232183 + * + * This file is part of Ipmi-fru, a tool used for retrieving + * motherboard field replaceable unit (FRU) information. For details, + * see http://www.llnl.gov/linux/. + * + * Ipmi-fru 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 3 of the License, or (at your + * option) any later version. + * + * Ipmi-fru 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 Ipmi-fru. If not, see . +\*****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "platform.h" +#include "dfd_tlveeprom.h" + +/* using in is_valid_tlvinfo_header */ +static u_int32_t eeprom_size; + +/* + * List of TLV codes and names. + */ +static const struct tlv_code_desc tlv_code_list[] = { + { TLV_CODE_PRODUCT_NAME , "Product Name"}, + { TLV_CODE_PART_NUMBER , "Part Number"}, + { TLV_CODE_SERIAL_NUMBER , "Serial Number"}, + { TLV_CODE_MAC_BASE , "Base MAC Address"}, + { TLV_CODE_MANUF_DATE , "Manufacture Date"}, + { TLV_CODE_DEVICE_VERSION , "Device Version"}, + { TLV_CODE_LABEL_REVISION , "Label Revision"}, + { TLV_CODE_PLATFORM_NAME , "Platform Name"}, + { TLV_CODE_ONIE_VERSION , "ONIE Version"}, + { TLV_CODE_MAC_SIZE , "MAC Addresses"}, + { TLV_CODE_MANUF_NAME , "Manufacturer"}, + { TLV_CODE_MANUF_COUNTRY , "Country Code"}, + { TLV_CODE_VENDOR_NAME , "Vendor Name"}, + { TLV_CODE_DIAG_VERSION , "Diag Version"}, + { TLV_CODE_SERVICE_TAG , "Service Tag"}, + { TLV_CODE_VENDOR_EXT , "Vendor Extension"}, + { TLV_CODE_CRC_32 , "CRC-32"}, +}; + +#if 0 +#define OPENBMC_VPD_KEY_INVAIL_VAL 0 + +static const tlv_code_map_t tlv_code_map[] = { + { TLV_CODE_PRODUCT_NAME , OPENBMC_VPD_KEY_PRODUCT_NAME}, + { TLV_CODE_PART_NUMBER , OPENBMC_VPD_KEY_PRODUCT_PART_MODEL_NUM}, + { TLV_CODE_SERIAL_NUMBER , OPENBMC_VPD_KEY_PRODUCT_SERIAL_NUM}, + { TLV_CODE_MAC_BASE , OPENBMC_VPD_KEY_INVAIL_VAL}, + { TLV_CODE_MANUF_DATE , OPENBMC_VPD_KEY_BOARD_MFG_DATE}, + { TLV_CODE_DEVICE_VERSION , OPENBMC_VPD_KEY_PRODUCT_VER}, + { TLV_CODE_LABEL_REVISION , OPENBMC_VPD_KEY_PRODUCT_CUSTOM7}, + { TLV_CODE_PLATFORM_NAME , OPENBMC_VPD_KEY_PRODUCT_CUSTOM1}, + { TLV_CODE_ONIE_VERSION , OPENBMC_VPD_KEY_PRODUCT_CUSTOM2}, + { TLV_CODE_MAC_SIZE , OPENBMC_VPD_KEY_INVAIL_VAL}, + { TLV_CODE_MANUF_NAME , OPENBMC_VPD_KEY_PRODUCT_MFR}, + { TLV_CODE_MANUF_COUNTRY , OPENBMC_VPD_KEY_PRODUCT_CUSTOM3}, + { TLV_CODE_VENDOR_NAME , OPENBMC_VPD_KEY_PRODUCT_CUSTOM4}, + { TLV_CODE_DIAG_VERSION , OPENBMC_VPD_KEY_PRODUCT_CUSTOM8}, + { TLV_CODE_SERVICE_TAG , OPENBMC_VPD_KEY_PRODUCT_CUSTOM5}, + { TLV_CODE_VENDOR_EXT , OPENBMC_VPD_KEY_PRODUCT_CUSTOM6}, + { TLV_CODE_CRC_32 , OPENBMC_VPD_KEY_INVAIL_VAL}, +}; +#endif + +#define TLV_CODE_NUM (sizeof(tlv_code_list) / sizeof(tlv_code_list[0])) + +#if 0 +#define TLV_CODE_MAP_NUM (sizeof(tlv_code_map) / sizeof(tlv_code_map[0])) +#endif + +const unsigned long crc_table[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, +}; + +static unsigned long crc32(unsigned long crc, const unsigned char *buf, unsigned len) +{ + unsigned i; + if (len < 1) + return 0xffffffff; + + for (i = 0; i != len; ++i) + { + crc = crc_table[(crc ^ buf[i]) & 0xff] ^ (crc >> 8); + } + + crc = crc ^ 0xffffffff; + + return crc; +} + +/* + * is_valid_tlv + * + * Perform basic sanity checks on a TLV field. The TLV is pointed to + * by the parameter provided. + * 1. The type code is not reserved (0x00 or 0xFF) + */ +static inline bool is_valid_tlv(tlvinfo_tlv_t *tlv) +{ + return ((tlv->type != 0x00) && (tlv->type != 0xFF)); +} + +/* + * is_valid_tlvinfo_header + * + * Perform sanity checks on the first 11 bytes of the TlvInfo EEPROM + * data pointed to by the parameter: + * 1. First 8 bytes contain null-terminated ASCII string "TlvInfo" + * 2. Version byte is 1 + * 3. Total length bytes contain value which is less than or equal + * to the allowed maximum (2048-11) + * + */ +static inline bool is_valid_tlvinfo_header(tlvinfo_header_t *hdr) +{ + int max_size = eeprom_size; + return((strcmp(hdr->signature, TLV_INFO_ID_STRING) == 0) && + (hdr->version == TLV_INFO_VERSION) && + (be16_to_cpu(hdr->totallen) <= max_size) ); +} + +/* + * decode_tlv_value + * + * Decode a single TLV value into a string. + + * The validity of EEPROM contents and the TLV field have been verified + * prior to calling this function. + */ +static void decode_tlv_value(tlvinfo_tlv_t *tlv, tlv_decode_value_t *decode_value) +{ + int i; + char *value; + u_int32_t length; + + value = (char *)decode_value->value; + + switch (tlv->type) { + case TLV_CODE_PRODUCT_NAME: + case TLV_CODE_PART_NUMBER: + case TLV_CODE_SERIAL_NUMBER: + case TLV_CODE_MANUF_DATE: + case TLV_CODE_LABEL_REVISION: + case TLV_CODE_PLATFORM_NAME: + case TLV_CODE_ONIE_VERSION: + case TLV_CODE_MANUF_NAME: + case TLV_CODE_MANUF_COUNTRY: + case TLV_CODE_VENDOR_NAME: + case TLV_CODE_DIAG_VERSION: + case TLV_CODE_SERVICE_TAG: + case TLV_CODE_VENDOR_EXT: + memcpy(value, tlv->value, tlv->length); + value[tlv->length] = 0; + length = tlv->length; + break; + case TLV_CODE_MAC_BASE: + length = sprintf(value, "%02X:%02X:%02X:%02X:%02X:%02X", + tlv->value[0], tlv->value[1], tlv->value[2], + tlv->value[3], tlv->value[4], tlv->value[5]); + break; + case TLV_CODE_DEVICE_VERSION: + length = sprintf(value, "%u", tlv->value[0]); + break; + case TLV_CODE_MAC_SIZE: + length = sprintf(value, "%u", (tlv->value[0] << 8) | tlv->value[1]); + break; + #if 0 + case TLV_CODE_VENDOR_EXT: + value[0] = 0; + length = 0; + for (i = 0; (i < (TLV_DECODE_VALUE_MAX_LEN/5)) && (i < tlv->length); i++) { + length += sprintf(value, "%s 0x%02X", value, tlv->value[i]); + } + break; + #endif + case TLV_CODE_CRC_32: + length = sprintf(value, "0x%02X%02X%02X%02X", tlv->value[0], + tlv->value[1], tlv->value[2], tlv->value[3]); + break; + default: + value[0] = 0; + length = 0; + for (i = 0; (i < (TLV_DECODE_VALUE_MAX_LEN/5)) && (i < tlv->length); i++) { + length += sprintf(value, "%s 0x%02X", value, tlv->value[i]); + } + break; + } + + decode_value->length = length; +} + +/* + * is_checksum_valid + * + * Validate the checksum in the provided TlvInfo EEPROM data. First, + * verify that the TlvInfo header is valid, then make sure the last + * TLV is a CRC-32 TLV. Then calculate the CRC over the EEPROM data + * and compare it to the value stored in the EEPROM CRC-32 TLV. + */ +static bool is_checksum_valid(u_int8_t *eeprom) +{ + tlvinfo_header_t *eeprom_hdr; + tlvinfo_tlv_t *eeprom_crc; + unsigned int calc_crc; + unsigned int stored_crc; + + eeprom_hdr = (tlvinfo_header_t *) eeprom; + + /* Is the eeprom header valid? */ + if (!is_valid_tlvinfo_header(eeprom_hdr)) { + return false; + } + + /* Is the last TLV a CRC? */ + eeprom_crc = (tlvinfo_tlv_t *) &eeprom[sizeof(tlvinfo_header_t) + + be16_to_cpu(eeprom_hdr->totallen) - (sizeof(tlvinfo_tlv_t) + 4)]; + if ((eeprom_crc->type != TLV_CODE_CRC_32) || (eeprom_crc->length != 4)) { + return false; + } + + /* Calculate the checksum */ + calc_crc = crc32(0xffffffffL, (const unsigned char *)eeprom, sizeof(tlvinfo_header_t) + + be16_to_cpu(eeprom_hdr->totallen) - 4); + stored_crc = ((eeprom_crc->value[0] << 24) | (eeprom_crc->value[1] << 16) | + (eeprom_crc->value[2] << 8) | eeprom_crc->value[3]); + + return (calc_crc == stored_crc); +} + +/* + * tlvinfo_find_tlv + * + * This function finds the TLV with the supplied code in the EERPOM. + * An offset from the beginning of the EEPROM is returned in the + * eeprom_index parameter if the TLV is found. + */ +static bool tlvinfo_find_tlv(u_int8_t *eeprom, u_int8_t tcode, int *eeprom_index) +{ + tlvinfo_header_t *eeprom_hdr; + tlvinfo_tlv_t *eeprom_tlv; + int eeprom_end; + + eeprom_hdr = (tlvinfo_header_t *) eeprom; + + /* Search through the TLVs, looking for the first one which matches the + supplied type code. */ + *eeprom_index = sizeof(tlvinfo_header_t); + eeprom_end = sizeof(tlvinfo_header_t) + be16_to_cpu(eeprom_hdr->totallen); + while (*eeprom_index < eeprom_end) { + eeprom_tlv = (tlvinfo_tlv_t *) &eeprom[*eeprom_index]; + if (!is_valid_tlv(eeprom_tlv)) { + return false; + } + + if (eeprom_tlv->type == tcode) { + return true; + } + + *eeprom_index += sizeof(tlvinfo_tlv_t) + eeprom_tlv->length; + } + + return false; +} + +/* + * tlvinfo_decode_tlv + * + * This function finds the TLV with the supplied code in the EERPOM + * and decodes the value into the buffer provided. + */ +static bool tlvinfo_decode_tlv(u_int8_t *eeprom, u_int8_t tcode, tlv_decode_value_t *decode_value) +{ + int eeprom_index; + tlvinfo_tlv_t *eeprom_tlv; + + /* Find the TLV and then decode it */ + if (tlvinfo_find_tlv(eeprom, tcode, &eeprom_index)) { + eeprom_tlv = (tlvinfo_tlv_t *) &eeprom[eeprom_index]; + decode_tlv_value(eeprom_tlv, decode_value); + return true; + } + + return false; +} + +/* + * parse_tlv_eeprom + * + * parse the EEPROM into memory, if it hasn't already been read. + */ +int parse_tlv_eeprom(u_int8_t *eeprom, u_int32_t size) +{ + unsigned int i; + bool ret; + tlvinfo_header_t *eeprom_hdr; + //tlv_info_vec_t tlv_info; + tlv_decode_value_t decode_value; + int j; + + eeprom_hdr = (tlvinfo_header_t *) eeprom; + eeprom_size = size; /* eeprom real size */ + + if (!is_valid_tlvinfo_header(eeprom_hdr)) { + DBG_ERROR("Failed to check tlv header.\n"); + return -1; + } + + if (!is_checksum_valid(eeprom)) { + DBG_ERROR("Failed to check tlv crc.\n"); + return -1; + } + + for (i = 0; i < TLV_CODE_NUM; i++) { + mem_clear((void *)&decode_value, sizeof(tlv_decode_value_t)); + ret = tlvinfo_decode_tlv(eeprom, tlv_code_list[i].m_code, &decode_value); + if (!ret) { + DBG_ERROR("No found type: %s\n", tlv_code_list[i].m_name); + continue; + } + + DBG_DEBUG("i: %d,Found type: %s tlv[%d]:%s\n", i, tlv_code_list[i].m_name, tlv_code_list[i].m_code, + decode_value.value); + for (j = 0; j < decode_value.length; j++) { + if ((j % 16) == 0) { + DBG_DEBUG("\n"); + } + DBG_DEBUG("%02x ", decode_value.value[j]); + } + DBG_DEBUG("\n\n"); + } + return 0; +} +static int dfd_parse_tlv_eeprom(u_int8_t *eeprom, u_int32_t size, u_int8_t main_type, tlv_decode_value_t *decode_value) +{ + bool ret; + tlvinfo_header_t *eeprom_hdr; + /* tlv_info_vec_t tlv_info; */ + int j; + + eeprom_hdr = (tlvinfo_header_t *) eeprom; + eeprom_size = size; /* eeprom real size */ + + if (!is_valid_tlvinfo_header(eeprom_hdr)) { + DBG_ERROR("Failed to check tlv header.\n"); + return -1; + } + + if (!is_checksum_valid(eeprom)) { + DBG_ERROR("Failed to check tlv crc.\n"); + return -1; + } + + ret = tlvinfo_decode_tlv(eeprom, main_type, decode_value); + if (!ret) { + DBG_ERROR("No found type: %d\n", main_type); + return -1; + } + + DBG_DEBUG("Found type: %d, value: %s\n", main_type,decode_value->value); + for (j = 0; j < decode_value->length; j++) { + if ((j % 16) == 0) { + DBG_DEBUG("\n"); + } + DBG_DEBUG("%02x ", decode_value->value[j]); + } + DBG_DEBUG("\n\n"); + + return 0; +} + +/* analyze the extended custom TLV format */ +static int tlvinfo_find_wb_ext_tlv(tlv_decode_value_t *ext_tlv_value, u_int8_t ext_type, + u_int8_t *buf, u_int8_t *buf_len) +{ + tlvinfo_tlv_t *eeprom_tlv; + int eeprom_end, eeprom_index; + + /* Search through the TLVs, looking for the first one which matches the + supplied type code. */ + DBG_DEBUG("ext_tlv_value->length: %d.\n", ext_tlv_value->length); + for (eeprom_index = 0; eeprom_index < ext_tlv_value->length; eeprom_index++) { + if ((eeprom_index % 16) == 0) { + DBG_DEBUG("\n"); + } + DBG_DEBUG("%02x ", ext_tlv_value->value[eeprom_index]); + } + + DBG_DEBUG("\n"); + + eeprom_index = 0; + eeprom_end = ext_tlv_value->length; + while (eeprom_index < eeprom_end) { + eeprom_tlv = (tlvinfo_tlv_t *) &(ext_tlv_value->value[eeprom_index]); + if (!is_valid_tlv(eeprom_tlv)) { + DBG_ERROR("tlv is not valid, eeprom_tlv->type 0x%x.\n", eeprom_tlv->type); + return -1; + } + + DBG_DEBUG("eeprom_tlv->length %d.\n", eeprom_tlv->length); + if (eeprom_tlv->type == ext_type) { + if (*buf_len >= eeprom_tlv->length) { + memcpy(buf, eeprom_tlv->value, eeprom_tlv->length); + DBG_DEBUG("eeprom_tlv->length %d.\n", eeprom_tlv->length); + *buf_len = eeprom_tlv->length; + return 0; + } + DBG_ERROR("buf_len %d small than info_len %d.\n", *buf_len, eeprom_tlv->length); + return -1; + } + + eeprom_index += sizeof(tlvinfo_tlv_t) + eeprom_tlv->length; + } + + DBG_ERROR("ext_type %d: tlv is not found.\n", ext_type); + return -1; +} + +/* get EEPROM information */ +int dfd_tlvinfo_get_e2prom_info(u_int8_t *eeprom, u_int32_t size, dfd_tlv_type_t *tlv_type, u_int8_t* buf, u_int8_t *buf_len) +{ + tlv_decode_value_t decode_value; + int ret; + + if (eeprom == NULL || tlv_type == NULL || buf == NULL) { + DBG_ERROR("Input para invalid.\n"); + return -1; + } + + mem_clear((void *)&decode_value, sizeof(tlv_decode_value_t)); + ret = dfd_parse_tlv_eeprom(eeprom, size, tlv_type->main_type, &decode_value); + if (ret) { + DBG_ERROR("dfd_parse_tlv_eeprom failed ret %d.\n", ret); + return ret; + } + + /* For non-extended types, return data directly */ + if (tlv_type->main_type != TLV_CODE_VENDOR_EXT) { + if (*buf_len >= decode_value.length) { + memcpy(buf, decode_value.value, decode_value.length); + *buf_len = decode_value.length; + return 0; + } + DBG_ERROR("buf_len %d small than info_len %d.\n", *buf_len, decode_value.length); + return -1; + } + DBG_DEBUG("info_len %d.\n", decode_value.length); + + /* For the extended type, continue with the secondary TLV analysis to obtain + the data corresponding to the sub-TLV type */ + return tlvinfo_find_wb_ext_tlv(&decode_value, tlv_type->ext_type, buf, buf_len); +} diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.h b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.h new file mode 100644 index 000000000000..6c5b2e98be52 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.h @@ -0,0 +1,121 @@ +#ifndef DFD_OPENBMC_TLVEEPROM_H +#define DFD_OPENBMC_TLVEEPROM_H + +#ifndef u_int8_t +#define u_int8_t unsigned char +#endif + +#ifndef u_int16_t +#define u_int16_t unsigned short +#endif + +#ifndef u_int32_t +#define u_int32_t unsigned int +#endif + +#ifndef be16_to_cpu +#define be16_to_cpu(x) ntohs(x) +#endif + +#ifndef cpu_to_be16 +#define cpu_to_be16(x) htons(x) +#endif + +/** + * The TLV Types. + * + * Keep these in sync with tlv_code_list in cmd_sys_eeprom.c + */ +#define TLV_CODE_PRODUCT_NAME 0x21 +#define TLV_CODE_PART_NUMBER 0x22 +#define TLV_CODE_SERIAL_NUMBER 0x23 +#define TLV_CODE_MAC_BASE 0x24 +#define TLV_CODE_MANUF_DATE 0x25 +#define TLV_CODE_DEVICE_VERSION 0x26 +#define TLV_CODE_LABEL_REVISION 0x27 +#define TLV_CODE_PLATFORM_NAME 0x28 +#define TLV_CODE_ONIE_VERSION 0x29 +#define TLV_CODE_MAC_SIZE 0x2A +#define TLV_CODE_MANUF_NAME 0x2B +#define TLV_CODE_MANUF_COUNTRY 0x2C +#define TLV_CODE_VENDOR_NAME 0x2D +#define TLV_CODE_DIAG_VERSION 0x2E +#define TLV_CODE_SERVICE_TAG 0x2F +#define TLV_CODE_VENDOR_EXT 0xFD +#define TLV_CODE_CRC_32 0xFE + +#define TLV_CODE_NAME_LEN 64 +/* + * Struct for displaying the TLV codes and names. + */ +struct tlv_code_desc { + u_int8_t m_code; + char m_name[TLV_CODE_NAME_LEN]; +}; +/* ONIE TLV Type and Extended TLV Type Definition */ +typedef struct dfd_tlv_type_s { + u_int8_t main_type;/* ONIE standard TLV TYPE type */ + u_int8_t ext_type; /* Extended TLV TYPE type */ +} dfd_tlv_type_t; + +/* Header Field Constants */ +#define TLV_INFO_ID_STRING "TlvInfo" +#define TLV_INFO_VERSION 0x01 +/*#define TLV_TOTAL_LEN_MAX (XXXXXXXX - sizeof(tlvinfo_header_t))*/ + +struct __attribute__ ((__packed__)) tlvinfo_header_s { + char signature[8]; /* 0x00 - 0x07 EEPROM Tag "TlvInfo" */ + u_int8_t version; /* 0x08 Structure version */ + u_int16_t totallen; /* 0x09 - 0x0A Length of all data which follows */ +}; +typedef struct tlvinfo_header_s tlvinfo_header_t; + +/* + * TlvInfo TLV: Layout of a TLV field + */ +struct __attribute__ ((__packed__)) tlvinfo_tlv_s { + u_int8_t type; + u_int8_t length; + u_int8_t value[0]; +}; +typedef struct tlvinfo_tlv_s tlvinfo_tlv_t; + +#define TLV_VALUE_MAX_LEN 255 +/* + * The max decode value is currently for the 'raw' type or the 'vendor + * extension' type, both of which have the same decode format. The + * max decode string size is computed as follows: + * + * strlen(" 0xFF") * TLV_VALUE_MAX_LEN + 1 + * + */ +#define TLV_DECODE_VALUE_MAX_LEN ((5 * TLV_VALUE_MAX_LEN) + 1) + +typedef struct tlv_decode_value_s { + u_int8_t value[TLV_DECODE_VALUE_MAX_LEN]; + u_int32_t length; +} tlv_decode_value_t; + +typedef enum dfd_tlvinfo_ext_tlv_type_e { + DFD_TLVINFO_EXT_TLV_TYPE_DEV_TYPE = 1, +} dfd_tlvinfo_ext_tlv_type_t; + +#if 0 +#define TLV_TIME_LEN 64 + +int ipmi_tlv_validate_fru_area(const uint8_t fruid, const char *fru_file_name, + sd_bus *bus_type, const bool bmc_fru); + +extern const char *get_vpd_key_names(int key_id); +extern std::string getService(sdbusplus::bus::bus& bus, + const std::string& intf, + const std::string& path); +extern std::string getFRUValue(const std::string& section, + const std::string& key, + const std::string& delimiter, + IPMIFruInfo& fruData); +#endif + +int dfd_tlvinfo_get_e2prom_info(u_int8_t *eeprom, u_int32_t size, dfd_tlv_type_t *tlv_type, u_int8_t* buf, u_int8_t *buf_len); + +#endif /* endif DFD_OPENBMC_TLVEEPROM_H */ diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/modules/platform.h b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/platform.h new file mode 100644 index 000000000000..869bc5322af6 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/platform.h @@ -0,0 +1,155 @@ +#ifndef __PLATFORM_H__ +#define __PLATFORM_H__ + +#include +#include +#include +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +/* debug switch level */ +typedef enum { + DBG_START, + DBG_VERBOSE, + DBG_KEY, + DBG_WARN, + DBG_ERROR, + DBG_END, +} dbg_level_t; + +typedef enum dfd_cpld_id { + BCM_CPLD0 = 0, + BCM_CPLD1, + CPLD0_MAC0, + CPLD0_MAC1, + CPLD1_MAC0, + CPLD2_MAC1, +} dfd_cpld_id_t; + + typedef enum dfd_cpld_bus { + SMBUS_BUS = 0 , + GPIO_BUS = 1, + PCA9641_BUS = 2, +} dfd_cpld_bus_t; + + typedef struct dfd_i2c_dev_s { + int bus; /* bus number */ + int addr; /* bus address */ + } dfd_i2c_dev_t; + + typedef enum dfd_cpld_addr { + CPLD_ADDR_MIN = 0x31, + BCM_CPLD0_ADDR = 0x32, /* pca9641 up */ + CPLD0_MAC0_ADDR = 0x33, /* SMBUS down */ + CPLD0_MAC1_ADDR = 0x34, + CPLD1_MAC0_ADDR = 0x35, + CPLD2_MAC1_ADDR = 0x36, + BCM_CPLD1_ADDR = 0x37, + CPLD_ADDR_MAX, +} dfd_cpld_addr_t; + +typedef struct dfd_dev_head_info_s { + uint8_t ver; /* The version number defined by the E2PROM file, the initial version is 0x01 */ + uint8_t flag; /* The new version of E2PROM is identified as 0x7E */ + uint8_t hw_ver; /* It consists of two parts: the main version number and the revised version */ + uint8_t type; /* Hardware type definition information */ + int16_t tlv_len; /* Effective data length (16 bits) */ +} dfd_dev_head_info_t; + +typedef enum dfd_intf_e{ + DFD_INTF_GET_FAN_HW_VERSION, + DFD_INTF_GET_FAN_STATUS, + DFD_INTF_GET_FAN_SPEED_LEVEL, + DFD_INTF_GET_FAN_SPEED, + DFD_INTF_GET_FAN_ATTRIBUTE, + DFD_INTF_GET_FAN_SN, + DFD_INTF_GET_FAN_TYPE, + DFD_INTF_SET_FAN_SPEED_LEVEL, + DFD_INTF_GET_FAN_SUB_NUM, + DFD_INTF_GET_FAN_FAIL_BITMAP, +}dfd_intf_t; + +typedef struct dfd_dev_tlv_info_s { + uint8_t type; /* the type of data */ + uint8_t len; /* the length of data */ + uint8_t data[0]; /* data */ +} dfd_dev_tlv_info_t; + +typedef enum dfd_dev_info_type_e { + DFD_DEV_INFO_TYPE_MAC = 1, + DFD_DEV_INFO_TYPE_NAME = 2, + DFD_DEV_INFO_TYPE_SN = 3, + DFD_DEV_INFO_TYPE_PWR_CONS = 4, + DFD_DEV_INFO_TYPE_HW_INFO = 5, + DFD_DEV_INFO_TYPE_DEV_TYPE = 6, +} dfd_dev_tlv_type_t; + +struct sfp_drivers_t{ + /* addr = sff present bitmap addr, index from 0 */ + void (*get_number) (unsigned int *number); + int (*get_port_start) (void); + int (*get_port_end) (void); + bool (*is_qsfp_port) (const unsigned int port_num); + bool (*get_present) (unsigned long *bitmap); + bool (*read_sfp_eeprom) (const unsigned int port, + const unsigned char addr, + const unsigned char offset, + const uint32_t count, char *buf); + bool (*write_sfp_eeprom) (const unsigned int port, + const unsigned char addr, + const unsigned char offset, + const unsigned char count, + const char *buf); + bool (*read_sysfs) (const unsigned int bus, + const unsigned char addr, + const unsigned char offset, + const uint32_t count, char *buf); + bool (*write_sysfs) (const unsigned int bus, + const unsigned char addr, + const unsigned char offset, + const unsigned char count, + const char *buf); + bool (*read_block_sysfs) (const unsigned int bus, + const unsigned char addr, + const unsigned char offset, + const uint32_t count, char *buf); +}; + +extern int debuglevel; +extern int dfd_cpld_read_chipid(int cpldid , uint32_t addr, int32_t size, unsigned char *buf); +extern int dfd_cpld_read(int32_t addr, uint8_t *val); +extern int dfd_cpld_write(int32_t addr, uint8_t val); + +extern s32 platform_i2c_smbus_read_byte_data(const struct i2c_client *client, u8 command); +extern s32 platform_i2c_smbus_read_i2c_block_data(const struct i2c_client *client, + u8 command, u8 length, u8 *values); +extern s32 platform_i2c_smbus_read_word_data(const struct i2c_client *client, u8 command); + +extern int sfp_drivers_register(struct sfp_drivers_t *drv); +extern int sfp_drivers_unregister(void); + +extern int sysfs_drivers_register(struct sfp_drivers_t *drv); +extern int sysfs_drivers_unregister(void); + +#define DBG_DEBUG(fmt, arg...) do { \ + if ( debuglevel > DBG_START && debuglevel < DBG_ERROR) { \ + printk(KERN_INFO "[DEBUG]:<%s, %d>:"fmt, __FUNCTION__, __LINE__, ##arg); \ + } else if ( debuglevel >= DBG_ERROR ) { \ + printk(KERN_ERR "[DEBUG]:<%s, %d>:"fmt, __FUNCTION__, __LINE__, ##arg); \ + } else { } \ +} while (0) + +#define DBG_INFO(fmt, arg...) do { \ + if ( debuglevel > DBG_KEY) { \ + printk(KERN_INFO "[INFO]:<%s, %d>:"fmt, __FUNCTION__, __LINE__, ##arg); \ + } \ + } while (0) + +#define DBG_ERROR(fmt, arg...) do { \ + if ( debuglevel > DBG_START) { \ + printk(KERN_ERR "[ERROR]:<%s, %d>:"fmt, __FUNCTION__, __LINE__, ##arg); \ + } \ + } while (0) + +#endif diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/modules/platform_common_module.c b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/platform_common_module.c new file mode 100644 index 000000000000..14fc1a1574c3 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/platform_common_module.c @@ -0,0 +1,210 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "platform.h" +#include "dfd_tlveeprom.h" + +#define PLATFORM_I2C_RETRY_TIMES 3 + +#define DFD_TLVEEPROM_I2C_BUS (0) +#define DFD_TLVEEPROM_I2C_ADDR (0x56) +#define DFD_E2PROM_MAX_LEN (256) +#define DFD_CARDTYPE_EXT_TLVLEN (4) + +#define PLATFORM_CARDTYPE_RETRY_CNT (10) +#define PLATFORM_CARDTYPE_RETRY_TIMES (1000) + +int debuglevel = 0; +module_param(debuglevel, int, S_IRUGO | S_IWUSR); + +static int dfd_my_type = 0; +module_param(dfd_my_type, int, S_IRUGO | S_IWUSR); + +int g_common_debug_error = 0; +module_param(g_common_debug_error, int, S_IRUGO | S_IWUSR); + +int g_common_debug_verbose = 0; +module_param(g_common_debug_verbose, int, S_IRUGO | S_IWUSR); + +uint32_t dfd_my_type_i2c_bus = 0; +module_param(dfd_my_type_i2c_bus, int, S_IRUGO | S_IWUSR); + +uint32_t dfd_my_type_i2c_addr = 0; +module_param(dfd_my_type_i2c_addr, int, S_IRUGO | S_IWUSR); + +#define WB_COMMON_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_common_debug_verbose) { \ + printk(KERN_ERR "[WB_COMMON][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_COMMON_DEBUG_ERROR(fmt, args...) do { \ + if (g_common_debug_error) { \ + printk(KERN_ERR "[WB_COMMON][ERROR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static int32_t dfd_i2c_read(char *dev, uint32_t addr, uint32_t offset_addr, unsigned char * +buf, int32_t size) +{ + struct file *fp; + mm_segment_t fs; + struct i2c_client client; + int i ,j ; + int rv; + s32 val_t; + + val_t = -1; + rv = 0; + fp = filp_open(dev, O_RDWR, S_IRUSR | S_IWUSR); + if (IS_ERR(fp)) { + DBG_ERROR("i2c open fail.\n"); + WB_COMMON_DEBUG_ERROR("i2c open fail.\n"); + return -1; + } + memcpy(&client, fp->private_data, sizeof(struct i2c_client)); + client.addr = addr; + fs = get_fs(); + set_fs(KERNEL_DS); + for (j = 0 ;j < size ;j++){ + for (i = 0; i < PLATFORM_I2C_RETRY_TIMES; i++) { + if ((val_t = i2c_smbus_read_byte_data(&client, (offset_addr + j))) < 0) { + DBG_DEBUG("read try(%d)time offset_addr:%x \n", i, offset_addr); + continue; + } else { + * (buf + j) = val_t; + break; + } + } + if (val_t < 0) { + rv = -1; + break; + } + } + filp_close(fp, NULL); + set_fs(fs); + return rv; +} + +static int dfd_tlvinfo_get_cardtype(void) +{ + char i2c_path[16] = {0}; + int ret; + int cardtype; + u_int8_t eeprom[DFD_E2PROM_MAX_LEN]; + dfd_i2c_dev_t i2c_dev; + uint8_t buf[DFD_CARDTYPE_EXT_TLVLEN]; + uint8_t len; + dfd_tlv_type_t tlv_type; + + if (dfd_my_type_i2c_bus != 0) { + i2c_dev.bus = dfd_my_type_i2c_bus; + } else { + i2c_dev.bus = DFD_TLVEEPROM_I2C_BUS; + } + + if (dfd_my_type_i2c_addr != 0) { + i2c_dev.addr = dfd_my_type_i2c_addr; + } else { + i2c_dev.addr = DFD_TLVEEPROM_I2C_ADDR; + } + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", i2c_dev.bus); + WB_COMMON_DEBUG_VERBOSE("Read device eeprom info:(dev:%s, addr:%02x).\n", i2c_path, i2c_dev.addr); + + ret = dfd_i2c_read(i2c_path, i2c_dev.addr, 0, eeprom, DFD_E2PROM_MAX_LEN); + if (ret != 0) { + DBG_ERROR("Read eeprom info error(dev: %s, addr: %02x).\n", i2c_path, i2c_dev.addr); + WB_COMMON_DEBUG_ERROR("Read eeprom info error(dev: %s, addr: %02x).\n", i2c_path, i2c_dev.addr); + return ret; + } + + tlv_type.main_type = TLV_CODE_VENDOR_EXT; + tlv_type.ext_type = DFD_TLVINFO_EXT_TLV_TYPE_DEV_TYPE; + len = sizeof(buf); + mem_clear(buf, len); + ret = dfd_tlvinfo_get_e2prom_info(eeprom, DFD_E2PROM_MAX_LEN, &tlv_type, buf, &len); + if (ret) { + DBG_ERROR("dfd_tlvinfo_get_e2prom_info failed ret %d.\n", ret); + return -1; + } + for (ret = 0; ret < 4; ret++) { + DBG_DEBUG("buf 0x%02x.\n", buf[ret]); + } + + cardtype = ntohl(*((uint32_t *)buf)); + DBG_DEBUG("cardtype 0x%x.\n", cardtype); + return cardtype; +} + +static int __dfd_get_my_card_type(void) +{ + return dfd_tlvinfo_get_cardtype(); +} + +/* Get its own card type */ +int dfd_get_my_card_type(void) +{ + int type; + int cnt; + + if (dfd_my_type != 0) { + DBG_DEBUG("my_type = 0x%x\r\n", dfd_my_type); + return dfd_my_type; + } + + cnt = PLATFORM_CARDTYPE_RETRY_CNT; + while (cnt--) { + type = __dfd_get_my_card_type(); + if (type < 0) { + WB_COMMON_DEBUG_ERROR("__dfd_get_my_card_type fail cnt %d, ret %d.\n", cnt, type); + msleep(PLATFORM_CARDTYPE_RETRY_TIMES); + continue; + } + WB_COMMON_DEBUG_VERBOSE("success to get type 0x%x.\n", type); + break; + } + + dfd_my_type = type; + return dfd_my_type; +} +EXPORT_SYMBOL(dfd_get_my_card_type); + +static int __init wb_common_init(void) +{ + int ret; + + WB_COMMON_DEBUG_VERBOSE("Enter.\n"); + ret = dfd_get_my_card_type(); + if (ret <= 0) { + WB_COMMON_DEBUG_ERROR("dfd_get_my_card_type failed, ret %d.\n", ret); + printk(KERN_ERR "Warning: Device type get failed, please check the TLV-EEPROM!\n"); + return -1; + } + + WB_COMMON_DEBUG_VERBOSE("Leave success type 0x%x.\n", ret); + return 0; +} + +static void __exit wb_common_exit(void) +{ + WB_COMMON_DEBUG_VERBOSE("Exit.\n"); +} + +module_init(wb_common_init); +module_exit(wb_common_exit); + +MODULE_DESCRIPTION("Platform Support"); +MODULE_AUTHOR("support "); +MODULE_LICENSE("GPL"); diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/modules/wb_platform.c b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/wb_platform.c new file mode 100644 index 000000000000..c7a976d45471 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/modules/wb_platform.c @@ -0,0 +1,79 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "platform.h" + +#define PLATFORM_I2C_RETRY_TIMES 3 + +s32 platform_i2c_smbus_read_byte_data(const struct i2c_client *client, u8 command) +{ + int try; + s32 ret; + + ret = -1; + for (try = 0; try < PLATFORM_I2C_RETRY_TIMES; try++) { + if ((ret = i2c_smbus_read_byte_data(client, command)) >= 0 ) + break; + } + return ret; + +} +EXPORT_SYMBOL(platform_i2c_smbus_read_byte_data); + +s32 platform_i2c_smbus_read_i2c_block_data(const struct i2c_client *client, + u8 command, u8 length, u8 *values) +{ + int try; + s32 ret; + + ret = -1; + for (try = 0; try < PLATFORM_I2C_RETRY_TIMES; try++) { + if ((ret = i2c_smbus_read_i2c_block_data(client, command, length, values)) >= 0 ) + break; + } + return ret; +} +EXPORT_SYMBOL(platform_i2c_smbus_read_i2c_block_data); + +s32 platform_i2c_smbus_read_word_data(const struct i2c_client *client, u8 command) +{ + int try; + s32 ret; + + ret = -1; + for (try = 0; try < PLATFORM_I2C_RETRY_TIMES; try++) { + if ((ret = i2c_smbus_read_word_data(client, command)) >= 0 ) + break; + } + return ret; +} +EXPORT_SYMBOL(platform_i2c_smbus_read_word_data); + +static int __init wb_platform_init(void) +{ + return 0; +} + +static void __exit wb_platform_exit(void) +{ + +} + +module_init(wb_platform_init); +module_exit(wb_platform_exit); + +MODULE_DESCRIPTION("Platform Support"); +MODULE_AUTHOR("support "); +MODULE_LICENSE("GPL"); diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/script/device_i2c.py b/platform/centec-arm64/sonic-platform-modules-micas/common/script/device_i2c.py new file mode 100644 index 000000000000..a3787f76bd7d --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/script/device_i2c.py @@ -0,0 +1,283 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- +import click +import os +import time +from platform_config import GLOBALCONFIG, GLOBALINITPARAM, GLOBALINITCOMMAND, MAC_LED_RESET, STARTMODULE, i2ccheck_params +from platform_util import wbpciwr, os_system + +CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) + +class AliasedGroup(click.Group): + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + elif len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + +def log_os_system(cmd): + u'''execute shell command''' + status, output = os_system(cmd) + if status: + print(output) + return status, output + +def write_sysfs_value(reg_name, value): + u'''write sysfs file''' + mb_reg_file = "/sys/bus/i2c/devices/" + reg_name + if (not os.path.isfile(mb_reg_file)): + print(mb_reg_file, 'not found !') + return False + try: + with open(mb_reg_file, 'w') as fd: + fd.write(value) + except Exception as error: + return False + return True + +def check_driver(): + u'''whether there is driver start with wb''' + status, output = log_os_system("lsmod | grep wb | wc -l") + #System execution error + if status: + return False + if output.isdigit() and int(output) > 0: + return True + else: + return False + +def get_pid(name): + ret = [] + for dirname in os.listdir('/proc'): + if dirname == 'curproc': + continue + try: + with open('/proc/{}/cmdline'.format(dirname), mode='r') as fd: + content = fd.read() + except Exception: + continue + if name in content: + ret.append(dirname) + return ret + +def start_avs_ctrl(): + if STARTMODULE.get("avscontrol", 0) == 1: + cmd = "nohup avscontrol.py start >/dev/null 2>&1 &" + rets = get_pid("avscontrol.py") + if len(rets) == 0: + log_os_system(cmd) + +def stop_avs_ctrl(): + if STARTMODULE.get('avscontrol', 0) == 1: + rets = get_pid("avscontrol.py") # + for ret in rets: + cmd = "kill "+ ret + log_os_system(cmd) + +def start_fan_ctrl(): + if STARTMODULE.get('fancontrol', 0) == 1: + cmd = "nohup fancontrol.py start >/dev/null 2>&1 &" + rets = get_pid("fancontrol.py") + if len(rets) == 0: + log_os_system(cmd) + +def stop_fan_ctrl(): + u'''disable fan timer service''' + if STARTMODULE.get('fancontrol', 0) == 1: + rets = get_pid("fancontrol.py") # + for ret in rets: + cmd = "kill "+ ret + log_os_system(cmd) + +def rm_dev(bus, loc): + cmd = "echo 0x%02x > /sys/bus/i2c/devices/i2c-%d/delete_device" % (loc, bus) + devpath = "/sys/bus/i2c/devices/%d-%04x"%(bus, loc) + if os.path.exists(devpath): + log_os_system(cmd) + +def add_dev(name, bus, loc): + if name == "lm75": + time.sleep(0.1) + pdevpath = "/sys/bus/i2c/devices/i2c-%d/" % (bus) + for i in range(1, 100):#wait for mother-bus generation, maximum wait time is 10s + if os.path.exists(pdevpath) == True: + break + time.sleep(0.1) + if i % 10 == 0: + click.echo("%%DEVICE_I2C-INIT: %s not found, wait 0.1 second ! i %d " % (pdevpath,i)) + + cmd = "echo %s 0x%02x > /sys/bus/i2c/devices/i2c-%d/new_device" % (name, loc, bus) + devpath = "/sys/bus/i2c/devices/%d-%04x"%(bus, loc) + if os.path.exists(devpath) == False: + log_os_system(cmd) + +def removedevs(): + devs = GLOBALCONFIG["DEVS"] + for index in range(len(devs)-1, -1, -1 ): + rm_dev(devs[index]["bus"] , devs[index]["loc"]) + +def adddevs(): + devs = GLOBALCONFIG["DEVS"] + for dev in range(0, devs.__len__()): + add_dev(devs[dev]["name"], devs[dev]["bus"] , devs[dev]["loc"]) + +def checksignaldriver(name): + modisexistcmd = "lsmod | grep %s | wc -l" % name + status, output = log_os_system(modisexistcmd) + #System execution error + if status: + return False + if output.isdigit() and int(output) > 0: + return True + else: + return False + +def adddriver(name, delay): + cmd = "modprobe %s" % name + if delay != 0: + time.sleep(delay) + if checksignaldriver(name) != True: + log_os_system(cmd) + +def removedriver(name, delay): + realname = name.lstrip().split(" ")[0]; + cmd = "rmmod -f %s" % realname + if checksignaldriver(realname): + log_os_system(cmd) + +def removedrivers(): + u'''remove all drivers''' + if GLOBALCONFIG is None: + click.echo("%%DEVICE_I2C-INIT: load global config failed.") + return + drivers = GLOBALCONFIG.get("DRIVERLISTS", None) + if drivers is None: + click.echo("%%DEVICE_I2C-INIT: load driver list failed.") + return + for index in range(len(drivers)-1, -1, -1 ): + delay = 0 + name = "" + if type(drivers[index]) == dict and "delay" in drivers[index]: + name = drivers[index].get("name") + delay = drivers[index]["delay"] + else: + name = drivers[index] + removedriver(name, delay) + +def adddrivers(): + u'''add drivers''' + if GLOBALCONFIG is None: + click.echo("%%DEVICE_I2C-INIT: load global config failed.") + return + drivers = GLOBALCONFIG.get("DRIVERLISTS", None) + if drivers is None: + click.echo("%%DEVICE_I2C-INIT: load driver list failed.") + return + for index in range(0 ,len(drivers)): + delay = 0 + name = "" + if type(drivers[index]) == dict and "delay" in drivers[index]: + name = drivers[index].get("name") + delay = drivers[index]["delay"] + else: + name = drivers[index] + adddriver(name, delay) + +def otherinit(): + for index in GLOBALINITPARAM: + delay = index.get('delay',0) + if delay !=0 : + time.sleep(1) + write_sysfs_value(index["loc"], index["value"]) + + for index in GLOBALINITCOMMAND: + log_os_system(index) + +def unload_driver(): + u'''remove devices and drivers''' + stop_avs_ctrl() # disable avs-control + stop_fan_ctrl() # disable fan-control service + removedevs() # remove other devices + removedrivers() # remove drivers + +def reload_driver(): + u'''reload devices and drivers''' + removedevs() # remove other devices + removedrivers() # remove drivers + time.sleep(1) + adddrivers() + adddevs() + + +def i2c_check(bus,retrytime = 6): + try: + i2cpath = "/sys/bus/i2c/devices/" + bus + while retrytime and not os.path.exists(i2cpath): + click.echo("%%DEVICE_I2C-HA: i2c bus abnormal, last bus %s is not exist." % i2cpath) + reload_driver() + retrytime -= 1 + time.sleep(1) + except Exception as e: + click.echo("%%DEVICE_I2C-HA: %s" % str(e)) + return + +def set_mac_leds(data): + '''write pci register''' + pcibus = MAC_LED_RESET.get("pcibus") + slot = MAC_LED_RESET.get("slot") + fn = MAC_LED_RESET.get("fn") + bar = MAC_LED_RESET.get("bar") + offset = MAC_LED_RESET.get("offset") + val = MAC_LED_RESET.get(data, None) + if val is None: + click.echo("%%DEVICE_I2C-INIT: set_mac_leds wrong input") + return + wbpciwr(pcibus, slot, fn, bar, offset, val) + +def load_driver(): + u'''load devices and drivers''' + adddrivers() + adddevs() + if STARTMODULE.get("i2ccheck",0) == 1: #i2c HA + busend = i2ccheck_params.get("busend") + retrytime = i2ccheck_params.get("retrytime") + i2c_check(busend,retrytime) + start_fan_ctrl() # enable fan + start_avs_ctrl() # avs voltage-adjustment + otherinit(); # other initialization, QSFP initialization + if STARTMODULE.get("macledreset", 0) == 1: + set_mac_leds("reset") + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''device operator''' + pass + + +@main.command() +def start(): + '''load device ''' + if check_driver(): + unload_driver() + load_driver() + +@main.command() +def stop(): + '''stop device ''' + unload_driver() + +@main.command() +def restart(): + '''restart device''' + unload_driver() + load_driver() + +if __name__ == '__main__': + u'''device_i2c operation''' + main() diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/script/fancontrol.py b/platform/centec-arm64/sonic-platform-modules-micas/common/script/fancontrol.py new file mode 100755 index 000000000000..dbd2767abca9 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/script/fancontrol.py @@ -0,0 +1,495 @@ +#!/usr/bin/env python3.9 +# -*- coding: UTF-8 -*- +import click +import os +import time +import json +import traceback +from interface import Interface +import logging.handlers +from platform_util import CompressedRotatingFileHandler + +CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) + +FILE_NAME = "/var/log/fancontrol.log" +MAX_LOG_BYTES = 20*1024*1024 +BACKUP_COUNT = 9 + +logger = logging.getLogger("fancontrol") +logger.setLevel(logging.DEBUG) +fanctrl_log = CompressedRotatingFileHandler(FILE_NAME, mode='a', maxBytes=MAX_LOG_BYTES, backupCount=BACKUP_COUNT, encoding=None, delay=0) +formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s") +fanctrl_log.setFormatter(formatter) +logger.addHandler(fanctrl_log) + +DEBUG_FILE = "/etc/fancontrol_debug" +FAN_CTRL_CFG_FILE = "/usr/local/bin/fan_ctrl_cfg.json" +KEY_THERMAL = "Thermal" +KEY_FAN = "Fans" +KEY_PID = "PID" +KEY_OPEN_LOOP = "OpenLoop" +KEY_DEVICE = "Device" +KEY_FAN_ERROR = "FanError" + +KEY_FANERROR_PWM_MAX = "Fan_Pwmmax" + +KEY_INLET_TEMP = "INLET_TEMP" +KEY_OUTLET_TEMP = "OUTLET_TEMP" +KEY_SWITCH_TEMP = "SWITCH_TEMP" +KEY_TEMP = [KEY_INLET_TEMP, KEY_OUTLET_TEMP, KEY_SWITCH_TEMP] + +KEY_PID_PWM_MAX = "Pwm_Max" +KEY_PID_PWM_MIN = "Pwm_Min" +KEY_PID_SETPOINT = "SetPoint" +KEY_PID_P = "P" +KEY_PID_I = "I" +KEY_PID_D = "D" +KEY_PID_TEMP_MIN = "Temp_Min" +KEY_PID_TEMP_MAX = "Temp_Max" + +KEY_OPENLOOP_A = "a" +KEY_OPENLOOP_B = "b" +KEY_OPENLOOP_C = "c" +KEY_OPENLOOP_FIXUP = "fix_up" +KEY_OPENLOOP_PWM_MAX = "pwmMax" +KEY_OPENLOOP_PWM_MIN = "pwmMin" +KEY_OPENLOOP_TEMP_MIN = "tempMin" + +STATUS_HIGH_CRIT = 1 +STATUS_MISS_CRIT = 2 +STATUS_BAD_FAN = 4 +STATUS_LOW_FAN = 8 +STATUS_MISS_ERR = 16 + +class AliasedGroup(click.Group): + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + elif len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + +def fanctrl_debug_log(s): + # s = s.decode('utf-8').encode('gb2312') + if os.path.isfile(DEBUG_FILE): + logger.debug(s) + +class OpenLoop(): + def __init__(self): + self.a = 0 + self.b = 0 + self.c = 0 + self.fix_up = 0 + self.pwmMax = 0 + self.pwmMin = 0 + self.temp = 0 + self.tempMin = 0 + + def calcPwm(self): + if self.temp < self.tempMin: + return self.pwmMin + pwm = self.a * self.temp * self.temp + self.b * self.temp + self.c + pwm = (pwm / 2.56) + pwm = min(pwm, self.pwmMax) + pwm = max(pwm, self.pwmMin) + return pwm + + +class FanPid(): + def __init__(self): + self.pwmMin = 30 + self.pwmMax = 100 + self.SetPoint = 89 + self.D = 0.196 + self.I = 0.196 + self.P = 1.176 + self.tempMin = 28.0 + self.tempMax = 45.0 + self.pwms = [30, 30] + self.temps = [-1, -1, -1] + self.last_temp = -1 + self.sensor = KEY_SWITCH_TEMP + + def calcPwm(self): + temp_delta = self.temps[2] - self.last_temp + temp_sp_delta = self.temps[2] - self.SetPoint + temp_last_delta = ((self.temps[2] - self.temps[1]) - (self.temps[1] - self.temps[0])) + + delta_pwm = self.P * temp_delta + self.I * temp_sp_delta + self.D * temp_last_delta + + self.temps[0] = self.temps[1] + self.temps[1] = self.temps[2] + self.last_temp = self.temps[2] + + self.pwms[0] = self.pwms[1] + self.pwms[1] = self.pwms[0] + delta_pwm + self.pwms[1] = max(self.pwms[1], self.pwmMin) + self.pwms[1] = min(self.pwms[1], self.pwmMax) + + return self.pwms[1] + +class FanControl(): + + def __init__(self): + self.status = 0 + self.fan_status = 0 + self.error_time = 0 + self.low_time = 0 + self.fan_pwm = 40 + self.fanerr_pwmmax = 0 + self.interface = Interface() + self.temps = {} + self.tempsMax = {} + self.tempsMin = {} + self.tempStatus = {} + self.tempCritTime = {} + self.tempMissTime = {} + + self.fans = {} + self.fanStatus = {} + self.fanErrTime = {} + self.fanLowTime = {} + + self.fanPid = None + self.openloop = None + + self.isBuildin = 0 + self.isLiquid = 0 + self.eeproms = {} + self.airflow = "" + self.pid_switch = 1 + self.openloop_switch = 1 + + def doGetAirFlow(self): + if self.isLiquid == 1: + return "Liquid" + # PSU and Fan is buildin using Tlve2 + if self.isBuildin == 1: + productName = self.interface.get_productname() + if productName != "": + tmp = productName.split("-") + fanairflow = tmp[-1] + if fanairflow == "R": + return "exhaust" + else: + return "intake" + elif self.isBuildin == 0: + return self.interface.get_airflow() + + return "" + + def doFanCtrlInit(self): + if os.path.isfile(FAN_CTRL_CFG_FILE): + fh = open(FAN_CTRL_CFG_FILE) + if not fh: + logger.error("Config file %s doesn't exist" % FAN_CTRL_CFG_FILE) + return False + cfg_json = json.load(fh) + if not cfg_json: + logger.error('Load config file %s failed' % FAN_CTRL_CFG_FILE) + fh.close() + return False + + cfg_keys = [KEY_THERMAL, KEY_FAN, KEY_PID, KEY_OPEN_LOOP, KEY_DEVICE, KEY_FAN_ERROR] + for key in cfg_keys: + if key not in cfg_json: + logger.error('Key %s not present in cfg file' % key) + return False + thermal_json = cfg_json[KEY_THERMAL] + fan_json = cfg_json[KEY_FAN] + pid_json = cfg_json[KEY_PID] + openloop_json = cfg_json[KEY_OPEN_LOOP] + device_json = cfg_json[KEY_DEVICE] + fan_error_json = cfg_json[KEY_FAN_ERROR] + + #init fanerror + self.fanerr_pwmmax = fan_error_json["Fan_Pwmmax"] + + # Get Airflow + self.isBuildin = device_json["Buildin"] + self.isLiquid = device_json["Liquid"] + self.airflow = self.doGetAirFlow() + if self.airflow == "": + logger.warning("Cannot get airflow from device!") + self.pid_switch = device_json["PID"] + self.openloop_switch = device_json["OpenLoop"] + if self.pid_switch == 0 and self.openloop_switch == 0: + logger.warning("No PID and OpenLoop found!") + # Init openloop + self.openloop = OpenLoop() + self.openloop.a = openloop_json[KEY_OPENLOOP_A] + self.openloop.b = openloop_json[KEY_OPENLOOP_B] + self.openloop.c = openloop_json[KEY_OPENLOOP_C] + self.openloop.fix_up = openloop_json[KEY_OPENLOOP_FIXUP] + self.openloop.pwmMax = openloop_json[KEY_OPENLOOP_PWM_MAX] + self.openloop.pwmMin = openloop_json[KEY_OPENLOOP_PWM_MIN] + self.openloop.tempMin = openloop_json[KEY_OPENLOOP_TEMP_MIN] + # Init PID + self.fanPid = FanPid() + self.fanPid.pwmMax = pid_json[KEY_PID_PWM_MAX] + self.fanPid.pwmMin = pid_json[KEY_PID_PWM_MIN] + self.fanPid.SetPoint = pid_json[KEY_PID_SETPOINT] + self.fanPid.P = pid_json[KEY_PID_P] + self.fanPid.I = pid_json[KEY_PID_I] + self.fanPid.D = pid_json[KEY_PID_D] + self.fanPid.tempMin = pid_json[KEY_PID_TEMP_MIN] + self.fanPid.tempMax = pid_json[KEY_PID_TEMP_MAX] + # Init thermal setting + for key, item in list(thermal_json.items()): + fanctrl_debug_log("%s %s " % (key,item)) + if key not in KEY_TEMP: + logger.error('Key %s not present in cfg file' % key) + return False + self.temps[item] = -1.0 + self.tempsMax[item] = self.interface.get_thermal_temp_max(item) + self.tempsMin[item] = self.interface.get_thermal_temp_min(item) + self.tempStatus[item] = 0 + self.tempMissTime[item] = [0, 0] + self.tempCritTime[item] = [0, 0] + if key == self.fanPid.sensor: + self.fanPid.sensor = item + + # Init fans setting + for key, item in list(fan_json.items()): + self.fans[key] = item + self.fanStatus[key] = 0 + self.fanErrTime[key] = [0, 0] + self.fanLowTime[key] = [0, 0] + fh.close() + else: + logger.error('%s is not a file' % FAN_CTRL_CFG_FILE) + return False + + fanctrl_debug_log("Device AirFlow: %s" % (self.airflow)) + self.updateThermal() + self.fanPid.last_temp = self.temps[self.fanPid.sensor] + for i in range(3): + self.fanPid.temps[i] = self.temps[self.fanPid.sensor] + return True + + def setFanSpeed(self, speed): + return self.interface.set_fan_speed_pwm(speed) + + def updateThermal(self): + for key in self.temps: + self.temps[key] = self.interface.get_thermal_temp(key) + fanctrl_debug_log("%s temps %d C" % (key, self.temps[key])) + + if self.temps[KEY_INLET_TEMP] >= self.tempsMax[KEY_INLET_TEMP] or self.temps[KEY_INLET_TEMP] <= -99999: + self.temps[KEY_INLET_TEMP] = self.tempsMax[KEY_INLET_TEMP] + self.openloop.temp = self.temps[KEY_INLET_TEMP] + self.fanPid.temps[2] = self.temps[KEY_INLET_TEMP] + + def checkThermal(self): + thermal_cnt = 0 + for key in self.temps: + if self.temps[key] <= -9999: + if self.tempStatus[key] & STATUS_MISS_CRIT != 0: + self.tempMissTime[key][0] = time.time() + else: + self.tempMissTime[key][1] = time.time() + self.tempStatus[key] = self.tempStatus[key] | STATUS_MISS_CRIT + if self.tempMissTime[key][1] - self.tempMissTime[key][0] > 15: + logger.warning("%s Read Invaild Temperautre %d " % (key, self.temps[key])) + self.tempStatus[key] = self.tempStatus[key] | STATUS_MISS_ERR + else: + self.tempStatus[key] = self.tempStatus[key] & ~(STATUS_MISS_CRIT | STATUS_MISS_ERR) + + if self.temps[key] >= self.tempsMax[key]: + self.tempCritTime[key][0] = time.time() + self.tempStatus[key] = self.tempStatus[key] | STATUS_HIGH_CRIT + logger.warning("%s Temperautre %d >= High Threshold %d" % (key, self.temps[key], self.tempsMax[key])) + elif self.tempStatus[key] & (STATUS_HIGH_CRIT) != 0: + self.tempCritTime[key][1] = time.time() + logger.warning("%s Temperautre %d Recovery" % (key, self.temps[key])) + if self.tempCritTime[key][1] - self.tempCritTime[key][0] > 300: + self.tempStatus[key] = self.tempStatus[key] & ~(STATUS_HIGH_CRIT) + + if self.tempStatus[key] & ~(STATUS_MISS_CRIT) != 0: + thermal_cnt = thermal_cnt + 1 + + self.status = thermal_cnt + fanctrl_debug_log("Thermal error num %d" % self.status) + + def checkFanSpeed(self): + fan_error_cnt = 0 + for key, item in list(self.fans.items()): + speed = self.interface.get_fan_speed_rpm(item) + rpm_max = self.interface.get_fan_rpm_max() + if self.fan_pwm == 100 and speed < rpm_max * 0.7: + if self.fanStatus[key] & STATUS_BAD_FAN != 0: + self.fanErrTime[key][0] = time.time() + else: + self.fanErrTime[key][1] = time.time() + + self.fanStatus[key] = self.fanStatus[key] | STATUS_BAD_FAN + if self.fanErrTime[key][1] - self.fanErrTime[key][0] >= 30: + logger.warning("%s PWM is %d but Speed %d <= %d RPM" % (item, self.fan_pwm, speed, rpm_max * 0.7)) + else: + self.fanStatus[key] = self.fanStatus[key] & ~(STATUS_BAD_FAN) + + if speed < 1000: + if self.fanStatus[key] & STATUS_LOW_FAN != 0: + self.fanLowTime[key][0] = time.time() + else: + self.fanLowTime[key][1] = time.time() + self.fanStatus[key] = self.fanStatus[key] | STATUS_LOW_FAN + if self.fanLowTime[key][1] - self.fanLowTime[key][0] > 30: + logger.warning("%s Speed %d <= %d RPM" % (item, speed, 1000)) + else: + self.fanStatus[key] = self.fanStatus[key] & ~(STATUS_LOW_FAN) + + fanctrl_debug_log("%s speed %d RPM" % (key, speed)) + + if self.fanStatus[key] != 0: + fan_error_cnt = fan_error_cnt + 1 + self.fan_status = fan_error_cnt + fanctrl_debug_log("Fan error num %d" % fan_error_cnt) + + def doApplyPolicy(self): + if self.isLiquid == 1: + return + + self.fan_pwm = 0 + if self.openloop_switch == 1: + openloop_pwm = int(self.openloop.calcPwm()) + fanctrl_debug_log("OpenLoop pwm %d" % (openloop_pwm)) + self.fan_pwm = max(self.fan_pwm, openloop_pwm) + + if self.pid_switch == 1: + pid_pwm = int(self.fanPid.calcPwm()) + fanctrl_debug_log("PID pwm %d" % (pid_pwm)) + self.fan_pwm = max(self.fan_pwm, pid_pwm) + + # Check fan presence + if self.interface.get_fan_presence() == False: + logger.warning("Fan presence check false, set fan pwm to 100") + self.fan_pwm = self.fanerr_pwmmax + if self.fan_status != 0 or self.status != 0: + self.fan_pwm = self.fanerr_pwmmax + fanctrl_debug_log("Fan Speed set to %d pwm" % self.fan_pwm) + for i in range(3): + ret = self.setFanSpeed(self.fan_pwm) + if ret == False: + logger.warning("Fan speed set %d pwm failed, retry %d times" % (self.fan_pwm, i + 1)) + continue + break + + def doBoardFanLedCtrl(self): + if self.interface.get_fan_status() != False and self.interface.get_fan_presence() != False and self.fan_status == 0: + fanctrl_debug_log("Fan status good setting LED to green") + self.interface.set_fan_board_led("green") + else: + fanctrl_debug_log("Fan status error setting LED to red") + self.interface.set_fan_board_led("red") + + def doBoardPsuLedCtrl(self): + if self.interface.get_psu_status() != False: + fanctrl_debug_log("PSU status good setting LED to green") + self.interface.set_psu_board_led("green") + else: + fanctrl_debug_log("PSU status error setting LED to red") + self.interface.set_psu_board_led("red") + + def doSysLedCtrl(self): + self.interface.set_sysled("green") + +def run(interval, fanCtrol): + loop = 0 + # waitForDocker() + fanCtrol.setFanSpeed(fanCtrol.fan_pwm) #init set fan speed to 50 pwm + fanCtrol.doFanCtrlInit() + if fanCtrol.airflow == "Liquid": + logger.warning('Liquid device stopping fancontrol') + return True + while True: + try: + if loop % 5 == 0: # Fan speed control + try: + fanCtrol.updateThermal() + except Exception as e: + logger.error('Failed: Update Thermal, %s' % str(e)) + logger.error('%s' % traceback.format_exc()) + time.sleep(3) + continue + + try: + fanCtrol.checkThermal() + except Exception as e: + logger.error('Failed: Check Thermal, %s' % str(e)) + logger.error('%s' % traceback.format_exc()) + time.sleep(3) + continue + + try: + fanCtrol.checkFanSpeed() + except Exception as e: + logger.error('Failed: Check Fan Speed, %s' % str(e)) + logger.error('%s' % traceback.format_exc()) + time.sleep(3) + continue + + try: + fanCtrol.doApplyPolicy() + except Exception as e: + logger.error('Failed: Apply Policy, %s' % str(e)) + logger.error('%s' % traceback.format_exc()) + time.sleep(3) + continue + + try: + fanCtrol.doBoardFanLedCtrl() + except Exception as e: + logger.error('Failed: Led Control, %s' % str(e)) + logger.error('%s' % traceback.format_exc()) + time.sleep(3) + continue + + try: + fanCtrol.doBoardPsuLedCtrl() + except Exception as e: + logger.error('Failed: Led Control, %s' % str(e)) + logger.error('%s' % traceback.format_exc()) + time.sleep(3) + continue + + try: + fanCtrol.doSysLedCtrl() + except Exception as e: + logger.error('Failed: Led Control, %s' % str(e)) + logger.error('%s' % traceback.format_exc()) + time.sleep(3) + continue + + time.sleep(interval) + loop += interval + except Exception as e: + traceback.print_exc() + logger.error(str(e)) + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''device operator''' + pass + +@main.command() +def start(): + '''start fan control''' + logger.info("FANCTROL start") + fanCtrol = FanControl() + interval = 1 + run(interval, fanCtrol) + +@main.command() +def stop(): + '''stop fan control ''' + logger.info("FANCTROL stop") + +# device_i2c operation +if __name__ == '__main__': + main() diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/script/interface.py b/platform/centec-arm64/sonic-platform-modules-micas/common/script/interface.py new file mode 100644 index 000000000000..140e09ec084b --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/script/interface.py @@ -0,0 +1,77 @@ +from sonic_platform.chassis import Chassis + +class Interface(): + def __init__(self): + self.chassis = Chassis() + self.fan_list = self.chassis._fan_list + self.thermal_list = self.chassis._thermal_list + self.psu_list = self.chassis._psu_list + # Device + def get_productname(self): + return self.chassis.get_name() + + def set_sysled(self, color): + return self.thermal_list[0].set_sys_led(color) + + # Thermal + def get_thermal_temp_max(self, name): + for thermal in self.thermal_list: + if name == thermal.get_real_name(): + return thermal.get_high_threshold() + + def get_thermal_temp_min(self, name): + for thermal in self.thermal_list: + if name == thermal.get_real_name(): + return thermal.get_low_threshold() + + def get_thermal_temp(self, name): + for thermal in self.thermal_list: + if name == thermal.get_real_name(): + return thermal.get_temperature() + # Fans + def set_fan_speed_pwm(self, speed): + return self.fan_list[0].set_speed_pwm(speed) + + def get_fan_status(self): + for fan in self.fan_list: + if fan.get_status() == False: + return False + return True + + def get_fan_presence(self): + for fan in self.fan_list: + if fan.get_presence() == False: + return False + return True + + def set_fan_board_led(self, color): + return self.fan_list[0].set_status_led(color) + + def get_fan_speed_rpm(self, name): + for fan in self.fan_list: + if name == fan.get_name(): + return fan.get_speed_rpm() + return 0 + + def get_fan_rpm_max(self): + return self.fan_list[0].get_high_critical_threshold() + + def get_airflow(self): + tmp1 = self.fan_list[0].get_direction() + tmp2 = self.fan_list[0].get_direction() + for fan in self.fan_list: + tmp1 = fan.get_direction() + if tmp1 != tmp2: + return "F2B" + tmp2 = tmp1 + return tmp2 + # Psus + def get_psu_status(self): + for psu in self.psu_list: + if psu.get_powergood_status == False: + return False + return True + + def set_psu_board_led(self, color): + return self.psu_list[0].set_status_led(color) + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_common.py b/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_common.py new file mode 100644 index 000000000000..48bfe59fb448 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_common.py @@ -0,0 +1,1303 @@ +#!/usr/bin/python3 +################################driver-load-adaption####################################################### +# need to export interface +################################################################################################### + +__all__ = [ + "fancontrol_loc", + "fancontrol_config_loc", + "GLOBALCONFIG", + "MONITOR_CONST", + "PLATFORM_PART_NUMBER", + "PLATFORM_LABEL_REVISION", + "PLATFORM_ONIE_VERSION", + "PLATFORM_MAC_SIZE", + "PLATFORM_MANUF_NAME", + "PLATFORM_MANUF_COUNTRY", + "PLATFORM_VENDOR_NAME", + "PLATFORM_DIAG_VERSION", + "PLATFORM_SERVICE_TAG", + "DEV_LEDS", + "MEM_SLOTS", + "LOCAL_LED_CONTROL", + "FIRMWARE_TOOLS", + "STARTMODULE", + "i2ccheck_params", + "FANS_DEF", + "factest_module", + "MONITOR_TEMP_MIN", + "MONITOR_K", + "MONITOR_MAC_IN", + "MONITOR_DEFAULT_SPEED", + "MONITOR_MAX_SPEED", + "MONITOR_MIN_SPEED", + "MONITOR_MAC_ERROR_SPEED", + "MONITOR_FAN_TOTAL_NUM", + "MONITOR_MAC_UP_TEMP", + "MONITOR_MAC_LOWER_TEMP", + "MONITOR_MAC_MAX_TEMP", + "MONITOR_FALL_TEMP", + "MONITOR_MAC_WARNING_THRESHOLD", + "MONITOR_OUTTEMP_WARNING_THRESHOLD", + "MONITOR_BOARDTEMP_WARNING_THRESHOLD", + "MONITOR_CPUTEMP_WARNING_THRESHOLD", + "MONITOR_INTEMP_WARNING_THRESHOLD", + "MONITOR_MAC_CRITICAL_THRESHOLD", + "MONITOR_OUTTEMP_CRITICAL_THRESHOLD", + "MONITOR_BOARDTEMP_CRITICAL_THRESHOLD", + "MONITOR_CPUTEMP_CRITICAL_THRESHOLD", + "MONITOR_INTEMP_CRITICAL_THRESHOLD", + "MONITOR_CRITICAL_NUM", + "MONITOR_SHAKE_TIME", + "MONITOR_INTERVAL", + "MONITOR_MAC_SOURCE_SYSFS", + "MONITOR_MAC_SOURCE_PATH", + "MAC_AVS_PARAM", + "MAC_DEFAULT_PARAM", + "MONITOR_SYS_LED", + "MONITOR_SYS_FAN_LED", + "MONITOR_FANS_LED", + "MONITOR_SYS_PSU_LED", + "MONITOR_FAN_STATUS", + "MONITOR_PSU_STATUS", + "MONITOR_DEV_STATUS", + "MONITOR_DEV_STATUS_DECODE", + "DEV_MONITOR_PARAM", + "SLOT_MONITOR_PARAM", + "fanloc", + "PCA9548START", + "PCA9548BUSEND", + "PLATFORM_CARDID", + "PLATFORM_PRODUCTNAME", + "FAN_PROTECT", + "wb_eeprom", + "E2_LOC", + "E2_PROTECT", + "MAC_LED_RESET", + "INIT_PARAM", + "INIT_COMMAND", + "CPLDVERSIONS", + "DRIVERLISTS", + "DEVICE", + "E2TYPE", + "FRULISTS", + "fanlevel_6510", + "fanlevel_6520", + "fanlevel", + "TEMPIDCHANGE", + "FACTESTMODULE", + "item1", + "test_sys_reload_item", + "test_sys_item", + "test_temp_item", + "test_mem_item", + "test_hd_item", + "test_rtc_item", + "test_i2c_item", + "test_cpld_item", + "test_portframe_item", + "test_sysled_item", + "test_fan_item", + "test_power_item", + "test_usb_item", + "test_prbs_item", + "test_portbroadcast_item", + "test_debug_level", + "test_log_level", + "test_setmac", + "test_setrtc", + "log_level_critical", + "log_level_debug", + "log_level_error", + "log_level_info", + "log_level_notset", + "log_level_warning", + "test_e2_setmac_item", + "test_bmc_setmac_item", + "test_fan_setmac_item", + "alltest", + "looptest", + "menuList", + "TESTCASE", + "PCIe_DEV_LIST", + "PCIe_SPEED_ITEM", +] + +fancontrol_loc = "/usr/local/bin" +fancontrol_config_loc = "/usr/local/bin" + +GLOBALCONFIG = "GLOBALCONFIG" +MONITOR_CONST = "MONITOR_CONST" + +PLATFORM_CARDID = 0x00004065 +PLATFORM_PRODUCTNAME = "M2-W6010-48GT4X" +PLATFORM_PART_NUMBER = "01016994" +PLATFORM_LABEL_REVISION = "R01" +PLATFORM_ONIE_VERSION = "2018.05-rc1" +PLATFORM_MAC_SIZE = 3 +PLATFORM_MANUF_NAME = "Micas" +PLATFORM_MANUF_COUNTRY = "USA" +PLATFORM_VENDOR_NAME = "Micas" +PLATFORM_DIAG_VERSION = "0.1.0.15" +PLATFORM_SERVICE_TAG = "www.micasnetworks.com" + +DEV_LEDS = {} +MEM_SLOTS = [] + +LOCAL_LED_CONTROL = {"CLOSE": {}, "OPEN": {}} + +FIRMWARE_TOOLS = {} +# start-up module +STARTMODULE = {"fancontrol": 1, "avscontrol": 1} + +i2ccheck_params = {"busend": "i2c-66", "retrytime": 6} + +################################################################################################### +##### fan board ID reference +################################################################################################### +FANS_DEF = { + 0x8100: "M6500-FAN-F", + 0x8101: "M6510-FAN-F", + 0x8102: "M6520-FAN-F", + 0x8103: "M6510-FAN-R", +} + +factest_module = { + "sysinfo_showfanmsg": 1, + "sysinfo_showPsumsg": 1, + "sysinfo_showrestfanmsg": 0, + "sysinfo_showrestpsumsg": 0, +} + +#################fan adjustment parameters ############################## +MONITOR_TEMP_MIN = 38 # temperature before speed-adjustment +MONITOR_K = 11 # adjustment algorithm +MONITOR_MAC_IN = 35 # temperature difference between mac and chip(backup) +MONITOR_DEFAULT_SPEED = 0x60 # default speed +MONITOR_MAX_SPEED = 0xFF # maximum speed +MONITOR_MIN_SPEED = 0x33 # minimum speed +MONITOR_MAC_ERROR_SPEED = 0xBB # MAC abnormal speed +MONITOR_FAN_TOTAL_NUM = 4 # 3+1 redundancy design, report to syslog if there is a error +MONITOR_MAC_UP_TEMP = 50 # MAC compared with inlet up +MONITOR_MAC_LOWER_TEMP = -50 # MAC compared with outlet down +MONITOR_MAC_MAX_TEMP = 100 # + +MONITOR_FALL_TEMP = 4 # adjustment reduced temperature +MONITOR_MAC_WARNING_THRESHOLD = 100 # 100 +MONITOR_OUTTEMP_WARNING_THRESHOLD = 85 +MONITOR_BOARDTEMP_WARNING_THRESHOLD = 85 +MONITOR_CPUTEMP_WARNING_THRESHOLD = 85 +MONITOR_INTEMP_WARNING_THRESHOLD = 70 # 70 + +MONITOR_MAC_CRITICAL_THRESHOLD = 105 # 105 +MONITOR_OUTTEMP_CRITICAL_THRESHOLD = 90 # 90 +MONITOR_BOARDTEMP_CRITICAL_THRESHOLD = 90 # 90 +MONITOR_CPUTEMP_CRITICAL_THRESHOLD = 100 # 100 +MONITOR_INTEMP_CRITICAL_THRESHOLD = 80 # 80 +MONITOR_CRITICAL_NUM = 3 # retry times +MONITOR_SHAKE_TIME = 20 # anti-shake times +MONITOR_INTERVAL = 60 + +# 1 get mac temperature from sysfs ,0 get mac temperature from bcmcmd +MONITOR_MAC_SOURCE_SYSFS = (0) +MONITOR_MAC_SOURCE_PATH = None # sysfs path + + +# default MAC AVS parameters +MAC_AVS_PARAM = { + 0x72: 0x0384, + 0x73: 0x037E, + 0x74: 0x0378, + 0x75: 0x0372, + 0x76: 0x036B, + 0x77: 0x0365, + 0x78: 0x035F, + 0x79: 0x0359, + 0x7A: 0x0352, + 0x7B: 0x034C, + 0x7C: 0x0346, + 0x7D: 0x0340, + 0x7E: 0x0339, + 0x7F: 0x0333, + 0x80: 0x032D, + 0x81: 0x0327, + 0x82: 0x0320, + 0x83: 0x031A, + 0x84: 0x0314, + 0x85: 0x030E, + 0x86: 0x0307, + 0x87: 0x0301, + 0x88: 0x02FB, + 0x89: 0x02F5, + 0x8A: 0x02EE, +} + +# default 6520 configuration +MAC_DEFAULT_PARAM = { + "type": 1, # type 1 represents default if out of range / 0 represents no voltage-adjustment if out of range + "default": 0x74, # should be used with type + "loopaddr": 0x00, # AVS loop address + "loop": 0x00, # AVS loop value + "open": 0x00, # diasble write-protection value + "close": 0x40, # enable write-protection value + "bus": 2, # AVSI2C bus address + "devno": 0x60, # AVS address + "addr": 0x21, # AVS voltage-adjustment address + "protectaddr": 0x10, # AVS write-protection address + "sdkreg": "DMU_PCU_OTP_CONFIG_8", # SDK register name + "sdktype": 1, # type 0 represents no shift operation / 1 represents shift operation + "macregloc": 24, # shift operation + "mask": 0xFF, # mask after shift +} + +MONITOR_SYS_LED = [ + {"bus": 2, "devno": 0x33, "addr": 0xB2, "yellow": 0x06, "red": 0x02, "green": 0x04}, + {"bus": 2, "devno": 0x32, "addr": 0x72, "yellow": 0x06, "red": 0x02, "green": 0x04}, +] + +MONITOR_SYS_FAN_LED = [ + {"bus": 2, "devno": 0x33, "addr": 0xB4, "yellow": 0x06, "red": 0x02, "green": 0x04}, +] + +MONITOR_FANS_LED = [ + {"bus": 2, "devno": 0x32, "addr": 0x23, "green": 0x09, "red": 0x0A}, + {"bus": 2, "devno": 0x32, "addr": 0x24, "green": 0x09, "red": 0x0A}, + {"bus": 2, "devno": 0x32, "addr": 0x25, "green": 0x09, "red": 0x0A}, + {"bus": 2, "devno": 0x32, "addr": 0x26, "green": 0x09, "red": 0x0A}, +] + + +MONITOR_SYS_PSU_LED = [ + {"bus": 2, "devno": 0x33, "addr": 0xB3, "yellow": 0x06, "red": 0x02, "green": 0x04}, +] + +MONITOR_FAN_STATUS = [ + {"status": "green", "minOkNum": 4, "maxOkNum": 4}, + {"status": "yellow", "minOkNum": 3, "maxOkNum": 3}, + {"status": "red", "minOkNum": 0, "maxOkNum": 2}, +] + +MONITOR_PSU_STATUS = [ + {"status": "green", "minOkNum": 2, "maxOkNum": 2}, + {"status": "yellow", "minOkNum": 1, "maxOkNum": 1}, + {"status": "red", "minOkNum": 0, "maxOkNum": 0}, +] + +MONITOR_DEV_STATUS = {} +MONITOR_DEV_STATUS_DECODE = {} +DEV_MONITOR_PARAM = {} +SLOT_MONITOR_PARAM = {} + + +fanloc = {"name": "fanset", "location": "0-0032/fan_speed_set"} +#####################MAC-Voltage-Adjustment-Parameters#################################### + + +####================================Adaption-Area================================ +#### PLATFORM_COMMON common configuration head +#### "platform" specific configuration head +#### +PCA9548START = 11 +PCA9548BUSEND = 74 + +PLATFORM_CARDID = 0x00004040 + +FAN_PROTECT = {"bus": 0, "devno": 0x32, "addr": 0x19, "open": 0x00, "close": 0x0F} +wb_eeprom = "2-0057/eeprom" +E2_LOC = {"bus": 2, "devno": 0x57} +E2_PROTECT = {"bus": 2, "devno": 0x33, "addr": 0xB0, "open": 0, "close": 1} +MAC_LED_RESET = {"pcibus": 8, "slot": 0, "fn": 0, "bar": 0, "offset": 64, "reset": 0x98} + +INIT_PARAM = [ + {"loc": "1-0034/sfp_enable", "value": "01"}, + {"loc": "2-0035/sfp_enable2", "value": "ff"}, + {"loc": "2-0033/mac_led", "value": "ff"}, + {"loc": "1-0034/sfp_txdis1", "value": "00"}, + {"loc": "1-0034/sfp_txdis2", "value": "00"}, + {"loc": "1-0034/sfp_txdis3", "value": "00"}, + {"loc": "1-0036/sfp_txdis4", "value": "00"}, + {"loc": "1-0036/sfp_txdis5", "value": "00"}, + {"loc": "1-0036/sfp_txdis6", "value": "00"}, + {"loc": fanloc["location"], "value": "80"}, +] + +INIT_COMMAND = [] + +CPLDVERSIONS = [ + {"loc": "2-0033/cpld_version", "des": "MAC Board CPLDA"}, + {"loc": "2-0035/cpld_version", "des": "MAC Board CPLDB"}, + {"loc": "2-0037/cpld_version", "des": "CPU Board CPLD"}, +] + +## Driver List +## + +DRIVERLISTS = [] +DEVICE = [] + +#####################FRU-Info-Adaption################################# +E2TYPE = { + "1": "tlveeprom", + "2": "x86cpueeprom", + "3": "bmceeprom", + "4": "cpueeprom", + "5": "maceeprom", + "6": "sloteeprom", + "7": "fanconnecteeprom", + "8": "M1HFANI-F", + "9": "M1HFANI-R", + "A": "M2HFANI-F", + "B": "M2HFANI-R", + "C": "psu", +} +FRULISTS = [] +################################Manufacturing-Test-Adaption-Area####################################################### +# need to export interface +fanlevel_6510 = { + "level": [51, 150, 255], + "low_speed": [500, 7500, 17000], + "high_speed": [11000, 22500, 28500], +} + +fanlevel_6520 = { + "level": [75, 150, 255], + "low_speed": [750, 4250, 6750], + "high_speed": [4500, 7500, 10000], +} + +fanlevel = fanlevel_6520 + +TEMPIDCHANGE = { + "lm75in": "inlet", + "lm75out": "outlet", + "lm75hot": "hot-point", + "inlet": "lm75in", + "outlet": "lm75out", + "hot-point": "lm75hot", +} + +# Manufacturing-Test module +FACTESTMODULE = {} + +##################################Manufacturing-Test-Menu +item1 = {"name": "Single Test", "deal": "test_signal", "childid": 1} +test_sys_reload_item = {"name": "reset-system", "deal": "test_sys_reload"} + +test_sys_item = {"name": "Product information test", "deal": "test_sysinfo"} +test_temp_item = {"name": "temperature test", "deal": "test_tempinfo"} +test_mem_item = {"name": "Memory test", "deal": "test_cpumemoryinfo"} +test_hd_item = {"name": "Hard disk test", "deal": "test_hard"} +test_rtc_item = {"name": "RTC test ", "deal": "test_rtc"} +test_i2c_item = {"name": "I2c test ", "deal": "test_i2c"} +test_cpld_item = {"name": "CPLD test", "deal": "test_cpld"} +test_portframe_item = { + "name": "Port transmit-receive frame test", + "deal": "test_portframe", +} +test_sysled_item = {"name": "System led test", "deal": "test_led"} +test_fan_item = {"name": "Fan status test", "deal": "test_fan"} +test_power_item = {"name": "PSU status test", "deal": "test_power"} +test_usb_item = {"name": "USB test", "deal": "test_usb"} +test_prbs_item = {"name": "PRBS test", "deal": "test_prbs"} +test_portbroadcast_item = {"name": "Port broadcast", "deal": "test_portbroadcast"} + +test_debug_level = {"name": "Change debug level", "deal": "test_setdebug"} +test_log_level = {"name": "Log output level", "deal": "test_loginfolevel"} +test_setmac = {"name": "setmac", "deal": "test_setmac"} +test_setrtc = {"name": "Set RTC", "deal": "test_set_rtc"} + +log_level_critical = {"name": "CRITICAL", "deal": "test_log_critical"} +log_level_debug = {"name": "DEBUG", "deal": "test_log_debug"} +log_level_error = {"name": "ERROR", "deal": "test_log_error"} +log_level_info = {"name": "INFO", "deal": "test_log_info"} +log_level_notset = {"name": "NOTSET", "deal": "test_log_notset"} +log_level_warning = {"name": "WARNING", "deal": "test_log_warning"} + + +test_e2_setmac_item = {"name": "E2SETMAC", "deal": "test_e2_setmac"} +test_bmc_setmac_item = {"name": "BMCSETMAC", "deal": "test_bmc_setmac"} +test_fan_setmac_item = {"name": "fan SETMAC", "deal": "test_fan_setmac"} + +alltest = [ + test_sys_item, + test_temp_item, + test_mem_item, + test_hd_item, + test_rtc_item, + test_i2c_item, + test_cpld_item, + test_portframe_item, + test_sysled_item, + test_fan_item, + test_power_item, + test_usb_item, + test_prbs_item, + test_portbroadcast_item, +] + +looptest = [ + test_sys_item, + test_temp_item, + test_mem_item, + test_hd_item, + test_rtc_item, + test_i2c_item, + test_cpld_item, + test_portframe_item, + test_fan_item, + test_power_item, + test_usb_item, + test_prbs_item, + test_portbroadcast_item, +] + +menuList = [ + { + "menuid": 0, + "value": [ + {"name": "Single test", "deal": "test_signal", "childid": 1}, + {"name": "All test", "deal": "test_all"}, + {"name": "Loop test", "deal": "test_loop"}, + # {"name":"Check loop-test result", "deal" :"test_loop_read"}, + # {"name":"Delete loop-test result", "deal" :"test_loop_delete"}, + # {"name":"Load configuration", "deal" :"test_config"}, + test_sys_reload_item, + {"name": "System Configuration", "deal": "test_sysconfig", "childid": 2}, + ], + }, + { + "menuid": 1, + "parentid": 0, + "value": [ + test_sys_item, + test_temp_item, + test_mem_item, + test_hd_item, + test_rtc_item, + test_i2c_item, + test_cpld_item, + test_portframe_item, + test_sysled_item, + test_fan_item, + test_power_item, + test_usb_item, + test_prbs_item, + test_portbroadcast_item, + ], + }, + { + "menuid": 2, + "parentid": 0, + "value": [test_debug_level, test_log_level, test_setmac, test_setrtc,], + }, + { + "menuid": 3, + "parentid": 2, + "value": [ + log_level_critical, + log_level_debug, + log_level_error, + log_level_info, + log_level_notset, + log_level_warning, + ], + }, + { + "menuid": 4, + "parentid": 2, + "value": [test_e2_setmac_item, test_bmc_setmac_item, test_fan_setmac_item,], + }, +] + + +TESTCASE = { + "CPLD": [ + { + "name": "CONNECT BOARD CPLD-A", + "cases": [ + {"name": "cpld32", "cmd": "grtd_test.py cpld_check 0 0x32 0xAA"}, + {"name": "cpld37", "cmd": "grtd_test.py cpld_check 2 0x37 0xAC"}, + ], + }, + { + "name": "MAC BOARD CPLD-A", + "cases": [ + {"name": "cpld33", "cmd": "grtd_test.py cpld_check 2 0x33 0xAB"}, + {"name": "cpld34", "cmd": "grtd_test.py cpld_check 1 0x34 0xAA"}, + ], + }, + { + "name": "MAC BOARD CPLD-B", + "cases": [ + {"name": "cpld36", "cmd": "grtd_test.py cpld_check 1 0x36 0xAA"}, + {"name": "cpld35", "cmd": "grtd_test.py cpld_check 2 0x35 0xAB"}, + ], + }, + ], + "TEMPERATURE": [ + { + "name": "-->temperature test", + "cases": [ + { + "name": "inlet", + "cmd": "grtd_test.py temp 2-0048/hwmon/hwmon1/temp1_input", + }, + { + "name": "outlet", + "cmd": "grtd_test.py temp 2-0049/hwmon/hwmon2/temp1_input", + }, + { + "name": "hot-point", + "cmd": "grtd_test.py temp 2-004a/hwmon/hwmon3/temp1_input", + }, + ], + } + ], + "MEMTORY": { + "cases": [ + {"name": "->memory test 1M", "cmd": "memtester 1M 1"}, + {"name": "->memory test 2M", "cmd": "memtester 2M 1"}, + {"name": "->memory test 8M", "cmd": "memtester 8M 1"}, + # {"name":"->memory test 16M","cmd":"memtester 16M 1"}, + # {"name":"->memory test 256M","cmd":"memtester 256M 1"}, + ] + }, + "SMARTCTLCMDS": { + "cases": [ + {"name": "->Check Hard Disk Info", "cmd": "smartctl -i /dev/sda"}, + {"name": "->Check Hard Disk Monitor Status", "cmd": "smartctl -H /dev/sda"}, + ] + }, + "LED": [ + { + "name": "Light Port Led test", + "cases": [ + { + "name": "-> Red Led Off", + "cmd": "grtd_test.py led loc 1-0034/sfp_led1_red,1-0034/sfp_led2_red,1-0034/sfp_led3_red,1-0034/sfp_led8_red,1-0036/sfp_led4_red,1-0036/sfp_led5_red,1-0036/sfp_led6_red,1-0036/sfp_led7_red 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00", + }, + { + "name": "-> Red Led On", + "cmd": "grtd_test.py led loc 1-0034/sfp_led1_red,1-0034/sfp_led2_red,1-0034/sfp_led3_red,1-0034/sfp_led8_red,1-0036/sfp_led4_red,1-0036/sfp_led5_red,1-0036/sfp_led6_red,1-0036/sfp_led7_red 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff", + }, + { + "name": "-> Recovery Red Led Off", + "cmd": "grtd_test.py led loc 1-0034/sfp_led1_red,1-0034/sfp_led2_red,1-0034/sfp_led3_red,1-0034/sfp_led8_red,1-0036/sfp_led4_red,1-0036/sfp_led5_red,1-0036/sfp_led6_red,1-0036/sfp_led7_red 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00", + }, + { + "name": "-> Yellow Led Off", + "cmd": "grtd_test.py led loc 1-0034/sfp_led1_yellow,1-0034/sfp_led2_yellow,1-0034/sfp_led3_yellow,1-0034/sfp_led8_yellow,1-0036/sfp_led4_yellow,1-0036/sfp_led5_yellow,1-0036/sfp_led6_yellow,1-0036/sfp_led7_yellow 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00", + }, + { + "name": "-> Yellow Led On", + "cmd": "grtd_test.py led loc 1-0034/sfp_led1_yellow,1-0034/sfp_led2_yellow,1-0034/sfp_led3_yellow,1-0034/sfp_led8_yellow,1-0036/sfp_led4_yellow,1-0036/sfp_led5_yellow,1-0036/sfp_led6_yellow,1-0036/sfp_led7_yellow 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff", + }, + { + "name": "-> Recovery Yellow Led Off", + "cmd": "grtd_test.py led loc 1-0034/sfp_led1_yellow,1-0034/sfp_led2_yellow,1-0034/sfp_led3_yellow,1-0034/sfp_led8_yellow,1-0036/sfp_led4_yellow,1-0036/sfp_led5_yellow,1-0036/sfp_led6_yellow,1-0036/sfp_led7_yellow 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00", + }, + ], + }, + { + "name": "fan 1 Led", + "cases": [ + { + "name": "-> LedOff", + "cmd": "grtd_test.py led loc 0-0032/fan0_led 0x0b", + }, + { + "name": "-> Red Led ", + "cmd": "grtd_test.py led loc 0-0032/fan0_led 0x0a", + }, + { + "name": "-> Green Led ", + "cmd": "grtd_test.py led loc 0-0032/fan0_led 0x09", + }, + { + "name": "-> Yellow Led ", + "cmd": "grtd_test.py led loc 0-0032/fan0_led 0x08", + }, + { + "name": "-> Red Led Flashing", + "cmd": "grtd_test.py led loc 0-0032/fan0_led 0x0e", + }, + { + "name": "-> Green Led Flashing", + "cmd": "grtd_test.py led loc 0-0032/fan0_led 0x0d", + }, + { + "name": "-> Yellow Led Flashing", + "cmd": "grtd_test.py led loc 0-0032/fan0_led 0x0c", + }, + { + "name": "-> Recovery Green Led ", + "cmd": "grtd_test.py led loc 0-0032/fan0_led 0x09", + }, + ], + }, + { + "name": "fan 2 Led", + "cases": [ + { + "name": "-> LedOff", + "cmd": "grtd_test.py led loc 0-0032/fan1_led 0x0b", + }, + { + "name": "-> Red Led ", + "cmd": "grtd_test.py led loc 0-0032/fan1_led 0x0a", + }, + { + "name": "-> Green Led ", + "cmd": "grtd_test.py led loc 0-0032/fan1_led 0x09", + }, + { + "name": "-> Yellow Led ", + "cmd": "grtd_test.py led loc 0-0032/fan1_led 0x08", + }, + { + "name": "-> Red Led Flashing", + "cmd": "grtd_test.py led loc 0-0032/fan1_led 0x0e", + }, + { + "name": "-> Green Led Flashing", + "cmd": "grtd_test.py led loc 0-0032/fan1_led 0x0d", + }, + { + "name": "-> Yellow Led Flashing", + "cmd": "grtd_test.py led loc 0-0032/fan1_led 0x0c", + }, + { + "name": "-> Recovery Green Led ", + "cmd": "grtd_test.py led loc 0-0032/fan1_led 0x09", + }, + ], + }, + { + "name": "fan 3 Led", + "cases": [ + { + "name": "-> LedOff", + "cmd": "grtd_test.py led loc 0-0032/fan2_led 0x0b", + }, + { + "name": "-> Red Led ", + "cmd": "grtd_test.py led loc 0-0032/fan2_led 0x0a", + }, + { + "name": "-> Green Led ", + "cmd": "grtd_test.py led loc 0-0032/fan2_led 0x09", + }, + { + "name": "-> Yellow Led ", + "cmd": "grtd_test.py led loc 0-0032/fan2_led 0x08", + }, + { + "name": "-> Red Led Flashing", + "cmd": "grtd_test.py led loc 0-0032/fan2_led 0x0e", + }, + { + "name": "-> Green Led Flashing", + "cmd": "grtd_test.py led loc 0-0032/fan2_led 0x0d", + }, + { + "name": "-> Yellow Led Flashing", + "cmd": "grtd_test.py led loc 0-0032/fan2_led 0x0c", + }, + { + "name": "-> Recovery Green Led ", + "cmd": "grtd_test.py led loc 0-0032/fan2_led 0x09", + }, + ], + }, + { + "name": "Front panel CPU Led", + "cases": [ + { + "name": "-> LedOff", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x00", + }, + { + "name": "-> Green Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x01", + }, + { + "name": "-> Red Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x02", + }, + { + "name": "-> Yellow Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x03", + }, + { + "name": "-> Green Led 1/4sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x11", + }, + { + "name": "-> Green Led 1/2sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x21", + }, + { + "name": "-> Green Led 1sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x41", + }, + { + "name": "-> Green Led 2sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x81", + }, + { + "name": "-> Red Led 1/4sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x12", + }, + { + "name": "-> Red Led 1/2sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x22", + }, + { + "name": "-> Red Led 1sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x42", + }, + { + "name": "-> Red Led 2sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x82", + }, + { + "name": "-> Yellow Led 1/4sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x13", + }, + { + "name": "-> Yellow Led 1/2sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x23", + }, + { + "name": "-> Yellow Led 1sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x43", + }, + { + "name": "-> Yellow Led 2sFlashing ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x83", + }, + { + "name": "-> Recovery Green Led ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_cpu 0x01", + }, + ], + }, + { + "name": "Front panel BMC Led", + "cases": [ + { + "name": "-> LedOff", + "cmd": "grtd_test.py led loc 2-0035/broad_front_bmc 0x00", + }, + { + "name": "-> Red Led Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_bmc 0x01", + }, + { + "name": "-> Red Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_bmc 0x02", + }, + { + "name": "-> Green Led Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_bmc 0x03", + }, + { + "name": "-> Green Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_bmc 0x04", + }, + { + "name": "-> Yellow Led Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_bmc 0x05", + }, + { + "name": "-> Yellow Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_bmc 0x06", + }, + { + "name": "-> Recovery Green Led ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_bmc 0x04", + }, + ], + }, + { + "name": "Front panel location Led", + "cases": [ + { + "name": "-> LedOff", + "cmd": "grtd_test.py led loc 2-0035/broad_front_lct 0xff", + }, + { + "name": "-> LedOn", + "cmd": "grtd_test.py led loc 2-0035/broad_front_lct 0xfe", + }, + { + "name": "->Recovery LedOff", + "cmd": "grtd_test.py led loc 2-0035/broad_front_lct 0xff", + }, + ], + }, + { + "name": "Front panel pwr Led", + "cases": [ + { + "name": "-> LedOff", + "cmd": "grtd_test.py led loc 2-0035/broad_front_pwr 0x00", + }, + { + "name": "-> Red Led Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_pwr 0x01", + }, + { + "name": "-> Red Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_pwr 0x02", + }, + { + "name": "-> Green Led Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_pwr 0x03", + }, + { + "name": "-> Green Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_pwr 0x04", + }, + { + "name": "-> Yellow Led Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_pwr 0x05", + }, + { + "name": "-> Yellow Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_pwr 0x06", + }, + { + "name": "-> Recovery Green Led ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_pwr 0x04", + }, + ], + }, + { + "name": "Front panel fan Led", + "cases": [ + { + "name": "-> LedOff", + "cmd": "grtd_test.py led loc 2-0035/broad_front_fan 0x00", + }, + { + "name": "-> Red Led Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_fan 0x01", + }, + { + "name": "-> Red Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_fan 0x02", + }, + { + "name": "-> Green Led Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_fan 0x03", + }, + { + "name": "-> Green Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_fan 0x04", + }, + { + "name": "-> Yellow Led Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_fan 0x05", + }, + { + "name": "-> Yellow Led not Flashing", + "cmd": "grtd_test.py led loc 2-0035/broad_front_fan 0x06", + }, + { + "name": "-> Recovery Green Led ", + "cmd": "grtd_test.py led loc 2-0035/broad_front_fan 0x04", + }, + ], + }, + ], + "I2C": [ + ####type 1 represents value obtained compated with value + ####type 2 represents return True or False + { + "name": "I2C device test", + "cases": [ + { + "name": " PCA9641 test", + "cmd": "grtd_test.py dev_rd 0 10 0", + "deal_type": 2, + }, + { + "name": " cpld32 test", + "cmd": "grtd_test.py dev_rd 0 32 0", + "deal_type": 2, + }, + { + "name": " cpld33 test", + "cmd": "grtd_test.py dev_rd 0 32 0", + "deal_type": 2, + }, + { + "name": " cpld34 test", + "cmd": "grtd_test.py dev_rd 0 32 0", + "deal_type": 2, + }, + { + "name": " cpld35 test", + "cmd": "grtd_test.py dev_rd 0 32 0", + "deal_type": 2, + }, + { + "name": " cpld36 test", + "cmd": "grtd_test.py dev_rd 0 32 0", + "deal_type": 2, + }, + { + "name": " cpld37 test", + "cmd": "grtd_test.py dev_rd 0 32 0", + "deal_type": 2, + }, + { + "name": " inlet LM75", + "cmd": "grtd_test.py dev_rd 0 32 0", + "deal_type": 2, + }, + { + "name": " outlet LM75", + "cmd": "grtd_test.py dev_rd 0 32 0", + "deal_type": 2, + }, + { + "name": " hot-point LM75", + "cmd": "grtd_test.py dev_rd 0 32 0", + "deal_type": 2, + }, + { + "name": " EEPROM", + "cmd": "grtd_test.py dev_rd 0 32 0", + "deal_type": 2, + }, + { + "name": " Port 1", + "cmd": "grtd_test.py dev_rd 11 0050 0", + "deal_type": 2, + }, + { + "name": " Port 2", + "cmd": "grtd_test.py dev_rd 12 0050 0", + "deal_type": 2, + }, + { + "name": " Port 3", + "cmd": "grtd_test.py dev_rd 13 0050 0", + "deal_type": 2, + }, + { + "name": " Port 4", + "cmd": "grtd_test.py dev_rd 14 0050 0", + "deal_type": 2, + }, + { + "name": " Port 5", + "cmd": "grtd_test.py dev_rd 15 0050 0", + "deal_type": 2, + }, + { + "name": " Port 6", + "cmd": "grtd_test.py dev_rd 16 0050 0", + "deal_type": 2, + }, + { + "name": " Port 7", + "cmd": "grtd_test.py dev_rd 17 0050 0", + "deal_type": 2, + }, + { + "name": " Port 8", + "cmd": "grtd_test.py dev_rd 18 0050 0", + "deal_type": 2, + }, + { + "name": " Port 9", + "cmd": "grtd_test.py dev_rd 19 0050 0", + "deal_type": 2, + }, + { + "name": " Port 10", + "cmd": "grtd_test.py dev_rd 20 0050 0", + "deal_type": 2, + }, + { + "name": " Port 11", + "cmd": "grtd_test.py dev_rd 21 0050 0", + "deal_type": 2, + }, + { + "name": " Port 12", + "cmd": "grtd_test.py dev_rd 22 0050 0", + "deal_type": 2, + }, + { + "name": " Port 13", + "cmd": "grtd_test.py dev_rd 23 0050 0", + "deal_type": 2, + }, + { + "name": " Port 14", + "cmd": "grtd_test.py dev_rd 24 0050 0", + "deal_type": 2, + }, + { + "name": " Port 15", + "cmd": "grtd_test.py dev_rd 25 0050 0", + "deal_type": 2, + }, + { + "name": " Port 16", + "cmd": "grtd_test.py dev_rd 26 0050 0", + "deal_type": 2, + }, + { + "name": " Port 17", + "cmd": "grtd_test.py dev_rd 27 0050 0", + "deal_type": 2, + }, + { + "name": " Port 18", + "cmd": "grtd_test.py dev_rd 28 0050 0", + "deal_type": 2, + }, + { + "name": " Port 19", + "cmd": "grtd_test.py dev_rd 29 0050 0", + "deal_type": 2, + }, + { + "name": " Port 20", + "cmd": "grtd_test.py dev_rd 30 0050 0", + "deal_type": 2, + }, + { + "name": " Port 21", + "cmd": "grtd_test.py dev_rd 31 0050 0", + "deal_type": 2, + }, + { + "name": " Port 22", + "cmd": "grtd_test.py dev_rd 32 0050 0", + "deal_type": 2, + }, + { + "name": " Port 23", + "cmd": "grtd_test.py dev_rd 33 0050 0", + "deal_type": 2, + }, + { + "name": " Port 24", + "cmd": "grtd_test.py dev_rd 34 0050 0", + "deal_type": 2, + }, + { + "name": " Port 25", + "cmd": "grtd_test.py dev_rd 35 0050 0", + "deal_type": 2, + }, + { + "name": " Port 26", + "cmd": "grtd_test.py dev_rd 36 0050 0", + "deal_type": 2, + }, + { + "name": " Port 27", + "cmd": "grtd_test.py dev_rd 37 0050 0", + "deal_type": 2, + }, + { + "name": " Port 28", + "cmd": "grtd_test.py dev_rd 38 0050 0", + "deal_type": 2, + }, + { + "name": " Port 29", + "cmd": "grtd_test.py dev_rd 39 0050 0", + "deal_type": 2, + }, + { + "name": " Port 30", + "cmd": "grtd_test.py dev_rd 40 0050 0", + "deal_type": 2, + }, + { + "name": " Port 31", + "cmd": "grtd_test.py dev_rd 41 0050 0", + "deal_type": 2, + }, + { + "name": " Port 32", + "cmd": "grtd_test.py dev_rd 42 0050 0", + "deal_type": 2, + }, + { + "name": " Port 33", + "cmd": "grtd_test.py dev_rd 43 0050 0", + "deal_type": 2, + }, + { + "name": " Port 34", + "cmd": "grtd_test.py dev_rd 44 0050 0", + "deal_type": 2, + }, + { + "name": " Port 35", + "cmd": "grtd_test.py dev_rd 45 0050 0", + "deal_type": 2, + }, + { + "name": " Port 36", + "cmd": "grtd_test.py dev_rd 46 0050 0", + "deal_type": 2, + }, + { + "name": " Port 37", + "cmd": "grtd_test.py dev_rd 47 0050 0", + "deal_type": 2, + }, + { + "name": " Port 38", + "cmd": "grtd_test.py dev_rd 48 0050 0", + "deal_type": 2, + }, + { + "name": " Port 39", + "cmd": "grtd_test.py dev_rd 49 0050 0", + "deal_type": 2, + }, + { + "name": " Port 40", + "cmd": "grtd_test.py dev_rd 50 0050 0", + "deal_type": 2, + }, + { + "name": " Port 41", + "cmd": "grtd_test.py dev_rd 51 0050 0", + "deal_type": 2, + }, + { + "name": " Port 42", + "cmd": "grtd_test.py dev_rd 52 0050 0", + "deal_type": 2, + }, + { + "name": " Port 43", + "cmd": "grtd_test.py dev_rd 53 0050 0", + "deal_type": 2, + }, + { + "name": " Port 44", + "cmd": "grtd_test.py dev_rd 54 0050 0", + "deal_type": 2, + }, + { + "name": " Port 45", + "cmd": "grtd_test.py dev_rd 55 0050 0", + "deal_type": 2, + }, + { + "name": " Port 46", + "cmd": "grtd_test.py dev_rd 56 0050 0", + "deal_type": 2, + }, + { + "name": " Port 47", + "cmd": "grtd_test.py dev_rd 57 0050 0", + "deal_type": 2, + }, + { + "name": " Port 48", + "cmd": "grtd_test.py dev_rd 58 0050 0", + "deal_type": 2, + }, + { + "name": " Port 49", + "cmd": "grtd_test.py dev_rd 59 0050 0", + "deal_type": 2, + }, + { + "name": " Port 50", + "cmd": "grtd_test.py dev_rd 60 0050 0", + "deal_type": 2, + }, + { + "name": " Port 51", + "cmd": "grtd_test.py dev_rd 61 0050 0", + "deal_type": 2, + }, + { + "name": " Port 52", + "cmd": "grtd_test.py dev_rd 62 0050 0", + "deal_type": 2, + }, + { + "name": " Port 53", + "cmd": "grtd_test.py dev_rd 63 0050 0", + "deal_type": 2, + }, + { + "name": " Port 54", + "cmd": "grtd_test.py dev_rd 64 0050 0", + "deal_type": 2, + }, + { + "name": " Port 55", + "cmd": "grtd_test.py dev_rd 65 0050 0", + "deal_type": 2, + }, + { + "name": " Port 56", + "cmd": "grtd_test.py dev_rd 66 0050 0", + "deal_type": 2, + }, + { + "name": " Port 57", + "cmd": "grtd_test.py dev_rd 67 0050 0", + "deal_type": 2, + }, + { + "name": " Port 58", + "cmd": "grtd_test.py dev_rd 68 0050 0", + "deal_type": 2, + }, + { + "name": " Port 59", + "cmd": "grtd_test.py dev_rd 69 0050 0", + "deal_type": 2, + }, + { + "name": " Port 60", + "cmd": "grtd_test.py dev_rd 70 0050 0", + "deal_type": 2, + }, + { + "name": " Port 61", + "cmd": "grtd_test.py dev_rd 71 0050 0", + "deal_type": 2, + }, + { + "name": " Port 62", + "cmd": "grtd_test.py dev_rd 72 0050 0", + "deal_type": 2, + }, + { + "name": " Port 63", + "cmd": "grtd_test.py dev_rd 73 0050 0", + "deal_type": 2, + }, + { + "name": " Port 64", + "cmd": "grtd_test.py dev_rd 74 0050 0", + "deal_type": 2, + }, + ], + }, + ], +} + +PCIe_DEV_LIST = [] +PCIe_SPEED_ITEM = [] + +################################Manufacturing-Test-Adaption-Area####################################################### diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_config.py b/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_config.py new file mode 100644 index 000000000000..64ae8567c181 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_config.py @@ -0,0 +1,196 @@ +#!/usr/bin/python3 + +import sys +import os +from wbutil.baseutil import get_machine_info +from wbutil.baseutil import get_platform_info + +__all__ = [ + "getdeviceplatform", + "MONITOR_CONST", + "MAILBOX_DIR", + "DEVICE", + "GLOBALCONFIG", + "GLOBALINITPARAM", + "GLOBALINITCOMMAND", + "MAC_LED_RESET", + "STARTMODULE", + "fanloc", + "PLATFORM_CARDID", + "PLATFORM_PRODUCTNAME", + "PLATFORM_PART_NUMBER", + "PLATFORM_LABEL_REVISION", + "PLATFORM_MAC_SIZE", + "PLATFORM_MANUF_NAME", + "PLATFORM_MANUF_COUNTRY", + "PLATFORM_VENDOR_NAME", + "PLATFORM_DIAG_VERSION", + "PLATFORM_SERVICE_TAG", + "E2_PROTECT", + "E2_LOC", + "FAN_PROTECT", + "FANS_DEF", + "MONITOR_FANS_LED", + "MONITOR_SYS_FAN_LED", + "MONITOR_SYS_PSU_LED", + "MONITOR_FAN_STATUS", + "MONITOR_PSU_STATUS", + "MONITOR_DEV_STATUS", + "MONITOR_DEV_STATUS_DECODE", + "DEV_LEDS", + "MAC_AVS_PARAM", + "MAC_DEFAULT_PARAM", + "FRULISTS", + "wb_eeprom", + "i2ccheck_params", + "FANCTROLDEBUG", + "DEVMONITORDEBUG", +] + + +def getdeviceplatform(): + x = get_platform_info(get_machine_info()) + if x != None: + filepath = "/usr/share/sonic/device/" + x + return filepath + return None + + +platform = get_platform_info(get_machine_info()) +platformpath = getdeviceplatform() +MAILBOX_DIR = "/sys/bus/i2c/devices/" +grtd_productfile = (platform + "_config").replace("-", "_") +common_productfile = "platform_common" +configfile_pre = "/usr/local/bin/" + +sys.path.append(platformpath) +sys.path.append(configfile_pre) + +############################################################################################ +## if there is no specific file, use common file +module_product = None +if os.path.exists(configfile_pre + grtd_productfile + ".py"): + module_product = __import__(grtd_productfile, globals(), locals(), [], 0) +elif os.path.exists(configfile_pre + common_productfile + ".py"): + module_product = __import__(common_productfile, globals(), locals(), [], 0) +else: + print("No Configuration existed, quit") + exit(-1) +############################################################################################ + +DEVICE = module_product.DEVICE + +##########Driver loading needs parameters +# get different product configuration +PLATFORM_GLOBALCONFIG = { + "DRIVERLISTS": module_product.DRIVERLISTS, + "QSFP": { + "startbus": module_product.PCA9548START, + "endbus": module_product.PCA9548BUSEND, + }, + "DEVS": DEVICE, +} +GLOBALCONFIG = PLATFORM_GLOBALCONFIG +GLOBALINITPARAM = module_product.INIT_PARAM +GLOBALINITCOMMAND = module_product.INIT_COMMAND + +fancontrol_loc = module_product.fancontrol_loc +fancontrol_config_loc = module_product.fancontrol_config_loc +MAC_LED_RESET = module_product.MAC_LED_RESET +###########Stat-up module parameters +STARTMODULE = module_product.STARTMODULE +FIRMWARE_TOOLS = module_product.FIRMWARE_TOOLS + + +##########Manufacturing-Test need parameters +FACTESTMODULE = module_product.FACTESTMODULE +TESTCASE = module_product.TESTCASE +menuList = module_product.menuList +alltest = module_product.alltest +looptest = module_product.looptest +fanloc = module_product.fanloc +fanlevel = module_product.fanlevel # fan adjustment level +TEMPIDCHANGE = module_product.TEMPIDCHANGE +CPLDVERSIONS = module_product.CPLDVERSIONS +PLATFORM_CARDID = module_product.PLATFORM_CARDID +PLATFORM_PRODUCTNAME = module_product.PLATFORM_PRODUCTNAME + +PLATFORM_PART_NUMBER = module_product.PLATFORM_PART_NUMBER +PLATFORM_LABEL_REVISION = module_product.PLATFORM_LABEL_REVISION +PLATFORM_ONIE_VERSION = module_product.PLATFORM_ONIE_VERSION +PLATFORM_MAC_SIZE = module_product.PLATFORM_MAC_SIZE +PLATFORM_MANUF_NAME = module_product.PLATFORM_MANUF_NAME +PLATFORM_MANUF_COUNTRY = module_product.PLATFORM_MANUF_COUNTRY +PLATFORM_VENDOR_NAME = module_product.PLATFORM_VENDOR_NAME +PLATFORM_DIAG_VERSION = module_product.PLATFORM_DIAG_VERSION +PLATFORM_SERVICE_TAG = module_product.PLATFORM_SERVICE_TAG + +E2_PROTECT = module_product.E2_PROTECT +E2_LOC = module_product.E2_LOC +FAN_PROTECT = module_product.FAN_PROTECT + +FANS_DEF = module_product.FANS_DEF +MONITOR_SYS_LED = module_product.MONITOR_SYS_LED +MONITOR_FANS_LED = module_product.MONITOR_FANS_LED +MONITOR_SYS_FAN_LED = module_product.MONITOR_SYS_FAN_LED +MONITOR_SYS_PSU_LED = module_product.MONITOR_SYS_PSU_LED +MONITOR_FAN_STATUS = module_product.MONITOR_FAN_STATUS +MONITOR_PSU_STATUS = module_product.MONITOR_PSU_STATUS +MONITOR_DEV_STATUS = module_product.MONITOR_DEV_STATUS +MONITOR_DEV_STATUS_DECODE = module_product.MONITOR_DEV_STATUS_DECODE +DEV_MONITOR_PARAM = module_product.DEV_MONITOR_PARAM +SLOT_MONITOR_PARAM = module_product.SLOT_MONITOR_PARAM + + +DEV_LEDS = module_product.DEV_LEDS +MEM_SLOTS = module_product.MEM_SLOTS + +MAC_AVS_PARAM = module_product.MAC_AVS_PARAM +MAC_DEFAULT_PARAM = module_product.MAC_DEFAULT_PARAM +E2TYPE = module_product.E2TYPE +FRULISTS = module_product.FRULISTS +wb_eeprom = "%d-%04x/eeprom" % (E2_LOC["bus"], E2_LOC["devno"]) +factest_module = module_product.factest_module + +LOCAL_LED_CONTROL = module_product.LOCAL_LED_CONTROL + +PCIe_DEV_LIST = module_product.PCIe_DEV_LIST +PCIe_SPEED_ITEM = module_product.PCIe_SPEED_ITEM +i2ccheck_params = module_product.i2ccheck_params + + +class MONITOR_CONST: + TEMP_MIN = module_product.MONITOR_TEMP_MIN + K = module_product.MONITOR_K + MAC_IN = module_product.MONITOR_MAC_IN + DEFAULT_SPEED = module_product.MONITOR_DEFAULT_SPEED + MAX_SPEED = module_product.MONITOR_MAX_SPEED + MIN_SPEED = module_product.MONITOR_MIN_SPEED + MAC_ERROR_SPEED = module_product.MONITOR_MAC_ERROR_SPEED + FAN_TOTAL_NUM = module_product.MONITOR_FAN_TOTAL_NUM + MAC_UP_TEMP = module_product.MONITOR_MAC_UP_TEMP + MAC_LOWER_TEMP = module_product.MONITOR_MAC_LOWER_TEMP + MAC_MAX_TEMP = module_product.MONITOR_MAC_MAX_TEMP + + MAC_WARNING_THRESHOLD = module_product.MONITOR_MAC_WARNING_THRESHOLD + OUTTEMP_WARNING_THRESHOLD = module_product.MONITOR_OUTTEMP_WARNING_THRESHOLD + BOARDTEMP_WARNING_THRESHOLD = module_product.MONITOR_BOARDTEMP_WARNING_THRESHOLD + CPUTEMP_WARNING_THRESHOLD = module_product.MONITOR_CPUTEMP_WARNING_THRESHOLD + INTEMP_WARNING_THRESHOLD = module_product.MONITOR_INTEMP_WARNING_THRESHOLD + + MAC_CRITICAL_THRESHOLD = module_product.MONITOR_MAC_CRITICAL_THRESHOLD + OUTTEMP_CRITICAL_THRESHOLD = module_product.MONITOR_OUTTEMP_CRITICAL_THRESHOLD + BOARDTEMP_CRITICAL_THRESHOLD = module_product.MONITOR_BOARDTEMP_CRITICAL_THRESHOLD + CPUTEMP_CRITICAL_THRESHOLD = module_product.MONITOR_CPUTEMP_CRITICAL_THRESHOLD + INTEMP_CRITICAL_THRESHOLD = module_product.MONITOR_INTEMP_CRITICAL_THRESHOLD + CRITICAL_NUM = module_product.MONITOR_CRITICAL_NUM + SHAKE_TIME = module_product.MONITOR_SHAKE_TIME + MONITOR_INTERVAL = module_product.MONITOR_INTERVAL + MONITOR_FALL_TEMP = module_product.MONITOR_FALL_TEMP + + MONITOR_MAC_SOURCE_SYSFS = module_product.MONITOR_MAC_SOURCE_SYSFS + MONITOR_MAC_SOURCE_PATH = module_product.MONITOR_MAC_SOURCE_PATH + + +FANCTROLDEBUG = 0 # 1 means enable +DEVMONITORDEBUG = 0 # 1 means enable diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_sensors.py b/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_sensors.py new file mode 100644 index 000000000000..9f8a7b466dcc --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_sensors.py @@ -0,0 +1,92 @@ +#!/usr/bin/python3 +# * onboard sensors +# +import os +import sys +from sonic_platform.redfish_api import Redfish_Api + +def get_machine_info(): + if not os.path.isfile('/host/machine.conf'): + return None + machine_vars = {} + with open('/host/machine.conf') as machine_file: + for line in machine_file: + tokens = line.split('=') + if len(tokens) < 2: + continue + machine_vars[tokens[0]] = tokens[1].strip() + return machine_vars + +def get_platform_info(machine_info): + if machine_info is not None: + if 'onie_platform' in machine_info: + return machine_info['onie_platform'] + elif 'aboot_platform' in machine_info: + return machine_info['aboot_platform'] + return None + +PLATFORM_ROOT_PATH = '/usr/share/sonic/device' +platform = None + +def get_platform_name(): + global platform + platform = get_platform_info(get_machine_info()) + return platform + +val = get_platform_name() +sys.path.append("/".join([PLATFORM_ROOT_PATH, platform])) + +def print_console(str): + print(str) + +def print_platform(): + platform_info = get_platform_name() + print_console(platform_info) + print_console('Adapter: Platform Management Controller') + print_console("") + +def get_sensor(): + sensor = Redfish_Api().get_thresholdSensors() + ctrl = sensor["Sensors"] + list_sensor =[] + for item in ctrl: + name = item.get("@odata.id").split("/",9)[9] + now = item.get("Reading") + min = item.get("Thresholds").get("LowerFatal").get("Reading") + max = item.get("Thresholds").get("UpperFatal").get("Reading") + unit = item.get("ReadingUnits") + if unit == "Amps": + unit = "A" + if min == (-1000): + min = (min/1000) + elif unit == "Volts": + unit = "V" + tmp = {} + tmp["name"]= name + tmp["now"] = ("%.3f" % now) + tmp["min"] = ("%.3f" % min) + tmp["max"] = ("%.3f" % max) + tmp["unit"] = unit + list_sensor.append(tmp) + return list_sensor + +def print_boarddcdc(): + val_ret = get_sensor() + print_info_str = "" + toptile = "Onboard Sensors:" + errformat = " {id:<26} : {errmsg}" + formatstr = " {name:<26} : {now:<6} {unit:<1} (Min = {min:<6} {unit:<1} , Max = {max:<6} {unit:<1} )" + + if len(val_ret) != 0: + print_info_str += toptile + '\n' + for item in val_ret: + realformat = formatstr if item.get('errcode', 0) == 0 else errformat + print_info_str += realformat.format(**item) + '\n' + print_console(print_info_str) + +def getsensors(): + print_platform() + print_boarddcdc() + +if __name__ == "__main__": + getsensors() diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_util.py b/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_util.py new file mode 100644 index 000000000000..68a2fd2f5721 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/script/platform_util.py @@ -0,0 +1,1934 @@ +#!/usr/bin/python3 + +import sys + +if sys.version_info >= (3, 0): + import subprocess as commands +else: + import commands +import os +import re +import syslog +import time +import binascii +import tty +import termios +import threading +import click +import mmap +from platform_config import ( + wb_eeprom, + FRULISTS, + MAC_DEFAULT_PARAM, + MAC_AVS_PARAM, + FANS_DEF, + FAN_PROTECT, + E2_LOC, + E2_PROTECT, + PLATFORM_SERVICE_TAG, + PLATFORM_DIAG_VERSION, + STARTMODULE, + PLATFORM_CARDID, + PLATFORM_PRODUCTNAME, + PLATFORM_PART_NUMBER, + PLATFORM_LABEL_REVISION, + PLATFORM_MAC_SIZE, + PLATFORM_MANUF_NAME, + PLATFORM_MANUF_COUNTRY, + PLATFORM_VENDOR_NAME, + MAILBOX_DIR, +) + +try: + from eepromutil.fru import ipmifru +except Exception or SystemExit: + print("error") + +import logging.handlers +import shutil +import gzip +import glob + +__all__ = [ + "MENUID", + "MENUPARENT", + "MENUVALUE", + "CHILDID", + "MENUITEMNAME", + "MENUITEMDEAL", + "GOBACK", + "GOQUIT", + "file_name", + "CRITICAL", + "FATAL", + "ERROR", + "WARNING", + "WARN", + "INFO", + "DEBUG", + "NOTSET", + "levelNames", + "TLV_INFO_ID_STRING", + "TLV_INFO_VERSION", + "TLV_INFO_LENGTH", + "TLV_INFO_LENGTH_VALUE", + "TLV_CODE_PRODUCT_NAME", + "TLV_CODE_PART_NUMBER", + "TLV_CODE_SERIAL_NUMBER", + "TLV_CODE_MAC_BASE", + "TLV_CODE_MANUF_DATE", + "TLV_CODE_DEVICE_VERSION", + "TLV_CODE_LABEL_REVISION", + "TLV_CODE_PLATFORM_NAME", + "TLV_CODE_ONIE_VERSION", + "TLV_CODE_MAC_SIZE", + "TLV_CODE_MANUF_NAME", + "TLV_CODE_MANUF_COUNTRY", + "TLV_CODE_VENDOR_NAME", + "TLV_CODE_DIAG_VERSION", + "TLV_CODE_SERVICE_TAG", + "TLV_CODE_VENDOR_EXT", + "TLV_CODE_CRC_32", + "_TLV_DISPLAY_VENDOR_EXT", + "TLV_CODE_CARID", + "_TLV_INFO_HDR_LEN", + "SYSLOG_IDENTIFIER", + "log_info", + "log_debug", + "log_warning", + "log_error", + "CompressedRotatingFileHandler", + "SETMACException", + "checkinput", + "checkinputproduct", + "getInputSetmac", + "fan_tlv", + "AVSUTIL", + "I2CUTIL", + "BMC", + "getSdkReg", + "getfilevalue", + "get_sysfs_value", + "write_sysfs_value", + "PRINTERR", + "strtoint", + "inttostr", + "str_to_hex", + "hex_to_str", + "str_to_bin", + "bin_to_str", + "get_mac_temp", + "get_mac_temp_sysfs", + "restartDockerService", + "wait_dhcp", + "wait_sdk", + "wait_docker", + "getTLV_BODY", + "_crc32", + "printvalue", + "generate_value", + "getsyseeprombyId", + "fac_init_cardidcheck", + "isValidMac", + "util_setmac", + "getInputCheck", + "getrawch", + "upper_input", + "astrcmp", + "generate_ext", + "wbi2cget", + "wbi2cset", + "wbpcird", + "wbpciwr", + "wbsysset", + "wbi2cget_word", + "wbi2cset_word", + "fan_setmac", + "checkfansninput", + "checkfanhwinput", + "util_show_fanse2", + "get_fane2_sysfs", + "util_show_fane2", + "getPid", + "fac_fans_setmac_tlv", + "fac_fan_setmac_fru", + "fac_fans_setmac", + "fac_fan_setmac", + "writeToEEprom", + "get_local_eth0_mac", + "getonieversion", + "createbmcMac", + "ipmi_set_mac", + "getInputValue", + "bmc_setmac", + "closeProtocol", + "checkSdkMem", + "getch", + "get_raw_input", + "getsysvalue", + "get_pmc_register", + "decoder", + "decode_eeprom", + "get_sys_eeprom", + "getCardId", + "getsysmeminfo", + "getsysmeminfo_detail", + "getDmiSysByType", + "gethwsys", + "getsysbios", + "searchDirByName", + "getUsbLocation", + "getusbinfo", + "get_cpu_info", + "io_rd", + "io_wr", +] + +MENUID = "menuid" +MENUPARENT = "parentid" +MENUVALUE = "value" +CHILDID = "childid" +MENUITEMNAME = "name" +MENUITEMDEAL = "deal" +GOBACK = "goBack" +GOQUIT = "quit" + +file_name = "/etc/init.d/opennsl-modules-3.16.0-5-amd64" +########################################################################## +# ERROR LOG LEVEL +########################################################################## +CRITICAL = 50 +FATAL = CRITICAL +ERROR = 40 +WARNING = 30 +WARN = WARNING +INFO = 20 +DEBUG = 10 +NOTSET = 0 + +levelNames = { + CRITICAL: "CRITICAL", + ERROR: "ERROR", + WARNING: "WARNING", + INFO: "INFO", + DEBUG: "DEBUG", + NOTSET: "NOTSET", + "CRITICAL": CRITICAL, + "ERROR": ERROR, + "WARN": WARNING, + "WARNING": WARNING, + "INFO": INFO, + "DEBUG": DEBUG, + "NOTSET": NOTSET, +} + +TLV_INFO_ID_STRING = "TlvInfo\x00" +TLV_INFO_VERSION = 0x01 +TLV_INFO_LENGTH = 0x00 +TLV_INFO_LENGTH_VALUE = 0xBA + +########################################################################## +# eeprom info +########################################################################## +TLV_CODE_PRODUCT_NAME = 0x21 +TLV_CODE_PART_NUMBER = 0x22 +TLV_CODE_SERIAL_NUMBER = 0x23 +TLV_CODE_MAC_BASE = 0x24 +TLV_CODE_MANUF_DATE = 0x25 +TLV_CODE_DEVICE_VERSION = 0x26 +TLV_CODE_LABEL_REVISION = 0x27 +TLV_CODE_PLATFORM_NAME = 0x28 +TLV_CODE_ONIE_VERSION = 0x29 +TLV_CODE_MAC_SIZE = 0x2A +TLV_CODE_MANUF_NAME = 0x2B +TLV_CODE_MANUF_COUNTRY = 0x2C +TLV_CODE_VENDOR_NAME = 0x2D +TLV_CODE_DIAG_VERSION = 0x2E +TLV_CODE_SERVICE_TAG = 0x2F +TLV_CODE_VENDOR_EXT = 0xFD +TLV_CODE_CRC_32 = 0xFE +_TLV_DISPLAY_VENDOR_EXT = 1 +TLV_CODE_CARID = 0x01 +_TLV_INFO_HDR_LEN = 11 + + +SYSLOG_IDENTIFIER = "UTILTOOL" + +# ========================== Syslog wrappers ========================== + + +def log_info(msg, also_print_to_console=False): + syslog.openlog(SYSLOG_IDENTIFIER) + syslog.syslog(syslog.LOG_INFO, msg) + syslog.closelog() + + if also_print_to_console: + click.echo(msg) + + +def log_debug(msg, also_print_to_console=False): + try: + syslog.openlog(SYSLOG_IDENTIFIER) + syslog.syslog(syslog.LOG_DEBUG, msg) + syslog.closelog() + + if also_print_to_console: + click.echo(msg) + except Exception as e: + print(str(e)) + + +def log_warning(msg, also_print_to_console=False): + syslog.openlog(SYSLOG_IDENTIFIER) + syslog.syslog(syslog.LOG_WARNING, msg) + syslog.closelog() + + if also_print_to_console: + click.echo(msg) + + +def log_error(msg, also_print_to_console=False): + syslog.openlog(SYSLOG_IDENTIFIER) + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + if also_print_to_console: + click.echo(msg) + + +class CompressedRotatingFileHandler(logging.handlers.RotatingFileHandler): + def doRollover(self): + """ + Do a rollover, as described in __init__(). + """ + if self.stream: + self.stream.close() + self.stream = None + if self.backupCount > 0: + for i in range(self.backupCount - 1, 0, -1): + sfn = "%s.%d.gz" % (self.baseFilename, i) + dfn = "%s.%d.gz" % (self.baseFilename, i + 1) + if os.path.exists(sfn): + if os.path.exists(dfn): + os.remove(dfn) + os.rename(sfn, dfn) + dfn = self.baseFilename + ".1.gz" + if os.path.exists(dfn): + os.remove(dfn) + # These two lines below are the only new lines. I commented out the os.rename(self.baseFilename, dfn) and + # replaced it with these two lines. + with open(self.baseFilename, "rb") as f_in, gzip.open(dfn, "wb") as f_out: + shutil.copyfileobj(f_in, f_out) + self.mode = "w" + self.stream = self._open() + + +class SETMACException(Exception): + def __init__(self, param="ERROR", errno="-1"): + err = "Setmac fail[%s]: %s" % (errno, param) + Exception.__init__(self, err) + self.param = param + self.errno = errno + + +def checkinput(b): + if b.isdigit() == False: + raise Exception("Ivalid Number") + if int(b) > 0xFF or int(b) < 0: + raise Exception("Out of area") + + +def checkinputproduct(b): + if b.isalnum() == False: + raise Exception("Invalid string") + + +def getInputSetmac(val): + bia = val.boardInfoArea + pia = val.productInfoArea + if bia != None: + a = raw_input("[Board Card]Product Serial Number:") + if len(a) != 13: + raise Exception("Invalid Serial Number length") + checkinputproduct(a) + bia.boardSerialNumber = a + b = raw_input("[Board Card]Product Version:(from 1-255)") + checkinput(b) + b = "%0x" % int(b) + bia.boardextra1 = b.upper() + if pia != None: + a = raw_input("[Product Area]Product Serial Number:") + if len(a) != 13: + raise Exception("Invalid Serial Number") + checkinputproduct(a) + pia.productSerialNumber = a + b = raw_input("[Product Area]Product Version:(from 1-255)") + checkinput(b) + b = "%0x" % int(b) + pia.productVersion = b.upper() + return val + + +class fan_tlv(object): + VERSION = 0x01 # E2PROM Version, start from 0x01 + FLAG = 0x7E # New E2PROM version flag is 0x7E + HW_VER = 0x01 # compose by master version and fixed version + TYPE = 0xF1 # hw type defination + TLV_LEN = 00 # data length (16bit) + _FAN_TLV_HDR_LEN = 6 + _FAN_TLV_CRC_LEN = 2 + + _FAN_TLV_TYPE_NAME = 0x02 + _FAN_TLV_TYPE_SN = 0x03 + _FAN_TLV_TYPE_HW_INFO = 0x05 + _FAN_TLV_TYPE_DEV_TYPE = 0x06 + + _fandecodetime = 0 + + @property + def dstatus(self): + return self._dstatus + + @property + def typename(self): + return self._typename + + @property + def typesn(self): + return self._typesn + + @property + def typehwinfo(self): + return self._typehwinfo + + @property + def typedevtype(self): + return self._typedevtype + + @property + def fanbus(self): + return self._fanbus + + @property + def fanloc(self): + return self._fanloc + + @property + def fandecodetime(self): + return self._fandecodetime + + def __init__(self): + self._typename = "" + self._typesn = "" + self._typehwinfo = "" + self._typedevtype = "" + self._dstatus = 0 + + def strtoarr(self, str): + s = [] + if str is not None: + for index in range(len(str)): + s.append(str[index]) + return s + + def generate_fan_value(self): + bin_buffer = [chr(0xFF)] * 256 + bin_buffer[0] = chr(self.VERSION) + bin_buffer[1] = chr(self.FLAG) + bin_buffer[2] = chr(self.HW_VER) + bin_buffer[3] = chr(self.TYPE) + + temp_t = "%08x" % self.typedevtype # handle devtype first + typedevtype_t = hex_to_str(temp_t) + total_len = ( + len(self.typename) + + len(self.typesn) + + len(self.typehwinfo) + + len(typedevtype_t) + + 8 + ) + + bin_buffer[4] = chr(total_len >> 8) + bin_buffer[5] = chr(total_len & 0x00FF) + + index_start = 6 + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_NAME) + bin_buffer[index_start + 1] = chr(len(self.typename)) + bin_buffer[ + index_start + 2 : index_start + 2 + len(self.typename) + ] = self.strtoarr(self.typename) + index_start = index_start + 2 + len(self.typename) + + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_SN) + bin_buffer[index_start + 1] = chr(len(self.typesn)) + bin_buffer[ + index_start + 2 : index_start + 2 + len(self.typesn) + ] = self.strtoarr(self.typesn) + index_start = index_start + 2 + len(self.typesn) + + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_HW_INFO) + bin_buffer[index_start + 1] = chr(len(self.typehwinfo)) + bin_buffer[ + index_start + 2 : index_start + 2 + len(self.typehwinfo) + ] = self.strtoarr(self.typehwinfo) + index_start = index_start + 2 + len(self.typehwinfo) + + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_DEV_TYPE) + bin_buffer[index_start + 1] = chr(len(typedevtype_t)) + bin_buffer[ + index_start + 2 : index_start + 2 + len(typedevtype_t) + ] = self.strtoarr(typedevtype_t) + index_start = index_start + 2 + len(typedevtype_t) + + crcs = fan_tlv.fancrc("".join(bin_buffer[0:index_start])) # check 2bytes + bin_buffer[index_start] = chr(crcs >> 8) + bin_buffer[index_start + 1] = chr(crcs & 0x00FF) + return bin_buffer + + def decode(self, e2): + ret = [] + self.VERSION = ord(e2[0]) + self.FLAG = ord(e2[1]) + self.HW_VER = ord(e2[2]) + self.TYPE = ord(e2[3]) + self.TLV_LEN = (ord(e2[4]) << 8) | ord(e2[5]) + + tlv_index = self._FAN_TLV_HDR_LEN + tlv_end = self._FAN_TLV_HDR_LEN + self.TLV_LEN + + # check checksum + if len(e2) < self._FAN_TLV_HDR_LEN + self.TLV_LEN + 2: + self._dstatus = -2 + return ret + sumcrc = fan_tlv.fancrc(e2[0 : self._FAN_TLV_HDR_LEN + self.TLV_LEN]) + readcrc = ord(e2[self._FAN_TLV_HDR_LEN + self.TLV_LEN]) << 8 | ord( + e2[self._FAN_TLV_HDR_LEN + self.TLV_LEN + 1] + ) + if sumcrc != readcrc: + self._dstatus = -1 + return ret + else: + self._dstatus = 0 + while (tlv_index + 2) < len(e2) and tlv_index < tlv_end: + s = self.decoder(e2[tlv_index : tlv_index + 2 + ord(e2[tlv_index + 1])]) + tlv_index += ord(e2[tlv_index + 1]) + 2 + ret.append(s) + + return ret + + @staticmethod + def fancrc(t): + sum = 0 + for index in range(len(t)): + sum += ord(t[index]) + return sum + + def decoder(self, t): + try: + name = "" + value = "" + if ord(t[0]) == self._FAN_TLV_TYPE_NAME: + name = "Product Name" + value = str(t[2 : 2 + ord(t[1])]) + self._typename = value + elif ord(t[0]) == self._FAN_TLV_TYPE_SN: + name = "serial Number" + value = str(t[2 : 2 + ord(t[1])]) + self._typesn = value + elif ord(t[0]) == self._FAN_TLV_TYPE_HW_INFO: + name = "hardware info" + value = str(t[2 : 2 + ord(t[1])]) + self._typehwinfo = value + elif ord(t[0]) == self._FAN_TLV_TYPE_DEV_TYPE: + name = "dev type" + value = str(t[2 : 2 + ord(t[1])]) + value = str_to_hex(value) + self._typedevtype = value + value = "0x08%x" % value + except Exception as e: + print(e) + return {"name": name, "code": ord(t[0]), "value": value} + + def __str__(self): + formatstr = ( + "VERSION : 0x%02x \n" + " FLAG : 0x%02x \n" + " HW_VER : 0x%02x \n" + " TYPE : 0x%02x \n" + "typename : %s \n" + "typesn : %s \n" + "typehwinfo : %s \n" + ) + return formatstr % ( + self.VERSION, + self.FLAG, + self.HW_VER, + self.TYPE, + self.typename, + self.typesn, + self.typehwinfo, + ) + + +class AVSUTIL: + @staticmethod + def mac_avs_chip(bus, devno, loc, open, close, loop, protectaddr, level, loopaddr): + # disable protection + wbi2cset(bus, devno, protectaddr, open) + wbi2cset(bus, devno, loopaddr, loop) + wbi2cset_word(bus, devno, loc, level) + ret, value = wbi2cget_word(bus, devno, loc) + if strtoint(value) == level: + ret = 0 + # enable protection + wbi2cset(bus, devno, protectaddr, close) + if ret == 0: + return True + return False + + @staticmethod + def macPressure_adj(macavs, avs_param, mac_def_param): + # check whether it within range + max_adj = max(avs_param.keys()) + min_adj = min(avs_param.keys()) + type = mac_def_param["type"] + level = 0 + if type == 0: + if macavs not in range(min_adj, max_adj + 1): + return False + else: + level = macavs + else: + if macavs not in range(min_adj, max_adj + 1): + level = mac_def_param["default"] + else: + level = macavs + ret = AVSUTIL.mac_avs_chip( + mac_def_param["bus"], + mac_def_param["devno"], + mac_def_param["addr"], + mac_def_param["open"], + mac_def_param["close"], + mac_def_param["loop"], + mac_def_param["protectaddr"], + avs_param[level], + mac_def_param["loopaddr"], + ) + return ret + + @staticmethod + def mac_adj(): + macavs = 0 + name = MAC_DEFAULT_PARAM["sdkreg"] + ret, status = getSdkReg(name) + if ret == False: + return False + status = strtoint(status) + # shift operation + if MAC_DEFAULT_PARAM["sdktype"] != 0: + status = (status >> MAC_DEFAULT_PARAM["macregloc"]) & MAC_DEFAULT_PARAM[ + "mask" + ] + macavs = status + ret = AVSUTIL.macPressure_adj(macavs, MAC_AVS_PARAM, MAC_DEFAULT_PARAM) + return ret + + +class I2CUTIL: + @staticmethod + def getvaluefromdevice(name): + ret = [] + for item in DEVICE: + if item["name"] == name: + ret.append(item) + return ret + + @staticmethod + def openFanE2Protect(): + wbi2cset( + FAN_PROTECT["bus"], + FAN_PROTECT["devno"], + FAN_PROTECT["addr"], + FAN_PROTECT["open"], + ) + + @staticmethod + def closeFanE2Protect(): + wbi2cset( + FAN_PROTECT["bus"], + FAN_PROTECT["devno"], + FAN_PROTECT["addr"], + FAN_PROTECT["close"], + ) + + @staticmethod + def writeToFanE2(bus, loc, rst_arr): + index = 0 + for item in rst_arr: + wbi2cset(bus, loc, index, ord(item)) + index += 1 + + @staticmethod + def writeToE2(bus, loc, rst_arr): + index = 0 + for item in rst_arr: + wbi2cset(bus, loc, index, ord(item)) + index += 1 + + @staticmethod + def getE2File(bus, loc): + return "/sys/bus/i2c/devices/%d-00%02x/eeprom" % (bus, loc) + + +class BMC(): + _instance_lock = threading.Lock() + + def __init__(self): + pass + + def __new__(cls, *args, **kwargs): + if not hasattr(Singleton, "_instance"): + with Singleton._instance_lock: + if not hasattr(Singleton, "_instance"): + Singleton._instance = object.__new__(cls) + return Singleton._instance + + +# Internal interface + + +def getSdkReg(reg): + try: + cmd = "bcmcmd -t 1 'getr %s ' < /dev/null" % reg + ret, result = os_system(cmd) + result_t = result.strip().replace("\r", "").replace("\n", "") + if ret != 0 or "Error:" in result_t: + return False, result + patt = r"%s.(.*):(.*)>drivshell" % reg + rt = re.findall(patt, result_t, re.S) + test = re.findall("=(.*)", rt[0][0])[0] + except Exception as e: + return False, "getsdk register error" + return True, test + + +def getfilevalue(location): + try: + with open(location, "r") as fd: + value = fd.read() + return True, value.strip() + except Exception as e: + return False, "error" + + +def get_sysfs_value(location): + pos_t = str(location) + name = get_pmc_register(pos_t) + return name + + +def write_sysfs_value(reg_name, value): + fileLoc = MAILBOX_DIR + reg_name + try: + if not os.path.isfile(fileLoc): + print(fileLoc, "not found !") + return False + with open(fileLoc, "w") as fd: + fd.write(value) + except Exception as error: + log_error("Unable to open " + fileLoc + "file !") + return False + return True + + +def PRINTERR(str): + print("\033[0;31m%s\033[0m" % str) + + +def strtoint(str): # convert Hex string to int such as "4040"/"0x4040"/"0X4040" = 16448 + value = 0 + rest_v = str.replace("0X", "").replace("0x", "") + for index in range(len(rest_v)): + value |= int(rest_v[index], 16) << ((len(rest_v) - index - 1) * 4) + return value + + +def inttostr(vl, len): # convert int to string such as 0x3030 = 00 + if type(vl) != int: + raise Exception(" type error") + index = 0 + ret_t = "" + while index < len: + ret = 0xFF & (vl >> index * 8) + ret_t += chr(ret) + index += 1 + return ret_t + + +def str_to_hex(rest_v): + value = 0 + for index in range(len(rest_v)): + value |= ord(rest_v[index]) << ((len(rest_v) - index - 1) * 8) + return value + + +def hex_to_str(s): + len_t = len(s) + if len_t % 2 != 0: + return 0 + ret = "" + for t in range(0, int(len_t / 2)): + ret += chr(int(s[2 * t : 2 * t + 2], 16)) + return ret + + +def str_to_bin(s): + return " ".join([bin(ord(c)).replace("0b", "") for c in s]) + + +def bin_to_str(s): + return "".join([chr(i) for i in [int(b, 2) for b in s.split(" ")]]) + + +def get_mac_temp(): + result = {} + # wait_docker() + # exec twice, get the second result + os_system('bcmcmd -t 1 "show temp" < /dev/null') + ret, log = os_system('bcmcmd -t 1 "show temp" < /dev/null') + if ret: + return False, result + else: + # decode obtained info + logs = log.splitlines() + for line in logs: + if "average" in line: + b = re.findall(r"\d+.\d+", line) + result["average"] = b[0] + elif "maximum" in line: + b = re.findall(r"\d+.\d+", line) + result["maximum"] = b[0] + return True, result + + +def get_mac_temp_sysfs(mactempconf): + try: + temp = -1000000 + temp_list = [] + mac_temp_loc = mactempconf.get("loc", []) + mac_temp_flag = mactempconf.get("flag", None) + if mac_temp_flag is not None: # check mac temperature vaild flag + gettype = mac_temp_flag.get("gettype") + okbit = mac_temp_flag.get("okbit") + okval = mac_temp_flag.get("okval") + if gettype == "io": + io_addr = mac_temp_flag.get("io_addr") + val = io_rd(io_addr) + if val is None: + raise Exception("get mac_flag by io failed.") + else: + bus = mac_temp_flag.get("bus") + loc = mac_temp_flag.get("loc") + offset = mac_temp_flag.get("offset") + ind, val = wbi2cget(bus, loc, offset) + if ind is not True: + raise Exception("get mac_flag by i2c failed.") + val_t = (int(val, 16) & (1 << okbit)) >> okbit + if val_t != okval: + raise Exception("mac_flag invalid, val_t:%d." % val_t) + for loc in mac_temp_loc: + temp_s = get_sysfs_value(loc) + if isinstance(temp_s, str) and temp_s.startswith("ERR"): + raise Exception("get mac temp error. loc:%s" % loc) + temp_t = int(temp_s) + if temp_t == -1000000: + raise Exception("mac temp invalid.loc:%s" % loc) + temp_list.append(temp_t) + temp_list.sort(reverse=True) + temp = temp_list[0] + except Exception as e: + return False, temp + return True, temp + + +def restartDockerService(force=False): + container_name = [ + "database", + "snmp", + "syncd", + "swss", + "dhcp_relay", + "radv", + "teamd", + "pmon", + ] + ret, status = os_system("docker ps") + if ret == 0: + for tmpname in container_name: + if tmpname not in status: + if force == True: + os_system("docker restart %s" % tmpname) + else: + os_system("systemctl restart %s" % tmpname) + + +def wait_dhcp(timeout): + time_cnt = 0 + while True: + try: + ret, status = os_system("systemctl status dhcp_relay.service") + if (ret == 0 and "running" in status) or "SUCCESS" in status: + break + else: + sys.stdout.write(".") + sys.stdout.flush() + time_cnt = time_cnt + 1 + if time_cnt > timeout: + raise Exception("wait_dhcp timeout") + time.sleep(1) + except Exception as e: + return False + return True + + +def wait_sdk(sdk_fpath, timeout): + time_cnt = 0 + while True: + try: + if os.path.exists(sdk_fpath): + break + else: + sys.stdout.write(".") + sys.stdout.flush() + time_cnt = time_cnt + 1 + if time_cnt > timeout: + raise Exception("wait_sdk timeout") + time.sleep(1) + except Exception as e: + return False + return True + + +def wait_docker(need_restart=False, timeout=180): + sdkcheck_params = STARTMODULE.get("sdkcheck", {}) + if sdkcheck_params.get("checktype") == "file": # pass file check + sdk_fpath = sdkcheck_params.get("sdk_fpath") + return wait_sdk(sdk_fpath, timeout) + return wait_dhcp(timeout) + + +def getTLV_BODY(type, productname): + x = [] + temp_t = "" + if type == TLV_CODE_MAC_BASE: + arr = productname.split(":") + for tt in arr: + temp_t += chr(int(tt, 16)) + elif type == TLV_CODE_DEVICE_VERSION: + temp_t = chr(productname) + elif type == TLV_CODE_MAC_SIZE: + temp_t = chr(productname >> 8) + chr(productname & 0x00FF) + else: + temp_t = productname + x.append(chr(type)) + x.append(chr(len(temp_t))) + for i in temp_t: + x.append(i) + return x + + +def _crc32(v): + return "0x%08x" % ( + binascii.crc32(v) & 0xFFFFFFFF + ) # get 8 bytes of crc32 %x return hex + + +def printvalue(b): + index = 0 + for i in range(0, len(b)): + if index % 16 == 0: + print(" ") + print("%02x " % ord(b[i])) + index += 1 + print("\n") + + +def generate_value(_t): + ret = [] + for i in TLV_INFO_ID_STRING: + ret.append(i) + ret.append(chr(TLV_INFO_VERSION)) + ret.append(chr(TLV_INFO_LENGTH)) + ret.append(chr(TLV_INFO_LENGTH_VALUE)) + + total_len = 0 + for key in _t: + x = getTLV_BODY(key, _t[key]) + ret += x + total_len += len(x) + ret[10] = chr(total_len + 6) + + ret.append(chr(0xFE)) + ret.append(chr(0x04)) + s = _crc32("".join(ret)) + for t in range(0, 4): + ret.append(chr(int(s[2 * t + 2 : 2 * t + 4], 16))) + totallen = len(ret) + if totallen < 256: + for left_t in range(0, 256 - totallen): + ret.append(chr(0x00)) + return (ret, True) + + +def getsyseeprombyId(id): + ret = get_sys_eeprom() + for item in ret: + if item["code"] == id: + return item + return None + + +def fac_init_cardidcheck(): + rest = getsyseeprombyId(TLV_CODE_CARID) # check cardId same or not + if rest is None: + print("need to program write bin file") + return False + else: + rest_v = rest["value"] + value = strtoint(rest_v) + if value == PLATFORM_CARDID: + log_debug("check card ID pass") + else: + log_debug("check card ID error") + return False + return True + + +def isValidMac(mac): + if re.match(r"^\s*([0-9a-fA-F]{2,2}:){5,5}[0-9a-fA-F]{2,2}\s*$", mac): + return True + return False + + +# Internet cardsetmac + + +def util_setmac(eth, mac): + rulefile = "/etc/udev/rules.d/70-persistent-net.rules" + if isValidMac(mac) == False: + return False, "MAC invaild" + cmd = "ethtool -e %s | grep 0x0010 | awk '{print \"0x\"$13$12$15$14}'" % eth + ret, log = os_system(cmd) + log_debug(log) + magic = "" + if ret == 0 and len(log): + magic = log + macs = mac.upper().split(":") + + # chage ETH0 to value after setmac + ifconfigcmd = "ifconfig eth0 hw ether %s" % mac + log_debug(ifconfigcmd) + ret, status = os_system(ifconfigcmd) + if ret: + raise SETMACException("software set Internet card MAC error") + index = 0 + for item in macs: + cmd = "ethtool -E %s magic %s offset %d value 0x%s" % (eth, magic, index, item) + log_debug(cmd) + index += 1 + ret, log = os_system(cmd) + if ret != 0: + raise SETMACException("set hardware Internet card MAC error") + # get value after setting + cmd_t = "ethtool -e eth0 offset 0 length 6" + ret, log = os_system(cmd_t) + m = re.split(":", log)[-1].strip().upper() + mac_result = m.upper().split(" ") + + for ind, s in enumerate(macs): + if s != mac_result[ind]: + PRINTERR("MAC comparison error") + if os.path.exists(rulefile): + os.remove(rulefile) + print("MGMT MAC[%s]" % mac) + return True + + +def getInputCheck(tips): + str = raw_input(tips) + if ( + astrcmp(str, "y") + or astrcmp(str, "ye") + or astrcmp(str, "yes") + or astrcmp(str, "") + ): + return True + else: + return False + + +def getrawch(): + fd = sys.stdin.fileno() + old_settings = termios.tcgetattr(fd) + try: + tty.setraw(sys.stdin.fileno()) + ch = sys.stdin.read(1) + finally: + termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) + return ch + + +def upper_input(tips): + sys.stdout.write(tips) + sys.stdout.flush() + passwd = [] + while True: + ch = getrawch().upper() + if ch == "\r" or ch == "\n": + return "".join(passwd) + elif ch == "\b" or ord(ch) == 127: + if passwd: + del passwd[-1] + sys.stdout.write("\b \b") + else: + sys.stdout.write(ch) + passwd.append(ch) + +def astrcmp(str1, str2): + return str1.lower() == str2.lower() + + +def generate_ext(cardid): + s = "%08x" % cardid + ret = "" + for t in range(0, 4): + ret += chr(int(s[2 * t : 2 * t + 2], 16)) + ret = chr(0x01) + chr(len(ret)) + ret + return ret + + +def wbi2cget(bus, devno, address): + command_line = "i2cget -f -y %d 0x%02x 0x%02x " % (bus, devno, address) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = os_system(command_line) + if ret == 0: + return True, ret_t + time.sleep(0.1) + return False, ret_t + + +def wbi2cset(bus, devno, address, byte): + command_line = "i2cset -f -y %d 0x%02x 0x%02x 0x%02x" % (bus, devno, address, byte) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = os_system(command_line) + if ret == 0: + return True, ret_t + return False, ret_t + + +def wbpcird(pcibus, slot, fn, bar, offset): + """read pci register""" + if offset % 4 != 0: + return False + filename = "/sys/bus/pci/devices/0000:%02x:%02x.%x/resource%d" % (int(pcibus), int(slot), int(fn), int(bar)) + with open(filename, "r+") as file: + size = os.path.getsize(filename) + data = mmap.mmap(file.fileno(), size) + result = data[offset: offset + 4] + s = result[::-1] + val = 0 + for i in range(0, len(s)): + val = val << 8 | ord(s[i]) + data.close() + return "0x%08x" % val + + +def wbpciwr(pcibus, slot, fn, bar, offset, data): + """write pci register""" + ret = inttostr(data, 4) + filename = "/sys/bus/pci/devices/0000:%02x:%02x.%x/resource%d" % (int(pcibus), int(slot), int(fn), int(bar)) + with open(filename, "r+") as file: + size = os.path.getsize(filename) + data = mmap.mmap(file.fileno(), size) + data[offset: offset + 4] = ret + result = data[offset: offset + 4] + s = result[::-1] + val = 0 + for i in range(0, len(s)): + val = val << 8 | ord(s[i]) + data.close() + + +def wbsysset(location, value): + command_line = "echo 0x%02x > %s" % (value, location) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = os_system(command_line) + if ret == 0: + return True, ret_t + return False, ret_t + + +def wbi2cget_word(bus, devno, address): + command_line = "i2cget -f -y %d 0x%02x 0x%02x w" % (bus, devno, address) + retrytime = 3 + ret_t = "" + for i in range(retrytime): + ret, ret_t = os_system(command_line) + if ret == 0: + return True, ret_t + return False, ret_t + + +def wbi2cset_word(bus, devno, address, byte): + command_line = "i2cset -f -y %d 0x%02x 0x%02x 0x%x w" % (bus, devno, address, byte) + os_system(command_line) + + +def fan_setmac(): + wbi2cset( + FAN_PROTECT["bus"], + FAN_PROTECT["devno"], + FAN_PROTECT["addr"], + FAN_PROTECT["open"], + ) + wbi2cset( + FAN_PROTECT["bus"], + FAN_PROTECT["devno"], + FAN_PROTECT["addr"], + FAN_PROTECT["close"], + ) + + +def checkfansninput(fan_sn, fansntemp): + if fan_sn in fansntemp: + PRINTERR("exist same Serial Number, please input again") + return False + if len(fan_sn) != 13: + PRINTERR("Serial Number length incorrect, please input again") + return False + return True + + +# check hw version +def checkfanhwinput(hw): + if len(hw) != 4: + PRINTERR("hardware version length incorrect, please input again") + return False + if hw.find(".") != 1: + PRINTERR("hardware version incorrect, please input again") + return False + return True + + +def util_show_fanse2(fans): + formatstr = "%-8s %-20s %-20s %-20s %-20s" + print(formatstr % ("id", "Name", "hardware version", "Serial Number", "Time")) + print( + formatstr + % ("------", "---------------", "---------------", "---------------", "----") + ) + for fan in fans: + # print fan.dstatus + if fan.dstatus < 0: + print("%-8s" % ("FAN%d" % (fans.index(fan) + 1))) + PRINTERR(" decode e2 error") + else: + print( + formatstr + % ( + "FAN%d" % (fans.index(fan) + 1), + fan.typename.replace(chr(0x00), ""), + fan.typehwinfo.replace(chr(0x00), ""), + fan.typesn.replace(chr(0x00), ""), + fan.fandecodetime, + ) + ) + + +def get_fane2_sysfs(bus, loc): + wb_fan_e2 = "%d-%04x/fan" % (bus, loc) + eeprom = get_sysfs_value(wb_fan_e2) + return eeprom + + +def util_show_fane2(): + ret = sorted(I2CUTIL.getvaluefromdevice("wb_fan")) + if len(ret) <= 0: + return None + fans = [] + for index in range(len(ret)): + t1 = int(round(time.time() * 1000)) + eeprom = get_fane2_sysfs(ret[index]["bus"], ret[index]["loc"]) + t2 = int(round(time.time() * 1000)) + fane2 = fan_tlv() + fane2.fandecodetime = t2 - t1 + fane2.decode(eeprom) + fans.append(fane2) + util_show_fanse2(fans) + + +def getPid(name): + ret = [] + for dirname in os.listdir("/proc"): + if dirname == "curproc": + continue + try: + with open("/proc/{}/cmdline".format(dirname), mode="rb") as fd: + content = fd.read() + except Exception: + continue + if name in content: + ret.append(dirname) + return ret + + +def fac_fans_setmac_tlv(ret): + if len(ret) <= 0: + return False + fans = [] + fansntemp = [] + for index in range(len(ret)): + item = ret[index] + log_debug(item) + eeprom = get_fane2_sysfs(item["bus"], item["loc"]) + fane2 = fan_tlv() + fane2.decode(eeprom) + fane2.fanbus = item["bus"] + fane2.fanloc = item["loc"] + log_debug("decode eeprom success") + + print("Fan[%d]-[%s]setmac" % ((index + 1), FANS_DEF[fane2.typedevtype])) + while True: + print("Please input[%s]:" % "Serial Number") + fan_sn = raw_input() + if checkfansninput(fan_sn, fansntemp) == False: + continue + fansntemp.append(fan_sn) + fan_sn = fan_sn + chr(0x00) + fane2.typesn = fan_sn + chr(0x00) + break + while True: + print("Please input[%s]:" % "hardware version") + hwinfo = raw_input() + if checkfanhwinput(hwinfo) == False: + continue + fan_hwinfo = hwinfo + chr(0x00) + fane2.typehwinfo = fan_hwinfo + chr(0x00) + break + log_debug(fane2.typedevtype) + fane2.typename = FANS_DEF[fane2.typedevtype] + chr(0x00) + fans.append(fane2) + print("\n") + print("\n*******************************\n") + + util_show_fanse2(fans) + if getInputCheck("check input correctly or not(Yes/No):") == True: + for fan in fans: + log_debug("ouput fan") + fac_fan_setmac(fan) + else: + print("setmac quit") + return False + + +def fac_fan_setmac_fru(ret): + fans = FRULISTS.get("fans") + + fanfrus = {} + newfrus = {} + + # getmsg + try: + for fan in fans: + print("===============%s ================getmessage" % fan.get("name")) + eeprom = getsysvalue(I2CUTIL.getE2File(fan.get("bus"), fan.get("loc"))) + fru = ipmifru() + fru.decodeBin(eeprom) + fanfrus[fan.get("name")] = fru + except Exception as e: + print(str(e)) + return False + + # setmsg + for fan in fans: + print("===============%s ================setmac" % fan.get("name")) + fruold = fanfrus.get(fan.get("name")) + newfru = getInputSetmac(fruold) + newfru.recalcute() + newfrus[fan.get("name")] = newfru + # writemsg + for fan in fans: + print("===============%s ================writeToE2" % fan.get("name")) + ret_t = newfrus.get(fan.get("name")) + I2CUTIL.openFanE2Protect() + I2CUTIL.writeToFanE2(fan.get("bus"), fan.get("loc"), ret_t.bindata) + I2CUTIL.closeFanE2Protect() + # check + try: + for fan in fans: + print("===============%s ================getmessage" % fan.get("name")) + eeprom = getsysvalue(I2CUTIL.getE2File(fan.get("bus"), fan.get("loc"))) + fru = ipmifru() + fru.decodeBin(eeprom) + except Exception as e: + print(str(e)) + return False + return True + + +def fac_fans_setmac(): + ret = I2CUTIL.getvaluefromdevice("wb_fan") + if ret is not None and len(ret) > 0: + return fac_fans_setmac_tlv(ret) + fans = FRULISTS.get("fans", None) + if fans is not None and len(fans) > 0: + return fac_fan_setmac_fru(ret) + return False + + +def fac_fan_setmac(item): + I2CUTIL.openFanE2Protect() + I2CUTIL.writeToFanE2(item.fanbus, item.fanloc, item.generate_fan_value()) + I2CUTIL.closeFanE2Protect() + + +def writeToEEprom(rst_arr): + dealtype = E2_PROTECT.get("gettype", None) + if dealtype is None: + wbi2cset( + E2_PROTECT["bus"], + E2_PROTECT["devno"], + E2_PROTECT["addr"], + E2_PROTECT["open"], + ) + elif dealtype == "io": + io_wr(E2_PROTECT["io_addr"], E2_PROTECT["open"]) + index = 0 + for item in rst_arr: + wbi2cset(E2_LOC["bus"], E2_LOC["devno"], index, ord(item)) + index += 1 + + if dealtype is None: + wbi2cset( + E2_PROTECT["bus"], + E2_PROTECT["devno"], + E2_PROTECT["addr"], + E2_PROTECT["close"], + ) + elif dealtype == "io": + io_wr(E2_PROTECT["io_addr"], E2_PROTECT["close"]) + # deal last drivers + os.system("rmmod at24 ") + os.system("modprobe at24 ") + os.system("rm -f /var/cache/sonic/decode-syseeprom/syseeprom_cache") + + +def get_local_eth0_mac(): + cmd = "ifconfig eth0 |grep HWaddr" + print(os_system(cmd)) + + +def getonieversion(): + if not os.path.isfile("/host/machine.conf"): + return "" + machine_vars = {} + with open("/host/machine.conf") as machine_file: + for line in machine_file: + tokens = line.split("=") + if len(tokens) < 2: + continue + machine_vars[tokens[0]] = tokens[1].strip() + return machine_vars.get("onie_version") + + +def createbmcMac(cpumac, num=2): + bcmvalue = strtoint(cpumac[cpumac.rindex(":") + 1 : len(cpumac)]) + num + # bmcmac = + t = cpumac.split(":") + t[5] = "%02x" % bcmvalue + bmcmac = ":".join(t) + return bmcmac.upper() + +def ipmi_set_mac(mac): + macs = mac.split(":") + cmdinit = "ipmitool raw 0x0c 0x01 0x01 0xc2 0x00" + cmdset = "ipmitool raw 0x0c 0x01 0x01 0x05" + for ind in range(len(macs)): + cmdset += " 0x%02x" % int(macs[ind], 16) + os_system(cmdinit) + ret, status = os_system(cmdset) + if ret: + PRINTERR("\n\n%s\n\n" % status) + return False + return True + + +def getInputValue(title, tips): + print("Please input[%s]such as(%s):" % (title, tips)) + name = raw_input() + + return name + + +def bmc_setmac(): + tips = "BMC MAC" + print("Please input value you want to change[%s]:" % tips) + name = raw_input() + if len(name) != 12: + PRINTERR("\nMAC address invaild, try again\n") + return False + release_mac = "" + for i in range(int(len(name) / 2)): + if i == 0: + release_mac += name[i * 2 : i * 2 + 2] + else: + release_mac += ":" + name[i * 2 : i * 2 + 2] + if isValidMac(release_mac) == True: + if ipmi_set_mac(release_mac) == True: + return True + else: + PRINTERR("\nMAC address invaild, try again\n") + return False + + +def closeProtocol(): + # disable LLDP + log_info("disable LLDP") + sys.stdout.write(".") + sys.stdout.flush() + os_system("systemctl stop lldp.service") + log_info("disable lldp service") + sys.stdout.write(".") + sys.stdout.flush() + os_system("systemctl stop bgp.service") + log_info("disable bgp service") + sys.stdout.write(".") + sys.stdout.flush() + # ret, status = os_system('bcmcmd "port ce,xe stp=disable"') + + +# check SDK memory must be 256M + + +def checkSdkMem(): + ind = 0 + file_data = "" + with open(file_name, "r") as f: + for line in f: + if "dmasize=16M" in line: + line = line.replace("dmasize=16M", "dmasize=256M") + ind = -1 + file_data += line + if ind == 0: + return + with open(file_name, "w") as f: + f.write(file_data) + print("change SDK memory to 256, reboot required") + os_system("sync") + os_system("reboot") + + +########################################################################## +# receives a character setting +########################################################################## + + +def getch(msg): + ret = "" + fd = sys.stdin.fileno() + old_ttyinfo = termios.tcgetattr(fd) + new_ttyinfo = old_ttyinfo[:] + new_ttyinfo[3] &= ~termios.ICANON + new_ttyinfo[3] &= ~termios.ECHO + sys.stdout.write(msg) + sys.stdout.flush() + try: + termios.tcsetattr(fd, termios.TCSANOW, new_ttyinfo) + ret = os.read(fd, 1) + finally: + # print "try to setting" + termios.tcsetattr(fd, termios.TCSANOW, old_ttyinfo) + return ret + + +def get_raw_input(): + ret = "" + fd = sys.stdin.fileno() + old_ttyinfo = termios.tcgetattr(fd) + new_ttyinfo = old_ttyinfo[:] + new_ttyinfo[3] &= ~termios.ICANON + new_ttyinfo[3] &= ~termios.ECHO + try: + termios.tcsetattr(fd, termios.TCSANOW, new_ttyinfo) + ret = raw_input("") + except Exception as e: + print(e) + finally: + termios.tcsetattr(fd, termios.TCSANOW, old_ttyinfo) + return ret + + +def getsysvalue(location): + retval = None + mb_reg_file = location + if not os.path.isfile(mb_reg_file): + print(mb_reg_file, "not found !") + return retval + try: + if not os.path.isfile(mb_reg_file): + print(mb_reg_file, "not found !") + return retval + with open(mb_reg_file, "r") as fd: + retval = fd.read() + except Exception as error: + log_error("Unable to open " + mb_reg_file + "file !") + retval = retval.rstrip("\r\n") + retval = retval.lstrip(" ") + # log_debug(retval) + return retval + + +# get file value + + +def get_pmc_register(reg_name): + retval = "ERR" + mb_reg_file = MAILBOX_DIR + reg_name + filepath = glob.glob(mb_reg_file) + if len(filepath) == 0: + return "%s %s notfound" % (retval, mb_reg_file) + mb_reg_file = filepath[0] + if not os.path.isfile(mb_reg_file): + return "%s %s notfound" % (retval, mb_reg_file) + try: + with open(mb_reg_file, "r") as fd: + retval = fd.read() + except Exception as error: + print("error") + retval = retval.rstrip("\r\n") + retval = retval.lstrip(" ") + return retval + + +# decode EEPROM + + +def decoder(s, t): + if ord(t[0]) == TLV_CODE_PRODUCT_NAME: + name = "Product Name" + value = str(t[2 : 2 + ord(t[1])]) + elif ord(t[0]) == TLV_CODE_PART_NUMBER: + name = "Part Number" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_SERIAL_NUMBER: + name = "Serial Number" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_MAC_BASE: + name = "Base MAC Address" + value = ":".join([binascii.b2a_hex(T) for T in t[2:8]]).upper() + elif ord(t[0]) == TLV_CODE_MANUF_DATE: + name = "Manufacture Date" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_DEVICE_VERSION: + name = "Device Version" + value = str(ord(t[2])) + elif ord(t[0]) == TLV_CODE_LABEL_REVISION: + name = "Label Revision" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_PLATFORM_NAME: + name = "Platform Name" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_ONIE_VERSION: + name = "ONIE Version" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_MAC_SIZE: + name = "MAC Addresses" + value = str((ord(t[2]) << 8) | ord(t[3])) + elif ord(t[0]) == TLV_CODE_MANUF_NAME: + name = "Manufacturer" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_MANUF_COUNTRY: + name = "Manufacture Country" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_VENDOR_NAME: + name = "Vendor Name" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_DIAG_VERSION: + name = "Diag Version" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_SERVICE_TAG: + name = "Service Tag" + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_VENDOR_EXT: + name = "Vendor Extension" + value = "" + if _TLV_DISPLAY_VENDOR_EXT: + value = t[2 : 2 + ord(t[1])] + elif ord(t[0]) == TLV_CODE_CRC_32 and len(t) == 6: + name = "CRC-32" + value = "0x%08X" % ( + ((ord(t[2]) << 24) | (ord(t[3]) << 16) | (ord(t[4]) << 8) | ord(t[5])), + ) + elif ord(t[0]) == TLV_CODE_CARID: + name = "board_cardid" + value = "" + for c in t[2 : 2 + ord(t[1])]: + value += "%02X" % (ord(c),) + else: + name = "Unknown" + value = "" + for c in t[2 : 2 + ord(t[1])]: + value += "0x%02X " % (ord(c),) + return {"name": name, "code": ord(t[0]), "value": value} + + +def decode_eeprom(e): + total_len = (ord(e[9]) << 8) | ord(e[10]) + tlv_index = _TLV_INFO_HDR_LEN + tlv_end = _TLV_INFO_HDR_LEN + total_len + ret = [] + while (tlv_index + 2) < len(e) and tlv_index < tlv_end: + rt = decoder(None, e[tlv_index : tlv_index + 2 + ord(e[tlv_index + 1])]) + ret.append(rt) + if ord(e[tlv_index]) == TLV_CODE_CRC_32: + break + tlv_index += ord(e[tlv_index + 1]) + 2 + for item in ret: + if item["code"] == TLV_CODE_VENDOR_EXT: + rt = decoder(None, item["value"][0 : 0 + 2 + ord(item["value"][0 + 1])]) + ret.append(rt) + return ret + + +def get_sys_eeprom(): + eeprom = get_sysfs_value(wb_eeprom) + return decode_eeprom(eeprom) + + +# get card ID +def getCardId(): + ret = get_sys_eeprom() + for item in ret: + if item["code"] == TLV_CODE_CARID: + return item.get("value", None) + return None + + +# ==================================== +# execute shell command +# ==================================== +def os_system(cmd): + status, output = commands.getstatusoutput(cmd) + return status, output + + +########################################### +# get memory slot and number via DMI command +########################################### +def getsysmeminfo(): + ret, log = os_system("which dmidecode ") + if ret != 0 or len(log) <= 0: + error = "cmd find dmidecode" + return False, error + cmd = log + '|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range' + # get total number first + result = [] + ret1, log1 = os_system(cmd) + if ret1 == 0 and len(log1): + log1 = log1.lstrip() + arr = log1.split("\n") + # total = len(arr) # total slot number + for i in range(len(arr)): + val = re.sub("\D", "", arr[i]) + if val == "": + val = arr[i].lstrip() + val = re.sub("Size:", "", val).lstrip() + # print val + result.append({"slot": i + 1, "size": val}) + return True, result + return False, "error" + + +########################################### +# get memory slot and number via DMI command +# return various arrays +########################################### +def getsysmeminfo_detail(): + ret, log = os_system("which dmidecode ") + if ret != 0 or len(log) <= 0: + error = "cmd find dmidecode" + return False, error + cmd = log + ' -t 17 | grep -A21 "Memory Device"' # 17 + # get total number + ret1, log1 = os_system(cmd) + if ret1 != 0 or len(log1) <= 0: + return False, "command execution error[%s]" % cmd + result_t = log1.split("--") + mem_rets = [] + for item in result_t: + its = item.replace("\t", "").strip().split("\n") + ret = {} + for it in its: + if ":" in it: + key = it.split(":")[0].lstrip() + value = it.split(":")[1].lstrip() + ret[key] = value + mem_rets.append(ret) + return True, mem_rets + + +########################################### +# get BIOS info via DMI command +########################################### +def getDmiSysByType(type_t): + ret, log = os_system("which dmidecode ") + if ret != 0 or len(log) <= 0: + error = "cmd find dmidecode" + return False, error + cmd = log + " -t %s" % type_t + # get total number + ret1, log1 = os_system(cmd) + if ret1 != 0 or len(log1) <= 0: + return False, "command execution error[%s]" % cmd + its = log1.replace("\t", "").strip().split("\n") + ret = {} + for it in its: + if ":" in it: + key = it.split(":")[0].lstrip() + value = it.split(":")[1].lstrip() + ret[key] = value + return True, ret + + +def gethwsys(): + return getDmiSysByType(1) + + +########################################### +# get BIOS info via DMI command + + +def getsysbios(): + return getDmiSysByType(0) + + +def searchDirByName(name, dir): + result = [] + try: + files = os.listdir(dir) + for file in files: + if name in file: + result.append(os.path.join(dir, file)) + except Exception as e: + print(str(e)) + return result + + +def getUsbLocation(): + dir = "/sys/block/" + spect = "sd" + usbpath = "" + result = searchDirByName(spect, dir) + if len(result) <= 0: + return False, usbpath + for item in result: + with open(os.path.join(item, "removable"), "r") as fd: + value = fd.read() + if value.strip() == "1": # U-Disk found + usbpath = item + break + if usbpath == "": # no U-Disk found + log_debug("no usb found") + return False, usbpath + return True, usbpath + + +# judge USB file +def getusbinfo(): + ret, path = getUsbLocation() + if ret == False: + return False, "not usb exists" + str = os.path.join(path, "size") + ret, value = getfilevalue(str) + if ret == True: + return ( + True, + { + "id": os.path.basename(path), + "size": float(value) * 512 / 1024 / 1024 / 1024, + }, + ) + else: + return False, "Err" + + +def get_cpu_info(): + cmd = "cat /proc/cpuinfo |grep processor -A18" # 17 + + ret, log1 = os_system(cmd) + if ret != 0 or len(log1) <= 0: + return False, "command execution error[%s]" % cmd + result_t = log1.split("--") + mem_rets = [] + for item in result_t: + its = item.replace("\t", "").strip().split("\n") + ret = {} + for it in its: + if ":" in it: + key = it.split(":")[0].lstrip() + value = it.split(":")[1].lstrip() + ret[key] = value + mem_rets.append(ret) + return True, mem_rets + +def io_rd(reg_addr, size=1): + path = "/dev/port" + ret = "" + fd = None + try: + reg_addr = int(reg_addr) + fd = os.open(path, os.O_RDWR|os.O_CREAT) + for i in range(size): + os.lseek(fd, reg_addr+i, os.SEEK_SET) + ret+="{:02x}".format(ord(os.read(fd, 1).decode('latin-1'))) + return ret + except Exception as e: + print(str(e)) + return None + finally: + if fd: os.close(fd) + + +def io_wr(reg_addr, reg_data): + u"""io write""" + fd = None + try: + regdata = 0 + regaddr = 0 + if type(reg_addr) == int: + regaddr = reg_addr + else: + regaddr = int(reg_addr, 16) + if type(reg_data) == int: + regdata = reg_data + else: + regdata = int(reg_data, 16) + devfile = "/dev/port" + fd = os.open(devfile, os.O_RDWR | os.O_CREAT) + os.lseek(fd, regaddr, os.SEEK_SET) + os.write(fd, regdata.to_bytes(2, 'little')) + return True + except ValueError as e: + print(e) + return False + except Exception as e: + print(e) + return False + finally: + if fd: os.close(fd) diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/script/sensors b/platform/centec-arm64/sonic-platform-modules-micas/common/script/sensors new file mode 100755 index 000000000000..a2c72b123a43 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/script/sensors @@ -0,0 +1,8 @@ +#!/bin/bash +#docker exec -i pmon sensors "$@" + + +#To probe sensors not part of lm-sensors +if [ -r /usr/local/bin/platform_sensors.py ]; then + python /usr/local/bin/platform_sensors.py +fi diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/service/device_i2c.service b/platform/centec-arm64/sonic-platform-modules-micas/common/service/device_i2c.service new file mode 100644 index 000000000000..94ddaaad1e41 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/service/device_i2c.service @@ -0,0 +1,15 @@ +[Unit] +Description= Platform Global Initialize I2c drivers. +After=local-fs.target +Before=pmon.service ntp.service +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/device_i2c.py start +ExecStop=/usr/local/bin/device_i2c.py stop +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common/service/fancontrol.service b/platform/centec-arm64/sonic-platform-modules-micas/common/service/fancontrol.service new file mode 100644 index 000000000000..aa686c9f9d79 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common/service/fancontrol.service @@ -0,0 +1,12 @@ +[Unit] +Description= Fancontrol for Device. +After=privatenetwork.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/fancontrol.py start +Restart=on-failure + +[Install] +WantedBy=multi-user.target + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/Makefile b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/Makefile new file mode 100644 index 000000000000..320229073791 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/Makefile @@ -0,0 +1,24 @@ +PWD = $(shell pwd) +EXTRA_CFLAGS:= -I$(M)/include +EXTRA_CFLAGS+= -Wall +SUB_BUILD_DIR = $(PWD)/build +SERVICE_DIR = $(PWD)/service +INSTALL_DIR = $(SUB_BUILD_DIR)/$(KERNEL_SRC)/$(INSTALL_MOD_DIR) +INSTALL_SCRIPT_DIR = $(SUB_BUILD_DIR)/usr/local/bin +INSTALL_LIB_DIR = $(SUB_BUILD_DIR)/usr/lib/python3.9/dist-packages +INSTALL_SERVICE_DIR = $(SUB_BUILD_DIR)/lib/systemd/system +INSTALL_ETC_DIR = $(SUB_BUILD_DIR)/etc +UNSUPPORT_KERVER = 4.9.189 + +all: + @if [ ! -d ${INSTALL_LIB_DIR} ]; then mkdir -p ${INSTALL_LIB_DIR} ;fi + @if [ -d $(PWD)/lib/ ]; then cp -r $(PWD)/lib/* ${INSTALL_LIB_DIR} ;fi + @if [ ! -d ${INSTALL_SCRIPT_DIR} ]; then mkdir -p ${INSTALL_SCRIPT_DIR} ;fi + @if [ -d $(PWD)/script/ ]; then cp -r $(PWD)/script/* ${INSTALL_SCRIPT_DIR} ;fi + @if [ ! -d ${INSTALL_ETC_DIR} ]; then mkdir -p ${INSTALL_ETC_DIR} ;fi + @if [ -d $(INSTALL_SCRIPT_DIR) ]; then chmod +x $(INSTALL_SCRIPT_DIR)/* ;fi + @if [ ! -d ${INSTALL_SERVICE_DIR} ]; then mkdir -p ${INSTALL_SERVICE_DIR} ;fi + if [ -d $(SERVICE_DIR) ]; then cp -r $(SERVICE_DIR)/* $(INSTALL_SERVICE_DIR) ;fi +clean: + rm -rf $(SUB_BUILD_DIR) + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/logutil/__init__.py b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/logutil/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/logutil/logutil.py b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/logutil/logutil.py new file mode 100644 index 000000000000..0d9f6ff94c10 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/logutil/logutil.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- +import os +import syslog +import logging +import subprocess +import shlex + +SYSLOG_IDENTIFIER = "LOGUTIL" + +# ========================== Syslog wrappers ========================== + +def log_info(msg,log_type=SYSLOG_IDENTIFIER, also_print_to_console=False): + syslog.openlog(log_type) + syslog.syslog(syslog.LOG_INFO, msg) + syslog.closelog() + + if also_print_to_console: + click.echo(msg) + + +def log_debug(msg, log_type=SYSLOG_IDENTIFIER, also_print_to_console=False): + try: + syslog.openlog(log_type) + syslog.syslog(syslog.LOG_DEBUG, msg) + syslog.closelog() + + if also_print_to_console: + click.echo(msg) + except Exception as e: + print(str(e)) + + +def log_warning(msg, log_type=SYSLOG_IDENTIFIER, also_print_to_console=False): + syslog.openlog(log_type) + syslog.syslog(syslog.LOG_WARNING, msg) + syslog.closelog() + + if also_print_to_console: + click.echo(msg) + +def log_error(msg, log_type=SYSLOG_IDENTIFIER, also_print_to_console=False): + syslog.openlog(log_type) + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + if also_print_to_console: + click.echo(msg) + +restful_logger_path = "/var/log/bmc_restful.log" +def bmc_restful_logger(message): + if not os.path.isfile(restful_logger_path): + cmd = "sudo touch %s && sudo chmod +x %s" % ( + restful_logger_path, restful_logger_path) + subprocess.Popen( + shlex.split(cmd), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + + logging.basicConfig(filename=restful_logger_path, + filemode='a', + format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s', + datefmt='%H:%M:%S', + level=logging.INFO) + + logging.info(message) diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/redfishutil/redfish_api.py b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/redfishutil/redfish_api.py new file mode 100644 index 000000000000..76b2c1ba6a24 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/redfishutil/redfish_api.py @@ -0,0 +1,304 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +import shlex +import datetime +import os +import ssl +import subprocess +import syslog + +class Redfish_Api(): + BmcBaseUrl = 'http://240.1.1.1:8080' + ThermalUrl = '/redfish/v1/Chassis/1/Thermal' + PowerUrl = '/redfish/v1/Chassis/1/Power' + ThresholdSensorsUrl = '/redfish/v1/Chassis/1/ThresholdSensors' + FanSpeedUrl = '/redfish/v1/Chassis/1/Thermal/Actions/Oem/OpenBmc/Fan.SetSpeed' + BoardsUrl = '/redfish/v1/Chassis/1/Boards/' + BoardLedUrl = "/redfish/v1/Chassis/1/Boards/{}/Actions/Oem/OpenBmc/Boards.SetLED" + + # Maximum time in seconds that you allow the connection to the server to take. + connect_timeout = 30 + # Maximum time in seconds that you allow the whole operation to take + operation_timeout = 300 + + default_prefix='/redfish/v1/' + session = None + __DEBUG__ = "N" + __DUMP_RESP__ = "N" + RST_STATUS = "status" + RST_SUCCESS = "OK" + refish_logger = None + + def redfish_log_debug(self, msg): + if (self.__DEBUG__ == "Y"): + syslog.openlog("redfis_api") + syslog.syslog(syslog.LOG_DEBUG, msg) + syslog.closelog() + + def redfish_log_error(self, msg): + syslog.openlog("redfish_api") + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + def __init__(self): + pass + + def get_full_url(self, url): + return self.BmcBaseUrl + url + + def _exec_cmd(self, cmd): + self.redfish_log_debug("Cmd: %s" % cmd) + p = subprocess.Popen(shlex.split(cmd), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p.wait() + self.redfish_log_debug("Cmd return: %d" % p.returncode) + str_stdout = p.stdout.read().decode('utf-8') + str_stderr = p.stderr.read().decode('utf-8') + self.redfish_log_debug("Cmd stdout: %s" % str_stdout) + if p.returncode !=0: + self.redfish_log_error("Cmd: %s, failed! error msg:%s" % (cmd, str_stderr)) + return None + else: + try: + ret = json.loads(str_stdout) + return ret + except Exception as e: + self.redfish_log_error("Cmd: %s, failed! stdout msg:%s" % (cmd, str_stdout)) + return None + + def _redfish_get(self, url): + self.redfish_log_debug("Get info from %s." % url) + result = None + try: + cmd_get="curl --connect-timeout %d -m %d -X GET %s" % (self.connect_timeout, self.operation_timeout, self.get_full_url(url)) + result = self._exec_cmd(cmd_get) + return result + except Exception as e: + self.redfish_log_error("error_message: %s" % e) + return None + + def _redfish_post(self, url, playload): + self.redfish_log_debug("post url: %s" % url) + self.redfish_log_debug("Playload: %s" % playload) + + playload_json = json.dumps(playload) + result = False + try: + cmd_post="curl --connect-timeout %d -m %d -X POST %s -d \'%s\'" % (self.connect_timeout, self.operation_timeout, self.get_full_url(url), playload_json) + ret_msg = self._exec_cmd(cmd_post) + if ret_msg == None: + return False + elif ret_msg["success"] == False: + self.redfish_log_error("Url: '%s', Playload: '%s', Bmc return failed, error_message: %s" % (url, playload_json, ret_msg["Message"])) + result = False + else: + result = True + return result + except Exception as e: + self.redfish_log_error("error_message: %s" % e) + return False + + def get_thermal(self): + """Get thermal info + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.ThermalUrl) + + def get_power(self): + """Get power info + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.PowerUrl) + + def get_thresholdSensors(self): + """Get thresholdSensors info + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.ThresholdSensorsUrl) + + def post_odata(self, odata_id, playload): + """post odata info + :params odata_id: the specified odata_id path + :type odata_id: string + :playload: info to post + :type: dictionary + :returns: True or False + """ + if odata_id is None or playload is None: + print("post failed: odata_id or playload is None") + return False + return self._redfish_post(odata_id, playload) + + def get_odata(self, odata_id): + """Get odata info + :params odata_id: the specified odata_id path + :type odata_id: string + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + if odata_id is None: + print("Get odata_id failed: odata_id is None") + return None + return self._redfish_get(odata_id) + + def post_fanSpeed(self, playload): + """post odata info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post failed: playload is None") + return False + return self._redfish_post(self.FanSpeedUrl, playload) + + def get_board(self, board_name="indicatorboard"): + """Get board info + :board_name: name of board, default is "indicatorboard" + :type: string + :returns: class'redfish.rest.v1.RestResponse' or None when failed + """ + if board_name is None : + print("get failed: board_name is None") + return None + return self._redfish_get(self.BoardsUrl + board_name) + + def post_boardLed(self, playload, board_name="indicatorboard"): + """post boardLed info + :board_name: name of board, default is "indicatorboard" + :type: string + :playload: info to post + :type: dictionary + :returns: True or False + """ + if board_name is None or playload is None: + print("post failed: playload is None") + return False + return self._redfish_post(self.BoardLedUrl.format(board_name), playload) + + ''' not supported currently + def post_thermal(self, playload): + """post thermal info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post_thermal failed: playload is None") + return None + return self._redfish_post(self.ThermalUrl, playload) + + def post_power(self, playload): + """post power info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post_power failed: playload is None") + return None + return self._redfish_post(self.PowerUrl, playload) + + def post_thresholdSensors(self, playload): + """post thresholdSensors info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post_thresholdSensors failed: playload is None") + return None + return self._redfish_post(self.ThresholdSensorsUrl, playload) + + def get_fanSpeed(self): + """Get board led info + :returns: class'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.FanSpeedUrl) + + def post_board(self, playload, board_name="indicatorboard"): + """post board info + :board_name: name of board, default is "indicatorboard" + :type: string + :playload: info to post + :type: dictionary + :returns: True or False + """ + if board_name is None or playload is None: + print("post failed: playload is None") + return False + return self._redfish_post(self.BoardsUrl + board_name, playload) + + def get_boardLed(self, board_name="indicatorboard"): + """Get boardLed info + :board_name: name of board, default is "indicatorboard" + :type: string + :returns: class'redfish.rest.v1.RestResponse' or None when failed + """ + if board_name is None : + print("get failed: board_name is None") + return None + return self._redfish_get(self.BoardsUrl % board_name) + + ''' + +''' +if __name__ == '__main__': + redfish = Redfish_Api() + + ### get + # boards + ret = redfish.get_board() + if ret is None: + print("get failed: board") + else: + print("get succeeded, board:%s" % ret) + + ret = redfish.get_thresholdSensors() + if ret is None: + print("get failed: threshold") + else: + print("get succeeded, threshold:%s" % ret) + + ret = redfish.get_power() + if ret is None: + print("get failed: power") + else: + print("get succeeded, power:%s" % ret) + + ret = redfish.get_thermal() + if ret is None: + print("get failed:thermal") + else: + print("get succeeded,thermal:%s" % ret) + + # get playload + resp = redfish.get_thresholdSensors() + if (resp != None): + print(resp["@odata.id"]) + print(resp["@odata.type"]) + print(resp["Id"]) + print(resp["Name"]) + else: + print("Failed: get_thresholdSensors") + + ### post + # fanSpeed + playload = {} + playload["FanName"] = 'Fan0' + playload["FanSpeedLevelPercents"] = "70" + print("post fanSpeed:%s" % redfish.post_fanSpeed(playload)) + + #{"LEDs": [{"IndicatorLEDColor": "green","LEDType": "sys"},{"IndicatorLEDColor": "off","LEDType": "pwr"},{"IndicatorLEDColor": "green","LEDType": "fan"}]} + playload = {} + led = {} + led1 = {} + led_list = [] + led["IndicatorLEDColor"] = "green" + led["LEDType"] = "sys" + led1["IndicatorLEDColor"] = "off" + led1["LEDType"] = "pwr" + led_list.append(led) + led_list.append(led1) + playload["LEDs"] = led_list + # boardsLed + print("post boardLed:%s" % redfish.post_boardLed(playload)) +''' diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/sonic_fwmgr/__init__.py b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/sonic_fwmgr/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/sonic_fwmgr/fwgmr_base.py b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/sonic_fwmgr/fwgmr_base.py new file mode 100644 index 000000000000..50a4ca7bc675 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/sonic_fwmgr/fwgmr_base.py @@ -0,0 +1,141 @@ +# fwgmr_base.py +# +# Base class for creating platform-specific firmware management interfaces for SONiC +# +try: + import abc +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + +class FwMgrUtilBase(object): + + """Base class for Platform-specific FwMgrUtil class""" + __metaclass__ = abc.ABCMeta + + def __init__(self): + """TODO: to be defined1. """ + pass + + @abc.abstractmethod + def get_bmc_version(self): + """Get BMC version from SONiC + :returns: version string + """ + return + + @abc.abstractmethod + def get_cpld_version(self): + """Get CPLD version from SONiC + :returns: dict like {'CPLD_1': version_string, 'CPLD_2': version_string} + """ + return + + @abc.abstractmethod + def get_onie_version(self): + """Get ONiE version from SONiC + :returns: version string + """ + return + + @abc.abstractmethod + def get_uboot_version(self): + """Get UBOOT version from SONiC + :returns: version string + """ + return + + # @fw_type MANDATORY, firmware type, should be one of the strings: 'cpld', 'fpga', 'bios', 'bmc' + # @fw_path MANDATORY, target firmware file + # @fw_extra OPTIONAL, extra information string, + # for fw_type 'cpld' and 'fpga': it can be used to indicate specific cpld, such as 'cpld1', 'cpld2', ... + # or 'cpld_fan_come_board', etc. For fw_type 'bios' and 'bmc', value should be one of 'master' + # or 'slave' or 'both'. For BMC, 'pingpong' stands for alternative upgrade policy. + @abc.abstractmethod + def firmware_upgrade(self, fw_type, fw_path, fw_extra): + return + + # Get last firmware upgrade information, inlcudes: + # 1) FwType: cpld/fpga/bios/bmc(passed by method 'firmware_upgrade'), string + # 2) FwPath: path and file name of firmware(passed by method 'firmware_upgrade'), string + # 3) FwExtra: designated string, econdings of this string is determined by vendor(passed by method 'firmware_upgrade') + # 4) Result: indicates whether the upgrade action is performed and success/failure status if performed. Values should be one of: "DONE"/"FAILED"/"NOT_PERFORMED". + # dict object: + # { + # "FwType": "cpld", + # "FwExtra": "specific_encoded_string" + # "Result": "DONE"/"FAILED"/"NOT_PERFORMED" + # } + @abc.abstractmethod + def get_last_upgrade_result(self): + return + + # Program FPGA and/or CPLD firmware only, but do not refresh them + # + # @param fw_type value can be: FPGA, CPLD + # @param fw_path a string of firmware file path, seperated by ':' + # @param fw_extra a string of firmware subtype, i.e CPU_CPLD, BOARD_CPLD, + # FAN_CPLD, LC_CPLD, etc. Subtypes are seperated by ':', + # the sequence should match the file nanmes in param @fw_path + # @return True when all required firmware is program succefully, + # False otherwise. + # + # Example: + # self.firmware_program("CPLD", "/cpu_cpld.vme:/lc_cpld", \ + # "CPU_CPLD:LC_CPLD") + # or + # self.firmware_program("FPGA", "/fpga.bin", "FPGA") + @abc.abstractmethod + def firmware_program(self, fw_type, fw_path, fw_extra=None): + return + + # Refresh firmware and take extra action when necessary. + # @param fpga_list a list of FPGA names + # @param cpld_list a list of CPLD names + # @return True if refresh succefully + # + # @Note extra action: + # 1) response OK to restful call + # 2) shutdown eth0.4088(keep eth0 working) + # 3) shutdown SFP power + # 4) power off all(CPU, switch, gearbox) + # 5) if power off fpga is supported: + # power off fpga + # else: + # refresh fpga + # 6) refresh linecard cpld, fan cpld + # 7) refresh cpu cpld, baseboard cpld + # 8) power on all + # 9) bring up eth0.4088 + # + # Example: + # self.firmware_refresh(["FPGA"], ["CPU_CPLD", "LC_CPLD"], "/tmp/fw/refresh.vme") + # or + # self.firmware_refresh(["FPGA"], None, None) + # or + # self.firmware_refresh(None, ["FAN_CPLD", "LC1_CPLD", "BOARD_CPLD"], "/tmp/fw/refresh.vme") + @abc.abstractmethod + def firmware_refresh(self, fpga_list, cpld_list, fw_extra=None): + return + + # Get booting flash of running BMC. + # @return a string, "master" or "slave" + @abc.abstractmethod + def get_running_bmc(self): + return + + # Set booting flash of BMC + # @param flash should be "master" or "slave" + @abc.abstractmethod + def set_bmc_boot_flash(self, flash): + return + + # Reboot BMC + @abc.abstractmethod + def reboot_bmc(self): + return + + # Get booting uboot image of current running host OS + # @return a string, "master" or "slave" + @abc.abstractmethod + def get_current_uboot(self): + return diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/wbutil/__init__.py b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/wbutil/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/wbutil/platformutil.py b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/wbutil/platformutil.py new file mode 100644 index 000000000000..d5c3e7a4edd3 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/lib/wbutil/platformutil.py @@ -0,0 +1,290 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +import os +import re +import time +import mmap +configfile_pre = "/usr/local/bin/" +import sys +sys.path.append(configfile_pre) +from platform_config import * +import subprocess +import pexpect +import shlex + +SYSLOG_IDENTIFIER = "UTILTOOL" + +def os_system(cmd): + status, output = subprocess.getstatusoutput(cmd) + return status, output + +def get_machine_info(): + if not os.path.isfile('/host/machine.conf'): + return None + machine_vars = {} + with open('/host/machine.conf') as machine_file: + for line in machine_file: + tokens = line.split('=') + if len(tokens) < 2: + continue + machine_vars[tokens[0]] = tokens[1].strip() + return machine_vars + +def get_platform_info(machine_info): + if machine_info != None: + if machine_info.__contains__('onie_platform'): + return machine_info['onie_platform'] + elif machine_info.__contains__('aboot_platform'): + return machine_info['aboot_platform'] + return None + +''' +def cpld_version_restful(url): + if url == "" or len(url) <=0: + print("invalid url") + return + bmc = BMCMessage() + value = bmc.getBmcValue(url) + json_dicts=json.dumps(value,indent=4) + return json_dicts +''' + +def lpc_cpld_rd(reg_addr): + try: + regaddr = 0 + if type(reg_addr) == int: + regaddr = reg_addr + else: + regaddr = int(reg_addr, 16) + devfile = "/dev/lpc_cpld" + fd = os.open(devfile, os.O_RDWR|os.O_CREAT) + os.lseek(fd, regaddr, os.SEEK_SET) + str = os.read(fd, 1) + os.close(fd) + return "%02x" % ord(str) + except ValueError: + return None + except Exception as e: + print (e) + return None + + +def my_log(txt): + if DEBUG == True: + print ("[PLATFORM]:",) + print (txt) + return + +def log_os_system(cmd, show): + my_log (' Run :'+ cmd) + status, output = subprocess.getstatusoutput(cmd) + my_log (" with result :" + str(status)) + my_log (" output :" + output) + if status: + log_error('Failed :%s msg:%s'%(cmd,output)) + if show: + print ('Failed :'+ cmd) + return status, output + +def password_command(cmd, password, exec_timeout=30): + + newkey = 'continue connecting' + log_os_system("rm -rf ~/.ssh", 0) + msg = "" + try_times = 3 + try_times_conter = try_times + while try_times_conter: + child = pexpect.spawn(cmd) + if try_times != try_times_conter: + time.sleep(5) + try_times_conter -= 1 + try: + i = child.expect([pexpect.TIMEOUT, newkey, 'password: ',"refused",pexpect.EOF],timeout=30) + # If the login times out, print an error message and exit. + if i == 0: # Timeout + msg = 'connect to BMC timeout' + continue + # no public key + if i == 1: + child.sendline ('yes') + i = child.expect([pexpect.TIMEOUT, 'password: '],timeout=30) + if i == 0: # Timeout + msg = 'connect to BMC timeout' + continue + if i == 1:# Go below and enter the logic of the password + i = 2 + if i == 2: # Enter the password + child.sendline (password) + i = child.expect([pexpect.EOF, pexpect.TIMEOUT], exec_timeout) + if i == 0: + return True,child.before + if i == 1: + msg = str(child.before)+"\nBMC run commands timeout" + return False,msg + if i == 3: # BMC Connection refused + msg = 'connect to BMC failed' + continue + if i == 4: + msg = child.before + except Exception as e: + msg = str(child.before)+"\nconnect to BMC failed" + + return False,msg + +def password_command_realtime(ssh_header, ssh_cmd, password,key_words, exec_timeout=30): + + key_word_end = key_words.get("key_word_end") + key_word_pass = key_words.get("key_word_pass") + key_word_noshow = key_words.get("key_word_noshow") + # Prevents waiting caused by BMC restart + key_word_exit = key_words.get("key_word_exit") + + if None in [key_word_end,key_word_pass]: + print ("Missing parameters") + return False + + newkey = 'continue connecting' + log_os_system("rm -rf ~/.ssh", 0) + msg = "" + try_times = 3 + key_word_pass_flag = False + try_times_conter = try_times + child = pexpect.spawn(ssh_header) + try: + i = child.expect([pexpect.TIMEOUT,newkey, 'password: ',"refused",pexpect.EOF],timeout=30) + # If the login times out, print an error message and exit. + if i == 0: # Timeout + msg = 'connect to BMC timeout' + # no public key + if i == 1: + child.sendline ('yes') + i = child.expect([pexpect.TIMEOUT, 'password: '],timeout=30) + if i == 0: # Timeout + msg = 'connect to BMC timeout' + if i == 1:# Go below and enter the logic of the password + i = 2 + + if i == 2: # Enter the password + child.sendline (password) + i = child.expect([pexpect.EOF, "\r",pexpect.TIMEOUT], exec_timeout) + if i == 0: + print (child.before) + return key_word_pass_flag + if i == 1: + child.sendline(ssh_cmd) + # amount received is similar to root@switch2 in order to avoid misjudgment about the end of execution + usr_symble_first = True + bmc_str_tmp="" + while True: + i = child.expect([pexpect.EOF,"\r","\n",key_word_end, pexpect.TIMEOUT], exec_timeout) + if i == 0: + return key_word_pass_flag + elif i in [1,2]: + if key_word_noshow == None or key_word_noshow not in child.before: + bmc_str, times = re.subn("\r|\n","",child.before) + if len(bmc_str) > 1: + print (bmc_str) + bmc_str_tmp=bmc_str_tmp + bmc_str + # print bmc_str_tmp + # if key_word_pass in child.before: + if re.search(key_word_pass,bmc_str_tmp) != None: + key_word_pass_flag = True + if key_word_exit != None and key_word_exit in child.before: + # Give the BMC time to execute the last command + time.sleep(3) + return key_word_pass_flag + elif i == 3 : + if usr_symble_first: + usr_symble_first = False + else: + return key_word_pass_flag + + if i == 3: # BMC Connection refused + msg = 'connect to BMC failed' + if i == 4: + msg = child.before + except Exception as e: + print (e) + msg = str(child.before)+"\nconnect to BMC error" + print (msg) + + return False + +def get_sys_execute2(cmd, key_word_pass): + # key_word_pass_flag1 = False + key_word_pass_flag = False + filename = "/tmp/diag_excute_out" + cmd = cmd + "|tee %s" % filename + p = subprocess.Popen(shlex.split(cmd), shell=False) + p.wait() + with open(filename, 'r') as f: + str1 = f.read() + if key_word_pass in str1: + key_word_pass_flag = True + # if key_word_pass_flag1 and "100%" in str1: + # key_word_pass_flag = True + log_os_system("rm %s"%filename,0) + return key_word_pass_flag + + +BMC_PATH = "PATH=/usr/sbin/:/bin/:/usr/bin/:/sbin" +RETURN_KEY1 = "code" +RETURN_KEY2 = "msg" +DEBUG = False + +def wbi2cget(bus, devno, address): + command_line = "i2cget -f -y %d 0x%02x 0x%02x " % (bus, devno, address) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = os_system(command_line) + if ret == 0: + return True, ret_t + time.sleep(0.1) + return False, ret_t + +def strtoint(str): # Hexadecimal string to int,"4040"/"0x4040"/"0X4040" = 16448 + value = 0 + rest_v = str.replace("0X", "").replace("0x", "") + for index in range(len(rest_v)): + value |= int(rest_v[index], 16) << ((len(rest_v) - index - 1) * 4) + return value + +def pci_read(pcibus, slot, fn , bar, offset): + if offset % 4 != 0: + return None + filename = "/sys/bus/pci/devices/0000:%02x:%02x.%x/resource%d" % (int(pcibus), int(slot), int(fn), int(bar)) + file = open(filename, "r+") + size = os.path.getsize(filename) + data = mmap.mmap(file.fileno(), size) + result = data[offset: offset + 4] + s = result[::-1] + val = 0 + for i in range(0, len(s)): + val = val << 8 | ord(s[i]) + data.close() + file.close() + return val + +########################################### +# Run the DMI command to obtain the BIOS information +########################################### +def getDmiSysByType(type_t): + ret, log = os_system("which dmidecode ") + if ret != 0 or len(log) <= 0: + error = "cmd find dmidecode" + return False, error + cmd = log + " -t %s" % type_t + # Get the total first + ret1, log1 = os_system(cmd) + if ret != 0 or len(log1) <= 0: + return False, "Command error[%s]" % cmd + its = log1.replace("\t", "").strip().split("\n") + ret = {} + for it in its: + if ":" in it: + key = it.split(":")[0].lstrip() + value = it.split(":")[1].lstrip() + ret[key] = value + return True, ret diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/ctccmd b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/ctccmd new file mode 100755 index 000000000000..2c4410a16d66 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/ctccmd @@ -0,0 +1,3 @@ +#! /bin/bash + +docker exec -i syncd ctc_shell -e "$@" \ No newline at end of file diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/privatenetwork.py b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/privatenetwork.py new file mode 100644 index 000000000000..b498818b2a6d --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/privatenetwork.py @@ -0,0 +1,50 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- +import sys +import os +import re +try: + from sonic_platform import get_machine_info + from sonic_platform import get_platform_info +except ImportError : + try: + from sonic_device_util import get_machine_info + from sonic_device_util import get_platform_info + except ImportError: + from sonic_py_common import device_info + def get_machine_info(): + print("get_machine_info is null") + return False + def get_platform_info(x): + return device_info.get_platform() + +def start(): + x = get_platform_info(get_machine_info()) + print (x) + str = re.findall(r"-(.+?)_",x) + print (str[0]) + if str[0] == 'micas': + print ("Start privatenetwork.sh") + os.system("/usr/local/bin/privatenetwork.sh start") + else: + print ("Not set private network.") +def stop(): + x = get_platform_info(get_machine_info()) + print (x) + str = re.findall(r"-(.+?)_",x) + print (str[0]) + if str[0] == 'micas': + print ("Stop privatenetwork.sh") + os.system("/usr/local/bin/privatenetwork.sh stop") + else: + print ("Not stop private network.") +def main(): + print (sys.argv[1]) + if sys.argv[1]=='start': + start() + elif sys.argv[1]=='stop': + stop() + else: + print ("Error parameter!\nRequired parameters : start or stop.") +if __name__ == '__main__': + main() diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/privatenetwork.sh b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/privatenetwork.sh new file mode 100644 index 000000000000..4105dcbfff83 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/privatenetwork.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +function load_eth0.4088(){ + try_times_remain=5 + state_up=$(ip -d link show eth0.4088 | awk '/state UP/{print $2}') + while [ -z "$state_up" ] && [ $try_times_remain -ne 0 ] + do + ((try_times_remain-=1)) + ip link add link eth0 name eth0.4088 type vlan id 4088 || true + ip addr add 240.1.1.2/30 brd 240.1.1.3 dev eth0.4088 || true + ip link set dev eth0.4088 up || true + state_up=$(ip -d link show eth0.4088 | awk '/state UP/{print $2}') + sleep 1 + done +} + +function unload_eth0.4088(){ + ip link set dev eth0.4088 down + ip link del eth0.4088 +} + +if [ "$1" = "start" ];then + load_eth0.4088 +elif [ "$1" = "stop" ];then + unload_eth0.4088 +fi diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/update_machine_config.sh b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/update_machine_config.sh new file mode 100644 index 000000000000..933e7cc3575e --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/script/update_machine_config.sh @@ -0,0 +1,24 @@ +#!/bin/bash +onie_dev=$(blkid | grep ONIE-BOOT | head -n 1 | awk '{print $1}' | sed -e 's/:.*$//') +mkdir -p /mnt/onie-boot +mount $onie_dev /mnt/onie-boot +onie_grub_cfg=/mnt/onie-boot/onie/grub/grub-machine.cfg + +if [ ! -e $onie_grub_cfg ]; then + echo "$onie_grub_cfg not found" +else + oldoniebuilddate=`cat /host/machine.conf|grep "onie_build_date="` + oniebuilddate=`cat $onie_grub_cfg|grep "onie_build_date="|sed "s/\"//g"` + onieversion=`cat $onie_grub_cfg|grep "onie_version="` + oniekernelversion=`cat $onie_grub_cfg|grep "onie_kernel_version="` + if [ "$oldoniebuilddate" != "$oniebuilddate" ]; then + echo "update /home/machine.conf" + sed -i "s/onie_build_date=.*/$oniebuilddate/" /host/machine.conf + sed -i "s/onie_version=.*/$onieversion/" /host/machine.conf + sed -i "s/onie_kernel_version=.*/$oniekernelversion/" /host/machine.conf + sed -i "s/\"//g" /host/machine.conf + fi +fi +umount /mnt/onie-boot + + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/service/privatenetwork.service b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/service/privatenetwork.service new file mode 100644 index 000000000000..b73d003046fe --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/common_custom/common_micas/service/privatenetwork.service @@ -0,0 +1,13 @@ +[Unit] +Description=Update interfaces configuration for adding eth0 private subnetwork +After=network.target m2-w6010-48gt4x_platform.service +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/privatenetwork.py start +ExecStop=/usr/local/bin/privatenetwork.py stop +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/platform/centec-arm64/sonic-platform-modules-micas/debian/changelog b/platform/centec-arm64/sonic-platform-modules-micas/debian/changelog new file mode 100755 index 000000000000..ee4b9abf6c21 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/debian/changelog @@ -0,0 +1,6 @@ +sonic-centec-platform-modules (1.3) unstable; urgency=low + + * Add support for centec platform + + -- sonic_rd Mon, 21 Sep 2020 13:34:33 +0800 + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/debian/compat b/platform/centec-arm64/sonic-platform-modules-micas/debian/compat new file mode 100644 index 000000000000..f599e28b8ab0 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/debian/compat @@ -0,0 +1 @@ +10 diff --git a/platform/centec-arm64/sonic-platform-modules-micas/debian/control b/platform/centec-arm64/sonic-platform-modules-micas/debian/control new file mode 100644 index 000000000000..776b15d4e32a --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/debian/control @@ -0,0 +1,14 @@ +Source: sonic-centec-platform-modules +Section: main +Priority: extra +Maintainer: shil +Build-Depends: debhelper (>= 8.0.0), bzip2 +Standards-Version: 3.9.3 + +Package: platform-modules-micas-m2-w6010-48gt4x-fa +Architecture: arm64 +Description: kernel modules for platform devices such as fan, led, sfp + +Package: platform-modules-micas-m2-w6010-48gt4x-ra +Architecture: arm64 +Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.init b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.init new file mode 100644 index 000000000000..cd7d03667dc0 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.init @@ -0,0 +1,61 @@ +#!/bin/bash +# This script load/unload centec kernel modules + +function install_python_api_package() +{ + device="/usr/share/sonic/device" + platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) + + rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null) + if [ $? -ne 0 ]; then + echo -n "Install sonic_platform-1.0-py3-none-any.whl ..." + rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl) + fi +} + +function load_kernel_modules() +{ + hwaddr=`fw_printenv ethaddr | awk -F = '{print $2}'` + if [ "$hwaddr" != "" ]; then + ifconfig eth0 hw ether $hwaddr + fi + depmod -a + modprobe dal + modprobe psample +} + +function remove_kernel_modules() +{ + modprobe -r dal +} + +case "$1" in +start) + echo -n "Load Centec kernel modules... " + + load_kernel_modules + install_python_api_package + + echo "done." + ;; + +stop) + echo -n "Unload Centec kernel modules... " + + remove_kernel_modules + + echo "done." + ;; + +force-reload|restart) + echo "Not supported" + ;; + +*) + echo "Usage: /etc/init.d/platform-modules-micas-m2-w6010-48gt4x-fa {start|stop}" + exit 1 + ;; +esac + +exit 0 + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.install b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.install new file mode 100644 index 000000000000..918f5b872ec7 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.install @@ -0,0 +1,2 @@ +m2-w6010-48gt4x-fa/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/arm64-micas_m2-w6010-48gt4x-fa-r0 + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.postinst b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.postinst new file mode 100644 index 000000000000..67f1fe08e3f4 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-fa.postinst @@ -0,0 +1,8 @@ +systemctl enable m2-w6010-48gt4x_platform.service +systemctl start m2-w6010-48gt4x_platform.service +systemctl enable device_i2c.service +systemctl start device_i2c.service +systemctl enable privatenetwork.service +systemctl start privatenetwork.service +systemctl enable fancontrol.service +systemctl start fancontrol.service diff --git a/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.init b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.init new file mode 100644 index 000000000000..91dcc47dced0 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.init @@ -0,0 +1,61 @@ +#!/bin/bash +# This script load/unload centec kernel modules + +function install_python_api_package() +{ + device="/usr/share/sonic/device" + platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) + + rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null) + if [ $? -ne 0 ]; then + echo -n "Install sonic_platform-1.0-py3-none-any.whl ..." + rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl) + fi +} + +function load_kernel_modules() +{ + hwaddr=`fw_printenv ethaddr | awk -F = '{print $2}'` + if [ "$hwaddr" != "" ]; then + ifconfig eth0 hw ether $hwaddr + fi + depmod -a + modprobe dal + modprobe psample +} + +function remove_kernel_modules() +{ + modprobe -r dal +} + +case "$1" in +start) + echo -n "Load Centec kernel modules... " + + load_kernel_modules + install_python_api_package + + echo "done." + ;; + +stop) + echo -n "Unload Centec kernel modules... " + + remove_kernel_modules + + echo "done." + ;; + +force-reload|restart) + echo "Not supported" + ;; + +*) + echo "Usage: /etc/init.d/platform-modules-micas-m2-w6010-48gt4x-ra {start|stop}" + exit 1 + ;; +esac + +exit 0 + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.install b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.install new file mode 100644 index 000000000000..3700a6fc8567 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.install @@ -0,0 +1,2 @@ +m2-w6010-48gt4x-ra/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/arm64-micas_m2-w6010-48gt4x-ra-r0 + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.postinst b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.postinst new file mode 100644 index 000000000000..67f1fe08e3f4 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6010-48gt4x-ra.postinst @@ -0,0 +1,8 @@ +systemctl enable m2-w6010-48gt4x_platform.service +systemctl start m2-w6010-48gt4x_platform.service +systemctl enable device_i2c.service +systemctl start device_i2c.service +systemctl enable privatenetwork.service +systemctl start privatenetwork.service +systemctl enable fancontrol.service +systemctl start fancontrol.service diff --git a/platform/centec-arm64/sonic-platform-modules-micas/debian/rules b/platform/centec-arm64/sonic-platform-modules-micas/debian/rules new file mode 100755 index 000000000000..b62824e822c2 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/debian/rules @@ -0,0 +1,114 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +include /usr/share/dpkg/pkg-info.mk + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export INSTALL_MOD_DIR:=extra + +PYTHON = python3.9 + +PACKAGE_PRE_NAME := platform-modules-micas +KVERSION ?= $(shell uname -r) +KERNEL_SRC := /lib/modules/$(KVERSION) +MOD_SRC_DIR:= $(shell pwd) +MODULE_DIRS:= m2-w6010-48gt4x-fa +MODULE_DIRS_R:= m2-w6010-48gt4x-ra +MODULE_DIR := common +CUSTOMS_DIRS := common_custom/common_micas +SERVICE_DIR := service +CLASSES_DIR := classes +CONFIG_DIR := config +KDAL_DIR := ../../centec/centec-dal/ +export KERNEL_SRC + + + +clean: + dh_testdir + dh_testroot + dh_clean + +build: + #make modules -C $(KERNEL_SRC)/build M=$(MODULE_SRC) + (for mod in $(KDAL_DIR); do \ + make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/; \ + done) + (for mod in $(MODULE_DIRS); do \ + make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \ + cd $${mod}; $(PYTHON) setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ + cd -; \ + done) + (for mod in $(MODULE_DIRS_R); do \ + make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \ + cd $${mod}; $(PYTHON) setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ + cd -; \ + done) + make -C $(MODULE_DIR); + make -C $(CUSTOMS_DIRS); + +binary: binary-arch binary-indep + # Nothing to do + +binary-arch: + # Nothing to do + +binary-indep: + dh_testdir + dh_installdirs + + # Custom package commands + (for mod in $(MODULE_DIRS); do \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} etc; \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} boot; \ + cp -r $(MOD_SRC_DIR)/$(MODULE_DIR)/build/* debian/$(PACKAGE_PRE_NAME)-$${mod}/; \ + cp -r $(MOD_SRC_DIR)/$(CUSTOMS_DIRS)/build/* debian/$(PACKAGE_PRE_NAME)-$${mod}/; \ + cp $(MOD_SRC_DIR)/$${mod}/config/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/local/bin/; \ + cp $(MOD_SRC_DIR)/$${mod}/modules/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + cp $(MOD_SRC_DIR)/$(KDAL_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + #cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system/; \ + #cp $(MOD_SRC_DIR)/${CONFIG_DIR}/* debian/$(PACKAGE_PRE_NAME)-$${mod}/etc/; \ + cd -; \ + done) + (for mod in $(MODULE_DIRS_R); do \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} etc; \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} boot; \ + cp -r $(MOD_SRC_DIR)/$(MODULE_DIR)/build/* debian/$(PACKAGE_PRE_NAME)-$${mod}/; \ + cp -r $(MOD_SRC_DIR)/$(CUSTOMS_DIRS)/build/* debian/$(PACKAGE_PRE_NAME)-$${mod}/; \ + cp $(MOD_SRC_DIR)/$${mod}/config/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/local/bin/; \ + cp $(MOD_SRC_DIR)/$${mod}/modules/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + cp $(MOD_SRC_DIR)/$(KDAL_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + #cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system/; \ + #cp $(MOD_SRC_DIR)/${CONFIG_DIR}/* debian/$(PACKAGE_PRE_NAME)-$${mod}/etc/; \ + cd -; \ + done) + # Resuming debhelper scripts + dh_testroot + dh_install + dh_installchangelogs + dh_installdocs + dh_systemd_enable + dh_installinit + dh_systemd_start + dh_link + dh_fixperms + dh_compress + dh_strip + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb +.PHONY: build binary binary-arch binary-indep clean diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/config/arm64_micas_m2_w6010_48gt4x_fa_r0_config.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/config/arm64_micas_m2_w6010_48gt4x_fa_r0_config.py new file mode 100755 index 000000000000..7c295e1394df --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/config/arm64_micas_m2_w6010_48gt4x_fa_r0_config.py @@ -0,0 +1,89 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- +from platform_common import * +PCA9548START = -1 +PCA9548BUSEND = -2 + +PLATFORM_CARDID = 0x00004065 +PLATFORM_PRODUCTNAME = "M2-W6010-48GT4X-FA" +PLATFORM_PART_NUMBER = "01016994" +PLATFORM_LABEL_REVISION = "R01" +PLATFORM_ONIE_VERSION = "2018.05-rc1" +PLATFORM_MAC_SIZE = 3 +PLATFORM_MANUF_NAME = "Micas" +PLATFORM_MANUF_COUNTRY = "USA" +PLATFORM_VENDOR_NAME = "Micas" +PLATFORM_DIAG_VERSION = "0.1.0.15" +PLATFORM_SERVICE_TAG = "www.micasnetworks.com" + +LOCAL_LED_CONTROL = { + "CLOSE":{}, + "OPEN":{} +} + +MACLED_PARAMS = [] + +# start system modules +STARTMODULE = { + "i2ccheck":0, + "fancontrol":0, + "avscontrol":0, + "avscontrol_restful":0, + "sfptempmodule":0, + "sfptempmodule_interval":3, + "macledreset": 0, + "macledreset_interval": 5, + "macledset_param":MACLED_PARAMS, + } + +FRULISTS = [ + {"name":"mmceeprom","bus":5,"loc":0x50, "E2PRODUCT":'2', "E2TYPE":'5' , "CANRESET":'1'}, + {"name":"cpueeprom","bus":5,"loc":0x57,"E2PRODUCT":'2', "E2TYPE":'4', "CANRESET":'1' }, + ] + +# eeprom = "1-0056/eeprom" +E2_LOC = {"bus":1, "devno":0x56} +E2_PROTECT = {} + + +CPLDVERSIONS = [ + {"bus":2, "devno":0x0d, "name":"CPU_CPLD"}, + {"bus":3, "devno":0x30, "name":"MAC_BOARD_CPLD_1"}, +] + +FIRMWARE_TOOLS = {"cpld": [{"channel":"0","cmd":"firmware_upgrade %s cpld %s cpld", "successtips":"CPLD Upgrade succeeded!"} + ], + } + +# drivers list +DRIVERLISTS = [ + {"name":"i2c_dev", "delay":0}, + {"name":"i2c_algo_bit","delay":0}, + {"name":"spi-bitbang", "delay":0}, + {"name":"i2c_mux", "delay":0}, + {"name":"rtcpcf85063", "delay":0}, + {"name":"i2c_mux_pca954x", "delay":0}, # force_deselect_on_exit=1 + {"name":"platform_common dfd_my_type=0x4065", "delay":0}, + {"name":"wb_cpld", "delay":0}, + {"name":"wb_at24", "delay":0}, + {"name":"optoe", "delay":0}, +] + +DEVICE = [ + {"name":"rtcpcf85063","bus":1,"loc":0x51 }, + {"name":"wb_24c02","bus":1,"loc":0x56 }, + {"name":"wb_cpld","bus":3,"loc":0x30 }, + {"name":"wb_24c02","bus":5,"loc":0x50 }, + {"name":"wb_24c02","bus":5,"loc":0x57 }, +] + +INIT_PARAM = [ + {"loc":"3-0030/tx_write_protect","value": "59","delay":1}, + {"loc":"3-0030/tx_disable","value": "00"}, + {"loc":"3-0030/tx_write_protect","value": "4e"}, +] + +INIT_COMMAND = [ + "hwclock -s", +] + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/config/fan_ctrl_cfg.json b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/config/fan_ctrl_cfg.json new file mode 100644 index 000000000000..86fcf892f032 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/config/fan_ctrl_cfg.json @@ -0,0 +1,40 @@ +{ + "Device": { + "Liquid": 0, + "Buildin": 1, + "PID": 0, + "OpenLoop": 1 + }, + "Thermal": { + "INLET_TEMP": "INLET_TEMP", + "OUTLET_TEMP": "OUTLET_TEMP", + "SWITCH_TEMP": "TPS53688_TEMP" + }, + "Fans": { + "Fan1" : "Fantray1_1", + "Fan2" : "Fantray2_1" + }, + "PID": { + "Pwm_Max": 99, + "Pwm_Min": 30, + "SetPoint" : 90, + "P": 1.5, + "I": 1, + "D": 0.3, + "Temp_Min": 28.0, + "Temp_Max": 45.0, + "Sensor": "TPS53688_TEMP" + }, + "OpenLoop": { + "a": -0.06, + "b": 10.3, + "c": -142.0, + "fix_up": -8, + "pwmMax": 99, + "pwmMin": 30, + "tempMin": 25 + }, + "FanError": { + "Fan_Pwmmax":99 + } +} \ No newline at end of file diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/service/m2-w6010-48gt4x_platform.service b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/service/m2-w6010-48gt4x_platform.service new file mode 100644 index 000000000000..ca2bf9f2c8b2 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/service/m2-w6010-48gt4x_platform.service @@ -0,0 +1,13 @@ +[Unit] +Description=Centec modules init +After=local-fs.target +Before=syncd.service + +[Service] +Type=oneshot +ExecStart=-/etc/init.d/platform-modules-micas-m2-w6010-48gt4x-fa start +ExecStop=-/etc/init.d/platform-modules-micas-m2-w6010-48gt4x-fa stop +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/setup.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/setup.py new file mode 100644 index 000000000000..b8aab82034ed --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/setup.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +import os +import sys +from setuptools import setup + +setup( + name='sonic_platform', + version='1.0', + description='Module to initialize centec platforms', + + packages=['sonic_platform'], + package_dir={'sonic_platform': 'sonic_platform'}, +) + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/__init__.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/__init__.py new file mode 100644 index 000000000000..4bfefa0fb636 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +__all__ = ["platform", "chassis"] +from sonic_platform import * + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/chassis.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/chassis.py new file mode 100644 index 000000000000..8cdf84cf3840 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/chassis.py @@ -0,0 +1,444 @@ + +#!/usr/bin/env python + +try: + import time + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.eeprom import Eeprom + from sonic_platform.thermal import Thermal + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.sfp import Sfp + from sonic_platform.psu import Psu + from .component import Component +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_FAN_TRAY = 2 +NUM_FAN = 2 +NUM_THERMAL = 5 +NUM_PORT = 52 +NUM_PSU = 2 + +class Chassis(ChassisBase): + + port_dict = {} + STATUS_INSERTED = "1" + STATUS_REMOVED = "0" + + def __init__(self): + ChassisBase.__init__(self) + # Initialize EEPROM + self._eeprom = Eeprom() + #firmware + for i in range(0,2): + self._component_list.append(Component(i)) + # Initialize FAN + for i in range(NUM_FAN_TRAY): + fandrawer = FanDrawer(i) + self._fan_drawer_list.append(fandrawer) + self._fan_list.extend(fandrawer._fan_list) + # Initialize THERMAL + for index in range(0, NUM_THERMAL): + thermal = Thermal(index) + self._thermal_list.append(thermal) + # Initialize SFP + for index in range(0, NUM_PORT + 1): + sfp = Sfp(index) + self._sfp_list.append(sfp) + if sfp.get_presence(): + self.port_dict[index] = self.STATUS_INSERTED + else: + self.port_dict[index] = self.STATUS_REMOVED + # Initialize PSU + for index in range(0, NUM_PSU): + psu = Psu(index) + self._psu_list.append(psu) + +############################################## +# Device methods +############################################## + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + name = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + name = sys_eeprom.modelstr(e) + if name is None: + return '' + return name + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + model = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + model = sys_eeprom.modelnumber(e) + if model is None: + return '' + return model + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this chassis. + """ + serial_number = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + serial_number = sys_eeprom.serial_number_str(e) + if serial_number is None: + return '' + + return serial_number + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + device_version = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + device_version = sys_eeprom.deviceversion(e) + if device_version is None: + return '' + + return device_version + + def get_serial(self): + """ + Retrieves the serial number of the chassis (Service tag) + Returns: + string: Serial number of chassis + """ + return self.get_serial_number() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def initizalize_system_led(self): + return True + + def get_status_led(self): + """ + Gets the state of the system LED + + Returns: + A string, one of the valid LED color strings which could be vendor + specified. + """ + return 'green' + + def set_status_led(self, color): + return False +############################################## +# Chassis methods +############################################## + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + base_mac = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + base_mac = sys_eeprom.base_mac_addr(e) + if base_mac is None: + return '' + + return base_mac.upper() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + """ + sys_eeprom_dict = dict() + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return {} + + e = sys_eeprom.read_eeprom() + if sys_eeprom._TLV_HDR_ENABLED: + if not sys_eeprom.is_valid_tlvinfo_header(e): + return {} + total_len = (e[9] << 8) | e[10] + tlv_index = sys_eeprom._TLV_INFO_HDR_LEN + tlv_end = sys_eeprom._TLV_INFO_HDR_LEN + total_len + else: + tlv_index = sys_eeprom.eeprom_start + tlv_end = sys_eeprom._TLV_INFO_MAX_LEN + + while (tlv_index + 2) < len(e) and tlv_index < tlv_end: + if not sys_eeprom.is_valid_tlv(e[tlv_index:]): + break + + tlv = e[tlv_index:tlv_index + 2 + e[tlv_index + 1]] + name, value = sys_eeprom.decoder(None, tlv) + sys_eeprom_dict[name] = value + + if e[tlv_index] == sys_eeprom._TLV_CODE_QUANTA_CRC or \ + e[tlv_index] == sys_eeprom._TLV_CODE_CRC_32: + break + tlv_index += e[tlv_index + 1] + 2 + + return sys_eeprom_dict + + def get_thermal_manager(self): + """ + Retrieves thermal manager class on this chassis + :return: A class derived from ThermalManagerBase representing the + specified thermal manager. ThermalManagerBase is returned as default + """ + return False + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + return (None, None) + + def get_module(self, index): + """ + Retrieves module represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the module to + retrieve + + Returns: + An object dervied from ModuleBase representing the specified + module + """ + module = None + + try: + if self.get_num_modules(): + module = self._module_list[index] + except IndexError: + sys.stderr.write("Module index {} out of range (0-{})\n".format( + index, len(self._module_list)-1)) + + return module + + def get_fan_drawer(self, index): + """ + Retrieves fan drawers represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the fan drawer to + retrieve + + Returns: + An object dervied from FanDrawerBase representing the specified fan + drawer + """ + fan_drawer = None + + try: + if self.get_num_fan_drawers(): + fan_drawer = self._fan_drawer_list[index] + except IndexError: + sys.stderr.write("Fan drawer index {} out of range (0-{})\n".format( + index, len(self._fan_drawer_list)-1)) + + return fan_drawer + + def get_change_event(self, timeout=0): + """ + Returns a nested dictionary containing all devices which have + experienced a change at chassis level + + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + + Returns: + (bool, dict): + - bool: True if call successful, False if not; + - dict: A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, where device_id is the device ID + for this device and device_event. + The known devices's device_id and device_event was defined as table below. + ----------------------------------------------------------------- + device | device_id | device_event | annotate + ----------------------------------------------------------------- + 'fan' '' '0' Fan removed + '1' Fan inserted + + 'sfp' '' '0' Sfp removed + '1' Sfp inserted + '2' I2C bus stuck + '3' Bad eeprom + '4' Unsupported cable + '5' High Temperature + '6' Bad cable + + 'voltage' '' '0' Vout normal + '1' Vout abnormal + -------------------------------------------------------------------- + Ex. {'fan':{'0':'0', '2':'1'}, 'sfp':{'11':'0', '12':'1'}, + 'voltage':{'U20':'0', 'U21':'1'}} + Indicates that: + fan 0 has been removed, fan 2 has been inserted. + sfp 11 has been removed, sfp 12 has been inserted. + monitored voltage U20 became normal, voltage U21 became abnormal. + Note: For sfp, when event 3-6 happened, the module will not be avalaible, + XCVRD shall stop to read eeprom before SFP recovered from error status. + """ + + change_event_dict = {"fan": {}, "sfp": {}, "voltage": {}} + + start_time = time.time() + forever = False + + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + print("get_change_event:Invalid timeout value", timeout) + return False, change_event_dict + + end_time = start_time + timeout + if start_time > end_time: + print( + "get_change_event:" "time wrap / invalid timeout value", + timeout, + ) + return False, change_event_dict # Time wrap or possibly incorrect timeout + try: + while timeout >= 0: + # check for sfp + sfp_change_dict = self.get_transceiver_change_event() + # check for fan + # fan_change_dict = self.get_fan_change_event() + # check for voltage + # voltage_change_dict = self.get_voltage_change_event() + + if sfp_change_dict: + change_event_dict["sfp"] = sfp_change_dict + # change_event_dict["fan"] = fan_change_dict + # change_event_dict["voltage"] = voltage_change_dict + return True, change_event_dict + if forever: + time.sleep(1) + else: + timeout = end_time - time.time() + if timeout >= 1: + time.sleep(1) # We poll at 1 second granularity + else: + if timeout > 0: + time.sleep(timeout) + return True, change_event_dict + except Exception as e: + print(e) + print("get_change_event: Should not reach here.") + return False, change_event_dict + + def get_transceiver_change_event(self): + current_port_dict = {} + ret_dict = {} + + # Check for OIR events and return ret_dict + for index in range(0, NUM_PORT + 1): + if self._sfp_list[index].get_presence(): + current_port_dict[index] = self.STATUS_INSERTED + else: + current_port_dict[index] = self.STATUS_REMOVED + + if len(self.port_dict) == 0: # first time + self.port_dict = current_port_dict + return {} + + if current_port_dict == self.port_dict: + return {} + + # Update reg value + for index, status in current_port_dict.items(): + if self.port_dict[index] != status: + ret_dict[index] = status + #ret_dict[str(index)] = status + self.port_dict = current_port_dict + for index, status in ret_dict.items(): + if int(status) == 1: + pass + #self._sfp_list[int(index)].check_sfp_optoe_type() + return ret_dict diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/component.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/component.py new file mode 100644 index 000000000000..325c000eea74 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/component.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +try: + import subprocess + from sonic_platform_base.component_base import ComponentBase + import sonic_platform.hwaccess as hwaccess +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +def get_cpld_version(bus, i2caddr): + return '{}{}{}{}'.format(hwaccess.i2c_get(bus, i2caddr, 1), + hwaccess.i2c_get(bus, i2caddr, 2), + hwaccess.i2c_get(bus, i2caddr, 3), + hwaccess.i2c_get(bus, i2caddr, 0) + ) + +def get_cpu_cpld_version(): + return get_cpld_version(2, 0x0d) + +def get_cpld1_version(): + return get_cpld_version(3, 0x30) + +COMPONENT_LIST= [ + ['CPU CPLD', + 'cpu board', + get_cpu_cpld_version + ], + + ['MAC1 CPLD', + 'mac1 board', + get_cpld1_version + ] + ] + +class Component(ComponentBase): + """Platform-specific Component class""" + + def __init__(self, component_index=0): + ComponentBase.__init__(self) + self.index = component_index + + def get_name(self): + """ + Retrieves the name of the component + + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + def get_firmware_version(self): + """ + Retrieves the firmware version of the component + + Returns: + A string containing the firmware version of the component + """ + return COMPONENT_LIST[self.index][2]() + + def install_firmware(self, image_path): + """ + Installs firmware to the component + + Args: + image_path: A string, path to firmware image + + Returns: + A boolean, True if install was successful, False if not + """ + try: + successtips = "CPLD Upgrade succeeded!" + status, output = subprocess.getstatusoutput("which firmware_upgrade") + if status or len(output) <= 0: + logger.error("no upgrade tool.") + return False + cmdstr = "%s %s cpld %d cpld"%(output,image_path,self.slot) + ret, log = subprocess.getstatusoutput(cmdstr) + if ret == 0 and successtips in log: + return True + logger.error("upgrade failed. ret:%d, log:\n%s" % (ret, log)) + except Exception as e: + logger.error(str(e)) + return False + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/eeprom.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/eeprom.py new file mode 100644 index 000000000000..af5da656b7b0 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/eeprom.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +try: + from sonic_eeprom import eeprom_tlvinfo + import binascii +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + """Platform-specific Eeprom class""" + + def __init__(self): + eeprom_path = "/sys/bus/i2c/devices/1-0056/eeprom" + if eeprom_path is None: + raise ValueError("get eeprom path failed") + + super(Eeprom, self).__init__(eeprom_path, 0, "", True) + + + def modelnumber(self, e): + ''' + Returns the value field of the model(part) number TLV as a string + ''' + (is_valid, t) = self.get_tlv_field(e, self._TLV_CODE_PART_NUMBER) + if not is_valid: + return super(Eeprom, self).part_number_str(e) + + return t[2].decode("ascii") + + def deviceversion(self, e): + ''' + Returns the value field of the Device Version as a string + ''' + (is_valid, t) = self.get_tlv_field(e, self._TLV_CODE_DEVICE_VERSION) + if not is_valid: + return "N/A" + + return str(ord(t[2])) diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/fan.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/fan.py new file mode 100644 index 000000000000..ebbb386278ed --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/fan.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python + +import time + +try: + from sonic_platform_base.fan_base import FanBase + from .redfish_api import Redfish_Api +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +FAN_NAME_LIST = ["1", "2"] + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, fan_tray_index, fan_index=0): + self.fan_index = fan_index + self.fan_tray_index = fan_tray_index + self.redfish = Redfish_Api() + self.pinf = {} + self._fan_list = [] + FanBase.__init__(self) + self.begin = time.time() + + def get_power_3s(self): + self.elapsed = time.time() + if not self.pinf or self.elapsed - self.begin >= 3: + self.begin = time.time() + self.pinf = self.redfish.get_thermal() + + def get_speed_pwm(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + speed = output.get("Oem").get("OpenBmc").get("FanSpeedLevelPercents") + return int(speed) + + def get_speed_rpm(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + speed = output.get("Reading") + return int(speed) + + def get_high_critical_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + high = output.get("UpperThresholdFatal") + return int(high) + + def get_low_critical_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + low = output.get("LowerThresholdFatal") + return int(low) + + def set_speed_pwm(self, speed): + post_url = '/redfish/v1/Chassis/1/Thermal/Actions/Oem/OpenBmc/Fan.SetSpeed' + playload = {} + playload["FanName"] = "Fan0" + playload["FanSpeedLevelPercents"] = str(speed) + return self.redfish.post_odata(post_url, playload) + + def get_status_led(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + led = output.get("Oem").get("OpenBmc").get("IndicatorLEDColor") + return led + + def set_status_led(self, color): + playload = {} + led = {} + led_list = [] + led["IndicatorLEDColor"] = color + led["LEDType"] = "fan" + led_list.append(led) + playload["LEDs"] = led_list + # boardsLed + return self.redfish.post_boardLed(playload) + + def get_direction(self): + return "intake" + + def get_name(self): + fan_name = FAN_NAME_LIST[self.fan_index] + return "Fantray{}_{}".format(self.fan_tray_index+1, fan_name) + + def get_model(self): + """ + Retrieves the part number of the FAN + Returns: + string: Part number of FAN + """ + return 'N/A' + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the FAN + Returns: + string: Serial number of FAN + """ + return 'N/A' + + def get_presence(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + state = output.get("Status").get("Status").get("State") + if state == "Enabled" or state == "UnavailableOffline": + return True + return False + + def get_status(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + if output.get("Status").get("Status").get("Health") == "OK": + return True + return False + + def get_speed(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + speed = output.get("Reading") + speed_percentage = round((speed*100)/17500) + if speed_percentage > 100: + speed_percentage = 100 + return speed_percentage + else: + return speed_percentage + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return 30 + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + return self.get_speed_pwm() diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/fan_drawer.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..c86b85566f33 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/fan_drawer.py @@ -0,0 +1,124 @@ +#!/usr/bin/env python +import time + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase + from sonic_platform.fan import Fan + from .redfish_api import Redfish_Api +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(FanDrawerBase): + + FANS_PER_FANTRAY = 1 + + def __init__(self, fantray_index=0): + FanDrawerBase.__init__(self) + self.fantrayindex = fantray_index + self.redfish = Redfish_Api() + self.pinf = {} + self.begin = time.time() + for i in range(self.FANS_PER_FANTRAY): + self._fan_list.append(Fan(fantray_index, i)) + + def get_power_3s(self): + self.elapsed = time.time() + if not self.pinf or self.elapsed - self.begin >= 3: + self.begin = time.time() + self.pinf = self.redfish.get_thermal() + + def get_name(self): + return "FanTray{}".format(self.fantrayindex+1) + + def get_presence(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fantrayindex] + state = output.get("Status").get("Status").get("State") + if state == "Enabled" or state == "UnavailableOffline": + return True + return False + + def get_model(self): + """ + Retrieves the part number of the FAN + Returns: + string: Part number of FAN + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the FAN + Returns: + string: Serial number of FAN + """ + return 'N/A' + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + return 'N/A' + + def get_status(self): + """ + Retrieves the operational status of the FAN + Returns: + bool: True if FAN is operating properly, False if not + """ + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fantrayindex] + if output.get("Status").get("Status").get("Health") == "OK": + return True + return False + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_status_led(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fantrayindex] + led = output.get("Oem").get("OpenBmc").get("IndicatorLEDColor") + return led + + def set_status_led(self, color): + playload = {} + led = {} + led_list = [] + led["IndicatorLEDColor"] = color + led["LEDType"] = "fan" + led_list.append(led) + playload["LEDs"] = led_list + # boardsLed + return self.redfish.post_boardLed(playload) + + def get_maximum_consumed_power(self): + """ + Retrives the maximum power drawn by Fan Drawer + + Returns: + A float, with value of the maximum consumable power of the + component. + """ + return 'N/A' diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/hwaccess.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/hwaccess.py new file mode 100644 index 000000000000..7a04e766ae28 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/hwaccess.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python + +import struct +import mmap +import subprocess + +# Read PCI device + +def pci_mem_read(mm, offset): + mm.seek(offset) + read_data_stream = mm.read(4) + return struct.unpack('I',read_data_stream)[0] + +def pci_get_value(resource, offset): + with open(resource, 'r+b') as fd: + mm = mmap.mmap(fd.fileno(), 0) + val = pci_mem_read(mm, offset) + mm.close() + return val + +def pci_mem_write(memmap, offset, data): + """ Write PCI device """ + memmap.seek(offset) + memmap.write(struct.pack('I', data)) + +def pci_set_value(resource, val, offset): + """ Set a value to PCI device """ + with open(resource, 'w+b') as filed: + memmap = None + try: + memmap = mmap.mmap(filed.fileno(), 0) + pci_mem_write(memmap, offset, val) + except EnvironmentError: + print("error") + if memmap is not None: + memmap.close() + +# Read I2C device + +def i2c_get(bus, i2caddr, ofs): + try: + valx = int(subprocess.check_output(['/usr/sbin/i2cget','-f', '-y', str(bus), str(i2caddr), str(ofs)]), 16) + return "{:02x}".format(valx) + except (FileNotFoundError, subprocess.CalledProcessError): + return -1 + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/platform.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/platform.py new file mode 100644 index 000000000000..7225a71b0307 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/platform.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/psu.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/psu.py new file mode 100644 index 000000000000..5176552c12e1 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/psu.py @@ -0,0 +1,231 @@ +#!/usr/bin/env python + +import time +import imp +import os +import sys + +try: + from sonic_platform_base.psu_base import PsuBase + from .redfish_api import Redfish_Api +except ImportError as e: + raise ImportError("%s - required module not found" % e) + +class Psu(PsuBase): + """Platform-specific Psu class""" + + def __init__(self, index=0): + PsuBase.__init__(self) + self.redfish = Redfish_Api() + self.pinf = {} + self.psu_index = index + self._fan_list = [] + self._thermal_list = [] + self.begin = time.time() + + def get_power_3s(self): + self.elapsed = time.time() + if not self.pinf or self.elapsed - self.begin >= 3: + self.begin = time.time() + self.pinf = self.redfish.get_power() + + def get_presence(self): + return True + + def get_fan(self, index): + """ + Retrieves fan module represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the fan module to + retrieve + + Returns: + An object dervied from FanBase representing the specified fan + module + """ + return None + + def get_powergood_status(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + if output.get("Status").get("Health") == "OK": + return True + else: + return False + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "PSU {}".format(self.psu_index + 1) + + def get_serial(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + serial = output.get("SerialNumber") + return serial + + def get_model(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + model = output.get("Model") + return model + + def get_revision(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + manufacturer = output.get("Manufacturer") + return manufacturer + + def get_voltage(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + voltage = output.get("Oem").get("OpenBmc").get("OutputVoltage") + return voltage + + def get_input_current(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + current = output.get("Oem").get("OpenBmc").get("OutputAmperage") + return current + + def get_input_voltage(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + voltage = output.get("Oem").get("OpenBmc").get("OutputVoltage") + return voltage + + def get_current(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + current = output.get("Oem").get("OpenBmc").get("OutputAmperage") + return current + + def get_power(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + current = output.get("Oem").get("OpenBmc").get("OutputAmperage") + voltage = output.get("Oem").get("OpenBmc").get("OutputVoltage") + power = float(current)*float(voltage) + return round(power,2) + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + # no temperature sensor + value = 35 + return round(float(value), 1) + + def get_status_led(self): + return "BuildIn" + + def set_status_led(self, color): + playload = {} + led = {} + led_list = [] + led["IndicatorLEDColor"] = color + led["LEDType"] = "pwr" + led_list.append(led) + playload["LEDs"] = led_list + # boardsLed + return self.redfish.post_boardLed(playload) + + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU + + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return False + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_status(self): + """ + Retrieves the operational status of the PSU + + Returns: + bool: True if PSU is operating properly, False if not + """ + return self.get_powergood_status() + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + value = 75 + return round(float(value), 1) + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + value = 14.52 + return str(round(float(value), 2)) + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + value = 9.72 + return str(round(float(value), 2)) + + def get_thermal(self, index): + """ + Retrieves thermal unit represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the thermal to + retrieve + + Returns: + An object dervied from ThermalBase representing the specified thermal + """ + return None diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/redfish_api.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/redfish_api.py new file mode 100644 index 000000000000..9d3cdd31436f --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/redfish_api.py @@ -0,0 +1,304 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +import shlex +import json +import os +import ssl +import subprocess +import syslog + +class Redfish_Api(): + BmcBaseUrl = 'http://240.1.1.1:8080' + ThermalUrl = '/redfish/v1/Chassis/1/Thermal' + PowerUrl = '/redfish/v1/Chassis/1/Power' + ThresholdSensorsUrl = '/redfish/v1/Chassis/1/ThresholdSensors' + FanSpeedUrl = '/redfish/v1/Chassis/1/Thermal/Actions/Oem/OpenBmc/Fan.SetSpeed' + BoardsUrl = '/redfish/v1/Chassis/1/Boards/' + BoardLedUrl = "/redfish/v1/Chassis/1/Boards/{}/Actions/Oem/OpenBmc/Boards.SetLED" + + # Maximum time in seconds that you allow the connection to the server to take. + connect_timeout = 30 + # Maximum time in seconds that you allow the whole operation to take + operation_timeout = 300 + + default_prefix='/redfish/v1/' + session = None + __DEBUG__ = "N" + __DUMP_RESP__ = "N" + RST_STATUS = "status" + RST_SUCCESS = "OK" + refish_logger = None + + def redfish_log_debug(self, msg): + if (self.__DEBUG__ == "Y"): + syslog.openlog("redfis_api") + syslog.syslog(syslog.LOG_DEBUG, msg) + syslog.closelog() + + def redfish_log_error(self, msg): + syslog.openlog("redfish_api") + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + def __init__(self): + pass + + def get_full_url(self, url): + return self.BmcBaseUrl + url + + def _exec_cmd(self, cmd): + self.redfish_log_debug("Cmd: %s" % cmd) + p = subprocess.Popen(shlex.split(cmd), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p.wait() + self.redfish_log_debug("Cmd return: %d" % p.returncode) + str_stdout = p.stdout.read().decode('utf-8') + str_stderr = p.stderr.read().decode('utf-8') + self.redfish_log_debug("Cmd stdout: %s" % str_stdout) + if p.returncode !=0: + self.redfish_log_error("Cmd: %s, failed! error msg:%s" % (cmd, str_stderr)) + return None + else: + try: + ret = json.loads(str_stdout) + return ret + except Exception as e: + self.redfish_log_error("Cmd: %s, failed! stdout msg:%s" % (cmd, str_stdout)) + return None + + def _redfish_get(self, url): + self.redfish_log_debug("Get info from %s." % url) + result = None + try: + cmd_get="curl --connect-timeout %d -m %d -X GET %s" % (self.connect_timeout, self.operation_timeout, self.get_full_url(url)) + result = self._exec_cmd(cmd_get) + return result + except Exception as e: + self.redfish_log_error("error_message: %s" % e) + return None + + def _redfish_post(self, url, playload): + self.redfish_log_debug("post url: %s" % url) + self.redfish_log_debug("Playload: %s" % playload) + + playload_json = json.dumps(playload) + result = False + try: + cmd_post="curl --connect-timeout %d -m %d -X POST %s -d \'%s\'" % (self.connect_timeout, self.operation_timeout, self.get_full_url(url), playload_json) + ret_msg = self._exec_cmd(cmd_post) + if ret_msg == None: + return False + elif ret_msg["success"] == False: + self.redfish_log_error("Url: '%s', Playload: '%s', Bmc return failed, error_message: %s" % (url, playload_json, ret_msg["Message"])) + result = False + else: + result = True + return result + except Exception as e: + self.redfish_log_error("error_message: %s" % e) + return False + + def get_thermal(self): + """Get thermal info + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.ThermalUrl) + + def get_power(self): + """Get power info + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.PowerUrl) + + def get_thresholdSensors(self): + """Get thresholdSensors info + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.ThresholdSensorsUrl) + + def post_odata(self, odata_id, playload): + """post odata info + :params odata_id: the specified odata_id path + :type odata_id: string + :playload: info to post + :type: dictionary + :returns: True or False + """ + if odata_id is None or playload is None: + print("post failed: odata_id or playload is None") + return False + return self._redfish_post(odata_id, playload) + + def get_odata(self, odata_id): + """Get odata info + :params odata_id: the specified odata_id path + :type odata_id: string + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + if odata_id is None: + print("Get odata_id failed: odata_id is None") + return None + return self._redfish_get(odata_id) + + def post_fanSpeed(self, playload): + """post odata info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post failed: playload is None") + return False + return self._redfish_post(self.FanSpeedUrl, playload) + + def get_board(self, board_name="indicatorboard"): + """Get board info + :board_name: name of board, default is "indicatorboard" + :type: string + :returns: class'redfish.rest.v1.RestResponse' or None when failed + """ + if board_name is None : + print("get failed: board_name is None") + return None + return self._redfish_get(self.BoardsUrl + board_name) + + def post_boardLed(self, playload, board_name="indicatorboard"): + """post boardLed info + :board_name: name of board, default is "indicatorboard" + :type: string + :playload: info to post + :type: dictionary + :returns: True or False + """ + if board_name is None or playload is None: + print("post failed: playload is None") + return False + return self._redfish_post(self.BoardLedUrl.format(board_name), playload) + + ''' not supported currently + def post_thermal(self, playload): + """post thermal info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post_thermal failed: playload is None") + return None + return self._redfish_post(self.ThermalUrl, playload) + + def post_power(self, playload): + """post power info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post_power failed: playload is None") + return None + return self._redfish_post(self.PowerUrl, playload) + + def post_thresholdSensors(self, playload): + """post thresholdSensors info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post_thresholdSensors failed: playload is None") + return None + return self._redfish_post(self.ThresholdSensorsUrl, playload) + + def get_fanSpeed(self): + """Get board led info + :returns: class'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.FanSpeedUrl) + + def post_board(self, playload, board_name="indicatorboard"): + """post board info + :board_name: name of board, default is "indicatorboard" + :type: string + :playload: info to post + :type: dictionary + :returns: True or False + """ + if board_name is None or playload is None: + print("post failed: playload is None") + return False + return self._redfish_post(self.BoardsUrl + board_name, playload) + + def get_boardLed(self, board_name="indicatorboard"): + """Get boardLed info + :board_name: name of board, default is "indicatorboard" + :type: string + :returns: class'redfish.rest.v1.RestResponse' or None when failed + """ + if board_name is None : + print("get failed: board_name is None") + return None + return self._redfish_get(self.BoardsUrl % board_name) + + ''' + +''' +if __name__ == '__main__': + redfish = Redfish_Api() + + ### get + # boards + ret = redfish.get_board() + if ret is None: + print("get failed: board") + else: + print("get succeeded, board:%s" % ret) + + ret = redfish.get_thresholdSensors() + if ret is None: + print("get failed: threshold") + else: + print("get succeeded, threshold:%s" % ret) + + ret = redfish.get_power() + if ret is None: + print("get failed: power") + else: + print("get succeeded, power:%s" % ret) + + ret = redfish.get_thermal() + if ret is None: + print("get failed:thermal") + else: + print("get succeeded,thermal:%s" % ret) + + # get playload + resp = redfish.get_thresholdSensors() + if (resp != None): + print(resp["@odata.id"]) + print(resp["@odata.type"]) + print(resp["Id"]) + print(resp["Name"]) + else: + print("Failed: get_thresholdSensors") + + ### post + # fanSpeed + playload = {} + playload["FanName"] = 'Fan0' + playload["FanSpeedLevelPercents"] = "70" + print("post fanSpeed:%s" % redfish.post_fanSpeed(playload)) + + #{"LEDs": [{"IndicatorLEDColor": "green","LEDType": "sys"},{"IndicatorLEDColor": "off","LEDType": "pwr"},{"IndicatorLEDColor": "green","LEDType": "fan"}]} + playload = {} + led = {} + led1 = {} + led_list = [] + led["IndicatorLEDColor"] = "green" + led["LEDType"] = "sys" + led1["IndicatorLEDColor"] = "off" + led1["LEDType"] = "pwr" + led_list.append(led) + led_list.append(led1) + playload["LEDs"] = led_list + # boardsLed + print("post boardLed:%s" % redfish.post_boardLed(playload)) +''' diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/sfp.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/sfp.py new file mode 100644 index 000000000000..29dd0cb079c1 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/sfp.py @@ -0,0 +1,325 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +############################################################################# +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +# +# *_device.py config version instruction: +# ver 1.0 - platform api: +# "presence_cpld": { +# "dev_id": { +# [dev_id]: { +# "offset": { +# [offset]: [port_id] +# } +# } +# } +# } +# "reset_cpld": { +# "dev_id": { +# [dev_id]: { +# "offset": { +# [offset]: [port_id] +# } +# } +# } +# } +# ver 2.0 - wb_plat: +# "presence_path": "/xx/wb_plat/xx[port_id]/present" +# "eeprom_path": "/sys/bus/i2c/devices/i2c-[bus]/[bus]-0050/eeprom" +# "reset_path": "/xx/wb_plat/xx[port_id]/reset" +############################################################################# +import sys +import time +import os +import syslog +import traceback +from abc import abstractmethod + +configfile_pre = "/usr/local/bin/" +sys.path.append(configfile_pre) + +try: + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + +except ImportError as error: + raise ImportError(str(error) + "- required module not found") from error + +LOG_DEBUG_LEVEL = 1 +LOG_WARNING_LEVEL = 2 +LOG_ERROR_LEVEL = 3 + + +class Sfp(SfpOptoeBase): + + OPTOE_DRV_TYPE1 = 1 + OPTOE_DRV_TYPE2 = 2 + OPTOE_DRV_TYPE3 = 3 + + # index must start at 1 + def __init__(self, index): + SfpOptoeBase.__init__(self) + self.sfp_type = None + self.log_level_config = LOG_WARNING_LEVEL + # Init instance of SfpCust + self._sfp_api = SfpV2(index) + + def get_eeprom_path(self): + return self._sfp_api._get_eeprom_path() + + def read_eeprom(self, offset, num_bytes): + return self._sfp_api.read_eeprom(offset, num_bytes) + + def write_eeprom(self, offset, num_bytes, write_buffer): + return self._sfp_api.write_eeprom(offset, num_bytes, write_buffer) + + def get_presence(self): + return self._sfp_api.get_presence() + + def get_transceiver_info(self): + # temporary solution for a sonic202111 bug + transceiver_info = super().get_transceiver_info() + try: + if transceiver_info["vendor_rev"] is not None: + transceiver_info["hardware_rev"] = transceiver_info["vendor_rev"] + except BaseException: + print(traceback.format_exc()) + return None + return transceiver_info + + def set_optoe_write_max(self, write_max): + """ + This func is declared and implemented by SONiC but we're not supported + so override it as NotImplemented + """ + self._sfplog(LOG_DEBUG_LEVEL, "set_optoe_write_max NotImplemented") + + def refresh_xcvr_api(self): + """ + Updates the XcvrApi associated with this SFP + """ + self._xcvr_api = self._xcvr_api_factory.create_xcvr_api() + class_name = self._xcvr_api.__class__.__name__ + optoe_type = None + # set sfp_type + if 'CmisApi' in class_name: + self.sfp_type = 'QSFP-DD' + optoe_type = self.OPTOE_DRV_TYPE3 + elif 'Sff8472Api' in class_name: + self.sfp_type = 'SFP' + optoe_type = self.OPTOE_DRV_TYPE2 + elif ('Sff8636Api' in class_name or 'Sff8436Api' in class_name): + self.sfp_type = 'QSFP' + optoe_type = self.OPTOE_DRV_TYPE1 + # set optoe driver + if optoe_type is not None: + self._sfp_api.set_optoe_type(optoe_type) + + def _sfplog(self, log_level, msg): + if log_level >= self.log_level_config: + try: + syslog.openlog("Sfp") + if log_level == LOG_DEBUG_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_WARNING_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_ERROR_LEVEL: + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + except BaseException: + print(traceback.format_exc()) + + +class SfpCust(): + def __init__(self, index): + self.eeprom_path = None + self._init_config(index) + + def _init_config(self, index): + self.log_level_config = LOG_WARNING_LEVEL + self._port_id = index + self.eeprom_retry_times = 5 + self.eeprom_retry_break_sec = 0.2 + + def _get_eeprom_path(self): + return self.eeprom_path or None + + @abstractmethod + def get_presence(self): + pass + + def read_eeprom(self, offset, num_bytes): + try: + for i in range(self.eeprom_retry_times): + with open(self._get_eeprom_path(), mode='rb', buffering=0) as f: + f.seek(offset) + result = f.read(num_bytes) + # temporary solution for a sonic202111 bug + if len(result) < num_bytes: + result = result[::-1].zfill(num_bytes)[::-1] + if result is not None: + return bytearray(result) + time.sleep(self.eeprom_retry_break_sec) + continue + + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return None + + def write_eeprom(self, offset, num_bytes, write_buffer): + try: + for i in range(self.eeprom_retry_times): + ret = SfpOptoeBase.write_eeprom(self, offset, num_bytes, write_buffer) + if ret is False: + time.sleep(self.eeprom_retry_break_sec) + continue + break + + return ret + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + + @abstractmethod + def set_optoe_type(self, optoe_type): + pass + + @abstractmethod + def set_reset(self, reset): + pass + + def _convert_str_range_to_int_arr(self, range_str): + if not range_str: + return [] + + int_range_strs = range_str.split(',') + range_res = [] + for int_range_str in int_range_strs: + if '-' in int_range_str: + range_s = int(int_range_str.split('-')[0]) + range_e = int(int_range_str.split('-')[1]) + 1 + else: + range_s = int(int_range_str) + range_e = int(int_range_str) + 1 + + range_res = range_res + list(range(range_s, range_e)) + + return range_res + + def _sfplog(self, log_level, msg): + if log_level >= self.log_level_config: + try: + syslog.openlog("SfpCust") + if log_level == LOG_DEBUG_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_WARNING_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_ERROR_LEVEL: + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + except BaseException: + print(traceback.format_exc()) + + +class SfpV2(SfpCust): + def _init_config(self, index): + super()._init_config(index) + # init eeprom path + sfp_pt2ee_path_list = [0] * 53 + sfp_pt2ee_path_list[49:53] = [9, 10, 11, 12] + + eeprom_path_config = "/sys/bus/i2c/devices/i2c-%d/%d-0050/eeprom" + eeprom_path_key = sfp_pt2ee_path_list[self._port_id] + self.eeprom_path = None if eeprom_path_config is None or eeprom_path_key == 0 else eeprom_path_config % ( + eeprom_path_key, eeprom_path_key) + self._sfplog(LOG_DEBUG_LEVEL, "Done init eeprom path: %s" % self.eeprom_path) + + # init presence path + self.presence_path = "/sys/bus/i2c/devices/3-0030/sfp_presence1" + self.presence_val_is_present = 0 + self._sfplog(LOG_DEBUG_LEVEL, "Done init presence path: %s" % self.presence_path) + + # init optoe driver path + optoe_driver_path = "/sys/bus/i2c/devices/i2c-%d/%d-0050/dev_class" + optoe_driver_key = sfp_pt2ee_path_list[self._port_id] + self.dev_class_path = None if optoe_driver_path is None or optoe_driver_key == 0 else optoe_driver_path % ( + optoe_driver_key, optoe_driver_key) + self._sfplog(LOG_DEBUG_LEVEL, "Done init optoe driver path: %s" % self.dev_class_path) + + # init reset path + self.reset_val_is_reset = 0 + + new_device_path = "/sys/bus/i2c/devices/i2c-%d/new_device" + new_device_key = sfp_pt2ee_path_list[self._port_id] + self.new_class_path = None if new_device_path is None or new_device_key == 0 else new_device_path % new_device_key + self._sfplog(LOG_DEBUG_LEVEL, "Done init new_class path: %s" % self.new_class_path) + + if sfp_pt2ee_path_list[self._port_id] != 0: + self.add_new_sfp_device(self._port_id, 0x50) + self._sfplog(LOG_DEBUG_LEVEL, "Done add_new_sfp_device 0x50 port %d" % self._port_id) + + def sfp_add_dev(self, new_device_path, devaddr, devtype): + try: + # Write device address to new_device file + nd_file = open(new_device_path, "w") + nd_str = "%s %s" % (devtype, hex(devaddr)) + nd_file.write(nd_str) + nd_file.close() + except Exception as err: + self._sfplog(LOG_ERROR_LEVEL, ("Error writing to new device file: %s" % str(err))) + return 1 + else: + return 0 + + def add_new_sfp_device(self, port_num, devid): + if os.path.exists(self.dev_class_path): + return + + ret = self.sfp_add_dev(self.new_class_path, devid, "optoe2") + if ret != 0: + self._sfplog(LOG_ERROR_LEVEL, "Error adding sfp device") + + def get_presence(self): + sfp_ls = [49, 50, 51, 52] + if self._port_id not in sfp_ls or self.presence_path is None: + self._sfplog(LOG_ERROR_LEVEL, "presence_path is None!") + return False + try: + with open(self.presence_path, "rb") as data: + presence_data = data.read(2) + if presence_data == "": + return False + result = int(presence_data, 16) + + # ModPrsL is active low + presence_offset = sfp_ls.index(self._port_id) + if result & (1 << presence_offset) == 0: + return True + return False + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + + def set_reset(self, reset): + return True + + def set_optoe_type(self, optoe_type): + if self.dev_class_path is None: + self._sfplog(LOG_ERROR_LEVEL, "dev_class_path is None!") + return False + try: + with open(self.dev_class_path, "r+") as dc_file: + dc_file_val = dc_file.read(1) + if int(dc_file_val) != optoe_type: + dc_str = "%s" % str(optoe_type) + dc_file.write(dc_str) + # dc_file.close() + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + return True diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/thermal.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/thermal.py new file mode 100644 index 000000000000..5fded8d9ddeb --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-fa/sonic_platform/thermal.py @@ -0,0 +1,172 @@ +#!/usr/bin/env python + +import os +import re +import os.path +import time + +try: + from sonic_platform_base.thermal_base import ThermalBase + from .redfish_api import Redfish_Api +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + def __init__(self, thermal_index): + ThermalBase.__init__(self) + self.index = thermal_index + self.high_threshold = float(112) + self.redfish = Redfish_Api() + self.pinf = {} + self.begin = time.time() + + def get_power_3s(self): + self.elapsed = time.time() + if not self.pinf or self.elapsed - self.begin >= 3: + self.begin = time.time() + self.pinf = self.redfish.get_thermal() + + def get_temperature(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + temp = output.get("ReadingCelsius") + return temp + + def get_high_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + temp = output.get("UpperThresholdFatal") + return temp + + def get_low_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + temp = output.get("LowerThresholdFatal") + return temp + + def get_high_critical_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + temp = output.get("UpperThresholdFatal") + return temp + + def get_low_critical_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + temp = output.get("LowerThresholdFatal") + return temp + + def get_name(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index].get("Name") + name = output.split("/",3)[2] + if name == "SWITCH_TEMP": + name = "ASIC_TEMP" + return "{}".format(name) + + def get_real_name(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index].get("Name") + name = output.split("/",3)[2] + return "{}".format(name) + + def get_presence(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + if output.get("Status").get("Status").get("State") == "Enabled": + return True + return False + + def get_status(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + if output.get("Status").get("Status").get("Health") == "OK": + return True + return False + + def set_sys_led(self, color): + playload = {} + led = {} + led_list = [] + led["IndicatorLEDColor"] = color + led["LEDType"] = "sys" + led_list.append(led) + playload["LEDs"] = led_list + # boardsLed + return self.redfish.post_boardLed(playload) + + def get_minimum_recorded(self): + """ + Retrieves the minimum recorded temperature of thermal + + Returns: + A float number, the minimum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return "N/A" + + def get_maximum_recorded(self): + """ + Retrieves the maximum recorded temperature of thermal + + Returns: + A float number, the maximum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return "N/A" + + def get_model(self): + """ + Retrieves the model number (or part number) of the Thermal + + Returns: + string: Model/part number of Thermal + """ + return "N/A" + + def get_serial(self): + """ + Retrieves the serial number of the Thermal + + Returns: + string: Serial number of Thermal + """ + return "N/A" + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + return "N/A" + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/config/arm64_micas_m2_w6010_48gt4x_ra_r0_config.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/config/arm64_micas_m2_w6010_48gt4x_ra_r0_config.py new file mode 100755 index 000000000000..1cb395dd7375 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/config/arm64_micas_m2_w6010_48gt4x_ra_r0_config.py @@ -0,0 +1,90 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- +from platform_common import * +PCA9548START = -1 +PCA9548BUSEND = -2 + +PLATFORM_CARDID = 0x00004065 +PLATFORM_PRODUCTNAME = "M2-W6010-48GT4X-RA" +PLATFORM_PART_NUMBER = "01017247" +PLATFORM_LABEL_REVISION = "R01" +PLATFORM_ONIE_VERSION = "2018.05-rc1" +PLATFORM_MAC_SIZE = 3 +PLATFORM_MANUF_NAME = "Micas" +PLATFORM_MANUF_COUNTRY = "USA" +PLATFORM_VENDOR_NAME = "Micas" +PLATFORM_DIAG_VERSION = "0.1.0.15" +PLATFORM_SERVICE_TAG = "www.micasnetworks.com" + + +LOCAL_LED_CONTROL = { + "CLOSE":{}, + "OPEN":{} +} + +MACLED_PARAMS = [] + +# start system modules +STARTMODULE = { + "i2ccheck":0, + "fancontrol":0, + "avscontrol":0, + "avscontrol_restful":0, + "sfptempmodule":0, + "sfptempmodule_interval":3, + "macledreset": 0, + "macledreset_interval": 5, + "macledset_param":MACLED_PARAMS, + } + +FRULISTS = [ + {"name":"mmceeprom","bus":5,"loc":0x50, "E2PRODUCT":'2', "E2TYPE":'5' , "CANRESET":'1'}, + {"name":"cpueeprom","bus":5,"loc":0x57,"E2PRODUCT":'2', "E2TYPE":'4', "CANRESET":'1' }, + ] + +# eeprom = "1-0056/eeprom" +E2_LOC = {"bus":1, "devno":0x56} +E2_PROTECT = {} + + +CPLDVERSIONS = [ + {"bus":2, "devno":0x0d, "name":"CPU_CPLD"}, + {"bus":3, "devno":0x30, "name":"MAC_BOARD_CPLD_1"}, +] + +FIRMWARE_TOOLS = {"cpld": [{"channel":"0","cmd":"firmware_upgrade %s cpld %s cpld", "successtips":"CPLD Upgrade succeeded!"} + ], + } + +# drivers list +DRIVERLISTS = [ + {"name":"i2c_dev", "delay":0}, + {"name":"i2c_algo_bit","delay":0}, + {"name":"spi-bitbang", "delay":0}, + {"name":"i2c_mux", "delay":0}, + {"name":"rtcpcf85063", "delay":0}, + {"name":"i2c_mux_pca954x", "delay":0}, # force_deselect_on_exit=1 + {"name":"platform_common dfd_my_type=0x4065", "delay":0}, + {"name":"wb_cpld", "delay":0}, + {"name":"wb_at24", "delay":0}, + {"name":"optoe", "delay":0}, +] + +DEVICE = [ + {"name":"rtcpcf85063","bus":1,"loc":0x51 }, + {"name":"wb_24c02","bus":1,"loc":0x56 }, + {"name":"wb_cpld","bus":3,"loc":0x30 }, + {"name":"wb_24c02","bus":5,"loc":0x50 }, + {"name":"wb_24c02","bus":5,"loc":0x57 }, +] + +INIT_PARAM = [ + {"loc":"3-0030/tx_write_protect","value": "59","delay":1}, + {"loc":"3-0030/tx_disable","value": "00"}, + {"loc":"3-0030/tx_write_protect","value": "4e"}, +] + +INIT_COMMAND = [ + "hwclock -s", +] + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/config/fan_ctrl_cfg.json b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/config/fan_ctrl_cfg.json new file mode 100644 index 000000000000..86fcf892f032 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/config/fan_ctrl_cfg.json @@ -0,0 +1,40 @@ +{ + "Device": { + "Liquid": 0, + "Buildin": 1, + "PID": 0, + "OpenLoop": 1 + }, + "Thermal": { + "INLET_TEMP": "INLET_TEMP", + "OUTLET_TEMP": "OUTLET_TEMP", + "SWITCH_TEMP": "TPS53688_TEMP" + }, + "Fans": { + "Fan1" : "Fantray1_1", + "Fan2" : "Fantray2_1" + }, + "PID": { + "Pwm_Max": 99, + "Pwm_Min": 30, + "SetPoint" : 90, + "P": 1.5, + "I": 1, + "D": 0.3, + "Temp_Min": 28.0, + "Temp_Max": 45.0, + "Sensor": "TPS53688_TEMP" + }, + "OpenLoop": { + "a": -0.06, + "b": 10.3, + "c": -142.0, + "fix_up": -8, + "pwmMax": 99, + "pwmMin": 30, + "tempMin": 25 + }, + "FanError": { + "Fan_Pwmmax":99 + } +} \ No newline at end of file diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/service/m2-w6010-48gt4x_platform.service b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/service/m2-w6010-48gt4x_platform.service new file mode 100644 index 000000000000..988739214bf7 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/service/m2-w6010-48gt4x_platform.service @@ -0,0 +1,13 @@ +[Unit] +Description=Centec modules init +After=local-fs.target +Before=syncd.service + +[Service] +Type=oneshot +ExecStart=-/etc/init.d/platform-modules-micas-m2-w6010-48gt4x-ra start +ExecStop=-/etc/init.d/platform-modules-micas-m2-w6010-48gt4x-ra stop +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/setup.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/setup.py new file mode 100644 index 000000000000..b8aab82034ed --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/setup.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +import os +import sys +from setuptools import setup + +setup( + name='sonic_platform', + version='1.0', + description='Module to initialize centec platforms', + + packages=['sonic_platform'], + package_dir={'sonic_platform': 'sonic_platform'}, +) + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/__init__.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/__init__.py new file mode 100644 index 000000000000..4bfefa0fb636 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +__all__ = ["platform", "chassis"] +from sonic_platform import * + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/chassis.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/chassis.py new file mode 100644 index 000000000000..8cdf84cf3840 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/chassis.py @@ -0,0 +1,444 @@ + +#!/usr/bin/env python + +try: + import time + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.eeprom import Eeprom + from sonic_platform.thermal import Thermal + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.sfp import Sfp + from sonic_platform.psu import Psu + from .component import Component +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_FAN_TRAY = 2 +NUM_FAN = 2 +NUM_THERMAL = 5 +NUM_PORT = 52 +NUM_PSU = 2 + +class Chassis(ChassisBase): + + port_dict = {} + STATUS_INSERTED = "1" + STATUS_REMOVED = "0" + + def __init__(self): + ChassisBase.__init__(self) + # Initialize EEPROM + self._eeprom = Eeprom() + #firmware + for i in range(0,2): + self._component_list.append(Component(i)) + # Initialize FAN + for i in range(NUM_FAN_TRAY): + fandrawer = FanDrawer(i) + self._fan_drawer_list.append(fandrawer) + self._fan_list.extend(fandrawer._fan_list) + # Initialize THERMAL + for index in range(0, NUM_THERMAL): + thermal = Thermal(index) + self._thermal_list.append(thermal) + # Initialize SFP + for index in range(0, NUM_PORT + 1): + sfp = Sfp(index) + self._sfp_list.append(sfp) + if sfp.get_presence(): + self.port_dict[index] = self.STATUS_INSERTED + else: + self.port_dict[index] = self.STATUS_REMOVED + # Initialize PSU + for index in range(0, NUM_PSU): + psu = Psu(index) + self._psu_list.append(psu) + +############################################## +# Device methods +############################################## + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + name = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + name = sys_eeprom.modelstr(e) + if name is None: + return '' + return name + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + model = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + model = sys_eeprom.modelnumber(e) + if model is None: + return '' + return model + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this chassis. + """ + serial_number = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + serial_number = sys_eeprom.serial_number_str(e) + if serial_number is None: + return '' + + return serial_number + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + device_version = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + device_version = sys_eeprom.deviceversion(e) + if device_version is None: + return '' + + return device_version + + def get_serial(self): + """ + Retrieves the serial number of the chassis (Service tag) + Returns: + string: Serial number of chassis + """ + return self.get_serial_number() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def initizalize_system_led(self): + return True + + def get_status_led(self): + """ + Gets the state of the system LED + + Returns: + A string, one of the valid LED color strings which could be vendor + specified. + """ + return 'green' + + def set_status_led(self, color): + return False +############################################## +# Chassis methods +############################################## + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + base_mac = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + base_mac = sys_eeprom.base_mac_addr(e) + if base_mac is None: + return '' + + return base_mac.upper() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + """ + sys_eeprom_dict = dict() + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return {} + + e = sys_eeprom.read_eeprom() + if sys_eeprom._TLV_HDR_ENABLED: + if not sys_eeprom.is_valid_tlvinfo_header(e): + return {} + total_len = (e[9] << 8) | e[10] + tlv_index = sys_eeprom._TLV_INFO_HDR_LEN + tlv_end = sys_eeprom._TLV_INFO_HDR_LEN + total_len + else: + tlv_index = sys_eeprom.eeprom_start + tlv_end = sys_eeprom._TLV_INFO_MAX_LEN + + while (tlv_index + 2) < len(e) and tlv_index < tlv_end: + if not sys_eeprom.is_valid_tlv(e[tlv_index:]): + break + + tlv = e[tlv_index:tlv_index + 2 + e[tlv_index + 1]] + name, value = sys_eeprom.decoder(None, tlv) + sys_eeprom_dict[name] = value + + if e[tlv_index] == sys_eeprom._TLV_CODE_QUANTA_CRC or \ + e[tlv_index] == sys_eeprom._TLV_CODE_CRC_32: + break + tlv_index += e[tlv_index + 1] + 2 + + return sys_eeprom_dict + + def get_thermal_manager(self): + """ + Retrieves thermal manager class on this chassis + :return: A class derived from ThermalManagerBase representing the + specified thermal manager. ThermalManagerBase is returned as default + """ + return False + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + return (None, None) + + def get_module(self, index): + """ + Retrieves module represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the module to + retrieve + + Returns: + An object dervied from ModuleBase representing the specified + module + """ + module = None + + try: + if self.get_num_modules(): + module = self._module_list[index] + except IndexError: + sys.stderr.write("Module index {} out of range (0-{})\n".format( + index, len(self._module_list)-1)) + + return module + + def get_fan_drawer(self, index): + """ + Retrieves fan drawers represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the fan drawer to + retrieve + + Returns: + An object dervied from FanDrawerBase representing the specified fan + drawer + """ + fan_drawer = None + + try: + if self.get_num_fan_drawers(): + fan_drawer = self._fan_drawer_list[index] + except IndexError: + sys.stderr.write("Fan drawer index {} out of range (0-{})\n".format( + index, len(self._fan_drawer_list)-1)) + + return fan_drawer + + def get_change_event(self, timeout=0): + """ + Returns a nested dictionary containing all devices which have + experienced a change at chassis level + + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + + Returns: + (bool, dict): + - bool: True if call successful, False if not; + - dict: A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, where device_id is the device ID + for this device and device_event. + The known devices's device_id and device_event was defined as table below. + ----------------------------------------------------------------- + device | device_id | device_event | annotate + ----------------------------------------------------------------- + 'fan' '' '0' Fan removed + '1' Fan inserted + + 'sfp' '' '0' Sfp removed + '1' Sfp inserted + '2' I2C bus stuck + '3' Bad eeprom + '4' Unsupported cable + '5' High Temperature + '6' Bad cable + + 'voltage' '' '0' Vout normal + '1' Vout abnormal + -------------------------------------------------------------------- + Ex. {'fan':{'0':'0', '2':'1'}, 'sfp':{'11':'0', '12':'1'}, + 'voltage':{'U20':'0', 'U21':'1'}} + Indicates that: + fan 0 has been removed, fan 2 has been inserted. + sfp 11 has been removed, sfp 12 has been inserted. + monitored voltage U20 became normal, voltage U21 became abnormal. + Note: For sfp, when event 3-6 happened, the module will not be avalaible, + XCVRD shall stop to read eeprom before SFP recovered from error status. + """ + + change_event_dict = {"fan": {}, "sfp": {}, "voltage": {}} + + start_time = time.time() + forever = False + + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + print("get_change_event:Invalid timeout value", timeout) + return False, change_event_dict + + end_time = start_time + timeout + if start_time > end_time: + print( + "get_change_event:" "time wrap / invalid timeout value", + timeout, + ) + return False, change_event_dict # Time wrap or possibly incorrect timeout + try: + while timeout >= 0: + # check for sfp + sfp_change_dict = self.get_transceiver_change_event() + # check for fan + # fan_change_dict = self.get_fan_change_event() + # check for voltage + # voltage_change_dict = self.get_voltage_change_event() + + if sfp_change_dict: + change_event_dict["sfp"] = sfp_change_dict + # change_event_dict["fan"] = fan_change_dict + # change_event_dict["voltage"] = voltage_change_dict + return True, change_event_dict + if forever: + time.sleep(1) + else: + timeout = end_time - time.time() + if timeout >= 1: + time.sleep(1) # We poll at 1 second granularity + else: + if timeout > 0: + time.sleep(timeout) + return True, change_event_dict + except Exception as e: + print(e) + print("get_change_event: Should not reach here.") + return False, change_event_dict + + def get_transceiver_change_event(self): + current_port_dict = {} + ret_dict = {} + + # Check for OIR events and return ret_dict + for index in range(0, NUM_PORT + 1): + if self._sfp_list[index].get_presence(): + current_port_dict[index] = self.STATUS_INSERTED + else: + current_port_dict[index] = self.STATUS_REMOVED + + if len(self.port_dict) == 0: # first time + self.port_dict = current_port_dict + return {} + + if current_port_dict == self.port_dict: + return {} + + # Update reg value + for index, status in current_port_dict.items(): + if self.port_dict[index] != status: + ret_dict[index] = status + #ret_dict[str(index)] = status + self.port_dict = current_port_dict + for index, status in ret_dict.items(): + if int(status) == 1: + pass + #self._sfp_list[int(index)].check_sfp_optoe_type() + return ret_dict diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/component.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/component.py new file mode 100644 index 000000000000..325c000eea74 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/component.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +try: + import subprocess + from sonic_platform_base.component_base import ComponentBase + import sonic_platform.hwaccess as hwaccess +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +def get_cpld_version(bus, i2caddr): + return '{}{}{}{}'.format(hwaccess.i2c_get(bus, i2caddr, 1), + hwaccess.i2c_get(bus, i2caddr, 2), + hwaccess.i2c_get(bus, i2caddr, 3), + hwaccess.i2c_get(bus, i2caddr, 0) + ) + +def get_cpu_cpld_version(): + return get_cpld_version(2, 0x0d) + +def get_cpld1_version(): + return get_cpld_version(3, 0x30) + +COMPONENT_LIST= [ + ['CPU CPLD', + 'cpu board', + get_cpu_cpld_version + ], + + ['MAC1 CPLD', + 'mac1 board', + get_cpld1_version + ] + ] + +class Component(ComponentBase): + """Platform-specific Component class""" + + def __init__(self, component_index=0): + ComponentBase.__init__(self) + self.index = component_index + + def get_name(self): + """ + Retrieves the name of the component + + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + def get_firmware_version(self): + """ + Retrieves the firmware version of the component + + Returns: + A string containing the firmware version of the component + """ + return COMPONENT_LIST[self.index][2]() + + def install_firmware(self, image_path): + """ + Installs firmware to the component + + Args: + image_path: A string, path to firmware image + + Returns: + A boolean, True if install was successful, False if not + """ + try: + successtips = "CPLD Upgrade succeeded!" + status, output = subprocess.getstatusoutput("which firmware_upgrade") + if status or len(output) <= 0: + logger.error("no upgrade tool.") + return False + cmdstr = "%s %s cpld %d cpld"%(output,image_path,self.slot) + ret, log = subprocess.getstatusoutput(cmdstr) + if ret == 0 and successtips in log: + return True + logger.error("upgrade failed. ret:%d, log:\n%s" % (ret, log)) + except Exception as e: + logger.error(str(e)) + return False + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/eeprom.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/eeprom.py new file mode 100644 index 000000000000..af5da656b7b0 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/eeprom.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +try: + from sonic_eeprom import eeprom_tlvinfo + import binascii +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + """Platform-specific Eeprom class""" + + def __init__(self): + eeprom_path = "/sys/bus/i2c/devices/1-0056/eeprom" + if eeprom_path is None: + raise ValueError("get eeprom path failed") + + super(Eeprom, self).__init__(eeprom_path, 0, "", True) + + + def modelnumber(self, e): + ''' + Returns the value field of the model(part) number TLV as a string + ''' + (is_valid, t) = self.get_tlv_field(e, self._TLV_CODE_PART_NUMBER) + if not is_valid: + return super(Eeprom, self).part_number_str(e) + + return t[2].decode("ascii") + + def deviceversion(self, e): + ''' + Returns the value field of the Device Version as a string + ''' + (is_valid, t) = self.get_tlv_field(e, self._TLV_CODE_DEVICE_VERSION) + if not is_valid: + return "N/A" + + return str(ord(t[2])) diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/fan.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/fan.py new file mode 100644 index 000000000000..69cb80e53fa1 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/fan.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python + +import time + +try: + from sonic_platform_base.fan_base import FanBase + from .redfish_api import Redfish_Api +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +FAN_NAME_LIST = ["1", "2"] + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, fan_tray_index, fan_index=0): + self.fan_index = fan_index + self.fan_tray_index = fan_tray_index + self.redfish = Redfish_Api() + self.pinf = {} + self._fan_list = [] + FanBase.__init__(self) + self.begin = time.time() + + def get_power_3s(self): + self.elapsed = time.time() + if not self.pinf or self.elapsed - self.begin >= 3: + self.begin = time.time() + self.pinf = self.redfish.get_thermal() + + def get_speed_pwm(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + speed = output.get("Oem").get("OpenBmc").get("FanSpeedLevelPercents") + return int(speed) + + def get_speed_rpm(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + speed = output.get("Reading") + return int(speed) + + def get_high_critical_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + high = output.get("UpperThresholdFatal") + return int(high) + + def get_low_critical_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + low = output.get("LowerThresholdFatal") + return int(low) + + def set_speed_pwm(self, speed): + post_url = '/redfish/v1/Chassis/1/Thermal/Actions/Oem/OpenBmc/Fan.SetSpeed' + playload = {} + playload["FanName"] = "Fan0" + playload["FanSpeedLevelPercents"] = str(speed) + return self.redfish.post_odata(post_url, playload) + + def get_status_led(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + led = output.get("Oem").get("OpenBmc").get("IndicatorLEDColor") + return led + + def set_status_led(self, color): + playload = {} + led = {} + led_list = [] + led["IndicatorLEDColor"] = color + led["LEDType"] = "fan" + led_list.append(led) + playload["LEDs"] = led_list + # boardsLed + return self.redfish.post_boardLed(playload) + + def get_direction(self): + return "exhaust" + + def get_name(self): + fan_name = FAN_NAME_LIST[self.fan_index] + return "Fantray{}_{}".format(self.fan_tray_index+1, fan_name) + + def get_model(self): + """ + Retrieves the part number of the FAN + Returns: + string: Part number of FAN + """ + return 'N/A' + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the FAN + Returns: + string: Serial number of FAN + """ + return 'N/A' + + def get_presence(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + state = output.get("Status").get("Status").get("State") + if state == "Enabled" or state == "UnavailableOffline": + return True + return False + + def get_status(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + if output.get("Status").get("Status").get("Health") == "OK": + return True + return False + + def get_speed(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fan_tray_index] + speed = output.get("Reading") + speed_percentage = round((speed*100)/17500) + if speed_percentage > 100: + speed_percentage = 100 + return speed_percentage + else: + return speed_percentage + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return 30 + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + return self.get_speed_pwm() diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/fan_drawer.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..fcf7d519ca8d --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/fan_drawer.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python + +import time + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase + from sonic_platform.fan import Fan + from .redfish_api import Redfish_Api +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(FanDrawerBase): + + FANS_PER_FANTRAY = 1 + + def __init__(self, fantray_index=0): + FanDrawerBase.__init__(self) + self.fantrayindex = fantray_index + self.redfish = Redfish_Api() + self.pinf = {} + self.begin = time.time() + for i in range(self.FANS_PER_FANTRAY): + self._fan_list.append(Fan(fantray_index, i)) + + def get_power_3s(self): + self.elapsed = time.time() + if not self.pinf or self.elapsed - self.begin >= 3: + self.begin = time.time() + self.pinf = self.redfish.get_thermal() + + def get_name(self): + return "FanTray{}".format(self.fantrayindex+1) + + def get_presence(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fantrayindex] + state = output.get("Status").get("Status").get("State") + if state == "Enabled" or state == "UnavailableOffline": + return True + return False + + def get_model(self): + """ + Retrieves the part number of the FAN + Returns: + string: Part number of FAN + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the FAN + Returns: + string: Serial number of FAN + """ + return 'N/A' + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + return 'N/A' + + def get_status(self): + """ + Retrieves the operational status of the FAN + Returns: + bool: True if FAN is operating properly, False if not + """ + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fantrayindex] + if output.get("Status").get("Status").get("Health") == "OK": + return True + return False + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_status_led(self): + self.get_power_3s() + ctrl = self.pinf["Fans"] + output = ctrl[self.fantrayindex] + led = output.get("Oem").get("OpenBmc").get("IndicatorLEDColor") + return led + + def set_status_led(self, color): + playload = {} + led = {} + led_list = [] + led["IndicatorLEDColor"] = color + led["LEDType"] = "fan" + led_list.append(led) + playload["LEDs"] = led_list + # boardsLed + return self.redfish.post_boardLed(playload) + + def get_maximum_consumed_power(self): + """ + Retrives the maximum power drawn by Fan Drawer + + Returns: + A float, with value of the maximum consumable power of the + component. + """ + return 'N/A' diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/hwaccess.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/hwaccess.py new file mode 100644 index 000000000000..7a04e766ae28 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/hwaccess.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python + +import struct +import mmap +import subprocess + +# Read PCI device + +def pci_mem_read(mm, offset): + mm.seek(offset) + read_data_stream = mm.read(4) + return struct.unpack('I',read_data_stream)[0] + +def pci_get_value(resource, offset): + with open(resource, 'r+b') as fd: + mm = mmap.mmap(fd.fileno(), 0) + val = pci_mem_read(mm, offset) + mm.close() + return val + +def pci_mem_write(memmap, offset, data): + """ Write PCI device """ + memmap.seek(offset) + memmap.write(struct.pack('I', data)) + +def pci_set_value(resource, val, offset): + """ Set a value to PCI device """ + with open(resource, 'w+b') as filed: + memmap = None + try: + memmap = mmap.mmap(filed.fileno(), 0) + pci_mem_write(memmap, offset, val) + except EnvironmentError: + print("error") + if memmap is not None: + memmap.close() + +# Read I2C device + +def i2c_get(bus, i2caddr, ofs): + try: + valx = int(subprocess.check_output(['/usr/sbin/i2cget','-f', '-y', str(bus), str(i2caddr), str(ofs)]), 16) + return "{:02x}".format(valx) + except (FileNotFoundError, subprocess.CalledProcessError): + return -1 + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/platform.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/platform.py new file mode 100644 index 000000000000..7225a71b0307 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/platform.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() + diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/psu.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/psu.py new file mode 100644 index 000000000000..5176552c12e1 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/psu.py @@ -0,0 +1,231 @@ +#!/usr/bin/env python + +import time +import imp +import os +import sys + +try: + from sonic_platform_base.psu_base import PsuBase + from .redfish_api import Redfish_Api +except ImportError as e: + raise ImportError("%s - required module not found" % e) + +class Psu(PsuBase): + """Platform-specific Psu class""" + + def __init__(self, index=0): + PsuBase.__init__(self) + self.redfish = Redfish_Api() + self.pinf = {} + self.psu_index = index + self._fan_list = [] + self._thermal_list = [] + self.begin = time.time() + + def get_power_3s(self): + self.elapsed = time.time() + if not self.pinf or self.elapsed - self.begin >= 3: + self.begin = time.time() + self.pinf = self.redfish.get_power() + + def get_presence(self): + return True + + def get_fan(self, index): + """ + Retrieves fan module represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the fan module to + retrieve + + Returns: + An object dervied from FanBase representing the specified fan + module + """ + return None + + def get_powergood_status(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + if output.get("Status").get("Health") == "OK": + return True + else: + return False + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "PSU {}".format(self.psu_index + 1) + + def get_serial(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + serial = output.get("SerialNumber") + return serial + + def get_model(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + model = output.get("Model") + return model + + def get_revision(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + manufacturer = output.get("Manufacturer") + return manufacturer + + def get_voltage(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + voltage = output.get("Oem").get("OpenBmc").get("OutputVoltage") + return voltage + + def get_input_current(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + current = output.get("Oem").get("OpenBmc").get("OutputAmperage") + return current + + def get_input_voltage(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + voltage = output.get("Oem").get("OpenBmc").get("OutputVoltage") + return voltage + + def get_current(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + current = output.get("Oem").get("OpenBmc").get("OutputAmperage") + return current + + def get_power(self): + self.get_power_3s() + ctrl = self.pinf["PowerSupplies"] + output = ctrl[self.psu_index] + current = output.get("Oem").get("OpenBmc").get("OutputAmperage") + voltage = output.get("Oem").get("OpenBmc").get("OutputVoltage") + power = float(current)*float(voltage) + return round(power,2) + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + # no temperature sensor + value = 35 + return round(float(value), 1) + + def get_status_led(self): + return "BuildIn" + + def set_status_led(self, color): + playload = {} + led = {} + led_list = [] + led["IndicatorLEDColor"] = color + led["LEDType"] = "pwr" + led_list.append(led) + playload["LEDs"] = led_list + # boardsLed + return self.redfish.post_boardLed(playload) + + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU + + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return False + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_status(self): + """ + Retrieves the operational status of the PSU + + Returns: + bool: True if PSU is operating properly, False if not + """ + return self.get_powergood_status() + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + value = 75 + return round(float(value), 1) + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + value = 14.52 + return str(round(float(value), 2)) + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + value = 9.72 + return str(round(float(value), 2)) + + def get_thermal(self, index): + """ + Retrieves thermal unit represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the thermal to + retrieve + + Returns: + An object dervied from ThermalBase representing the specified thermal + """ + return None diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/redfish_api.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/redfish_api.py new file mode 100644 index 000000000000..9d3cdd31436f --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/redfish_api.py @@ -0,0 +1,304 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +import shlex +import json +import os +import ssl +import subprocess +import syslog + +class Redfish_Api(): + BmcBaseUrl = 'http://240.1.1.1:8080' + ThermalUrl = '/redfish/v1/Chassis/1/Thermal' + PowerUrl = '/redfish/v1/Chassis/1/Power' + ThresholdSensorsUrl = '/redfish/v1/Chassis/1/ThresholdSensors' + FanSpeedUrl = '/redfish/v1/Chassis/1/Thermal/Actions/Oem/OpenBmc/Fan.SetSpeed' + BoardsUrl = '/redfish/v1/Chassis/1/Boards/' + BoardLedUrl = "/redfish/v1/Chassis/1/Boards/{}/Actions/Oem/OpenBmc/Boards.SetLED" + + # Maximum time in seconds that you allow the connection to the server to take. + connect_timeout = 30 + # Maximum time in seconds that you allow the whole operation to take + operation_timeout = 300 + + default_prefix='/redfish/v1/' + session = None + __DEBUG__ = "N" + __DUMP_RESP__ = "N" + RST_STATUS = "status" + RST_SUCCESS = "OK" + refish_logger = None + + def redfish_log_debug(self, msg): + if (self.__DEBUG__ == "Y"): + syslog.openlog("redfis_api") + syslog.syslog(syslog.LOG_DEBUG, msg) + syslog.closelog() + + def redfish_log_error(self, msg): + syslog.openlog("redfish_api") + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + def __init__(self): + pass + + def get_full_url(self, url): + return self.BmcBaseUrl + url + + def _exec_cmd(self, cmd): + self.redfish_log_debug("Cmd: %s" % cmd) + p = subprocess.Popen(shlex.split(cmd), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p.wait() + self.redfish_log_debug("Cmd return: %d" % p.returncode) + str_stdout = p.stdout.read().decode('utf-8') + str_stderr = p.stderr.read().decode('utf-8') + self.redfish_log_debug("Cmd stdout: %s" % str_stdout) + if p.returncode !=0: + self.redfish_log_error("Cmd: %s, failed! error msg:%s" % (cmd, str_stderr)) + return None + else: + try: + ret = json.loads(str_stdout) + return ret + except Exception as e: + self.redfish_log_error("Cmd: %s, failed! stdout msg:%s" % (cmd, str_stdout)) + return None + + def _redfish_get(self, url): + self.redfish_log_debug("Get info from %s." % url) + result = None + try: + cmd_get="curl --connect-timeout %d -m %d -X GET %s" % (self.connect_timeout, self.operation_timeout, self.get_full_url(url)) + result = self._exec_cmd(cmd_get) + return result + except Exception as e: + self.redfish_log_error("error_message: %s" % e) + return None + + def _redfish_post(self, url, playload): + self.redfish_log_debug("post url: %s" % url) + self.redfish_log_debug("Playload: %s" % playload) + + playload_json = json.dumps(playload) + result = False + try: + cmd_post="curl --connect-timeout %d -m %d -X POST %s -d \'%s\'" % (self.connect_timeout, self.operation_timeout, self.get_full_url(url), playload_json) + ret_msg = self._exec_cmd(cmd_post) + if ret_msg == None: + return False + elif ret_msg["success"] == False: + self.redfish_log_error("Url: '%s', Playload: '%s', Bmc return failed, error_message: %s" % (url, playload_json, ret_msg["Message"])) + result = False + else: + result = True + return result + except Exception as e: + self.redfish_log_error("error_message: %s" % e) + return False + + def get_thermal(self): + """Get thermal info + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.ThermalUrl) + + def get_power(self): + """Get power info + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.PowerUrl) + + def get_thresholdSensors(self): + """Get thresholdSensors info + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.ThresholdSensorsUrl) + + def post_odata(self, odata_id, playload): + """post odata info + :params odata_id: the specified odata_id path + :type odata_id: string + :playload: info to post + :type: dictionary + :returns: True or False + """ + if odata_id is None or playload is None: + print("post failed: odata_id or playload is None") + return False + return self._redfish_post(odata_id, playload) + + def get_odata(self, odata_id): + """Get odata info + :params odata_id: the specified odata_id path + :type odata_id: string + :returns: class 'redfish.rest.v1.RestResponse' or None when failed + """ + if odata_id is None: + print("Get odata_id failed: odata_id is None") + return None + return self._redfish_get(odata_id) + + def post_fanSpeed(self, playload): + """post odata info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post failed: playload is None") + return False + return self._redfish_post(self.FanSpeedUrl, playload) + + def get_board(self, board_name="indicatorboard"): + """Get board info + :board_name: name of board, default is "indicatorboard" + :type: string + :returns: class'redfish.rest.v1.RestResponse' or None when failed + """ + if board_name is None : + print("get failed: board_name is None") + return None + return self._redfish_get(self.BoardsUrl + board_name) + + def post_boardLed(self, playload, board_name="indicatorboard"): + """post boardLed info + :board_name: name of board, default is "indicatorboard" + :type: string + :playload: info to post + :type: dictionary + :returns: True or False + """ + if board_name is None or playload is None: + print("post failed: playload is None") + return False + return self._redfish_post(self.BoardLedUrl.format(board_name), playload) + + ''' not supported currently + def post_thermal(self, playload): + """post thermal info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post_thermal failed: playload is None") + return None + return self._redfish_post(self.ThermalUrl, playload) + + def post_power(self, playload): + """post power info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post_power failed: playload is None") + return None + return self._redfish_post(self.PowerUrl, playload) + + def post_thresholdSensors(self, playload): + """post thresholdSensors info + :playload: info to post + :type: dictionary + :returns: True or False + """ + if playload is None: + print("post_thresholdSensors failed: playload is None") + return None + return self._redfish_post(self.ThresholdSensorsUrl, playload) + + def get_fanSpeed(self): + """Get board led info + :returns: class'redfish.rest.v1.RestResponse' or None when failed + """ + return self._redfish_get(self.FanSpeedUrl) + + def post_board(self, playload, board_name="indicatorboard"): + """post board info + :board_name: name of board, default is "indicatorboard" + :type: string + :playload: info to post + :type: dictionary + :returns: True or False + """ + if board_name is None or playload is None: + print("post failed: playload is None") + return False + return self._redfish_post(self.BoardsUrl + board_name, playload) + + def get_boardLed(self, board_name="indicatorboard"): + """Get boardLed info + :board_name: name of board, default is "indicatorboard" + :type: string + :returns: class'redfish.rest.v1.RestResponse' or None when failed + """ + if board_name is None : + print("get failed: board_name is None") + return None + return self._redfish_get(self.BoardsUrl % board_name) + + ''' + +''' +if __name__ == '__main__': + redfish = Redfish_Api() + + ### get + # boards + ret = redfish.get_board() + if ret is None: + print("get failed: board") + else: + print("get succeeded, board:%s" % ret) + + ret = redfish.get_thresholdSensors() + if ret is None: + print("get failed: threshold") + else: + print("get succeeded, threshold:%s" % ret) + + ret = redfish.get_power() + if ret is None: + print("get failed: power") + else: + print("get succeeded, power:%s" % ret) + + ret = redfish.get_thermal() + if ret is None: + print("get failed:thermal") + else: + print("get succeeded,thermal:%s" % ret) + + # get playload + resp = redfish.get_thresholdSensors() + if (resp != None): + print(resp["@odata.id"]) + print(resp["@odata.type"]) + print(resp["Id"]) + print(resp["Name"]) + else: + print("Failed: get_thresholdSensors") + + ### post + # fanSpeed + playload = {} + playload["FanName"] = 'Fan0' + playload["FanSpeedLevelPercents"] = "70" + print("post fanSpeed:%s" % redfish.post_fanSpeed(playload)) + + #{"LEDs": [{"IndicatorLEDColor": "green","LEDType": "sys"},{"IndicatorLEDColor": "off","LEDType": "pwr"},{"IndicatorLEDColor": "green","LEDType": "fan"}]} + playload = {} + led = {} + led1 = {} + led_list = [] + led["IndicatorLEDColor"] = "green" + led["LEDType"] = "sys" + led1["IndicatorLEDColor"] = "off" + led1["LEDType"] = "pwr" + led_list.append(led) + led_list.append(led1) + playload["LEDs"] = led_list + # boardsLed + print("post boardLed:%s" % redfish.post_boardLed(playload)) +''' diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/sfp.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/sfp.py new file mode 100644 index 000000000000..29dd0cb079c1 --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/sfp.py @@ -0,0 +1,325 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +############################################################################# +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +# +# *_device.py config version instruction: +# ver 1.0 - platform api: +# "presence_cpld": { +# "dev_id": { +# [dev_id]: { +# "offset": { +# [offset]: [port_id] +# } +# } +# } +# } +# "reset_cpld": { +# "dev_id": { +# [dev_id]: { +# "offset": { +# [offset]: [port_id] +# } +# } +# } +# } +# ver 2.0 - wb_plat: +# "presence_path": "/xx/wb_plat/xx[port_id]/present" +# "eeprom_path": "/sys/bus/i2c/devices/i2c-[bus]/[bus]-0050/eeprom" +# "reset_path": "/xx/wb_plat/xx[port_id]/reset" +############################################################################# +import sys +import time +import os +import syslog +import traceback +from abc import abstractmethod + +configfile_pre = "/usr/local/bin/" +sys.path.append(configfile_pre) + +try: + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + +except ImportError as error: + raise ImportError(str(error) + "- required module not found") from error + +LOG_DEBUG_LEVEL = 1 +LOG_WARNING_LEVEL = 2 +LOG_ERROR_LEVEL = 3 + + +class Sfp(SfpOptoeBase): + + OPTOE_DRV_TYPE1 = 1 + OPTOE_DRV_TYPE2 = 2 + OPTOE_DRV_TYPE3 = 3 + + # index must start at 1 + def __init__(self, index): + SfpOptoeBase.__init__(self) + self.sfp_type = None + self.log_level_config = LOG_WARNING_LEVEL + # Init instance of SfpCust + self._sfp_api = SfpV2(index) + + def get_eeprom_path(self): + return self._sfp_api._get_eeprom_path() + + def read_eeprom(self, offset, num_bytes): + return self._sfp_api.read_eeprom(offset, num_bytes) + + def write_eeprom(self, offset, num_bytes, write_buffer): + return self._sfp_api.write_eeprom(offset, num_bytes, write_buffer) + + def get_presence(self): + return self._sfp_api.get_presence() + + def get_transceiver_info(self): + # temporary solution for a sonic202111 bug + transceiver_info = super().get_transceiver_info() + try: + if transceiver_info["vendor_rev"] is not None: + transceiver_info["hardware_rev"] = transceiver_info["vendor_rev"] + except BaseException: + print(traceback.format_exc()) + return None + return transceiver_info + + def set_optoe_write_max(self, write_max): + """ + This func is declared and implemented by SONiC but we're not supported + so override it as NotImplemented + """ + self._sfplog(LOG_DEBUG_LEVEL, "set_optoe_write_max NotImplemented") + + def refresh_xcvr_api(self): + """ + Updates the XcvrApi associated with this SFP + """ + self._xcvr_api = self._xcvr_api_factory.create_xcvr_api() + class_name = self._xcvr_api.__class__.__name__ + optoe_type = None + # set sfp_type + if 'CmisApi' in class_name: + self.sfp_type = 'QSFP-DD' + optoe_type = self.OPTOE_DRV_TYPE3 + elif 'Sff8472Api' in class_name: + self.sfp_type = 'SFP' + optoe_type = self.OPTOE_DRV_TYPE2 + elif ('Sff8636Api' in class_name or 'Sff8436Api' in class_name): + self.sfp_type = 'QSFP' + optoe_type = self.OPTOE_DRV_TYPE1 + # set optoe driver + if optoe_type is not None: + self._sfp_api.set_optoe_type(optoe_type) + + def _sfplog(self, log_level, msg): + if log_level >= self.log_level_config: + try: + syslog.openlog("Sfp") + if log_level == LOG_DEBUG_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_WARNING_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_ERROR_LEVEL: + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + except BaseException: + print(traceback.format_exc()) + + +class SfpCust(): + def __init__(self, index): + self.eeprom_path = None + self._init_config(index) + + def _init_config(self, index): + self.log_level_config = LOG_WARNING_LEVEL + self._port_id = index + self.eeprom_retry_times = 5 + self.eeprom_retry_break_sec = 0.2 + + def _get_eeprom_path(self): + return self.eeprom_path or None + + @abstractmethod + def get_presence(self): + pass + + def read_eeprom(self, offset, num_bytes): + try: + for i in range(self.eeprom_retry_times): + with open(self._get_eeprom_path(), mode='rb', buffering=0) as f: + f.seek(offset) + result = f.read(num_bytes) + # temporary solution for a sonic202111 bug + if len(result) < num_bytes: + result = result[::-1].zfill(num_bytes)[::-1] + if result is not None: + return bytearray(result) + time.sleep(self.eeprom_retry_break_sec) + continue + + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return None + + def write_eeprom(self, offset, num_bytes, write_buffer): + try: + for i in range(self.eeprom_retry_times): + ret = SfpOptoeBase.write_eeprom(self, offset, num_bytes, write_buffer) + if ret is False: + time.sleep(self.eeprom_retry_break_sec) + continue + break + + return ret + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + + @abstractmethod + def set_optoe_type(self, optoe_type): + pass + + @abstractmethod + def set_reset(self, reset): + pass + + def _convert_str_range_to_int_arr(self, range_str): + if not range_str: + return [] + + int_range_strs = range_str.split(',') + range_res = [] + for int_range_str in int_range_strs: + if '-' in int_range_str: + range_s = int(int_range_str.split('-')[0]) + range_e = int(int_range_str.split('-')[1]) + 1 + else: + range_s = int(int_range_str) + range_e = int(int_range_str) + 1 + + range_res = range_res + list(range(range_s, range_e)) + + return range_res + + def _sfplog(self, log_level, msg): + if log_level >= self.log_level_config: + try: + syslog.openlog("SfpCust") + if log_level == LOG_DEBUG_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_WARNING_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_ERROR_LEVEL: + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + except BaseException: + print(traceback.format_exc()) + + +class SfpV2(SfpCust): + def _init_config(self, index): + super()._init_config(index) + # init eeprom path + sfp_pt2ee_path_list = [0] * 53 + sfp_pt2ee_path_list[49:53] = [9, 10, 11, 12] + + eeprom_path_config = "/sys/bus/i2c/devices/i2c-%d/%d-0050/eeprom" + eeprom_path_key = sfp_pt2ee_path_list[self._port_id] + self.eeprom_path = None if eeprom_path_config is None or eeprom_path_key == 0 else eeprom_path_config % ( + eeprom_path_key, eeprom_path_key) + self._sfplog(LOG_DEBUG_LEVEL, "Done init eeprom path: %s" % self.eeprom_path) + + # init presence path + self.presence_path = "/sys/bus/i2c/devices/3-0030/sfp_presence1" + self.presence_val_is_present = 0 + self._sfplog(LOG_DEBUG_LEVEL, "Done init presence path: %s" % self.presence_path) + + # init optoe driver path + optoe_driver_path = "/sys/bus/i2c/devices/i2c-%d/%d-0050/dev_class" + optoe_driver_key = sfp_pt2ee_path_list[self._port_id] + self.dev_class_path = None if optoe_driver_path is None or optoe_driver_key == 0 else optoe_driver_path % ( + optoe_driver_key, optoe_driver_key) + self._sfplog(LOG_DEBUG_LEVEL, "Done init optoe driver path: %s" % self.dev_class_path) + + # init reset path + self.reset_val_is_reset = 0 + + new_device_path = "/sys/bus/i2c/devices/i2c-%d/new_device" + new_device_key = sfp_pt2ee_path_list[self._port_id] + self.new_class_path = None if new_device_path is None or new_device_key == 0 else new_device_path % new_device_key + self._sfplog(LOG_DEBUG_LEVEL, "Done init new_class path: %s" % self.new_class_path) + + if sfp_pt2ee_path_list[self._port_id] != 0: + self.add_new_sfp_device(self._port_id, 0x50) + self._sfplog(LOG_DEBUG_LEVEL, "Done add_new_sfp_device 0x50 port %d" % self._port_id) + + def sfp_add_dev(self, new_device_path, devaddr, devtype): + try: + # Write device address to new_device file + nd_file = open(new_device_path, "w") + nd_str = "%s %s" % (devtype, hex(devaddr)) + nd_file.write(nd_str) + nd_file.close() + except Exception as err: + self._sfplog(LOG_ERROR_LEVEL, ("Error writing to new device file: %s" % str(err))) + return 1 + else: + return 0 + + def add_new_sfp_device(self, port_num, devid): + if os.path.exists(self.dev_class_path): + return + + ret = self.sfp_add_dev(self.new_class_path, devid, "optoe2") + if ret != 0: + self._sfplog(LOG_ERROR_LEVEL, "Error adding sfp device") + + def get_presence(self): + sfp_ls = [49, 50, 51, 52] + if self._port_id not in sfp_ls or self.presence_path is None: + self._sfplog(LOG_ERROR_LEVEL, "presence_path is None!") + return False + try: + with open(self.presence_path, "rb") as data: + presence_data = data.read(2) + if presence_data == "": + return False + result = int(presence_data, 16) + + # ModPrsL is active low + presence_offset = sfp_ls.index(self._port_id) + if result & (1 << presence_offset) == 0: + return True + return False + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + + def set_reset(self, reset): + return True + + def set_optoe_type(self, optoe_type): + if self.dev_class_path is None: + self._sfplog(LOG_ERROR_LEVEL, "dev_class_path is None!") + return False + try: + with open(self.dev_class_path, "r+") as dc_file: + dc_file_val = dc_file.read(1) + if int(dc_file_val) != optoe_type: + dc_str = "%s" % str(optoe_type) + dc_file.write(dc_str) + # dc_file.close() + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + return True diff --git a/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/thermal.py b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/thermal.py new file mode 100644 index 000000000000..5fded8d9ddeb --- /dev/null +++ b/platform/centec-arm64/sonic-platform-modules-micas/m2-w6010-48gt4x-ra/sonic_platform/thermal.py @@ -0,0 +1,172 @@ +#!/usr/bin/env python + +import os +import re +import os.path +import time + +try: + from sonic_platform_base.thermal_base import ThermalBase + from .redfish_api import Redfish_Api +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + def __init__(self, thermal_index): + ThermalBase.__init__(self) + self.index = thermal_index + self.high_threshold = float(112) + self.redfish = Redfish_Api() + self.pinf = {} + self.begin = time.time() + + def get_power_3s(self): + self.elapsed = time.time() + if not self.pinf or self.elapsed - self.begin >= 3: + self.begin = time.time() + self.pinf = self.redfish.get_thermal() + + def get_temperature(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + temp = output.get("ReadingCelsius") + return temp + + def get_high_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + temp = output.get("UpperThresholdFatal") + return temp + + def get_low_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + temp = output.get("LowerThresholdFatal") + return temp + + def get_high_critical_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + temp = output.get("UpperThresholdFatal") + return temp + + def get_low_critical_threshold(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + temp = output.get("LowerThresholdFatal") + return temp + + def get_name(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index].get("Name") + name = output.split("/",3)[2] + if name == "SWITCH_TEMP": + name = "ASIC_TEMP" + return "{}".format(name) + + def get_real_name(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index].get("Name") + name = output.split("/",3)[2] + return "{}".format(name) + + def get_presence(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + if output.get("Status").get("Status").get("State") == "Enabled": + return True + return False + + def get_status(self): + self.get_power_3s() + ctrl = self.pinf["Temperatures"] + output = ctrl[self.index] + if output.get("Status").get("Status").get("Health") == "OK": + return True + return False + + def set_sys_led(self, color): + playload = {} + led = {} + led_list = [] + led["IndicatorLEDColor"] = color + led["LEDType"] = "sys" + led_list.append(led) + playload["LEDs"] = led_list + # boardsLed + return self.redfish.post_boardLed(playload) + + def get_minimum_recorded(self): + """ + Retrieves the minimum recorded temperature of thermal + + Returns: + A float number, the minimum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return "N/A" + + def get_maximum_recorded(self): + """ + Retrieves the maximum recorded temperature of thermal + + Returns: + A float number, the maximum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return "N/A" + + def get_model(self): + """ + Retrieves the model number (or part number) of the Thermal + + Returns: + string: Model/part number of Thermal + """ + return "N/A" + + def get_serial(self): + """ + Retrieves the serial number of the Thermal + + Returns: + string: Serial number of Thermal + """ + return "N/A" + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + return "N/A" + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/platform/centec-arm64/sonic_fit.its b/platform/centec-arm64/sonic_fit.its index 9d1cd37e1c68..d7158e242855 100644 --- a/platform/centec-arm64/sonic_fit.its +++ b/platform/centec-arm64/sonic_fit.its @@ -48,6 +48,18 @@ algo = "crc32"; }; }; + ctc_fdtw6010 { + description = "dtb for m2-w6010-48gt4x-r0"; + data = /incbin/("./m2-w6010-48gt4x-r0.dtb"); + type = "flat_dt"; + arch = "arm64"; + os = "linux"; + compression = "none"; + load = <0x88000000>; + hash { + algo = "crc32"; + }; + }; }; configurations { default = "arm64-centec_e530_24x2c-r0"; @@ -86,5 +98,17 @@ ramdisk = "initramfs"; fdt = "ctc_fdt"; }; + arm64-micas_m2-w6010-48gt4x-fa-r0 { + description = "config for micas_m2-w6010-48gt4x-fa"; + kernel = "kernel_ctc"; + ramdisk = "initramfs"; + fdt = "ctc_fdtw6010"; + }; + arm64-micas_m2-w6010-48gt4x-ra-r0 { + description = "config for micas_m2-w6010-48gt4x-ra"; + kernel = "kernel_ctc"; + ramdisk = "initramfs"; + fdt = "ctc_fdtw6010"; + }; }; }; diff --git a/platform/centec-arm64/tsingma-bsp/debian/rules b/platform/centec-arm64/tsingma-bsp/debian/rules index 39744906e3cf..65e564fcedd3 100755 --- a/platform/centec-arm64/tsingma-bsp/debian/rules +++ b/platform/centec-arm64/tsingma-bsp/debian/rules @@ -17,6 +17,7 @@ KERNEL_SRC := /lib/modules/$(KVERSION) MOD_SRC_DIR:= $(shell pwd) MODULE_DIRS:= ctc5236-mc ctc5236_switch ctcmac ctc_wdt ehci-ctc gpio-ctc i2c-ctc pinctrl-ctc pwm-ctc rtc-sd2405 sdhci-ctc5236 spi-ctc-qspi ctc-phy DTS_DIR := ctc-dts +DTS_DIR0 := m2-w6010-48gt4x MODULE_DIR := src UTILS_DIR := utils SERVICE_DIR := service @@ -36,6 +37,7 @@ build: make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$(MODULE_DIR)/$${mod}; \ done) make -C $(MOD_SRC_DIR)/$(MODULE_DIR)/$(DTS_DIR) + make -C $(MOD_SRC_DIR)/$(MODULE_DIR)/$(DTS_DIR0) binary: binary-arch binary-indep # Nothing to do diff --git a/platform/centec-arm64/tsingma-bsp/debian/tsingma-bsp.install b/platform/centec-arm64/tsingma-bsp/debian/tsingma-bsp.install index 01444d149c2d..30757f33ec53 100644 --- a/platform/centec-arm64/tsingma-bsp/debian/tsingma-bsp.install +++ b/platform/centec-arm64/tsingma-bsp/debian/tsingma-bsp.install @@ -13,5 +13,6 @@ src/rtc-sd2405/rtc-sd2405.ko /lib/modules/6.1.0-11-2-arm64/kernel/extra src/sdhci-ctc5236/sdhci-ctc5236.ko /lib/modules/6.1.0-11-2-arm64/kernel/extra src/spi-ctc-qspi/spi-ctc-qspi.ko /lib/modules/6.1.0-11-2-arm64/kernel/extra src/ctc-dts/e530-ctc5236.dtb /boot/ +src/m2-w6010-48gt4x/m2-w6010-48gt4x-r0.dtb /boot/ src/config/fw_env.config /etc/ src/config/tsingma-bsp.service /lib/systemd/system diff --git a/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/Makefile b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/Makefile new file mode 100755 index 000000000000..5837924e3dd5 --- /dev/null +++ b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/Makefile @@ -0,0 +1,5 @@ +m2-w6010-48gt4x-r0.dtb: m2-w6010-48gt4x-r0.dts ctc5236.dtsi ctc5236-clock.dtsi + cpp -nostdinc -I. -undef -x assembler-with-cpp m2-w6010-48gt4x-r0.dts > tmp.dts + dtc -O dtb -o m2-w6010-48gt4x-r0.dtb tmp.dts + rm tmp.dts -rf + diff --git a/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/arm-gic.h b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/arm-gic.h new file mode 100755 index 000000000000..ef79498bdde5 --- /dev/null +++ b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/arm-gic.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* + * This header provides constants for the ARM GIC. + */ + +#ifndef _DT_BINDINGS_INTERRUPT_CONTROLLER_ARM_GIC_H +#define _DT_BINDINGS_INTERRUPT_CONTROLLER_ARM_GIC_H + +#include "irq.h" + +/* interrupt specifier cell 0 */ + +#define GIC_SPI 0 +#define GIC_PPI 1 + +/* + * Interrupt specifier cell 2. + * The flags in irq.h are valid, plus those below. + */ +#define GIC_CPU_MASK_RAW(x) ((x) << 8) +#define GIC_CPU_MASK_SIMPLE(num) GIC_CPU_MASK_RAW((1 << (num)) - 1) + +#endif diff --git a/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236-clks.h b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236-clks.h new file mode 100755 index 000000000000..56d91da3130a --- /dev/null +++ b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236-clks.h @@ -0,0 +1,25 @@ +/* + * ctc5236 clock tree IDs + * + * (C) Copyright 2004-2017 Centec Networks (suzhou) Co., LTD. + * + * Jay Cao + * + * 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 version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __CTC5236_CLKS_H +#define __CTC5236_CLKs_H + +#define CLKID_UNUSED 0 +#define CLKID_PLL_FIXED 1 +#define CLKID_UART0 2 + +#endif /* __CTC5236_CLKS_H */ diff --git a/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236-clock.dtsi b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236-clock.dtsi new file mode 100755 index 000000000000..ae6b00c00ba2 --- /dev/null +++ b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236-clock.dtsi @@ -0,0 +1,63 @@ +/* + * dts file for Centec CTC5236(TsingMa) SoC + * + * (C) Copyright 2004-2017 Centec Networks (suzhou) Co., LTD. + * + * Jay Cao + * + * 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. + */ + + osc: oscillator { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <50000000>; + }; + + sup_clk: sup_clk_12m { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <1200000000>; + clock-output-names = "sup_clk"; + }; + + uart_clk: uart_clk_20m { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <20000000>; + clock-output-names = "uart_clk"; + }; + + i2c_clk: clkm { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <50000000>; + clock-output-names = "i2c_clk"; + }; + wdog_clk:wdog_clk{ + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <1000000>; + clock-output-names = "wdog_clk"; + }; + timer_clk:timer_clk{ + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <500000000>; + clock-output-names = "timer_clk"; + }; + mmc_clk:mmc_clk{ + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <100000000>; + clock-output-names = "mmc_clk"; + }; + spi_clk:spi_clk{ + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <100000000>; + clock-output-names = "spi_clk"; + }; diff --git a/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236.dtsi b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236.dtsi new file mode 100755 index 000000000000..bacf2eb17ddc --- /dev/null +++ b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/ctc5236.dtsi @@ -0,0 +1,428 @@ +/* + * dts file for Centec CTC5236(TsingMa) SoC + * + * (C) Copyright 2004-2017 Centec Networks (suzhou) Co., LTD. + * + * Jay Cao + * + * 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. + */ + +#include "arm-gic.h" +#include "ctc5236-clks.h" +#include "../pinctrl-ctc/pinctrl-ctc.h" + +/ { + compatible = "centec,ctc5236"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&gic>; + + cpus { + #address-cells = <2>; + #size-cells = <0>; + + cpu-map { + cluster0 { + core0 { + cpu = <&cpu0>; + }; + core1 { + cpu = <&cpu1>; + }; + }; + }; + + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0 0x000>; + enable-method = "spin-table"; + cpu-release-addr = <0 0x0010fff0>; + }; + + cpu1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0 0x001>; + enable-method = "spin-table"; + cpu-release-addr = <0 0x0010fff0>; + }; + }; + + gic: interrupt-controller@31201000 { + compatible = "arm,gic-400"; + #interrupt-cells = <3>; + interrupt-controller; + reg = <0x0 0x31201000 0 0x1000>, + <0x0 0x31202000 0 0x2000>, + <0x0 0x31204000 0 0x2000>, + <0x0 0x31206000 0 0x2000>; + interrupts = ; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupt-parent = <&gic>; + interrupts = , + , + , + ; + }; + + soc: soc { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + #include "ctc5236-clock.dtsi" + ocram: sram@00100000 { + compatible = "mmio-sram"; + reg = <0x0 0x00100000 0x0 0x10000>; + }; + + memory-controller@30600000 { + compatible = "ctc,ctc5236-ddr-ctrl"; + reg = <0x0 0x30600000 0x0 0x100000>; + interrupts = , + , + , + ; + ctc,sysctrl = <&sysctrl>; + }; + + sysctrl: sysctrl@33200000 { + compatible = "ctc,ctc5236-sysctrl", "syscon"; + reg = <0x0 0x33200000 0x0 0x100000>; + little-endian; + }; + + serial0: serial@33000000 { + compatible = "arm,pl011","arm,primecell"; + reg = <0x0 0x33000000 0x0 0x1000>; + interrupts = ; + clocks = <&uart_clk>, <&sup_clk>; + clock-names = "uart_clk", "apb_pclk"; + status="disabled"; + }; + serial1: serial@33001000 { + compatible = "arm,pl011","arm,primecell"; + reg = <0x0 0x33001000 0x0 0x1000>; + interrupts = ; + clocks = <&uart_clk>, <&sup_clk>; + clock-names = "uart_clk", "apb_pclk"; + status="disabled"; + }; + serial2: serial@33002000 { + compatible = "arm,pl011","arm,primecell"; + reg = <0x0 0x33002000 0x0 0x1000>; + interrupts = ; + clocks = <&uart_clk>, <&sup_clk>; + clock-names = "uart_clk", "apb_pclk"; + status="disabled"; + }; + mdio: mdio@33620000 { + compatible = "ctc,mdio"; + reg = <0x0 0x33620000 0x0 0x10000>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + enet0: ethernet@33410000 { + compatible = "ctc,mac"; + device_type = "network"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&gic>; + status = "disabled"; + local-mac-address = [00 00 00 00 00 00]; + index = <0x00>; + reg = <0x0 0x33410000 0x0 0x10000>, + <0x0 0x33400000 0x0 0x10000>; + interrupts = , + , + , + , + ; + ctc,sysctrl = <&sysctrl>; + }; + + enet1: ethernet@33420000 { + compatible = "ctc,mac"; + device_type = "network"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&gic>; + status = "disabled"; + local-mac-address = [00 00 00 00 00 00]; + index = <0x01>; + reg = <0x0 0x33420000 0x0 0x10000>, + <0x0 0x33400000 0x0 0x10000>; + interrupts = , + , + , + , + ; + ctc,sysctrl = <&sysctrl>; + }; + + ehci0: usb@30500000 { + compatible = "ctc-ehci"; + reg = <0x0 0x30500000 0x0 0x1000>; + interrupts = ; + ctc,sysctrl = <&sysctrl>; + status = "disabled"; + }; + + ohci0: usb@30580000 { + compatible = "generic-ohci"; + reg = <0x0 0x30580000 0x0 0x1000>; + interrupts = ; + status = "disabled"; + }; + + spi: spi@33100000 { + compatible = "arm,pl022","arm,primecell"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x33100000 0x0 0x100000>; + clocks = <&spi_clk>, <&sup_clk>; + clock-names = "spi_clk", "apb_pclk"; + num-cs = <4>; + interrupts = ; + ctc,sysctrl = <&sysctrl>; + status ="disabled"; + }; + + qspi: qspi@10000000 { + compatible = "ctc, igdaxi001a-qspi"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x10000000 0x0 0x10000>; + pclk = <500000000>; + num-cs = <2>; + idle-cycle = <2>; + post-cycle = <1>; + pre-cycle = <2>; + interrupts = ; + status = "disabled"; + }; + switch: switch@31100000 { + compatible = "centec,dal-localbus"; + reg = <0x0 0x31100000 0x0 0x1000>, + <0x0 0x33290000 0x0 0x10000>; + interrupts = , + , + , + , + , + , + , + ; + status ="disabled"; + }; + switch1: switch1@31101000 { + compatible = "centec,switch"; + reg = <0x0 0x31101000 0x0 0x1000>; + status ="disabled"; + }; + + i2c0: i2c0@33700000{ + compatible = "ctc,i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x33700000 0x0 0x1000>; + interrupts = ; + clocks = <&i2c_clk>; + ctc,sysctrl = <&sysctrl>; + i2c-num = <0>; + status ="disabled"; + }; + + i2c1: i2c1@33701000{ + compatible = "ctc,i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x33701000 0x0 0x1000>; + interrupts = ; + clocks = <&i2c_clk>; + ctc,sysctrl = <&sysctrl>; + i2c-num = <1>; + status ="disabled"; + }; + + pcie: pcie@20000000 { + compatible = "centec,ctc5236-pcie"; + reg = <0x0 0x20000000 0x0 0x10000000 + 0x0 0x30000000 0x0 0x1000>; + reg-names = "cfg", "ctrl"; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + device_type = "pci"; + interrupt-parent = <&gic>; + interrupts = , + , + ; + interrupt-names = "msi","aer","pme"; + msi-parent = <&pcie>; + bus-range = <0 0xff>; + ranges = <0x42000000 0 0x00000000 0 0x40000000 0 0x20000000 + 0x02000000 0 0x20000000 0 0x60000000 0 0x20000000>; + num-lanes = <1>; + ctc,sysctrl = <&sysctrl>; + status ="disabled"; + }; + + wtd0: wtd0@33500000{ + compatible = "arm,sp805-wdt", "arm,primecell"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x33500000 0x0 0x1000>; + clocks = <&wdog_clk>, <&sup_clk>; + clock-names = "wdog_clk", "apb_pclk"; + ctc,sysctrl = <&sysctrl>; + interrupts = ; + status="disabled"; + }; + wtd1: wtd1@33501000{ + compatible = "arm,sp805-wdt", "arm,primecell"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x33501000 0x0 0x1000>; + clocks = <&wdog_clk>, <&sup_clk>; + clock-names = "wdog_clk", "apb_pclk"; + ctc,sysctrl = <&sysctrl>; + interrupts = ; + status="disabled"; + }; + + sdhci: sdhci@30400000 { + compatible = "centec,ctc5236-sdhci"; + status = "disabled"; + interrupt-parent = <&gic>; + interrupts = ; + clocks = <&mmc_clk>; + clock-names = "mmc_clk"; + ctc,sysctrl = <&sysctrl>; + reg = <0x0 0x30400000 0x0 0x1000>; + }; + + timer0: timer0@33600000{ + compatible = "snps,dw-apb-timer"; + reg = <0x0 0x33600000 0x0 0x20>; + clocks = <&timer_clk>; + clock-names = "timer"; + interrupts = ; + DivNum = <0x3c>; + status="disabled"; + }; + timer1: timer1@33600020{ + compatible = "snps,dw-apb-timer"; + reg = <0x0 0x33600020 0x0 0x20>; + clocks = <&timer_clk>; + clock-names = "timer"; + interrupts = ; + DivNum = <0x3c>; + status="disabled"; + }; + + pwm: pwm@33200240{ + compatible = "centec-pwm"; + ctc,sysctrl = <&sysctrl>; + #pwm-cells = <2>; + + status="disabled"; + }; + + fan: fan-ctc5236 { + compatible = "fan-ctc5236"; + pwms = <&pwm 0 1000000>, + <&pwm 1 1000000>, + <&pwm 2 1000000>, + <&pwm 3 1000000>; + pwm-names = "pwm1","pwm2","pwm3","pwm4"; + }; + + gpio0: gpio@33610000 { + compatible = "ctc,apb-gpio"; + reg = <0x0 0x33610000 0x0 0x10000>; + #address-cells = <1>; + #size-cells = <0>; + ctc,sysctrl = <&sysctrl>; + + porta: gpio-port@0 { + compatible = "ctc,apb-gpio-porta"; + gpio-controller; + #gpio-cells = <2>; + ctc,nr-gpios = <16>; + reg = <0>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; + }; + portb: gpio-port@1 { + compatible = "ctc,apb-gpio-portb"; + gpio-controller; + #gpio-cells = <2>; + ctc,nr-gpios = <18>; + reg = <1>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; + }; + }; + + pinctrl: pinctrl { + compatible = "ctc,ctc5236-pinctrl"; + #address-cells = <0x2>; + #size-cells = <0x2>; + ctc,pinctrl-bank0 = <16>; + ctc,pinctrl-bank1 = <8>; + ctc,sysctrl = <&sysctrl>; + + spi { + spi_pin: spi_pin { + ctc,pins = <0 0 PIN_FUNC_SPI>, + <0 2 PIN_FUNC_SPI>, + <0 3 PIN_FUNC_SPI>, + <0 4 PIN_FUNC_SPI>, + <0 5 PIN_FUNC_SPI>, + <0 6 PIN_FUNC_SPI>, + <0 7 PIN_FUNC_SPI>; + }; + }; + + uart2 { + uart2_pin: uart2_pin { + ctc,pins = <0 10 PIN_FUNC_UART>, + <0 11 PIN_FUNC_UART>, + <0 12 PIN_FUNC_UART>, + <0 13 PIN_FUNC_UART>, + <0 14 PIN_FUNC_UART>, + <0 15 PIN_FUNC_UART>; + }; + }; + + fc { + fc_pin: fc_pin { + ctc,pins = <1 0 PIN_FUNC_FC>, + <1 1 PIN_FUNC_FC>, + <1 2 PIN_FUNC_FC>, + <1 3 PIN_FUNC_FC>, + <1 4 PIN_FUNC_FC>, + <1 5 PIN_FUNC_FC>, + <1 6 PIN_FUNC_FC>, + <1 7 PIN_FUNC_FC>; + }; + }; + }; + }; + +}; + diff --git a/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/irq.h b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/irq.h new file mode 100755 index 000000000000..9e3d183e1381 --- /dev/null +++ b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/irq.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* + * This header provides constants for most IRQ bindings. + * + * Most IRQ bindings include a flags cell as part of the IRQ specifier. + * In most cases, the format of the flags cell uses the standard values + * defined in this header. + */ + +#ifndef _DT_BINDINGS_INTERRUPT_CONTROLLER_IRQ_H +#define _DT_BINDINGS_INTERRUPT_CONTROLLER_IRQ_H + +#define IRQ_TYPE_NONE 0 +#define IRQ_TYPE_EDGE_RISING 1 +#define IRQ_TYPE_EDGE_FALLING 2 +#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING) +#define IRQ_TYPE_LEVEL_HIGH 4 +#define IRQ_TYPE_LEVEL_LOW 8 + +#endif diff --git a/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/m2-w6010-48gt4x-r0.dts b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/m2-w6010-48gt4x-r0.dts new file mode 100755 index 000000000000..acc4b2627e44 --- /dev/null +++ b/platform/centec-arm64/tsingma-bsp/src/m2-w6010-48gt4x/m2-w6010-48gt4x-r0.dts @@ -0,0 +1,331 @@ +/* + * dts file for Centec CTC5236(TsingMa) SoC E530-24X2C Board + * + * (C) Copyright 2004-2018 Centec Networks (suzhou) Co., LTD. + * + * liuht + * + * 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. + */ + +/dts-v1/; +#include "ctc5236.dtsi" + +/ { + model = " CTC5236(TsingMa) E530 Board"; + compatible = "ctc5236,e530-ctc5236"; + + memory@0 { + device_type = "memory"; + reg = <0 0x80000000 0x1 0x00000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + serial0 = &serial0; + serial1 = &serial1; + ethernet0 = &enet0; + ethernet1 = &enet1; + + i2c0 = &i2c1; + /* 0 0x70 */ + i2c1 = &imux1; + i2c2 = &imux2; + i2c3 = &imux3; + i2c4 = &imux4; + i2c5 = &imux5; + i2c6 = &imux6; + i2c7 = &imux7; + i2c8 = &imux8; + /* 8 0x74 */ + i2c9 = &imux9; + i2c10 = &imux10; + i2c11 = &imux11; + i2c12 = &imux12; + i2c13 = &imux13; + i2c14 = &imux14; + i2c15 = &imux15; + i2c16 = &imux16; + }; + +}; + +&serial0 { + status = "okay"; +}; + +&serial1 { + status = "okay"; +}; + +&mdio { + status = "okay"; + phy0: ethernet-phy@0 { + index = <0x00>; + reg = <0x00>; + }; +}; + +&enet0 { + status = "okay"; + auto-nego-mode= "sgmii-mac"; + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&qspi { + status = "okay"; + + qspiflash0: mx25u3235f@0 { + compatible = "jedec,spi-nor"; + reg = <0x0>; + spi-cpha; + spi-cpol; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x300000>; + }; + partition@300000 { + label = "uboot-env"; + reg = <0x300000 0x10000>; + }; + partition@310000 { + label = "onie"; + reg = <0x310000 0x1cf0000>; + }; + }; + }; + + qspiflash1: mx25u3235f@1 { + compatible = "jedec,spi-nor"; + reg = <0x1>; + spi-cpha; + spi-cpol; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot1"; + reg = <0x0 0x300000>; + }; + partition@300000 { + label = "uboot1-env"; + reg = <0x300000 0x10000>; + }; + partition@310000 { + label = "onie1"; + reg = <0x310000 0x1cf0000>; + }; + }; + }; +}; + +&spi { + status = "disabled"; + pinctrl-names = "default"; + pinctrl-0 = <&spi_pin>; + + clock0: ad9559@1 { + compatible = "analog,ad9559"; + reg = <1>; + spi-max-frequency = <25000000>; + }; +}; + +&switch { + status = "okay"; +}; + +&switch1 { + status = "okay"; +}; + + +&i2c1{ + status = "okay"; + clock-frequency = <95000>; + + pca9548@70 { + compatible = "nxp,pca9548"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + imux1:i2c@0 { + reg = <0>; + }; + imux2:i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + imux3:i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + imux4:i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + imux5:i2c@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + imux6:i2c@5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + imux7:i2c@6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + imux8:i2c@7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + pca9548@74 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "nxp,pca9548"; + reg = <0x74>; + imux9:i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + imux10:i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + imux11:i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + imux12:i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + imux13:i2c@4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + imux14:i2c@5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + imux15:i2c@6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + imux16:i2c@7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + }; + }; +}; + +&ehci0 { + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&wtd0{ + status = "okay"; +}; + +&wtd1{ + status = "disabled"; +}; + +&sdhci { + bus-width = <8>; + max-frequency = <100000000>; + non-removable; + no-sd; + no-sdio; + voltage-ranges = <3300 3300>; + status = "okay"; +}; + +&timer0 { + status = "okay"; +}; + +&soc { + ctc-irq { + compatible = "centec,ctc-irq"; + device_type = "ctc-irq"; + interrupt-parent=<&porta>; + interrupts = < 0 IRQ_TYPE_LEVEL_LOW>, + < 1 IRQ_TYPE_LEVEL_LOW>, + <15 IRQ_TYPE_LEVEL_LOW>, + < 6 IRQ_TYPE_LEVEL_HIGH>, + < 7 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&pwm { + status = "disabled"; +}; + + +&pinctrl { + spi { + spi_pin: spi_pin { + status = "disabled"; + ctc,pins = <0 0 PIN_FUNC_SPI>, + <0 2 PIN_FUNC_SPI>, + <0 3 PIN_FUNC_SPI>, + <0 5 PIN_FUNC_SPI>; + }; + }; + + pwm0 { + pwm0_pin: pwm0_pin { + ctc,pins = <0 8 PIN_FUNC_PWM>, + <0 9 PIN_FUNC_PWM>, + <0 10 PIN_FUNC_PWM>, + <0 11 PIN_FUNC_PWM>, + <0 12 PIN_FUNC_PWM>, + <0 13 PIN_FUNC_PWM>, + <0 14 PIN_FUNC_PWM>, + <0 15 PIN_FUNC_PWM>; + }; + }; +}; From 0e2bfc436d9b6aeec54d7ef39f73fde9fade1000 Mon Sep 17 00:00:00 2001 From: saksarav-nokia Date: Wed, 29 May 2024 13:14:57 -0400 Subject: [PATCH 190/282] Linecard startup-TSA-TSB (#18496) * start a new service to configure TSA as soon as Linecard comes up, start a timer to configure TSB and configure TSB when the timer expires * Update tsa-tsb service to use config-setup.service instaed of update-minigraph.service --------- Signed-off-by: saksarav --- .../startup-tsa-tsb.conf | 1 + dockers/docker-fpm-frr/base_image_files/TS | 14 ++ dockers/docker-fpm-frr/base_image_files/TSA | 11 +- dockers/docker-fpm-frr/base_image_files/TSB | 9 + .../build_templates/sonic_debian_extension.j2 | 4 + files/build_templates/startup_tsa_tsb.service | 15 ++ files/scripts/startup_tsa_tsb.py | 156 ++++++++++++++++++ 7 files changed, 209 insertions(+), 1 deletion(-) create mode 100644 device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/startup-tsa-tsb.conf create mode 100644 files/build_templates/startup_tsa_tsb.service create mode 100644 files/scripts/startup_tsa_tsb.py diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/startup-tsa-tsb.conf b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/startup-tsa-tsb.conf new file mode 100644 index 000000000000..150337493256 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/startup-tsa-tsb.conf @@ -0,0 +1 @@ +STARTUP_TSB_TIMER=900 diff --git a/dockers/docker-fpm-frr/base_image_files/TS b/dockers/docker-fpm-frr/base_image_files/TS index e0e7ce0ebabf..fcff1f80674c 100755 --- a/dockers/docker-fpm-frr/base_image_files/TS +++ b/dockers/docker-fpm-frr/base_image_files/TS @@ -65,3 +65,17 @@ else docker exec -i bgp /usr/bin/$1 fi fi + +# If TSA was issued by startup_tsa_tsb.service, show it +if [[ $1 == "TSC" ]]; then + service='startup_tsa_tsb.service' + if [[ $(/bin/systemctl show $service --property ActiveState --value) == "active" ]] && \ + [[ $(/bin/systemctl show $service --property SubState --value) == "running" ]]; then + TSA_TSB_CONF=/usr/share/sonic/device/$PLATFORM/startup-tsa-tsb.conf + [ -f $TSA_TSB_CONF ] && . $TSA_TSB_CONF + service_start_sec=$(date -d "$(systemctl show --property=ActiveEnterTimestamp $service --value)" +%s) + service_elapsed_sec=$(( $(date +%s) - service_start_sec)) + tsb_time_remaining=$((STARTUP_TSB_TIMER - service_elapsed_sec)) + echo "TSB : Pending (Time Remaining:$tsb_time_remaining seconds, service:$service)" + fi +fi diff --git a/dockers/docker-fpm-frr/base_image_files/TSA b/dockers/docker-fpm-frr/base_image_files/TSA index 841b968fa33c..4b26b2d430b5 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSA +++ b/dockers/docker-fpm-frr/base_image_files/TSA @@ -21,6 +21,15 @@ then sudo config mux mode standby all fi +if [ -z "$STARTED_BY_TSA_TSB_SERVICE" ]; then + service='startup_tsa_tsb.service' + if [[ $(/bin/systemctl show $service --property ActiveState --value) == "active" ]] && \ + [[ $(/bin/systemctl show $service --property SubState --value) == "running" ]]; then + echo "Stopping $service before configuring TSA" + systemctl stop $service + fi +fi + /usr/bin/TS TSA if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.type)" == *"SpineRouter"* ]] ; then if [[ "$1" != "chassis" ]] ; then @@ -29,4 +38,4 @@ if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.type)" == *"SpineRouter"* fi else echo "Please execute 'sudo config save' to preserve System mode in Maintenance after reboot or config reload" -fi \ No newline at end of file +fi diff --git a/dockers/docker-fpm-frr/base_image_files/TSB b/dockers/docker-fpm-frr/base_image_files/TSB index 11cac4939606..ec353148a72f 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSB +++ b/dockers/docker-fpm-frr/base_image_files/TSB @@ -21,6 +21,15 @@ then sudo config mux mode auto all fi +if [ -z "$STARTED_BY_TSA_TSB_SERVICE" ]; then + service='startup_tsa_tsb.service' + if [[ $(/bin/systemctl show $service --property ActiveState --value) == "active" ]] && \ + [[ $(/bin/systemctl show $service --property SubState --value) == "running" ]]; then + echo "Stopping $service before configuring TSB" + systemctl stop $service + fi +fi + /usr/bin/TS TSB if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.type)" == *"SpineRouter"* ]] ; then if [[ "$1" != "chassis" ]] ; then diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index b540f39d4f07..ece833119be6 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -1004,6 +1004,7 @@ sudo LANG=C cp $SCRIPTS_DIR/gnmi.sh $FILESYSTEM_ROOT/usr/local/bin/gnmi.sh sudo LANG=C cp $SCRIPTS_DIR/mgmt-framework.sh $FILESYSTEM_ROOT/usr/local/bin/mgmt-framework.sh sudo LANG=C cp $SCRIPTS_DIR/asic_status.sh $FILESYSTEM_ROOT/usr/local/bin/asic_status.sh sudo LANG=C cp $SCRIPTS_DIR/asic_status.py $FILESYSTEM_ROOT/usr/local/bin/asic_status.py +sudo LANG=C cp $SCRIPTS_DIR/startup_tsa_tsb.py $FILESYSTEM_ROOT/usr/local/bin/startup_tsa_tsb.py # Copy sonic-netns-exec script sudo LANG=C cp $SCRIPTS_DIR/sonic-netns-exec $FILESYSTEM_ROOT/usr/bin/sonic-netns-exec @@ -1014,6 +1015,9 @@ sudo LANG=C cp $SCRIPTS_DIR/write_standby.py $FILESYSTEM_ROOT/usr/local/bin/writ # Copy mark_dhcp_packet script sudo LANG=C cp $SCRIPTS_DIR/mark_dhcp_packet.py $FILESYSTEM_ROOT/usr/local/bin/mark_dhcp_packet.py +sudo cp files/build_templates/startup_tsa_tsb.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/ +echo "startup_tsa_tsb.service" | sudo tee -a $GENERATED_SERVICE_FILE + sudo cp $BUILD_TEMPLATES/sonic.target $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable sonic.target diff --git a/files/build_templates/startup_tsa_tsb.service b/files/build_templates/startup_tsa_tsb.service new file mode 100644 index 000000000000..0557f4fc5e04 --- /dev/null +++ b/files/build_templates/startup_tsa_tsb.service @@ -0,0 +1,15 @@ +[Unit] +Description= STARTUP TSA-TSB SERVICE +Requires=config-setup.service database.service +After=config-setup.service database.service +Before=bgp.service +ConditionPathExists=!/etc/sonic/chassisdb.conf + +[Service] +Environment="STARTED_BY_TSA_TSB_SERVICE=1" +ExecStart=/usr/bin/python3 -u /usr/local/bin/startup_tsa_tsb.py start +ExecStop=/usr/bin/python3 -u /usr/local/bin/startup_tsa_tsb.py stop +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/files/scripts/startup_tsa_tsb.py b/files/scripts/startup_tsa_tsb.py new file mode 100644 index 000000000000..5d0495ead601 --- /dev/null +++ b/files/scripts/startup_tsa_tsb.py @@ -0,0 +1,156 @@ +#!/usr/bin/env python3 + +# Name: startup_tsa_tsb.py, version: 1.0 +# +# Description: Module contains the definitions to the VOQ Startup TSA-TSB service +from sonic_py_common import multi_asic, device_info +from sonic_py_common.logger import Logger +import subprocess +import sys, getopt +from threading import Timer +import os + +# Global Logger class instance +logger = Logger("startup_tsa_tsb") +logger.set_min_log_priority_info() + +def get_tsb_timer_interval(): + platform = device_info.get_platform() + conf_file = '/usr/share/sonic/device/{}/startup-tsa-tsb.conf'.format(platform) + file = open(conf_file, 'r') + Lines = file.readlines() + for line in Lines: + field = line.split('=')[0].strip() + if field == "STARTUP_TSB_TIMER": + return line.split('=')[1].strip() + return 0 + +def get_sonic_config(ns, config_name): + if ns == "": + return subprocess.check_output(['sonic-cfggen', '-d', '-v', config_name.replace('"', "'"), ]).strip() + else: + return subprocess.check_output(['sonic-cfggen', '-d', '-v', config_name.replace('"', "'"), '-n', ns.replace('"', "'")]).strip() + +def get_sub_role(asic_ns): + sub_role_config = "DEVICE_METADATA['localhost']['sub_role']" + sub_role = (get_sonic_config(asic_ns, sub_role_config)).decode() + return sub_role + +def get_tsa_config(asic_ns): + tsa_config = 'BGP_DEVICE_GLOBAL.STATE.tsa_enabled' + tsa_ena = (get_sonic_config(asic_ns, tsa_config)).decode() + if asic_ns == "": + logger.log_info('CONFIG_DB.{} : {}'.format(tsa_config, tsa_ena)) + else: + logger.log_info('{} - CONFIG_DB.{} : {}'.format(asic_ns, tsa_config, tsa_ena)) + return tsa_ena + +def get_tsa_status(num_asics): + if num_asics > 1: + counter = 0 + for asic_id in range(int(num_asics)): + asic_ns = 'asic{}'.format(asic_id) + sub_role = get_sub_role(asic_ns) + if sub_role == 'FrontEnd': + tsa_enabled = get_tsa_config(asic_ns) + if tsa_enabled == 'false': + counter += 1 + if counter == int(num_asics): + return True; + else: + tsa_enabled = get_tsa_config("") + if tsa_enabled == 'false': + return True; + return False; + +def config_tsa(): + num_asics = multi_asic.get_num_asics() + tsa_ena = get_tsa_status(num_asics) + if tsa_ena == True: + logger.log_info("Configuring TSA") + subprocess.check_output(['TSA']).strip() + else: + if num_asics > 1: + logger.log_info("Either TSA is already configured or switch sub_role is not Frontend - not configuring TSA") + else: + logger.log_info("Either TSA is already configured - not configuring TSA") + return tsa_ena + +def config_tsb(): + logger.log_info("Configuring TSB") + subprocess.check_output(['TSB']).strip() + tsb_issued = True + return + +def start_tsb_timer(interval): + global timer + logger.log_info("Starting timer with interval {} seconds to configure TSB".format(interval)) + timer = Timer(int(interval), config_tsb) + timer.start() + timer.join() + return + +def print_usage(): + logger.log_info("Usage: startup_tsa_tsb.py [options] command") + logger.log_info("options:") + logger.log_info(" -h | --help : this help message") + logger.log_info("command:") + logger.log_info("start : start the TSA/TSB") + logger.log_info("stop : stop the TSA/TSB") + return + +def reset_env_variables(): + logger.log_info("Resetting environment variable") + os.environ.pop('STARTED_BY_TSA_TSB_SERVICE') + return + +def start_tsa_tsb(timer): + #Configure TSA if it was not configured already in CONFIG_DB + tsa_enabled = config_tsa() + if tsa_enabled == True: + #Start the timer to configure TSB + start_tsb_timer(timer) + return + +def stop_tsa_tsb(): + reset_env_variables() + return + +def main(): + platform = device_info.get_platform() + conf_file = '/usr/share/sonic/device/{}/startup-tsa-tsb.conf'.format(platform) + #This check should be moved to service file or make this feature as configurable. + #Adding it here for now. + if not os.path.exists(conf_file): + logger.log_info("{} does not exist, exiting the service".format(conf_file)) + return + if len(sys.argv) <= 1: + print_usage() + return + + # parse command line options: + try: + opts, args = getopt.getopt(sys.argv[1:], 'h:', ['help' ]) + except getopt.GetoptError: + print_usage() + return + + for opt, arg in opts: + if opt in ("-h", "--help"): + print_usage() + return + + for arg in args: + if arg == 'start': + tsb_timer = get_tsb_timer_interval() + start_tsa_tsb(tsb_timer) + elif arg == 'stop': + stop_tsa_tsb() + else: + print_usage() + return + + return + +if __name__ == "__main__": + main() From 6b26c2c12cb092af0ab6dc816a6938fc622110e1 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Wed, 29 May 2024 11:00:13 -0700 Subject: [PATCH 191/282] [LLDP][T2] Advertise Chassis Hostname when present. (#19076) Why I did: For chassis Advertise Chassis Hostname instead of Line Card Hostname if available to LLDP peers. --------- Signed-off-by: Abhishek Dosi --- dockers/docker-lldp/lldpmgrd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dockers/docker-lldp/lldpmgrd b/dockers/docker-lldp/lldpmgrd index 2ee9c897c45a..8d0333ab6070 100755 --- a/dockers/docker-lldp/lldpmgrd +++ b/dockers/docker-lldp/lldpmgrd @@ -245,7 +245,10 @@ class LldpManager(daemon_base.DaemonBase): if not op in ["SET", "DEL"]: return self.log_info("Device Config Opcode: {} Dict {} Key {}".format(op, device_dict, key)) - hostname = device_dict.get("hostname") + try: + hostname = device_dict["chassis_hostname"] + except: + hostname = device_dict.get("hostname") if not self.hostname == hostname: self.log_info("Hostname changed old {0}, new {1}".format(self.hostname, hostname)) self.update_hostname(hostname) From 27473fab874429ed39ec64f91e7b8122f0e8aca2 Mon Sep 17 00:00:00 2001 From: Ryan Lucus Date: Wed, 29 May 2024 11:10:06 -0700 Subject: [PATCH 192/282] add support for save-on-set to gnmi (#18481) * add support for save-on-set to gnmi https://github.com/sonic-net/SONiC/pull/1297 * leave default if not set * move to telemetry.sh --- dockers/docker-sonic-telemetry/telemetry.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dockers/docker-sonic-telemetry/telemetry.sh b/dockers/docker-sonic-telemetry/telemetry.sh index dadd226b8d80..061046d2594f 100755 --- a/dockers/docker-sonic-telemetry/telemetry.sh +++ b/dockers/docker-sonic-telemetry/telemetry.sh @@ -71,6 +71,14 @@ else TELEMETRY_ARGS+=" -v=2" fi +# gNMI save-on-set behavior is disabled by default. +# Save-on-set can be turned on by setting the "TELEMETRY|gnmi|save_on_set" +# to "true". +readonly SAVE_ON_SET=$(echo $GNMI | jq -r '.save_on_set // empty') +if [ ! -z "$SAVE_ON_SET" ]; then + TELEMETRY_ARGS+=" --with-save-on-set=$SAVE_ON_SET" +fi + # Server will handle threshold connections consecutively THRESHOLD_CONNECTIONS=$(echo $GNMI | jq -r '.threshold') if [[ $THRESHOLD_CONNECTIONS =~ ^[0-9]+$ ]]; then From 1af02ca3377be3759b9102d6edcfb9cedb2dd8c6 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Thu, 30 May 2024 10:37:25 +0800 Subject: [PATCH 193/282] [ci] Migrate ubuntu and sonicbld agent pool to fix S360 alert. (#19099) Why I did it Migrate agent pool to fix S360 ticket. Work item tracking Microsoft ADO (number only): 27889786 How I did it How to verify it --- .azure-pipelines/azure-pipelines-Official.yml | 2 +- .../azure-pipelines-UpgrateVersion.yml | 2 +- .azure-pipelines/build-template.yml | 4 ++-- .../docker-sonic-mgmt-py3-only.yml | 2 +- .azure-pipelines/docker-sonic-mgmt.yml | 2 +- .../docker-sonic-slave-template.yml | 4 ++-- .azure-pipelines/docker-sonic-slave.yml | 2 +- .azure-pipelines/dpkg-cache-cleanup.yml | 2 +- .azure-pipelines/official-build-cache.yml | 2 +- .azure-pipelines/official-build.yml | 2 +- .azure-pipelines/template-commonlib.yml | 2 +- azure-pipelines.yml | 22 +++++++++---------- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-Official.yml b/.azure-pipelines/azure-pipelines-Official.yml index a5a08167ca1d..56d88751f690 100644 --- a/.azure-pipelines/azure-pipelines-Official.yml +++ b/.azure-pipelines/azure-pipelines-Official.yml @@ -14,7 +14,7 @@ schedules: - 202012 always: true -pool: sonicbld +pool: sonicbld-1es stages: - stage: Build diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml index cb1b0744ccbd..b40a5d03330b 100644 --- a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -26,7 +26,7 @@ resources: ref: master endpoint: sonic-net -pool: sonicbld +pool: sonicbld-1es parameters: - name: 'jobFilters' diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index 355cfc7aaf9a..813126792e69 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -35,9 +35,9 @@ parameters: - name: pool type: string values: - - sonicbld + - sonicbld-1es - sonicbld_8c - default: sonicbld + default: sonicbld-1es - name: dbg_image type: boolean diff --git a/.azure-pipelines/docker-sonic-mgmt-py3-only.yml b/.azure-pipelines/docker-sonic-mgmt-py3-only.yml index f31e069bbc2c..8019e957fdc3 100644 --- a/.azure-pipelines/docker-sonic-mgmt-py3-only.yml +++ b/.azure-pipelines/docker-sonic-mgmt-py3-only.yml @@ -32,7 +32,7 @@ stages: - stage: Build jobs: - job: Build - pool: sonicbld + pool: sonicbld-1es timeoutInMinutes: 360 steps: - template: cleanup.yml diff --git a/.azure-pipelines/docker-sonic-mgmt.yml b/.azure-pipelines/docker-sonic-mgmt.yml index 207d8ee710f5..924e4230df5a 100644 --- a/.azure-pipelines/docker-sonic-mgmt.yml +++ b/.azure-pipelines/docker-sonic-mgmt.yml @@ -32,7 +32,7 @@ stages: - stage: Build jobs: - job: Build - pool: sonicbld + pool: sonicbld-1es timeoutInMinutes: 360 steps: - template: cleanup.yml diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 1ac8ce67fd3b..8bf7540e1803 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -29,9 +29,9 @@ parameters: default: sonicdev - name: pool type: string - default: sonicbld + default: sonicbld-1es values: - - sonicbld + - sonicbld-1es - sonicbld-arm64 - sonicbld-armhf diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index acff1b85879c..9633c32f607b 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -64,7 +64,7 @@ stages: - ${{ each arch in parameters.arches }}: - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage parameters: - pool: sonicbld + pool: sonicbld-1es arch: ${{ arch }} dist: ${{ dist }} ${{ if ne(arch, 'amd64') }}: diff --git a/.azure-pipelines/dpkg-cache-cleanup.yml b/.azure-pipelines/dpkg-cache-cleanup.yml index 50bb3a63635b..7bac6997e40a 100644 --- a/.azure-pipelines/dpkg-cache-cleanup.yml +++ b/.azure-pipelines/dpkg-cache-cleanup.yml @@ -16,7 +16,7 @@ pr: none jobs: - job: Amd - pool: sonicbld + pool: sonicbld-1es timeoutInMinutes: 5 steps: - checkout: none diff --git a/.azure-pipelines/official-build-cache.yml b/.azure-pipelines/official-build-cache.yml index cc398bab7117..0f7b34e9bd5b 100644 --- a/.azure-pipelines/official-build-cache.yml +++ b/.azure-pipelines/official-build-cache.yml @@ -24,7 +24,7 @@ pr: none stages: - stage: Build - pool: sonicbld + pool: sonicbld-1es variables: - name: CACHE_MODE value: cache diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index 14308292f4b8..ecc9bd89c697 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -34,7 +34,7 @@ variables: stages: - stage: Build - pool: sonicbld + pool: sonicbld-1es variables: - name: CACHE_MODE value: wcache diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml index cd7551d83823..c821998ae815 100644 --- a/.azure-pipelines/template-commonlib.yml +++ b/.azure-pipelines/template-commonlib.yml @@ -11,7 +11,7 @@ jobs: - job: Build_${{ arch }} timeoutInMinutes: 120 ${{ if eq(arch,'amd64') }}: - pool: sonicbld + pool: sonicbld-1es ${{ else }}: pool: sonicbld-${{ arch }} variables: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 18ed0c58b653..4144bf801f84 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -51,7 +51,7 @@ variables: stages: - stage: BuildVS - pool: sonicbld + pool: sonicbld-1es jobs: - template: .azure-pipelines/azure-pipelines-build.yml parameters: @@ -60,7 +60,7 @@ stages: - name: vs - stage: Build - pool: sonicbld + pool: sonicbld-1es dependsOn: [] jobs: - template: .azure-pipelines/azure-pipelines-build.yml @@ -163,7 +163,7 @@ stages: testRunTitle: vstest - job: t0_elastictest - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c displayName: "kvmtest-t0 by Elastictest" timeoutInMinutes: 240 continueOnError: false @@ -176,7 +176,7 @@ stages: MGMT_BRANCH: $(BUILD_BRANCH) - job: t0_2vlans_elastictest - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c displayName: "kvmtest-t0-2vlans by Elastictest" timeoutInMinutes: 240 continueOnError: false @@ -191,7 +191,7 @@ stages: DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" - job: t1_lag_elastictest - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c displayName: "kvmtest-t1-lag by Elastictest" timeoutInMinutes: 240 continueOnError: false @@ -205,7 +205,7 @@ stages: - job: multi_asic_elastictest displayName: "kvmtest-multi-asic-t1-lag by Elastictest" - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c timeoutInMinutes: 240 continueOnError: false steps: @@ -219,7 +219,7 @@ stages: MGMT_BRANCH: $(BUILD_BRANCH) - job: dualtor_elastictest - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c displayName: "kvmtest-dualtor-t0 by Elastictest" timeoutInMinutes: 240 continueOnError: false @@ -234,7 +234,7 @@ stages: - job: sonic_t0_elastictest displayName: "kvmtest-t0-sonic by Elastictest" - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c timeoutInMinutes: 240 continueOnError: false steps: @@ -252,7 +252,7 @@ stages: displayName: "kvmtest-dpu by Elastictest" timeoutInMinutes: 240 continueOnError: false - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c steps: - template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt parameters: @@ -265,7 +265,7 @@ stages: displayName: "onboarding testcases by Elastictest" timeoutInMinutes: 240 continueOnError: true - pool: ubuntu-20.04 + pool: sonic-ubuntu-1c steps: - template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt parameters: @@ -279,7 +279,7 @@ stages: # - job: wan_elastictest # displayName: "kvmtest-wan by Elastictest" -# pool: ubuntu-20.04 +# pool: sonic-ubuntu-1c # timeoutInMinutes: 240 # continueOnError: false # steps: From f5b20f888327bd9be406bc19e37bcb767bd5f98d Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Thu, 30 May 2024 12:21:05 -0700 Subject: [PATCH 194/282] Update init_cfg.json.j2 to handle global scope for lldp feature (#18808) * Update init_cfg.json.j2 to handle global scope for lldp feature * Update sonic-feature.yang --- files/build_templates/init_cfg.json.j2 | 3 ++- src/sonic-yang-models/yang-models/sonic-feature.yang | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index f31b5a22f5bb..31be59e35017 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -71,10 +71,11 @@ "{{feature}}": { "state": "{{state}}", "delayed" : {{delayed | lower()}}, - "has_global_scope": {% if feature + '.service' in installer_services.split(' ') %}true{% else %}false{% endif %}, {%- if feature in ["lldp"] %} + "has_global_scope": {% raw %}"{% if ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['linecard']) %}False{% else %}True{% endif %}"{% endraw %}, "has_per_asic_scope": {% raw %}"{% if not DEVICE_RUNTIME_METADATA['ETHERNET_PORTS_PRESENT'] or ('CHASSIS_METADATA' in DEVICE_RUNTIME_METADATA and DEVICE_RUNTIME_METADATA['CHASSIS_METADATA']['module_type'] in ['supervisor']) %}False{% else %}True{% endif %}"{% endraw %}, {%- else %} + "has_global_scope": {% if feature + '.service' in installer_services.split(' ') %}true{% else %}false{% endif %}, "has_per_asic_scope": {% if feature + '@.service' in installer_services.split(' ') %}"True"{% else %}"False"{% endif %}, {%- endif %} "auto_restart": "{{autorestart}}", diff --git a/src/sonic-yang-models/yang-models/sonic-feature.yang b/src/sonic-yang-models/yang-models/sonic-feature.yang index 6f23135b609e..3ca32ad6a955 100644 --- a/src/sonic-yang-models/yang-models/sonic-feature.yang +++ b/src/sonic-yang-models/yang-models/sonic-feature.yang @@ -67,7 +67,7 @@ module sonic-feature{ leaf has_global_scope { description "This configuration identicates there will only one service spawned for the device"; - type stypes:boolean_type; + type feature-scope-status; default "false"; } From 0e3fbd9d860f11241719ae7637262039ea5add5b Mon Sep 17 00:00:00 2001 From: Michael Attig <7726374+mkeda@users.noreply.github.com> Date: Thu, 30 May 2024 13:15:38 -0700 Subject: [PATCH 195/282] Update P4RT docker to Bookworm (#18886) Signed-off-by: mkeda --- dockers/docker-sonic-p4rt/Dockerfile.j2 | 2 +- rules/docker-p4rt.mk | 10 +++++----- src/sonic-p4rt/Makefile | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dockers/docker-sonic-p4rt/Dockerfile.j2 b/dockers/docker-sonic-p4rt/Dockerfile.j2 index 241f4724ea3f..994bc3a5e211 100644 --- a/dockers/docker-sonic-p4rt/Dockerfile.j2 +++ b/dockers/docker-sonic-p4rt/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name ARG git_commit diff --git a/rules/docker-p4rt.mk b/rules/docker-p4rt.mk index bc8d6b9fbe82..85cfb67552c7 100644 --- a/rules/docker-p4rt.mk +++ b/rules/docker-p4rt.mk @@ -7,12 +7,12 @@ DOCKER_P4RT_DBG = $(DOCKER_P4RT_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_P4RT)_PATH = $(DOCKERS_PATH)/$(DOCKER_P4RT_STEM) $(DOCKER_P4RT)_DEPENDS += $(SONIC_P4RT) -$(DOCKER_P4RT)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) +$(DOCKER_P4RT)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS) $(DOCKER_P4RT)_DBG_DEPENDS += $(SONIC_P4RT_DBG) $(LIBSWSSCOMMON_DBG) $(DOCKER_P4RT)_DBG_DEPENDS += $(LIBSAIREDIS_DBG) -$(DOCKER_P4RT)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES) +$(DOCKER_P4RT)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES) -$(DOCKER_P4RT)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE) +$(DOCKER_P4RT)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM) $(DOCKER_P4RT)_VERSION = 1.0.0 $(DOCKER_P4RT)_PACKAGE_NAME = p4rt @@ -21,9 +21,9 @@ $(DOCKER_P4RT)_FAST_SHUTDOWN_BEFORE = swss # TODO: Enable P4RT DBG SONIC_DOCKER_IMAGES += $(DOCKER_P4RT) -SONIC_BULLSEYE_DOCKERS += $(DOCKER_P4RT) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_P4RT) # SONIC_DOCKER_DBG_IMAGES += $(DOCKER_P4RT_DBG) -# SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_P4RT_DBG) +# SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_P4RT_DBG) ifeq ($(INCLUDE_P4RT), y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_P4RT) diff --git a/src/sonic-p4rt/Makefile b/src/sonic-p4rt/Makefile index 191a94d45518..5eeb135e9222 100644 --- a/src/sonic-p4rt/Makefile +++ b/src/sonic-p4rt/Makefile @@ -11,6 +11,10 @@ BAZEL_BUILD_OPTS += --fission=yes --features=per_object_debug_info # Override sonic_swss_common to use the version specific to this buildimage. BAZEL_BUILD_OPTS += --override_repository=sonic_swss_common=/sonic/src/sonic-swss-common +# Newer version of gcc has spurious warnings in boringssl package. +BAZEL_BUILD_OPTS += --copt=-Wno-array-bounds +BAZEL_BUILD_OPTS += --copt=-Wno-stringop-overflow + # Build optimized, stripped binaries. BAZEL_BUILD_OPTS += -c opt From bb659e513e5788b95bfb513b4cdd0445935b3522 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Fri, 31 May 2024 03:30:00 +0300 Subject: [PATCH 196/282] [Nvidia] Remove SAI_HOSTIF_OPER_STATUS_UPDATE_BY_APP, set it only for certain SKUs (#19066) * Revert "[Mellanox] enable host interface control by orchagent (#18592)" This reverts commit 3adf3082889dbba697cbec09846bb78ca879109e. Signed-off-by: Stepan Blyschak --- .../x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile | 1 + platform/mellanox/docker-syncd-mlnx/sai-common.profile | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile index a362513c8dd5..73fbbd1609bb 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-O128/sai.profile @@ -1 +1,2 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_sn5600_128x400g_1x25g.xml +SAI_HOSTIF_OPER_STATUS_UPDATE_BY_APP=1 diff --git a/platform/mellanox/docker-syncd-mlnx/sai-common.profile b/platform/mellanox/docker-syncd-mlnx/sai-common.profile index d3b91a00e106..3b9e6fe00573 100644 --- a/platform/mellanox/docker-syncd-mlnx/sai-common.profile +++ b/platform/mellanox/docker-syncd-mlnx/sai-common.profile @@ -1,3 +1,2 @@ SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps SAI_DUMP_STORE_AMOUNT=10 -SAI_HOSTIF_OPER_STATUS_UPDATE_BY_APP=1 From 3387506f61fccd662cb5aa904fd60d33bc0c506c Mon Sep 17 00:00:00 2001 From: Tejaswini Chadaga <85581939+tjchadaga@users.noreply.github.com> Date: Thu, 30 May 2024 17:47:53 -0700 Subject: [PATCH 197/282] [bgpcfgd]: Changes to support sequential IDF isolation (#19136) Why I did it In order to isolate an IDF sequentially (one device at a time), need a mechanism to perform downstream isolation on T2 device. Adding support for two kinds of isolation - By setting no-export BGP community on all routes advertised to T1 (except loopback), so the routes are not advertised to T0s By withdrawing all routes from T1 How I did it Added 1. New configuration to support the changes described by Yang model changes for Sequential IDF isolation #18597 Script to update configDB on each ASIC to configure no-export/withdraw-all isolation and unisolation of IDF. This is copied to host 2. BGPcfgd changes to handle configDB events and add/remove the required route-maps 3. UT cases and data file changes for BGPCfgd and jinja templates How to verify it Corresponding templates on T2 have to be updated to verify the functionality Configuration options- sudo idf_isolation withdraw_all sudo idf_isolation no-export sudo idf_isolation unisolated Validate the routes on T1 are either withdrawn, tagged with no-export community or re-advertised based on the configuration --- .../base_image_files/idf_isolation | 87 +++++++++++++++++++ .../frr/bgpd/idf_isolate/idf_isolate.conf.j2 | 20 +++++ .../bgpd/idf_isolate/idf_unisolate.conf.j2 | 6 ++ rules/docker-fpm-frr.mk | 1 + src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py | 6 +- .../bgpcfgd/managers_device_global.py | 51 +++++++++-- .../result_all_idf_isolated_no_export.conf | 34 ++++++++ .../result_all_idf_isolated_withdraw_all.conf | 33 +++++++ .../result_all_idf_unisolated.conf | 27 ++++++ .../peer-group.conf/result_idf_isolated.conf | 12 +++ .../idf_isolate/idf_isolated_no_export.conf | 12 +++ .../idf_isolate/idf_isolated_no_export.json | 9 ++ .../idf_isolated_withdraw_all.conf | 12 +++ .../idf_isolated_withdraw_all.json | 9 ++ .../idf_isolate/idf_unisolated.conf | 6 ++ .../idf_isolate/idf_unisolated.json | 9 ++ src/sonic-bgpcfgd/tests/test_device_global.py | 37 ++++++++ src/sonic-bgpcfgd/tests/test_sonic-cfggen.py | 18 ++++ 18 files changed, 382 insertions(+), 7 deletions(-) create mode 100755 dockers/docker-fpm-frr/base_image_files/idf_isolation create mode 100644 dockers/docker-fpm-frr/frr/bgpd/idf_isolate/idf_isolate.conf.j2 create mode 100644 dockers/docker-fpm-frr/frr/bgpd/idf_isolate/idf_unisolate.conf.j2 create mode 100644 src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_isolated_no_export.conf create mode 100644 src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_isolated_withdraw_all.conf create mode 100644 src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_unisolated.conf create mode 100644 src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_idf_isolated.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_no_export.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_no_export.json create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_withdraw_all.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_withdraw_all.json create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_unisolated.conf create mode 100644 src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_unisolated.json diff --git a/dockers/docker-fpm-frr/base_image_files/idf_isolation b/dockers/docker-fpm-frr/base_image_files/idf_isolation new file mode 100755 index 000000000000..7312b99648c3 --- /dev/null +++ b/dockers/docker-fpm-frr/base_image_files/idf_isolation @@ -0,0 +1,87 @@ +#!/bin/bash + +# Restrict command to sudo users +if [ "$EUID" -ne 0 ] ; then + echo "Root priveleges are needed for this operation" + exit 1 +fi + +# Command is only supported on spine routers +if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.type)" != *"SpineRouter"* ]] ; then + echo "Operation is not supported on this platform" + exit 1 +fi + +# Skip operation on chassis supervisor +if [ -f /etc/sonic/chassisdb.conf ]; then + echo "Skipping Operation on chassis supervisor" + exit 0 +fi + +idf_isolation_states=("isolated_no_export" "isolated_withdraw_all" "unisolated" "status") +valid=false +for state in "${idf_isolation_states[@]}"; do + if [[ "$1" == "$state" ]]; then + valid=true + break + fi +done +if [ $valid == false ]; then + echo "Invalid parameter $1, Operation not supported" + echo "" + echo "Usage: sudo idf_isolation " + exit 0 +fi + +IDF_ISOLATION_STATE="{\"BGP_DEVICE_GLOBAL\":{\"STATE\":{\"idf_isolation_state\": \"$1\"}}}" + +# read SONiC immutable variables +[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment + +PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} + +# Parse the device specific asic conf file, if it exists +ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf +[ -f $ASIC_CONF ] && . $ASIC_CONF + +if [[ ($NUM_ASIC -gt 1) ]]; then + asic=0 + NAMESPACE_PREFIX='asic' + + while [ $asic -lt $NUM_ASIC ] + do + sub_role=`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['sub_role']" -n $NAMESPACE_PREFIX$asic` + if [ $sub_role == 'FrontEnd' ] ; then + cur_idf_isolation_state="$(sonic-cfggen -d -v BGP_DEVICE_GLOBAL.STATE.idf_isolation_state -n $NAMESPACE_PREFIX$asic)" + if [ $1 == 'status' ] ; then + echo "BGP$asic: IDF isolation state: $cur_idf_isolation_state" + else + if [ $1 == $cur_idf_isolation_state ]; then + echo "BGP$asic: IDF is already in $1 state" + else + sonic-cfggen -a "$IDF_ISOLATION_STATE" -w -n $NAMESPACE_PREFIX$asic + logger -t $1 -p user.info "IDF isolation state: $1" + echo "BGP$asic: IDF isolation state: $1" + fi + fi + fi + asic=$[$asic+1] + done +else + cur_idf_isolation_state="$(sonic-cfggen -d -v BGP_DEVICE_GLOBAL.STATE.idf_isolation_state)" + if [ $1 == 'status' ] ; then + echo "IDF isolation state: $cur_idf_isolation_state" + else + if [ $1 == $cur_idf_isolation_state ]; then + echo "IDF is already in $1 state" + else + sonic-cfggen -a "$IDF_ISOLATION_STATE" -w + logger -t $1 -p user.info "IDF isolation state: $1" + echo "IDF isolation state: $1" + fi + fi +fi + +if [ $1 != 'status' ]; then + echo "Please execute 'sudo config save' to preserve IDF isolation state after reboot or config reload" +fi \ No newline at end of file diff --git a/dockers/docker-fpm-frr/frr/bgpd/idf_isolate/idf_isolate.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/idf_isolate/idf_isolate.conf.j2 new file mode 100644 index 000000000000..2ab76b128b0d --- /dev/null +++ b/dockers/docker-fpm-frr/frr/bgpd/idf_isolate/idf_isolate.conf.j2 @@ -0,0 +1,20 @@ +route-map CHECK_IDF_ISOLATION permit 1 + match ip address prefix-list PL_LoopbackV4 + set community {{ constants.bgp.traffic_shift_community }} +route-map CHECK_IDF_ISOLATION permit 2 + match ipv6 address prefix-list PL_LoopbackV6 + set community {{ constants.bgp.traffic_shift_community }} +route-map CHECK_IDF_ISOLATION permit 3 + match tag {{ constants.bgp.internal_community_match_tag }} + set community {{ constants.bgp.traffic_shift_community }} +{# #} +{%- if isolation_status == "isolated_withdraw_all" -%} + route-map CHECK_IDF_ISOLATION deny 4 + route-map CHECK_IDF_ISOLATION permit 10 + no set community no-export additive{# Added to clean up state, in case of transition from isolated_no_export (not expected) #} +{%- elif isolation_status == "isolated_no_export" -%} + route-map CHECK_IDF_ISOLATION permit 10 + set community no-export additive + no route-map CHECK_IDF_ISOLATION deny 4{# Added to clean up state, in case of transition from isolated_withdraw_all (not expected) #} +{# #} +{%- endif -%} \ No newline at end of file diff --git a/dockers/docker-fpm-frr/frr/bgpd/idf_isolate/idf_unisolate.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/idf_isolate/idf_unisolate.conf.j2 new file mode 100644 index 000000000000..5454c92f8ab9 --- /dev/null +++ b/dockers/docker-fpm-frr/frr/bgpd/idf_isolate/idf_unisolate.conf.j2 @@ -0,0 +1,6 @@ +no route-map CHECK_IDF_ISOLATION permit 1 +no route-map CHECK_IDF_ISOLATION permit 2 +no route-map CHECK_IDF_ISOLATION permit 3 +no route-map CHECK_IDF_ISOLATION deny 4 +route-map CHECK_IDF_ISOLATION permit 10 + no set community no-export additive diff --git a/rules/docker-fpm-frr.mk b/rules/docker-fpm-frr.mk index bcc293e0257f..b866960d6d73 100644 --- a/rules/docker-fpm-frr.mk +++ b/rules/docker-fpm-frr.mk @@ -40,6 +40,7 @@ $(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += TSA:/usr/bin/TSA $(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += TSB:/usr/bin/TSB $(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += TSC:/usr/bin/TSC $(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += TS:/usr/bin/TS +$(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += idf_isolation:/usr/bin/idf_isolation SONIC_BULLSEYE_DOCKERS += $(DOCKER_FPM_FRR) SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_FPM_FRR_DBG) diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py index de85a2f84a92..3708b5b30dfc 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py @@ -59,14 +59,15 @@ def update_pg(self, name, **kwargs): try: pg = self.peergroup_template.render(**kwargs) tsa_rm = self.device_global_cfgmgr.check_state_and_get_tsa_routemaps(pg) + idf_isolation_rm = self.device_global_cfgmgr.check_state_and_get_idf_isolation_routemaps() except jinja2.TemplateError as e: log_err("Can't render peer-group template: '%s': %s" % (name, str(e))) return False if kwargs['vrf'] == 'default': - cmd = ('router bgp %s\n' % kwargs['bgp_asn']) + pg + tsa_rm + cmd = ('router bgp %s\n' % kwargs['bgp_asn']) + pg + tsa_rm + idf_isolation_rm else: - cmd = ('router bgp %s vrf %s\n' % (kwargs['bgp_asn'], kwargs['vrf'])) + pg + tsa_rm + cmd = ('router bgp %s vrf %s\n' % (kwargs['bgp_asn'], kwargs['vrf'])) + pg + tsa_rm + idf_isolation_rm self.update_entity(cmd, "Peer-group for peer '%s'" % name) return True @@ -108,6 +109,7 @@ def __init__(self, common_objs, db_name, table_name, peer_type, check_neig_meta) ("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"), ("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0"), ("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"), + ("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "idf_isolation_state"), ("LOCAL", "local_addresses", ""), ("LOCAL", "interfaces", ""), ] diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py index db2bcd9893db..5c42e4415f16 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py @@ -19,6 +19,8 @@ def __init__(self, common_objs, db, table): self.constants = common_objs['constants'] self.tsa_template = common_objs['tf'].from_file("bgpd/tsa/bgpd.tsa.isolate.conf.j2") self.tsb_template = common_objs['tf'].from_file("bgpd/tsa/bgpd.tsa.unisolate.conf.j2") + self.idf_isolate_template = common_objs['tf'].from_file("bgpd/idf_isolate/idf_isolate.conf.j2") + self.idf_unisolate_template = common_objs['tf'].from_file("bgpd/idf_isolate/idf_unisolate.conf.j2") self.directory.subscribe([("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/switch_type"),], self.on_switch_type_change) super(DeviceGlobalCfgMgr, self).__init__( common_objs, @@ -42,13 +44,31 @@ def set_handler(self, key, data): log_err("DeviceGlobalCfgMgr:: data is None") return False + tsa_status = "false" + idf_isolation_state = "unisolated" + + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"): + tsa_status = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["tsa_enabled"] + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "idf_isolation_state"): + idf_isolation_state = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["idf_isolation_state"] + if "tsa_enabled" in data: - self.cfg_mgr.commit() - self.cfg_mgr.update() - self.isolate_unisolate_device(data["tsa_enabled"]) self.directory.put(self.db_name, self.table_name, "tsa_enabled", data["tsa_enabled"]) - return True - return False + if tsa_status != data["tsa_enabled"]: + self.cfg_mgr.commit() + self.cfg_mgr.update() + self.isolate_unisolate_device(data["tsa_enabled"]) + + + if "idf_isolation_state" in data: + self.directory.put(self.db_name, self.table_name, "idf_isolation_state", data["idf_isolation_state"]) + if idf_isolation_state != data["idf_isolation_state"]: + if self.switch_type and self.switch_type != "SpineRouter": + log_debug("DeviceGlobalCfgMgr:: Skipping IDF isolation configuration on Switch type: %s" % self.switch_type) + return True + self.downstream_isolate_unisolate(data["idf_isolation_state"]) + + return True def del_handler(self, key): log_debug("DeviceGlobalCfgMgr:: del handler") @@ -113,3 +133,24 @@ def __extract_out_route_map_names(self, cmds): route_map_names.add(result.group(1)) return route_map_names + def downstream_isolate_unisolate(self, idf_isolation_state): + cmd = "\n" + if idf_isolation_state == "unisolated": + cmd += self.idf_unisolate_template.render(constants=self.constants) + log_notice("DeviceGlobalCfgMgr:: IDF un-isolated") + else: + cmd += self.idf_isolate_template.render(isolation_status=idf_isolation_state, constants=self.constants) + log_notice("DeviceGlobalCfgMgr:: IDF isolated, {} policy applied".format(idf_isolation_state)) + + self.cfg_mgr.push(cmd) + log_debug("DeviceGlobalCfgMgr::Done") + + def check_state_and_get_idf_isolation_routemaps(self): + """ API to get TSA route-maps if device is isolated""" + cmd = "" + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "idf_isolation_state"): + idf_isolation_state = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["idf_isolation_state"] + if idf_isolation_state != "unisolated": + log_notice("DeviceGlobalCfgMgr:: IDF is isolated. Applying required route-maps") + cmd = self.idf_isolate_template.render(isolation_status=idf_isolation_state, constants=self.constants) + return cmd \ No newline at end of file diff --git a/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_isolated_no_export.conf b/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_isolated_no_export.conf new file mode 100644 index 000000000000..39d6866ad30d --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_isolated_no_export.conf @@ -0,0 +1,34 @@ +! +! template: bgpd/templates/general/peer-group.conf.j2 +! + neighbor PEER_V4 peer-group + neighbor PEER_V6 peer-group + address-family ipv4 + neighbor PEER_V4 allowas-in 1 + neighbor PEER_V4 soft-reconfiguration inbound + neighbor PEER_V4 route-map FROM_BGP_PEER_V4 in + neighbor PEER_V4 route-map TO_BGP_PEER_V4 out + exit-address-family + address-family ipv6 + neighbor PEER_V6 allowas-in 1 + neighbor PEER_V6 soft-reconfiguration inbound + neighbor PEER_V6 route-map FROM_BGP_PEER_V6 in + neighbor PEER_V6 route-map TO_BGP_PEER_V6 out + exit-address-family +! +! end of template: bgpd/templates/general/peer-group.conf.j2 +! + +route-map CHECK_IDF_ISOLATION permit 1 + match ip address prefix-list PL_LoopbackV4 + set community 12345:12345 +route-map CHECK_IDF_ISOLATION permit 2 + match ipv6 address prefix-list PL_LoopbackV6 + set community 12345:12345 +route-map CHECK_IDF_ISOLATION permit 3 + match tag 1001 + set community 12345:12345 +route-map CHECK_IDF_ISOLATION permit 10 + set community no-export additive + no route-map CHECK_IDF_ISOLATION deny 4 + diff --git a/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_isolated_withdraw_all.conf b/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_isolated_withdraw_all.conf new file mode 100644 index 000000000000..cbf1c19b2e98 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_isolated_withdraw_all.conf @@ -0,0 +1,33 @@ +! +! template: bgpd/templates/general/peer-group.conf.j2 +! + neighbor PEER_V4 peer-group + neighbor PEER_V6 peer-group + address-family ipv4 + neighbor PEER_V4 allowas-in 1 + neighbor PEER_V4 soft-reconfiguration inbound + neighbor PEER_V4 route-map FROM_BGP_PEER_V4 in + neighbor PEER_V4 route-map TO_BGP_PEER_V4 out + exit-address-family + address-family ipv6 + neighbor PEER_V6 allowas-in 1 + neighbor PEER_V6 soft-reconfiguration inbound + neighbor PEER_V6 route-map FROM_BGP_PEER_V6 in + neighbor PEER_V6 route-map TO_BGP_PEER_V6 out + exit-address-family +! +! end of template: bgpd/templates/general/peer-group.conf.j2 +! + +route-map CHECK_IDF_ISOLATION permit 1 + match ip address prefix-list PL_LoopbackV4 + set community 12345:12345 +route-map CHECK_IDF_ISOLATION permit 2 + match ipv6 address prefix-list PL_LoopbackV6 + set community 12345:12345 +route-map CHECK_IDF_ISOLATION permit 3 + match tag 1001 + set community 12345:12345 +route-map CHECK_IDF_ISOLATION deny 4 + route-map CHECK_IDF_ISOLATION permit 10 + no set community no-export additive diff --git a/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_unisolated.conf b/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_unisolated.conf new file mode 100644 index 000000000000..075f97f5da97 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_all_idf_unisolated.conf @@ -0,0 +1,27 @@ +! +! template: bgpd/templates/general/peer-group.conf.j2 +! + neighbor PEER_V4 peer-group + neighbor PEER_V6 peer-group + address-family ipv4 + neighbor PEER_V4 allowas-in 1 + neighbor PEER_V4 soft-reconfiguration inbound + neighbor PEER_V4 route-map FROM_BGP_PEER_V4 in + neighbor PEER_V4 route-map TO_BGP_PEER_V4 out + exit-address-family + address-family ipv6 + neighbor PEER_V6 allowas-in 1 + neighbor PEER_V6 soft-reconfiguration inbound + neighbor PEER_V6 route-map FROM_BGP_PEER_V6 in + neighbor PEER_V6 route-map TO_BGP_PEER_V6 out + exit-address-family +! +! end of template: bgpd/templates/general/peer-group.conf.j2 +! + +no route-map CHECK_IDF_ISOLATION permit 1 +no route-map CHECK_IDF_ISOLATION permit 2 +no route-map CHECK_IDF_ISOLATION permit 3 +no route-map CHECK_IDF_ISOLATION deny 4 +route-map CHECK_IDF_ISOLATION permit 10 + no set community no-export additive diff --git a/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_idf_isolated.conf b/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_idf_isolated.conf new file mode 100644 index 000000000000..838dd4e9c5b9 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/general/peer-group.conf/result_idf_isolated.conf @@ -0,0 +1,12 @@ +route-map CHECK_IDF_ISOLATION permit 1 + match ip address prefix-list PL_LoopbackV4 + set community 12345:12345 +route-map CHECK_IDF_ISOLATION permit 2 + match ipv6 address prefix-list PL_LoopbackV6 + set community 12345:12345 +route-map CHECK_IDF_ISOLATION permit 3 + match tag 1001 + set community 12345:12345 +route-map CHECK_IDF_ISOLATION permit 10 + set community no-export additive + no route-map CHECK_IDF_ISOLATION deny 4 diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_no_export.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_no_export.conf new file mode 100644 index 000000000000..fa269cd96628 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_no_export.conf @@ -0,0 +1,12 @@ +route-map CHECK_IDF_ISOLATION permit 1 + match ip address prefix-list PL_LoopbackV4 + set community 12345:555 +route-map CHECK_IDF_ISOLATION permit 2 + match ipv6 address prefix-list PL_LoopbackV6 + set community 12345:555 +route-map CHECK_IDF_ISOLATION permit 3 + match tag 1002 + set community 12345:555 +route-map CHECK_IDF_ISOLATION permit 10 + set community no-export additive + no route-map CHECK_IDF_ISOLATION deny 4 \ No newline at end of file diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_no_export.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_no_export.json new file mode 100644 index 000000000000..1c8f5191c33e --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_no_export.json @@ -0,0 +1,9 @@ +{ + "constants": { + "bgp": { + "traffic_shift_community": "12345:555", + "internal_community_match_tag": "1002" + } + }, + "isolation_status": "isolated_no_export" +} \ No newline at end of file diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_withdraw_all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_withdraw_all.conf new file mode 100644 index 000000000000..4cc312a72227 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_withdraw_all.conf @@ -0,0 +1,12 @@ +route-map CHECK_IDF_ISOLATION permit 1 + match ip address prefix-list PL_LoopbackV4 + set community 12345:555 +route-map CHECK_IDF_ISOLATION permit 2 + match ipv6 address prefix-list PL_LoopbackV6 + set community 12345:555 +route-map CHECK_IDF_ISOLATION permit 3 + match tag 1002 + set community 12345:555 +route-map CHECK_IDF_ISOLATION deny 4 + route-map CHECK_IDF_ISOLATION permit 10 + no set community no-export additive \ No newline at end of file diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_withdraw_all.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_withdraw_all.json new file mode 100644 index 000000000000..6e4dbc4f5dca --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_isolated_withdraw_all.json @@ -0,0 +1,9 @@ +{ + "constants": { + "bgp": { + "traffic_shift_community": "12345:555", + "internal_community_match_tag": "1002" + } + }, + "isolation_status": "isolated_withdraw_all" +} \ No newline at end of file diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_unisolated.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_unisolated.conf new file mode 100644 index 000000000000..f9541f402d93 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_unisolated.conf @@ -0,0 +1,6 @@ +no route-map CHECK_IDF_ISOLATION permit 1 +no route-map CHECK_IDF_ISOLATION permit 2 +no route-map CHECK_IDF_ISOLATION permit 3 +no route-map CHECK_IDF_ISOLATION deny 4 +route-map CHECK_IDF_ISOLATION permit 10 + no set community no-export additive \ No newline at end of file diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_unisolated.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_unisolated.json new file mode 100644 index 000000000000..f11553e2d39d --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/idf_isolate/idf_unisolated.json @@ -0,0 +1,9 @@ +{ + "constants": { + "bgp": { + "traffic_shift_community": "12345:555", + "internal_community_match_tag": "1002" + } + }, + "isolation_status": "unisolated" +} \ No newline at end of file diff --git a/src/sonic-bgpcfgd/tests/test_device_global.py b/src/sonic-bgpcfgd/tests/test_device_global.py index 396a72a23182..12dd895f58d7 100644 --- a/src/sonic-bgpcfgd/tests/test_device_global.py +++ b/src/sonic-bgpcfgd/tests/test_device_global.py @@ -63,6 +63,31 @@ def test_isolate_device(mocked_log_info): mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_isolate.conf") +@patch('bgpcfgd.managers_device_global.log_debug') +def test_idf_isolation_no_export(mocked_log_info): + m = constructor() + res = m.set_handler("STATE", {"idf_isolation_state": "isolated_no_export"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_isolated_no_export.conf") + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_idf_isolation_withdraw_all(mocked_log_info): + m = constructor() + res = m.set_handler("STATE", {"idf_isolation_state": "isolated_withdraw_all"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_isolated_withdraw_all.conf") + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_idf_unisolation(mocked_log_info): + m = constructor() + m.directory.put(m.db_name, m.table_name, "idf_isolation_state", "isolated_no_export") + res = m.set_handler("STATE", {"idf_isolation_state": "unisolated"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_unisolated.conf") + @patch('bgpcfgd.managers_device_global.log_debug') def test_isolate_device_internal_session(mocked_log_info): m = constructor(check_internal=True) @@ -75,6 +100,7 @@ def test_isolate_device_internal_session(mocked_log_info): @patch('bgpcfgd.managers_device_global.log_debug') def test_unisolate_device(mocked_log_info): m = constructor() + m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") @@ -83,6 +109,7 @@ def test_unisolate_device(mocked_log_info): @patch('bgpcfgd.managers_device_global.log_debug') def test_unisolate_device_internal_session(mocked_log_info): m = constructor(check_internal=True) + m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") @@ -99,6 +126,16 @@ def test_check_state_and_get_tsa_routemaps(): res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) assert res == "" +def test_check_state_and_get_idf_isolation_routemaps(): + m = constructor() + m.set_handler("STATE", {"idf_isolation_state": "isolated_no_export"}) + res = m.check_state_and_get_idf_isolation_routemaps() + assert res == get_string_from_file("/result_idf_isolated.conf") + + m.set_handler("STATE", {"idf_isolation_state": "unisolated"}) + res = m.check_state_and_get_idf_isolation_routemaps() + assert res == "" + def test_get_tsa_routemaps(): m = constructor() assert m.get_ts_routemaps([], m.tsa_template) == "" diff --git a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py index acbd3b53cc2f..908c4d802e54 100644 --- a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py +++ b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py @@ -63,6 +63,24 @@ def test_bgpd_lo_ipv6_conf_base(): "bgpd.main.conf.j2/base.json", "bgpd.main.conf.j2/base.conf") +def test_idf_isolated_no_export(): + run_test("IDF isolation with no export", + "bgpd/idf_isolate/idf_isolate.conf.j2", + "idf_isolate/idf_isolated_no_export.json", + "idf_isolate/idf_isolated_no_export.conf") + +def test_idf_isolated_withdraw_all(): + run_test("IDF isolation withdraw all", + "bgpd/idf_isolate/idf_isolate.conf.j2", + "idf_isolate/idf_isolated_withdraw_all.json", + "idf_isolate/idf_isolated_withdraw_all.conf") + +def test_idf_unisolated(): + run_test("IDF unisolated", + "bgpd/idf_isolate/idf_unisolate.conf.j2", + "idf_isolate/idf_unisolated.json", + "idf_isolate/idf_unisolated.conf") + def test_tsa_isolate(): run_test("tsa/bgpd.tsa.isolate.conf.j2", "bgpd/tsa/bgpd.tsa.isolate.conf.j2", From 77349ab6d00182a3213281cfa710c6236be6cf6c Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 31 May 2024 08:49:19 +0800 Subject: [PATCH 198/282] [Mellanox] upgrade MFT tool to 4.28.0-96 (#19139) Upgrade MFT tool to 4.28.0-96 --- platform/mellanox/mft.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index 4dbdf07cff1f..61e43e5823ff 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016-2023 NVIDIA CORPORATION & AFFILIATES. +# Copyright (c) 2016-2024 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,8 +16,8 @@ # # Mellanox SAI -MFT_VERSION = 4.27.0 -MFT_REVISION = 83 +MFT_VERSION = 4.28.0 +MFT_REVISION = 96 MLNX_MFT_INTERNAL_SOURCE_BASE_URL = From 4aea944c148529a9e0115b9fb9fa3d2b78126019 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Thu, 30 May 2024 17:51:57 -0700 Subject: [PATCH 199/282] [Mellanox]Passing the installed kernel headers during SDK compilation (#19115) Passing the last installed kernel headers during SDK compilation. Without this the SDK does uname -r which gives the kernel version of the host machine in the slave docker. But these kernel headers are not installed in the slave docker leading to compilation failure. --- platform/mellanox/sdk-src/wjh-libs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/sdk-src/wjh-libs/Makefile b/platform/mellanox/sdk-src/wjh-libs/Makefile index d5af48b7c559..5e5786befd0a 100644 --- a/platform/mellanox/sdk-src/wjh-libs/Makefile +++ b/platform/mellanox/sdk-src/wjh-libs/Makefile @@ -20,7 +20,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : ./autogen.sh fi - debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + debuild -e 'KVERSION=$(shell ls -t /lib/modules |head -1)' -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) popd From 4b91ea8a0c39fdfce5e71bfff0062603c475e612 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Fri, 31 May 2024 03:57:29 +0300 Subject: [PATCH 200/282] [build] use eatmydata for sonic-slave-bookworm (#19077) Use eatmydata to reduce build time of sonic-slave-bookworm docker image. More info in #15857 --- sonic-slave-bookworm/Dockerfile.j2 | 68 +++++++++++++++--------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index fd9184218e00..a254d3fab308 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -38,9 +38,9 @@ ARG PYTHON_CROSS_PLATFORM=linux_aarch64 {%- endif %} RUN dpkg --add-architecture $arch -RUN apt-get update -RUN apt-get install -y crossbuild-essential-$arch -RUN apt-get install -y gcc-$gcc_arch +RUN apt-get update && apt-get install -y eatmydata +RUN eatmydata apt-get install -y crossbuild-essential-$arch +RUN eatmydata apt-get install -y gcc-$gcc_arch RUN apt-mark hold g++-$gcc_arch RUN apt-mark hold g++-10-$gcc_arch @@ -57,10 +57,10 @@ ENV DEBIAN_FRONTEND=noninteractive COPY ["pip.conf", "/etc/pip.conf"] {%- if CROSS_BUILD_ENVIRON == "y" %} -RUN apt-get install -y python3 python3-pip -RUN apt-get install -y python3-minimal:$arch python3.11:$arch python3:$arch python3-dev:$arch python3-setuptools:$arch -RUN apt-get download python3-distutils && dpkg --force-all -i python3-distutils* -RUN apt-get download python3-pip && dpkg --force-all -i python3-pip* +RUN eatmydata apt-get install -y python3 python3-pip +RUN eatmydata apt-get install -y python3-minimal:$arch python3.11:$arch python3:$arch python3-dev:$arch python3-setuptools:$arch +RUN apt-get download python3-distutils && eatmydata dpkg --force-all -i python3-distutils* +RUN apt-get download python3-pip && eatmydata dpkg --force-all -i python3-pip* RUN which pip3 && pip3 install enum34 RUN pip3 install virtualenv @@ -70,10 +70,10 @@ RUN cd /python_virtualenv && python3 -m virtualenv --copies -p /usr/bin/python3 RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install setuptools==66.1.1 setuptools-scm==8.0.4 setuptools-scm-git-archive==1.4.1 wheel==0.38.4 fastentrypoints pytest pytest-cov pytest-runner==5.2 nose==1.3.7 mockredispy==2.9.3 mock==3.0.5 PyYAML==6.0.1 redis==3.5.3 pexpect==4.8.0 Pympler==0.8 parameterized natsort==6.2.1 MarkupSafe==2.0.1 Jinja2==3.0.3 click tabulate netaddr netifaces pyroute2 pyfakefs sphinx && ln -s /python_virtualenv/env3/bin/pytest /python_virtualenv/env3/bin/pytest-3 -RUN apt-get --fix-broken install -y +RUN eatmydata apt-get --fix-broken install -y RUN LIBPYTHON3_DEPS="`apt-cache depends libpython3-dev:$arch |grep Depends|awk {'print \$2;'}|tr "\n" " "`" && apt-get install -y libpython2.7-dev:$arch $LIBPYTHON3_DEPS libxml2-dev:$arch libxslt-dev:$arch libssl-dev:$arch libz-dev:$arch -RUN apt-get install -y swig libssl-dev +RUN eatmydata apt-get install -y swig libssl-dev RUN PATH=/python_virtualenv/env3/bin/:$PATH python3 -m pip install pyang==2.4.0 RUN PATH=/python_virtualenv/env3/bin/:$PATH python3 -m pip install pyangbind==0.8.2 @@ -81,7 +81,7 @@ RUN PATH=/python_virtualenv/env3/bin/:$PATH python3 -m pip uninstall -y enum34 RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install --force-reinstall --no-cache-dir coverage {%- endif %} -RUN apt-get update && apt-get install -y \ +RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install -y \ apt-utils \ default-jre-headless \ openssh-server \ @@ -452,7 +452,7 @@ RUN apt-get update && apt-get install -y \ libzip-dev {%- if CONFIGURED_ARCH != "arm64" and CONFIGURED_ARCH != "armhf" %} -RUN apt-get update && apt-get install -y \ +RUN eatmydata apt-get install -y \ # For p4 libraries libgrpc++-dev \ libgrpc-dev \ @@ -482,14 +482,14 @@ RUN apt-get update && apt-get install -y \ {%- if CROSS_BUILD_ENVIRON == "y" %} # Arm vs. amd64 versions conflict - remove amd64 packages RUN apt-get remove -y libnl-3-200 -RUN apt-get install -y libpcre3:$arch +RUN eatmydata apt-get install -y libpcre3:$arch {%- endif %} -RUN apt-get -y build-dep openssh +RUN eatmydata apt-get -y build-dep openssh # Build fix for ARM64 and ARMHF /etc/debian_version {%- if CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" %} -RUN apt upgrade -y base-files libc-bin=$(dpkg-query -W -f '${Version}' libc-bin) +RUN eatmydata apt upgrade -y base-files libc-bin=$(dpkg-query -W -f '${Version}' libc-bin) {%- endif %} ## Config dpkg @@ -502,21 +502,21 @@ RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confold" {%- if CROSS_BUILD_ENVIRON != "y" %} # For linux build -RUN apt-get -y build-dep linux +RUN eatmydata apt-get -y build-dep linux {%- else %} -RUN apt-get install -y kernel-wedge +RUN eatmydata apt-get install -y kernel-wedge {%- endif %} # For gobgp and telemetry build -RUN apt-get install -y golang +RUN eatmydata apt-get install -y golang {%- if INCLUDE_FIPS == "y" %} RUN wget -O golang-go.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bookworm/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.19-go_{{ FIPS_GOLANG_VERSION }}_{{ CONFIGURED_ARCH }}.deb' \ && wget -O golang-src.deb 'https://sonicstorage.blob.core.windows.net/public/fips/bookworm/{{ FIPS_VERSION }}/{{ CONFIGURED_ARCH }}/golang-1.19-src_{{ FIPS_GOLANG_VERSION }}_all.deb' \ - && dpkg -i golang-go.deb golang-src.deb \ + && eatmydata dpkg -i golang-go.deb golang-src.deb \ && ln -sf /usr/lib/go-1.19 /usr/local/go \ && rm golang-go.deb golang-src.deb {%- else %} -RUN apt-get install -y golang-go \ +RUN eatmydata apt-get install -y golang-go \ && ln -sf /usr/lib/go-1.19 /usr/local/go {%- endif %} @@ -578,16 +578,16 @@ RUN pip3 install mmh3==2.5.1 # For ptf-py3 0.10.0 RUN pip3 install setuptools==66.1.1 setuptools-scm==8.0.4 setuptools-scm-git-archive==1.4.1 -RUN apt-get install -y xsltproc +RUN eatmydata apt-get install -y xsltproc # Install dependencies for isc-dhcp-relay build -RUN apt-get -y build-dep isc-dhcp +RUN eatmydata apt-get -y build-dep isc-dhcp # Install vim -RUN apt-get install -y vim +RUN eatmydata apt-get install -y vim # Install rsyslog -RUN apt-get install -y rsyslog +RUN eatmydata apt-get install -y rsyslog {%- if CROSS_BUILD_ENVIRON == "y" %} RUN cd /usr/src/gtest && CXX=$CROSS_CXX CC=$CROSS_CC cmake . && make -C /usr/src/gtest @@ -600,7 +600,7 @@ EXPOSE 22 # Install docker engine 24 inside docker and enable experimental feature RUN apt-get update -RUN apt-get install -y \ +RUN eatmydata apt-get install -y \ apt-transport-https \ ca-certificates \ curl \ @@ -619,15 +619,15 @@ RUN add-apt-repository \ $(lsb_release -cs) \ stable" RUN apt-get update -RUN apt-get install -y docker-ce=5:24.0.2-1~debian.12~bookworm docker-ce-cli=5:24.0.2-1~debian.12~bookworm containerd.io=1.6.21-1 docker-buildx-plugin=0.10.5-1~debian.12~bookworm docker-compose-plugin=2.18.1-1~debian.12~bookworm +RUN eatmydata apt-get install -y docker-ce=5:24.0.2-1~debian.12~bookworm docker-ce-cli=5:24.0.2-1~debian.12~bookworm containerd.io=1.6.21-1 docker-buildx-plugin=0.10.5-1~debian.12~bookworm docker-compose-plugin=2.18.1-1~debian.12~bookworm RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs {{ DOCKER_EXTRA_OPTS }}\"" >> /etc/default/docker RUN update-alternatives --set iptables /usr/sbin/iptables-legacy # Install m2crypto package, needed by SWI tools -RUN apt-get install python3-m2crypto +RUN eatmydata apt-get install python3-m2crypto # Install libthrift package needed by saithrift -RUN apt-get install libthrift-0.17 \ +RUN eatmydata apt-get install libthrift-0.17 \ libthrift-dev \ thrift-compiler\ python3-thrift @@ -638,12 +638,12 @@ RUN pip3 install git+https://github.com/aristanetworks/swi-tools.git@bead66bf261 {% if CONFIGURED_ARCH != "amd64" -%} # Install node.js for azure pipeline RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - -RUN apt-get install -y nodejs +RUN eatmydata apt-get install -y nodejs {%- if CROSS_BUILD_ENVIRON == "y" %} -RUN apt-get install -y rsync dh-python +RUN eatmydata apt-get install -y rsync dh-python -RUN apt-get install -y \ +RUN eatmydata apt-get install -y \ libelf-dev:$arch \ libdw-dev:$arch \ libbz2-dev:$arch \ @@ -715,20 +715,20 @@ RUN apt-get install -y \ libboost-filesystem-dev:$arch \ libboost-program-options-dev:$arch -RUN apt-get download libgirepository1.0-dev:$arch && dpkg --force-all -i libgirepository1.0-dev* +RUN apt-get download libgirepository1.0-dev:$arch && eatmydata dpkg --force-all -i libgirepository1.0-dev* RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install pycairo # Install libpcsclite-dev for wpasupplicant using download because regular install removes amd64 python package -RUN apt-get download libpcsclite1:$arch && dpkg --force-all -i libpcsclite1* && apt-get download libpcsclite-dev:$arch && dpkg --force-all -i libpcsclite-dev* +RUN apt-get download libpcsclite1:$arch && eatmydata dpkg --force-all -i libpcsclite1* && apt-get download libpcsclite-dev:$arch && eatmydata dpkg --force-all -i libpcsclite-dev* # Install python3-dev for frr (/usr/bin/python3-config for $arch) using download because regular install removes amd64 python package -RUN apt-get download python3.11-dev:$arch && apt-get download python3-dev:$arch && dpkg --force-all -i python3*-dev* +RUN apt-get download python3.11-dev:$arch && apt-get download python3-dev:$arch && eatmydata dpkg --force-all -i python3*-dev* {% endif %} # Tell azure pipeline to use node.js in the docker LABEL "com.azure.dev.pipelines.agent.handler.node.path"="/usr/bin/node" {% endif -%} -RUN apt install -y python-is-python3 +RUN eatmydata apt install -y python-is-python3 # Install Bazel build system (amd64 and arm64 architectures are supported using this method) # TODO(PINS): Remove once pre-build Bazel binaries are available for armhf (armv7l) From 8e5049069533b2ed5932c2589a0069eca65ae129 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 31 May 2024 08:58:43 +0800 Subject: [PATCH 201/282] [ci/build]: Upgrade SONiC package versions (#19014) --- .../build-sonic-slave-bookworm/versions-py3 | 1 - files/build/versions/default/versions-git | 6 ++-- files/build/versions/default/versions-mirror | 30 +++++++++---------- .../docker-platform-monitor/versions-py3 | 1 + .../versions-py3-all-arm64 | 1 + .../versions-py3-all-armhf | 1 + .../sonic-slave-buster/versions-deb-buster | 30 +++++++++---------- .../versions/host-image/versions-deb-bookworm | 3 ++ 8 files changed, 39 insertions(+), 34 deletions(-) diff --git a/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 b/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 index 322deae41746..eb8e166158a1 100644 --- a/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 @@ -25,7 +25,6 @@ paramiko==2.11.0 pexpect==4.9.0 prefixed==0.7.1 prettyprinter==0.18.0 -psutil==5.9.8 ptyprocess==0.7.0 pycairo==1.26.0 pycparser==2.22 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 4c9e43ea6360..db1e94a1aa2d 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -4,8 +4,8 @@ https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 -https://github.com/flashrom/flashrom.git==643ae4d1fcb9b3bda6f35e8ff6f5b71b1104f600 -https://github.com/FreeRADIUS/freeradius-server.git==66cf26be5e195b56c70288c98a3e62680ff38154 +https://github.com/flashrom/flashrom.git==85b977151b8f5717ad00b7b7204521a823ac1ad2 +https://github.com/FreeRADIUS/freeradius-server.git==3310bf65f2912231fcb1dc59b1624d6894e3ca2a https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/lguohan/gnxi.git==3adf8b97755b49947e465b5a14645f11e79fa0cd @@ -17,6 +17,6 @@ https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 https://github.com/sonic-net/DASH.git==2cb918fbe22eee60296c7326af530bd25b23398f https://github.com/thom311/libnl==49f7822961f5bc6b18cd2a2d3f3b8d2ab0896d3f -https://salsa.debian.org/kernel-team/initramfs-tools.git==15311e6282434f184fb306c38d415f2217239214 +https://salsa.debian.org/kernel-team/initramfs-tools.git==b7f5a3ceaa306212aa5c7810d5fc5faf82bc4ffe https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d https://salsa.debian.org/ssh-team/openssh.git==d150d0d69246f55c711684078f47f999a4bfd6bc diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 9e406ee2f03e..9ed36688b2dc 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,24 +1,24 @@ archive.ubuntu.com_ubuntu_dists_focal==2020-04-23T17:33:17Z archive.ubuntu.com_ubuntu_dists_focal-backports==2023-11-13T00:36:10Z -archive.ubuntu.com_ubuntu_dists_focal-updates==2024-05-18T01:45:17Z +archive.ubuntu.com_ubuntu_dists_focal-updates==2024-05-20T01:41:38Z deb.nodesource.com_node%5f14.x_dists_bookworm==2023-02-17T00:35:29Z deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20240517T000625Z -debian-security==20240517T000237Z +debian==20240519T000308Z +debian-security==20240519T000258Z download.docker.com_linux_debian_dists_bookworm==2024-05-16T12:25:40Z download.docker.com_linux_debian_dists_bullseye==2024-05-16T12:25:40Z download.docker.com_linux_debian_dists_buster==2024-05-16T12:25:40Z -packages.trafficmanager.net_snapshot_debian-security_20240517T000237Z_dists_bookworm-security==2024-05-16T19:15:13Z -packages.trafficmanager.net_snapshot_debian-security_20240517T000237Z_dists_bullseye-security==2024-05-16T19:15:12Z -packages.trafficmanager.net_snapshot_debian-security_20240517T000237Z_dists_buster_updates==2024-05-16T19:15:12Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bookworm==2024-02-10T11:07:25Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bookworm-backports==2024-05-16T20:19:56Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bookworm-updates==2024-05-16T20:19:56Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye-backports==2024-05-16T20:19:56Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_bullseye-updates==2024-05-16T20:19:56Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240517T000625Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20240519T000258Z_dists_bookworm-security==2024-05-17T18:44:06Z +packages.trafficmanager.net_snapshot_debian-security_20240519T000258Z_dists_bullseye-security==2024-05-17T18:44:06Z +packages.trafficmanager.net_snapshot_debian-security_20240519T000258Z_dists_buster_updates==2024-05-17T18:44:07Z +packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bookworm==2024-02-10T11:07:25Z +packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bookworm-backports==2024-05-18T20:11:44Z +packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bookworm-updates==2024-05-18T20:11:44Z +packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bullseye-backports==2024-05-18T20:11:44Z +packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bullseye-updates==2024-05-18T20:11:43Z +packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_buster-updates==2023-06-10T08:55:10Z security.ubuntu.com_ubuntu_dists_focal-security==2024-05-15T17:54:08Z diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-py3 b/files/build/versions/dockers/docker-platform-monitor/versions-py3 index 88a9dfbe9252..40dd5328cd5c 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-py3 +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py3 @@ -9,6 +9,7 @@ jsonschema==2.6.0 libpci==0.2 netifaces==0.11.0 protobuf==4.25.3 +psutil==5.9.8 pyrsistent==0.18.1 python-sdk-api==4.6.3064 requests==2.31.0 diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-arm64 b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-arm64 index 9a6fae8cbf18..980b0b50f9ca 100644 --- a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-arm64 +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-arm64 @@ -1 +1,2 @@ protobuf==4.25.3 +psutil==5.9.8 diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-armhf b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-armhf index 9a6fae8cbf18..980b0b50f9ca 100644 --- a/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-armhf +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-py3-all-armhf @@ -1 +1,2 @@ protobuf==4.25.3 +psutil==5.9.8 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index 202bd02c061e..cb3a5da28159 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -23,7 +23,7 @@ autopoint==0.19.8.1-9 autotools-dev==20180224.1 bash-completion==1:2.8-6 bc==1.07.1-2+b1 -bind9-host==1:9.11.5.P4+dfsg-5.1+deb10u10 +bind9-host==1:9.11.5.P4+dfsg-5.1+deb10u11 binfmt-support==2.2.0-2 binutils==2.31.1-16 binutils-aarch64-linux-gnu==2.31.1-16 @@ -86,7 +86,7 @@ distro-info-data==0.41+deb10u9 dkms==2.6.1-4 dmeventd==2:1.02.155-3 dmsetup==2:1.02.155-3 -dnsutils==1:9.11.5.P4+dfsg-5.1+deb10u10 +dnsutils==1:9.11.5.P4+dfsg-5.1+deb10u11 docbook==4.5-6 docbook-dsssl==1.79-9.1 docbook-to-man==1:2.0.0-42 @@ -287,8 +287,8 @@ libbabeltrace-dev==1.5.6-2+deb10u1 libbabeltrace1==1.5.6-2+deb10u1 libbatik-java==1.10-2+deb10u3 libbdplus0==0.1.2-3 -libbind-export-dev==1:9.11.5.P4+dfsg-5.1+deb10u10 -libbind9-161==1:9.11.5.P4+dfsg-5.1+deb10u10 +libbind-export-dev==1:9.11.5.P4+dfsg-5.1+deb10u11 +libbind9-161==1:9.11.5.P4+dfsg-5.1+deb10u11 libbinutils==2.31.1-16 libbison-dev==2:3.3.2.dfsg-1 libbit-vector-perl==7.4-1+b5 @@ -453,8 +453,8 @@ libdist-checkconflicts-perl==0.11-1 libdistro-info-perl==0.21+deb10u1 libdjvulibre-text==3.5.27.1-10+deb10u1 libdjvulibre21==3.5.27.1-10+deb10u1 -libdns-export1104==1:9.11.5.P4+dfsg-5.1+deb10u10 -libdns1104==1:9.11.5.P4+dfsg-5.1+deb10u10 +libdns-export1104==1:9.11.5.P4+dfsg-5.1+deb10u11 +libdns1104==1:9.11.5.P4+dfsg-5.1+deb10u11 libdom4j-java==2.1.1-2 libdouble-conversion1==3.1.0-3 libdoxia-core-java==1.7-2 @@ -676,14 +676,14 @@ libipc-system-simple-perl==1.25-4 libipt2==2.0-2 libiptc-dev==1.8.2-4 libiptc0==1.8.2-4 -libirs-export161==1:9.11.5.P4+dfsg-5.1+deb10u10 -libirs161==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisc-export1100==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisc1100==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisccc-export161==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisccc161==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisccfg-export163==1:9.11.5.P4+dfsg-5.1+deb10u10 -libisccfg163==1:9.11.5.P4+dfsg-5.1+deb10u10 +libirs-export161==1:9.11.5.P4+dfsg-5.1+deb10u11 +libirs161==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisc-export1100==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisc1100==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisccc-export161==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisccc161==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisccfg-export163==1:9.11.5.P4+dfsg-5.1+deb10u11 +libisccfg163==1:9.11.5.P4+dfsg-5.1+deb10u11 libisl19==0.20-2 libitext1-java==1.4-7 libitm1==8.3.0-6 @@ -763,7 +763,7 @@ liblua5.1-0-dev==5.1.5-8.1+b2 liblvm2cmd2.03==2.03.02-3 liblwp-mediatypes-perl==6.02-1 liblwp-protocol-https-perl==6.07-2 -liblwres161==1:9.11.5.P4+dfsg-5.1+deb10u10 +liblwres161==1:9.11.5.P4+dfsg-5.1+deb10u11 liblzma-dev==5.2.4-1+deb10u1 liblzo2-2==2.10-0.1 liblzo2-dev==2.10-0.1 diff --git a/files/build/versions/host-image/versions-deb-bookworm b/files/build/versions/host-image/versions-deb-bookworm index 242ff4bb7c27..d5af0316f8da 100644 --- a/files/build/versions/host-image/versions-deb-bookworm +++ b/files/build/versions/host-image/versions-deb-bookworm @@ -42,6 +42,7 @@ eatmydata==130-2 ebtables==2.0.11-5 efibootmgr==17-2 efitools==1.9.2-3 +ethtool==1:6.1-1 fdisk==2.38.1-5+deb12u1 file==1:5.44-3 firmware-amd-graphics==20230210-5 @@ -315,6 +316,7 @@ pciutils==1:3.9.0-4 perl==5.36.0-7+deb12u1 perl-modules-5.36==5.36.0-7+deb12u1 picocom==3.1-4 +pigz==2.6-1 pkgconf==1.8.1-1 procps==2:4.0.2-3 psmisc==23.6-1 @@ -390,6 +392,7 @@ vim-runtime==2:9.0.1378-2 wireless-regdb==2022.06.06-1 x11-common==1:7.7+23 xml-core==0.18+nmu1 +xmlstarlet==1.6.1-3 xxd==2:9.0.1378-2 xz-utils==5.4.1-0.2 zlib1g-dev==1:1.2.13.dfsg-1 From e336741be0db25d011cc429067c2e9f2bb4f1a62 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Thu, 30 May 2024 19:59:48 -0700 Subject: [PATCH 202/282] [doc]: add build badge for nvidia bluefield (#19148) Signed-off-by: Guohan Lu --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ae76a8937316..9ea16954201a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,9 @@ [![Marvell(armhf)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-armhf?branchName=master&label=Marvell-armhf)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=141&branchName=master) [![Marvell(arm64)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-arm64?branchName=master&label=Marvell-arm64)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=999&branchName=master) [![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=master&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=master) +[![Nvidia-Bluefield](https://dev.azure.com/mssonic/build/_apis/build/status/nvidia/Azure.sonic-buildimage.official.nvidia-bluefield?branchName=master&label=Nvidia-Bluefield)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=1665&branchName=master) [![Pensando](https://dev.azure.com/mssonic/build/_apis/build/status/pensando/Azure.sonic-buildimage.official.pensando?branchName=master&label=Pensando)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=1366&branchName=master) + [![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=master&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=master) *202311 builds*: @@ -99,6 +101,10 @@ [![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=201811&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=201811) [![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=201811&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=201811) +## SONiC Image Azure Pipelines + +All SONiC project build pipeline could be found at [Download Portal for SONiC Images](https://sonic-build.azurewebsites.net) + # sonic-buildimage ## Build SONiC Switch Images @@ -194,6 +200,7 @@ The supported ASIC vendors are: * PLATFORM=cavium * PLATFORM=centec * PLATFORM=nephos +* PLATFORM=nvidia-bluefield * PLATFORM=innovium * PLATFORM=vs @@ -362,10 +369,6 @@ on the SAI version for each SONiC release. [managing, configuring and monitoring SONiC](https://github.com/sonic-net/sonic-mgmt) (gzip tar archive) -## SONiC Image Azure Pipelines - -All SONiC project build pipeline could be found at [Download Portal for SONiC Images](https://sonic-build.azurewebsites.net) - ## Contribution Guide All contributors must sign a contribution license agreement before contributions From 6e43f99135d3adf6bb35ae30029e87a13d1be913 Mon Sep 17 00:00:00 2001 From: Sai Kiran <110003254+opcoder0@users.noreply.github.com> Date: Fri, 31 May 2024 16:07:13 +1000 Subject: [PATCH 203/282] [docker-ptf]: Fix issue with Py3 environment (#19138) This PR fixes a bug in the docker-ptf Dockerfile when executed with SONIC_PTF_ENV_PY_VER=py3 option. Why I did it Without this fix the docker-ptf image pushes all the required py3 packages into a virtual environment and prevents it from starting up. How I did it Fixed the jinja condition to initialize virtualenv only for mixed case. How to verify it Build, load and run the docker image Build with - make SONIC_PTF_ENV_PY_VER=py3 SONIC_BUILD_JOBS=4 BUILD_MULTIASIC_KVM=y INCLUDE_DHCP_SERVER=y target/docker-ptf.gz Load and run the image - docker load -i target/docker-ptf.gz Run with - docker run -it --entrypoint bash docker-ptf:latest Verified the packages are installed properly. * Fixes incorrect condition that makes Py3 packages go into a virtual environment when docker-ptf is built with 'py3'. When package is built with 'py3' the packages do not need to be in a virtualenv. --- dockers/docker-ptf/Dockerfile.j2 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index d026b708b4b3..95a7cb9eee41 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -73,6 +73,7 @@ RUN apt-get update \ python3-six \ libpcap-dev \ # TODO check if tacacs+ is required by tests +# tacacs+ has been dropped from bullseye {% if PTF_ENV_PY_VER == "mixed" %} tacacs+ \ {% endif %} @@ -90,6 +91,7 @@ RUN apt-get update \ {% if PTF_ENV_PY_VER == "py3" %} RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \ + && update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 \ && update-alternatives --install /usr/bin/pdb pdb /usr/bin/pdb3 1 \ && update-alternatives --install /usr/bin/pydoc pydoc /usr/bin/pydoc3 1 \ && update-alternatives --install /usr/bin/pygettext pygettext /usr/bin/pygettext3 1 @@ -113,6 +115,10 @@ RUN rm -rf /debs \ && python setup.py install \ && cd .. \ && rm -fr scapy-vxlan \ +{% else %} + && wget --https-only https://bootstrap.pypa.io/pip/get-pip.py \ + && python get-pip.py \ + && rm -f get-pip.py \ {% endif %} && git clone https://github.com/sflow/sflowtool \ && cd sflowtool \ @@ -160,19 +166,19 @@ RUN rm -rf /debs \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py +{% if PTF_ENV_PY_VER == "mixed" %} RUN python3 -m venv --system-site-packages env-python3 - # Activating a virtualenv. The virtualenv automatically works for RUN, ENV and CMD. ENV VIRTUAL_ENV=/root/env-python3 ARG BACKUP_OF_PATH="$PATH" ENV PATH="$VIRTUAL_ENV/bin:$PATH" - ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 PYTHONIOENCODING=UTF-8 +{% endif %} {% if PTF_ENV_PY_VER == "mixed" %} RUN python3 -m pip install --upgrade --ignore-installed pip {% else %} -RUN pip install --upgrade --ignore-installed pip +RUN pip3 install --upgrade --ignore-installed pip {% endif %} # Install all python modules from pypi. python3-scapy is exception, ptf debian package requires python3-scapy @@ -212,8 +218,10 @@ RUN pip3 install setuptools \ {{ install_python_wheels(docker_ptf_whls.split(' ')) }} {% endif %} +{% if PTF_ENV_PY_VER == "mixed" %} # Deactivating a virtualenv. ENV PATH="$BACKUP_OF_PATH" +{% endif %} ## Adjust sshd settings RUN mkdir /var/run/sshd \ From ebac764f1444e0b68aaee6f840c357833c9dee21 Mon Sep 17 00:00:00 2001 From: Philo <135693886+philo-micas@users.noreply.github.com> Date: Fri, 31 May 2024 15:33:44 +0800 Subject: [PATCH 204/282] [Micas/Platform]platform support M2-W6510 (#15888) Why I did it Add new platform m2-w6510(Trident 3) ASIC Vendor: Broadcom Switch ASIC: Trident 3 Port Config: 48x25G+8x100G How I did it Provide device and platform related files. How to verify it show platform fan show platform ssdhealth show platform psustatus show platform summary show platform syseeprom show platform temperature show interface status --- .../M2-W6510-48V8C/hwsku.json | 172 + .../M2-W6510-48V8C/port_config.ini | 57 + .../M2-W6510-48V8C/sai.profile | 1 + ...d3-m2-w6510-48v8c-48x25G+8x100G.config.bcm | 605 ++++ .../custom_led.bin | Bin 0 -> 236 bytes .../default_sku | 1 + .../x86_64-micas_m2-w6510-48v8c-r0/dev.xml | 420 +++ .../dev_exhaust.xml | 420 +++ .../x86_64-micas_m2-w6510-48v8c-r0/fru.py | 961 ++++++ .../x86_64-micas_m2-w6510-48v8c-r0/hwsku.json | 172 + .../installer.conf | 2 + .../led_proc_init.soc | 7 + .../media_settings.json | 2020 ++++++++++++ .../x86_64-micas_m2-w6510-48v8c-r0/monitor.py | 402 +++ .../x86_64-micas_m2-w6510-48v8c-r0/pcie.yaml | 440 +++ .../platform.json | 819 +++++ .../platform_asic | 1 + .../platform_components.json | 16 + .../plugins/sfputil.py | 243 ++ .../plugins/ssd_util.py | 318 ++ .../pmon_daemon_control.json | 3 + .../system_health_monitoring_config.json | 0 platform/broadcom/one-image.mk | 3 +- platform/broadcom/platform-modules-micas.dep | 9 + platform/broadcom/platform-modules-micas.mk | 10 + platform/broadcom/rules.dep | 1 + platform/broadcom/rules.mk | 1 + .../sonic-platform-modules-micas/LICENSE | 14 + .../common/Makefile | 41 + .../common/app/Makefile | 25 + .../common/app/dev_util/Makefile | 30 + .../common/app/dev_util/dfd_debug.c | 43 + .../common/app/dev_util/dfd_utest.c | 2121 +++++++++++++ .../common/app/dev_util/dfd_utest.h | 109 + .../common/app/fw_upgrade/Makefile | 18 + .../common/app/fw_upgrade/Rules.mk | 42 + .../common/app/fw_upgrade/fw_upgrade/Makefile | 39 + .../app/fw_upgrade/fw_upgrade/fw_upgrade.c | 1632 ++++++++++ .../fw_upgrade/fw_upgrade/fw_upgrade_debug.c | 51 + .../fw_upgrade/include/fw_upgrade.h | 230 ++ .../fw_upgrade/include/fw_upgrade_debug.h | 25 + .../common/lib/algorithm/__init__.py | 0 .../common/lib/algorithm/hysteresis.py | 169 + .../common/lib/algorithm/openloop.py | 110 + .../common/lib/algorithm/pid.py | 109 + .../common/lib/eepromutil/__init__.py | 0 .../common/lib/eepromutil/cust_fru.py | 135 + .../common/lib/eepromutil/fantlv.py | 192 ++ .../common/lib/eepromutil/fru.py | 961 ++++++ .../common/lib/eepromutil/onietlv.py | 441 +++ .../common/lib/plat_hal/__init__.py | 0 .../common/lib/plat_hal/baseutil.py | 169 + .../common/lib/plat_hal/chassisbase.py | 318 ++ .../common/lib/plat_hal/component.py | 33 + .../common/lib/plat_hal/cpld.py | 66 + .../common/lib/plat_hal/cpu.py | 48 + .../common/lib/plat_hal/dcdc.py | 11 + .../common/lib/plat_hal/devicebase.py | 351 +++ .../common/lib/plat_hal/fan.py | 417 +++ .../common/lib/plat_hal/interface.py | 1339 ++++++++ .../common/lib/plat_hal/led.py | 52 + .../common/lib/plat_hal/onie_e2.py | 127 + .../common/lib/plat_hal/osutil.py | 440 +++ .../common/lib/plat_hal/psu.py | 701 +++++ .../common/lib/plat_hal/rotor.py | 149 + .../common/lib/plat_hal/sensor.py | 274 ++ .../common/lib/plat_hal/temp.py | 139 + .../common/lib/restful_util/__init__.py | 0 .../common/lib/restful_util/restful_api.py | 89 + .../common/lib/wbutil/__init__.py | 0 .../common/lib/wbutil/baseutil.py | 38 + .../common/lib/wbutil/smbus.py | 772 +++++ .../kernel_drivers_blacklist.conf | 3 + .../common/modules/COPYING | 20 + .../common/modules/GPL-2.0 | 359 +++ .../common/modules/Makefile | 52 + .../common/modules/dfd_tlveeprom.c | 516 +++ .../common/modules/dfd_tlveeprom.h | 121 + .../common/modules/fpga_i2c.h | 133 + .../common/modules/hw_test.c | 608 ++++ .../common/modules/hw_test.h | 31 + .../common/modules/linux/Makefile | 36 + .../common/modules/linux/wb_csu550.c | 236 ++ .../common/modules/linux/wb_i2c_algo_bit.c | 725 +++++ .../common/modules/linux/wb_i2c_gpio.c | 431 +++ .../common/modules/linux/wb_i2c_gpio_device.c | 133 + .../common/modules/linux/wb_i2c_i801.c | 2114 +++++++++++++ .../common/modules/linux/wb_i2c_ismt.c | 1131 +++++++ .../common/modules/linux/wb_i2c_mux_pca954x.c | 1387 ++++++++ .../common/modules/linux/wb_i2c_mux_pca954x.h | 68 + .../common/modules/linux/wb_i2c_mux_pca9641.c | 1410 +++++++++ .../common/modules/linux/wb_i2c_mux_pca9641.h | 64 + .../common/modules/linux/wb_ina3221.c | 1031 ++++++ .../common/modules/linux/wb_isl68137.c | 577 ++++ .../common/modules/linux/wb_lm75.c | 992 ++++++ .../common/modules/linux/wb_lm75.h | 40 + .../common/modules/linux/wb_pmbus.h | 535 ++++ .../common/modules/linux/wb_pmbus_core.c | 2780 +++++++++++++++++ .../common/modules/linux/wb_tmp401.c | 1010 ++++++ .../common/modules/linux/wb_tps53622.c | 265 ++ .../common/modules/linux/wb_ucd9000.c | 720 +++++ .../common/modules/linux/wb_xdpe12284.c | 499 +++ .../modules/linux/wb_xdpe132g5c_pmbus.c | 512 +++ .../common/modules/pinctrl/Makefile | 17 + .../common/modules/pinctrl/core.h | 249 ++ .../common/modules/pinctrl/wb_gpio_c3000.c | 452 +++ .../modules/pinctrl/wb_gpio_c3000_device.c | 69 + .../common/modules/pinctrl/wb_pinctrl_intel.c | 1829 +++++++++++ .../common/modules/pinctrl/wb_pinctrl_intel.h | 275 ++ .../common/modules/plat_sysfs/Makefile | 20 + .../modules/plat_sysfs/dev_cfg/Makefile | 25 + .../modules/plat_sysfs/dev_cfg/cfg/dfd_cfg.c | 815 +++++ .../plat_sysfs/dev_cfg/cfg/dfd_cfg_adapter.c | 358 +++ .../plat_sysfs/dev_cfg/cfg/dfd_cfg_file.c | 236 ++ .../plat_sysfs/dev_cfg/cfg/dfd_cfg_info.c | 776 +++++ .../plat_sysfs/dev_cfg/cfg/dfd_cfg_listnode.c | 82 + .../plat_sysfs/dev_cfg/dfd_fan_driver.c | 201 ++ .../modules/plat_sysfs/dev_cfg/dfd_module.c | 95 + .../plat_sysfs/dev_cfg/dfd_psu_driver.c | 70 + .../plat_sysfs/dev_cfg/dfd_sensors_driver.c | 149 + .../plat_sysfs/dev_cfg/dfd_sff_driver.c | 56 + .../plat_sysfs/dev_cfg/dfd_slot_driver.c | 27 + .../plat_sysfs/dev_cfg/include/dfd_cfg.h | 99 + .../dev_cfg/include/dfd_cfg_adapter.h | 46 + .../plat_sysfs/dev_cfg/include/dfd_cfg_file.h | 37 + .../plat_sysfs/dev_cfg/include/dfd_cfg_info.h | 119 + .../dev_cfg/include/dfd_cfg_listnode.h | 30 + .../dev_cfg/include/dfd_fan_driver.h | 18 + .../plat_sysfs/dev_cfg/include/dfd_module.h | 96 + .../dev_cfg/include/dfd_psu_driver.h | 10 + .../dev_cfg/include/dfd_sensors_driver.h | 10 + .../dev_cfg/include/dfd_sff_driver.h | 8 + .../dev_cfg/include/dfd_slot_driver.h | 6 + .../modules/plat_sysfs/dev_sysfs/Makefile | 21 + .../dev_sysfs/include/plat_switch.h | 86 + .../dev_sysfs/include/sysfs_common.h | 90 + .../modules/plat_sysfs/dev_sysfs/plat_fan.c | 501 +++ .../modules/plat_sysfs/dev_sysfs/plat_psu.c | 426 +++ .../plat_sysfs/dev_sysfs/plat_sensor.c | 452 +++ .../modules/plat_sysfs/dev_sysfs/plat_sff.c | 287 ++ .../modules/plat_sysfs/dev_sysfs/plat_slot.c | 663 ++++ .../plat_sysfs/dev_sysfs/plat_switch.c | 130 + .../common/modules/platform_common.h | 74 + .../common/modules/platform_common_module.c | 210 ++ .../common/modules/wb_fpga_i2c_bus_drv.c | 1135 +++++++ .../common/modules/wb_fpga_pca954x_drv.c | 542 ++++ .../common/modules/wb_fpga_pcie.c | 169 + .../common/modules/wb_gpio_d1500.c | 367 +++ .../common/modules/wb_gpio_device.c | 54 + .../common/modules/wb_i2c_dev.c | 843 +++++ .../common/modules/wb_i2c_dev.h | 20 + .../common/modules/wb_i2c_ocores.c | 1179 +++++++ .../common/modules/wb_i2c_ocores.h | 30 + .../common/modules/wb_io_dev.c | 598 ++++ .../common/modules/wb_io_dev.h | 21 + .../common/modules/wb_lpc_drv.c | 166 + .../common/modules/wb_lpc_drv.h | 18 + .../common/modules/wb_mac_bsc.c | 867 +++++ .../common/modules/wb_mdio_gpio_device.c | 110 + .../common/modules/wb_pcie_dev.c | 819 +++++ .../common/modules/wb_pcie_dev.h | 28 + .../common/modules/wb_platform_i2c_dev.c | 749 +++++ .../common/modules/wb_platform_i2c_dev.h | 19 + .../common/modules/wb_spi_dev.c | 711 +++++ .../common/modules/wb_spi_dev.h | 17 + .../common/modules/wb_spi_gpio_device.c | 163 + .../common/modules/wb_spi_ocores.c | 1039 ++++++ .../common/modules/wb_spi_ocores.h | 21 + .../common/modules/wb_uio_irq.c | 282 ++ .../common/modules/wb_wdt.c | 1202 +++++++ .../common/modules/wb_wdt.h | 53 + .../common/modules/wb_xdpe132g5c.c | 579 ++++ .../common/script/auto_update.py | 196 ++ .../common/script/avscontrol.py | 203 ++ .../common/script/dev_monitor.py | 303 ++ .../common/script/drv_update.py | 152 + .../common/script/generate_airflow.py | 254 ++ .../common/script/hal_fanctrl.py | 1190 +++++++ .../common/script/hal_ledctrl.py | 830 +++++ .../common/script/hal_pltfm.py | 492 +++ .../common/script/intelligent_monitor.py | 144 + .../script/intelligent_monitor/monitor_fan.py | 285 ++ .../common/script/platform_common.py | 186 ++ .../common/script/platform_config.py | 192 ++ .../common/script/platform_driver.py | 258 ++ .../common/script/platform_e2.py | 444 +++ .../common/script/platform_intf.py | 389 +++ .../common/script/platform_ipmi.py | 92 + .../common/script/platform_manufacturer.py | 562 ++++ .../common/script/platform_process.py | 413 +++ .../common/script/platform_sensors.py | 283 ++ .../common/script/platform_test.py | 142 + .../common/script/platform_util.py | 838 +++++ .../common/script/pmon_syslog.py | 519 +++ .../common/script/reboot_cause.py | 183 ++ .../common/script/reboot_ctrl.py | 150 + .../common/script/sensors | 8 + .../common/script/set_eth_mac.py | 274 ++ .../common/script/sfp_highest_temperatue.py | 148 + .../common/script/slot_monitor.py | 253 ++ .../common/script/ssdmon | 82 + .../common/script/subnetwork.py | 59 + .../common/script/tty_console.py | 91 + .../common/script/upgrade.py | 991 ++++++ .../common/script/warm_upgrade.py | 514 +++ .../common/service/platform_driver.service | 15 + .../common/service/platform_process.service | 16 + .../common/service/subnetwork.service | 13 + .../common/sonic_platform/__init__.py | 2 + .../common/sonic_platform/chassis.py | 530 ++++ .../common/sonic_platform/component.py | 226 ++ .../common/sonic_platform/dcdc.py | 85 + .../common/sonic_platform/eeprom.py | 92 + .../common/sonic_platform/fan.py | 310 ++ .../common/sonic_platform/fan_drawer.py | 167 + .../common/sonic_platform/pcie.py | 21 + .../common/sonic_platform/platform.py | 24 + .../common/sonic_platform/psu.py | 388 +++ .../common/sonic_platform/sfp.py | 634 ++++ .../common/sonic_platform/thermal.py | 234 ++ .../common/sonic_platform/watchdog.py | 236 ++ .../debian/changelog | 5 + .../debian/compat | 1 + .../debian/control | 9 + .../debian/copyright | 15 + ...tform-modules-micas-m2-w6510-48v8c.install | 1 + ...form-modules-micas-m2-w6510-48v8c.postinst | 10 + .../debian/rule.mk | 5 + .../sonic-platform-modules-micas/debian/rules | 98 + .../m2-w6510-48v8c/Makefile | 25 + .../x86_64_micas_m2_w6510_48v8c_r0_config.py | 1106 +++++++ ..._64_micas_m2_w6510_48v8c_r0_port_config.py | 7 + .../x86_64_micas_m2_w6510_48v8c_r0_device.py | 1371 ++++++++ ..._micas_m2_w6510_48v8c_r0_exhaust_device.py | 1371 ++++++++ .../x86_64_micas_m2_w6510_48v8c_r0_monitor.py | 206 ++ .../m2-w6510-48v8c/modules/driver/Makefile | 12 + .../modules/driver/wb_i2c_dev_device.c | 140 + .../driver/wb_i2c_mux_pca954x_device.c | 296 ++ .../modules/driver/wb_i2c_ocores_device.c | 423 +++ .../modules/driver/wb_io_dev_device.c | 103 + .../modules/driver/wb_lpc_drv_device.c | 130 + .../modules/driver/wb_pcie_dev_device.c | 93 + .../plat_sysfs_cfg/WB_PLAT_CPLD.cfg | 41 + .../plat_sysfs_cfg/WB_PLAT_FAN.cfg | 304 ++ .../plat_sysfs_cfg/WB_PLAT_PSU.cfg | 64 + .../plat_sysfs_cfg/WB_PLAT_SFF.cfg | 521 +++ .../plat_sysfs_cfg/cfg_file_name | 4 + .../m2-w6510-48v8c/setup.py | 39 + src/sonic-device-data/tests/permitted_list | 4 + 249 files changed, 79250 insertions(+), 1 deletion(-) create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/hwsku.json create mode 100755 device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/port_config.ini create mode 100755 device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/sai.profile create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/td3-m2-w6510-48v8c-48x25G+8x100G.config.bcm create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/custom_led.bin create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/default_sku create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/dev.xml create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/dev_exhaust.xml create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/fru.py create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/hwsku.json create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/installer.conf create mode 100755 device/micas/x86_64-micas_m2-w6510-48v8c-r0/led_proc_init.soc create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/media_settings.json create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/monitor.py create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/pcie.yaml create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform.json create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform_asic create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform_components.json create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/plugins/sfputil.py create mode 100755 device/micas/x86_64-micas_m2-w6510-48v8c-r0/plugins/ssd_util.py create mode 100644 device/micas/x86_64-micas_m2-w6510-48v8c-r0/pmon_daemon_control.json create mode 100755 device/micas/x86_64-micas_m2-w6510-48v8c-r0/system_health_monitoring_config.json create mode 100644 platform/broadcom/platform-modules-micas.dep create mode 100644 platform/broadcom/platform-modules-micas.mk create mode 100644 platform/broadcom/sonic-platform-modules-micas/LICENSE create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_debug.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_utest.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_utest.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/Rules.mk create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/fw_upgrade.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/fw_upgrade_debug.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/include/fw_upgrade.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/include/fw_upgrade_debug.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/hysteresis.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/openloop.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/pid.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/cust_fru.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/fantlv.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/fru.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/onietlv.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/baseutil.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/chassisbase.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/component.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/cpld.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/cpu.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/dcdc.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/devicebase.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/fan.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/interface.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/led.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/onie_e2.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/osutil.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/psu.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/rotor.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/sensor.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/temp.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/lib/restful_util/__init__.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/lib/restful_util/restful_api.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/baseutil.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/smbus.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modprobe_conf/kernel_drivers_blacklist.conf create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/COPYING create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/GPL-2.0 create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/fpga_i2c.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/hw_test.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/hw_test.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_csu550.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_algo_bit.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_gpio.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_gpio_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_i801.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_ismt.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca954x.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca954x.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca9641.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca9641.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_ina3221.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_isl68137.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_lm75.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_lm75.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_pmbus.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_pmbus_core.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_tmp401.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_tps53622.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_ucd9000.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_xdpe12284.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_xdpe132g5c_pmbus.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/core.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_gpio_c3000.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_gpio_c3000_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_pinctrl_intel.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_pinctrl_intel.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_adapter.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_file.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_info.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_listnode.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_fan_driver.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_module.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_psu_driver.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_sensors_driver.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_sff_driver.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_slot_driver.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_adapter.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_file.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_info.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_listnode.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_fan_driver.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_module.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_psu_driver.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_sensors_driver.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_sff_driver.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_slot_driver.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/include/plat_switch.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/include/sysfs_common.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_fan.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_psu.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_sensor.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_sff.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_slot.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_switch.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/platform_common.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/platform_common_module.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_i2c_bus_drv.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_pca954x_drv.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_pcie.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_gpio_d1500.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_gpio_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_dev.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_dev.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_ocores.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_ocores.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_io_dev.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_io_dev.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_lpc_drv.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_lpc_drv.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_mac_bsc.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_mdio_gpio_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_pcie_dev.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_pcie_dev.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_platform_i2c_dev.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_platform_i2c_dev.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_dev.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_dev.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_gpio_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_ocores.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_ocores.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_uio_irq.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_wdt.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_wdt.h create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/modules/wb_xdpe132g5c.c create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/auto_update.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/avscontrol.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/dev_monitor.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/drv_update.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/generate_airflow.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/hal_fanctrl.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/hal_ledctrl.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/hal_pltfm.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/intelligent_monitor.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/intelligent_monitor/monitor_fan.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_common.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_config.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_driver.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_e2.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_intf.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_ipmi.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_manufacturer.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_process.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_sensors.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_test.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/platform_util.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/pmon_syslog.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/reboot_cause.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/reboot_ctrl.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/sensors create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/set_eth_mac.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/sfp_highest_temperatue.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/slot_monitor.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/ssdmon create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/subnetwork.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/tty_console.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/upgrade.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/common/script/warm_upgrade.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/service/platform_driver.service create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/service/platform_process.service create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/service/subnetwork.service create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/chassis.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/component.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/dcdc.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/eeprom.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/fan.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/fan_drawer.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/pcie.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/platform.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/psu.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/sfp.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/thermal.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/watchdog.py create mode 100644 platform/broadcom/sonic-platform-modules-micas/debian/changelog create mode 100644 platform/broadcom/sonic-platform-modules-micas/debian/compat create mode 100644 platform/broadcom/sonic-platform-modules-micas/debian/control create mode 100644 platform/broadcom/sonic-platform-modules-micas/debian/copyright create mode 100644 platform/broadcom/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6510-48v8c.install create mode 100644 platform/broadcom/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6510-48v8c.postinst create mode 100644 platform/broadcom/sonic-platform-modules-micas/debian/rule.mk create mode 100755 platform/broadcom/sonic-platform-modules-micas/debian/rules create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/Makefile create mode 100755 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/config/x86_64_micas_m2_w6510_48v8c_r0_config.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/config/x86_64_micas_m2_w6510_48v8c_r0_port_config.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_device.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_exhaust_device.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_monitor.py create mode 100755 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_dev_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_mux_pca954x_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_ocores_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_io_dev_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_lpc_drv_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_pcie_dev_device.c create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_CPLD.cfg create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_FAN.cfg create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_PSU.cfg create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_SFF.cfg create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/cfg_file_name create mode 100644 platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/setup.py diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/hwsku.json b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/hwsku.json new file mode 100644 index 000000000000..9a5a4d2b6420 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/hwsku.json @@ -0,0 +1,172 @@ +{ + "interfaces": { + "Ethernet1": { + "default_brkout_mode": "1x25G" + }, + "Ethernet2": { + "default_brkout_mode": "1x25G" + }, + "Ethernet3": { + "default_brkout_mode": "1x25G" + }, + "Ethernet4": { + "default_brkout_mode": "1x25G" + }, + "Ethernet5": { + "default_brkout_mode": "1x25G" + }, + "Ethernet6": { + "default_brkout_mode": "1x25G" + }, + "Ethernet7": { + "default_brkout_mode": "1x25G" + }, + "Ethernet8": { + "default_brkout_mode": "1x25G" + }, + "Ethernet9": { + "default_brkout_mode": "1x25G" + }, + "Ethernet10": { + "default_brkout_mode": "1x25G" + }, + "Ethernet11": { + "default_brkout_mode": "1x25G" + }, + "Ethernet12": { + "default_brkout_mode": "1x25G" + }, + "Ethernet13": { + "default_brkout_mode": "1x25G" + }, + "Ethernet14": { + "default_brkout_mode": "1x25G" + }, + "Ethernet15": { + "default_brkout_mode": "1x25G" + }, + "Ethernet16": { + "default_brkout_mode": "1x25G" + }, + "Ethernet17": { + "default_brkout_mode": "1x25G" + }, + "Ethernet18": { + "default_brkout_mode": "1x25G" + }, + "Ethernet19": { + "default_brkout_mode": "1x25G" + }, + "Ethernet20": { + "default_brkout_mode": "1x25G" + }, + "Ethernet21": { + "default_brkout_mode": "1x25G" + }, + "Ethernet22": { + "default_brkout_mode": "1x25G" + }, + "Ethernet23": { + "default_brkout_mode": "1x25G" + }, + "Ethernet24": { + "default_brkout_mode": "1x25G" + }, + "Ethernet25": { + "default_brkout_mode": "1x25G" + }, + "Ethernet26": { + "default_brkout_mode": "1x25G" + }, + "Ethernet27": { + "default_brkout_mode": "1x25G" + }, + "Ethernet28": { + "default_brkout_mode": "1x25G" + }, + "Ethernet29": { + "default_brkout_mode": "1x25G" + }, + "Ethernet30": { + "default_brkout_mode": "1x25G" + }, + "Ethernet31": { + "default_brkout_mode": "1x25G" + }, + "Ethernet32": { + "default_brkout_mode": "1x25G" + }, + "Ethernet33": { + "default_brkout_mode": "1x25G" + }, + "Ethernet34": { + "default_brkout_mode": "1x25G" + }, + "Ethernet35": { + "default_brkout_mode": "1x25G" + }, + "Ethernet36": { + "default_brkout_mode": "1x25G" + }, + "Ethernet37": { + "default_brkout_mode": "1x25G" + }, + "Ethernet38": { + "default_brkout_mode": "1x25G" + }, + "Ethernet39": { + "default_brkout_mode": "1x25G" + }, + "Ethernet40": { + "default_brkout_mode": "1x25G" + }, + "Ethernet41": { + "default_brkout_mode": "1x25G" + }, + "Ethernet42": { + "default_brkout_mode": "1x25G" + }, + "Ethernet43": { + "default_brkout_mode": "1x25G" + }, + "Ethernet44": { + "default_brkout_mode": "1x25G" + }, + "Ethernet45": { + "default_brkout_mode": "1x25G" + }, + "Ethernet46": { + "default_brkout_mode": "1x25G" + }, + "Ethernet47": { + "default_brkout_mode": "1x25G" + }, + "Ethernet48": { + "default_brkout_mode": "1x25G" + }, + "Ethernet49": { + "default_brkout_mode": "1x100G" + }, + "Ethernet53": { + "default_brkout_mode": "1x100G" + }, + "Ethernet57": { + "default_brkout_mode": "1x100G" + }, + "Ethernet61": { + "default_brkout_mode": "1x100G" + }, + "Ethernet65": { + "default_brkout_mode": "1x100G" + }, + "Ethernet69": { + "default_brkout_mode": "1x100G" + }, + "Ethernet73": { + "default_brkout_mode": "1x100G" + }, + "Ethernet77": { + "default_brkout_mode": "1x100G" + } + } +} \ No newline at end of file diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/port_config.ini b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/port_config.ini new file mode 100755 index 000000000000..57d6132aac04 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/port_config.ini @@ -0,0 +1,57 @@ +# name lanes alias index speed admin_status +Ethernet1 57 twentyfiveGigE0/1 1 25000 up +Ethernet2 58 twentyfiveGigE0/2 2 25000 up +Ethernet3 59 twentyfiveGigE0/3 3 25000 up +Ethernet4 60 twentyfiveGigE0/4 4 25000 up +Ethernet5 61 twentyfiveGigE0/5 5 25000 up +Ethernet6 62 twentyfiveGigE0/6 6 25000 up +Ethernet7 63 twentyfiveGigE0/7 7 25000 up +Ethernet8 64 twentyfiveGigE0/8 8 25000 up +Ethernet9 1 twentyfiveGigE0/9 9 25000 up +Ethernet10 2 twentyfiveGigE0/10 10 25000 up +Ethernet11 3 twentyfiveGigE0/11 11 25000 up +Ethernet12 4 twentyfiveGigE0/12 12 25000 up +Ethernet13 5 twentyfiveGigE0/13 13 25000 up +Ethernet14 6 twentyfiveGigE0/14 14 25000 up +Ethernet15 7 twentyfiveGigE0/15 15 25000 up +Ethernet16 8 twentyfiveGigE0/16 16 25000 up +Ethernet17 13 twentyfiveGigE0/17 17 25000 up +Ethernet18 14 twentyfiveGigE0/18 18 25000 up +Ethernet19 15 twentyfiveGigE0/19 19 25000 up +Ethernet20 16 twentyfiveGigE0/20 20 25000 up +Ethernet21 21 twentyfiveGigE0/21 21 25000 up +Ethernet22 22 twentyfiveGigE0/22 22 25000 up +Ethernet23 23 twentyfiveGigE0/23 23 25000 up +Ethernet24 24 twentyfiveGigE0/24 24 25000 up +Ethernet25 29 twentyfiveGigE0/25 25 25000 up +Ethernet26 30 twentyfiveGigE0/26 26 25000 up +Ethernet27 31 twentyfiveGigE0/27 27 25000 up +Ethernet28 32 twentyfiveGigE0/28 28 25000 up +Ethernet29 33 twentyfiveGigE0/29 29 25000 up +Ethernet30 34 twentyfiveGigE0/30 30 25000 up +Ethernet31 35 twentyfiveGigE0/31 31 25000 up +Ethernet32 36 twentyfiveGigE0/32 32 25000 up +Ethernet33 41 twentyfiveGigE0/33 33 25000 up +Ethernet34 42 twentyfiveGigE0/34 34 25000 up +Ethernet35 43 twentyfiveGigE0/35 35 25000 up +Ethernet36 44 twentyfiveGigE0/36 36 25000 up +Ethernet37 49 twentyfiveGigE0/37 37 25000 up +Ethernet38 50 twentyfiveGigE0/38 38 25000 up +Ethernet39 51 twentyfiveGigE0/39 39 25000 up +Ethernet40 52 twentyfiveGigE0/40 40 25000 up +Ethernet41 65 twentyfiveGigE0/41 41 25000 up +Ethernet42 66 twentyfiveGigE0/42 42 25000 up +Ethernet43 67 twentyfiveGigE0/43 43 25000 up +Ethernet44 68 twentyfiveGigE0/44 44 25000 up +Ethernet45 69 twentyfiveGigE0/45 45 25000 up +Ethernet46 70 twentyfiveGigE0/46 46 25000 up +Ethernet47 71 twentyfiveGigE0/47 47 25000 up +Ethernet48 72 twentyfiveGigE0/48 48 25000 up +Ethernet49 85,86,87,88 hundredGigE0/1 49 100000 up +Ethernet53 77,78,79,80 hundredGigE0/2 50 100000 up +Ethernet57 97,98,99,100 hundredGigE0/3 51 100000 up +Ethernet61 93,94,95,96 hundredGigE0/4 52 100000 up +Ethernet65 113,114,115,116 hundredGigE0/5 53 100000 up +Ethernet69 105,106,107,108 hundredGigE0/6 54 100000 up +Ethernet73 121,122,123,124 hundredGigE0/7 55 100000 up +Ethernet77 125,126,127,128 hundredGigE0/8 56 100000 up diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/sai.profile b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/sai.profile new file mode 100755 index 000000000000..9dffa1046f04 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td3-m2-w6510-48v8c-48x25G+8x100G.config.bcm diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/td3-m2-w6510-48v8c-48x25G+8x100G.config.bcm b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/td3-m2-w6510-48v8c-48x25G+8x100G.config.bcm new file mode 100644 index 000000000000..559a49f4c887 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/M2-W6510-48V8C/td3-m2-w6510-48v8c-48x25G+8x100G.config.bcm @@ -0,0 +1,605 @@ +cancun_dir=/usr/share/sonic/platform/cancun/sdk_6.5.16/ +l2_mem_entries=32768 +l3_mem_entries=16384 +l3_alpm_enable=2 +ipv6_lpm_128b_enable=0x1 +l2xmsg_mode=0 +l3_max_ecmp_mode=1 +svi_my_station_optimization=1 +sai_nbr_bcast_ifp_optimized=2 +sai_stats_support_mask=0x1 +bcm_num_cos=8 +bcm_stat_interval=2000000 +cdma_timeout_usec=3000000 +core_clock_frequency=1525 +dpp_clock_ratio=2:3 +help_cli_enable=1 +ifp_inports_support_enable=1 +#lpm_scaling_enable=1 +max_vp_lags=0 +mem_cache_enable=0 +memlist_enable=1 +miim_intr_enable=0 +module_64ports=1 +oversubscribe_mode=1 +oversubscribe_mixed_sister_25_50_enable=1 +parity_enable=1 +parity_correction=1 +pbmp_gport_stack.0=0x0000000000000000000000000000000000000000000000000000000000000000 +#pbmp_xport_xe.0=0x00000000000000000000000000000000888ffffffffffff9fffffffffffffffe +pbmp_xport_xe=0xffffffffffffffffffffffffffffffffffffffffe +port_flex_enable=1 +phy_chain_tx_lane_map_physical{57.0}=0x0123 +phy_chain_tx_lane_map_physical{61.0}=0x0123 +phy_chain_tx_lane_map_physical{1.0}=0x0123 +phy_chain_tx_lane_map_physical{5.0}=0x0123 +phy_chain_tx_lane_map_physical{13.0}=0x0123 +phy_chain_tx_lane_map_physical{21.0}=0x0123 +phy_chain_tx_lane_map_physical{29.0}=0x0123 +phy_chain_tx_lane_map_physical{33.0}=0x0123 +phy_chain_tx_lane_map_physical{41.0}=0x0123 +phy_chain_tx_lane_map_physical{49.0}=0x0123 +phy_chain_tx_lane_map_physical{65.0}=0x3210 +phy_chain_tx_lane_map_physical{69.0}=0x3210 +phy_chain_tx_lane_map_physical{85.0}=0x3210 +phy_chain_tx_lane_map_physical{77.0}=0x0213 +phy_chain_tx_lane_map_physical{97.0}=0x3210 +phy_chain_tx_lane_map_physical{93.0}=0x0213 +phy_chain_tx_lane_map_physical{113.0}=0x3210 +phy_chain_tx_lane_map_physical{105.0}=0x0213 +phy_chain_tx_lane_map_physical{121.0}=0x3120 +phy_chain_tx_lane_map_physical{125.0}=0x1203 + +phy_chain_rx_lane_map_physical{57.0}=0x1032 +phy_chain_rx_lane_map_physical{61.0}=0x1032 +phy_chain_rx_lane_map_physical{1.0}=0x1032 +phy_chain_rx_lane_map_physical{5.0}=0x1032 +phy_chain_rx_lane_map_physical{13.0}=0x1032 +phy_chain_rx_lane_map_physical{21.0}=0x1032 +phy_chain_rx_lane_map_physical{29.0}=0x1032 +phy_chain_rx_lane_map_physical{33.0}=0x1032 +phy_chain_rx_lane_map_physical{41.0}=0x1032 +phy_chain_rx_lane_map_physical{49.0}=0x1032 +phy_chain_rx_lane_map_physical{65.0}=0x2301 +phy_chain_rx_lane_map_physical{69.0}=0x2301 +phy_chain_rx_lane_map_physical{85.0}=0x1032 +phy_chain_rx_lane_map_physical{77.0}=0x1032 +phy_chain_rx_lane_map_physical{97.0}=0x1032 +phy_chain_rx_lane_map_physical{93.0}=0x1032 +phy_chain_rx_lane_map_physical{113.0}=0x1032 +phy_chain_rx_lane_map_physical{105.0}=0x1032 +phy_chain_rx_lane_map_physical{121.0}=0x2031 +phy_chain_rx_lane_map_physical{125.0}=0x1023 + +portmap_57=57:25 +portmap_58=58:25 +portmap_59=59:25 +portmap_60=60:25 +portmap_61=61:25 +portmap_62=62:25 +portmap_63=63:25 +portmap_64=64:25 +portmap_1=1:25 +portmap_2=2:25 +portmap_3=3:25 +portmap_4=4:25 +portmap_5=5:25 +portmap_6=6:25 +portmap_7=7:25 +portmap_8=8:25 +portmap_13=13:25 +portmap_14=14:25 +portmap_15=15:25 +portmap_16=16:25 +portmap_21=21:25 +portmap_22=22:25 +portmap_23=23:25 +portmap_24=24:25 +portmap_29=29:25 +portmap_30=30:25 +portmap_31=31:25 +portmap_32=32:25 +portmap_33=33:25 +portmap_34=34:25 +portmap_35=35:25 +portmap_36=36:25 +portmap_41=41:25 +portmap_42=42:25 +portmap_43=43:25 +portmap_44=44:25 +portmap_49=49:25 +portmap_50=50:25 +portmap_51=51:25 +portmap_52=52:25 +portmap_67=65:25 +portmap_68=66:25 +portmap_69=67:25 +portmap_70=68:25 +portmap_71=69:25 +portmap_72=70:25 +portmap_73=71:25 +portmap_74=72:25 +portmap_87=85:100 +portmap_79=77:100 +portmap_99=97:100 +portmap_95=93:100 +portmap_115=113:100 +portmap_107=105:100 +portmap_123=121:100 +portmap_127=125:100 + +dport_map_port_57=1 +dport_map_port_58=2 +dport_map_port_59=3 +dport_map_port_60=4 +dport_map_port_61=5 +dport_map_port_62=6 +dport_map_port_63=7 +dport_map_port_64=8 +dport_map_port_1=9 +dport_map_port_2=10 +dport_map_port_3=11 +dport_map_port_4=12 +dport_map_port_5=13 +dport_map_port_6=14 +dport_map_port_7=15 +dport_map_port_8=16 +dport_map_port_13=17 +dport_map_port_14=18 +dport_map_port_15=19 +dport_map_port_16=20 +dport_map_port_21=21 +dport_map_port_22=22 +dport_map_port_23=23 +dport_map_port_24=24 +dport_map_port_29=25 +dport_map_port_30=26 +dport_map_port_31=27 +dport_map_port_32=28 +dport_map_port_33=29 +dport_map_port_34=30 +dport_map_port_35=31 +dport_map_port_36=32 +dport_map_port_41=33 +dport_map_port_42=34 +dport_map_port_43=35 +dport_map_port_44=36 +dport_map_port_49=37 +dport_map_port_50=38 +dport_map_port_51=39 +dport_map_port_52=40 +dport_map_port_67=41 +dport_map_port_68=42 +dport_map_port_69=43 +dport_map_port_70=44 +dport_map_port_71=45 +dport_map_port_72=46 +dport_map_port_73=47 +dport_map_port_74=48 +dport_map_port_87=49 +dport_map_port_79=50 +dport_map_port_99=51 +dport_map_port_95=52 +dport_map_port_115=53 +dport_map_port_107=54 +dport_map_port_123=55 +dport_map_port_127=56 + +phy_chain_tx_polarity_flip_physical{57.0}=0x1 +phy_chain_tx_polarity_flip_physical{58.0}=0x0 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x0 +phy_chain_tx_polarity_flip_physical{61.0}=0x1 +phy_chain_tx_polarity_flip_physical{62.0}=0x0 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x0 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{2.0}=0x0 +phy_chain_tx_polarity_flip_physical{3.0}=0x0 +phy_chain_tx_polarity_flip_physical{4.0}=0x0 +phy_chain_tx_polarity_flip_physical{5.0}=0x0 +phy_chain_tx_polarity_flip_physical{6.0}=0x0 +phy_chain_tx_polarity_flip_physical{7.0}=0x0 +phy_chain_tx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{14.0}=0x0 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x0 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x0 +phy_chain_tx_polarity_flip_physical{30.0}=0x0 +phy_chain_tx_polarity_flip_physical{31.0}=0x0 +phy_chain_tx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x0 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x0 +phy_chain_tx_polarity_flip_physical{44.0}=0x0 +phy_chain_tx_polarity_flip_physical{49.0}=0x0 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x0 +phy_chain_tx_polarity_flip_physical{65.0}=0x0 +phy_chain_tx_polarity_flip_physical{66.0}=0x0 +phy_chain_tx_polarity_flip_physical{67.0}=0x0 +phy_chain_tx_polarity_flip_physical{68.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x0 +phy_chain_tx_polarity_flip_physical{70.0}=0x0 +phy_chain_tx_polarity_flip_physical{71.0}=0x0 +phy_chain_tx_polarity_flip_physical{72.0}=0x0 +phy_chain_tx_polarity_flip_physical{85.0}=0x0 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x1 +phy_chain_tx_polarity_flip_physical{88.0}=0x0 +phy_chain_tx_polarity_flip_physical{77.0}=0x1 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{80.0}=0x0 +phy_chain_tx_polarity_flip_physical{97.0}=0x0 +phy_chain_tx_polarity_flip_physical{98.0}=0x0 +phy_chain_tx_polarity_flip_physical{99.0}=0x1 +phy_chain_tx_polarity_flip_physical{100.0}=0x0 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x1 +phy_chain_tx_polarity_flip_physical{95.0}=0x1 +phy_chain_tx_polarity_flip_physical{96.0}=0x0 +phy_chain_tx_polarity_flip_physical{113.0}=0x0 +phy_chain_tx_polarity_flip_physical{114.0}=0x0 +phy_chain_tx_polarity_flip_physical{115.0}=0x1 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x0 +phy_chain_tx_polarity_flip_physical{106.0}=0x1 +phy_chain_tx_polarity_flip_physical{107.0}=0x1 +phy_chain_tx_polarity_flip_physical{108.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x1 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x1 +phy_chain_tx_polarity_flip_physical{124.0}=0x0 +phy_chain_tx_polarity_flip_physical{125.0}=0x1 +phy_chain_tx_polarity_flip_physical{126.0}=0x0 +phy_chain_tx_polarity_flip_physical{127.0}=0x1 +phy_chain_tx_polarity_flip_physical{128.0}=0x1 + +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x0 +phy_chain_rx_polarity_flip_physical{61.0}=0x1 +phy_chain_rx_polarity_flip_physical{62.0}=0x1 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x1 +phy_chain_rx_polarity_flip_physical{1.0}=0x1 +phy_chain_rx_polarity_flip_physical{2.0}=0x1 +phy_chain_rx_polarity_flip_physical{3.0}=0x1 +phy_chain_rx_polarity_flip_physical{4.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x0 +phy_chain_rx_polarity_flip_physical{6.0}=0x0 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{8.0}=0x0 +phy_chain_rx_polarity_flip_physical{13.0}=0x0 +phy_chain_rx_polarity_flip_physical{14.0}=0x0 +phy_chain_rx_polarity_flip_physical{15.0}=0x0 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{22.0}=0x0 +phy_chain_rx_polarity_flip_physical{23.0}=0x0 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{30.0}=0x1 +phy_chain_rx_polarity_flip_physical{31.0}=0x0 +phy_chain_rx_polarity_flip_physical{32.0}=0x0 +phy_chain_rx_polarity_flip_physical{33.0}=0x1 +phy_chain_rx_polarity_flip_physical{34.0}=0x1 +phy_chain_rx_polarity_flip_physical{35.0}=0x1 +phy_chain_rx_polarity_flip_physical{36.0}=0x1 +phy_chain_rx_polarity_flip_physical{41.0}=0x1 +phy_chain_rx_polarity_flip_physical{42.0}=0x1 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_polarity_flip_physical{49.0}=0x1 +phy_chain_rx_polarity_flip_physical{50.0}=0x1 +phy_chain_rx_polarity_flip_physical{51.0}=0x1 +phy_chain_rx_polarity_flip_physical{52.0}=0x1 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x1 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x0 +phy_chain_rx_polarity_flip_physical{72.0}=0x0 +phy_chain_rx_polarity_flip_physical{85.0}=0x1 +phy_chain_rx_polarity_flip_physical{86.0}=0x1 +phy_chain_rx_polarity_flip_physical{87.0}=0x1 +phy_chain_rx_polarity_flip_physical{88.0}=0x1 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x0 +phy_chain_rx_polarity_flip_physical{79.0}=0x0 +phy_chain_rx_polarity_flip_physical{80.0}=0x0 +phy_chain_rx_polarity_flip_physical{97.0}=0x0 +phy_chain_rx_polarity_flip_physical{98.0}=0x0 +phy_chain_rx_polarity_flip_physical{99.0}=0x0 +phy_chain_rx_polarity_flip_physical{100.0}=0x0 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x0 +phy_chain_rx_polarity_flip_physical{95.0}=0x0 +phy_chain_rx_polarity_flip_physical{96.0}=0x0 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x1 +phy_chain_rx_polarity_flip_physical{115.0}=0x1 +phy_chain_rx_polarity_flip_physical{116.0}=0x1 +phy_chain_rx_polarity_flip_physical{105.0}=0x0 +phy_chain_rx_polarity_flip_physical{106.0}=0x0 +phy_chain_rx_polarity_flip_physical{107.0}=0x0 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x1 +phy_chain_rx_polarity_flip_physical{123.0}=0x0 +phy_chain_rx_polarity_flip_physical{124.0}=0x1 +phy_chain_rx_polarity_flip_physical{125.0}=0x1 +phy_chain_rx_polarity_flip_physical{126.0}=0x0 +phy_chain_rx_polarity_flip_physical{127.0}=0x0 +phy_chain_rx_polarity_flip_physical{128.0}=0x0 + +serdes_preemphasis_lane0_57=0x0f480d +serdes_preemphasis_lane1_57=0x0f480d +serdes_preemphasis_lane2_57=0x0f480d +serdes_preemphasis_lane3_57=0x0f480d +serdes_preemphasis_lane0_58=0x0f480d +serdes_preemphasis_lane1_58=0x0f480d +serdes_preemphasis_lane2_58=0x0f480d +serdes_preemphasis_lane3_58=0x0f480d +serdes_preemphasis_lane0_59=0x0f480d +serdes_preemphasis_lane1_59=0x0f480d +serdes_preemphasis_lane2_59=0x0f480d +serdes_preemphasis_lane3_59=0x0f480d +serdes_preemphasis_lane0_60=0x0f480d +serdes_preemphasis_lane1_60=0x0f480d +serdes_preemphasis_lane2_60=0x0f480d +serdes_preemphasis_lane3_60=0x0f480d +serdes_preemphasis_lane0_61=0x0f480d +serdes_preemphasis_lane1_61=0x0f480d +serdes_preemphasis_lane2_61=0x0f480d +serdes_preemphasis_lane3_61=0x0f480d +serdes_preemphasis_lane0_62=0x0f480d +serdes_preemphasis_lane1_62=0x0f480d +serdes_preemphasis_lane2_62=0x0f480d +serdes_preemphasis_lane3_62=0x0f480d +serdes_preemphasis_lane0_63=0x0f480d +serdes_preemphasis_lane1_63=0x0f480d +serdes_preemphasis_lane2_63=0x0f480d +serdes_preemphasis_lane3_63=0x0f480d +serdes_preemphasis_lane0_64=0x0f480d +serdes_preemphasis_lane1_64=0x0f480d +serdes_preemphasis_lane2_64=0x0f480d +serdes_preemphasis_lane3_64=0x0f480d +serdes_preemphasis_lane0_1=0x0f480d +serdes_preemphasis_lane1_1=0x0f480d +serdes_preemphasis_lane2_1=0x0f480d +serdes_preemphasis_lane3_1=0x0f480d +serdes_preemphasis_lane0_2=0x0d4b0c +serdes_preemphasis_lane1_2=0x0d4b0c +serdes_preemphasis_lane2_2=0x0d4b0c +serdes_preemphasis_lane3_2=0x0d4b0c +serdes_preemphasis_lane0_3=0x0f480d +serdes_preemphasis_lane1_3=0x0f480d +serdes_preemphasis_lane2_3=0x0f480d +serdes_preemphasis_lane3_3=0x0f480d +serdes_preemphasis_lane0_4=0x0d4b0c +serdes_preemphasis_lane1_4=0x0d4b0c +serdes_preemphasis_lane2_4=0x0d4b0c +serdes_preemphasis_lane3_4=0x0d4b0c +serdes_preemphasis_lane0_5=0x0f480d +serdes_preemphasis_lane1_5=0x0f480d +serdes_preemphasis_lane2_5=0x0f480d +serdes_preemphasis_lane3_5=0x0f480d +serdes_preemphasis_lane0_6=0x0d4b0c +serdes_preemphasis_lane1_6=0x0d4b0c +serdes_preemphasis_lane2_6=0x0d4b0c +serdes_preemphasis_lane3_6=0x0d4b0c +serdes_preemphasis_lane0_7=0x0f480d +serdes_preemphasis_lane1_7=0x0f480d +serdes_preemphasis_lane2_7=0x0f480d +serdes_preemphasis_lane3_7=0x0f480d +serdes_preemphasis_lane0_8=0x0d4b0c +serdes_preemphasis_lane1_8=0x0d4b0c +serdes_preemphasis_lane2_8=0x0d4b0c +serdes_preemphasis_lane3_8=0x0d4b0c +serdes_preemphasis_lane0_13=0x0f480d +serdes_preemphasis_lane1_13=0x0f480d +serdes_preemphasis_lane2_13=0x0f480d +serdes_preemphasis_lane3_13=0x0f480d +serdes_preemphasis_lane0_14=0x0d4b0c +serdes_preemphasis_lane1_14=0x0d4b0c +serdes_preemphasis_lane2_14=0x0d4b0c +serdes_preemphasis_lane3_14=0x0d4b0c +serdes_preemphasis_lane0_15=0x0f480d +serdes_preemphasis_lane1_15=0x0f480d +serdes_preemphasis_lane2_15=0x0f480d +serdes_preemphasis_lane3_15=0x0f480d +serdes_preemphasis_lane0_16=0x0d4b0c +serdes_preemphasis_lane1_16=0x0d4b0c +serdes_preemphasis_lane2_16=0x0d4b0c +serdes_preemphasis_lane3_16=0x0d4b0c +serdes_preemphasis_lane0_21=0x0d4b0c +serdes_preemphasis_lane1_21=0x0d4b0c +serdes_preemphasis_lane2_21=0x0d4b0c +serdes_preemphasis_lane3_21=0x0d4b0c +serdes_preemphasis_lane0_22=0x0d4b0c +serdes_preemphasis_lane1_22=0x0d4b0c +serdes_preemphasis_lane2_22=0x0d4b0c +serdes_preemphasis_lane3_22=0x0d4b0c +serdes_preemphasis_lane0_23=0x0d4b0c +serdes_preemphasis_lane1_23=0x0d4b0c +serdes_preemphasis_lane2_23=0x0d4b0c +serdes_preemphasis_lane3_23=0x0d4b0c +serdes_preemphasis_lane0_24=0x0d4b0c +serdes_preemphasis_lane1_24=0x0d4b0c +serdes_preemphasis_lane2_24=0x0d4b0c +serdes_preemphasis_lane3_24=0x0d4b0c +serdes_preemphasis_lane0_29=0x0d4b0c +serdes_preemphasis_lane1_29=0x0d4b0c +serdes_preemphasis_lane2_29=0x0d4b0c +serdes_preemphasis_lane3_29=0x0d4b0c +serdes_preemphasis_lane0_30=0x0d4b0c +serdes_preemphasis_lane1_30=0x0d4b0c +serdes_preemphasis_lane2_30=0x0d4b0c +serdes_preemphasis_lane3_30=0x0d4b0c +serdes_preemphasis_lane0_31=0x0d4b0c +serdes_preemphasis_lane1_31=0x0d4b0c +serdes_preemphasis_lane2_31=0x0d4b0c +serdes_preemphasis_lane3_31=0x0d4b0c +serdes_preemphasis_lane0_32=0x0d4b0c +serdes_preemphasis_lane1_32=0x0d4b0c +serdes_preemphasis_lane2_32=0x0d4b0c +serdes_preemphasis_lane3_32=0x0d4b0c +serdes_preemphasis_lane0_33=0x0d4b0c +serdes_preemphasis_lane1_33=0x0d4b0c +serdes_preemphasis_lane2_33=0x0d4b0c +serdes_preemphasis_lane3_33=0x0d4b0c +serdes_preemphasis_lane0_34=0x0d4b0c +serdes_preemphasis_lane1_34=0x0d4b0c +serdes_preemphasis_lane2_34=0x0d4b0c +serdes_preemphasis_lane3_34=0x0d4b0c +serdes_preemphasis_lane0_35=0x0d4b0c +serdes_preemphasis_lane1_35=0x0d4b0c +serdes_preemphasis_lane2_35=0x0d4b0c +serdes_preemphasis_lane3_35=0x0d4b0c +serdes_preemphasis_lane0_36=0x0d4b0c +serdes_preemphasis_lane1_36=0x0d4b0c +serdes_preemphasis_lane2_36=0x0d4b0c +serdes_preemphasis_lane3_36=0x0d4b0c +serdes_preemphasis_lane0_41=0x0d4b0c +serdes_preemphasis_lane1_41=0x0d4b0c +serdes_preemphasis_lane2_41=0x0d4b0c +serdes_preemphasis_lane3_41=0x0d4b0c +serdes_preemphasis_lane0_42=0x0d4b0c +serdes_preemphasis_lane1_42=0x0d4b0c +serdes_preemphasis_lane2_42=0x0d4b0c +serdes_preemphasis_lane3_42=0x0d4b0c +serdes_preemphasis_lane0_43=0x0d4b0c +serdes_preemphasis_lane1_43=0x0d4b0c +serdes_preemphasis_lane2_43=0x0d4b0c +serdes_preemphasis_lane3_43=0x0d4b0c +serdes_preemphasis_lane0_44=0x0d4b0c +serdes_preemphasis_lane1_44=0x0d4b0c +serdes_preemphasis_lane2_44=0x0d4b0c +serdes_preemphasis_lane3_44=0x0d4b0c +serdes_preemphasis_lane0_49=0x0f480d +serdes_preemphasis_lane1_49=0x0f480d +serdes_preemphasis_lane2_49=0x0f480d +serdes_preemphasis_lane3_49=0x0f480d +serdes_preemphasis_lane0_50=0x0d4b0c +serdes_preemphasis_lane1_50=0x0d4b0c +serdes_preemphasis_lane2_50=0x0d4b0c +serdes_preemphasis_lane3_50=0x0d4b0c +serdes_preemphasis_lane0_51=0x0f480d +serdes_preemphasis_lane1_51=0x0f480d +serdes_preemphasis_lane2_51=0x0f480d +serdes_preemphasis_lane3_51=0x0f480d +serdes_preemphasis_lane0_52=0x0d4b0c +serdes_preemphasis_lane1_52=0x0d4b0c +serdes_preemphasis_lane2_52=0x0d4b0c +serdes_preemphasis_lane3_52=0x0d4b0c +serdes_preemphasis_lane0_67=0x0d4b0c +serdes_preemphasis_lane1_67=0x0d4b0c +serdes_preemphasis_lane2_67=0x0d4b0c +serdes_preemphasis_lane3_67=0x0d4b0c +serdes_preemphasis_lane0_68=0x0d4b0c +serdes_preemphasis_lane1_68=0x0d4b0c +serdes_preemphasis_lane2_68=0x0d4b0c +serdes_preemphasis_lane3_68=0x0d4b0c +serdes_preemphasis_lane0_69=0x0d4b0c +serdes_preemphasis_lane1_69=0x0d4b0c +serdes_preemphasis_lane2_69=0x0d4b0c +serdes_preemphasis_lane3_69=0x0d4b0c +serdes_preemphasis_lane0_70=0x0d4b0c +serdes_preemphasis_lane1_70=0x0d4b0c +serdes_preemphasis_lane2_70=0x0d4b0c +serdes_preemphasis_lane3_70=0x0d4b0c +serdes_preemphasis_lane0_71=0x0d4b0c +serdes_preemphasis_lane1_71=0x0d4b0c +serdes_preemphasis_lane2_71=0x0d4b0c +serdes_preemphasis_lane3_71=0x0d4b0c +serdes_preemphasis_lane0_72=0x0d4b0c +serdes_preemphasis_lane1_72=0x0d4b0c +serdes_preemphasis_lane2_72=0x0d4b0c +serdes_preemphasis_lane3_72=0x0d4b0c +serdes_preemphasis_lane0_73=0x0d4b0c +serdes_preemphasis_lane1_73=0x0d4b0c +serdes_preemphasis_lane2_73=0x0d4b0c +serdes_preemphasis_lane3_73=0x0d4b0c +serdes_preemphasis_lane0_74=0x0d4b0c +serdes_preemphasis_lane1_74=0x0d4b0c +serdes_preemphasis_lane2_74=0x0d4b0c +serdes_preemphasis_lane3_74=0x0d4b0c +serdes_preemphasis_lane0_87=0x0d4b0c +serdes_preemphasis_lane1_87=0x0d4b0c +serdes_preemphasis_lane2_87=0x0d4b0c +serdes_preemphasis_lane3_87=0x0d4b0c +serdes_preemphasis_lane0_79=0x0d4b0c +serdes_preemphasis_lane1_79=0x0d4b0c +serdes_preemphasis_lane2_79=0x0d4b0c +serdes_preemphasis_lane3_79=0x0d4b0c +serdes_preemphasis_lane0_99=0x0d4b0c +serdes_preemphasis_lane1_99=0x0d4b0c +serdes_preemphasis_lane2_99=0x0d4b0c +serdes_preemphasis_lane3_99=0x0d4b0c +serdes_preemphasis_lane0_95=0x0d4b0c +serdes_preemphasis_lane1_95=0x0d4b0c +serdes_preemphasis_lane2_95=0x0d4b0c +serdes_preemphasis_lane3_95=0x0d4b0c +serdes_preemphasis_lane0_115=0x0d4b0c +serdes_preemphasis_lane1_115=0x0d4b0c +serdes_preemphasis_lane2_115=0x0d4b0c +serdes_preemphasis_lane3_115=0x0d4b0c +serdes_preemphasis_lane0_107=0x0d4b0c +serdes_preemphasis_lane1_107=0x0d4b0c +serdes_preemphasis_lane2_107=0x0d4b0c +serdes_preemphasis_lane3_107=0x0d4b0c +serdes_preemphasis_lane0_123=0x14460a +serdes_preemphasis_lane1_123=0x14460a +serdes_preemphasis_lane2_123=0x14460a +serdes_preemphasis_lane3_123=0x14460a +serdes_preemphasis_lane0_127=0x14460a +serdes_preemphasis_lane1_127=0x14460a +serdes_preemphasis_lane2_127=0x14460a +serdes_preemphasis_lane3_127=0x14460a + + +reglist_enable=1 +scache_filename=/var/warmboot/wbscache +schan_intr_enable=0 +stable_size=0x55000000 +stable_location=3 +warmboot_knet_shutdown_mode=1 +tdma_timeout_usec=3000000 + +#vxlan flex flow mode +flow_init_mode=1 + +riot_enable=1 +riot_overlay_l3_intf_mem_size=4096 +riot_overlay_l3_egress_mem_size=32768 +riot_overlay_ecmp_resilient_hash_size=16384 + +l3_ecmp_levels=2 + +use_all_splithorizon_groups=1 +sai_tunnel_support=1 + +#This property allows to enable L2 FDB entry to discard based on Source Mac +sai_fdb_entry_l2_discard_src_enable=1 + +#RDMA +sai_pfc_defaults_disable=1 +sai_optimized_mmu=1 + +#ACL wb count +ctr_evict_enable=0 diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/custom_led.bin b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/custom_led.bin new file mode 100644 index 0000000000000000000000000000000000000000..e02f94e7ed87ffe60524721f4aec68d661880e7c GIT binary patch literal 236 zcmWN~%}N4M7=YpT%$NoC2ayV4HjWWfZN?-t`f=LVkf$CZeDzh_uF%kr>I`FYKD`eLmXf;U;{tHuD;Ze7>$f@av% zgCSlz(c*=6Vg!#wxw@UXuqvtQF#P>drO^$pZE}t_Ju@=OS5eW|Q7?+4_%^r@%5rR&XfcQvT1^* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/dev_exhaust.xml b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/dev_exhaust.xml new file mode 100644 index 000000000000..86851af90ec9 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/dev_exhaust.xml @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/fru.py b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/fru.py new file mode 100644 index 000000000000..f95164e03601 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/fru.py @@ -0,0 +1,961 @@ +#!/usr/bin/python3 +import collections +from datetime import datetime, timedelta +from bitarray import bitarray + + +__DEBUG__ = "N" + + +class FruException(Exception): + def __init__(self, message='fruerror', code=-100): + err = 'errcode: {0} message:{1}'.format(code, message) + Exception.__init__(self, err) + self.code = code + self.message = message + + +def e_print(err): + print("ERROR: " + err) + + +def d_print(debug_info): + if __DEBUG__ == "Y": + print(debug_info) + + +class FruUtil(): + @staticmethod + def decodeLength(value): + a = bitarray(8) + a.setall(True) + a[0:1] = 0 + a[1:2] = 0 + x = ord(a.tobytes()) + return x & ord(value) + + @staticmethod + def minToData(): + starttime = datetime(1996, 1, 1, 0, 0, 0) + endtime = datetime.now() + seconds = (endtime - starttime).total_seconds() + mins = seconds // 60 + m = int(round(mins)) + return m + + @staticmethod + def getTimeFormat(): + return datetime.now().strftime('%Y-%m-%d') + + @staticmethod + def getTypeLength(value): + if value is None or len(value) == 0: + return 0 + a = bitarray(8) + a.setall(False) + a[0:1] = 1 + a[1:2] = 1 + x = ord(a.tobytes()) + return x | len(value) + + @staticmethod + def checksum(b): + result = 0 + for item in b: + result += ord(item) + return (0x100 - (result & 0xff)) & 0xff + + +class BaseArea(object): + SUGGESTED_SIZE_COMMON_HEADER = 8 + SUGGESTED_SIZE_INTERNAL_USE_AREA = 72 + SUGGESTED_SIZE_CHASSIS_INFO_AREA = 32 + SUGGESTED_SIZE_BOARD_INFO_AREA = 80 + SUGGESTED_SIZE_PRODUCT_INFO_AREA = 80 + + INITVALUE = b'\x00' + resultvalue = INITVALUE * 256 + COMMON_HEAD_VERSION = b'\x01' + __childList = None + + def __init__(self, name="", size=0, offset=0): + self.__childList = [] + self._offset = offset + self.name = name + self._size = size + self._isPresent = False + self._data = b'\x00' * size + + @property + def childList(self): + return self.__childList + + @childList.setter + def childList(self, value): + self.__childList = value + + @property + def offset(self): + return self._offset + + @offset.setter + def offset(self, value): + self._offset = value + + @property + def size(self): + return self._size + + @size.setter + def size(self, value): + self._size = value + + @property + def data(self): + return self._data + + @data.setter + def data(self, value): + self._data = value + + @property + def isPresent(self): + return self._isPresent + + @isPresent.setter + def isPresent(self, value): + self._isPresent = value + + +class InternalUseArea(BaseArea): + pass + + +class ChassisInfoArea(BaseArea): + pass + + +class BoardInfoArea(BaseArea): + _boardTime = None + _fields = None + _mfg_date = None + areaversion = None + _boardversion = None + _language = None + + def __str__(self): + formatstr = "version : %x\n" \ + "length : %d \n" \ + "language : %x \n" \ + "mfg_date : %s \n" \ + "boardManufacturer : %s \n" \ + "boardProductName : %s \n" \ + "boardSerialNumber : %s \n" \ + "boardPartNumber : %s \n" \ + "fruFileId : %s \n" + + tmpstr = formatstr % (ord(self.boardversion), self.size, + self.language, self.getMfgRealData(), + self.boardManufacturer, self.boardProductName, + self.boardSerialNumber, self.boardPartNumber, + self.fruFileId) + for i in range(1, 11): + valtmp = "boardextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + tmpstr += "boardextra%d : %s \n" % (i, valtmpval) + else: + break + + return tmpstr + + def todict(self): + dic = collections.OrderedDict() + dic["boardversion"] = ord(self.boardversion) + dic["boardlength"] = self.size + dic["boardlanguage"] = self.language + dic["boardmfg_date"] = self.getMfgRealData() + dic["boardManufacturer"] = self.boardManufacturer + dic["boardProductName"] = self.boardProductName + dic["boardSerialNumber"] = self.boardSerialNumber + dic["boardPartNumber"] = self.boardPartNumber + dic["boardfruFileId"] = self.fruFileId + for i in range(1, 11): + valtmp = "boardextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + dic[valtmp] = valtmpval + else: + break + return dic + + def decodedata(self): + index = 0 + self.areaversion = self.data[index] + index += 1 + d_print("decode length :%d class size:%d" % + ((ord(self.data[index]) * 8), self.size)) + index += 2 + + timetmp = self.data[index: index + 3] + self.mfg_date = ord(timetmp[0]) | ( + ord(timetmp[1]) << 8) | (ord(timetmp[2]) << 16) + d_print("decode getMfgRealData :%s" % self.getMfgRealData()) + index += 3 + + templen = FruUtil.decodeLength(self.data[index]) + self.boardManufacturer = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardManufacturer:%s" % self.boardManufacturer) + + templen = FruUtil.decodeLength(self.data[index]) + self.boardProductName = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardProductName:%s" % self.boardProductName) + + templen = FruUtil.decodeLength(self.data[index]) + self.boardSerialNumber = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardSerialNumber:%s" % self.boardSerialNumber) + + templen = FruUtil.decodeLength(self.data[index]) + self.boardPartNumber = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardPartNumber:%s" % self.boardPartNumber) + + templen = FruUtil.decodeLength(self.data[index]) + self.fruFileId = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode fruFileId:%s" % self.fruFileId) + + for i in range(1, 11): + valtmp = "boardextra%d" % i + if self.data[index] != chr(0xc1): + templen = FruUtil.decodeLength(self.data[index]) + tmpval = self.data[index + 1: index + templen + 1] + setattr(self, valtmp, tmpval) + index += templen + 1 + d_print("decode boardextra%d:%s" % (i, tmpval)) + else: + break + + def fruSetValue(self, field, value): + tmp_field = getattr(self, field, None) + if tmp_field is not None: + setattr(self, field, value) + + def recalcute(self): + d_print("boardInfoArea version:%x" % ord(self.boardversion)) + d_print("boardInfoArea length:%d" % self.size) + d_print("boardInfoArea language:%x" % self.language) + self.mfg_date = FruUtil.minToData() + d_print("boardInfoArea mfg_date:%x" % self.mfg_date) + + self.data = chr(ord(self.boardversion)) + \ + chr(self.size // 8) + chr(self.language) + + self.data += chr(self.mfg_date & 0xFF) + self.data += chr((self.mfg_date >> 8) & 0xFF) + self.data += chr((self.mfg_date >> 16) & 0xFF) + + d_print("boardInfoArea boardManufacturer:%s" % self.boardManufacturer) + typelength = FruUtil.getTypeLength(self.boardManufacturer) + self.data += chr(typelength) + self.data += self.boardManufacturer + + d_print("boardInfoArea boardProductName:%s" % self.boardProductName) + self.data += chr(FruUtil.getTypeLength(self.boardProductName)) + self.data += self.boardProductName + + d_print("boardInfoArea boardSerialNumber:%s" % self.boardSerialNumber) + self.data += chr(FruUtil.getTypeLength(self.boardSerialNumber)) + self.data += self.boardSerialNumber + + d_print("boardInfoArea boardPartNumber:%s" % self.boardPartNumber) + self.data += chr(FruUtil.getTypeLength(self.boardPartNumber)) + self.data += self.boardPartNumber + + d_print("boardInfoArea fruFileId:%s" % self.fruFileId) + self.data += chr(FruUtil.getTypeLength(self.fruFileId)) + self.data += self.fruFileId + + for i in range(1, 11): + valtmp = "boardextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + d_print("boardInfoArea boardextra%d:%s" % (i, valtmpval)) + self.data += chr(FruUtil.getTypeLength(valtmpval)) + if valtmpval is not None: + self.data += valtmpval + else: + break + + self.data += chr(0xc1) + + if len(self.data) > (self.size - 1): + incr = (len(self.data) - self.size) // 8 + 1 + self.size += incr * 8 + + self.data = self.data[0:1] + chr(self.size // 8) + self.data[2:] + d_print("self data:%d" % len(self.data)) + d_print("self size:%d" % self.size) + d_print("adjust size:%d" % (self.size - len(self.data) - 1)) + self.data = self.data.ljust((self.size - 1), chr(self.INITVALUE[0])) + + # checksum + checksum = FruUtil.checksum(self.data) + d_print("board info checksum:%x" % checksum) + self.data += chr(checksum) + + def getMfgRealData(self): + starttime = datetime(1996, 1, 1, 0, 0, 0) + mactime = starttime + timedelta(minutes=self.mfg_date) + return mactime + + @property + def language(self): + self._language = 25 + return self._language + + @property + def mfg_date(self): + return self._mfg_date + + @mfg_date.setter + def mfg_date(self, val): + self._mfg_date = val + + @property + def boardversion(self): + self._boardversion = self.COMMON_HEAD_VERSION + return self._boardversion + + @property + def fruFileId(self): + return self._FRUFileID + + @fruFileId.setter + def fruFileId(self, val): + self._FRUFileID = val + + @property + def boardPartNumber(self): + return self._boardPartNumber + + @boardPartNumber.setter + def boardPartNumber(self, val): + self._boardPartNumber = val + + @property + def boardSerialNumber(self): + return self._boardSerialNumber + + @boardSerialNumber.setter + def boardSerialNumber(self, val): + self._boardSerialNumber = val + + @property + def boardProductName(self): + return self._boradProductName + + @boardProductName.setter + def boardProductName(self, val): + self._boradProductName = val + + @property + def boardManufacturer(self): + return self._boardManufacturer + + @boardManufacturer.setter + def boardManufacturer(self, val): + self._boardManufacturer = val + + @property + def boardTime(self): + return self._boardTime + + @boardTime.setter + def boardTime(self, val): + self._boardTime = val + + @property + def fields(self): + return self._fields + + @fields.setter + def fields(self, val): + self._fields = val + + +class ProductInfoArea(BaseArea): + _productManufacturer = None + _productAssetTag = None + _FRUFileID = None + _language = None + + def __str__(self): + formatstr = "version : %x\n" \ + "length : %d \n" \ + "language : %x \n" \ + "productManufacturer : %s \n" \ + "productName : %s \n" \ + "productPartModelName: %s \n" \ + "productVersion : %s \n" \ + "productSerialNumber : %s \n" \ + "productAssetTag : %s \n" \ + "fruFileId : %s \n" + + tmpstr = formatstr % (ord(self.areaversion), self.size, + self.language, self.productManufacturer, + self.productName, self.productPartModelName, + self.productVersion, self.productSerialNumber, + self.productAssetTag, self.fruFileId) + + for i in range(1, 11): + valtmp = "productextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + tmpstr += "productextra%d : %s \n" % (i, valtmpval) + else: + break + + return tmpstr + + def todict(self): + dic = collections.OrderedDict() + dic["productversion"] = ord(self.areaversion) + dic["productlength"] = self.size + dic["productlanguage"] = self.language + dic["productManufacturer"] = self.productManufacturer + dic["productName"] = self.productName + dic["productPartModelName"] = self.productPartModelName + dic["productVersion"] = int(self.productVersion, 16) + dic["productSerialNumber"] = self.productSerialNumber + dic["productAssetTag"] = self.productAssetTag + dic["productfruFileId"] = self.fruFileId + for i in range(1, 11): + valtmp = "productextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + dic[valtmp] = valtmpval + else: + break + return dic + + def decodedata(self): + index = 0 + self.areaversion = self.data[index] # 0 + index += 1 + d_print("decode length %d" % (ord(self.data[index]) * 8)) + d_print("class size %d" % self.size) + index += 2 + + templen = FruUtil.decodeLength(self.data[index]) + self.productManufacturer = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productManufacturer:%s" % self.productManufacturer) + + templen = FruUtil.decodeLength(self.data[index]) + self.productName = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productName:%s" % self.productName) + + templen = FruUtil.decodeLength(self.data[index]) + self.productPartModelName = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productPartModelName:%s" % self.productPartModelName) + + templen = FruUtil.decodeLength(self.data[index]) + self.productVersion = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productVersion:%s" % self.productVersion) + + templen = FruUtil.decodeLength(self.data[index]) + self.productSerialNumber = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productSerialNumber:%s" % self.productSerialNumber) + + templen = FruUtil.decodeLength(self.data[index]) + self.productAssetTag = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productAssetTag:%s" % self.productAssetTag) + + templen = FruUtil.decodeLength(self.data[index]) + self.fruFileId = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode fruFileId:%s" % self.fruFileId) + + for i in range(1, 11): + valtmp = "productextra%d" % i + if self.data[index] != chr(0xc1) and index < self.size - 1: + templen = FruUtil.decodeLength(self.data[index]) + if templen == 0: + break + tmpval = self.data[index + 1: index + templen + 1] + d_print("decode boardextra%d:%s" % (i, tmpval)) + setattr(self, valtmp, tmpval) + index += templen + 1 + else: + break + + @property + def productVersion(self): + return self._productVersion + + @productVersion.setter + def productVersion(self, name): + self._productVersion = name + + @property + def areaversion(self): + self._areaversion = self.COMMON_HEAD_VERSION + return self._areaversion + + @areaversion.setter + def areaversion(self, name): + self._areaversion = name + + @property + def language(self): + self._language = 25 + return self._language + + @property + def productManufacturer(self): + return self._productManufacturer + + @productManufacturer.setter + def productManufacturer(self, name): + self._productManufacturer = name + + @property + def productName(self): + return self._productName + + @productName.setter + def productName(self, name): + self._productName = name + + @property + def productPartModelName(self): + return self._productPartModelName + + @productPartModelName.setter + def productPartModelName(self, name): + self._productPartModelName = name + + @property + def productSerialNumber(self): + return self._productSerialNumber + + @productSerialNumber.setter + def productSerialNumber(self, name): + self._productSerialNumber = name + + @property + def productAssetTag(self): + return self._productAssetTag + + @productAssetTag.setter + def productAssetTag(self, name): + self._productAssetTag = name + + @property + def fruFileId(self): + return self._FRUFileID + + @fruFileId.setter + def fruFileId(self, name): + self._FRUFileID = name + + def fruSetValue(self, field, value): + tmp_field = getattr(self, field, None) + if tmp_field is not None: + setattr(self, field, value) + + def recalcute(self): + d_print("product version:%x" % ord(self.areaversion)) + d_print("product length:%d" % self.size) + d_print("product language:%x" % self.language) + self.data = chr(ord(self.areaversion)) + \ + chr(self.size // 8) + chr(self.language) + + typelength = FruUtil.getTypeLength(self.productManufacturer) + self.data += chr(typelength) + self.data += self.productManufacturer + + self.data += chr(FruUtil.getTypeLength(self.productName)) + self.data += self.productName + + self.data += chr(FruUtil.getTypeLength(self.productPartModelName)) + self.data += self.productPartModelName + + self.data += chr(FruUtil.getTypeLength(self.productVersion)) + self.data += self.productVersion + + self.data += chr(FruUtil.getTypeLength(self.productSerialNumber)) + self.data += self.productSerialNumber + + self.data += chr(FruUtil.getTypeLength(self.productAssetTag)) + if self.productAssetTag is not None: + self.data += self.productAssetTag + + self.data += chr(FruUtil.getTypeLength(self.fruFileId)) + self.data += self.fruFileId + + for i in range(1, 11): + valtmp = "productextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + d_print("boardInfoArea productextra%d:%s" % (i, valtmpval)) + self.data += chr(FruUtil.getTypeLength(valtmpval)) + if valtmpval is not None: + self.data += valtmpval + else: + break + + self.data += chr(0xc1) + if len(self.data) > (self.size - 1): + incr = (len(self.data) - self.size) // 8 + 1 + self.size += incr * 8 + d_print("self.data:%d" % len(self.data)) + d_print("self.size:%d" % self.size) + + self.data = self.data[0:1] + chr(self.size // 8) + self.data[2:] + self.data = self.data.ljust((self.size - 1), chr(self.INITVALUE[0])) + checksum = FruUtil.checksum(self.data) + d_print("board info checksum:%x" % checksum) + self.data += chr(checksum) + + +class MultiRecordArea(BaseArea): + pass + + +class Field(object): + + def __init__(self, fieldType="ASCII", fieldData=""): + self.fieldData = fieldData + self.fieldType = fieldType + + @property + def fieldType(self): + return self.fieldType + + @property + def fieldData(self): + return self.fieldData + + +class ipmifru(BaseArea): + _BoardInfoArea = None + _ProductInfoArea = None + _InternalUseArea = None + _ChassisInfoArea = None + _multiRecordArea = None + _productinfoAreaOffset = BaseArea.INITVALUE + _boardInfoAreaOffset = BaseArea.INITVALUE + _internalUserAreaOffset = BaseArea.INITVALUE + _chassicInfoAreaOffset = BaseArea.INITVALUE + _multiRecordAreaOffset = BaseArea.INITVALUE + _bindata = None + _bodybin = None + _version = BaseArea.COMMON_HEAD_VERSION + _zeroCheckSum = None + _frusize = 256 + + def __str__(self): + tmpstr = "" + if self.boardInfoArea.isPresent: + tmpstr += "\nboardinfoarea: \n" + tmpstr += self.boardInfoArea.__str__() + if self.productInfoArea.isPresent: + tmpstr += "\nproductinfoarea: \n" + tmpstr += self.productInfoArea.__str__() + return tmpstr + + def decodeBin(self, eeprom): + commonHead = eeprom[0:8] + d_print("decode version %x" % ord(commonHead[0])) + if ord(self.COMMON_HEAD_VERSION) != ord(commonHead[0]): + raise FruException("HEAD VERSION error,not Fru format!", -10) + if FruUtil.checksum(commonHead[0:7]) != ord(commonHead[7]): + strtemp = "check header checksum error [cal:%02x data:%02x]" % ( + FruUtil.checksum(commonHead[0:7]), ord(commonHead[7])) + raise FruException(strtemp, -3) + if ord(commonHead[1]) != ord(self.INITVALUE): + d_print("Internal Use Area is present") + self.internalUseArea = InternalUseArea( + name="Internal Use Area", size=self.SUGGESTED_SIZE_INTERNAL_USE_AREA) + self.internalUseArea.isPresent = True + self.internalUserAreaOffset = ord(commonHead[1]) + self.internalUseArea.data = eeprom[self.internalUserAreaOffset * 8: ( + self.internalUserAreaOffset * 8 + self.internalUseArea.size)] + if ord(commonHead[2]) != ord(self.INITVALUE): + d_print("Chassis Info Area is present") + self.chassisInfoArea = ChassisInfoArea( + name="Chassis Info Area", size=self.SUGGESTED_SIZE_CHASSIS_INFO_AREA) + self.chassisInfoArea.isPresent = True + self.chassicInfoAreaOffset = ord(commonHead[2]) + self.chassisInfoArea.data = eeprom[self.chassicInfoAreaOffset * 8: ( + self.chassicInfoAreaOffset * 8 + self.chassisInfoArea.size)] + if ord(commonHead[3]) != ord(self.INITVALUE): + self.boardInfoArea = BoardInfoArea( + name="Board Info Area", size=self.SUGGESTED_SIZE_BOARD_INFO_AREA) + self.boardInfoArea.isPresent = True + self.boardInfoAreaOffset = ord(commonHead[3]) + self.boardInfoArea.size = ord( + eeprom[self.boardInfoAreaOffset * 8 + 1]) * 8 + d_print("Board Info Area is present size:%d" % + (self.boardInfoArea.size)) + self.boardInfoArea.data = eeprom[self.boardInfoAreaOffset * 8: ( + self.boardInfoAreaOffset * 8 + self.boardInfoArea.size)] + if FruUtil.checksum(self.boardInfoArea.data[:-1]) != ord(self.boardInfoArea.data[-1:]): + strtmp = "check boardInfoArea checksum error[cal:%02x data:%02x]" % \ + (FruUtil.checksum( + self.boardInfoArea.data[:-1]), ord(self.boardInfoArea.data[-1:])) + raise FruException(strtmp, -3) + self.boardInfoArea.decodedata() + if ord(commonHead[4]) != ord(self.INITVALUE): + d_print("Product Info Area is present") + self.productInfoArea = ProductInfoArea( + name="Product Info Area ", size=self.SUGGESTED_SIZE_PRODUCT_INFO_AREA) + self.productInfoArea.isPresent = True + self.productinfoAreaOffset = ord(commonHead[4]) + d_print("length offset value: %02x" % + ord(eeprom[self.productinfoAreaOffset * 8 + 1])) + self.productInfoArea.size = ord( + eeprom[self.productinfoAreaOffset * 8 + 1]) * 8 + d_print("Product Info Area is present size:%d" % + (self.productInfoArea.size)) + + self.productInfoArea.data = eeprom[self.productinfoAreaOffset * 8: ( + self.productinfoAreaOffset * 8 + self.productInfoArea.size)] + if FruUtil.checksum(self.productInfoArea.data[:-1]) != ord(self.productInfoArea.data[-1:]): + strtmp = "check productInfoArea checksum error [cal:%02x data:%02x]" % ( + FruUtil.checksum(self.productInfoArea.data[:-1]), ord(self.productInfoArea.data[-1:])) + raise FruException(strtmp, -3) + self.productInfoArea.decodedata() + if ord(commonHead[5]) != ord(self.INITVALUE): + self.multiRecordArea = MultiRecordArea( + name="MultiRecord record Area ") + d_print("MultiRecord record present") + self.multiRecordArea.isPresent = True + self.multiRecordAreaOffset = ord(commonHead[5]) + self.multiRecordArea.data = eeprom[self.multiRecordAreaOffset * 8: ( + self.multiRecordAreaOffset * 8 + self.multiRecordArea.size)] + + def initDefault(self): + self.version = self.COMMON_HEAD_VERSION + self.internalUserAreaOffset = self.INITVALUE + self.chassicInfoAreaOffset = self.INITVALUE + self.boardInfoAreaOffset = self.INITVALUE + self.productinfoAreaOffset = self.INITVALUE + self.multiRecordAreaOffset = self.INITVALUE + self.zeroCheckSum = self.INITVALUE + self.offset = self.SUGGESTED_SIZE_COMMON_HEADER + self.productInfoArea = None + self.internalUseArea = None + self.boardInfoArea = None + self.chassisInfoArea = None + self.multiRecordArea = None + # self.recalcute() + + @property + def version(self): + return self._version + + @version.setter + def version(self, name): + self._version = name + + @property + def internalUserAreaOffset(self): + return self._internalUserAreaOffset + + @internalUserAreaOffset.setter + def internalUserAreaOffset(self, obj): + self._internalUserAreaOffset = obj + + @property + def chassicInfoAreaOffset(self): + return self._chassicInfoAreaOffset + + @chassicInfoAreaOffset.setter + def chassicInfoAreaOffset(self, obj): + self._chassicInfoAreaOffset = obj + + @property + def productinfoAreaOffset(self): + return self._productinfoAreaOffset + + @productinfoAreaOffset.setter + def productinfoAreaOffset(self, obj): + self._productinfoAreaOffset = obj + + @property + def boardInfoAreaOffset(self): + return self._boardInfoAreaOffset + + @boardInfoAreaOffset.setter + def boardInfoAreaOffset(self, obj): + self._boardInfoAreaOffset = obj + + @property + def multiRecordAreaOffset(self): + return self._multiRecordAreaOffset + + @multiRecordAreaOffset.setter + def multiRecordAreaOffset(self, obj): + self._multiRecordAreaOffset = obj + + @property + def zeroCheckSum(self): + return self._zeroCheckSum + + @zeroCheckSum.setter + def zeroCheckSum(self, obj): + self._zeroCheckSum = obj + + @property + def productInfoArea(self): + return self._ProductInfoArea + + @productInfoArea.setter + def productInfoArea(self, obj): + self._ProductInfoArea = obj + + @property + def internalUseArea(self): + return self._InternalUseArea + + @internalUseArea.setter + def internalUseArea(self, obj): + self.internalUseArea = obj + + @property + def boardInfoArea(self): + return self._BoardInfoArea + + @boardInfoArea.setter + def boardInfoArea(self, obj): + self._BoardInfoArea = obj + + @property + def chassisInfoArea(self): + return self._ChassisInfoArea + + @chassisInfoArea.setter + def chassisInfoArea(self, obj): + self._ChassisInfoArea = obj + + @property + def multiRecordArea(self): + return self._multiRecordArea + + @multiRecordArea.setter + def multiRecordArea(self, obj): + self._multiRecordArea = obj + + @property + def bindata(self): + return self._bindata + + @bindata.setter + def bindata(self, obj): + self._bindata = obj + + @property + def bodybin(self): + return self._bodybin + + @bodybin.setter + def bodybin(self, obj): + self._bodybin = obj + + def recalcuteCommonHead(self): + self.bindata = "" + self.offset = self.SUGGESTED_SIZE_COMMON_HEADER + d_print("common Header %d" % self.offset) + d_print("fru eeprom size %d" % self._frusize) + if self.internalUseArea is not None and self.internalUseArea.isPresent: + self.internalUserAreaOffset = self.offset // 8 + self.offset += self.internalUseArea.size + d_print("internalUseArea is present offset:%d" % self.offset) + + if self.chassisInfoArea is not None and self.chassisInfoArea.isPresent: + self.chassicInfoAreaOffset = self.offset // 8 + self.offset += self.chassisInfoArea.size + d_print("chassisInfoArea is present offset:%d" % self.offset) + + if self.boardInfoArea is not None and self.boardInfoArea.isPresent: + self.boardInfoAreaOffset = self.offset // 8 + self.offset += self.boardInfoArea.size + d_print("boardInfoArea is present offset:%d" % self.offset) + d_print("boardInfoArea is present size:%d" % + self.boardInfoArea.size) + + if self.productInfoArea is not None and self.productInfoArea.isPresent: + self.productinfoAreaOffset = self.offset // 8 + self.offset += self.productInfoArea.size + d_print("productInfoArea is present offset:%d" % self.offset) + + if self.multiRecordArea is not None and self.multiRecordArea.isPresent: + self.multiRecordAreaOffset = self.offset // 8 + d_print("multiRecordArea is present offset:%d" % self.offset) + + if self.internalUserAreaOffset == self.INITVALUE: + self.internalUserAreaOffset = 0 + if self.productinfoAreaOffset == self.INITVALUE: + self.productinfoAreaOffset = 0 + if self.chassicInfoAreaOffset == self.INITVALUE: + self.chassicInfoAreaOffset = 0 + if self.boardInfoAreaOffset == self.INITVALUE: + self.boardInfoAreaOffset = 0 + if self.multiRecordAreaOffset == self.INITVALUE: + self.multiRecordAreaOffset = 0 + + self.zeroCheckSum = (0x100 - ord(self.version) - self.internalUserAreaOffset - self.chassicInfoAreaOffset - self.productinfoAreaOffset + - self.boardInfoAreaOffset - self.multiRecordAreaOffset) & 0xff + d_print("zerochecksum:%x" % self.zeroCheckSum) + self.data = "" + self.data += chr(self.version[0]) + chr(self.internalUserAreaOffset) + chr(self.chassicInfoAreaOffset) + chr( + self.boardInfoAreaOffset) + chr(self.productinfoAreaOffset) + chr(self.multiRecordAreaOffset) + chr(self.INITVALUE[0]) + chr(self.zeroCheckSum) + + self.bindata = self.data + self.bodybin + totallen = len(self.bindata) + d_print("totallen %d" % totallen) + if totallen < self._frusize: + self.bindata = self.bindata.ljust(self._frusize, chr(self.INITVALUE[0])) + else: + raise FruException('bin data more than %d' % self._frusize, -2) + + def recalcutebin(self): + self.bodybin = "" + if self.internalUseArea is not None and self.internalUseArea.isPresent: + d_print("internalUseArea present") + self.bodybin += self.internalUseArea.data + if self.chassisInfoArea is not None and self.chassisInfoArea.isPresent: + d_print("chassisInfoArea present") + self.bodybin += self.chassisInfoArea.data + if self.boardInfoArea is not None and self.boardInfoArea.isPresent: + d_print("boardInfoArea present") + self.boardInfoArea.recalcute() + self.bodybin += self.boardInfoArea.data + if self.productInfoArea is not None and self.productInfoArea.isPresent: + d_print("productInfoAreapresent") + self.productInfoArea.recalcute() + self.bodybin += self.productInfoArea.data + if self.multiRecordArea is not None and self.multiRecordArea.isPresent: + d_print("multiRecordArea present") + self.bodybin += self.productInfoArea.data + + def recalcute(self, fru_eeprom_size=256): + self._frusize = fru_eeprom_size + self.recalcutebin() + self.recalcuteCommonHead() + + def setValue(self, area, field, value): + tmp_area = getattr(self, area, None) + if tmp_area is not None: + tmp_area.fruSetValue(field, value) diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/hwsku.json b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/hwsku.json new file mode 100644 index 000000000000..9a5a4d2b6420 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/hwsku.json @@ -0,0 +1,172 @@ +{ + "interfaces": { + "Ethernet1": { + "default_brkout_mode": "1x25G" + }, + "Ethernet2": { + "default_brkout_mode": "1x25G" + }, + "Ethernet3": { + "default_brkout_mode": "1x25G" + }, + "Ethernet4": { + "default_brkout_mode": "1x25G" + }, + "Ethernet5": { + "default_brkout_mode": "1x25G" + }, + "Ethernet6": { + "default_brkout_mode": "1x25G" + }, + "Ethernet7": { + "default_brkout_mode": "1x25G" + }, + "Ethernet8": { + "default_brkout_mode": "1x25G" + }, + "Ethernet9": { + "default_brkout_mode": "1x25G" + }, + "Ethernet10": { + "default_brkout_mode": "1x25G" + }, + "Ethernet11": { + "default_brkout_mode": "1x25G" + }, + "Ethernet12": { + "default_brkout_mode": "1x25G" + }, + "Ethernet13": { + "default_brkout_mode": "1x25G" + }, + "Ethernet14": { + "default_brkout_mode": "1x25G" + }, + "Ethernet15": { + "default_brkout_mode": "1x25G" + }, + "Ethernet16": { + "default_brkout_mode": "1x25G" + }, + "Ethernet17": { + "default_brkout_mode": "1x25G" + }, + "Ethernet18": { + "default_brkout_mode": "1x25G" + }, + "Ethernet19": { + "default_brkout_mode": "1x25G" + }, + "Ethernet20": { + "default_brkout_mode": "1x25G" + }, + "Ethernet21": { + "default_brkout_mode": "1x25G" + }, + "Ethernet22": { + "default_brkout_mode": "1x25G" + }, + "Ethernet23": { + "default_brkout_mode": "1x25G" + }, + "Ethernet24": { + "default_brkout_mode": "1x25G" + }, + "Ethernet25": { + "default_brkout_mode": "1x25G" + }, + "Ethernet26": { + "default_brkout_mode": "1x25G" + }, + "Ethernet27": { + "default_brkout_mode": "1x25G" + }, + "Ethernet28": { + "default_brkout_mode": "1x25G" + }, + "Ethernet29": { + "default_brkout_mode": "1x25G" + }, + "Ethernet30": { + "default_brkout_mode": "1x25G" + }, + "Ethernet31": { + "default_brkout_mode": "1x25G" + }, + "Ethernet32": { + "default_brkout_mode": "1x25G" + }, + "Ethernet33": { + "default_brkout_mode": "1x25G" + }, + "Ethernet34": { + "default_brkout_mode": "1x25G" + }, + "Ethernet35": { + "default_brkout_mode": "1x25G" + }, + "Ethernet36": { + "default_brkout_mode": "1x25G" + }, + "Ethernet37": { + "default_brkout_mode": "1x25G" + }, + "Ethernet38": { + "default_brkout_mode": "1x25G" + }, + "Ethernet39": { + "default_brkout_mode": "1x25G" + }, + "Ethernet40": { + "default_brkout_mode": "1x25G" + }, + "Ethernet41": { + "default_brkout_mode": "1x25G" + }, + "Ethernet42": { + "default_brkout_mode": "1x25G" + }, + "Ethernet43": { + "default_brkout_mode": "1x25G" + }, + "Ethernet44": { + "default_brkout_mode": "1x25G" + }, + "Ethernet45": { + "default_brkout_mode": "1x25G" + }, + "Ethernet46": { + "default_brkout_mode": "1x25G" + }, + "Ethernet47": { + "default_brkout_mode": "1x25G" + }, + "Ethernet48": { + "default_brkout_mode": "1x25G" + }, + "Ethernet49": { + "default_brkout_mode": "1x100G" + }, + "Ethernet53": { + "default_brkout_mode": "1x100G" + }, + "Ethernet57": { + "default_brkout_mode": "1x100G" + }, + "Ethernet61": { + "default_brkout_mode": "1x100G" + }, + "Ethernet65": { + "default_brkout_mode": "1x100G" + }, + "Ethernet69": { + "default_brkout_mode": "1x100G" + }, + "Ethernet73": { + "default_brkout_mode": "1x100G" + }, + "Ethernet77": { + "default_brkout_mode": "1x100G" + } + } +} \ No newline at end of file diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/installer.conf b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/installer.conf new file mode 100644 index 000000000000..2a5d7d83f102 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/installer.conf @@ -0,0 +1,2 @@ +CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="intel_idle.max_cstate=0 idle=poll modprobe.blacklist=spi_intel,spi_intel_platform,spi_intel_pci" diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/led_proc_init.soc b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/led_proc_init.soc new file mode 100755 index 000000000000..59238f5cdc94 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/led_proc_init.soc @@ -0,0 +1,7 @@ +m0 load 0 0x3800 /usr/share/sonic/platform/custom_led.bin + +led auto on + +led start + +linkscan SwPortBitMap=xe,ce diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/media_settings.json b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/media_settings.json new file mode 100644 index 000000000000..e848307fd9bf --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/media_settings.json @@ -0,0 +1,2020 @@ +{ + "PORT_MEDIA_SETTINGS": { + "49": { + "Default": { + "pre1": { + "lane0": "0x0000000C", + "lane1": "0x0000000C", + "lane2": "0x0000000C", + "lane3": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B", + "lane1": "0x0000004B", + "lane2": "0x0000004B", + "lane3": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D", + "lane1": "0x0000000D", + "lane2": "0x0000000D", + "lane3": "0x0000000D" + } + }, + "QSFP+-": { + "pre1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000" + }, + "main": { + "lane0": "0x0000003C", + "lane1": "0x0000003C", + "lane2": "0x0000003C", + "lane3": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004" + } + } + }, + "50": { + "Default": { + "pre1": { + "lane0": "0x0000000C", + "lane1": "0x0000000C", + "lane2": "0x0000000C", + "lane3": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B", + "lane1": "0x0000004B", + "lane2": "0x0000004B", + "lane3": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D", + "lane1": "0x0000000D", + "lane2": "0x0000000D", + "lane3": "0x0000000D" + } + }, + "QSFP+-": { + "pre1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000" + }, + "main": { + "lane0": "0x0000003C", + "lane1": "0x0000003C", + "lane2": "0x0000003C", + "lane3": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004", + "lane1": "0x00000004", + "lane2": "0x00000004", + "lane3": "0x00000004" + } + } + }, + "51": { + "Default": { + "pre1": { + "lane0": "0x0000000C", + "lane1": "0x0000000C", + "lane2": "0x0000000C", + "lane3": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B", + "lane1": "0x0000004B", + "lane2": "0x0000004B", + "lane3": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D", + "lane1": "0x0000000D", + "lane2": "0x0000000D", + "lane3": "0x0000000D" + } + }, + "QSFP+-": { + "pre1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000" + }, + "main": { + "lane0": "0x0000003C", + "lane1": "0x0000003C", + "lane2": "0x0000003C", + "lane3": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000004" + } + } + }, + "52": { + "Default": { + "pre1": { + "lane0": "0x0000000C", + "lane1": "0x0000000C", + "lane2": "0x0000000C", + "lane3": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B", + "lane1": "0x0000004B", + "lane2": "0x0000004B", + "lane3": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D", + "lane1": "0x0000000D", + "lane2": "0x0000000D", + "lane3": "0x0000000D" + } + }, + "QSFP+-": { + "pre1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000" + }, + "main": { + "lane0": "0x0000003C", + "lane1": "0x0000003C", + "lane2": "0x0000003C", + "lane3": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004", + "lane1": "0x00000005", + "lane2": "0x00000005", + "lane3": "0x00000005" + } + } + }, + "53": { + "Default": { + "pre1": { + "lane0": "0x0000000C", + "lane1": "0x0000000C", + "lane2": "0x0000000C", + "lane3": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B", + "lane1": "0x0000004B", + "lane2": "0x0000004B", + "lane3": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D", + "lane1": "0x0000000D", + "lane2": "0x0000000D", + "lane3": "0x0000000D" + } + }, + "QSFP+-": { + "pre1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000" + }, + "main": { + "lane0": "0x0000003C", + "lane1": "0x0000003C", + "lane2": "0x0000003C", + "lane3": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006" + } + } + }, + "54": { + "Default": { + "pre1": { + "lane0": "0x0000000C", + "lane1": "0x0000000C", + "lane2": "0x0000000C", + "lane3": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B", + "lane1": "0x0000004B", + "lane2": "0x0000004B", + "lane3": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D", + "lane1": "0x0000000D", + "lane2": "0x0000000D", + "lane3": "0x0000000D" + } + }, + "QSFP+-": { + "pre1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000" + }, + "main": { + "lane0": "0x0000003C", + "lane1": "0x0000003C", + "lane2": "0x0000003C", + "lane3": "0x0000003C" + }, + "post1": { + "lane0": "0x00000005", + "lane1": "0x00000005", + "lane2": "0x00000005", + "lane3": "0x00000005" + } + } + }, + "55": { + "Default": { + "pre1": { + "lane0": "0x0000000A", + "lane1": "0x0000000A", + "lane2": "0x0000000A", + "lane3": "0x0000000A" + }, + "main": { + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046" + }, + "post1": { + "lane0": "0x00000014", + "lane1": "0x00000014", + "lane2": "0x00000014", + "lane3": "0x00000014" + } + }, + "QSFP+-": { + "pre1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000001", + "lane3": "0x00000001" + }, + "main": { + "lane0": "0x0000003C", + "lane1": "0x0000003C", + "lane2": "0x0000003C", + "lane3": "0x0000003C" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006" + } + } + }, + "56": { + "Default": { + "pre1": { + "lane0": "0x0000000A", + "lane1": "0x0000000A", + "lane2": "0x0000000A", + "lane3": "0x0000000A" + }, + "main": { + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046" + }, + "post1": { + "lane0": "0x00000014", + "lane1": "0x00000014", + "lane2": "0x00000014", + "lane3": "0x00000014" + } + }, + "QSFP+-": { + "pre1": { + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000" + }, + "main": { + "lane0": "0x0000003C", + "lane1": "0x0000003C", + "lane2": "0x0000003C", + "lane3": "0x0000003C" + }, + "post1": { + "lane0": "0x00000006", + "lane1": "0x00000006", + "lane2": "0x00000006", + "lane3": "0x00000006" + } + } + }, + "1": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000006" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "2": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000006" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "3": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000006" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "4": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000005" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "5": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000005" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "6": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000005" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "7": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000005" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "8": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "9": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "10": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "11": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "12": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "13": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "14": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "15": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "16": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "17": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "18": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "19": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "20": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000003" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "21": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "22": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000003" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "23": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "24": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000002" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "25": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000003" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "26": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000002" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "27": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "28": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000002" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "29": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "30": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000002" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "31": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "32": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "33": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "34": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000003" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "35": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "36": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "37": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "38": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "39": { + "Default": { + "pre1": { + "lane0": "0x0000000D" + }, + "main": { + "lane0": "0x00000048" + }, + "post1": { + "lane0": "0x0000000F" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "40": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "41": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "42": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "43": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "44": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "45": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "46": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "47": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + }, + "48": { + "Default": { + "pre1": { + "lane0": "0x0000000C" + }, + "main": { + "lane0": "0x0000004B" + }, + "post1": { + "lane0": "0x0000000D" + } + }, + "SFP-10G-": { + "pre1": { + "lane0": "0x00000000" + }, + "main": { + "lane0": "0x0000003C" + }, + "post1": { + "lane0": "0x00000004" + } + }, + "SFP-GB-": { + "pre1": { + "lane0": "0x00000002" + }, + "main": { + "lane0": "0x0000005F" + }, + "post1": { + "lane0": "0x00000003" + } + } + } + } +} \ No newline at end of file diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/monitor.py b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/monitor.py new file mode 100644 index 000000000000..7a97218a2430 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/monitor.py @@ -0,0 +1,402 @@ +#!/usr/bin/python3 +# * onboard temperature sensors +# * FAN trays +# * PSU +# +import os +from lxml import etree as ET +import glob +import json +from decimal import Decimal +from fru import ipmifru + + +MAILBOX_DIR = "/sys/bus/i2c/devices/" +BOARD_ID_PATH = "/sys/module/platform_common/parameters/dfd_my_type" +BOARD_AIRFLOW_PATH = "/etc/sonic/.airflow" + + +CONFIG_NAME = "dev.xml" + + +def byteTostr(val): + strtmp = '' + for value in val: + strtmp += chr(value) + return strtmp + + +def typeTostr(val): + if isinstance(val, bytes): + strtmp = byteTostr(val) + return strtmp + return val + + +def get_board_id(): + if not os.path.exists(BOARD_ID_PATH): + return "NA" + with open(BOARD_ID_PATH) as fd: + id_str = fd.read().strip() + return "0x%x" % (int(id_str, 10)) + + +def getboardairflow(): + if not os.path.exists(BOARD_AIRFLOW_PATH): + return "NA" + with open(BOARD_AIRFLOW_PATH) as fd: + airflow_str = fd.read().strip() + data = json.loads(airflow_str) + airflow = data.get("board", "NA") + return airflow + + +boardid = get_board_id() +boardairflow = getboardairflow() + + +DEV_XML_FILE_LIST = [ + "dev_" + boardid + "_" + boardairflow + ".xml", + "dev_" + boardid + ".xml", + "dev_" + boardairflow + ".xml", +] + + +def dev_file_read(path, offset, read_len): + retval = "ERR" + val_list = [] + msg = "" + ret = "" + fd = -1 + + if not os.path.exists(path): + return False, "%s %s not found" % (retval, path) + + try: + fd = os.open(path, os.O_RDONLY) + os.lseek(fd, offset, os.SEEK_SET) + ret = os.read(fd, read_len) + for item in ret: + val_list.append(item) + except Exception as e: + msg = str(e) + return False, "%s %s" % (retval, msg) + finally: + if fd > 0: + os.close(fd) + return True, val_list + + +def getPMCreg(location): + retval = 'ERR' + if not os.path.isfile(location): + return "%s %s notfound" % (retval, location) + try: + with open(location, 'r') as fd: + retval = fd.read() + except Exception as error: + return "ERR %s" % str(error) + + retval = retval.rstrip('\r\n') + retval = retval.lstrip(" ") + return retval + + +# Get a mailbox register +def get_pmc_register(reg_name): + retval = 'ERR' + mb_reg_file = reg_name + filepath = glob.glob(mb_reg_file) + if len(filepath) == 0: + return "%s %s notfound" % (retval, mb_reg_file) + mb_reg_file = filepath[0] + if not os.path.isfile(mb_reg_file): + # print mb_reg_file, 'not found !' + return "%s %s notfound" % (retval, mb_reg_file) + try: + with open(mb_reg_file, 'rb') as fd: + retval = fd.read() + retval = typeTostr(retval) + except Exception as error: + retval = "%s %s read failed, msg: %s" % (retval, mb_reg_file, str(error)) + + retval = retval.rstrip('\r\n') + retval = retval.lstrip(" ") + return retval + + +class checktype(): + def __init__(self, test1): + self.test1 = test1 + + @staticmethod + def getValue(location, bit, data_type, coefficient=1, addend=0): + try: + value_t = get_pmc_register(location) + if value_t.startswith("ERR") or value_t.startswith("NA"): + return value_t + if data_type == 1: + return float('%.1f' % ((float(value_t) / 1000) + addend)) + if data_type == 2: + return float('%.1f' % (float(value_t) / 100)) + if data_type == 3: + psu_status = int(value_t, 16) + return (psu_status & (1 << bit)) >> bit + if data_type == 4: + return int(value_t, 10) + if data_type == 5: + return float('%.1f' % (float(value_t) / 1000 / 1000)) + if data_type == 6: + return Decimal(float(value_t) * coefficient / 1000).quantize(Decimal('0.000')) + return value_t + except Exception as e: + value_t = "ERR %s" % str(e) + return value_t + + # fanFRU + @staticmethod + def decodeBinByValue(retval): + fru = ipmifru() + fru.decodeBin(retval) + return fru + + @staticmethod + def getfruValue(prob_t, root, val): + try: + ret, binval_bytes = dev_file_read(val, 0, 256) + if ret is False: + return binval_bytes + binval = byteTostr(binval_bytes) + fanpro = {} + ret = checktype.decodeBinByValue(binval) + fanpro['fan_type'] = ret.productInfoArea.productName + fanpro['hw_version'] = str(int(ret.productInfoArea.productVersion, 16)) + fanpro['sn'] = ret.productInfoArea.productSerialNumber + fan_display_name_dict = status.getDecodValue(root, "fan_display_name") + fan_name = fanpro['fan_type'].strip() + if len(fan_display_name_dict) == 0: + return fanpro + if fan_name not in fan_display_name_dict: + prob_t['errcode'] = -1 + prob_t['errmsg'] = '%s' % ("ERR fan name: %s not support" % fan_name) + else: + fanpro['fan_type'] = fan_display_name_dict[fan_name] + return fanpro + except Exception as error: + return "ERR " + str(error) + + @staticmethod + def getslotfruValue(val): + try: + binval = checktype.getValue(val, 0, 0) + if binval.startswith("ERR"): + return binval + slotpro = {} + ret = checktype.decodeBinByValue(binval) + slotpro['slot_type'] = ret.boardInfoArea.boardProductName + slotpro['hw_version'] = ret.boardInfoArea.boardextra1 + slotpro['sn'] = ret.boardInfoArea.boardSerialNumber + return slotpro + except Exception as error: + return "ERR " + str(error) + + @staticmethod + def getpsufruValue(prob_t, root, val): + try: + psu_match = False + binval = checktype.getValue(val, 0, 0) + if binval.startswith("ERR"): + return binval + psupro = {} + ret = checktype.decodeBinByValue(binval) + psupro['type1'] = ret.productInfoArea.productPartModelName + psupro['sn'] = ret.productInfoArea.productSerialNumber + psupro['hw_version'] = ret.productInfoArea.productVersion + psu_dict = status.getDecodValue(root, "psutype") + psupro['type1'] = psupro['type1'].strip() + if len(psu_dict) == 0: + return psupro + for psu_name, display_name in psu_dict.items(): + if psu_name.strip() == psupro['type1']: + psupro['type1'] = display_name + psu_match = True + break + if psu_match is not True: + prob_t['errcode'] = -1 + prob_t['errmsg'] = '%s' % ("ERR psu name: %s not support" % psupro['type1']) + return psupro + except Exception as error: + return "ERR " + str(error) + + +class status(): + def __init__(self, productname): + self.productname = productname + + @staticmethod + def getETroot(filename): + tree = ET.parse(filename) + root = tree.getroot() + return root + + @staticmethod + def getDecodValue(collection, decode): + decodes = collection.find('decode') + testdecode = decodes.find(decode) + test = {} + if testdecode is None: + return test + for neighbor in testdecode.iter('code'): + test[neighbor.attrib["key"]] = neighbor.attrib["value"] + return test + + @staticmethod + def getfileValue(location): + return checktype.getValue(location, " ", " ") + + @staticmethod + def getETValue(a, filename, tagname): + root = status.getETroot(filename) + for neighbor in root.iter(tagname): + prob_t = {} + prob_t.update(neighbor.attrib) + prob_t['errcode'] = 0 + prob_t['errmsg'] = '' + for pros in neighbor.iter("property"): + ret = dict(list(neighbor.attrib.items()) + list(pros.attrib.items())) + if ret.get('e2type') == 'fru' and ret.get("name") == "fru": + fruval = checktype.getfruValue(prob_t, root, ret["location"]) + if isinstance(fruval, str) and fruval.startswith("ERR"): + prob_t['errcode'] = -1 + prob_t['errmsg'] = fruval + break + prob_t.update(fruval) + continue + + if ret.get("name") == "psu" and ret.get('e2type') == 'fru': + psuval = checktype.getpsufruValue(prob_t, root, ret["location"]) + if isinstance(psuval, str) and psuval.startswith("ERR"): + prob_t['errcode'] = -1 + prob_t['errmsg'] = psuval + break + prob_t.update(psuval) + continue + + if ret.get("gettype") == "config": + prob_t[ret["name"]] = ret["value"] + continue + + if 'type' not in ret.keys(): + val = "0" + else: + val = ret["type"] + if 'bit' not in ret.keys(): + bit = "0" + else: + bit = ret["bit"] + if 'coefficient' not in ret.keys(): + coefficient = 1 + else: + coefficient = float(ret["coefficient"]) + if 'addend' not in ret.keys(): + addend = 0 + else: + addend = float(ret["addend"]) + + s = checktype.getValue(ret["location"], int(bit), int(val), coefficient, addend) + if isinstance(s, str) and s.startswith("ERR"): + prob_t['errcode'] = -1 + prob_t['errmsg'] = s + break + if 'default' in ret.keys(): + rt = status.getDecodValue(root, ret['decode']) + prob_t['errmsg'] = rt[str(s)] + if str(s) != ret["default"]: + prob_t['errcode'] = -1 + break + else: + if 'decode' in ret.keys(): + rt = status.getDecodValue(root, ret['decode']) + if (ret['decode'] == "psutype" and s.replace("\x00", "").rstrip() not in rt): + prob_t['errcode'] = -1 + prob_t['errmsg'] = '%s' % ("ERR psu name: %s not support" % + (s.replace("\x00", "").rstrip())) + else: + s = rt[str(s).replace("\x00", "").rstrip()] + name = ret["name"] + prob_t[name] = str(s) + a.append(prob_t) + + @staticmethod + def getCPUValue(a, filename, tagname): + root = status.getETroot(filename) + for neighbor in root.iter(tagname): + location = neighbor.attrib["location"] + L = [] + for dirpath, dirnames, filenames in os.walk(location): + for file in filenames: + if file.endswith("input"): + L.append(os.path.join(dirpath, file)) + L = sorted(L, reverse=False) + for i in range(len(L)): + prob_t = {} + prob_t["name"] = getPMCreg("%s/temp%d_label" % (location, i + 1)) + prob_t["temp"] = float(getPMCreg("%s/temp%d_input" % (location, i + 1))) / 1000 + prob_t["alarm"] = float(getPMCreg("%s/temp%d_crit_alarm" % (location, i + 1))) / 1000 + prob_t["crit"] = float(getPMCreg("%s/temp%d_crit" % (location, i + 1))) / 1000 + prob_t["max"] = float(getPMCreg("%s/temp%d_max" % (location, i + 1))) / 1000 + a.append(prob_t) + + @staticmethod + def getFileName(): + fpath = os.path.dirname(os.path.realpath(__file__)) + for file in DEV_XML_FILE_LIST: + xml = fpath + "/" + file + if os.path.exists(xml): + return xml + return fpath + "/" + CONFIG_NAME + + @staticmethod + def checkFan(ret): + _filename = status.getFileName() + # _filename = "/usr/local/bin/" + status.getFileName() + _tagname = "fan" + status.getETValue(ret, _filename, _tagname) + + @staticmethod + def getTemp(ret): + _filename = status.getFileName() + # _filename = "/usr/local/bin/" + status.getFileName() + _tagname = "temp" + status.getETValue(ret, _filename, _tagname) + + @staticmethod + def getPsu(ret): + _filename = status.getFileName() + # _filename = "/usr/local/bin/" + status.getFileName() + _tagname = "psu" + status.getETValue(ret, _filename, _tagname) + + @staticmethod + def getcputemp(ret): + _filename = status.getFileName() + _tagname = "cpus" + status.getCPUValue(ret, _filename, _tagname) + + @staticmethod + def getDcdc(ret): + _filename = status.getFileName() + _tagname = "dcdc" + status.getETValue(ret, _filename, _tagname) + + @staticmethod + def getmactemp(ret): + _filename = status.getFileName() + _tagname = "mactemp" + status.getETValue(ret, _filename, _tagname) + + @staticmethod + def getmacpower(ret): + _filename = status.getFileName() + _tagname = "macpower" + status.getETValue(ret, _filename, _tagname) diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/pcie.yaml b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/pcie.yaml new file mode 100644 index 000000000000..7b026cec395e --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/pcie.yaml @@ -0,0 +1,440 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 6f00 + name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 + (rev 03)' +- bus: '00' + dev: '01' + fn: '0' + id: 6f02 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '01' + fn: '1' + id: 6f03 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 6f04 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '02' + fn: '2' + id: 6f06 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '05' + fn: '0' + id: 6f28 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Map/VTd_Misc/System Management (rev 03)' +- bus: '00' + dev: '05' + fn: '1' + id: 6f29 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO Hot Plug (rev 03)' +- bus: '00' + dev: '05' + fn: '2' + id: 6f2a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO RAS/Control Status/Global Errors (rev 03)' +- bus: '00' + dev: '05' + fn: '4' + id: 6f2c + name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev + 03)' +- bus: '00' + dev: '14' + fn: '0' + id: 8c31 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + xHCI (rev 05)' +- bus: '00' + dev: '16' + fn: '0' + id: 8c3a + name: 'Communication controller: Intel Corporation 8 Series/C220 Series Chipset + Family MEI Controller #1 (rev 04)' +- bus: '00' + dev: '16' + fn: '1' + id: 8c3b + name: 'Communication controller: Intel Corporation 8 Series/C220 Series Chipset + Family MEI Controller #2 (rev 04)' +- bus: '00' + dev: 1c + fn: '0' + id: 8c10 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #1 (rev d5)' +- bus: '00' + dev: 1c + fn: '1' + id: 8c12 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #2 (rev d5)' +- bus: '00' + dev: 1d + fn: '0' + id: 8c26 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + EHCI #1 (rev 05)' +- bus: '00' + dev: 1f + fn: '0' + id: 8c54 + name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard + SKU LPC Controller (rev 05)' +- bus: '00' + dev: 1f + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '00' + dev: 1f + fn: '3' + id: 8c22 + name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller + (rev 05)' +- bus: '01' + dev: '00' + fn: '0' + id: b873 + name: 'Ethernet controller: Broadcom Inc. and subsidiaries Device b873 (rev 01)' +- bus: '03' + dev: '00' + fn: '0' + id: 6f50 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 0' +- bus: '03' + dev: '00' + fn: '1' + id: 6f51 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 1' +- bus: '03' + dev: '00' + fn: '2' + id: 6f52 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 2' +- bus: '03' + dev: '00' + fn: '3' + id: 6f53 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 3' +- bus: '04' + dev: '00' + fn: '0' + id: 15ab + name: 'Ethernet controller: Intel Corporation Ethernet Connection X552 10 GbE Backplane' +- bus: '04' + dev: '00' + fn: '1' + id: 15ab + name: 'Ethernet controller: Intel Corporation Ethernet Connection X552 10 GbE Backplane' +- bus: '07' + dev: '00' + fn: '0' + id: '1537' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Backplane Connection + (rev 03)' +- bus: 08 + dev: '00' + fn: '0' + id: '7022' + name: 'Memory controller: Xilinx Corporation Device 7022' +- bus: ff + dev: 0b + fn: '0' + id: 6f81 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '1' + id: 6f36 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '2' + id: 6f37 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '3' + id: 6f76 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link Debug (rev 03)' +- bus: ff + dev: 0c + fn: '0' + id: 6fe0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '1' + id: 6fe1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '2' + id: 6fe2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '3' + id: 6fe3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '0' + id: 6ff8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '4' + id: 6ffc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '5' + id: 6ffd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '6' + id: 6ffe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: '10' + fn: '0' + id: 6f1d + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '1' + id: 6f34 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '5' + id: 6f1e + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '6' + id: 6f7d + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '7' + id: 6f1f + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '12' + fn: '0' + id: 6fa0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '12' + fn: '1' + id: 6f30 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '13' + fn: '0' + id: 6fa8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '1' + id: 6f71 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '2' + id: 6faa + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '3' + id: 6fab + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '4' + id: 6fac + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '5' + id: 6fad + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '6' + id: 6fae + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Broadcast (rev 03)' +- bus: ff + dev: '13' + fn: '7' + id: 6faf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Global Broadcast (rev 03)' +- bus: ff + dev: '14' + fn: '0' + id: 6fb0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '1' + id: 6fb1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '2' + id: 6fb2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Error (rev 03)' +- bus: ff + dev: '14' + fn: '3' + id: 6fb3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Error (rev 03)' +- bus: ff + dev: '14' + fn: '4' + id: 6fbc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '5' + id: 6fbd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '6' + id: 6fbe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '7' + id: 6fbf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '15' + fn: '0' + id: 6fb4 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '1' + id: 6fb5 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '2' + id: 6fb6 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Error (rev 03)' +- bus: ff + dev: '15' + fn: '3' + id: 6fb7 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Error (rev 03)' +- bus: ff + dev: 1e + fn: '0' + id: 6f98 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '1' + id: 6f99 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '2' + id: 6f9a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '3' + id: 6fc0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '4' + id: 6f9c + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '0' + id: 6f88 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '2' + id: 6f8a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform.json b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform.json new file mode 100644 index 000000000000..0fe70dd1411e --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform.json @@ -0,0 +1,819 @@ +{ + "chassis": { + "name": "M2-W6510-48V8C", + "thermal_manager": false, + "status_led": { + "controllable": false, + "colors": ["green", "blinking_green", "amber", "blinking_amber"] + }, + "components": [ + { + "name": "CPU_CPLD" + }, + { + "name": "CONNECT_CPLD" + }, + { + "name": "CONNECT_CPLD-FAN" + }, + { + "name": "MAC_CPLD1" + }, + { + "name": "MAC_CPLD2" + }, + { + "name": "FPGA" + }, + { + "name": "BIOS" + } + ], + "fans": [ + { + "name": "Fantray1_1", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + }, + { + "name": "Fantray1_2", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + }, + { + "name": "Fantray2_1", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + }, + { + "name": "Fantray2_2", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + }, + { + "name": "Fantray3_1", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + }, + { + "name": "Fantray3_2", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + }, + { + "name": "Fantray4_1", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + }, + { + "name": "Fantray4_2", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false, + "colors": ["off", "red", "amber", "green"] + } + } + ], + "fan_drawers":[ + { + "name": "Fantray1", + "num_fans" : 2, + "status_led": { + "controllable": false, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "Fantray1_1", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false + } + }, + { + "name": "Fantray1_2", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "Fantray2", + "num_fans" : 2, + "status_led": { + "controllable": false, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "Fantray2_1", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false + } + }, + { + "name": "Fantray2_2", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "Fantray3", + "num_fans" : 2, + "status_led": { + "controllable": false, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "Fantray3_1", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false + } + }, + { + "name": "Fantray3_2", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "Fantray4", + "num_fans" : 2, + "status_led": { + "controllable": false, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "Fantray4_1", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false + } + }, + { + "name": "Fantray4_2", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false + } + } + ] + } + ], + "psus": [ + { + "name": "Psu1", + "voltage": true, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": true, + "voltage_low_threshold": true, + "temperature": true, + "fans_target_speed": true, + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "PSU1_FAN1", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "Psu2", + "voltage": true, + "current": true, + "power": true, + "max_power": false, + "voltage_high_threshold": true, + "voltage_low_threshold": true, + "temperature": true, + "fans_target_speed": true, + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "PSU2_FAN1", + "speed": { + "controllable": true, + "minimum": 50, + "maximum": 100 + }, + "status_led": { + "available": false + } + } + ] + } + ], + "thermals": [ + { + "name": "ASIC_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "CPU_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "INLET_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "OUTLET_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "MAC_OUT_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "MAC_IN_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "PSU1_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + }, + { + "name": "PSU2_TEMP", + "controllable": false, + "low-crit-threshold": true, + "high-crit-threshold": true, + "low-threshold": true, + "high-threshold": true, + "minimum-recorded": true, + "maximum-recorded": true + } + ], + "modules": [], + "sfps": [] + }, + "interfaces": { + "Ethernet1": { + "index": "1", + "lanes": "57", + "breakout_modes": { + "1x25G": ["Eth1"] + } + }, + "Ethernet2": { + "index": "2", + "lanes": "58", + "breakout_modes": { + "1x25G": ["Eth2"] + } + }, + "Ethernet3": { + "index": "3", + "lanes": "59", + "breakout_modes": { + "1x25G": ["Eth3"] + } + }, + "Ethernet4": { + "index": "4", + "lanes": "60", + "breakout_modes": { + "1x25G": ["Eth4"] + } + }, + "Ethernet5": { + "index": "5", + "lanes": "61", + "breakout_modes": { + "1x25G": ["Eth5"] + } + }, + "Ethernet6": { + "index": "6", + "lanes": "62", + "breakout_modes": { + "1x25G": ["Eth6"] + } + }, + "Ethernet7": { + "index": "7", + "lanes": "63", + "breakout_modes": { + "1x25G": ["Eth7"] + } + }, + "Ethernet8": { + "index": "8", + "lanes": "64", + "breakout_modes": { + "1x25G": ["Eth8"] + } + }, + "Ethernet9": { + "index": "9", + "lanes": "1", + "breakout_modes": { + "1x25G": ["Eth9"] + } + }, + "Ethernet10": { + "index": "10", + "lanes": "2", + "breakout_modes": { + "1x25G": ["Eth10"] + } + }, + "Ethernet11": { + "index": "11", + "lanes": "3", + "breakout_modes": { + "1x25G": ["Eth11"] + } + }, + "Ethernet12": { + "index": "12", + "lanes": "4", + "breakout_modes": { + "1x25G": ["Eth12"] + } + }, + "Ethernet13": { + "index": "13", + "lanes": "5", + "breakout_modes": { + "1x25G": ["Eth13"] + } + }, + "Ethernet14": { + "index": "14", + "lanes": "6", + "breakout_modes": { + "1x25G": ["Eth14"] + } + }, + "Ethernet15": { + "index": "15", + "lanes": "7", + "breakout_modes": { + "1x25G": ["Eth15"] + } + }, + "Ethernet16": { + "index": "16", + "lanes": "8", + "breakout_modes": { + "1x25G": ["Eth16"] + } + }, + "Ethernet17": { + "index": "17", + "lanes": "13", + "breakout_modes": { + "1x25G": ["Eth17"] + } + }, + "Ethernet18": { + "index": "18", + "lanes": "14", + "breakout_modes": { + "1x25G": ["Eth18"] + } + }, + "Ethernet19": { + "index": "19", + "lanes": "15", + "breakout_modes": { + "1x25G": ["Eth19"] + } + }, + "Ethernet20": { + "index": "20", + "lanes": "16", + "breakout_modes": { + "1x25G": ["Eth20"] + } + }, + "Ethernet21": { + "index": "21", + "lanes": "21", + "breakout_modes": { + "1x25G": ["Eth21"] + } + }, + "Ethernet22": { + "index": "22", + "lanes": "22", + "breakout_modes": { + "1x25G": ["Eth22"] + } + }, + "Ethernet23": { + "index": "23", + "lanes": "23", + "breakout_modes": { + "1x25G": ["Eth23"] + } + }, + "Ethernet24": { + "index": "24", + "lanes": "24", + "breakout_modes": { + "1x25G": ["Eth24"] + } + }, + "Ethernet25": { + "index": "25", + "lanes": "29", + "breakout_modes": { + "1x25G": ["Eth25"] + } + }, + "Ethernet26": { + "index": "26", + "lanes": "30", + "breakout_modes": { + "1x25G": ["Eth26"] + } + }, + "Ethernet27": { + "index": "27", + "lanes": "31", + "breakout_modes": { + "1x25G": ["Eth27"] + } + }, + "Ethernet28": { + "index": "28", + "lanes": "32", + "breakout_modes": { + "1x25G": ["Eth28"] + } + }, + "Ethernet29": { + "index": "29", + "lanes": "33", + "breakout_modes": { + "1x25G": ["Eth29"] + } + }, + "Ethernet30": { + "index": "30", + "lanes": "34", + "breakout_modes": { + "1x25G": ["Eth30"] + } + }, + "Ethernet31": { + "index": "31", + "lanes": "35", + "breakout_modes": { + "1x25G": ["Eth31"] + } + }, + "Ethernet32": { + "index": "32", + "lanes": "36", + "breakout_modes": { + "1x25G": ["Eth32"] + } + }, + "Ethernet33": { + "index": "33", + "lanes": "41", + "breakout_modes": { + "1x25G": ["Eth33"] + } + }, + "Ethernet34": { + "index": "34", + "lanes": "42", + "breakout_modes": { + "1x25G": ["Eth34"] + } + }, + "Ethernet35": { + "index": "35", + "lanes": "43", + "breakout_modes": { + "1x25G": ["Eth35"] + } + }, + "Ethernet36": { + "index": "36", + "lanes": "44", + "breakout_modes": { + "1x25G": ["Eth36"] + } + }, + "Ethernet37": { + "index": "37", + "lanes": "49", + "breakout_modes": { + "1x25G": ["Eth37"] + } + }, + "Ethernet38": { + "index": "38", + "lanes": "50", + "breakout_modes": { + "1x25G": ["Eth38"] + } + }, + "Ethernet39": { + "index": "39", + "lanes": "51", + "breakout_modes": { + "1x25G": ["Eth39"] + } + }, + "Ethernet40": { + "index": "40", + "lanes": "52", + "breakout_modes": { + "1x25G": ["Eth40"] + } + }, + "Ethernet41": { + "index": "41", + "lanes": "65", + "breakout_modes": { + "1x25G": ["Eth41"] + } + }, + "Ethernet42": { + "index": "42", + "lanes": "66", + "breakout_modes": { + "1x25G": ["Eth42"] + } + }, + "Ethernet43": { + "index": "43", + "lanes": "67", + "breakout_modes": { + "1x25G": ["Eth43"] + } + }, + "Ethernet44": { + "index": "44", + "lanes": "68", + "breakout_modes": { + "1x25G": ["Eth44"] + } + }, + "Ethernet45": { + "index": "45", + "lanes": "69", + "breakout_modes": { + "1x25G": ["Eth45"] + } + }, + "Ethernet46": { + "index": "46", + "lanes": "70", + "breakout_modes": { + "1x25G": ["Eth46"] + } + }, + "Ethernet47": { + "index": "47", + "lanes": "71", + "breakout_modes": { + "1x25G": ["Eth47"] + } + }, + "Ethernet48": { + "index": "48", + "lanes": "72", + "breakout_modes": { + "1x25G": ["Eth48"] + } + }, + "Ethernet49": { + "index": "49,49,49,49", + "lanes": "85,86,87,88", + "breakout_modes": { + "1x100G": ["Eth49"], + "2x50G": ["Eth49/1", "Eth49/2"], + "4x25G[10G]": ["Eth49/1", "Eth49/2", "Eth49/3", "Eth49/4"], + "4x10G": ["Eth49/1", "Eth49/2", "Eth49/3", "Eth49/4"] + } + }, + "Ethernet53": { + "index": "50,50,50,50", + "lanes": "77,78,79,80", + "breakout_modes": { + "1x100G": ["Eth50"], + "2x50G": ["Eth50/1", "Eth50/2"], + "4x25G[10G]": ["Eth50/1", "Eth50/2", "Eth50/3", "Eth50/4"], + "4x10G": ["Eth50/1", "Eth50/2", "Eth50/3", "Eth50/4"] + } + }, + "Ethernet57": { + "index": "51,51,51,51", + "lanes": "97,98,99,100", + "breakout_modes": { + "1x100G": ["Eth51"], + "2x50G": ["Eth51/1", "Eth51/2"], + "4x25G[10G]": ["Eth51/1", "Eth51/2", "Eth51/3", "Eth51/4"], + "4x10G": ["Eth51/1", "Eth51/2", "Eth51/3", "Eth51/4"] + } + }, + "Ethernet61": { + "index": "52,52,52,52", + "lanes": "93,94,95,96", + "breakout_modes": { + "1x100G": ["Eth52"], + "2x50G": ["Eth52/1", "Eth52/2"], + "4x25G[10G]": ["Eth52/1", "Eth52/2", "Eth52/3", "Eth52/4"], + "4x10G": ["Eth52/1", "Eth52/2", "Eth52/3", "Eth52/4"] + } + }, + "Ethernet65": { + "index": "53,53,53,53", + "lanes": "113,114,115,116", + "breakout_modes": { + "1x100G": ["Eth53"], + "2x50G": ["Eth53/1", "Eth53/2"], + "4x25G[10G]": ["Eth53/1", "Eth53/2", "Eth53/3", "Eth53/4"], + "4x10G": ["Eth53/1", "Eth53/2", "Eth53/3", "Eth53/4"] + } + }, + "Ethernet69": { + "index": "54,54,54,54", + "lanes": "105,106,107,108", + "breakout_modes": { + "1x100G": ["Eth54"], + "2x50G": ["Eth54/1","Eth54/2"], + "4x25G[10G]": ["Eth54/1", "Eth54/2", "Eth54/3", "Eth54/4"], + "4x10G": ["Eth54/1", "Eth54/2", "Eth54/3", "Eth54/4"] + } + }, + "Ethernet73": { + "index": "55,55,55,55", + "lanes": "121,122,123,124", + "breakout_modes": { + "1x100G": ["Eth55"], + "2x50G": ["Eth55/1", "Eth55/2"], + "4x25G[10G]": ["Eth55/1", "Eth55/2", "Eth55/3", "Eth55/4"], + "4x10G": ["Eth55/1", "Eth55/2", "Eth55/3", "Eth55/4"] + } + }, + "Ethernet77": { + "index": "56,56,56,56", + "lanes": "125,126,127,128", + "breakout_modes": { + "1x100G": ["Eth56"], + "2x50G": ["Eth56/1", "Eth56/2"], + "4x25G[10G]": ["Eth56/1", "Eth56/2", "Eth56/3", "Eth56/4"], + "4x10G": ["Eth56/1", "Eth56/2", "Eth56/3", "Eth56/4"] + } + } + } +} diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform_asic b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform_asic new file mode 100644 index 000000000000..960467652765 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform_asic @@ -0,0 +1 @@ +broadcom diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform_components.json b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform_components.json new file mode 100644 index 000000000000..8040c1a267e2 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/platform_components.json @@ -0,0 +1,16 @@ +{ + "chassis": { + "M2-W6510-48V8C": { + "component": { + "CPU_CPLD": { }, + "CONNECT_CPLD": { }, + "CONNECT_CPLD-FAN": { }, + "MAC_CPLD1": { }, + "MAC_CPLD2": { }, + "FPGA": { }, + "BIOS": { } + } + } + } +} + diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/plugins/sfputil.py b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/plugins/sfputil.py new file mode 100644 index 000000000000..3e195a36f6cb --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/plugins/sfputil.py @@ -0,0 +1,243 @@ +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# + +try: + import time + import os + import traceback + 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 = 1 + PORT_END = 56 + PORTS_IN_BLOCK = 57 + + EEPROM_OFFSET = 32 + SFP_DEVICE_TYPE = "optoe2" + QSFP_DEVICE_TYPE = "optoe1" + I2C_MAX_ATTEMPT = 3 + + _port_to_eeprom_mapping = {} + port_to_i2cbus_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(49, self.PORTS_IN_BLOCK) + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): + for x in range(self.PORT_START, self.PORTS_IN_BLOCK): + self.port_to_i2cbus_mapping[x] = x + self.EEPROM_OFFSET - 1 + SfpUtilBase.__init__(self) + + def _sfp_read_file_path(self, file_path, offset, num_bytes): + attempts = 0 + while attempts < self.I2C_MAX_ATTEMPT: + try: + file_path.seek(offset) + read_buf = file_path.read(num_bytes) + except Exception: + attempts += 1 + time.sleep(0.05) + return True, read_buf + return False, None + + def _sfp_eeprom_present(self, sysfs_sfp_i2c_client_eeprompath, offset): + """Tries to read the eeprom file to determine if the + device/sfp is present or not. If sfp present, the read returns + valid bytes. If not, read returns error 'Connection timed out""" + + if not os.path.exists(sysfs_sfp_i2c_client_eeprompath): + return False + with open(sysfs_sfp_i2c_client_eeprompath, "rb", buffering=0) as sysfsfile: + rv, buf = self._sfp_read_file_path(sysfsfile, offset, 1) + return rv + + def _add_new_sfp_device(self, sysfs_sfp_i2c_adapter_path, devaddr, devtype): + try: + sysfs_nd_path = "%s/new_device" % sysfs_sfp_i2c_adapter_path + + # Write device address to new_device file + nd_str = "%s %s" % (devtype, hex(devaddr)) + with open(sysfs_nd_path, "w") as nd_file: + nd_file.write(nd_str) + + except Exception as err: + print("Error writing to new device file: %s" % str(err)) + return 1 + else: + return 0 + + def _get_port_eeprom_path(self, port_num, devid): + sysfs_i2c_adapter_base_path = "" + + if port_num in self.port_to_eeprom_mapping: + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[port_num] + else: + sysfs_i2c_adapter_base_path = "/sys/class/i2c-adapter" + + i2c_adapter_id = self._get_port_i2c_adapter_id(port_num) + if i2c_adapter_id is None: + print("Error getting i2c bus num") + return None + + # Get i2c virtual bus path for the sfp + sysfs_sfp_i2c_adapter_path = "%s/i2c-%s" % (sysfs_i2c_adapter_base_path, + str(i2c_adapter_id)) + + # If i2c bus for port does not exist + if not os.path.exists(sysfs_sfp_i2c_adapter_path): + print("Could not find i2c bus %s. Driver not loaded?" % sysfs_sfp_i2c_adapter_path) + return None + + sysfs_sfp_i2c_client_path = "%s/%s-00%s" % (sysfs_sfp_i2c_adapter_path, + str(i2c_adapter_id), + hex(devid)[-2:]) + + # If sfp device is not present on bus, Add it + if not os.path.exists(sysfs_sfp_i2c_client_path): + if port_num in self.qsfp_ports: + ret = self._add_new_sfp_device( + sysfs_sfp_i2c_adapter_path, devid, self.QSFP_DEVICE_TYPE) + else: + ret = self._add_new_sfp_device( + sysfs_sfp_i2c_adapter_path, devid, self.SFP_DEVICE_TYPE) + if ret != 0: + print("Error adding sfp device") + return None + + sysfs_sfp_i2c_client_eeprom_path = "%s/eeprom" % sysfs_sfp_i2c_client_path + + return sysfs_sfp_i2c_client_eeprom_path + + def _read_eeprom_specific_bytes(self, sysfsfile_eeprom, offset, num_bytes): + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + rv, raw = self._sfp_read_file_path(sysfsfile_eeprom, offset, num_bytes) + if rv is False: + return None + + try: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except Exception: + return None + + return eeprom_raw + + def get_eeprom_dom_raw(self, port_num): + if port_num in self.qsfp_ports: + # QSFP DOM EEPROM is also at addr 0x50 and thus also stored in eeprom_ifraw + return None + # Read dom eeprom at addr 0x51 + return self._read_eeprom_devid(port_num, self.IDENTITY_EEPROM_ADDR, 256) + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + presence_path = "/sys/wb_plat/sff/sff%d/present" % port_num + + try: + with open(presence_path, "rb") as data: + presence_data = data.read(2) + if presence_data == "": + return False + result = int(presence_data, 16) + except IOError: + return False + + if result == 1: + return True + return False + + def get_low_power_mode(self, port_num): + # Check for invalid port_num + + return True + + def set_low_power_mode(self, port_num, lpmode): + # Check for invalid port_num + + return True + + def reset(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + return True + + def get_transceiver_change_event(self, timeout=0): + return False, {} + + def get_highest_temperature(self): + offset = 0 + hightest_temperature = -9999 + + presence_flag = False + read_eeprom_flag = False + temperature_valid_flag = False + + for port in range(49, self.PORTS_IN_BLOCK): + if self.get_presence(port) is False: + continue + + presence_flag = True + + if port in self.qsfp_ports: + offset = 22 + else: + offset = 96 + + eeprom_path = self._get_port_eeprom_path(port, 0x50) + try: + with open(eeprom_path, mode="rb", buffering=0) as eeprom: + read_eeprom_flag = True + eeprom_raw = self._read_eeprom_specific_bytes(eeprom, offset, 2) + msb = int(eeprom_raw[0], 16) + lsb = int(eeprom_raw[1], 16) + + result = (msb << 8) | (lsb & 0xff) + result = float(result / 256.0) + if -50 <= result <= 200: + temperature_valid_flag = True + hightest_temperature = max(hightest_temperature, result) + except Exception: + print(traceback.format_exc()) + + # all port not presence + if presence_flag is False: + hightest_temperature = -10000 + + # all port read eeprom fail + elif read_eeprom_flag is False: + hightest_temperature = -9999 + + # all port temperature invalid + elif read_eeprom_flag is True and temperature_valid_flag is False: + hightest_temperature = -10000 + + hightest_temperature = round(hightest_temperature, 2) + + return hightest_temperature diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/plugins/ssd_util.py b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/plugins/ssd_util.py new file mode 100755 index 000000000000..932867b34ff7 --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/plugins/ssd_util.py @@ -0,0 +1,318 @@ +# +# ssd_util.py +# +# Generic implementation of the SSD health API +# SSD models supported: +# - InnoDisk +# - StorFly +# - Virtium + +try: + import re + import os + import subprocess + from sonic_platform_base.sonic_ssd.ssd_base import SsdBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +SMARTCTL = "smartctl {} -a" +INNODISK = "iSmart -d {}" +VIRTIUM = "SmartCmd -m {}" +DISK_LIST_CMD = "fdisk -l -o Device" +DISK_FREE_CMD = "df -h" +MOUNT_CMD = "mount" + +NOT_AVAILABLE = "N/A" +PE_CYCLE = 3000 +FAIL_PERCENT = 95 + +# Set Vendor Specific IDs +INNODISK_HEALTH_ID = 169 +INNODISK_TEMPERATURE_ID = 194 + +class SsdUtil(SsdBase): + """ + Generic implementation of the SSD health API + """ + model = NOT_AVAILABLE + serial = NOT_AVAILABLE + firmware = NOT_AVAILABLE + temperature = NOT_AVAILABLE + health = NOT_AVAILABLE + remaining_life = NOT_AVAILABLE + sata_rate = NOT_AVAILABLE + ssd_info = NOT_AVAILABLE + vendor_ssd_info = NOT_AVAILABLE + + def __init__(self, diskdev): + self.vendor_ssd_utility = { + "Generic" : { "utility" : SMARTCTL, "parser" : self.parse_generic_ssd_info }, + "InnoDisk" : { "utility" : INNODISK, "parser" : self.parse_innodisk_info }, + "M.2" : { "utility" : INNODISK, "parser" : self.parse_innodisk_info }, + "StorFly" : { "utility" : VIRTIUM, "parser" : self.parse_virtium_info }, + "Virtium" : { "utility" : VIRTIUM, "parser" : self.parse_virtium_info } + } + + """ + The dict model_attr keys relate the vendors + LITEON : "ER2-GD","AF2MA31DTDLT" + Intel : "SSDSCKKB" + SMI : "SM619GXC" + samsung: "MZNLH" + ADATA : "IM2S3134N" + """ + self.model_attr = { + "ER2-GD" : { "temperature" : "\n190\s+(.+?)\n", "remainingLife" : "\n202\s+(.+?)\n" }, + "AF2MA31DTDLT" : { "temperature" : "\n194\s+(.+?)\n", "remainingLife" : "\n202\s+(.+?)\n" }, + "SSDSCK" : { "temperature" : "\n194\s+(.+?)\n", "remainingLife" : "\n233\s+(.+?)\n" }, + "SM619GXC" : { "temperature" : "\n194\s+(.+?)\n", "remainingLife" : "\n169\s+(.+?)\n" }, + "MZNLH" : { "temperature" : "\n190\s+(.+?)\n", "remainingLife" : "\n245\s+(.+?)\n" }, + "IM2S3134N" : { "temperature" : "\n194\s+(.+?)\n", "remainingLife" : "\n231\s+(.+?)\n" }, + "MTFDDAV240TCB-1AR1ZABAA" : { "temperature" : "\n194\s+(.+?)\n", "remainingLife" : "\n202\s+(.+?)\n" } + } + + self.key_list = list(self.model_attr.keys()) + self.attr_info_rule = "[\s\S]*SMART Attributes Data Structure revision number: 1|SMART Error Log Version[\s\S]*" + self.dev = diskdev + # Generic part + self.fetch_generic_ssd_info(diskdev) + self.parse_generic_ssd_info() + self.fetch_vendor_ssd_info(diskdev, "Generic") + + # Known vendor part + if self.model: + model_short = self.model.split()[0] + if model_short in self.vendor_ssd_utility: + self.fetch_vendor_ssd_info(diskdev, model_short) + self.parse_vendor_ssd_info(model_short) + else: + # No handler registered for this disk model + pass + else: + # Failed to get disk model + self.model = "Unknown" + + def _execute_shell(self, cmd): + process = subprocess.Popen(cmd.split(), universal_newlines=True, stdout=subprocess.PIPE) + output, error = process.communicate() + exit_code = process.returncode + if exit_code: + return None + return output + + def _parse_re(self, pattern, buffer): + res_list = re.findall(pattern, str(buffer)) + return res_list[0] if res_list else NOT_AVAILABLE + + def fetch_generic_ssd_info(self, diskdev): + self.ssd_info = self._execute_shell(self.vendor_ssd_utility["Generic"]["utility"].format(diskdev)) + + # Health and temperature values may be overwritten with vendor specific data + def parse_generic_ssd_info(self): + if "nvme" in self.dev: + self.model = self._parse_re('Model Number:\s*(.+?)\n', self.ssd_info) + + health_raw = self._parse_re('Percentage Used\s*(.+?)\n', self.ssd_info) + if health_raw == NOT_AVAILABLE: + self.health = NOT_AVAILABLE + else: + health_raw = health_raw.split()[-1] + self.health = 100 - float(health_raw.strip('%')) + + temp_raw = self._parse_re('Temperature\s*(.+?)\n', self.ssd_info) + if temp_raw == NOT_AVAILABLE: + self.temperature = NOT_AVAILABLE + else: + temp_raw = temp_raw.split()[-2] + self.temperature = float(temp_raw) + else: + self.model = self._parse_re('Device Model:\s*(.+?)\n', self.ssd_info) + model_key = "" + for key in self.key_list: + if re.search(key, self.model): + model_key = key + break + if model_key != "": + self.remaining_life = self._parse_re(self.model_attr[model_key]["remainingLife"], re.sub(self.attr_info_rule,"",self.ssd_info)).split()[2] + self.temperature = self._parse_re(self.model_attr[model_key]["temperature"], re.sub(self.attr_info_rule,"",self.ssd_info)).split()[8] + self.health = self.remaining_life + # Get the LITEON ssd health value by (PE CYCLE - AVG ERASE CYCLE )/(PE CYCLE) + if model_key in ["ER2-GD", "AF2MA31DTDLT"]: + avg_erase = int(self._parse_re('\n173\s+(.+?)\n' ,re.sub(self.attr_info_rule,"",self.ssd_info)).split()[-1]) + self.health = int(round((PE_CYCLE - avg_erase)/PE_CYCLE*100,0)) + if self.remaining_life != NOT_AVAILABLE and int(self.remaining_life) < FAIL_PERCENT: + self.remaining_life = "Fail" + self.sata_rate = self._parse_re('SATA Version is:.*current: (.+?)\)\n', self.ssd_info) + self.serial = self._parse_re('Serial Number:\s*(.+?)\n', self.ssd_info) + self.firmware = self._parse_re('Firmware Version:\s*(.+?)\n', self.ssd_info) + + def parse_innodisk_info(self): + if self.vendor_ssd_info: + self.health = self._parse_re('Health:\s*(.+?)%', self.vendor_ssd_info) + self.temperature = self._parse_re('Temperature\s*\[\s*(.+?)\]', self.vendor_ssd_info) + else: + if self.health == NOT_AVAILABLE: + health_raw = self.parse_id_number(INNODISK_HEALTH_ID) + self.health = health_raw.split()[-1] + if self.temperature == NOT_AVAILABLE: + temp_raw = self.parse_id_number(INNODISK_TEMPERATURE_ID) + self.temperature = temp_raw.split()[-6] + + def parse_virtium_info(self): + if self.vendor_ssd_info: + self.temperature = self._parse_re('Temperature_Celsius\s*\d*\s*(\d+?)\s+', self.vendor_ssd_info) + nand_endurance = self._parse_re('NAND_Endurance\s*\d*\s*(\d+?)\s+', self.vendor_ssd_info) + avg_erase_count = self._parse_re('Average_Erase_Count\s*\d*\s*(\d+?)\s+', self.vendor_ssd_info) + try: + self.health = 100 - (float(avg_erase_count) * 100 / float(nand_endurance)) + except (ValueError, ZeroDivisionError): + # Invalid avg_erase_count or nand_endurance. + pass + + def fetch_vendor_ssd_info(self, diskdev, model): + self.vendor_ssd_info = self._execute_shell(self.vendor_ssd_utility[model]["utility"].format(diskdev)) + + def parse_vendor_ssd_info(self, model): + self.vendor_ssd_utility[model]["parser"]() + + def check_readonly2(self, partition, filesystem): + # parse mount cmd output info + mount_info = self._execute_shell(MOUNT_CMD) + for line in mount_info.split('\n'): + column_list = line.split() + if line == '': + continue + if column_list[0] == partition and column_list[2] == filesystem: + if column_list[5].split(',')[0][1:] == "ro": + return partition + else: + return NOT_AVAILABLE + return NOT_AVAILABLE + + def check_readonly(self, partition, filesystem): + ret = os.access(filesystem, os.W_OK) + if ret == False: + return partition + else: + return NOT_AVAILABLE + + def get_health(self): + """ + Retrieves current disk health in percentages + + Returns: + A float number of current ssd health + e.g. 83.5 + """ + if self.health == 'N/A': + return "NA" + else: + return float(self.health) + + def get_temperature(self): + """ + Retrieves current disk temperature in Celsius + + Returns: + A float number of current temperature in Celsius + e.g. 40.1 + """ + if self.temperature == 'N/A': + return 'NA' + else: + return float(self.temperature) + + def get_model(self): + """ + Retrieves model for the given disk device + + Returns: + A string holding disk model as provided by the manufacturer + """ + return self.model + + def get_firmware(self): + """ + Retrieves firmware version for the given disk device + + Returns: + A string holding disk firmware version as provided by the manufacturer + """ + return self.firmware + + def get_serial(self): + """ + Retrieves serial number for the given disk device + + Returns: + A string holding disk serial number as provided by the manufacturer + """ + return self.serial + def get_sata_rate(self): + """ + Retrieves SATA rate for the given disk device + Returns: + A string holding current SATA rate as provided by the manufacturer + """ + return self.sata_rate + def get_remaining_life(self): + """ + Retrieves remaining life for the given disk device + Returns: + A string holding disk remaining life as provided by the manufacturer + """ + return self.remaining_life + def get_vendor_output(self): + """ + Retrieves vendor specific data for the given disk device + + Returns: + A string holding some vendor specific disk information + """ + return self.vendor_ssd_info + + def parse_id_number(self, id): + return self._parse_re('{}\s*(.+?)\n'.format(id), self.ssd_info) + + def get_readonly_partition(self): + """ + Check the partition mount filesystem is readonly status,then output the result. + Returns: + The readonly partition list + """ + + ro_partition_list = [] + partition_list = [] + + # parse fdisk cmd output info + disk_info = self._execute_shell(DISK_LIST_CMD) + begin_flag = False + for line in disk_info.split('\n'): + if line == "Device": + begin_flag = True + continue + if begin_flag: + if line != "": + partition_list.append(line) + else: + break + + # parse df cmd output info + disk_free = self._execute_shell(DISK_FREE_CMD) + disk_dict = {} + line_num = 0 + for line in disk_free.split('\n'): + line_num = line_num + 1 + if line_num == 1 or line == "": + continue + column_list = line.split() + disk_dict[column_list[0]] = column_list[5] + + # get partition which is readonly + for partition in partition_list: + if partition in disk_dict: + ret = self.check_readonly(partition, disk_dict[partition]) + if (ret != NOT_AVAILABLE): + ro_partition_list.append(ret) + + return ro_partition_list diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/pmon_daemon_control.json b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..94592fa8cebc --- /dev/null +++ b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/pmon_daemon_control.json @@ -0,0 +1,3 @@ +{ + "skip_ledd": true +} diff --git a/device/micas/x86_64-micas_m2-w6510-48v8c-r0/system_health_monitoring_config.json b/device/micas/x86_64-micas_m2-w6510-48v8c-r0/system_health_monitoring_config.json new file mode 100755 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/one-image.mk b/platform/broadcom/one-image.mk index f5a1f68f4e26..4e86423bd7e8 100755 --- a/platform/broadcom/one-image.mk +++ b/platform/broadcom/one-image.mk @@ -89,7 +89,8 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \ $(UFISPACE_S9110_32X_PLATFORM_MODULE) \ $(UFISPACE_S8901_54XC_PLATFORM_MODULE) \ $(UFISPACE_S7801_54XS_PLATFORM_MODULE) \ - $(UFISPACE_S6301_56ST_PLATFORM_MODULE) + $(UFISPACE_S6301_56ST_PLATFORM_MODULE) \ + $(MICAS_M2_W6510_48V8C_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_BUILD_INSTALLS = $(BRCM_OPENNSL_KERNEL) $(BRCM_DNX_OPENNSL_KERNEL) ifeq ($(INSTALL_DEBUG_TOOLS),y) diff --git a/platform/broadcom/platform-modules-micas.dep b/platform/broadcom/platform-modules-micas.dep new file mode 100644 index 000000000000..6ae59a668b27 --- /dev/null +++ b/platform/broadcom/platform-modules-micas.dep @@ -0,0 +1,9 @@ +MPATH := $($(MICAS_M2_W6510_48V8C_PLATFORM_MODULE)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/platform-modules-micas.mk platform/broadcom/platform-modules-micas.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(addprefix $(MPATH)/,$(shell cd $(MPATH) && git ls-files)) + + +$(MICAS_M2_W6510_48V8C_PLATFORM_MODULE)_CACHE_MODE := GIT_CONTENT_SHA +$(MICAS_M2_W6510_48V8C_PLATFORM_MODULE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(MICAS_M2_W6510_48V8C_PLATFORM_MODULE)_DEP_FILES := $(DEP_FILES) diff --git a/platform/broadcom/platform-modules-micas.mk b/platform/broadcom/platform-modules-micas.mk new file mode 100644 index 000000000000..7f2a95cade55 --- /dev/null +++ b/platform/broadcom/platform-modules-micas.mk @@ -0,0 +1,10 @@ +## M2-W6510-48V8C +MICAS_M2_W6510_48V8C_PLATFORM_MODULE_VERSION = 1.0 +export MICAS_M2_W6510_48V8C_PLATFORM_MODULE_VERSION + +MICAS_M2_W6510_48V8C_PLATFORM_MODULE = platform-modules-micas-m2-w6510-48v8c_$(MICAS_M2_W6510_48V8C_PLATFORM_MODULE_VERSION)_amd64.deb +$(MICAS_M2_W6510_48V8C_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-micas +$(MICAS_M2_W6510_48V8C_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) $(PDDF_PLATFORM_MODULE) +$(MICAS_M2_W6510_48V8C_PLATFORM_MODULE)_PLATFORM = x86_64-micas_m2-w6510-48v8c-r0 +SONIC_DPKG_DEBS += $(MICAS_M2_W6510_48V8C_PLATFORM_MODULE) +SONIC_STRETCH_DEBS += $(MICAS_M2_W6510_48V8C_PLATFORM_MODULE) diff --git a/platform/broadcom/rules.dep b/platform/broadcom/rules.dep index e27e370b9a27..51cca1baacce 100644 --- a/platform/broadcom/rules.dep +++ b/platform/broadcom/rules.dep @@ -20,6 +20,7 @@ include $(PLATFORM_PATH)/platform-modules-quanta.dep #include $(PLATFORM_PATH)/platform-modules-ragile.dep include $(PLATFORM_PATH)/platform-modules-ruijie.dep include $(PLATFORM_PATH)/platform-modules-brcm-xlr-gts.dep +include $(PLATFORM_PATH)/platform-modules-micas.dep include $(PLATFORM_PATH)/docker-syncd-brcm.dep include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.dep include $(PLATFORM_PATH)/docker-saiserver-brcm.dep diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index 3f1d35c89f55..3349e6717074 100755 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -22,6 +22,7 @@ include $(PLATFORM_PATH)/platform-modules-quanta.mk #include $(PLATFORM_PATH)/platform-modules-ragile.mk #include $(PLATFORM_PATH)/platform-modules-tencent.mk #include $(PLATFORM_PATH)/platform-modules-ufispace.mk +include $(PLATFORM_PATH)/platform-modules-micas.mk include $(PLATFORM_PATH)/docker-syncd-brcm.mk include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.mk include $(PLATFORM_PATH)/docker-saiserver-brcm.mk diff --git a/platform/broadcom/sonic-platform-modules-micas/LICENSE b/platform/broadcom/sonic-platform-modules-micas/LICENSE new file mode 100644 index 000000000000..5681cac34476 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/LICENSE @@ -0,0 +1,14 @@ +Copyright (C) 2016 Microsoft, 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. diff --git a/platform/broadcom/sonic-platform-modules-micas/common/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/Makefile new file mode 100755 index 000000000000..385dae0884fb --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/Makefile @@ -0,0 +1,41 @@ +PWD = $(shell pwd) +CC ?=gcc +INSTALL_MOD_DIR ?=extra +KVERSION ?= $(shell uname -r) +KERNEL_SRC ?= /lib/modules/$(KVERSION) +EXTRA_CFLAGS:= -I$(M)/include +EXTRA_CFLAGS+= -Wall +SUB_BUILD_DIR = $(PWD)/build +DIR_KERNEL_SRC = $(PWD)/modules +SCRIPT_DIR = $(PWD)/script +SERVICE_DIR = $(PWD)/service +BLACK_DRIVER_CONF_DIR = $(PWD)/modprobe_conf + +app_dir = $(PWD)/app +app_build_dir = $(app_dir)/build +modules_build_dir = $(DIR_KERNEL_SRC)/build + +INSTALL_MODULE_DIR = $(SUB_BUILD_DIR)/$(KERNEL_SRC)/$(INSTALL_MOD_DIR) +INSTALL_SCRIPT_DIR = $(SUB_BUILD_DIR)/usr/local/bin +INSTALL_SERVICE_DIR = $(SUB_BUILD_DIR)/lib/systemd/system +INSTALL_LIB_DIR = $(SUB_BUILD_DIR)/usr/lib/python3/dist-packages +INSTALL_BLACK_DRIVER = $(SUB_BUILD_DIR)/etc/modprobe.d + +all: + $(MAKE) -C $(app_dir) + $(MAKE) -C $(DIR_KERNEL_SRC) + @if [ ! -d ${INSTALL_MODULE_DIR} ]; then mkdir -p ${INSTALL_MODULE_DIR} ;fi + @if [ ! -d ${INSTALL_SCRIPT_DIR} ]; then mkdir -p ${INSTALL_SCRIPT_DIR} ;fi + @if [ ! -d ${INSTALL_SERVICE_DIR} ]; then mkdir -p ${INSTALL_SERVICE_DIR} ;fi + @if [ ! -d ${INSTALL_LIB_DIR} ]; then mkdir -p ${INSTALL_LIB_DIR} ;fi + @if [ -d $(PWD)/lib/ ]; then cp -r $(PWD)/lib/* ${INSTALL_LIB_DIR} ;fi + @if [ -d $(PWD)/sonic_platform/ ]; then cp -rf $(PWD)/sonic_platform ${INSTALL_LIB_DIR} ;fi + cp -r $(modules_build_dir)/*.ko $(INSTALL_MODULE_DIR) + cp -r $(app_dir)/build/app/* $(INSTALL_SCRIPT_DIR) + cp -r $(SCRIPT_DIR)/* $(INSTALL_SCRIPT_DIR) + cp -r $(SERVICE_DIR)/* $(INSTALL_SERVICE_DIR) + @if [ -d $(INSTALL_SCRIPT_DIR) ]; then chmod +x $(INSTALL_SCRIPT_DIR)/* ;fi + @if [ ! -d ${INSTALL_BLACK_DRIVER} ]; then mkdir -p ${INSTALL_BLACK_DRIVER} ;fi + cp -r $(BLACK_DRIVER_CONF_DIR)/* $(INSTALL_BLACK_DRIVER) +clean: + rm -rf $(SUB_BUILD_DIR) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/app/Makefile new file mode 100644 index 000000000000..25ba3c5a9156 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/Makefile @@ -0,0 +1,25 @@ +pes_parent_dir:=$(shell pwd)/$(lastword $(MAKEFILE_LIST)) +pes_parent_dir:=$(shell dirname $(pes_parent_dir)) + +SUBDIRS=$(shell ls -l | grep ^d | awk '{if($$9 != "build") print $$9}') +INC = -I./inc + +COMMON_OUT_PUT := $(shell pwd)/build +common_out_put_dir := $(COMMON_OUT_PUT)/app +common_module_dir := $(COMMON_OUT_PUT)/module/ +export common_out_put_dir common_module_dir + +all : CHECK $(SUBDIRS) +CHECK : + @echo $(pes_parent_dir) + +$(SUBDIRS):ECHO + #@echo $@ + make -C $@ + +ECHO: + @echo $(SUBDIRS) + +.PHONY : clean +clean : + -rm -rf $(COMMON_OUT_PUT) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/Makefile new file mode 100644 index 000000000000..e4078716eb33 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/Makefile @@ -0,0 +1,30 @@ +top_srcdir:=$(shell pwd) +#include $(top_srcdir)/Rules.mk +DIR=$(shell pwd) +BUILD_OUTPUT=$(DIR)/tmp +SRCS=$(wildcard *.c) +OBJS=$(patsubst %.c, $(BUILD_OUTPUT)/%.o, $(SRCS)) +DEPS=$(patsubst %.o, %.d, $(OBJS)) +CFLAGS+=-Wall -W -g -I$(DIR)/include +LDFLAGS= +PROGRAM=dfd_debug + +.PHONY: all + +all:$(OBJS) + $(CC) $(OBJS) $(LDFLAGS) -o $(BUILD_OUTPUT)/$(PROGRAM) + @if [ ! -d ${common_out_put_dir} ]; then mkdir -p ${common_out_put_dir} ;fi + cp -p $(BUILD_OUTPUT)/$(PROGRAM) $(common_out_put_dir) + +$(OBJS):$(SRCS) + @if [ ! -d ${BUILD_OUTPUT} ]; then mkdir -p ${BUILD_OUTPUT} ;fi + $(CC) -c $(CFLAGS) $(INCLUDE) $(*F).c -o $@ + +.PHONY: install +install: + @mkdir -p $(common_out_put_dir) + cp -p $(BUILD_OUTPUT)/$(PROGRAM) $(common_out_put_dir) + +rebuild: clean all +clean: + @rm -rf $(BUILD_OUTPUT)/* diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_debug.c b/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_debug.c new file mode 100644 index 000000000000..93ed6066efed --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_debug.c @@ -0,0 +1,43 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "dfd_utest.h" + +int g_dfd_debug_sw = 0; +int g_dfd_debugpp_sw = 0; + +void dfd_debug_set_init(void) +{ + FILE *fp; + char buf[10]; + + mem_clear(buf, sizeof(buf)); + fp = fopen(DFD_DEBUGP_DEBUG_FILE, "r"); + if (fp != NULL) { + + g_dfd_debug_sw = 1; + fclose(fp); + } + + fp = fopen(DFD_DEBUGPP_DEBUG_FILE, "r"); + if (fp != NULL) { + + g_dfd_debugpp_sw = 1; + fclose(fp); + } + + return; +} + +int main(int argc, char* argv[]) +{ + dfd_debug_set_init(); + dfd_utest_cmd_main(argc, argv); + + return 0; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_utest.c b/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_utest.c new file mode 100644 index 000000000000..c82b0baad4c3 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_utest.c @@ -0,0 +1,2121 @@ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "dfd_utest.h" + +#define DFD_UTEST_MAX_RDWR_NUM (256) +#define DFD_UTEST_DEFAULT_WR_NUM (1) + +#define DEV_MEM_NAME "/dev/mem" +#define DEV_KMEM_NAME "/dev/kmem" + +#define WIDTH_1Byte (1) +#define WIDTH_2Byte (2) +#define WIDTH_4Byte (4) +#define DFD_UTEST_MAX_BIT_WIDTH (4) + +struct phydev_user_info { + int phy_index; + uint32_t regnum; + uint32_t regval; +}; + +#define CMD_PHY_LIST _IOR('P', 0, struct phydev_user_info) +#define CMD_PHY_READ _IOR('P', 1, struct phydev_user_info) +#define CMD_PHY_WRITE _IOR('P', 2, struct phydev_user_info) + +struct mdio_dev_user_info { + int mdio_index; + int phyaddr; + uint32_t regnum; + uint32_t regval; +}; + +#define CMD_MDIO_LIST _IOR('M', 0, struct mdio_dev_user_info) +#define CMD_MDIO_READ _IOR('M', 1, struct mdio_dev_user_info) +#define CMD_MDIO_WRITE _IOR('M', 2, struct mdio_dev_user_info) + +#ifdef DFD_UTEST_ITEM +#undef DFD_UTEST_ITEM +#endif +#define DFD_UTEST_ITEM(_id, _type_str, _help_info, _help_info_detail) {_id, #_type_str, dfd_utest_##_type_str, _help_info, _help_info_detail}, +static dfd_utest_t g_dfd_unit_test[] = { + DFD_UTEST_ITEM_ALL +}; + +static int g_sys_page_size; +#define SYS_PAGE_SIZE g_sys_page_size +#define SYS_PAGE_MASK (~(SYS_PAGE_SIZE - 1)) + +void dfd_utest_print_cmd(int argc, char* argv[]) +{ + int i; + + for (i = 1; i < argc; i++) { + if (i != 1) { + printf(" "); + } + printf("%s", argv[i]); + } + return; +} + +void dfd_utest_print_all_help(void) +{ + int i, tbl_size; + + tbl_size = sizeof(g_dfd_unit_test) / sizeof(g_dfd_unit_test[0]); + + for (i = 0; i < tbl_size; i++) { + printf("%-20s\t\t\t%s\r\n", g_dfd_unit_test[i].type_str, g_dfd_unit_test[i].help_info); + } + + return; +} + +void dfd_utest_printf_single_help(int utest_type) +{ + int i, tbl_size; + + tbl_size = sizeof(g_dfd_unit_test) / sizeof(g_dfd_unit_test[0]); + for (i = 0; i < tbl_size; i++) { + if (g_dfd_unit_test[i].utest_type == utest_type) { + printf("%-20s\t\t\t%s\r\n", g_dfd_unit_test[i].type_str, g_dfd_unit_test[i].help_info_detail); + return; + } + } + + DFD_DEBUG_DBG("type: %d not match.\n", utest_type); + return; + +} + +void dfd_utest_printf_reg(uint8_t *buf, int buf_len, uint32_t offset_addr) +{ + int i, j, tmp; + + j = offset_addr % 16; + tmp = j; + offset_addr -= j; + printf("\n "); + + for (i = 0; i < 16; i++) { + printf("%2x ", i); + } + + for (i = 0; i < buf_len + j; i++) { + if ((i % 16) == 0) { + printf("\n0x%08x ", offset_addr); + offset_addr = offset_addr + 16; + } + if (tmp) { + printf(" "); + tmp--; + } else { + printf("%02x ", buf[i-j]); + } + } + + printf("\n"); + return; +} + +#define I2C_RETRIES 0x0701 +#define I2C_TIMEOUT 0x0702 +#define I2C_RDWR 0x0707 + +#define I2C_SLAVE 0x0703 /* Use this slave address */ + +#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it + is already in use by a driver! */ +#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */ +#define I2C_SMBUS 0x0720 /* SMBus transfer */ + +struct i2c_msg +{ + unsigned short addr; + unsigned short flags; +#define I2C_M_TEN 0x0010 +#define I2C_M_RD 0x0001 + unsigned short len; + unsigned char *buf; +}; + +struct i2c_rdwr_ioctl_data +{ + struct i2c_msg *msgs; + int nmsgs; + +}; + +#define DFD_I2C_SHORT_ADDR_TYPE 0 +#define DFD_I2C_RETRY_SLEEP_TIME (10000) /* 10ms */ +#define DFD_I2C_RETRY_TIME (50000 / DFD_I2C_RETRY_SLEEP_TIME) +/* i2c_smbus_xfer read or write markers */ +#define I2C_SMBUS_READ 1 +#define I2C_SMBUS_WRITE 0 + +/* SMBus transaction types (size parameter in the above functions) + Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */ +#define I2C_SMBUS_QUICK 0 +#define I2C_SMBUS_BYTE 1 +#define I2C_SMBUS_BYTE_DATA 2 +#define I2C_SMBUS_WORD_DATA 3 +#define I2C_SMBUS_PROC_CALL 4 +#define I2C_SMBUS_BLOCK_DATA 5 +#define I2C_SMBUS_I2C_BLOCK_BROKEN 6 +#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ +#define I2C_SMBUS_I2C_BLOCK_DATA 8 + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,36) +/* fix tjm */ + +#ifndef __ASSEMBLY__ +/* + * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the + * header files exported to user space + */ +typedef __signed__ char __s8; +typedef unsigned char __u8; + +typedef __signed__ short __s16; +typedef unsigned short __u16; + +typedef __signed__ int __s32; +typedef unsigned int __u32; + +typedef __signed__ long __s64; +typedef unsigned long __u64; + +#endif /* __ASSEMBLY__ */ + +#else +/* do noting add tjm */ +#endif + +/* + * Data for SMBus Messages + */ +#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */ +union i2c_smbus_data { + __u8 byte; + __u16 word; + __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */ + /* and one more for user-space compatibility */ +}; + +/* This is the structure as used in the I2C_SMBUS ioctl call */ +struct i2c_smbus_ioctl_data { + __u8 read_write; + __u8 command; + __u32 size; + union i2c_smbus_data *data; +}; +int32_t dfd_read_port_i2c_one_time_smbus(char *i2c_name, uint16_t dev_addr, uint16_t offset_addr, + uint8_t *recv_buf, int32_t size, int addr_type) +{ + union i2c_smbus_data data; + struct i2c_smbus_ioctl_data ioctl_data; + unsigned long addr = dev_addr; + int fd; + int rc; + int rv; + int i; + + mem_clear(&ioctl_data, sizeof(struct i2c_smbus_ioctl_data)); + if (i2c_name == NULL || recv_buf == NULL) { + DFD_DEBUG_ERROR("i2c_num = NULL, recv_buf = NULL\r\n"); + return -1; + } + + DFD_DEBUG_DBG("i2c name: %s, dev_addr: 0x%x, offset_addr: 0x%x, size: %d, addr_type: %d.\n", i2c_name, dev_addr, + offset_addr, size, addr_type); + + rv = 0; + fd = open(i2c_name, O_RDWR | O_SYNC); + if (fd < 0) { + DFD_DEBUG_ERROR("i2c open fail fd %d\n", fd); + rv = fd; + goto err; + } + if (ioctl(fd, I2C_SLAVE_FORCE , addr) < 0) { + DFD_DEBUG_ERROR("ioctl 2C_SLAVE_FORCE %d.\n", errno); + rv =-1; + goto fail; + } + for (i = 0 ;i < size; i++) { + data.byte = 0; + ioctl_data.read_write = I2C_SMBUS_READ; + ioctl_data.command = (offset_addr + i); + ioctl_data.size = I2C_SMBUS_BYTE_DATA; + ioctl_data.data= &data; + + rc = ioctl(fd, I2C_SMBUS, &ioctl_data); + if (rc < 0) { + DFD_DEBUG_ERROR("read, I2C_SMBUS failed: %d.\n", errno); + rv = -1; + goto fail; + } + *(recv_buf + i) = data.byte; + } + fail: + close(fd); + err: + return rv; + +} + +int32_t dfd_read_port_i2c_one_time(char *i2c_name, uint16_t dev_addr, uint16_t offset_addr, + uint8_t *recv_buf, int32_t size, int addr_type) +{ + + int32_t fd, rv; + struct i2c_rdwr_ioctl_data ioctl_data; + struct i2c_msg msgs[2]; + uint8_t buf[2]; + + if (i2c_name == NULL || recv_buf == NULL) { + DFD_DEBUG_ERROR("i2c_num = NULL, recv_buf = NULL\r\n"); + return -1; + } + + DFD_DEBUG_DBG("i2c name %s, dev_addr 0x%x, offset_addr 0x%x, size %d, addr_type %d.\n", i2c_name, dev_addr, + offset_addr, size, addr_type); + + rv = 0; + fd = open(i2c_name, O_RDWR | O_SYNC); + if (fd < 0) { + DFD_DEBUG_ERROR("i2c open fail fd %d\n", fd); + return -1; + } + mem_clear(&ioctl_data, sizeof(ioctl_data)); + mem_clear(msgs, sizeof(msgs)); + mem_clear(buf, sizeof(buf)); + if (ioctl(fd, I2C_SLAVE, dev_addr) < 0) { + + DFD_DEBUG_ERROR("%s %dioctl fail(ret:%d, errno:%s)!\r\n", __func__ , __LINE__, rv, strerror(errno)); + rv = -1; + goto fail; + } + + buf[0] = (uint8_t)(offset_addr); + msgs[0].addr= dev_addr; + msgs[0].len= 2; + msgs[0].buf= buf; + msgs[1].addr= dev_addr; + msgs[1].flags|= I2C_M_RD; + msgs[1].len= 1; + msgs[1].buf= recv_buf; + ioctl_data.nmsgs= 1; + ioctl_data.msgs= msgs; + + rv = ioctl(fd, I2C_RDWR, &ioctl_data); + if(rv < 0) { + DFD_DEBUG_ERROR("%s %dioctl fail(ret:%d, errno:%s)!\r\n", __func__ , __LINE__, rv, strerror(errno)); + goto fail; + } + ioctl_data.msgs= &msgs[1]; + DFD_DEBUG_DBG("ioctlread, return :%d/n", ioctl(fd, I2C_RDWR, &ioctl_data)); + DFD_DEBUG_DBG("dfd_read_port_i2c addr: 0x%X, offset: 0x%X, value: 0x%X\n", dev_addr, offset_addr, *recv_buf); + fail: + close(fd); + return rv; + +} + +int32_t dfd_read_port_i2c(char *i2c_name, uint16_t dev_addr, uint16_t offset_addr, + uint8_t *recv_buf, int32_t size) +{ + int i; + int rv; + + for (i = 0; i < DFD_I2C_RETRY_TIME; i++) { + rv = dfd_read_port_i2c_one_time_smbus(i2c_name, dev_addr, offset_addr, recv_buf, size, DFD_I2C_SHORT_ADDR_TYPE); + if (rv < 0) { + DFD_DEBUG_ERROR("(read times %d)i2c name %s, dev_addr 0x%X, offset_addr 0x%X, addr_type %d\n", i, i2c_name, dev_addr, offset_addr, DFD_I2C_SHORT_ADDR_TYPE); + usleep(DFD_I2C_RETRY_SLEEP_TIME); + continue; + } + break; + } + + return rv; +} + +int32_t dfd_write_port_i2c_one_time(char *i2c_name, uint16_t dev_addr, uint16_t offset_addr, + uint8_t *write_buf, int32_t size,int addr_type) +{ + int32_t fd, rv; + int index; + struct i2c_smbus_ioctl_data ioctl_data; + union i2c_smbus_data data; + uint8_t addr_buf[2]; + uint8_t write_buf_tmp[256]; + + if (i2c_name == NULL || write_buf == NULL ) { + DFD_DEBUG_ERROR("i2c_num = NULL \r\n"); + return -1; + } + + if (size <= 0) { + DFD_DEBUG_ERROR("error:size\n"); + return -1; + } + DFD_DEBUG_DBG("i2c name %s, dev_addr 0x%x, offset_addr 0x%x, size %d, addr_type %d\n",i2c_name, dev_addr, + offset_addr, size, addr_type); + mem_clear(&ioctl_data, sizeof(ioctl_data)); + mem_clear(addr_buf, sizeof(addr_buf)); + mem_clear(write_buf_tmp, sizeof(write_buf_tmp)); + + rv = 0; + + fd = open(i2c_name, O_RDWR | O_SYNC); + if (fd < 0) { + DFD_DEBUG_ERROR("i2c open fail fd %d\n", fd); + return -1; + } + + if (ioctl(fd, I2C_SLAVE_FORCE, dev_addr) < 0) { + DFD_DEBUG_ERROR("ioctl, I2C_SLAVE failed: %d.\n", errno); + rv = -1; + goto fail; + } + + for (index = 0; index < size; index++) { + data.byte = *(write_buf + index); + ioctl_data.read_write = I2C_SMBUS_WRITE; + ioctl_data.command = (offset_addr + index); + ioctl_data.size = I2C_SMBUS_BYTE_DATA; + ioctl_data.data= &data; + rv = ioctl(fd, I2C_SMBUS, (unsigned long)&ioctl_data); + if(rv < 0) { + DFD_DEBUG_ERROR("ioctl fail(ret:%d, errno:%s %d) !\r\n", rv, strerror(errno),errno); + break; + } + DFD_DEBUG_DBG("ret:%d value:0x%02x\n", rv, data.byte); + usleep(5000); + } + +fail: + close(fd); + return rv; +} + +int32_t dfd_write_port_i2c(char *i2c_name, uint16_t dev_addr, uint16_t offset_addr, + uint8_t *write_buf, int32_t size) +{ + int i; + int rv; + + for (i = 0; i < DFD_I2C_RETRY_TIME; i++) { + rv = dfd_write_port_i2c_one_time(i2c_name, dev_addr, offset_addr, write_buf,size, DFD_I2C_SHORT_ADDR_TYPE); + if (rv < 0) { + DFD_DEBUG_ERROR("(write times %d)i2c name %s, dev_addr 0x%X, offset_addr 0x%X, addr_type %d\n", + i, i2c_name, dev_addr, offset_addr, DFD_I2C_SHORT_ADDR_TYPE); + usleep(DFD_I2C_RETRY_SLEEP_TIME); + continue; + } + break; + } + + return rv; +} + +static int dfd_read_io_port(uint16_t offset_addr, uint8_t *recv_buf, int32_t size) +{ + int fd; + int ret; + + fd = open("/dev/port", O_RDWR); + if (fd < 0) { + printf("open failed ret %d.\n", fd); + return -1; + } + + ret = lseek(fd, offset_addr, SEEK_SET); + if (ret < 0) { + printf("lseek failed ret %d.\n", ret); + goto exit; + } + + ret = read(fd, recv_buf, size); + if (ret != size) { + printf("read failed ret %d size %d.\n", ret, size); + ret = -1; + goto exit; + } + +exit: + close(fd); + return ret; +} + +static int dfd_write_io_port(uint16_t offset_addr, uint8_t *write_buf, int32_t size) +{ + int fd; + int ret; + + fd = open("/dev/port", O_RDWR); + if (fd < 0) { + printf("open failed ret %d.\n", fd); + return -1; + } + + ret = lseek(fd, offset_addr, SEEK_SET); + if (ret < 0) { + printf("lseek failed ret %d.\n", ret); + goto exit; + } + + ret = write(fd, write_buf, size); + if (ret != size) { + printf("write failed ret %d size %d.\n", ret, size); + ret = -1; + goto exit; + } + +exit: + close(fd); + return ret; +} + +static int dfd_process_mem(char *dev_name, char is_wr, char width, off_t offset, uint8_t *buf, int32_t size) +{ + int mfd, ret = 0; + void *base; + int i, j; + unsigned int val; + off_t map_offset; + size_t map_size; + + if (size & (width - 1)) { + printf("size %d invalid.\n", size); + return -1; + } + + mfd = open(dev_name, O_RDWR); + if (mfd < 0) { + printf("Cannot open %s.\n", dev_name); + return -1; + } + + g_sys_page_size = getpagesize(); + map_offset = offset & SYS_PAGE_MASK; + map_size = size + offset - map_offset; + base = mmap(NULL, map_size, PROT_READ | PROT_WRITE, MAP_SHARED, mfd, map_offset); + if (base == MAP_FAILED) { + printf("mmap offset 0x%lx failed error(%s).\n", map_offset, strerror(errno)); + close(mfd); + return -1; + } + printf("width %d map_offset 0x%lx, offset 0x%lx, mmap base %p, g_sys_page_size %d\n", + width, map_offset, offset, base, g_sys_page_size); + + if (is_wr) { + for (i = 0; i < size; i = i + width) { + val = 0; + for (j = 0; j < width; j++) { + val |= buf[i + j] << (8 * j); + } + switch (width) { + case 1: + *((volatile unsigned char*)(base + i + offset - map_offset)) = val; + break; + case 2: + *((volatile unsigned short*)(base + i + offset - map_offset)) = val; + break; + case 4: + *((volatile unsigned int*)(base + i + offset - map_offset)) = val; + break; + default: + ret = -1; + printf("Not support width %d.\n", width); + goto exit; + } + } + } else { + for (i = 0; i < size; i = i + width) { + switch (width) { + case 1: + val = *((volatile unsigned char*)(base + i + offset - map_offset)); + break; + case 2: + val = *((volatile unsigned short*)(base + i + offset - map_offset)); + break; + case 4: + val = *((volatile unsigned int*)(base + i + offset - map_offset)); + break; + default: + ret = -1; + printf("Not support width %d.\n", width); + goto exit; + } + for (j = 0; j < width; j++) { + buf[i + j] = (val >> (8 * j)) & 0xff; + } + } + } +exit: + munmap(base, map_size); + close(mfd); + return ret; +} + +int32_t dfd_i2c_gen_read_one_time(char *i2c_path, uint32_t dev_addr, uint32_t addr_bitwidth, + uint32_t offset_addr, uint8_t *recv_buf, int32_t rd_len) +{ + int32_t fd, rv, i; + struct i2c_rdwr_ioctl_data ioctl_data; + struct i2c_msg msgs[2]; + uint8_t buf[DFD_UTEST_MAX_BIT_WIDTH]; + + fd = open(i2c_path, O_RDWR | O_SYNC); + if (fd < 0) { + DFD_DEBUG_ERROR("i2c open fail fd:%d\n", fd); + return -1; + } + mem_clear(&ioctl_data, sizeof(ioctl_data)); + mem_clear(msgs, sizeof(msgs)); + mem_clear(buf, sizeof(buf)); + + i = 0; + + switch (addr_bitwidth) { + case WIDTH_4Byte: + buf[i++] = (offset_addr >> 24) & 0xFF; + buf[i++] = (offset_addr >> 16) & 0xFF; + buf[i++] = (offset_addr >> 8) & 0xFF; + buf[i++] = offset_addr & 0xFF; + break; + case WIDTH_2Byte: + buf[i++] = (offset_addr >> 8) & 0xFF; + buf[i++] = offset_addr & 0xFF; + break; + case WIDTH_1Byte: + buf[i++] = offset_addr & 0xFF; + break; + default: + DFD_DEBUG_ERROR("Only support 1,2,4 Byte Address Width,but set %u addr_bitwidth \n", addr_bitwidth); + rv = -1; + goto fail; + } + + msgs[0].addr = dev_addr; + msgs[0].flags = 0; + msgs[0].len = addr_bitwidth; + msgs[0].buf = buf; + msgs[1].addr = dev_addr; + msgs[1].flags |= I2C_M_RD; + msgs[1].len = rd_len; + msgs[1].buf = recv_buf; + ioctl_data.nmsgs = 2; + ioctl_data.msgs = msgs; + + rv = ioctl(fd, I2C_RDWR, &ioctl_data); + if(rv < 0) { + DFD_DEBUG_ERROR("%s %d Error: Sending messages failed:(ret:%d, errno:%s)!\n", __func__ , __LINE__, rv, strerror(errno)); + goto fail; + } + +fail: + close(fd); + return rv; +} + +int32_t dfd_i2c_gen_read(char *i2c_path, uint32_t dev_addr, uint32_t addr_bitwidth, + uint32_t offset_addr, uint8_t *recv_buf, int32_t rd_len) +{ + int i; + int rv; + + for (i = 0; i < DFD_I2C_RETRY_TIME; i++) { + rv = dfd_i2c_gen_read_one_time(i2c_path, dev_addr, addr_bitwidth, offset_addr, recv_buf, rd_len); + if (rv < 0) { + DFD_DEBUG_ERROR("(read times:%d) i2c_path:%s, dev_addr:0x%x, addr_bitwidth:%u, offset_addr:0x%x, rd_len:%u\n", + i, i2c_path, dev_addr, addr_bitwidth, offset_addr, rd_len); + usleep(DFD_I2C_RETRY_SLEEP_TIME); + continue; + } + break; + } + + return rv; +} + +int dfd_utest_i2c_gen_rd(int argc, char* argv[]) +{ + int ret; + uint32_t i2c_bus, dev_addr, addr_bitwidth, offset_addr, data_bitwidth, rd_len, i, j; + char *stopstring; + char i2c_path[32]; + uint8_t tmp_value[DFD_UTEST_MAX_RDWR_NUM]; + uint8_t rd_value[DFD_UTEST_MAX_RDWR_NUM]; + + if (argc != 8) { + DFD_DEBUG_ERROR("params error\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_I2C_GEN_RD); + goto exit; + } + + i2c_bus = strtol(argv[2], &stopstring, 10); + dev_addr = strtol(argv[3], &stopstring, 16); + addr_bitwidth = strtol(argv[4], &stopstring, 10); + offset_addr = strtol(argv[5], &stopstring, 16); + data_bitwidth = strtol(argv[6], &stopstring, 10); + rd_len = strtol(argv[7], &stopstring, 10); + + if (rd_len > DFD_UTEST_MAX_RDWR_NUM) { + DFD_DEBUG_ERROR("Input num %d exceed max.\n", rd_len); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_I2C_GEN_RD); + goto exit; + } + + dfd_utest_print_cmd(argc, argv); + printf(":\n"); + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", i2c_bus); + mem_clear(tmp_value, sizeof(tmp_value)); + ret = dfd_i2c_gen_read(i2c_path, dev_addr, addr_bitwidth, offset_addr, tmp_value, rd_len); + if (ret < 0) { + printf("read failed. ret:%d\n", ret); + goto exit; + } + + mem_clear(rd_value, sizeof(rd_value)); + if (data_bitwidth == WIDTH_1Byte) { + memcpy(rd_value, tmp_value, rd_len); + } else { + for (i = 0; i < rd_len; i += data_bitwidth) { + for (j = 0; (j < data_bitwidth) && (i + j < rd_len); j++) { + rd_value[i + data_bitwidth - j - 1] = tmp_value[i + j]; + } + } + } + + dfd_utest_printf_reg(rd_value, rd_len, offset_addr); + +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int32_t dfd_i2c_gen_write_one_time(char *i2c_path, uint32_t dev_addr, uint32_t addr_bitwidth, + uint32_t offset_addr, uint8_t *wr_value, uint32_t wr_len) +{ + int32_t fd, rv, i; + struct i2c_rdwr_ioctl_data ioctl_data; + struct i2c_msg msgs[1]; + uint8_t buf[DFD_UTEST_MAX_BIT_WIDTH + DFD_UTEST_MAX_RDWR_NUM]; + + fd = open(i2c_path, O_RDWR | O_SYNC); + if (fd < 0) { + DFD_DEBUG_ERROR("i2c open fail fd %d\n", fd); + return -1; + } + mem_clear(&ioctl_data, sizeof(ioctl_data)); + mem_clear(msgs, sizeof(msgs)); + mem_clear(buf, sizeof(buf)); + + i = 0; + + switch (addr_bitwidth) { + case WIDTH_4Byte: + buf[i++] = (offset_addr >> 24) & 0xFF; + buf[i++] = (offset_addr >> 16) & 0xFF; + buf[i++] = (offset_addr >> 8) & 0xFF; + buf[i++] = offset_addr & 0xFF; + break; + case WIDTH_2Byte: + buf[i++] = (offset_addr >> 8) & 0xFF; + buf[i++] = offset_addr & 0xFF; + break; + case WIDTH_1Byte: + buf[i++] = offset_addr & 0xFF; + break; + default: + DFD_DEBUG_ERROR("Only support 1,2,4 Byte Address Width,but set %u addr_bitwidth \r\n", addr_bitwidth); + rv = -1; + goto fail; + } + + memcpy(buf + addr_bitwidth, wr_value, wr_len); + + msgs[0].addr= dev_addr; + msgs[0].flags = 0; + msgs[0].len= addr_bitwidth + wr_len; + msgs[0].buf= buf; + + ioctl_data.nmsgs= 1; + ioctl_data.msgs= msgs; + + rv = ioctl(fd, I2C_RDWR, &ioctl_data); + if(rv < 0) { + DFD_DEBUG_ERROR("%s %dError: Sending messages failed:(ret:%d, errno:%s)!\n", __func__ , __LINE__, rv, strerror(errno)); + goto fail; + } else if (rv < ioctl_data.nmsgs) { + DFD_DEBUG_ERROR("%s %dWarning: only %d/%d messages were sent\n", __func__ , __LINE__, rv, ioctl_data.nmsgs); + } + +fail: + close(fd); + return rv; +} + +int32_t dfd_i2c_gen_write(char *i2c_path, uint32_t dev_addr, uint32_t addr_bitwidth, + uint32_t offset_addr, uint8_t *wr_value, uint32_t wr_len) +{ + int i; + int rv; + + for (i = 0; i < DFD_I2C_RETRY_TIME; i++) { + rv = dfd_i2c_gen_write_one_time(i2c_path, dev_addr, addr_bitwidth, offset_addr, wr_value, wr_len); + if (rv < 0) { + DFD_DEBUG_ERROR("(write times:%d)i2c_path:%s, dev_addr:0x%x, addr_bitwidth:%u, offset_addr:0x%x, wr_len:%u\n", + i, i2c_path, dev_addr, addr_bitwidth, offset_addr, wr_len); + usleep(DFD_I2C_RETRY_SLEEP_TIME); + continue; + } + break; + } + + return rv; +} + +int dfd_utest_i2c_gen_wr(int argc, char* argv[]) +{ + int ret; + uint32_t i2c_bus, dev_addr, addr_bitwidth, offset_addr, data_bitwidth, wr_len, tmp_data, para_len, i, j; + char *stopstring; + char i2c_path[32]; + uint8_t wr_value[DFD_UTEST_MAX_RDWR_NUM]; + + if (argc < 8) { + DFD_DEBUG_ERROR("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_I2C_GEN_WR); + goto exit; + } + + i2c_bus = strtol(argv[2], &stopstring, 10); + dev_addr = strtol(argv[3], &stopstring, 16); + addr_bitwidth = strtol(argv[4], &stopstring, 10); + offset_addr = strtol(argv[5], &stopstring, 16); + data_bitwidth = strtol(argv[6], &stopstring, 10); + + para_len = argc - 7; + wr_len = para_len * data_bitwidth; + + if (wr_len > DFD_UTEST_MAX_RDWR_NUM) { + DFD_DEBUG_ERROR("Input num %d exceed max.\n", wr_len); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_I2C_GEN_WR); + goto exit; + } + + if (data_bitwidth == WIDTH_1Byte) { + for (i = 0; i < para_len; i++) { + wr_value[i] = strtol(argv[7 + i], &stopstring, 16); + DFD_DEBUG_DBG(" index :%d value 0x%x\n", i , wr_value[i]); + } + } else { + for (i = 0; i < para_len; i++) { + tmp_data = strtol(argv[7 + i], &stopstring, 16); + DFD_DEBUG_DBG(" index :%d value 0x%x\n", i , tmp_data); + for (j = 0; j < data_bitwidth; j++) { + tmp_data = strtol(argv[7 + i], &stopstring, 16); + wr_value[j + i * data_bitwidth] = (tmp_data >> (24 - 8 * j)) & 0xFF; + } + } + } + + dfd_utest_print_cmd(argc, argv); + + printf(":\n"); + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", i2c_bus); + + ret = dfd_i2c_gen_write(i2c_path, dev_addr, addr_bitwidth, offset_addr, wr_value, wr_len); + if (ret < 0) { + printf("write failed. ret:%d\n", ret); + } else { + printf("write success\n"); + } +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_i2c_rd(int argc, char* argv[]) +{ + int ret; + uint8_t value[DFD_UTEST_MAX_RDWR_NUM]; + uint16_t dev_addr, offset_addr; + char *stopstring; + int num, i2c_bus; + char i2c_path[32]; + + if (argc != 6) { + DFD_DEBUG_ERROR("params error\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_I2C_RD); + goto exit; + } + + i2c_bus = strtol(argv[2], &stopstring, 10); + dev_addr = strtol(argv[3], &stopstring, 16); + offset_addr = strtol(argv[4], &stopstring, 16); + num = strtol(argv[5], &stopstring, 10); + + if (num > DFD_UTEST_MAX_RDWR_NUM) { + DFD_DEBUG_ERROR("Input num %d exceed max.\n", num); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_I2C_RD); + goto exit; + } + + dfd_utest_print_cmd(argc, argv); + printf(":\n"); + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", i2c_bus); + mem_clear(value, sizeof(value)); + ret = dfd_read_port_i2c(i2c_path, dev_addr, offset_addr, value, num); + if (ret < 0) { + printf("failed ret %d\n", ret); + goto exit; + } + + dfd_utest_printf_reg(value, num, offset_addr); + +exit: + return DFD_RV_MODE_NOTSUPPORT; + +} + +int dfd_utest_i2c_wr(int argc, char* argv[]) +{ + int ret; + uint16_t dev_addr, offset_addr; + char *stopstring; + int i2c_bus; + char i2c_path[32]; + uint8_t wr_len,i; + uint8_t wr_value[DFD_UTEST_MAX_RDWR_NUM]; + + if (argc < 6) { + DFD_DEBUG_ERROR("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_I2C_WR); + goto exit; + } + + wr_len = argc - 5; + i2c_bus = strtol(argv[2], &stopstring, 10); + dev_addr = strtol(argv[3], &stopstring, 16); + offset_addr = strtol(argv[4], &stopstring, 16); + + for (i = 0; i < wr_len; i++) { + wr_value[i] = strtol(argv[5+i], &stopstring, 16); + DFD_DEBUG_DBG(" index :%d value %x\n", i , wr_value[i]); + } + + dfd_utest_print_cmd(argc, argv); + + printf(":\n"); + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", i2c_bus); + + ret = dfd_write_port_i2c(i2c_path, dev_addr, offset_addr, wr_value, wr_len); + if (ret < 0) { + printf("failed ret %d\n", ret); + } else { + printf("success\n"); + } +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_io_rd(int argc, char* argv[]) +{ + int ret; + uint8_t value[DFD_UTEST_MAX_RDWR_NUM]; + uint16_t offset_addr; + char *stopstring; + int num; + + if (argc != 4) { + DFD_DEBUG_ERROR("params error\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_IO_RD); + goto exit; + } + + offset_addr = strtol(argv[2], &stopstring, 16); + num = strtol(argv[3], &stopstring, 10); + + if (num > DFD_UTEST_MAX_RDWR_NUM) { + DFD_DEBUG_ERROR("Input num %d exceed max.\n", num); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_IO_RD); + goto exit; + } + + dfd_utest_print_cmd(argc, argv); + printf(":\n"); + mem_clear(value, sizeof(value)); + ret = dfd_read_io_port(offset_addr, value, num); + if (ret < 0) { + printf("failed ret %d\n", ret); + goto exit; + } + + dfd_utest_printf_reg(value, num, offset_addr); + +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_io_wr(int argc, char* argv[]) +{ + int ret; + uint16_t offset_addr; + char *stopstring; + int32_t wr_len,i; + uint8_t wr_value[DFD_UTEST_MAX_RDWR_NUM]; + + if (argc < 4) { + DFD_DEBUG_ERROR("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_IO_WR); + goto exit; + } + + wr_len = argc - 3; + if (wr_len > DFD_UTEST_MAX_RDWR_NUM) { + DFD_DEBUG_ERROR("Input num %d exceed max.\n", wr_len); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_IO_WR); + goto exit; + } + + offset_addr = strtol(argv[2], &stopstring, 16); + + for (i = 0; i < wr_len; i++) { + wr_value[i] = strtol(argv[3 + i], &stopstring, 16); + DFD_DEBUG_DBG(" index :%d value %x\n", i , wr_value[i]); + } + + dfd_utest_print_cmd(argc, argv); + + printf(":\n"); + ret = dfd_write_io_port(offset_addr, wr_value, wr_len); + if (ret < 0) { + printf("failed ret %d\n", ret); + } else { + printf("success\n"); + } +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_phymem_rd(int argc, char* argv[]) +{ + int ret, width; + uint8_t value[DFD_UTEST_MAX_RDWR_NUM]; + off_t offset_addr; + char *stopstring; + int num; + + if (argc != 5) { + DFD_DEBUG_ERROR("params error\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_PHYMEM_RD); + goto exit; + } + + width = strtol(argv[2], &stopstring, 10); + offset_addr = strtol(argv[3], &stopstring, 16); + num = strtol(argv[4], &stopstring, 10); + + if (num > DFD_UTEST_MAX_RDWR_NUM) { + DFD_DEBUG_ERROR("Input num %d exceed max.\n", num); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_PHYMEM_RD); + goto exit; + } + + dfd_utest_print_cmd(argc, argv); + printf(":\n"); + mem_clear(value, sizeof(value)); + ret = dfd_process_mem(DEV_MEM_NAME, 0, width, offset_addr, value, num); + if (ret < 0) { + printf("failed ret %d\n", ret); + goto exit; + } + + dfd_utest_printf_reg(value, num, offset_addr); + +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_phymem_wr(int argc, char* argv[]) +{ + int ret, width; + off_t offset_addr; + char *stopstring; + int32_t wr_len,i; + uint8_t wr_value[DFD_UTEST_MAX_RDWR_NUM]; + + if (argc < 5) { + DFD_DEBUG_ERROR("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_PHYMEM_WR); + goto exit; + } + + wr_len = argc - 4; + if (wr_len > DFD_UTEST_MAX_RDWR_NUM) { + DFD_DEBUG_ERROR("Input num %d exceed max.\n", wr_len); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_PHYMEM_WR); + goto exit; + } + + width = strtol(argv[2], &stopstring, 10); + offset_addr = strtol(argv[3], &stopstring, 16); + + for (i = 0; i < wr_len; i++) { + wr_value[i] = strtol(argv[4 + i], &stopstring, 16); + DFD_DEBUG_DBG(" index :%d value %x\n", i , wr_value[i]); + } + + dfd_utest_print_cmd(argc, argv); + + printf(":\n"); + ret = dfd_process_mem(DEV_MEM_NAME, 1, width, offset_addr, wr_value, wr_len); + if (ret < 0) { + printf("failed ret %d\n", ret); + } else { + printf("success\n"); + } +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_kmem_rd(int argc, char* argv[]) +{ + int ret, width; + uint8_t value[DFD_UTEST_MAX_RDWR_NUM]; + uint16_t offset_addr; + char *stopstring; + int num; + + if (argc != 5) { + DFD_DEBUG_ERROR("params error\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_KMEM_RD); + goto exit; + } + + width = strtol(argv[2], &stopstring, 10); + offset_addr = strtol(argv[3], &stopstring, 16); + num = strtol(argv[4], &stopstring, 10); + + if (num > DFD_UTEST_MAX_RDWR_NUM) { + DFD_DEBUG_ERROR("Input num %d exceed max.\n", num); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_KMEM_RD); + goto exit; + } + + dfd_utest_print_cmd(argc, argv); + printf(":\n"); + mem_clear(value, sizeof(value)); + ret = dfd_process_mem(DEV_KMEM_NAME, 0, width, offset_addr, value, num); + if (ret < 0) { + printf("failed ret %d\n", ret); + goto exit; + } + + dfd_utest_printf_reg(value, num, offset_addr); + +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_kmem_wr(int argc, char* argv[]) +{ + int ret; + uint16_t offset_addr, width; + char *stopstring; + int32_t wr_len,i; + uint8_t wr_value[DFD_UTEST_MAX_RDWR_NUM]; + + if (argc < 5) { + DFD_DEBUG_ERROR("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_KMEM_WR); + goto exit; + } + + wr_len = argc - 4; + if (wr_len > DFD_UTEST_MAX_RDWR_NUM) { + DFD_DEBUG_ERROR("Input num %d exceed max.\n", wr_len); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_KMEM_WR); + goto exit; + } + + width = strtol(argv[2], &stopstring, 10); + offset_addr = strtol(argv[3], &stopstring, 16); + + for (i = 0; i < wr_len; i++) { + wr_value[i] = strtol(argv[4 + i], &stopstring, 16); + DFD_DEBUG_DBG(" index :%d value %x\n", i , wr_value[i]); + } + + dfd_utest_print_cmd(argc, argv); + + printf(":\n"); + ret = dfd_process_mem(DEV_KMEM_NAME, 1, width, offset_addr, wr_value, wr_len); + if (ret < 0) { + printf("failed ret %d\n", ret); + } else { + printf("success\n"); + } +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +static unsigned long dfd_utest_get_file_size(const char *path) +{ + unsigned long filesize; + struct stat statbuff; + + if (stat(path, &statbuff) < 0) { + filesize = -1; + } else { + filesize = statbuff.st_size; + } + + return filesize; +} + +int dfd_utest_i2c_file_wr(int argc, char* argv[]) +{ + int ret; + uint16_t dev_addr, offset_addr; + char *stopstring; + int i2c_bus; + char i2c_path[32]; + char *file_name; + unsigned long filesize; + int fd; + uint8_t wr_buf[DFD_UTEST_MAX_RDWR_NUM]; + int len; + int bpt; /* byte per times*/ + int page_left; + + if (argc != 7) { + printf("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_I2C_FILE_WR); + goto exit; + } + + i2c_bus = strtol(argv[2], &stopstring, 10); + dev_addr = strtol(argv[3], &stopstring, 16); + offset_addr = strtol(argv[4], &stopstring, 16); + bpt = strtol(argv[5], &stopstring, 10); + file_name = argv[6]; + + if ((bpt <= 0) || (bpt > DFD_UTEST_MAX_RDWR_NUM)) { + bpt = DFD_UTEST_MAX_RDWR_NUM; + } + + if ((bpt & (bpt - 1)) != 0) { + printf("Bytes per times %d isn't power of two.\n",bpt); + goto exit; + } + + filesize = dfd_utest_get_file_size(file_name); + if (filesize <= 0) { + printf("Input invalid file %s, filesize %lu.\n", file_name, filesize); + goto exit; + } + + fd = open(file_name, O_RDONLY); + if (fd < 0) { + printf("open file[%s] fail.\n", file_name); + goto exit; + } + + dfd_utest_print_cmd(argc, argv); + + printf(":\n"); + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", i2c_bus); + + while (filesize > 0) { + mem_clear(wr_buf, DFD_UTEST_MAX_RDWR_NUM); + len = bpt; + if (offset_addr & (bpt - 1)) { + page_left = bpt - (offset_addr & (bpt - 1)); + len = len > page_left ? page_left : len; + } + + len = read(fd, wr_buf, len); + + ret = dfd_write_port_i2c(i2c_path, dev_addr, offset_addr, wr_buf, len); + if (ret < 0) { + break; + } + offset_addr += len; + filesize -= len; + } + + close(fd); + + if (ret < 0) { + printf("failed ret %d\n", ret); + } else { + printf("success\n"); + } + +exit: + return DFD_RV_MODE_NOTSUPPORT; + +} + +/* compare with sys_flie_wr, One more step is read back verification */ +int dfd_utest_sysfs_file_upg(int argc, char* argv[]) +{ + int ret = 0; + uint32_t offset_addr; + char *file_name; + char *sysfs_loc; + char *stopstring; + unsigned long filesize; + int fd, file_fd; + uint8_t wr_buf[DFD_UTEST_MAX_RDWR_NUM]; + int len, write_len, per_wr_len; + int i; + uint8_t reread_buf[DFD_UTEST_MAX_RDWR_NUM]; + int reback_len, reread_len; + int j = 0; + + if (argc != 5 && argc != 6) { + printf("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_SYSFS_FILE_UPG); + goto exit; + } + + sysfs_loc = argv[2]; + offset_addr = strtol(argv[3], &stopstring, 16); + file_name = argv[4]; + + if (argc == 6) { + per_wr_len = strtol(argv[5], &stopstring, 10); + if (per_wr_len > DFD_UTEST_MAX_RDWR_NUM || per_wr_len <= 0) { + printf("per_wr_byte %d invalid, not in range (0, 256]\n", per_wr_len); + goto exit; + } + } else { + per_wr_len = DFD_UTEST_DEFAULT_WR_NUM; + } + DFD_DEBUG_DBG("per_wr_byte: %d\n", per_wr_len); + filesize = dfd_utest_get_file_size(file_name); + if (filesize <= 0) { + printf("Input invalid file %s, filesize %lu.\n", file_name, filesize); + goto exit; + } + + fd = open(sysfs_loc, O_RDWR | O_SYNC); + if (fd < 0) { + printf("open file[%s] fail.\n", sysfs_loc); + goto exit; + } + + file_fd = open(file_name, O_RDONLY); + if (file_fd < 0) { + printf("open file[%s] fail.\n", file_name); + goto open_dev_err; + } + + dfd_utest_print_cmd(argc, argv); + + ret = lseek(fd, offset_addr, SEEK_SET); + if (ret < 0) { + printf("lseek file[%s offset=%d] fail,\n", sysfs_loc, offset_addr); + goto fail; + } + + printf(":\n"); + while (filesize > 0) { + if (filesize > (unsigned long)per_wr_len) { + len = per_wr_len; + } else { + len = filesize; + } + + mem_clear(wr_buf, DFD_UTEST_MAX_RDWR_NUM); + for (i = 0; i < DFD_I2C_RETRY_TIME; i++) { + len = read(file_fd, wr_buf, len); + if (len < 0) { + DFD_DEBUG_ERROR("read file[%s] fail, offset = 0x%x retrytimes = %d ret = %d\n", + sysfs_loc, offset_addr, i ,len); + usleep(DFD_I2C_RETRY_SLEEP_TIME); + continue; + } + break; + } + if (i == DFD_I2C_RETRY_TIME) { + printf("read file[%s] fail, offset = 0x%x, ret = %d\n", sysfs_loc, offset_addr, len); + goto fail; + } + + for (i = 0; i < DFD_I2C_RETRY_TIME; i++) { + write_len = write(fd, wr_buf, len); + if (write_len != len) { + DFD_DEBUG_ERROR("write file[%s] fail,offset = 0x%x retrytimes = %d len = %d,write_len =%d\n", + sysfs_loc, offset_addr, i ,len, write_len); + usleep(DFD_I2C_RETRY_SLEEP_TIME); + continue; + } + break; + } + if (i == DFD_I2C_RETRY_TIME) { + printf("write file[%s] fail, offset = 0x%x, len = %d,write_len =%d\n", + sysfs_loc, offset_addr, len, write_len); + goto fail; + } + + reback_len = write_len; + ret = lseek(fd, -reback_len, SEEK_CUR); + if (ret < 0) { + printf("reread lseek file[%s offset=%d] fail,lseek len=%d\n", + sysfs_loc, offset_addr, reback_len); + goto fail; + } + + mem_clear(reread_buf, DFD_UTEST_MAX_RDWR_NUM); + for (i = 0; i < DFD_I2C_RETRY_TIME; i++) { + reread_len = read(fd, reread_buf, reback_len); + if (reread_len != reback_len) { + DFD_DEBUG_ERROR("reread file[%s] fail,offset = 0x%x retrytimes = %d reread_len = %d,reback_len =%d\n", + sysfs_loc, offset_addr, i ,reread_len, reback_len); + usleep(DFD_I2C_RETRY_SLEEP_TIME); + continue; + } + break; + } + if (i == DFD_I2C_RETRY_TIME) { + printf("reread file[%s] fail, offset = 0x%x, reread_len = %d,reback_len = %d\n", + sysfs_loc, offset_addr, reread_len, reback_len); + goto fail; + } + + if (memcmp(reread_buf, wr_buf, reread_len) != 0) { + if (j < DFD_I2C_RETRY_TIME) { + DFD_DEBUG_ERROR("memcmp file[%s] fail,offset = 0x%x retrytimes = %d\n", + sysfs_loc, offset_addr, j); + j++; + ret = lseek(file_fd, -len, SEEK_CUR); + if (ret < 0) { + printf("retry file_fd lseek fail,lseek len=%d\n", len); + goto fail; + } + ret = lseek(fd, -write_len, SEEK_CUR); + if (ret < 0) { + printf("retry fd lseek fail,lseek len=%d\n", write_len); + goto fail; + } + continue; + } + + printf("upgrade file[%s] fail, offset = 0x%x.\n", sysfs_loc, offset_addr); + printf("want to write buf :\n"); + for (i = 0; i < reread_len; i++) { + printf("0x%x ", wr_buf[i]); + } + printf("\n"); + + printf("actually reread buf :\n"); + for (i = 0; i < reread_len; i++) { + printf("0x%x ", reread_buf[i]); + } + printf("\n"); + + goto fail; + } + + offset_addr += len; + filesize -= len; + usleep(5000); + } + + printf("success\n"); + close(file_fd); + close(fd); + return DFD_RV_OK; + +fail: + close(file_fd); +open_dev_err: + close(fd); +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_sysfs_file_wr(int argc, char* argv[]) +{ + int ret = 0; + uint32_t offset_addr; + char *file_name; + char *sysfs_loc; + char *stopstring; + unsigned long filesize; + int fd, file_fd; + uint8_t wr_buf[DFD_UTEST_MAX_RDWR_NUM]; + int len, write_len, per_wr_len; + int i; + + if (argc != 5 && argc != 6) { + printf("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_SYSFS_FILE_WR); + goto exit; + } + + sysfs_loc = argv[2]; + offset_addr = strtol(argv[3], &stopstring, 16); + file_name = argv[4]; + + if (argc == 6) { + per_wr_len = strtol(argv[5], &stopstring, 10); + if (per_wr_len > DFD_UTEST_MAX_RDWR_NUM || per_wr_len <= 0) { + printf("per_wr_byte %d invalid, not in range (0, 256]\n", per_wr_len); + goto exit; + } + } else { + per_wr_len = DFD_UTEST_DEFAULT_WR_NUM; + } + DFD_DEBUG_DBG("per_wr_byte: %d\n", per_wr_len); + filesize = dfd_utest_get_file_size(file_name); + if (filesize <= 0) { + printf("Input invalid file %s, filesize %lu.\n", file_name, filesize); + goto exit; + } + + fd = open(sysfs_loc, O_RDWR | O_SYNC); + if (fd < 0) { + printf("open file[%s] fail.\n", sysfs_loc); + goto exit; + } + + file_fd = open(file_name, O_RDONLY); + if (file_fd < 0) { + printf("open file[%s] fail.\n", file_name); + goto open_dev_err; + } + + dfd_utest_print_cmd(argc, argv); + + ret = lseek(fd, offset_addr, SEEK_SET); + if (ret < 0) { + printf("lseek file[%s offset=%d] fail,\n", sysfs_loc, offset_addr); + goto fail; + } + + printf(":\n"); + while (filesize > 0) { + if (filesize > (unsigned long)per_wr_len) { + len = per_wr_len; + } else { + len = filesize; + } + + mem_clear(wr_buf, DFD_UTEST_MAX_RDWR_NUM); + for (i = 0; i < DFD_I2C_RETRY_TIME; i++) { + len = read(file_fd, wr_buf, len); + if (len < 0) { + DFD_DEBUG_ERROR("read file[%s] fail, offset = 0x%x retrytimes = %d ret = %d\n", + sysfs_loc, offset_addr, i ,len); + usleep(DFD_I2C_RETRY_SLEEP_TIME); + continue; + } + break; + } + if (i == DFD_I2C_RETRY_TIME) { + printf("read file[%s] fail, offset = 0x%x, ret = %d\n", sysfs_loc, offset_addr, len); + goto fail; + } + for (i = 0; i < DFD_I2C_RETRY_TIME; i++) { + write_len = write(fd, wr_buf, len); + if (write_len != len) { + DFD_DEBUG_ERROR("write file[%s] fail,offset = 0x%x retrytimes = %d len = %d,write_len =%d\n", sysfs_loc, offset_addr, i ,len, write_len); + usleep(DFD_I2C_RETRY_SLEEP_TIME); + continue; + } + break; + } + + if(i == DFD_I2C_RETRY_TIME) { + printf("write file[%s] fail, offset = 0x%x, len = %d,write_len =%d\n", sysfs_loc, offset_addr, len, write_len); + ret = -1; + goto fail; + } + offset_addr += len; + filesize -= len; + usleep(5000); + } + + printf("success\n"); + close(file_fd); + close(fd); + return DFD_RV_OK; + +fail: + close(file_fd); +open_dev_err: + close(fd); +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_sysfs_file_rd(int argc, char* argv[]) +{ + int ret = 0; + uint32_t offset_addr; + char *sysfs_loc; + char *stopstring; + int fd; + uint8_t rd_buf[DFD_UTEST_MAX_RDWR_NUM]; + int len, read_len;; + + if (argc != 5) { + printf("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_SYSFS_FILE_RD); + goto exit; + } + + sysfs_loc = argv[2]; + offset_addr = strtol(argv[3], &stopstring, 16); + len = strtol(argv[4], &stopstring, 10); + + if (len > DFD_UTEST_MAX_RDWR_NUM) { + printf("Input num %d exceed max 256.\n", len); + goto exit; + } + + fd = open(sysfs_loc, O_RDONLY); + if (fd < 0) { + printf("open file[%s] fail.\n", sysfs_loc); + goto exit; + } + dfd_utest_print_cmd(argc, argv); + + printf(":\n"); + + ret = lseek(fd, offset_addr, SEEK_SET); + if (ret < 0) { + printf("lseek failed ret %d.\n", ret); + goto fail; + } + + mem_clear(rd_buf, DFD_UTEST_MAX_RDWR_NUM); + read_len = read(fd, rd_buf, len); + if (read_len != len) { + printf("read failed read_len %d len %d.\n", read_len, len); + goto fail; + } + dfd_utest_printf_reg(rd_buf, read_len, offset_addr); + close(fd); + return DFD_RV_OK; + +fail: + close(fd); +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_msr_rd(int argc, char* argv[]) +{ + int fd; + char msr_file_name[64]; + uint64_t data; + uint64_t read_result; + char *stopstring; + uint8_t cpu_index, width; + uint64_t offset; + + if (argc != 5) { + printf("rdmsr failed: Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_MSR_RD); + goto exit; + } + + cpu_index = strtol(argv[2], &stopstring, 10); + offset = strtol(argv[3], &stopstring, 16); + width = strtol(argv[4], &stopstring, 10); + + if (width != 8 && width != 16 && width != 32 && width != 64) { + printf("rdmsr failed: width:%u Input invalid.only support 8 16 32 64\n", width); + goto exit; + } + + mem_clear(msr_file_name, sizeof(msr_file_name)); + sprintf(msr_file_name, "/dev/cpu/%u/msr", cpu_index); + + fd = open(msr_file_name, O_RDONLY); + if (fd < 0) { + if (errno == ENXIO) { + fprintf(stderr, "rdmsr failed: No CPU %u\n", cpu_index); + } else if (errno == EIO) { + fprintf(stderr, "rdmsr failed: CPU %u doesn't support MSRs\n", cpu_index); + } else if (errno == ENOENT) { + fprintf(stderr, "rdmsr failed: can't find %s file, Please check if modprobe msr driver already\n", msr_file_name); + } else { + printf("rdmsr failed: %s open failed. errno:%d\n", msr_file_name, errno); + } + goto exit; + } + + if (pread(fd, &data, sizeof(data), offset) != sizeof(data)) { + fprintf(stderr, "rdmsr failed: CPU:%u offset:0x%lx read failed\n", cpu_index, offset); + goto fail; + } + + switch (width) { + case 8: + read_result = (volatile uint8_t)data; + break; + case 16: + read_result = (volatile uint16_t)data; + break; + case 32: + read_result = (volatile uint32_t)data; + break; + case 64: + read_result = (volatile uint64_t)data; + break; + default: + printf("rdmsr failed: width:%u illegal width.\n", width); + goto fail; + } + + printf("0x%lx\n", read_result); + close(fd); + return DFD_RV_OK; + +fail: + close(fd); +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_utest_sysfs_data_wr(int argc, char* argv[]) +{ + uint32_t offset; + char *sysfs_loc; + char *stopstring; + uint8_t wr_buf[DFD_UTEST_MAX_RDWR_NUM]; + int ret, i; + int fd, len, write_len, index; + + if (argc < 5) { + DFD_DEBUG_ERROR("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_SYSFS_DATA_WR); + goto exit; + } + + dfd_utest_print_cmd(argc, argv); + printf(":\n"); + + sysfs_loc = argv[2]; + offset = strtol(argv[3], &stopstring, 16); + len = argc - 4; + mem_clear(wr_buf, sizeof(wr_buf)); + for (i = 0; i < len; i++) { + wr_buf[i] = strtol(argv[4 + i], &stopstring, 16); + DFD_DEBUG_DBG("index :%d value %x\n", i , wr_buf[i]); + } + + fd = open(sysfs_loc, O_RDWR | O_SYNC); + if (fd < 0) { + printf("open file[%s] fail.\n", sysfs_loc); + goto exit; + } + + ret = lseek(fd, offset, SEEK_SET); + if (ret < 0) { + printf("lseek file[%s offset=%d] fail,\n", sysfs_loc, offset); + goto fail; + } + index = 0; + while (len > 0) { + for (i = 0; i < DFD_I2C_RETRY_TIME; i++) { + write_len = write(fd, &wr_buf[index], len); + if (write_len < 0) { + DFD_DEBUG_ERROR("write file[%s] fail, retrytimes: %d, offset: 0x%x, len: %d, write_len: %d\n", + sysfs_loc, offset, i, len, write_len); + usleep(DFD_I2C_RETRY_SLEEP_TIME); + continue; + } + if (write_len == 0) { + DFD_DEBUG_ERROR("write file[%s] EOF, offset: 0x%x, len: %d, write_len: %d\n", + sysfs_loc, offset, len, write_len); + goto fail; + } + break; + } + if(i == DFD_I2C_RETRY_TIME) { + printf("write file[%s] fail, offset: 0x%x, len: %d, write_len: %d\n", + sysfs_loc, offset, len, write_len); + goto fail; + } + offset += write_len; + index += write_len; + len -= write_len; + usleep(5000); + } + printf("success\n"); + close(fd); + return DFD_RV_OK; +fail: + close(fd); +exit: + return DFD_RV_MODE_NOTSUPPORT; +} + +static void phy_help(char *name) +{ + fprintf(stderr, + "Usage: %s phy_index(dec) regnum(hex) [regval(hex)] \n" + " phy_index phydev index \n" + " regnum phydev register address \n" + " regval phydev register value \n", + name); + return; +} + +static void mdio_help(char *name) +{ + fprintf(stderr, + "Usage: %s mdio_index(dec) phyaddr(hex) regnum(hex) [regval(hex)] \n" + " mdio_index mdiodev index \n" + " phyaddr phydev address \n" + " regnum phydev register address \n" + " regval phydev register value \n", + name); + return; +} + +static int phydev_arg_parse(int argc, char* argv[], int *phy_index, uint32_t *regnum, uint32_t *regval, + int num_arg) +{ + + unsigned long index, regaddr, value; + char *end; + + if (argc != num_arg) { + return -EINVAL; + } + + index = strtoul(argv[2], &end, 0); + if (*end) { + fprintf(stderr, "Error: index invalid!\n"); + return -EINVAL; + } + + regaddr = strtoul(argv[3], &end, 0); + if (*end || regaddr > 0xffff) { + fprintf(stderr, "Error: regaddr invalid!\n"); + return -EINVAL; + } + + if (argc > 4) { + value = strtoul(argv[4], &end, 0); + if (*end || value > 0xffff) { + fprintf(stderr, "Error: reg data invalid!\n"); + return -EINVAL; + } + + *regval = (uint32_t)value; + } + + *phy_index = (uint32_t)index; + *regnum = (uint32_t)regaddr; + + return 0; +} + +static int mdiodev_arg_parse(int argc, char* argv[], int *mdio_index, int *phyaddr, uint32_t *regnum, + uint32_t *regval, int num_arg) +{ + + unsigned long index, addr, regaddr, value; + char *end; + + if (argc != num_arg) { + return -EINVAL; + } + + index = strtoul(argv[2], &end, 0); + if (*end) { + fprintf(stderr, "Error: index invalid!\n"); + return -EINVAL; + } + + addr = strtoul(argv[3], &end, 0); + if (*end || addr > 0x1f) { + fprintf(stderr, "Error: phyaddr invalid!\n"); + return -EINVAL; + } + + regaddr = strtoul(argv[4], &end, 0); + if (*end || regaddr > 0xffff) { + fprintf(stderr, "Error: regaddr invalid!\n"); + return -EINVAL; + } + + if (argc > 5) { + value = strtoul(argv[5], &end, 0); + if (*end || value > 0xffff) { + fprintf(stderr, "Error: reg data invalid!\n"); + return -EINVAL; + } + + *regval = (uint32_t)value; + } + + *mdio_index = (uint32_t)index; + *phyaddr = (int)addr; + *regnum = (uint32_t)regaddr; + + return 0; +} + +int dfd_utest_phydev_list(int argc, char* argv[]) +{ + int fd; + + if (argc != 2) { + printf("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_PHYDEV_LIST); + return DFD_RV_MODE_NOTSUPPORT; + } + + argv = argv; + fd = open("/dev/dram_test", O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); + if (fd < 0) { + fprintf(stderr, "Error: Could not open file " + "/dev/dram: %s\n", strerror(errno)); + return -1; + } + + (void)ioctl(fd, CMD_PHY_LIST, NULL); + + close(fd); + + return 0; +} + +int dfd_utest_phydev_rd(int argc, char* argv[]) +{ + struct phydev_user_info phy_info; + int fd; + long int ret; + + ret = phydev_arg_parse(argc, argv, &phy_info.phy_index, &phy_info.regnum, &phy_info.regval, 4); + if (ret < 0) { + phy_help("phydev_rd"); + return -1; + } + + fd = open("/dev/dram_test", O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); + if (fd < 0) { + fprintf(stderr, "Error: Could not open file " + "/dev/dram: %s\n", strerror(errno)); + return -1; + } + + ret = ioctl(fd, CMD_PHY_READ, &phy_info); + if (ret < 0) { + fprintf(stderr, "Error: phy read error : %s\n", strerror(errno)); + close(fd); + return -1; + } + + close(fd); + + printf("Read success --- phydev%d regnum: 0x%x, value: 0x%x\n",phy_info.phy_index, + phy_info.regnum, phy_info.regval); + + return 0; +} + +int dfd_utest_phydev_wr(int argc, char* argv[]) +{ + struct phydev_user_info phy_info; + int fd; + long int ret; + + ret = phydev_arg_parse(argc, argv, &phy_info.phy_index, &phy_info.regnum, &phy_info.regval, 5); + if (ret < 0) { + phy_help("phydev_wr"); + return -1; + } + + fd = open("/dev/dram_test", O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); + if (fd < 0) { + fprintf(stderr, "Error: Could not open file " + "/dev/dram: %s\n", strerror(errno)); + return -1; + } + + ret = ioctl(fd, CMD_PHY_WRITE, &phy_info); + if (ret < 0) { + fprintf(stderr, "Error: phy write error : %s\n", strerror(errno)); + close(fd); + return -1; + } + + close(fd); + + printf("write success --- phydev%d regnum: 0x%x, value: 0x%x\n",phy_info.phy_index, + phy_info.regnum, phy_info.regval); + + return 0; +} + +int dfd_utest_mdiodev_list(int argc, char* argv[]) +{ + int fd; + + if (argc != 2) { + printf("Input invalid.\n"); + dfd_utest_printf_single_help(DFD_UTEST_ITEM_MDIODEV_LIST); + return DFD_RV_MODE_NOTSUPPORT; + } + + argv = argv; + fd = open("/dev/dram_test", O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); + if (fd < 0) { + fprintf(stderr, "Error: Could not open file " + "/dev/dram: %s\n", strerror(errno)); + return -1; + } + + (void)ioctl(fd, CMD_MDIO_LIST, NULL); + + close(fd); + + return 0; +} + +int dfd_utest_mdiodev_rd(int argc, char* argv[]) +{ + struct mdio_dev_user_info mdio_info; + int fd; + long int ret; + + ret = mdiodev_arg_parse(argc, argv, &mdio_info.mdio_index, &mdio_info.phyaddr, + &mdio_info.regnum, &mdio_info.regval, 5); + if (ret < 0) { + mdio_help("mdiodev_rd"); + return -1; + } + + fd = open("/dev/dram_test", O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); + if (fd < 0) { + fprintf(stderr, "Error: Could not open file " + "/dev/dram: %s\n", strerror(errno)); + return -1; + } + + ret = ioctl(fd, CMD_MDIO_READ, &mdio_info); + if (ret < 0) { + fprintf(stderr, "Error: mdio read error : %s\n", strerror(errno)); + close(fd); + return -1; + } + + close(fd); + + printf("Read success\n mdio_index phyaddr regnum value\n"); + printf(" %-10d %#-10x %#-10x %#-10x\n", mdio_info.mdio_index, mdio_info.phyaddr, + mdio_info.regnum, mdio_info.regval); + + return 0; +} + +int dfd_utest_mdiodev_wr(int argc, char* argv[]) +{ + struct mdio_dev_user_info mdio_info; + int fd; + long int ret; + + ret = mdiodev_arg_parse(argc, argv, &mdio_info.mdio_index, &mdio_info.phyaddr, + &mdio_info.regnum, &mdio_info.regval, 6); + if (ret < 0) { + mdio_help("mdiodev_wr"); + return -1; + } + + fd = open("/dev/dram_test", O_RDWR, S_IRWXU | S_IRWXG | S_IRWXO); + if (fd < 0) { + fprintf(stderr, "Error: Could not open file " + "/dev/dram: %s\n", strerror(errno)); + return -1; + } + + ret = ioctl(fd, CMD_MDIO_WRITE, &mdio_info); + if (ret < 0) { + fprintf(stderr, "Error: mdio write error : %s\n", strerror(errno)); + close(fd); + return -1; + } + + close(fd); + + printf("write success\n mdio_index phyaddr regnum value\n"); + printf(" %-10d %#-10x %#-10x %#-10x\n", mdio_info.mdio_index, mdio_info.phyaddr, + mdio_info.regnum, mdio_info.regval); + + return 0; +} + +dfd_utest_proc_fun dfd_utest_get_proc_func(char *type_str) +{ + int i, tbl_size; + + tbl_size = sizeof(g_dfd_unit_test) / sizeof(g_dfd_unit_test[0]); + + for (i = 0; i < tbl_size; i++) { + if (!strncmp(g_dfd_unit_test[i].type_str, type_str, strlen(g_dfd_unit_test[i].type_str))) { + return g_dfd_unit_test[i].utest_func; + } + } + DFD_DEBUG_DBG("type: %s not match.\n", type_str); + return NULL; +} + +void dfd_utest_cmd_main(int argc, char* argv[]) +{ + dfd_utest_proc_fun pfunc; + int ret; + + if (argc < 2) { + dfd_utest_print_all_help(); + return; + } + + pfunc = dfd_utest_get_proc_func(argv[1]); + if (pfunc == NULL) { + DFD_DEBUG_DBG("utest type %s in not support.\n", argv[1]); + dfd_utest_print_all_help(); + return; + } + ret = pfunc(argc, argv); + if ((ret != DFD_RV_MODE_NOTSUPPORT) && (ret != DFD_RV_INDEX_INVALID)) { + if (ret == DFD_RV_OK) { + DFD_DEBUG_DBG(" [SUCCESS]\n"); + } else { + DFD_DEBUG_DBG(" [FAIL(%d)]\n", ret); + } + } + + return; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_utest.h b/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_utest.h new file mode 100644 index 000000000000..1ae65148ea9c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/dev_util/dfd_utest.h @@ -0,0 +1,109 @@ +/* monitor_utest.h */ +#ifndef __DFD_UTEST_H__ +#define __DFD_UTEST_H__ + +#include + +extern int g_dfd_debug_sw; +extern int g_dfd_debugpp_sw; + +#define DFD_UTEST_TRUE_FALSE_STRING(flag) ((flag == true) ? "true" : "false") + +#define DFD_DEBUG_DBG(fmt, args...) do { \ + if (g_dfd_debug_sw) { \ + printf("" fmt,\ + ##args); \ + } \ +} while (0) + +#define DFD_DEBUG_ERROR(fmt, args...) do { \ + if (g_dfd_debugpp_sw) { \ + printf("" fmt,\ + ##args); \ + } \ +} while (0) + +#define mem_clear(data, size) memset((data), 0, (size)) + +typedef enum dfd_rv_s { + DFD_RV_OK = 0, + DFD_RV_INIT_ERR = 1, + DFD_RV_SLOT_INVALID = 2, + DFD_RV_MODE_INVALID = 3, + DFD_RV_MODE_NOTSUPPORT = 4, + DFD_RV_TYPE_ERR = 5, + DFD_RV_DEV_NOTSUPPORT = 6, + DFD_RV_DEV_FAIL = 7, + DFD_RV_INDEX_INVALID = 8, + DFD_RV_NO_INTF = 9, + DFD_RV_NO_NODE = 10, + DFD_RV_NODE_FAIL = 11, +} dfd_rv_t; + +#define DFD_DEBUG_BUF_LEN (32) +#define DFD_DEBUGP_DEBUG_FILE "/sbin/.dfd_debugp_flag" +#define DFD_DEBUGPP_DEBUG_FILE "/sbin/.dfd_debugpp_flag" + +#define DFD_UTEST_MAX_PARA_NUM (4) +#define DFD_UTEST_TYPE_STRING_LEN (64) +#define DFD_UTEST_MATCH_STRING_LEN (64) +#define DFD_UTEST_HELP_STRING_LEN (256) +#define DFD_UTEST_INVALID_PARA (-1) +#define DFD_UTEST_BUFF_LEN (64) + +typedef enum dfd_fpga_cpld_flag_e { + DFD_CPLD_RW_FLAG = 0x00, + DFD_FPGA_RW_FLAG = 0x01, +} dfd_fpga_cpld_flag_t; + +typedef int (* dfd_utest_proc_fun)(int argc, char* argv[]); + +#define DFD_UTEST_ITEM_ALL \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_I2C_RD, i2c_rd, "i2c_rd [i2c_bus] [slave_addr] [offset] [len]", "i2c_rd [i2c_bus] [slave_addr] [offset] [len]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_I2C_WR, i2c_wr, "i2c_wr [i2c_bus] [slave_addr] [offset] [data0] ... [dataN]", "i2c_wr [i2c_bus] [slave_addr] [offset] [data0] ... [dataN]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_IO_RD, io_rd, "io_rd [offset] [len]", "io_rd [offset] [len]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_IO_WR, io_wr, "io_wr [offset] [data0]... [dataN]", "io_wr [offset] [data0]... [dataN]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_PHYMEM_RD, phymem_rd, "phymem_rd [bit_width] [offset] [len]", "phymem_rd [bit_width] [offset] [len]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_PHYMEM_WR, phymem_wr, "phymem_wr [bit_width] [offset] [data0]... [dataN]", "phymem_wr [bit_width] [offset] [data0]... [dataN]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_KMEM_RD, kmem_rd, "kmem_rd [bit_width] [offset] [len]", "kmem_rd [bit_width] [offset] [len]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_KMEM_WR, kmem_wr, "kmem_wr [bit_width][offset] [data0]... [dataN]", "kmem_wr [bit_width] [offset] [data0]... [dataN]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_I2C_FILE_WR, i2c_file_wr, "i2c_file_wr [i2c_bus] [slave_addr] [offset] [bpt] [filename]", "i2c_file_wr [i2c_bus] [slave_addr] [offset] [bpt] [filename]\nbpt:bytes per times") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_SYSFS_FILE_WR, sysfs_file_wr, "sysfs_file_wr [sysfs_loc] [offset] [filename] [per_wr_byte]", "sysfs_file_wr [sysfs_loc] [offset] [filename] [per_wr_byte]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_SYSFS_FILE_RD, sysfs_file_rd, "sysfs_file_rd [sysfs_loc] [offset] [len]", "sysfs_file_rd [sysfs_loc] [offset] [len]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_SYSFS_FILE_UPG, sysfs_file_upg, "sysfs_file_upg [sysfs_loc] [offset] [filename] [per_wr_byte]", "sysfs_file_upg [sysfs_loc] [offset] [filename] [per_wr_byte]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_I2C_GEN_RD, i2c_gen_rd, "i2c_gen_rd [i2c_bus] [slave_addr] [addr_bitwidth] [offset] [data_bitwidth] [len]", "i2c_gen_rd [i2c_bus] [slave_addr] [addr_bitwidth] [offset] [data_bitwidth] [len]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_I2C_GEN_WR, i2c_gen_wr, "i2c_gen_wr [i2c_bus] [slave_addr] [addr_bitwidth] [offset] [data_bitwidth] [data0]... [dataN]", "i2c_gen_wr [i2c_bus] [slave_addr] [addr_bitwidth] [offset] [data_bitwidth] [data0]... [dataN]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_MSR_RD, msr_rd, "msr_rd [cpu_index] [offset] [width]", "msr_rd [cpu_index] [offset] [width]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_SYSFS_DATA_WR, sysfs_data_wr, "sysfs_data_wr [sysfs_loc] [offset] [data0] ... [dataN]", "sysfs_data_wr [sysfs_loc] [offset] [data0] ... [dataN]]") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_PHYDEV_LIST, phydev_list, "phydev_list", "phydev_list") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_PHYDEV_RD, phydev_rd, "phydev_rd phy_index reg_addr", "phydev_rd phy_index reg_addr") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_PHYDEV_WR, phydev_wr, "phydev_wr phy_index reg_addr reg_data", "phydev_wr phy_index reg_addr reg_data") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_MDIODEV_LIST, mdiodev_list, "mdiodev_list", "mdiodev_list") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_MDIODEV_RD, mdiodev_rd, "mdiodev_rd mdio_index phyaddr reg_addr", "mdiodev_rd mdio_index phyaddr reg_addr") \ + DFD_UTEST_ITEM(DFD_UTEST_ITEM_MDIODEV_WR, mdiodev_wr, "mdiodev_wr mdio_index phyaddr reg_addr reg_data", "mdiodev_wr mdio_index phyaddr reg_addr reg_data") \ + +#ifdef DFD_UTEST_ITEM +#undef DFD_UTEST_ITEM +#endif +#define DFD_UTEST_ITEM(_id, _type_str, _help_info, _help_info_detail) _id, +typedef enum dfd_utest_item_id_s { + DFD_UTEST_ITEM_ALL +} dfd_utest_item_id_t; + +typedef struct { + int utest_type; + char type_str[DFD_UTEST_TYPE_STRING_LEN]; + dfd_utest_proc_fun utest_func; + char help_info[DFD_UTEST_HELP_STRING_LEN]; + char help_info_detail[DFD_UTEST_HELP_STRING_LEN]; +} dfd_utest_t; + +void dfd_utest_cmd_main(int argc, char* argv[]); + +#ifdef DFD_UTEST_ITEM +#undef DFD_UTEST_ITEM +#endif +#define DFD_UTEST_ITEM(_id, _type_str, _help_info, _help_info_detail) int dfd_utest_##_type_str(int argc, char* argv[]); +DFD_UTEST_ITEM_ALL + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/Makefile new file mode 100644 index 000000000000..1701b5f62114 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/Makefile @@ -0,0 +1,18 @@ +top_srcdir:=$(shell pwd) +include $(top_srcdir)/Rules.mk + +firmware-y:= +firmware-y += fw_upgrade + +.PHONY: all +all: build + +.PHONY: build +build: $(firmware-y) +$(foreach dir,$(firmware-y),$(eval $(call compile_dirs,$(dir)))) + +.PHONY: rpmpkg +rpmpkg: +ifeq ("$(CONFIG_CPLD_UPGRADE_ISPVME)", "y") + #$(RPMPKG) $(install_cpld_dir) firmware-cpld-ispvme.spec git +endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/Rules.mk b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/Rules.mk new file mode 100644 index 000000000000..5fb5a09d34fd --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/Rules.mk @@ -0,0 +1,42 @@ +CC ?= $(CROSS)gcc +AR ?= $(CROSS)ar +AS ?= $(CROSS)as +LD ?= $(CROSS)ld +STRIP ?= $(CROSS)strip + +install_root:=${top_srcdir}/images + +install_header_dir:=${install_root}/header +install_adir:=$(install_root)/lib +install_symbol_dir:=$(install_root)/symbol +symbol_files:=$(shell find $(EXPORT_SYMBOL) -name 'Module.symvers') +# +# symbol_files += $(shell find $(install_symbol_dir) -name 'Module.symvers') +# KBUILD_EXTRA_SYMBOLS += $(symbol_files) +# export KBUILD_EXTRA_SYMBOLS + +# top root: install_rootfs_dir +install_rootfs_dir:=$(install_root)/rootfs + +install_sodir:=$(install_rootfs_dir)/$(INSTALL_SODIR) + +install_usr_bin_dir:=$(install_rootfs_dir)/usr/bin +install_sbin_dir:=$(install_rootfs_dir)/sbin +install_etc_dir:=$(install_rootfs_dir)/etc + +export INSTALL_MOD_PATH:=$(ROOT) + +BUILD_CFLAGS:=$(CFLAGS) -I$(install_header_dir) +BUILD_LDFLAGS:=$(LDFLAGS) -L/$(install_sodir) -L/$(install_adir) + +define compile_dirs +.PHONY: $(1) +$(1): + @echo;echo "building $(1)..." + @$(MAKE) -C ${1} +endef + +compile.c = $(CC) $(BUILD_CFLAGS) -d -c -o $@ $< +%.o: %.c + $(compile.c) + diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/Makefile new file mode 100644 index 000000000000..8b4bca739087 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/Makefile @@ -0,0 +1,39 @@ +include ../Rules.mk + +OBJ = fw_upgrade.o fw_upgrade_debug.o + +LIB += $(BUILD_CFALGS) $(BUILD_LDFLAGS) -lpthread +ifdef ENABLE_GCOV +ifeq ($(ENABLE_GCOV), y) +LIB += -fprofile-arcs +endif +endif # ENABLE_GCOV + +APP = fw_upgrade +BUILD_DIR = tmp +ELF_FILE = $(BUILD_DIR)/$(APP) +MAP_FILE = $(BUILD_DIR)/$(APP).map.sym +INCLUDE = -Iinclude +CFLAGS+=-Wall -W -g + +.PHONY: build +build:make-dir $(addprefix $(BUILD_DIR)/,$(OBJ)) + $(CC) -o $(ELF_FILE) $(addprefix $(BUILD_DIR)/,$(OBJ)) $(LINKFLAGS) $(LIB) + + cp -p $(ELF_FILE) $(common_out_put_dir) + +.PHONY: make-dir +make-dir: + @mkdir -p $(BUILD_DIR) + +$(BUILD_DIR)/%.o:%.c + $(CC) -c $(CFLAGS) $(INCLUDE) $< -o $@ + +.PHONY: install +install: + echo "fw_upgrade install success." + cp -p $(ELF_FILE) $(common_out_put_dir) + +.PHONY: clean +clean: + rm -rf $(BUILD_DIR) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/fw_upgrade.c b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/fw_upgrade.c new file mode 100644 index 000000000000..2045608d5c3b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/fw_upgrade.c @@ -0,0 +1,1632 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "fw_upgrade.h" + +static flash_info_t flash_info[] = { + { + .flash_name = "M25L6433F", + .flash_size = M32, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = MX25L6433F, + .block_size = STEP_64, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "S25FL512S", + .flash_size = M64, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = S25FL512S, + .block_size = STEP_256, + .full_erase = 0, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "MX25l512", + .flash_size = M64, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = MX25l512, + .block_size = STEP_64, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "STM25P64", + .flash_size = M12, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = STM25P64, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "STM25P128", + .flash_size = M16, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = STM25P128, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "N25Q256", + .flash_size = M16, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = N25Q256, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "N25Q512", + .flash_size = M16, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = N25Q512, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "W25X16", + .flash_size = M3, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = W25X16, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "W25X64", + .flash_size = M12, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = W25X64, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "W25Q64BV", + .flash_size = M12, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = W25Q64BV, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "W25Q128BV", + .flash_size = M16, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = W25Q128BV, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "W25Q256FV", + .flash_size = M16, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = W25Q256FV, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "MX25L1605D", + .flash_size = M32, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = MX25L1605D, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "MX25L12805D", + .flash_size = M32, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = MX25L12805D, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "MX66L1G45G", + .flash_size = M128, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = MX66L1G45G, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, + { + .flash_name = "GD25Q256", + .flash_size = M16, + .flash_type = SPI, + .page_size = BYTE_256, + .flash_id = GD25Q256, + .block_size = STEP_256, + .full_erase = 1, + .erase_block_command = BLOCK_ERASE_64, + .page_program = COMMON_PAGE_PROGRAM, + }, +}; + +static int debug_on; + +static void help(void) +{ + printf("------------------------------BMC Upgrade Tool--------------------------------\n"); + printf("Program Flash:\n"); + printf("\tfw_upgrade upgrade [file name] [chip select: 0 | 1 | 2] "); + printf("[erase type: full | block]\n"); + printf("\t[file name] if file is not located at /home/admin, path should be added\n"); + printf("\t[chip select] 0:master, 1:slave, 2:both\n"); + printf("\t[erase type] choose a way to erase chip, full erase would be faster\n"); + printf("Read BMC Reg:\n"); + printf("\tfw_upgrade rd [address] [length]\n"); + printf("\t[address(Hexadecimal)] register address of BMC\n"); + printf("\t[length(decimal)] length of read data, should be times of 4\n"); + + return; +} + +static int set_ioport_rw_access(void) +{ + + if ( iopl(3) < 0) { + printf("Can't get access to /dev/port \n"); + return -1; + } + + return 0; +} + +static int get_file_size(char *file_name) +{ + FILE * pFile; + int size; + + pFile = fopen(file_name,"rb"); + if (pFile == NULL) { + printf("Error opening file\n"); + return -1; + } + fseek (pFile, 0, SEEK_END); + size = ftell(pFile); + fclose (pFile); + return size; +} + +static uint8_t _read(uint16_t addr) +{ + return inb(addr); +} + +static void _write(uint16_t addr, uint8_t val) +{ + outb(val, addr); + + return; +} + +static void write_addr_port(uint8_t addr_val, uint16_t addr_port) +{ + _write(addr_port, addr_val); + + return; +} + +static void write_data_port(uint8_t val, uint16_t data_port) +{ + _write(data_port, val); + + return; +} + +static uint8_t read_data_port(uint16_t data_port) +{ + return _read(data_port); +} + +static void write_ilpc2ahb_addr(uint32_t addr) +{ + int i; + + for (i = 0; i < 4; i++) { + write_addr_port(SUPERIO_REG0 + i, LPC_ADDR_PORT); + write_data_port((addr >> (8 * (3 - i))) & MASK, LPC_DATA_PORT); + } + + return; +} + +static void write_ilpc2ahb_data(uint32_t data) +{ + int i; + + for (i = 0; i < 4; i++) { + write_addr_port(SUPERIO_REG4 + i, LPC_ADDR_PORT); + write_data_port((data >> (8 * (3 - i))) & MASK, LPC_DATA_PORT); + } + + return; +} + +static uint32_t read_ilpc2ahb_data(void) +{ + int i, tmp; + uint32_t res; + + res = 0; + for (i = 0; i < 4; i++) { + write_addr_port(SUPERIO_REG4 + i, LPC_ADDR_PORT); + tmp = read_data_port(LPC_DATA_PORT); + res |= (tmp << (8 * (3 - i))); + } + + return res; +} + +static void trigger_ilpc2ahb_read(void) +{ + write_addr_port(SUPERIO_FE, LPC_ADDR_PORT); + read_data_port(LPC_DATA_PORT); + + return; +} + +static void trigger_ilpc2ahb_write(void) +{ + write_addr_port(SUPERIO_FE, LPC_ADDR_PORT); + write_data_port(TOGGLE_WRITE, LPC_DATA_PORT); + + return; +} + +static uint32_t read_bmc_reg(uint32_t addr) +{ + uint32_t res; + + write_ilpc2ahb_addr(addr); + trigger_ilpc2ahb_read(); + res = read_ilpc2ahb_data(); + + return res; +} + +static void write_bmc_reg(uint32_t addr, uint32_t val) +{ + write_ilpc2ahb_addr(addr); + write_ilpc2ahb_data(val); + trigger_ilpc2ahb_write(); + + return; +} + +static uint32_t read_bmc_flash_data(void) +{ + uint32_t res; + + trigger_ilpc2ahb_read(); + res = read_ilpc2ahb_data(); + + return res; +} + +static void write_bmc_flash_data(uint32_t data) +{ + write_ilpc2ahb_data(data); + trigger_ilpc2ahb_write(); + + return; +} + +static void write_bmc_flash_addr(uint32_t addr) +{ + int i; + + for (i = 0; i < 4; i++) { + write_addr_port(SUPERIO_REG4 + i, LPC_ADDR_PORT); + write_data_port((addr >> (8 * i)) & MASK, LPC_DATA_PORT); + } + + trigger_ilpc2ahb_write(); + + return; +} + +static void enable_bytes(int byte) +{ + write_addr_port(SUPERIO_REG8, LPC_ADDR_PORT); + switch (byte) { + case BYTE1: + write_data_port(SUPERIO_A0 + BYTE1_VAL, LPC_DATA_PORT); + break; + case BYTE2: + write_data_port(SUPERIO_A0 + BYTE2_VAL, LPC_DATA_PORT); + break; + case BYTE4: + write_data_port(SUPERIO_A0 + BYTE4_VAL, LPC_DATA_PORT); + break; + default: + write_data_port(SUPERIO_A0 + BYTE_RESERVED, LPC_DATA_PORT); + break; + } + + return; +} + +static void pull_ce_down(flash_info_t* info) +{ + write_bmc_reg(info->ce_control_reg, USER_MODE_PULL_CE_DOWN); + + return; +} + +static void pull_ce_up(flash_info_t* info) +{ + write_bmc_reg(info->ce_control_reg, USER_MODE_PULL_CE_UP); + + return; +} + +static void send_cmd(uint32_t flash_base_addr, int cmd) +{ + write_ilpc2ahb_addr(flash_base_addr); + enable_bytes(1); + write_addr_port(SUPERIO_REG7, LPC_ADDR_PORT); + write_data_port(cmd & MASK, LPC_DATA_PORT); + trigger_ilpc2ahb_write(); + enable_bytes(4); + + return; +} + +static void send_cmd_to_flash(flash_info_t* info, int cmd) +{ + pull_ce_down(info); + send_cmd(info->flash_base_addr, cmd); + pull_ce_up(info); + + return; +} + +static void check_data_length(void) +{ + uint8_t tmp; + /* Data length check, 4 bytes */ + write_addr_port(SUPERIO_REG8, LPC_ADDR_PORT); + tmp = read_data_port(LPC_DATA_PORT); + if (tmp != SUPERIO_A2) { + write_data_port(SUPERIO_A2, LPC_DATA_PORT); + } + + return; +} + +static void enable_ilpc2ahb(void) +{ + /* Write 0xAA then write 0xA5 twice to enable super IO*/ + write_addr_port(DISABLE_LPC, LPC_ADDR_PORT); + write_addr_port(ENABLE_LPC, LPC_ADDR_PORT); + write_addr_port(ENABLE_LPC, LPC_ADDR_PORT); + + /* Enable iLPC2AHB */ + write_addr_port(SUPERIO_07, LPC_ADDR_PORT); + write_data_port(LPC_TO_AHB, LPC_DATA_PORT); + write_addr_port(SUPERIO_30, LPC_ADDR_PORT); + write_data_port(ENABLE_LPC_TO_AHB, LPC_DATA_PORT); + + /* Data length */ + check_data_length(); + + return; +} + +static void disable_ilpc2ahb(void) +{ + /* disable ilpc2ahb */ + write_addr_port(SUPERIO_30, LPC_ADDR_PORT); + write_data_port(DISABLE_LPC_TO_AHB, LPC_DATA_PORT); + /* disable super IO */ + write_addr_port(DISABLE_LPC, LPC_ADDR_PORT); + + return; +} + +/* Enable CPU */ +static void enable_cpu(void) +{ + /* unlock SCU register */ + write_bmc_reg(SCU_ADDR, UNLOCK_SCU_KEY); + /* enable ARM */ + write_bmc_reg(REBOOT_CPU_REGISTER, SET_BMC_CPU_BOOT); + /* lock SCU register */ + write_bmc_reg(SCU_ADDR, LOCK_SCU_KEY); + + return; +} + +/* diasble CPU */ +static void disable_cpu(void) +{ + uint32_t scu_hw_strap_val; + + /* unlock SCU register */ + write_bmc_reg(SCU_ADDR, UNLOCK_SCU_KEY); + /* disable ARM */ + scu_hw_strap_val = read_bmc_reg(HARDWARE_STRAP_REGISTER); + write_bmc_reg(HARDWARE_STRAP_REGISTER, scu_hw_strap_val |0x01); + /* lock SCU register */ + write_bmc_reg(SCU_ADDR, LOCK_SCU_KEY); + + return; +} + +static void enable_upgrade(void) +{ + + enable_ilpc2ahb(); + /* diasble CPU */ + disable_cpu(); + /* init CE control register */ + write_bmc_reg(CE0_CONTROL_REGISTER, 0); + write_bmc_reg(CE1_CONTROL_REGISTER, 0); + /* disable WDT2 */ + write_bmc_reg(WATCHDOG2_CONTROL, DISABLE_WATCHDOG); + + return; +} + +static void disable_upgrade(void) +{ + enable_cpu(); + dbg_print(debug_on, "DEBUG 0x%x\n", read_bmc_reg(HARDWARE_STRAP_REGISTER)); + disable_ilpc2ahb(); + + return; +} + +static void watchdog_status_debug(void) +{ + uint32_t watchdog_reg; + + /* Watchdog Control Register */ + watchdog_reg = read_bmc_reg(WATCHDOG2_CONTROL); + dbg_print(debug_on,"Watchdog Control Register: 0x%x\n", watchdog_reg); + dbg_print(debug_on,"Watchdog Enable Signal: 0x%x\n", watchdog_reg & BIT1); + dbg_print(debug_on,"Watchdog Reset SyS En: 0x%x\n", (watchdog_reg & BIT2) >> 1); + dbg_print(debug_on,"Watchdog Reset Mode: 0x%x\n", (watchdog_reg & (BIT6 | BIT7)) >> 5); + switch (watchdog_reg & (BIT6 | BIT7)) { + case SOC_SYS: + dbg_print(debug_on,"\tReset Mode En: SoC System\n"); + break; + case FULL_CHIP: + dbg_print(debug_on,"\tReset Mode En: Full Chip\n"); + break; + case ARM_CPU: + dbg_print(debug_on,"\tReset Mode En: ARM Cpu\n"); + break; + default: + break; + } + + /* Watchdog Timeout Status Register */ + watchdog_reg = read_bmc_reg(WATCHDOG2_TSR); + dbg_print(debug_on,"Watchdog Timeout Occur: 0x%x\n", watchdog_reg & BIT1); + dbg_print(debug_on,"Watchdog Boot from: CD%d\n", watchdog_reg & BIT2); + dbg_print(debug_on,"Watchdog Interrupt Occur: 0x%x\n", watchdog_reg & BIT3); + + return; +} + +/* CE Type Setting Register */ +static void ce_type_setting_debug(void) +{ + uint32_t fmc_reg; + + fmc_reg = read_bmc_reg(FMC_CE_TYPE_SETTING_REG); + if ((fmc_reg & CE0_SPI_TYPE) == SPI) { + dbg_print(debug_on,"CE0 Type Seeting: 0x%x, Type: SPI\n", fmc_reg & CE0_SPI_TYPE); + } else { + dbg_print(debug_on,"CE0 Type Seeting: 0x%x, Type: Unknown\n", fmc_reg & CE0_SPI_TYPE); + } + if (((fmc_reg & CE1_SPI_TYPE) >> BIT2) == SPI) { + dbg_print(debug_on,"CE1 Type Seeting: 0x%x, Type: SPI\n", (fmc_reg & CE1_SPI_TYPE) >> BIT2); + } else { + dbg_print(debug_on,"CE1 Type Seeting: 0x%x, Type: Unknown\n", (fmc_reg & CE1_SPI_TYPE) >> BIT2); + } + + return; +} +/* CE Control Register */ +static void ce_control_debug(void) +{ + uint32_t fmc_reg; + + fmc_reg = read_bmc_reg(CE_CONTROL_REGISTER); + dbg_print(debug_on,"CE0 Address Mode: 0x%x, Mode: %d Bytes\n", + fmc_reg & BIT1, (fmc_reg & BIT1) + 3); + dbg_print(debug_on,"CE1 Address Mode: 0x%x, Mode: %d Bytes\n", + (fmc_reg & BIT2) >> 1, ((fmc_reg & BIT2) >> 1) + 3); + + return; +} + +/* Interrupt Control & Status Register */ +static void irq_control_status_debug(void) +{ + uint32_t fmc_reg; + + fmc_reg = read_bmc_reg(INR_STATUS_CONTROL_REGISTER); + dbg_print(debug_on,"SPI Write Address Protected Interrupt EN: 0x%x\n", fmc_reg & BIT2); + dbg_print(debug_on,"SPI Command Abort Interrupt EN: 0x%x\n", fmc_reg & BIT3); + dbg_print(debug_on,"SPI Write Address Protected Status: 0x%x, Status: %s\n", + RIGHT_SHIFT_8(fmc_reg) & BIT2, (RIGHT_SHIFT_8(fmc_reg) & BIT2) == BIT2 ? "Occur" : "Normal"); + dbg_print(debug_on,"SPI Command Abort Status: 0x%x, Status: %s\n", + RIGHT_SHIFT_8(fmc_reg) & BIT3, (RIGHT_SHIFT_8(fmc_reg) & BIT3) == BIT3 ? "Occur" : "Normal"); + /*Clear Abnormal Status*/ + if ((RIGHT_SHIFT_8(fmc_reg) & BIT3) || (RIGHT_SHIFT_8(fmc_reg) & BIT2)) { + write_bmc_reg(INR_STATUS_CONTROL_REGISTER, CLEAR_INR_STATUS_CONTROL); + } + + return; +} + +/* Command Control Register */ +static void command_control_debug(void) +{ + uint32_t fmc_reg; + + fmc_reg = read_bmc_reg(COMMAND_CONTROL_REGISTER); + dbg_print(debug_on,"Data Byte Line 0: %s\n", ((fmc_reg & BIT4) != 0) ? "Disable" : "Enable"); + dbg_print(debug_on,"Data Byte Line 1: %s\n", ((fmc_reg & BIT3) != 0) ? "Disable" : "Enable"); + dbg_print(debug_on,"Data Byte Line 2: %s\n", ((fmc_reg & BIT2) != 0) ? "Disable" : "Enable"); + dbg_print(debug_on,"Data Byte Line 3: %s\n", ((fmc_reg & BIT1) != 0) ? "Disable" : "Enable"); + + dbg_print(debug_on,"Address Byte Line 0: %s\n", ((fmc_reg & BIT8) != 0) ? "Disable" : "Enable"); + dbg_print(debug_on,"Address Byte Line 1: %s\n", ((fmc_reg & BIT7) != 0) ? "Disable" : "Enable"); + dbg_print(debug_on,"Address Byte Line 2: %s\n", ((fmc_reg & BIT6) != 0) ? "Disable" : "Enable"); + dbg_print(debug_on,"Address Byte Line 3: %s\n", ((fmc_reg & BIT5) != 0) ? "Disable" : "Enable"); + + return; +} + +static void ce_control_reg_debug(void) +{ + uint32_t fmc_reg; + + /* CE0 Control Register */ + fmc_reg = read_bmc_reg(CE0_CONTROL_REGISTER); + switch (fmc_reg & (BIT1 | BIT2)){ + case NORMAL_READ: + dbg_print(debug_on,"CE0 Command Mode: Normal Read\n"); + break; + case READ_MODE: + dbg_print(debug_on,"CE0 Command Mode: Read Command\n"); + break; + case WRITE_MODE: + dbg_print(debug_on,"CE0 Command Mode: Write Command\n"); + break; + case USER_MODE: + dbg_print(debug_on,"CE0 Command Mode: User Mode\n"); + break; + default: + break; + } + switch((RIGHT_SHIFT_24(fmc_reg) & (BIT5 | BIT6 | BIT7))){ + case 0: + dbg_print(debug_on,"CE0 IO Mode: Single Mode\n"); + break; + case 2: + case 3: + dbg_print(debug_on,"CE0 IO Mode: Dual Mode\n"); + break; + default: + break; + } + + dbg_print(debug_on,"CE0 Inactive Pulse Width: %d HCLK\n", + DEFAULT_WIDTH - (RIGHT_SHIFT_24(fmc_reg) & (BIT1 | BIT2 | BIT3 | BIT4))); + dbg_print(debug_on,"CE0 Data Input Mode: %s Mode\n", (fmc_reg & BIT4) == 0 ? "Single" : "Dual"); + dbg_print(debug_on,"CE0 MSB | LSB: %s First\n", (fmc_reg & BIT6) == 0 ? "MSB" : "LSB"); + + /* CE1 Control Register */ + fmc_reg = read_bmc_reg(CE1_CONTROL_REGISTER); + switch (fmc_reg & (BIT1 | BIT2)){ + case NORMAL_READ: + dbg_print(debug_on,"CE1 Command Mode: Normal Read\n"); + break; + case READ_MODE: + dbg_print(debug_on,"CE1 Command Mode: Read Command\n"); + break; + case WRITE_MODE: + dbg_print(debug_on,"CE1 Command Mode: Write Command\n"); + break; + case USER_MODE: + dbg_print(debug_on,"CE1 Command Mode: User Mode\n"); + break; + default: + break; + } + switch((RIGHT_SHIFT_24(fmc_reg) & (BIT5 | BIT6 | BIT7))){ + case 0: + dbg_print(debug_on,"CE1 IO Mode: Single Mode\n"); + break; + case 2: + case 3: + dbg_print(debug_on,"CE1 IO Mode: Dual Mode\n"); + break; + default: + break; + } + + dbg_print(debug_on,"CE1 Inactive Pulse Width: %d HCLK\n", + DEFAULT_WIDTH - (RIGHT_SHIFT_24(fmc_reg) & (BIT1 | BIT2 | BIT3 | BIT4))); + dbg_print(debug_on,"CE1 Data Input Mode: %s Mode\n", (fmc_reg & BIT4) == 0 ? "Single" : "Dual"); + dbg_print(debug_on,"CE1 MSB | LSB: %s First\n", (fmc_reg & BIT6) == 0 ? "MSB" : "LSB"); + + return; +} + +static void fmc_debug(void) +{ + ce_type_setting_debug(); + ce_control_debug(); + irq_control_status_debug(); + command_control_debug(); + ce_control_reg_debug(); + + return; +} + +/* Enable WatchDog to reset BMC*/ +static void enable_watchdog(int cs) +{ + uint32_t enable_watch_cmd; + + enable_watch_cmd = (cs == CE0) ? ENABLE_WATCHDOG : ENABLE_WATCHDOG | BOOT_DEFAULT_MASK; + write_bmc_reg(WATCHDOG2_CLEAR_STATUS, CLEAR_WATCHDOG_STATUS); + write_bmc_reg(WATCHDOG2_RESET_FUN_MASK, WATCHDOG_GATEMASK); + write_bmc_reg(WATCHDOG2_RELOAD_VALUE, WATCHDOG_NEW_COUNT); + write_bmc_reg(WATCHDOG2_COUNTER_RST, WATCHDOG_RELOAD_COUNTER); + write_bmc_reg(WATCHDOG2_CONTROL, enable_watch_cmd); + + return; +} + +static void bmc_reboot(int cs) +{ + enable_watchdog(cs); + watchdog_status_debug(); + disable_upgrade(); + printf("Upgrade-Complete, BMC rebooting...\n"); + + return; +} + +static int get_current_bmc(void) +{ + return (read_bmc_reg(WATCHDOG2_TSR) & 0x02) >> 1; +} + +static void get_flash_base_and_ce_ctrl(int current_bmc, int cs, uint32_t *flash_base_addr, uint32_t *ce_ctrl_addr) +{ + uint32_t ce0_addr_range_reg_val, ce0_decode_addr; + uint32_t ce1_addr_range_reg_val, ce1_decode_addr; + + ce0_addr_range_reg_val = read_bmc_reg(CE0_ADDRESS_RANGE_REGISTER); + ce0_decode_addr = SEGMENT_ADDR_START(ce0_addr_range_reg_val); + ce1_addr_range_reg_val = read_bmc_reg(CE1_ADDRESS_RANGE_REGISTER); + ce1_decode_addr = SEGMENT_ADDR_START(ce1_addr_range_reg_val); + dbg_print(debug_on,"CE0 addr decode range reg value:0x%08x, decode addr:0x%08x.\n", + ce0_addr_range_reg_val, ce0_decode_addr); + dbg_print(debug_on,"CE1 addr decode range reg value:0x%08x, decode addr:0x%08x.\n", + ce1_addr_range_reg_val, ce1_decode_addr); + + if (((current_bmc == CURRENT_MASTER) && (cs ==CE0)) || ((current_bmc == CURRENT_SLAVE) && (cs ==CE1))) { + *ce_ctrl_addr = CE0_CONTROL_REGISTER; + *flash_base_addr = ce0_decode_addr; + } else { + *ce_ctrl_addr = CE1_CONTROL_REGISTER; + *flash_base_addr = ce1_decode_addr; + } + + return; +} + +static int get_flash_id(uint32_t flash_base_addr, uint32_t ce_ctrl_addr) +{ + uint32_t origin_flash_id, flash_id; + + write_bmc_reg(ce_ctrl_addr, USER_MODE_PULL_CE_DOWN); + send_cmd(flash_base_addr, READID); + origin_flash_id = read_bmc_flash_data(); + write_bmc_reg(ce_ctrl_addr, USER_MODE_PULL_CE_UP); + flash_id = origin_flash_id & 0xFFFFFF; + dbg_print(debug_on,"origin flash id:0x%x, flash id:0x%x\n", origin_flash_id, flash_id); + + return flash_id; +} + +static uint8_t get_flash_status(flash_info_t* info) +{ + uint8_t flash_status; + + pull_ce_down(info); + + send_cmd(info->flash_base_addr, READ_FLASH_STATUS); + + flash_status = read_bmc_flash_data() & MASK; + pull_ce_up(info); + + dbg_print(debug_on,"get_flash_status:0x%x\n", flash_status); + return flash_status; +} + +static int check_flash_write_enable(flash_info_t* info) +{ + uint8_t flash_status; + int i, count; + + count = FLASH_WEL_TIMEOUT / FLASH_WEL_SLEEP_TIME; + for (i = 0; i <= count; i++) { + flash_status = get_flash_status(info); + if ((flash_status & FLASH_WRITE_ENABLE_MASK) != FLASH_WRITE_ENABLE_MASK) { + usleep(FLASH_WEL_SLEEP_TIME); + } else { + dbg_print(debug_on,"Check flash WEL success, RDSR:0x%x\n", flash_status); + return 0; + } + } + printf("Check flash WEL timeout, RDSR:0x%x\n", flash_status); + return -1; +} + +static int check_flash_write_process(flash_info_t* info, int timeout, int sleep_time) +{ + int i, count; + uint8_t flash_status; + + count = timeout / sleep_time; + for (i = 0; i <= count; i++) { + flash_status = get_flash_status(info); + if ((flash_status & FLASH_WIP_MASK) != 0) { + usleep(sleep_time); + } else { + dbg_print(debug_on,"Check flash WIP success, RDSR:0x%x\n", flash_status); + return 0; + } + } + printf("Check flash WIP timeout, RDSR:0x%x.\n", flash_status); + return -1; +} + +static int flash_write_enable(flash_info_t* info) +{ + int ret; + + send_cmd_to_flash(info, WRITE_ENABLE_FLASH); + ret = check_flash_write_enable(info); + if (ret < 0) { + return -1; + } + return 0; +} + +static void send_block_erase_cmd(flash_info_t* info, uint32_t block_addr) +{ + pull_ce_down(info); + send_cmd(info->flash_base_addr, info->erase_block_command); + write_bmc_flash_addr(block_addr); /* Erase Block addr */ + pull_ce_up(info); + + return; +} + +static void send_chip_erase_cmd(flash_info_t* info) +{ + send_cmd_to_flash(info, CHIP_ERASE_FLASH); + + return; +} + +static int write_bmc_flash_page(flash_info_t* info, uint32_t page_addr, uint8_t *p, int len) +{ + int pos; + + if (len % 4) { + printf("Page size %d invalid.\n", len); + return -1; + } + + pos = 0; + pull_ce_down(info); + send_cmd(info->flash_base_addr, info->page_program); + write_bmc_flash_addr(page_addr); /* page address */ + while (len) { + write_bmc_flash_data((*(uint32_t *)(p + pos))); + pos += 4; + len -= 4; + } + pull_ce_up(info); + + return 0; +} + +static int erase_chip_full(flash_info_t* info) +{ + time_t timep; + int ret; + + if (info->full_erase == 0) { + printf("Flash not support full erase function.\n"); + return -1; + } + + ret = flash_write_enable(info); + if(ret < 0) { + printf("Chip erase, enable flash write error.\n"); + return -1; + } + + time(&timep); + printf("Full chip erasing, please wait...\n"); + dbg_print(debug_on,"Erase Start-%s\n",asctime(gmtime(&timep))); + send_chip_erase_cmd(info); + ret = check_flash_write_process(info, CHIP_ERASE_TIMEOUT, CHIP_ERASE_SLEEP_TIME); + if (ret < 0) { + printf("Chip erase timeout.\n"); + return -1; + } + time(&timep); + dbg_print(debug_on,"Erase Finish-%s\n",asctime(gmtime(&timep))); + printf("Erase Finish\n"); + printf("=========================================\n"); + return 0; +} + +static int erase_chip_block(flash_info_t* info) +{ + uint32_t block_addr, end_addr; + time_t timep; + int ret; + + printf("Block erasing...\n"); + time (&timep); + dbg_print(debug_on,"Erase-Start-%s\n", asctime(gmtime(&timep))); + end_addr = info->flash_base_addr + info->flash_size; + block_addr = info->flash_base_addr; + while (1) { + /* Enable write */ + ret = flash_write_enable(info); + if(ret < 0) { + printf("Block erase, enable flash write error, block addr:0x%x\n", block_addr); + return -1; + } + + send_block_erase_cmd(info, block_addr); + /* Erase Block(64KB) MAX time 650ms*/ + ret = check_flash_write_process(info, BLOCK_ERASE_TIMEOUT, BLOCK_ERASE_SLEEP_TIME); + if (ret < 0) { + printf("Block erase, check write status error, block addr:0x%x\n", block_addr); + return -1; + } + printf("\r0x%x", block_addr); + fflush(stdout); + if (block_addr >= end_addr) { + time(&timep); + printf("\r\nErase Finish\n"); + printf("=========================================\n"); + dbg_print(debug_on,"\nEnd-Earse-%s\n",asctime(gmtime(&timep))); + break; + } + block_addr += info->block_size; + } + return 0; +} + +static int program_chip(uint32_t file_size, uint8_t *p, flash_info_t* info) +{ + time_t timep; + uint32_t page_addr, end_addr; + int ret, page_size; + + page_addr = info->flash_base_addr; + page_size = info->page_size; + end_addr = file_size + info->flash_base_addr; + time (&timep); + printf("Programming...\n"); + dbg_print(debug_on,"Program Start-%s\n",asctime(gmtime(&timep))); + /* Debug info */ + fmc_debug(); + while (1) { + /* Write enable */ + ret = flash_write_enable(info); + if(ret < 0) { + printf("Page program, enable flash write error, page addr:0x%x\n", page_addr); + return -1; + } + ret = write_bmc_flash_page(info, page_addr, p, page_size); + if (ret < 0) { + printf("Page program, write bmc flash page error, page addr:0x%x\n", page_addr); + return -1; + } + /* page program MAX time 1.5ms */ + ret = check_flash_write_process(info, PAGE_PROGRAM_TIMEOUT, PAGE_PROGRAM_SLEEP_TIME); + if (ret < 0) { + printf("Page program, check write status error, page addr:0x%x\n", page_addr); + return -1; + } + page_addr += page_size; + p += page_size; + if ((page_addr % 0x10000) == 0) { + printf("\r0x%x", page_addr); + fflush(stdout); + } + + if (page_addr >= end_addr) { + printf("\nProgram Finish\n"); + printf("=========================================\n"); + time(&timep); + dbg_print(debug_on,"\nProgram-End-%s\n",asctime(gmtime(&timep))); + break; + } + } /* End of while (1) */ + return 0; +} + +static int check_chip(uint32_t file_size, uint8_t *p, flash_info_t* info) +{ + time_t timep; + uint32_t offset_addr, rd_val, end_addr; + int pos; + + offset_addr = info->flash_base_addr; + end_addr = file_size + info->flash_base_addr; + pos=0; + /* Checking */ + time(&timep); + printf("Checking...\n"); + dbg_print(debug_on,"Checking-Start-%s\n",asctime(gmtime(&timep))); + + pull_ce_down(info); + send_cmd(info->flash_base_addr, COMMON_FLASH_READ); + write_bmc_flash_addr(info->flash_base_addr); + while (1) { + if (offset_addr >= end_addr) { + break; + } + rd_val = read_bmc_flash_data(); + if (rd_val != (*(uint32_t *)(p + pos))) { + printf("Check Error at 0x%08x\n", offset_addr); + printf("READ:0x%08x VALUE:0x%08x\n", rd_val, (*(uint32_t *)(p + pos))); + pull_ce_up(info); + return -1; + } + if ((offset_addr % 0x10000) == 0) { + printf("\r0x%x ", offset_addr); + fflush(stdout); + } + offset_addr += 4; + pos += 4; + } + pull_ce_up(info); + printf("\r\nFlash Checked\n"); + printf("=========================================\n"); + time(&timep); + dbg_print(debug_on,"Checking-End-%s\n",asctime(gmtime(&timep))); + return 0; +} + +flash_info_t* get_flash_info(int current_bmc, int cs) +{ + int i, size; + uint32_t flash_base_addr, ce_ctrl_addr, flash_id; + + get_flash_base_and_ce_ctrl(current_bmc, cs, &flash_base_addr, &ce_ctrl_addr); + + size = (sizeof(flash_info) / sizeof((flash_info)[0])); + + flash_id = get_flash_id(flash_base_addr, ce_ctrl_addr); + for (i = 0; i < size; i++) { + if (flash_info[i].flash_id == flash_id) { + flash_info[i].flash_base_addr = flash_base_addr; + flash_info[i].ce_control_reg = ce_ctrl_addr; + flash_info[i].cs = cs; + return &flash_info[i]; + } + } + printf("Cannot get flash info, cs:%d, flash base addr:0x%x, ce control addr:0x%x, flash_id:0x%x.\n", + cs, flash_base_addr, ce_ctrl_addr, flash_id); + return NULL; +} + +static void init_flash(flash_info_t* info) +{ + send_cmd_to_flash(info, RSTEN); + send_cmd_to_flash(info, RST); + send_cmd_to_flash(info, EXIT_OTP); + send_cmd_to_flash(info, ENABLE_BYTE4); + + return; +} + +static int upgrade_bmc_core(char *file_name, int erase_type, flash_info_t* info) +{ + int file_size, fp, ret; + uint8_t *p; + + file_size = get_file_size(file_name); + if (file_size < 0) { + printf("file size %d Error\n", file_size); + return -1; + } + + fp = open(file_name, O_RDWR); + if (fp < 0) { + printf("Cannot open %s.\n", file_name); + return -1; + } + + p = mmap(NULL, file_size, PROT_READ, MAP_SHARED, fp, 0); + if (p == MAP_FAILED) { + printf("Could not mmap %s, error(%s).\n", file_name, strerror(errno)); + close(fp); + return -1; + } + + printf("* CE%d FLASH TYPE: SPI FLASH\n", info->cs); + printf("* FLASH NAME: %s\n", info->flash_name); + printf("* File Size:%d, 0x%x\n", file_size, file_size); + printf("=========================================\n"); + + /* Select erase type */ + switch (erase_type) { + case FULL_ERASE: + ret = erase_chip_full(info); + break; + case BLOCK_ERASE: + ret = erase_chip_block(info); + break; + default: + printf("Unsupport earse type:%d\n", erase_type); + goto exit; + break; + } + + if (ret < 0) { + printf("Erase Chip Error\n"); + goto exit; + } + + /* Program the flash */ + ret = program_chip(file_size, p, info); + if(ret < 0) { + printf("Program Chip Error\n"); + goto exit; + } + /* Check */ + ret = check_chip(file_size, p, info); + if(ret < 0) { + printf("Check Chip Error\n"); + goto exit; + } + + munmap(p, file_size); + close(fp); + return 0; +exit: + munmap(p, file_size); + close(fp); + return -1; +} + +static int upgrade_bmc_flash(char *filename, int current_bmc, int cs, int erase_type) +{ + int ret; + flash_info_t* info; + + info = get_flash_info(current_bmc, cs); + if(info == NULL) { + return -1; + } + + init_flash(info); + + ret = upgrade_bmc_core(filename, erase_type, info); + + return ret; +} + +static int upgrade_both_flash(char *filename, int erase_type) +{ + int ret, current_bmc; + + enable_upgrade(); + + current_bmc = get_current_bmc(); + if (current_bmc == CURRENT_MASTER) { + printf("* Current Bmc Default Boot: CE0\n"); + } else { + printf("* Current Bmc Default Boot: CE1\n"); + } + + ret = upgrade_bmc_flash(filename, current_bmc, CE0, erase_type); + if (ret < 0) { + printf("Upgrade master bmc flash failed, stop upgrade.\n"); + goto err; + } + printf("Upgrade master bmc flash success.\n"); + + ret = upgrade_bmc_flash(filename, current_bmc, CE1, erase_type); + if (ret < 0) { + printf("Upgrade slave bmc flash failed.\n"); + goto err; + } + printf("Upgrade slave bmc flash success.\n"); + + bmc_reboot(CE0); + return 0; +err: + disable_upgrade(); + return -1; +} + +static int upgrade_single_flash(char *filename, int cs, int erase_type) +{ + int ret, current_bmc; + + enable_upgrade(); + + current_bmc = get_current_bmc(); + if (current_bmc == CURRENT_MASTER) { + printf("* Current Bmc Default Boot: CE0\n"); + } else { + printf("* Current Bmc Default Boot: CE1\n"); + } + + ret = upgrade_bmc_flash(filename, current_bmc, cs, erase_type); + if (ret < 0) { + printf("Upgrade %s bmc flash failed.\n", cs == 0 ? "master":"slave"); + goto err; + } + printf("Upgrade %s bmc flash success.\n", cs == 0 ? "master":"slave"); + + bmc_reboot(cs); + return 0; +err: + disable_upgrade(); + return -1; +} + +static int upgrade_bmc(char *filename, int cs, int erase_type) +{ + int ret; + + if (access(filename, F_OK) < 0) { + printf("Can't find file\n"); + help(); + return -1; + } + + ret = set_ioport_rw_access(); + if (ret < 0) { + printf("IO ERROR\n"); + return -1; + } + + switch(cs) { + /* Single */ + case CE0: + case CE1: + ret = upgrade_single_flash(filename, cs, erase_type); + break; + /* Both */ + case BOTHFLASH: + ret = upgrade_both_flash(filename, erase_type); + break; + default: + ret = -1; + printf("Unsupport cs:%d\n", cs); + break; + } + + return ret; +} + +static int read_single_bmc_flash(flash_info_t* info, uint32_t start_addr, int read_size, int is_print) +{ + uint32_t res, flash_start_addr, flash_end_addr; + char filename[MAX_FILENAME_LENGTH]; + int fd, ret; + + flash_start_addr = info->flash_base_addr + start_addr; + flash_end_addr = flash_start_addr + read_size; + ret = 0; + fd = 0; + if (!is_print) { + mem_clear(filename, MAX_FILENAME_LENGTH); + snprintf(filename, MAX_FILENAME_LENGTH, "/tmp/image-bmc%d", info->cs); + fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, S_IRWXG|S_IRWXU|S_IRWXO); + if (fd < 0) { + printf("open file %s fail(err:%d)!\r\n", filename, errno); + return -1; + } + } + + printf("* CE%d FLASH TYPE: SPI FLASH\n", info->cs); + printf("* FLASH NAME: %s\n", info->flash_name); + printf("* Read flash addr:0x%x, size:0x%x\n", flash_start_addr, read_size); + printf("=========================================\n"); + printf("Reading...\n"); + + pull_ce_down(info); + send_cmd(info->flash_base_addr, COMMON_FLASH_READ); + write_bmc_flash_addr(flash_start_addr); + while (1) { + if (flash_start_addr >= flash_end_addr) { + break; + } + res = read_bmc_flash_data(); + if (is_print) { + printf("addr:0x%08x, val:0x%08x\n", flash_start_addr, res); + } else { + ret = write(fd, &res, sizeof(res)); + if (ret < 0) { + printf("write failed (errno: %d).\n", errno); + ret = -1; + goto exit; + } + } + if (((flash_start_addr % 0x10000) == 0) && (!is_print)) { + printf("\r0x%x ", flash_start_addr); + fflush(stdout); + } + flash_start_addr += 4; + } + printf("\r\nRead Finish\n"); + printf("=========================================\n"); +exit: + pull_ce_up(info); + if (fd > 0) { + close(fd); + } + return ret; +} + +static int read_bmc_flash(int cs, uint32_t start_addr, int read_size, int is_print) +{ + int ret, current_bmc; + flash_info_t* info; + + ret = set_ioport_rw_access(); + if (ret < 0) { + printf("IO ERROR\n"); + return -1; + } + + enable_upgrade(); + + current_bmc = get_current_bmc(); + if (current_bmc == CURRENT_MASTER) { + printf("* Current Bmc Default Boot: CE0\n"); + } else { + printf("* Current Bmc Default Boot: CE1\n"); + } + + info = get_flash_info(current_bmc, cs); + if(info == NULL) { + goto err; + } + + if (start_addr >= info->flash_size) { + printf("start_addr 0x%x out of range.\n", start_addr); + goto err; + } + + if ((start_addr + read_size) > info->flash_size) { + printf("read size %d exceed flash size.\n", read_size); + read_size = info->flash_size - start_addr; + } + + init_flash(info); + + ret = read_single_bmc_flash(info, start_addr, read_size, is_print); + if (ret < 0) { + printf("Read %s bmc flash failed.\n", cs == 0 ? "master" : "slave"); + goto err; + } + disable_upgrade(); + return 0; +err: + disable_upgrade(); + return -1; +} + +static int read_bmc_reg_main(int argc, char* argv[]) +{ + uint32_t start_addr, read_val; + int read_size, ret; + char *stopstring; + + if (argc != 4) { + printf("Input invalid.\n"); + help(); + return -1; + } + + start_addr = strtoul(argv[2], &stopstring, 16); + read_size = strtol(argv[3], &stopstring, 10); + + if (read_size <= 0) { + printf("read length %d invalid\n", read_size); + return -1; + } + + if (((start_addr % 4) != 0) || ((read_size % 4) != 0)) { + printf("Params invalid, start_addr:0x%08x, read_size:%d\n", start_addr, read_size); + printf("Please input address/length times of 4\n"); + return -1; + } + + ret = set_ioport_rw_access(); + if (ret < 0) { + printf("IO ERROR\n"); + return -1; + } + + enable_ilpc2ahb(); + + printf("read bcm reg, start_addr:0x%08x, read length:%d\n", start_addr, read_size); + printf("===Addr=== | ===Cont===\n"); + while (read_size) { + read_val = read_bmc_reg(start_addr); + printf("0x%08x | 0x%08x\n", start_addr, read_val); + start_addr += 4; + read_size -= 4; + } + + disable_ilpc2ahb(); + return 0; +} + +static int write_bmc_reg_main(int argc, char* argv[]) +{ + uint32_t addr, wr_val; + int ret; + char *stopstring; + + if (argc != 4) { + printf("Input invalid.\n"); + help(); + return -1; + } + + addr = strtoul(argv[2], &stopstring, 16); + wr_val = strtoul(argv[3], &stopstring, 16); + + if (((addr & MASK_BYTE) != REGISTER_HEAD) || ((addr % 4) != 0)) { + printf("Address[0x%08x] invalid, address should be register address and times of 4.\n", addr); + return -1; + } + + ret = set_ioport_rw_access(); + if (ret < 0) { + printf("IO ERROR\n"); + return -1; + } + + printf("write bcm reg, addr:0x%08x, val:0x%08x\n", addr, wr_val); + + enable_ilpc2ahb(); + write_bmc_reg(addr, wr_val); + disable_ilpc2ahb(); + + return 0; +} + +static int get_fmc_info_main(void) +{ + int ret; + + ret = set_ioport_rw_access(); + if (ret < 0) { + printf("IO ERROR\n"); + return -1; + } + + enable_ilpc2ahb(); + + debug_on = 3; + fmc_debug(); + debug_on = 0; + + disable_ilpc2ahb(); + return 0; +} + +static int program_flash_main(int argc, char* argv[]) +{ + int cs, erase_way, ret; + char *stopstring; + char tmp[128]; + + if (argc != 5) { + printf("Input invalid.\n"); + help(); + return -1; + } + + cs = strtol(argv[3], &stopstring, 10); + if ((strlen(stopstring) != 0) || cs < 0 || cs > 2) { + snprintf(tmp, sizeof(tmp), "%s", argv[3]); + printf("Incorrect chip select %s\n", tmp); + help(); + return -1; + } + + if (strcmp(argv[4], "full") == 0) { + erase_way = FULL_ERASE; + } else if (strcmp(argv[4], "block") == 0) { + erase_way = BLOCK_ERASE; + } else { + snprintf(tmp, sizeof(tmp), "%s", argv[4]); + printf("Incorrect erase type %s\n", tmp); + help(); + return -1; + } + + printf("============BMC Upgrade Tool=============\n"); + ret = upgrade_bmc(argv[2], cs, erase_way); + return ret; +} + +static int read_bmc_flash_main(int argc, char* argv[]) +{ + int cs, ret, read_size, is_print; + uint32_t start_addr; + char *stopstring; + char tmp[128]; + + if (argc != 6) { + printf("Input invalid.\n"); + help(); + return -1; + } + + cs = strtol(argv[2], &stopstring, 10); + if ((strlen(stopstring) != 0) || cs < 0 || cs > 1) { + snprintf(tmp, sizeof(tmp), "%s", argv[2]); + printf("Incorrect chip select %s\n", tmp); + help(); + return -1; + } + + start_addr = strtoul(argv[3], &stopstring, 16); + read_size = strtol(argv[4], &stopstring, 10); + + if (read_size <= 0) { + printf("read length %d invalid\n", read_size); + return -1; + } + + if (((start_addr % 4) != 0) || ((read_size % 4) != 0)) { + printf("Params invalid, start_addr:0x%08x, read_size:%d\n", start_addr, read_size); + printf("Please input address/length times of 4\n"); + return -1; + } + + if (strcmp(argv[5], "print") == 0) { + is_print = 1; + } else { + is_print = 0; + } + + printf("============READ BMC FLASH=============\n"); + ret = read_bmc_flash(cs, start_addr, read_size, is_print); + return ret; +} + +int main(int argc, char *argv[]) +{ + int ret; + + debug_on = fw_upgrade_debug(); + + if (argc < 2) { + help(); + return -1; + } + + if (argc == 2) { + if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) { + help(); + return 0; + } + } + + if (strcmp(argv[1], "rd") == 0) { + ret = read_bmc_reg_main(argc, argv); + if (ret < 0) { + printf("Read Failed\n"); + } + return ret; + } + + if (strcmp(argv[1], "wr") == 0 && debug_on == 3) { + ret = write_bmc_reg_main(argc, argv); + if (ret < 0) { + printf("Write Failed\n"); + } + return ret; + } + + if (strcmp(argv[1], "info") == 0) { + ret = get_fmc_info_main(); + if (ret < 0) { + printf("Get fmc info Failed\n"); + } + return ret; + } + + if (strcmp(argv[1], "upgrade") == 0) { + ret = program_flash_main(argc, argv); + if (ret < 0) { + printf("Upgrade BMC failed.\n"); + } + return ret; + } + + if (strcmp(argv[1], "read_bmc_flash") == 0) { + ret = read_bmc_flash_main(argc, argv); + if (ret < 0) { + printf("Read BMC flash failed.\n"); + } + return ret; + } + + printf("Input invalid.\n"); + help(); + + return -1; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/fw_upgrade_debug.c b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/fw_upgrade_debug.c new file mode 100644 index 000000000000..a7a78d011011 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/fw_upgrade_debug.c @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "fw_upgrade_debug.h" + +int fw_upgrade_debug(void) +{ + int size; + FILE *fp; + char debug_info[DEBUG_INFO_LEN]; + + fp = fopen(DEBUG_FILE, "r"); + if (fp == NULL) { + return DEBUG_IGNORE; + } + + mem_clear(debug_info, DEBUG_INFO_LEN); + size = fread(debug_info, DEBUG_INFO_LEN - 1, 1, fp); + if (size < 0) { + fclose(fp); + return DEBUG_IGNORE; + } + + if (strncmp(debug_info, DEBUG_ON_INFO, 1) == 0) { + fclose(fp); + return DEBUG_APP_ON; + } + + if (strncmp(debug_info, DEBUG_ON_KERN, 1) == 0) { + fclose(fp); + return DEBUG_KERN_ON; + } + + if (strncmp(debug_info, DEBUG_ON_ALL, 1) == 0) { + fclose(fp); + return DEBUG_ALL_ON; + } + + if (strncmp(debug_info, DEBUG_OFF_INFO, 1) == 0) { + fclose(fp); + return DEBUG_OFF; + } + + fclose(fp); + return DEBUG_IGNORE; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/include/fw_upgrade.h b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/include/fw_upgrade.h new file mode 100644 index 000000000000..bd806a94b154 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/include/fw_upgrade.h @@ -0,0 +1,230 @@ +#ifndef _FW_UPGRADE_H_ +#define _FW_UPGRADE_H_ + +#include "fw_upgrade_debug.h" + +#define dbg_print(debug, fmt, arg...) \ + if (debug == DEBUG_APP_ON || debug == DEBUG_ALL_ON) \ + { do{printf(fmt,##arg);} while(0); } + +/* LPC Interface */ +#define LPC_ADDR_PORT (0x4E) +#define LPC_DATA_PORT (0x4F) + +/* FMC REGISTER ADDR */ +#define FMC_BASE_ADDR (0x1E620000) +#define FMC_CE_TYPE_SETTING_REG (FMC_BASE_ADDR + 0x00) +#define CE_CONTROL_REGISTER (FMC_BASE_ADDR + 0x04) +#define INR_STATUS_CONTROL_REGISTER (FMC_BASE_ADDR + 0x08) +#define COMMAND_CONTROL_REGISTER (FMC_BASE_ADDR + 0x0C) +#define CE0_CONTROL_REGISTER (FMC_BASE_ADDR + 0x10) +#define CE1_CONTROL_REGISTER (FMC_BASE_ADDR + 0x14) +#define CE0_ADDRESS_RANGE_REGISTER (FMC_BASE_ADDR + 0x30) +#define CE1_ADDRESS_RANGE_REGISTER (FMC_BASE_ADDR + 0x34) + +/* SCU REGISTER ADDR */ +#define SCU_ADDR (0x1E6E2000) +#define HARDWARE_STRAP_REGISTER (SCU_ADDR + 0x70) +#define REBOOT_CPU_REGISTER (SCU_ADDR + 0x7C) + +/* SCU KEY */ +#define UNLOCK_SCU_KEY (0x1688A8A8) +#define LOCK_SCU_KEY (0x11111111) + +/* WATCHDOG REGISTER ADDR */ +#define WATCHDOG_ADDR (0x1E785000) +#define WATCHDOG1_RELOAD_VALUE (WATCHDOG_ADDR + 0x04) +#define WATCHDOG1_COUNTER_RST (WATCHDOG_ADDR + 0x08) +#define WATCHDOG1_CONTROL (WATCHDOG_ADDR + 0x0C) +#define WATCHDOG1_TSR (WATCHDOG_ADDR + 0x10) +#define WATCHDOG1_CLEAR_STATUS (WATCHDOG_ADDR + 0x14) +#define WATCHDOG1_RESET_FUN_MASK (WATCHDOG_ADDR + 0x1C) + +#define WATCHDOG2_RELOAD_VALUE (WATCHDOG_ADDR + 0x24) +#define WATCHDOG2_COUNTER_RST (WATCHDOG_ADDR + 0x28) +#define WATCHDOG2_CONTROL (WATCHDOG_ADDR + 0x2C) +#define WATCHDOG2_TSR (WATCHDOG_ADDR + 0x30) +#define WATCHDOG2_CLEAR_STATUS (WATCHDOG_ADDR + 0x34) +#define WATCHDOG2_RESET_FUN_MASK (WATCHDOG_ADDR + 0x3C) + +/* User Mode Command */ +#define WRITE_STATUS (0x01) +#define COMMON_PAGE_PROGRAM (0x02) +#define COMMON_FLASH_READ (0x03) +#define WRITE_DISABLE_FLASH (0x04) +#define READ_FLASH_STATUS (0x05) +#define WRITE_ENABLE_FLASH (0x06) +#define PAGE_PROGRAM_FLASH (0x12) +#define SECTOR_ERASE (0x20) +#define CLEAR_FLAG (0x50) +#define SUBBLOCK_ERASE (0x52) +#define CHIP_ERASE_FLASH (0x60) +#define BLOCK_ERASE_64 (0xD8) +#define READID (0x9F) +#define ENABLE_BYTE4 (0xB7) +#define EXIT_OTP (0xC1) +#define RSTEN (0x66) +#define RST (0x99) + +#define BIT1 (0x01) +#define BIT2 (0x02) +#define BIT3 (0x04) +#define BIT4 (0x08) +#define BIT5 (0x10) +#define BIT6 (0x20) +#define BIT7 (0x40) +#define BIT8 (0x80) +#define RIGHT_SHIFT_8(reg) (reg >> 8) +#define RIGHT_SHIFT_16(reg) (reg >> 16) +#define RIGHT_SHIFT_24(reg) (reg >> 24) +#define MASK (0xFF) +#define FLASH_TYPE_MASK (BIT1 | BIT2) +#define BOOT_DEFAULT_MASK (BIT8) +#define HEAD_MASK (0x00FFFF00) +#define MASK_BYTE (0xFF000000) +#define BYTE1 (1) +#define BYTE2 (2) +#define BYTE4 (4) +#define BYTE1_VAL (0) +#define BYTE2_VAL (1) +#define BYTE4_VAL (2) +#define BYTE_RESERVED (3) + +/* SuperIO */ +#define SUPERIO_07 (0x07) +#define SUPERIO_30 (0x30) +#define SUPERIO_A0 (0xA0) +#define SUPERIO_A2 (0xA2) +#define SUPERIO_REG0 (0xF0) +#define SUPERIO_REG1 (0xF1) +#define SUPERIO_REG2 (0xF2) +#define SUPERIO_REG3 (0xF3) +#define SUPERIO_REG4 (0xF4) +#define SUPERIO_REG5 (0xF5) +#define SUPERIO_REG6 (0xF6) +#define SUPERIO_REG7 (0xF7) +#define SUPERIO_REG8 (0xF8) +#define SUPERIO_FE (0xFE) + +/* SPI Command */ +#define HIGH_CLOCK (0x00000000) +#define NORMAL_READ (0x00000000) +#define READ_MODE (0x00000001) +#define WRITE_MODE (0x00000002) +#define USER_MODE (0x00000003) +#define PULL_DOWN (0x00000000) +#define PULL_UP (0x00000004) + +#define CHIP_ERASE_TIME (60) +#define CHIP_ERASE_TIMEOUT (300 * 1000 * 1000) +#define CHIP_ERASE_SLEEP_TIME (5 * 1000 * 1000) +#define BLOCK_ERASE_TIMEOUT (10 * 1000 * 1000) +#define BLOCK_ERASE_SLEEP_TIME (100 * 1000) +#define PAGE_PROGRAM_TIMEOUT (100 * 1000) +#define PAGE_PROGRAM_SLEEP_TIME (1000) +#define FLASH_WEL_TIMEOUT (100 * 1000) +#define FLASH_WEL_SLEEP_TIME (1000) +#define FLASH_WIP_MASK (0x00000001) +#define FLASH_WRITE_ENABLE_MASK (0x00000002) + +#define DATA_LENGTH_MASK (0xA2) +#define TOGGLE_WRITE (0xCF) +#define DISABLE_LPC (0xAA) +#define ENABLE_LPC (0xA5) +#define LPC_TO_AHB (0x0D) +#define ENABLE_LPC_TO_AHB (0x01) +#define DISABLE_LPC_TO_AHB (0x00) +#define ENABLE_BMC_CPU_BOOT (0xF10BD286) +#define DISABLE_BMC_CPU_BOOT (0xF10BD287) +#define SET_BMC_CPU_BOOT (0x01) +#define CLEAR_WATCHDOG_STATUS (0x01) +#define DISABLE_WATCHDOG (0x00000030) +#define ENABLE_WATCHDOG (0x00000033) +#define WATCHDOG_GATEMASK (0x033FFFF3) +#define WATCHDOG_NEW_COUNT (0x00050000) +#define WATCHDOG_RELOAD_COUNTER (0x4755) + +#define CE0_SPI_TYPE (0x00000002) +#define CE1_SPI_TYPE (0x00000008) +#define ERROR_COMMAND (0x00000400) +#define ADDRESS_PROTECT (0x00000200) +#define CLEAR_INR_STATUS_CONTROL (ERROR_COMMAND | ADDRESS_PROTECT) +#define USER_MODE_PULL_CE_DOWN (HIGH_CLOCK | USER_MODE | PULL_DOWN) +#define USER_MODE_PULL_CE_UP (HIGH_CLOCK | USER_MODE | PULL_UP) + +#define STEP_64 (64 * 1024) +#define STEP_256 (256 * 1024) +#define BYTE_256 (256) + +#define CE0 (0) +#define CE1 (1) +#define BOTHFLASH (2) +#define SOC_SYS (0) +#define FULL_CHIP (1) +#define ARM_CPU (2) +#define FULL_ERASE (0) +#define BLOCK_ERASE (1) +#define READ_ALL (2) +#define CURRENT_SLAVE (1) +#define CURRENT_MASTER (0) +#define REGISTER_HEAD (0x1e000000) +#define DEFAULT_WIDTH (16) +#define MAX_FILENAME_LENGTH (64) +#define SEGMENT_ADDR_START(_r) ((((_r) >> 16) & 0xFF) << 23) + +typedef struct flash_info { + uint32_t flash_size; + int cs; + int flash_type; + uint32_t flash_id; + int page_size; + char flash_name[64]; + int erase_block_command; + int page_program; + int block_size; + int full_erase; + uint32_t ce_control_reg; + uint32_t flash_base_addr; +} flash_info_t; + +typedef enum flash_id { + MX25L6433F = 0x1920c2, + S25FL512S = 0x200201, + MX25l512 = 0x1a20c2, + STM25P64 = 0x172020, + STM25P128 = 0x182020, + N25Q256 = 0x19ba20, + N25Q512 = 0x20ba20, + W25X16 = 0x1530ef, + W25X64 = 0x1730ef, + W25Q64BV = 0x1740ef, + W25Q128BV = 0x1840ef, + W25Q256FV = 0x1940ef, + MX25L1605D = 0x1520C2, + MX25L12805D = 0x1820C2, + MX66L1G45G = 0x1B20C2, + SST25VF016B = 0x4125bf, + SST25VF064C = 0x4b25bf, + SST25VF040B = 0x8d25bf, + AT25DF161 = 0x02461F, + AT25DF321 = 0x01471F, + GD25Q256 = 0X1940c8, +} flash_id_t; + +typedef enum flash_type { + NOR = 0, + SPI = 2, +} flash_type_t; + +typedef enum flash_size { + M1 = 0x00080000, + M3 = 0x00200000, /* 3M */ + M6 = 0x00400000, /* 6M */ + M12 = 0x00800000, /* 12M */ + M16 = 0x01000000, /* 16M */ + M32 = 0x02000000, /* 32M */ + M64 = 0x04000000, /* 64M */ + M128 = 0x08000000, /* 128M */ +} flash_size_t; + +#endif /*_FW_UPGRADE_H_*/ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/include/fw_upgrade_debug.h b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/include/fw_upgrade_debug.h new file mode 100644 index 000000000000..05911da62a7e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/app/fw_upgrade/fw_upgrade/include/fw_upgrade_debug.h @@ -0,0 +1,25 @@ +#ifndef __FW_UPGRADE_DEBUG_H__ +#define __FW_UPGRADE_DEBUG_H__ + +#include + +#define DEBUG_INFO_LEN 20 +#define DEBUG_FILE "/tmp/.fw_upgrade_debug" +#define DEBUG_ON_ALL "3" +#define DEBUG_ON_KERN "2" +#define DEBUG_ON_INFO "1" +#define DEBUG_OFF_INFO "0" + +#define mem_clear(data, size) memset((data), 0, (size)) + +enum debug_s { + DEBUG_OFF = 0, + DEBUG_APP_ON, + DEBUG_KERN_ON, + DEBUG_ALL_ON, + DEBUG_IGNORE, +}; + +extern int fw_upgrade_debug(void); + +#endif /* End of __FW_UPGRADE_DEBUG_H__ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/__init__.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/hysteresis.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/hysteresis.py new file mode 100644 index 000000000000..81fd596e7fee --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/hysteresis.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python3 +import os +import syslog +import copy + +from plat_hal.baseutil import baseutil + +HYST_DEBUG_FILE = "/etc/.hysteresis_debug_flag" + +HYSTERROR = 1 +HYSTDEBUG = 2 + +debuglevel = 0 + + +def hyst_debug(s): + if HYSTDEBUG & debuglevel: + syslog.openlog("FANCONTROL-HYST", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def hyst_error(s): + if HYSTERROR & debuglevel: + syslog.openlog("FANCONTROL-HYST", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +class hysteresis(object): + __config = None + __hyst_config = None + + def __init__(self): + self.__config = baseutil.get_monitor_config() + self.__hyst_config = copy.deepcopy(self.__config.get("hyst", {})) + # init check + errcnt = 0 + errmsg = "" + self.debug_init() + for temp_hyst_conf in self.__hyst_config.values(): + if temp_hyst_conf["flag"] == 0: + continue + for i in range(temp_hyst_conf["temp_min"], temp_hyst_conf["temp_max"] + 1): + if i not in temp_hyst_conf["rising"]: + errcnt -= 1 + msg = "%s hyst config error, temp value %d not in rising curve;" % (temp_hyst_conf["name"], i) + hyst_error(msg) + errmsg += msg + if i not in temp_hyst_conf["descending"]: + errcnt -= 1 + msg = "%s hyst config error, temp value %d not in descending curve;" % (temp_hyst_conf["name"], i) + hyst_error(msg) + errmsg += msg + if errcnt < 0: + raise KeyError(errmsg) + + def debug_init(self): + global debuglevel + if os.path.exists(HYST_DEBUG_FILE): + debuglevel = debuglevel | HYSTDEBUG | HYSTERROR + else: + debuglevel = debuglevel & ~(HYSTDEBUG | HYSTERROR) + + def get_temp_hyst_conf(self, temp_name): + temp_hyst_conf = self.__hyst_config.get(temp_name) + return temp_hyst_conf + + def get_temp_update(self, hyst_para, current_temp): + temp = hyst_para["value"] + if temp is None: + return None + temp.append(current_temp) + del temp[0] + return temp + + def duty_to_pwm(self, duty): + pwm = int(round(float(duty) * 255 / 100)) + return pwm + + def pwm_to_duty(self, pwm): + duty = int(round(float(pwm) * 100 / 255)) + return duty + + def calc_hyst_val(self, temp_name, temp_list): + + temp_hyst_conf = self.get_temp_hyst_conf(temp_name) + hyst_min = temp_hyst_conf["hyst_min"] + hyst_max = temp_hyst_conf["hyst_max"] + temp_min = temp_hyst_conf["temp_min"] + temp_max = temp_hyst_conf["temp_max"] + rising = temp_hyst_conf["rising"] + descending = temp_hyst_conf["descending"] + last_hyst_value = temp_hyst_conf["last_hyst_value"] + current_temp = temp_list[1] + last_temp = temp_list[0] + + hyst_debug("calc_hyst_val, temp_name: %s, current_temp: %s, last_temp: %s, last_hyst_value: %s" % + (temp_name, current_temp, last_temp, last_hyst_value)) + + if current_temp < temp_min: + hyst_debug("%s current_temp %s less than temp_min %s, set min hyst value: %s" % + (temp_name, current_temp, temp_min, hyst_min)) + return hyst_min + + if current_temp > temp_max: + hyst_debug("%s current_temp %s more than temp_max %s, set max hyst value: %s" % + (temp_name, current_temp, temp_max, hyst_max)) + return hyst_max + + if last_temp is None: # first time + hyst_value = rising[current_temp] + hyst_debug("last_temp is None, it's first hysteresis, using rising hyst value: %s" % hyst_value) + return hyst_value + + if current_temp == last_temp: # temp unchanging + hyst_debug("current_temp equal last_temp, keep last hyst value: %s" % last_hyst_value) + return last_hyst_value + + if current_temp > last_temp: + calc_hyst_value = rising[current_temp] + if calc_hyst_value < last_hyst_value: + hyst_value = last_hyst_value + else: + hyst_value = calc_hyst_value + hyst_debug("temp rising, last_hyst_value: %s, calc_hyst_value: %s, set hyst value: %s" % + (last_hyst_value, calc_hyst_value, hyst_value)) + return hyst_value + + calc_hyst_value = descending[current_temp] + if calc_hyst_value > last_hyst_value: + hyst_value = last_hyst_value + else: + hyst_value = calc_hyst_value + hyst_debug("temp descending, last_hyst_value: %s, calc_hyst_value: %s, set hyst value: %s" % + (last_hyst_value, calc_hyst_value, hyst_value)) + return hyst_value + + def cacl(self, temp_name, current_temp): + self.debug_init() + try: + temp_hyst_conf = self.get_temp_hyst_conf(temp_name) + if temp_hyst_conf is None: + hyst_debug("get %s hysteresis config failed" % temp_name) + return None + + flag = temp_hyst_conf["flag"] + if flag != 1: + hyst_debug("%s hysteresis flag == 0, skip" % temp_name) + return None + + temp = self.get_temp_update(temp_hyst_conf, current_temp) + if temp is None: + hyst_debug("get %s update failed" % temp_name) + return None + + value = self.calc_hyst_val(temp_name, temp) + + temp_hyst_conf["last_hyst_value"] = value + + speed_type = temp_hyst_conf["type"] + if speed_type == "duty": + pwm = self.duty_to_pwm(value) + else: + pwm = value + + hyst_debug("temp_name: %s, current_temp: %s, set pwm 0x%x" % (temp_name, current_temp, pwm)) + return pwm + except Exception as e: + hyst_error("temp_name: %s calc hysteresis pwm error, msg: %s" % (temp_name, str(e))) + return None diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/openloop.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/openloop.py new file mode 100644 index 000000000000..3bb46b286998 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/openloop.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 +import os +import syslog + +from plat_hal.baseutil import baseutil + +OPENLOOP_DEBUG_FILE = "/etc/.openloop_debug_flag" + +OPENLOOPERROR = 1 +OPENLOOPDEBUG = 2 + +debuglevel = 0 + + +def openloop_debug(s): + if OPENLOOPDEBUG & debuglevel: + syslog.openlog("FANCONTROL-OPENLOOP", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def openloop_error(s): + if OPENLOOPERROR & debuglevel: + syslog.openlog("FANCONTROL-OPENLOOP", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +class openloop(object): + __config = None + __openloop_config = None + + def __init__(self): + self.__config = baseutil.get_monitor_config() + self.__openloop_config = self.__config["openloop"] + + def debug_init(self): + global debuglevel + if os.path.exists(OPENLOOP_DEBUG_FILE): + debuglevel = debuglevel | OPENLOOPDEBUG | OPENLOOPERROR + else: + debuglevel = debuglevel & ~(OPENLOOPDEBUG | OPENLOOPERROR) + + def get_para(self, t): + para = self.__openloop_config.get(t) + return para + + def linear_cacl(self, temp): + self.debug_init() + openloop_para = self.get_para("linear") + if openloop_para is None: + openloop_debug("linear openloop: get para failed") + return None + + K = openloop_para["K"] + tin_min = openloop_para["tin_min"] + pwm_min = openloop_para["pwm_min"] + pwm_max = openloop_para["pwm_max"] + flag = openloop_para["flag"] + + openloop_debug("linear openloop: flag: %s, k: %s, tin_min: %s, pwm_min: 0x%x, pwm_max: 0x%x" + % (flag, K, tin_min, pwm_min, pwm_max)) + + if flag != 1: + openloop_debug("linear openloop: flag == 0") + return None + + if temp <= tin_min: + openloop_debug("linear openloop: temp = %d less than tin_min[%d]" % (temp, tin_min)) + return pwm_min + + pwm = int(pwm_min + (temp - tin_min) * K) + openloop_debug("linear openloop: cacl_pwm = 0x%x" % pwm) + + pwm = min(pwm, pwm_max) + pwm = max(pwm, pwm_min) + openloop_debug("linear openloop: temp = %d, pwm = 0x%x" % (temp, pwm)) + return pwm + + def curve_cacl(self, temp): + self.debug_init() + openloop_para = self.get_para("curve") + if openloop_para is None: + openloop_debug("curve openloop: get para failed") + return None + + a = openloop_para["a"] + b = openloop_para["b"] + c = openloop_para["c"] + tin_min = openloop_para["tin_min"] + pwm_min = openloop_para["pwm_min"] + pwm_max = openloop_para["pwm_max"] + flag = openloop_para["flag"] + + openloop_debug("curve openloop: flag: %s, a: %s, b: %s, c: %s, tin_min: %s, pwm_min: 0x%x, pwm_max: 0x%x" + % (flag, a, b, c, tin_min, pwm_min, pwm_max)) + + if flag != 1: + openloop_debug("curve openloop: flag == 0") + return None + + if temp <= tin_min: + openloop_debug("curve openloop: temp = %d less than tin_min[%d]" % (temp, tin_min)) + return pwm_min + + pwm = int(a * temp * temp + b * temp + c) + openloop_debug("curve openloop: cacl_pwm = 0x%x" % pwm) + + pwm = min(pwm, pwm_max) + pwm = max(pwm, pwm_min) + openloop_debug("curve openloop: temp = %d, pwm = 0x%x" % (temp, pwm)) + return pwm diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/pid.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/pid.py new file mode 100644 index 000000000000..25c2069fea66 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/algorithm/pid.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 +import os +import syslog +import copy + +from plat_hal.baseutil import baseutil + +PID_DEBUG_FILE = "/etc/.pid_debug_flag" + +PIDERROR = 1 +PIDDEBUG = 2 + +debuglevel = 0 + + +def pid_debug(s): + if PIDDEBUG & debuglevel: + syslog.openlog("FANCONTROL-PID", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def pid_error(s): + if PIDERROR & debuglevel: + syslog.openlog("FANCONTROL-PID", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +class pid(object): + __config = None + __pid_config = None + + def __init__(self): + self.__config = baseutil.get_monitor_config() + self.__pid_config = copy.deepcopy(self.__config["pid"]) + + def debug_init(self): + global debuglevel + if os.path.exists(PID_DEBUG_FILE): + debuglevel = debuglevel | PIDDEBUG | PIDERROR + else: + debuglevel = debuglevel & ~(PIDDEBUG | PIDERROR) + + def get_para(self, name): + para = self.__pid_config.get(name) + return para + + def get_temp_update(self, pid_para, current_temp): + temp = pid_para["value"] + if temp is None: + return None + temp.append(current_temp) + del temp[0] + return temp + + def cacl(self, last_pwm, name, current_temp): + delta_pwm = 0 + self.debug_init() + pid_debug("last_pwm = %d" % last_pwm) + + pid_para = self.get_para(name) + if pid_para is None: + pid_debug("get %s pid para failed" % name) + return None + + temp = self.get_temp_update(pid_para, current_temp) + if temp is None: + pid_debug("get %s update failed" % name) + return None + + speed_type = pid_para["type"] + Kp = pid_para["Kp"] + Ki = pid_para["Ki"] + Kd = pid_para["Kd"] + target = pid_para["target"] + pwm_min = pid_para["pwm_min"] + pwm_max = pid_para["pwm_max"] + flag = pid_para["flag"] + + pid_debug("%s pid para: flag: %s, speed_type: %s, Kp: %s, Ki: %s, Kd: %s, target: %s, pwm_min: 0x%x, pwm_max: 0x%x" + % (name, flag, speed_type, Kp, Ki, Kd, target, pwm_min, pwm_max)) + + if flag != 1: + pid_debug("%s pid flag == 0" % name) + return None + + if speed_type == "duty": + current_pwm = round(last_pwm * 100 / 255) + else: + current_pwm = last_pwm + + if temp[2] is None: + tmp_pwm = current_pwm + elif ((temp[0] is None) or (temp[1] is None)): + delta_pwm = Ki * (temp[2] - target) + tmp_pwm = current_pwm + delta_pwm + else: + delta_pwm = Kp * (temp[2] - temp[1]) + Ki * (temp[2] - target) + Kd * (temp[2] - 2 * temp[1] + temp[0]) + tmp_pwm = current_pwm + delta_pwm + + pid_debug("delta_pwm = %d" % delta_pwm) + if speed_type == "duty": + pwm = round(tmp_pwm * 255 / 100) + else: + pwm = int(tmp_pwm) + + pwm = min(pwm, pwm_max) + pwm = max(pwm, pwm_min) + pid_debug("last_pwm = 0x%x, pwm = 0x%x" % (last_pwm, pwm)) + return pwm diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/__init__.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/cust_fru.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/cust_fru.py new file mode 100644 index 000000000000..940c722ce467 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/cust_fru.py @@ -0,0 +1,135 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +import sys +import os + + +class CustFruException(Exception): + def __init__(self, message='custfrueerror', code=-100): + err = 'errcode: {0} message:{1}'.format(code, message) + Exception.__init__(self, err) + self.code = code + self.message = message + + +class CustFru(): + MAGIC_HEAD_INFO = 0x7a + + _CUST_MAGIC_OFFSET = 0 + _CUST_MAGIC_LEN = 1 + _CUST_VERSION_OFFSET = 1 + _CUST_VERSION_LEN = 6 + _CUST_CRC_OFFSET = 7 + _CUST_CRC_LEN = 1 + _CUST_PRODUCT_NAME_OFFSET = 10 + _CUST_PRODUCT_NAME_LEN = 17 + _CUST_MANUFACTURER_OFFSET = 27 + _CUST_MANUFACTURER_LEN = 7 + _CUST_SERIAL_NUMBER_OFFSET = 34 + _CUST_SERIAL_NUMBER_LEN = 25 + _CUST_INPUT_TYPE_OFFSET = 78 + _CUST_INPUT_TYPE_LEN = 2 + _CUST_INPUT_OFFSET = 86 + _CUST_INPUT_LEN = 15 + _CUST_OUTPUT_OFFSET = 108 + _CUST_OUTPUT_LEN = 11 + _CUST_POWER_OFFSET = 200 + _CUST_POWER_LEN = 10 + _CUST_MANUFACTURER_DATE_OFFSET = 210 + _CUST_MANUFACTURER_DATE_LEN = 3 + + def __init__(self): + self.magic = "" + self.version = "" + self.crc = "" + self.product_name = "" + self.manufacturer = "" + self.serial_number = "" + self.input_type = "" + self.input = "" + self.output = "" + self.power = "" + self.manufacturer_date = "" + + def checksum(self, v): + result = 0 + for item in v: + result += ord(item) + return (result & 0xff) + + def decode(self, e2): + # header + e2_index = 0 + head = ord(e2[0]) + if head != self.MAGIC_HEAD_INFO: + raise CustFruException("Customization fru eeprom head info error, head:0x%x" % head, -10) + self.magic = "0x%02x" % self.MAGIC_HEAD_INFO + + # version + version = "%s" % (e2[self._CUST_VERSION_OFFSET:self._CUST_VERSION_OFFSET + self._CUST_VERSION_LEN]) + self.version = version.replace("\xff", "").strip() + + # crc + crc_calc = self.checksum(e2[0:self._CUST_CRC_OFFSET]) + if crc_calc != ord(e2[self._CUST_CRC_OFFSET]): + raise CustFruException("Customization fru eeprom crc check error, calc: 0x%x, read: 0x%x" % (crc_calc, ord(e2[self._CUST_CRC_OFFSET])), -10) + self.crc = crc_calc + + # Product Name + product_name = "%s" % (e2[self._CUST_PRODUCT_NAME_OFFSET:self._CUST_PRODUCT_NAME_OFFSET + self._CUST_PRODUCT_NAME_LEN]) + self.product_name = product_name.replace("\xff", "").strip() + + # manufacturer + manufacturer = "%s" % (e2[self._CUST_MANUFACTURER_OFFSET:self._CUST_MANUFACTURER_OFFSET + self._CUST_MANUFACTURER_LEN]) + self.manufacturer = manufacturer.strip() + + # serial_number + serial_number = "%s" % (e2[self._CUST_SERIAL_NUMBER_OFFSET:self._CUST_SERIAL_NUMBER_OFFSET + self._CUST_SERIAL_NUMBER_LEN]) + self.serial_number = serial_number.strip() + + # input_type + input_type = "%s" % (e2[self._CUST_INPUT_TYPE_OFFSET:self._CUST_INPUT_TYPE_OFFSET + self._CUST_INPUT_TYPE_LEN]) + self.input_type = input_type.strip() + + # input + input = "%s" % (e2[self._CUST_INPUT_OFFSET:self._CUST_INPUT_OFFSET + self._CUST_INPUT_LEN]) + self.input = input.strip() + + # output + output = "%s" % (e2[self._CUST_OUTPUT_OFFSET:self._CUST_OUTPUT_OFFSET + self._CUST_OUTPUT_LEN]) + self.output = output.strip() + + # power + power = "%s" % (e2[self._CUST_POWER_OFFSET:self._CUST_POWER_OFFSET + self._CUST_POWER_LEN]) + self.power = power.replace("\xff", "").strip() + + # manufacturer_date + manufacturer_year = ord(e2[self._CUST_MANUFACTURER_DATE_OFFSET]) + 2000 + manufacturer_month = ord(e2[self._CUST_MANUFACTURER_DATE_OFFSET + 1]) + manufacturer_day = ord(e2[self._CUST_MANUFACTURER_DATE_OFFSET + 2]) + self.manufacturer_date = "%04d-%02d-%02d" % (manufacturer_year, manufacturer_month, manufacturer_day) + + return + + + def __str__(self): + formatstr = "Version : %s \n" \ + "Product Name : %s \n" \ + "Manufacturer : %s \n" \ + "Serial Number : %s \n" \ + "AC/DC Power Module : %s \n" \ + "INPUT : %s \n" \ + "OUTPUT : %s \n" \ + "POWER : %s \n" \ + "Manufacturer Date : %s \n" + str_tmp = formatstr % (self.version, + self.product_name, + self.manufacturer, + self.serial_number, + self.input_type, + self.input, + self.output, + self.power, + self.manufacturer_date) + return str_tmp.replace("\x00","") + diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/fantlv.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/fantlv.py new file mode 100644 index 000000000000..4be78e7fdc03 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/fantlv.py @@ -0,0 +1,192 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +class FantlvException(Exception): + def __init__(self, message='fantlverror', code=-100): + err = 'errcode: {0} message:{1}'.format(code, message) + Exception.__init__(self, err) + self.code = code + self.message = message + + +class fan_tlv(): + HEAD_INFO = "\x01\x7e\x01\xf1" + VERSION = 0x01 + FLAG = 0x7E + HW_VER = 0X01 + TYPE = 0xf1 + TLV_LEN = 00 + _FAN_TLV_HDR_LEN = 6 + _FAN_TLV_CRC_LEN = 2 + + _FAN_TLV_TYPE_NAME = 0x02 + _FAN_TLV_TYPE_SN = 0x03 + _FAN_TLV_TYPE_HW_INFO = 0x05 + _FAN_TLV_TYPE_DEV_TYPE = 0x06 + + @property + def dstatus(self): + return self._dstatus + + @property + def typename(self): + return self._typename + + @property + def typesn(self): + return self._typesn + + @property + def typehwinfo(self): + return self._typehwinfo + + @property + def typedevtype(self): + return self._typedevtype + + def __init__(self): + self._typename = "" + self._typesn = "" + self._typehwinfo = "" + self._typedevtype = "" + self._dstatus = 0 + + def strtoarr(self, val): + s = [] + if not isinstance(val, str): + return s + for index in val: + s.append(index) + return s + + def hex_to_str(self, s): + len_t = len(s) + if len_t % 2 != 0: + return 0 + ret = "" + for t in range(0, len_t / 2): + ret += chr(int(s[2 * t:2 * t + 2], 16)) + return ret + + def generate_fan_value(self): + bin_buffer = [chr(0xff)] * 256 + bin_buffer[0] = chr(self.VERSION) + bin_buffer[1] = chr(self.FLAG) + bin_buffer[2] = chr(self.HW_VER) + bin_buffer[3] = chr(self.TYPE) + + temp_t = "%08x" % self.typedevtype + typedevtype_t = self.hex_to_str(temp_t) + total_len = len(self.typename) + len(self.typesn) + \ + len(self.typehwinfo) + len(typedevtype_t) + 8 + + bin_buffer[4] = chr(total_len >> 8) + bin_buffer[5] = chr(total_len & 0x00FF) + + index_start = 6 + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_NAME) + bin_buffer[index_start + 1] = chr(len(self.typename)) + bin_buffer[index_start + 2: index_start + 2 + + len(self.typename)] = self.strtoarr(self.typename) + index_start = index_start + 2 + len(self.typename) + + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_SN) + bin_buffer[index_start + 1] = chr(len(self.typesn)) + bin_buffer[index_start + 2:index_start + 2 + + len(self.typesn)] = self.strtoarr(self.typesn) + index_start = index_start + 2 + len(self.typesn) + + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_HW_INFO) + bin_buffer[index_start + 1] = chr(len(self.typehwinfo)) + bin_buffer[index_start + 2:index_start + 2 + + len(self.typehwinfo)] = self.strtoarr(self.typehwinfo) + index_start = index_start + 2 + len(self.typehwinfo) + + bin_buffer[index_start] = chr(self._FAN_TLV_TYPE_DEV_TYPE) + bin_buffer[index_start + 1] = chr(len(typedevtype_t)) + bin_buffer[index_start + 2:index_start + 2 + + len(typedevtype_t)] = self.strtoarr(typedevtype_t) + index_start = index_start + 2 + len(typedevtype_t) + + crcs = fan_tlv.fancrc(''.join(bin_buffer[0:index_start])) + bin_buffer[index_start] = chr(crcs >> 8) + bin_buffer[index_start + 1] = chr(crcs & 0x00ff) + return bin_buffer + + def decode(self, e2): + if e2[0:4] != self.HEAD_INFO: + raise FantlvException("Fan tlv head info error,not fan tlv type", -10) + ret = [] + self.VERSION = ord(e2[0]) + self.FLAG = ord(e2[1]) + self.HW_VER = ord(e2[2]) + self.TYPE = ord(e2[3]) + self.TLV_LEN = (ord(e2[4]) << 8) | ord(e2[5]) + + tlv_index = self._FAN_TLV_HDR_LEN + tlv_end = self._FAN_TLV_HDR_LEN + self.TLV_LEN + + if len(e2) < self._FAN_TLV_HDR_LEN + self.TLV_LEN + 2: + raise FantlvException("Fan tlv eeprom len error!", -2) + sumcrc = fan_tlv.fancrc(e2[0:self._FAN_TLV_HDR_LEN + self.TLV_LEN]) + readcrc = ord(e2[self._FAN_TLV_HDR_LEN + self.TLV_LEN] + ) << 8 | ord(e2[self._FAN_TLV_HDR_LEN + self.TLV_LEN + 1]) + if sumcrc != readcrc: + raise FantlvException("Fan tlv eeprom checksum error!", -1) + self._dstatus = 0 + while (tlv_index + 2) < len(e2) and tlv_index < tlv_end: + s = self.decoder( + e2[tlv_index:tlv_index + 2 + ord(e2[tlv_index + 1])]) + tlv_index += ord(e2[tlv_index + 1]) + 2 + ret.append(s) + + return ret + + @staticmethod + def fancrc(t): + crc = 0 + for item in t: + crc += ord(item) + return crc + + def decoder(self, t): + try: + name = "" + value = "" + _len = 0 + if ord(t[0]) == self._FAN_TLV_TYPE_NAME: + name = "Product Name" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._typename = value + elif ord(t[0]) == self._FAN_TLV_TYPE_SN: + name = "serial Number" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._typesn = value + elif ord(t[0]) == self._FAN_TLV_TYPE_HW_INFO: + name = "hardware info" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._typehwinfo = value + elif ord(t[0]) == self._FAN_TLV_TYPE_DEV_TYPE: + name = "dev type" + _len = ord(t[1]) + value = "0x" + for c in t[2:2 + ord(t[1])]: + value += "%02X" % (ord(c),) + self._typedevtype = int(value, 16) + except Exception as e: + print(e) + return {"name": name, "code": ord(t[0]), "value": value, "lens": _len} + + def __str__(self): + formatstr = "VERSION : 0x%02x \n" \ + " FLAG : 0x%02x \n" \ + " HW_VER : 0x%02x \n" \ + " TYPE : 0x%02x \n" \ + "typename : %s \n" \ + "typesn : %s \n" \ + "typehwinfo : %s \n" + return formatstr % (self.VERSION, self.FLAG, self.HW_VER, self.TYPE, + self.typename, self.typesn, self.typehwinfo) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/fru.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/fru.py new file mode 100644 index 000000000000..f95164e03601 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/fru.py @@ -0,0 +1,961 @@ +#!/usr/bin/python3 +import collections +from datetime import datetime, timedelta +from bitarray import bitarray + + +__DEBUG__ = "N" + + +class FruException(Exception): + def __init__(self, message='fruerror', code=-100): + err = 'errcode: {0} message:{1}'.format(code, message) + Exception.__init__(self, err) + self.code = code + self.message = message + + +def e_print(err): + print("ERROR: " + err) + + +def d_print(debug_info): + if __DEBUG__ == "Y": + print(debug_info) + + +class FruUtil(): + @staticmethod + def decodeLength(value): + a = bitarray(8) + a.setall(True) + a[0:1] = 0 + a[1:2] = 0 + x = ord(a.tobytes()) + return x & ord(value) + + @staticmethod + def minToData(): + starttime = datetime(1996, 1, 1, 0, 0, 0) + endtime = datetime.now() + seconds = (endtime - starttime).total_seconds() + mins = seconds // 60 + m = int(round(mins)) + return m + + @staticmethod + def getTimeFormat(): + return datetime.now().strftime('%Y-%m-%d') + + @staticmethod + def getTypeLength(value): + if value is None or len(value) == 0: + return 0 + a = bitarray(8) + a.setall(False) + a[0:1] = 1 + a[1:2] = 1 + x = ord(a.tobytes()) + return x | len(value) + + @staticmethod + def checksum(b): + result = 0 + for item in b: + result += ord(item) + return (0x100 - (result & 0xff)) & 0xff + + +class BaseArea(object): + SUGGESTED_SIZE_COMMON_HEADER = 8 + SUGGESTED_SIZE_INTERNAL_USE_AREA = 72 + SUGGESTED_SIZE_CHASSIS_INFO_AREA = 32 + SUGGESTED_SIZE_BOARD_INFO_AREA = 80 + SUGGESTED_SIZE_PRODUCT_INFO_AREA = 80 + + INITVALUE = b'\x00' + resultvalue = INITVALUE * 256 + COMMON_HEAD_VERSION = b'\x01' + __childList = None + + def __init__(self, name="", size=0, offset=0): + self.__childList = [] + self._offset = offset + self.name = name + self._size = size + self._isPresent = False + self._data = b'\x00' * size + + @property + def childList(self): + return self.__childList + + @childList.setter + def childList(self, value): + self.__childList = value + + @property + def offset(self): + return self._offset + + @offset.setter + def offset(self, value): + self._offset = value + + @property + def size(self): + return self._size + + @size.setter + def size(self, value): + self._size = value + + @property + def data(self): + return self._data + + @data.setter + def data(self, value): + self._data = value + + @property + def isPresent(self): + return self._isPresent + + @isPresent.setter + def isPresent(self, value): + self._isPresent = value + + +class InternalUseArea(BaseArea): + pass + + +class ChassisInfoArea(BaseArea): + pass + + +class BoardInfoArea(BaseArea): + _boardTime = None + _fields = None + _mfg_date = None + areaversion = None + _boardversion = None + _language = None + + def __str__(self): + formatstr = "version : %x\n" \ + "length : %d \n" \ + "language : %x \n" \ + "mfg_date : %s \n" \ + "boardManufacturer : %s \n" \ + "boardProductName : %s \n" \ + "boardSerialNumber : %s \n" \ + "boardPartNumber : %s \n" \ + "fruFileId : %s \n" + + tmpstr = formatstr % (ord(self.boardversion), self.size, + self.language, self.getMfgRealData(), + self.boardManufacturer, self.boardProductName, + self.boardSerialNumber, self.boardPartNumber, + self.fruFileId) + for i in range(1, 11): + valtmp = "boardextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + tmpstr += "boardextra%d : %s \n" % (i, valtmpval) + else: + break + + return tmpstr + + def todict(self): + dic = collections.OrderedDict() + dic["boardversion"] = ord(self.boardversion) + dic["boardlength"] = self.size + dic["boardlanguage"] = self.language + dic["boardmfg_date"] = self.getMfgRealData() + dic["boardManufacturer"] = self.boardManufacturer + dic["boardProductName"] = self.boardProductName + dic["boardSerialNumber"] = self.boardSerialNumber + dic["boardPartNumber"] = self.boardPartNumber + dic["boardfruFileId"] = self.fruFileId + for i in range(1, 11): + valtmp = "boardextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + dic[valtmp] = valtmpval + else: + break + return dic + + def decodedata(self): + index = 0 + self.areaversion = self.data[index] + index += 1 + d_print("decode length :%d class size:%d" % + ((ord(self.data[index]) * 8), self.size)) + index += 2 + + timetmp = self.data[index: index + 3] + self.mfg_date = ord(timetmp[0]) | ( + ord(timetmp[1]) << 8) | (ord(timetmp[2]) << 16) + d_print("decode getMfgRealData :%s" % self.getMfgRealData()) + index += 3 + + templen = FruUtil.decodeLength(self.data[index]) + self.boardManufacturer = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardManufacturer:%s" % self.boardManufacturer) + + templen = FruUtil.decodeLength(self.data[index]) + self.boardProductName = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardProductName:%s" % self.boardProductName) + + templen = FruUtil.decodeLength(self.data[index]) + self.boardSerialNumber = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardSerialNumber:%s" % self.boardSerialNumber) + + templen = FruUtil.decodeLength(self.data[index]) + self.boardPartNumber = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode boardPartNumber:%s" % self.boardPartNumber) + + templen = FruUtil.decodeLength(self.data[index]) + self.fruFileId = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode fruFileId:%s" % self.fruFileId) + + for i in range(1, 11): + valtmp = "boardextra%d" % i + if self.data[index] != chr(0xc1): + templen = FruUtil.decodeLength(self.data[index]) + tmpval = self.data[index + 1: index + templen + 1] + setattr(self, valtmp, tmpval) + index += templen + 1 + d_print("decode boardextra%d:%s" % (i, tmpval)) + else: + break + + def fruSetValue(self, field, value): + tmp_field = getattr(self, field, None) + if tmp_field is not None: + setattr(self, field, value) + + def recalcute(self): + d_print("boardInfoArea version:%x" % ord(self.boardversion)) + d_print("boardInfoArea length:%d" % self.size) + d_print("boardInfoArea language:%x" % self.language) + self.mfg_date = FruUtil.minToData() + d_print("boardInfoArea mfg_date:%x" % self.mfg_date) + + self.data = chr(ord(self.boardversion)) + \ + chr(self.size // 8) + chr(self.language) + + self.data += chr(self.mfg_date & 0xFF) + self.data += chr((self.mfg_date >> 8) & 0xFF) + self.data += chr((self.mfg_date >> 16) & 0xFF) + + d_print("boardInfoArea boardManufacturer:%s" % self.boardManufacturer) + typelength = FruUtil.getTypeLength(self.boardManufacturer) + self.data += chr(typelength) + self.data += self.boardManufacturer + + d_print("boardInfoArea boardProductName:%s" % self.boardProductName) + self.data += chr(FruUtil.getTypeLength(self.boardProductName)) + self.data += self.boardProductName + + d_print("boardInfoArea boardSerialNumber:%s" % self.boardSerialNumber) + self.data += chr(FruUtil.getTypeLength(self.boardSerialNumber)) + self.data += self.boardSerialNumber + + d_print("boardInfoArea boardPartNumber:%s" % self.boardPartNumber) + self.data += chr(FruUtil.getTypeLength(self.boardPartNumber)) + self.data += self.boardPartNumber + + d_print("boardInfoArea fruFileId:%s" % self.fruFileId) + self.data += chr(FruUtil.getTypeLength(self.fruFileId)) + self.data += self.fruFileId + + for i in range(1, 11): + valtmp = "boardextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + d_print("boardInfoArea boardextra%d:%s" % (i, valtmpval)) + self.data += chr(FruUtil.getTypeLength(valtmpval)) + if valtmpval is not None: + self.data += valtmpval + else: + break + + self.data += chr(0xc1) + + if len(self.data) > (self.size - 1): + incr = (len(self.data) - self.size) // 8 + 1 + self.size += incr * 8 + + self.data = self.data[0:1] + chr(self.size // 8) + self.data[2:] + d_print("self data:%d" % len(self.data)) + d_print("self size:%d" % self.size) + d_print("adjust size:%d" % (self.size - len(self.data) - 1)) + self.data = self.data.ljust((self.size - 1), chr(self.INITVALUE[0])) + + # checksum + checksum = FruUtil.checksum(self.data) + d_print("board info checksum:%x" % checksum) + self.data += chr(checksum) + + def getMfgRealData(self): + starttime = datetime(1996, 1, 1, 0, 0, 0) + mactime = starttime + timedelta(minutes=self.mfg_date) + return mactime + + @property + def language(self): + self._language = 25 + return self._language + + @property + def mfg_date(self): + return self._mfg_date + + @mfg_date.setter + def mfg_date(self, val): + self._mfg_date = val + + @property + def boardversion(self): + self._boardversion = self.COMMON_HEAD_VERSION + return self._boardversion + + @property + def fruFileId(self): + return self._FRUFileID + + @fruFileId.setter + def fruFileId(self, val): + self._FRUFileID = val + + @property + def boardPartNumber(self): + return self._boardPartNumber + + @boardPartNumber.setter + def boardPartNumber(self, val): + self._boardPartNumber = val + + @property + def boardSerialNumber(self): + return self._boardSerialNumber + + @boardSerialNumber.setter + def boardSerialNumber(self, val): + self._boardSerialNumber = val + + @property + def boardProductName(self): + return self._boradProductName + + @boardProductName.setter + def boardProductName(self, val): + self._boradProductName = val + + @property + def boardManufacturer(self): + return self._boardManufacturer + + @boardManufacturer.setter + def boardManufacturer(self, val): + self._boardManufacturer = val + + @property + def boardTime(self): + return self._boardTime + + @boardTime.setter + def boardTime(self, val): + self._boardTime = val + + @property + def fields(self): + return self._fields + + @fields.setter + def fields(self, val): + self._fields = val + + +class ProductInfoArea(BaseArea): + _productManufacturer = None + _productAssetTag = None + _FRUFileID = None + _language = None + + def __str__(self): + formatstr = "version : %x\n" \ + "length : %d \n" \ + "language : %x \n" \ + "productManufacturer : %s \n" \ + "productName : %s \n" \ + "productPartModelName: %s \n" \ + "productVersion : %s \n" \ + "productSerialNumber : %s \n" \ + "productAssetTag : %s \n" \ + "fruFileId : %s \n" + + tmpstr = formatstr % (ord(self.areaversion), self.size, + self.language, self.productManufacturer, + self.productName, self.productPartModelName, + self.productVersion, self.productSerialNumber, + self.productAssetTag, self.fruFileId) + + for i in range(1, 11): + valtmp = "productextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + tmpstr += "productextra%d : %s \n" % (i, valtmpval) + else: + break + + return tmpstr + + def todict(self): + dic = collections.OrderedDict() + dic["productversion"] = ord(self.areaversion) + dic["productlength"] = self.size + dic["productlanguage"] = self.language + dic["productManufacturer"] = self.productManufacturer + dic["productName"] = self.productName + dic["productPartModelName"] = self.productPartModelName + dic["productVersion"] = int(self.productVersion, 16) + dic["productSerialNumber"] = self.productSerialNumber + dic["productAssetTag"] = self.productAssetTag + dic["productfruFileId"] = self.fruFileId + for i in range(1, 11): + valtmp = "productextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + dic[valtmp] = valtmpval + else: + break + return dic + + def decodedata(self): + index = 0 + self.areaversion = self.data[index] # 0 + index += 1 + d_print("decode length %d" % (ord(self.data[index]) * 8)) + d_print("class size %d" % self.size) + index += 2 + + templen = FruUtil.decodeLength(self.data[index]) + self.productManufacturer = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productManufacturer:%s" % self.productManufacturer) + + templen = FruUtil.decodeLength(self.data[index]) + self.productName = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productName:%s" % self.productName) + + templen = FruUtil.decodeLength(self.data[index]) + self.productPartModelName = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productPartModelName:%s" % self.productPartModelName) + + templen = FruUtil.decodeLength(self.data[index]) + self.productVersion = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productVersion:%s" % self.productVersion) + + templen = FruUtil.decodeLength(self.data[index]) + self.productSerialNumber = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productSerialNumber:%s" % self.productSerialNumber) + + templen = FruUtil.decodeLength(self.data[index]) + self.productAssetTag = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode productAssetTag:%s" % self.productAssetTag) + + templen = FruUtil.decodeLength(self.data[index]) + self.fruFileId = self.data[index + 1: index + templen + 1] + index += templen + 1 + d_print("decode fruFileId:%s" % self.fruFileId) + + for i in range(1, 11): + valtmp = "productextra%d" % i + if self.data[index] != chr(0xc1) and index < self.size - 1: + templen = FruUtil.decodeLength(self.data[index]) + if templen == 0: + break + tmpval = self.data[index + 1: index + templen + 1] + d_print("decode boardextra%d:%s" % (i, tmpval)) + setattr(self, valtmp, tmpval) + index += templen + 1 + else: + break + + @property + def productVersion(self): + return self._productVersion + + @productVersion.setter + def productVersion(self, name): + self._productVersion = name + + @property + def areaversion(self): + self._areaversion = self.COMMON_HEAD_VERSION + return self._areaversion + + @areaversion.setter + def areaversion(self, name): + self._areaversion = name + + @property + def language(self): + self._language = 25 + return self._language + + @property + def productManufacturer(self): + return self._productManufacturer + + @productManufacturer.setter + def productManufacturer(self, name): + self._productManufacturer = name + + @property + def productName(self): + return self._productName + + @productName.setter + def productName(self, name): + self._productName = name + + @property + def productPartModelName(self): + return self._productPartModelName + + @productPartModelName.setter + def productPartModelName(self, name): + self._productPartModelName = name + + @property + def productSerialNumber(self): + return self._productSerialNumber + + @productSerialNumber.setter + def productSerialNumber(self, name): + self._productSerialNumber = name + + @property + def productAssetTag(self): + return self._productAssetTag + + @productAssetTag.setter + def productAssetTag(self, name): + self._productAssetTag = name + + @property + def fruFileId(self): + return self._FRUFileID + + @fruFileId.setter + def fruFileId(self, name): + self._FRUFileID = name + + def fruSetValue(self, field, value): + tmp_field = getattr(self, field, None) + if tmp_field is not None: + setattr(self, field, value) + + def recalcute(self): + d_print("product version:%x" % ord(self.areaversion)) + d_print("product length:%d" % self.size) + d_print("product language:%x" % self.language) + self.data = chr(ord(self.areaversion)) + \ + chr(self.size // 8) + chr(self.language) + + typelength = FruUtil.getTypeLength(self.productManufacturer) + self.data += chr(typelength) + self.data += self.productManufacturer + + self.data += chr(FruUtil.getTypeLength(self.productName)) + self.data += self.productName + + self.data += chr(FruUtil.getTypeLength(self.productPartModelName)) + self.data += self.productPartModelName + + self.data += chr(FruUtil.getTypeLength(self.productVersion)) + self.data += self.productVersion + + self.data += chr(FruUtil.getTypeLength(self.productSerialNumber)) + self.data += self.productSerialNumber + + self.data += chr(FruUtil.getTypeLength(self.productAssetTag)) + if self.productAssetTag is not None: + self.data += self.productAssetTag + + self.data += chr(FruUtil.getTypeLength(self.fruFileId)) + self.data += self.fruFileId + + for i in range(1, 11): + valtmp = "productextra%d" % i + if hasattr(self, valtmp): + valtmpval = getattr(self, valtmp) + d_print("boardInfoArea productextra%d:%s" % (i, valtmpval)) + self.data += chr(FruUtil.getTypeLength(valtmpval)) + if valtmpval is not None: + self.data += valtmpval + else: + break + + self.data += chr(0xc1) + if len(self.data) > (self.size - 1): + incr = (len(self.data) - self.size) // 8 + 1 + self.size += incr * 8 + d_print("self.data:%d" % len(self.data)) + d_print("self.size:%d" % self.size) + + self.data = self.data[0:1] + chr(self.size // 8) + self.data[2:] + self.data = self.data.ljust((self.size - 1), chr(self.INITVALUE[0])) + checksum = FruUtil.checksum(self.data) + d_print("board info checksum:%x" % checksum) + self.data += chr(checksum) + + +class MultiRecordArea(BaseArea): + pass + + +class Field(object): + + def __init__(self, fieldType="ASCII", fieldData=""): + self.fieldData = fieldData + self.fieldType = fieldType + + @property + def fieldType(self): + return self.fieldType + + @property + def fieldData(self): + return self.fieldData + + +class ipmifru(BaseArea): + _BoardInfoArea = None + _ProductInfoArea = None + _InternalUseArea = None + _ChassisInfoArea = None + _multiRecordArea = None + _productinfoAreaOffset = BaseArea.INITVALUE + _boardInfoAreaOffset = BaseArea.INITVALUE + _internalUserAreaOffset = BaseArea.INITVALUE + _chassicInfoAreaOffset = BaseArea.INITVALUE + _multiRecordAreaOffset = BaseArea.INITVALUE + _bindata = None + _bodybin = None + _version = BaseArea.COMMON_HEAD_VERSION + _zeroCheckSum = None + _frusize = 256 + + def __str__(self): + tmpstr = "" + if self.boardInfoArea.isPresent: + tmpstr += "\nboardinfoarea: \n" + tmpstr += self.boardInfoArea.__str__() + if self.productInfoArea.isPresent: + tmpstr += "\nproductinfoarea: \n" + tmpstr += self.productInfoArea.__str__() + return tmpstr + + def decodeBin(self, eeprom): + commonHead = eeprom[0:8] + d_print("decode version %x" % ord(commonHead[0])) + if ord(self.COMMON_HEAD_VERSION) != ord(commonHead[0]): + raise FruException("HEAD VERSION error,not Fru format!", -10) + if FruUtil.checksum(commonHead[0:7]) != ord(commonHead[7]): + strtemp = "check header checksum error [cal:%02x data:%02x]" % ( + FruUtil.checksum(commonHead[0:7]), ord(commonHead[7])) + raise FruException(strtemp, -3) + if ord(commonHead[1]) != ord(self.INITVALUE): + d_print("Internal Use Area is present") + self.internalUseArea = InternalUseArea( + name="Internal Use Area", size=self.SUGGESTED_SIZE_INTERNAL_USE_AREA) + self.internalUseArea.isPresent = True + self.internalUserAreaOffset = ord(commonHead[1]) + self.internalUseArea.data = eeprom[self.internalUserAreaOffset * 8: ( + self.internalUserAreaOffset * 8 + self.internalUseArea.size)] + if ord(commonHead[2]) != ord(self.INITVALUE): + d_print("Chassis Info Area is present") + self.chassisInfoArea = ChassisInfoArea( + name="Chassis Info Area", size=self.SUGGESTED_SIZE_CHASSIS_INFO_AREA) + self.chassisInfoArea.isPresent = True + self.chassicInfoAreaOffset = ord(commonHead[2]) + self.chassisInfoArea.data = eeprom[self.chassicInfoAreaOffset * 8: ( + self.chassicInfoAreaOffset * 8 + self.chassisInfoArea.size)] + if ord(commonHead[3]) != ord(self.INITVALUE): + self.boardInfoArea = BoardInfoArea( + name="Board Info Area", size=self.SUGGESTED_SIZE_BOARD_INFO_AREA) + self.boardInfoArea.isPresent = True + self.boardInfoAreaOffset = ord(commonHead[3]) + self.boardInfoArea.size = ord( + eeprom[self.boardInfoAreaOffset * 8 + 1]) * 8 + d_print("Board Info Area is present size:%d" % + (self.boardInfoArea.size)) + self.boardInfoArea.data = eeprom[self.boardInfoAreaOffset * 8: ( + self.boardInfoAreaOffset * 8 + self.boardInfoArea.size)] + if FruUtil.checksum(self.boardInfoArea.data[:-1]) != ord(self.boardInfoArea.data[-1:]): + strtmp = "check boardInfoArea checksum error[cal:%02x data:%02x]" % \ + (FruUtil.checksum( + self.boardInfoArea.data[:-1]), ord(self.boardInfoArea.data[-1:])) + raise FruException(strtmp, -3) + self.boardInfoArea.decodedata() + if ord(commonHead[4]) != ord(self.INITVALUE): + d_print("Product Info Area is present") + self.productInfoArea = ProductInfoArea( + name="Product Info Area ", size=self.SUGGESTED_SIZE_PRODUCT_INFO_AREA) + self.productInfoArea.isPresent = True + self.productinfoAreaOffset = ord(commonHead[4]) + d_print("length offset value: %02x" % + ord(eeprom[self.productinfoAreaOffset * 8 + 1])) + self.productInfoArea.size = ord( + eeprom[self.productinfoAreaOffset * 8 + 1]) * 8 + d_print("Product Info Area is present size:%d" % + (self.productInfoArea.size)) + + self.productInfoArea.data = eeprom[self.productinfoAreaOffset * 8: ( + self.productinfoAreaOffset * 8 + self.productInfoArea.size)] + if FruUtil.checksum(self.productInfoArea.data[:-1]) != ord(self.productInfoArea.data[-1:]): + strtmp = "check productInfoArea checksum error [cal:%02x data:%02x]" % ( + FruUtil.checksum(self.productInfoArea.data[:-1]), ord(self.productInfoArea.data[-1:])) + raise FruException(strtmp, -3) + self.productInfoArea.decodedata() + if ord(commonHead[5]) != ord(self.INITVALUE): + self.multiRecordArea = MultiRecordArea( + name="MultiRecord record Area ") + d_print("MultiRecord record present") + self.multiRecordArea.isPresent = True + self.multiRecordAreaOffset = ord(commonHead[5]) + self.multiRecordArea.data = eeprom[self.multiRecordAreaOffset * 8: ( + self.multiRecordAreaOffset * 8 + self.multiRecordArea.size)] + + def initDefault(self): + self.version = self.COMMON_HEAD_VERSION + self.internalUserAreaOffset = self.INITVALUE + self.chassicInfoAreaOffset = self.INITVALUE + self.boardInfoAreaOffset = self.INITVALUE + self.productinfoAreaOffset = self.INITVALUE + self.multiRecordAreaOffset = self.INITVALUE + self.zeroCheckSum = self.INITVALUE + self.offset = self.SUGGESTED_SIZE_COMMON_HEADER + self.productInfoArea = None + self.internalUseArea = None + self.boardInfoArea = None + self.chassisInfoArea = None + self.multiRecordArea = None + # self.recalcute() + + @property + def version(self): + return self._version + + @version.setter + def version(self, name): + self._version = name + + @property + def internalUserAreaOffset(self): + return self._internalUserAreaOffset + + @internalUserAreaOffset.setter + def internalUserAreaOffset(self, obj): + self._internalUserAreaOffset = obj + + @property + def chassicInfoAreaOffset(self): + return self._chassicInfoAreaOffset + + @chassicInfoAreaOffset.setter + def chassicInfoAreaOffset(self, obj): + self._chassicInfoAreaOffset = obj + + @property + def productinfoAreaOffset(self): + return self._productinfoAreaOffset + + @productinfoAreaOffset.setter + def productinfoAreaOffset(self, obj): + self._productinfoAreaOffset = obj + + @property + def boardInfoAreaOffset(self): + return self._boardInfoAreaOffset + + @boardInfoAreaOffset.setter + def boardInfoAreaOffset(self, obj): + self._boardInfoAreaOffset = obj + + @property + def multiRecordAreaOffset(self): + return self._multiRecordAreaOffset + + @multiRecordAreaOffset.setter + def multiRecordAreaOffset(self, obj): + self._multiRecordAreaOffset = obj + + @property + def zeroCheckSum(self): + return self._zeroCheckSum + + @zeroCheckSum.setter + def zeroCheckSum(self, obj): + self._zeroCheckSum = obj + + @property + def productInfoArea(self): + return self._ProductInfoArea + + @productInfoArea.setter + def productInfoArea(self, obj): + self._ProductInfoArea = obj + + @property + def internalUseArea(self): + return self._InternalUseArea + + @internalUseArea.setter + def internalUseArea(self, obj): + self.internalUseArea = obj + + @property + def boardInfoArea(self): + return self._BoardInfoArea + + @boardInfoArea.setter + def boardInfoArea(self, obj): + self._BoardInfoArea = obj + + @property + def chassisInfoArea(self): + return self._ChassisInfoArea + + @chassisInfoArea.setter + def chassisInfoArea(self, obj): + self._ChassisInfoArea = obj + + @property + def multiRecordArea(self): + return self._multiRecordArea + + @multiRecordArea.setter + def multiRecordArea(self, obj): + self._multiRecordArea = obj + + @property + def bindata(self): + return self._bindata + + @bindata.setter + def bindata(self, obj): + self._bindata = obj + + @property + def bodybin(self): + return self._bodybin + + @bodybin.setter + def bodybin(self, obj): + self._bodybin = obj + + def recalcuteCommonHead(self): + self.bindata = "" + self.offset = self.SUGGESTED_SIZE_COMMON_HEADER + d_print("common Header %d" % self.offset) + d_print("fru eeprom size %d" % self._frusize) + if self.internalUseArea is not None and self.internalUseArea.isPresent: + self.internalUserAreaOffset = self.offset // 8 + self.offset += self.internalUseArea.size + d_print("internalUseArea is present offset:%d" % self.offset) + + if self.chassisInfoArea is not None and self.chassisInfoArea.isPresent: + self.chassicInfoAreaOffset = self.offset // 8 + self.offset += self.chassisInfoArea.size + d_print("chassisInfoArea is present offset:%d" % self.offset) + + if self.boardInfoArea is not None and self.boardInfoArea.isPresent: + self.boardInfoAreaOffset = self.offset // 8 + self.offset += self.boardInfoArea.size + d_print("boardInfoArea is present offset:%d" % self.offset) + d_print("boardInfoArea is present size:%d" % + self.boardInfoArea.size) + + if self.productInfoArea is not None and self.productInfoArea.isPresent: + self.productinfoAreaOffset = self.offset // 8 + self.offset += self.productInfoArea.size + d_print("productInfoArea is present offset:%d" % self.offset) + + if self.multiRecordArea is not None and self.multiRecordArea.isPresent: + self.multiRecordAreaOffset = self.offset // 8 + d_print("multiRecordArea is present offset:%d" % self.offset) + + if self.internalUserAreaOffset == self.INITVALUE: + self.internalUserAreaOffset = 0 + if self.productinfoAreaOffset == self.INITVALUE: + self.productinfoAreaOffset = 0 + if self.chassicInfoAreaOffset == self.INITVALUE: + self.chassicInfoAreaOffset = 0 + if self.boardInfoAreaOffset == self.INITVALUE: + self.boardInfoAreaOffset = 0 + if self.multiRecordAreaOffset == self.INITVALUE: + self.multiRecordAreaOffset = 0 + + self.zeroCheckSum = (0x100 - ord(self.version) - self.internalUserAreaOffset - self.chassicInfoAreaOffset - self.productinfoAreaOffset + - self.boardInfoAreaOffset - self.multiRecordAreaOffset) & 0xff + d_print("zerochecksum:%x" % self.zeroCheckSum) + self.data = "" + self.data += chr(self.version[0]) + chr(self.internalUserAreaOffset) + chr(self.chassicInfoAreaOffset) + chr( + self.boardInfoAreaOffset) + chr(self.productinfoAreaOffset) + chr(self.multiRecordAreaOffset) + chr(self.INITVALUE[0]) + chr(self.zeroCheckSum) + + self.bindata = self.data + self.bodybin + totallen = len(self.bindata) + d_print("totallen %d" % totallen) + if totallen < self._frusize: + self.bindata = self.bindata.ljust(self._frusize, chr(self.INITVALUE[0])) + else: + raise FruException('bin data more than %d' % self._frusize, -2) + + def recalcutebin(self): + self.bodybin = "" + if self.internalUseArea is not None and self.internalUseArea.isPresent: + d_print("internalUseArea present") + self.bodybin += self.internalUseArea.data + if self.chassisInfoArea is not None and self.chassisInfoArea.isPresent: + d_print("chassisInfoArea present") + self.bodybin += self.chassisInfoArea.data + if self.boardInfoArea is not None and self.boardInfoArea.isPresent: + d_print("boardInfoArea present") + self.boardInfoArea.recalcute() + self.bodybin += self.boardInfoArea.data + if self.productInfoArea is not None and self.productInfoArea.isPresent: + d_print("productInfoAreapresent") + self.productInfoArea.recalcute() + self.bodybin += self.productInfoArea.data + if self.multiRecordArea is not None and self.multiRecordArea.isPresent: + d_print("multiRecordArea present") + self.bodybin += self.productInfoArea.data + + def recalcute(self, fru_eeprom_size=256): + self._frusize = fru_eeprom_size + self.recalcutebin() + self.recalcuteCommonHead() + + def setValue(self, area, field, value): + tmp_area = getattr(self, area, None) + if tmp_area is not None: + tmp_area.fruSetValue(field, value) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/onietlv.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/onietlv.py new file mode 100644 index 000000000000..a90f8f8453c8 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/eepromutil/onietlv.py @@ -0,0 +1,441 @@ +#!/usr/bin/python3 +import binascii + + +class OnietlvException(Exception): + def __init__(self, message='onietlverror', code=-100): + err = 'errcode: {0} message:{1}'.format(code, message) + Exception.__init__(self, err) + self.code = code + self.message = message + + +class onie_tlv(object): + TLV_INFO_ID_STRING = "TlvInfo\x00" + TLV_INFO_INIA_ID = "\x00\x00\x13\x11" + TLV_INFO_VERSION = 0x01 + TLV_INFO_LENGTH = 0x00 + TLV_INFO_LENGTH_VALUE = 0xba + + TLV_CODE_PRODUCT_NAME = 0x21 + TLV_CODE_PART_NUMBER = 0x22 + TLV_CODE_SERIAL_NUMBER = 0x23 + TLV_CODE_MAC_BASE = 0x24 + TLV_CODE_MANUF_DATE = 0x25 + TLV_CODE_DEVICE_VERSION = 0x26 + TLV_CODE_LABEL_REVISION = 0x27 + TLV_CODE_PLATFORM_NAME = 0x28 + TLV_CODE_ONIE_VERSION = 0x29 + TLV_CODE_MAC_SIZE = 0x2A + TLV_CODE_MANUF_NAME = 0x2B + TLV_CODE_MANUF_COUNTRY = 0x2C + TLV_CODE_VENDOR_NAME = 0x2D + TLV_CODE_DIAG_VERSION = 0x2E + TLV_CODE_SERVICE_TAG = 0x2F + TLV_CODE_VENDOR_EXT = 0xFD + TLV_CODE_CRC_32 = 0xFE + _TLV_DISPLAY_VENDOR_EXT = 1 + TLV_CODE_WB_CARID = 0x01 + _TLV_INFO_HDR_LEN = 11 + TLV_CODE_PRODUCT_ID = 0x40 + TLV_CODE_HW_VERSION = 0x41 + TLV_CODE_MAIN_FILENAME = 0x42 + TLV_CODE_DTS_FINENAME = 0x43 + TLV_CODE_SY_SERIAL0 = 0x44 + TLV_CODE_SY_SERIAL1 = 0x45 + TLV_CODE_SY_SERIAL2 = 0x46 + TLV_CODE_SY_SERIAL3 = 0x47 + TLV_CODE_PROJECT_ID = 0x48 + TLV_CODE_SETMAC_VERSION = 0x49 + TLV_CODE_EEPROM_TYPE = 0x4A + + @property + def dstatus(self): + return self._dstatus + + @property + def cardid(self): + return self._cardid + + @property + def productname(self): + return self._productname + + @property + def partnum(self): + return self._partnum + + @property + def serialnum(self): + return self._serialnum + + @property + def macbase(self): + return self._macbase + + @property + def manufdate(self): + return self._manufdate + + @property + def deviceversion(self): + return self._deviceversion + + @property + def labelrevision(self): + return self._labelrevision + + @property + def platformname(self): + return self._platformname + + @property + def onieversion(self): + return self._onieversion + + @property + def macsize(self): + return self._macsize + + @property + def manufname(self): + return self._manufname + + @property + def manufcountry(self): + return self._manufcountry + + @property + def vendorname(self): + return self._vendorname + + @property + def diagname(self): + return self._diagname + + @property + def servicetag(self): + return self._servicetag + + @property + def vendorext(self): + return self._vendorext + + def __init__(self): + self._cardid = "" + self._productname = "" + self._partnum = "" + self._serialnum = "" + self._macbase = "" + self._manufdate = "" + self._deviceversion = "" + self._labelrevision = "" + self._platformname = "" + self._onieversion = "" + self._macsize = "" + self._manufname = "" + self._manufcountry = "" + self._vendorname = "" + self._diagname = "" + self._servicetag = "" + self._vendorext = "" + self._productid = "" + self._hwversion = "" + self._mainfilename = "" + self._dtsfilename = "" + self._syserial0 = "" + self._syserial1 = "" + self._syserial2 = "" + self._syserial3 = "" + self._projectid = "" + self._setmacversion = "" + self._eepromtype = "" + self._crc32 = "" + self._dstatus = 0 + + def oniecrc32(self, v): + data_array = bytearray() + for x in v: + data_array.append(ord(x)) + return '0x%08x' % (binascii.crc32(bytes(data_array)) & 0xffffffff) + + def getTLV_BODY(self, tlv_type, value): + x = [] + temp_t = "" + if tlv_type == self.TLV_CODE_MAC_BASE: + arr = value.split(':') + for tt in arr: + temp_t += chr(int(tt, 16)) + elif tlv_type == self.TLV_CODE_DEVICE_VERSION: + temp_t = chr(value) + elif tlv_type == self.TLV_CODE_MAC_SIZE: + temp_t = chr(value >> 8) + chr(value & 0x00ff) + else: + temp_t = value + x.append(chr(tlv_type)) + x.append(chr(len(temp_t))) + for i in temp_t: + x.append(i) + return x + + def generate_ext(self, cardid): + s = "%08x" % cardid + ret = "" + for t in range(0, 4): + ret += chr(int(s[2 * t:2 * t + 2], 16)) + ret = chr(0x01) + chr(len(ret)) + ret + return ret + + def generate_value(self, _t): + ret = [] + for i in self.TLV_INFO_ID_STRING: + ret.append(i) + ret.append(chr(self.TLV_INFO_VERSION)) + ret.append(chr(self.TLV_INFO_LENGTH)) + ret.append(chr(self.TLV_INFO_LENGTH_VALUE)) + + total_len = 0 + for key in _t: + x = self.getTLV_BODY(key, _t[key]) + ret += x + total_len += len(x) + ret[10] = chr(total_len + 6) + + ret.append(chr(0xFE)) + ret.append(chr(0x04)) + s = self.oniecrc32(''.join(ret)) + for t in range(0, 4): + ret.append(chr(int(s[2 * t + 2:2 * t + 4], 16))) + totallen = len(ret) + if totallen < 256: + for left_t in range(0, 256 - totallen): + ret.append(chr(0x00)) + return (ret, True) + + def decode_tlv(self, e): + tlv_index = 0 + tlv_end = len(e) + ret = [] + while tlv_index < tlv_end and (tlv_index + 2 + ord(e[tlv_index + 1])) <= len(e): + rt = self.decoder(e[tlv_index:tlv_index + 2 + ord(e[tlv_index + 1])]) + ret.append(rt) + if ord(e[tlv_index]) == self.TLV_CODE_CRC_32: + break + tlv_index += ord(e[tlv_index + 1]) + 2 + return ret + + def decode(self, e): + if e[0:8] != self.TLV_INFO_ID_STRING: + raise OnietlvException("ONIE tlv head info error,not onie tlv type", -1) + total_len = (ord(e[9]) << 8) | ord(e[10]) + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_len + if tlv_end > len(e): + raise OnietlvException("ONIE tlv length error", -2) + ret = [] + ret = self.decode_tlv(e[tlv_index:tlv_end]) + for item in ret: + if item['code'] == self.TLV_CODE_VENDOR_EXT: + if item["value"][0:4] == self.TLV_INFO_INIA_ID: + rt = self.decode_tlv(item["value"][4:]) + else: + rt = self.decode_tlv(item["value"][0:]) + ret.extend(rt) + return ret + + def decoder(self, t): + if ord(t[0]) == self.TLV_CODE_PRODUCT_NAME: + name = "Product Name" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._productname = value + elif ord(t[0]) == self.TLV_CODE_PART_NUMBER: + name = "Part Number" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._partnum = value + elif ord(t[0]) == self.TLV_CODE_SERIAL_NUMBER: + name = "Serial Number" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._serialnum = value + elif ord(t[0]) == self.TLV_CODE_MAC_BASE: + name = "Base MAC Address" + _len = ord(t[1]) + value = ":".join(['%02X' % ord(T) for T in t[2:8]]).upper() + self._macbase = value + elif ord(t[0]) == self.TLV_CODE_MANUF_DATE: + name = "Manufacture Date" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._manufdate = value + elif ord(t[0]) == self.TLV_CODE_DEVICE_VERSION: + name = "Device Version" + _len = ord(t[1]) + value = ord(t[2]) + self._deviceversion = value + elif ord(t[0]) == self.TLV_CODE_LABEL_REVISION: + name = "Label Revision" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._labelrevision = value + elif ord(t[0]) == self.TLV_CODE_PLATFORM_NAME: + name = "Platform Name" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._platformname = value + elif ord(t[0]) == self.TLV_CODE_ONIE_VERSION: + name = "ONIE Version" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._onieversion = value + elif ord(t[0]) == self.TLV_CODE_MAC_SIZE: + name = "MAC Addresses" + _len = ord(t[1]) + value = str((ord(t[2]) << 8) | ord(t[3])) + self._macsize = value + elif ord(t[0]) == self.TLV_CODE_MANUF_NAME: + name = "Manufacturer" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._manufname = value + elif ord(t[0]) == self.TLV_CODE_MANUF_COUNTRY: + name = "Manufacture Country" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._manufcountry = value + elif ord(t[0]) == self.TLV_CODE_VENDOR_NAME: + name = "Vendor Name" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._vendorname = value + elif ord(t[0]) == self.TLV_CODE_DIAG_VERSION: + name = "Diag Version" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._diagname = value + elif ord(t[0]) == self.TLV_CODE_SERVICE_TAG: + name = "Service Tag" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._servicetag = value + elif ord(t[0]) == self.TLV_CODE_VENDOR_EXT: + name = "Vendor Extension" + _len = ord(t[1]) + value = "" + if self._TLV_DISPLAY_VENDOR_EXT: + value = t[2:2 + ord(t[1])] + self._vendorext = value + elif ord(t[0]) == self.TLV_CODE_CRC_32 and len(t) == 6: + name = "CRC-32" + _len = ord(t[1]) + value = "0x%08X" % (((ord(t[2]) << 24) | ( + ord(t[3]) << 16) | (ord(t[4]) << 8) | ord(t[5])),) + self._crc32 = value + elif ord(t[0]) == self.TLV_CODE_WB_CARID: + name = "Card id" + _len = ord(t[1]) + value = "" + for c in t[2:2 + ord(t[1])]: + value += "%02X" % (ord(c),) + self._cardid = value + elif ord(t[0]) == self.TLV_CODE_PRODUCT_ID: + name = "Product id" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._productid = value + elif ord(t[0]) == self.TLV_CODE_HW_VERSION: + name = "Hardware Version" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._hwversion = value + elif ord(t[0]) == self.TLV_CODE_MAIN_FILENAME: + name = "Main File Name" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._mainfilename = value + elif ord(t[0]) == self.TLV_CODE_DTS_FINENAME: + name = "DTS File Name" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._dtsfilename = value + elif ord(t[0]) == self.TLV_CODE_SY_SERIAL0: + name = "SY Serial 0" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._syserial0 = value + elif ord(t[0]) == self.TLV_CODE_SY_SERIAL1: + name = "SY Serial 1" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._syserial1 = value + elif ord(t[0]) == self.TLV_CODE_SY_SERIAL2: + name = "SY Serial 2" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._syserial2 = value + elif ord(t[0]) == self.TLV_CODE_SY_SERIAL3: + name = "SY Serial 3" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._syserial3 = value + elif ord(t[0]) == self.TLV_CODE_PROJECT_ID: + name = "Project id" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._projectid = value + elif ord(t[0]) == self.TLV_CODE_SETMAC_VERSION: + name = "Setmac Version" + _len = ord(t[1]) + value = t[2:2 + ord(t[1])] + self._setmacversion = value + elif ord(t[0]) == self.TLV_CODE_EEPROM_TYPE: + name = "EEPROM Type" + _len = ord(t[1]) + value = "" + for c in t[2:2 + ord(t[1])]: + value += "%02X" % (ord(c),) + self._eepromtype = value + else: + name = "Unknown" + _len = ord(t[1]) + value = "" + for c in t[2:2 + ord(t[1])]: + value += "0x%02X " % (ord(c),) + return {"name": name, "code": ord(t[0]), "value": value, "lens": _len} + + def __str__(self): + formatstr = "Card id : %s \n" \ + "Product Name : %s \n" \ + "Part Number : %s \n" \ + "Serial Number : %s \n" \ + "Base MAC Address : %s \n" \ + "Manufacture Date : %s \n" \ + "Device Version : %s \n" \ + "Label Revision : %s \n" \ + "Platform Name : %s \n" \ + "ONIE Version : %s \n" \ + "MAC Addresses : %s \n" \ + "Manufacturer : %s \n" \ + "Manufacture Country : %s \n" \ + "Vendor Name : %s \n" \ + "Diag Version : %s \n" \ + "Service Tag : %s \n" \ + "CRC-32 : %s \n" + return formatstr % (self._cardid, + self._productname, + self._partnum, + self._serialnum, + self._macbase, + self._manufdate, + self._deviceversion, + self._labelrevision, + self._platformname, + self._onieversion, + self._macsize, + self._manufname, + self._manufcountry, + self._vendorname, + self._diagname, + self._servicetag, + self._crc32) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/__init__.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/baseutil.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/baseutil.py new file mode 100644 index 000000000000..abf0ecf97d6b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/baseutil.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python3 +####################################################### +# +# baseutil.py +# Python implementation of the Class baseutil +# +####################################################### +import importlib.machinery +import os +import syslog +import json +import subprocess +import glob +from plat_hal.osutil import osutil + +SYSLOG_IDENTIFIER = "HAL" + +CONFIG_DB_PATH = "/etc/sonic/config_db.json" +BOARD_ID_PATH = "/sys/module/platform_common/parameters/dfd_my_type" +BOARD_AIRFLOW_PATH = "/etc/sonic/.airflow" + + +def getonieplatform(path): + if not os.path.isfile(path): + return "" + machine_vars = {} + with open(path) as machine_file: + for line in machine_file: + tokens = line.split('=') + if len(tokens) < 2: + continue + machine_vars[tokens[0]] = tokens[1].strip() + return machine_vars.get("onie_platform") + + +def getboardid(): + if not os.path.exists(BOARD_ID_PATH): + return "NA" + with open(BOARD_ID_PATH) as fd: + id_str = fd.read().strip() + return "0x%x" % (int(id_str, 10)) + + +def getboardairflow(): + if not os.path.exists(BOARD_AIRFLOW_PATH): + return "NA" + with open(BOARD_AIRFLOW_PATH) as fd: + airflow_str = fd.read().strip() + data = json.loads(airflow_str) + airflow = data.get("board", "NA") + return airflow + + +def getplatform_config_db(): + if not os.path.isfile(CONFIG_DB_PATH): + return "" + val = subprocess.check_output(["sonic-cfggen", "-j", CONFIG_DB_PATH, "-v", "DEVICE_METADATA.localhost.platform"]).decode().strip() + if len(val) <= 0: + return "" + return val + + +def getplatform_name(): + if os.path.isfile('/host/machine.conf'): + return getonieplatform('/host/machine.conf') + if os.path.isfile('/etc/sonic/machine.conf'): + return getonieplatform('/etc/sonic/machine.conf') + return getplatform_config_db() + + +platform = (getplatform_name()).replace("-", "_") +boardid = getboardid() +boardairflow = getboardairflow() + + +CONFIG_FILE_PATH_LIST = [ + "/usr/lib/python3/dist-packages/", + "/usr/local/lib/*/dist-packages/hal-config/" +] + + +DEVICE_CONFIG_FILE_LIST = [ + platform + "_" + boardid + "_" + boardairflow + "_device.py", + platform + "_" + boardid + "_device.py", + platform + "_" + boardairflow + "_device.py", + platform + "_device.py" +] + + +MONITOR_CONFIG_FILE_LIST = [ + platform + "_" + boardid + "_" + boardairflow + "_monitor.py", + platform + "_" + boardid + "_monitor.py", + platform + "_" + boardairflow + "_monitor.py", + platform + "_monitor.py" +] + + +class baseutil: + + CONFIG_NAME = 'devices' + MONITOR_CONFIG_NAME = 'monitor' + UBOOT_ENV_URL = '/etc/device/uboot_env' + + @staticmethod + def get_config(): + real_path = None + for configfile_path in CONFIG_FILE_PATH_LIST: + if "/*/" in configfile_path: + filepath = glob.glob(configfile_path) + if len(filepath) == 0: + continue + configfile_path = filepath[0] + for config_file in DEVICE_CONFIG_FILE_LIST: + file = configfile_path + config_file + if os.path.exists(file): + real_path = file + break + if real_path is not None: + break + + if real_path is None: + raise Exception("get hal device config error") + devices = importlib.machinery.SourceFileLoader(baseutil.CONFIG_NAME, real_path).load_module() + return devices.devices + + @staticmethod + def get_monitor_config(): + real_path = None + for configfile_path in CONFIG_FILE_PATH_LIST: + for config_file in MONITOR_CONFIG_FILE_LIST: + file = configfile_path + config_file + if os.path.exists(file): + real_path = file + break + if real_path is not None: + break + + if real_path is None: + raise Exception("get hal monitor config error") + monitor = importlib.machinery.SourceFileLoader(baseutil.MONITOR_CONFIG_NAME, real_path).load_module() + return monitor.monitor + + @staticmethod + def get_productname(): + ret, val = osutil.command("cat %s |grep productname | awk -F\"=\" '{print $2;}'" % baseutil.UBOOT_ENV_URL) + tmp = val.lower().replace('-', '_') + if ret != 0 or len(val) <= 0: + raise Exception("get productname error") + return tmp + + @staticmethod + def get_platform(): + ret, val = osutil.command("cat %s |grep conffitname | awk -F\"=\" '{print $2;}'" % baseutil.UBOOT_ENV_URL) + if ret != 0 or len(val) <= 0: + raise Exception("get platform error") + return val + + @staticmethod + def get_product_fullname(): + ret, val = osutil.command("cat %s |grep productname | awk -F\"=\" '{print $2;}'" % baseutil.UBOOT_ENV_URL) + if ret != 0 or len(val) <= 0: + raise Exception("get productname error") + return val + + @staticmethod + def logger_debug(msg): + syslog.openlog(SYSLOG_IDENTIFIER) + syslog.syslog(syslog.LOG_DEBUG, msg) + syslog.closelog() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/chassisbase.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/chassisbase.py new file mode 100644 index 000000000000..767d6da34ba9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/chassisbase.py @@ -0,0 +1,318 @@ +#!/usr/bin/env python3 +####################################################### +# +# chassisbase.py +# Python implementation of the Class chassisbase +# +####################################################### +from plat_hal.dcdc import dcdc +from plat_hal.onie_e2 import onie_e2 +from plat_hal.psu import psu +from plat_hal.led import led +from plat_hal.temp import temp +from plat_hal.fan import fan +from plat_hal.cpld import cpld +from plat_hal.component import component +from plat_hal.cpu import cpu +from plat_hal.baseutil import baseutil + + +class chassisbase(object): + __onie_e2_list = [] + __psu_list = [] + __led_list = [] + __temp_list = [] + __fan_list = [] + __card_list = [] + __sensor_list = [] + __dcdc_list = [] + __cpld_list = [] + __comp_list = [] + __bios_list = [] + __bmc_list = [] + __cpu = None + + def __init__(self, conftype=0, conf=None): + # type: (object, object, object) -> object + """ + init chassisbase as order + + type = 0 use default conf, maybe auto find by platform + type = 1 use given conf, conf is not None + + BITMAP + bit 16 + bit 0 PSU + bit 1 LED + bit 2 TEMP + bit 3 fan + bit 4 card + bit 5 sensor + """ + __confTemp = None + + if conftype == 0: + # user + __confTemp = baseutil.get_config() + elif conftype == 1: + __confTemp = conf + + # onie_e2 + onie_e2temp = [] + onie_e2config = __confTemp.get('onie_e2', []) + for item in onie_e2config: + onie_e2_1 = onie_e2(item) + onie_e2temp.append(onie_e2_1) + self.onie_e2_list = onie_e2temp + + # psu + psutemp = [] + psuconfig = __confTemp.get('psus', []) + for item in psuconfig: + psu1 = psu(item) + psutemp.append(psu1) + self.psu_list = psutemp + + # led + ledtemp = [] + ledconfig = __confTemp.get('leds', []) + for item in ledconfig: + led1 = led(item) + ledtemp.append(led1) + self.led_list = ledtemp + + # temp + temptemp = [] + tempconfig = __confTemp.get('temps', []) + for item in tempconfig: + temp1 = temp(item) + temptemp.append(temp1) + self.temp_list = temptemp + + # fan + fantemp = [] + fanconfig = __confTemp.get('fans', []) + for item in fanconfig: + fan1 = fan(item) + fantemp.append(fan1) + self.fan_list = fantemp + + # dcdc + dcdctemp = [] + dcdcconfig = __confTemp.get('dcdc', []) + for item in dcdcconfig: + dcdc1 = dcdc(item) + dcdctemp.append(dcdc1) + self.dcdc_list = dcdctemp + + # cpld + cpldtemp = [] + cpldconfig = __confTemp.get('cplds', []) + for item in cpldconfig: + cpld1 = cpld(item) + cpldtemp.append(cpld1) + self.cpld_list = cpldtemp + + # compoment: cpld/fpga/bios + comptemp = [] + compconfig = __confTemp.get('comp_cpld', []) + for item in compconfig: + comp1 = component(item) + comptemp.append(comp1) + self.comp_list = comptemp + + compconfig = __confTemp.get('comp_fpga', []) + for item in compconfig: + comp1 = component(item) + self.comp_list.append(comp1) + + compconfig = __confTemp.get('comp_bios', []) + for item in compconfig: + comp1 = component(item) + self.comp_list.append(comp1) + + # cpu + cpuconfig = __confTemp.get('cpu', []) + if len(cpuconfig): + self.cpu = cpu(cpuconfig[0]) + + # dcdc + @property + def dcdc_list(self): + return self.__dcdc_list + + @dcdc_list.setter + def dcdc_list(self, val): + self.__dcdc_list = val + + # sensor + @property + def sensor_list(self): + return self.__sensor_list + + @sensor_list.setter + def sensor_list(self, val): + self.__sensor_list = val + + def get_sensor_byname(self, name): + tmp = self.sensor_list + for item in tmp: + if name == item.name: + return item + return None + + # onie_e2 + @property + def onie_e2_list(self): + return self.__onie_e2_list + + @onie_e2_list.setter + def onie_e2_list(self, val): + self.__onie_e2_list = val + + def get_onie_e2_byname(self, name): + tmp = self.onie_e2_list + for item in tmp: + if name == item.name: + return item + return None + + # psu + @property + def psu_list(self): + return self.__psu_list + + @psu_list.setter + def psu_list(self, val): + self.__psu_list = val + + def get_psu_byname(self, name): + tmp = self.psu_list + for item in tmp: + if name == item.name: + return item + return None + + # fan + @property + def fan_list(self): + return self.__fan_list + + @fan_list.setter + def fan_list(self, val): + self.__fan_list = val + + def get_fan_byname(self, name): + tmp = self.fan_list + for item in tmp: + if name == item.name: + return item + return None + + # led + + @property + def led_list(self): + return self.__led_list + + @led_list.setter + def led_list(self, val): + self.__led_list = val + + def get_led_byname(self, name): + tmp = self.led_list + for item in tmp: + if name == item.name: + return item + return None + + # temp + @property + def temp_list(self): + return self.__temp_list + + @temp_list.setter + def temp_list(self, val): + self.__temp_list = val + + def get_temp_byname(self, name): + tmp = self.temp_list + for item in tmp: + if name == item.name: + return item + return None + + # cpld + @property + def cpld_list(self): + return self.__cpld_list + + @cpld_list.setter + def cpld_list(self, val): + self.__cpld_list = val + + def get_cpld_byname(self, name): + tmp = self.cpld_list + for item in tmp: + if name == item.name: + return item + return None + + @property + def comp_list(self): + return self.__comp_list + + @comp_list.setter + def comp_list(self, val): + self.__comp_list = val + + def get_comp_byname(self, name): + tmp = self.comp_list + for item in tmp: + if name == item.name: + return item + return None + + # bios + @property + def bios_list(self): + return self.__bios_list + + @bios_list.setter + def bios_list(self, val): + self.__bios_list = val + + def get_bios_byname(self, name): + tmp = self.bios_list + for item in tmp: + if name == item.name: + return item + return None + + # bmc + @property + def bmc_list(self): + return self.__bmc_list + + @bmc_list.setter + def bmc_list(self, val): + self.__bmc_list = val + + def get_bmc_byname(self, name): + tmp = self.bmc_list + for item in tmp: + if name == item.name: + return item + return None + + # cpu + @property + def cpu(self): + return self.__cpu + + @cpu.setter + def cpu(self, val): + self.__cpu = val + + def get_cpu_byname(self, name): + return self.cpu diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/component.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/component.py new file mode 100644 index 000000000000..0f2ad2167485 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/component.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +####################################################### +# +# component.py +# Python implementation of the Class fan +# +####################################################### +from plat_hal.devicebase import devicebase +from plat_hal.osutil import osutil + + +class component(devicebase): + __user_reg = None + + def __init__(self, conf=None): + if conf is not None: + self.name = conf.get('name', None) + self.version_file = conf.get('VersionFile', None) + self.comp_id = conf.get("comp_id", None) + self.desc = conf.get("desc", None) + self.slot = conf.get("slot", None) + + def get_version(self): + version = "NA" + try: + ret, version = self.get_value(self.version_file) + if ret is False: + return version + pattern = self.version_file.get('pattern', None) + version = osutil.std_match(version, pattern) + except Exception: + return version + return version diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/cpld.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/cpld.py new file mode 100644 index 000000000000..09eed5f975ee --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/cpld.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 +####################################################### +# +# fan.py +# Python implementation of the Class fan +# +####################################################### +from plat_hal.devicebase import devicebase + + +class cpld(devicebase): + __user_reg = None + + def __init__(self, conf=None): + if conf is not None: + self.name = conf.get('name', None) + self.user_reg = conf.get('UserReg', None) + self.console_reg = conf.get('ConsoleReg', None) + self.console_reg_attrs = conf.get('ConsoleRegAttrs', None) + self.version_file = conf.get('VersionFile', None) + self.cpld_id = conf.get("cpld_id", None) + self.desc = conf.get("desc", None) + self.slot = conf.get("slot", None) + self.format = conf.get("format", "big_endian") + self.warm = conf.get("warm", None) + self.type = conf.get("type", None) + + def get_user_reg(self): + if self.user_reg is None: + return False + ret, val = self.get_value(self.user_reg) + return val + + def set_user_reg(self, value): + if self.user_reg is None: + return False + byte = value & 0xFF + ret, val = self.set_value(self.user_reg, byte) + return ret + + def set_console_owner(self, owner): + ret = False + + if self.console_reg is None: + return False + tmpattr = self.console_reg_attrs.get(owner, None) + if tmpattr is not None: + ret, val = self.set_value(self.console_reg, tmpattr) + return ret + + def get_version(self): + ret, val = self.get_value(self.version_file) + if ret is False: + val = "N/A" + return val + if self.type == "str": + return val.strip('\n') + val = val.strip('\n').split(" ") + if len(val) < 4: + val = "N/A" + return val + if self.format == "little_endian": + cpld_version = "%s%s%s%s" % (val[3], val[2], val[1], val[0]) + else: + cpld_version = "%s%s%s%s" % (val[0], val[1], val[2], val[3]) + return cpld_version diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/cpu.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/cpu.py new file mode 100644 index 000000000000..c6bec1abd1c2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/cpu.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +############################################################################### +# +# Hardware Abstraction Layer APIs -- CPU APIs. +# +############################################################################### +from plat_hal.devicebase import devicebase + + +class cpu(devicebase): + + def __init__(self, conf=None): + if conf is not None: + self.name = conf.get('name', None) + self.cpu_reset_cnt_reg = conf.get('CpuResetCntReg', None) + self.reboot_cause_path = conf.get('reboot_cause_path', "/etc/sonic/.reboot/.previous-reboot-cause.txt") + + def get_cpu_reset_num(self): + """ + get cpu reset num. + @return cpu reset number, -1 for failure + """ + ret = -1 + if self.cpu_reset_cnt_reg is None: + self.logger_debug("ERR: no support get cpu reset num") + return ret + ret, reset_num = self.get_value(self.cpu_reset_cnt_reg) + if ret is False or reset_num is None: + self.logger_debug("ERR: i2c read cpu_reset_cnt_reg,result:%s" % reset_num) + else: + if isinstance(reset_num, str): + ret = int(reset_num, 16) + else: + ret = reset_num + return ret + + def get_cpu_reboot_cause(self): + """ + get_cpu_reboot_cause + @return cpu reset number, -1 for failure + """ + try: + with open(self.reboot_cause_path) as fd: + reboot_cause = fd.read().strip() + return reboot_cause + except Exception: + return "Unknown reboot cause" + diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/dcdc.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/dcdc.py new file mode 100644 index 000000000000..ba604995043d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/dcdc.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +from plat_hal.devicebase import devicebase +from plat_hal.sensor import sensor + + +class dcdc(devicebase): + def __init__(self, conf=None): + if conf is not None: + self.name = conf.get('name', None) + self.dcdc_id = conf.get("dcdc_id", None) + self.sensor = sensor(conf) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/devicebase.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/devicebase.py new file mode 100644 index 000000000000..001b4ee239bf --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/devicebase.py @@ -0,0 +1,351 @@ +#!/usr/bin/env python3 +####################################################### +# +# devicebase.py +# Python implementation of the Class devicebase +# +####################################################### +import subprocess +import shlex +import ast +from plat_hal.osutil import osutil +from plat_hal.baseutil import baseutil + +class CodeVisitor(ast.NodeVisitor): + + def __init__(self): + self.value = None + + def get_value(self): + return self.value + + def get_op_value(self, node): + if isinstance(node, ast.Call): # node is func call + value = self.visit_Call(node) + elif isinstance(node, ast.BinOp): # node is BinOp + value = self.visit_BinOp(node) + elif isinstance(node, ast.UnaryOp): # node is UnaryOp + value = self.visit_UnaryOp(node) + elif isinstance(node, ast.Num): # node is Num Constant + value = node.n + elif isinstance(node, ast.Str): # node is Str Constant + value = node.s + else: + raise NotImplementedError("Unsupport operand type: %s" % type(node)) + return value + + def visit_UnaryOp(self, node): + ''' + node.op: operand type, only support ast.UAdd/ast.USub + node.operand: only support ast.Call/ast.Constant(ast.Num/ast.Str)/ast.BinOp/ast.UnaryOp + ''' + + operand_value = self.get_op_value(node.operand) + if isinstance(node.op, ast.UAdd): + self.value = operand_value + elif isinstance(node.op, ast.USub): + self.value = 0 - operand_value + else: + raise NotImplementedError("Unsupport arithmetic methods %s" % type(node.op)) + return self.value + + def visit_BinOp(self, node): + ''' + node.left: left operand, only support ast.Call/ast.Constant(ast.Num)/ast.BinOp + node.op: operand type, only support ast.Add/ast.Sub/ast.Mult/ast.Div + node.right: right operan, only support ast.Call/ast.Constant(ast.Num/ast.Str)/ast.BinOp + ''' + left_value = self.get_op_value(node.left) + right_value = self.get_op_value(node.right) + + if isinstance(node.op, ast.Add): + self.value = left_value + right_value + elif isinstance(node.op, ast.Sub): + self.value = left_value - right_value + elif isinstance(node.op, ast.Mult): + self.value = left_value * right_value + elif isinstance(node.op, ast.Div): + self.value = left_value / right_value + else: + raise NotImplementedError("Unsupport arithmetic methods %s" % type(node.op)) + return self.value + + def visit_Call(self, node): + ''' + node.func.id: func name, only support 'float', 'int', 'str' + node.args: func args list,only support ast.Constant(ast.Num/ast.Str)/ast.BinOp/ast.Call + str/float only support one parameter, eg: float(XXX), str(xxx) + int support one or two parameters, eg: int(xxx) or int(xxx, 16) + xxx can be ast.Call/ast.Constant(ast.Num/ast.Str)/ast.BinOp + ''' + calc_tuple = ("float", "int", "str") + + if node.func.id not in calc_tuple: + raise NotImplementedError("Unsupport function call type: %s" % node.func.id) + + args_val_list = [] + for item in node.args: + ret = self.get_op_value(item) + args_val_list.append(ret) + + if node.func.id == "str": + if len(args_val_list) != 1: + raise TypeError("str() takes 1 positional argument but %s were given" % len(args_val_list)) + value = str(args_val_list[0]) + self.value = value + return value + + if node.func.id == "float": + if len(args_val_list) != 1: + raise TypeError("float() takes 1 positional argument but %s were given" % len(args_val_list)) + value = float(args_val_list[0]) + self.value = value + return value + # int + if len(args_val_list) == 1: + value = int(args_val_list[0]) + self.value = value + return value + if len(args_val_list) == 2: + value = int(args_val_list[0], args_val_list[1]) + self.value = value + return value + raise TypeError("int() takes 1 or 2 arguments (%s given)" % len(args_val_list)) + + +class devicebase(object): + _name = None + __error_ret = -99999 + + @property + def name(self): + return self._name + + @name.setter + def name(self, val): + self._name = val + + def dumpValueByI2c(self, bus, loc): + value = "" + for i in range(256): + ret, val = self.get_i2c(bus, loc, i) + value += chr(val) + return value + + def byteTostr(self, val): + strtmp = '' + for value in val: + strtmp += chr(value) + return strtmp + + def get_eeprom_info(self, conf): + eeprom = "" + if conf.get('way') == 'sysfs': + ret, eeprom = self.get_value(conf) + if ret is False: + return None + elif conf.get('way') == 'devfile': + ret, eeprom_list = self.get_value(conf) + if ret is False: + return None + for item in eeprom_list: + eeprom += chr(item) + else: + eeprom = self.dumpValueByI2c(conf.get('bus'), conf.get('addr')) + return eeprom + + def exec_os_cmd(self, cmd): + status, output = subprocess.getstatusoutput(cmd) + return status, output + + def get_value(self, config): + ''' + get value by config way + way i2c/sysfs/lpc + ''' + way = config.get("way") + if way == 'sysfs': + return self.get_sysfs(config.get("loc"), config.get("flock_path")) + if way == "i2c": + bus = config.get("bus") + addr = config.get("addr") + offset = config.get("offset") + return self.get_i2c(bus, addr, offset) + if way == "io": + io_addr = config.get('io_addr') + read_len = config.get('read_len', 1) + return self.get_io(io_addr, read_len) + if way == "i2cword": + bus = config.get("bus") + addr = config.get("addr") + offset = config.get("offset") + return self.get_i2cword(bus, addr, offset) + if way == "devmem": + addr = config.get("addr") + digit = config.get("digit") + mask = config.get("mask", None) + return self.get_devmem(addr, digit, mask) + if way == "sdk": + get_type = config.get("type") + if get_type == "bcm_temp": + return self.getbcmtemp() + if get_type == "bcm_reg": + reg = config.get("reg") + return self.getbcmreg(reg) + raise Exception("cannot found sdk type deal") + if way == "devfile": + loc = config.get("loc") + offset = config.get("offset") + length = config.get("len") + ret, val_list = self.devfile_read(loc, offset, length) + if ret is True: + if length == 1: + val = val_list[0] + return True, val + return True, val_list + return False, ("devfile read failed. path:%s, offset:0x%x, read_len:%d" % (loc, offset, length)) + if way == "devfile_ascii": + loc = config.get("loc") + offset = config.get("offset") + length = config.get("len") + return self.devfile_read_ascii(loc, offset, length) + if way == 'cmd': + cmd = config.get("cmd") + ret, log = self.exec_os_cmd(cmd) + if ret: + return False, ("cmd write exec %s failed, log: %s" % (cmd, log)) + return True, log + if way == 'config': + value = config.get("value") + return True, value + raise Exception("cannot found way deal") + + def devfile_read(self, loc, offset, length): + return osutil.readdevfile(loc, offset, length) + + def devfile_read_ascii(self, loc, offset, length): + return osutil.readdevfile_ascii(loc, offset, length) + + def get_sysfs(self, loc, flock_path=None): + return self.getsysfs(loc, flock_path) + + def getsysfs(self, loc, flock_path=None): + ret, val = osutil.readsysfs(loc, flock_path) + return ret, val + + def get_devmem(self, addr, digit, mask): + return osutil.getdevmem(addr, digit, mask) + + def get_i2cword(self, bus, addr, offset): + return self.geti2cword(bus, addr, offset) + + def geti2cword(self, bus, addr, offset): + ret, val = osutil.geti2cword(bus, addr, offset) + return ret, val + + def get_io(self, reg_addr, read_len): + return self.getio(reg_addr, read_len) + + def getio(self, reg_addr, read_len): + ret, val = osutil.io_rd(reg_addr, read_len) + return ret, val + + def get_i2c(self, bus, addr, offset): + return self.geti2c(bus, addr, offset) + + def geti2c(self, bus, addr, offset): + ret, val = osutil.wbi2cget(bus, addr, offset) + return ret, val + + def set_value(self, config, val): + ''' + get value by config way + way i2c/sysfs/lpc + ''' + way = config.get("way") + if way == 'sysfs': + return self.set_sysfs(config.get("loc"), "0x%02x" % val) + if way == "i2c": + bus = config.get("bus") + addr = config.get("addr") + offset = config.get("offset") + return self.set_i2c(bus, addr, offset, val) + if way == "i2cpec": + bus = config.get("bus") + addr = config.get("addr") + offset = config.get("offset") + return self.seti2c_byte_pec(bus, addr, offset, val) + if way == 'i2cword': + bus = config.get("bus") + addr = config.get("addr") + offset = config.get("offset") + return self.set_i2cword(bus, addr, offset, val) + if way == "i2cwordpec": + bus = config.get("bus") + addr = config.get("addr") + offset = config.get("offset") + return self.set_i2cwordpec(bus, addr, offset, val) + if way == "devfile": + loc = config.get("loc") + offset = config.get("offset") + return self.devfile_write(loc, offset, val) + return False, "unsupport way: %s" % way + + def set_sysfs(self, loc, value): + return self.setsysfs(loc, value) + + def setsysfs(self, loc, value): + return osutil.writesysfs(loc, value) + + def set_i2cword(self, bus, addr, offset, byte): + return self.seti2cword(bus, addr, offset, byte) + + def seti2cword(self, bus, addr, offset, byte): + return osutil.seti2cword(bus, addr, offset, byte) + + def set_i2cwordpec(self, bus, addr, offset, val): + return osutil.seti2cwordpec(bus, addr, offset, val) + + def seti2c_byte_pec(self, bus, addr, offset, val): + return osutil.seti2c_byte_pec(bus, addr, offset, val) + + def set_i2c(self, bus, addr, offset, byte): + return self.seti2c(bus, addr, offset, byte) + + def seti2c(self, bus, addr, offset, byte): + ret, val = osutil.wbi2cset(bus, addr, offset, byte) + return ret, val + + def devfile_write(self, loc, offset, val): + ret, val = osutil.writedevfile(loc, offset, val) + return ret, val + + def getbcmtemp(self): + try: + sta, ret = osutil.getmactemp() + if sta is True: + mac_aver = float(ret.get("average", self.__error_ret)) + mac_aver = mac_aver * 1000 + else: + return False, ret + except AttributeError as e: + return False, str(e) + return True, mac_aver + + def getbcmreg(self, reg): + ret, val = osutil.getsdkreg(reg) + return ret, val + + def logger_debug(self, msg): + baseutil.logger_debug(msg) + + def command(self, cmd): + ret, output = osutil.command(cmd) + return ret, output + + def get_format_value(self, format_str): + ast_obj = ast.parse(format_str, mode='eval') + visitor = CodeVisitor() + visitor.visit(ast_obj) + ret = visitor.get_value() + return ret diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/fan.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/fan.py new file mode 100644 index 000000000000..5b33af02527c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/fan.py @@ -0,0 +1,417 @@ +#!/usr/bin/env python3 +####################################################### +# +# fan.py +# Python implementation of the Class fan +# +####################################################### +from eepromutil.fru import ipmifru +from eepromutil.fantlv import fan_tlv +from plat_hal.devicebase import devicebase +from plat_hal.rotor import rotor + + +class fan(devicebase): + __rotor_list = [] + __pn = None + __raweeprom = None + __sn = None + __hw_version = None + __e2loc = None + __rotors = None + __AirFlow = None + __SpeedMin = None + __SpeedMax = None + __PowerMax = None + __productName = None + __productSerialNumber = None + __WatchdogStatus = None + __led_attrs_config = None + __led_config = None + __WatchdogStatus_config = None + __AirFlowconifg = None + __EnableWatchdogConf = None + __Rotor_config = None + __fan_display_name = None # 'N/A' + __fan_display_name_conifg = None + + def __init__(self, conf=None): + if conf is not None: + self.name = conf.get('name', None) + self.sn = conf.get('sn', None) + self.present = conf.get('present', None) + self.e2loc = conf.get('e2loc', None) + self.e2_type = conf.get('e2_type', "fru") + self.SpeedMin = conf.get('SpeedMin', None) + self.SpeedMax = conf.get('SpeedMax', None) + self.PowerMax = conf.get('PowerMax', None) + self.AirFlowconifg = conf.get("airflow", None) + self.WatchdogStatus_config = conf.get('WatchdogStatus', None) + self.EnableWatchdogConf = conf.get('EnableWatchdogConf', None) + self.led_attrs_config = conf.get('led_attrs', None) + self.led_config = conf.get('led', None) + self.Rotor_config = conf.get('Rotor', None) + self.fan_display_name_conifg = conf.get("fan_display_name", None) + rotor_tmp = [] + for value in self.Rotor_config.values(): + rotor_tmp.append(rotor(value)) + rotor_tmp.sort(key=lambda x: x.name, reverse=False) + self.rotor_list = rotor_tmp + self.rotors = len(self.rotor_list) + + @property + def EnableWatchdogConf(self): + return self.__EnableWatchdogConf + + @EnableWatchdogConf.setter + def EnableWatchdogConf(self, val): + self.__EnableWatchdogConf = val + + @property + def rotor_list(self): + return self.__rotor_list + + @rotor_list.setter + def rotor_list(self, val): + self.__rotor_list = val + + @property + def Rotor_config(self): + return self.__Rotor_config + + @Rotor_config.setter + def Rotor_config(self, val): + self.__Rotor_config = val + + @property + def productName(self): + return self.__productName + + @productName.setter + def productName(self, val): + self.__productName = val + + @property + def productSerialNumber(self): + return self.__productSerialNumber + + @productSerialNumber.setter + def productSerialNumber(self, val): + self.__productSerialNumber = val + + @property + def hw_version(self): + return self.__hw_version + + @hw_version.setter + def hw_version(self, val): + self.__hw_version = val + + @property + def sn(self): + return self.__sn + + @sn.setter + def sn(self, val): + self.__sn = val + + @property + def pn(self): + return self.__pn + + @pn.setter + def pn(self, val): + self.__pn = val + + @property + def raweeprom(self): + return self.__raweeprom + + @raweeprom.setter + def raweeprom(self, val): + self.__raweeprom = val + + @property + def SpeedMax(self): + return self.__SpeedMax + + @SpeedMax.setter + def SpeedMax(self, val): + self.__SpeedMax = val + + @property + def SpeedMin(self): + return self.__SpeedMin + + @SpeedMin.setter + def SpeedMin(self, val): + self.__SpeedMin = val + + @property + def PowerMax(self): + return self.__PowerMax + + @PowerMax.setter + def PowerMax(self, val): + self.__PowerMax = val + + @property + def rotors(self): + return self.__rotors + + @property + def AirFlow(self): + return self.__AirFlow + + @AirFlow.setter + def AirFlow(self, val): + self.__AirFlow = val + + @rotors.setter + def rotors(self, val): + self.__rotors = val + + @property + def fan_display_name_conifg(self): + return self.__fan_display_name_conifg + + @fan_display_name_conifg.setter + def fan_display_name_conifg(self, val): + self.__fan_display_name_conifg = val + + @property + def fan_display_name(self): + return self.__fan_display_name + + @fan_display_name.setter + def fan_display_name(self, val): + self.__fan_display_name = val + + def getspeed(self, conf): + tmp = None + if conf is None: + return -1 + ret, val = self.get_value(conf) + if ret is True: + tmp = int(str(val), 10) + else: + val = None + if val is not None: + return int(15000000 / tmp) + return -1 + + def get_speed(self, rotor_index): + rotor_item = self.get_rotor_index(rotor_index) + if rotor_item is None: + return None + speed = rotor_item.rotor_Speed.Value + if speed is None: + return None + return int(speed) + + def set_led(self, color): + status = self.led_attrs_config.get(color, None) + if status is None: + return False + + mask = self.led_attrs_config.get('mask', 0xff) + ret, value = self.get_value(self.led_config) + if ret is False or value is None: + return False + setval = (int(value) & ~mask) | (status) + ret, val = self.set_value(self.led_config, setval) + return ret + + def get_led(self): + mask = self.led_attrs_config.get('mask', 0xff) + ret, value = self.get_value(self.led_config) + if ret is False or value is None: + return False, 'N/A' + ledval = int(value) & mask + for key, val in self.led_attrs_config.items(): + if (ledval == val) and (key != "mask"): + return True, key + return False, 'N/A' + + def set_speed(self, rotor_index, level): + if level > 255 or level < 0: + return False + rotor_item = self.get_rotor_index(rotor_index) + if rotor_item is None: + return False + ret, val = self.set_value(rotor_item.Speedconfig, int(level)) + return ret + + def get_rotor_index(self, rotor_index): + if rotor_index > len(self.rotor_list): + return None + rotor_item = self.rotor_list[rotor_index - 1] + return rotor_item + + def get_rotor_byname(self, rotor_index): + for rotor_item in self.rotor_list: + if rotor_item.name == rotor_index: + return rotor_item + return None + + def get_presence(self): + ret, val = self.get_value(self.present) + if ret is False or val is None or val == "no_support": + return False + if isinstance(val, str): + value = int(val, 16) + else: + value = val + mask = self.present.get("mask") + flag = value & mask + okval = self.present.get("okval", 0) + if flag == okval: + return True + return False + + def get_speed_pwm(self, rotor_index): + rotor_item = self.get_rotor_index(rotor_index) + if rotor_item is None: + return False + if rotor_item.i2c_speed is None: + return False + val = round(rotor_item.i2c_speed * 100 / 255) + return val + + def feed_watchdog(self): + ret = False + for rotor_item in self.rotor_list: + ret, val = rotor_item.feed_watchdog() + if ret is False: + return ret + return ret + + def get_fru_info(self): + try: + if self.get_presence() is False: + raise Exception("%s: not present" % self.name) + eeprom = self.get_eeprom_info(self.e2loc) + if eeprom is None: + raise Exception("%s: value is none" % self.name) + fru = ipmifru() + if isinstance(eeprom, bytes): + eeprom = self.byteTostr(eeprom) + fru.decodeBin(eeprom) + self.productName = fru.productInfoArea.productName.strip() # PN + self.productSerialNumber = fru.productInfoArea.productSerialNumber.strip() # SN + self.hw_version = fru.productInfoArea.productVersion.strip() # HW + except Exception: + self.productName = None + self.productSerialNumber = None + self.hw_version = None + return False + return True + + def get_tlv_info(self): + try: + if self.get_presence() is False: + raise Exception("%s: not present" % self.name) + eeprom = self.get_eeprom_info(self.e2loc) + if eeprom is None: + raise Exception("%s: value is none" % self.name) + tlv = fan_tlv() + rets = tlv.decode(eeprom) + for item in rets: + if item["name"] == "Product Name": + self.productName = item["value"].replace("\x00", "").strip() + elif item["name"] == "serial Number": + self.productSerialNumber = item["value"].replace("\x00", "").strip() + elif item["name"] == "hardware info": + self.hw_version = item["value"].replace("\x00", "").strip() + except Exception: + self.productName = None + self.productSerialNumber = None + self.hw_version = None + return False + return True + + def decode_eeprom_info(self): + '''get fan name, hw version, sn''' + if self.e2_type == "fru": + return self.get_fru_info() + + if self.e2_type == "fantlv": + return self.get_tlv_info() + + return False + + def get_AirFlow(self): + if self.productName is None: + ret = self.decode_eeprom_info() + if ret is False: + self.AirFlow = None + return False + if self.AirFlowconifg is None: + self.AirFlow = None + return False + for i in self.AirFlowconifg: + if self.productName in self.AirFlowconifg[i]: + self.AirFlow = i + return True + self.AirFlow = None + return False + + def enable_watchdog(self, enable): + ret = False + if enable is True: + byte = self.EnableWatchdogConf.get("enable_byte", None) + ret, val = self.set_value(self.EnableWatchdogConf, byte) + elif enable is False: + byte = self.EnableWatchdogConf.get("disable_byte", None) + ret, val = self.set_value(self.EnableWatchdogConf, byte) + return ret + + def get_watchdog_status(self): + dic = {"support": None, "open": None, "work_full": None, "work_allow_set": None} + if self.WatchdogStatus_config is None: + return None + ret, val = self.get_value(self.WatchdogStatus_config) + if ret is False or val is None: + return None + support_watchdog_off = self.WatchdogStatus_config.get("support_watchdog_off", None) + is_open_off = self.WatchdogStatus_config.get("is_open_off", None) + full_running_off = self.WatchdogStatus_config.get("full_running_off", None) + running_setting_off = self.WatchdogStatus_config.get("running_setting_off", None) + if support_watchdog_off is not None: + if support_watchdog_off & val == self.WatchdogStatus_config.get("support_watchdog_mask", None): + dic["support"] = True + else: + dic["support"] = False + return dic + if is_open_off is not None: + if is_open_off & val == self.WatchdogStatus_config.get("is_open_mask", None): + dic["open"] = True + else: + dic["open"] = False + if full_running_off is not None: + if full_running_off & val == self.WatchdogStatus_config.get("full_running_mask", None): + dic["work_full"] = True + else: + dic["work_full"] = False + if running_setting_off is not None: + if running_setting_off & val == self.WatchdogStatus_config.get("running_setting_mask", None): + dic["work_allow_set"] = True + else: + dic["work_allow_set"] = False + return dic + + def get_fan_display_name(self): + if self.productName is None: + ret = self.decode_eeprom_info() + if ret is False: + self.fan_display_name = None + return False + if self.fan_display_name_conifg is None: + self.fan_display_name = self.productName + return False + for i in self.fan_display_name_conifg: + if self.productName in self.fan_display_name_conifg[i]: + self.fan_display_name = i + return True + self.fan_display_name = self.productName + return False diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/interface.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/interface.py new file mode 100644 index 000000000000..88873a029b64 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/interface.py @@ -0,0 +1,1339 @@ +#!/usr/bin/env python3 +####################################################### +# +# interface.py +# Python implementation of the Class interface +# +####################################################### +import collections +from plat_hal.chassisbase import chassisbase +from plat_hal.baseutil import baseutil +from plat_hal.osutil import osutil + + +def Singleton(cls): + _instance = {} + + def _singleton(*args, **kargs): + if cls not in _instance: + _instance[cls] = cls(*args, **kargs) + return _instance[cls] + + return _singleton + + +@Singleton +class interface(object): + __chas = None + __error_ret = None + + def __init__(self): + self.chas = chassisbase() + self.__error_ret = -99999 + self.__na_ret = 'N/A' + + @property + def na_ret(self): + return self.__na_ret + + @na_ret.setter + def na_ret(self, val): + self.__na_ret = val + + @property + def error_ret(self): + return self.__error_ret + + @error_ret.setter + def error_ret(self, val): + self.__error_ret = val + + @property + def chas(self): + return self.__chas + + @chas.setter + def chas(self, val): + self.__chas = val + + # onie_e2 + def get_onie_e2(self): + onie_e2_list = self.chas.onie_e2_list + return onie_e2_list + + def get_onie_e2_path(self, name): + onie_e2 = self.chas.get_onie_e2_byname(name) + if onie_e2 is None: + return None + return onie_e2.e2_path + + def get_device_airflow(self, name): + onie_e2 = self.chas.get_onie_e2_byname(name) + if onie_e2 is None: + return None + return onie_e2.airflow + + def get_onie_e2_obj(self, name): + onie_e2 = self.chas.get_onie_e2_byname(name) + if onie_e2 is None: + return None + onie_e2.get_onie_e2_info() + return onie_e2 + + # temp + def get_temps(self): + templist = self.chas.temp_list + return templist + + def get_temp_total_number(self): + templist = self.chas.temp_list + return len(templist) + + def check_temp_id_exist(self, temp_id): + templist = self.chas.temp_list + for temp in templist: + if temp.temp_id == temp_id: + return True + return False + + def get_temp_id_number(self): + templist = self.chas.temp_list + temp_num = 0 + for i in range(len(templist)): + temp_id = "TEMP" + str(i + 1) + ret = self.check_temp_id_exist(temp_id) + if ret is True: + temp_num = temp_num + 1 + else: + return temp_num + return temp_num + + def get_temp_location(self, temp_name): + temp = self.chas.get_temp_byname(temp_name) + return temp.get_location() + + def set_temp_location(self, temp_name, location): + temp = self.chas.get_temp_byname(temp_name) + return temp.set_location(location) + + def set_temp_name(self, temp_name, name): + temp = self.chas.get_temp_byname(temp_name) + return temp.set_name(name) + + def get_appoint_temp(self, temp_name): + temp = self.chas.get_led_byname(temp_name) + return temp.get_temp() + + def set_appoint_temp(self, temp_name, val): + temp = self.chas.get_temp_byname(temp_name) + return temp.set_temp(val) + + def get_temp_mintemp(self, temp_name): + temp = self.chas.get_temp_byname(temp_name) + return temp.get_mintemp() + + def set_temp_mintemp(self, temp_name, val): + temp = self.chas.get_temp_byname(temp_name) + return temp.set_mintemp(val) + + # led + def get_leds(self): + ledlist = self.chas.led_list + return ledlist + + def get_led_total_number(self): + ledlist = self.chas.led_list + return len(ledlist) + + def get_led_color(self, led_name): + led = self.chas.get_led_byname(led_name) + if led is None: + return -1 + return led.get_color() + + def get_led_color_by_type(self, led_type): + ledlist = self.chas.led_list + ledtmp = None + for temp in ledlist: + if temp.led_type == led_type: + ledtmp = temp + break + if ledtmp is None: + return -1 + return ledtmp.get_color() + + def set_led_color(self, led_name, color): + led = self.chas.get_led_byname(led_name) + if led is None: + return -1 + return led.set_color(color) + + # psu + def get_psu_total_number(self): + psulist = self.chas.psu_list + if psulist is None: + return -1 + return len(psulist) + + def get_psus(self): + psulist = self.chas.psu_list + return psulist + + def get_psu_presence(self, psu_name): + psu = self.chas.get_psu_byname(psu_name) + if psu is None: + return -1 + return psu.present + + def get_psu_fru_info(self, psu_name): + ''' + { + "Name": "PSU1", + "SN": "serial_number_example", # 'N/A' + "PN": "part_number_example", # 'N/A' + "AirFlow": "B2F" # 'N/A' + } + ''' + psu = self.chas.get_psu_byname(psu_name) + if psu is None: + return -1 + psu.get_fru_info() + psu.get_AirFlow() + psu.get_psu_display_name() + + dic = collections.OrderedDict() + dic["Name"] = psu.name + dic["SN"] = psu.productSerialNumber if (psu.productSerialNumber is not None) else self.na_ret + dic["PN"] = psu.productPartModelName if (psu.productPartModelName is not None) else self.na_ret + dic["DisplayName"] = psu.psu_display_name if (psu.psu_display_name is not None) else self.na_ret + dic["VENDOR"] = psu.productManufacturer if (psu.productManufacturer is not None) else self.na_ret + dic["HW"] = psu.productVersion if (psu.productVersion is not None) else self.na_ret + dic["AirFlow"] = psu.AirFlow if (psu.AirFlow is not None) else self.na_ret + return dic + + def get_psu_input_output_status(self, psu_name): + psu = self.chas.get_psu_byname(psu_name) + if psu is None: + return -1 + psu.InputsCurrent.Value # just for clear faults + if psu.InputStatus is True and psu.OutputStatus is True: + return True + # only has outputstatus + if psu.InputStatus is None and psu.OutputStatus is True: + return True + return False + + def get_psu_status(self, psu_name): + """ + Get status of a specific PSU + @return dict of the specific PSU's status, None for failure + Example return value(all keys are mandatory) + { + "Name": "PSU1", + "InputType": "DC", # "AC" or 'N/A' + "InputStatus": True, # H/W status bit + "OutputStatus": True # H/W status bit + "FanSpeed": { + "Value": 4000, # -99999 + "Min": 2000, # -99999 + "Max": 10000 # -99999 + }, + "Temperature": { + "Value": 40.0, # -99999.0 + "Min": -30.0, # -99999.0 + "Max": 50.0 # -99999.0 + } + } + """ + psu = self.chas.get_psu_byname(psu_name) + if psu is None: + return -1 + + if psu.get_threshold_by_model == 1: + psu.get_fru_info() + + dic = collections.OrderedDict() + # psu.get_Temperature() + temp_dict = collections.OrderedDict() + temp_dict['Min'] = psu.Temperature.Min + temp_dict['Max'] = psu.Temperature.Max + temp_dict['Value'] = psu.Temperature.Value + temp_dict['Unit'] = psu.Temperature.Unit + dic["Temperature"] = temp_dict + + # psu.get_FanSpeed() + fan_speed_dict = collections.OrderedDict() + fan_speed_dict['Min'] = psu.FanSpeed.Min + fan_speed_dict['Max'] = psu.FanSpeed.Max + fan_speed_dict['Tolerance'] = psu.FanSpeedTolerance + fan_speed_dict['Value'] = psu.FanSpeed.Value + fan_speed_dict['Unit'] = psu.FanSpeed.Unit + dic["FanSpeed"] = fan_speed_dict + + dic["Name"] = psu.name + dic["InputType"] = psu.InputsType + dic["InputStatus"] = psu.InputStatus + dic["OutputStatus"] = psu.OutputStatus + dic["TempStatus"] = psu.TempStatus + dic["FanStatus"] = psu.FanStatus + return dic + + def get_psu_power_status(self, psu_name): + """ + Get power status of a specific PSU + @return dict of the specific PSU's power status, None for failure + Example return value + { + "Name": "PSU1", + "Inputs": { + "Status": True, # H/W status bit + "Type": "DC", # or "AC" or "N/A" + "Voltage": { + "Value": 220, # -1 + "LowAlarm": 200, # -1 + "HighAlarm": 240, # -1 + "Unit": "V" + }, + "Current": { + "Value": 6.0, # -99999.0 + "LowAlarm": 0.2, # -99999.0 + "HighAlarm": 7.0, # -99999.0 + "Unit": "A" + }, + "Power": { + "Value": 1000, # -99999 + "LowAlarm": -1, # -99999 + "HighAlarm": 1400, # -99999 + "Unit": "W" + } + }, + "Outputs": { + "Status": True, + "Voltage": { + "Value": 220, + "LowAlarm": 200, + "HighAlarm": 240, + "Unit": "V" + }, + "Current": { + "Value": 6.0, + "LowAlarm": 0.2, + "HighAlarm": 7.0, + "Unit": "A" + }, + "Power": { + "Value": 1000, + "LowAlarm": -1, # Don't care + "HighAlarm": 1400, + "Unit": "W" + } + } + } + """ + psu = self.chas.get_psu_byname(psu_name) + if psu is None: + return -1 + if psu.get_threshold_by_model == 1: + psu.get_fru_info() + dic = collections.OrderedDict() + inputdic = collections.OrderedDict() + Outputsdic = collections.OrderedDict() + dic["Name"] = psu.name + inputdic["Status"] = psu.InputStatus + inputdic["Type"] = psu.InputsType + + # psu.get_InputsVoltage() + inputdic_voltage = collections.OrderedDict() + + inputdic_voltage["Value"] = psu.InputsVoltage.Value + inputdic_voltage["LowAlarm"] = psu.InputsVoltage.Min + inputdic_voltage["HighAlarm"] = psu.InputsVoltage.Max + inputdic_voltage["Unit"] = psu.InputsVoltage.Unit + + inputdic["Voltage"] = inputdic_voltage + inputdic_current = collections.OrderedDict() + inputdic_current["Value"] = psu.InputsCurrent.Value + inputdic_current["LowAlarm"] = psu.InputsCurrent.Min + inputdic_current["HighAlarm"] = psu.InputsCurrent.Max + inputdic_current["Unit"] = psu.InputsCurrent.Unit + inputdic["Current"] = inputdic_current + + inputdic_power = collections.OrderedDict() + inputdic_power["Value"] = psu.InputsPower.Value + inputdic_power["LowAlarm"] = psu.InputsPower.Min + inputdic_power["HighAlarm"] = psu.InputsPower.Max + inputdic_power["Unit"] = psu.InputsPower.Unit + inputdic["Power"] = inputdic_power + Outputsdic["Status"] = psu.InputStatus + + outputdic_voltage = collections.OrderedDict() + outputdic_current = collections.OrderedDict() + outputdic_power = collections.OrderedDict() + + outputdic_voltage["Value"] = psu.OutputsVoltage.Value + outputdic_voltage["LowAlarm"] = psu.OutputsVoltage.Min + outputdic_voltage["HighAlarm"] = psu.OutputsVoltage.Max + outputdic_voltage["Unit"] = psu.OutputsVoltage.Unit + + outputdic_current["Value"] = psu.OutputsCurrent.Value + outputdic_current["LowAlarm"] = psu.OutputsCurrent.Min + outputdic_current["HighAlarm"] = psu.OutputsCurrent.Max + outputdic_current["Unit"] = psu.OutputsCurrent.Unit + + outputdic_power["Value"] = psu.OutputsPower.Value + outputdic_power["LowAlarm"] = psu.OutputsPower.Min + outputdic_power["HighAlarm"] = psu.OutputsPower.Max + outputdic_power["Unit"] = psu.OutputsPower.Unit + + Outputsdic["Voltage"] = outputdic_voltage + Outputsdic["Current"] = outputdic_current + Outputsdic["Power"] = outputdic_power + + dic["Inputs"] = inputdic + dic["Outputs"] = Outputsdic + + return dic + + def set_psu_fan_speed_pwm(self, psu_name, pwm): + psu = self.chas.get_psu_byname(psu_name) + if psu is None: + return -1 + return psu.set_fan_speed_pwm(pwm) + + def get_psu_fan_speed_pwm(self, psu_name): + psu = self.chas.get_psu_byname(psu_name) + if psu is None: + return -1 + return psu.get_fan_speed_pwm() + + def get_psu_info_all(self): + """ + { + "Number": 2, + "PSU1": { + "SN": "serial_number_example", # 'N/A' + "PN": "part_number_example", # 'N/A' + "AirFlow": "intake", # 'N/A' + + "FanSpeed": { + "Value": 4000, + "Min": 2000, + "Max": 30000 + }, + "Temperature": { + "Value": 35.0, + "Min": -20.0, + "Max": 45.0 + }, + "Inputs": { + "Status": True, # H/W status bit + "Type": "DC", # or "AC" + "Voltage": { + "Value": 220, + "LowAlarm": 200, + "HighAlarm": 240, + "Unit": "V" + }, + "Current": { + "Value": 6.0, + "LowAlarm": 0.2, + "HighAlarm": 7.0, + "Unit": "A" + }, + "Power": { + "Value": 1000, + "LowAlarm": -1, + "HighAlarm": 1400, + "Unit": "W" + } + }, + "Outputs": { + "Status": True, + "Voltage": { + "Value": 220, + "LowAlarm": 200, + "HighAlarm": 240, + "Unit": "V" + }, + "Current": { + "Value": 6.0, + "LowAlarm": 0.2, + "HighAlarm": 7.0, + "Unit": "A" + }, + "Power": { + "Value": 1000, + "LowAlarm": -1, # Don't care + "HighAlarm": 1400, + "Unit": "W" + } + } + } + } + """ + + psus = self.get_psus() + psu_dict = collections.OrderedDict() + psu_dict['Number'] = len(psus) + for psu in psus: + dicttmp = self.get_psu_fru_info(psu.name) + dicttmp.update(self.get_psu_status(psu.name)) + dicttmp.update(self.get_psu_power_status(psu.name)) + if self.get_psu_presence(psu.name) is True: + dicttmp['Present'] = 'yes' + else: + dicttmp['Present'] = 'no' + psu_dict[psu.name] = dicttmp + return psu_dict + + def get_fans(self): + fanlist = self.chas.fan_list + return fanlist + + # fan + def get_fan_total_number(self): + fanlist = self.chas.fan_list + if fanlist is None: + return -1 + return len(fanlist) + + def get_fan_rotor_number(self, fan_name): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + ret = fan.rotors + if ret is None: + return -1 + return ret + + def get_fan_speed(self, fan_name, rotor_index): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + ret = fan.get_speed(rotor_index) + if ret is None: + return -1 + return ret + + def fan_speed_set_level(self, fan_name, rotor_index, level): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + ret = fan.set_speed(rotor_index, level) + if ret is True: + return 0 + return -1 + + def get_fan_speed_pwm(self, fan_name, rotor_index): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + val = fan.get_speed_pwm(rotor_index) + if val is False: + return -1 + return val + + def set_fan_speed_pwm(self, fan_name, rotor_index, pwm): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + if isinstance(pwm, str): + rate = float(pwm.strip('%s')) + speed = round(rate * 255 / 100) + elif isinstance(pwm, int): + speed = round(pwm * 255 / 100) + elif isinstance(pwm, float): + speed = round(pwm * 255 / 100) + else: + return -1 + ret = self.fan_speed_set_level(fan.name, rotor_index, speed) + if ret == 0: + return 0 + return -1 + + def get_fan_watchdog_status(self): + fan = self.chas.fan_list[0] + dic = fan.get_watchdog_status() + if dic is None or dic["support"] is False: + return self.na_ret + if dic["open"] is False or dic["work_allow_set"] is True: + return "Normal" + if dic["work_full"] is True: + return "Abnormal" + return "Abnormal" + + def enable_fan_watchdog(self, enable=True): + fan = self.chas.fan_list[0] + ret = fan.enable_watchdog(enable) + if ret is True: + return 0 + return -1 + + def feed_fan_watchdog(self): + fan_list = self.chas.fan_list + if fan_list is None: + return -1 + for fan in fan_list: + ret = fan.feed_watchdog() + if ret is False: + return -1 + return 0 + + def set_fan_led(self, fan_name, color): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + ret = fan.set_led(color) + if ret is True: + return 0 + return -1 + + def get_fan_led(self, fan_name): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return False, 'N/A' + return fan.get_led() + + def get_fan_presence(self, fan_name): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + return fan.get_presence() + + def get_fan_fru_info(self, fan_name): + """ + Get specific fan's information + # Properties + "Name": "FAN1", + "SN": "serial_number_example", # 'N/A' + "PN": "part_number_exampple", # 'N/A' + "Rotors": 2, # -1 + "AirFlow": "intake", # 'N/A' + "SpeedMin": 2000, # -1 + "SpeedMax": 30000 # -1 + """ + fan = self.chas.get_fan_byname(fan_name) + fan.decode_eeprom_info() + fan.get_AirFlow() + fan.get_fan_display_name() + + dic = collections.OrderedDict() + dic["Name"] = fan.name + dic["SN"] = fan.productSerialNumber + if dic["SN"] is None: + dic["SN"] = self.na_ret + dic["PN"] = fan.productName + if dic["PN"] is None: + dic["PN"] = self.na_ret + dic["DisplayName"] = fan.fan_display_name + if dic["DisplayName"] is None: + dic["DisplayName"] = self.na_ret + + dic["Rotors"] = fan.rotors + dic["AirFlow"] = fan.AirFlow + if dic["AirFlow"] is None: + dic["AirFlow"] = self.na_ret + dic["SpeedMin"] = fan.SpeedMin + dic["SpeedMax"] = fan.SpeedMax + return dic + + def get_fan_eeprom_info(self, fan_name): + """ + Get specific fan's information + # Properties + "Name": "M6510-FAN-F", # 'N/A' + "SN": "serial_number_example", # 'N/A' + "HW": "hw_version_exampple", # 'N/A' + """ + fan = self.chas.get_fan_byname(fan_name) + fan.decode_eeprom_info() + fan.get_fan_display_name() + dic = collections.OrderedDict() + dic["NAME"] = fan.productName + if dic["NAME"] is None: + dic["NAME"] = self.na_ret + dic["SN"] = fan.productSerialNumber + if dic["SN"] is None: + dic["SN"] = self.na_ret + dic["HW"] = fan.hw_version + if dic["HW"] is None: + dic["HW"] = self.na_ret + dic["DisplayName"] = fan.fan_display_name + if dic["DisplayName"] is None: + dic["DisplayName"] = self.na_ret + return dic + + def get_product_fullname(self): + return baseutil.get_product_fullname() + + def get_fan_status(self, fan_name): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + rotorlist = fan.rotor_list + dic = collections.OrderedDict() + for rotor in rotorlist: + dic_val = collections.OrderedDict() + if rotor.rotor_Running is True: + dic_val['Running'] = 'yes' + else: + dic_val['Running'] = 'no' + if rotor.rotor_HwAlarm is True: + dic_val['HwAlarm'] = 'yes' + else: + dic_val['HwAlarm'] = 'no' + dic_val['Speed'] = int(rotor.rotor_Speed.Value) + dic[rotor.name] = dic_val + return dic + + def get_fan_rotor_status(self, fan_name, rotor_name): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + rotorlist = fan.rotor_list + for rotor in rotorlist: + if rotor_name == rotor.name: + if rotor.rotor_Running is True: + return True + return False + return -1 + + def get_fan_roll_status(self, fan_name, rotor_index): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + rotor = fan.get_rotor_index(rotor_index) + if rotor is None: + return -1 + if rotor.rotor_Running is True: + return True + return False + + def get_fan_info_fru(self, fan_name): + fan = self.chas.get_fan_byname(fan_name) + fan.get_fru_info() + fan.get_AirFlow() + dic = collections.OrderedDict() + dic["Name"] = fan.name + dic["SN"] = fan.productSerialNumber + if dic["SN"] is None: + dic["SN"] = self.na_ret + dic["PN"] = fan.productPartModelName + if dic["PN"] is None: + dic["PN"] = self.na_ret + flag = self.get_fan_presence(fan_name) + if flag is True: + dic["Present"] = "yes" + elif flag is False: + dic["Present"] = "no" + else: + dic["Present"] = self.na_ret + dic["Rotors"] = fan.rotors + dic["AirFlow"] = fan.AirFlow + if dic["AirFlow"] is None: + dic["AirFlow"] = self.na_ret + return dic + + # support TLV and FRU FAN E2 + def get_fan_info(self, fan_name): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return None + fan.get_AirFlow() + dic = self.get_fan_eeprom_info(fan_name) + flag = self.get_fan_presence(fan_name) + if flag is True: + dic["Present"] = "yes" + elif flag is False: + dic["Present"] = "no" + else: + dic["Present"] = self.na_ret + dic["Rotors"] = fan.rotors + dic["AirFlow"] = fan.AirFlow + if dic["AirFlow"] is None: + dic["AirFlow"] = self.na_ret + dic["PowerMax"] = fan.PowerMax + if dic["PowerMax"] is None: + dic["PowerMax"] = self.na_ret + return dic + + def get_fan_info_rotor(self, fan_name): + fan = self.chas.get_fan_byname(fan_name) + if fan is None: + return -1 + rotorlist = fan.rotor_list + dic = collections.OrderedDict() + for rotor in rotorlist: + dic_val = collections.OrderedDict() + if rotor.rotor_Running is True: + dic_val['Running'] = 'yes' + else: + dic_val['Running'] = 'no' + if rotor.rotor_HwAlarm is True: + dic_val['HwAlarm'] = 'yes' + else: + dic_val['HwAlarm'] = 'no' + speed_value = rotor.rotor_Speed.Value + if speed_value is None: + dic_val['Speed'] = self.error_ret + else: + dic_val['Speed'] = int(speed_value) + if rotor.SpeedMin is None: + dic_val['SpeedMin'] = self.error_ret + else: + dic_val['SpeedMin'] = rotor.SpeedMin + if rotor.SpeedMax is None: + dic_val['SpeedMax'] = self.error_ret + else: + dic_val['SpeedMax'] = rotor.SpeedMax + if rotor.Tolerance is None: + dic_val['Tolerance'] = self.error_ret + else: + dic_val['Tolerance'] = rotor.Tolerance + + dic[rotor.name] = dic_val + return dic + + def get_fan_info_all(self): + fanlist = self.chas.fan_list + dic = collections.OrderedDict() + dic['Number'] = len(fanlist) + dic['WatchdogStatus'] = self.get_fan_watchdog_status() + for fan in fanlist: + dic[fan.name] = self.get_fan_info(fan.name) + dic[fan.name].update(self.get_fan_info_rotor(fan.name)) + return dic + + def temp_test(self): + templist = self.chas.temp_list + dicret = collections.OrderedDict() + + for temp in templist: + dic = collections.OrderedDict() + temp_value = temp.Value + dic["Value"] = temp_value if (temp_value is not None) else self.error_ret + dic["LowAlarm"] = temp.Min + dic["HighAlarm"] = temp.Max + dicret[temp.name] = dic + return dicret + + # dcdc + def get_dcdc_total_number(self): + dcdclist = self.chas.dcdc_list + if dcdclist is None: + return -1 + return len(dcdclist) + + def get_dcdc_by_id(self, dcdc_id): + dcdclist = self.chas.dcdc_list + dcdctmp = None + for dcdc in dcdclist: + if dcdc.dcdc_id == dcdc_id: + dcdctmp = dcdc + dic = collections.OrderedDict() + if dcdctmp is None: + dic["Name"] = self.error_ret + dic["Min"] = self.error_ret + dic["Max"] = self.error_ret + dic["Low"] = self.error_ret + dic["High"] = self.error_ret + dic["Value"] = self.error_ret + dic["Unit"] = self.error_ret + else: + dic["Name"] = dcdctmp.name + dic["Min"] = dcdctmp.sensor.Min + dic["Max"] = dcdctmp.sensor.Max + dic["Low"] = dcdctmp.sensor.Low + dic["High"] = dcdctmp.sensor.High + tmp = dcdctmp.sensor.Value + if tmp is not None: + dic['Value'] = tmp + else: + dic['Value'] = self.error_ret + dic["Unit"] = dcdctmp.sensor.Unit + return dic + + def get_dcdc_all_info(self): + val_list = collections.OrderedDict() + dcdclist = self.chas.dcdc_list + for dcdc in dcdclist: + dicttmp = {} + sensorname = "%s" % (dcdc.name) + dicttmp['Min'] = dcdc.sensor.Min + dicttmp['Max'] = dcdc.sensor.Max + tmp = dcdc.sensor.Value + if tmp is not None: + dicttmp['Value'] = tmp + if tmp > dicttmp['Max'] or tmp < dicttmp['Min']: + dicttmp["Status"] = "NOT OK" + else: + dicttmp["Status"] = "OK" + else: + dicttmp['Value'] = self.error_ret + dicttmp["Status"] = "NOT OK" + dicttmp['Unit'] = dcdc.sensor.Unit + val_list[sensorname] = dicttmp + return val_list + + # sensors + def get_monitor_temp(self, name): + templist = self.chas.temp_list + temptmp = None + for temp in templist: + if temp.name == name: + temptmp = temp + + dic = collections.OrderedDict() + if temptmp is None: + dic["Min"] = self.error_ret + dic["Max"] = self.error_ret + dic["Value"] = self.error_ret + dic["Unit"] = self.error_ret + else: + dic["Min"] = temptmp.Min + dic["Max"] = temptmp.Max + temp_value = temptmp.Value + dic["Value"] = temp_value if (temp_value is not None) else self.error_ret + dic["Unit"] = temptmp.Unit + return dic + + def get_monitor_temp_by_id(self, temp_id): + templist = self.chas.temp_list + temptmp = None + for temp in templist: + if temp.temp_id == temp_id: + temptmp = temp + + dic = collections.OrderedDict() + if temptmp is None: + dic["Name"] = self.error_ret + dic["Api_name"] = self.error_ret + dic["Min"] = self.error_ret + dic["Max"] = self.error_ret + dic["Low"] = self.error_ret + dic["High"] = self.error_ret + dic["Value"] = self.error_ret + dic["Unit"] = self.error_ret + else: + dic["Name"] = temptmp.name + dic["Api_name"] = temptmp.api_name + dic["Min"] = temptmp.Min + dic["Max"] = temptmp.Max + dic["Low"] = temptmp.Low + dic["High"] = temptmp.High + temp_value = temptmp.Value + dic["Value"] = temp_value if (temp_value is not None) else self.error_ret + dic["Unit"] = temptmp.Unit + return dic + + def get_temp_info(self): + val_list = collections.OrderedDict() + # temp + templist = self.chas.temp_list + for temp in templist: + dic = collections.OrderedDict() + dic["Min"] = temp.Min + dic["Max"] = temp.Max + dic["Low"] = temp.Low + dic["High"] = temp.High + temp_value = temp.Value + dic["Value"] = temp_value if (temp_value is not None) else self.error_ret + dic["Unit"] = temp.Unit + val_list[temp.name] = dic + return val_list + + def get_sensor_info(self): + val_list = collections.OrderedDict() + # temp + templist = self.chas.temp_list + for temp in templist: + dic = collections.OrderedDict() + dic["Min"] = temp.Min + dic["Max"] = temp.Max + dic["Low"] = temp.Low + dic["High"] = temp.High + temp_value = temp.Value + dic["Value"] = temp_value if (temp_value is not None) else self.error_ret + dic["Unit"] = temp.Unit + val_list[temp.name] = dic + # fan + fanlist = self.chas.fan_list + for fan in fanlist: + for rotor in fan.rotor_list: + sensorname = "%s%s" % (fan.name, rotor.name) + speed = collections.OrderedDict() + speed['Min'] = rotor.rotor_Speed.Min + speed['Max'] = rotor.rotor_Speed.Max + rotor_speed_Value = rotor.rotor_Speed.Value + speed['Value'] = rotor_speed_Value if (rotor_speed_Value is not None) else self.error_ret + speed['Unit'] = rotor.rotor_Speed.Unit + val_list[sensorname] = speed + + val_list.update(self.get_dcdc_all_info()) + + # psu + psulist = self.chas.psu_list + for psu in psulist: + inputdic_voltage = collections.OrderedDict() + inputdic_current = collections.OrderedDict() + inputdic_power = collections.OrderedDict() + outputdic_voltage = collections.OrderedDict() + outputdic_current = collections.OrderedDict() + outputdic_power = collections.OrderedDict() + temperature = collections.OrderedDict() + fanspeed = collections.OrderedDict() + + psu_temp_value = psu.Temperature.Value + temperature["Value"] = psu_temp_value if (psu_temp_value is not None) else self.error_ret + temperature["Min"] = psu.Temperature.Min + temperature["Max"] = psu.Temperature.Max + temperature["Unit"] = psu.Temperature.Unit + + fanspeed["Value"] = psu.FanSpeed.Value + fanspeed["Min"] = psu.FanSpeed.Min + fanspeed["Max"] = psu.FanSpeed.Max + fanspeed["Unit"] = psu.FanSpeed.Unit + + psu_inputvoltage_value = psu.InputsVoltage.Value + inputdic_voltage["Value"] = psu_inputvoltage_value if ( + psu_inputvoltage_value is not None) else self.error_ret + inputdic_voltage["Min"] = psu.InputsVoltage.Min + inputdic_voltage["Max"] = psu.InputsVoltage.Max + inputdic_voltage["Unit"] = psu.InputsVoltage.Unit + + psu_inputcurrent_value = psu.InputsCurrent.Value + inputdic_current["Value"] = psu_inputcurrent_value if ( + psu_inputcurrent_value is not None) else self.error_ret + inputdic_current["Min"] = psu.InputsCurrent.Min + inputdic_current["Max"] = psu.InputsCurrent.Max + inputdic_current["Unit"] = psu.InputsCurrent.Unit + + psu_inputpower_value = psu.InputsPower.Value + inputdic_power["Value"] = psu_inputpower_value if (psu_inputpower_value is not None) else self.error_ret + inputdic_power["Min"] = psu.InputsPower.Min + inputdic_power["Max"] = psu.InputsPower.Max + inputdic_power["Unit"] = psu.InputsPower.Unit + + psu_outputvoltage_value = psu.OutputsVoltage.Value + outputdic_voltage["Value"] = psu_outputvoltage_value if ( + psu_outputvoltage_value is not None) else self.error_ret + outputdic_voltage["Min"] = psu.OutputsVoltage.Min + outputdic_voltage["Max"] = psu.OutputsVoltage.Max + outputdic_voltage["Unit"] = psu.OutputsVoltage.Unit + + psu_outputcurrent_value = psu.OutputsCurrent.Value + outputdic_current["Value"] = psu_outputcurrent_value if ( + psu_outputcurrent_value is not None) else self.error_ret + outputdic_current["Min"] = psu.OutputsCurrent.Min + outputdic_current["Max"] = psu.OutputsCurrent.Max + outputdic_current["Unit"] = psu.OutputsCurrent.Unit + + psu_outputpower_value = psu.OutputsPower.Value + outputdic_power["Value"] = psu_outputpower_value if ( + psu_outputpower_value is not None) else self.error_ret + outputdic_power["Min"] = psu.OutputsPower.Min + outputdic_power["Max"] = psu.OutputsPower.Max + outputdic_power["Unit"] = psu.OutputsPower.Unit + + val_list["%s%s" % (psu.name, "Vol_I")] = inputdic_voltage + val_list["%s%s" % (psu.name, "Curr_I")] = inputdic_current + val_list["%s%s" % (psu.name, "Power_I")] = inputdic_power + val_list["%s%s" % (psu.name, "Vol_O")] = outputdic_voltage + val_list["%s%s" % (psu.name, "Curr_O")] = outputdic_current + val_list["%s%s" % (psu.name, "Power_O")] = outputdic_power + val_list["%s%s" % (psu.name, "Fan")] = fanspeed + val_list["%s%s" % (psu.name, "Temp")] = temperature + + return val_list + + # cpld + def get_cpld_total_number(self): + cpldlist = self.chas.cpld_list + return len(cpldlist) + + def get_cpld_user_reg(self): + cpld = self.chas.get_cpld_byname("BASE_CPLD") + if cpld is None: + return None + return cpld.get_user_reg() + + def set_cpld_user_reg(self, value): + if isinstance(value, int) is False: + baseutil.logger_debug("value must int %s" % type(value)) + return -1 + if (int(value) < 0 or int(value) > 255): + baseutil.logger_debug("value must [0 - 255]") + return -1 + cpld = self.chas.get_cpld_byname("BASE_CPLD") + if cpld is None: + baseutil.logger_debug("name BASE_CPLD not find") + return -1 + if cpld.set_user_reg(value) is True: + return 0 + return -1 + + def set_cpld_console_owner(self, owner): + """ + Set console I/O owner + + @param owner I/O owner of the console, either "cpu" or "bmc" + + @return 0 for success, -1 for failure + """ + if owner is None: + baseutil.logger_debug("owner is None") + return -1 + owner_tuple = ("cpu", "bmc") + if owner not in owner_tuple: + baseutil.logger_debug("owner is %s, must cpu or bmc" % owner) + return -1 + cpld = self.chas.get_cpld_byname("BASE_CPLD") + if cpld is None: + baseutil.logger_debug("name BASE_CPLD not find") + return -1 + if cpld.set_console_owner(owner) is True: + return 0 + return -1 + + def get_cpld_version_by_id(self, cpld_id): + cpldlist = self.chas.cpld_list + cpldtmp = None + for cpld in cpldlist: + if cpld.cpld_id == cpld_id: + cpldtmp = cpld + + dic = collections.OrderedDict() + if cpldtmp is None: + dic["Name"] = self.na_ret + dic["Version"] = self.na_ret + dic["Desc"] = self.na_ret + dic["Slot"] = None + dic["Warm"] = None + else: + dic["Name"] = cpldtmp.name + dic["Version"] = cpldtmp.get_version() + dic["Desc"] = cpldtmp.desc + dic["Slot"] = cpldtmp.slot + dic["Warm"] = cpldtmp.warm + return dic + + def get_cpld_all_version(self): + """ + Get version of all CPLDs' that can be read from BMC + + @return dict of CPLDs' version or None for failure. + example outputs: + { + "BASE_CPLD": "0.1", # or "N/A" for read failure + "FAN_CPLD": "0.2" + } + """ + cpld_version = { + "BASE_CPLD": "N/A", + "FAN_CPLD": "N/A" + } + for cpld_name in cpld_version: + cpld = self.chas.get_cpld_byname(cpld_name) + if cpld is None: + baseutil.logger_debug("name %s not find" % cpld_name) + continue + cpld_version[cpld_name] = cpld.get_version() + return cpld_version + + # comp + def get_comp_total_number(self): + complist = self.chas.comp_list + return len(complist) + + def get_comp_list(self): + return self.chas.comp_list + + def get_comp_id(self, comp): + return comp.comp_id + + def get_comp_version_by_id(self, comp_id): + comp_list = self.chas.comp_list + comptmp = None + for comp in comp_list: + if comp.comp_id == comp_id: + comptmp = comp + break + + dic = collections.OrderedDict() + if comptmp is None: + dic["Name"] = self.na_ret + dic["Version"] = self.na_ret + dic["Desc"] = self.na_ret + dic["Slot"] = None + else: + dic["Name"] = comptmp.name + dic["Version"] = comptmp.get_version() + dic["Desc"] = comptmp.desc + dic["Slot"] = comptmp.slot + return dic + + def get_bmc_productname(self): + """ + Get product name + + @return product name string, e.g. $(device name)-F-$(VENDOR_NAME), if error return "N/A" + """ + bmc = self.chas.get_bmc_byname("master") + if bmc is None: + baseutil.logger_debug("name bmc(master) not find") + return self.na_ret + return bmc.get_productname() + + def call_bmc_diagcmd(self, cmdstr): + """ + Call BMC diag comman func + + @return ret: 0 sucess , -1 fail + outmsg: if success is out msg, or fail is err msg + """ + if (cmdstr is None or cmdstr == ""): + outmsg = "cmdstr is empty" + baseutil.logger_debug(outmsg) + return -1, outmsg + bmc = self.chas.get_bmc_byname("master") + if bmc is None: + outmsg = "name bmc(master) not find" + baseutil.logger_debug(outmsg) + return -1, outmsg + baseutil.logger_debug("call cmdstr %s" % cmdstr) + return bmc.call_diagcmd(cmdstr) + + def write_bios_version(self, flash, version): + bios = self.chas.get_bios_byname("master") + if bios is None: + baseutil.logger_debug("name bios(master) not find") + return -1 + return bios.set_bios_version(flash, version) + + def get_bios_version(self): + bios = self.chas.get_bios_byname("master") + if bios is None: + baseutil.logger_debug("name bios(master) not find") + return -1 + return bios.get_bios_version() + + def get_bios_status(self): + bios = self.chas.get_bios_byname("master") + if bios is None: + baseutil.logger_debug("name bios(master) not find") + return -1 + return bios.get_bios_boot_status() + + def get_bmc_mac_rov(self): + """ + Get BMC mac rov + + @return ret: 0 sucess , -1 fail + outmsg: if success is out msg, or fail is err msg + """ + bmc = self.chas.get_bmc_byname("master") + if bmc is None: + msg = "name master not find" + baseutil.logger_debug(msg) + return -1, msg + return bmc.get_mac_rov() + + def get_bmc_next_boot(self): + """ + Get next booting flash of BMC + + @return 'master'/'slave' on success, "N/A" for failure + """ + bmc = self.chas.get_bmc_byname("master") + if bmc is None: + baseutil.logger_debug("name master not find") + return self.na_ret + return bmc.get_next_boot() + + def set_bmc_next_boot(self, flash): + """ + Set flash from which next BMC boot + + @param flash Booting flash of BMC, "master" or "slave" + + @return 0 on success, -1 for failure + """ + flash_status = ("master", "slave") + if flash is None or flash not in flash_status: + baseutil.logger_debug("parameter flash illegal, should be [master|slave]") + return -1 + bmc = self.chas.get_bmc_byname("master") + if bmc is None: + baseutil.logger_debug("name master not find") + return -1 + return bmc.set_next_boot(flash) + + def reboot_bmc(self): + """ + Reboot running BMC + """ + bmc = self.chas.get_bmc_byname("master") + if bmc is None: + baseutil.logger_debug("name master not find") + return -1 + return bmc.reboot() + + def get_bmc_info(self): + """ + Get BMC info + + @return dict of BMC info or None for failure + "Version": "1.1.1", # "N/A" + "Flash": "master", # "N/A" + "Next": "master" # "N/A" + """ + bmc = self.chas.get_bmc_byname("master") + if bmc is None: + baseutil.logger_debug("name master not find") + return self.na_ret + return bmc.get_info() + + def get_bmc_version_all(self): + """ + @return dict of BMCs + { + "MasterVersion": "1.1.1", # "N/A" + "SlaveVersion": "1.1.1" # "N/A" + } + """ + bmc = self.chas.get_bmc_byname("master") + if bmc is None: + baseutil.logger_debug("name master not find") + return self.na_ret + return bmc.get_version_all() + + def bmc_execute_command(self, cmd_str): + ret, output = osutil.command(cmd_str) + if ret: + baseutil.logger_debug("execute %s command failed" % (cmd_str)) + return ret, output + + def get_cpu_reset_num(self): + """ + Get CPU reset num + @return CPU reset num on success, -1 for failure + """ + cpu = self.chas.get_cpu_byname("cpu") + if cpu is None: + msg = "name cpu not find" + baseutil.logger_debug(msg) + return -1 + return cpu.get_cpu_reset_num() + + def get_cpu_reboot_cause(self): + """ + Get CPU reboot cause + @return string of cpu reboot reason + """ + cpu = self.chas.get_cpu_byname("cpu") + if cpu is None: + msg = "name cpu not find" + baseutil.logger_debug(msg) + return "Unknown reboot cause" + return cpu.get_cpu_reboot_cause() + diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/led.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/led.py new file mode 100644 index 000000000000..7fb869c74d7f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/led.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +####################################################### +# +# led.py +# Python implementation of the Class led +# +####################################################### +from plat_hal.devicebase import devicebase + + +class led(devicebase): + def __init__(self, conf=None): + if conf is not None: + self.name = conf.get('name', None) + self.led_type = conf.get('led_type', None) + self.led_attrs_config = conf.get('led_attrs', None) + self.led_config = conf.get('led', None) + + def set_color(self, color): + status = self.led_attrs_config.get(color, None) + if status is None: + return False + + mask = self.led_attrs_config.get('mask', 0xff) + + if isinstance(self.led_config, list): + for led_config_index in self.led_config: + ret, value = self.get_value(led_config_index) + if (ret is False) or (value is None): + return False + setval = (int(value) & ~mask) | (status) + ret, val = self.set_value(led_config_index, setval) + if ret is False: + return ret + else: + ret, value = self.get_value(self.led_config) + if (ret is False) or (value is None): + return False + setval = (int(value) & ~mask) | (status) + ret, val = self.set_value(self.led_config, setval) + return ret + + def get_color(self): + mask = self.led_attrs_config.get('mask', 0xff) + ret, value = self.get_value(self.led_config) + if ret is False or value is None: + return False, 'N/A' + ledval = int(value) & mask + for key, val in self.led_attrs_config.items(): + if (ledval == val) and (key != "mask"): + return True, key + return False, 'N/A' diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/onie_e2.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/onie_e2.py new file mode 100644 index 000000000000..9ac32cace263 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/onie_e2.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python3 +####################################################### +# +# onie_e2.py +# Python implementation of the Class onie_e2 +# +####################################################### +from plat_hal.devicebase import devicebase +from eepromutil.onietlv import onie_tlv + + +class onie_e2(devicebase): + + def __init__(self, conf=None): + self._cardid = "" + self._productname = "" + self._partnum = "" + self._serialnum = "" + self._macbase = "" + self._manufdate = "" + self._deviceversion = "" + self._labelrevision = "" + self._platformname = "" + self._onieversion = "" + self._macsize = "" + self._manufname = "" + self._manufcountry = "" + self._vendorname = "" + self._diagname = "" + self._servicetag = "" + + if conf is not None: + self.name = conf.get('name', None) + self.e2loc = conf.get('e2loc', None) + self.e2_path = self.e2loc.get('loc', None) + self.airflow = conf.get('airflow', "intake") + + @property + def cardid(self): + return self._cardid + + @property + def productname(self): + return self._productname + + @property + def partnum(self): + return self._partnum + + @property + def serialnum(self): + return self._serialnum + + @property + def macbase(self): + return self._macbase + + @property + def manufdate(self): + return self._manufdate + + @property + def deviceversion(self): + return self._deviceversion + + @property + def labelrevision(self): + return self._labelrevision + + @property + def platformname(self): + return self._platformname + + @property + def onieversion(self): + return self._onieversion + + @property + def macsize(self): + return self._macsize + + @property + def manufname(self): + return self._manufname + + @property + def manufcountry(self): + return self._manufcountry + + @property + def vendorname(self): + return self._vendorname + + @property + def diagname(self): + return self._diagname + + @property + def servicetag(self): + return self._servicetag + + def get_onie_e2_info(self): + try: + eeprom = self.get_eeprom_info(self.e2loc) + if eeprom is None: + raise Exception("%s: value is none" % self.name) + onietlv = onie_tlv() + onietlv.decode(eeprom) + self._cardid = onietlv.cardid + self._productname = onietlv.productname + self._partnum = onietlv.partnum + self._serialnum = onietlv.serialnum + self._macbase = onietlv.macbase + self._manufdate = onietlv.manufdate + self._deviceversion = onietlv.deviceversion + self._labelrevision = onietlv.labelrevision + self._platformname = onietlv.platformname + self._onieversion = onietlv.onieversion + self._macsize = onietlv.macsize + self._manufname = onietlv.manufname + self._manufcountry = onietlv.manufcountry + self._vendorname = onietlv.vendorname + self._diagname = onietlv.diagname + self._servicetag = onietlv.servicetag + except Exception: + return False + return True diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/osutil.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/osutil.py new file mode 100644 index 000000000000..684e26bb9ecd --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/osutil.py @@ -0,0 +1,440 @@ +#!/usr/bin/env python3 +####################################################### +# +# osutil.py +# Python implementation of the Class osutil +# +####################################################### + +import os +import glob +import re +import time +import subprocess +import fcntl +import syslog +from functools import wraps +from wbutil.smbus import SMBus + + +PLATFORM_HAL_DEBUG_FILE = "/etc/.platform_hal_debug_flag" + + +def platform_hal_debug(s): + if os.path.exists(PLATFORM_HAL_DEBUG_FILE): + syslog.openlog("PLATFORM_HAL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def retry(maxretry=6, delay=0.01): + ''' + maxretry: max retry times + delay : interval after last retry + ''' + def decorator(f): + @wraps(f) + def wrapper(*args, **kwargs): + time_retry = maxretry + time_delay = delay + result_msg = "" + while time_retry: + try: + val, result_msg = f(*args, **kwargs) + if val is True: + return val, result_msg + time_retry -= 1 + time.sleep(time_delay) + except Exception as e: + time_retry -= 1 + result_msg = str(e) + time.sleep(time_delay) + return False, "max time retry last errmsg is {}".format(result_msg) + return wrapper + return decorator + + +pidfile = None + + +def file_rw_lock(file_path): + global pidfile + pidfile = open(file_path, "r") + try: + fcntl.flock(pidfile, fcntl.LOCK_EX | fcntl.LOCK_NB) + platform_hal_debug("file_rw_lock success") + return True + except Exception: + if pidfile is not None: + pidfile.close() + pidfile = None + return False + + +def file_rw_unlock(): + try: + global pidfile + + if pidfile is not None: + fcntl.flock(pidfile, fcntl.LOCK_UN) + pidfile.close() + pidfile = None + platform_hal_debug("file_rw_unlock success") + else: + platform_hal_debug("pidfile is invalid, do nothing") + return True + except Exception as e: + platform_hal_debug("file_rw_unlock err, msg: %s" % (str(e))) + return False + + +def take_file_rw_lock(file_path): + loop = 1000 + ret = False + for i in range(0, loop): + ret = file_rw_lock(file_path) + if ret is True: + break + time.sleep(0.001) + return ret + + +class osutil(object): + """ + osutil + """ + + @staticmethod + @retry(maxretry=6) + def wbi2cget_python(bus, addr, reg): + with SMBus(bus) as y: + val, ind = y.read_byte_data(addr, reg, True) + return val, ind + + @staticmethod + @retry(maxretry=6) + def wbi2cset_python(bus, addr, reg, value): + with SMBus(bus) as y: + val, ind = y.write_byte_data(addr, reg, value, True) + return val, ind + + @staticmethod + @retry(maxretry=6) + def wbi2cgetword_python(bus, addr, reg): + with SMBus(bus) as y: + val, ind = y.read_word_data(addr, reg, True) + return val, ind + + @staticmethod + @retry(maxretry=6) + def wbi2csetword_python(bus, addr, reg, value): + with SMBus(bus) as y: + val, ind = y.write_word_data(addr, reg, value, True) + return val, ind + + @staticmethod + @retry(maxretry=6) + def wbi2csetwordpec_python(bus, addr, reg, value): + with SMBus(bus) as y: + val, ind = y.write_word_data_pec(addr, reg, value, True) + return val, ind + + @staticmethod + @retry(maxretry=6) + def wbi2cset_byte_pec_python(bus, addr, reg, value): + with SMBus(bus) as y: + val, ind = y.write_byte_data_pec(addr, reg, value, True) + return val, ind + + @staticmethod + def command(cmdstr): + retcode, output = subprocess.getstatusoutput(cmdstr) + return retcode, output + + @staticmethod + def geti2cword_i2ctool(bus, addr, offset): + command_line = "i2cget -f -y %d 0x%02x 0x%02x wp" % (bus, addr, offset) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = osutil.command(command_line) + if ret == 0: + return True, int(ret_t, 16) + time.sleep(0.1) + return False, ret_t + + @staticmethod + def seti2cword_i2ctool(bus, addr, offset, val): + command_line = "i2cset -f -y %d 0x%02x 0x%0x 0x%04x wp" % (bus, addr, offset, val) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = osutil.command(command_line) + if ret == 0: + return True, ret_t + time.sleep(0.1) + return False, ret_t + + @staticmethod + def wbi2cget_i2ctool(bus, devno, address): + command_line = "i2cget -f -y %d 0x%02x 0x%02x " % (bus, devno, address) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = osutil.command(command_line) + if ret == 0: + return True, int(ret_t, 16) + time.sleep(0.1) + return False, ret_t + + @staticmethod + def wbi2cset_i2ctool(bus, devno, address, byte): + command_line = "i2cset -f -y %d 0x%02x 0x%02x 0x%02x" % ( + bus, devno, address, byte) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = osutil.command(command_line) + if ret == 0: + return True, ret_t + return False, ret_t + + @staticmethod + def geti2cword(bus, addr, offset): + return osutil.wbi2cgetword_python(bus, addr, offset) + + @staticmethod + def seti2cword(bus, addr, offset, val): + return osutil.wbi2csetword_python(bus, addr, offset, val) + + @staticmethod + def seti2cwordpec(bus, addr, offset, val): + return osutil.wbi2csetwordpec_python(bus, addr, offset, val) + + @staticmethod + def seti2c_byte_pec(bus, addr, offset, val): + return osutil.wbi2cset_byte_pec_python(bus, addr, offset, val) + + @staticmethod + def wbi2cget(bus, devno, address): + return osutil.wbi2cget_python(bus, devno, address) + + @staticmethod + def wbi2cset(bus, devno, address, byte): + return osutil.wbi2cset_python(bus, devno, address, byte) + + @staticmethod + def byteTostr(val): + strtmp = '' + for value in val: + strtmp += chr(value) + return strtmp + + @staticmethod + def io_rd(reg_addr, read_len=1): + try: + regaddr = 0 + if isinstance(reg_addr, int): + regaddr = reg_addr + else: + regaddr = int(reg_addr, 16) + devfile = "/dev/port" + fd = os.open(devfile, os.O_RDWR | os.O_CREAT) + os.lseek(fd, regaddr, os.SEEK_SET) + val = os.read(fd, read_len) + return True, "".join(["%02x" % item for item in val]) + except ValueError as e: + return False, str(e) + except Exception as e: + return False, str(e) + finally: + os.close(fd) + + @staticmethod + def readsysfs(location, flock_path=None): + flock_path_tmp = None + platform_hal_debug("readsysfs, location:%s, flock_path:%s" % (location, flock_path)) + try: + if flock_path is not None: + flock_paths = glob.glob(flock_path) + if len(flock_paths) != 0: + flock_path_tmp = flock_paths[0] + platform_hal_debug("try to get file lock, path:%s" % flock_path_tmp) + ret = take_file_rw_lock(flock_path_tmp) + if ret is False: + platform_hal_debug("take file lock timeout, path:%s" % flock_path_tmp) + return False, ("take file rw lock timeout, path:%s" % flock_path_tmp) + else: + platform_hal_debug("config error, can't find flock_path:%s" % flock_path) + + locations = glob.glob(location) + with open(locations[0], 'rb') as fd1: + retval = fd1.read() + retval = osutil.byteTostr(retval) + if flock_path_tmp is not None: + file_rw_unlock() + + retval = retval.rstrip('\r\n') + retval = retval.lstrip(" ") + except Exception as e: + if flock_path_tmp is not None: + file_rw_unlock() + platform_hal_debug("readsysfs error, msg:%s" % str(e)) + return False, (str(e) + " location[%s]" % location) + return True, retval + + @staticmethod + def writesysfs(location, value): + try: + if not os.path.isfile(location): + print(location, 'not found !') + return False, ("location[%s] not found !" % location) + with open(location, 'w') as fd1: + fd1.write(value) + except Exception as e: + return False, (str(e) + " location[%s]" % location) + return True, ("set location[%s] %s success !" % (location, value)) + + @staticmethod + def getdevmem(addr, digit, mask): + command_line = "devmem 0x%02x %d" % (addr, digit) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = osutil.command(command_line) + if ret == 0: + if mask is not None: + ret_t = str(int(ret_t, 16) & mask) + return True, ret_t + return False, ret_t + + @staticmethod + def readdevfile_ascii(path, offset, length): + msg = "" + ret = "" + joinstr = '' + fd = -1 + + if not os.path.exists(path): + msg = path + " not found !" + return False, msg + + try: + fd = os.open(path, os.O_RDONLY) + os.lseek(fd, offset, os.SEEK_SET) + ret = os.read(fd, length) + for item in ret: + joinstr += '%02x ' % item # like sysfs, display in hex + except Exception as e: + msg = str(e) + return False, msg + finally: + if fd > 0: + os.close(fd) + return True, joinstr + + @staticmethod + def readdevfile(path, offset, length): + msg = "" + ret = "" + fd = -1 + val_list = [] + + if not os.path.exists(path): + msg = path + " not found !" + return False, msg + + try: + fd = os.open(path, os.O_RDONLY) + os.lseek(fd, offset, os.SEEK_SET) + ret = os.read(fd, length) + for item in ret: + val_list.append(item) + except Exception as e: + msg = str(e) + return False, msg + finally: + if fd > 0: + os.close(fd) + return True, val_list + + @staticmethod + def writedevfile(path, offset, buf): + msg = "" + fd = -1 + + if not os.path.exists(path): + msg = path + " not found !" + return False, msg + + if isinstance(buf, list): + if len(buf) == 0: + msg = "buf:%s is NONE !" % buf + return False, msg + elif isinstance(buf, int): + buf = [buf] + else: + msg = "buf:%s is not list type or not int type !" % buf + return False, msg + + try: + fd = os.open(path, os.O_WRONLY) + os.lseek(fd, offset, os.SEEK_SET) + ret = os.write(fd, bytes(buf)) + except Exception as e: + msg = str(e) + return False, msg + finally: + if fd > 0: + os.close(fd) + + return True, ret + + @staticmethod + def wb_os_system(cmd): + status, output = subprocess.getstatusoutput(cmd) + return status, output + + @staticmethod + def getsdkreg(reg): + try: + cmd = "bcmcmd -t 1 'getr %s ' < /dev/null" % reg + ret, result = osutil.wb_os_system(cmd) + result_t = result.strip().replace("\r", "").replace("\n", "") + if ret != 0 or "Error:" in result_t: + return False, result + patt = r"%s.(.*):(.*)>drivshell" % reg + rt = re.findall(patt, result_t, re.S) + test = re.findall("=(.*)", rt[0][0])[0] + except Exception as e: + return False, 'get sdk register error, msg: %s' % str(e) + return True, test + + @staticmethod + def getmactemp(): + try: + result = {} + # need to exec twice + osutil.wb_os_system("bcmcmd -t 1 \"show temp\" < /dev/null") + ret, log = osutil.wb_os_system("bcmcmd -t 1 \"show temp\" < /dev/null") + if ret: + return False, result + logs = log.splitlines() + for line in logs: + if "average" in line: + b = re.findall(r'\d+.\d+', line) + result["average"] = b[0] + elif "maximum" in line: + b = re.findall(r'\d+.\d+', line) + result["maximum"] = b[0] + except Exception as e: + return False, str(e) + return True, result + + @staticmethod + def std_match(stdout, pattern): + if pattern is None: + return stdout.strip() + for line in stdout.splitlines(): + if re.match(pattern, line): + return line.strip() + return None diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/psu.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/psu.py new file mode 100644 index 000000000000..a7fc90e0fe23 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/psu.py @@ -0,0 +1,701 @@ +#!/usr/bin/env python3 +####################################################### +# +# psu.py +# Python implementation of the Class psu +# +####################################################### +from eepromutil.fru import ipmifru +from eepromutil.cust_fru import CustFru +from plat_hal.devicebase import devicebase +from plat_hal.sensor import sensor + + +class psu(devicebase): + __pmbus = None + __e2loc = None + __productManufacturer = None # : ARTESYN + __productName = None # : CRPS550W + __productPartModelName = None # : CSU550AP-3-300 + __productVersion = None # : AB + __productSerialNumber = None # : M623UZ00JYABL + __AirFlow = None # 'N/A' + __AirFlowconifg = None + __psu_display_name = None # 'N/A' + __psu_display_name_conifg = None + __psu_not_present_pwm = None + __InputStatus_config = None + __OutputStatus_config = None + __FanSpeed_config = None + __Temperature_config = None + __InputStatus = None + __OutputStatus = None + __FanSpeed = None + __Temperature = None + __FanSpeedMin = None + __FanSpeedMax = None + __FanSpeedTolerance = None + __InputsVoltage_config = None + __InputsCurrent_config = None + __InputsPower_config = None + __OutputsVoltage_config = None + __OutputsCurrent_config = None + __OutputsPower_config = None + __InputsVoltage = {} + __InputsCurrent = None + __InputsPower = None + __OutputsVoltage = None + __OutputsCurrent = None + __OutputsPower = None + __InputsType_config = None + __InputsType = None + __psu_sn_config = None + __psu_hw_config = None + __psu_pn_config = None + __psu_vendor_config = None + __TempStatus_config = None + __FanStatus_config = None + __TempStatus = None + __FanStatus = None + + def __init__(self, conf=None): + self.pmbus = conf.get("pmbusloc", None) + self.e2loc = conf.get("e2loc", None) + self.e2_type = conf.get('e2_type', "fru") + self.__presentconfig = conf.get("present", None) + self.name = conf.get("name", None) + self.get_threshold_by_model = conf.get("get_threshold_by_model", 0) + self.AirFlowconifg = conf.get("airflow", None) + self.psu_display_name_conifg = conf.get("psu_display_name", None) + self.psu_not_present_pwm = conf.get("psu_not_present_pwm", 100) + self.Temperature_config = conf.get("Temperature", None) + self.Temperature = sensor(self.Temperature_config, self.get_psu_model) + + self.FanSpeedTolerance = conf.get('psu_fan_tolerance', 30) + self.FanSpeed_config = conf.get("FanSpeed", None) + self.FanSpeed = sensor(self.FanSpeed_config, self.get_psu_model) + + self.__InputsVoltage_config = conf.get("InputsVoltage", None) + self.generate_psu_input_vol(self.__InputsVoltage_config) + self.__InputsCurrent_config = conf.get("InputsCurrent", None) + self.InputsCurrent = sensor(self.__InputsCurrent_config, self.get_psu_model) + self.__InputsPower_config = conf.get("InputsPower", None) + self.InputsPower = sensor(self.__InputsPower_config, self.get_psu_model) + self.__OutputsVoltage_config = conf.get("OutputsVoltage", None) + self.OutputsVoltage = sensor(self.__OutputsVoltage_config, self.get_psu_model) + self.__OutputsCurrent_config = conf.get("OutputsCurrent", None) + self.OutputsCurrent = sensor(self.__OutputsCurrent_config, self.get_psu_model) + self.__OutputsPower_config = conf.get("OutputsPower", None) + self.OutputsPower = sensor(self.__OutputsPower_config, self.get_psu_model) + + self.__InputStatus_config = conf.get("InputsStatus", None) + self.__OutputStatus_config = conf.get("OutputsStatus", None) + self.__InputsType_config = conf.get('InputsType', None) + self.__psu_sn_config = conf.get('psu_sn', None) + self.__psu_hw_config = conf.get('psu_hw', None) + self.__psu_pn_config = conf.get('psu_pn', None) + self.__psu_vendor_config = conf.get('psu_vendor', None) + self.__TempStatus_config = conf.get("TempStatus", None) + self.__FanStatus_config = conf.get("FanStatus", None) + + def get_psu_model(self): + if self.productPartModelName is None: + ret = self.get_fru_info() + if ret is False: + return None + return self.productPartModelName + + def generate_psu_input_vol(self, config): + tmp = {} + for (key, item) in config.items(): + tmp.setdefault(key, sensor(item, self.get_psu_model)) + self.__InputsVoltage = tmp + + def get_psu_sensor_by_name(self, psutype): + return self.__InputsVoltage.get(psutype) or self.__InputsVoltage.get('other') + + @property + def InputsVoltage(self): + psutype = self.InputsType + input_sensor = self.get_psu_sensor_by_name(psutype) + if input_sensor is None: + return None + return input_sensor + + @InputsVoltage.setter + def InputsVoltage(self, val): + self.__InputsVoltage = val + + @property + def InputsCurrent(self): + return self.__InputsCurrent + + @InputsCurrent.setter + def InputsCurrent(self, val): + self.__InputsCurrent = val + + @property + def InputsPower(self): + return self.__InputsPower + + @InputsPower.setter + def InputsPower(self, val): + self.__InputsPower = val + + @property + def OutputsVoltage(self): + return self.__OutputsVoltage + + @OutputsVoltage.setter + def OutputsVoltage(self, val): + self.__OutputsVoltage = val + + @property + def OutputsCurrent(self): + return self.__OutputsCurrent + + @OutputsCurrent.setter + def OutputsCurrent(self, val): + self.__OutputsCurrent = val + + @property + def OutputsPower(self): + return self.__OutputsPower + + @OutputsPower.setter + def OutputsPower(self, val): + self.__OutputsPower = val + + @property + def InputStatus(self): + if self.__InputStatus_config is None: + return None + if self.present is False: + self.__InputStatus = False + else: + ret, val = self.get_value(self.__InputStatus_config) + mask = self.__InputStatus_config.get("mask") + if ret is True: + if isinstance(val, str): + value = int(val, 16) + else: + value = val + ttt = value & mask + okval = self.__InputStatus_config.get("okval", 0) + if ttt == okval: + self.__InputStatus = True + else: + self.__InputStatus = False + else: + self.__InputStatus = False + return self.__InputStatus + + @InputStatus.setter + def InputStatus(self, val): + self.__InputStatus = val + + @property + def TempStatus(self): + if self.__TempStatus_config is None: + return None + if self.present is False: + self.__TempStatus = False + else: + ret, val = self.get_value(self.__TempStatus_config) + mask = self.__TempStatus_config.get("mask") + if ret is True: + if isinstance(val, str): + value = int(val, 16) + else: + value = val + ttt = value & mask + okval = self.__TempStatus_config.get("okval", 0) + if ttt == okval: + self.__TempStatus = True + else: + self.__TempStatus = False + else: + self.__TempStatus = False + return self.__TempStatus + + @TempStatus.setter + def TempStatus(self, val): + self.__TempStatus = val + + @property + def FanStatus(self): + if self.__FanStatus_config is None: + return None + if self.present is False: + self.__FanStatus = False + else: + ret, val = self.get_value(self.__FanStatus_config) + mask = self.__FanStatus_config.get("mask") + if ret is True: + if isinstance(val, str): + value = int(val, 16) + else: + value = val + ttt = value & mask + okval = self.__FanStatus_config.get("okval", 0) + if ttt == okval: + self.__FanStatus = True + else: + self.__FanStatus = False + else: + self.__FanStatus = False + return self.__FanStatus + + @FanStatus.setter + def FanStatus(self, val): + self.__FanStatus = val + + def get_input_type_pmbus(self): + psutypedecode = self.__InputsType_config.get('psutypedecode', {}) + if self.present is False: + self.__InputsType = psutypedecode.get(0x00) + else: + ret, val = self.get_value(self.__InputsType_config) + self.__InputsType = self.__InputsType_config.get(val, None) + if self.__InputsType is not None: + return self.__InputsType + if ret is True and val in psutypedecode: + self.__InputsType = psutypedecode.get(val) + else: + self.__InputsType = psutypedecode.get(0x00) + return self.__InputsType + + def get_input_type_fru(self): + self.__InputsType = 'N/A' + if self.productPartModelName is None: + ret = self.get_fru_info() + if ret is False: + return self.__InputsType + psutypedecode = self.__InputsType_config.get('psutypedecode', {}) + for key, value in psutypedecode.items(): + if self.productPartModelName in value: + self.__InputsType = key + return self.__InputsType + + @property + def InputsType(self): + gettype = self.__InputsType_config.get('gettype', "pmbus") + if gettype == "pmbus": + return self.get_input_type_pmbus() + + if gettype == "fru": + return self.get_input_type_fru() + + self.__InputsType = 'N/A' + return self.__InputsType + + @InputsType.setter + def InputsType(self, val): + self.__InputsType = val + + @property + def FanSpeedMin(self): + return self.__FanSpeedMin + + @FanSpeedMin.setter + def FanSpeedMin(self, val): + self.__FanSpeedMin = val + + @property + def FanSpeedMax(self): + return self.__FanSpeedMax + + @FanSpeedMax.setter + def FanSpeedMax(self, val): + self.__FanSpeedMax = val + + @property + def FanSpeedTolerance(self): + return self.__FanSpeedTolerance + + @FanSpeedTolerance.setter + def FanSpeedTolerance(self, val): + self.__FanSpeedTolerance = val + + @property + def OutputStatus(self): + if self.__OutputStatus_config is None: + return None + if self.present is False: + self.__OutputStatus = False + else: + ret, val = self.get_value(self.__OutputStatus_config) + mask = self.__OutputStatus_config.get("mask") + if ret is True: + if isinstance(val, str): + value = int(val, 16) + else: + value = val + ttt = value & mask + okval = self.__OutputStatus_config.get("okval", 0) + if ttt == okval: + self.__OutputStatus = True + else: + self.__OutputStatus = False + else: + self.__OutputStatus = False + return self.__OutputStatus + + @OutputStatus.setter + def OutputStatus(self, val): + self.__OutputStatus = val + + @property + def FanSpeed(self): + return self.__FanSpeed + + @FanSpeed.setter + def FanSpeed(self, val): + self.__FanSpeed = val + + @property + def Temperature(self): + return self.__Temperature + + @Temperature.setter + def Temperature(self, val): + self.__Temperature = val + + @property + def Temperature_config(self): + return self.__Temperature_config + + @Temperature_config.setter + def Temperature_config(self, val): + self.__Temperature_config = val + + @property + def AirFlowconifg(self): + return self.__AirFlowconifg + + @AirFlowconifg.setter + def AirFlowconifg(self, val): + self.__AirFlowconifg = val + + @property + def psu_display_name_conifg(self): + return self.__psu_display_name_conifg + + @psu_display_name_conifg.setter + def psu_display_name_conifg(self, val): + self.__psu_display_name_conifg = val + + @property + def pmbus(self): + return self.__pmbus + + @pmbus.setter + def pmbus(self, val): + self.__pmbus = val + + @property + def e2loc(self): + return self.__e2loc + + @e2loc.setter + def e2loc(self, val): + self.__e2loc = val + + @property + def AirFlow(self): + return self.__AirFlow + + @AirFlow.setter + def AirFlow(self, val): + self.__AirFlow = val + + @property + def psu_display_name(self): + return self.__psu_display_name + + @psu_display_name.setter + def psu_display_name(self, val): + self.__psu_display_name = val + + @property + def psu_not_present_pwm(self): + return self.__psu_not_present_pwm + + @psu_not_present_pwm.setter + def psu_not_present_pwm(self, val): + self.__psu_not_present_pwm = val + + @property + def present(self): + ret, val = self.get_value(self.__presentconfig) + if ret is False or val is None or val == "no_support": + return False + mask = self.__presentconfig.get("mask") + if isinstance(val, str): + value = int(val, 16) + else: + value = val + ttt = value & mask + okval = self.__presentconfig.get("okval", 0) + if ttt == okval: + return True + return False + + @property + def productManufacturer(self): + return self.__productManufacturer + + @productManufacturer.setter + def productManufacturer(self, val): + self.__productManufacturer = val + + @property + def productName(self): + return self.__productName + + @productName.setter + def productName(self, val): + self.__productName = val + + @property + def productPartModelName(self): + return self.__productPartModelName + + @productPartModelName.setter + def productPartModelName(self, val): + self.__productPartModelName = val + + @property + def productVersion(self): + return self.__productVersion + + @productVersion.setter + def productVersion(self, val): + self.__productVersion = val + + @property + def productSerialNumber(self): + return self.__productSerialNumber + + @productSerialNumber.setter + def productSerialNumber(self, val): + self.__productSerialNumber = val + + @property + def psu_sn_sysfs(self): + if self.__psu_sn_config is None: + return None + ret, val = self.get_value(self.__psu_sn_config) + if ret is False or val is None: + return None + return val + + @property + def psu_hw_sysfs(self): + if self.__psu_hw_config is None: + return None + ret, val = self.get_value(self.__psu_hw_config) + if ret is False or val is None: + return None + return val + + @property + def psu_pn_sysfs(self): + if self.__psu_pn_config is None: + return None + ret, val = self.get_value(self.__psu_pn_config) + if ret is False or val is None: + return None + return val + + @property + def psu_vendor_sysfs(self): + if self.__psu_vendor_config is None: + return None + ret, val = self.get_value(self.__psu_vendor_config) + if ret is False or val is None: + return None + return val + + def __str__(self): + formatstr = \ + "name : %s \n" \ + "productManufacturer : %s \n" \ + "productName : %s \n" \ + "productPartModelName: %s \n" \ + "productVersion : %s \n" \ + "productSerialNumber : %s \n" \ + "AirFlow : %s \n" \ + + tmpstr = formatstr % (self.name, self.productManufacturer, + self.productName, self.productPartModelName, + self.productVersion, self.productSerialNumber, self.AirFlow) + return tmpstr + + def get_fan_speed_pwm(self): + if self.pmbus is None: + return None + if self.present is False: + return self.psu_not_present_pwm + selfconfig = {} + selfconfig['bus'] = self.pmbus['bus'] + selfconfig['addr'] = self.pmbus['addr'] + selfconfig['way'] = 'i2cword' + selfconfig['offset'] = 0x3b + ret, val = self.get_value(selfconfig) + if ret is True: + return val + return None + + def set_fan_speed_pwm(self, pwm): + ''' + pmbus + if duty: + i2cset -f -y 0x3b 0x0064 wp + ''' + if self.present is False: + return None + + if self.pmbus is None: + return None + + if 0 <= pwm <= 100: + # enable duty first + selfconfig = {} + + selfconfig['bus'] = self.pmbus['bus'] + selfconfig['addr'] = self.pmbus['addr'] + selfconfig['way'] = 'i2cpec' + selfconfig['offset'] = 0x3a + self.set_value(selfconfig, 0x80) + + selfconfig['way'] = 'i2cwordpec' + selfconfig['offset'] = 0x3b + bytetmp = pwm + ret, val = self.set_value(selfconfig, int(bytetmp)) + if ret is True: + return True + return None + raise Exception("pwm not in range [0,100]") + + def get_fru_info_by_sysfs(self): + try: + psu_sn = self.psu_sn_sysfs + psu_hw = self.psu_hw_sysfs + psu_pn = self.psu_pn_sysfs + psu_vendor = self.psu_vendor_sysfs + if psu_sn is None or psu_hw is None or psu_pn is None or psu_vendor is None: + return False + self.productSerialNumber = psu_sn.strip().replace(chr(0), "") + self.productVersion = psu_hw.strip() + self.productPartModelName = psu_pn.strip() + self.productManufacturer = psu_vendor.strip().replace(chr(0), "") + except Exception: + self.productSerialNumber = None + self.productVersion = None + self.productPartModelName = None + self.productManufacturer = None + return False + return True + + def get_fru_info_by_decode(self): + try: + eeprom = self.get_eeprom_info(self.e2loc) + if eeprom is None: + raise Exception("%s:value is none" % self.name) + fru = ipmifru() + if isinstance(eeprom, bytes): + eeprom = self.byteTostr(eeprom) + fru.decodeBin(eeprom) + if fru.productInfoArea is not None: + self.productManufacturer = fru.productInfoArea.productManufacturer.strip() + self.productName = fru.productInfoArea.productName.strip() + self.productPartModelName = fru.productInfoArea.productPartModelName.strip() + self.productVersion = fru.productInfoArea.productVersion.strip() + self.productSerialNumber = fru.productInfoArea.productSerialNumber.strip().replace(chr(0), "") + except Exception: + self.productManufacturer = None + self.productName = None + self.productPartModelName = None + self.productVersion = None + self.productSerialNumber = None + return False + return True + + def get_custfru_info_by_decode(self): + try: + eeprom = self.get_eeprom_info(self.e2loc) + if eeprom is None: + raise Exception("%s:value is none" % self.name) + custfru = CustFru() + if isinstance(eeprom, bytes): + eeprom = self.byteTostr(eeprom) + custfru.decode(eeprom) + self.productManufacturer = custfru.manufacturer.strip() + self.productName = custfru.product_name.strip() + self.productPartModelName = custfru.product_name.strip() + self.productVersion = custfru.version.strip() + self.productSerialNumber = custfru.serial_number.strip().replace(chr(0), "") + except Exception: + self.productManufacturer = None + self.productName = None + self.productPartModelName = None + self.productVersion = None + self.productSerialNumber = None + return False + return True + + def get_fru_info(self): + try: + if self.present is not True: + raise Exception("%s: not present" % self.name) + + if self.get_fru_info_by_sysfs() is True: + return True + + if self.e2_type == "fru": + return self.get_fru_info_by_decode() + + if self.e2_type == "custfru": + return self.get_custfru_info_by_decode() + + raise Exception("%s: unsupport e2_type: %s" % (self.name, self.e2_type)) + except Exception: + self.productManufacturer = None + self.productName = None + self.productPartModelName = None + self.productVersion = None + self.productSerialNumber = None + return False + + def get_AirFlow(self): + if self.productPartModelName is None: + ret = self.get_fru_info() + if ret is False: + self.AirFlow = None + return False + if self.AirFlowconifg is None: + self.AirFlow = None + return False + for i in self.AirFlowconifg: + if self.productPartModelName in self.AirFlowconifg[i]: + self.AirFlow = i + return True + self.AirFlow = None + return False + + def get_psu_display_name(self): + if self.productPartModelName is None: + ret = self.get_fru_info() + if ret is False: + self.psu_display_name = None + return False + if self.psu_display_name_conifg is None: + self.psu_display_name = self.productPartModelName + return False + for i in self.psu_display_name_conifg: + if self.productPartModelName in self.psu_display_name_conifg[i]: + self.psu_display_name = i + return True + self.psu_display_name = self.productPartModelName + return False diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/rotor.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/rotor.py new file mode 100644 index 000000000000..ff120cb474b2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/rotor.py @@ -0,0 +1,149 @@ +#!/usr/bin/env python3 +####################################################### +# +# rotor.py +# Python implementation of the Class rotor +# +####################################################### +from plat_hal.devicebase import devicebase +from plat_hal.sensor import sensor + + +class rotor(devicebase): + __rotor_Running = None + __rotor_HwAlarm_conf = None + __rotor_Speed = None + __rotor_run_conf = None + __Speedconfig = None + __i2c_speed = None + __SpeedMin = None + __SpeedMax = None + __SpeedTolerance = None + + def __init__(self, conf=None): + self.name = conf.get('name', None) + self.rotor_HwAlarm_conf = conf.get('HwAlarm', None) + self.rotor_run_conf = conf.get('Running', None) + self.SpeedMin = conf.get('SpeedMin', None) + self.SpeedMax = conf.get('SpeedMax', None) + self.Tolerance = conf.get('tolerance', 30) + self.rotor_Speed = sensor(conf.get('Speed', None)) + self.Speedconfig = conf.get('Set_speed', None) + + def getRunning(self): + ret, val = self.get_value(self.rotor_run_conf) + if ret is False or val is None or val == "no_support": + return False + if isinstance(val, str): + value = int(val, 16) + else: + value = val + mask = self.rotor_run_conf.get("mask") + is_runing_value = self.rotor_run_conf.get("is_runing") + flag = value & mask + if flag == is_runing_value: + return True + return False + + @property + def SpeedMin(self): + return self.__SpeedMin + + @SpeedMin.setter + def SpeedMin(self, val): + self.__SpeedMin = val + + @property + def SpeedMax(self): + return self.__SpeedMax + + @SpeedMax.setter + def SpeedMax(self, val): + self.__SpeedMax = val + + @property + def Tolerance(self): + return self.__SpeedTolerance + + @Tolerance.setter + def Tolerance(self, val): + self.__SpeedTolerance = val + + @property + def i2c_speed(self): + ret, val = self.get_value(self.Speedconfig) + if ret is False: + return None + if val is not None: + self.__i2c_speed = val + return self.__i2c_speed + + def feed_watchdog(self): + ret, val = self.get_value(self.Speedconfig) + if ret is False: + return False, None + if val is not None: + ret, val = self.set_value(self.Speedconfig, val) + return ret, val + return False, None + + @i2c_speed.setter + def i2c_speed(self, val): + self.__i2c_speed = val + + @property + def Speedconfig(self): + return self.__Speedconfig + + @Speedconfig.setter + def Speedconfig(self, val): + self.__Speedconfig = val + + @property + def rotor_run_conf(self): + return self.__rotor_run_conf + + @rotor_run_conf.setter + def rotor_run_conf(self, val): + self.__rotor_run_conf = val + + @property + def rotor_Speed(self): + return self.__rotor_Speed + + @rotor_Speed.setter + def rotor_Speed(self, val): + self.__rotor_Speed = val + + @property + def rotor_HwAlarm(self): + ret, val = self.get_value(self.rotor_HwAlarm_conf) + mask = self.rotor_HwAlarm_conf.get("mask") + no_alarm_value = self.rotor_HwAlarm_conf.get("no_alarm") + if ret is False or val is None: + return False + if isinstance(val, str): + value = int(val, 16) + else: + value = val + flag = value & mask + if flag == no_alarm_value: + return False + return True + + @property + def rotor_HwAlarm_conf(self): + return self.__rotor_HwAlarm_conf + + @rotor_HwAlarm_conf.setter + def rotor_HwAlarm_conf(self, val): + self.__rotor_HwAlarm_conf = val + + @property + def rotor_Running(self): + self.__rotor_Running = self.getRunning() + return self.__rotor_Running + + @rotor_Running.setter + def rotor_Running(self, val): + self.__rotor_Running = val diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/sensor.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/sensor.py new file mode 100644 index 000000000000..af2a5384b618 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/sensor.py @@ -0,0 +1,274 @@ +#!/usr/bin/env python3 +####################################################### +# +# sensor.py +# Python implementation of the Class sensor +# +####################################################### +import time +from plat_hal.devicebase import devicebase + + +class sensor(devicebase): + + __Value = None + __Min = None + __Max = None + __Low = None + __High = None + __ValueConfig = None + __Flag = None + __Unit = None + __format = None + __read_times = None + + __Min_config = None + __Max_config = None + __Low_config = None + __High_config = None + + @property + def Min_config(self): + return self.__Min_config + + @Min_config.setter + def Min_config(self, val): + self.__Min_config = val + + @property + def Max_config(self): + return self.__Max_config + + @Max_config.setter + def Max_config(self, val): + self.__Max_config = val + + @property + def Low_config(self): + return self.__Low_config + + @Low_config.setter + def Low_config(self, val): + self.__Low_config = val + + @property + def High_config(self): + return self.__High_config + + @High_config.setter + def High_config(self, val): + self.__High_config = val + + @property + def Unit(self): + return self.__Unit + + @Unit.setter + def Unit(self, val): + self.__Unit = val + + @property + def format(self): + return self.__format + + @format.setter + def format(self, val): + self.__format = val + + @property + def read_times(self): + return self.__read_times + + @read_times.setter + def read_times(self, val): + self.__read_times = val + + @property + def ValueConfig(self): + return self.__ValueConfig + + @ValueConfig.setter + def ValueConfig(self, val): + self.__ValueConfig = val + + @property + def Flag(self): + return self.__Flag + + @Flag.setter + def Flag(self, val): + self.__Flag = val + + def get_median(self, value_config, read_times): + val_list = [] + for i in range(0, read_times): + ret, real_value = self.get_value(value_config) + if i != (read_times - 1): + time.sleep(0.01) + if ret is False or real_value is None: + continue + val_list.append(real_value) + val_list.sort() + if val_list: + return True, val_list[int((len(val_list) - 1) / 2)] + return False, None + + @property + def Value(self): + try: + ret, val = self.get_median(self.ValueConfig, self.read_times) + if ret is False or val is None: + return None + if self.format is None: + self.__Value = int(val) + else: + self.__Value = self.get_format_value(self.format % val) + self.__Value = round(float(self.__Value), 3) + except Exception: + return None + return self.__Value + + @Value.setter + def Value(self, val): + self.__Value = val + + @property + def Min(self): + try: + if isinstance(self.Min_config, dict): + if self.call_back is None: + self.__Min = self.Min_config.get("other") + else: + ret = self.call_back() + if ret not in self.Min_config: + self.__Min = self.Min_config.get("other") + else: + self.__Min = self.Min_config[ret] + else: + self.__Min = self.Min_config + + if self.__Min is None: + return None + + if self.format is not None: + self.__Min = self.get_format_value(self.format % self.__Min) + self.__Min = round(float(self.__Min), 3) + except Exception: + return None + return self.__Min + + @Min.setter + def Min(self, val): + self.__Min = val + + @property + def Max(self): + try: + if isinstance(self.Max_config, dict): + if self.call_back is None: + self.__Max = self.Max_config.get("other") + else: + ret = self.call_back() + if ret not in self.Max_config: + self.__Max = self.Max_config.get("other") + else: + self.__Max = self.Max_config[ret] + else: + self.__Max = self.Max_config + + if self.__Max is None: + return None + + if self.format is not None: + self.__Max = self.get_format_value(self.format % self.__Max) + self.__Max = round(float(self.__Max), 3) + except Exception: + return None + return self.__Max + + @Max.setter + def Max(self, val): + self.__Max = val + + @property + def Low(self): + try: + if isinstance(self.Low_config, dict): + if self.call_back is None: + self.__Low = self.Low_config.get("other") + else: + ret = self.call_back() + if ret not in self.Low_config: + self.__Low = self.Low_config.get("other") + else: + self.__Low = self.Low_config[ret] + else: + self.__Low = self.Low_config + + if self.__Low is None: + return None + + if self.format is not None: + self.__Low = self.get_format_value(self.format % self.__Low) + self.__Low = round(float(self.__Low), 3) + except Exception: + return None + return self.__Low + + @Low.setter + def Low(self, val): + self.__Low = val + + @property + def High(self): + try: + if isinstance(self.High_config, dict): + if self.call_back is None: + self.__High = self.High_config.get("other") + else: + ret = self.call_back() + if ret not in self.High_config: + self.__High = self.High_config.get("other") + else: + self.__High = self.High_config[ret] + else: + self.__High = self.High_config + + if self.__High is None: + return None + + if self.format is not None: + self.__High = self.get_format_value(self.format % self.__High) + self.__High = round(float(self.__High), 3) + except Exception: + return None + return self.__High + + @High.setter + def High(self, val): + self.__High = val + + def __init__(self, conf=None, call_back=None): + self.ValueConfig = conf.get("value", None) + self.Flag = conf.get("flag", None) + self.Min_config = conf.get("Min", None) + self.Max_config = conf.get("Max", None) + self.Low_config = conf.get("Low", None) + self.High_config = conf.get("High", None) + self.Unit = conf.get('Unit', None) + self.format = conf.get('format', None) + self.read_times = conf.get('read_times', 1) + self.call_back = call_back + + def __str__(self): + formatstr = \ + "ValueConfig: : %s \n" \ + "Min : %s \n" \ + "Max : %s \n" \ + "Unit : %s \n" \ + "format: : %s \n" + + tmpstr = formatstr % (self.ValueConfig, self.Min, + self.Max, self.Unit, + self.format) + return tmpstr diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/temp.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/temp.py new file mode 100644 index 000000000000..a202c20339c9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/plat_hal/temp.py @@ -0,0 +1,139 @@ +#!/usr/bin/env python3 +####################################################### +# +# temp.py +# Python implementation of the Class temp +# +####################################################### +import os +import syslog +from plat_hal.sensor import sensor + + +PLATFORM_HAL_TEMP_DEBUG_FILE = "/etc/.platform_hal_temp_debug_flag" + + +def platform_hal_temp_debug(s): + if os.path.exists(PLATFORM_HAL_TEMP_DEBUG_FILE): + syslog.openlog("PLATFORM_HAL_TEPM", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +class temp(sensor): + def __init__(self, conf=None): + super(temp, self).__init__(conf.get('Temperature', None)) + self.name = conf.get("name", None) + self.temp_id = conf.get("temp_id", None) + self.api_name = conf.get("api_name", self.name) + self.fix_value = conf.get("fix_value", None) + self.temp_invalid = conf.get("invalid", None) + self.temp_error = conf.get("error", None) + + def temp_cali_by_fan_pwm(self, param, origin_value): + fan_pwm_conf = param.get("fan_pwm") + temp_fix_list = param.get("temp_fix_list") + + ret, val = self.get_value(fan_pwm_conf) + if ret is False or val is None: + platform_hal_temp_debug("temp calibration get fan pwm failed, msg: %s, return None" % (val)) + return None + + fan_pwm = int(val) + for item in temp_fix_list: + if item["min"] <= fan_pwm <= item["max"]: + fix_value = origin_value + item["fix"] + platform_hal_temp_debug("temp calibration by fan pwm, origin_value: %s, pwm: %s, fix_value: %s" % + (origin_value, fan_pwm, fix_value)) + return fix_value + platform_hal_temp_debug("temp calibration by fan pwm, origin_value: %s, pwm: %s, not match return None" % + (origin_value, fan_pwm)) + return None + + def fix_temp_value(self, origin_value): + try: + fix_type = self.fix_value.get("fix_type") + + if fix_type == "func": + func_name = self.fix_value.get("func_name") + func_param = self.fix_value.get("func_param") + func = getattr(self, func_name) + if func is None: + platform_hal_temp_debug("function %s, not defined" % func_name) + return None + value = func(func_param, origin_value) + return value + + if fix_type == "config": + coefficient = self.fix_value.get("coefficient", 1) + addend = self.fix_value.get("addend", 0) + value = (origin_value + addend) * coefficient + platform_hal_temp_debug("temp calibration by config, coefficient: %s, addend: %s, origin_value: %s, fix_value: %s" % + (coefficient, addend, origin_value, value)) + return value + + platform_hal_temp_debug("unsupport fix type: %s, return origin value: %s" % (fix_type, origin_value)) + return origin_value + except Exception as e: + platform_hal_temp_debug("fix_temp_value raise exception, msg: %s" % (str(e))) + return None + + def get_max_value(self, conf): + try: + ret, val = self.get_value(conf) + if ret is False or val is None: + return None + return val + except Exception: + return None + + def check_flag(self): + try: + okbit = self.Flag.get('okbit') + okval = self.Flag.get('okval') + ret, val = self.get_value(self.Flag) + if (ret is False) or (val is None): + return False + val_t = (int(val) & (1 << okbit)) >> okbit + if val_t != okval: + return False + except Exception: + return False + return True + + @property + def Value(self): + try: + if self.Flag is not None: + if self.check_flag() is False: + return None + if isinstance(self.ValueConfig, list): + max_val = None + for i in self.ValueConfig: + tmp = self.get_max_value(i) + if tmp is None: + continue + if max_val is None or max_val < tmp: + max_val = tmp + if max_val is None: + return None + if self.format is None: + self.__Value = int(max_val) + else: + self.__Value = self.get_format_value(self.format % max_val) + else: + ret, val = self.get_value(self.ValueConfig) + if ret is False or val is None: + return None + if self.format is None: + self.__Value = int(val) + else: + self.__Value = self.get_format_value(self.format % val) + except Exception: + return None + if self.fix_value is not None and self.__Value != self.temp_invalid and self.__Value != self.temp_error: + self.__Value = self.fix_temp_value(self.__Value) + return self.__Value + + @Value.setter + def Value(self, val): + self.__Value = val diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/restful_util/__init__.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/restful_util/__init__.py new file mode 100755 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/restful_util/restful_api.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/restful_util/restful_api.py new file mode 100755 index 000000000000..2cb7f5273a44 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/restful_util/restful_api.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import os +import syslog + +import requests + +class RestfulApiClient(): + Debug_file = "/tmp/restful_api_debug" + BmcBaseUrl = 'http://240.1.1.2:8080' + NetworkUrl = '/api/v1.0/network' + PowerUrl = '/api/v1.0/power' + HostnameUrl = '/api/v1.0/hostname' + EventsUrl = '/api/v1.0/events' + SensorsUrl = '/api/v1.0/sys_switch/sensors' + SyseepromUrl = '/api/v1.0/syseeprom' + FansUrl = '/api/v1.0/sys_switch/fans' + # FanUrl = '/api/v1.0/sys_switch/fan/fan1' + FanUrl = '/api/v1.0/sys_switch/fan/' + PsusUrl = '/api/v1.0/sys_switch/psus' + # PsuUrl = '/api/v1.0/sys_switch/psu/psu1' + PsuUrl = '/api/v1.0/sys_switch/psu/' + LEDsUrl = '/api/v1.0/sys_switch/leds' + FirmwaresUrl = '/api/v1.0/sys_switch/firmwares' + WatchdogsUrl = '/api/v1.0/watchdog-lambda-os' + UsersUrl = '/api/v1.0/users' + TimeUrl = '/api/v1.0/time' + TimezoneUrl = '/api/v1.0/timezone' + NtpUrl = '/api/v1.0/ntp' + PowerUrl = '/api/v1.0/power' + + def restful_api_error_log(self, msg): + syslog.openlog("restful_api") + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + def restful_api_debug_log(self, msg): + if os.path.exists(self.Debug_file): + syslog.openlog("restful_api") + syslog.syslog(syslog.LOG_DEBUG, msg) + syslog.closelog() + + def get_request(self, url, time_out=(30, 30)): + try: + full_url = self.BmcBaseUrl + url + self.restful_api_debug_log("GET: %s" % full_url) + response = requests.get(full_url, timeout=time_out) + self.restful_api_debug_log("RET: %s" % str(response.json())) + return response.json() + except Exception as e: + self.restful_api_error_log(str(e)) + return None + + def post_request(self, url, data, time_out=(30, 30)): + try: + full_url = self.BmcBaseUrl + url + self.restful_api_debug_log("POST: %s -d %s" % (full_url, str(data))) + response = requests.post(full_url, json=data, timeout=time_out) + if response.status_code == 200: + self.restful_api_debug_log("RET: %s" % str(response.json())) + return response.json() + else: + self.restful_api_error_log("Post request failed. Status code {}".format(response.status_code)) + return None + except Exception as e: + self.restful_api_error_log(str(e)) + return None +''' +if __name__ == '__main__': + client = RestfulApiClient() + + time_data = client.get_request(client.TimeUrl) + print("Current time:", time_data) + + fans = client.get_request(client.FansUrl) + print("Current fans:", fans) + + new_time = "2023-08-31 14:41:28 +0800" + response = client.post_request(client.TimeUrl, {"time": new_time}) + print("Time set successfully:", response) + + cmd = "bmc reset cold" + response = client.post_request(client.PowerUrl, {"cmd": cmd}) + print("Time set successfully:", response) + + #sensors = client.get_request(client.SensorsUrl) + #print("sensors:", sensors) +''' diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/__init__.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/baseutil.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/baseutil.py new file mode 100644 index 000000000000..340a1f7a733f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/baseutil.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +import os + + +def get_machine_info(): + if not os.path.isfile('/host/machine.conf'): + return None + machine_vars = {} + with open('/host/machine.conf') as machine_file: + for line in machine_file: + tokens = line.split('=') + if len(tokens) < 2: + continue + machine_vars[tokens[0]] = tokens[1].strip() + return machine_vars + + +def get_platform_info(machine_info): + if machine_info is not None: + if 'onie_platform' in machine_info: + return machine_info['onie_platform'] + if 'aboot_platform' in machine_info: + return machine_info['aboot_platform'] + return None + + +def get_board_id(machine_info): + if machine_info is not None: + if 'onie_board_id' in machine_info: + return machine_info['onie_board_id'].lower() + return "NA" + + +def get_onie_machine(machine_info): + if machine_info is not None: + if 'onie_machine' in machine_info: + return machine_info['onie_machine'] + return None diff --git a/platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/smbus.py b/platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/smbus.py new file mode 100644 index 000000000000..5f1659b3bbf0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/lib/wbutil/smbus.py @@ -0,0 +1,772 @@ +#!/usr/bin/env python3 +# smbus2 - A drop-in replacement for smbus-cffi/smbus-python +# The MIT License (MIT) +# Copyright (c) 2017 Karl-Petter Lindegaard +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import os +import sys +from fcntl import ioctl +from ctypes import c_uint32, c_uint8, c_uint16, c_char, POINTER, Structure, Array, Union, create_string_buffer, string_at + + +# Commands from uapi/linux/i2c-dev.h +I2C_SLAVE = 0x0703 # Use this slave address +I2C_SLAVE_FORCE = 0x0706 # Use this slave address, even if it is already in use by a driver! +I2C_FUNCS = 0x0705 # Get the adapter functionality mask +I2C_RDWR = 0x0707 # Combined R/W transfer (one STOP only) +I2C_SMBUS = 0x0720 # SMBus transfer. Takes pointer to i2c_smbus_ioctl_data +I2C_PEC = 0x0708 + +# SMBus transfer read or write markers from uapi/linux/i2c.h +I2C_SMBUS_WRITE = 0 +I2C_SMBUS_READ = 1 + +# Size identifiers uapi/linux/i2c.h +I2C_SMBUS_QUICK = 0 +I2C_SMBUS_BYTE = 1 +I2C_SMBUS_BYTE_DATA = 2 +I2C_SMBUS_WORD_DATA = 3 +I2C_SMBUS_PROC_CALL = 4 +# This isn't supported by Pure-I2C drivers with SMBUS emulation, like those in RaspberryPi, OrangePi, etc :( +I2C_SMBUS_BLOCK_DATA = 5 +I2C_SMBUS_BLOCK_PROC_CALL = 7 # Like I2C_SMBUS_BLOCK_DATA, it isn't supported by Pure-I2C drivers either. +I2C_SMBUS_I2C_BLOCK_DATA = 8 +I2C_SMBUS_BLOCK_MAX = 32 + +# To determine what functionality is present (uapi/linux/i2c.h) +try: + from enum import IntFlag +except ImportError: + IntFlag = int + + +class I2cFunc(IntFlag): + """ + These flags identify the operations supported by an I2C/SMBus device. + + You can test these flags on your `smbus.funcs` + + On newer python versions, I2cFunc is an IntFlag enum, but it + falls back to class with a bunch of int constants on older releases. + """ + I2C = 0x00000001 + ADDR_10BIT = 0x00000002 + PROTOCOL_MANGLING = 0x00000004 # I2C_M_IGNORE_NAK etc. + SMBUS_PEC = 0x00000008 + NOSTART = 0x00000010 # I2C_M_NOSTART + SLAVE = 0x00000020 + SMBUS_BLOCK_PROC_CALL = 0x00008000 # SMBus 2.0 + SMBUS_QUICK = 0x00010000 + SMBUS_READ_BYTE = 0x00020000 + SMBUS_WRITE_BYTE = 0x00040000 + SMBUS_READ_BYTE_DATA = 0x00080000 + SMBUS_WRITE_BYTE_DATA = 0x00100000 + SMBUS_READ_WORD_DATA = 0x00200000 + SMBUS_WRITE_WORD_DATA = 0x00400000 + SMBUS_PROC_CALL = 0x00800000 + SMBUS_READ_BLOCK_DATA = 0x01000000 + SMBUS_WRITE_BLOCK_DATA = 0x02000000 + SMBUS_READ_I2C_BLOCK = 0x04000000 # I2C-like block xfer + SMBUS_WRITE_I2C_BLOCK = 0x08000000 # w/ 1-byte reg. addr. + SMBUS_HOST_NOTIFY = 0x10000000 + + SMBUS_BYTE = 0x00060000 + SMBUS_BYTE_DATA = 0x00180000 + SMBUS_WORD_DATA = 0x00600000 + SMBUS_BLOCK_DATA = 0x03000000 + SMBUS_I2C_BLOCK = 0x0c000000 + SMBUS_EMUL = 0x0eff0008 + + +# i2c_msg flags from uapi/linux/i2c.h +I2C_M_RD = 0x0001 + +# Pointer definitions +LP_c_uint8 = POINTER(c_uint8) +LP_c_uint16 = POINTER(c_uint16) +LP_c_uint32 = POINTER(c_uint32) + + +############################################################# +# Type definitions as in i2c.h + + +class i2c_smbus_data(Array): + """ + Adaptation of the i2c_smbus_data union in ``i2c.h``. + + Data for SMBus messages. + """ + _length_ = I2C_SMBUS_BLOCK_MAX + 2 + _type_ = c_uint8 + + +class union_i2c_smbus_data(Union): + _fields_ = [ + ("byte", c_uint8), + ("word", c_uint16), + ("block", i2c_smbus_data) + ] + + +union_pointer_type = POINTER(union_i2c_smbus_data) + + +class i2c_smbus_ioctl_data(Structure): + """ + As defined in ``i2c-dev.h``. + """ + _fields_ = [ + ('read_write', c_uint8), + ('command', c_uint8), + ('size', c_uint32), + ('data', union_pointer_type)] + __slots__ = [name for name, type in _fields_] + + @staticmethod + def create(read_write=I2C_SMBUS_READ, command=0, size=I2C_SMBUS_BYTE_DATA): + u = union_i2c_smbus_data() + return i2c_smbus_ioctl_data( + read_write=read_write, command=command, size=size, + data=union_pointer_type(u)) + + +############################################################# +# Type definitions for i2c_rdwr combined transactions + + +class i2c_msg(Structure): + """ + As defined in ``i2c.h``. + """ + _fields_ = [ + ('addr', c_uint16), + ('flags', c_uint16), + ('len', c_uint16), + ('buf', POINTER(c_char))] + + def __iter__(self): + """ Iterator / Generator + + :return: iterates over :py:attr:`buf` + :rtype: :py:class:`generator` which returns int values + """ + idx = 0 + while idx < self.len: + yield ord(self.buf[idx]) + idx += 1 + + def __len__(self): + return self.len + + def __bytes__(self): + return string_at(self.buf, self.len) + + def __repr__(self): + return 'i2c_msg(%d,%d,%r)' % (self.addr, self.flags, self.__bytes__()) + + def __str__(self): + s = self.__bytes__() + if sys.version_info.major >= 3: + s = ''.join(map(chr, s)) + return s + + @staticmethod + def read(address, length): + """ + Prepares an i2c read transaction. + + :param address: Slave address. + :type: address: int + :param length: Number of bytes to read. + :type: length: int + :return: New :py:class:`i2c_msg` instance for read operation. + :rtype: :py:class:`i2c_msg` + """ + arr = create_string_buffer(length) + return i2c_msg( + addr=address, flags=I2C_M_RD, len=length, + buf=arr) + + @staticmethod + def write(address, buf): + """ + Prepares an i2c write transaction. + + :param address: Slave address. + :type address: int + :param buf: Bytes to write. Either list of values or str. + :type buf: list + :return: New :py:class:`i2c_msg` instance for write operation. + :rtype: :py:class:`i2c_msg` + """ + if sys.version_info.major >= 3: + if isinstance(buf, str): + buf = bytes(map(ord, buf)) + else: + buf = bytes(buf) + else: + if not isinstance(buf, str): + buf = ''.join([chr(x) for x in buf]) + arr = create_string_buffer(buf, len(buf)) + return i2c_msg( + addr=address, flags=0, len=len(arr), + buf=arr) + + +class i2c_rdwr_ioctl_data(Structure): + """ + As defined in ``i2c-dev.h``. + """ + _fields_ = [ + ('msgs', POINTER(i2c_msg)), + ('nmsgs', c_uint32) + ] + __slots__ = [name for name, type in _fields_] + + @staticmethod + def create(*i2c_msg_instances): + """ + Factory method for creating a i2c_rdwr_ioctl_data struct that can + be called with ``ioctl(fd, I2C_RDWR, data)``. + + :param i2c_msg_instances: Up to 42 i2c_msg instances + :rtype: i2c_rdwr_ioctl_data + """ + n_msg = len(i2c_msg_instances) + msg_array = (i2c_msg * n_msg)(*i2c_msg_instances) + return i2c_rdwr_ioctl_data( + msgs=msg_array, + nmsgs=n_msg + ) + + +############################################################# + + +class SMBus(object): + + def __init__(self, bus=None, force=False): + """ + Initialize and (optionally) open an i2c bus connection. + + :param bus: i2c bus number (e.g. 0 or 1) + or an absolute file path (e.g. `/dev/i2c-42`). + If not given, a subsequent call to ``open()`` is required. + :type bus: int or str + :param force: force using the slave address even when driver is + already using it. + :type force: boolean + """ + self.fd = None + self.funcs = I2cFunc(0) + if bus is not None: + self.open(bus) + self.address = None + self.force = force + self._force_last = None + + def __enter__(self): + """Enter handler.""" + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + """Exit handler.""" + self.close() + + def open(self, bus): + """ + Open a given i2c bus. + + :param bus: i2c bus number (e.g. 0 or 1) + or an absolute file path (e.g. '/dev/i2c-42'). + :type bus: int or str + :raise TypeError: if type(bus) is not in (int, str) + """ + if isinstance(bus, int): + filepath = "/dev/i2c-{}".format(bus) + elif isinstance(bus, str): + filepath = bus + else: + raise TypeError("Unexpected type(bus)={}".format(type(bus))) + + self.fd = os.open(filepath, os.O_RDWR) + self.funcs = self._get_funcs() + + def close(self): + """ + Close the i2c connection. + """ + if self.fd: + os.close(self.fd) + self.fd = None + + def _set_address(self, address, force=None): + """ + Set i2c slave address to use for subsequent calls. + + :param address: + :type address: int + :param force: + :type force: Boolean + """ + force = force if force is not None else self.force + if self.address != address or self._force_last != force: + if force is True: + ioctl(self.fd, I2C_SLAVE_FORCE, address) + else: + ioctl(self.fd, I2C_SLAVE, address) + self.address = address + self._force_last = force + + def _get_funcs(self): + """ + Returns a 32-bit value stating supported I2C functions. + + :rtype: int + """ + f = c_uint32() + ioctl(self.fd, I2C_FUNCS, f) + return f.value + + def write_quick(self, i2c_addr, force=None): + """ + Perform quick transaction. Throws IOError if unsuccessful. + :param i2c_addr: i2c address + :type i2c_addr: int + :param force: + :type force: Boolean + """ + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=0, size=I2C_SMBUS_QUICK) + ioctl(self.fd, I2C_SMBUS, msg) + + def read_byte(self, i2c_addr, force=None): + """ + Read a single byte from a device. + + :rtype: int + :param i2c_addr: i2c address + :type i2c_addr: int + :param force: + :type force: Boolean + :return: Read byte value + """ + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_READ, command=0, size=I2C_SMBUS_BYTE + ) + ioctl(self.fd, I2C_SMBUS, msg) + return msg.data.contents.byte + + def write_byte(self, i2c_addr, value, force=None): + """ + Write a single byte to a device. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param value: value to write + :type value: int + :param force: + :type force: Boolean + """ + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=value, size=I2C_SMBUS_BYTE + ) + ioctl(self.fd, I2C_SMBUS, msg) + + def read_byte_data(self, i2c_addr, register, force=None): + """ + Read a single byte from a designated register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to read + :type register: int + :param force: + :type force: Boolean + :return: Read byte value + :rtype: int + """ + val_t = -1 + returnmsg = "" + try: + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_READ, command=register, size=I2C_SMBUS_BYTE_DATA + ) + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + self.close() + returnmsg = str(e) + if val_t < 0: + return False, returnmsg + return True, msg.data.contents.byte + + def write_byte_data(self, i2c_addr, register, value, force=None): + """ + Write a byte to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to write to + :type register: int + :param value: Byte value to transmit + :type value: int + :param force: + :type force: Boolean + :rtype: None + """ + val_t = -1 + returnmsg = "" + try: + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_BYTE_DATA + ) + msg.data.contents.byte = value + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + returnmsg = str(e) + self.close() + if val_t < 0: + return False, returnmsg or "" + return True, "" + + def write_byte_data_pec(self, i2c_addr, register, value, force=None): + """ + Write a byte to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to write to + :type register: int + :param value: Byte value to transmit + :type value: int + :param force: + :type force: Boolean + :rtype: None + """ + val_t = -1 + returnmsg = "" + try: + val_t = ioctl(self.fd, I2C_PEC, 1) + if val_t < 0: + raise Exception("set pec mod error") + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_BYTE_DATA + ) + msg.data.contents.byte = value + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + returnmsg = str(e) + self.close() + if val_t < 0: + return False, returnmsg or "" + return True, "" + + def read_word_data(self, i2c_addr, register, force=None): + """ + Read a single word (2 bytes) from a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to read + :type register: int + :param force: + :type force: Boolean + :return: 2-byte word + :rtype: int + """ + val_t = -1 + returnmsg = "" + try: + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_READ, command=register, size=I2C_SMBUS_WORD_DATA + ) + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + returnmsg = str(e) + self.close() + if val_t < 0: + return False, returnmsg or "" + return True, msg.data.contents.word + + def write_word_data_pec(self, i2c_addr, register, value, force=None): + """ + Write a byte to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to write to + :type register: int + :param value: Word value to transmit + :type value: int + :param force: + :type force: Boolean + :rtype: None + """ + val_t = -1 + returnmsg = "" + try: + val_t = ioctl(self.fd, I2C_PEC, 1) + if val_t < 0: + raise Exception("set pec mod error") + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_WORD_DATA + ) + msg.data.contents.word = value + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + returnmsg = str(e) + self.close() + if val_t < 0: + return False, returnmsg or "" + return True, "" + + def write_word_data(self, i2c_addr, register, value, force=None): + """ + Write a byte to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to write to + :type register: int + :param value: Word value to transmit + :type value: int + :param force: + :type force: Boolean + :rtype: None + """ + val_t = -1 + returnmsg = "" + try: + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_WORD_DATA + ) + msg.data.contents.word = value + val_t = ioctl(self.fd, I2C_SMBUS, msg) + except Exception as e: + returnmsg = str(e) + self.close() + if val_t < 0: + return False, returnmsg or "" + return True, "" + + def process_call(self, i2c_addr, register, value, force=None): + """ + Executes a SMBus Process Call, sending a 16-bit value and receiving a 16-bit response + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to read/write to + :type register: int + :param value: Word value to transmit + :type value: int + :param force: + :type force: Boolean + :rtype: int + """ + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_PROC_CALL + ) + msg.data.contents.word = value + ioctl(self.fd, I2C_SMBUS, msg) + return msg.data.contents.word + + def read_block_data(self, i2c_addr, register, force=None): + """ + Read a block of up to 32-bytes from a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Start register + :type register: int + :param force: + :type force: Boolean + :return: List of bytes + :rtype: list + """ + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_READ, command=register, size=I2C_SMBUS_BLOCK_DATA + ) + ioctl(self.fd, I2C_SMBUS, msg) + length = msg.data.contents.block[0] + return msg.data.contents.block[1:length + 1] + + def write_block_data(self, i2c_addr, register, data, force=None): + """ + Write a block of byte data to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Start register + :type register: int + :param data: List of bytes + :type data: list + :param force: + :type force: Boolean + :rtype: None + """ + length = len(data) + if length > I2C_SMBUS_BLOCK_MAX: + raise ValueError("Data length cannot exceed %d bytes" % I2C_SMBUS_BLOCK_MAX) + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_BLOCK_DATA + ) + msg.data.contents.block[0] = length + msg.data.contents.block[1:length + 1] = data + ioctl(self.fd, I2C_SMBUS, msg) + + def block_process_call(self, i2c_addr, register, data, force=None): + """ + Executes a SMBus Block Process Call, sending a variable-size data + block and receiving another variable-size response + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Register to read/write to + :type register: int + :param data: List of bytes + :type data: list + :param force: + :type force: Boolean + :return: List of bytes + :rtype: list + """ + length = len(data) + if length > I2C_SMBUS_BLOCK_MAX: + raise ValueError("Data length cannot exceed %d bytes" % I2C_SMBUS_BLOCK_MAX) + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_BLOCK_PROC_CALL + ) + msg.data.contents.block[0] = length + msg.data.contents.block[1:length + 1] = data + ioctl(self.fd, I2C_SMBUS, msg) + length = msg.data.contents.block[0] + return msg.data.contents.block[1:length + 1] + + def read_i2c_block_data(self, i2c_addr, register, length, force=None): + """ + Read a block of byte data from a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Start register + :type register: int + :param length: Desired block length + :type length: int + :param force: + :type force: Boolean + :return: List of bytes + :rtype: list + """ + if length > I2C_SMBUS_BLOCK_MAX: + raise ValueError("Desired block length over %d bytes" % I2C_SMBUS_BLOCK_MAX) + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_READ, command=register, size=I2C_SMBUS_I2C_BLOCK_DATA + ) + msg.data.contents.byte = length + ioctl(self.fd, I2C_SMBUS, msg) + return msg.data.contents.block[1:length + 1] + + def write_i2c_block_data(self, i2c_addr, register, data, force=None): + """ + Write a block of byte data to a given register. + + :param i2c_addr: i2c address + :type i2c_addr: int + :param register: Start register + :type register: int + :param data: List of bytes + :type data: list + :param force: + :type force: Boolean + :rtype: None + """ + length = len(data) + if length > I2C_SMBUS_BLOCK_MAX: + raise ValueError("Data length cannot exceed %d bytes" % I2C_SMBUS_BLOCK_MAX) + self._set_address(i2c_addr, force=force) + msg = i2c_smbus_ioctl_data.create( + read_write=I2C_SMBUS_WRITE, command=register, size=I2C_SMBUS_I2C_BLOCK_DATA + ) + msg.data.contents.block[0] = length + msg.data.contents.block[1:length + 1] = data + ioctl(self.fd, I2C_SMBUS, msg) + + def i2c_rdwr(self, *i2c_msgs): + """ + Combine a series of i2c read and write operations in a single + transaction (with repeated start bits but no stop bits in between). + + This method takes i2c_msg instances as input, which must be created + first with :py:meth:`i2c_msg.read` or :py:meth:`i2c_msg.write`. + + :param i2c_msgs: One or more i2c_msg class instances. + :type i2c_msgs: i2c_msg + :rtype: None + """ + ioctl_data = i2c_rdwr_ioctl_data.create(*i2c_msgs) + ioctl(self.fd, I2C_RDWR, ioctl_data) + + +class SMBusWrapper: + """ + Wrapper class around the SMBus. + Deprecated as of version 0.3.0. Please replace with :py:class:`SMBus`. + + Enables the user to wrap access to the :py:class:`SMBus` class in a + "with" statement. If auto_cleanup is True (default), the + :py:class:`SMBus` handle will be automatically closed + upon exit of the ``with`` block. + """ + + def __init__(self, bus_number=0, auto_cleanup=True, force=False): + """ + :param auto_cleanup: Close bus when leaving scope. + :type auto_cleanup: Boolean + :param force: Force using the slave address even when driver is already using it. + :type force: Boolean + """ + self.bus_number = bus_number + self.auto_cleanup = auto_cleanup + self.force = force + self.bus = None + + def __enter__(self): + self.bus = SMBus(bus=self.bus_number, force=self.force) + return self.bus + + def __exit__(self, exc_type, exc_val, exc_tb): + if self.auto_cleanup: + self.bus.close() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modprobe_conf/kernel_drivers_blacklist.conf b/platform/broadcom/sonic-platform-modules-micas/common/modprobe_conf/kernel_drivers_blacklist.conf new file mode 100644 index 000000000000..a49166ab6207 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modprobe_conf/kernel_drivers_blacklist.conf @@ -0,0 +1,3 @@ +blacklist wb_fpga_pcie +blacklist wb_i2c_i801 +blacklist wb_i2c_ismt diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/COPYING b/platform/broadcom/sonic-platform-modules-micas/common/modules/COPYING new file mode 100644 index 000000000000..a635a38ef940 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/COPYING @@ -0,0 +1,20 @@ +The Linux Kernel is provided under: + + SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note + +Being under the terms of the GNU General Public License version 2 only, +according with: + + LICENSES/preferred/GPL-2.0 + +With an explicit syscall exception, as stated at: + + LICENSES/exceptions/Linux-syscall-note + +In addition, other licenses may also apply. Please see: + + Documentation/process/license-rules.rst + +for more details. + +All contributions to the Linux Kernel are subject to this COPYING file. diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/GPL-2.0 b/platform/broadcom/sonic-platform-modules-micas/common/modules/GPL-2.0 new file mode 100644 index 000000000000..ff0812fd89cc --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/GPL-2.0 @@ -0,0 +1,359 @@ +Valid-License-Identifier: GPL-2.0 +Valid-License-Identifier: GPL-2.0-only +Valid-License-Identifier: GPL-2.0+ +Valid-License-Identifier: GPL-2.0-or-later +SPDX-URL: https://spdx.org/licenses/GPL-2.0.html +Usage-Guide: + To use this license in source code, put one of the following SPDX + tag/value pairs into a comment according to the placement + guidelines in the licensing rules documentation. + For 'GNU General Public License (GPL) version 2 only' use: + SPDX-License-Identifier: GPL-2.0 + or + SPDX-License-Identifier: GPL-2.0-only + For 'GNU General Public License (GPL) version 2 or any later version' use: + SPDX-License-Identifier: GPL-2.0+ + or + SPDX-License-Identifier: GPL-2.0-or-later +License-Text: + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/modules/Makefile new file mode 100644 index 000000000000..bacb3839e834 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/Makefile @@ -0,0 +1,52 @@ +PWD = $(shell pwd) +EXTRA_CFLAGS:= -I$(M)/include +EXTRA_CFLAGS+= -Wall +KVERSION ?= $(shell uname -r) +KERNEL_SRC ?= /lib/modules/$(KVERSION) + +module_out_put_dir := $(PWD)/build +export module_out_put_dir + +KERNEL_MODULES_SRC = $(PWD)/linux + +PLAT_SYSFS_DIR = $(PWD)/plat_sysfs +PINCTRL = $(PWD)/pinctrl + +export PLAT_SYSFS_DIR + +platform_common-objs := platform_common_module.o dfd_tlveeprom.o +obj-m += platform_common.o +obj-m += wb_mac_bsc.o +obj-m += wb_fpga_pcie.o +obj-m += wb_pcie_dev.o +obj-m += wb_fpga_i2c_bus_drv.o +obj-m += wb_fpga_pca954x_drv.o +obj-m += wb_lpc_drv.o +obj-m += wb_i2c_dev.o +obj-m += wb_platform_i2c_dev.o +obj-m += wb_io_dev.o +obj-m += wb_gpio_d1500.o +obj-m += wb_gpio_device.o +obj-m += wb_i2c_ocores.o +obj-m += wb_spi_ocores.o +obj-m += wb_spi_dev.o +obj-m += wb_wdt.o +obj-m += wb_spi_gpio_device.o +obj-m += wb_xdpe132g5c.o +obj-m += wb_uio_irq.o +obj-m += hw_test.o +obj-m += wb_mdio_gpio_device.o + +all : + $(MAKE) -C $(KERNEL_MODULES_SRC) + $(MAKE) -C $(PLAT_SYSFS_DIR) + $(MAKE) -C $(PINCTRL) + $(MAKE) -C $(KERNEL_SRC)/build M=$(PWD) modules + @if [ ! -d $(module_out_put_dir) ]; then mkdir -p $(module_out_put_dir) ;fi + cp -p $(PWD)/*.ko $(module_out_put_dir) + +clean : + rm -rf $(module_out_put_dir) + rm -f ${PWD}/*.o ${PWD}/*.ko ${PWD}/*.mod.c ${PWD}/.*.cmd ${PWD}/.*.o.d ${PWD}/*.mod + rm -f ${PWD}/Module.markers ${PWD}/Module.symvers ${PWD}/modules.order + rm -rf ${PWD}/.tmp_versions diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.c new file mode 100644 index 000000000000..0d6f38ecc551 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.c @@ -0,0 +1,516 @@ +/* + * Copyright (C) 2003-2014 FreeIPMI Core Team + * + * 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 3 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, see . + * + */ +/*****************************************************************************\ + * Copyright (C) 2007-2014 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Albert Chu + * UCRL-CODE-232183 + * + * This file is part of Ipmi-fru, a tool used for retrieving + * motherboard field replaceable unit (FRU) information. For details, + * see http://www.llnl.gov/linux/. + * + * Ipmi-fru 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 3 of the License, or (at your + * option) any later version. + * + * Ipmi-fru 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 Ipmi-fru. If not, see . +\*****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "platform_common.h" +#include "dfd_tlveeprom.h" + +/* using in is_valid_tlvinfo_header */ +static u_int32_t eeprom_size; + +/* + * List of TLV codes and names. + */ +static const struct tlv_code_desc tlv_code_list[] = { + { TLV_CODE_PRODUCT_NAME , "Product Name"}, + { TLV_CODE_PART_NUMBER , "Part Number"}, + { TLV_CODE_SERIAL_NUMBER , "Serial Number"}, + { TLV_CODE_MAC_BASE , "Base MAC Address"}, + { TLV_CODE_MANUF_DATE , "Manufacture Date"}, + { TLV_CODE_DEVICE_VERSION , "Device Version"}, + { TLV_CODE_LABEL_REVISION , "Label Revision"}, + { TLV_CODE_PLATFORM_NAME , "Platform Name"}, + { TLV_CODE_ONIE_VERSION , "ONIE Version"}, + { TLV_CODE_MAC_SIZE , "MAC Addresses"}, + { TLV_CODE_MANUF_NAME , "Manufacturer"}, + { TLV_CODE_MANUF_COUNTRY , "Country Code"}, + { TLV_CODE_VENDOR_NAME , "Vendor Name"}, + { TLV_CODE_DIAG_VERSION , "Diag Version"}, + { TLV_CODE_SERVICE_TAG , "Service Tag"}, + { TLV_CODE_VENDOR_EXT , "Vendor Extension"}, + { TLV_CODE_CRC_32 , "CRC-32"}, +}; + +#if 0 +#define OPENBMC_VPD_KEY_INVAIL_VAL 0 + +static const tlv_code_map_t tlv_code_map[] = { + { TLV_CODE_PRODUCT_NAME , OPENBMC_VPD_KEY_PRODUCT_NAME}, + { TLV_CODE_PART_NUMBER , OPENBMC_VPD_KEY_PRODUCT_PART_MODEL_NUM}, + { TLV_CODE_SERIAL_NUMBER , OPENBMC_VPD_KEY_PRODUCT_SERIAL_NUM}, + { TLV_CODE_MAC_BASE , OPENBMC_VPD_KEY_INVAIL_VAL}, + { TLV_CODE_MANUF_DATE , OPENBMC_VPD_KEY_BOARD_MFG_DATE}, + { TLV_CODE_DEVICE_VERSION , OPENBMC_VPD_KEY_PRODUCT_VER}, + { TLV_CODE_LABEL_REVISION , OPENBMC_VPD_KEY_PRODUCT_CUSTOM7}, + { TLV_CODE_PLATFORM_NAME , OPENBMC_VPD_KEY_PRODUCT_CUSTOM1}, + { TLV_CODE_ONIE_VERSION , OPENBMC_VPD_KEY_PRODUCT_CUSTOM2}, + { TLV_CODE_MAC_SIZE , OPENBMC_VPD_KEY_INVAIL_VAL}, + { TLV_CODE_MANUF_NAME , OPENBMC_VPD_KEY_PRODUCT_MFR}, + { TLV_CODE_MANUF_COUNTRY , OPENBMC_VPD_KEY_PRODUCT_CUSTOM3}, + { TLV_CODE_VENDOR_NAME , OPENBMC_VPD_KEY_PRODUCT_CUSTOM4}, + { TLV_CODE_DIAG_VERSION , OPENBMC_VPD_KEY_PRODUCT_CUSTOM8}, + { TLV_CODE_SERVICE_TAG , OPENBMC_VPD_KEY_PRODUCT_CUSTOM5}, + { TLV_CODE_VENDOR_EXT , OPENBMC_VPD_KEY_PRODUCT_CUSTOM6}, + { TLV_CODE_CRC_32 , OPENBMC_VPD_KEY_INVAIL_VAL}, +}; +#endif + +#define TLV_CODE_NUM (sizeof(tlv_code_list) / sizeof(tlv_code_list[0])) + +#if 0 +#define TLV_CODE_MAP_NUM (sizeof(tlv_code_map) / sizeof(tlv_code_map[0])) +#endif + +const unsigned long crc_table[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, +}; + +static unsigned long crc32(unsigned long crc, const unsigned char *buf, unsigned len) +{ + unsigned i; + if (len < 1) + return 0xffffffff; + + for (i = 0; i != len; ++i) + { + crc = crc_table[(crc ^ buf[i]) & 0xff] ^ (crc >> 8); + } + + crc = crc ^ 0xffffffff; + + return crc; +} + +/* + * is_valid_tlv + * + * Perform basic sanity checks on a TLV field. The TLV is pointed to + * by the parameter provided. + * 1. The type code is not reserved (0x00 or 0xFF) + */ +static inline bool is_valid_tlv(tlvinfo_tlv_t *tlv) +{ + return ((tlv->type != 0x00) && (tlv->type != 0xFF)); +} + +/* + * is_valid_tlvinfo_header + * + * Perform sanity checks on the first 11 bytes of the TlvInfo EEPROM + * data pointed to by the parameter: + * 1. First 8 bytes contain null-terminated ASCII string "TlvInfo" + * 2. Version byte is 1 + * 3. Total length bytes contain value which is less than or equal + * to the allowed maximum (2048-11) + * + */ +static inline bool is_valid_tlvinfo_header(tlvinfo_header_t *hdr) +{ + int max_size = eeprom_size; + return((strcmp(hdr->signature, TLV_INFO_ID_STRING) == 0) && + (hdr->version == TLV_INFO_VERSION) && + (be16_to_cpu(hdr->totallen) <= max_size) ); +} + +/* + * decode_tlv_value + * + * Decode a single TLV value into a string. + + * The validity of EEPROM contents and the TLV field have been verified + * prior to calling this function. + */ +static void decode_tlv_value(tlvinfo_tlv_t *tlv, tlv_decode_value_t *decode_value) +{ + int i; + char *value; + u_int32_t length; + + value = (char *)decode_value->value; + + switch (tlv->type) { + case TLV_CODE_PRODUCT_NAME: + case TLV_CODE_PART_NUMBER: + case TLV_CODE_SERIAL_NUMBER: + case TLV_CODE_MANUF_DATE: + case TLV_CODE_LABEL_REVISION: + case TLV_CODE_PLATFORM_NAME: + case TLV_CODE_ONIE_VERSION: + case TLV_CODE_MANUF_NAME: + case TLV_CODE_MANUF_COUNTRY: + case TLV_CODE_VENDOR_NAME: + case TLV_CODE_DIAG_VERSION: + case TLV_CODE_SERVICE_TAG: + case TLV_CODE_VENDOR_EXT: + memcpy(value, tlv->value, tlv->length); + value[tlv->length] = 0; + length = tlv->length; + break; + case TLV_CODE_MAC_BASE: + length = sprintf(value, "%02X:%02X:%02X:%02X:%02X:%02X", + tlv->value[0], tlv->value[1], tlv->value[2], + tlv->value[3], tlv->value[4], tlv->value[5]); + break; + case TLV_CODE_DEVICE_VERSION: + length = sprintf(value, "%u", tlv->value[0]); + break; + case TLV_CODE_MAC_SIZE: + length = sprintf(value, "%u", (tlv->value[0] << 8) | tlv->value[1]); + break; + #if 0 + case TLV_CODE_VENDOR_EXT: + value[0] = 0; + length = 0; + for (i = 0; (i < (TLV_DECODE_VALUE_MAX_LEN/5)) && (i < tlv->length); i++) { + length += sprintf(value, "%s 0x%02X", value, tlv->value[i]); + } + break; + #endif + case TLV_CODE_CRC_32: + length = sprintf(value, "0x%02X%02X%02X%02X", tlv->value[0], + tlv->value[1], tlv->value[2], tlv->value[3]); + break; + default: + value[0] = 0; + length = 0; + for (i = 0; (i < (TLV_DECODE_VALUE_MAX_LEN/5)) && (i < tlv->length); i++) { + length += sprintf(value, "%s 0x%02X", value, tlv->value[i]); + } + break; + } + + decode_value->length = length; +} + +/* + * is_checksum_valid + * + * Validate the checksum in the provided TlvInfo EEPROM data. First, + * verify that the TlvInfo header is valid, then make sure the last + * TLV is a CRC-32 TLV. Then calculate the CRC over the EEPROM data + * and compare it to the value stored in the EEPROM CRC-32 TLV. + */ +static bool is_checksum_valid(u_int8_t *eeprom) +{ + tlvinfo_header_t *eeprom_hdr; + tlvinfo_tlv_t *eeprom_crc; + unsigned int calc_crc; + unsigned int stored_crc; + + eeprom_hdr = (tlvinfo_header_t *) eeprom; + + // Is the eeprom header valid? + if (!is_valid_tlvinfo_header(eeprom_hdr)) { + return false; + } + + // Is the last TLV a CRC? + eeprom_crc = (tlvinfo_tlv_t *) &eeprom[sizeof(tlvinfo_header_t) + + be16_to_cpu(eeprom_hdr->totallen) - (sizeof(tlvinfo_tlv_t) + 4)]; + if ((eeprom_crc->type != TLV_CODE_CRC_32) || (eeprom_crc->length != 4)) { + return false; + } + + // Calculate the checksum + calc_crc = crc32(0xffffffffL, (const unsigned char *)eeprom, sizeof(tlvinfo_header_t) + + be16_to_cpu(eeprom_hdr->totallen) - 4); + stored_crc = ((eeprom_crc->value[0] << 24) | (eeprom_crc->value[1] << 16) | + (eeprom_crc->value[2] << 8) | eeprom_crc->value[3]); + + return (calc_crc == stored_crc); +} + +/* + * tlvinfo_find_tlv + * + * This function finds the TLV with the supplied code in the EERPOM. + * An offset from the beginning of the EEPROM is returned in the + * eeprom_index parameter if the TLV is found. + */ +static bool tlvinfo_find_tlv(u_int8_t *eeprom, u_int8_t tcode, int *eeprom_index) +{ + tlvinfo_header_t *eeprom_hdr; + tlvinfo_tlv_t *eeprom_tlv; + int eeprom_end; + + eeprom_hdr = (tlvinfo_header_t *) eeprom; + + // Search through the TLVs, looking for the first one which matches the + // supplied type code. + *eeprom_index = sizeof(tlvinfo_header_t); + eeprom_end = sizeof(tlvinfo_header_t) + be16_to_cpu(eeprom_hdr->totallen); + while (*eeprom_index < eeprom_end) { + eeprom_tlv = (tlvinfo_tlv_t *) &eeprom[*eeprom_index]; + if (!is_valid_tlv(eeprom_tlv)) { + return false; + } + + if (eeprom_tlv->type == tcode) { + return true; + } + + *eeprom_index += sizeof(tlvinfo_tlv_t) + eeprom_tlv->length; + } + + return false; +} + +/* + * tlvinfo_decode_tlv + * + * This function finds the TLV with the supplied code in the EERPOM + * and decodes the value into the buffer provided. + */ +static bool tlvinfo_decode_tlv(u_int8_t *eeprom, u_int8_t tcode, tlv_decode_value_t *decode_value) +{ + int eeprom_index; + tlvinfo_tlv_t *eeprom_tlv; + + // Find the TLV and then decode it + if (tlvinfo_find_tlv(eeprom, tcode, &eeprom_index)) { + eeprom_tlv = (tlvinfo_tlv_t *) &eeprom[eeprom_index]; + decode_tlv_value(eeprom_tlv, decode_value); + return true; + } + + return false; +} + +/* + * parse_tlv_eeprom + * + * parse the EEPROM into memory, if it hasn't already been read. + */ +int parse_tlv_eeprom(u_int8_t *eeprom, u_int32_t size) +{ + unsigned int i; + bool ret; + tlvinfo_header_t *eeprom_hdr; + //tlv_info_vec_t tlv_info; + tlv_decode_value_t decode_value; + int j; + + eeprom_hdr = (tlvinfo_header_t *) eeprom; + eeprom_size = size; /* eeprom real size */ + + if (!is_valid_tlvinfo_header(eeprom_hdr)) { + DBG_ERROR("Failed to check tlv header.\n"); + return -1; + } + + if (!is_checksum_valid(eeprom)) { + DBG_ERROR("Failed to check tlv crc.\n"); + return -1; + } + + for (i = 0; i < TLV_CODE_NUM; i++) { + mem_clear((void *)&decode_value, sizeof(tlv_decode_value_t)); + ret = tlvinfo_decode_tlv(eeprom, tlv_code_list[i].m_code, &decode_value); + if (!ret) { + DBG_ERROR("No found type: %s\n", tlv_code_list[i].m_name); + continue; + } + + DBG_DEBUG("i: %d,Found type: %s tlv[%d]:%s\n", i, tlv_code_list[i].m_name, tlv_code_list[i].m_code, + decode_value.value); + for (j = 0; j < decode_value.length; j++) { + if ((j % 16) == 0) { + DBG_DEBUG("\n"); + } + DBG_DEBUG("%02x ", decode_value.value[j]); + } + DBG_DEBUG("\n\n"); + } + return 0; +} +static int dfd_parse_tlv_eeprom(u_int8_t *eeprom, u_int32_t size, u_int8_t main_type, tlv_decode_value_t *decode_value) +{ + bool ret; + tlvinfo_header_t *eeprom_hdr; + //tlv_info_vec_t tlv_info; + int j; + + eeprom_hdr = (tlvinfo_header_t *) eeprom; + eeprom_size = size; /* eeprom real size */ + + if (!is_valid_tlvinfo_header(eeprom_hdr)) { + DBG_ERROR("Failed to check tlv header.\n"); + return -1; + } + + if (!is_checksum_valid(eeprom)) { + DBG_ERROR("Failed to check tlv crc.\n"); + return -1; + } + + ret = tlvinfo_decode_tlv(eeprom, main_type, decode_value); + if (!ret) { + DBG_ERROR("No found type: %d\n", main_type); + return -1; + } + + DBG_DEBUG("Found type: %d, value: %s\n", main_type,decode_value->value); + for (j = 0; j < decode_value->length; j++) { + if ((j % 16) == 0) { + DBG_DEBUG("\n"); + } + DBG_DEBUG("%02x ", decode_value->value[j]); + } + DBG_DEBUG("\n\n"); + + return 0; +} + +static int tlvinfo_find_wb_ext_tlv(tlv_decode_value_t *ext_tlv_value, u_int8_t ext_type, + u_int8_t *buf, u_int8_t *buf_len) +{ + tlvinfo_tlv_t *eeprom_tlv; + int eeprom_end, eeprom_index; + + // Search through the TLVs, looking for the first one which matches the + // supplied type code. + DBG_DEBUG("ext_tlv_value->length: %d.\n", ext_tlv_value->length); + for (eeprom_index = 0; eeprom_index < ext_tlv_value->length; eeprom_index++) { + if ((eeprom_index % 16) == 0) { + DBG_DEBUG("\n"); + } + DBG_DEBUG("%02x ", ext_tlv_value->value[eeprom_index]); + } + + DBG_DEBUG("\n"); + + eeprom_index = 0; + eeprom_end = ext_tlv_value->length; + while (eeprom_index < eeprom_end) { + eeprom_tlv = (tlvinfo_tlv_t *) &(ext_tlv_value->value[eeprom_index]); + if (!is_valid_tlv(eeprom_tlv)) { + DBG_ERROR("tlv is not valid, eeprom_tlv->type 0x%x.\n", eeprom_tlv->type); + return -1; + } + + DBG_DEBUG("eeprom_tlv->length %d.\n", eeprom_tlv->length); + if (eeprom_tlv->type == ext_type) { + if (*buf_len >= eeprom_tlv->length) { + memcpy(buf, eeprom_tlv->value, eeprom_tlv->length); + DBG_DEBUG("eeprom_tlv->length %d.\n", eeprom_tlv->length); + *buf_len = eeprom_tlv->length; + return 0; + } + DBG_ERROR("buf_len %d small than info_len %d.\n", *buf_len, eeprom_tlv->length); + return -1; + } + + eeprom_index += sizeof(tlvinfo_tlv_t) + eeprom_tlv->length; + } + + DBG_ERROR("ext_type %d: tlv is not found.\n", ext_type); + return -1; +} + +int dfd_tlvinfo_get_e2prom_info(u_int8_t *eeprom, u_int32_t size, dfd_tlv_type_t *tlv_type, u_int8_t* buf, u_int8_t *buf_len) +{ + tlv_decode_value_t decode_value; + int ret; + + if (eeprom == NULL || tlv_type == NULL || buf == NULL) { + DBG_ERROR("Input para invalid.\n"); + return -1; + } + + mem_clear((void *)&decode_value, sizeof(tlv_decode_value_t)); + ret = dfd_parse_tlv_eeprom(eeprom, size, tlv_type->main_type, &decode_value); + if (ret) { + DBG_ERROR("dfd_parse_tlv_eeprom failed ret %d.\n", ret); + return ret; + } + + if (tlv_type->main_type != TLV_CODE_VENDOR_EXT) { + if (*buf_len >= decode_value.length) { + memcpy(buf, decode_value.value, decode_value.length); + *buf_len = decode_value.length; + return 0; + } + DBG_ERROR("buf_len %d small than info_len %d.\n", *buf_len, decode_value.length); + return -1; + } + DBG_DEBUG("info_len %d.\n", decode_value.length); + + return tlvinfo_find_wb_ext_tlv(&decode_value, tlv_type->ext_type, buf, buf_len); +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.h new file mode 100644 index 000000000000..6eaac5848223 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/dfd_tlveeprom.h @@ -0,0 +1,121 @@ +#ifndef DFD_OPENBMC_TLVEEPROM_H +#define DFD_OPENBMC_TLVEEPROM_H + +#ifndef u_int8_t +#define u_int8_t unsigned char +#endif + +#ifndef u_int16_t +#define u_int16_t unsigned short +#endif + +#ifndef u_int32_t +#define u_int32_t unsigned int +#endif + +#ifndef be16_to_cpu +#define be16_to_cpu(x) ntohs(x) +#endif + +#ifndef cpu_to_be16 +#define cpu_to_be16(x) htons(x) +#endif + +/** + * The TLV Types. + * + * Keep these in sync with tlv_code_list in cmd_sys_eeprom.c + */ +#define TLV_CODE_PRODUCT_NAME 0x21 +#define TLV_CODE_PART_NUMBER 0x22 +#define TLV_CODE_SERIAL_NUMBER 0x23 +#define TLV_CODE_MAC_BASE 0x24 +#define TLV_CODE_MANUF_DATE 0x25 +#define TLV_CODE_DEVICE_VERSION 0x26 +#define TLV_CODE_LABEL_REVISION 0x27 +#define TLV_CODE_PLATFORM_NAME 0x28 +#define TLV_CODE_ONIE_VERSION 0x29 +#define TLV_CODE_MAC_SIZE 0x2A +#define TLV_CODE_MANUF_NAME 0x2B +#define TLV_CODE_MANUF_COUNTRY 0x2C +#define TLV_CODE_VENDOR_NAME 0x2D +#define TLV_CODE_DIAG_VERSION 0x2E +#define TLV_CODE_SERVICE_TAG 0x2F +#define TLV_CODE_VENDOR_EXT 0xFD +#define TLV_CODE_CRC_32 0xFE + +#define TLV_CODE_NAME_LEN 64 +/* + * Struct for displaying the TLV codes and names. + */ +struct tlv_code_desc { + u_int8_t m_code; + char m_name[TLV_CODE_NAME_LEN]; +}; + +typedef struct dfd_tlv_type_s { + u_int8_t main_type; + u_int8_t ext_type; +} dfd_tlv_type_t; + +// Header Field Constants +#define TLV_INFO_ID_STRING "TlvInfo" +#define TLV_INFO_VERSION 0x01 +/*#define TLV_TOTAL_LEN_MAX (XXXXXXXX - sizeof(tlvinfo_header_t))*/ + +struct __attribute__ ((__packed__)) tlvinfo_header_s { + char signature[8]; /* 0x00 - 0x07 EEPROM Tag "TlvInfo" */ + u_int8_t version; /* 0x08 Structure version */ + u_int16_t totallen; /* 0x09 - 0x0A Length of all data which follows */ +}; +typedef struct tlvinfo_header_s tlvinfo_header_t; + +/* + * TlvInfo TLV: Layout of a TLV field + */ +struct __attribute__ ((__packed__)) tlvinfo_tlv_s { + u_int8_t type; + u_int8_t length; + u_int8_t value[0]; +}; +typedef struct tlvinfo_tlv_s tlvinfo_tlv_t; + +#define TLV_VALUE_MAX_LEN 255 +/* + * The max decode value is currently for the 'raw' type or the 'vendor + * extension' type, both of which have the same decode format. The + * max decode string size is computed as follows: + * + * strlen(" 0xFF") * TLV_VALUE_MAX_LEN + 1 + * + */ +#define TLV_DECODE_VALUE_MAX_LEN ((5 * TLV_VALUE_MAX_LEN) + 1) + +typedef struct tlv_decode_value_s { + u_int8_t value[TLV_DECODE_VALUE_MAX_LEN]; + u_int32_t length; +} tlv_decode_value_t; + +typedef enum dfd_tlvinfo_ext_tlv_type_e { + DFD_TLVINFO_EXT_TLV_TYPE_DEV_TYPE = 1, +} dfd_tlvinfo_ext_tlv_type_t; + +#if 0 +#define TLV_TIME_LEN 64 + +int ipmi_tlv_validate_fru_area(const uint8_t fruid, const char *fru_file_name, + sd_bus *bus_type, const bool bmc_fru); + +extern const char *get_vpd_key_names(int key_id); +extern std::string getService(sdbusplus::bus::bus& bus, + const std::string& intf, + const std::string& path); +extern std::string getFRUValue(const std::string& section, + const std::string& key, + const std::string& delimiter, + IPMIFruInfo& fruData); +#endif + +int dfd_tlvinfo_get_e2prom_info(u_int8_t *eeprom, u_int32_t size, dfd_tlv_type_t *tlv_type, u_int8_t* buf, u_int8_t *buf_len); + +#endif /* endif DFD_OPENBMC_TLVEEPROM_H */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/fpga_i2c.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/fpga_i2c.h new file mode 100644 index 000000000000..649a8452debe --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/fpga_i2c.h @@ -0,0 +1,133 @@ +#ifndef _FPGA_I2C_H +#define _FPGA_I2C_H + +#include +#include +#include +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +#if 0 + +#define FPGA_I2C_EXT_9548_ADDR (0x00) +#define FPGA_I2C_EXT_9548_CHAN (0x04) +#define FPGA_I2C_DEV_SLAVE_ADDR (0x08) +#define FPGA_I2C_DEV_REG_ADDR (0x0C) +#define FPGA_I2C_DEV_RDWR_LEN (0x10) +#define FPGA_I2C_CTRL_REG (0x14) +#define FPGA_I2C_STATUS_REG (0x18) +#define FPGA_I2C_SCALE_REG (0x1C) +#define FPGA_I2C_FILTER_REG (0x20) +#define FPGA_I2C_STRETCH_REG (0x24) +#define FPGA_I2C_EXT_9548_EXITS_FLAG (0x28) +#define FPGA_I2C_INTERNAL_9548_CHAN (0x2C) +#define FPGA_I2C_RDWR_DATA_BUF (0x80) +#endif +#define FPGA_I2C_RDWR_MAX_LEN_DEFAULT (128) +#define I2C_REG_MAX_WIDTH (16) + +#define DEV_NAME_MAX_LEN (64) + +#define FPGA_I2C_MAX_TIMES (10) +#define FPGA_I2C_XFER_TIME_OUT (100000) +#define FPGA_I2C_SLEEP_TIME (40) + +typedef struct fpga_i2c_reg_s { + uint32_t i2c_scale; + uint32_t i2c_filter; + uint32_t i2c_stretch; + uint32_t i2c_ext_9548_exits_flag; + uint32_t i2c_ext_9548_addr; + uint32_t i2c_ext_9548_chan; + uint32_t i2c_in_9548_chan; + uint32_t i2c_slave; + uint32_t i2c_reg; + uint32_t i2c_reg_len; + uint32_t i2c_data_len; + uint32_t i2c_ctrl; + uint32_t i2c_status; + uint32_t i2c_err_vec; + uint32_t i2c_data_buf; + uint32_t i2c_data_buf_len; +} fpga_i2c_reg_t; + +typedef struct fpga_i2c_reset_cfg_s { + uint32_t i2c_adap_reset_flag; + uint32_t reset_addr; + uint32_t reset_on; + uint32_t reset_off; + uint32_t reset_delay_b; + uint32_t reset_delay; + uint32_t reset_delay_a; +} fpga_i2c_reset_cfg_t; + +typedef struct fpga_i2c_reg_addr_s { + uint8_t reg_addr_len; + uint8_t read_reg_addr[I2C_REG_MAX_WIDTH]; +} fpga_i2c_reg_addr_t; + +typedef struct fpga_i2c_dev_s { + fpga_i2c_reg_t reg; + fpga_i2c_reset_cfg_t reset_cfg; + fpga_i2c_reg_addr_t i2c_addr_desc; + const char *dev_name; + uint32_t i2c_scale_value; + uint32_t i2c_filter_value; + uint32_t i2c_stretch_value; + uint32_t i2c_timeout; + uint32_t i2c_func_mode; + wait_queue_head_t queue; + struct i2c_adapter adap; + int adap_nr; + struct device *dev; + bool i2c_params_check; +} fpga_i2c_dev_t; + +typedef struct fpga_i2c_bus_device_s { + int i2c_timeout; + int i2c_scale; + int i2c_filter; + int i2c_stretch; + int i2c_ext_9548_exits_flag; + int i2c_ext_9548_addr; + int i2c_ext_9548_chan; + int i2c_in_9548_chan; + int i2c_slave; + int i2c_reg; + int i2c_reg_len; + int i2c_data_len; + int i2c_ctrl; + int i2c_status; + int i2c_err_vec; + int i2c_data_buf; + int i2c_data_buf_len; + char dev_name[DEV_NAME_MAX_LEN]; + int adap_nr; + int i2c_scale_value; + int i2c_filter_value; + int i2c_stretch_value; + int i2c_func_mode; + int i2c_adap_reset_flag; + int i2c_reset_addr; + int i2c_reset_on; + int i2c_reset_off; + int i2c_rst_delay_b; /* delay time before reset(us) */ + int i2c_rst_delay; /* reset time(us) */ + int i2c_rst_delay_a; /* delay time after reset(us) */ + int device_flag; + bool i2c_params_check; + int i2c_data_buf_len_reg; + int i2c_offset_reg; +} fpga_i2c_bus_device_t; + +typedef struct fpga_pca954x_device_s { + struct i2c_client *client; + uint32_t i2c_bus; + uint32_t i2c_addr; + uint32_t fpga_9548_flag; + uint32_t fpga_9548_reset_flag; + uint32_t pca9548_base_nr; +} fpga_pca954x_device_t; + +#endif /* _FPGA_I2C_H */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/hw_test.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/hw_test.c new file mode 100644 index 000000000000..e74f4e800582 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/hw_test.c @@ -0,0 +1,608 @@ +/* + * hw_test.c + * Original Author : support, 2020-10-15 + * + * History + * v1.0 support 2020-10-15 Initial version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hw_test.h" + +extern struct bus_type mdio_bus_type; + +struct board_mdio_dev { + struct list_head list; + struct mii_bus *mdio_bus; + int mdio_index; +}; + +struct board_phy_dev { + struct list_head list; + struct phy_device *phydev; + int phy_index; +}; + +static LIST_HEAD(mdio_dev_list); +static LIST_HEAD(phydev_list); +static struct class *class_mdio_bus = NULL; + +#define PRINT_BUF_SIZE (256) +#define INVALID_PHY_ADDR (0xFF) +#define MAX_MDIO_DEVICE_NUMS (1000) +#define MAX_PHY_DEVICE_NUMS (1000) + +#define dram_debug(fmt, ...) \ + printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) + +static ssize_t dram_dev_read (struct file *file, char __user *buf, size_t count, + loff_t *offset) +{ + u8 value8; + u16 value16; + u32 value32; + + if (file->private_data != NULL) { + return -EINVAL; + } + + file->private_data = ioremap(file->f_pos, count); + + if (!file->private_data) { + pr_notice("%s, %d\n", __FUNCTION__, __LINE__); + return -ENODEV; + } + + rmb(); + switch (count) { + case 1: + value8 = readb(file->private_data); + if (copy_to_user(buf, &value8, sizeof(u8))) { + return -EFAULT; + } + break; + case 2: + value16 = readw(file->private_data); + if (copy_to_user(buf, &value16, sizeof(u16))) { + return -EFAULT; + } + break; + case 4: + value32 = readl(file->private_data); + if (copy_to_user(buf, &value32, sizeof(u32))) { + return -EFAULT; + } + break; + default: + return -EINVAL; + } + + iounmap(file->private_data); + file->private_data = NULL; + return count; + +} + +static ssize_t dram_dev_write (struct file *file, const char __user *buf, size_t count, + loff_t *offset) +{ + u8 value8; + u16 value16; + u32 value32; + + if (file->private_data != NULL) { + return -EINVAL; + } + + file->private_data = ioremap(file->f_pos, count); + + if (!file->private_data) { + pr_err("%s, %d\n", __FUNCTION__, __LINE__); + return -ENODEV; + } + + switch (count) { + case 1: + if (copy_from_user(&value8, buf, sizeof(u8))) { + return -EFAULT; + } + writeb(value8, file->private_data); + break; + case 2: + if (copy_from_user(&value16, buf, sizeof(u16))) { + return -EFAULT; + } + writew(value16, file->private_data); + break; + case 4: + if (copy_from_user(&value32, buf, sizeof(u32))) { + return -EFAULT; + } + writel(value32, file->private_data); + break; + default: + return -EINVAL; + } + + wmb(); + iounmap(file->private_data); + file->private_data = NULL; + return count; +} + +static loff_t dram_dev_llseek(struct file *file, loff_t offset, int origin) +{ + loff_t ret; + + switch (origin) { + case 0: + file->f_pos = offset; + ret = file->f_pos; + break; + case 1: + file->f_pos += offset; + ret = file->f_pos; + break; + default: + ret = -EINVAL; + } + return ret; +} + +static int temp_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum) +{ + return 0; +} + +static int temp_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum, u16 value) +{ + return 0; +} + +static int init_class_mdio_bus(void) +{ + struct mii_bus *bus; + int err = 0; + + bus = mdiobus_alloc(); + + bus->name = "temp_mdio_bus"; + snprintf(bus->id, MII_BUS_ID_SIZE, "temp_mdio_bus0"); + bus->read = temp_mdiobus_read; + bus->write = temp_mdiobus_write; + + err = mdiobus_register(bus); + if (err) { + printk(KERN_ERR "temp mdio bus register fail\n"); + return -1; + } + + class_mdio_bus = bus->dev.class; + mdiobus_unregister(bus); + + return 0; +} + +static int mdio_match_success(struct device *dev, const void * data) +{ + + return 1; +} + +static int add_all_mdio_devices_to_list(void) +{ + struct device *dev, *dev_start = NULL; + struct board_mdio_dev *mdio_dev = NULL; + int i = 0; + struct class *bus_class = class_mdio_bus; + + for (i = 0; i < MAX_MDIO_DEVICE_NUMS; i++) { + dev = class_find_device(bus_class, dev_start, NULL, mdio_match_success); + if (dev != NULL) { + mdio_dev = kzalloc(sizeof(struct board_mdio_dev), GFP_KERNEL); + if (mdio_dev == NULL) { + printk(KERN_ERR "%s: alloc fail\n", __func__); + return -EFAULT; + } + + mdio_dev->mdio_index = i; + mdio_dev->mdio_bus = to_mii_bus(dev); + list_add_tail(&mdio_dev->list, &mdio_dev_list); + + dev_start = dev; + } else { + break; + } + } + + printk(KERN_INFO "mdio dev numbers = %d\n", i); + + return 0; +} + +static void delete_all_mdio_devices_from_list(void) +{ + struct list_head *n, *pos; + struct board_mdio_dev *mdio_dev; + + list_for_each_safe(pos, n, &mdio_dev_list) { + list_del(pos); + mdio_dev = list_entry(pos, struct board_mdio_dev, list); + kfree(mdio_dev); + } + + return; +} + +void list_all_mdio_devices_info(void) +{ + struct board_mdio_dev *mdio_dev; + unsigned char phyaddr[PHY_MAX_ADDR]; + int i = 0, j = 0; + int phydev_num = 0; + char buf[PRINT_BUF_SIZE]; + int len = 0; + + printk(KERN_INFO "all the mdio devs info:\n"); + printk(KERN_INFO "index busid name phy_num phyaddr \n"); + list_for_each_entry(mdio_dev, &mdio_dev_list, list) { + i = 0; + j = 0; + phydev_num = 0; + mem_clear(phyaddr, INVALID_PHY_ADDR, sizeof(phyaddr)); + mem_clear(buf, 0, sizeof(buf)); + + for (i = 0; i < PHY_MAX_ADDR; i++) { + if (mdio_dev->mdio_bus->mdio_map[i]) { + phydev_num++; + phyaddr[j] = (unsigned char)i; + j++; + } + } + + len = snprintf(buf, sizeof(buf), " %-10d %-20s %-20s %-10d ", mdio_dev->mdio_index, + mdio_dev->mdio_bus->id, mdio_dev->mdio_bus->name, phydev_num); + + for (i = 0; i < PHY_MAX_ADDR; i++) { + if (phyaddr[i] == INVALID_PHY_ADDR) { + break; + } + + len += snprintf(&buf[len], sizeof(buf) - len, " %#x", phyaddr[i]); + } + + printk(KERN_INFO "%s\n", buf); + } + + return; +} + +static struct mii_bus *get_mdio_dev_according_to_index(int mdio_index) +{ + struct board_mdio_dev *mdio_dev; + list_for_each_entry(mdio_dev, &mdio_dev_list, list) { + if (mdio_dev->mdio_index == mdio_index) { + return mdio_dev->mdio_bus; + } + } + + printk(KERN_ERR "no exist the mdio dev it's mdio_index = %d, please exec cmd [hw_test.bin mdiodev_list] to view mdiodev info\n", + mdio_index); + + return NULL; +} + +int board_mdio_read(int mdio_index, int phyaddr, u32 regnum) +{ + struct mii_bus *bus; + int reg_val; + + bus = get_mdio_dev_according_to_index(mdio_index); + if (bus == NULL) { + return -1; + } + + reg_val = mdiobus_read(bus, phyaddr, regnum); + + return reg_val; +} + +int board_mdio_write(int mdio_index, int phyaddr, u32 regnum, u16 val) +{ + struct mii_bus *bus; + int ret; + + bus = get_mdio_dev_according_to_index(mdio_index); + if (bus == NULL) { + return -1; + } + + ret = mdiobus_write(bus, phyaddr, regnum, val); + + return ret; +} + +static int phy_match_success(struct device *dev, const void * data) +{ + + return 1; +} + +static int add_all_phydevs_to_list(void) +{ + struct device *dev, *dev_start = NULL; + struct board_phy_dev *board_phydev = NULL; + int i = 0; + + for (i = 0; i < MAX_PHY_DEVICE_NUMS; i++) { + dev = bus_find_device(&mdio_bus_type, dev_start, NULL, phy_match_success); + if (dev != NULL) { + board_phydev = kzalloc(sizeof(struct board_phy_dev), GFP_KERNEL); + if (board_phydev == NULL) { + printk(KERN_ERR "%s: alloc fail\n", __func__); + return -EFAULT; + } + + board_phydev->phy_index = i; + board_phydev->phydev = to_phy_device(dev); + list_add_tail(&board_phydev->list, &phydev_list); + + dev_start = dev; + } else { + break; + } + } + + printk(KERN_INFO "phydev num = %d\n", i); + + return 0; +} + +static void delete_all_phydevs_from_list(void) +{ + struct list_head *n, *pos; + struct board_phy_dev *board_phydev; + + list_for_each_safe(pos, n, &phydev_list) { + list_del(pos); + board_phydev = list_entry(pos, struct board_phy_dev, list); + kfree(board_phydev); + } + + return; +} + +void list_all_phydevs_info(void) +{ + struct board_phy_dev *board_phydev; + + printk(KERN_INFO "all the phydevs info:\n"); + printk(KERN_INFO "index phyaddr phyId phydev_name\n"); + list_for_each_entry(board_phydev, &phydev_list, list) { + printk(KERN_INFO " %-10d %#-10x %#-10x %-20s\n", board_phydev->phy_index, board_phydev->phydev->mdio.addr,\ + board_phydev->phydev->phy_id, dev_name(&board_phydev->phydev->mdio.dev)); + } + + return; +} + +static struct phy_device *get_phy_dev_according_to_index(int phy_index) +{ + struct board_phy_dev *board_phydev; + list_for_each_entry(board_phydev, &phydev_list, list) { + if (board_phydev->phy_index == phy_index) { + return board_phydev->phydev; + } + } + + printk(KERN_ERR "no exist the phydev it's phy_index = %d, please exec cmd [hw_test.bin phydev_list] to view phydev info\n", phy_index); + + return NULL; +} + +int board_phy_read(int phy_index, u32 regnum) +{ + struct phy_device *phydev; + int reg_val; + + phydev = get_phy_dev_according_to_index(phy_index); + if (phydev == NULL) { + return -1; + } + + reg_val = phy_read(phydev, regnum); + + return reg_val; +} + +int board_phy_write(int phy_index, u32 regnum, u16 val) +{ + struct phy_device *phydev; + int ret; + + phydev = get_phy_dev_according_to_index(phy_index); + if (phydev == NULL) { + return -1; + } + + ret = phy_write(phydev, regnum, val); + + return ret; +} + +static long dram_dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + void __user *argp = (void __user *)arg; + int ret = 0; + struct phydev_user_info phy_user_info; + struct mdio_dev_user_info mdio_user_info; + + switch (cmd) { + case CMD_PHY_LIST: + list_all_phydevs_info(); + break; + + case CMD_PHY_READ: + if (copy_from_user(&phy_user_info, argp, sizeof(struct phydev_user_info))) + return -EFAULT; + + ret = board_phy_read(phy_user_info.phy_index, phy_user_info.regnum); + if (ret < 0) { + return -EFAULT; + } + + phy_user_info.regval = (u32)ret; + + if (copy_to_user(argp, &phy_user_info, sizeof(struct phydev_user_info))) + return -EFAULT; + + break; + + case CMD_PHY_WRITE: + if (copy_from_user(&phy_user_info, argp, sizeof(struct phydev_user_info))) + return -EFAULT; + + ret = board_phy_write(phy_user_info.phy_index, phy_user_info.regnum, (u16)phy_user_info.regval); + if (ret < 0) { + return -EFAULT; + } + + break; + + case CMD_MDIO_LIST: + list_all_mdio_devices_info(); + break; + + case CMD_MDIO_READ: + if (copy_from_user(&mdio_user_info, argp, sizeof(struct mdio_dev_user_info))) + return -EFAULT; + + ret = board_mdio_read(mdio_user_info.mdio_index, mdio_user_info.phyaddr, mdio_user_info.regnum); + if (ret < 0) { + return -EFAULT; + } + + mdio_user_info.regval = (u32)ret; + + if (copy_to_user(argp, &mdio_user_info, sizeof(struct mdio_dev_user_info))) + return -EFAULT; + + break; + + case CMD_MDIO_WRITE: + if (copy_from_user(&mdio_user_info, argp, sizeof(struct mdio_dev_user_info))) + return -EFAULT; + + ret = board_mdio_write(mdio_user_info.mdio_index, mdio_user_info.phyaddr, mdio_user_info.regnum, (u16)mdio_user_info.regval); + if (ret < 0) { + return -EFAULT; + } + + break; + + default: + printk("unknown ioctl cmd\n"); + break; + } + + return 0; +} + +static int dram_dev_open(struct inode *inode, struct file *file) +{ + file->private_data = NULL; + file->f_pos = 0; + return 0; + +} + +static int dram_dev_release(struct inode *inode, struct file *file) +{ + if (file->private_data) { + iounmap(file->private_data); + } + return 0; +} + +static const struct file_operations dram_dev_fops = { + .owner = THIS_MODULE, + .llseek = dram_dev_llseek, + .read = dram_dev_read, + .write = dram_dev_write, + .unlocked_ioctl = dram_dev_ioctl, + .open = dram_dev_open, + .release = dram_dev_release, +}; + +static struct miscdevice dram_dev = { + .minor = MISC_DYNAMIC_MINOR, + .name = "dram_test", + .fops = &dram_dev_fops, +}; + +static int __init dram_init(void) +{ + if (add_all_phydevs_to_list() != 0) { + printk(KERN_ERR "add all phydev to list fail\n"); + delete_all_phydevs_from_list(); + return -ENXIO; + } + + if (init_class_mdio_bus() == 0) { + if (add_all_mdio_devices_to_list() == -EFAULT) { + printk(KERN_ERR "add all mdiodev to list fail\n"); + delete_all_mdio_devices_from_list(); + delete_all_phydevs_from_list(); + return -ENXIO; + } + } + + if (misc_register(&dram_dev) != 0) { + pr_notice("Register %s failed.\n", dram_dev.name); + delete_all_mdio_devices_from_list(); + delete_all_phydevs_from_list(); + return -ENXIO; + } + + return 0; +} + +static void __exit dram_exit(void) +{ + misc_deregister(&dram_dev); + + delete_all_mdio_devices_from_list(); + delete_all_phydevs_from_list(); +} + +module_init(dram_init); +module_exit(dram_exit); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/hw_test.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/hw_test.h new file mode 100644 index 000000000000..695fa336c4ff --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/hw_test.h @@ -0,0 +1,31 @@ + +#ifndef _LINUX_DRAM_DRIVER_H +#define _LINUX_DRAM_DRIVER_H + +#include +#include + +#define mem_clear(data, val, size) memset((data), val, (size)) + +struct phydev_user_info { + int phy_index; + u32 regnum; + u32 regval; +}; + +#define CMD_PHY_LIST _IOR('P', 0, struct phydev_user_info) +#define CMD_PHY_READ _IOR('P', 1, struct phydev_user_info) +#define CMD_PHY_WRITE _IOR('P', 2, struct phydev_user_info) + +struct mdio_dev_user_info { + int mdio_index; + int phyaddr; + u32 regnum; + u32 regval; +}; + +#define CMD_MDIO_LIST _IOR('M', 0, struct mdio_dev_user_info) +#define CMD_MDIO_READ _IOR('M', 1, struct mdio_dev_user_info) +#define CMD_MDIO_WRITE _IOR('M', 2, struct mdio_dev_user_info) + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/Makefile new file mode 100644 index 000000000000..a3da5aadf5ab --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/Makefile @@ -0,0 +1,36 @@ +PWD = $(shell pwd) + +EXTRA_CFLAGS:= -I$(M)/include +EXTRA_CFLAGS+= -Wall +#ifdef ENABLE_GCOV +#ifeq ($(ENABLE_GCOV), y) +#EXTRA_CFLAGS+= -fprofile-arcs -ftest-coverage -lgcov +#endif +#endif # ENABLE_GCOV + +obj-m := wb_lm75.o +obj-m += wb_tmp401.o +obj-m += wb_i2c_mux_pca9641.o +obj-m += wb_i2c_mux_pca954x.o +obj-m += wb_i2c_i801.o +obj-m += wb_i2c_algo_bit.o +obj-m += wb_i2c_gpio.o +obj-m += wb_i2c_gpio_device.o +obj-m += wb_pmbus_core.o +obj-m += wb_csu550.o +obj-m += wb_ina3221.o +obj-m += wb_isl68137.o +obj-m += wb_tps53622.o +obj-m += wb_ucd9000.o +obj-m += wb_xdpe12284.o +obj-m += wb_xdpe132g5c_pmbus.o +obj-m += wb_i2c_ismt.o + +all: + $(MAKE) -C $(KERNEL_SRC)/build M=$(PWD) modules + @if [ ! -d $(module_out_put_dir) ]; then mkdir -p $(module_out_put_dir) ;fi + cp -p $(PWD)/*.ko $(module_out_put_dir) +clean: + rm -f $(PWD)/*.o $(PWD)/*.ko $(PWD)/*.mod.c $(PWD)/.*.cmd $(PWD)/*.mod + rm -f $(PWD)/Module.markers $(PWD)/Module.symvers $(PWD)/modules.order + rm -rf $(PWD)/.tmp_versions diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_csu550.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_csu550.c new file mode 100644 index 000000000000..36d07f071a71 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_csu550.c @@ -0,0 +1,236 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Hardware monitoring driver for PMBus devices + * + * Copyright (c) 2010, 2011 Ericsson AB. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "wb_pmbus.h" + +struct pmbus_device_info { + int pages; + u32 flags; +}; + +static const struct i2c_device_id pmbus_id[]; + +/* + * Find sensor groups and status registers on each page. + */ +static void pmbus_find_sensor_groups(struct i2c_client *client, + struct pmbus_driver_info *info) +{ + int page; + + /* Sensors detected on page 0 only */ + if (wb_pmbus_check_word_register(client, 0, PMBUS_READ_VIN)) + info->func[0] |= PMBUS_HAVE_VIN; + if (wb_pmbus_check_word_register(client, 0, PMBUS_READ_IIN)) + info->func[0] |= PMBUS_HAVE_IIN; + if (wb_pmbus_check_word_register(client, 0, PMBUS_READ_PIN)) + info->func[0] |= PMBUS_HAVE_PIN; + if (info->func[0] + && wb_pmbus_check_byte_register(client, 0, PMBUS_STATUS_INPUT)) + info->func[0] |= PMBUS_HAVE_STATUS_INPUT; + if (wb_pmbus_check_byte_register(client, 0, PMBUS_FAN_CONFIG_12) && + wb_pmbus_check_word_register(client, 0, PMBUS_READ_FAN_SPEED_1)) { + info->func[0] |= PMBUS_HAVE_FAN12; + if (wb_pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_12)) + info->func[0] |= PMBUS_HAVE_STATUS_FAN12; + } + if (wb_pmbus_check_byte_register(client, 0, PMBUS_FAN_CONFIG_34) && + wb_pmbus_check_word_register(client, 0, PMBUS_READ_FAN_SPEED_3)) { + info->func[0] |= PMBUS_HAVE_FAN34; + if (wb_pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_34)) + info->func[0] |= PMBUS_HAVE_STATUS_FAN34; + } + if (wb_pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_1)) + info->func[0] |= PMBUS_HAVE_TEMP; + if (wb_pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_2)) + info->func[0] |= PMBUS_HAVE_TEMP2; + if (wb_pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_3)) + info->func[0] |= PMBUS_HAVE_TEMP3; + if (info->func[0] & (PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 + | PMBUS_HAVE_TEMP3) + && wb_pmbus_check_byte_register(client, 0, + PMBUS_STATUS_TEMPERATURE)) + info->func[0] |= PMBUS_HAVE_STATUS_TEMP; + + /* Sensors detected on all pages */ + for (page = 0; page < info->pages; page++) { + if (wb_pmbus_check_word_register(client, page, PMBUS_READ_VOUT)) { + info->func[page] |= PMBUS_HAVE_VOUT; + if (wb_pmbus_check_byte_register(client, page, + PMBUS_STATUS_VOUT)) + info->func[page] |= PMBUS_HAVE_STATUS_VOUT; + } + if (wb_pmbus_check_word_register(client, page, PMBUS_READ_IOUT)) { + info->func[page] |= PMBUS_HAVE_IOUT; + if (wb_pmbus_check_byte_register(client, 0, + PMBUS_STATUS_IOUT)) + info->func[page] |= PMBUS_HAVE_STATUS_IOUT; + } + if (wb_pmbus_check_word_register(client, page, PMBUS_READ_POUT)) + info->func[page] |= PMBUS_HAVE_POUT; + } +} + +/* + * Identify chip parameters. + */ +static int pmbus_identify(struct i2c_client *client, + struct pmbus_driver_info *info) +{ + int ret = 0; + + if (!info->pages) { + /* + * Check if the PAGE command is supported. If it is, + * keep setting the page number until it fails or until the + * maximum number of pages has been reached. Assume that + * this is the number of pages supported by the chip. + */ + if (wb_pmbus_check_byte_register(client, 0, PMBUS_PAGE)) { + int page; + + for (page = 1; page < PMBUS_PAGES; page++) { + if (wb_pmbus_set_page(client, page, 0xff) < 0) + break; + } + wb_pmbus_set_page(client, 0, 0xff); + info->pages = page; + } else { + info->pages = 1; + } + + wb_pmbus_clear_faults(client); + } + + if (wb_pmbus_check_byte_register(client, 0, PMBUS_VOUT_MODE)) { + int vout_mode, i; + + vout_mode = wb_pmbus_read_byte_data(client, 0, PMBUS_VOUT_MODE); + if (vout_mode >= 0 && vout_mode != 0xff) { + switch (vout_mode >> 5) { + case 0: + break; + case 1: + info->format[PSC_VOLTAGE_OUT] = vid; + for (i = 0; i < info->pages; i++) + info->vrm_version[i] = vr11; + break; + case 2: + info->format[PSC_VOLTAGE_OUT] = direct; + break; + default: + ret = -ENODEV; + goto abort; + } + } + } + + /* + * We should check if the COEFFICIENTS register is supported. + * If it is, and the chip is configured for direct mode, we can read + * the coefficients from the chip, one set per group of sensor + * registers. + * + * To do this, we will need access to a chip which actually supports the + * COEFFICIENTS command, since the command is too complex to implement + * without testing it. Until then, abort if a chip configured for direct + * mode was detected. + */ + if (info->format[PSC_VOLTAGE_OUT] == direct) { + ret = -ENODEV; + goto abort; + } + + /* Try to find sensor groups */ + pmbus_find_sensor_groups(client, info); +abort: + return ret; +} + +static int pmbus_probe(struct i2c_client *client) +{ + struct pmbus_driver_info *info; + struct pmbus_platform_data *pdata = NULL; + struct device *dev = &client->dev; + struct pmbus_device_info *device_info; + + info = devm_kzalloc(dev, sizeof(struct pmbus_driver_info), GFP_KERNEL); + if (!info) + return -ENOMEM; + + device_info = (struct pmbus_device_info *)i2c_match_id(pmbus_id, client)->driver_data; + if (device_info->flags & PMBUS_SKIP_STATUS_CHECK) { + pdata = devm_kzalloc(dev, sizeof(struct pmbus_platform_data), + GFP_KERNEL); + if (!pdata) + return -ENOMEM; + + pdata->flags = PMBUS_SKIP_STATUS_CHECK; + } + + info->pages = device_info->pages; + info->identify = pmbus_identify; + dev->platform_data = pdata; + + return wb_pmbus_do_probe(client, info); +} + +static const struct pmbus_device_info pmbus_info_one = { + .pages = 1, + .flags = 0 +}; + +static const struct pmbus_device_info pmbus_info_zero = { + .pages = 0, + .flags = 0 +}; + +static const struct pmbus_device_info pmbus_info_one_skip = { + .pages = 1, + .flags = PMBUS_SKIP_STATUS_CHECK +}; + +static const struct pmbus_device_info pmbus_info_zero_skip = { + .pages = 0, + .flags = PMBUS_SKIP_STATUS_CHECK +}; +/* + * Use driver_data to set the number of pages supported by the chip. + */ +static const struct i2c_device_id pmbus_id[] = { + {"wb_csu550", (kernel_ulong_t)&pmbus_info_zero_skip}, + {"wb_csu800", (kernel_ulong_t)&pmbus_info_one_skip}, + {"wb_fsp1200", (kernel_ulong_t)&pmbus_info_one_skip}, + {"wb_dps550", (kernel_ulong_t)&pmbus_info_one_skip}, + {} +}; + +MODULE_DEVICE_TABLE(i2c, pmbus_id); + +/* This is the driver that will be inserted */ +static struct i2c_driver pmbus_driver = { + .driver = { + .name = "wb_pmbus", + }, + .probe_new = pmbus_probe, + .remove = wb_pmbus_do_remove, + .id_table = pmbus_id, +}; + +module_i2c_driver(pmbus_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("Generic PMBus driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_algo_bit.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_algo_bit.c new file mode 100644 index 000000000000..c98ac7a1c5b6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_algo_bit.c @@ -0,0 +1,725 @@ +/* ------------------------------------------------------------------------- + * i2c-algo-bit.c i2c driver algorithms for bit-shift adapters + * ------------------------------------------------------------------------- + * Copyright (C) 1995-2000 Simon G. Vogl + + 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. + * ------------------------------------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include + +static int g_i2c_algo_bit_debug = 0; +static int g_i2c_algo_bit_error = 0; + +module_param(g_i2c_algo_bit_debug, int, S_IRUGO | S_IWUSR); +module_param(g_i2c_algo_bit_error, int, S_IRUGO | S_IWUSR); + +#define I2C_ALGO_BIT_DEBUG(fmt, args...) do { \ + if (g_i2c_algo_bit_debug) { \ + printk(KERN_INFO "[I2C_ALGO_BIT][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define I2C_ALGO_BIT_ERROR(fmt, args...) do { \ + if (g_i2c_algo_bit_error) { \ + printk(KERN_ERR "[I2C_ALGO_BIT][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +/* ----- global defines ----------------------------------------------- */ + +#ifdef DEBUG +#define bit_dbg(level, dev, format, args...) \ + do { \ + if (i2c_debug >= level) \ + dev_dbg(dev, format, ##args); \ + } while (0) +#else +#define bit_dbg(level, dev, format, args...) \ + do {} while (0) +#endif /* DEBUG */ + +/* ----- global variables --------------------------------------------- */ + +static int bit_test; /* see if the line-setting functions work */ +module_param(bit_test, int, S_IRUGO); +MODULE_PARM_DESC(bit_test, "lines testing - 0 off; 1 report; 2 fail if stuck"); + +#ifdef DEBUG +static int i2c_debug = 1; +module_param(i2c_debug, int, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(i2c_debug, + "debug level - 0 off; 1 normal; 2 verbose; 3 very verbose"); +#endif + +/* --- setting states on the bus with the right timing: --------------- */ + +#define setsda(adap, val) adap->setsda(adap->data, val) +#define setscl(adap, val) adap->setscl(adap->data, val) +#define getsda(adap) adap->getsda(adap->data) +#define getscl(adap) adap->getscl(adap->data) + +static inline void sdalo(struct i2c_algo_bit_data *adap) +{ + setsda(adap, 0); + udelay((adap->udelay + 1) / 2); +} + +static inline void sdahi(struct i2c_algo_bit_data *adap) +{ + setsda(adap, 1); + udelay((adap->udelay + 1) / 2); +} + +static inline void scllo(struct i2c_algo_bit_data *adap) +{ + setscl(adap, 0); + udelay(adap->udelay / 2); +} + +/* + * Raise scl line, and do checking for delays. This is necessary for slower + * devices. + */ +static int sclhi(struct i2c_algo_bit_data *adap) +{ + unsigned long start; + + setscl(adap, 1); + + /* Not all adapters have scl sense line... */ + if (!adap->getscl) + goto done; + + start = jiffies; + while (!getscl(adap)) { + /* This hw knows how to read the clock line, so we wait + * until it actually gets high. This is safer as some + * chips may hold it low ("clock stretching") while they + * are processing data internally. + */ + if (time_after(jiffies, start + adap->timeout)) { + /* Test one last time, as we may have been preempted + * between last check and timeout test. + */ + if (getscl(adap)) + break; + return -ETIMEDOUT; + } + cpu_relax(); + } +#ifdef DEBUG + if (jiffies != start && i2c_debug >= 3) + pr_debug("i2c-algo-bit: needed %ld jiffies for SCL to go " + "high\n", jiffies - start); +#endif + +done: + udelay(adap->udelay); + return 0; +} + +/* --- other auxiliary functions -------------------------------------- */ +static void i2c_start(struct i2c_algo_bit_data *adap) +{ + /* assert: scl, sda are high */ + setsda(adap, 0); + udelay(adap->udelay); + scllo(adap); +} + +static void i2c_repstart(struct i2c_algo_bit_data *adap) +{ + /* assert: scl is low */ + sdahi(adap); + sclhi(adap); + setsda(adap, 0); + udelay(adap->udelay); + scllo(adap); +} + +static void i2c_stop(struct i2c_algo_bit_data *adap) +{ + /* assert: scl is low */ + sdalo(adap); + sclhi(adap); + setsda(adap, 1); + udelay(adap->udelay); +} + +/* send a byte without start cond., look for arbitration, + check ackn. from slave */ +/* returns: + * 1 if the device acknowledged + * 0 if the device did not ack + * -ETIMEDOUT if an error occurred (while raising the scl line) + */ +static int i2c_outb(struct i2c_adapter *i2c_adap, unsigned char c) +{ + int i; + int sb; + int ack; + struct i2c_algo_bit_data *adap = i2c_adap->algo_data; + + /* assert: scl is low */ + for (i = 7; i >= 0; i--) { + sb = (c >> i) & 1; + setsda(adap, sb); + udelay((adap->udelay + 1) / 2); + if (sclhi(adap) < 0) { /* timed out */ + bit_dbg(1, &i2c_adap->dev, "i2c_outb: 0x%02x, " + "timeout at bit #%d\n", (int)c, i); + return -ETIMEDOUT; + } + /* FIXME do arbitration here: + * if (sb && !getsda(adap)) -> ouch! Get out of here. + * + * Report a unique code, so higher level code can retry + * the whole (combined) message and *NOT* issue STOP. + */ + scllo(adap); + } + sdahi(adap); + if (sclhi(adap) < 0) { /* timeout */ + bit_dbg(1, &i2c_adap->dev, "i2c_outb: 0x%02x, " + "timeout at ack\n", (int)c); + return -ETIMEDOUT; + } + + /* read ack: SDA should be pulled down by slave, or it may + * NAK (usually to report problems with the data we wrote). + */ + ack = !getsda(adap); /* ack: sda is pulled low -> success */ + bit_dbg(2, &i2c_adap->dev, "i2c_outb: 0x%02x %s\n", (int)c, + ack ? "A" : "NA"); + + scllo(adap); + return ack; + /* assert: scl is low (sda undef) */ +} + +static int i2c_inb(struct i2c_adapter *i2c_adap) +{ + /* read byte via i2c port, without start/stop sequence */ + /* acknowledge is sent in i2c_read. */ + int i; + unsigned char indata = 0; + struct i2c_algo_bit_data *adap = i2c_adap->algo_data; + + /* assert: scl is low */ + sdahi(adap); + for (i = 0; i < 8; i++) { + if (sclhi(adap) < 0) { /* timeout */ + bit_dbg(1, &i2c_adap->dev, "i2c_inb: timeout at bit " + "#%d\n", 7 - i); + return -ETIMEDOUT; + } + indata *= 2; + if (getsda(adap)) + indata |= 0x01; + setscl(adap, 0); + udelay(i == 7 ? adap->udelay / 2 : adap->udelay); + } + /* assert: scl is low */ + return indata; +} + +/* + * Sanity check for the adapter hardware - check the reaction of + * the bus lines only if it seems to be idle. + */ +static int test_bus(struct i2c_adapter *i2c_adap) +{ + struct i2c_algo_bit_data *adap = i2c_adap->algo_data; + const char *name = i2c_adap->name; + int scl, sda, ret; + + if (adap->pre_xfer) { + ret = adap->pre_xfer(i2c_adap); + if (ret < 0) + return -ENODEV; + } + + if (adap->getscl == NULL) + pr_info("%s: Testing SDA only, SCL is not readable\n", name); + + sda = getsda(adap); + scl = (adap->getscl == NULL) ? 1 : getscl(adap); + if (!scl || !sda) { + printk(KERN_WARNING + "%s: bus seems to be busy (scl=%d, sda=%d)\n", + name, scl, sda); + goto bailout; + } + + sdalo(adap); + sda = getsda(adap); + scl = (adap->getscl == NULL) ? 1 : getscl(adap); + if (sda) { + printk(KERN_WARNING "%s: SDA stuck high!\n", name); + goto bailout; + } + if (!scl) { + printk(KERN_WARNING "%s: SCL unexpected low " + "while pulling SDA low!\n", name); + goto bailout; + } + + sdahi(adap); + sda = getsda(adap); + scl = (adap->getscl == NULL) ? 1 : getscl(adap); + if (!sda) { + printk(KERN_WARNING "%s: SDA stuck low!\n", name); + goto bailout; + } + if (!scl) { + printk(KERN_WARNING "%s: SCL unexpected low " + "while pulling SDA high!\n", name); + goto bailout; + } + + scllo(adap); + sda = getsda(adap); + scl = (adap->getscl == NULL) ? 0 : getscl(adap); + if (scl) { + printk(KERN_WARNING "%s: SCL stuck high!\n", name); + goto bailout; + } + if (!sda) { + printk(KERN_WARNING "%s: SDA unexpected low " + "while pulling SCL low!\n", name); + goto bailout; + } + + sclhi(adap); + sda = getsda(adap); + scl = (adap->getscl == NULL) ? 1 : getscl(adap); + if (!scl) { + printk(KERN_WARNING "%s: SCL stuck low!\n", name); + goto bailout; + } + if (!sda) { + printk(KERN_WARNING "%s: SDA unexpected low " + "while pulling SCL high!\n", name); + goto bailout; + } + + if (adap->post_xfer) + adap->post_xfer(i2c_adap); + + pr_info("%s: Test OK\n", name); + return 0; +bailout: + sdahi(adap); + sclhi(adap); + + if (adap->post_xfer) + adap->post_xfer(i2c_adap); + + return -ENODEV; +} + +/* ----- Utility functions + */ + +/* try_address tries to contact a chip for a number of + * times before it gives up. + * return values: + * 1 chip answered + * 0 chip did not answer + * -x transmission error + */ +static int try_address(struct i2c_adapter *i2c_adap, + unsigned char addr, int retries) +{ + struct i2c_algo_bit_data *adap = i2c_adap->algo_data; + int i, ret = 0; + + for (i = 0; i <= retries; i++) { + ret = i2c_outb(i2c_adap, addr); + if (ret == 1 || i == retries) + break; + bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n"); + i2c_stop(adap); + udelay(adap->udelay); + yield(); + bit_dbg(3, &i2c_adap->dev, "emitting start condition\n"); + i2c_start(adap); + } + if (i && ret) + bit_dbg(1, &i2c_adap->dev, "Used %d tries to %s client at " + "0x%02x: %s\n", i + 1, + addr & 1 ? "read from" : "write to", addr >> 1, + ret == 1 ? "success" : "failed, timeout?"); + return ret; +} + +static int sendbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) +{ + const unsigned char *temp = msg->buf; + int count = msg->len; + unsigned short nak_ok = msg->flags & I2C_M_IGNORE_NAK; + int retval; + int wrcount = 0; + + while (count > 0) { + retval = i2c_outb(i2c_adap, *temp); + + /* OK/ACK; or ignored NAK */ + if ((retval > 0) || (nak_ok && (retval == 0))) { + count--; + temp++; + wrcount++; + + /* A slave NAKing the master means the slave didn't like + * something about the data it saw. For example, maybe + * the SMBus PEC was wrong. + */ + } else if (retval == 0) { + dev_err(&i2c_adap->dev, "sendbytes: NAK bailout.\n"); + return -EIO; + + /* Timeout; or (someday) lost arbitration + * + * FIXME Lost ARB implies retrying the transaction from + * the first message, after the "winning" master issues + * its STOP. As a rule, upper layer code has no reason + * to know or care about this ... it is *NOT* an error. + */ + } else { + dev_err(&i2c_adap->dev, "sendbytes: error %d\n", + retval); + return retval; + } + } + return wrcount; +} + +static int acknak(struct i2c_adapter *i2c_adap, int is_ack) +{ + struct i2c_algo_bit_data *adap = i2c_adap->algo_data; + + /* assert: sda is high */ + if (is_ack) /* send ack */ + setsda(adap, 0); + udelay((adap->udelay + 1) / 2); + if (sclhi(adap) < 0) { /* timeout */ + dev_err(&i2c_adap->dev, "readbytes: ack/nak timeout\n"); + return -ETIMEDOUT; + } + scllo(adap); + return 0; +} + +static int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) +{ + int inval; + int rdcount = 0; /* counts bytes read */ + unsigned char *temp = msg->buf; + int count = msg->len; + const unsigned flags = msg->flags; + + while (count > 0) { + inval = i2c_inb(i2c_adap); + if (inval >= 0) { + *temp = inval; + rdcount++; + } else { /* read timed out */ + break; + } + + temp++; + count--; + + /* Some SMBus transactions require that we receive the + transaction length as the first read byte. */ + if (rdcount == 1 && (flags & I2C_M_RECV_LEN)) { + if (inval <= 0 || inval > I2C_SMBUS_BLOCK_MAX) { + if (!(flags & I2C_M_NO_RD_ACK)) + acknak(i2c_adap, 0); + dev_err(&i2c_adap->dev, "readbytes: invalid " + "block length (%d)\n", inval); + return -EPROTO; + } + /* The original count value accounts for the extra + bytes, that is, either 1 for a regular transaction, + or 2 for a PEC transaction. */ + count += inval; + msg->len += inval; + } + + bit_dbg(2, &i2c_adap->dev, "readbytes: 0x%02x %s\n", + inval, + (flags & I2C_M_NO_RD_ACK) + ? "(no ack/nak)" + : (count ? "A" : "NA")); + + if (!(flags & I2C_M_NO_RD_ACK)) { + inval = acknak(i2c_adap, count); + if (inval < 0) + return inval; + } + } + return rdcount; +} + +/* doAddress initiates the transfer by generating the start condition (in + * try_address) and transmits the address in the necessary format to handle + * reads, writes as well as 10bit-addresses. + * returns: + * 0 everything went okay, the chip ack'ed, or IGNORE_NAK flag was set + * -x an error occurred (like: -ENXIO if the device did not answer, or + * -ETIMEDOUT, for example if the lines are stuck...) + */ +static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg) +{ + unsigned short flags = msg->flags; + unsigned short nak_ok = msg->flags & I2C_M_IGNORE_NAK; + struct i2c_algo_bit_data *adap = i2c_adap->algo_data; + + unsigned char addr; + int ret, retries; + + retries = nak_ok ? 0 : i2c_adap->retries; + + if (flags & I2C_M_TEN) { + /* a ten bit address */ + addr = 0xf0 | ((msg->addr >> 7) & 0x06); + bit_dbg(2, &i2c_adap->dev, "addr0: %d\n", addr); + /* try extended address code...*/ + ret = try_address(i2c_adap, addr, retries); + if ((ret != 1) && !nak_ok) { + dev_err(&i2c_adap->dev, + "died at extended address code\n"); + return -ENXIO; + } + /* the remaining 8 bit address */ + ret = i2c_outb(i2c_adap, msg->addr & 0xff); + if ((ret != 1) && !nak_ok) { + /* the chip did not ack / xmission error occurred */ + dev_err(&i2c_adap->dev, "died at 2nd address code\n"); + return -ENXIO; + } + if (flags & I2C_M_RD) { + bit_dbg(3, &i2c_adap->dev, "emitting repeated " + "start condition\n"); + i2c_repstart(adap); + /* okay, now switch into reading mode */ + addr |= 0x01; + ret = try_address(i2c_adap, addr, retries); + if ((ret != 1) && !nak_ok) { + dev_err(&i2c_adap->dev, + "died at repeated address code\n"); + return -EIO; + } + } + } else { /* normal 7bit address */ + addr = msg->addr << 1; + if (flags & I2C_M_RD) + addr |= 1; + if (flags & I2C_M_REV_DIR_ADDR) + addr ^= 1; + ret = try_address(i2c_adap, addr, retries); + if ((ret != 1) && !nak_ok) + return -ENXIO; + } + + return 0; +} + +static void bit_i2c_unblock(struct i2c_adapter *i2c_adap) +{ + int i; + struct i2c_algo_bit_data *adap = i2c_adap->algo_data; + + for (i = 0; i < 9; i++) { + setscl(adap, 0); + udelay(5); + setscl(adap, 1); + udelay(5); + } + setscl(adap, 0); + setsda(adap, 0); + udelay(5); + setscl(adap, 1); + udelay(5); + setsda(adap, 1); +} + +static int check_bit_i2c_unblock(struct i2c_adapter *i2c_adap) +{ + struct i2c_algo_bit_data *adap = i2c_adap->algo_data; + int sda, scl; + + sda = getsda(adap); + scl = getscl(adap); + if ((sda == 0) && scl) { + I2C_ALGO_BIT_ERROR("SCL is high and SDA is low, send 9 clock to device.\n"); + bit_i2c_unblock(i2c_adap); + } + + sda = getsda(adap); + scl = getscl(adap); + if (sda && scl) { + I2C_ALGO_BIT_DEBUG("SCL and SDA are both high, i2c level check ok.\n"); + return 0; + } + dev_warn(&i2c_adap->dev, "Check i2c level failed, SCL %s, SDA %s.\n", scl ? "high" : "low", sda ? "high" : "low"); + return -EIO; +} + +static int bit_xfer(struct i2c_adapter *i2c_adap, + struct i2c_msg msgs[], int num) +{ + struct i2c_msg *pmsg; + struct i2c_algo_bit_data *adap = i2c_adap->algo_data; + int i, ret; + unsigned short nak_ok; + + if (adap->pre_xfer) { + ret = adap->pre_xfer(i2c_adap); + if (ret < 0) + return ret; + } + + if (check_bit_i2c_unblock(i2c_adap) < 0) { + I2C_ALGO_BIT_ERROR("check i2c is block.\n"); + return -EIO; + } + + bit_dbg(3, &i2c_adap->dev, "emitting start condition\n"); + i2c_start(adap); + for (i = 0; i < num; i++) { + pmsg = &msgs[i]; + nak_ok = pmsg->flags & I2C_M_IGNORE_NAK; + if (!(pmsg->flags & I2C_M_NOSTART)) { + if (i) { + bit_dbg(3, &i2c_adap->dev, "emitting " + "repeated start condition\n"); + i2c_repstart(adap); + } + ret = bit_doAddress(i2c_adap, pmsg); + if ((ret != 0) && !nak_ok) { + bit_dbg(1, &i2c_adap->dev, "NAK from " + "device addr 0x%02x msg #%d\n", + msgs[i].addr, i); + goto bailout; + } + } + if (pmsg->flags & I2C_M_RD) { + /* read bytes into buffer*/ + ret = readbytes(i2c_adap, pmsg); + if (ret >= 1) + bit_dbg(2, &i2c_adap->dev, "read %d byte%s\n", + ret, ret == 1 ? "" : "s"); + if (ret < pmsg->len) { + if (ret >= 0) + ret = -EIO; + goto bailout; + } + } else { + /* write bytes from buffer */ + ret = sendbytes(i2c_adap, pmsg); + if (ret >= 1) + bit_dbg(2, &i2c_adap->dev, "wrote %d byte%s\n", + ret, ret == 1 ? "" : "s"); + if (ret < pmsg->len) { + if (ret >= 0) + ret = -EIO; + goto bailout; + } + } + } + ret = i; + +bailout: + bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n"); + i2c_stop(adap); + + if (adap->post_xfer) + adap->post_xfer(i2c_adap); + return ret; +} + +static u32 bit_func(struct i2c_adapter *adap) +{ + return I2C_FUNC_I2C | I2C_FUNC_NOSTART | I2C_FUNC_SMBUS_EMUL | + I2C_FUNC_SMBUS_READ_BLOCK_DATA | + I2C_FUNC_SMBUS_BLOCK_PROC_CALL | + I2C_FUNC_10BIT_ADDR | I2C_FUNC_PROTOCOL_MANGLING; +} + +/* -----exported algorithm data: ------------------------------------- */ + +const struct i2c_algorithm wb_i2c_bit_algo = { + .master_xfer = bit_xfer, + .functionality = bit_func, +}; +EXPORT_SYMBOL(wb_i2c_bit_algo); + +static const struct i2c_adapter_quirks i2c_bit_quirk_no_clk_stretch = { + .flags = I2C_AQ_NO_CLK_STRETCH, +}; + +/* + * registering functions to load algorithms at runtime + */ +static int __i2c_bit_add_bus(struct i2c_adapter *adap, + int (*add_adapter)(struct i2c_adapter *)) +{ + struct i2c_algo_bit_data *bit_adap = adap->algo_data; + int ret; + + if (bit_test) { + ret = test_bus(adap); + if (bit_test >= 2 && ret < 0) + return -ENODEV; + } + + /* register new adapter to i2c module... */ + adap->algo = &wb_i2c_bit_algo; + adap->retries = 3; + if (bit_adap->getscl == NULL) + adap->quirks = &i2c_bit_quirk_no_clk_stretch; + + ret = add_adapter(adap); + if (ret < 0) + return ret; + + /* Complain if SCL can't be read */ + if (bit_adap->getscl == NULL) { + dev_warn(&adap->dev, "Not I2C compliant: can't read SCL\n"); + dev_warn(&adap->dev, "Bus may be unreliable\n"); + } + return 0; +} + +int wb_i2c_bit_add_bus(struct i2c_adapter *adap) +{ + return __i2c_bit_add_bus(adap, i2c_add_adapter); +} +EXPORT_SYMBOL(wb_i2c_bit_add_bus); + +int wb_i2c_bit_add_numbered_bus(struct i2c_adapter *adap) +{ + return __i2c_bit_add_bus(adap, i2c_add_numbered_adapter); +} +EXPORT_SYMBOL(wb_i2c_bit_add_numbered_bus); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("I2C-Bus bit-banging algorithm"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_gpio.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_gpio.c new file mode 100644 index 000000000000..0362e905fddb --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_gpio.c @@ -0,0 +1,431 @@ +/* + * Bitbanging I2C bus driver using the GPIO API + * + * Copyright (C) 2007 Atmel Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern int wb_i2c_bit_add_numbered_bus(struct i2c_adapter *adap); + +struct i2c_gpio_private_data { + struct gpio_desc *sda; + struct gpio_desc *scl; + struct i2c_adapter adap; + struct i2c_algo_bit_data bit_data; + struct i2c_gpio_platform_data pdata; +#ifdef CONFIG_I2C_GPIO_FAULT_INJECTOR + struct dentry *debug_dir; +#endif +}; + +/* + * Toggle SDA by changing the output value of the pin. This is only + * valid for pins configured as open drain (i.e. setting the value + * high effectively turns off the output driver.) + */ +static void i2c_gpio_setsda_val(void *data, int state) +{ + struct i2c_gpio_private_data *priv = data; + + gpiod_set_value_cansleep(priv->sda, state); +} + +/* + * Toggle SCL by changing the output value of the pin. This is used + * for pins that are configured as open drain and for output-only + * pins. The latter case will break the i2c protocol, but it will + * often work in practice. + */ +static void i2c_gpio_setscl_val(void *data, int state) +{ + struct i2c_gpio_private_data *priv = data; + + gpiod_set_value_cansleep(priv->scl, state); +} + +static int i2c_gpio_getsda(void *data) +{ + struct i2c_gpio_private_data *priv = data; + + return gpiod_get_value_cansleep(priv->sda); +} + +static int i2c_gpio_getscl(void *data) +{ + struct i2c_gpio_private_data *priv = data; + + return gpiod_get_value_cansleep(priv->scl); +} + +#ifdef CONFIG_I2C_GPIO_FAULT_INJECTOR +static struct dentry *i2c_gpio_debug_dir; + +#define setsda(bd, val) ((bd)->setsda((bd)->data, val)) +#define setscl(bd, val) ((bd)->setscl((bd)->data, val)) +#define getsda(bd) ((bd)->getsda((bd)->data)) +#define getscl(bd) ((bd)->getscl((bd)->data)) + +#define WIRE_ATTRIBUTE(wire) \ +static int fops_##wire##_get(void *data, u64 *val) \ +{ \ + struct i2c_gpio_private_data *priv = data; \ + \ + i2c_lock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); \ + *val = get##wire(&priv->bit_data); \ + i2c_unlock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); \ + return 0; \ +} \ +static int fops_##wire##_set(void *data, u64 val) \ +{ \ + struct i2c_gpio_private_data *priv = data; \ + \ + i2c_lock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); \ + set##wire(&priv->bit_data, val); \ + i2c_unlock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); \ + return 0; \ +} \ +DEFINE_DEBUGFS_ATTRIBUTE(fops_##wire, fops_##wire##_get, fops_##wire##_set, "%llu\n") + +WIRE_ATTRIBUTE(scl); +WIRE_ATTRIBUTE(sda); + +static void i2c_gpio_incomplete_transfer(struct i2c_gpio_private_data *priv, + u32 pattern, u8 pattern_size) +{ + struct i2c_algo_bit_data *bit_data = &priv->bit_data; + int i; + + i2c_lock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); + + /* START condition */ + setsda(bit_data, 0); + udelay(bit_data->udelay); + + /* Send pattern, request ACK, don't send STOP */ + for (i = pattern_size - 1; i >= 0; i--) { + setscl(bit_data, 0); + udelay(bit_data->udelay / 2); + setsda(bit_data, (pattern >> i) & 1); + udelay((bit_data->udelay + 1) / 2); + setscl(bit_data, 1); + udelay(bit_data->udelay); + } + + i2c_unlock_bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER); +} + +static int fops_incomplete_addr_phase_set(void *data, u64 addr) +{ + struct i2c_gpio_private_data *priv = data; + u32 pattern; + + if (addr > 0x7f) + return -EINVAL; + + /* ADDR (7 bit) + RD (1 bit) + Client ACK, keep SDA hi (1 bit) */ + pattern = (addr << 2) | 3; + + i2c_gpio_incomplete_transfer(priv, pattern, 9); + + return 0; +} +DEFINE_DEBUGFS_ATTRIBUTE(fops_incomplete_addr_phase, NULL, fops_incomplete_addr_phase_set, "%llu\n"); + +static int fops_incomplete_write_byte_set(void *data, u64 addr) +{ + struct i2c_gpio_private_data *priv = data; + u32 pattern; + + if (addr > 0x7f) + return -EINVAL; + + /* ADDR (7 bit) + WR (1 bit) + Client ACK (1 bit) */ + pattern = (addr << 2) | 1; + /* 0x00 (8 bit) + Client ACK, keep SDA hi (1 bit) */ + pattern = (pattern << 9) | 1; + + i2c_gpio_incomplete_transfer(priv, pattern, 18); + + return 0; +} +DEFINE_DEBUGFS_ATTRIBUTE(fops_incomplete_write_byte, NULL, fops_incomplete_write_byte_set, "%llu\n"); + +static void i2c_gpio_fault_injector_init(struct platform_device *pdev) +{ + struct i2c_gpio_private_data *priv = platform_get_drvdata(pdev); + + /* + * If there will be a debugfs-dir per i2c adapter somewhen, put the + * 'fault-injector' dir there. Until then, we have a global dir with + * all adapters as subdirs. + */ + if (!i2c_gpio_debug_dir) { + i2c_gpio_debug_dir = debugfs_create_dir("i2c-fault-injector", NULL); + if (!i2c_gpio_debug_dir) + return; + } + + priv->debug_dir = debugfs_create_dir(pdev->name, i2c_gpio_debug_dir); + if (!priv->debug_dir) + return; + + debugfs_create_file_unsafe("scl", 0600, priv->debug_dir, priv, &fops_scl); + debugfs_create_file_unsafe("sda", 0600, priv->debug_dir, priv, &fops_sda); + debugfs_create_file_unsafe("incomplete_address_phase", 0200, priv->debug_dir, + priv, &fops_incomplete_addr_phase); + debugfs_create_file_unsafe("incomplete_write_byte", 0200, priv->debug_dir, + priv, &fops_incomplete_write_byte); +} + +static void i2c_gpio_fault_injector_exit(struct platform_device *pdev) +{ + struct i2c_gpio_private_data *priv = platform_get_drvdata(pdev); + + debugfs_remove_recursive(priv->debug_dir); +} +#else +static inline void i2c_gpio_fault_injector_init(struct platform_device *pdev) {} +static inline void i2c_gpio_fault_injector_exit(struct platform_device *pdev) {} +#endif /* CONFIG_I2C_GPIO_FAULT_INJECTOR*/ + +static void of_i2c_gpio_get_props(struct device_node *np, + struct i2c_gpio_platform_data *pdata) +{ + u32 reg; + + of_property_read_u32(np, "i2c-gpio,delay-us", &pdata->udelay); + + if (!of_property_read_u32(np, "i2c-gpio,timeout-ms", ®)) + pdata->timeout = msecs_to_jiffies(reg); + + pdata->sda_is_open_drain = + of_property_read_bool(np, "i2c-gpio,sda-open-drain"); + pdata->scl_is_open_drain = + of_property_read_bool(np, "i2c-gpio,scl-open-drain"); + pdata->scl_is_output_only = + of_property_read_bool(np, "i2c-gpio,scl-output-only"); +} + +static struct gpio_desc *i2c_gpio_get_desc(struct device *dev, + const char *con_id, + unsigned int index, + enum gpiod_flags gflags) +{ + struct gpio_desc *retdesc; + int ret; + + retdesc = devm_gpiod_get(dev, con_id, gflags); + if (!IS_ERR(retdesc)) { + dev_dbg(dev, "got GPIO from name %s\n", con_id); + return retdesc; + } + + retdesc = devm_gpiod_get_index(dev, NULL, index, gflags); + if (!IS_ERR(retdesc)) { + dev_dbg(dev, "got GPIO from index %u\n", index); + return retdesc; + } + + ret = PTR_ERR(retdesc); + + /* FIXME: hack in the old code, is this really necessary? */ + if (ret == -EINVAL) + retdesc = ERR_PTR(-EPROBE_DEFER); + + /* This happens if the GPIO driver is not yet probed, let's defer */ + if (ret == -ENOENT) + retdesc = ERR_PTR(-EPROBE_DEFER); + + if (PTR_ERR(retdesc) != -EPROBE_DEFER) + dev_err(dev, "error trying to get descriptor: %d\n", ret); + + return retdesc; +} + +static int i2c_gpio_probe(struct platform_device *pdev) +{ + struct i2c_gpio_private_data *priv; + struct i2c_gpio_platform_data *pdata; + struct i2c_algo_bit_data *bit_data; + struct i2c_adapter *adap; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + enum gpiod_flags gflags; + int ret; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + adap = &priv->adap; + bit_data = &priv->bit_data; + pdata = &priv->pdata; + + if (np) { + of_i2c_gpio_get_props(np, pdata); + } else { + /* + * If all platform data settings are zero it is OK + * to not provide any platform data from the board. + */ + if (dev_get_platdata(dev)) + memcpy(pdata, dev_get_platdata(dev), sizeof(*pdata)); + } + + /* + * First get the GPIO pins; if it fails, we'll defer the probe. + * If the SDA line is marked from platform data or device tree as + * "open drain" it means something outside of our control is making + * this line being handled as open drain, and we should just handle + * it as any other output. Else we enforce open drain as this is + * required for an I2C bus. + */ + if (pdata->sda_is_open_drain) + gflags = GPIOD_OUT_HIGH; + else + gflags = GPIOD_OUT_HIGH_OPEN_DRAIN; + priv->sda = i2c_gpio_get_desc(dev, "sda", 0, gflags); + if (IS_ERR(priv->sda)) + return PTR_ERR(priv->sda); + + /* + * If the SCL line is marked from platform data or device tree as + * "open drain" it means something outside of our control is making + * this line being handled as open drain, and we should just handle + * it as any other output. Else we enforce open drain as this is + * required for an I2C bus. + */ + if (pdata->scl_is_open_drain) + gflags = GPIOD_OUT_HIGH; + else + gflags = GPIOD_OUT_HIGH_OPEN_DRAIN; + priv->scl = i2c_gpio_get_desc(dev, "scl", 1, gflags); + if (IS_ERR(priv->scl)) + return PTR_ERR(priv->scl); + + if (gpiod_cansleep(priv->sda) || gpiod_cansleep(priv->scl)) + dev_warn(dev, "Slow GPIO pins might wreak havoc into I2C/SMBus bus timing"); + + bit_data->setsda = i2c_gpio_setsda_val; + bit_data->setscl = i2c_gpio_setscl_val; + + if (!pdata->scl_is_output_only) + bit_data->getscl = i2c_gpio_getscl; + bit_data->getsda = i2c_gpio_getsda; + + if (pdata->udelay) + bit_data->udelay = pdata->udelay; + else if (pdata->scl_is_output_only) + bit_data->udelay = 50; /* 10 kHz */ + else + bit_data->udelay = 5; /* 100 kHz */ + + if (pdata->timeout) + bit_data->timeout = pdata->timeout; + else + bit_data->timeout = HZ / 10; /* 100 ms */ + + bit_data->data = priv; + + adap->owner = THIS_MODULE; + if (np) + strlcpy(adap->name, dev_name(dev), sizeof(adap->name)); + else + snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id); + + adap->algo_data = bit_data; + adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; + adap->dev.parent = dev; + adap->dev.of_node = np; + + adap->nr = pdev->id; + ret = wb_i2c_bit_add_numbered_bus(adap); + if (ret) + return ret; + + platform_set_drvdata(pdev, priv); + + /* + * FIXME: using global GPIO numbers is not helpful. If/when we + * get accessors to get the actual name of the GPIO line, + * from the descriptor, then provide that instead. + */ + dev_info(dev, "using lines %u (SDA) and %u (SCL%s)\n", + desc_to_gpio(priv->sda), desc_to_gpio(priv->scl), + pdata->scl_is_output_only + ? ", no clock stretching" : ""); + + i2c_gpio_fault_injector_init(pdev); + + return 0; +} + +static int i2c_gpio_remove(struct platform_device *pdev) +{ + struct i2c_gpio_private_data *priv; + struct i2c_adapter *adap; + + i2c_gpio_fault_injector_exit(pdev); + + priv = platform_get_drvdata(pdev); + adap = &priv->adap; + + i2c_del_adapter(adap); + + return 0; +} + +#if defined(CONFIG_OF) +static const struct of_device_id i2c_gpio_dt_ids[] = { + { .compatible = "wb-i2c-gpio", }, + { /* sentinel */ } +}; + +MODULE_DEVICE_TABLE(of, i2c_gpio_dt_ids); +#endif + +static struct platform_driver i2c_gpio_driver = { + .driver = { + .name = "wb-i2c-gpio", + .of_match_table = of_match_ptr(i2c_gpio_dt_ids), + }, + .probe = i2c_gpio_probe, + .remove = i2c_gpio_remove, +}; + +static int __init i2c_gpio_init(void) +{ + int ret; + + ret = platform_driver_register(&i2c_gpio_driver); + if (ret) + printk(KERN_ERR "i2c-gpio: probe failed: %d\n", ret); + + return ret; +} +subsys_initcall(i2c_gpio_init); + +static void __exit i2c_gpio_exit(void) +{ + platform_driver_unregister(&i2c_gpio_driver); +} +module_exit(i2c_gpio_exit); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("Platform-independent bitbanging I2C driver"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:i2c-gpio"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_gpio_device.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_gpio_device.c new file mode 100644 index 000000000000..1e1d815eedf1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_gpio_device.c @@ -0,0 +1,133 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define I2C_GPIO_DEV_NAME_LEN (16) +static char i2c_gpio_dev_name[I2C_GPIO_DEV_NAME_LEN] = {0}; + +static int gpio_sda = 17; +module_param(gpio_sda, int, S_IRUGO | S_IWUSR); + +static int gpio_scl = 1; +module_param(gpio_scl, int, S_IRUGO | S_IWUSR); + +static int gpio_udelay = 2; +module_param(gpio_udelay, int, S_IRUGO | S_IWUSR); + +static int bus_num = -1; +module_param(bus_num, int, S_IRUGO | S_IWUSR); + +static char *gpio_chip_name = NULL; +module_param(gpio_chip_name, charp, 0644); +MODULE_PARM_DESC(str_var, "A string variable for GPIO controller"); + +static int g_wb_i2c_gpio_device_debug = 0; +static int g_wb_i2c_gpio_device_error = 0; + +module_param(g_wb_i2c_gpio_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_i2c_gpio_device_error, int, S_IRUGO | S_IWUSR); + +#define WB_I2C_GPIO_DEVICE_VERBOSE(fmt, args...) do { \ + if (g_wb_i2c_gpio_device_debug) { \ + printk(KERN_INFO "[WB_I2C_GPIO_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_I2C_GPIO_DEVICE_ERROR(fmt, args...) do { \ + if (g_wb_i2c_gpio_device_error) { \ + printk(KERN_ERR "[WB_I2C_GPIO_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +/****************** i2c adapter with gpio ***********************/ +static struct i2c_gpio_platform_data i2c_pdata = { + .udelay = 2, + .scl_is_output_only = 0, + .sda_is_open_drain = 0, + .scl_is_open_drain = 0, +}; + +static void i2c_gpio_release(struct device *dev) +{ + return; +} + +static struct platform_device wb_i2c_gpio_device = { + .name = "wb-i2c-gpio", + .id = -1, + .num_resources = 0, + .resource = NULL, + .dev = { + .platform_data = &i2c_pdata, + .release = i2c_gpio_release, + }, +}; + +/* + * i2c + */ +static struct gpiod_lookup_table wb_i2c_gpio_table = { + .dev_id = "wb-i2c-gpio", + .table = { + GPIO_LOOKUP("wb_gpio_d1500", 17, "sda", + GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), + GPIO_LOOKUP("wb_gpio_d1500", 1, "scl", + GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), + { }, + }, +}; + +static int __init wb_i2c_gpio_device_init(void) +{ + int err; + + WB_I2C_GPIO_DEVICE_VERBOSE("wb_i2c_gpio_device_init enter!\n"); + wb_i2c_gpio_table.table[0].chip_hwnum = gpio_sda; + wb_i2c_gpio_table.table[1].chip_hwnum = gpio_scl; + i2c_pdata.udelay = gpio_udelay; + + if (gpio_chip_name) { + wb_i2c_gpio_table.table[0].key = gpio_chip_name; + wb_i2c_gpio_table.table[1].key = gpio_chip_name; + } + + if (bus_num >= 0) { + wb_i2c_gpio_device.id = bus_num; + snprintf(i2c_gpio_dev_name, I2C_GPIO_DEV_NAME_LEN, "wb-i2c-gpio.%d", bus_num); + wb_i2c_gpio_table.dev_id = i2c_gpio_dev_name; + } + + gpiod_add_lookup_table(&wb_i2c_gpio_table); + + err = platform_device_register(&wb_i2c_gpio_device); + if (err < 0) { + printk(KERN_ERR "register i2c gpio device fail(%d). \n", err); + gpiod_remove_lookup_table(&wb_i2c_gpio_table); + return -1; + } + return 0; +} + +static void __exit wb_i2c_gpio_device_exit(void) +{ + WB_I2C_GPIO_DEVICE_VERBOSE("wb_i2c_gpio_device_exit enter!\n"); + platform_device_unregister(&wb_i2c_gpio_device); + gpiod_remove_lookup_table(&wb_i2c_gpio_table); +} + +module_init(wb_i2c_gpio_device_init); +module_exit(wb_i2c_gpio_device_exit); +MODULE_DESCRIPTION("I2C GPIO Devices"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_i801.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_i801.c new file mode 100644 index 000000000000..a733c115487e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_i801.c @@ -0,0 +1,2114 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + Copyright (c) 1998 - 2002 Frodo Looijaard , + Philip Edelbrock , and Mark D. Studebaker + + Copyright (C) 2007 - 2014 Jean Delvare + Copyright (C) 2010 Intel Corporation, + David Woodhouse + +*/ + +/* + * Supports the following Intel I/O Controller Hubs (ICH): + * + * I/O Block I2C + * region SMBus Block proc. block + * Chip name PCI ID size PEC buffer call read + * --------------------------------------------------------------------------- + * 82801AA (ICH) 0x2413 16 no no no no + * 82801AB (ICH0) 0x2423 16 no no no no + * 82801BA (ICH2) 0x2443 16 no no no no + * 82801CA (ICH3) 0x2483 32 soft no no no + * 82801DB (ICH4) 0x24c3 32 hard yes no no + * 82801E (ICH5) 0x24d3 32 hard yes yes yes + * 6300ESB 0x25a4 32 hard yes yes yes + * 82801F (ICH6) 0x266a 32 hard yes yes yes + * 6310ESB/6320ESB 0x269b 32 hard yes yes yes + * 82801G (ICH7) 0x27da 32 hard yes yes yes + * 82801H (ICH8) 0x283e 32 hard yes yes yes + * 82801I (ICH9) 0x2930 32 hard yes yes yes + * EP80579 (Tolapai) 0x5032 32 hard yes yes yes + * ICH10 0x3a30 32 hard yes yes yes + * ICH10 0x3a60 32 hard yes yes yes + * 5/3400 Series (PCH) 0x3b30 32 hard yes yes yes + * 6 Series (PCH) 0x1c22 32 hard yes yes yes + * Patsburg (PCH) 0x1d22 32 hard yes yes yes + * Patsburg (PCH) IDF 0x1d70 32 hard yes yes yes + * Patsburg (PCH) IDF 0x1d71 32 hard yes yes yes + * Patsburg (PCH) IDF 0x1d72 32 hard yes yes yes + * DH89xxCC (PCH) 0x2330 32 hard yes yes yes + * Panther Point (PCH) 0x1e22 32 hard yes yes yes + * Lynx Point (PCH) 0x8c22 32 hard yes yes yes + * Lynx Point-LP (PCH) 0x9c22 32 hard yes yes yes + * Avoton (SOC) 0x1f3c 32 hard yes yes yes + * Wellsburg (PCH) 0x8d22 32 hard yes yes yes + * Wellsburg (PCH) MS 0x8d7d 32 hard yes yes yes + * Wellsburg (PCH) MS 0x8d7e 32 hard yes yes yes + * Wellsburg (PCH) MS 0x8d7f 32 hard yes yes yes + * Coleto Creek (PCH) 0x23b0 32 hard yes yes yes + * Wildcat Point (PCH) 0x8ca2 32 hard yes yes yes + * Wildcat Point-LP (PCH) 0x9ca2 32 hard yes yes yes + * BayTrail (SOC) 0x0f12 32 hard yes yes yes + * Braswell (SOC) 0x2292 32 hard yes yes yes + * Sunrise Point-H (PCH) 0xa123 32 hard yes yes yes + * Sunrise Point-LP (PCH) 0x9d23 32 hard yes yes yes + * DNV (SOC) 0x19df 32 hard yes yes yes + * Emmitsburg (PCH) 0x1bc9 32 hard yes yes yes + * Broxton (SOC) 0x5ad4 32 hard yes yes yes + * Lewisburg (PCH) 0xa1a3 32 hard yes yes yes + * Lewisburg Supersku (PCH) 0xa223 32 hard yes yes yes + * Kaby Lake PCH-H (PCH) 0xa2a3 32 hard yes yes yes + * Gemini Lake (SOC) 0x31d4 32 hard yes yes yes + * Cannon Lake-H (PCH) 0xa323 32 hard yes yes yes + * Cannon Lake-LP (PCH) 0x9da3 32 hard yes yes yes + * Cedar Fork (PCH) 0x18df 32 hard yes yes yes + * Ice Lake-LP (PCH) 0x34a3 32 hard yes yes yes + * Comet Lake (PCH) 0x02a3 32 hard yes yes yes + * Comet Lake-H (PCH) 0x06a3 32 hard yes yes yes + * Elkhart Lake (PCH) 0x4b23 32 hard yes yes yes + * Tiger Lake-LP (PCH) 0xa0a3 32 hard yes yes yes + * Tiger Lake-H (PCH) 0x43a3 32 hard yes yes yes + * Jasper Lake (SOC) 0x4da3 32 hard yes yes yes + * Comet Lake-V (PCH) 0xa3a3 32 hard yes yes yes + * Alder Lake-S (PCH) 0x7aa3 32 hard yes yes yes + * + * Features supported by this driver: + * Software PEC no + * Hardware PEC yes + * Block buffer yes + * Block process call transaction yes + * I2C block read transaction yes (doesn't use the block buffer) + * Slave mode no + * SMBus Host Notify yes + * Interrupt processing yes + * + * See the file Documentation/i2c/busses/i2c-i801.rst for details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI +#include +#include +#endif + +#define mem_clear(data, size) memset((data), 0, (size)) + +/* I801 SMBus address offsets */ +#define SMBHSTSTS(p) (0 + (p)->smba) +#define SMBHSTCNT(p) (2 + (p)->smba) +#define SMBHSTCMD(p) (3 + (p)->smba) +#define SMBHSTADD(p) (4 + (p)->smba) +#define SMBHSTDAT0(p) (5 + (p)->smba) +#define SMBHSTDAT1(p) (6 + (p)->smba) +#define SMBBLKDAT(p) (7 + (p)->smba) +#define SMBPEC(p) (8 + (p)->smba) /* ICH3 and later */ +#define SMBAUXSTS(p) (12 + (p)->smba) /* ICH4 and later */ +#define SMBAUXCTL(p) (13 + (p)->smba) /* ICH4 and later */ +#define SMBSLVSTS(p) (16 + (p)->smba) /* ICH3 and later */ +#define SMBSLVCMD(p) (17 + (p)->smba) /* ICH3 and later */ +#define SMBNTFDADD(p) (20 + (p)->smba) /* ICH3 and later */ +#define SMBPINCTL(p) (15 + (p)->smba) /* SMBus Pin Control Register */ + +/* PCI Address Constants */ +#define SMBBAR 4 +#define SMBPCICTL 0x004 +#define SMBPCISTS 0x006 +#define SMBHSTCFG 0x040 +#define TCOBASE 0x050 +#define TCOCTL 0x054 + +#define SBREG_BAR 0x10 +#define SBREG_SMBCTRL 0xc6000c +#define SBREG_SMBCTRL_DNV 0xcf000c + +/* Host status bits for SMBPCISTS */ +#define SMBPCISTS_INTS BIT(3) + +/* Control bits for SMBPCICTL */ +#define SMBPCICTL_INTDIS BIT(10) + +/* Host configuration bits for SMBHSTCFG */ +#define SMBHSTCFG_HST_EN BIT(0) +#define SMBHSTCFG_SMB_SMI_EN BIT(1) +#define SMBHSTCFG_I2C_EN BIT(2) +#define SMBHSTCFG_SSRESET BIT(3) +#define SSRESET_SLEEP_TIME 1 /* 1us */ +#define SSRESET_RETRY_TIME (1000 / SSRESET_SLEEP_TIME) + +/* Pin status for SMBPINCTL */ +#define SMBPINCTL_CLK_STS 1 /* bit0 SMBCLK_CUR_STS*/ +#define SMBPINCTL_SDA_STS 2 /* bit1 SMBDATA_CUR_STS*/ +#define SMBPINCTL_CLK_CTL 4 /* bit2 SMBCLK_CTL */ + +#define SMBHSTCFG_SPD_WD BIT(4) + +/* TCO configuration bits for TCOCTL */ +#define TCOCTL_EN BIT(8) + +/* Auxiliary status register bits, ICH4+ only */ +#define SMBAUXSTS_CRCE BIT(0) +#define SMBAUXSTS_STCO BIT(1) + +/* Auxiliary control register bits, ICH4+ only */ +#define SMBAUXCTL_CRC BIT(0) +#define SMBAUXCTL_E32B BIT(1) + +/* Other settings */ +#define MAX_RETRIES 400 + +/* I801 command constants */ +#define I801_QUICK 0x00 +#define I801_BYTE 0x04 +#define I801_BYTE_DATA 0x08 +#define I801_WORD_DATA 0x0C +#define I801_PROC_CALL 0x10 /* unimplemented */ +#define I801_BLOCK_DATA 0x14 +#define I801_I2C_BLOCK_DATA 0x18 /* ICH5 and later */ +#define I801_BLOCK_PROC_CALL 0x1C + +/* I801 Host Control register bits */ +#define SMBHSTCNT_INTREN BIT(0) +#define SMBHSTCNT_KILL BIT(1) +#define SMBHSTCNT_LAST_BYTE BIT(5) +#define SMBHSTCNT_START BIT(6) +#define SMBHSTCNT_PEC_EN BIT(7) /* ICH3 and later */ + +/* I801 Hosts Status register bits */ +#define SMBHSTSTS_BYTE_DONE BIT(7) +#define SMBHSTSTS_INUSE_STS BIT(6) +#define SMBHSTSTS_SMBALERT_STS BIT(5) +#define SMBHSTSTS_FAILED BIT(4) +#define SMBHSTSTS_BUS_ERR BIT(3) +#define SMBHSTSTS_DEV_ERR BIT(2) +#define SMBHSTSTS_INTR BIT(1) +#define SMBHSTSTS_HOST_BUSY BIT(0) + +/* Host Notify Status register bits */ +#define SMBSLVSTS_HST_NTFY_STS BIT(0) + +/* Host Notify Command register bits */ +#define SMBSLVCMD_HST_NTFY_INTREN BIT(0) + +#define STATUS_ERROR_FLAGS (SMBHSTSTS_FAILED | SMBHSTSTS_BUS_ERR | \ + SMBHSTSTS_DEV_ERR) + +#define STATUS_FLAGS (SMBHSTSTS_BYTE_DONE | SMBHSTSTS_INTR | \ + STATUS_ERROR_FLAGS) + +/* Older devices have their ID defined in */ +#define PCI_DEVICE_ID_INTEL_COMETLAKE_SMBUS 0x02a3 +#define PCI_DEVICE_ID_INTEL_COMETLAKE_H_SMBUS 0x06a3 +#define PCI_DEVICE_ID_INTEL_BAYTRAIL_SMBUS 0x0f12 +#define PCI_DEVICE_ID_INTEL_CDF_SMBUS 0x18df +#define PCI_DEVICE_ID_INTEL_DNV_SMBUS 0x19df +#define PCI_DEVICE_ID_INTEL_EBG_SMBUS 0x1bc9 +#define PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS 0x1c22 +#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS 0x1d22 +/* Patsburg also has three 'Integrated Device Function' SMBus controllers */ +#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0 0x1d70 +#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1 0x1d71 +#define PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2 0x1d72 +#define PCI_DEVICE_ID_INTEL_PANTHERPOINT_SMBUS 0x1e22 +#define PCI_DEVICE_ID_INTEL_AVOTON_SMBUS 0x1f3c +#define PCI_DEVICE_ID_INTEL_BRASWELL_SMBUS 0x2292 +#define PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS 0x2330 +#define PCI_DEVICE_ID_INTEL_COLETOCREEK_SMBUS 0x23b0 +#define PCI_DEVICE_ID_INTEL_GEMINILAKE_SMBUS 0x31d4 +#define PCI_DEVICE_ID_INTEL_ICELAKE_LP_SMBUS 0x34a3 +#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS 0x3b30 +#define PCI_DEVICE_ID_INTEL_TIGERLAKE_H_SMBUS 0x43a3 +#define PCI_DEVICE_ID_INTEL_ELKHART_LAKE_SMBUS 0x4b23 +#define PCI_DEVICE_ID_INTEL_JASPER_LAKE_SMBUS 0x4da3 +#define PCI_DEVICE_ID_INTEL_BROXTON_SMBUS 0x5ad4 +#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_S_SMBUS 0x7aa3 +#define PCI_DEVICE_ID_INTEL_LYNXPOINT_SMBUS 0x8c22 +#define PCI_DEVICE_ID_INTEL_WILDCATPOINT_SMBUS 0x8ca2 +#define PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS 0x8d22 +#define PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS0 0x8d7d +#define PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS1 0x8d7e +#define PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS2 0x8d7f +#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_SMBUS 0x9c22 +#define PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_SMBUS 0x9ca2 +#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SMBUS 0x9d23 +#define PCI_DEVICE_ID_INTEL_CANNONLAKE_LP_SMBUS 0x9da3 +#define PCI_DEVICE_ID_INTEL_TIGERLAKE_LP_SMBUS 0xa0a3 +#define PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS 0xa123 +#define PCI_DEVICE_ID_INTEL_LEWISBURG_SMBUS 0xa1a3 +#define PCI_DEVICE_ID_INTEL_LEWISBURG_SSKU_SMBUS 0xa223 +#define PCI_DEVICE_ID_INTEL_KABYLAKE_PCH_H_SMBUS 0xa2a3 +#define PCI_DEVICE_ID_INTEL_CANNONLAKE_H_SMBUS 0xa323 +#define PCI_DEVICE_ID_INTEL_COMETLAKE_V_SMBUS 0xa3a3 + +struct i801_mux_config { + char *gpio_chip; + unsigned values[3]; + int n_values; + unsigned classes[3]; + unsigned gpios[2]; /* Relative to gpio_chip->base */ + int n_gpios; +}; + +struct i801_priv { + struct i2c_adapter adapter; + unsigned long smba; + unsigned char original_hstcfg; + unsigned char original_slvcmd; + struct pci_dev *pci_dev; + unsigned int features; + + /* isr processing */ + wait_queue_head_t waitq; + u8 status; + + /* Command state used by isr for byte-by-byte block transactions */ + u8 cmd; + bool is_read; + int count; + int len; + u8 *data; + +#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI + const struct i801_mux_config *mux_drvdata; + struct platform_device *mux_pdev; + struct gpiod_lookup_table *lookup; +#endif + struct platform_device *tco_pdev; + + /* + * If set to true the host controller registers are reserved for + * ACPI AML use. Protected by acpi_lock. + */ + bool acpi_reserved; + struct mutex acpi_lock; +}; + +#define FEATURE_SMBUS_PEC BIT(0) +#define FEATURE_BLOCK_BUFFER BIT(1) +#define FEATURE_BLOCK_PROC BIT(2) +#define FEATURE_I2C_BLOCK_READ BIT(3) +#define FEATURE_IRQ BIT(4) +#define FEATURE_HOST_NOTIFY BIT(5) +/* Not really a feature, but it's convenient to handle it as such */ +#define FEATURE_IDF BIT(15) +#define FEATURE_TCO_SPT BIT(16) +#define FEATURE_TCO_CNL BIT(17) + +static const char *i801_feature_names[] = { + "SMBus PEC", + "Block buffer", + "Block process call", + "I2C block read", + "Interrupt", + "SMBus Host Notify", +}; + +static unsigned int disable_features; +module_param(disable_features, uint, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(disable_features, "Disable selected driver features:\n" + "\t\t 0x01 disable SMBus PEC\n" + "\t\t 0x02 disable the block buffer\n" + "\t\t 0x08 disable the I2C block read functionality\n" + "\t\t 0x10 don't use interrupts\n" + "\t\t 0x20 disable SMBus Host Notify "); + +static void i801_setscl(struct i801_priv *priv, unsigned int level) +{ + int pin_status; + pin_status = inb_p(SMBPINCTL(priv)); + if (level == 0) { + pin_status &= (~SMBPINCTL_CLK_CTL); + } + else { + pin_status |= SMBPINCTL_CLK_CTL; + } + outb_p(pin_status, SMBPINCTL(priv)); + return; +} + +static void i801_i2c_unblock(struct i801_priv *priv) +{ + int i; + for (i = 0; i < 10; i++) { + i801_setscl(priv, 0); + udelay(5); + i801_setscl(priv, 1); + udelay(5); + } + return; +} + +static int i801_check_i2c_unblock(struct i801_priv *priv) +{ + int pin_status; + + pin_status = inb_p(SMBPINCTL(priv)); + if ( (!(pin_status & SMBPINCTL_SDA_STS) ) && (pin_status & SMBPINCTL_CLK_STS) ) { + dev_dbg(&priv->pci_dev->dev, "SDA is low, send 9 clock to device!\n"); + i801_i2c_unblock(priv); + } + return 0; +} + +static void i801_do_reset(struct i801_priv *priv) +{ + unsigned char tmp; + unsigned int retry_count = 0; + + pci_read_config_byte(priv->pci_dev, SMBHSTCFG, &tmp); + tmp |= SMBHSTCFG_SSRESET; + pci_write_config_byte(priv->pci_dev, SMBHSTCFG, tmp); + pci_read_config_byte(priv->pci_dev, SMBHSTCFG, &tmp); + + while( ((tmp & SMBHSTCFG_SSRESET) != 0) && (retry_count < SSRESET_RETRY_TIME)) { + usleep_range(SSRESET_SLEEP_TIME, SSRESET_SLEEP_TIME + 1); + retry_count++; + pci_read_config_byte(priv->pci_dev, SMBHSTCFG, &tmp); + } + + return ; +} + +static int i801_check_i2c_scl(struct i801_priv *priv) +{ + int pin_status; + + pin_status = inb_p(SMBPINCTL(priv)); + if ( (pin_status & SMBPINCTL_SDA_STS) && (pin_status & SMBPINCTL_CLK_STS) ) { + return 0; + } + + dev_dbg(&priv->pci_dev->dev, "SDA or SCL is low, begin to reset SMBus adapter, pin_status: 0x%x\n",pin_status); + i801_do_reset(priv); + pin_status = inb_p(SMBPINCTL(priv)); + if ( (pin_status & SMBPINCTL_SDA_STS) && (pin_status & SMBPINCTL_CLK_STS) ) { + return 0; + } + dev_warn(&priv->pci_dev->dev, "SDA or SCL is low.pin_status:0x%x\n",pin_status); + return -1; +} + +/* Make sure the SMBus host is ready to start transmitting. + Return 0 if it is, -EBUSY if it is not. */ +static int i801_check_pre(struct i801_priv *priv) +{ + int status; + + i801_check_i2c_unblock(priv); + + if (i801_check_i2c_scl(priv)) { + return -EIO; + } + + status = inb_p(SMBHSTSTS(priv)); + if (status & SMBHSTSTS_HOST_BUSY) { + dev_dbg(&priv->pci_dev->dev, "SMBus is busy, begin to reset SMBus adapter!\n"); + + i801_do_reset(priv); + + status = inb_p(SMBHSTSTS(priv)); + if (status & SMBHSTSTS_HOST_BUSY) { + dev_err(&priv->pci_dev->dev, "SMBus is busy, can't use it!\n"); + return -EBUSY; + } + } + + status &= STATUS_FLAGS; + if (status) { + dev_dbg(&priv->pci_dev->dev, "Clearing status flags (%02x)\n", + status); + outb_p(status, SMBHSTSTS(priv)); + status = inb_p(SMBHSTSTS(priv)) & STATUS_FLAGS; + if (status) { + dev_err(&priv->pci_dev->dev, + "Failed clearing status flags (%02x)\n", + status); + return -EBUSY; + } + } + + /* + * Clear CRC status if needed. + * During normal operation, i801_check_post() takes care + * of it after every operation. We do it here only in case + * the hardware was already in this state when the driver + * started. + */ + if (priv->features & FEATURE_SMBUS_PEC) { + status = inb_p(SMBAUXSTS(priv)) & SMBAUXSTS_CRCE; + if (status) { + dev_dbg(&priv->pci_dev->dev, + "Clearing aux status flags (%02x)\n", status); + outb_p(status, SMBAUXSTS(priv)); + status = inb_p(SMBAUXSTS(priv)) & SMBAUXSTS_CRCE; + if (status) { + dev_err(&priv->pci_dev->dev, + "Failed clearing aux status flags (%02x)\n", + status); + return -EBUSY; + } + } + } + + return 0; +} + +/* + * Convert the status register to an error code, and clear it. + * Note that status only contains the bits we want to clear, not the + * actual register value. + */ +static int i801_check_post(struct i801_priv *priv, int status) +{ + int result = 0; + + /* + * If the SMBus is still busy, we give up + * Note: This timeout condition only happens when using polling + * transactions. For interrupt operation, NAK/timeout is indicated by + * DEV_ERR. + */ + if (unlikely(status < 0)) { + dev_err(&priv->pci_dev->dev, "Transaction timeout\n"); + /* try to stop the current command */ + dev_dbg(&priv->pci_dev->dev, "Terminating the current operation\n"); + outb_p(SMBHSTCNT_KILL, SMBHSTCNT(priv)); + usleep_range(1000, 2000); + outb_p(0, SMBHSTCNT(priv)); + + /* Check if it worked */ + status = inb_p(SMBHSTSTS(priv)); + if ((status & SMBHSTSTS_HOST_BUSY) || + !(status & SMBHSTSTS_FAILED)) + dev_err(&priv->pci_dev->dev, + "Failed terminating the transaction\n"); + outb_p(STATUS_FLAGS, SMBHSTSTS(priv)); + return -ETIMEDOUT; + } + + if (status & SMBHSTSTS_FAILED) { + result = -EIO; + dev_err(&priv->pci_dev->dev, "Transaction failed\n"); + } + if (status & SMBHSTSTS_DEV_ERR) { + /* + * This may be a PEC error, check and clear it. + * + * AUXSTS is handled differently from HSTSTS. + * For HSTSTS, i801_isr() or i801_wait_intr() + * has already cleared the error bits in hardware, + * and we are passed a copy of the original value + * in "status". + * For AUXSTS, the hardware register is left + * for us to handle here. + * This is asymmetric, slightly iffy, but safe, + * since all this code is serialized and the CRCE + * bit is harmless as long as it's cleared before + * the next operation. + */ + if ((priv->features & FEATURE_SMBUS_PEC) && + (inb_p(SMBAUXSTS(priv)) & SMBAUXSTS_CRCE)) { + outb_p(SMBAUXSTS_CRCE, SMBAUXSTS(priv)); + result = -EBADMSG; + dev_dbg(&priv->pci_dev->dev, "PEC error\n"); + } else { + result = -ENXIO; + dev_dbg(&priv->pci_dev->dev, "No response\n"); + } + } + if (status & SMBHSTSTS_BUS_ERR) { + result = -EAGAIN; + dev_dbg(&priv->pci_dev->dev, "Lost arbitration\n"); + } + + /* Clear status flags except BYTE_DONE, to be cleared by caller */ + outb_p(status, SMBHSTSTS(priv)); + + return result; +} + +/* Wait for BUSY being cleared and either INTR or an error flag being set */ +static int i801_wait_intr(struct i801_priv *priv) +{ + int timeout = 0; + int status; + + /* We will always wait for a fraction of a second! */ + do { + usleep_range(250, 500); + status = inb_p(SMBHSTSTS(priv)); + } while (((status & SMBHSTSTS_HOST_BUSY) || + !(status & (STATUS_ERROR_FLAGS | SMBHSTSTS_INTR))) && + (timeout++ < MAX_RETRIES)); + + if (timeout > MAX_RETRIES) { + dev_dbg(&priv->pci_dev->dev, "INTR Timeout!\n"); + return -ETIMEDOUT; + } + return status & (STATUS_ERROR_FLAGS | SMBHSTSTS_INTR); +} + +/* Wait for either BYTE_DONE or an error flag being set */ +static int i801_wait_byte_done(struct i801_priv *priv) +{ + int timeout = 0; + int status; + + /* We will always wait for a fraction of a second! */ + do { + usleep_range(250, 500); + status = inb_p(SMBHSTSTS(priv)); + } while (!(status & (STATUS_ERROR_FLAGS | SMBHSTSTS_BYTE_DONE)) && + (timeout++ < MAX_RETRIES)); + + if (timeout > MAX_RETRIES) { + dev_dbg(&priv->pci_dev->dev, "BYTE_DONE Timeout!\n"); + return -ETIMEDOUT; + } + return status & STATUS_ERROR_FLAGS; +} + +static int i801_transaction(struct i801_priv *priv, int xact) +{ + int status; + int result; + const struct i2c_adapter *adap = &priv->adapter; + + result = i801_check_pre(priv); + if (result < 0) + return result; + + if (priv->features & FEATURE_IRQ) { + outb_p(xact | SMBHSTCNT_INTREN | SMBHSTCNT_START, + SMBHSTCNT(priv)); + result = wait_event_timeout(priv->waitq, + (status = priv->status), + adap->timeout); + if (!result) { + status = -ETIMEDOUT; + dev_warn(&priv->pci_dev->dev, + "Timeout waiting for interrupt!\n"); + } + priv->status = 0; + return i801_check_post(priv, status); + } + + /* the current contents of SMBHSTCNT can be overwritten, since PEC, + * SMBSCMD are passed in xact */ + outb_p(xact | SMBHSTCNT_START, SMBHSTCNT(priv)); + + status = i801_wait_intr(priv); + return i801_check_post(priv, status); +} + +static int i801_block_transaction_by_block(struct i801_priv *priv, + union i2c_smbus_data *data, + char read_write, int command, + int hwpec) +{ + int i, len; + int status; + int xact = hwpec ? SMBHSTCNT_PEC_EN : 0; + + switch (command) { + case I2C_SMBUS_BLOCK_PROC_CALL: + xact |= I801_BLOCK_PROC_CALL; + break; + case I2C_SMBUS_BLOCK_DATA: + xact |= I801_BLOCK_DATA; + break; + default: + return -EOPNOTSUPP; + } + + inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */ + + /* Use 32-byte buffer to process this transaction */ + if (read_write == I2C_SMBUS_WRITE) { + len = data->block[0]; + outb_p(len, SMBHSTDAT0(priv)); + for (i = 0; i < len; i++) + outb_p(data->block[i+1], SMBBLKDAT(priv)); + } + + status = i801_transaction(priv, xact); + if (status) + return status; + + if (read_write == I2C_SMBUS_READ || + command == I2C_SMBUS_BLOCK_PROC_CALL) { + len = inb_p(SMBHSTDAT0(priv)); + if (len < 1 || len > I2C_SMBUS_BLOCK_MAX) + return -EPROTO; + + data->block[0] = len; + for (i = 0; i < len; i++) + data->block[i + 1] = inb_p(SMBBLKDAT(priv)); + } + return 0; +} + +static void i801_isr_byte_done(struct i801_priv *priv) +{ + if (priv->is_read) { + /* For SMBus block reads, length is received with first byte */ + if (((priv->cmd & 0x1c) == I801_BLOCK_DATA) && + (priv->count == 0)) { + priv->len = inb_p(SMBHSTDAT0(priv)); + if (priv->len < 1 || priv->len > I2C_SMBUS_BLOCK_MAX) { + dev_err(&priv->pci_dev->dev, + "Illegal SMBus block read size %d\n", + priv->len); + /* FIXME: Recover */ + priv->len = I2C_SMBUS_BLOCK_MAX; + } else { + dev_dbg(&priv->pci_dev->dev, + "SMBus block read size is %d\n", + priv->len); + } + priv->data[-1] = priv->len; + } + + /* Read next byte */ + if (priv->count < priv->len) + priv->data[priv->count++] = inb(SMBBLKDAT(priv)); + else + dev_dbg(&priv->pci_dev->dev, + "Discarding extra byte on block read\n"); + + /* Set LAST_BYTE for last byte of read transaction */ + if (priv->count == priv->len - 1) + outb_p(priv->cmd | SMBHSTCNT_LAST_BYTE, + SMBHSTCNT(priv)); + } else if (priv->count < priv->len - 1) { + /* Write next byte, except for IRQ after last byte */ + outb_p(priv->data[++priv->count], SMBBLKDAT(priv)); + } + + /* Clear BYTE_DONE to continue with next byte */ + outb_p(SMBHSTSTS_BYTE_DONE, SMBHSTSTS(priv)); +} + +static irqreturn_t i801_host_notify_isr(struct i801_priv *priv) +{ + unsigned short addr; + + addr = inb_p(SMBNTFDADD(priv)) >> 1; + + /* + * With the tested platforms, reading SMBNTFDDAT (22 + (p)->smba) + * always returns 0. Our current implementation doesn't provide + * data, so we just ignore it. + */ + i2c_handle_smbus_host_notify(&priv->adapter, addr); + + /* clear Host Notify bit and return */ + outb_p(SMBSLVSTS_HST_NTFY_STS, SMBSLVSTS(priv)); + return IRQ_HANDLED; +} + +/* + * There are three kinds of interrupts: + * + * 1) i801 signals transaction completion with one of these interrupts: + * INTR - Success + * DEV_ERR - Invalid command, NAK or communication timeout + * BUS_ERR - SMI# transaction collision + * FAILED - transaction was canceled due to a KILL request + * When any of these occur, update ->status and wake up the waitq. + * ->status must be cleared before kicking off the next transaction. + * + * 2) For byte-by-byte (I2C read/write) transactions, one BYTE_DONE interrupt + * occurs for each byte of a byte-by-byte to prepare the next byte. + * + * 3) Host Notify interrupts + */ +static irqreturn_t i801_isr(int irq, void *dev_id) +{ + struct i801_priv *priv = dev_id; + u16 pcists; + u8 status; + + /* Confirm this is our interrupt */ + pci_read_config_word(priv->pci_dev, SMBPCISTS, &pcists); + if (!(pcists & SMBPCISTS_INTS)) + return IRQ_NONE; + + if (priv->features & FEATURE_HOST_NOTIFY) { + status = inb_p(SMBSLVSTS(priv)); + if (status & SMBSLVSTS_HST_NTFY_STS) + return i801_host_notify_isr(priv); + } + + status = inb_p(SMBHSTSTS(priv)); + if (status & SMBHSTSTS_BYTE_DONE) + i801_isr_byte_done(priv); + + /* + * Clear irq sources and report transaction result. + * ->status must be cleared before the next transaction is started. + */ + status &= SMBHSTSTS_INTR | STATUS_ERROR_FLAGS; + if (status) { + outb_p(status, SMBHSTSTS(priv)); + priv->status = status; + wake_up(&priv->waitq); + } + + return IRQ_HANDLED; +} + +/* + * For "byte-by-byte" block transactions: + * I2C write uses cmd=I801_BLOCK_DATA, I2C_EN=1 + * I2C read uses cmd=I801_I2C_BLOCK_DATA + */ +static int i801_block_transaction_byte_by_byte(struct i801_priv *priv, + union i2c_smbus_data *data, + char read_write, int command, + int hwpec) +{ + int i, len; + int smbcmd; + int status; + int result; + const struct i2c_adapter *adap = &priv->adapter; + + if (command == I2C_SMBUS_BLOCK_PROC_CALL) + return -EOPNOTSUPP; + + result = i801_check_pre(priv); + if (result < 0) + return result; + + len = data->block[0]; + + if (read_write == I2C_SMBUS_WRITE) { + outb_p(len, SMBHSTDAT0(priv)); + outb_p(data->block[1], SMBBLKDAT(priv)); + } + + if (command == I2C_SMBUS_I2C_BLOCK_DATA && + read_write == I2C_SMBUS_READ) + smbcmd = I801_I2C_BLOCK_DATA; + else + smbcmd = I801_BLOCK_DATA; + + if (priv->features & FEATURE_IRQ) { + priv->is_read = (read_write == I2C_SMBUS_READ); + if (len == 1 && priv->is_read) + smbcmd |= SMBHSTCNT_LAST_BYTE; + priv->cmd = smbcmd | SMBHSTCNT_INTREN; + priv->len = len; + priv->count = 0; + priv->data = &data->block[1]; + + outb_p(priv->cmd | SMBHSTCNT_START, SMBHSTCNT(priv)); + result = wait_event_timeout(priv->waitq, + (status = priv->status), + adap->timeout); + if (!result) { + status = -ETIMEDOUT; + dev_warn(&priv->pci_dev->dev, + "Timeout waiting for interrupt!\n"); + } + priv->status = 0; + return i801_check_post(priv, status); + } + + for (i = 1; i <= len; i++) { + if (i == len && read_write == I2C_SMBUS_READ) + smbcmd |= SMBHSTCNT_LAST_BYTE; + outb_p(smbcmd, SMBHSTCNT(priv)); + + if (i == 1) + outb_p(inb(SMBHSTCNT(priv)) | SMBHSTCNT_START, + SMBHSTCNT(priv)); + + status = i801_wait_byte_done(priv); + if (status) + goto exit; + + if (i == 1 && read_write == I2C_SMBUS_READ + && command != I2C_SMBUS_I2C_BLOCK_DATA) { + len = inb_p(SMBHSTDAT0(priv)); + if (len < 1 || len > I2C_SMBUS_BLOCK_MAX) { + dev_err(&priv->pci_dev->dev, + "Illegal SMBus block read size %d\n", + len); + /* Recover */ + while (inb_p(SMBHSTSTS(priv)) & + SMBHSTSTS_HOST_BUSY) + outb_p(SMBHSTSTS_BYTE_DONE, + SMBHSTSTS(priv)); + outb_p(SMBHSTSTS_INTR, SMBHSTSTS(priv)); + return -EPROTO; + } + data->block[0] = len; + } + + /* Retrieve/store value in SMBBLKDAT */ + if (read_write == I2C_SMBUS_READ) + data->block[i] = inb_p(SMBBLKDAT(priv)); + if (read_write == I2C_SMBUS_WRITE && i+1 <= len) + outb_p(data->block[i+1], SMBBLKDAT(priv)); + + /* signals SMBBLKDAT ready */ + outb_p(SMBHSTSTS_BYTE_DONE, SMBHSTSTS(priv)); + } + + status = i801_wait_intr(priv); +exit: + return i801_check_post(priv, status); +} + +static int i801_set_block_buffer_mode(struct i801_priv *priv) +{ + outb_p(inb_p(SMBAUXCTL(priv)) | SMBAUXCTL_E32B, SMBAUXCTL(priv)); + if ((inb_p(SMBAUXCTL(priv)) & SMBAUXCTL_E32B) == 0) + return -EIO; + return 0; +} + +/* Block transaction function */ +static int i801_block_transaction(struct i801_priv *priv, + union i2c_smbus_data *data, char read_write, + int command, int hwpec) +{ + int result = 0; + unsigned char hostc; + + if (command == I2C_SMBUS_I2C_BLOCK_DATA) { + if (read_write == I2C_SMBUS_WRITE) { + /* set I2C_EN bit in configuration register */ + pci_read_config_byte(priv->pci_dev, SMBHSTCFG, &hostc); + pci_write_config_byte(priv->pci_dev, SMBHSTCFG, + hostc | SMBHSTCFG_I2C_EN); + } else if (!(priv->features & FEATURE_I2C_BLOCK_READ)) { + dev_err(&priv->pci_dev->dev, + "I2C block read is unsupported!\n"); + return -EOPNOTSUPP; + } + } + + if (read_write == I2C_SMBUS_WRITE + || command == I2C_SMBUS_I2C_BLOCK_DATA) { + if (data->block[0] < 1) + data->block[0] = 1; + if (data->block[0] > I2C_SMBUS_BLOCK_MAX) + data->block[0] = I2C_SMBUS_BLOCK_MAX; + } else { + data->block[0] = 32; /* max for SMBus block reads */ + } + + /* Experience has shown that the block buffer can only be used for + SMBus (not I2C) block transactions, even though the datasheet + doesn't mention this limitation. */ + if ((priv->features & FEATURE_BLOCK_BUFFER) + && command != I2C_SMBUS_I2C_BLOCK_DATA + && i801_set_block_buffer_mode(priv) == 0) + result = i801_block_transaction_by_block(priv, data, + read_write, + command, hwpec); + else + result = i801_block_transaction_byte_by_byte(priv, data, + read_write, + command, hwpec); + + if (command == I2C_SMBUS_I2C_BLOCK_DATA + && read_write == I2C_SMBUS_WRITE) { + /* restore saved configuration register value */ + pci_write_config_byte(priv->pci_dev, SMBHSTCFG, hostc); + } + return result; +} + +/* Return negative errno on error. */ +static s32 i801_access(struct i2c_adapter *adap, u16 addr, + unsigned short flags, char read_write, u8 command, + int size, union i2c_smbus_data *data) +{ + int hwpec; + int block = 0; + int ret = 0, xact = 0; + struct i801_priv *priv = i2c_get_adapdata(adap); + + mutex_lock(&priv->acpi_lock); + if (priv->acpi_reserved) { + mutex_unlock(&priv->acpi_lock); + return -EBUSY; + } + + pm_runtime_get_sync(&priv->pci_dev->dev); + + hwpec = (priv->features & FEATURE_SMBUS_PEC) && (flags & I2C_CLIENT_PEC) + && size != I2C_SMBUS_QUICK + && size != I2C_SMBUS_I2C_BLOCK_DATA; + + switch (size) { + case I2C_SMBUS_QUICK: + outb_p(((addr & 0x7f) << 1) | (read_write & 0x01), + SMBHSTADD(priv)); + xact = I801_QUICK; + break; + case I2C_SMBUS_BYTE: + outb_p(((addr & 0x7f) << 1) | (read_write & 0x01), + SMBHSTADD(priv)); + if (read_write == I2C_SMBUS_WRITE) + outb_p(command, SMBHSTCMD(priv)); + xact = I801_BYTE; + break; + case I2C_SMBUS_BYTE_DATA: + outb_p(((addr & 0x7f) << 1) | (read_write & 0x01), + SMBHSTADD(priv)); + outb_p(command, SMBHSTCMD(priv)); + if (read_write == I2C_SMBUS_WRITE) + outb_p(data->byte, SMBHSTDAT0(priv)); + xact = I801_BYTE_DATA; + break; + case I2C_SMBUS_WORD_DATA: + outb_p(((addr & 0x7f) << 1) | (read_write & 0x01), + SMBHSTADD(priv)); + outb_p(command, SMBHSTCMD(priv)); + if (read_write == I2C_SMBUS_WRITE) { + outb_p(data->word & 0xff, SMBHSTDAT0(priv)); + outb_p((data->word & 0xff00) >> 8, SMBHSTDAT1(priv)); + } + xact = I801_WORD_DATA; + break; + case I2C_SMBUS_BLOCK_DATA: + outb_p(((addr & 0x7f) << 1) | (read_write & 0x01), + SMBHSTADD(priv)); + outb_p(command, SMBHSTCMD(priv)); + block = 1; + break; + case I2C_SMBUS_I2C_BLOCK_DATA: + /* + * NB: page 240 of ICH5 datasheet shows that the R/#W + * bit should be cleared here, even when reading. + * However if SPD Write Disable is set (Lynx Point and later), + * the read will fail if we don't set the R/#W bit. + */ + outb_p(((addr & 0x7f) << 1) | + ((priv->original_hstcfg & SMBHSTCFG_SPD_WD) ? + (read_write & 0x01) : 0), + SMBHSTADD(priv)); + if (read_write == I2C_SMBUS_READ) { + /* NB: page 240 of ICH5 datasheet also shows + * that DATA1 is the cmd field when reading */ + outb_p(command, SMBHSTDAT1(priv)); + } else + outb_p(command, SMBHSTCMD(priv)); + block = 1; + break; + case I2C_SMBUS_BLOCK_PROC_CALL: + /* + * Bit 0 of the slave address register always indicate a write + * command. + */ + outb_p((addr & 0x7f) << 1, SMBHSTADD(priv)); + outb_p(command, SMBHSTCMD(priv)); + block = 1; + break; + default: + dev_err(&priv->pci_dev->dev, "Unsupported transaction %d\n", + size); + ret = -EOPNOTSUPP; + goto out; + } + + if (hwpec) /* enable/disable hardware PEC */ + outb_p(inb_p(SMBAUXCTL(priv)) | SMBAUXCTL_CRC, SMBAUXCTL(priv)); + else + outb_p(inb_p(SMBAUXCTL(priv)) & (~SMBAUXCTL_CRC), + SMBAUXCTL(priv)); + + if (block) + ret = i801_block_transaction(priv, data, read_write, size, + hwpec); + else + ret = i801_transaction(priv, xact); + + /* Some BIOSes don't like it when PEC is enabled at reboot or resume + time, so we forcibly disable it after every transaction. Turn off + E32B for the same reason. */ + if (hwpec || block) + outb_p(inb_p(SMBAUXCTL(priv)) & + ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), SMBAUXCTL(priv)); + + if (block) + goto out; + if (ret) + goto out; + if ((read_write == I2C_SMBUS_WRITE) || (xact == I801_QUICK)) + goto out; + + switch (xact & 0x7f) { + case I801_BYTE: /* Result put in SMBHSTDAT0 */ + case I801_BYTE_DATA: + data->byte = inb_p(SMBHSTDAT0(priv)); + break; + case I801_WORD_DATA: + data->word = inb_p(SMBHSTDAT0(priv)) + + (inb_p(SMBHSTDAT1(priv)) << 8); + break; + } + +out: + pm_runtime_mark_last_busy(&priv->pci_dev->dev); + pm_runtime_put_autosuspend(&priv->pci_dev->dev); + mutex_unlock(&priv->acpi_lock); + return ret; +} + +static u32 i801_func(struct i2c_adapter *adapter) +{ + struct i801_priv *priv = i2c_get_adapdata(adapter); + + return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | + I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK | + ((priv->features & FEATURE_SMBUS_PEC) ? I2C_FUNC_SMBUS_PEC : 0) | + ((priv->features & FEATURE_BLOCK_PROC) ? + I2C_FUNC_SMBUS_BLOCK_PROC_CALL : 0) | + ((priv->features & FEATURE_I2C_BLOCK_READ) ? + I2C_FUNC_SMBUS_READ_I2C_BLOCK : 0) | + ((priv->features & FEATURE_HOST_NOTIFY) ? + I2C_FUNC_SMBUS_HOST_NOTIFY : 0); +} + +static void i801_enable_host_notify(struct i2c_adapter *adapter) +{ + struct i801_priv *priv = i2c_get_adapdata(adapter); + + if (!(priv->features & FEATURE_HOST_NOTIFY)) + return; + + if (!(SMBSLVCMD_HST_NTFY_INTREN & priv->original_slvcmd)) + outb_p(SMBSLVCMD_HST_NTFY_INTREN | priv->original_slvcmd, + SMBSLVCMD(priv)); + + /* clear Host Notify bit to allow a new notification */ + outb_p(SMBSLVSTS_HST_NTFY_STS, SMBSLVSTS(priv)); +} + +static void i801_disable_host_notify(struct i801_priv *priv) +{ + if (!(priv->features & FEATURE_HOST_NOTIFY)) + return; + + outb_p(priv->original_slvcmd, SMBSLVCMD(priv)); +} + +static const struct i2c_algorithm smbus_algorithm = { + .smbus_xfer = i801_access, + .functionality = i801_func, +}; + +static const struct pci_device_id i801_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_3) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_3) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_3) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_4) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_16) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_17) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_17) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_5) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_6) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EP80579_1) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_4) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH10_5) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5_3400_SERIES_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COUGARPOINT_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DH89XXCC_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PANTHERPOINT_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_AVOTON_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS0) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS1) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS2) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COLETOCREEK_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GEMINILAKE_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WILDCATPOINT_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BAYTRAIL_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BRASWELL_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CDF_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EBG_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BROXTON_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LEWISBURG_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LEWISBURG_SSKU_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KABYLAKE_PCH_H_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CANNONLAKE_H_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CANNONLAKE_LP_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICELAKE_LP_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COMETLAKE_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COMETLAKE_H_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COMETLAKE_V_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ELKHART_LAKE_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TIGERLAKE_LP_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TIGERLAKE_H_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_JASPER_LAKE_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ALDER_LAKE_S_SMBUS) }, + { 0, } +}; + +MODULE_DEVICE_TABLE(pci, i801_ids); + +#if defined CONFIG_X86 && defined CONFIG_DMI +static unsigned char apanel_addr; + +/* Scan the system ROM for the signature "FJKEYINF" */ +static __init const void __iomem *bios_signature(const void __iomem *bios) +{ + ssize_t offset; + const unsigned char signature[] = "FJKEYINF"; + + for (offset = 0; offset < 0x10000; offset += 0x10) { + if (check_signature(bios + offset, signature, + sizeof(signature)-1)) + return bios + offset; + } + return NULL; +} + +static void __init input_apanel_init(void) +{ + void __iomem *bios; + const void __iomem *p; + + bios = ioremap(0xF0000, 0x10000); /* Can't fail */ + p = bios_signature(bios); + if (p) { + /* just use the first address */ + apanel_addr = readb(p + 8 + 3) >> 1; + } + iounmap(bios); +} + +struct dmi_onboard_device_info { + const char *name; + u8 type; + unsigned short i2c_addr; + const char *i2c_type; +}; + +static const struct dmi_onboard_device_info dmi_devices[] = { + { "Syleus", DMI_DEV_TYPE_OTHER, 0x73, "fscsyl" }, + { "Hermes", DMI_DEV_TYPE_OTHER, 0x73, "fscher" }, + { "Hades", DMI_DEV_TYPE_OTHER, 0x73, "fschds" }, +}; + +static void dmi_check_onboard_device(u8 type, const char *name, + struct i2c_adapter *adap) +{ + int i; + struct i2c_board_info info; + + for (i = 0; i < ARRAY_SIZE(dmi_devices); i++) { + /* & ~0x80, ignore enabled/disabled bit */ + if ((type & ~0x80) != dmi_devices[i].type) + continue; + if (strcasecmp(name, dmi_devices[i].name)) + continue; + + mem_clear(&info, sizeof(struct i2c_board_info)); + info.addr = dmi_devices[i].i2c_addr; + strlcpy(info.type, dmi_devices[i].i2c_type, I2C_NAME_SIZE); + i2c_new_client_device(adap, &info); + break; + } +} + +/* We use our own function to check for onboard devices instead of + dmi_find_device() as some buggy BIOS's have the devices we are interested + in marked as disabled */ +static void dmi_check_onboard_devices(const struct dmi_header *dm, void *adap) +{ + int i, count; + + if (dm->type != 10) + return; + + count = (dm->length - sizeof(struct dmi_header)) / 2; + for (i = 0; i < count; i++) { + const u8 *d = (char *)(dm + 1) + (i * 2); + const char *name = ((char *) dm) + dm->length; + u8 type = d[0]; + u8 s = d[1]; + + if (!s) + continue; + s--; + while (s > 0 && name[0]) { + name += strlen(name) + 1; + s--; + } + if (name[0] == 0) /* Bogus string reference */ + continue; + + dmi_check_onboard_device(type, name, adap); + } +} + +/* NOTE: Keep this list in sync with drivers/platform/x86/dell-smo8800.c */ +static const char *const acpi_smo8800_ids[] = { + "SMO8800", + "SMO8801", + "SMO8810", + "SMO8811", + "SMO8820", + "SMO8821", + "SMO8830", + "SMO8831", +}; + +static acpi_status check_acpi_smo88xx_device(acpi_handle obj_handle, + u32 nesting_level, + void *context, + void **return_value) +{ + struct acpi_device_info *info; + acpi_status status; + char *hid; + int i; + + status = acpi_get_object_info(obj_handle, &info); + if (ACPI_FAILURE(status)) + return AE_OK; + + if (!(info->valid & ACPI_VALID_HID)) + goto smo88xx_not_found; + + hid = info->hardware_id.string; + if (!hid) + goto smo88xx_not_found; + + i = match_string(acpi_smo8800_ids, ARRAY_SIZE(acpi_smo8800_ids), hid); + if (i < 0) + goto smo88xx_not_found; + + kfree(info); + + *((bool *)return_value) = true; + return AE_CTRL_TERMINATE; + +smo88xx_not_found: + kfree(info); + return AE_OK; +} + +static bool is_dell_system_with_lis3lv02d(void) +{ + bool found; + const char *vendor; + + vendor = dmi_get_system_info(DMI_SYS_VENDOR); + if (!vendor || strcmp(vendor, "Dell Inc.")) + return false; + + /* + * Check that ACPI device SMO88xx is present and is functioning. + * Function acpi_get_devices() already filters all ACPI devices + * which are not present or are not functioning. + * ACPI device SMO88xx represents our ST microelectronics lis3lv02d + * accelerometer but unfortunately ACPI does not provide any other + * information (like I2C address). + */ + found = false; + acpi_get_devices(NULL, check_acpi_smo88xx_device, NULL, + (void **)&found); + + return found; +} + +/* + * Accelerometer's I2C address is not specified in DMI nor ACPI, + * so it is needed to define mapping table based on DMI product names. + */ +static const struct { + const char *dmi_product_name; + unsigned short i2c_addr; +} dell_lis3lv02d_devices[] = { + /* + * Dell platform team told us that these Latitude devices have + * ST microelectronics accelerometer at I2C address 0x29. + */ + { "Latitude E5250", 0x29 }, + { "Latitude E5450", 0x29 }, + { "Latitude E5550", 0x29 }, + { "Latitude E6440", 0x29 }, + { "Latitude E6440 ATG", 0x29 }, + { "Latitude E6540", 0x29 }, + /* + * Additional individual entries were added after verification. + */ + { "Latitude 5480", 0x29 }, + { "Vostro V131", 0x1d }, +}; + +static void register_dell_lis3lv02d_i2c_device(struct i801_priv *priv) +{ + struct i2c_board_info info; + const char *dmi_product_name; + int i; + + dmi_product_name = dmi_get_system_info(DMI_PRODUCT_NAME); + for (i = 0; i < ARRAY_SIZE(dell_lis3lv02d_devices); ++i) { + if (strcmp(dmi_product_name, + dell_lis3lv02d_devices[i].dmi_product_name) == 0) + break; + } + + if (i == ARRAY_SIZE(dell_lis3lv02d_devices)) { + dev_warn(&priv->pci_dev->dev, + "Accelerometer lis3lv02d is present on SMBus but its" + " address is unknown, skipping registration\n"); + return; + } + + mem_clear(&info, sizeof(struct i2c_board_info)); + info.addr = dell_lis3lv02d_devices[i].i2c_addr; + strlcpy(info.type, "lis3lv02d", I2C_NAME_SIZE); + i2c_new_client_device(&priv->adapter, &info); +} + +/* Register optional slaves */ +static void i801_probe_optional_slaves(struct i801_priv *priv) +{ + /* Only register slaves on main SMBus channel */ + if (priv->features & FEATURE_IDF) + return; + + if (apanel_addr) { + struct i2c_board_info info; + + mem_clear(&info, sizeof(struct i2c_board_info)); + info.addr = apanel_addr; + strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE); + i2c_new_client_device(&priv->adapter, &info); + } + + if (dmi_name_in_vendors("FUJITSU")) + dmi_walk(dmi_check_onboard_devices, &priv->adapter); + + if (is_dell_system_with_lis3lv02d()) + register_dell_lis3lv02d_i2c_device(priv); + + /* Instantiate SPD EEPROMs unless the SMBus is multiplexed */ +#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) + if (!priv->mux_drvdata) +#endif + i2c_register_spd(&priv->adapter); +} +#else +static void __init input_apanel_init(void) {} +static void i801_probe_optional_slaves(struct i801_priv *priv) {} +#endif /* CONFIG_X86 && CONFIG_DMI */ + +#if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI +static struct i801_mux_config i801_mux_config_asus_z8_d12 = { + .gpio_chip = "gpio_ich", + .values = { 0x02, 0x03 }, + .n_values = 2, + .classes = { I2C_CLASS_SPD, I2C_CLASS_SPD }, + .gpios = { 52, 53 }, + .n_gpios = 2, +}; + +static struct i801_mux_config i801_mux_config_asus_z8_d18 = { + .gpio_chip = "gpio_ich", + .values = { 0x02, 0x03, 0x01 }, + .n_values = 3, + .classes = { I2C_CLASS_SPD, I2C_CLASS_SPD, I2C_CLASS_SPD }, + .gpios = { 52, 53 }, + .n_gpios = 2, +}; + +static const struct dmi_system_id mux_dmi_table[] = { + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "Z8NA-D6(C)"), + }, + .driver_data = &i801_mux_config_asus_z8_d12, + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "Z8P(N)E-D12(X)"), + }, + .driver_data = &i801_mux_config_asus_z8_d12, + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "Z8NH-D12"), + }, + .driver_data = &i801_mux_config_asus_z8_d12, + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "Z8PH-D12/IFB"), + }, + .driver_data = &i801_mux_config_asus_z8_d12, + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "Z8NR-D12"), + }, + .driver_data = &i801_mux_config_asus_z8_d12, + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "Z8P(N)H-D12"), + }, + .driver_data = &i801_mux_config_asus_z8_d12, + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "Z8PG-D18"), + }, + .driver_data = &i801_mux_config_asus_z8_d18, + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "Z8PE-D18"), + }, + .driver_data = &i801_mux_config_asus_z8_d18, + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."), + DMI_MATCH(DMI_BOARD_NAME, "Z8PS-D12"), + }, + .driver_data = &i801_mux_config_asus_z8_d12, + }, + { } +}; + +/* Setup multiplexing if needed */ +static int i801_add_mux(struct i801_priv *priv) +{ + struct device *dev = &priv->adapter.dev; + const struct i801_mux_config *mux_config; + struct i2c_mux_gpio_platform_data gpio_data; + struct gpiod_lookup_table *lookup; + int err, i; + + if (!priv->mux_drvdata) + return 0; + mux_config = priv->mux_drvdata; + + /* Prepare the platform data */ + mem_clear(&gpio_data, sizeof(struct i2c_mux_gpio_platform_data)); + gpio_data.parent = priv->adapter.nr; + gpio_data.values = mux_config->values; + gpio_data.n_values = mux_config->n_values; + gpio_data.classes = mux_config->classes; + gpio_data.idle = I2C_MUX_GPIO_NO_IDLE; + + /* Register GPIO descriptor lookup table */ + lookup = devm_kzalloc(dev, + struct_size(lookup, table, mux_config->n_gpios + 1), + GFP_KERNEL); + if (!lookup) + return -ENOMEM; + lookup->dev_id = "i2c-mux-gpio"; + for (i = 0; i < mux_config->n_gpios; i++) { + lookup->table[i] = (struct gpiod_lookup) + GPIO_LOOKUP(mux_config->gpio_chip, + mux_config->gpios[i], "mux", 0); + } + gpiod_add_lookup_table(lookup); + priv->lookup = lookup; + + /* + * Register the mux device, we use PLATFORM_DEVID_NONE here + * because since we are referring to the GPIO chip by name we are + * anyways in deep trouble if there is more than one of these + * devices, and there should likely only be one platform controller + * hub. + */ + priv->mux_pdev = platform_device_register_data(dev, "i2c-mux-gpio", + PLATFORM_DEVID_NONE, &gpio_data, + sizeof(struct i2c_mux_gpio_platform_data)); + if (IS_ERR(priv->mux_pdev)) { + err = PTR_ERR(priv->mux_pdev); + gpiod_remove_lookup_table(lookup); + priv->mux_pdev = NULL; + dev_err(dev, "Failed to register i2c-mux-gpio device\n"); + return err; + } + + return 0; +} + +static void i801_del_mux(struct i801_priv *priv) +{ + if (priv->mux_pdev) + platform_device_unregister(priv->mux_pdev); + if (priv->lookup) + gpiod_remove_lookup_table(priv->lookup); +} + +static unsigned int i801_get_adapter_class(struct i801_priv *priv) +{ + const struct dmi_system_id *id; + const struct i801_mux_config *mux_config; + unsigned int class = I2C_CLASS_HWMON | I2C_CLASS_SPD; + int i; + + id = dmi_first_match(mux_dmi_table); + if (id) { + /* Remove branch classes from trunk */ + mux_config = id->driver_data; + for (i = 0; i < mux_config->n_values; i++) + class &= ~mux_config->classes[i]; + + /* Remember for later */ + priv->mux_drvdata = mux_config; + } + + return class; +} +#else +static inline int i801_add_mux(struct i801_priv *priv) { return 0; } +static inline void i801_del_mux(struct i801_priv *priv) { } + +static inline unsigned int i801_get_adapter_class(struct i801_priv *priv) +{ + return I2C_CLASS_HWMON | I2C_CLASS_SPD; +} +#endif + +static const struct itco_wdt_platform_data spt_tco_platform_data = { + .name = "Intel PCH", + .version = 4, +}; + +static DEFINE_SPINLOCK(p2sb_spinlock); + +static struct platform_device * +i801_add_tco_spt(struct i801_priv *priv, struct pci_dev *pci_dev, + struct resource *tco_res) +{ + struct resource *res; + unsigned int devfn; + u64 base64_addr; + u32 base_addr; + u8 hidden; + + /* + * We must access the NO_REBOOT bit over the Primary to Sideband + * bridge (P2SB). The BIOS prevents the P2SB device from being + * enumerated by the PCI subsystem, so we need to unhide/hide it + * to lookup the P2SB BAR. + */ + spin_lock(&p2sb_spinlock); + + devfn = PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 1); + + /* Unhide the P2SB device, if it is hidden */ + pci_bus_read_config_byte(pci_dev->bus, devfn, 0xe1, &hidden); + if (hidden) + pci_bus_write_config_byte(pci_dev->bus, devfn, 0xe1, 0x0); + + pci_bus_read_config_dword(pci_dev->bus, devfn, SBREG_BAR, &base_addr); + base64_addr = base_addr & 0xfffffff0; + + pci_bus_read_config_dword(pci_dev->bus, devfn, SBREG_BAR + 0x4, &base_addr); + base64_addr |= (u64)base_addr << 32; + + /* Hide the P2SB device, if it was hidden before */ + if (hidden) + pci_bus_write_config_byte(pci_dev->bus, devfn, 0xe1, hidden); + spin_unlock(&p2sb_spinlock); + + res = &tco_res[1]; + if (pci_dev->device == PCI_DEVICE_ID_INTEL_DNV_SMBUS) + res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL_DNV; + else + res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL; + + res->end = res->start + 3; + res->flags = IORESOURCE_MEM; + + return platform_device_register_resndata(&pci_dev->dev, "iTCO_wdt", -1, + tco_res, 2, &spt_tco_platform_data, + sizeof(spt_tco_platform_data)); +} + +static const struct itco_wdt_platform_data cnl_tco_platform_data = { + .name = "Intel PCH", + .version = 6, +}; + +static struct platform_device * +i801_add_tco_cnl(struct i801_priv *priv, struct pci_dev *pci_dev, + struct resource *tco_res) +{ + return platform_device_register_resndata(&pci_dev->dev, + "iTCO_wdt", -1, tco_res, 1, &cnl_tco_platform_data, + sizeof(cnl_tco_platform_data)); +} + +static void i801_add_tco(struct i801_priv *priv) +{ + struct pci_dev *pci_dev = priv->pci_dev; + struct resource tco_res[2], *res; + u32 tco_base, tco_ctl; + + /* If we have ACPI based watchdog use that instead */ + if (acpi_has_watchdog()) + return; + + if (!(priv->features & (FEATURE_TCO_SPT | FEATURE_TCO_CNL))) + return; + + pci_read_config_dword(pci_dev, TCOBASE, &tco_base); + pci_read_config_dword(pci_dev, TCOCTL, &tco_ctl); + if (!(tco_ctl & TCOCTL_EN)) + return; + + mem_clear(tco_res, sizeof(tco_res)); + /* + * Always populate the main iTCO IO resource here. The second entry + * for NO_REBOOT MMIO is filled by the SPT specific function. + */ + res = &tco_res[0]; + res->start = tco_base & ~1; + res->end = res->start + 32 - 1; + res->flags = IORESOURCE_IO; + + if (priv->features & FEATURE_TCO_CNL) + priv->tco_pdev = i801_add_tco_cnl(priv, pci_dev, tco_res); + else + priv->tco_pdev = i801_add_tco_spt(priv, pci_dev, tco_res); + + if (IS_ERR(priv->tco_pdev)) + dev_warn(&pci_dev->dev, "failed to create iTCO device\n"); +} + +#ifdef CONFIG_ACPI +static bool i801_acpi_is_smbus_ioport(const struct i801_priv *priv, + acpi_physical_address address) +{ + return address >= priv->smba && + address <= pci_resource_end(priv->pci_dev, SMBBAR); +} + +static acpi_status +i801_acpi_io_handler(u32 function, acpi_physical_address address, u32 bits, + u64 *value, void *handler_context, void *region_context) +{ + struct i801_priv *priv = handler_context; + struct pci_dev *pdev = priv->pci_dev; + acpi_status status; + + /* + * Once BIOS AML code touches the OpRegion we warn and inhibit any + * further access from the driver itself. This device is now owned + * by the system firmware. + */ + mutex_lock(&priv->acpi_lock); + + if (!priv->acpi_reserved && i801_acpi_is_smbus_ioport(priv, address)) { + priv->acpi_reserved = true; + + dev_warn(&pdev->dev, "BIOS is accessing SMBus registers\n"); + dev_warn(&pdev->dev, "Driver SMBus register access inhibited\n"); + + /* + * BIOS is accessing the host controller so prevent it from + * suspending automatically from now on. + */ + pm_runtime_get_sync(&pdev->dev); + } + + if ((function & ACPI_IO_MASK) == ACPI_READ) + status = acpi_os_read_port(address, (u32 *)value, bits); + else + status = acpi_os_write_port(address, (u32)*value, bits); + + mutex_unlock(&priv->acpi_lock); + + return status; +} + +static int i801_acpi_probe(struct i801_priv *priv) +{ + struct acpi_device *adev; + acpi_status status; + + adev = ACPI_COMPANION(&priv->pci_dev->dev); + if (adev) { + status = acpi_install_address_space_handler(adev->handle, + ACPI_ADR_SPACE_SYSTEM_IO, i801_acpi_io_handler, + NULL, priv); + if (ACPI_SUCCESS(status)) + return 0; + } + + return acpi_check_resource_conflict(&priv->pci_dev->resource[SMBBAR]); +} + +static void i801_acpi_remove(struct i801_priv *priv) +{ + struct acpi_device *adev; + + adev = ACPI_COMPANION(&priv->pci_dev->dev); + if (!adev) + return; + + acpi_remove_address_space_handler(adev->handle, + ACPI_ADR_SPACE_SYSTEM_IO, i801_acpi_io_handler); + + mutex_lock(&priv->acpi_lock); + if (priv->acpi_reserved) + pm_runtime_put(&priv->pci_dev->dev); + mutex_unlock(&priv->acpi_lock); +} +#else +static inline int i801_acpi_probe(struct i801_priv *priv) { return 0; } +static inline void i801_acpi_remove(struct i801_priv *priv) { } +#endif + +static unsigned char i801_setup_hstcfg(struct i801_priv *priv) +{ + unsigned char hstcfg = priv->original_hstcfg; + + hstcfg &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */ + hstcfg |= SMBHSTCFG_HST_EN; + pci_write_config_byte(priv->pci_dev, SMBHSTCFG, hstcfg); + return hstcfg; +} + +static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) +{ + unsigned char temp; + int err, i; + struct i801_priv *priv; + + priv = devm_kzalloc(&dev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + i2c_set_adapdata(&priv->adapter, priv); + priv->adapter.owner = THIS_MODULE; + priv->adapter.class = i801_get_adapter_class(priv); + priv->adapter.algo = &smbus_algorithm; + priv->adapter.dev.parent = &dev->dev; + ACPI_COMPANION_SET(&priv->adapter.dev, ACPI_COMPANION(&dev->dev)); + priv->adapter.retries = 3; + mutex_init(&priv->acpi_lock); + + priv->pci_dev = dev; + switch (dev->device) { + case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_SMBUS: + case PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_SMBUS: + case PCI_DEVICE_ID_INTEL_LEWISBURG_SMBUS: + case PCI_DEVICE_ID_INTEL_LEWISBURG_SSKU_SMBUS: + case PCI_DEVICE_ID_INTEL_DNV_SMBUS: + case PCI_DEVICE_ID_INTEL_KABYLAKE_PCH_H_SMBUS: + case PCI_DEVICE_ID_INTEL_COMETLAKE_V_SMBUS: + priv->features |= FEATURE_BLOCK_PROC; + priv->features |= FEATURE_I2C_BLOCK_READ; + priv->features |= FEATURE_IRQ; + priv->features |= FEATURE_SMBUS_PEC; + priv->features |= FEATURE_BLOCK_BUFFER; + priv->features |= FEATURE_TCO_SPT; + priv->features |= FEATURE_HOST_NOTIFY; + break; + + case PCI_DEVICE_ID_INTEL_CANNONLAKE_H_SMBUS: + case PCI_DEVICE_ID_INTEL_CANNONLAKE_LP_SMBUS: + case PCI_DEVICE_ID_INTEL_CDF_SMBUS: + case PCI_DEVICE_ID_INTEL_ICELAKE_LP_SMBUS: + case PCI_DEVICE_ID_INTEL_COMETLAKE_SMBUS: + case PCI_DEVICE_ID_INTEL_COMETLAKE_H_SMBUS: + case PCI_DEVICE_ID_INTEL_ELKHART_LAKE_SMBUS: + case PCI_DEVICE_ID_INTEL_TIGERLAKE_LP_SMBUS: + case PCI_DEVICE_ID_INTEL_TIGERLAKE_H_SMBUS: + case PCI_DEVICE_ID_INTEL_JASPER_LAKE_SMBUS: + case PCI_DEVICE_ID_INTEL_EBG_SMBUS: + case PCI_DEVICE_ID_INTEL_ALDER_LAKE_S_SMBUS: + priv->features |= FEATURE_BLOCK_PROC; + priv->features |= FEATURE_I2C_BLOCK_READ; + priv->features |= FEATURE_IRQ; + priv->features |= FEATURE_SMBUS_PEC; + priv->features |= FEATURE_BLOCK_BUFFER; + priv->features |= FEATURE_TCO_CNL; + priv->features |= FEATURE_HOST_NOTIFY; + break; + + case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF0: + case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF1: + case PCI_DEVICE_ID_INTEL_PATSBURG_SMBUS_IDF2: + case PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS0: + case PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS1: + case PCI_DEVICE_ID_INTEL_WELLSBURG_SMBUS_MS2: + priv->features |= FEATURE_IDF; + fallthrough; + default: + priv->features |= FEATURE_BLOCK_PROC; + priv->features |= FEATURE_I2C_BLOCK_READ; + priv->features |= FEATURE_IRQ; + fallthrough; + case PCI_DEVICE_ID_INTEL_82801DB_3: + priv->features |= FEATURE_SMBUS_PEC; + priv->features |= FEATURE_BLOCK_BUFFER; + fallthrough; + case PCI_DEVICE_ID_INTEL_82801CA_3: + priv->features |= FEATURE_HOST_NOTIFY; + fallthrough; + case PCI_DEVICE_ID_INTEL_82801BA_2: + case PCI_DEVICE_ID_INTEL_82801AB_3: + case PCI_DEVICE_ID_INTEL_82801AA_3: + break; + } + + /* Disable features on user request */ + for (i = 0; i < ARRAY_SIZE(i801_feature_names); i++) { + if (priv->features & disable_features & (1 << i)) + dev_notice(&dev->dev, "%s disabled by user\n", + i801_feature_names[i]); + } + priv->features &= ~disable_features; + + err = pcim_enable_device(dev); + if (err) { + dev_err(&dev->dev, "Failed to enable SMBus PCI device (%d)\n", + err); + return err; + } + pcim_pin_device(dev); + + /* Determine the address of the SMBus area */ + priv->smba = pci_resource_start(dev, SMBBAR); + if (!priv->smba) { + dev_err(&dev->dev, + "SMBus base address uninitialized, upgrade BIOS\n"); + return -ENODEV; + } + + if (i801_acpi_probe(priv)) + return -ENODEV; + + err = pcim_iomap_regions(dev, 1 << SMBBAR, + dev_driver_string(&dev->dev)); + if (err) { + dev_err(&dev->dev, + "Failed to request SMBus region 0x%lx-0x%Lx\n", + priv->smba, + (unsigned long long)pci_resource_end(dev, SMBBAR)); + i801_acpi_remove(priv); + return err; + } + + pci_read_config_byte(priv->pci_dev, SMBHSTCFG, &priv->original_hstcfg); + temp = i801_setup_hstcfg(priv); + if (!(priv->original_hstcfg & SMBHSTCFG_HST_EN)) + dev_info(&dev->dev, "Enabling SMBus device\n"); + + if (temp & SMBHSTCFG_SMB_SMI_EN) { + dev_dbg(&dev->dev, "SMBus using interrupt SMI#\n"); + /* Disable SMBus interrupt feature if SMBus using SMI# */ + priv->features &= ~FEATURE_IRQ; + } + if (temp & SMBHSTCFG_SPD_WD) + dev_info(&dev->dev, "SPD Write Disable is set\n"); + + /* Clear special mode bits */ + if (priv->features & (FEATURE_SMBUS_PEC | FEATURE_BLOCK_BUFFER)) + outb_p(inb_p(SMBAUXCTL(priv)) & + ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), SMBAUXCTL(priv)); + + /* Remember original Host Notify setting */ + if (priv->features & FEATURE_HOST_NOTIFY) + priv->original_slvcmd = inb_p(SMBSLVCMD(priv)); + + /* Default timeout in interrupt mode: 200 ms */ + priv->adapter.timeout = HZ / 5; + + if (dev->irq == IRQ_NOTCONNECTED) + priv->features &= ~FEATURE_IRQ; + + if (priv->features & FEATURE_IRQ) { + u16 pcictl, pcists; + + /* Complain if an interrupt is already pending */ + pci_read_config_word(priv->pci_dev, SMBPCISTS, &pcists); + if (pcists & SMBPCISTS_INTS) + dev_warn(&dev->dev, "An interrupt is pending!\n"); + + /* Check if interrupts have been disabled */ + pci_read_config_word(priv->pci_dev, SMBPCICTL, &pcictl); + if (pcictl & SMBPCICTL_INTDIS) { + dev_info(&dev->dev, "Interrupts are disabled\n"); + priv->features &= ~FEATURE_IRQ; + } + } + + if (priv->features & FEATURE_IRQ) { + init_waitqueue_head(&priv->waitq); + + err = devm_request_irq(&dev->dev, dev->irq, i801_isr, + IRQF_SHARED, + dev_driver_string(&dev->dev), priv); + if (err) { + dev_err(&dev->dev, "Failed to allocate irq %d: %d\n", + dev->irq, err); + priv->features &= ~FEATURE_IRQ; + } + } + dev_info(&dev->dev, "SMBus using %s\n", + priv->features & FEATURE_IRQ ? "PCI interrupt" : "polling"); + + i801_add_tco(priv); + + snprintf(priv->adapter.name, sizeof(priv->adapter.name), + "SMBus I801 adapter at %04lx", priv->smba); + err = i2c_add_adapter(&priv->adapter); + if (err) { + i801_acpi_remove(priv); + return err; + } + + i801_enable_host_notify(&priv->adapter); + + i801_probe_optional_slaves(priv); + /* We ignore errors - multiplexing is optional */ + i801_add_mux(priv); + + pci_set_drvdata(dev, priv); + + dev_pm_set_driver_flags(&dev->dev, DPM_FLAG_NO_DIRECT_COMPLETE); + pm_runtime_set_autosuspend_delay(&dev->dev, 1000); + pm_runtime_use_autosuspend(&dev->dev); + pm_runtime_put_autosuspend(&dev->dev); + pm_runtime_allow(&dev->dev); + dev_info(&dev->dev, "wb-i2c-i801 probe ok.\n"); + + return 0; +} + +static void i801_remove(struct pci_dev *dev) +{ + struct i801_priv *priv = pci_get_drvdata(dev); + + pm_runtime_forbid(&dev->dev); + pm_runtime_get_noresume(&dev->dev); + + i801_disable_host_notify(priv); + i801_del_mux(priv); + i2c_del_adapter(&priv->adapter); + i801_acpi_remove(priv); + pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg); + + platform_device_unregister(priv->tco_pdev); + + /* + * do not call pci_disable_device(dev) since it can cause hard hangs on + * some systems during power-off (eg. Fujitsu-Siemens Lifebook E8010) + */ +} + +static void i801_shutdown(struct pci_dev *dev) +{ + struct i801_priv *priv = pci_get_drvdata(dev); + + /* Restore config registers to avoid hard hang on some systems */ + i801_disable_host_notify(priv); + pci_write_config_byte(dev, SMBHSTCFG, priv->original_hstcfg); +} + +#ifdef CONFIG_PM_SLEEP +static int i801_suspend(struct device *dev) +{ + struct i801_priv *priv = dev_get_drvdata(dev); + + pci_write_config_byte(priv->pci_dev, SMBHSTCFG, priv->original_hstcfg); + return 0; +} + +static int i801_resume(struct device *dev) +{ + struct i801_priv *priv = dev_get_drvdata(dev); + + i801_setup_hstcfg(priv); + i801_enable_host_notify(&priv->adapter); + + return 0; +} +#endif + +static SIMPLE_DEV_PM_OPS(i801_pm_ops, i801_suspend, i801_resume); + +static struct pci_driver i801_driver = { + .name = "wb_i801_smbus", + .id_table = i801_ids, + .probe = i801_probe, + .remove = i801_remove, + .shutdown = i801_shutdown, + .driver = { + .pm = &i801_pm_ops, + }, +}; + +static int __init i2c_i801_init(void) +{ + if (dmi_name_in_vendors("FUJITSU")) + input_apanel_init(); + return pci_register_driver(&i801_driver); +} + +static void __exit i2c_i801_exit(void) +{ + pci_unregister_driver(&i801_driver); +} + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("I801 SMBus driver"); +MODULE_LICENSE("GPL"); + +module_init(i2c_i801_init); +module_exit(i2c_i801_exit); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_ismt.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_ismt.c new file mode 100644 index 000000000000..94a3ed827209 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_ismt.c @@ -0,0 +1,1131 @@ +/* + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * Copyright(c) 2012 Intel Corporation. All rights reserved. + * + * GPL LICENSE SUMMARY + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * 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. + * The full GNU General Public License is included in this distribution + * in the file called LICENSE.GPL. + * + * BSD LICENSE + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Supports the SMBus Message Transport (SMT) in the Intel Atom Processor + * S12xx Product Family. + * + * Features supported by this driver: + * Hardware PEC yes + * Block buffer yes + * Block process call transaction yes + * Slave mode no + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +/* PCI Address Constants */ +#define SMBBAR 0 + +#define ISMT_DBCTRL 0x388 /* ISMT PIN Control Register */ +#define ISMT_DBSTS 0X38C /* ISMT PIN Status Register */ + +#define ISMT_DBSTS_CLK_STS (1<<9) /* bit9 SMBCLK_CUR_STS */ +#define ISMT_DBSTS_SDA_STS (1<<8) /* bit8 SMBDATA_CUR_STS */ +#define ISMT_DBCTRL_CLK_CTL (1<<1) /* bit1 SMBCLK_CTL */ +#define ISMT_DBCTRL_ENABLE (1<<31) /* bit31 EN */ + +/* PCI DIDs for the Intel SMBus Message Transport (SMT) Devices */ +#define PCI_DEVICE_ID_INTEL_S1200_SMT0 0x0c59 +#define PCI_DEVICE_ID_INTEL_S1200_SMT1 0x0c5a +#define PCI_DEVICE_ID_INTEL_CDF_SMT 0x18ac +#define PCI_DEVICE_ID_INTEL_DNV_SMT 0x19ac +#define PCI_DEVICE_ID_INTEL_EBG_SMT 0x1bff +#define PCI_DEVICE_ID_INTEL_AVOTON_SMT 0x1f15 + +#define ISMT_DESC_ENTRIES 2 /* number of descriptor entries */ +#define ISMT_MAX_RETRIES 3 /* number of SMBus retries to attempt */ +#define ISMT_LOG_ENTRIES 3 /* number of interrupt cause log entries */ + +/* Hardware Descriptor Constants - Control Field */ +#define ISMT_DESC_CWRL 0x01 /* Command/Write Length */ +#define ISMT_DESC_BLK 0X04 /* Perform Block Transaction */ +#define ISMT_DESC_FAIR 0x08 /* Set fairness flag upon successful arbit. */ +#define ISMT_DESC_PEC 0x10 /* Packet Error Code */ +#define ISMT_DESC_I2C 0x20 /* I2C Enable */ +#define ISMT_DESC_INT 0x40 /* Interrupt */ +#define ISMT_DESC_SOE 0x80 /* Stop On Error */ + +/* Hardware Descriptor Constants - Status Field */ +#define ISMT_DESC_SCS 0x01 /* Success */ +#define ISMT_DESC_DLTO 0x04 /* Data Low Time Out */ +#define ISMT_DESC_NAK 0x08 /* NAK Received */ +#define ISMT_DESC_CRC 0x10 /* CRC Error */ +#define ISMT_DESC_CLTO 0x20 /* Clock Low Time Out */ +#define ISMT_DESC_COL 0x40 /* Collisions */ +#define ISMT_DESC_LPR 0x80 /* Large Packet Received */ + +/* Macros */ +#define ISMT_DESC_ADDR_RW(addr, rw) (((addr) << 1) | (rw)) + +/* iSMT General Register address offsets (SMBBAR + ) */ +#define ISMT_GR_GCTRL 0x000 /* General Control */ +#define ISMT_GR_SMTICL 0x008 /* SMT Interrupt Cause Location */ +#define ISMT_GR_ERRINTMSK 0x010 /* Error Interrupt Mask */ +#define ISMT_GR_ERRAERMSK 0x014 /* Error AER Mask */ +#define ISMT_GR_ERRSTS 0x018 /* Error Status */ +#define ISMT_GR_ERRINFO 0x01c /* Error Information */ + +/* iSMT Master Registers */ +#define ISMT_MSTR_MDBA 0x100 /* Master Descriptor Base Address */ +#define ISMT_MSTR_MCTRL 0x108 /* Master Control */ +#define ISMT_MSTR_MSTS 0x10c /* Master Status */ +#define ISMT_MSTR_MDS 0x110 /* Master Descriptor Size */ +#define ISMT_MSTR_RPOLICY 0x114 /* Retry Policy */ + +/* iSMT Miscellaneous Registers */ +#define ISMT_SPGT 0x300 /* SMBus PHY Global Timing */ + +/* General Control Register (GCTRL) bit definitions */ +#define ISMT_GCTRL_TRST 0x04 /* Target Reset */ +#define ISMT_GCTRL_KILL 0x08 /* Kill */ +#define ISMT_GCTRL_SRST 0x40 /* Soft Reset */ + +/* Master Control Register (MCTRL) bit definitions */ +#define ISMT_MCTRL_SS 0x01 /* Start/Stop */ +#define ISMT_MCTRL_MEIE 0x10 /* Master Error Interrupt Enable */ +#define ISMT_MCTRL_FMHP 0x00ff0000 /* Firmware Master Head Ptr (FMHP) */ + +/* Master Status Register (MSTS) bit definitions */ +#define ISMT_MSTS_HMTP 0xff0000 /* HW Master Tail Pointer (HMTP) */ +#define ISMT_MSTS_MIS 0x20 /* Master Interrupt Status (MIS) */ +#define ISMT_MSTS_MEIS 0x10 /* Master Error Int Status (MEIS) */ +#define ISMT_MSTS_IP 0x01 /* In Progress */ + +/* Master Descriptor Size (MDS) bit definitions */ +#define ISMT_MDS_MASK 0xff /* Master Descriptor Size mask (MDS) */ + +/* SMBus PHY Global Timing Register (SPGT) bit definitions */ +#define ISMT_SPGT_SPD_MASK 0xc0000000 /* SMBus Speed mask */ +#define ISMT_SPGT_SPD_80K 0x00 /* 80 kHz */ +#define ISMT_SPGT_SPD_100K (0x1 << 30) /* 100 kHz */ +#define ISMT_SPGT_SPD_400K (0x2U << 30) /* 400 kHz */ +#define ISMT_SPGT_SPD_1M (0x3U << 30) /* 1 MHz */ + + +/* MSI Control Register (MSICTL) bit definitions */ +#define ISMT_MSICTL_MSIE 0x01 /* MSI Enable */ + +/* iSMT Hardware Descriptor */ +struct ismt_desc { + u8 tgtaddr_rw; /* target address & r/w bit */ + u8 wr_len_cmd; /* write length in bytes or a command */ + u8 rd_len; /* read length */ + u8 control; /* control bits */ + u8 status; /* status bits */ + u8 retry; /* collision retry and retry count */ + u8 rxbytes; /* received bytes */ + u8 txbytes; /* transmitted bytes */ + u32 dptr_low; /* lower 32 bit of the data pointer */ + u32 dptr_high; /* upper 32 bit of the data pointer */ +} __packed; + +struct ismt_priv { + struct i2c_adapter adapter; + void __iomem *smba; /* PCI BAR */ + struct pci_dev *pci_dev; + struct ismt_desc *hw; /* descriptor virt base addr */ + dma_addr_t io_rng_dma; /* descriptor HW base addr */ + u8 head; /* ring buffer head pointer */ + struct completion cmp; /* interrupt completion */ + u8 buffer[I2C_SMBUS_BLOCK_MAX + 16]; /* temp R/W data buffer */ + dma_addr_t log_dma; + u32 *log; +}; + +static const struct pci_device_id ismt_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_S1200_SMT0) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_S1200_SMT1) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CDF_SMT) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_DNV_SMT) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EBG_SMT) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_AVOTON_SMT) }, + { 0, } +}; + +MODULE_DEVICE_TABLE(pci, ismt_ids); + +/* Bus speed control bits for slow debuggers - refer to the docs for usage */ +static unsigned int bus_speed; +module_param(bus_speed, uint, S_IRUGO); +MODULE_PARM_DESC(bus_speed, "Bus Speed in kHz (0 = BIOS default)"); + +static unsigned int dma_reset_timeout = 1000; +module_param(dma_reset_timeout, uint, S_IRUGO); + +static void ismt_hw_init(struct ismt_priv *priv); + +/** + * __ismt_desc_dump() - dump the contents of a specific descriptor + * @dev: the iSMT device + * @desc: the iSMT hardware descriptor + */ +static void __ismt_desc_dump(struct device *dev, const struct ismt_desc *desc) +{ + + dev_dbg(dev, "Descriptor struct: %p\n", desc); + dev_dbg(dev, "\ttgtaddr_rw=0x%02X\n", desc->tgtaddr_rw); + dev_dbg(dev, "\twr_len_cmd=0x%02X\n", desc->wr_len_cmd); + dev_dbg(dev, "\trd_len= 0x%02X\n", desc->rd_len); + dev_dbg(dev, "\tcontrol= 0x%02X\n", desc->control); + dev_dbg(dev, "\tstatus= 0x%02X\n", desc->status); + dev_dbg(dev, "\tretry= 0x%02X\n", desc->retry); + dev_dbg(dev, "\trxbytes= 0x%02X\n", desc->rxbytes); + dev_dbg(dev, "\ttxbytes= 0x%02X\n", desc->txbytes); + dev_dbg(dev, "\tdptr_low= 0x%08X\n", desc->dptr_low); + dev_dbg(dev, "\tdptr_high= 0x%08X\n", desc->dptr_high); +} +/** + * ismt_desc_dump() - dump the contents of a descriptor for debug purposes + * @priv: iSMT private data + */ +static void ismt_desc_dump(struct ismt_priv *priv) +{ + struct device *dev = &priv->pci_dev->dev; + struct ismt_desc *desc = &priv->hw[priv->head]; + + dev_dbg(dev, "Dump of the descriptor struct: 0x%X\n", priv->head); + __ismt_desc_dump(dev, desc); +} + +static void ismt_reset_dma(struct ismt_priv *priv) +{ + uint val; + u16 ctrl; + struct pci_dev *pdev; + u32 addr_lo, addr_hi; + + /* save msiaddr */ + pdev = priv->pci_dev; + pci_read_config_dword(pdev, pdev->msi_cap + PCI_MSI_ADDRESS_LO, &addr_lo); + pci_read_config_dword(pdev, pdev->msi_cap + PCI_MSI_ADDRESS_HI, &addr_hi); + + /* Clear the start bit */ + val = readl(priv->smba + ISMT_MSTR_MCTRL); + val &= ~ISMT_MCTRL_SS; + writel(val, priv->smba + ISMT_MSTR_MCTRL); + + val = readl(priv->smba + ISMT_GR_GCTRL); + writel(val | ISMT_GCTRL_KILL | ISMT_GCTRL_TRST | ISMT_GCTRL_SRST, priv->smba + ISMT_GR_GCTRL); + + if (dma_reset_timeout > 0) { + usleep_range(dma_reset_timeout, dma_reset_timeout + 1); + } + + ismt_hw_init(priv); + pci_write_config_dword(pdev, pdev->msi_cap + PCI_MSI_ADDRESS_LO, addr_lo); + pci_write_config_dword(pdev, pdev->msi_cap + PCI_MSI_ADDRESS_HI, addr_hi); + /* enable msi */ + pci_read_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, &ctrl); + ctrl |= PCI_MSI_FLAGS_ENABLE; + pci_write_config_word(pdev, pdev->msi_cap + PCI_MSI_FLAGS, ctrl); +} + +/** + * ismt_gen_reg_dump() - dump the iSMT General Registers + * @priv: iSMT private data + */ +static void ismt_gen_reg_dump(struct ismt_priv *priv) +{ + struct device *dev = &priv->pci_dev->dev; + + dev_dbg(dev, "Dump of the iSMT General Registers\n"); + dev_dbg(dev, " GCTRL.... : (0x%p)=0x%X\n", + priv->smba + ISMT_GR_GCTRL, + readl(priv->smba + ISMT_GR_GCTRL)); + dev_dbg(dev, " SMTICL... : (0x%p)=0x%016llX\n", + priv->smba + ISMT_GR_SMTICL, + (long long unsigned int)readq(priv->smba + ISMT_GR_SMTICL)); + dev_dbg(dev, " ERRINTMSK : (0x%p)=0x%X\n", + priv->smba + ISMT_GR_ERRINTMSK, + readl(priv->smba + ISMT_GR_ERRINTMSK)); + dev_dbg(dev, " ERRAERMSK : (0x%p)=0x%X\n", + priv->smba + ISMT_GR_ERRAERMSK, + readl(priv->smba + ISMT_GR_ERRAERMSK)); + dev_dbg(dev, " ERRSTS... : (0x%p)=0x%X\n", + priv->smba + ISMT_GR_ERRSTS, + readl(priv->smba + ISMT_GR_ERRSTS)); + dev_dbg(dev, " ERRINFO.. : (0x%p)=0x%X\n", + priv->smba + ISMT_GR_ERRINFO, + readl(priv->smba + ISMT_GR_ERRINFO)); +} + +/** + * ismt_mstr_reg_dump() - dump the iSMT Master Registers + * @priv: iSMT private data + */ +static void ismt_mstr_reg_dump(struct ismt_priv *priv) +{ + struct device *dev = &priv->pci_dev->dev; + + dev_dbg(dev, "Dump of the iSMT Master Registers\n"); + dev_dbg(dev, " MDBA..... : (0x%p)=0x%016llX\n", + priv->smba + ISMT_MSTR_MDBA, + (long long unsigned int)readq(priv->smba + ISMT_MSTR_MDBA)); + dev_dbg(dev, " MCTRL.... : (0x%p)=0x%X\n", + priv->smba + ISMT_MSTR_MCTRL, + readl(priv->smba + ISMT_MSTR_MCTRL)); + dev_dbg(dev, " MSTS..... : (0x%p)=0x%X\n", + priv->smba + ISMT_MSTR_MSTS, + readl(priv->smba + ISMT_MSTR_MSTS)); + dev_dbg(dev, " MDS...... : (0x%p)=0x%X\n", + priv->smba + ISMT_MSTR_MDS, + readl(priv->smba + ISMT_MSTR_MDS)); + dev_dbg(dev, " RPOLICY.. : (0x%p)=0x%X\n", + priv->smba + ISMT_MSTR_RPOLICY, + readl(priv->smba + ISMT_MSTR_RPOLICY)); + dev_dbg(dev, " SPGT..... : (0x%p)=0x%X\n", + priv->smba + ISMT_SPGT, + readl(priv->smba + ISMT_SPGT)); +} + +/** + * ismt_submit_desc() - add a descriptor to the ring + * @priv: iSMT private data + */ +static void ismt_submit_desc(struct ismt_priv *priv) +{ + uint fmhp; + uint val; + + ismt_desc_dump(priv); + ismt_gen_reg_dump(priv); + ismt_mstr_reg_dump(priv); + + /* Set the FMHP (Firmware Master Head Pointer)*/ + fmhp = ((priv->head + 1) % ISMT_DESC_ENTRIES) << 16; + val = readl(priv->smba + ISMT_MSTR_MCTRL); + writel((val & ~ISMT_MCTRL_FMHP) | fmhp, + priv->smba + ISMT_MSTR_MCTRL); + + /* Set the start bit */ + val = readl(priv->smba + ISMT_MSTR_MCTRL); + writel(val | ISMT_MCTRL_SS, + priv->smba + ISMT_MSTR_MCTRL); +} + +/** + * ismt_process_desc() - handle the completion of the descriptor + * @desc: the iSMT hardware descriptor + * @data: data buffer from the upper layer + * @priv: ismt_priv struct holding our dma buffer + * @size: SMBus transaction type + * @read_write: flag to indicate if this is a read or write + */ +static int ismt_process_desc(const struct ismt_desc *desc, + union i2c_smbus_data *data, + struct ismt_priv *priv, int size, + char read_write) +{ + u8 *dma_buffer = PTR_ALIGN(&priv->buffer[0], 16); + + dev_dbg(&priv->pci_dev->dev, "Processing completed descriptor\n"); + __ismt_desc_dump(&priv->pci_dev->dev, desc); + ismt_gen_reg_dump(priv); + ismt_mstr_reg_dump(priv); + + if (desc->status & ISMT_DESC_SCS) { + if (read_write == I2C_SMBUS_WRITE && + size != I2C_SMBUS_PROC_CALL && + size != I2C_SMBUS_BLOCK_PROC_CALL) + return 0; + + switch (size) { + case I2C_SMBUS_BYTE: + case I2C_SMBUS_BYTE_DATA: + data->byte = dma_buffer[0]; + break; + case I2C_SMBUS_WORD_DATA: + case I2C_SMBUS_PROC_CALL: + data->word = dma_buffer[0] | (dma_buffer[1] << 8); + break; + case I2C_SMBUS_BLOCK_DATA: + case I2C_SMBUS_BLOCK_PROC_CALL: + if (desc->rxbytes != dma_buffer[0] + 1) + return -EMSGSIZE; + + memcpy(data->block, dma_buffer, desc->rxbytes); + break; + case I2C_SMBUS_I2C_BLOCK_DATA: + memcpy(&data->block[1], dma_buffer, desc->rxbytes); + data->block[0] = desc->rxbytes; + break; + } + return 0; + } + + if (likely(desc->status & ISMT_DESC_NAK)) + return -ENXIO; + + if (desc->status & ISMT_DESC_CRC) + return -EBADMSG; + + if (desc->status & ISMT_DESC_COL) + return -EAGAIN; + + if (desc->status & ISMT_DESC_LPR) + return -EPROTO; + + if (desc->status & (ISMT_DESC_DLTO | ISMT_DESC_CLTO)) + return -ETIMEDOUT; + + return -EIO; +} + +static void ismt_setscl(struct ismt_priv *priv, unsigned int level) +{ + int pin_status; + + pin_status = readl(priv->smba + ISMT_DBCTRL); + if (level == 0) { + pin_status &= (~ISMT_DBCTRL_CLK_CTL); + } else { + pin_status |= ISMT_DBCTRL_CLK_CTL; + } + writel(pin_status, priv->smba + ISMT_DBCTRL); + pin_status = readl(priv->smba + ISMT_DBCTRL); + dev_dbg(&priv->pci_dev->dev, "dbctrl status = 0x%04x\r\n", pin_status); + return; +} + +static void ismt_i2c_unblock(struct ismt_priv *priv) +{ + int i; + int pin_status, ori_status; + + pin_status = readl(priv->smba + ISMT_DBCTRL); + ori_status = pin_status; + if ((pin_status & ISMT_DBCTRL_ENABLE) == 0) { + pin_status |= ISMT_DBCTRL_ENABLE; + writel(pin_status, priv->smba + ISMT_DBCTRL); + pin_status = readl(priv->smba + ISMT_DBCTRL); + dev_dbg(&priv->pci_dev->dev, "enable dbctrl pin status = 0x%04x\r\n", pin_status); + } + + for (i = 0; i < 10; i++) { + ismt_setscl(priv, 0); + udelay(5); + ismt_setscl(priv, 1); + udelay(5); + } + + pin_status = readl(priv->smba + ISMT_DBCTRL); + if (pin_status != ori_status) { + writel(ori_status, priv->smba + ISMT_DBCTRL); + pin_status = readl(priv->smba + ISMT_DBCTRL); + dev_dbg(&priv->pci_dev->dev, "reback dbctrl pin status = 0x%04x\r\n", pin_status); + } + + return; +} + +static int ismt_check_i2c_unblock(struct ismt_priv *priv) +{ + int pin_status; + + pin_status = readl(priv->smba + ISMT_DBSTS); + + if ( (!(pin_status & ISMT_DBSTS_SDA_STS) ) && (pin_status & ISMT_DBSTS_CLK_STS) ) { + dev_dbg(&priv->pci_dev->dev, "SDA is low, send 9 clock to device!\n"); + ismt_i2c_unblock(priv); + } + return 0; +} + +static int ismt_check_i2c_scl(struct ismt_priv *priv) +{ + int pin_status; + + pin_status = readl(priv->smba + ISMT_DBSTS); + + if ( (pin_status & ISMT_DBSTS_SDA_STS) && (pin_status & ISMT_DBSTS_CLK_STS) ) { + return 0; + } + + dev_warn(&priv->pci_dev->dev, "SDA or SCL is low.pin_status:0x%x\n", pin_status); + return -1; +} + +/* Make sure the SMBus host is ready to start transmitting. + Return 0 if it is, -EIO if it is not. */ +static int ismt_check_pre(struct ismt_priv *priv) +{ + ismt_check_i2c_unblock(priv); + + /* SDA or SCL is low, return -EIO */ + if (ismt_check_i2c_scl(priv)) { + return -EIO; + } + + return 0; +} + +/** + * ismt_access() - process an SMBus command + * @adap: the i2c host adapter + * @addr: address of the i2c/SMBus target + * @flags: command options + * @read_write: read from or write to device + * @command: the i2c/SMBus command to issue + * @size: SMBus transaction type + * @data: read/write data buffer + */ +static int ismt_access(struct i2c_adapter *adap, u16 addr, + unsigned short flags, char read_write, u8 command, + int size, union i2c_smbus_data *data) +{ + int ret; + unsigned long time_left; + dma_addr_t dma_addr = 0; /* address of the data buffer */ + u8 dma_size = 0; + enum dma_data_direction dma_direction = 0; + struct ismt_desc *desc; + struct ismt_priv *priv = i2c_get_adapdata(adap); + struct device *dev = &priv->pci_dev->dev; + u8 *dma_buffer = PTR_ALIGN(&priv->buffer[0], 16); + + ret = ismt_check_pre(priv); + if (ret < 0) { + return ret; + } + + desc = &priv->hw[priv->head]; + + /* Initialize the DMA buffer */ + mem_clear(priv->buffer, sizeof(priv->buffer)); + + /* Initialize the descriptor */ + mem_clear(desc, sizeof(struct ismt_desc)); + desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write); + + /* Always clear the log entries */ + mem_clear(priv->log, ISMT_LOG_ENTRIES * sizeof(u32)); + + /* Initialize common control bits */ + if (likely(pci_dev_msi_enabled(priv->pci_dev))) + desc->control = ISMT_DESC_INT | ISMT_DESC_FAIR; + else + desc->control = ISMT_DESC_FAIR; + + if ((flags & I2C_CLIENT_PEC) && (size != I2C_SMBUS_QUICK) + && (size != I2C_SMBUS_I2C_BLOCK_DATA)) + desc->control |= ISMT_DESC_PEC; + + switch (size) { + case I2C_SMBUS_QUICK: + dev_dbg(dev, "I2C_SMBUS_QUICK\n"); + break; + + case I2C_SMBUS_BYTE: + if (read_write == I2C_SMBUS_WRITE) { + /* + * Send Byte + * The command field contains the write data + */ + dev_dbg(dev, "I2C_SMBUS_BYTE: WRITE\n"); + desc->control |= ISMT_DESC_CWRL; + desc->wr_len_cmd = command; + } else { + /* Receive Byte */ + dev_dbg(dev, "I2C_SMBUS_BYTE: READ\n"); + dma_size = 1; + dma_direction = DMA_FROM_DEVICE; + desc->rd_len = 1; + } + break; + + case I2C_SMBUS_BYTE_DATA: + if (read_write == I2C_SMBUS_WRITE) { + /* + * Write Byte + * Command plus 1 data byte + */ + dev_dbg(dev, "I2C_SMBUS_BYTE_DATA: WRITE\n"); + desc->wr_len_cmd = 2; + dma_size = 2; + dma_direction = DMA_TO_DEVICE; + dma_buffer[0] = command; + dma_buffer[1] = data->byte; + } else { + /* Read Byte */ + dev_dbg(dev, "I2C_SMBUS_BYTE_DATA: READ\n"); + desc->control |= ISMT_DESC_CWRL; + desc->wr_len_cmd = command; + desc->rd_len = 1; + dma_size = 1; + dma_direction = DMA_FROM_DEVICE; + } + break; + + case I2C_SMBUS_WORD_DATA: + if (read_write == I2C_SMBUS_WRITE) { + /* Write Word */ + dev_dbg(dev, "I2C_SMBUS_WORD_DATA: WRITE\n"); + desc->wr_len_cmd = 3; + dma_size = 3; + dma_direction = DMA_TO_DEVICE; + dma_buffer[0] = command; + dma_buffer[1] = data->word & 0xff; + dma_buffer[2] = data->word >> 8; + } else { + /* Read Word */ + dev_dbg(dev, "I2C_SMBUS_WORD_DATA: READ\n"); + desc->wr_len_cmd = command; + desc->control |= ISMT_DESC_CWRL; + desc->rd_len = 2; + dma_size = 2; + dma_direction = DMA_FROM_DEVICE; + } + break; + + case I2C_SMBUS_PROC_CALL: + dev_dbg(dev, "I2C_SMBUS_PROC_CALL\n"); + desc->wr_len_cmd = 3; + desc->rd_len = 2; + dma_size = 3; + dma_direction = DMA_BIDIRECTIONAL; + dma_buffer[0] = command; + dma_buffer[1] = data->word & 0xff; + dma_buffer[2] = data->word >> 8; + break; + + case I2C_SMBUS_BLOCK_DATA: + if (read_write == I2C_SMBUS_WRITE) { + /* Block Write */ + dev_dbg(dev, "I2C_SMBUS_BLOCK_DATA: WRITE\n"); + if (data->block[0] < 1 || data->block[0] > I2C_SMBUS_BLOCK_MAX) + return -EINVAL; + + dma_size = data->block[0] + 1; + dma_direction = DMA_TO_DEVICE; + desc->wr_len_cmd = dma_size; + desc->control |= ISMT_DESC_BLK; + dma_buffer[0] = command; + memcpy(&dma_buffer[1], &data->block[1], dma_size - 1); + } else { + /* Block Read */ + dev_dbg(dev, "I2C_SMBUS_BLOCK_DATA: READ\n"); + dma_size = I2C_SMBUS_BLOCK_MAX; + dma_direction = DMA_FROM_DEVICE; + desc->rd_len = dma_size; + desc->wr_len_cmd = command; + desc->control |= (ISMT_DESC_BLK | ISMT_DESC_CWRL); + } + break; + + case I2C_SMBUS_BLOCK_PROC_CALL: + dev_dbg(dev, "I2C_SMBUS_BLOCK_PROC_CALL\n"); + if (data->block[0] > I2C_SMBUS_BLOCK_MAX) + return -EINVAL; + + dma_size = I2C_SMBUS_BLOCK_MAX; + desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, 1); + desc->wr_len_cmd = data->block[0] + 1; + desc->rd_len = dma_size; + desc->control |= ISMT_DESC_BLK; + dma_direction = DMA_BIDIRECTIONAL; + dma_buffer[0] = command; + memcpy(&dma_buffer[1], &data->block[1], data->block[0]); + break; + + case I2C_SMBUS_I2C_BLOCK_DATA: + /* Make sure the length is valid */ + if (data->block[0] < 1) + data->block[0] = 1; + + if (data->block[0] > I2C_SMBUS_BLOCK_MAX) + data->block[0] = I2C_SMBUS_BLOCK_MAX; + + if (read_write == I2C_SMBUS_WRITE) { + /* i2c Block Write */ + dev_dbg(dev, "I2C_SMBUS_I2C_BLOCK_DATA: WRITE\n"); + dma_size = data->block[0] + 1; + dma_direction = DMA_TO_DEVICE; + desc->wr_len_cmd = dma_size; + desc->control |= ISMT_DESC_I2C; + dma_buffer[0] = command; + memcpy(&dma_buffer[1], &data->block[1], dma_size - 1); + } else { + /* i2c Block Read */ + dev_dbg(dev, "I2C_SMBUS_I2C_BLOCK_DATA: READ\n"); + dma_size = data->block[0]; + dma_direction = DMA_FROM_DEVICE; + desc->rd_len = dma_size; + desc->wr_len_cmd = command; + desc->control |= (ISMT_DESC_I2C | ISMT_DESC_CWRL); + /* + * Per the "Table 15-15. I2C Commands", + * in the External Design Specification (EDS), + * (Document Number: 508084, Revision: 2.0), + * the _rw bit must be 0 + */ + desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, 0); + } + break; + + default: + dev_err(dev, "Unsupported transaction %d\n", + size); + return -EOPNOTSUPP; + } + + /* map the data buffer */ + if (dma_size != 0) { + dev_dbg(dev, " dev=%p\n", dev); + dev_dbg(dev, " data=%p\n", data); + dev_dbg(dev, " dma_buffer=%p\n", dma_buffer); + dev_dbg(dev, " dma_size=%d\n", dma_size); + dev_dbg(dev, " dma_direction=%d\n", dma_direction); + + dma_addr = dma_map_single(dev, + dma_buffer, + dma_size, + dma_direction); + + if (dma_mapping_error(dev, dma_addr)) { + dev_err(dev, "Error in mapping dma buffer %p\n", + dma_buffer); + return -EIO; + } + + dev_dbg(dev, " dma_addr = %pad\n", &dma_addr); + + desc->dptr_low = lower_32_bits(dma_addr); + desc->dptr_high = upper_32_bits(dma_addr); + } + + reinit_completion(&priv->cmp); + + /* Add the descriptor */ + ismt_submit_desc(priv); + + /* Now we wait for interrupt completion, 1s */ + time_left = wait_for_completion_timeout(&priv->cmp, HZ*1); + + /* unmap the data buffer */ + if (dma_size != 0) + dma_unmap_single(dev, dma_addr, dma_size, dma_direction); + + if (unlikely(!time_left)) { + dev_warn(dev, "completion wait timed out:addr[%d-0x%x], read_write[%d], command[0x%x], size[%d]\n", + adap->nr, addr, read_write, command, size); + ismt_reset_dma(priv); + ret = -ETIMEDOUT; + priv->head = 0; + return ret; + } + + /* do any post processing of the descriptor here */ + ret = ismt_process_desc(desc, data, priv, size, read_write); + + /* Update the ring pointer */ + priv->head++; + priv->head %= ISMT_DESC_ENTRIES; + + return ret; +} + +/** + * ismt_func() - report which i2c commands are supported by this adapter + * @adap: the i2c host adapter + */ +static u32 ismt_func(struct i2c_adapter *adap) +{ + return I2C_FUNC_SMBUS_QUICK | + I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA | + I2C_FUNC_SMBUS_WORD_DATA | + I2C_FUNC_SMBUS_PROC_CALL | + I2C_FUNC_SMBUS_BLOCK_PROC_CALL | + I2C_FUNC_SMBUS_BLOCK_DATA | + I2C_FUNC_SMBUS_I2C_BLOCK | + I2C_FUNC_SMBUS_PEC; +} + +static const struct i2c_algorithm smbus_algorithm = { + .smbus_xfer = ismt_access, + .functionality = ismt_func, +}; + +/** + * ismt_handle_isr() - interrupt handler bottom half + * @priv: iSMT private data + */ +static irqreturn_t ismt_handle_isr(struct ismt_priv *priv) +{ + complete(&priv->cmp); + + return IRQ_HANDLED; +} + + +/** + * ismt_do_interrupt() - IRQ interrupt handler + * @vec: interrupt vector + * @data: iSMT private data + */ +static irqreturn_t ismt_do_interrupt(int vec, void *data) +{ + u32 val; + struct ismt_priv *priv = data; + + /* + * check to see it's our interrupt, return IRQ_NONE if not ours + * since we are sharing interrupt + */ + val = readl(priv->smba + ISMT_MSTR_MSTS); + + if (!(val & (ISMT_MSTS_MIS | ISMT_MSTS_MEIS))) + return IRQ_NONE; + else + writel(val | ISMT_MSTS_MIS | ISMT_MSTS_MEIS, + priv->smba + ISMT_MSTR_MSTS); + + return ismt_handle_isr(priv); +} + +/** + * ismt_do_msi_interrupt() - MSI interrupt handler + * @vec: interrupt vector + * @data: iSMT private data + */ +static irqreturn_t ismt_do_msi_interrupt(int vec, void *data) +{ + return ismt_handle_isr(data); +} + +/** + * ismt_hw_init() - initialize the iSMT hardware + * @priv: iSMT private data + */ +static void ismt_hw_init(struct ismt_priv *priv) +{ + u32 val; + struct device *dev = &priv->pci_dev->dev; + + /* initialize the Master Descriptor Base Address (MDBA) */ + writeq(priv->io_rng_dma, priv->smba + ISMT_MSTR_MDBA); + + writeq(priv->log_dma, priv->smba + ISMT_GR_SMTICL); + + /* initialize the Master Control Register (MCTRL) */ + writel(ISMT_MCTRL_MEIE, priv->smba + ISMT_MSTR_MCTRL); + + /* initialize the Master Status Register (MSTS) */ + writel(0, priv->smba + ISMT_MSTR_MSTS); + + /* initialize the Master Descriptor Size (MDS) */ + val = readl(priv->smba + ISMT_MSTR_MDS); + writel((val & ~ISMT_MDS_MASK) | (ISMT_DESC_ENTRIES - 1), + priv->smba + ISMT_MSTR_MDS); + + /* + * Set the SMBus speed (could use this for slow HW debuggers) + */ + + val = readl(priv->smba + ISMT_SPGT); + + switch (bus_speed) { + case 0: + break; + + case 80: + dev_dbg(dev, "Setting SMBus clock to 80 kHz\n"); + writel(((val & ~ISMT_SPGT_SPD_MASK) | ISMT_SPGT_SPD_80K), + priv->smba + ISMT_SPGT); + break; + + case 100: + dev_dbg(dev, "Setting SMBus clock to 100 kHz\n"); + writel(((val & ~ISMT_SPGT_SPD_MASK) | ISMT_SPGT_SPD_100K), + priv->smba + ISMT_SPGT); + break; + + case 400: + dev_dbg(dev, "Setting SMBus clock to 400 kHz\n"); + writel(((val & ~ISMT_SPGT_SPD_MASK) | ISMT_SPGT_SPD_400K), + priv->smba + ISMT_SPGT); + break; + + case 1000: + dev_dbg(dev, "Setting SMBus clock to 1000 kHz\n"); + writel(((val & ~ISMT_SPGT_SPD_MASK) | ISMT_SPGT_SPD_1M), + priv->smba + ISMT_SPGT); + break; + + default: + dev_warn(dev, "Invalid SMBus clock speed, only 0, 80, 100, 400, and 1000 are valid\n"); + break; + } + + val = readl(priv->smba + ISMT_SPGT); + + switch (val & ISMT_SPGT_SPD_MASK) { + case ISMT_SPGT_SPD_80K: + bus_speed = 80; + break; + case ISMT_SPGT_SPD_100K: + bus_speed = 100; + break; + case ISMT_SPGT_SPD_400K: + bus_speed = 400; + break; + case ISMT_SPGT_SPD_1M: + bus_speed = 1000; + break; + } + dev_dbg(dev, "SMBus clock is running at %d kHz\n", bus_speed); +} + +/** + * ismt_dev_init() - initialize the iSMT data structures + * @priv: iSMT private data + */ +static int ismt_dev_init(struct ismt_priv *priv) +{ + /* allocate memory for the descriptor */ + priv->hw = dmam_alloc_coherent(&priv->pci_dev->dev, + (ISMT_DESC_ENTRIES + * sizeof(struct ismt_desc)), + &priv->io_rng_dma, + GFP_KERNEL); + if (!priv->hw) + return -ENOMEM; + + priv->head = 0; + init_completion(&priv->cmp); + + priv->log = dmam_alloc_coherent(&priv->pci_dev->dev, + ISMT_LOG_ENTRIES * sizeof(u32), + &priv->log_dma, GFP_KERNEL); + if (!priv->log) + return -ENOMEM; + + return 0; +} + +/** + * ismt_int_init() - initialize interrupts + * @priv: iSMT private data + */ +static int ismt_int_init(struct ismt_priv *priv) +{ + int err; + + /* Try using MSI interrupts */ + err = pci_enable_msi(priv->pci_dev); + if (err) + goto intx; + + err = devm_request_irq(&priv->pci_dev->dev, + priv->pci_dev->irq, + ismt_do_msi_interrupt, + 0, + "ismt-msi", + priv); + if (err) { + pci_disable_msi(priv->pci_dev); + goto intx; + } + + return 0; + + /* Try using legacy interrupts */ +intx: + dev_warn(&priv->pci_dev->dev, + "Unable to use MSI interrupts, falling back to legacy\n"); + + err = devm_request_irq(&priv->pci_dev->dev, + priv->pci_dev->irq, + ismt_do_interrupt, + IRQF_SHARED, + "ismt-intx", + priv); + if (err) { + dev_err(&priv->pci_dev->dev, "no usable interrupts\n"); + return err; + } + + return 0; +} + +static struct pci_driver ismt_driver; + +/** + * ismt_probe() - probe for iSMT devices + * @pdev: PCI-Express device + * @id: PCI-Express device ID + */ +static int +ismt_probe(struct pci_dev *pdev, const struct pci_device_id *id) +{ + int err; + struct ismt_priv *priv; + unsigned long start, len; + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + pci_set_drvdata(pdev, priv); + + i2c_set_adapdata(&priv->adapter, priv); + priv->adapter.owner = THIS_MODULE; + priv->adapter.class = I2C_CLASS_HWMON; + priv->adapter.algo = &smbus_algorithm; + priv->adapter.dev.parent = &pdev->dev; + ACPI_COMPANION_SET(&priv->adapter.dev, ACPI_COMPANION(&pdev->dev)); + priv->adapter.retries = ISMT_MAX_RETRIES; + + priv->pci_dev = pdev; + + err = pcim_enable_device(pdev); + if (err) { + dev_err(&pdev->dev, "Failed to enable SMBus PCI device (%d)\n", + err); + return err; + } + + /* enable bus mastering */ + pci_set_master(pdev); + + /* Determine the address of the SMBus area */ + start = pci_resource_start(pdev, SMBBAR); + len = pci_resource_len(pdev, SMBBAR); + if (!start || !len) { + dev_err(&pdev->dev, + "SMBus base address uninitialized, upgrade BIOS\n"); + return -ENODEV; + } + + snprintf(priv->adapter.name, sizeof(priv->adapter.name), + "SMBus iSMT adapter at %lx", start); + + dev_dbg(&priv->pci_dev->dev, " start=0x%lX\n", start); + dev_dbg(&priv->pci_dev->dev, " len=0x%lX\n", len); + + err = acpi_check_resource_conflict(&pdev->resource[SMBBAR]); + if (err) { + dev_err(&pdev->dev, "ACPI resource conflict!\n"); + return err; + } + + err = pci_request_region(pdev, SMBBAR, ismt_driver.name); + if (err) { + dev_err(&pdev->dev, + "Failed to request SMBus region 0x%lx-0x%lx\n", + start, start + len); + return err; + } + + priv->smba = pcim_iomap(pdev, SMBBAR, len); + if (!priv->smba) { + dev_err(&pdev->dev, "Unable to ioremap SMBus BAR\n"); + return -ENODEV; + } + + err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); + if (err) { + dev_err(&pdev->dev, "dma_set_mask fail\n"); + return -ENODEV; + } + + err = ismt_dev_init(priv); + if (err) + return err; + + ismt_hw_init(priv); + + err = ismt_int_init(priv); + if (err) + return err; + + err = i2c_add_adapter(&priv->adapter); + if (err) + return -ENODEV; + dev_info(&pdev->dev, "wb-i2c-ismt probe ok.\n"); + return 0; +} + +/** + * ismt_remove() - release driver resources + * @pdev: PCI-Express device + */ +static void ismt_remove(struct pci_dev *pdev) +{ + struct ismt_priv *priv = pci_get_drvdata(pdev); + + i2c_del_adapter(&priv->adapter); +} + +static struct pci_driver ismt_driver = { + .name = "wb_ismt_smbus", + .id_table = ismt_ids, + .probe = ismt_probe, + .remove = ismt_remove, +}; + +module_pci_driver(ismt_driver); + +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_AUTHOR("Bill E. Brown "); +MODULE_DESCRIPTION("Intel SMBus Message Transport (iSMT) driver"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca954x.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca954x.c new file mode 100644 index 000000000000..854675d9fa99 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca954x.c @@ -0,0 +1,1387 @@ +/* + * I2C multiplexer + * + * Copyright (c) 2008-2009 Rodolfo Giometti + * Copyright (c) 2008-2009 Eurotech S.p.A. + * + * This module supports the PCA954x series of I2C multiplexer/switch chips + * made by Philips Semiconductors. + * This includes the: + * PCA9540, PCA9542, PCA9543, PCA9544, PCA9545, PCA9546, PCA9547 + * and PCA9548. + * + * These chips are all controlled via the I2C bus itself, and all have a + * single 8-bit register. The upstream "parent" bus fans out to two, + * four, or eight downstream busses or channels; which of these + * are selected is determined by the chip type and register contents. A + * mux can select only one sub-bus at a time; a switch can select any + * combination simultaneously. + * + * Based on: + * pca954x.c from Kumar Gala + * Copyright (C) 2006 + * + * Based on: + * pca954x.c from Ken Harrenstien + * Copyright (C) 2004 Google, Inc. (Ken Harrenstien) + * + * Based on: + * i2c-virtual_cb.c from Brian Kuschak + * and + * pca9540.c from Jean Delvare . + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_i2c_mux_pca954x.h" + +#define PCA954X_MAX_NCHANS 8 +#define PCA954X_IRQ_OFFSET 4 + +#define I2C_RETRY_TIMES 5 +#define I2C_RETRY_WAIT_TIMES 10 /*delay 10ms*/ + +#define WIDTH_1Byte (1) +#define WIDTH_4Byte (4) + +typedef struct pca9548_cfg_info_s { + uint32_t pca9548_base_nr; + uint32_t pca9548_reset_type; + uint32_t rst_delay_b; /* delay time before reset(us) */ + uint32_t rst_delay; /* reset time(us) */ + uint32_t rst_delay_a; /* delay time after reset(us) */ + union { + i2c_attr_t i2c_attr; + gpio_attr_t gpio_attr; + io_attr_t io_attr; + file_attr_t file_attr; + } attr; + bool select_chan_check; + bool close_chan_force_reset; +} pca9548_cfg_info_t; + +int g_pca954x_debug = 0; +int g_pca954x_error = 0; + +module_param(g_pca954x_debug, int, S_IRUGO | S_IWUSR); +module_param(g_pca954x_error, int, S_IRUGO | S_IWUSR); + +#define PCA954X_DEBUG(fmt, args...) do { \ + if (g_pca954x_debug) { \ + printk(KERN_INFO "[PCA95x][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define PCA954X_ERROR(fmt, args...) do { \ + if (g_pca954x_error) { \ + printk(KERN_ERR "[PCA95x][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +extern int pca9641_setmuxflag(int nr, int flag); +enum pca_type { + pca_9540, + pca_9542, + pca_9543, + pca_9544, + pca_9545, + pca_9546, + pca_9547, + pca_9548, +}; + +struct chip_desc { + u8 nchans; + u8 enable; /* used for muxes only */ + u8 has_irq; + enum muxtype { + pca954x_ismux = 0, + pca954x_isswi + } muxtype; +}; + +struct pca954x { + const struct chip_desc *chip; + u8 last_chan; /* last register value */ + u8 deselect; + struct i2c_client *client; + struct irq_domain *irq; + unsigned int irq_mask; + raw_spinlock_t lock; + pca9548_cfg_info_t pca9548_cfg_info; /* pca9548 reset cfg */ +}; + +/* Provide specs for the PCA954x types we know about */ +static const struct chip_desc chips[] = { + [pca_9540] = { + .nchans = 2, + .enable = 0x4, + .muxtype = pca954x_ismux, + }, + [pca_9542] = { + .nchans = 2, + .enable = 0x4, + .has_irq = 1, + .muxtype = pca954x_ismux, + }, + [pca_9543] = { + .nchans = 2, + .has_irq = 1, + .muxtype = pca954x_isswi, + }, + [pca_9544] = { + .nchans = 4, + .enable = 0x4, + .has_irq = 1, + .muxtype = pca954x_ismux, + }, + [pca_9545] = { + .nchans = 4, + .has_irq = 1, + .muxtype = pca954x_isswi, + }, + [pca_9546] = { + .nchans = 4, + .muxtype = pca954x_isswi, + }, + [pca_9547] = { + .nchans = 8, + .enable = 0x8, + .muxtype = pca954x_ismux, + }, + [pca_9548] = { + .nchans = 8, + .muxtype = pca954x_isswi, + }, +}; + +static const struct i2c_device_id pca954x_id[] = { + { "wb_pca9540", pca_9540 }, + { "wb_pca9542", pca_9542 }, + { "wb_pca9543", pca_9543 }, + { "wb_pca9544", pca_9544 }, + { "wb_pca9545", pca_9545 }, + { "wb_pca9546", pca_9546 }, + { "wb_pca9547", pca_9547 }, + { "wb_pca9548", pca_9548 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, pca954x_id); + +#ifdef CONFIG_OF +static const struct of_device_id pca954x_of_match[] = { + { .compatible = "nxp,wb_pca9540", .data = &chips[pca_9540] }, + { .compatible = "nxp,wb_pca9542", .data = &chips[pca_9542] }, + { .compatible = "nxp,wb_pca9543", .data = &chips[pca_9543] }, + { .compatible = "nxp,wb_pca9544", .data = &chips[pca_9544] }, + { .compatible = "nxp,wb_pca9545", .data = &chips[pca_9545] }, + { .compatible = "nxp,wb_pca9546", .data = &chips[pca_9546] }, + { .compatible = "nxp,wb_pca9547", .data = &chips[pca_9547] }, + { .compatible = "nxp,wb_pca9548", .data = &chips[pca_9548] }, + {} +}; +MODULE_DEVICE_TABLE(of, pca954x_of_match); +#endif + +/* Write to mux register. Don't use i2c_transfer()/i2c_smbus_xfer() + for this as they will try to lock adapter a second time */ +static int pca954x_reg_write(struct i2c_adapter *adap, + struct i2c_client *client, u8 val) +{ + int ret = -ENODEV; + + if (adap->algo->master_xfer) { + struct i2c_msg msg; + char buf[1]; + + msg.addr = client->addr; + msg.flags = 0; + msg.len = 1; + buf[0] = val; + msg.buf = buf; + ret = __i2c_transfer(adap, &msg, 1); + + if (ret >= 0 && ret != 1) + ret = -EREMOTEIO; + } else { + union i2c_smbus_data data; + ret = adap->algo->smbus_xfer(adap, client->addr, + client->flags, + I2C_SMBUS_WRITE, + val, I2C_SMBUS_BYTE, &data); + } + return ret; +} + +static int pca954x_reg_read(struct i2c_adapter *adap, + struct i2c_client *client, u8 *val) +{ + int ret = -ENODEV; + u8 tmp_val; + + if (adap->algo->master_xfer) { + struct i2c_msg msg; + + msg.addr = client->addr; + msg.flags = I2C_M_RD; + msg.len = 1; + msg.buf = &tmp_val; + ret = __i2c_transfer(adap, &msg, 1); + + if (ret >= 0 && ret != 1) { + ret = -EREMOTEIO; + } else { + *val = tmp_val; + } + } else { + union i2c_smbus_data data; + ret = adap->algo->smbus_xfer(adap, client->addr, + client->flags, + I2C_SMBUS_READ, + 0, I2C_SMBUS_BYTE, &data); + + if (!ret) { + tmp_val = data.byte; + *val = tmp_val; + } + } + + return ret; +} + +static int pca954x_setmuxflag(struct i2c_client *client, int flag) +{ + int ret; + struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent); + + ret = pca9641_setmuxflag(adap->nr, flag); + return ret; +} + +static int pca9548_gpio_init(gpio_attr_t *gpio_attr) +{ + int err; + + if (gpio_attr->gpio_init) { + PCA954X_DEBUG("gpio%d already init, do nothing.\n", gpio_attr->gpio); + return 0; + } + + PCA954X_DEBUG("gpio%d init.\n", gpio_attr->gpio); + err = gpio_request(gpio_attr->gpio, "pca9548_reset"); + if (err) { + goto error; + } + err = gpio_direction_output(gpio_attr->gpio, gpio_attr->reset_off); + if (err) { + gpio_free(gpio_attr->gpio); + goto error; + } + gpio_attr->gpio_init = 1; + return 0; +error: + PCA954X_ERROR("pca9548_gpio_init failed, ret:%d.\n", err); + return err; +} + +static void pca9548_gpio_free(gpio_attr_t *gpio_attr) +{ + if (gpio_attr->gpio_init == 1) { + PCA954X_DEBUG("gpio%d release.\n", gpio_attr->gpio); + gpio_free(gpio_attr->gpio); + gpio_attr->gpio_init = 0; + } +} + +static int pca954x_reset_file_read(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDONLY, 0); + if (IS_ERR(filp)) { + PCA954X_ERROR("read open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_DEST, &iov, 1, iov.iov_len); + ret = vfs_iter_read(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + PCA954X_ERROR("vfs_iter_read failed, path=%s, addr=0x%x, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int pca954x_reset_file_write(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDWR, 777); + if (IS_ERR(filp)) { + PCA954X_ERROR("write open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_SOURCE, &iov, 1, iov.iov_len); + ret = vfs_iter_write(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + PCA954X_ERROR("vfs_iter_write failed, path=%s, addr=0x%x, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + vfs_fsync(filp, 1); + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int pca954x_reset_i2c_read(uint32_t bus, uint32_t addr, uint32_t offset_addr, + unsigned char *buf, uint32_t size) +{ + struct file *fp; + struct i2c_client client; + char i2c_path[32]; + int i ,j ; + int rv; + + rv = 0; + mem_clear(i2c_path, sizeof(i2c_path)); + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", bus); + fp = filp_open(i2c_path, O_RDWR, S_IRUSR | S_IWUSR); + if (IS_ERR(fp)) { + PCA954X_ERROR("i2c open fail.\n"); + return -1; + } + memcpy(&client, fp->private_data, sizeof(struct i2c_client)); + client.addr = addr; + for (j = 0 ;j < size ;j++) { + for (i = 0; i < I2C_RETRY_TIMES; i++) { + rv = i2c_smbus_read_byte_data(&client, (offset_addr + j)); + if (rv < 0) { + PCA954X_ERROR("i2c read failed, try again.\n"); + msleep(I2C_RETRY_WAIT_TIMES); + if (i >= (I2C_RETRY_TIMES - 1)) { + goto out; + } + continue; + } + *(buf + j) = (unsigned char)rv; + break; + } + } +out: + filp_close(fp, NULL); + return rv; +} + +static int pca954x_reset_i2c_write(uint32_t bus, uint32_t dev_addr, uint32_t offset_addr, + uint8_t write_buf) +{ + struct file *fp; + struct i2c_client client; + char i2c_path[32]; + int i; + int rv; + + rv = 0; + mem_clear(i2c_path, sizeof(i2c_path)); + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", bus); + fp = filp_open(i2c_path, O_RDWR, S_IRUSR | S_IWUSR); + if (IS_ERR(fp)) { + PCA954X_ERROR("i2c open fail.\n"); + return -1; + } + memcpy(&client, fp->private_data, sizeof(struct i2c_client)); + client.addr = dev_addr; + for (i = 0; i < I2C_RETRY_TIMES; i++) { + rv = i2c_smbus_write_byte_data(&client, offset_addr, write_buf); + if (rv < 0) { + PCA954X_ERROR("i2c write failed, try again.\n"); + msleep(I2C_RETRY_WAIT_TIMES); + if (i >= (I2C_RETRY_TIMES - 1)) { + goto out; + } + continue; + } + break; + } +out: + filp_close(fp, NULL); + return rv; +} + +static int pca954x_do_file_reset(struct i2c_mux_core *muxc) +{ + int ret, timeout, err; + struct pca954x *data; + pca9548_cfg_info_t *reset_cfg; + file_attr_t *file_attr; + int udelay_cnt; + uint8_t read_value[4], write_reset_on_value[4], write_reset_off_value[4]; + uint8_t tmp_read8; + uint32_t tmp_read32, tmp_write32; + + + data = i2c_mux_priv(muxc); + reset_cfg = &data->pca9548_cfg_info; + file_attr = &reset_cfg->attr.file_attr; + ret = -1; + + PCA954X_DEBUG("rst_delay_b:%u, rst_delay:%u, rst_delay_a:%u.\n", + reset_cfg->rst_delay_b, reset_cfg->rst_delay, reset_cfg->rst_delay_a); + PCA954X_DEBUG("dev_name:%s, offset:0x%x, mask:0x%x, on:0x%x, off:0x%x, width: %u\n", + file_attr->dev_name, file_attr->offset, file_attr->mask, + file_attr->reset_on, file_attr->reset_off, file_attr->width); + + if (reset_cfg->rst_delay_b) { + usleep_range(reset_cfg->rst_delay_b, reset_cfg->rst_delay_b + 1); + } + + mem_clear(read_value, sizeof(read_value)); + mem_clear(write_reset_on_value, sizeof(write_reset_on_value)); + mem_clear(write_reset_off_value, sizeof(write_reset_off_value)); + err = pca954x_reset_file_read(file_attr->dev_name, file_attr->offset, read_value, file_attr->width); + if (err < 0) { + goto out; + } + + if (file_attr->width == WIDTH_1Byte) { + tmp_read8 = read_value[0]; + write_reset_on_value[0] = ((tmp_read8 & (~file_attr->mask)) | file_attr->reset_on) & 0xFF; + write_reset_off_value[0] = ((tmp_read8 & (~file_attr->mask)) | file_attr->reset_off) & 0xFF; + PCA954X_DEBUG("1 byte write reset on val[0]: 0x%x, write reset off valu[0]: 0x%x\n", + write_reset_on_value[0], write_reset_off_value[0]); + } else { + memcpy((uint8_t *)&tmp_read32, read_value, 4); + tmp_write32 = (tmp_read32 & (~file_attr->mask)) | file_attr->reset_on; + memcpy(write_reset_on_value, (uint8_t *)&tmp_write32, 4); + tmp_write32 = (tmp_read32 & (~file_attr->mask)) | file_attr->reset_off; + memcpy(write_reset_off_value, (uint8_t *)&tmp_write32, 4); + PCA954X_DEBUG("4 byte write reset on val[0]:0x%x, val[1]:0x%x, val[2]:0x%x, val[3]:0x%x", + write_reset_on_value[0], write_reset_on_value[1], write_reset_on_value[2], write_reset_on_value[3]); + PCA954X_DEBUG("4 byte write reset off val[0]:0x%x, val[1]:0x%x, val[2]:0x%x, val[3]:0x%x", + write_reset_off_value[0], write_reset_off_value[1], write_reset_off_value[2], write_reset_off_value[3]); + } + + err = pca954x_reset_file_write(file_attr->dev_name, file_attr->offset, write_reset_on_value, file_attr->width); + if (err < 0) { + goto out; + } + + if (reset_cfg->rst_delay) { + usleep_range(reset_cfg->rst_delay, reset_cfg->rst_delay + 1); + } + + err = pca954x_reset_file_write(file_attr->dev_name, file_attr->offset, write_reset_off_value, file_attr->width); + if (err < 0) { + goto out; + } + + udelay_cnt = 0; + timeout = reset_cfg->rst_delay_a; + while (timeout > 0) { + usleep_range(1, 2); + err = pca954x_reset_file_read(file_attr->dev_name, file_attr->offset, read_value, file_attr->width); + if (err < 0) { + goto out; + } + if (file_attr->width == WIDTH_1Byte) { + tmp_read32 = read_value[0]; + } else { + memcpy((uint8_t *)&tmp_read32, read_value, 4); + } + tmp_read32 &= (file_attr->mask); + if (tmp_read32 == file_attr->reset_off) { + ret = 0; + PCA954X_DEBUG("pca954x_do_file_reset success.\n"); + break; + } + udelay_cnt++; + if ((udelay_cnt % 1000) == 0) { + /* 1MS schedule*/ + schedule(); + } + timeout--; + } + if (ret < 0) { + PCA954X_ERROR("pca954x_do_file_reset timeout.\n"); + } +out: + if (err < 0) { + PCA954X_ERROR("pca954x_do_file_reset file rd/wr failed, ret:%d.\n", err); + } + + return ret; +} + +static int pca954x_do_io_reset(struct i2c_mux_core *muxc) +{ + int ret, timeout; + struct pca954x *data; + pca9548_cfg_info_t *reset_cfg; + io_attr_t *io_attr; + u8 val; + int udelay_cnt; + + data = i2c_mux_priv(muxc); + reset_cfg = &data->pca9548_cfg_info; + io_attr = &reset_cfg->attr.io_attr; + + PCA954X_DEBUG("rst_delay_b:%u, rst_delay:%u, rst_delay_a:%u.\n", + reset_cfg->rst_delay_b, reset_cfg->rst_delay, reset_cfg->rst_delay_a); + PCA954X_DEBUG("io_addr:0x%x, mask:0x%x, on:0x%x, off:0x%x.\n", + io_attr->io_addr, io_attr->mask, io_attr->reset_on, io_attr->reset_off); + + if (reset_cfg->rst_delay_b) { + usleep_range(reset_cfg->rst_delay_b, reset_cfg->rst_delay_b + 1); + } + + val = inb(io_attr->io_addr); + val &= ~(io_attr->mask); + val |= io_attr->reset_on; + outb(val, io_attr->io_addr); + + if (reset_cfg->rst_delay) { + usleep_range(reset_cfg->rst_delay, reset_cfg->rst_delay + 1); + } + + val &= ~(io_attr->mask); + val |= io_attr->reset_off; + outb(val, io_attr->io_addr); + + ret = -1; + udelay_cnt = 0; + timeout = reset_cfg->rst_delay_a; + while (timeout > 0) { + usleep_range(1, 2); + val = inb(io_attr->io_addr); + val &= (io_attr->mask); + if (val == io_attr->reset_off) { + ret = 0; + PCA954X_DEBUG("pca954x_do_io_reset success.\n"); + break; + } + udelay_cnt++; + if ((udelay_cnt % 1000) == 0) { + /* 1MS schedule*/ + schedule(); + } + timeout--; + } + + if (ret < 0) { + PCA954X_ERROR("pca954x_do_io_reset timeout.\n"); + } + + return ret; +} + +static int pca954x_do_gpio_reset(struct i2c_mux_core *muxc) +{ + int ret, timeout; + struct pca954x *data; + pca9548_cfg_info_t *reset_cfg; + gpio_attr_t *gpio_attr; + u8 val; + int udelay_cnt; + + data = i2c_mux_priv(muxc); + reset_cfg = &data->pca9548_cfg_info; + gpio_attr = &reset_cfg->attr.gpio_attr; + + ret = pca9548_gpio_init(gpio_attr); + if (ret) { + return -1; + } + + if (reset_cfg->rst_delay_b) { + usleep_range(reset_cfg->rst_delay_b, reset_cfg->rst_delay_b + 1); + } + + /* reset on */ + __gpio_set_value(gpio_attr->gpio, gpio_attr->reset_on); + + if (reset_cfg->rst_delay) { + usleep_range(reset_cfg->rst_delay, reset_cfg->rst_delay + 1); + } + + /* reset off */ + __gpio_set_value(gpio_attr->gpio, gpio_attr->reset_off); + ret = -1; + udelay_cnt = 0; + timeout = reset_cfg->rst_delay_a; + while (timeout > 0) { + usleep_range(1, 2); + val = __gpio_get_value(gpio_attr->gpio); + if (val == gpio_attr->reset_off) { + ret = 0; + PCA954X_DEBUG("pca954x_do_gpio_reset success.\n"); + break; + } + udelay_cnt++; + if ((udelay_cnt % 1000) == 0) { + /* 1MS schedule*/ + schedule(); + } + timeout--; + } + + if (ret < 0) { + PCA954X_ERROR("pca954x_do_gpio_reset timeout.\n"); + } + + pca9548_gpio_free(gpio_attr); + return ret; +} + +static int pca954x_do_i2c_reset(struct i2c_mux_core *muxc) +{ + int ret, timeout, err; + struct pca954x *data; + pca9548_cfg_info_t *reset_cfg; + i2c_attr_t *i2c_attr; + u8 val; + int udelay_cnt; + + data = i2c_mux_priv(muxc); + reset_cfg = &data->pca9548_cfg_info; + i2c_attr = &reset_cfg->attr.i2c_attr; + ret = -1; + + PCA954X_DEBUG("rst_delay_b:%u, rst_delay:%u, rst_delay_a:%u.\n", + reset_cfg->rst_delay_b, reset_cfg->rst_delay, reset_cfg->rst_delay_a); + PCA954X_DEBUG("bus:0x%x, addr:0x%x, reg:0x%x, mask:0x%x, on:0x%x, off:0x%x.\n", + i2c_attr->i2c_bus, i2c_attr->i2c_addr, i2c_attr->reg_offset, + i2c_attr->mask, i2c_attr->reset_on, i2c_attr->reset_off); + + if (reset_cfg->rst_delay_b) { + usleep_range(reset_cfg->rst_delay_b, reset_cfg->rst_delay_b + 1); + } + + err = pca954x_reset_i2c_read(i2c_attr->i2c_bus, i2c_attr->i2c_addr, + i2c_attr->reg_offset, &val, sizeof(val)); + if (err < 0) { + goto out; + } + val &= ~(i2c_attr->mask); + val |= i2c_attr->reset_on; + err = pca954x_reset_i2c_write(i2c_attr->i2c_bus, i2c_attr->i2c_addr, + i2c_attr->reg_offset, val); + if (err < 0) { + goto out; + } + + if (reset_cfg->rst_delay) { + usleep_range(reset_cfg->rst_delay, reset_cfg->rst_delay + 1); + } + + val &= ~(i2c_attr->mask); + val |= i2c_attr->reset_off; + err = pca954x_reset_i2c_write(i2c_attr->i2c_bus, i2c_attr->i2c_addr, + i2c_attr->reg_offset, val); + if (err < 0) { + goto out; + } + + udelay_cnt = 0; + timeout = reset_cfg->rst_delay_a; + while (timeout > 0) { + usleep_range(1, 2); + err = pca954x_reset_i2c_read(i2c_attr->i2c_bus, i2c_attr->i2c_addr, + i2c_attr->reg_offset, &val, sizeof(val)); + if (err < 0) { + goto out; + } + val &= (i2c_attr->mask); + if (val == i2c_attr->reset_off) { + ret = 0; + PCA954X_DEBUG("pca954x_do_i2c_reset success.\n"); + break; + } + udelay_cnt++; + if ((udelay_cnt % 1000) == 0) { + /* 1MS schedule*/ + schedule(); + } + timeout--; + } + if (ret < 0) { + PCA954X_ERROR("pca954x_do_i2c_reset timeout.\n"); + } +out: + if (err < 0) { + PCA954X_ERROR("pca954x_do_i2c_reset i2c op failed, ret:%d.\n", err); + } + return ret; +} + +static int pca954x_do_reset(struct i2c_mux_core *muxc) +{ + int ret; + struct pca954x *data; + + data = i2c_mux_priv(muxc); + if (data->pca9548_cfg_info.pca9548_reset_type == PCA9548_RESET_NONE) { + ret = -1; + PCA954X_DEBUG("Don't need to reset.\n"); + } else if (data->pca9548_cfg_info.pca9548_reset_type == PCA9548_RESET_I2C) { + ret = pca954x_do_i2c_reset(muxc); + } else if (data->pca9548_cfg_info.pca9548_reset_type == PCA9548_RESET_GPIO) { + ret = pca954x_do_gpio_reset(muxc); + } else if (data->pca9548_cfg_info.pca9548_reset_type == PCA9548_RESET_IO) { + ret = pca954x_do_io_reset(muxc); + } else if (data->pca9548_cfg_info.pca9548_reset_type == PCA9548_RESET_FILE) { + ret = pca954x_do_file_reset(muxc); + } else { + ret = -1; + PCA954X_ERROR("Unsupport reset type:0x%x.\n", + data->pca9548_cfg_info.pca9548_reset_type); + } + + if (ret < 0) { + PCA954X_ERROR("pca9548_reset_ctrl failed, reset type:%u, ret:%d.\n", + data->pca9548_cfg_info.pca9548_reset_type, ret); + } + return ret; +} + +static int pca954x_select_chan(struct i2c_mux_core *muxc, u32 chan) +{ + struct pca954x *data = i2c_mux_priv(muxc); + struct i2c_client *client = data->client; + const struct chip_desc *chip = data->chip; + u8 regval; + int ret = 0; + u8 read_val = 0; + int rv; + + /* we make switches look like muxes, not sure how to be smarter */ + if (chip->muxtype == pca954x_ismux) + regval = chan | chip->enable; + else + regval = 1 << chan; + + /* Only select the channel if its different from the last channel */ + if (data->last_chan != regval) { + pca954x_setmuxflag(client, 0); + ret = pca954x_reg_write(muxc->parent, client, regval); + data->last_chan = ret < 0 ? 0 : regval; + } + + if (data->pca9548_cfg_info.select_chan_check) { /* check chan */ + ret = pca954x_reg_read(muxc->parent, client, &read_val); + /* read failed or chan not open, reset pca9548 */ + if ((ret < 0) || (read_val != data->last_chan)) { + dev_warn(&client->dev, "pca954x open channle %u failed, do reset.\n", chan); + PCA954X_DEBUG("ret = %d, read_val = %d, last_chan = %d.\n", ret, read_val, data->last_chan); + rv = pca954x_do_reset(muxc); + if (rv >= 0) { + PCA954X_DEBUG("pca954x_do_reset success, rv = %d.\n", rv); + } else { + PCA954X_DEBUG("pca954x_do_reset failed, rv = %d.\n", rv); + } + if (ret >= 0) { + ret = -EIO; /* chan not match, return IO error */ + } + } + } + + return ret; +} + +static int pca954x_deselect_mux(struct i2c_mux_core *muxc, u32 chan) +{ + struct pca954x *data = i2c_mux_priv(muxc); + struct i2c_client *client = data->client; + int ret, rv; + + /* Deselect active channel */ + data->last_chan = 0; + if (data->pca9548_cfg_info.close_chan_force_reset) { + ret = pca954x_do_reset(muxc); + } else { + ret = pca954x_reg_write(muxc->parent, client, data->last_chan); + if (ret < 0 ) { + dev_warn(&client->dev, "pca954x close channel %u failed, do reset.\n", chan); + rv = pca954x_do_reset(muxc); + if (rv == 0) { + ret = 0; + } + } + } + + rv = pca954x_setmuxflag(client, 1); + if (rv == 0) { + PCA954X_DEBUG("match 9641, close 9548 channel to deselect 9641.\n"); + (void)pca954x_reg_write(muxc->parent, client, data->last_chan); + } else { + PCA954X_DEBUG("dismatch 9641, do nothing.\n"); + } + + return ret; + +} + +static irqreturn_t pca954x_irq_handler(int irq, void *dev_id) +{ + struct pca954x *data = dev_id; + unsigned int child_irq; + int ret, i, handled = 0; + + ret = i2c_smbus_read_byte(data->client); + if (ret < 0) + return IRQ_NONE; + + for (i = 0; i < data->chip->nchans; i++) { + if (ret & BIT(PCA954X_IRQ_OFFSET + i)) { + child_irq = irq_linear_revmap(data->irq, i); + handle_nested_irq(child_irq); + handled++; + } + } + return handled ? IRQ_HANDLED : IRQ_NONE; +} + +static void pca954x_irq_mask(struct irq_data *idata) +{ + struct pca954x *data = irq_data_get_irq_chip_data(idata); + unsigned int pos = idata->hwirq; + unsigned long flags; + + raw_spin_lock_irqsave(&data->lock, flags); + + data->irq_mask &= ~BIT(pos); + if (!data->irq_mask) + disable_irq(data->client->irq); + + raw_spin_unlock_irqrestore(&data->lock, flags); +} + +static void pca954x_irq_unmask(struct irq_data *idata) +{ + struct pca954x *data = irq_data_get_irq_chip_data(idata); + unsigned int pos = idata->hwirq; + unsigned long flags; + + raw_spin_lock_irqsave(&data->lock, flags); + + if (!data->irq_mask) + enable_irq(data->client->irq); + data->irq_mask |= BIT(pos); + + raw_spin_unlock_irqrestore(&data->lock, flags); +} + +static int pca954x_irq_set_type(struct irq_data *idata, unsigned int type) +{ + if ((type & IRQ_TYPE_SENSE_MASK) != IRQ_TYPE_LEVEL_LOW) + return -EINVAL; + return 0; +} + +static struct irq_chip pca954x_irq_chip = { + .name = "i2c-mux-pca954x", + .irq_mask = pca954x_irq_mask, + .irq_unmask = pca954x_irq_unmask, + .irq_set_type = pca954x_irq_set_type, +}; + +static int of_pca954x_irq_setup(struct i2c_mux_core *muxc) +{ + struct pca954x *data = i2c_mux_priv(muxc); + struct i2c_client *client = data->client; + int c, err, irq; + + if (!data->chip->has_irq || client->irq <= 0) + return 0; + + raw_spin_lock_init(&data->lock); + + data->irq = irq_domain_add_linear(client->dev.of_node, + data->chip->nchans, + &irq_domain_simple_ops, data); + if (!data->irq) + return -ENODEV; + + for (c = 0; c < data->chip->nchans; c++) { + irq = irq_create_mapping(data->irq, c); + irq_set_chip_data(irq, data); + irq_set_chip_and_handler(irq, &pca954x_irq_chip, + handle_simple_irq); + } + + err = devm_request_threaded_irq(&client->dev, data->client->irq, NULL, + pca954x_irq_handler, + IRQF_ONESHOT | IRQF_SHARED, + "pca954x", data); + if (err) + goto err_req_irq; + + disable_irq(data->client->irq); + + return 0; +err_req_irq: + for (c = 0; c < data->chip->nchans; c++) { + irq = irq_find_mapping(data->irq, c); + irq_dispose_mapping(irq); + } + irq_domain_remove(data->irq); + + return err; +} + +static int pca954x_irq_setup(struct i2c_mux_core *muxc) +{ + return 0; +} + +static int of_pca954x_reset_data_init(struct pca954x *data) +{ + int err, rv; + struct device *dev = &data->client->dev; + pca9548_cfg_info_t *reset_cfg; + + reset_cfg = &data->pca9548_cfg_info; + if (dev == NULL || dev->of_node == NULL) { + PCA954X_DEBUG("dev or dev->of_node is NUll, no reset.\n"); + reset_cfg->pca9548_reset_type = PCA9548_RESET_NONE; + return 0; + } + + reset_cfg->select_chan_check = of_property_read_bool(dev->of_node, "select_chan_check"); + reset_cfg->close_chan_force_reset = of_property_read_bool(dev->of_node, "close_chan_force_reset"); + PCA954X_DEBUG("select_chan_check:%d, close_chan_force_reset:%d.\n", reset_cfg->select_chan_check, + reset_cfg->close_chan_force_reset); + + if (of_property_read_u32(dev->of_node, "pca9548_reset_type", &reset_cfg->pca9548_reset_type)) { + + PCA954X_DEBUG("pca9548_reset_type not found, no reset.\n"); + reset_cfg->pca9548_reset_type = PCA9548_RESET_NONE; + return 0; + } + err = of_property_read_u32(dev->of_node, "rst_delay_b", &reset_cfg->rst_delay_b); + err |= of_property_read_u32(dev->of_node, "rst_delay", &reset_cfg->rst_delay); + err |= of_property_read_u32(dev->of_node, "rst_delay_a", &reset_cfg->rst_delay_a); + + if (err) { + goto dts_config_err; + } + PCA954X_DEBUG("reset_type:0x%x, rst_delay_b:0x%x, rst_delay:0x%x, rst_delay_a:0x%x.\n", + reset_cfg->pca9548_reset_type, reset_cfg->rst_delay_b, + reset_cfg->rst_delay, reset_cfg->rst_delay_a); + + if (reset_cfg->pca9548_reset_type == PCA9548_RESET_I2C) { + PCA954X_DEBUG("reset by i2c.\n"); + err = of_property_read_u32(dev->of_node, "i2c_bus", &reset_cfg->attr.i2c_attr.i2c_bus); + err |=of_property_read_u32(dev->of_node, "i2c_addr", &reset_cfg->attr.i2c_attr.i2c_addr); + err |=of_property_read_u32(dev->of_node, "reg_offset", &reset_cfg->attr.i2c_attr.reg_offset); + err |=of_property_read_u32(dev->of_node, "mask", &reset_cfg->attr.i2c_attr.mask); + err |=of_property_read_u32(dev->of_node, "reset_on", &reset_cfg->attr.i2c_attr.reset_on); + err |=of_property_read_u32(dev->of_node, "reset_off", &reset_cfg->attr.i2c_attr.reset_off); + if (err) { + goto dts_config_err; + } + PCA954X_DEBUG("bus:%u, addr:0x%x, offset:0x%x, mask:0x%x, on:0x%x, off:0x%x.\n", + reset_cfg->attr.i2c_attr.i2c_bus, reset_cfg->attr.i2c_attr.i2c_addr, + reset_cfg->attr.i2c_attr.reg_offset, reset_cfg->attr.i2c_attr.mask, + reset_cfg->attr.i2c_attr.reset_on, reset_cfg->attr.i2c_attr.reset_off); + } else if (reset_cfg->pca9548_reset_type == PCA9548_RESET_GPIO) { + PCA954X_DEBUG("reset by gpio.\n"); + err = of_property_read_u32(dev->of_node, "gpio", &reset_cfg->attr.gpio_attr.gpio); + err |=of_property_read_u32(dev->of_node, "reset_on", &reset_cfg->attr.gpio_attr.reset_on); + err |=of_property_read_u32(dev->of_node, "reset_off", &reset_cfg->attr.gpio_attr.reset_off); + if (err) { + goto dts_config_err; + } + PCA954X_DEBUG("gpio number:%u, reset_on:0x%x, reset_off:0x%x.\n", + reset_cfg->attr.gpio_attr.gpio, reset_cfg->attr.gpio_attr.reset_on, + reset_cfg->attr.gpio_attr.reset_off); + reset_cfg->attr.gpio_attr.gpio_init = 0; + } else if (reset_cfg->pca9548_reset_type == PCA9548_RESET_IO) { + PCA954X_DEBUG("reset by io.\n"); + err = of_property_read_u32(dev->of_node, "io_addr", &reset_cfg->attr.io_attr.io_addr); + err |=of_property_read_u32(dev->of_node, "mask", &reset_cfg->attr.io_attr.mask); + err |=of_property_read_u32(dev->of_node, "reset_on", &reset_cfg->attr.io_attr.reset_on); + err |=of_property_read_u32(dev->of_node, "reset_off", &reset_cfg->attr.io_attr.reset_off); + if (err) { + goto dts_config_err; + } + PCA954X_DEBUG("io_addr:0x%x, mask:0x%x, reset_on:0x%x, reset_off:0x%x.\n", + reset_cfg->attr.io_attr.io_addr, reset_cfg->attr.io_attr.mask, + reset_cfg->attr.io_attr.reset_on, reset_cfg->attr.io_attr.reset_off); + } else if (reset_cfg->pca9548_reset_type == PCA9548_RESET_FILE) { + PCA954X_DEBUG("reset by file.\n"); + err = of_property_read_string(dev->of_node, "dev_name", &reset_cfg->attr.file_attr.dev_name); + err |=of_property_read_u32(dev->of_node, "offset", &reset_cfg->attr.file_attr.offset); + err |=of_property_read_u32(dev->of_node, "mask", &reset_cfg->attr.file_attr.mask); + err |=of_property_read_u32(dev->of_node, "reset_on", &reset_cfg->attr.file_attr.reset_on); + err |=of_property_read_u32(dev->of_node, "reset_off", &reset_cfg->attr.file_attr.reset_off); + if (err) { + goto dts_config_err; + } + rv = of_property_read_u32(dev->of_node, "width", &reset_cfg->attr.file_attr.width); + if (rv == 0) { + if ((reset_cfg->attr.file_attr.width != WIDTH_1Byte) && (reset_cfg->attr.file_attr.width != WIDTH_4Byte)) { + PCA954X_ERROR("9548 reset config error, witdh: %u not support.\n", reset_cfg->attr.file_attr.width); + return -EINVAL; + } + } else { + reset_cfg->attr.file_attr.width = 1; + } + PCA954X_DEBUG("dev_name:%s, mask:0x%x, reset_on:0x%x, reset_off:0x%x, width: %u\n", + reset_cfg->attr.file_attr.dev_name, reset_cfg->attr.file_attr.mask, + reset_cfg->attr.file_attr.reset_on, reset_cfg->attr.file_attr.reset_off, reset_cfg->attr.file_attr.width); + } else { + PCA954X_ERROR("Unsupport reset type:%d.\n", reset_cfg->pca9548_reset_type); + goto dts_config_err; + } + return 0; +dts_config_err: + PCA954X_ERROR("dts config error, ret:%d.\n", err); + return -EINVAL; +} + +static int pca954x_reset_data_init(struct pca954x *data) +{ + pca9548_cfg_info_t *reset_cfg; + i2c_mux_pca954x_device_t *i2c_mux_pca954x_device; + + if (data->client->dev.platform_data == NULL) { + PCA954X_DEBUG("pca954x has no reset platform data config.\n"); + return 0; + } + reset_cfg = &data->pca9548_cfg_info; + i2c_mux_pca954x_device = data->client->dev.platform_data; + reset_cfg->select_chan_check = i2c_mux_pca954x_device->select_chan_check; + reset_cfg->close_chan_force_reset = i2c_mux_pca954x_device->close_chan_force_reset; + PCA954X_DEBUG("select_chan_check:%d, close_chan_force_reset:%d.\n", reset_cfg->select_chan_check, + reset_cfg->close_chan_force_reset); + + reset_cfg->pca9548_reset_type = i2c_mux_pca954x_device->pca9548_reset_type; + if (reset_cfg->pca9548_reset_type == PCA9548_RESET_NONE) { + PCA954X_DEBUG("pca9548_reset_type not found, no reset.\n"); + return 0; + } + + reset_cfg->rst_delay_b = i2c_mux_pca954x_device->rst_delay_b; + reset_cfg->rst_delay = i2c_mux_pca954x_device->rst_delay; + reset_cfg->rst_delay_a = i2c_mux_pca954x_device->rst_delay_a; + PCA954X_DEBUG("reset_type:0x%x, rst_delay_b:0x%x, rst_delay:0x%x, rst_delay_a:0x%x.\n", + reset_cfg->pca9548_reset_type, reset_cfg->rst_delay_b, + reset_cfg->rst_delay, reset_cfg->rst_delay_a); + + if (reset_cfg->pca9548_reset_type == PCA9548_RESET_I2C) { + PCA954X_DEBUG("reset by i2c.\n"); + reset_cfg->attr.i2c_attr.i2c_bus = i2c_mux_pca954x_device->attr.i2c_attr.i2c_bus; + reset_cfg->attr.i2c_attr.i2c_addr = i2c_mux_pca954x_device->attr.i2c_attr.i2c_addr; + reset_cfg->attr.i2c_attr.reg_offset = i2c_mux_pca954x_device->attr.i2c_attr.reg_offset; + reset_cfg->attr.i2c_attr.mask = i2c_mux_pca954x_device->attr.i2c_attr.mask; + reset_cfg->attr.i2c_attr.reset_on = i2c_mux_pca954x_device->attr.i2c_attr.reset_on; + reset_cfg->attr.i2c_attr.reset_off = i2c_mux_pca954x_device->attr.i2c_attr.reset_off; + PCA954X_DEBUG("bus:%u, addr:0x%x, offset:0x%x, mask:0x%x, on:0x%x, off:0x%x.\n", + reset_cfg->attr.i2c_attr.i2c_bus, reset_cfg->attr.i2c_attr.i2c_addr, + reset_cfg->attr.i2c_attr.reg_offset, reset_cfg->attr.i2c_attr.mask, + reset_cfg->attr.i2c_attr.reset_on, reset_cfg->attr.i2c_attr.reset_off); + } else if (reset_cfg->pca9548_reset_type == PCA9548_RESET_GPIO) { + PCA954X_DEBUG("reset by gpio.\n"); + reset_cfg->attr.gpio_attr.gpio = i2c_mux_pca954x_device->attr.gpio_attr.gpio; + reset_cfg->attr.gpio_attr.reset_on = i2c_mux_pca954x_device->attr.gpio_attr.reset_on; + reset_cfg->attr.gpio_attr.reset_off = i2c_mux_pca954x_device->attr.gpio_attr.reset_off; + PCA954X_DEBUG("gpio number:%u, reset_on:0x%x, reset_off:0x%x.\n", + reset_cfg->attr.gpio_attr.gpio, reset_cfg->attr.gpio_attr.reset_on, + reset_cfg->attr.gpio_attr.reset_off); + reset_cfg->attr.gpio_attr.gpio_init = 0; + } else if (reset_cfg->pca9548_reset_type == PCA9548_RESET_IO) { + PCA954X_DEBUG("reset by io.\n"); + reset_cfg->attr.io_attr.io_addr = i2c_mux_pca954x_device->attr.io_attr.io_addr; + reset_cfg->attr.io_attr.mask = i2c_mux_pca954x_device->attr.io_attr.mask; + reset_cfg->attr.io_attr.reset_on = i2c_mux_pca954x_device->attr.io_attr.reset_on; + reset_cfg->attr.io_attr.reset_off = i2c_mux_pca954x_device->attr.io_attr.reset_off; + PCA954X_DEBUG("io_addr:0x%x, mask:0x%x, reset_on:0x%x, reset_off:0x%x.\n", + reset_cfg->attr.io_attr.io_addr, reset_cfg->attr.io_attr.mask, + reset_cfg->attr.io_attr.reset_on, reset_cfg->attr.io_attr.reset_off); + } else if (reset_cfg->pca9548_reset_type == PCA9548_RESET_FILE) { + PCA954X_DEBUG("reset by file.\n"); + reset_cfg->attr.file_attr.dev_name = i2c_mux_pca954x_device->attr.file_attr.dev_name; + reset_cfg->attr.file_attr.offset = i2c_mux_pca954x_device->attr.file_attr.offset; + reset_cfg->attr.file_attr.mask = i2c_mux_pca954x_device->attr.file_attr.mask; + reset_cfg->attr.file_attr.reset_on = i2c_mux_pca954x_device->attr.file_attr.reset_on; + reset_cfg->attr.file_attr.reset_off = i2c_mux_pca954x_device->attr.file_attr.reset_off; + reset_cfg->attr.file_attr.width = i2c_mux_pca954x_device->attr.file_attr.width; + if (reset_cfg->attr.file_attr.width > 0) { + if ((reset_cfg->attr.file_attr.width != WIDTH_1Byte) && (reset_cfg->attr.file_attr.width != WIDTH_4Byte)) { + PCA954X_ERROR("9548 reset config error, witdh: %u not support.\n", reset_cfg->attr.file_attr.width); + return -EINVAL; + } + } else { + reset_cfg->attr.file_attr.width = 1; + } + PCA954X_DEBUG("dev_name:%s, mask:0x%x, reset_on:0x%x, reset_off:0x%x, width: %u\n", + reset_cfg->attr.file_attr.dev_name, reset_cfg->attr.file_attr.mask, + reset_cfg->attr.file_attr.reset_on, reset_cfg->attr.file_attr.reset_off, reset_cfg->attr.file_attr.width); + } else { + PCA954X_ERROR("Unsupport reset type:%d.\n", reset_cfg->pca9548_reset_type); + return -EINVAL; + } + return 0; +} + +/* + * I2C init/probing/exit functions + */ +static int pca954x_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent); + struct device_node *of_node = client->dev.of_node; + bool idle_disconnect_dt; + struct gpio_desc *gpio; + int num, force, class; + struct i2c_mux_core *muxc; + struct pca954x *data; + const struct of_device_id *match; + unsigned int probe_disable; + int ret, dynamic_nr; + i2c_mux_pca954x_device_t *i2c_mux_pca954x_device; + + PCA954X_DEBUG("pca954x_probe, parent bus: %d, 9548 addr:0x%x.\n", adap->nr, client->addr); + + if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE)) + return -ENODEV; + + muxc = i2c_mux_alloc(adap, &client->dev, + PCA954X_MAX_NCHANS, sizeof(*data), 0, + pca954x_select_chan, pca954x_deselect_mux); + if (!muxc) + return -ENOMEM; + data = i2c_mux_priv(muxc); + + i2c_set_clientdata(client, muxc); + data->client = client; + + /* Get the mux out of reset if a reset GPIO is specified. */ + gpio = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(gpio)) + return PTR_ERR(gpio); + + /* check device connection status */ + + if (client->dev.of_node == NULL) { + if (client->dev.platform_data == NULL) { + probe_disable = 1; + PCA954X_DEBUG("has no platform data config, set probe_disable = 1.\n"); + } else { + i2c_mux_pca954x_device = client->dev.platform_data; + probe_disable = i2c_mux_pca954x_device->probe_disable; + } + } else { + probe_disable = of_property_read_bool(of_node, "probe_disable"); + } + + /* Write the mux register at addr to verify + * that the mux is in fact present. This also + * initializes the mux to disconnected state. + */ + if (!probe_disable && (i2c_smbus_write_byte(client, 0) < 0)) { + dev_warn(&client->dev, "probe failed\n"); + return -ENODEV; + } + + match = of_match_device(of_match_ptr(pca954x_of_match), &client->dev); + if (match) + data->chip = of_device_get_match_data(&client->dev); + else + data->chip = &chips[id->driver_data]; + + data->last_chan = 0; /* force the first selection */ + + if (client->dev.of_node == NULL) { + idle_disconnect_dt = false; + } else { + idle_disconnect_dt = of_node && + of_property_read_bool(of_node, "i2c-mux-idle-disconnect"); + } + + if (client->dev.of_node) { + ret= of_pca954x_reset_data_init(data); + } else { + ret= pca954x_reset_data_init(data); + } + if (ret < 0) { + dev_err(&client->dev, "pca954x reset config err, ret:%d.\n", ret); + return ret; + } + + if (client->dev.of_node) { + ret = of_pca954x_irq_setup(muxc); + } else { + ret = pca954x_irq_setup(muxc); + } + if (ret) { + goto fail_del_adapters; + } + + if (client->dev.of_node == NULL) { + if (client->dev.platform_data == NULL) { + dynamic_nr = 1; + PCA954X_DEBUG("platform data is NULL, use dynamic adap number.\n"); + } else { + i2c_mux_pca954x_device = client->dev.platform_data; + data->pca9548_cfg_info.pca9548_base_nr = i2c_mux_pca954x_device->pca9548_base_nr; + if (data->pca9548_cfg_info.pca9548_base_nr == 0) { + dynamic_nr = 1; + PCA954X_DEBUG("pca9548_base_nr = 0, use dynamic adap number.\n"); + } else { + dynamic_nr = 0; + PCA954X_DEBUG("pca9548_base_nr:%u.\n", data->pca9548_cfg_info.pca9548_base_nr); + } + } + } else { + if (of_property_read_u32(of_node, "pca9548_base_nr", &data->pca9548_cfg_info.pca9548_base_nr)) { + + dynamic_nr = 1; + PCA954X_DEBUG("pca9548_base_nr not found, use dynamic adap number"); + } else { + dynamic_nr = 0; + PCA954X_DEBUG("pca9548_base_nr:%u.\n", data->pca9548_cfg_info.pca9548_base_nr); + } + } + + /* Now create an adapter for each channel */ + for (num = 0; num < data->chip->nchans; num++) { + bool idle_disconnect_pd = false; + if (dynamic_nr == 1) { + force = 0; /* dynamic adap number */ + } else { + force = data->pca9548_cfg_info.pca9548_base_nr + num; + } + + class = 0; /* no class by default */ + data->deselect |= (idle_disconnect_pd || + idle_disconnect_dt) << num; + + ret = i2c_mux_add_adapter(muxc, force, num, class); + if (ret) + goto fail_del_adapters; + } + + dev_info(&client->dev, + "registered %d multiplexed busses for I2C %s %s\n", + num, data->chip->muxtype == pca954x_ismux + ? "mux" : "switch", client->name); + + return 0; + +fail_del_adapters: + i2c_mux_del_adapters(muxc); + return ret; +} + +static void pca954x_remove(struct i2c_client *client) +{ + struct i2c_mux_core *muxc = i2c_get_clientdata(client); + struct pca954x *data = i2c_mux_priv(muxc); + int c, irq; + + if (data->irq) { + for (c = 0; c < data->chip->nchans; c++) { + irq = irq_find_mapping(data->irq, c); + irq_dispose_mapping(irq); + } + irq_domain_remove(data->irq); + } + + i2c_mux_del_adapters(muxc); + return; +} + +#ifdef CONFIG_PM_SLEEP +static int pca954x_resume(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct i2c_mux_core *muxc = i2c_get_clientdata(client); + struct pca954x *data = i2c_mux_priv(muxc); + + data->last_chan = 0; + return i2c_smbus_write_byte(client, 0); +} +#endif + +static SIMPLE_DEV_PM_OPS(pca954x_pm, NULL, pca954x_resume); + +static struct i2c_driver pca954x_driver = { + .driver = { + .name = "wb_pca954x", + .pm = &pca954x_pm, + .of_match_table = of_match_ptr(pca954x_of_match), + }, + .probe = pca954x_probe, + .remove = pca954x_remove, + .id_table = pca954x_id, +}; + +module_i2c_driver(pca954x_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("PCA954x I2C mux/switch driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca954x.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca954x.h new file mode 100644 index 000000000000..beed9b2f94ac --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca954x.h @@ -0,0 +1,68 @@ +#ifndef __WB_I2C_MUX_PCA954X_H__ +#define __WB_I2C_MUX_PCA954X_H__ + +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +typedef enum pca9548_reset_type_s { + PCA9548_RESET_NONE = 0, + PCA9548_RESET_I2C = 1, + PCA9548_RESET_GPIO = 2, + PCA9548_RESET_IO = 3, + PCA9548_RESET_FILE = 4, +} pca9548_reset_type_t; + +typedef struct i2c_attr_s { + uint32_t i2c_bus; + uint32_t i2c_addr; + uint32_t reg_offset; + uint32_t mask; + uint32_t reset_on; + uint32_t reset_off; +} i2c_attr_t; + +typedef struct io_attr_s { + uint32_t io_addr; + uint32_t mask; + uint32_t reset_on; + uint32_t reset_off; +} io_attr_t; + +typedef struct file_attr_s { + const char *dev_name; + uint32_t offset; + uint32_t mask; + uint32_t reset_on; + uint32_t reset_off; + uint32_t width; +} file_attr_t; + +typedef struct gpio_attr_s { + int gpio_init; + uint32_t gpio; + uint32_t reset_on; + uint32_t reset_off; +} gpio_attr_t; + +typedef struct i2c_mux_pca954x_device_s { + struct i2c_client *client; + uint32_t i2c_bus; + uint32_t i2c_addr; + uint32_t pca9548_base_nr; + uint32_t pca9548_reset_type; + uint32_t rst_delay_b; /* delay time before reset(us) */ + uint32_t rst_delay; /* reset time(us) */ + uint32_t rst_delay_a; /* delay time after reset(us) */ + bool probe_disable; + bool select_chan_check; + bool close_chan_force_reset; + union { + i2c_attr_t i2c_attr; + gpio_attr_t gpio_attr; + io_attr_t io_attr; + file_attr_t file_attr; + } attr; +} i2c_mux_pca954x_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca9641.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca9641.c new file mode 100644 index 000000000000..a3ae9f4b2431 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca9641.c @@ -0,0 +1,1410 @@ +/* + * I2C multiplexer driver for PCA9541 bus master selector + * + * Copyright (c) 2010 Ericsson AB. + * + * Author: Guenter Roeck + * + * Derived from: + * pca954x.c + * + * Copyright (c) 2008-2009 Rodolfo Giometti + * Copyright (c) 2008-2009 Eurotech S.p.A. + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_i2c_mux_pca9641.h" + +/* + * The PCA9541 is a bus master selector. It supports two I2C masters connected + * to a single slave bus. + * + * Before each bus transaction, a master has to acquire bus ownership. After the + * transaction is complete, bus ownership has to be released. This fits well + * into the I2C multiplexer framework, which provides select and release + * functions for this purpose. For this reason, this driver is modeled as + * single-channel I2C bus multiplexer. + * + * This driver assumes that the two bus masters are controlled by two different + * hosts. If a single host controls both masters, platform code has to ensure + * that only one of the masters is instantiated at any given time. + */ + +#define PCA9541_CONTROL 0x01 +#define PCA9541_ISTAT 0x02 + +#define PCA9541_CTL_MYBUS (1 << 0) +#define PCA9541_CTL_NMYBUS (1 << 1) +#define PCA9541_CTL_BUSON (1 << 2) +#define PCA9541_CTL_NBUSON (1 << 3) +#define PCA9541_CTL_BUSINIT (1 << 4) +#define PCA9541_CTL_TESTON (1 << 6) +#define PCA9541_CTL_NTESTON (1 << 7) +#define PCA9541_ISTAT_INTIN (1 << 0) +#define PCA9541_ISTAT_BUSINIT (1 << 1) +#define PCA9541_ISTAT_BUSOK (1 << 2) +#define PCA9541_ISTAT_BUSLOST (1 << 3) +#define PCA9541_ISTAT_MYTEST (1 << 6) +#define PCA9541_ISTAT_NMYTEST (1 << 7) +#define PCA9641_ID 0x00 +#define PCA9641_ID_MAGIC 0x38 +#define PCA9641_CONTROL 0x01 +#define PCA9641_STATUS 0x02 +#define PCA9641_TIME 0x03 +#define PCA9641_CTL_LOCK_REQ BIT(0) +#define PCA9641_CTL_LOCK_GRANT BIT(1) +#define PCA9641_CTL_BUS_CONNECT BIT(2) +#define PCA9641_CTL_BUS_INIT BIT(3) +#define PCA9641_CTL_SMBUS_SWRST BIT(4) +#define PCA9641_CTL_IDLE_TIMER_DIS BIT(5) +#define PCA9641_CTL_SMBUS_DIS BIT(6) +#define PCA9641_CTL_PRIORITY BIT(7) +#define PCA9641_STS_OTHER_LOCK BIT(0) +#define PCA9641_STS_BUS_INIT_FAIL BIT(1) +#define PCA9641_STS_BUS_HUNG BIT(2) +#define PCA9641_STS_MBOX_EMPTY BIT(3) +#define PCA9641_STS_MBOX_FULL BIT(4) +#define PCA9641_STS_TEST_INT BIT(5) +#define PCA9641_STS_SCL_IO BIT(6) +#define PCA9641_STS_SDA_IO BIT(7) +#define PCA9641_RES_TIME 0x03 +#define BUSON (PCA9541_CTL_BUSON | PCA9541_CTL_NBUSON) +#define MYBUS (PCA9541_CTL_MYBUS | PCA9541_CTL_NMYBUS) +#define mybus(x) (!((x) & MYBUS) || ((x) & MYBUS) == MYBUS) +#define busoff(x) (!((x) & BUSON) || ((x) & BUSON) == BUSON) +#define BUSOFF(x, y) (!((x) & PCA9641_CTL_LOCK_GRANT) && \ + !((y) & PCA9641_STS_OTHER_LOCK)) +#define other_lock(x) ((x) & PCA9641_STS_OTHER_LOCK) +#define lock_grant(x) ((x) & PCA9641_CTL_LOCK_GRANT) + +#define PCA9641_RETRY_TIME (8) +#define PCA9641_RESET_DELAY (150) + +typedef struct i2c_muxs_struct_flag +{ + int nr; + char name[48]; + struct mutex update_lock; + int flag; +}i2c_mux_flag; + +i2c_mux_flag pca_flag = { + .nr = -1, + .flag = -1, +}; + +int pca9641_setmuxflag(int nr, int flag) +{ + if (pca_flag.nr == nr) { + pca_flag.flag = flag; + return 0; + } + return -1; +} +EXPORT_SYMBOL(pca9641_setmuxflag); + +static int g_debug_info = 0; +static int g_debug_err = 0; + +module_param(g_debug_info, int, S_IRUGO | S_IWUSR); +module_param(g_debug_err, int, S_IRUGO | S_IWUSR); + +#define PCA_DEBUG(fmt, args...) do { \ + if (g_debug_info) { \ + printk(KERN_INFO "[pca9641][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define PCA_DEBUG_ERR(fmt, args...) do { \ + if (g_debug_err) { \ + printk(KERN_ERR "[pca9641][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +/* arbitration timeouts, in jiffies */ +#define ARB_TIMEOUT (HZ / 8) /* 125 ms until forcing bus ownership */ +#define ARB2_TIMEOUT (HZ / 4) /* 250 ms until acquisition failure */ + +/* arbitration retry delays, in us */ +#define SELECT_DELAY_SHORT 50 +#define SELECT_DELAY_LONG 1000 +#define I2C_RETRY_TIMES (5) +#define I2C_RETRY_WAIT_TIMES (10) /*delay 10ms*/ + +typedef struct pca9641_cfg_info_s { + uint32_t pca9641_reset_type; + uint32_t rst_delay_b; /* delay time before reset(us) */ + uint32_t rst_delay; /* reset time(us) */ + uint32_t rst_delay_a; /* delay time after reset(us) */ + union { + i2c_attr_t i2c_attr; + gpio_attr_t gpio_attr; + io_attr_t io_attr; + file_attr_t file_attr; + } attr; +} pca9641_cfg_info_t; + +struct pca9541 { + struct i2c_client *client; + unsigned long select_timeout; + unsigned long arb_timeout; + uint32_t pca9641_nr; + pca9641_cfg_info_t pca9641_cfg_info; /* pca9641 reset cfg */ +}; + +static const struct i2c_device_id pca9541_id[] = { + {"wb_pca9541", 0}, + {"wb_pca9641", 1}, + {} +}; + +MODULE_DEVICE_TABLE(i2c, pca9541_id); + +#ifdef CONFIG_OF +static const struct of_device_id pca9541_of_match[] = { + { .compatible = "nxp,wb_pca9541" }, + { .compatible = "nxp,wb_pca9641" }, + {} +}; +MODULE_DEVICE_TABLE(of, pca9541_of_match); +#endif + +static int pca9641_gpio_init(gpio_attr_t *gpio_attr) +{ + int err; + + if (gpio_attr->gpio_init) { + PCA_DEBUG("gpio%d already init, do nothing.\n", gpio_attr->gpio); + return 0; + } + + PCA_DEBUG("gpio%d init.\n", gpio_attr->gpio); + err = gpio_request(gpio_attr->gpio, "pca9641_reset"); + if (err) { + goto error; + } + err = gpio_direction_output(gpio_attr->gpio, gpio_attr->reset_off); + if (err) { + gpio_free(gpio_attr->gpio); + goto error; + } + gpio_attr->gpio_init = 1; + return 0; +error: + PCA_DEBUG_ERR("pca9641_gpio_init failed, ret:%d.\n", err); + return err; +} + +static void pca9641_gpio_free(gpio_attr_t *gpio_attr) +{ + if (gpio_attr->gpio_init == 1) { + PCA_DEBUG("gpio%d release.\n", gpio_attr->gpio); + gpio_free(gpio_attr->gpio); + gpio_attr->gpio_init = 0; + } + return; +} + +static int pca9641_reset_file_read(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDONLY, 0); + if (IS_ERR(filp)) { + PCA_DEBUG_ERR("read open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_DEST, &iov, 1, iov.iov_len); + ret = vfs_iter_read(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + PCA_DEBUG_ERR("vfs_iter_read failed, path=%s, addr=0x%x, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int pca9641_reset_file_write(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDWR, 777); + if (IS_ERR(filp)) { + PCA_DEBUG_ERR("write open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_SOURCE, &iov, 1, iov.iov_len); + ret = vfs_iter_write(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + PCA_DEBUG_ERR("vfs_iter_write failed, path=%s, addr=0x%x, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + vfs_fsync(filp, 1); + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int pca9641_reset_i2c_read(uint32_t bus, uint32_t addr, uint32_t offset_addr, + unsigned char *buf, uint32_t size) +{ + struct file *fp; + struct i2c_client client; + char i2c_path[32]; + int i, j; + int rv; + + rv = 0; + mem_clear(i2c_path, sizeof(i2c_path)); + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", bus); + fp = filp_open(i2c_path, O_RDWR, S_IRUSR | S_IWUSR); + if (IS_ERR(fp)) { + PCA_DEBUG_ERR("i2c open fail.\n"); + return -1; + } + memcpy(&client, fp->private_data, sizeof(struct i2c_client)); + client.addr = addr; + for (j = 0; j < size; j++) { + for (i = 0; i < I2C_RETRY_TIMES; i++) { + rv = i2c_smbus_read_byte_data(&client, (offset_addr + j)); + if (rv < 0) { + PCA_DEBUG_ERR("i2c read failed, try again.\n"); + msleep(I2C_RETRY_WAIT_TIMES); + if (i >= (I2C_RETRY_TIMES - 1)) { + goto out; + } + continue; + } + *(buf + j) = (unsigned char)rv; + break; + } + } +out: + filp_close(fp, NULL); + return rv; +} + +static int pca9641_reset_i2c_write(uint32_t bus, uint32_t dev_addr, uint32_t offset_addr, + uint8_t write_buf) +{ + struct file *fp; + struct i2c_client client; + char i2c_path[32]; + int i; + int rv; + + rv = 0; + mem_clear(i2c_path, sizeof(i2c_path)); + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", bus); + fp = filp_open(i2c_path, O_RDWR, S_IRUSR | S_IWUSR); + if (IS_ERR(fp)) { + PCA_DEBUG_ERR("i2c open fail.\n"); + return -1; + } + memcpy(&client, fp->private_data, sizeof(struct i2c_client)); + client.addr = dev_addr; + for (i = 0; i < I2C_RETRY_TIMES; i++) { + rv = i2c_smbus_write_byte_data(&client, offset_addr, write_buf); + if (rv < 0) { + PCA_DEBUG_ERR("i2c write failed, try again.\n"); + msleep(I2C_RETRY_WAIT_TIMES); + if (i >= (I2C_RETRY_TIMES - 1)) { + goto out; + } + continue; + } + break; + } +out: + filp_close(fp, NULL); + return rv; +} + +static int pca9641_do_file_reset(struct i2c_mux_core *muxc) +{ + int ret, timeout, err; + struct pca9541 *data; + pca9641_cfg_info_t *reset_cfg; + file_attr_t *file_attr; + u8 val; + int udelay_cnt; + + data = i2c_mux_priv(muxc); + reset_cfg = &data->pca9641_cfg_info; + file_attr = &reset_cfg->attr.file_attr; + ret = -1; + + PCA_DEBUG("rst_delay_b:%u, rst_delay:%u, rst_delay_a:%u.\n", + reset_cfg->rst_delay_b, reset_cfg->rst_delay, reset_cfg->rst_delay_a); + PCA_DEBUG("dev_name:%s, offset:0x%x, mask:0x%x, on:0x%x, off:0x%x.\n", + file_attr->dev_name, file_attr->offset, file_attr->mask, + file_attr->reset_on, file_attr->reset_off); + + if (reset_cfg->rst_delay_b) { + usleep_range(reset_cfg->rst_delay_b, reset_cfg->rst_delay_b + 1); + } + + err = pca9641_reset_file_read(file_attr->dev_name, file_attr->offset, &val, sizeof(val)); + if (err < 0) { + goto out; + } + + val &= ~(file_attr->mask); + val |= file_attr->reset_on; + err = pca9641_reset_file_write(file_attr->dev_name, file_attr->offset, &val, sizeof(val)); + if (err < 0) { + goto out; + } + + if (reset_cfg->rst_delay) { + usleep_range(reset_cfg->rst_delay, reset_cfg->rst_delay + 1); + } + + val &= ~(file_attr->mask); + val |= file_attr->reset_off; + err = pca9641_reset_file_write(file_attr->dev_name, file_attr->offset, &val, sizeof(val)); + if (err < 0) { + goto out; + } + + udelay_cnt = 0; + timeout = reset_cfg->rst_delay_a; + while (timeout > 0) { + usleep_range(1, 2); + err = pca9641_reset_file_read(file_attr->dev_name, file_attr->offset, &val, sizeof(val)); + if (err < 0) { + goto out; + } + val &= (file_attr->mask); + if (val == file_attr->reset_off) { + ret = 0; + PCA_DEBUG("pca9641_do_file_reset success.\n"); + break; + } + udelay_cnt++; + if ((udelay_cnt % 1000) == 0) { + /* 1MS schedule*/ + schedule(); + } + timeout--; + } + if (ret < 0) { + PCA_DEBUG_ERR("pca9641_do_file_reset timeout.\n"); + } +out: + if (err < 0) { + PCA_DEBUG_ERR("pca9641_do_file_reset file rd/wr failed, ret:%d.\n", err); + } + + return ret; +} + +static int pca9641_do_io_reset(struct i2c_mux_core *muxc) +{ + int ret, timeout; + struct pca9541 *data; + pca9641_cfg_info_t *reset_cfg; + io_attr_t *io_attr; + u8 val; + int udelay_cnt; + + data = i2c_mux_priv(muxc); + reset_cfg = &data->pca9641_cfg_info; + io_attr = &reset_cfg->attr.io_attr; + + PCA_DEBUG("rst_delay_b:%u, rst_delay:%u, rst_delay_a:%u.\n", + reset_cfg->rst_delay_b, reset_cfg->rst_delay, reset_cfg->rst_delay_a); + PCA_DEBUG("io_addr:0x%x, mask:0x%x, on:0x%x, off:0x%x.\n", + io_attr->io_addr, io_attr->mask, io_attr->reset_on, io_attr->reset_off); + + if (reset_cfg->rst_delay_b) { + usleep_range(reset_cfg->rst_delay_b, reset_cfg->rst_delay_b + 1); + } + + val = inb(io_attr->io_addr); + val &= ~(io_attr->mask); + val |= io_attr->reset_on; + outb(val, io_attr->io_addr); + + if (reset_cfg->rst_delay) { + usleep_range(reset_cfg->rst_delay, reset_cfg->rst_delay + 1); + } + + val &= ~(io_attr->mask); + val |= io_attr->reset_off; + outb(val, io_attr->io_addr); + + ret = -1; + udelay_cnt = 0; + timeout = reset_cfg->rst_delay_a; + while (timeout > 0) { + usleep_range(1, 2); + val = inb(io_attr->io_addr); + val &= (io_attr->mask); + if (val == io_attr->reset_off) { + ret = 0; + PCA_DEBUG("pca9641_do_io_reset success.\n"); + break; + } + udelay_cnt++; + if ((udelay_cnt % 1000) == 0) { + /* 1MS schedule*/ + schedule(); + } + timeout--; + } + + if (ret < 0) { + PCA_DEBUG_ERR("pca9641_do_io_reset timeout.\n"); + } + + return ret; +} + +static int pca9641_do_gpio_reset(struct i2c_mux_core *muxc) +{ + int ret, timeout; + struct pca9541 *data; + pca9641_cfg_info_t *reset_cfg; + gpio_attr_t *gpio_attr; + u8 val; + int udelay_cnt; + + data = i2c_mux_priv(muxc); + reset_cfg = &data->pca9641_cfg_info; + gpio_attr = &reset_cfg->attr.gpio_attr; + + ret = pca9641_gpio_init(gpio_attr); + if (ret) { + return -1; + } + + if (reset_cfg->rst_delay_b) { + usleep_range(reset_cfg->rst_delay_b, reset_cfg->rst_delay_b + 1); + } + + __gpio_set_value(gpio_attr->gpio, gpio_attr->reset_on); + + if (reset_cfg->rst_delay) { + usleep_range(reset_cfg->rst_delay, reset_cfg->rst_delay + 1); + } + + __gpio_set_value(gpio_attr->gpio, gpio_attr->reset_off); + ret = -1; + udelay_cnt = 0; + timeout = reset_cfg->rst_delay_a; + while (timeout > 0) { + usleep_range(1, 2); + val = __gpio_get_value(gpio_attr->gpio); + if (val == gpio_attr->reset_off) { + ret = 0; + PCA_DEBUG("pca9641_do_gpio_reset success.\n"); + break; + } + udelay_cnt++; + if ((udelay_cnt % 1000) == 0) { + /* 1MS schedule*/ + schedule(); + } + timeout--; + } + + if (ret < 0) { + PCA_DEBUG_ERR("pca9641_do_gpio_reset timeout.\n"); + } + + pca9641_gpio_free(gpio_attr); + return ret; +} + +static int pca9641_do_i2c_reset(struct i2c_mux_core *muxc) +{ + int ret, timeout, err; + struct pca9541 *data; + pca9641_cfg_info_t *reset_cfg; + i2c_attr_t *i2c_attr; + u8 val; + int udelay_cnt; + + data = i2c_mux_priv(muxc); + reset_cfg = &data->pca9641_cfg_info; + i2c_attr = &reset_cfg->attr.i2c_attr; + ret = -1; + + PCA_DEBUG("rst_delay_b:%u, rst_delay:%u, rst_delay_a:%u.\n", + reset_cfg->rst_delay_b, reset_cfg->rst_delay, reset_cfg->rst_delay_a); + PCA_DEBUG("bus:0x%x, addr:0x%x, reg:0x%x, mask:0x%x, on:0x%x, off:0x%x.\n", + i2c_attr->i2c_bus, i2c_attr->i2c_addr, i2c_attr->reg_offset, + i2c_attr->mask, i2c_attr->reset_on, i2c_attr->reset_off); + + if (reset_cfg->rst_delay_b) { + usleep_range(reset_cfg->rst_delay_b, reset_cfg->rst_delay_b + 1); + } + + err = pca9641_reset_i2c_read(i2c_attr->i2c_bus, i2c_attr->i2c_addr, + i2c_attr->reg_offset, &val, sizeof(val)); + if (err < 0) { + goto out; + } + + val &= ~(i2c_attr->mask); + val |= i2c_attr->reset_on; + err = pca9641_reset_i2c_write(i2c_attr->i2c_bus, i2c_attr->i2c_addr, + i2c_attr->reg_offset, val); + if (err < 0) { + goto out; + } + + if (reset_cfg->rst_delay) { + usleep_range(reset_cfg->rst_delay, reset_cfg->rst_delay + 1); + } + + val &= ~(i2c_attr->mask); + val |= i2c_attr->reset_off; + err = pca9641_reset_i2c_write(i2c_attr->i2c_bus, i2c_attr->i2c_addr, + i2c_attr->reg_offset, val); + if (err < 0) { + goto out; + } + + udelay_cnt = 0; + timeout = reset_cfg->rst_delay_a; + while (timeout > 0) { + usleep_range(1, 2); + err = pca9641_reset_i2c_read(i2c_attr->i2c_bus, i2c_attr->i2c_addr, + i2c_attr->reg_offset, &val, sizeof(val)); + if (err < 0) { + goto out; + } + val &= (i2c_attr->mask); + if (val == i2c_attr->reset_off) { + ret = 0; + PCA_DEBUG("pca9641_do_i2c_reset success.\n"); + break; + } + udelay_cnt++; + if ((udelay_cnt % 1000) == 0) { + /* 1MS schedule*/ + schedule(); + } + timeout--; + } + if (ret < 0) { + PCA_DEBUG_ERR("pca9641_do_i2c_reset timeout.\n"); + } +out: + if (err < 0) { + PCA_DEBUG_ERR("pca9641_do_i2c_reset i2c op failed, ret:%d.\n", err); + } + return ret; +} + +static int pca9641_do_reset(struct i2c_mux_core *muxc) +{ + int ret; + struct pca9541 *data; + + data = i2c_mux_priv(muxc); + if (data->pca9641_cfg_info.pca9641_reset_type == PCA9641_RESET_NONE) { + ret = -1; + PCA_DEBUG("Don't need to reset.\n"); + } else if (data->pca9641_cfg_info.pca9641_reset_type == PCA9641_RESET_I2C) { + ret = pca9641_do_i2c_reset(muxc); + } else if (data->pca9641_cfg_info.pca9641_reset_type == PCA9641_RESET_GPIO) { + ret = pca9641_do_gpio_reset(muxc); + } else if (data->pca9641_cfg_info.pca9641_reset_type == PCA9641_RESET_IO) { + ret = pca9641_do_io_reset(muxc); + } else if (data->pca9641_cfg_info.pca9641_reset_type == PCA9641_RESET_FILE) { + ret = pca9641_do_file_reset(muxc); + } else { + ret = -1; + PCA_DEBUG_ERR("Unsupport reset type:0x%x.\n", + data->pca9641_cfg_info.pca9641_reset_type); + } + + if (ret < 0) { + PCA_DEBUG_ERR("pca9641_reset_ctrl failed, reset type:%u, ret:%d.\n", + data->pca9641_cfg_info.pca9641_reset_type, ret); + } else { + usleep_range(PCA9641_RESET_DELAY, PCA9641_RESET_DELAY + 1); + } + return ret; +} + +/* + * Write to chip register. Don't use i2c_transfer()/i2c_smbus_xfer() + * as they will try to lock the adapter a second time. + */ +static int pca9541_reg_write(struct i2c_client *client, u8 command, u8 val) +{ + struct i2c_adapter *adap = client->adapter; + int ret; + + if (adap->algo->master_xfer) { + struct i2c_msg msg; + char buf[2]; + + msg.addr = client->addr; + msg.flags = 0; + msg.len = 2; + buf[0] = command; + buf[1] = val; + msg.buf = buf; + ret = __i2c_transfer(adap, &msg, 1); + } else { + union i2c_smbus_data data; + + data.byte = val; + ret = adap->algo->smbus_xfer(adap, client->addr, + client->flags, + I2C_SMBUS_WRITE, + command, + I2C_SMBUS_BYTE_DATA, &data); + } + + return ret; +} + +/* + * Read from chip register. Don't use i2c_transfer()/i2c_smbus_xfer() + * as they will try to lock adapter a second time. + */ +static int pca9541_reg_read(struct i2c_client *client, u8 command) +{ + struct i2c_adapter *adap = client->adapter; + int ret; + u8 val; + + if (adap->algo->master_xfer) { + struct i2c_msg msg[2] = { + { + .addr = client->addr, + .flags = 0, + .len = 1, + .buf = &command + }, + { + .addr = client->addr, + .flags = I2C_M_RD, + .len = 1, + .buf = &val + } + }; + ret = __i2c_transfer(adap, msg, 2); + if (ret == 2) + ret = val; + else if (ret >= 0) + ret = -EIO; + } else { + union i2c_smbus_data data; + + ret = adap->algo->smbus_xfer(adap, client->addr, + client->flags, + I2C_SMBUS_READ, + command, + I2C_SMBUS_BYTE_DATA, &data); + if (!ret) + ret = data.byte; + } + return ret; +} + +/* + * Arbitration management functions + */ + +/* Release bus. Also reset NTESTON and BUSINIT if it was set. */ +static void pca9541_release_bus(struct i2c_client *client) +{ + int reg; + + reg = pca9541_reg_read(client, PCA9541_CONTROL); + if (reg >= 0 && !busoff(reg) && mybus(reg)) + pca9541_reg_write(client, PCA9541_CONTROL, + (reg & PCA9541_CTL_NBUSON) >> 1); +} + +/* + * Arbitration is defined as a two-step process. A bus master can only activate + * the slave bus if it owns it; otherwise it has to request ownership first. + * This multi-step process ensures that access contention is resolved + * gracefully. + * + * Bus Ownership Other master Action + * state requested access + * ---------------------------------------------------- + * off - yes wait for arbitration timeout or + * for other master to drop request + * off no no take ownership + * off yes no turn on bus + * on yes - done + * on no - wait for arbitration timeout or + * for other master to release bus + * + * The main contention point occurs if the slave bus is off and both masters + * request ownership at the same time. In this case, one master will turn on + * the slave bus, believing that it owns it. The other master will request + * bus ownership. Result is that the bus is turned on, and master which did + * _not_ own the slave bus before ends up owning it. + */ + +/* Control commands per PCA9541 datasheet */ +static const u8 pca9541_control[16] = { + 4, 0, 1, 5, 4, 4, 5, 5, 0, 0, 1, 1, 0, 4, 5, 1 +}; + +/* + * Channel arbitration + * + * Return values: + * <0: error + * 0 : bus not acquired + * 1 : bus acquired + */ +static int pca9541_arbitrate(struct i2c_client *client) +{ + struct i2c_mux_core *muxc = i2c_get_clientdata(client); + struct pca9541 *data = i2c_mux_priv(muxc); + int reg; + + reg = pca9541_reg_read(client, PCA9541_CONTROL); + if (reg < 0) + return reg; + + if (busoff(reg)) { + int istat; + /* + * Bus is off. Request ownership or turn it on unless + * other master requested ownership. + */ + istat = pca9541_reg_read(client, PCA9541_ISTAT); + if (!(istat & PCA9541_ISTAT_NMYTEST) + || time_is_before_eq_jiffies(data->arb_timeout)) { + /* + * Other master did not request ownership, + * or arbitration timeout expired. Take the bus. + */ + pca9541_reg_write(client, + PCA9541_CONTROL, + pca9541_control[reg & 0x0f] + | PCA9541_CTL_NTESTON); + data->select_timeout = SELECT_DELAY_SHORT; + } else { + /* + * Other master requested ownership. + * Set extra long timeout to give it time to acquire it. + */ + data->select_timeout = SELECT_DELAY_LONG * 2; + } + } else if (mybus(reg)) { + /* + * Bus is on, and we own it. We are done with acquisition. + * Reset NTESTON and BUSINIT, then return success. + */ + if (reg & (PCA9541_CTL_NTESTON | PCA9541_CTL_BUSINIT)) + pca9541_reg_write(client, + PCA9541_CONTROL, + reg & ~(PCA9541_CTL_NTESTON + | PCA9541_CTL_BUSINIT)); + return 1; + } else { + /* + * Other master owns the bus. + * If arbitration timeout has expired, force ownership. + * Otherwise request it. + */ + data->select_timeout = SELECT_DELAY_LONG; + if (time_is_before_eq_jiffies(data->arb_timeout)) { + /* Time is up, take the bus and reset it. */ + pca9541_reg_write(client, + PCA9541_CONTROL, + pca9541_control[reg & 0x0f] + | PCA9541_CTL_BUSINIT + | PCA9541_CTL_NTESTON); + } else { + /* Request bus ownership if needed */ + if (!(reg & PCA9541_CTL_NTESTON)) + pca9541_reg_write(client, + PCA9541_CONTROL, + reg | PCA9541_CTL_NTESTON); + } + } + return 0; +} + +static int pca9541_select_chan(struct i2c_mux_core *muxc, u32 chan) +{ + struct pca9541 *data = i2c_mux_priv(muxc); + struct i2c_client *client = data->client; + int ret; + unsigned long timeout = jiffies + ARB2_TIMEOUT; + /* give up after this time */ + + data->arb_timeout = jiffies + ARB_TIMEOUT; + /* force bus ownership after this time */ + + do { + ret = pca9541_arbitrate(client); + if (ret) + return ret < 0 ? ret : 0; + + if (data->select_timeout == SELECT_DELAY_SHORT) + udelay(data->select_timeout); + else + msleep(data->select_timeout / 1000); + } while (time_is_after_eq_jiffies(timeout)); + + dev_warn(&client->dev, "pca9541 select channel timeout.\n"); + return -ETIMEDOUT; +} + +static int pca9541_release_chan(struct i2c_mux_core *muxc, u32 chan) +{ + struct pca9541 *data = i2c_mux_priv(muxc); + struct i2c_client *client = data->client; + pca9541_release_bus(client); + return 0; +} + +/* +* Arbitration management functions +*/ +static void pca9641_release_bus(struct i2c_client *client) +{ + pca9541_reg_write(client, PCA9641_CONTROL, 0x80); //master 0x80 +} + +/* +* Channel arbitration +* +* Return values: +* <0: error +* 0 : bus not acquired +* 1 : bus acquired +*/ +static int pca9641_arbitrate(struct i2c_client *client) +{ + struct i2c_mux_core *muxc = i2c_get_clientdata(client); + struct pca9541 *data = i2c_mux_priv(muxc); + int reg_ctl, reg_sts; + + reg_ctl = pca9541_reg_read(client, PCA9641_CONTROL); + if (reg_ctl < 0) { + PCA_DEBUG_ERR("pca9641 read control register failed, ret:%d.\n", reg_ctl); + return reg_ctl; + } + + reg_sts = pca9541_reg_read(client, PCA9641_STATUS); + if (reg_sts < 0) { + PCA_DEBUG_ERR("pca9641 read status register failed, ret:%d.\n", reg_sts); + return reg_sts; + } + + if (BUSOFF(reg_ctl, reg_sts)) { + /* + * Bus is off. Request ownership or turn it on unless + * other master requested ownership. + */ + reg_ctl |= PCA9641_CTL_LOCK_REQ; + pca9541_reg_write(client, PCA9641_CONTROL, reg_ctl); + reg_ctl = pca9541_reg_read(client, PCA9641_CONTROL); + if (reg_ctl < 0) { + PCA_DEBUG_ERR("Bus is off, but read control register failed, ret:%d.\n", reg_ctl); + return reg_ctl; + } + + if (lock_grant(reg_ctl)) { + /* + * Other master did not request ownership, + * or arbitration timeout expired. Take the bus. + */ + PCA_DEBUG("Bus is off, get pca9641 arbitration success.\n"); + reg_ctl |= PCA9641_CTL_BUS_CONNECT | PCA9641_CTL_LOCK_REQ; + pca9541_reg_write(client, PCA9641_CONTROL, reg_ctl); + return 1; + } else { + /* + * Other master requested ownership. + * Set extra long timeout to give it time to acquire it. + */ + PCA_DEBUG("Bus is off, but get pca9641 arbitration failed.\n"); + data->select_timeout = SELECT_DELAY_LONG * 2; + } + } else if (lock_grant(reg_ctl)) { + /* + * Bus is on, and we own it. We are done with acquisition. + */ + PCA_DEBUG("Bus is on, get pca9641 arbitration success.\n"); + reg_ctl |= PCA9641_CTL_BUS_CONNECT | PCA9641_CTL_LOCK_REQ; + pca9541_reg_write(client, PCA9641_CONTROL, reg_ctl); + return 1; + } else if (other_lock(reg_sts)) { + /* + * Other master owns the bus. + * If arbitration timeout has expired, force ownership. + * Otherwise request it. + */ + PCA_DEBUG("Other master owns the bus, try to request it.\n"); + data->select_timeout = SELECT_DELAY_LONG; + reg_ctl |= PCA9641_CTL_LOCK_REQ; + pca9541_reg_write(client, PCA9641_CONTROL, reg_ctl); + } + return 0; +} + +int pca9641_select_chan_single(struct i2c_mux_core *muxc, u32 chan) +{ + struct pca9541 *data = i2c_mux_priv(muxc); + struct i2c_client *client = data->client; + int ret; + int result; + unsigned long msleep_time; + unsigned long timeout = jiffies + ARB2_TIMEOUT; + /* give up after this time */ + data->arb_timeout = jiffies + ARB_TIMEOUT; + /* force bus ownership after this time */ + for (result = 0 ; result < PCA9641_RETRY_TIME ; result ++) { + do { + ret = pca9641_arbitrate(client); + if (ret) { + return ret < 0 ? -EIO : 0; + } + msleep_time = data->select_timeout / 1000; + if (msleep_time < 1) { + msleep(1); + } else { + msleep(msleep_time); + } + } while (time_is_after_eq_jiffies(timeout)); + timeout = jiffies + ARB2_TIMEOUT; + } + dev_warn(&client->dev, "pca9641 select channel timeout.\n"); + return -ETIMEDOUT; +} + +static int pca9641_select_chan(struct i2c_mux_core *muxc, u32 chan) +{ + int ret, rv; + + ret = pca9641_select_chan_single(muxc, chan); + if (ret < 0) { + PCA_DEBUG_ERR("pca9641 select channel failed, ret:%d, try to reset pca9641.\n", ret); + rv = pca9641_do_reset(muxc); + + if (rv < 0) { + PCA_DEBUG_ERR("pca9641 reset failed, rv:%d.\n", rv); + return ret; + } + + ret = pca9641_select_chan_single(muxc, chan); + if (ret < 0) { + PCA_DEBUG_ERR("after pca9641 reset, select channel still failed, ret:%d.\n", ret); + } + } + return ret; +} + +static int pca9641_release_chan(struct i2c_mux_core *muxc, u32 chan) +{ + struct pca9541 *data = i2c_mux_priv(muxc); + struct i2c_client *client = data->client; + if (pca_flag.flag) { + pca9641_release_bus(client); + } + return 0; +} + +static int pca9641_detect_id(struct i2c_client *client) +{ +#if 0 + int reg; + + reg = pca9541_reg_read(client, PCA9641_ID); + if (reg == PCA9641_ID_MAGIC) + return 1; + else + return 0; +#endif + /* only support pca9641 */ + return 1; +} + +static int pca9641_recordflag(struct i2c_adapter *adap) { + if (pca_flag.flag != -1) { + pr_err(" %s %d has init already!!!", __func__, __LINE__); + return -1 ; + } + pca_flag.nr = adap->nr; + PCA_DEBUG(" adap->nr:%d\n", adap->nr); + snprintf(pca_flag.name, sizeof(pca_flag.name),adap->name); + return 0; +} + +static int of_pca9641_reset_data_init(struct pca9541 *data) +{ + int err; + struct device *dev = &data->client->dev; + pca9641_cfg_info_t *reset_cfg; + + reset_cfg = &data->pca9641_cfg_info; + if (dev == NULL || dev->of_node == NULL) { + PCA_DEBUG("dev or dev->of_node is NUll, no reset.\n"); + reset_cfg->pca9641_reset_type = PCA9641_RESET_NONE; + return 0; + } + + if (of_property_read_u32(dev->of_node, "pca9641_reset_type", &reset_cfg->pca9641_reset_type)) { + + PCA_DEBUG("pca9641_reset_type not found, no reset.\n"); + reset_cfg->pca9641_reset_type = PCA9641_RESET_NONE; + return 0; + } + err = of_property_read_u32(dev->of_node, "rst_delay_b", &reset_cfg->rst_delay_b); + err |= of_property_read_u32(dev->of_node, "rst_delay", &reset_cfg->rst_delay); + err |= of_property_read_u32(dev->of_node, "rst_delay_a", &reset_cfg->rst_delay_a); + + if (err) { + goto dts_config_err; + } + PCA_DEBUG("reset_type:0x%x, rst_delay_b:0x%x, rst_delay:0x%x, rst_delay_a:0x%x.\n", + reset_cfg->pca9641_reset_type, reset_cfg->rst_delay_b, + reset_cfg->rst_delay, reset_cfg->rst_delay_a); + + if (reset_cfg->pca9641_reset_type == PCA9641_RESET_I2C) { + + PCA_DEBUG("reset by i2c.\n"); + err = of_property_read_u32(dev->of_node, "i2c_bus", &reset_cfg->attr.i2c_attr.i2c_bus); + err |=of_property_read_u32(dev->of_node, "i2c_addr", &reset_cfg->attr.i2c_attr.i2c_addr); + err |=of_property_read_u32(dev->of_node, "reg_offset", &reset_cfg->attr.i2c_attr.reg_offset); + err |=of_property_read_u32(dev->of_node, "mask", &reset_cfg->attr.i2c_attr.mask); + err |=of_property_read_u32(dev->of_node, "reset_on", &reset_cfg->attr.i2c_attr.reset_on); + err |=of_property_read_u32(dev->of_node, "reset_off", &reset_cfg->attr.i2c_attr.reset_off); + if (err) { + goto dts_config_err; + } + PCA_DEBUG("bus:%u, addr:0x%x, offset:0x%x, mask:0x%x, on:0x%x, off:0x%x.\n", + reset_cfg->attr.i2c_attr.i2c_bus, reset_cfg->attr.i2c_attr.i2c_addr, + reset_cfg->attr.i2c_attr.reg_offset, reset_cfg->attr.i2c_attr.mask, + reset_cfg->attr.i2c_attr.reset_on, reset_cfg->attr.i2c_attr.reset_off); + } else if (reset_cfg->pca9641_reset_type == PCA9641_RESET_GPIO) { + + PCA_DEBUG("reset by gpio.\n"); + err = of_property_read_u32(dev->of_node, "gpio", &reset_cfg->attr.gpio_attr.gpio); + err |=of_property_read_u32(dev->of_node, "reset_on", &reset_cfg->attr.gpio_attr.reset_on); + err |=of_property_read_u32(dev->of_node, "reset_off", &reset_cfg->attr.gpio_attr.reset_off); + if (err) { + goto dts_config_err; + } + PCA_DEBUG("gpio number:%u, reset_on:0x%x, reset_off:0x%x.\n", + reset_cfg->attr.gpio_attr.gpio, reset_cfg->attr.gpio_attr.reset_on, + reset_cfg->attr.gpio_attr.reset_off); + reset_cfg->attr.gpio_attr.gpio_init = 0; + } else if (reset_cfg->pca9641_reset_type == PCA9641_RESET_IO) { + + PCA_DEBUG("reset by io.\n"); + err = of_property_read_u32(dev->of_node, "io_addr", &reset_cfg->attr.io_attr.io_addr); + err |=of_property_read_u32(dev->of_node, "mask", &reset_cfg->attr.io_attr.mask); + err |=of_property_read_u32(dev->of_node, "reset_on", &reset_cfg->attr.io_attr.reset_on); + err |=of_property_read_u32(dev->of_node, "reset_off", &reset_cfg->attr.io_attr.reset_off); + if (err) { + goto dts_config_err; + } + PCA_DEBUG("io_addr:0x%x, mask:0x%x, reset_on:0x%x, reset_off:0x%x.\n", + reset_cfg->attr.io_attr.io_addr, reset_cfg->attr.io_attr.mask, + reset_cfg->attr.io_attr.reset_on, reset_cfg->attr.io_attr.reset_off); + } else if (reset_cfg->pca9641_reset_type == PCA9641_RESET_FILE) { + + PCA_DEBUG("reset by file.\n"); + err = of_property_read_string(dev->of_node, "dev_name", &reset_cfg->attr.file_attr.dev_name); + err |=of_property_read_u32(dev->of_node, "offset", &reset_cfg->attr.file_attr.offset); + err |=of_property_read_u32(dev->of_node, "mask", &reset_cfg->attr.file_attr.mask); + err |=of_property_read_u32(dev->of_node, "reset_on", &reset_cfg->attr.file_attr.reset_on); + err |=of_property_read_u32(dev->of_node, "reset_off", &reset_cfg->attr.file_attr.reset_off); + if (err) { + goto dts_config_err; + } + PCA_DEBUG("dev_name:%s, mask:0x%x, reset_on:0x%x, reset_off:0x%x.\n", + reset_cfg->attr.file_attr.dev_name, reset_cfg->attr.file_attr.mask, + reset_cfg->attr.file_attr.reset_on, reset_cfg->attr.file_attr.reset_off); + } else { + PCA_DEBUG_ERR("Unsupport reset type:%d.\n", reset_cfg->pca9641_reset_type); + goto dts_config_err; + } + return 0; +dts_config_err: + PCA_DEBUG_ERR("dts config error, ret:%d.\n", err); + return -EINVAL; +} + +static int pca9641_reset_data_init(struct pca9541 *data) +{ + pca9641_cfg_info_t *reset_cfg; + i2c_mux_pca9641_device_t *i2c_mux_pca9641_device; + + if (data->client->dev.platform_data == NULL) { + PCA_DEBUG("pca9641 has no reset platform data config.\n"); + return 0; + } + reset_cfg = &data->pca9641_cfg_info; + i2c_mux_pca9641_device = data->client->dev.platform_data; + reset_cfg->pca9641_reset_type = i2c_mux_pca9641_device->pca9641_reset_type; + if (reset_cfg->pca9641_reset_type == PCA9641_RESET_NONE) { + PCA_DEBUG("pca9641 has no reset function.\n"); + return 0; + } + + reset_cfg->rst_delay_b = i2c_mux_pca9641_device->rst_delay_b; + reset_cfg->rst_delay = i2c_mux_pca9641_device->rst_delay; + reset_cfg->rst_delay_a = i2c_mux_pca9641_device->rst_delay_a; + PCA_DEBUG("reset_type:0x%x, rst_delay_b:0x%x, rst_delay:0x%x, rst_delay_a:0x%x.\n", + reset_cfg->pca9641_reset_type, reset_cfg->rst_delay_b, + reset_cfg->rst_delay, reset_cfg->rst_delay_a); + + if (reset_cfg->pca9641_reset_type == PCA9641_RESET_I2C) { + + PCA_DEBUG("reset by i2c.\n"); + reset_cfg->attr.i2c_attr.i2c_bus = i2c_mux_pca9641_device->attr.i2c_attr.i2c_bus; + reset_cfg->attr.i2c_attr.i2c_addr = i2c_mux_pca9641_device->attr.i2c_attr.i2c_addr; + reset_cfg->attr.i2c_attr.reg_offset = i2c_mux_pca9641_device->attr.i2c_attr.reg_offset; + reset_cfg->attr.i2c_attr.mask = i2c_mux_pca9641_device->attr.i2c_attr.mask; + reset_cfg->attr.i2c_attr.reset_on = i2c_mux_pca9641_device->attr.i2c_attr.reset_on; + reset_cfg->attr.i2c_attr.reset_off = i2c_mux_pca9641_device->attr.i2c_attr.reset_off; + PCA_DEBUG("bus:%u, addr:0x%x, offset:0x%x, mask:0x%x, on:0x%x, off:0x%x.\n", + reset_cfg->attr.i2c_attr.i2c_bus, reset_cfg->attr.i2c_attr.i2c_addr, + reset_cfg->attr.i2c_attr.reg_offset, reset_cfg->attr.i2c_attr.mask, + reset_cfg->attr.i2c_attr.reset_on, reset_cfg->attr.i2c_attr.reset_off); + } else if (reset_cfg->pca9641_reset_type == PCA9641_RESET_GPIO) { + + PCA_DEBUG("reset by gpio.\n"); + reset_cfg->attr.gpio_attr.gpio = i2c_mux_pca9641_device->attr.gpio_attr.gpio; + reset_cfg->attr.gpio_attr.reset_on = i2c_mux_pca9641_device->attr.gpio_attr.reset_on; + reset_cfg->attr.gpio_attr.reset_off = i2c_mux_pca9641_device->attr.gpio_attr.reset_off; + PCA_DEBUG("gpio number:%u, reset_on:0x%x, reset_off:0x%x.\n", + reset_cfg->attr.gpio_attr.gpio, reset_cfg->attr.gpio_attr.reset_on, + reset_cfg->attr.gpio_attr.reset_off); + reset_cfg->attr.gpio_attr.gpio_init = 0; + } else if (reset_cfg->pca9641_reset_type == PCA9641_RESET_IO) { + + PCA_DEBUG("reset by io.\n"); + reset_cfg->attr.io_attr.io_addr = i2c_mux_pca9641_device->attr.io_attr.io_addr; + reset_cfg->attr.io_attr.mask = i2c_mux_pca9641_device->attr.io_attr.mask; + reset_cfg->attr.io_attr.reset_on = i2c_mux_pca9641_device->attr.io_attr.reset_on; + reset_cfg->attr.io_attr.reset_off = i2c_mux_pca9641_device->attr.io_attr.reset_off; + PCA_DEBUG("io_addr:0x%x, mask:0x%x, reset_on:0x%x, reset_off:0x%x.\n", + reset_cfg->attr.io_attr.io_addr, reset_cfg->attr.io_attr.mask, + reset_cfg->attr.io_attr.reset_on, reset_cfg->attr.io_attr.reset_off); + } else if (reset_cfg->pca9641_reset_type == PCA9641_RESET_FILE) { + + PCA_DEBUG("reset by file.\n"); + reset_cfg->attr.file_attr.dev_name = i2c_mux_pca9641_device->attr.file_attr.dev_name; + reset_cfg->attr.file_attr.offset = i2c_mux_pca9641_device->attr.file_attr.offset; + reset_cfg->attr.file_attr.mask = i2c_mux_pca9641_device->attr.file_attr.mask; + reset_cfg->attr.file_attr.reset_on = i2c_mux_pca9641_device->attr.file_attr.reset_on; + reset_cfg->attr.file_attr.reset_off = i2c_mux_pca9641_device->attr.file_attr.reset_off; + PCA_DEBUG("dev_name:%s, mask:0x%x, reset_on:0x%x, reset_off:0x%x.\n", + reset_cfg->attr.file_attr.dev_name, reset_cfg->attr.file_attr.mask, + reset_cfg->attr.file_attr.reset_on, reset_cfg->attr.file_attr.reset_off); + } else { + PCA_DEBUG_ERR("Unsupport reset type:%d.\n", reset_cfg->pca9641_reset_type); + return -EINVAL; + } + return 0; +} + +/* + * I2C init/probing/exit functions + */ +static int pca9541_probe(struct i2c_client *client, const struct i2c_device_id *id) +{ + struct i2c_adapter *adap = client->adapter; + struct i2c_mux_core *muxc; + struct pca9541 *data; + int force; + int ret = -ENODEV; + int detect_id; + i2c_mux_pca9641_device_t *i2c_mux_pca9641_device; + + if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE_DATA)) + return -ENODEV; + + detect_id = pca9641_detect_id(client); + + /* + * I2C accesses are unprotected here. + * We have to lock the adapter before releasing the bus. + */ + if (detect_id == 0) { + i2c_lock_bus(adap, I2C_LOCK_ROOT_ADAPTER); + pca9541_release_bus(client); + i2c_unlock_bus(adap, I2C_LOCK_ROOT_ADAPTER); + } else { + i2c_lock_bus(adap, I2C_LOCK_ROOT_ADAPTER); + pca9641_release_bus(client); + i2c_unlock_bus(adap, I2C_LOCK_ROOT_ADAPTER); + } + + if (detect_id == 0) { /* pca9541 */ + muxc = i2c_mux_alloc(adap, &client->dev, 1, sizeof(*data), + I2C_MUX_ARBITRATOR, + pca9541_select_chan, pca9541_release_chan); + if (!muxc) + return -ENOMEM; + + data = i2c_mux_priv(muxc); + data->client = client; + + i2c_set_clientdata(client, muxc); + /* Create mux adapter */ + if (of_property_read_u32(client->dev.of_node, "pca9641_nr", &data->pca9641_nr)) { + + force = 0; + PCA_DEBUG("pca9641_nr not found, use dynamic adap number.\n"); + } else { + force = data->pca9641_nr; + PCA_DEBUG("pca9641_nr: %d.\n", force); + } + + ret = i2c_mux_add_adapter(muxc, force, 0, 0); + if (ret) + return ret; + } else { + muxc = i2c_mux_alloc(adap, &client->dev, 1, sizeof(*data), I2C_MUX_ARBITRATOR, + pca9641_select_chan, pca9641_release_chan); + if (!muxc) { + dev_err(&client->dev, "i2c_mux_alloc failed, out of memory.\n"); + return -ENOMEM; + } + + data = i2c_mux_priv(muxc); + data->client = client; + + i2c_set_clientdata(client, muxc); + + if (client->dev.of_node) { + ret= of_pca9641_reset_data_init(data); + } else { + ret= pca9641_reset_data_init(data); + } + if (ret < 0) { + dev_err(&client->dev, "pca9641 reset config err, ret:%d.\n", ret); + return ret; + } + + if (client->dev.of_node == NULL) { + if (client->dev.platform_data == NULL) { + force = 0; + PCA_DEBUG("platform data is NULL, use dynamic adap number.\n"); + } else { + i2c_mux_pca9641_device = client->dev.platform_data; + data->pca9641_nr = i2c_mux_pca9641_device->pca9641_nr; + if (data->pca9641_nr == 0) { + force = 0; + PCA_DEBUG("pca9641_nr = 0, use dynamic adap number.\n"); + } else { + force = data->pca9641_nr; + PCA_DEBUG("pca9641_nr: %d.\n", force); + } + } + } else { + /* Create mux adapter */ + if (of_property_read_u32(client->dev.of_node, "pca9641_nr", &data->pca9641_nr)) { + + force = 0; + PCA_DEBUG("pca9641_nr not found, use dynamic adap number.\n"); + } else { + force = data->pca9641_nr; + PCA_DEBUG("pca9641_nr: %d.\n", force); + } + } + + ret = i2c_mux_add_adapter(muxc, force, 0, 0); + if (ret) { + dev_err(&client->dev, "Failed to register master selector.\n"); + return ret; + } + } + pca9641_recordflag(muxc->adapter[0]); + + dev_info(&client->dev, "registered master selector for I2C %s\n", client->name); + + return 0; +} + +static void pca9541_remove(struct i2c_client *client) +{ + struct i2c_mux_core *muxc = i2c_get_clientdata(client); + + i2c_mux_del_adapters(muxc); + return; +} + +static struct i2c_driver pca9641_driver = { + .driver = { + .name = "wb_pca9641", + .of_match_table = of_match_ptr(pca9541_of_match), + }, + .probe = pca9541_probe, + .remove = pca9541_remove, + .id_table = pca9541_id, +}; + +module_i2c_driver(pca9641_driver); +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("PCA9541 I2C master selector driver"); +MODULE_LICENSE("GPL v2"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca9641.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca9641.h new file mode 100644 index 000000000000..b87f7585567b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_i2c_mux_pca9641.h @@ -0,0 +1,64 @@ +#ifndef __WB_I2C_MUX_PCA9641_H__ +#define __WB_I2C_MUX_PCA9641_H__ + +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +typedef enum pca9641_reset_type_s { + PCA9641_RESET_NONE = 0, + PCA9641_RESET_I2C = 1, + PCA9641_RESET_GPIO = 2, + PCA9641_RESET_IO = 3, + PCA9641_RESET_FILE = 4, +} pca9641_reset_type_t; + +typedef struct i2c_attr_s { + uint32_t i2c_bus; + uint32_t i2c_addr; + uint32_t reg_offset; + uint32_t mask; + uint32_t reset_on; + uint32_t reset_off; +} i2c_attr_t; + +typedef struct io_attr_s { + uint32_t io_addr; + uint32_t mask; + uint32_t reset_on; + uint32_t reset_off; +} io_attr_t; + +typedef struct file_attr_s { + const char *dev_name; + uint32_t offset; + uint32_t mask; + uint32_t reset_on; + uint32_t reset_off; +} file_attr_t; + +typedef struct gpio_attr_s { + int gpio_init; + uint32_t gpio; + uint32_t reset_on; + uint32_t reset_off; +} gpio_attr_t; + +typedef struct i2c_mux_pca9641_device_s { + struct i2c_client *client; + uint32_t i2c_bus; + uint32_t i2c_addr; + uint32_t pca9641_nr; + uint32_t pca9641_reset_type; + uint32_t rst_delay_b; /* delay time before reset(us) */ + uint32_t rst_delay; /* reset time(us) */ + uint32_t rst_delay_a; /* delay time after reset(us) */ + union { + i2c_attr_t i2c_attr; + gpio_attr_t gpio_attr; + io_attr_t io_attr; + file_attr_t file_attr; + } attr; +} i2c_mux_pca9641_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_ina3221.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_ina3221.c new file mode 100644 index 000000000000..05b6da0284c0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_ina3221.c @@ -0,0 +1,1031 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * INA3221 Triple Current/Voltage Monitor + * + * Copyright (C) 2016 Texas Instruments Incorporated - https://www.ti.com/ + * Andrew F. Davis + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define INA3221_DRIVER_NAME "wb_ina3221" + +#define INA3221_CONFIG 0x00 +#define INA3221_SHUNT1 0x01 +#define INA3221_BUS1 0x02 +#define INA3221_SHUNT2 0x03 +#define INA3221_BUS2 0x04 +#define INA3221_SHUNT3 0x05 +#define INA3221_BUS3 0x06 +#define INA3221_CRIT1 0x07 +#define INA3221_WARN1 0x08 +#define INA3221_CRIT2 0x09 +#define INA3221_WARN2 0x0a +#define INA3221_CRIT3 0x0b +#define INA3221_WARN3 0x0c +#define INA3221_SHUNT_SUM 0x0d +#define INA3221_CRIT_SUM 0x0e +#define INA3221_MASK_ENABLE 0x0f + +#define INA3221_CONFIG_MODE_MASK GENMASK(2, 0) +#define INA3221_CONFIG_MODE_POWERDOWN 0 +#define INA3221_CONFIG_MODE_SHUNT BIT(0) +#define INA3221_CONFIG_MODE_BUS BIT(1) +#define INA3221_CONFIG_MODE_CONTINUOUS BIT(2) +#define INA3221_CONFIG_VSH_CT_SHIFT 3 +#define INA3221_CONFIG_VSH_CT_MASK GENMASK(5, 3) +#define INA3221_CONFIG_VSH_CT(x) (((x) & GENMASK(5, 3)) >> 3) +#define INA3221_CONFIG_VBUS_CT_SHIFT 6 +#define INA3221_CONFIG_VBUS_CT_MASK GENMASK(8, 6) +#define INA3221_CONFIG_VBUS_CT(x) (((x) & GENMASK(8, 6)) >> 6) +#define INA3221_CONFIG_AVG_SHIFT 9 +#define INA3221_CONFIG_AVG_MASK GENMASK(11, 9) +#define INA3221_CONFIG_AVG(x) (((x) & GENMASK(11, 9)) >> 9) +#define INA3221_CONFIG_CHs_EN_MASK GENMASK(14, 12) +#define INA3221_CONFIG_CHx_EN(x) BIT(14 - (x)) + +#define INA3221_MASK_ENABLE_SCC_MASK GENMASK(14, 12) + +#define INA3221_CONFIG_DEFAULT 0x7127 +#define INA3221_RSHUNT_DEFAULT 10000 + +enum ina3221_fields { + /* Configuration */ + F_RST, + + /* Status Flags */ + F_CVRF, + + /* Warning Flags */ + F_WF3, F_WF2, F_WF1, + + /* Alert Flags: SF is the summation-alert flag */ + F_SF, F_CF3, F_CF2, F_CF1, + + /* sentinel */ + F_MAX_FIELDS +}; + +static const struct reg_field ina3221_reg_fields[] = { + [F_RST] = REG_FIELD(INA3221_CONFIG, 15, 15), + + [F_CVRF] = REG_FIELD(INA3221_MASK_ENABLE, 0, 0), + [F_WF3] = REG_FIELD(INA3221_MASK_ENABLE, 3, 3), + [F_WF2] = REG_FIELD(INA3221_MASK_ENABLE, 4, 4), + [F_WF1] = REG_FIELD(INA3221_MASK_ENABLE, 5, 5), + [F_SF] = REG_FIELD(INA3221_MASK_ENABLE, 6, 6), + [F_CF3] = REG_FIELD(INA3221_MASK_ENABLE, 7, 7), + [F_CF2] = REG_FIELD(INA3221_MASK_ENABLE, 8, 8), + [F_CF1] = REG_FIELD(INA3221_MASK_ENABLE, 9, 9), +}; + +enum ina3221_channels { + INA3221_CHANNEL1, + INA3221_CHANNEL2, + INA3221_CHANNEL3, + INA3221_NUM_CHANNELS +}; + +/** + * struct ina3221_input - channel input source specific information + * @label: label of channel input source + * @shunt_resistor: shunt resistor value of channel input source + * @disconnected: connection status of channel input source + */ +struct ina3221_input { + const char *label; + int shunt_resistor; + bool disconnected; +}; + +/** + * struct ina3221_data - device specific information + * @pm_dev: Device pointer for pm runtime + * @regmap: Register map of the device + * @fields: Register fields of the device + * @inputs: Array of channel input source specific structures + * @lock: mutex lock to serialize sysfs attribute accesses + * @reg_config: Register value of INA3221_CONFIG + * @summation_shunt_resistor: equivalent shunt resistor value for summation + * @single_shot: running in single-shot operating mode + */ +struct ina3221_data { + struct device *pm_dev; + struct regmap *regmap; + struct regmap_field *fields[F_MAX_FIELDS]; + struct ina3221_input inputs[INA3221_NUM_CHANNELS]; + struct mutex lock; + u32 reg_config; + int summation_shunt_resistor; + + bool single_shot; +}; + +static inline bool ina3221_is_enabled(struct ina3221_data *ina, int channel) +{ + /* Summation channel checks shunt resistor values */ + if (channel > INA3221_CHANNEL3) + return ina->summation_shunt_resistor != 0; + + return pm_runtime_active(ina->pm_dev) && + (ina->reg_config & INA3221_CONFIG_CHx_EN(channel)); +} + +/** + * Helper function to return the resistor value for current summation. + * + * There is a condition to calculate current summation -- all the shunt + * resistor values should be the same, so as to simply fit the formula: + * current summation = shunt voltage summation / shunt resistor + * + * Returns the equivalent shunt resistor value on success or 0 on failure + */ +static inline int ina3221_summation_shunt_resistor(struct ina3221_data *ina) +{ + struct ina3221_input *input = ina->inputs; + int i, shunt_resistor = 0; + + for (i = 0; i < INA3221_NUM_CHANNELS; i++) { + if (input[i].disconnected || !input[i].shunt_resistor) + continue; + if (!shunt_resistor) { + /* Found the reference shunt resistor value */ + shunt_resistor = input[i].shunt_resistor; + } else { + /* No summation if resistor values are different */ + if (shunt_resistor != input[i].shunt_resistor) + return 0; + } + } + + return shunt_resistor; +} + +/* Lookup table for Bus and Shunt conversion times in usec */ +static const u16 ina3221_conv_time[] = { + 140, 204, 332, 588, 1100, 2116, 4156, 8244, +}; + +/* Lookup table for number of samples using in averaging mode */ +static const int ina3221_avg_samples[] = { + 1, 4, 16, 64, 128, 256, 512, 1024, +}; + +/* Converting update_interval in msec to conversion time in usec */ +static inline u32 ina3221_interval_ms_to_conv_time(u16 config, int interval) +{ + u32 channels = hweight16(config & INA3221_CONFIG_CHs_EN_MASK); + u32 samples_idx = INA3221_CONFIG_AVG(config); + u32 samples = ina3221_avg_samples[samples_idx]; + + /* Bisect the result to Bus and Shunt conversion times */ + return DIV_ROUND_CLOSEST(interval * 1000 / 2, channels * samples); +} + +/* Converting CONFIG register value to update_interval in usec */ +static inline u32 ina3221_reg_to_interval_us(u16 config) +{ + u32 channels = hweight16(config & INA3221_CONFIG_CHs_EN_MASK); + u32 vbus_ct_idx = INA3221_CONFIG_VBUS_CT(config); + u32 vsh_ct_idx = INA3221_CONFIG_VSH_CT(config); + u32 samples_idx = INA3221_CONFIG_AVG(config); + u32 samples = ina3221_avg_samples[samples_idx]; + u32 vbus_ct = ina3221_conv_time[vbus_ct_idx]; + u32 vsh_ct = ina3221_conv_time[vsh_ct_idx]; + + /* Calculate total conversion time */ + return channels * (vbus_ct + vsh_ct) * samples; +} + +static inline int ina3221_wait_for_data(struct ina3221_data *ina) +{ + u32 wait, cvrf; + + wait = ina3221_reg_to_interval_us(ina->reg_config); + + /* Polling the CVRF bit to make sure read data is ready */ + return regmap_field_read_poll_timeout(ina->fields[F_CVRF], + cvrf, cvrf, wait, wait * 2); +} + +static int ina3221_read_value(struct ina3221_data *ina, unsigned int reg, + int *val) +{ + unsigned int regval; + int ret; + + ret = regmap_read(ina->regmap, reg, ®val); + if (ret) + return ret; + + /* + * Shunt Voltage Sum register has 14-bit value with 1-bit shift + * Other Shunt Voltage registers have 12 bits with 3-bit shift + */ + if (reg == INA3221_SHUNT_SUM) + *val = sign_extend32(regval >> 1, 14); + else + *val = sign_extend32(regval >> 3, 12); + + return 0; +} + +static const u8 ina3221_in_reg[] = { + INA3221_BUS1, + INA3221_BUS2, + INA3221_BUS3, + INA3221_SHUNT1, + INA3221_SHUNT2, + INA3221_SHUNT3, + INA3221_SHUNT_SUM, +}; + +static int ina3221_read_chip(struct device *dev, u32 attr, long *val) +{ + struct ina3221_data *ina = dev_get_drvdata(dev); + int regval; + + switch (attr) { + case hwmon_chip_samples: + regval = INA3221_CONFIG_AVG(ina->reg_config); + *val = ina3221_avg_samples[regval]; + return 0; + case hwmon_chip_update_interval: + /* Return in msec */ + *val = ina3221_reg_to_interval_us(ina->reg_config); + *val = DIV_ROUND_CLOSEST(*val, 1000); + return 0; + default: + return -EOPNOTSUPP; + } +} + +static int ina3221_read_in(struct device *dev, u32 attr, int channel, long *val) +{ + const bool is_shunt = channel > INA3221_CHANNEL3; + struct ina3221_data *ina = dev_get_drvdata(dev); + u8 reg = ina3221_in_reg[channel]; + int regval, ret; + + /* + * Translate shunt channel index to sensor channel index except + * the 7th channel (6 since being 0-aligned) is for summation. + */ + if (channel != 6) + channel %= INA3221_NUM_CHANNELS; + + switch (attr) { + case hwmon_in_input: + if (!ina3221_is_enabled(ina, channel)) + return -ENODATA; + + /* Write CONFIG register to trigger a single-shot measurement */ + if (ina->single_shot) + regmap_write(ina->regmap, INA3221_CONFIG, + ina->reg_config); + + ret = ina3221_wait_for_data(ina); + if (ret) + return ret; + + ret = ina3221_read_value(ina, reg, ®val); + if (ret) + return ret; + + /* + * Scale of shunt voltage (uV): LSB is 40uV + * Scale of bus voltage (mV): LSB is 8mV + */ + *val = regval * (is_shunt ? 40 : 8); + return 0; + case hwmon_in_enable: + *val = ina3221_is_enabled(ina, channel); + return 0; + default: + return -EOPNOTSUPP; + } +} + +static const u8 ina3221_curr_reg[][INA3221_NUM_CHANNELS + 1] = { + [hwmon_curr_input] = { INA3221_SHUNT1, INA3221_SHUNT2, + INA3221_SHUNT3, INA3221_SHUNT_SUM }, + [hwmon_curr_max] = { INA3221_WARN1, INA3221_WARN2, INA3221_WARN3, 0 }, + [hwmon_curr_crit] = { INA3221_CRIT1, INA3221_CRIT2, + INA3221_CRIT3, INA3221_CRIT_SUM }, + [hwmon_curr_max_alarm] = { F_WF1, F_WF2, F_WF3, 0 }, + [hwmon_curr_crit_alarm] = { F_CF1, F_CF2, F_CF3, F_SF }, +}; + +static int ina3221_read_curr(struct device *dev, u32 attr, + int channel, long *val) +{ + struct ina3221_data *ina = dev_get_drvdata(dev); + struct ina3221_input *input = ina->inputs; + u8 reg = ina3221_curr_reg[attr][channel]; + int resistance_uo, voltage_nv; + int regval, ret; + + if (channel > INA3221_CHANNEL3) + resistance_uo = ina->summation_shunt_resistor; + else + resistance_uo = input[channel].shunt_resistor; + + switch (attr) { + case hwmon_curr_input: + if (!ina3221_is_enabled(ina, channel)) + return -ENODATA; + + /* Write CONFIG register to trigger a single-shot measurement */ + if (ina->single_shot) + regmap_write(ina->regmap, INA3221_CONFIG, + ina->reg_config); + + ret = ina3221_wait_for_data(ina); + if (ret) + return ret; + + fallthrough; + case hwmon_curr_crit: + case hwmon_curr_max: + if (!resistance_uo) + return -ENODATA; + + ret = ina3221_read_value(ina, reg, ®val); + if (ret) + return ret; + + /* Scale of shunt voltage: LSB is 40uV (40000nV) */ + voltage_nv = regval * 40000; + /* Return current in mA */ + *val = DIV_ROUND_CLOSEST(voltage_nv, resistance_uo); + return 0; + case hwmon_curr_crit_alarm: + case hwmon_curr_max_alarm: + /* No actual register read if channel is disabled */ + if (!ina3221_is_enabled(ina, channel)) { + /* Return 0 for alert flags */ + *val = 0; + return 0; + } + ret = regmap_field_read(ina->fields[reg], ®val); + if (ret) + return ret; + *val = regval; + return 0; + default: + return -EOPNOTSUPP; + } +} + +static int ina3221_write_chip(struct device *dev, u32 attr, long val) +{ + struct ina3221_data *ina = dev_get_drvdata(dev); + int ret, idx; + u32 tmp; + + switch (attr) { + case hwmon_chip_samples: + idx = find_closest(val, ina3221_avg_samples, + ARRAY_SIZE(ina3221_avg_samples)); + + tmp = (ina->reg_config & ~INA3221_CONFIG_AVG_MASK) | + (idx << INA3221_CONFIG_AVG_SHIFT); + ret = regmap_write(ina->regmap, INA3221_CONFIG, tmp); + if (ret) + return ret; + + /* Update reg_config accordingly */ + ina->reg_config = tmp; + return 0; + case hwmon_chip_update_interval: + tmp = ina3221_interval_ms_to_conv_time(ina->reg_config, val); + idx = find_closest(tmp, ina3221_conv_time, + ARRAY_SIZE(ina3221_conv_time)); + + /* Update Bus and Shunt voltage conversion times */ + tmp = INA3221_CONFIG_VBUS_CT_MASK | INA3221_CONFIG_VSH_CT_MASK; + tmp = (ina->reg_config & ~tmp) | + (idx << INA3221_CONFIG_VBUS_CT_SHIFT) | + (idx << INA3221_CONFIG_VSH_CT_SHIFT); + ret = regmap_write(ina->regmap, INA3221_CONFIG, tmp); + if (ret) + return ret; + + /* Update reg_config accordingly */ + ina->reg_config = tmp; + return 0; + default: + return -EOPNOTSUPP; + } +} + +static int ina3221_write_curr(struct device *dev, u32 attr, + int channel, long val) +{ + struct ina3221_data *ina = dev_get_drvdata(dev); + struct ina3221_input *input = ina->inputs; + u8 reg = ina3221_curr_reg[attr][channel]; + int resistance_uo, current_ma, voltage_uv; + int regval; + + if (channel > INA3221_CHANNEL3) + resistance_uo = ina->summation_shunt_resistor; + else + resistance_uo = input[channel].shunt_resistor; + + if (!resistance_uo) + return -EOPNOTSUPP; + + /* clamp current */ + current_ma = clamp_val(val, + INT_MIN / resistance_uo, + INT_MAX / resistance_uo); + + voltage_uv = DIV_ROUND_CLOSEST(current_ma * resistance_uo, 1000); + + /* clamp voltage */ + voltage_uv = clamp_val(voltage_uv, -163800, 163800); + + /* + * Formula to convert voltage_uv to register value: + * regval = (voltage_uv / scale) << shift + * Note: + * The scale is 40uV for all shunt voltage registers + * Shunt Voltage Sum register left-shifts 1 bit + * All other Shunt Voltage registers shift 3 bits + * Results: + * SHUNT_SUM: (1 / 40uV) << 1 = 1 / 20uV + * SHUNT[1-3]: (1 / 40uV) << 3 = 1 / 5uV + */ + if (reg == INA3221_SHUNT_SUM) + regval = DIV_ROUND_CLOSEST(voltage_uv, 20) & 0xfffe; + else + regval = DIV_ROUND_CLOSEST(voltage_uv, 5) & 0xfff8; + + return regmap_write(ina->regmap, reg, regval); +} + +static int ina3221_write_enable(struct device *dev, int channel, bool enable) +{ + struct ina3221_data *ina = dev_get_drvdata(dev); + u16 config, mask = INA3221_CONFIG_CHx_EN(channel); + u16 config_old = ina->reg_config & mask; + u32 tmp; + int ret; + + config = enable ? mask : 0; + + /* Bypass if enable status is not being changed */ + if (config_old == config) + return 0; + + /* For enabling routine, increase refcount and resume() at first */ + if (enable) { + ret = pm_runtime_resume_and_get(ina->pm_dev); + if (ret < 0) { + dev_err(dev, "Failed to get PM runtime\n"); + return ret; + } + } + + /* Enable or disable the channel */ + tmp = (ina->reg_config & ~mask) | (config & mask); + ret = regmap_write(ina->regmap, INA3221_CONFIG, tmp); + if (ret) + goto fail; + + /* Cache the latest config register value */ + ina->reg_config = tmp; + + /* For disabling routine, decrease refcount or suspend() at last */ + if (!enable) + pm_runtime_put_sync(ina->pm_dev); + + return 0; + +fail: + if (enable) { + dev_err(dev, "Failed to enable channel %d: error %d\n", + channel, ret); + pm_runtime_put_sync(ina->pm_dev); + } + + return ret; +} + +static int ina3221_read(struct device *dev, enum hwmon_sensor_types type, + u32 attr, int channel, long *val) +{ + struct ina3221_data *ina = dev_get_drvdata(dev); + int ret; + + mutex_lock(&ina->lock); + + switch (type) { + case hwmon_chip: + ret = ina3221_read_chip(dev, attr, val); + break; + case hwmon_in: + /* 0-align channel ID */ + ret = ina3221_read_in(dev, attr, channel - 1, val); + break; + case hwmon_curr: + ret = ina3221_read_curr(dev, attr, channel, val); + break; + default: + ret = -EOPNOTSUPP; + break; + } + + mutex_unlock(&ina->lock); + + return ret; +} + +static int ina3221_write(struct device *dev, enum hwmon_sensor_types type, + u32 attr, int channel, long val) +{ + struct ina3221_data *ina = dev_get_drvdata(dev); + int ret; + + mutex_lock(&ina->lock); + + switch (type) { + case hwmon_chip: + ret = ina3221_write_chip(dev, attr, val); + break; + case hwmon_in: + /* 0-align channel ID */ + ret = ina3221_write_enable(dev, channel - 1, val); + break; + case hwmon_curr: + ret = ina3221_write_curr(dev, attr, channel, val); + break; + default: + ret = -EOPNOTSUPP; + break; + } + + mutex_unlock(&ina->lock); + + return ret; +} + +static int ina3221_read_string(struct device *dev, enum hwmon_sensor_types type, + u32 attr, int channel, const char **str) +{ + struct ina3221_data *ina = dev_get_drvdata(dev); + int index = channel - 1; + + if (channel == 7) + *str = "sum of shunt voltages"; + else + *str = ina->inputs[index].label; + + return 0; +} + +static umode_t ina3221_is_visible(const void *drvdata, + enum hwmon_sensor_types type, + u32 attr, int channel) +{ + const struct ina3221_data *ina = drvdata; + const struct ina3221_input *input = NULL; + + switch (type) { + case hwmon_chip: + switch (attr) { + case hwmon_chip_samples: + case hwmon_chip_update_interval: + return 0644; + default: + return 0; + } + case hwmon_in: + /* Ignore in0_ */ + if (channel == 0) + return 0; + + switch (attr) { + case hwmon_in_label: + if (channel - 1 <= INA3221_CHANNEL3) + input = &ina->inputs[channel - 1]; + else if (channel == 7) + return 0444; + /* Hide label node if label is not provided */ + return (input && input->label) ? 0444 : 0; + case hwmon_in_input: + return 0444; + case hwmon_in_enable: + return 0644; + default: + return 0; + } + case hwmon_curr: + switch (attr) { + case hwmon_curr_input: + case hwmon_curr_crit_alarm: + case hwmon_curr_max_alarm: + return 0444; + case hwmon_curr_crit: + case hwmon_curr_max: + return 0644; + default: + return 0; + } + default: + return 0; + } +} + +#define INA3221_HWMON_CURR_CONFIG (HWMON_C_INPUT | \ + HWMON_C_CRIT | HWMON_C_CRIT_ALARM | \ + HWMON_C_MAX | HWMON_C_MAX_ALARM) + +static const struct hwmon_channel_info *ina3221_info[] = { + HWMON_CHANNEL_INFO(chip, + HWMON_C_SAMPLES, + HWMON_C_UPDATE_INTERVAL), + HWMON_CHANNEL_INFO(in, + /* 0: dummy, skipped in is_visible */ + HWMON_I_INPUT, + /* 1-3: input voltage Channels */ + HWMON_I_INPUT | HWMON_I_ENABLE | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_ENABLE | HWMON_I_LABEL, + HWMON_I_INPUT | HWMON_I_ENABLE | HWMON_I_LABEL, + /* 4-6: shunt voltage Channels */ + HWMON_I_INPUT, + HWMON_I_INPUT, + HWMON_I_INPUT, + /* 7: summation of shunt voltage channels */ + HWMON_I_INPUT | HWMON_I_LABEL), + HWMON_CHANNEL_INFO(curr, + /* 1-3: current channels*/ + INA3221_HWMON_CURR_CONFIG, + INA3221_HWMON_CURR_CONFIG, + INA3221_HWMON_CURR_CONFIG, + /* 4: summation of current channels */ + HWMON_C_INPUT | HWMON_C_CRIT | HWMON_C_CRIT_ALARM), + NULL +}; + +static const struct hwmon_ops ina3221_hwmon_ops = { + .is_visible = ina3221_is_visible, + .read_string = ina3221_read_string, + .read = ina3221_read, + .write = ina3221_write, +}; + +static const struct hwmon_chip_info ina3221_chip_info = { + .ops = &ina3221_hwmon_ops, + .info = ina3221_info, +}; + +/* Extra attribute groups */ +static ssize_t ina3221_shunt_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct sensor_device_attribute *sd_attr = to_sensor_dev_attr(attr); + struct ina3221_data *ina = dev_get_drvdata(dev); + unsigned int channel = sd_attr->index; + struct ina3221_input *input = &ina->inputs[channel]; + + return snprintf(buf, PAGE_SIZE, "%d\n", input->shunt_resistor); +} + +static ssize_t ina3221_shunt_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct sensor_device_attribute *sd_attr = to_sensor_dev_attr(attr); + struct ina3221_data *ina = dev_get_drvdata(dev); + unsigned int channel = sd_attr->index; + struct ina3221_input *input = &ina->inputs[channel]; + int val; + int ret; + + ret = kstrtoint(buf, 0, &val); + if (ret) + return ret; + + val = clamp_val(val, 1, INT_MAX); + + input->shunt_resistor = val; + + /* Update summation_shunt_resistor for summation channel */ + ina->summation_shunt_resistor = ina3221_summation_shunt_resistor(ina); + + return count; +} + +/* shunt resistance */ +static SENSOR_DEVICE_ATTR_RW(shunt1_resistor, ina3221_shunt, INA3221_CHANNEL1); +static SENSOR_DEVICE_ATTR_RW(shunt2_resistor, ina3221_shunt, INA3221_CHANNEL2); +static SENSOR_DEVICE_ATTR_RW(shunt3_resistor, ina3221_shunt, INA3221_CHANNEL3); + +static struct attribute *ina3221_attrs[] = { + &sensor_dev_attr_shunt1_resistor.dev_attr.attr, + &sensor_dev_attr_shunt2_resistor.dev_attr.attr, + &sensor_dev_attr_shunt3_resistor.dev_attr.attr, + NULL, +}; +ATTRIBUTE_GROUPS(ina3221); + +static const struct regmap_range ina3221_yes_ranges[] = { + regmap_reg_range(INA3221_CONFIG, INA3221_BUS3), + regmap_reg_range(INA3221_SHUNT_SUM, INA3221_SHUNT_SUM), + regmap_reg_range(INA3221_MASK_ENABLE, INA3221_MASK_ENABLE), +}; + +static const struct regmap_access_table ina3221_volatile_table = { + .yes_ranges = ina3221_yes_ranges, + .n_yes_ranges = ARRAY_SIZE(ina3221_yes_ranges), +}; + +static const struct regmap_config ina3221_regmap_config = { + .reg_bits = 8, + .val_bits = 16, + + .cache_type = REGCACHE_RBTREE, + .volatile_table = &ina3221_volatile_table, +}; + +static int ina3221_probe_child_from_dt(struct device *dev, + struct device_node *child, + struct ina3221_data *ina) +{ + struct ina3221_input *input; + u32 val; + int ret; + + ret = of_property_read_u32(child, "reg", &val); + if (ret) { + dev_err(dev, "missing reg property of %pOFn\n", child); + return ret; + } else if (val > INA3221_CHANNEL3) { + dev_err(dev, "invalid reg %d of %pOFn\n", val, child); + return ret; + } + + input = &ina->inputs[val]; + + /* Log the disconnected channel input */ + if (!of_device_is_available(child)) { + input->disconnected = true; + return 0; + } + + /* Save the connected input label if available */ + of_property_read_string(child, "label", &input->label); + + /* Overwrite default shunt resistor value optionally */ + if (!of_property_read_u32(child, "shunt-resistor-micro-ohms", &val)) { + if (val < 1 || val > INT_MAX) { + dev_err(dev, "invalid shunt resistor value %u of %pOFn\n", + val, child); + return -EINVAL; + } + input->shunt_resistor = val; + } + + return 0; +} + +static int ina3221_probe_from_dt(struct device *dev, struct ina3221_data *ina) +{ + const struct device_node *np = dev->of_node; + struct device_node *child; + int ret; + + /* Compatible with non-DT platforms */ + if (!np) + return 0; + + ina->single_shot = of_property_read_bool(np, "ti,single-shot"); + + for_each_child_of_node(np, child) { + ret = ina3221_probe_child_from_dt(dev, child, ina); + if (ret) { + of_node_put(child); + return ret; + } + } + + return 0; +} + +static int ina3221_probe(struct i2c_client *client) +{ + struct device *dev = &client->dev; + struct ina3221_data *ina; + struct device *hwmon_dev; + int i, ret; + + ina = devm_kzalloc(dev, sizeof(*ina), GFP_KERNEL); + if (!ina) + return -ENOMEM; + + ina->regmap = devm_regmap_init_i2c(client, &ina3221_regmap_config); + if (IS_ERR(ina->regmap)) { + dev_err(dev, "Unable to allocate register map\n"); + return PTR_ERR(ina->regmap); + } + + for (i = 0; i < F_MAX_FIELDS; i++) { + ina->fields[i] = devm_regmap_field_alloc(dev, + ina->regmap, + ina3221_reg_fields[i]); + if (IS_ERR(ina->fields[i])) { + dev_err(dev, "Unable to allocate regmap fields\n"); + return PTR_ERR(ina->fields[i]); + } + } + + for (i = 0; i < INA3221_NUM_CHANNELS; i++) + ina->inputs[i].shunt_resistor = INA3221_RSHUNT_DEFAULT; + + ret = ina3221_probe_from_dt(dev, ina); + if (ret) { + dev_err(dev, "Unable to probe from device tree\n"); + return ret; + } + + /* The driver will be reset, so use reset value */ + ina->reg_config = INA3221_CONFIG_DEFAULT; + + /* Clear continuous bit to use single-shot mode */ + if (ina->single_shot) + ina->reg_config &= ~INA3221_CONFIG_MODE_CONTINUOUS; + + /* Disable channels if their inputs are disconnected */ + for (i = 0; i < INA3221_NUM_CHANNELS; i++) { + if (ina->inputs[i].disconnected) + ina->reg_config &= ~INA3221_CONFIG_CHx_EN(i); + } + + /* Initialize summation_shunt_resistor for summation channel control */ + ina->summation_shunt_resistor = ina3221_summation_shunt_resistor(ina); + + ina->pm_dev = dev; + mutex_init(&ina->lock); + dev_set_drvdata(dev, ina); + + /* Enable PM runtime -- status is suspended by default */ + pm_runtime_enable(ina->pm_dev); + + /* Initialize (resume) the device */ + for (i = 0; i < INA3221_NUM_CHANNELS; i++) { + if (ina->inputs[i].disconnected) + continue; + /* Match the refcount with number of enabled channels */ + ret = pm_runtime_get_sync(ina->pm_dev); + if (ret < 0) + goto fail; + } + + hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name, ina, + &ina3221_chip_info, + ina3221_groups); + if (IS_ERR(hwmon_dev)) { + dev_err(dev, "Unable to register hwmon device\n"); + ret = PTR_ERR(hwmon_dev); + goto fail; + } + + return 0; + +fail: + pm_runtime_disable(ina->pm_dev); + pm_runtime_set_suspended(ina->pm_dev); + /* pm_runtime_put_noidle() will decrease the PM refcount until 0 */ + for (i = 0; i < INA3221_NUM_CHANNELS; i++) + pm_runtime_put_noidle(ina->pm_dev); + mutex_destroy(&ina->lock); + + return ret; +} + +static void ina3221_remove(struct i2c_client *client) +{ + struct ina3221_data *ina = dev_get_drvdata(&client->dev); + int i; + + pm_runtime_disable(ina->pm_dev); + pm_runtime_set_suspended(ina->pm_dev); + + /* pm_runtime_put_noidle() will decrease the PM refcount until 0 */ + for (i = 0; i < INA3221_NUM_CHANNELS; i++) + pm_runtime_put_noidle(ina->pm_dev); + + mutex_destroy(&ina->lock); + + return; +} + +static int __maybe_unused ina3221_suspend(struct device *dev) +{ + struct ina3221_data *ina = dev_get_drvdata(dev); + int ret; + + /* Save config register value and enable cache-only */ + ret = regmap_read(ina->regmap, INA3221_CONFIG, &ina->reg_config); + if (ret) + return ret; + + /* Set to power-down mode for power saving */ + ret = regmap_update_bits(ina->regmap, INA3221_CONFIG, + INA3221_CONFIG_MODE_MASK, + INA3221_CONFIG_MODE_POWERDOWN); + if (ret) + return ret; + + regcache_cache_only(ina->regmap, true); + regcache_mark_dirty(ina->regmap); + + return 0; +} + +static int __maybe_unused ina3221_resume(struct device *dev) +{ + struct ina3221_data *ina = dev_get_drvdata(dev); + int ret; + + regcache_cache_only(ina->regmap, false); + + /* Software reset the chip */ + ret = regmap_field_write(ina->fields[F_RST], true); + if (ret) { + dev_err(dev, "Unable to reset device\n"); + return ret; + } + + /* Restore cached register values to hardware */ + ret = regcache_sync(ina->regmap); + if (ret) + return ret; + + /* Restore config register value to hardware */ + ret = regmap_write(ina->regmap, INA3221_CONFIG, ina->reg_config); + if (ret) + return ret; + + /* Initialize summation channel control */ + if (ina->summation_shunt_resistor) { + /* + * Take all three channels into summation by default + * Shunt measurements of disconnected channels should + * be 0, so it does not matter for summation. + */ + ret = regmap_update_bits(ina->regmap, INA3221_MASK_ENABLE, + INA3221_MASK_ENABLE_SCC_MASK, + INA3221_MASK_ENABLE_SCC_MASK); + if (ret) { + dev_err(dev, "Unable to control summation channel\n"); + return ret; + } + } + + return 0; +} + +static const struct dev_pm_ops ina3221_pm = { + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) + SET_RUNTIME_PM_OPS(ina3221_suspend, ina3221_resume, NULL) +}; + +static const struct of_device_id ina3221_of_match_table[] = { + { .compatible = "ti,wb_ina3221", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, ina3221_of_match_table); + +static const struct i2c_device_id ina3221_ids[] = { + { "wb_ina3221", 0 }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(i2c, ina3221_ids); + +static struct i2c_driver ina3221_i2c_driver = { + .probe_new = ina3221_probe, + .remove = ina3221_remove, + .driver = { + .name = INA3221_DRIVER_NAME, + .of_match_table = ina3221_of_match_table, + .pm = &ina3221_pm, + }, + .id_table = ina3221_ids, +}; +module_i2c_driver(ina3221_i2c_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("Texas Instruments INA3221 HWMon Driver"); +MODULE_LICENSE("GPL v2"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_isl68137.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_isl68137.c new file mode 100644 index 000000000000..648020435311 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_isl68137.c @@ -0,0 +1,577 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Hardware monitoring driver for Renesas Digital Multiphase Voltage Regulators + * + * Copyright (c) 2017 Google Inc + * Copyright (c) 2020 Renesas Electronics America + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_pmbus.h" + +#define ISL68137_VOUT_AVS (0x30) +#define RAA_DMPVR2_READ_VMON (0xc8) +#define WRITE_PROTECT_CLOSE (0x00) +#define WRITE_PROTECT_OPEN (0x40) + +static int g_wb_isl68137_debug = 0; +static int g_wb_isl68137_error = 0; + +module_param(g_wb_isl68137_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_isl68137_error, int, S_IRUGO | S_IWUSR); + +#define WB_ISL68137_VERBOSE(fmt, args...) do { \ + if (g_wb_isl68137_debug) { \ + printk(KERN_INFO "[WB_ISL68137][VER][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_ISL68137_ERROR(fmt, args...) do { \ + if (g_wb_isl68137_error) { \ + printk(KERN_ERR "[WB_ISL68137][ERR][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +enum chips { + isl68137, + isl68220, + isl68221, + isl68222, + isl68223, + isl68224, + isl68225, + isl68226, + isl68227, + isl68229, + isl68233, + isl68239, + isl69222, + isl69223, + isl69224, + isl69225, + isl69227, + isl69228, + isl69234, + isl69236, + isl69239, + isl69242, + isl69243, + isl69247, + isl69248, + isl69254, + isl69255, + isl69256, + isl69259, + isl69260, + isl69268, + isl69269, + isl69298, + raa228000, + raa228004, + raa228006, + raa228228, + raa229001, + raa229004, +}; + +enum variants { + raa_dmpvr1_2rail, + raa_dmpvr2_1rail, + raa_dmpvr2_2rail, + raa_dmpvr2_2rail_nontc, + raa_dmpvr2_3rail, + raa_dmpvr2_hv, +}; + +static const struct i2c_device_id raa_dmpvr_id[]; + +static ssize_t isl68137_avs_enable_show_page(struct i2c_client *client, + int page, + char *buf) +{ + int val = wb_pmbus_read_byte_data(client, page, PMBUS_OPERATION); + + return sprintf(buf, "%d\n", + (val & ISL68137_VOUT_AVS) == ISL68137_VOUT_AVS ? 1 : 0); +} + +static ssize_t isl68137_avs_enable_store_page(struct i2c_client *client, + int page, + const char *buf, size_t count) +{ + int rc, op_val; + bool result; + + rc = kstrtobool(buf, &result); + if (rc) + return rc; + + op_val = result ? ISL68137_VOUT_AVS : 0; + + /* + * Writes to VOUT setpoint over AVSBus will persist after the VRM is + * switched to PMBus control. Switching back to AVSBus control + * restores this persisted setpoint rather than re-initializing to + * PMBus VOUT_COMMAND. Writing VOUT_COMMAND first over PMBus before + * enabling AVS control is the workaround. + */ + if (op_val == ISL68137_VOUT_AVS) { + rc = wb_pmbus_read_word_data(client, page, 0xff, + PMBUS_VOUT_COMMAND); + if (rc < 0) + return rc; + + rc = wb_pmbus_write_word_data(client, page, PMBUS_VOUT_COMMAND, + rc); + if (rc < 0) + return rc; + } + + rc = wb_pmbus_update_byte_data(client, page, PMBUS_OPERATION, + ISL68137_VOUT_AVS, op_val); + + return (rc < 0) ? rc : count; +} + +static ssize_t isl68137_avs_enable_show(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + return isl68137_avs_enable_show_page(client, attr->index, buf); +} + +static ssize_t isl68137_avs_enable_store(struct device *dev, + struct device_attribute *devattr, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + return isl68137_avs_enable_store_page(client, attr->index, buf, count); +} + +static ssize_t isl68137_avs_vout_show(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int vout_cmd, vout; + + mutex_lock(&data->update_lock); + vout_cmd = wb_pmbus_read_word_data(client, attr->index, 0xff, PMBUS_VOUT_COMMAND); + if (vout_cmd < 0) { + WB_ISL68137_ERROR("%d-%04x: read page%d vout command reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, PMBUS_VOUT_COMMAND, vout_cmd); + mutex_unlock(&data->update_lock); + return vout_cmd; + } + vout = vout_cmd * 1000; + WB_ISL68137_VERBOSE("%d-%04x: page%d, vout: %d, vout_cmd: 0x%x\n", client->adapter->nr, + client->addr, attr->index, vout, vout_cmd); + mutex_unlock(&data->update_lock); + return snprintf(buf, PAGE_SIZE, "%d\n", vout); +} + +static ssize_t isl68137_avs_vout_store(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int vout, vout_max, vout_min; + int ret, vout_cmd, vout_cmd_set; + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_ISL68137_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + ret = kstrtoint(buf, 0, &vout); + if (ret) { + WB_ISL68137_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + + if (vout <= 0) { + WB_ISL68137_ERROR("%d-%04x: invalid value: %d \n", client->adapter->nr, client->addr, vout); + return -EINVAL; + } + + vout_max = data->vout_max[attr->index]; + vout_min = data->vout_min[attr->index]; + if ((vout > vout_max) || (vout < vout_min)) { + WB_ISL68137_ERROR("%d-%04x: vout value: %d, out of range [%d, %d] \n", client->adapter->nr, + client->addr, vout, vout_min, vout_max); + return -EINVAL; + } + + /* calc VOUT_COMMAND set value */ + vout_cmd_set = vout / 1000; + if (vout_cmd_set > 0xffff) { + WB_ISL68137_ERROR("%d-%04x: invalid value, vout %d, vout_cmd_set: 0x%x\n", + client->adapter->nr, client->addr, vout, vout_cmd_set); + return -EINVAL; + } + + mutex_lock(&data->update_lock); + + /* close write protect */ + ret = wb_pmbus_write_byte_data(client, attr->index, PMBUS_WRITE_PROTECT, WRITE_PROTECT_CLOSE); + if (ret < 0) { + WB_ISL68137_ERROR("%d-%04x: close page%d write protect failed, ret: %d\n", client->adapter->nr, + client->addr, attr->index, ret); + mutex_unlock(&data->update_lock); + return ret; + } + + /* set VOUT_COMMAND */ + ret = wb_pmbus_write_word_data(client, attr->index, PMBUS_VOUT_COMMAND, vout_cmd_set); + if (ret < 0) { + WB_ISL68137_ERROR("%d-%04x: set page%d vout cmd reg: 0x%x, value: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, PMBUS_VOUT_COMMAND, vout_cmd_set, ret); + goto error; + } + + /* read back VOUT_COMMAND */ + vout_cmd = wb_pmbus_read_word_data(client, attr->index, 0xff, PMBUS_VOUT_COMMAND); + if (vout_cmd < 0) { + ret = vout_cmd; + WB_ISL68137_ERROR("%d-%04x: read page%d vout command reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, PMBUS_VOUT_COMMAND, ret); + goto error; + } + + /* compare vout_cmd and vout_cmd_set */ + if (vout_cmd != vout_cmd_set) { + ret = -EIO; + WB_ISL68137_ERROR("%d-%04x: vout cmd value check error, vout cmd read: 0x%x, vout cmd set: 0x%x\n", + client->adapter->nr, client->addr, vout_cmd, vout_cmd_set); + goto error; + } + + /* open write protect */ + wb_pmbus_write_byte_data(client, attr->index, PMBUS_WRITE_PROTECT, WRITE_PROTECT_OPEN); + mutex_unlock(&data->update_lock); + WB_ISL68137_VERBOSE("%d-%04x: set page%d vout cmd success, vout %d, vout_cmd_set: 0x%x\n", + client->adapter->nr, client->addr, attr->index, vout, vout_cmd_set); + return count; +error: + wb_pmbus_write_byte_data(client, attr->index, PMBUS_WRITE_PROTECT, WRITE_PROTECT_OPEN); + mutex_unlock(&data->update_lock); + return ret; +} + +static ssize_t isl68137_avs_vout_max_store(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int ret, vout_threshold; + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_ISL68137_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + ret = kstrtoint(buf, 0, &vout_threshold); + if (ret) { + WB_ISL68137_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + + WB_ISL68137_VERBOSE("%d-%04x: vout%d max threshold: %d", client->adapter->nr, client->addr, + attr->index, vout_threshold); + + data->vout_max[attr->index] = vout_threshold; + return count; +} + +static ssize_t isl68137_avs_vout_max_show(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_ISL68137_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + return snprintf(buf, PAGE_SIZE, "%d\n", data->vout_max[attr->index]); +} + +static ssize_t isl68137_avs_vout_min_store(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int ret, vout_threshold; + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_ISL68137_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + ret = kstrtoint(buf, 0, &vout_threshold); + if (ret) { + WB_ISL68137_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + + WB_ISL68137_VERBOSE("%d-%04x: vout%d min threshold: %d", client->adapter->nr, client->addr, + attr->index, vout_threshold); + + data->vout_min[attr->index] = vout_threshold; + return count; +} + +static ssize_t isl68137_avs_vout_min_show(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_ISL68137_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + return snprintf(buf, PAGE_SIZE, "%d\n", data->vout_min[attr->index]); +} + +static SENSOR_DEVICE_ATTR_RW(avs0_enable, isl68137_avs_enable, 0); +static SENSOR_DEVICE_ATTR_RW(avs1_enable, isl68137_avs_enable, 1); + +static SENSOR_DEVICE_ATTR_RW(avs0_vout, isl68137_avs_vout, 0); +static SENSOR_DEVICE_ATTR_RW(avs1_vout, isl68137_avs_vout, 1); +static SENSOR_DEVICE_ATTR_RW(avs0_vout_max, isl68137_avs_vout_max, 0); +static SENSOR_DEVICE_ATTR_RW(avs0_vout_min, isl68137_avs_vout_min, 0); +static SENSOR_DEVICE_ATTR_RW(avs1_vout_max, isl68137_avs_vout_max, 1); +static SENSOR_DEVICE_ATTR_RW(avs1_vout_min, isl68137_avs_vout_min, 1); + +static struct attribute *enable_attrs[] = { + &sensor_dev_attr_avs0_enable.dev_attr.attr, + &sensor_dev_attr_avs1_enable.dev_attr.attr, + NULL, +}; + +static struct attribute *avs_ctrl_attrs[] = { + &sensor_dev_attr_avs0_vout.dev_attr.attr, + &sensor_dev_attr_avs1_vout.dev_attr.attr, + &sensor_dev_attr_avs0_vout_max.dev_attr.attr, + &sensor_dev_attr_avs0_vout_min.dev_attr.attr, + &sensor_dev_attr_avs1_vout_max.dev_attr.attr, + &sensor_dev_attr_avs1_vout_min.dev_attr.attr, + NULL, +}; + +static const struct attribute_group enable_group = { + .attrs = enable_attrs, +}; + +static const struct attribute_group avs_ctrl_group = { + .attrs = avs_ctrl_attrs, +}; + +static const struct attribute_group *isl68137_attribute_groups[] = { + &enable_group, + &avs_ctrl_group, + NULL, +}; + +static int raa_dmpvr2_read_word_data(struct i2c_client *client, int page, + int phase, int reg) +{ + int ret; + + switch (reg) { + case PMBUS_VIRT_READ_VMON: + ret = wb_pmbus_read_word_data(client, page, phase, + RAA_DMPVR2_READ_VMON); + break; + default: + ret = -ENODATA; + break; + } + + return ret; +} + +static struct pmbus_driver_info raa_dmpvr_info = { + .pages = 3, + .format[PSC_VOLTAGE_IN] = direct, + .format[PSC_VOLTAGE_OUT] = direct, + .format[PSC_CURRENT_IN] = direct, + .format[PSC_CURRENT_OUT] = direct, + .format[PSC_POWER] = direct, + .format[PSC_TEMPERATURE] = direct, + .m[PSC_VOLTAGE_IN] = 1, + .b[PSC_VOLTAGE_IN] = 0, + .R[PSC_VOLTAGE_IN] = 2, + .m[PSC_VOLTAGE_OUT] = 1, + .b[PSC_VOLTAGE_OUT] = 0, + .R[PSC_VOLTAGE_OUT] = 3, + .m[PSC_CURRENT_IN] = 1, + .b[PSC_CURRENT_IN] = 0, + .R[PSC_CURRENT_IN] = 2, + .m[PSC_CURRENT_OUT] = 1, + .b[PSC_CURRENT_OUT] = 0, + .R[PSC_CURRENT_OUT] = 1, + .m[PSC_POWER] = 1, + .b[PSC_POWER] = 0, + .R[PSC_POWER] = 0, + .m[PSC_TEMPERATURE] = 1, + .b[PSC_TEMPERATURE] = 0, + .R[PSC_TEMPERATURE] = 0, + .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_PIN + | PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 + | PMBUS_HAVE_TEMP3 | PMBUS_HAVE_STATUS_TEMP + | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT + | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_POUT + | PMBUS_HAVE_VMON, + .func[1] = PMBUS_HAVE_IIN | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT + | PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP3 | PMBUS_HAVE_STATUS_TEMP + | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_IOUT + | PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_POUT, + .func[2] = PMBUS_HAVE_IIN | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT + | PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP3 | PMBUS_HAVE_STATUS_TEMP + | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_IOUT + | PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_POUT, +}; + +static int isl68137_probe(struct i2c_client *client) +{ + struct pmbus_driver_info *info; + + info = devm_kzalloc(&client->dev, sizeof(*info), GFP_KERNEL); + if (!info) + return -ENOMEM; + memcpy(info, &raa_dmpvr_info, sizeof(*info)); + + switch (i2c_match_id(raa_dmpvr_id, client)->driver_data) { + case raa_dmpvr1_2rail: + info->pages = 2; + info->R[PSC_VOLTAGE_IN] = 3; + info->func[0] &= ~PMBUS_HAVE_VMON; + info->func[1] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT + | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT + | PMBUS_HAVE_POUT; + info->groups = isl68137_attribute_groups; + break; + case raa_dmpvr2_1rail: + info->pages = 1; + info->read_word_data = raa_dmpvr2_read_word_data; + break; + case raa_dmpvr2_2rail_nontc: + info->func[0] &= ~PMBUS_HAVE_TEMP3; + info->func[1] &= ~PMBUS_HAVE_TEMP3; + fallthrough; + case raa_dmpvr2_2rail: + info->pages = 2; + info->read_word_data = raa_dmpvr2_read_word_data; + break; + case raa_dmpvr2_3rail: + info->read_word_data = raa_dmpvr2_read_word_data; + break; + case raa_dmpvr2_hv: + info->pages = 1; + info->R[PSC_VOLTAGE_IN] = 1; + info->m[PSC_VOLTAGE_OUT] = 2; + info->R[PSC_VOLTAGE_OUT] = 2; + info->m[PSC_CURRENT_IN] = 2; + info->m[PSC_POWER] = 2; + info->R[PSC_POWER] = -1; + info->read_word_data = raa_dmpvr2_read_word_data; + break; + default: + return -ENODEV; + } + + return wb_pmbus_do_probe(client, info); +} + +static const struct i2c_device_id raa_dmpvr_id[] = { + {"wb_isl68127", raa_dmpvr1_2rail}, + {"wb_isl68137", raa_dmpvr1_2rail}, + {"wb_isl68220", raa_dmpvr2_2rail}, + {"wb_isl68221", raa_dmpvr2_3rail}, + {"wb_isl68222", raa_dmpvr2_2rail}, + {"wb_isl68223", raa_dmpvr2_2rail}, + {"wb_isl68224", raa_dmpvr2_3rail}, + {"wb_isl68225", raa_dmpvr2_2rail}, + {"wb_isl68226", raa_dmpvr2_3rail}, + {"wb_isl68227", raa_dmpvr2_1rail}, + {"wb_isl68229", raa_dmpvr2_3rail}, + {"wb_isl68233", raa_dmpvr2_2rail}, + {"wb_isl68239", raa_dmpvr2_3rail}, + + {"wb_isl69222", raa_dmpvr2_2rail}, + {"wb_isl69223", raa_dmpvr2_3rail}, + {"wb_isl69224", raa_dmpvr2_2rail}, + {"wb_isl69225", raa_dmpvr2_2rail}, + {"wb_isl69227", raa_dmpvr2_3rail}, + {"wb_isl69228", raa_dmpvr2_3rail}, + {"wb_isl69234", raa_dmpvr2_2rail}, + {"wb_isl69236", raa_dmpvr2_2rail}, + {"wb_isl69239", raa_dmpvr2_3rail}, + {"wb_isl69242", raa_dmpvr2_2rail}, + {"wb_isl69243", raa_dmpvr2_1rail}, + {"wb_isl69247", raa_dmpvr2_2rail}, + {"wb_isl69248", raa_dmpvr2_2rail}, + {"wb_isl69254", raa_dmpvr2_2rail}, + {"wb_isl69255", raa_dmpvr2_2rail}, + {"wb_isl69256", raa_dmpvr2_2rail}, + {"wb_isl69259", raa_dmpvr2_2rail}, + {"wb_isl69260", raa_dmpvr2_2rail}, + {"wb_isl69268", raa_dmpvr2_2rail}, + {"wb_isl69269", raa_dmpvr2_3rail}, + {"wb_isl69298", raa_dmpvr2_2rail}, + + {"wb_raa228000", raa_dmpvr2_hv}, + {"wb_raa228004", raa_dmpvr2_hv}, + {"wb_raa228006", raa_dmpvr2_hv}, + {"wb_raa228228", raa_dmpvr2_2rail_nontc}, + {"wb_raa229001", raa_dmpvr2_2rail}, + {"wb_raa229004", raa_dmpvr2_2rail}, + {} +}; + +MODULE_DEVICE_TABLE(i2c, raa_dmpvr_id); + +/* This is the driver that will be inserted */ +static struct i2c_driver isl68137_driver = { + .driver = { + .name = "wb_isl68137", + }, + .probe_new = isl68137_probe, + .remove = wb_pmbus_do_remove, + .id_table = raa_dmpvr_id, +}; + +module_i2c_driver(isl68137_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("PMBus driver for Renesas digital multiphase voltage regulators"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_lm75.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_lm75.c new file mode 100644 index 000000000000..0386cfb0b61d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_lm75.c @@ -0,0 +1,992 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * lm75.c - Part of lm_sensors, Linux kernel modules for hardware + * monitoring + * Copyright (c) 1998, 1999 Frodo Looijaard + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "wb_lm75.h" + +/* + * This driver handles the LM75 and compatible digital temperature sensors. + */ + +enum lm75_type { /* keep sorted in alphabetical order */ + adt75, + ds1775, + ds75, + ds7505, + g751, + lm75, + lm75a, + lm75b, + max6625, + max6626, + max31725, + mcp980x, + pct2075, + stds75, + stlm75, + tcn75, + tmp100, + tmp101, + tmp105, + tmp112, + tmp175, + tmp275, + tmp75, + tmp75b, + tmp75c, +}; + +/** + * struct lm75_params - lm75 configuration parameters. + * @set_mask: Bits to set in configuration register when configuring + * the chip. + * @clr_mask: Bits to clear in configuration register when configuring + * the chip. + * @default_resolution: Default number of bits to represent the temperature + * value. + * @resolution_limits: Limit register resolution. Optional. Should be set if + * the resolution of limit registers does not match the + * resolution of the temperature register. + * @resolutions: List of resolutions associated with sample times. + * Optional. Should be set if num_sample_times is larger + * than 1, and if the resolution changes with sample times. + * If set, number of entries must match num_sample_times. + * @default_sample_time:Sample time to be set by default. + * @num_sample_times: Number of possible sample times to be set. Optional. + * Should be set if the number of sample times is larger + * than one. + * @sample_times: All the possible sample times to be set. Mandatory if + * num_sample_times is larger than 1. If set, number of + * entries must match num_sample_times. + */ + +struct lm75_params { + u8 set_mask; + u8 clr_mask; + u8 default_resolution; + u8 resolution_limits; + const u8 *resolutions; + unsigned int default_sample_time; + u8 num_sample_times; + const unsigned int *sample_times; +}; +#if 0 +/* Addresses scanned */ +static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, + 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; +#endif +/* The LM75 registers */ +#define LM75_REG_TEMP 0x00 +#define LM75_REG_CONF 0x01 +#define LM75_REG_HYST 0x02 +#define LM75_REG_MAX 0x03 +#define PCT2075_REG_IDLE 0x04 +#define LM75_TEMP_INVALID_RETRY_TIMES (3) + +/* Each client has this additional data */ +struct lm75_data { + struct i2c_client *client; + struct regmap *regmap; + struct regulator *vs; + u8 orig_conf; + u8 current_conf; + u8 resolution; /* In bits, 9 to 16 */ + unsigned int sample_time; /* In ms */ + enum lm75_type kind; + const struct lm75_params *params; +}; + +/*-----------------------------------------------------------------------*/ + +static const u8 lm75_sample_set_masks[] = { 0 << 5, 1 << 5, 2 << 5, 3 << 5 }; + +#define LM75_SAMPLE_CLEAR_MASK (3 << 5) + +/* The structure below stores the configuration values of the supported devices. + * In case of being supported multiple configurations, the default one must + * always be the first element of the array + */ +static const struct lm75_params device_params[] = { + [adt75] = { + .clr_mask = 1 << 5, /* not one-shot mode */ + .default_resolution = 12, + .default_sample_time = MSEC_PER_SEC / 10, + }, + [ds1775] = { + .clr_mask = 3 << 5, + .set_mask = 2 << 5, /* 11-bit mode */ + .default_resolution = 11, + .default_sample_time = 500, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 125, 250, 500, 1000 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [ds75] = { + .clr_mask = 3 << 5, + .set_mask = 2 << 5, /* 11-bit mode */ + .default_resolution = 11, + .default_sample_time = 600, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 150, 300, 600, 1200 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [stds75] = { + .clr_mask = 3 << 5, + .set_mask = 2 << 5, /* 11-bit mode */ + .default_resolution = 11, + .default_sample_time = 600, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 150, 300, 600, 1200 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [stlm75] = { + .default_resolution = 9, + .default_sample_time = MSEC_PER_SEC / 6, + }, + [ds7505] = { + .set_mask = 3 << 5, /* 12-bit mode*/ + .default_resolution = 12, + .default_sample_time = 200, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 25, 50, 100, 200 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [g751] = { + .default_resolution = 9, + .default_sample_time = MSEC_PER_SEC / 10, + }, + [lm75] = { + .default_resolution = 9, + .default_sample_time = MSEC_PER_SEC / 10, + }, + [lm75a] = { + .default_resolution = 9, + .default_sample_time = MSEC_PER_SEC / 10, + }, + [lm75b] = { + .default_resolution = 11, + .default_sample_time = MSEC_PER_SEC / 10, + }, + [max6625] = { + .default_resolution = 9, + .default_sample_time = MSEC_PER_SEC / 7, + }, + [max6626] = { + .default_resolution = 12, + .default_sample_time = MSEC_PER_SEC / 7, + .resolution_limits = 9, + }, + [max31725] = { + .default_resolution = 16, + .default_sample_time = MSEC_PER_SEC / 20, + }, + [tcn75] = { + .default_resolution = 9, + .default_sample_time = MSEC_PER_SEC / 18, + }, + [pct2075] = { + .default_resolution = 11, + .default_sample_time = MSEC_PER_SEC / 10, + .num_sample_times = 31, + .sample_times = (unsigned int []){ 100, 200, 300, 400, 500, 600, + 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, + 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, + 2800, 2900, 3000, 3100 }, + }, + [mcp980x] = { + .set_mask = 3 << 5, /* 12-bit mode */ + .clr_mask = 1 << 7, /* not one-shot mode */ + .default_resolution = 12, + .resolution_limits = 9, + .default_sample_time = 240, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 30, 60, 120, 240 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [tmp100] = { + .set_mask = 3 << 5, /* 12-bit mode */ + .clr_mask = 1 << 7, /* not one-shot mode */ + .default_resolution = 12, + .default_sample_time = 320, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 40, 80, 160, 320 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [tmp101] = { + .set_mask = 3 << 5, /* 12-bit mode */ + .clr_mask = 1 << 7, /* not one-shot mode */ + .default_resolution = 12, + .default_sample_time = 320, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 40, 80, 160, 320 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [tmp105] = { + .set_mask = 3 << 5, /* 12-bit mode */ + .clr_mask = 1 << 7, /* not one-shot mode*/ + .default_resolution = 12, + .default_sample_time = 220, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 28, 55, 110, 220 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [tmp112] = { + .set_mask = 3 << 5, /* 8 samples / second */ + .clr_mask = 1 << 7, /* no one-shot mode*/ + .default_resolution = 12, + .default_sample_time = 125, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 125, 250, 1000, 4000 }, + }, + [tmp175] = { + .set_mask = 3 << 5, /* 12-bit mode */ + .clr_mask = 1 << 7, /* not one-shot mode*/ + .default_resolution = 12, + .default_sample_time = 220, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 28, 55, 110, 220 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [tmp275] = { + .set_mask = 3 << 5, /* 12-bit mode */ + .clr_mask = 1 << 7, /* not one-shot mode*/ + .default_resolution = 12, + .default_sample_time = 220, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 28, 55, 110, 220 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [tmp75] = { + .set_mask = 3 << 5, /* 12-bit mode */ + .clr_mask = 1 << 7, /* not one-shot mode*/ + .default_resolution = 12, + .default_sample_time = 220, + .num_sample_times = 4, + .sample_times = (unsigned int []){ 28, 55, 110, 220 }, + .resolutions = (u8 []) {9, 10, 11, 12 }, + }, + [tmp75b] = { /* not one-shot mode, Conversion rate 37Hz */ + .clr_mask = 1 << 7 | 3 << 5, + .default_resolution = 12, + .default_sample_time = MSEC_PER_SEC / 37, + .sample_times = (unsigned int []){ MSEC_PER_SEC / 37, + MSEC_PER_SEC / 18, + MSEC_PER_SEC / 9, MSEC_PER_SEC / 4 }, + .num_sample_times = 4, + }, + [tmp75c] = { + .clr_mask = 1 << 5, /*not one-shot mode*/ + .default_resolution = 12, + .default_sample_time = MSEC_PER_SEC / 12, + } +}; + +/* input temp threshold check */ +typedef struct lm75_temp_threshold_s { + int chip_type; + int temp_max; + int temp_min; +} lm75_temp_threshold_t; + +static lm75_temp_threshold_t g_lm75_temp_threshold_info[] = { + { + .chip_type = lm75, + .temp_max = 125000, + .temp_min = -55000, + }, + { + .chip_type = tmp275, + .temp_max = 125000, + .temp_min = -40000, + }, +}; + +/*-----------------------------------------------------------------------*/ +static int lm75_input_temp_check(struct lm75_data *data, int input_val) +{ + int i, size; + + size = ARRAY_SIZE(g_lm75_temp_threshold_info); + + for (i = 0; i < size; i++) { + if (g_lm75_temp_threshold_info[i].chip_type == data->kind) { + if ((input_val > g_lm75_temp_threshold_info[i].temp_max) + || (input_val < g_lm75_temp_threshold_info[i].temp_min)) { + dev_dbg(&data->client->dev, "input temp: %d not in range[%d, %d]\n", + input_val, g_lm75_temp_threshold_info[i].temp_min, + g_lm75_temp_threshold_info[i].temp_max); + return -EINVAL; + } + dev_dbg(&data->client->dev, "input temp: %d in range[%d, %d]", input_val, + g_lm75_temp_threshold_info[i].temp_min, g_lm75_temp_threshold_info[i].temp_max); + return 0; + } + } + return 0; +} + +static inline long lm75_reg_to_mc(s16 temp, u8 resolution) +{ + return ((temp >> (16 - resolution)) * 1000) >> (resolution - 8); +} + +static int lm75_write_config(struct lm75_data *data, u8 set_mask, + u8 clr_mask) +{ + u8 value; + + clr_mask |= LM75_SHUTDOWN; + value = data->current_conf & ~clr_mask; + value |= set_mask; + + if (data->current_conf != value) { + s32 err; + + err = i2c_smbus_write_byte_data(data->client, LM75_REG_CONF, + value); + if (err) + return err; + data->current_conf = value; + } + return 0; +} + +static int lm75_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, int channel, + long *val) +{ + struct lm75_data *data = dev_get_drvdata(dev); + unsigned int regval; + int err, reg, i, ret; + + switch (type) { + case hwmon_chip: + switch (attr) { + case hwmon_chip_update_interval: + *val = data->sample_time; + break; + default: + return -EINVAL; + } + break; + case hwmon_temp: + switch (attr) { + case hwmon_temp_input: + reg = LM75_REG_TEMP; + break; + case hwmon_temp_max: + reg = LM75_REG_MAX; + break; + case hwmon_temp_max_hyst: + reg = LM75_REG_HYST; + break; + default: + return -EINVAL; + } + for (i = 0; i < LM75_TEMP_INVALID_RETRY_TIMES; i++) { + err = regmap_read(data->regmap, reg, ®val); + if (err < 0) { + return err; + } + *val = lm75_reg_to_mc(regval, data->resolution); + if (reg != LM75_REG_TEMP) { + return 0; + } + /* do input_temp_check */ + ret = lm75_input_temp_check(data, *val); + if (ret == 0) { /* input temp check ok */ + return 0; + } + if ((i + 1) < LM75_TEMP_INVALID_RETRY_TIMES) { + msleep(data->sample_time); + } + } + dev_info(&data->client->dev, "temp_input value: %ld invalid\n", *val); + return -EINVAL; + default: + return -EINVAL; + } + return 0; +} + +static int lm75_write_temp(struct device *dev, u32 attr, long temp) +{ + struct lm75_data *data = dev_get_drvdata(dev); + u8 resolution; + int reg; + + switch (attr) { + case hwmon_temp_max: + reg = LM75_REG_MAX; + break; + case hwmon_temp_max_hyst: + reg = LM75_REG_HYST; + break; + default: + return -EINVAL; + } + + /* + * Resolution of limit registers is assumed to be the same as the + * temperature input register resolution unless given explicitly. + */ + if (data->params->resolution_limits) + resolution = data->params->resolution_limits; + else + resolution = data->resolution; + + temp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); + temp = DIV_ROUND_CLOSEST(temp << (resolution - 8), + 1000) << (16 - resolution); + + return regmap_write(data->regmap, reg, (u16)temp); +} + +static int lm75_update_interval(struct device *dev, long val) +{ + struct lm75_data *data = dev_get_drvdata(dev); + unsigned int reg; + u8 index; + s32 err; + + index = find_closest(val, data->params->sample_times, + (int)data->params->num_sample_times); + + switch (data->kind) { + default: + err = lm75_write_config(data, lm75_sample_set_masks[index], + LM75_SAMPLE_CLEAR_MASK); + if (err) + return err; + + data->sample_time = data->params->sample_times[index]; + if (data->params->resolutions) + data->resolution = data->params->resolutions[index]; + break; + case tmp112: + err = regmap_read(data->regmap, LM75_REG_CONF, ®); + if (err < 0) + return err; + reg &= ~0x00c0; + reg |= (3 - index) << 6; + err = regmap_write(data->regmap, LM75_REG_CONF, reg); + if (err < 0) + return err; + data->sample_time = data->params->sample_times[index]; + break; + case pct2075: + err = i2c_smbus_write_byte_data(data->client, PCT2075_REG_IDLE, + index + 1); + if (err) + return err; + data->sample_time = data->params->sample_times[index]; + break; + } + return 0; +} + +static int lm75_write_chip(struct device *dev, u32 attr, long val) +{ + switch (attr) { + case hwmon_chip_update_interval: + return lm75_update_interval(dev, val); + default: + return -EINVAL; + } + return 0; +} + +static int lm75_write(struct device *dev, enum hwmon_sensor_types type, + u32 attr, int channel, long val) +{ + switch (type) { + case hwmon_chip: + return lm75_write_chip(dev, attr, val); + case hwmon_temp: + return lm75_write_temp(dev, attr, val); + default: + return -EINVAL; + } + return 0; +} + +static umode_t lm75_is_visible(const void *data, enum hwmon_sensor_types type, + u32 attr, int channel) +{ + const struct lm75_data *config_data = data; + + switch (type) { + case hwmon_chip: + switch (attr) { + case hwmon_chip_update_interval: + if (config_data->params->num_sample_times > 1) + return 0644; + return 0444; + } + break; + case hwmon_temp: + switch (attr) { + case hwmon_temp_input: + return 0444; + case hwmon_temp_max: + case hwmon_temp_max_hyst: + return 0644; + } + break; + default: + break; + } + return 0; +} + +static const struct hwmon_channel_info *lm75_info[] = { + HWMON_CHANNEL_INFO(chip, + HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL), + HWMON_CHANNEL_INFO(temp, + HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST), + NULL +}; + +static const struct hwmon_ops lm75_hwmon_ops = { + .is_visible = lm75_is_visible, + .read = lm75_read, + .write = lm75_write, +}; + +static const struct hwmon_chip_info lm75_chip_info = { + .ops = &lm75_hwmon_ops, + .info = lm75_info, +}; + +static bool lm75_is_writeable_reg(struct device *dev, unsigned int reg) +{ + return reg != LM75_REG_TEMP; +} + +static bool lm75_is_volatile_reg(struct device *dev, unsigned int reg) +{ + return reg == LM75_REG_TEMP || reg == LM75_REG_CONF; +} + +static const struct regmap_config lm75_regmap_config = { + .reg_bits = 8, + .val_bits = 16, + .max_register = PCT2075_REG_IDLE, + .writeable_reg = lm75_is_writeable_reg, + .volatile_reg = lm75_is_volatile_reg, + .val_format_endian = REGMAP_ENDIAN_BIG, + .cache_type = REGCACHE_RBTREE, + .use_single_read = true, + .use_single_write = true, +}; + +static void lm75_disable_regulator(void *data) +{ + struct lm75_data *lm75 = data; + + regulator_disable(lm75->vs); +} + +static void lm75_remove(void *data) +{ + struct lm75_data *lm75 = data; + struct i2c_client *client = lm75->client; + + i2c_smbus_write_byte_data(client, LM75_REG_CONF, lm75->orig_conf); +} + +static const struct i2c_device_id lm75_ids[]; + +static int lm75_probe(struct i2c_client *client) +{ + struct device *dev = &client->dev; + struct device *hwmon_dev; + struct lm75_data *data; + int status, err; + enum lm75_type kind; + + if (client->dev.of_node) + kind = (enum lm75_type)of_device_get_match_data(&client->dev); + else + kind = i2c_match_id(lm75_ids, client)->driver_data; + + if (!i2c_check_functionality(client->adapter, + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) + return -EIO; + + data = devm_kzalloc(dev, sizeof(struct lm75_data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->client = client; + data->kind = kind; + + data->vs = devm_regulator_get(dev, "vs"); + if (IS_ERR(data->vs)) + return PTR_ERR(data->vs); + + data->regmap = devm_regmap_init_i2c(client, &lm75_regmap_config); + if (IS_ERR(data->regmap)) + return PTR_ERR(data->regmap); + + /* Set to LM75 resolution (9 bits, 1/2 degree C) and range. + * Then tweak to be more precise when appropriate. + */ + + data->params = &device_params[data->kind]; + + /* Save default sample time and resolution*/ + data->sample_time = data->params->default_sample_time; + data->resolution = data->params->default_resolution; + + /* Enable the power */ + err = regulator_enable(data->vs); + if (err) { + dev_err(dev, "failed to enable regulator: %d\n", err); + return err; + } + + err = devm_add_action_or_reset(dev, lm75_disable_regulator, data); + if (err) + return err; + + /* Cache original configuration */ + status = i2c_smbus_read_byte_data(client, LM75_REG_CONF); + if (status < 0) { + dev_dbg(dev, "Can't read config? %d\n", status); + return status; + } + data->orig_conf = status; + data->current_conf = status; + + err = lm75_write_config(data, data->params->set_mask, + data->params->clr_mask); + if (err) + return err; + + err = devm_add_action_or_reset(dev, lm75_remove, data); + if (err) + return err; + + hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name, + data, &lm75_chip_info, + NULL); + if (IS_ERR(hwmon_dev)) + return PTR_ERR(hwmon_dev); + + dev_info(dev, "%s: sensor '%s'\n", dev_name(hwmon_dev), client->name); + + return 0; +} + +static const struct i2c_device_id lm75_ids[] = { + { "wb_adt75", adt75, }, + { "wb_ds1775", ds1775, }, + { "wb_ds75", ds75, }, + { "wb_ds7505", ds7505, }, + { "wb_g751", g751, }, + { "wb_lm75", lm75, }, + { "wb_lm75a", lm75a, }, + { "wb_lm75b", lm75b, }, + { "wb_max6625", max6625, }, + { "wb_max6626", max6626, }, + { "wb_max31725", max31725, }, + { "wb_max31726", max31725, }, + { "wb_mcp980x", mcp980x, }, + { "wb_pct2075", pct2075, }, + { "wb_stds75", stds75, }, + { "wb_stlm75", stlm75, }, + { "wb_tcn75", tcn75, }, + { "wb_tmp100", tmp100, }, + { "wb_tmp101", tmp101, }, + { "wb_tmp105", tmp105, }, + { "wb_tmp112", tmp112, }, + { "wb_tmp175", tmp175, }, + { "wb_tmp275", tmp275, }, + { "wb_tmp75", tmp75, }, + { "wb_tmp75b", tmp75b, }, + { "wb_tmp75c", tmp75c, }, + { /* LIST END */ } +}; +MODULE_DEVICE_TABLE(i2c, lm75_ids); + +static const struct of_device_id __maybe_unused lm75_of_match[] = { + { + .compatible = "adi,adt75", + .data = (void *)adt75 + }, + { + .compatible = "dallas,ds1775", + .data = (void *)ds1775 + }, + { + .compatible = "dallas,ds75", + .data = (void *)ds75 + }, + { + .compatible = "dallas,ds7505", + .data = (void *)ds7505 + }, + { + .compatible = "gmt,g751", + .data = (void *)g751 + }, + { + .compatible = "national,lm75", + .data = (void *)lm75 + }, + { + .compatible = "national,lm75a", + .data = (void *)lm75a + }, + { + .compatible = "national,lm75b", + .data = (void *)lm75b + }, + { + .compatible = "maxim,max6625", + .data = (void *)max6625 + }, + { + .compatible = "maxim,max6626", + .data = (void *)max6626 + }, + { + .compatible = "maxim,max31725", + .data = (void *)max31725 + }, + { + .compatible = "maxim,max31726", + .data = (void *)max31725 + }, + { + .compatible = "maxim,mcp980x", + .data = (void *)mcp980x + }, + { + .compatible = "nxp,pct2075", + .data = (void *)pct2075 + }, + { + .compatible = "st,stds75", + .data = (void *)stds75 + }, + { + .compatible = "st,stlm75", + .data = (void *)stlm75 + }, + { + .compatible = "microchip,tcn75", + .data = (void *)tcn75 + }, + { + .compatible = "ti,tmp100", + .data = (void *)tmp100 + }, + { + .compatible = "ti,tmp101", + .data = (void *)tmp101 + }, + { + .compatible = "ti,tmp105", + .data = (void *)tmp105 + }, + { + .compatible = "ti,tmp112", + .data = (void *)tmp112 + }, + { + .compatible = "ti,tmp175", + .data = (void *)tmp175 + }, + { + .compatible = "ti,tmp275", + .data = (void *)tmp275 + }, + { + .compatible = "ti,tmp75", + .data = (void *)tmp75 + }, + { + .compatible = "ti,tmp75b", + .data = (void *)tmp75b + }, + { + .compatible = "ti,tmp75c", + .data = (void *)tmp75c + }, + { }, +}; +MODULE_DEVICE_TABLE(of, lm75_of_match); + +#define LM75A_ID 0xA1 +#if 0 +/* Return 0 if detection is successful, -ENODEV otherwise */ +static int lm75_detect(struct i2c_client *new_client, + struct i2c_board_info *info) +{ + struct i2c_adapter *adapter = new_client->adapter; + int i; + int conf, hyst, os; + bool is_lm75a = 0; + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | + I2C_FUNC_SMBUS_WORD_DATA)) + return -ENODEV; + + /* + * Now, we do the remaining detection. There is no identification- + * dedicated register so we have to rely on several tricks: + * unused bits, registers cycling over 8-address boundaries, + * addresses 0x04-0x07 returning the last read value. + * The cycling+unused addresses combination is not tested, + * since it would significantly slow the detection down and would + * hardly add any value. + * + * The National Semiconductor LM75A is different than earlier + * LM75s. It has an ID byte of 0xaX (where X is the chip + * revision, with 1 being the only revision in existence) in + * register 7, and unused registers return 0xff rather than the + * last read value. + * + * Note that this function only detects the original National + * Semiconductor LM75 and the LM75A. Clones from other vendors + * aren't detected, on purpose, because they are typically never + * found on PC hardware. They are found on embedded designs where + * they can be instantiated explicitly so detection is not needed. + * The absence of identification registers on all these clones + * would make their exhaustive detection very difficult and weak, + * and odds are that the driver would bind to unsupported devices. + */ + + /* Unused bits */ + conf = i2c_smbus_read_byte_data(new_client, 1); + if (conf & 0xe0) + return -ENODEV; + + /* First check for LM75A */ + if (i2c_smbus_read_byte_data(new_client, 7) == LM75A_ID) { + /* + * LM75A returns 0xff on unused registers so + * just to be sure we check for that too. + */ + if (i2c_smbus_read_byte_data(new_client, 4) != 0xff + || i2c_smbus_read_byte_data(new_client, 5) != 0xff + || i2c_smbus_read_byte_data(new_client, 6) != 0xff) + return -ENODEV; + is_lm75a = 1; + hyst = i2c_smbus_read_byte_data(new_client, 2); + os = i2c_smbus_read_byte_data(new_client, 3); + } else { /* Traditional style LM75 detection */ + /* Unused addresses */ + hyst = i2c_smbus_read_byte_data(new_client, 2); + if (i2c_smbus_read_byte_data(new_client, 4) != hyst + || i2c_smbus_read_byte_data(new_client, 5) != hyst + || i2c_smbus_read_byte_data(new_client, 6) != hyst + || i2c_smbus_read_byte_data(new_client, 7) != hyst) + return -ENODEV; + os = i2c_smbus_read_byte_data(new_client, 3); + if (i2c_smbus_read_byte_data(new_client, 4) != os + || i2c_smbus_read_byte_data(new_client, 5) != os + || i2c_smbus_read_byte_data(new_client, 6) != os + || i2c_smbus_read_byte_data(new_client, 7) != os) + return -ENODEV; + } + /* + * It is very unlikely that this is a LM75 if both + * hysteresis and temperature limit registers are 0. + */ + if (hyst == 0 && os == 0) + return -ENODEV; + + /* Addresses cycling */ + for (i = 8; i <= 248; i += 40) { + if (i2c_smbus_read_byte_data(new_client, i + 1) != conf + || i2c_smbus_read_byte_data(new_client, i + 2) != hyst + || i2c_smbus_read_byte_data(new_client, i + 3) != os) + return -ENODEV; + if (is_lm75a && i2c_smbus_read_byte_data(new_client, i + 7) + != LM75A_ID) + return -ENODEV; + } + + strlcpy(info->type, is_lm75a ? "lm75a" : "lm75", I2C_NAME_SIZE); + + return 0; +} +#endif + +#ifdef CONFIG_PM +static int lm75_suspend(struct device *dev) +{ + int status; + struct i2c_client *client = to_i2c_client(dev); + + status = i2c_smbus_read_byte_data(client, LM75_REG_CONF); + if (status < 0) { + dev_dbg(&client->dev, "Can't read config? %d\n", status); + return status; + } + status = status | LM75_SHUTDOWN; + i2c_smbus_write_byte_data(client, LM75_REG_CONF, status); + return 0; +} + +static int lm75_resume(struct device *dev) +{ + int status; + struct i2c_client *client = to_i2c_client(dev); + + status = i2c_smbus_read_byte_data(client, LM75_REG_CONF); + if (status < 0) { + dev_dbg(&client->dev, "Can't read config? %d\n", status); + return status; + } + status = status & ~LM75_SHUTDOWN; + i2c_smbus_write_byte_data(client, LM75_REG_CONF, status); + return 0; +} + +static const struct dev_pm_ops lm75_dev_pm_ops = { + .suspend = lm75_suspend, + .resume = lm75_resume, +}; +#define LM75_DEV_PM_OPS (&lm75_dev_pm_ops) +#else +#define LM75_DEV_PM_OPS NULL +#endif /* CONFIG_PM */ + +static struct i2c_driver lm75_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "wb_lm75", + .of_match_table = of_match_ptr(lm75_of_match), + .pm = LM75_DEV_PM_OPS, + }, + .probe_new = lm75_probe, + .id_table = lm75_ids, + /* .detect = lm75_detect, */ + /* .address_list = normal_i2c, */ +}; + +module_i2c_driver(lm75_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("LM75 driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_lm75.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_lm75.h new file mode 100644 index 000000000000..a398171162a8 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_lm75.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * lm75.h - Part of lm_sensors, Linux kernel modules for hardware monitoring + * Copyright (c) 2003 Mark M. Hoffman + */ + +/* + * This file contains common code for encoding/decoding LM75 type + * temperature readings, which are emulated by many of the chips + * we support. As the user is unlikely to load more than one driver + * which contains this code, we don't worry about the wasted space. + */ + +#include + +/* straight from the datasheet */ +#define LM75_TEMP_MIN (-55000) +#define LM75_TEMP_MAX 125000 +#define LM75_SHUTDOWN 0x01 + +/* + * TEMP: 0.001C/bit (-55C to +125C) + * REG: (0.5C/bit, two's complement) << 7 + */ +static inline u16 LM75_TEMP_TO_REG(long temp) +{ + int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); + + ntemp += (ntemp < 0 ? -250 : 250); + return (u16)((ntemp / 500) << 7); +} + +static inline int LM75_TEMP_FROM_REG(u16 reg) +{ + /* + * use integer division instead of equivalent right shift to + * guarantee arithmetic shift and preserve the sign + */ + return ((s16)reg / 128) * 500; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_pmbus.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_pmbus.h new file mode 100644 index 000000000000..781f2ee07198 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_pmbus.h @@ -0,0 +1,535 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * wb_pmbus.h - Common defines and structures for PMBus devices + * + * Copyright (c) 2010, 2011 Ericsson AB. + * Copyright (c) 2012 Guenter Roeck + */ + +#ifndef WB_PMBUS_H +#define WB_PMBUS_H + +#include +#include +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +/* + * Registers + */ +enum pmbus_regs { + PMBUS_PAGE = 0x00, + PMBUS_OPERATION = 0x01, + PMBUS_ON_OFF_CONFIG = 0x02, + PMBUS_CLEAR_FAULTS = 0x03, + PMBUS_PHASE = 0x04, + + PMBUS_WRITE_PROTECT = 0x10, + + PMBUS_CAPABILITY = 0x19, + PMBUS_QUERY = 0x1A, + + PMBUS_VOUT_MODE = 0x20, + PMBUS_VOUT_COMMAND = 0x21, + PMBUS_VOUT_TRIM = 0x22, + PMBUS_VOUT_CAL_OFFSET = 0x23, + PMBUS_VOUT_MAX = 0x24, + PMBUS_VOUT_MARGIN_HIGH = 0x25, + PMBUS_VOUT_MARGIN_LOW = 0x26, + PMBUS_VOUT_TRANSITION_RATE = 0x27, + PMBUS_VOUT_DROOP = 0x28, + PMBUS_VOUT_SCALE_LOOP = 0x29, + PMBUS_VOUT_SCALE_MONITOR = 0x2A, + + PMBUS_COEFFICIENTS = 0x30, + PMBUS_POUT_MAX = 0x31, + + PMBUS_FAN_CONFIG_12 = 0x3A, + PMBUS_FAN_COMMAND_1 = 0x3B, + PMBUS_FAN_COMMAND_2 = 0x3C, + PMBUS_FAN_CONFIG_34 = 0x3D, + PMBUS_FAN_COMMAND_3 = 0x3E, + PMBUS_FAN_COMMAND_4 = 0x3F, + + PMBUS_VOUT_OV_FAULT_LIMIT = 0x40, + PMBUS_VOUT_OV_FAULT_RESPONSE = 0x41, + PMBUS_VOUT_OV_WARN_LIMIT = 0x42, + PMBUS_VOUT_UV_WARN_LIMIT = 0x43, + PMBUS_VOUT_UV_FAULT_LIMIT = 0x44, + PMBUS_VOUT_UV_FAULT_RESPONSE = 0x45, + PMBUS_IOUT_OC_FAULT_LIMIT = 0x46, + PMBUS_IOUT_OC_FAULT_RESPONSE = 0x47, + PMBUS_IOUT_OC_LV_FAULT_LIMIT = 0x48, + PMBUS_IOUT_OC_LV_FAULT_RESPONSE = 0x49, + PMBUS_IOUT_OC_WARN_LIMIT = 0x4A, + PMBUS_IOUT_UC_FAULT_LIMIT = 0x4B, + PMBUS_IOUT_UC_FAULT_RESPONSE = 0x4C, + + PMBUS_OT_FAULT_LIMIT = 0x4F, + PMBUS_OT_FAULT_RESPONSE = 0x50, + PMBUS_OT_WARN_LIMIT = 0x51, + PMBUS_UT_WARN_LIMIT = 0x52, + PMBUS_UT_FAULT_LIMIT = 0x53, + PMBUS_UT_FAULT_RESPONSE = 0x54, + PMBUS_VIN_OV_FAULT_LIMIT = 0x55, + PMBUS_VIN_OV_FAULT_RESPONSE = 0x56, + PMBUS_VIN_OV_WARN_LIMIT = 0x57, + PMBUS_VIN_UV_WARN_LIMIT = 0x58, + PMBUS_VIN_UV_FAULT_LIMIT = 0x59, + + PMBUS_IIN_OC_FAULT_LIMIT = 0x5B, + PMBUS_IIN_OC_WARN_LIMIT = 0x5D, + + PMBUS_POUT_OP_FAULT_LIMIT = 0x68, + PMBUS_POUT_OP_WARN_LIMIT = 0x6A, + PMBUS_PIN_OP_WARN_LIMIT = 0x6B, + + PMBUS_STATUS_BYTE = 0x78, + PMBUS_STATUS_WORD = 0x79, + PMBUS_STATUS_VOUT = 0x7A, + PMBUS_STATUS_IOUT = 0x7B, + PMBUS_STATUS_INPUT = 0x7C, + PMBUS_STATUS_TEMPERATURE = 0x7D, + PMBUS_STATUS_CML = 0x7E, + PMBUS_STATUS_OTHER = 0x7F, + PMBUS_STATUS_MFR_SPECIFIC = 0x80, + PMBUS_STATUS_FAN_12 = 0x81, + PMBUS_STATUS_FAN_34 = 0x82, + + PMBUS_READ_VIN = 0x88, + PMBUS_READ_IIN = 0x89, + PMBUS_READ_VCAP = 0x8A, + PMBUS_READ_VOUT = 0x8B, + PMBUS_READ_IOUT = 0x8C, + PMBUS_READ_TEMPERATURE_1 = 0x8D, + PMBUS_READ_TEMPERATURE_2 = 0x8E, + PMBUS_READ_TEMPERATURE_3 = 0x8F, + PMBUS_READ_FAN_SPEED_1 = 0x90, + PMBUS_READ_FAN_SPEED_2 = 0x91, + PMBUS_READ_FAN_SPEED_3 = 0x92, + PMBUS_READ_FAN_SPEED_4 = 0x93, + PMBUS_READ_DUTY_CYCLE = 0x94, + PMBUS_READ_FREQUENCY = 0x95, + PMBUS_READ_POUT = 0x96, + PMBUS_READ_PIN = 0x97, + + PMBUS_REVISION = 0x98, + PMBUS_MFR_ID = 0x99, + PMBUS_MFR_MODEL = 0x9A, + PMBUS_MFR_REVISION = 0x9B, + PMBUS_MFR_LOCATION = 0x9C, + PMBUS_MFR_DATE = 0x9D, + PMBUS_MFR_SERIAL = 0x9E, + + PMBUS_MFR_VIN_MIN = 0xA0, + PMBUS_MFR_VIN_MAX = 0xA1, + PMBUS_MFR_IIN_MAX = 0xA2, + PMBUS_MFR_PIN_MAX = 0xA3, + PMBUS_MFR_VOUT_MIN = 0xA4, + PMBUS_MFR_VOUT_MAX = 0xA5, + PMBUS_MFR_IOUT_MAX = 0xA6, + PMBUS_MFR_POUT_MAX = 0xA7, + + PMBUS_IC_DEVICE_ID = 0xAD, + PMBUS_IC_DEVICE_REV = 0xAE, + + PMBUS_MFR_MAX_TEMP_1 = 0xC0, + PMBUS_MFR_MAX_TEMP_2 = 0xC1, + PMBUS_MFR_MAX_TEMP_3 = 0xC2, + +/* + * Virtual registers. + * Useful to support attributes which are not supported by standard PMBus + * registers but exist as manufacturer specific registers on individual chips. + * Must be mapped to real registers in device specific code. + * + * Semantics: + * Virtual registers are all word size. + * READ registers are read-only; writes are either ignored or return an error. + * RESET registers are read/write. Reading reset registers returns zero + * (used for detection), writing any value causes the associated history to be + * reset. + * Virtual registers have to be handled in device specific driver code. Chip + * driver code returns non-negative register values if a virtual register is + * supported, or a negative error code if not. The chip driver may return + * -ENODATA or any other error code in this case, though an error code other + * than -ENODATA is handled more efficiently and thus preferred. Either case, + * the calling PMBus core code will abort if the chip driver returns an error + * code when reading or writing virtual registers. + */ + PMBUS_VIRT_BASE = 0x100, + PMBUS_VIRT_READ_TEMP_AVG, + PMBUS_VIRT_READ_TEMP_MIN, + PMBUS_VIRT_READ_TEMP_MAX, + PMBUS_VIRT_RESET_TEMP_HISTORY, + PMBUS_VIRT_READ_VIN_AVG, + PMBUS_VIRT_READ_VIN_MIN, + PMBUS_VIRT_READ_VIN_MAX, + PMBUS_VIRT_RESET_VIN_HISTORY, + PMBUS_VIRT_READ_IIN_AVG, + PMBUS_VIRT_READ_IIN_MIN, + PMBUS_VIRT_READ_IIN_MAX, + PMBUS_VIRT_RESET_IIN_HISTORY, + PMBUS_VIRT_READ_PIN_AVG, + PMBUS_VIRT_READ_PIN_MIN, + PMBUS_VIRT_READ_PIN_MAX, + PMBUS_VIRT_RESET_PIN_HISTORY, + PMBUS_VIRT_READ_POUT_AVG, + PMBUS_VIRT_READ_POUT_MIN, + PMBUS_VIRT_READ_POUT_MAX, + PMBUS_VIRT_RESET_POUT_HISTORY, + PMBUS_VIRT_READ_VOUT_AVG, + PMBUS_VIRT_READ_VOUT_MIN, + PMBUS_VIRT_READ_VOUT_MAX, + PMBUS_VIRT_RESET_VOUT_HISTORY, + PMBUS_VIRT_READ_IOUT_AVG, + PMBUS_VIRT_READ_IOUT_MIN, + PMBUS_VIRT_READ_IOUT_MAX, + PMBUS_VIRT_RESET_IOUT_HISTORY, + PMBUS_VIRT_READ_TEMP2_AVG, + PMBUS_VIRT_READ_TEMP2_MIN, + PMBUS_VIRT_READ_TEMP2_MAX, + PMBUS_VIRT_RESET_TEMP2_HISTORY, + + PMBUS_VIRT_READ_VMON, + PMBUS_VIRT_VMON_UV_WARN_LIMIT, + PMBUS_VIRT_VMON_OV_WARN_LIMIT, + PMBUS_VIRT_VMON_UV_FAULT_LIMIT, + PMBUS_VIRT_VMON_OV_FAULT_LIMIT, + PMBUS_VIRT_STATUS_VMON, + + /* + * RPM and PWM Fan control + * + * Drivers wanting to expose PWM control must define the behaviour of + * PMBUS_VIRT_PWM_[1-4] and PMBUS_VIRT_PWM_ENABLE_[1-4] in the + * {read,write}_word_data callback. + * + * pmbus core provides a default implementation for + * PMBUS_VIRT_FAN_TARGET_[1-4]. + * + * TARGET, PWM and PWM_ENABLE members must be defined sequentially; + * pmbus core uses the difference between the provided register and + * it's _1 counterpart to calculate the FAN/PWM ID. + */ + PMBUS_VIRT_FAN_TARGET_1, + PMBUS_VIRT_FAN_TARGET_2, + PMBUS_VIRT_FAN_TARGET_3, + PMBUS_VIRT_FAN_TARGET_4, + PMBUS_VIRT_PWM_1, + PMBUS_VIRT_PWM_2, + PMBUS_VIRT_PWM_3, + PMBUS_VIRT_PWM_4, + PMBUS_VIRT_PWM_ENABLE_1, + PMBUS_VIRT_PWM_ENABLE_2, + PMBUS_VIRT_PWM_ENABLE_3, + PMBUS_VIRT_PWM_ENABLE_4, + + /* Samples for average + * + * Drivers wanting to expose functionality for changing the number of + * samples used for average values should implement support in + * {read,write}_word_data callback for either PMBUS_VIRT_SAMPLES if it + * applies to all types of measurements, or any number of specific + * PMBUS_VIRT_*_SAMPLES registers to allow for individual control. + */ + PMBUS_VIRT_SAMPLES, + PMBUS_VIRT_IN_SAMPLES, + PMBUS_VIRT_CURR_SAMPLES, + PMBUS_VIRT_POWER_SAMPLES, + PMBUS_VIRT_TEMP_SAMPLES, +}; + +/* + * OPERATION + */ +#define PB_OPERATION_CONTROL_ON BIT(7) + +/* + * WRITE_PROTECT + */ +#define PB_WP_ALL BIT(7) /* all but WRITE_PROTECT */ +#define PB_WP_OP BIT(6) /* all but WP, OPERATION, PAGE */ +#define PB_WP_VOUT BIT(5) /* all but WP, OPERATION, PAGE, VOUT, ON_OFF */ + +#define PB_WP_ANY (PB_WP_ALL | PB_WP_OP | PB_WP_VOUT) + +/* + * CAPABILITY + */ +#define PB_CAPABILITY_SMBALERT BIT(4) +#define PB_CAPABILITY_ERROR_CHECK BIT(7) + +/* + * VOUT_MODE + */ +#define PB_VOUT_MODE_MODE_MASK 0xe0 +#define PB_VOUT_MODE_PARAM_MASK 0x1f + +#define PB_VOUT_MODE_LINEAR 0x00 +#define PB_VOUT_MODE_VID 0x20 +#define PB_VOUT_MODE_DIRECT 0x40 + +/* + * Fan configuration + */ +#define PB_FAN_2_PULSE_MASK (BIT(0) | BIT(1)) +#define PB_FAN_2_RPM BIT(2) +#define PB_FAN_2_INSTALLED BIT(3) +#define PB_FAN_1_PULSE_MASK (BIT(4) | BIT(5)) +#define PB_FAN_1_RPM BIT(6) +#define PB_FAN_1_INSTALLED BIT(7) + +enum pmbus_fan_mode { percent = 0, rpm }; + +/* + * STATUS_BYTE, STATUS_WORD (lower) + */ +#define PB_STATUS_NONE_ABOVE BIT(0) +#define PB_STATUS_CML BIT(1) +#define PB_STATUS_TEMPERATURE BIT(2) +#define PB_STATUS_VIN_UV BIT(3) +#define PB_STATUS_IOUT_OC BIT(4) +#define PB_STATUS_VOUT_OV BIT(5) +#define PB_STATUS_OFF BIT(6) +#define PB_STATUS_BUSY BIT(7) + +/* + * STATUS_WORD (upper) + */ +#define PB_STATUS_UNKNOWN BIT(8) +#define PB_STATUS_OTHER BIT(9) +#define PB_STATUS_FANS BIT(10) +#define PB_STATUS_POWER_GOOD_N BIT(11) +#define PB_STATUS_WORD_MFR BIT(12) +#define PB_STATUS_INPUT BIT(13) +#define PB_STATUS_IOUT_POUT BIT(14) +#define PB_STATUS_VOUT BIT(15) + +/* + * STATUS_IOUT + */ +#define PB_POUT_OP_WARNING BIT(0) +#define PB_POUT_OP_FAULT BIT(1) +#define PB_POWER_LIMITING BIT(2) +#define PB_CURRENT_SHARE_FAULT BIT(3) +#define PB_IOUT_UC_FAULT BIT(4) +#define PB_IOUT_OC_WARNING BIT(5) +#define PB_IOUT_OC_LV_FAULT BIT(6) +#define PB_IOUT_OC_FAULT BIT(7) + +/* + * STATUS_VOUT, STATUS_INPUT + */ +#define PB_VOLTAGE_UV_FAULT BIT(4) +#define PB_VOLTAGE_UV_WARNING BIT(5) +#define PB_VOLTAGE_OV_WARNING BIT(6) +#define PB_VOLTAGE_OV_FAULT BIT(7) + +/* + * STATUS_INPUT + */ +#define PB_PIN_OP_WARNING BIT(0) +#define PB_IIN_OC_WARNING BIT(1) +#define PB_IIN_OC_FAULT BIT(2) + +/* + * STATUS_TEMPERATURE + */ +#define PB_TEMP_UT_FAULT BIT(4) +#define PB_TEMP_UT_WARNING BIT(5) +#define PB_TEMP_OT_WARNING BIT(6) +#define PB_TEMP_OT_FAULT BIT(7) + +/* + * STATUS_FAN + */ +#define PB_FAN_AIRFLOW_WARNING BIT(0) +#define PB_FAN_AIRFLOW_FAULT BIT(1) +#define PB_FAN_FAN2_SPEED_OVERRIDE BIT(2) +#define PB_FAN_FAN1_SPEED_OVERRIDE BIT(3) +#define PB_FAN_FAN2_WARNING BIT(4) +#define PB_FAN_FAN1_WARNING BIT(5) +#define PB_FAN_FAN2_FAULT BIT(6) +#define PB_FAN_FAN1_FAULT BIT(7) + +/* + * CML_FAULT_STATUS + */ +#define PB_CML_FAULT_OTHER_MEM_LOGIC BIT(0) +#define PB_CML_FAULT_OTHER_COMM BIT(1) +#define PB_CML_FAULT_PROCESSOR BIT(3) +#define PB_CML_FAULT_MEMORY BIT(4) +#define PB_CML_FAULT_PACKET_ERROR BIT(5) +#define PB_CML_FAULT_INVALID_DATA BIT(6) +#define PB_CML_FAULT_INVALID_COMMAND BIT(7) + +enum pmbus_sensor_classes { + PSC_VOLTAGE_IN = 0, + PSC_VOLTAGE_OUT, + PSC_CURRENT_IN, + PSC_CURRENT_OUT, + PSC_POWER, + PSC_TEMPERATURE, + PSC_FAN, + PSC_PWM, + PSC_NUM_CLASSES /* Number of power sensor classes */ +}; + +#define PMBUS_PAGES 32 /* Per PMBus specification */ +#define PMBUS_PHASES 8 /* Maximum number of phases per page */ + +/* Functionality bit mask */ +#define PMBUS_HAVE_VIN BIT(0) +#define PMBUS_HAVE_VCAP BIT(1) +#define PMBUS_HAVE_VOUT BIT(2) +#define PMBUS_HAVE_IIN BIT(3) +#define PMBUS_HAVE_IOUT BIT(4) +#define PMBUS_HAVE_PIN BIT(5) +#define PMBUS_HAVE_POUT BIT(6) +#define PMBUS_HAVE_FAN12 BIT(7) +#define PMBUS_HAVE_FAN34 BIT(8) +#define PMBUS_HAVE_TEMP BIT(9) +#define PMBUS_HAVE_TEMP2 BIT(10) +#define PMBUS_HAVE_TEMP3 BIT(11) +#define PMBUS_HAVE_STATUS_VOUT BIT(12) +#define PMBUS_HAVE_STATUS_IOUT BIT(13) +#define PMBUS_HAVE_STATUS_INPUT BIT(14) +#define PMBUS_HAVE_STATUS_TEMP BIT(15) +#define PMBUS_HAVE_STATUS_FAN12 BIT(16) +#define PMBUS_HAVE_STATUS_FAN34 BIT(17) +#define PMBUS_HAVE_VMON BIT(18) +#define PMBUS_HAVE_STATUS_VMON BIT(19) +#define PMBUS_HAVE_PWM12 BIT(20) +#define PMBUS_HAVE_PWM34 BIT(21) +#define PMBUS_HAVE_SAMPLES BIT(22) + +#define PMBUS_PHASE_VIRTUAL BIT(30) /* Phases on this page are virtual */ +#define PMBUS_PAGE_VIRTUAL BIT(31) /* Page is virtual */ + +enum pmbus_data_format { linear = 0, direct, vid }; +enum vrm_version { vr11 = 0, vr12, vr13, imvp9, amd625mv }; + +struct pmbus_driver_info { + int pages; /* Total number of pages */ + u8 phases[PMBUS_PAGES]; /* Number of phases per page */ + enum pmbus_data_format format[PSC_NUM_CLASSES]; + enum vrm_version vrm_version[PMBUS_PAGES]; /* vrm version per page */ + /* + * Support one set of coefficients for each sensor type + * Used for chips providing data in direct mode. + */ + int m[PSC_NUM_CLASSES]; /* mantissa for direct data format */ + int b[PSC_NUM_CLASSES]; /* offset */ + int R[PSC_NUM_CLASSES]; /* exponent */ + + u32 func[PMBUS_PAGES]; /* Functionality, per page */ + u32 pfunc[PMBUS_PHASES];/* Functionality, per phase */ + /* + * The following functions map manufacturing specific register values + * to PMBus standard register values. Specify only if mapping is + * necessary. + * Functions return the register value (read) or zero (write) if + * successful. A return value of -ENODATA indicates that there is no + * manufacturer specific register, but that a standard PMBus register + * may exist. Any other negative return value indicates that the + * register does not exist, and that no attempt should be made to read + * the standard register. + */ + int (*read_byte_data)(struct i2c_client *client, int page, int reg); + int (*read_word_data)(struct i2c_client *client, int page, int phase, + int reg); + int (*write_word_data)(struct i2c_client *client, int page, int reg, + u16 word); + int (*write_byte)(struct i2c_client *client, int page, u8 value); + /* + * The identify function determines supported PMBus functionality. + * This function is only necessary if a chip driver supports multiple + * chips, and the chip functionality is not pre-determined. + */ + int (*identify)(struct i2c_client *client, + struct pmbus_driver_info *info); + + /* Regulator functionality, if supported by this chip driver. */ + int num_regulators; + const struct regulator_desc *reg_desc; + + /* custom attributes */ + const struct attribute_group **groups; +}; + +/* Regulator ops */ + +extern const struct regulator_ops wb_pmbus_regulator_ops; + +/* Macro for filling in array of struct regulator_desc */ +#define PMBUS_REGULATOR(_name, _id) \ + [_id] = { \ + .name = (_name # _id), \ + .id = (_id), \ + .of_match = of_match_ptr(_name # _id), \ + .regulators_node = of_match_ptr("regulators"), \ + .ops = &wb_pmbus_regulator_ops, \ + .type = REGULATOR_VOLTAGE, \ + .owner = THIS_MODULE, \ + } + +struct pmbus_data { + struct device *dev; + struct device *hwmon_dev; + + u32 flags; /* from platform data */ + + int exponent[PMBUS_PAGES]; /* linear mode: exponent for output voltages */ + + const struct pmbus_driver_info *info; + + int max_attributes; + int num_attributes; + struct attribute_group group; + const struct attribute_group **groups; + struct dentry *debugfs; /* debugfs device directory */ + + struct pmbus_sensor *sensors; + + struct mutex update_lock; + + bool has_status_word; /* device uses STATUS_WORD register */ + int (*read_status)(struct i2c_client *client, int page); + + s16 currpage; /* current page, -1 for unknown/unset */ + s16 currphase; /* current phase, 0xff for all, -1 for unknown/unset */ + int vout_max[PMBUS_PAGES]; /* pmbus maximum output voltage */ + int vout_min[PMBUS_PAGES]; /* pmbus minimum output voltage */ +}; + +/* Function declarations */ +void wb_pmbus_clear_cache(struct i2c_client *client); +int wb_pmbus_set_page(struct i2c_client *client, int page, int phase); +int wb_pmbus_read_word_data(struct i2c_client *client, int page, int phase, + u8 reg); +int wb_pmbus_write_word_data(struct i2c_client *client, int page, u8 reg, + u16 word); +int wb_pmbus_read_byte_data(struct i2c_client *client, int page, u8 reg); +int wb_pmbus_write_byte(struct i2c_client *client, int page, u8 value); +int wb_pmbus_write_byte_data(struct i2c_client *client, int page, u8 reg, + u8 value); +int wb_pmbus_update_byte_data(struct i2c_client *client, int page, u8 reg, + u8 mask, u8 value); +void wb_pmbus_clear_faults(struct i2c_client *client); +bool wb_pmbus_check_byte_register(struct i2c_client *client, int page, int reg); +bool wb_pmbus_check_word_register(struct i2c_client *client, int page, int reg); +int wb_pmbus_do_probe(struct i2c_client *client, struct pmbus_driver_info *info); +void wb_pmbus_do_remove(struct i2c_client *client); +const struct pmbus_driver_info *wb_pmbus_get_driver_info(struct i2c_client + *client); +int wb_pmbus_get_fan_rate_device(struct i2c_client *client, int page, int id, + enum pmbus_fan_mode mode); +int wb_pmbus_get_fan_rate_cached(struct i2c_client *client, int page, int id, + enum pmbus_fan_mode mode); +int wb_pmbus_update_fan(struct i2c_client *client, int page, int id, + u8 config, u8 mask, u16 command); +struct dentry *wb_pmbus_get_debugfs_dir(struct i2c_client *client); + +#endif /* WB_PMBUS_H */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_pmbus_core.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_pmbus_core.c new file mode 100644 index 000000000000..3a86ade43b7e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_pmbus_core.c @@ -0,0 +1,2780 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Hardware monitoring driver for PMBus devices + * + * Copyright (c) 2010, 2011 Ericsson AB. + * Copyright (c) 2012 Guenter Roeck + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "wb_pmbus.h" + +/* + * Number of additional attribute pointers to allocate + * with each call to krealloc + */ +#define PMBUS_ATTR_ALLOC_SIZE (32) +#define PMBUS_NAME_SIZE (24) +#define PMBUS_RETRY_SLEEP_TIME (10000) /* 10ms */ +#define PMBUS_RETRY_TIME (3) + +struct pmbus_sensor { + struct pmbus_sensor *next; + char name[PMBUS_NAME_SIZE]; /* sysfs sensor name */ + struct device_attribute attribute; + u8 page; /* page number */ + u8 phase; /* phase number, 0xff for all phases */ + u16 reg; /* register */ + enum pmbus_sensor_classes class; /* sensor class */ + bool update; /* runtime sensor update needed */ + bool convert; /* Whether or not to apply linear/vid/direct */ + int data; /* Sensor data. + Negative if there was a read error */ +}; +#define to_pmbus_sensor(_attr) \ + container_of(_attr, struct pmbus_sensor, attribute) + +struct pmbus_boolean { + char name[PMBUS_NAME_SIZE]; /* sysfs boolean name */ + struct sensor_device_attribute attribute; + struct pmbus_sensor *s1; + struct pmbus_sensor *s2; +}; +#define to_pmbus_boolean(_attr) \ + container_of(_attr, struct pmbus_boolean, attribute) + +struct pmbus_label { + char name[PMBUS_NAME_SIZE]; /* sysfs label name */ + struct device_attribute attribute; + char label[PMBUS_NAME_SIZE]; /* label */ +}; +#define to_pmbus_label(_attr) \ + container_of(_attr, struct pmbus_label, attribute) + +/* Macros for converting between sensor index and register/page/status mask */ + +#define PB_STATUS_MASK 0xffff +#define PB_REG_SHIFT 16 +#define PB_REG_MASK 0x3ff +#define PB_PAGE_SHIFT 26 +#define PB_PAGE_MASK 0x3f + +#define pb_reg_to_index(page, reg, mask) (((page) << PB_PAGE_SHIFT) | \ + ((reg) << PB_REG_SHIFT) | (mask)) + +#define pb_index_to_page(index) (((index) >> PB_PAGE_SHIFT) & PB_PAGE_MASK) +#define pb_index_to_reg(index) (((index) >> PB_REG_SHIFT) & PB_REG_MASK) +#define pb_index_to_mask(index) ((index) & PB_STATUS_MASK) + +struct pmbus_debugfs_entry { + struct i2c_client *client; + u8 page; + u8 reg; +}; + +static const int pmbus_fan_rpm_mask[] = { + PB_FAN_1_RPM, + PB_FAN_2_RPM, + PB_FAN_1_RPM, + PB_FAN_2_RPM, +}; + +static const int pmbus_fan_config_registers[] = { + PMBUS_FAN_CONFIG_12, + PMBUS_FAN_CONFIG_12, + PMBUS_FAN_CONFIG_34, + PMBUS_FAN_CONFIG_34 +}; + +static const int pmbus_fan_command_registers[] = { + PMBUS_FAN_COMMAND_1, + PMBUS_FAN_COMMAND_2, + PMBUS_FAN_COMMAND_3, + PMBUS_FAN_COMMAND_4, +}; + +void wb_pmbus_clear_cache(struct i2c_client *client) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + struct pmbus_sensor *sensor; + + for (sensor = data->sensors; sensor; sensor = sensor->next) + sensor->data = -ENODATA; +} +EXPORT_SYMBOL_GPL(wb_pmbus_clear_cache); + +static int wb_pmbus_set_page_tmp(struct i2c_client *client, int page, int phase) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + int rv; + + if (page < 0) + return 0; + + if (!(data->info->func[page] & PMBUS_PAGE_VIRTUAL) && + data->info->pages > 1 && page != data->currpage) { + rv = i2c_smbus_write_byte_data(client, PMBUS_PAGE, page); + if (rv < 0) + return rv; + + rv = i2c_smbus_read_byte_data(client, PMBUS_PAGE); + if (rv < 0) + return rv; + + if (rv != page) + return -EIO; + } + data->currpage = page; + + if (data->info->phases[page] && data->currphase != phase && + !(data->info->func[page] & PMBUS_PHASE_VIRTUAL)) { + rv = i2c_smbus_write_byte_data(client, PMBUS_PHASE, + phase); + if (rv) + return rv; + } + data->currphase = phase; + + return 0; +} + +int wb_pmbus_set_page(struct i2c_client *client, int page, int phase) +{ + int rv, i; + struct device *dev = &client->dev; + + for (i = 0; i < PMBUS_RETRY_TIME; i++) { + rv = wb_pmbus_set_page_tmp(client, page, phase); + if(rv >= 0){ + return rv; + } + if ((i + 1) < PMBUS_RETRY_TIME) { + usleep_range(PMBUS_RETRY_SLEEP_TIME, PMBUS_RETRY_SLEEP_TIME + 1); + } + } + dev_dbg(dev, "wb_pmbus_set_page failed, page=%d, phase=%d, rv=%d\n", + page, phase, rv); + return rv; +} +EXPORT_SYMBOL_GPL(wb_pmbus_set_page); + +static int wb_pmbus_write_byte_tmp(struct i2c_client *client, int page, u8 value) +{ + int rv; + + rv = wb_pmbus_set_page(client, page, 0xff); + if (rv < 0) + return rv; + + return i2c_smbus_write_byte(client, value); +} + +int wb_pmbus_write_byte(struct i2c_client *client, int page, u8 value) +{ + int rv, i; + struct device *dev = &client->dev; + + for (i = 0; i < PMBUS_RETRY_TIME; i++) { + rv = wb_pmbus_write_byte_tmp(client, page, value); + if(rv >= 0){ + return rv; + } + if ((i + 1) < PMBUS_RETRY_TIME) { + usleep_range(PMBUS_RETRY_SLEEP_TIME, PMBUS_RETRY_SLEEP_TIME + 1); + } + } + dev_dbg(dev, "wb_pmbus_write_byte failed, page=%d, value=0x%x, rv: %d\n", + page, value, rv); + return rv; +} + +EXPORT_SYMBOL_GPL(wb_pmbus_write_byte); + +/* + * _pmbus_write_byte() is similar to pmbus_write_byte(), but checks if + * a device specific mapping function exists and calls it if necessary. + */ +static int _pmbus_write_byte(struct i2c_client *client, int page, u8 value) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + const struct pmbus_driver_info *info = data->info; + int status; + + if (info->write_byte) { + status = info->write_byte(client, page, value); + if (status != -ENODATA) + return status; + } + return wb_pmbus_write_byte(client, page, value); +} + +static int wb_pmbus_write_word_data_tmp(struct i2c_client *client, int page, u8 reg, + u16 word) +{ + int rv; + + rv = wb_pmbus_set_page(client, page, 0xff); + if (rv < 0) + return rv; + + return i2c_smbus_write_word_data(client, reg, word); +} + +int wb_pmbus_write_word_data(struct i2c_client *client, int page, u8 reg, + u16 word) +{ + int rv, i; + struct device *dev = &client->dev; + + for (i = 0; i < PMBUS_RETRY_TIME; i++) { + rv = wb_pmbus_write_word_data_tmp(client, page, reg, word); + if(rv >= 0){ + return rv; + } + if ((i + 1) < PMBUS_RETRY_TIME) { + usleep_range(PMBUS_RETRY_SLEEP_TIME, PMBUS_RETRY_SLEEP_TIME + 1); + } + } + dev_dbg(dev, "wb_pmbus_write_word_data failed, page: %d, reg: 0x%x, value: 0x%x, rv: %d\n", + page, reg, word, rv); + return rv; + +} +EXPORT_SYMBOL_GPL(wb_pmbus_write_word_data); + +static int pmbus_write_virt_reg(struct i2c_client *client, int page, int reg, + u16 word) +{ + int bit; + int id; + int rv; + + switch (reg) { + case PMBUS_VIRT_FAN_TARGET_1 ... PMBUS_VIRT_FAN_TARGET_4: + id = reg - PMBUS_VIRT_FAN_TARGET_1; + bit = pmbus_fan_rpm_mask[id]; + rv = wb_pmbus_update_fan(client, page, id, bit, bit, word); + break; + default: + rv = -ENXIO; + break; + } + + return rv; +} + +/* + * _pmbus_write_word_data() is similar to pmbus_write_word_data(), but checks if + * a device specific mapping function exists and calls it if necessary. + */ +static int _pmbus_write_word_data(struct i2c_client *client, int page, int reg, + u16 word) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + const struct pmbus_driver_info *info = data->info; + int status; + + if (info->write_word_data) { + status = info->write_word_data(client, page, reg, word); + if (status != -ENODATA) + return status; + } + + if (reg >= PMBUS_VIRT_BASE) + return pmbus_write_virt_reg(client, page, reg, word); + + return wb_pmbus_write_word_data(client, page, reg, word); +} + +int wb_pmbus_update_fan(struct i2c_client *client, int page, int id, + u8 config, u8 mask, u16 command) +{ + int from; + int rv; + u8 to; + + from = wb_pmbus_read_byte_data(client, page, + pmbus_fan_config_registers[id]); + if (from < 0) + return from; + + to = (from & ~mask) | (config & mask); + if (to != from) { + rv = wb_pmbus_write_byte_data(client, page, + pmbus_fan_config_registers[id], to); + if (rv < 0) + return rv; + } + + return _pmbus_write_word_data(client, page, + pmbus_fan_command_registers[id], command); +} +EXPORT_SYMBOL_GPL(wb_pmbus_update_fan); + +static int wb_pmbus_read_word_data_tmp(struct i2c_client *client, int page, int phase, u8 reg) +{ + int rv; + + rv = wb_pmbus_set_page(client, page, phase); + if (rv < 0) + return rv; + + return i2c_smbus_read_word_data(client, reg); +} + +int wb_pmbus_read_word_data(struct i2c_client *client, int page, int phase, u8 reg) +{ + int rv, i; + struct device *dev = &client->dev; + + for (i = 0; i < PMBUS_RETRY_TIME; i++) { + rv = wb_pmbus_read_word_data_tmp(client, page, phase, reg); + if(rv >= 0){ + return rv; + } + if ((i + 1) < PMBUS_RETRY_TIME) { + usleep_range(PMBUS_RETRY_SLEEP_TIME, PMBUS_RETRY_SLEEP_TIME + 1); + } + } + dev_dbg(dev, "wb_pmbus_read_word_data failed, page: %d, phase: %d, reg: 0x%x, rv: %d\n", + page, phase, reg, rv); + return rv; +} +EXPORT_SYMBOL_GPL(wb_pmbus_read_word_data); + +static int pmbus_read_virt_reg(struct i2c_client *client, int page, int reg) +{ + int rv; + int id; + + switch (reg) { + case PMBUS_VIRT_FAN_TARGET_1 ... PMBUS_VIRT_FAN_TARGET_4: + id = reg - PMBUS_VIRT_FAN_TARGET_1; + rv = wb_pmbus_get_fan_rate_device(client, page, id, rpm); + break; + default: + rv = -ENXIO; + break; + } + + return rv; +} + +/* + * _pmbus_read_word_data() is similar to wb_pmbus_read_word_data(), but checks if + * a device specific mapping function exists and calls it if necessary. + */ +static int _pmbus_read_word_data(struct i2c_client *client, int page, + int phase, int reg) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + const struct pmbus_driver_info *info = data->info; + int status; + + if (info->read_word_data) { + status = info->read_word_data(client, page, phase, reg); + if (status != -ENODATA) + return status; + } + + if (reg >= PMBUS_VIRT_BASE) + return pmbus_read_virt_reg(client, page, reg); + + return wb_pmbus_read_word_data(client, page, phase, reg); +} + +/* Same as above, but without phase parameter, for use in check functions */ +static int __pmbus_read_word_data(struct i2c_client *client, int page, int reg) +{ + return _pmbus_read_word_data(client, page, 0xff, reg); +} + +static int wb_pmbus_read_byte_data_tmp(struct i2c_client *client, int page, u8 reg) +{ + int rv; + + rv = wb_pmbus_set_page(client, page, 0xff); + if (rv < 0) + return rv; + + return i2c_smbus_read_byte_data(client, reg); +} + +int wb_pmbus_read_byte_data(struct i2c_client *client, int page, u8 reg) +{ + int rv, i; + struct device *dev = &client->dev; + + for (i = 0; i < PMBUS_RETRY_TIME; i++) { + rv = wb_pmbus_read_byte_data_tmp(client, page, reg); + if(rv >= 0){ + return rv; + } + if ((i + 1) < PMBUS_RETRY_TIME) { + usleep_range(PMBUS_RETRY_SLEEP_TIME, PMBUS_RETRY_SLEEP_TIME + 1); + } + } + dev_dbg(dev, "wb_pmbus_read_byte_data failed, page: %d, reg: 0x%x, rv: %d\n", + page, reg, rv); + return rv; +} +EXPORT_SYMBOL_GPL(wb_pmbus_read_byte_data); + +static int wb_pmbus_write_byte_data_tmp(struct i2c_client *client, int page, u8 reg, u8 value) +{ + int rv; + + rv = wb_pmbus_set_page(client, page, 0xff); + if (rv < 0) + return rv; + + return i2c_smbus_write_byte_data(client, reg, value); +} + +int wb_pmbus_write_byte_data(struct i2c_client *client, int page, u8 reg, u8 value) +{ + int rv, i; + struct device *dev = &client->dev; + + for (i = 0; i < PMBUS_RETRY_TIME; i++) { + rv = wb_pmbus_write_byte_data_tmp(client, page, reg, value); + if(rv >= 0){ + return rv; + } + if ((i + 1) < PMBUS_RETRY_TIME) { + usleep_range(PMBUS_RETRY_SLEEP_TIME, PMBUS_RETRY_SLEEP_TIME + 1); + } + } + dev_dbg(dev, "wb_pmbus_write_byte_data failed, page: %d, reg: 0x%x, value: 0x%x, rv: %d\n", + page, reg, value, rv); + return rv; +} +EXPORT_SYMBOL_GPL(wb_pmbus_write_byte_data); + +int wb_pmbus_update_byte_data(struct i2c_client *client, int page, u8 reg, + u8 mask, u8 value) +{ + unsigned int tmp; + int rv; + + rv = wb_pmbus_read_byte_data(client, page, reg); + if (rv < 0) + return rv; + + tmp = (rv & ~mask) | (value & mask); + + if (tmp != rv) + rv = wb_pmbus_write_byte_data(client, page, reg, tmp); + + return rv; +} +EXPORT_SYMBOL_GPL(wb_pmbus_update_byte_data); + +/* + * _pmbus_read_byte_data() is similar to wb_pmbus_read_byte_data(), but checks if + * a device specific mapping function exists and calls it if necessary. + */ +static int _pmbus_read_byte_data(struct i2c_client *client, int page, int reg) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + const struct pmbus_driver_info *info = data->info; + int status; + + if (info->read_byte_data) { + status = info->read_byte_data(client, page, reg); + if (status != -ENODATA) + return status; + } + return wb_pmbus_read_byte_data(client, page, reg); +} + +static struct pmbus_sensor *pmbus_find_sensor(struct pmbus_data *data, int page, + int reg) +{ + struct pmbus_sensor *sensor; + + for (sensor = data->sensors; sensor; sensor = sensor->next) { + if (sensor->page == page && sensor->reg == reg) + return sensor; + } + + return ERR_PTR(-EINVAL); +} + +static int pmbus_get_fan_rate(struct i2c_client *client, int page, int id, + enum pmbus_fan_mode mode, + bool from_cache) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + bool want_rpm, have_rpm; + struct pmbus_sensor *s; + int config; + int reg; + + want_rpm = (mode == rpm); + + if (from_cache) { + reg = want_rpm ? PMBUS_VIRT_FAN_TARGET_1 : PMBUS_VIRT_PWM_1; + s = pmbus_find_sensor(data, page, reg + id); + if (IS_ERR(s)) + return PTR_ERR(s); + + return s->data; + } + + config = wb_pmbus_read_byte_data(client, page, + pmbus_fan_config_registers[id]); + if (config < 0) + return config; + + have_rpm = !!(config & pmbus_fan_rpm_mask[id]); + if (want_rpm == have_rpm) + return wb_pmbus_read_word_data(client, page, 0xff, + pmbus_fan_command_registers[id]); + + /* Can't sensibly map between RPM and PWM, just return zero */ + return 0; +} + +int wb_pmbus_get_fan_rate_device(struct i2c_client *client, int page, int id, + enum pmbus_fan_mode mode) +{ + return pmbus_get_fan_rate(client, page, id, mode, false); +} +EXPORT_SYMBOL_GPL(wb_pmbus_get_fan_rate_device); + +int wb_pmbus_get_fan_rate_cached(struct i2c_client *client, int page, int id, + enum pmbus_fan_mode mode) +{ + return pmbus_get_fan_rate(client, page, id, mode, true); +} +EXPORT_SYMBOL_GPL(wb_pmbus_get_fan_rate_cached); + +static void pmbus_clear_fault_page(struct i2c_client *client, int page) +{ + _pmbus_write_byte(client, page, PMBUS_CLEAR_FAULTS); +} + +void wb_pmbus_clear_faults(struct i2c_client *client) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + int i; + + for (i = 0; i < data->info->pages; i++) + pmbus_clear_fault_page(client, i); +} +EXPORT_SYMBOL_GPL(wb_pmbus_clear_faults); + +static int pmbus_check_status_cml(struct i2c_client *client) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + int status, status2; + + status = data->read_status(client, -1); + if (status < 0 || (status & PB_STATUS_CML)) { + status2 = _pmbus_read_byte_data(client, -1, PMBUS_STATUS_CML); + if (status2 < 0 || (status2 & PB_CML_FAULT_INVALID_COMMAND)) + return -EIO; + } + return 0; +} + +static bool pmbus_check_register(struct i2c_client *client, + int (*func)(struct i2c_client *client, + int page, int reg), + int page, int reg) +{ + int rv; + struct pmbus_data *data = i2c_get_clientdata(client); + + rv = func(client, page, reg); + if (rv >= 0 && !(data->flags & PMBUS_SKIP_STATUS_CHECK)) + rv = pmbus_check_status_cml(client); + pmbus_clear_fault_page(client, -1); + return rv >= 0; +} + +static bool pmbus_check_status_register(struct i2c_client *client, int page) +{ + int status; + struct pmbus_data *data = i2c_get_clientdata(client); + + status = data->read_status(client, page); + if (status >= 0 && !(data->flags & PMBUS_SKIP_STATUS_CHECK) && + (status & PB_STATUS_CML)) { + status = _pmbus_read_byte_data(client, -1, PMBUS_STATUS_CML); + if (status < 0 || (status & PB_CML_FAULT_INVALID_COMMAND)) + status = -EIO; + } + + pmbus_clear_fault_page(client, -1); + return status >= 0; +} + +bool wb_pmbus_check_byte_register(struct i2c_client *client, int page, int reg) +{ + return pmbus_check_register(client, _pmbus_read_byte_data, page, reg); +} +EXPORT_SYMBOL_GPL(wb_pmbus_check_byte_register); + +bool wb_pmbus_check_word_register(struct i2c_client *client, int page, int reg) +{ + return pmbus_check_register(client, __pmbus_read_word_data, page, reg); +} +EXPORT_SYMBOL_GPL(wb_pmbus_check_word_register); + +const struct pmbus_driver_info *wb_pmbus_get_driver_info(struct i2c_client *client) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + + return data->info; +} +EXPORT_SYMBOL_GPL(wb_pmbus_get_driver_info); + +static int pmbus_read_status_byte(struct i2c_client *client, int page) +{ + return _pmbus_read_byte_data(client, page, PMBUS_STATUS_BYTE); +} + +static int pmbus_read_status_word(struct i2c_client *client, int page) +{ + return _pmbus_read_word_data(client, page, 0xff, PMBUS_STATUS_WORD); +} + +static int pmbus_get_status(struct i2c_client *client, int page, int reg) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + int status; + + switch (reg) { + case PMBUS_STATUS_WORD: + status = data->read_status(client, page); + if ((status < 0) || (data->has_status_word && (status == 0xffff)) + || (!data->has_status_word && (status == 0xff))) { + if (data->has_status_word) { + data->read_status = pmbus_read_status_byte; + } else { + data->read_status = pmbus_read_status_word; + } + data->has_status_word = !data->has_status_word; + status = data->read_status(client, page); + } + break; + default: + status = _pmbus_read_byte_data(client, page, reg); + break; + } + if (status < 0) + wb_pmbus_clear_faults(client); + return status; +} + +static void pmbus_update_sensor_data(struct i2c_client *client, struct pmbus_sensor *sensor) +{ + if (sensor->data < 0 || sensor->update) + sensor->data = _pmbus_read_word_data(client, sensor->page, + sensor->phase, sensor->reg); +} + +/* + * Convert linear sensor values to milli- or micro-units + * depending on sensor type. + */ +static s64 pmbus_reg2data_linear(struct pmbus_data *data, + struct pmbus_sensor *sensor) +{ + s16 exponent; + s32 mantissa; + s64 val; + + if (sensor->class == PSC_VOLTAGE_OUT) { /* LINEAR16 */ + exponent = data->exponent[sensor->page]; + mantissa = (u16) sensor->data; + } else { /* LINEAR11 */ + exponent = ((s16)sensor->data) >> 11; + mantissa = ((s16)((sensor->data & 0x7ff) << 5)) >> 5; + } + + val = mantissa; + + /* scale result to milli-units for all sensors except fans */ + if (sensor->class != PSC_FAN) + val = val * 1000LL; + + /* scale result to micro-units for power sensors */ + if (sensor->class == PSC_POWER) + val = val * 1000LL; + + if (exponent >= 0) + val <<= exponent; + else + val >>= -exponent; + + return val; +} + +/* + * Convert direct sensor values to milli- or micro-units + * depending on sensor type. + */ +static s64 pmbus_reg2data_direct(struct pmbus_data *data, + struct pmbus_sensor *sensor) +{ + s64 b, val = (s16)sensor->data; + s32 m, R; + + m = data->info->m[sensor->class]; + b = data->info->b[sensor->class]; + R = data->info->R[sensor->class]; + + if (m == 0) + return 0; + + /* X = 1/m * (Y * 10^-R - b) */ + R = -R; + /* scale result to milli-units for everything but fans */ + if (!(sensor->class == PSC_FAN || sensor->class == PSC_PWM)) { + R += 3; + b *= 1000; + } + + /* scale result to micro-units for power sensors */ + if (sensor->class == PSC_POWER) { + R += 3; + b *= 1000; + } + + while (R > 0) { + val *= 10; + R--; + } + while (R < 0) { + val = div_s64(val + 5LL, 10L); /* round closest */ + R++; + } + + val = div_s64(val - b, m); + return val; +} + +/* + * Convert VID sensor values to milli- or micro-units + * depending on sensor type. + */ +static s64 pmbus_reg2data_vid(struct pmbus_data *data, + struct pmbus_sensor *sensor) +{ + long val = sensor->data; + long rv = 0; + + switch (data->info->vrm_version[sensor->page]) { + case vr11: + if (val >= 0x02 && val <= 0xb2) + rv = DIV_ROUND_CLOSEST(160000 - (val - 2) * 625, 100); + break; + case vr12: + if (val >= 0x01) + rv = 250 + (val - 1) * 5; + break; + case vr13: + if (val >= 0x01) + rv = 500 + (val - 1) * 10; + break; + case imvp9: + if (val >= 0x01) + rv = 200 + (val - 1) * 10; + break; + case amd625mv: + if (val >= 0x0 && val <= 0xd8) + rv = DIV_ROUND_CLOSEST(155000 - val * 625, 100); + break; + } + return rv; +} + +static s64 pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor) +{ + s64 val; + + if (!sensor->convert) + return sensor->data; + + switch (data->info->format[sensor->class]) { + case direct: + val = pmbus_reg2data_direct(data, sensor); + break; + case vid: + val = pmbus_reg2data_vid(data, sensor); + break; + case linear: + default: + val = pmbus_reg2data_linear(data, sensor); + break; + } + return val; +} + +#define MAX_MANTISSA (1023 * 1000) +#define MIN_MANTISSA (511 * 1000) + +static u16 pmbus_data2reg_linear(struct pmbus_data *data, + struct pmbus_sensor *sensor, s64 val) +{ + s16 exponent = 0, mantissa; + bool negative = false; + + /* simple case */ + if (val == 0) + return 0; + + if (sensor->class == PSC_VOLTAGE_OUT) { + /* LINEAR16 does not support negative voltages */ + if (val < 0) + return 0; + + /* + * For a static exponents, we don't have a choice + * but to adjust the value to it. + */ + if (data->exponent[sensor->page] < 0) + val <<= -data->exponent[sensor->page]; + else + val >>= data->exponent[sensor->page]; + val = DIV_ROUND_CLOSEST_ULL(val, 1000); + return clamp_val(val, 0, 0xffff); + } + + if (val < 0) { + negative = true; + val = -val; + } + + /* Power is in uW. Convert to mW before converting. */ + if (sensor->class == PSC_POWER) + val = DIV_ROUND_CLOSEST_ULL(val, 1000); + + /* + * For simplicity, convert fan data to milli-units + * before calculating the exponent. + */ + if (sensor->class == PSC_FAN) + val = val * 1000LL; + + /* Reduce large mantissa until it fits into 10 bit */ + while (val >= MAX_MANTISSA && exponent < 15) { + exponent++; + val >>= 1; + } + /* Increase small mantissa to improve precision */ + while (val < MIN_MANTISSA && exponent > -15) { + exponent--; + val <<= 1; + } + + /* Convert mantissa from milli-units to units */ + mantissa = clamp_val(DIV_ROUND_CLOSEST_ULL(val, 1000), 0, 0x3ff); + + /* restore sign */ + if (negative) + mantissa = -mantissa; + + /* Convert to 5 bit exponent, 11 bit mantissa */ + return (mantissa & 0x7ff) | ((exponent << 11) & 0xf800); +} + +static u16 pmbus_data2reg_direct(struct pmbus_data *data, + struct pmbus_sensor *sensor, s64 val) +{ + s64 b; + s32 m, R; + + m = data->info->m[sensor->class]; + b = data->info->b[sensor->class]; + R = data->info->R[sensor->class]; + + /* Power is in uW. Adjust R and b. */ + if (sensor->class == PSC_POWER) { + R -= 3; + b *= 1000; + } + + /* Calculate Y = (m * X + b) * 10^R */ + if (!(sensor->class == PSC_FAN || sensor->class == PSC_PWM)) { + R -= 3; /* Adjust R and b for data in milli-units */ + b *= 1000; + } + val = val * m + b; + + while (R > 0) { + val *= 10; + R--; + } + while (R < 0) { + val = div_s64(val + 5LL, 10L); /* round closest */ + R++; + } + + return (u16)clamp_val(val, S16_MIN, S16_MAX); +} + +static u16 pmbus_data2reg_vid(struct pmbus_data *data, + struct pmbus_sensor *sensor, s64 val) +{ + val = clamp_val(val, 500, 1600); + + return 2 + DIV_ROUND_CLOSEST_ULL((1600LL - val) * 100LL, 625); +} + +static u16 pmbus_data2reg(struct pmbus_data *data, + struct pmbus_sensor *sensor, s64 val) +{ + u16 regval; + + if (!sensor->convert) + return val; + + switch (data->info->format[sensor->class]) { + case direct: + regval = pmbus_data2reg_direct(data, sensor, val); + break; + case vid: + regval = pmbus_data2reg_vid(data, sensor, val); + break; + case linear: + default: + regval = pmbus_data2reg_linear(data, sensor, val); + break; + } + return regval; +} + +/* + * Return boolean calculated from converted data. + * defines a status register index and mask. + * The mask is in the lower 8 bits, the register index is in bits 8..23. + * + * The associated pmbus_boolean structure contains optional pointers to two + * sensor attributes. If specified, those attributes are compared against each + * other to determine if a limit has been exceeded. + * + * If the sensor attribute pointers are NULL, the function returns true if + * (status[reg] & mask) is true. + * + * If sensor attribute pointers are provided, a comparison against a specified + * limit has to be performed to determine the boolean result. + * In this case, the function returns true if v1 >= v2 (where v1 and v2 are + * sensor values referenced by sensor attribute pointers s1 and s2). + * + * To determine if an object exceeds upper limits, specify = . + * To determine if an object exceeds lower limits, specify = . + * + * If a negative value is stored in any of the referenced registers, this value + * reflects an error code which will be returned. + */ +static int pmbus_get_boolean(struct i2c_client *client, struct pmbus_boolean *b, + int index) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + struct pmbus_sensor *s1 = b->s1; + struct pmbus_sensor *s2 = b->s2; + u16 mask = pb_index_to_mask(index); + u8 page = pb_index_to_page(index); + u16 reg = pb_index_to_reg(index); + int ret, status; + u16 regval; + + mutex_lock(&data->update_lock); + status = pmbus_get_status(client, page, reg); + if (status < 0) { + ret = status; + goto unlock; + } + + if (s1) + pmbus_update_sensor_data(client, s1); + if (s2) + pmbus_update_sensor_data(client, s2); + + regval = status & mask; + if (s1 && s2) { + s64 v1, v2; + + if (s1->data < 0) { + ret = s1->data; + goto unlock; + } + if (s2->data < 0) { + ret = s2->data; + goto unlock; + } + + v1 = pmbus_reg2data(data, s1); + v2 = pmbus_reg2data(data, s2); + ret = !!(regval && v1 >= v2); + } else { + ret = !!regval; + } +unlock: + mutex_unlock(&data->update_lock); + return ret; +} + +static ssize_t pmbus_show_boolean(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct pmbus_boolean *boolean = to_pmbus_boolean(attr); + struct i2c_client *client = to_i2c_client(dev->parent); + int val; + + val = pmbus_get_boolean(client, boolean, attr->index); + if (val < 0) + return val; + return snprintf(buf, PAGE_SIZE, "%d\n", val); +} + +static ssize_t pmbus_show_sensor(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct pmbus_sensor *sensor = to_pmbus_sensor(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + ssize_t ret; + + mutex_lock(&data->update_lock); + pmbus_update_sensor_data(client, sensor); + if (sensor->data < 0) + ret = sensor->data; + else + ret = snprintf(buf, PAGE_SIZE, "%lld\n", pmbus_reg2data(data, sensor)); + mutex_unlock(&data->update_lock); + return ret; +} + +static ssize_t pmbus_set_sensor(struct device *dev, + struct device_attribute *devattr, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct pmbus_data *data = i2c_get_clientdata(client); + struct pmbus_sensor *sensor = to_pmbus_sensor(devattr); + ssize_t rv = count; + s64 val; + int ret; + u16 regval; + + if (kstrtos64(buf, 10, &val) < 0) + return -EINVAL; + + mutex_lock(&data->update_lock); + regval = pmbus_data2reg(data, sensor, val); + ret = _pmbus_write_word_data(client, sensor->page, sensor->reg, regval); + if (ret < 0) + rv = ret; + else + sensor->data = regval; + mutex_unlock(&data->update_lock); + return rv; +} + +static ssize_t pmbus_show_label(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct pmbus_label *label = to_pmbus_label(da); + + return snprintf(buf, PAGE_SIZE, "%s\n", label->label); +} + +static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr) +{ + if (data->num_attributes >= data->max_attributes - 1) { + int new_max_attrs = data->max_attributes + PMBUS_ATTR_ALLOC_SIZE; + void *new_attrs = devm_krealloc(data->dev, data->group.attrs, + new_max_attrs * sizeof(void *), + GFP_KERNEL); + if (!new_attrs) + return -ENOMEM; + data->group.attrs = new_attrs; + data->max_attributes = new_max_attrs; + } + + data->group.attrs[data->num_attributes++] = attr; + data->group.attrs[data->num_attributes] = NULL; + return 0; +} + +static void pmbus_dev_attr_init(struct device_attribute *dev_attr, + const char *name, + umode_t mode, + ssize_t (*show)(struct device *dev, + struct device_attribute *attr, + char *buf), + ssize_t (*store)(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count)) +{ + sysfs_attr_init(&dev_attr->attr); + dev_attr->attr.name = name; + dev_attr->attr.mode = mode; + dev_attr->show = show; + dev_attr->store = store; +} + +static void pmbus_attr_init(struct sensor_device_attribute *a, + const char *name, + umode_t mode, + ssize_t (*show)(struct device *dev, + struct device_attribute *attr, + char *buf), + ssize_t (*store)(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count), + int idx) +{ + pmbus_dev_attr_init(&a->dev_attr, name, mode, show, store); + a->index = idx; +} + +static int pmbus_add_boolean(struct pmbus_data *data, + const char *name, const char *type, int seq, + struct pmbus_sensor *s1, + struct pmbus_sensor *s2, + u8 page, u16 reg, u16 mask) +{ + struct pmbus_boolean *boolean; + struct sensor_device_attribute *a; + + if (WARN((s1 && !s2) || (!s1 && s2), "Bad s1/s2 parameters\n")) + return -EINVAL; + + boolean = devm_kzalloc(data->dev, sizeof(*boolean), GFP_KERNEL); + if (!boolean) + return -ENOMEM; + + a = &boolean->attribute; + + snprintf(boolean->name, sizeof(boolean->name), "%s%d_%s", + name, seq, type); + boolean->s1 = s1; + boolean->s2 = s2; + pmbus_attr_init(a, boolean->name, 0444, pmbus_show_boolean, NULL, + pb_reg_to_index(page, reg, mask)); + + return pmbus_add_attribute(data, &a->dev_attr.attr); +} + +static struct pmbus_sensor *pmbus_add_sensor(struct pmbus_data *data, + const char *name, const char *type, + int seq, int page, int phase, + int reg, + enum pmbus_sensor_classes class, + bool update, bool readonly, + bool convert) +{ + struct pmbus_sensor *sensor; + struct device_attribute *a; + + sensor = devm_kzalloc(data->dev, sizeof(*sensor), GFP_KERNEL); + if (!sensor) + return NULL; + a = &sensor->attribute; + + if (type) + snprintf(sensor->name, sizeof(sensor->name), "%s%d_%s", + name, seq, type); + else + snprintf(sensor->name, sizeof(sensor->name), "%s%d", + name, seq); + + if (data->flags & PMBUS_WRITE_PROTECTED) + readonly = true; + + sensor->page = page; + sensor->phase = phase; + sensor->reg = reg; + sensor->class = class; + sensor->update = update; + sensor->convert = convert; + sensor->data = -ENODATA; + pmbus_dev_attr_init(a, sensor->name, + readonly ? 0444 : 0644, + pmbus_show_sensor, pmbus_set_sensor); + + if (pmbus_add_attribute(data, &a->attr)) + return NULL; + + sensor->next = data->sensors; + data->sensors = sensor; + + return sensor; +} + +static int pmbus_add_label(struct pmbus_data *data, + const char *name, int seq, + const char *lstring, int index, int phase) +{ + struct pmbus_label *label; + struct device_attribute *a; + + label = devm_kzalloc(data->dev, sizeof(*label), GFP_KERNEL); + if (!label) + return -ENOMEM; + + a = &label->attribute; + + snprintf(label->name, sizeof(label->name), "%s%d_label", name, seq); + if (!index) { + if (phase == 0xff) + strlcpy(label->label, lstring, + sizeof(label->label)); + else + snprintf(label->label, sizeof(label->label), "%s.%d", + lstring, phase); + } else { + if (phase == 0xff) + snprintf(label->label, sizeof(label->label), "%s%d", + lstring, index); + else + snprintf(label->label, sizeof(label->label), "%s%d.%d", + lstring, index, phase); + } + + pmbus_dev_attr_init(a, label->name, 0444, pmbus_show_label, NULL); + return pmbus_add_attribute(data, &a->attr); +} + +/* + * Search for attributes. Allocate sensors, booleans, and labels as needed. + */ + +/* + * The pmbus_limit_attr structure describes a single limit attribute + * and its associated alarm attribute. + */ +struct pmbus_limit_attr { + u16 reg; /* Limit register */ + u16 sbit; /* Alarm attribute status bit */ + bool update; /* True if register needs updates */ + bool low; /* True if low limit; for limits with compare + functions only */ + const char *attr; /* Attribute name */ + const char *alarm; /* Alarm attribute name */ +}; + +/* + * The pmbus_sensor_attr structure describes one sensor attribute. This + * description includes a reference to the associated limit attributes. + */ +struct pmbus_sensor_attr { + u16 reg; /* sensor register */ + u16 gbit; /* generic status bit */ + u8 nlimit; /* # of limit registers */ + enum pmbus_sensor_classes class;/* sensor class */ + const char *label; /* sensor label */ + bool paged; /* true if paged sensor */ + bool update; /* true if update needed */ + bool compare; /* true if compare function needed */ + u32 func; /* sensor mask */ + u32 sfunc; /* sensor status mask */ + int sreg; /* status register */ + const struct pmbus_limit_attr *limit;/* limit registers */ +}; + +/* + * Add a set of limit attributes and, if supported, the associated + * alarm attributes. + * returns 0 if no alarm register found, 1 if an alarm register was found, + * < 0 on errors. + */ +static int pmbus_add_limit_attrs(struct i2c_client *client, + struct pmbus_data *data, + const struct pmbus_driver_info *info, + const char *name, int index, int page, + struct pmbus_sensor *base, + const struct pmbus_sensor_attr *attr) +{ + const struct pmbus_limit_attr *l = attr->limit; + int nlimit = attr->nlimit; + int have_alarm = 0; + int i, ret; + struct pmbus_sensor *curr; + + for (i = 0; i < nlimit; i++) { + if (wb_pmbus_check_word_register(client, page, l->reg)) { + curr = pmbus_add_sensor(data, name, l->attr, index, + page, 0xff, l->reg, attr->class, + attr->update || l->update, + false, true); + if (!curr) + return -ENOMEM; + if (l->sbit && (info->func[page] & attr->sfunc)) { + ret = pmbus_add_boolean(data, name, + l->alarm, index, + attr->compare ? l->low ? curr : base + : NULL, + attr->compare ? l->low ? base : curr + : NULL, + page, attr->sreg, l->sbit); + if (ret) + return ret; + have_alarm = 1; + } + } + l++; + } + return have_alarm; +} + +static int pmbus_add_sensor_attrs_one(struct i2c_client *client, + struct pmbus_data *data, + const struct pmbus_driver_info *info, + const char *name, + int index, int page, int phase, + const struct pmbus_sensor_attr *attr, + bool paged) +{ + struct pmbus_sensor *base; + bool upper = !!(attr->gbit & 0xff00); /* need to check STATUS_WORD */ + int ret; + + if (attr->label) { + ret = pmbus_add_label(data, name, index, attr->label, + paged ? page + 1 : 0, phase); + if (ret) + return ret; + } + base = pmbus_add_sensor(data, name, "input", index, page, phase, + attr->reg, attr->class, true, true, true); + if (!base) + return -ENOMEM; + /* No limit and alarm attributes for phase specific sensors */ + if (attr->sfunc && phase == 0xff) { + ret = pmbus_add_limit_attrs(client, data, info, name, + index, page, base, attr); + if (ret < 0) + return ret; + /* + * Add generic alarm attribute only if there are no individual + * alarm attributes, if there is a global alarm bit, and if + * the generic status register (word or byte, depending on + * which global bit is set) for this page is accessible. + */ + if (!ret && attr->gbit && + (!upper || (upper && data->has_status_word)) && + pmbus_check_status_register(client, page)) { + ret = pmbus_add_boolean(data, name, "alarm", index, + NULL, NULL, + page, PMBUS_STATUS_WORD, + attr->gbit); + if (ret) + return ret; + } + } + return 0; +} + +static bool pmbus_sensor_is_paged(const struct pmbus_driver_info *info, + const struct pmbus_sensor_attr *attr) +{ + int p; + + if (attr->paged) + return true; + + /* + * Some attributes may be present on more than one page despite + * not being marked with the paged attribute. If that is the case, + * then treat the sensor as being paged and add the page suffix to the + * attribute name. + * We don't just add the paged attribute to all such attributes, in + * order to maintain the un-suffixed labels in the case where the + * attribute is only on page 0. + */ + for (p = 1; p < info->pages; p++) { + if (info->func[p] & attr->func) + return true; + } + return false; +} + +static int pmbus_add_sensor_attrs(struct i2c_client *client, + struct pmbus_data *data, + const char *name, + const struct pmbus_sensor_attr *attrs, + int nattrs) +{ + const struct pmbus_driver_info *info = data->info; + int index, i; + int ret; + + index = 1; + for (i = 0; i < nattrs; i++) { + int page, pages; + bool paged = pmbus_sensor_is_paged(info, attrs); + + pages = paged ? info->pages : 1; + for (page = 0; page < pages; page++) { + if (!(info->func[page] & attrs->func)) + continue; + ret = pmbus_add_sensor_attrs_one(client, data, info, + name, index, page, + 0xff, attrs, paged); + if (ret) + return ret; + index++; + if (info->phases[page]) { + int phase; + + for (phase = 0; phase < info->phases[page]; + phase++) { + if (!(info->pfunc[phase] & attrs->func)) + continue; + ret = pmbus_add_sensor_attrs_one(client, + data, info, name, index, page, + phase, attrs, paged); + if (ret) + return ret; + index++; + } + } + } + attrs++; + } + return 0; +} + +static const struct pmbus_limit_attr vin_limit_attrs[] = { + { + .reg = PMBUS_VIN_UV_WARN_LIMIT, + .attr = "min", + .alarm = "min_alarm", + .sbit = PB_VOLTAGE_UV_WARNING, + }, { + .reg = PMBUS_VIN_UV_FAULT_LIMIT, + .attr = "lcrit", + .alarm = "lcrit_alarm", + .sbit = PB_VOLTAGE_UV_FAULT, + }, { + .reg = PMBUS_VIN_OV_WARN_LIMIT, + .attr = "max", + .alarm = "max_alarm", + .sbit = PB_VOLTAGE_OV_WARNING, + }, { + .reg = PMBUS_VIN_OV_FAULT_LIMIT, + .attr = "crit", + .alarm = "crit_alarm", + .sbit = PB_VOLTAGE_OV_FAULT, + }, { + .reg = PMBUS_VIRT_READ_VIN_AVG, + .update = true, + .attr = "average", + }, { + .reg = PMBUS_VIRT_READ_VIN_MIN, + .update = true, + .attr = "lowest", + }, { + .reg = PMBUS_VIRT_READ_VIN_MAX, + .update = true, + .attr = "highest", + }, { + .reg = PMBUS_VIRT_RESET_VIN_HISTORY, + .attr = "reset_history", + }, { + .reg = PMBUS_MFR_VIN_MIN, + .attr = "rated_min", + }, { + .reg = PMBUS_MFR_VIN_MAX, + .attr = "rated_max", + }, +}; + +static const struct pmbus_limit_attr vmon_limit_attrs[] = { + { + .reg = PMBUS_VIRT_VMON_UV_WARN_LIMIT, + .attr = "min", + .alarm = "min_alarm", + .sbit = PB_VOLTAGE_UV_WARNING, + }, { + .reg = PMBUS_VIRT_VMON_UV_FAULT_LIMIT, + .attr = "lcrit", + .alarm = "lcrit_alarm", + .sbit = PB_VOLTAGE_UV_FAULT, + }, { + .reg = PMBUS_VIRT_VMON_OV_WARN_LIMIT, + .attr = "max", + .alarm = "max_alarm", + .sbit = PB_VOLTAGE_OV_WARNING, + }, { + .reg = PMBUS_VIRT_VMON_OV_FAULT_LIMIT, + .attr = "crit", + .alarm = "crit_alarm", + .sbit = PB_VOLTAGE_OV_FAULT, + } +}; + +static const struct pmbus_limit_attr vout_limit_attrs[] = { + { + .reg = PMBUS_VOUT_UV_WARN_LIMIT, + .attr = "min", + .alarm = "min_alarm", + .sbit = PB_VOLTAGE_UV_WARNING, + }, { + .reg = PMBUS_VOUT_UV_FAULT_LIMIT, + .attr = "lcrit", + .alarm = "lcrit_alarm", + .sbit = PB_VOLTAGE_UV_FAULT, + }, { + .reg = PMBUS_VOUT_OV_WARN_LIMIT, + .attr = "max", + .alarm = "max_alarm", + .sbit = PB_VOLTAGE_OV_WARNING, + }, { + .reg = PMBUS_VOUT_OV_FAULT_LIMIT, + .attr = "crit", + .alarm = "crit_alarm", + .sbit = PB_VOLTAGE_OV_FAULT, + }, { + .reg = PMBUS_VIRT_READ_VOUT_AVG, + .update = true, + .attr = "average", + }, { + .reg = PMBUS_VIRT_READ_VOUT_MIN, + .update = true, + .attr = "lowest", + }, { + .reg = PMBUS_VIRT_READ_VOUT_MAX, + .update = true, + .attr = "highest", + }, { + .reg = PMBUS_VIRT_RESET_VOUT_HISTORY, + .attr = "reset_history", + }, { + .reg = PMBUS_MFR_VOUT_MIN, + .attr = "rated_min", + }, { + .reg = PMBUS_MFR_VOUT_MAX, + .attr = "rated_max", + }, +}; + +static const struct pmbus_sensor_attr voltage_attributes[] = { + { + .reg = PMBUS_READ_VIN, + .class = PSC_VOLTAGE_IN, + .label = "vin", + .func = PMBUS_HAVE_VIN, + .sfunc = PMBUS_HAVE_STATUS_INPUT, + .sreg = PMBUS_STATUS_INPUT, + .gbit = PB_STATUS_VIN_UV, + .limit = vin_limit_attrs, + .nlimit = 0, + }, { + .reg = PMBUS_VIRT_READ_VMON, + .class = PSC_VOLTAGE_IN, + .label = "vmon", + .func = PMBUS_HAVE_VMON, + .sfunc = PMBUS_HAVE_STATUS_VMON, + .sreg = PMBUS_VIRT_STATUS_VMON, + .limit = vmon_limit_attrs, + .nlimit = 0, + }, { + .reg = PMBUS_READ_VCAP, + .class = PSC_VOLTAGE_IN, + .label = "vcap", + .func = PMBUS_HAVE_VCAP, + }, { + .reg = PMBUS_READ_VOUT, + .class = PSC_VOLTAGE_OUT, + .label = "vout", + .paged = true, + .func = PMBUS_HAVE_VOUT, + .sfunc = PMBUS_HAVE_STATUS_VOUT, + .sreg = PMBUS_STATUS_VOUT, + .gbit = PB_STATUS_VOUT_OV, + .limit = vout_limit_attrs, + .nlimit = 0, + } +}; + +/* Current attributes */ + +static const struct pmbus_limit_attr iin_limit_attrs[] = { + { + .reg = PMBUS_IIN_OC_WARN_LIMIT, + .attr = "max", + .alarm = "max_alarm", + .sbit = PB_IIN_OC_WARNING, + }, { + .reg = PMBUS_IIN_OC_FAULT_LIMIT, + .attr = "crit", + .alarm = "crit_alarm", + .sbit = PB_IIN_OC_FAULT, + }, { + .reg = PMBUS_VIRT_READ_IIN_AVG, + .update = true, + .attr = "average", + }, { + .reg = PMBUS_VIRT_READ_IIN_MIN, + .update = true, + .attr = "lowest", + }, { + .reg = PMBUS_VIRT_READ_IIN_MAX, + .update = true, + .attr = "highest", + }, { + .reg = PMBUS_VIRT_RESET_IIN_HISTORY, + .attr = "reset_history", + }, { + .reg = PMBUS_MFR_IIN_MAX, + .attr = "rated_max", + }, +}; + +static const struct pmbus_limit_attr iout_limit_attrs[] = { + { + .reg = PMBUS_IOUT_OC_WARN_LIMIT, + .attr = "max", + .alarm = "max_alarm", + .sbit = PB_IOUT_OC_WARNING, + }, { + .reg = PMBUS_IOUT_UC_FAULT_LIMIT, + .attr = "lcrit", + .alarm = "lcrit_alarm", + .sbit = PB_IOUT_UC_FAULT, + }, { + .reg = PMBUS_IOUT_OC_FAULT_LIMIT, + .attr = "crit", + .alarm = "crit_alarm", + .sbit = PB_IOUT_OC_FAULT, + }, { + .reg = PMBUS_VIRT_READ_IOUT_AVG, + .update = true, + .attr = "average", + }, { + .reg = PMBUS_VIRT_READ_IOUT_MIN, + .update = true, + .attr = "lowest", + }, { + .reg = PMBUS_VIRT_READ_IOUT_MAX, + .update = true, + .attr = "highest", + }, { + .reg = PMBUS_VIRT_RESET_IOUT_HISTORY, + .attr = "reset_history", + }, { + .reg = PMBUS_MFR_IOUT_MAX, + .attr = "rated_max", + }, +}; + +static const struct pmbus_sensor_attr current_attributes[] = { + { + .reg = PMBUS_READ_IIN, + .class = PSC_CURRENT_IN, + .label = "iin", + .func = PMBUS_HAVE_IIN, + .sfunc = PMBUS_HAVE_STATUS_INPUT, + .sreg = PMBUS_STATUS_INPUT, + .gbit = PB_STATUS_INPUT, + .limit = iin_limit_attrs, + .nlimit = 0, + }, { + .reg = PMBUS_READ_IOUT, + .class = PSC_CURRENT_OUT, + .label = "iout", + .paged = true, + .func = PMBUS_HAVE_IOUT, + .sfunc = PMBUS_HAVE_STATUS_IOUT, + .sreg = PMBUS_STATUS_IOUT, + .gbit = PB_STATUS_IOUT_OC, + .limit = iout_limit_attrs, + .nlimit = 0, + } +}; + +/* Power attributes */ + +static const struct pmbus_limit_attr pin_limit_attrs[] = { + { + .reg = PMBUS_PIN_OP_WARN_LIMIT, + .attr = "max", + .alarm = "alarm", + .sbit = PB_PIN_OP_WARNING, + }, { + .reg = PMBUS_VIRT_READ_PIN_AVG, + .update = true, + .attr = "average", + }, { + .reg = PMBUS_VIRT_READ_PIN_MIN, + .update = true, + .attr = "input_lowest", + }, { + .reg = PMBUS_VIRT_READ_PIN_MAX, + .update = true, + .attr = "input_highest", + }, { + .reg = PMBUS_VIRT_RESET_PIN_HISTORY, + .attr = "reset_history", + }, { + .reg = PMBUS_MFR_PIN_MAX, + .attr = "rated_max", + }, +}; + +static const struct pmbus_limit_attr pout_limit_attrs[] = { + { + .reg = PMBUS_POUT_MAX, + .attr = "cap", + .alarm = "cap_alarm", + .sbit = PB_POWER_LIMITING, + }, { + .reg = PMBUS_POUT_OP_WARN_LIMIT, + .attr = "max", + .alarm = "max_alarm", + .sbit = PB_POUT_OP_WARNING, + }, { + .reg = PMBUS_POUT_OP_FAULT_LIMIT, + .attr = "crit", + .alarm = "crit_alarm", + .sbit = PB_POUT_OP_FAULT, + }, { + .reg = PMBUS_VIRT_READ_POUT_AVG, + .update = true, + .attr = "average", + }, { + .reg = PMBUS_VIRT_READ_POUT_MIN, + .update = true, + .attr = "input_lowest", + }, { + .reg = PMBUS_VIRT_READ_POUT_MAX, + .update = true, + .attr = "input_highest", + }, { + .reg = PMBUS_VIRT_RESET_POUT_HISTORY, + .attr = "reset_history", + }, { + .reg = PMBUS_MFR_POUT_MAX, + .attr = "rated_max", + }, +}; + +static const struct pmbus_sensor_attr power_attributes[] = { + { + .reg = PMBUS_READ_PIN, + .class = PSC_POWER, + .label = "pin", + .func = PMBUS_HAVE_PIN, + .sfunc = PMBUS_HAVE_STATUS_INPUT, + .sreg = PMBUS_STATUS_INPUT, + .gbit = PB_STATUS_INPUT, + .limit = pin_limit_attrs, + .nlimit = 0, + }, { + .reg = PMBUS_READ_POUT, + .class = PSC_POWER, + .label = "pout", + .paged = true, + .func = PMBUS_HAVE_POUT, + .sfunc = PMBUS_HAVE_STATUS_IOUT, + .sreg = PMBUS_STATUS_IOUT, + .limit = pout_limit_attrs, + .nlimit = 0, + } +}; + +/* Temperature atributes */ + +static const struct pmbus_limit_attr temp_limit_attrs[] = { + { + .reg = PMBUS_UT_WARN_LIMIT, + .low = true, + .attr = "min", + .alarm = "min_alarm", + .sbit = PB_TEMP_UT_WARNING, + }, { + .reg = PMBUS_UT_FAULT_LIMIT, + .low = true, + .attr = "lcrit", + .alarm = "lcrit_alarm", + .sbit = PB_TEMP_UT_FAULT, + }, { + .reg = PMBUS_OT_WARN_LIMIT, + .attr = "max", + .alarm = "max_alarm", + .sbit = PB_TEMP_OT_WARNING, + }, { + .reg = PMBUS_OT_FAULT_LIMIT, + .attr = "crit", + .alarm = "crit_alarm", + .sbit = PB_TEMP_OT_FAULT, + }, { + .reg = PMBUS_VIRT_READ_TEMP_MIN, + .attr = "lowest", + }, { + .reg = PMBUS_VIRT_READ_TEMP_AVG, + .attr = "average", + }, { + .reg = PMBUS_VIRT_READ_TEMP_MAX, + .attr = "highest", + }, { + .reg = PMBUS_VIRT_RESET_TEMP_HISTORY, + .attr = "reset_history", + }, { + .reg = PMBUS_MFR_MAX_TEMP_1, + .attr = "rated_max", + }, +}; + +static const struct pmbus_limit_attr temp_limit_attrs2[] = { + { + .reg = PMBUS_UT_WARN_LIMIT, + .low = true, + .attr = "min", + .alarm = "min_alarm", + .sbit = PB_TEMP_UT_WARNING, + }, { + .reg = PMBUS_UT_FAULT_LIMIT, + .low = true, + .attr = "lcrit", + .alarm = "lcrit_alarm", + .sbit = PB_TEMP_UT_FAULT, + }, { + .reg = PMBUS_OT_WARN_LIMIT, + .attr = "max", + .alarm = "max_alarm", + .sbit = PB_TEMP_OT_WARNING, + }, { + .reg = PMBUS_OT_FAULT_LIMIT, + .attr = "crit", + .alarm = "crit_alarm", + .sbit = PB_TEMP_OT_FAULT, + }, { + .reg = PMBUS_VIRT_READ_TEMP2_MIN, + .attr = "lowest", + }, { + .reg = PMBUS_VIRT_READ_TEMP2_AVG, + .attr = "average", + }, { + .reg = PMBUS_VIRT_READ_TEMP2_MAX, + .attr = "highest", + }, { + .reg = PMBUS_VIRT_RESET_TEMP2_HISTORY, + .attr = "reset_history", + }, { + .reg = PMBUS_MFR_MAX_TEMP_2, + .attr = "rated_max", + }, +}; + +static const struct pmbus_limit_attr temp_limit_attrs3[] = { + { + .reg = PMBUS_UT_WARN_LIMIT, + .low = true, + .attr = "min", + .alarm = "min_alarm", + .sbit = PB_TEMP_UT_WARNING, + }, { + .reg = PMBUS_UT_FAULT_LIMIT, + .low = true, + .attr = "lcrit", + .alarm = "lcrit_alarm", + .sbit = PB_TEMP_UT_FAULT, + }, { + .reg = PMBUS_OT_WARN_LIMIT, + .attr = "max", + .alarm = "max_alarm", + .sbit = PB_TEMP_OT_WARNING, + }, { + .reg = PMBUS_OT_FAULT_LIMIT, + .attr = "crit", + .alarm = "crit_alarm", + .sbit = PB_TEMP_OT_FAULT, + }, { + .reg = PMBUS_MFR_MAX_TEMP_3, + .attr = "rated_max", + }, +}; + +static const struct pmbus_sensor_attr temp_attributes[] = { + { + .reg = PMBUS_READ_TEMPERATURE_1, + .class = PSC_TEMPERATURE, + .paged = true, + .update = true, + .compare = true, + .func = PMBUS_HAVE_TEMP, + .sfunc = PMBUS_HAVE_STATUS_TEMP, + .sreg = PMBUS_STATUS_TEMPERATURE, + .gbit = PB_STATUS_TEMPERATURE, + .limit = temp_limit_attrs, + .nlimit = 0, + }, { + .reg = PMBUS_READ_TEMPERATURE_2, + .class = PSC_TEMPERATURE, + .paged = true, + .update = true, + .compare = true, + .func = PMBUS_HAVE_TEMP2, + .sfunc = PMBUS_HAVE_STATUS_TEMP, + .sreg = PMBUS_STATUS_TEMPERATURE, + .gbit = PB_STATUS_TEMPERATURE, + .limit = temp_limit_attrs2, + .nlimit = 0, + }, { + .reg = PMBUS_READ_TEMPERATURE_3, + .class = PSC_TEMPERATURE, + .paged = true, + .update = true, + .compare = true, + .func = PMBUS_HAVE_TEMP3, + .sfunc = PMBUS_HAVE_STATUS_TEMP, + .sreg = PMBUS_STATUS_TEMPERATURE, + .gbit = PB_STATUS_TEMPERATURE, + .limit = temp_limit_attrs3, + .nlimit = 0, + } +}; + +static const int pmbus_fan_registers[] = { + PMBUS_READ_FAN_SPEED_1, + PMBUS_READ_FAN_SPEED_2, + PMBUS_READ_FAN_SPEED_3, + PMBUS_READ_FAN_SPEED_4 +}; + +static const int pmbus_fan_status_registers[] = { + PMBUS_STATUS_FAN_12, + PMBUS_STATUS_FAN_12, + PMBUS_STATUS_FAN_34, + PMBUS_STATUS_FAN_34 +}; + +static const u32 pmbus_fan_flags[] = { + PMBUS_HAVE_FAN12, + PMBUS_HAVE_FAN12, + PMBUS_HAVE_FAN34, + PMBUS_HAVE_FAN34 +}; + +static const u32 pmbus_fan_status_flags[] = { + PMBUS_HAVE_STATUS_FAN12, + PMBUS_HAVE_STATUS_FAN12, + PMBUS_HAVE_STATUS_FAN34, + PMBUS_HAVE_STATUS_FAN34 +}; + +/* Fans */ + +/* Precondition: FAN_CONFIG_x_y and FAN_COMMAND_x must exist for the fan ID */ +static int pmbus_add_fan_ctrl(struct i2c_client *client, + struct pmbus_data *data, int index, int page, int id, + u8 config) +{ + struct pmbus_sensor *sensor; + + sensor = pmbus_add_sensor(data, "fan", "target", index, page, + 0xff, PMBUS_VIRT_FAN_TARGET_1 + id, PSC_FAN, + false, false, true); + + if (!sensor) + return -ENOMEM; + + if (!((data->info->func[page] & PMBUS_HAVE_PWM12) || + (data->info->func[page] & PMBUS_HAVE_PWM34))) + return 0; + + sensor = pmbus_add_sensor(data, "pwm", NULL, index, page, + 0xff, PMBUS_VIRT_PWM_1 + id, PSC_PWM, + false, false, true); + + if (!sensor) + return -ENOMEM; + + sensor = pmbus_add_sensor(data, "pwm", "enable", index, page, + 0xff, PMBUS_VIRT_PWM_ENABLE_1 + id, PSC_PWM, + true, false, false); + + if (!sensor) + return -ENOMEM; + + return 0; +} + +static int pmbus_add_fan_attributes(struct i2c_client *client, + struct pmbus_data *data) +{ + const struct pmbus_driver_info *info = data->info; + int index = 1; + int page; + int ret; + + for (page = 0; page < info->pages; page++) { + int f; + + for (f = 0; f < ARRAY_SIZE(pmbus_fan_registers); f++) { + int regval; + + if (!(info->func[page] & pmbus_fan_flags[f])) + break; + + if (!wb_pmbus_check_word_register(client, page, + pmbus_fan_registers[f])) + break; + + /* + * Skip fan if not installed. + * Each fan configuration register covers multiple fans, + * so we have to do some magic. + */ + regval = _pmbus_read_byte_data(client, page, + pmbus_fan_config_registers[f]); + if (regval < 0 || + (!(regval & (PB_FAN_1_INSTALLED >> ((f & 1) * 4))))) + continue; + + if (pmbus_add_sensor(data, "fan", "input", index, + page, 0xff, pmbus_fan_registers[f], + PSC_FAN, true, true, true) == NULL) + return -ENOMEM; + + /* Fan control */ + if (wb_pmbus_check_word_register(client, page, + pmbus_fan_command_registers[f])) { + ret = pmbus_add_fan_ctrl(client, data, index, + page, f, regval); + if (ret < 0) + return ret; + } + + /* + * Each fan status register covers multiple fans, + * so we have to do some magic. + */ + if ((info->func[page] & pmbus_fan_status_flags[f]) && + wb_pmbus_check_byte_register(client, + page, pmbus_fan_status_registers[f])) { + int reg; + + if (f > 1) /* fan 3, 4 */ + reg = PMBUS_STATUS_FAN_34; + else + reg = PMBUS_STATUS_FAN_12; + ret = pmbus_add_boolean(data, "fan", + "alarm", index, NULL, NULL, page, reg, + PB_FAN_FAN1_WARNING >> (f & 1)); + if (ret) + return ret; + ret = pmbus_add_boolean(data, "fan", + "fault", index, NULL, NULL, page, reg, + PB_FAN_FAN1_FAULT >> (f & 1)); + if (ret) + return ret; + } + index++; + } + } + return 0; +} + +struct pmbus_samples_attr { + int reg; + char *name; +}; + +struct pmbus_samples_reg { + int page; + struct pmbus_samples_attr *attr; + struct device_attribute dev_attr; +}; + +static struct pmbus_samples_attr pmbus_samples_registers[] = { + { + .reg = PMBUS_VIRT_SAMPLES, + .name = "samples", + }, { + .reg = PMBUS_VIRT_IN_SAMPLES, + .name = "in_samples", + }, { + .reg = PMBUS_VIRT_CURR_SAMPLES, + .name = "curr_samples", + }, { + .reg = PMBUS_VIRT_POWER_SAMPLES, + .name = "power_samples", + }, { + .reg = PMBUS_VIRT_TEMP_SAMPLES, + .name = "temp_samples", + } +}; + +#define to_samples_reg(x) container_of(x, struct pmbus_samples_reg, dev_attr) + +static ssize_t pmbus_show_samples(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int val; + struct i2c_client *client = to_i2c_client(dev->parent); + struct pmbus_samples_reg *reg = to_samples_reg(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + val = _pmbus_read_word_data(client, reg->page, 0xff, reg->attr->reg); + mutex_unlock(&data->update_lock); + if (val < 0) + return val; + + return snprintf(buf, PAGE_SIZE, "%d\n", val); +} + +static ssize_t pmbus_set_samples(struct device *dev, + struct device_attribute *devattr, + const char *buf, size_t count) +{ + int ret; + long val; + struct i2c_client *client = to_i2c_client(dev->parent); + struct pmbus_samples_reg *reg = to_samples_reg(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + + if (kstrtol(buf, 0, &val) < 0) + return -EINVAL; + + mutex_lock(&data->update_lock); + ret = _pmbus_write_word_data(client, reg->page, reg->attr->reg, val); + mutex_unlock(&data->update_lock); + + return ret ? : count; +} + +static int pmbus_add_samples_attr(struct pmbus_data *data, int page, + struct pmbus_samples_attr *attr) +{ + struct pmbus_samples_reg *reg; + + reg = devm_kzalloc(data->dev, sizeof(*reg), GFP_KERNEL); + if (!reg) + return -ENOMEM; + + reg->attr = attr; + reg->page = page; + + pmbus_dev_attr_init(®->dev_attr, attr->name, 0644, + pmbus_show_samples, pmbus_set_samples); + + return pmbus_add_attribute(data, ®->dev_attr.attr); +} + +static int pmbus_add_samples_attributes(struct i2c_client *client, + struct pmbus_data *data) +{ + const struct pmbus_driver_info *info = data->info; + int s; + + if (!(info->func[0] & PMBUS_HAVE_SAMPLES)) + return 0; + + for (s = 0; s < ARRAY_SIZE(pmbus_samples_registers); s++) { + struct pmbus_samples_attr *attr; + int ret; + + attr = &pmbus_samples_registers[s]; + if (!wb_pmbus_check_word_register(client, 0, attr->reg)) + continue; + + ret = pmbus_add_samples_attr(data, 0, attr); + if (ret) + return ret; + } + + return 0; +} + +static int pmbus_find_attributes(struct i2c_client *client, + struct pmbus_data *data) +{ + int ret; + + /* Voltage sensors */ + ret = pmbus_add_sensor_attrs(client, data, "in", voltage_attributes, + ARRAY_SIZE(voltage_attributes)); + if (ret) + return ret; + + /* Current sensors */ + ret = pmbus_add_sensor_attrs(client, data, "curr", current_attributes, + ARRAY_SIZE(current_attributes)); + if (ret) + return ret; + + /* Power sensors */ + ret = pmbus_add_sensor_attrs(client, data, "power", power_attributes, + ARRAY_SIZE(power_attributes)); + if (ret) + return ret; + + /* Temperature sensors */ + ret = pmbus_add_sensor_attrs(client, data, "temp", temp_attributes, + ARRAY_SIZE(temp_attributes)); + if (ret) + return ret; + + /* Fans */ + ret = pmbus_add_fan_attributes(client, data); + if (ret) + return ret; + + ret = pmbus_add_samples_attributes(client, data); + return ret; +} + +/* + * Identify chip parameters. + * This function is called for all chips. + */ +static int pmbus_identify_common(struct i2c_client *client, + struct pmbus_data *data, int page) +{ + int vout_mode = -1; + + if (wb_pmbus_check_byte_register(client, page, PMBUS_VOUT_MODE)) + vout_mode = _pmbus_read_byte_data(client, page, + PMBUS_VOUT_MODE); + if (vout_mode >= 0 && vout_mode != 0xff) { + /* + * Not all chips support the VOUT_MODE command, + * so a failure to read it is not an error. + */ + switch (vout_mode >> 5) { + case 0: /* linear mode */ + if (data->info->format[PSC_VOLTAGE_OUT] != linear) + return -ENODEV; + + data->exponent[page] = ((s8)(vout_mode << 3)) >> 3; + break; + case 1: /* VID mode */ + if (data->info->format[PSC_VOLTAGE_OUT] != vid) + return -ENODEV; + break; + case 2: /* direct mode */ + if (data->info->format[PSC_VOLTAGE_OUT] != direct) + return -ENODEV; + break; + default: + return -ENODEV; + } + } + + pmbus_clear_fault_page(client, page); + return 0; +} + +static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data, + struct pmbus_driver_info *info) +{ + struct device *dev = &client->dev; + int page, ret, i; + + /* + * Some PMBus chips don't support PMBUS_STATUS_WORD, so try + * to use PMBUS_STATUS_BYTE instead if that is the case. + * Bail out if both registers are not supported. + */ + for(i = 0; i < PMBUS_RETRY_TIME; i++) { + data->read_status = pmbus_read_status_word; + ret = i2c_smbus_read_word_data(client, PMBUS_STATUS_WORD); + if (ret < 0 || ret == 0xffff) { + data->read_status = pmbus_read_status_byte; + ret = i2c_smbus_read_byte_data(client, PMBUS_STATUS_BYTE); + if (ret < 0 || ret == 0xff) { + usleep_range(PMBUS_RETRY_SLEEP_TIME, PMBUS_RETRY_SLEEP_TIME + 1); + continue; + } + } else { + data->has_status_word = true; + } + break; + } + + if(i == PMBUS_RETRY_TIME) { + dev_err(dev, "PMBus status register not found\n"); + return -ENODEV; + } + + /* Enable PEC if the controller supports it */ + for(i = 0; i < PMBUS_RETRY_TIME; i++) { + ret = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY); + if (ret >= 0) { + break; + } + usleep_range(PMBUS_RETRY_SLEEP_TIME, PMBUS_RETRY_SLEEP_TIME + 1); + } + + if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK)) + client->flags |= I2C_CLIENT_PEC; + + /* + * Check if the chip is write protected. If it is, we can not clear + * faults, and we should not try it. Also, in that case, writes into + * limit registers need to be disabled. + */ + for(i = 0; i < PMBUS_RETRY_TIME; i++) { + ret = i2c_smbus_read_byte_data(client, PMBUS_WRITE_PROTECT); + if (ret >= 0) { + break; + } + usleep_range(PMBUS_RETRY_SLEEP_TIME, PMBUS_RETRY_SLEEP_TIME + 1); + } + + if (ret > 0 && (ret & PB_WP_ANY)) + data->flags |= PMBUS_WRITE_PROTECTED | PMBUS_SKIP_STATUS_CHECK; + + if (data->info->pages) + wb_pmbus_clear_faults(client); + else + pmbus_clear_fault_page(client, -1); + + if (info->identify) { + ret = (*info->identify)(client, info); + if (ret < 0) { + dev_err(dev, "Chip identification failed\n"); + return ret; + } + } + + if (info->pages <= 0 || info->pages > PMBUS_PAGES) { + dev_err(dev, "Bad number of PMBus pages: %d\n", info->pages); + return -ENODEV; + } + + for (page = 0; page < info->pages; page++) { + ret = pmbus_identify_common(client, data, page); + if (ret < 0) { + dev_err(dev, "Failed to identify chip capabilities\n"); + return ret; + } + } + return 0; +} + +#if IS_ENABLED(CONFIG_REGULATOR) +static int pmbus_regulator_is_enabled(struct regulator_dev *rdev) +{ + struct device *dev = rdev_get_dev(rdev); + struct i2c_client *client = to_i2c_client(dev->parent); + u8 page = rdev_get_id(rdev); + int ret; + + ret = wb_pmbus_read_byte_data(client, page, PMBUS_OPERATION); + if (ret < 0) + return ret; + + return !!(ret & PB_OPERATION_CONTROL_ON); +} + +static int _pmbus_regulator_on_off(struct regulator_dev *rdev, bool enable) +{ + struct device *dev = rdev_get_dev(rdev); + struct i2c_client *client = to_i2c_client(dev->parent); + u8 page = rdev_get_id(rdev); + + return wb_pmbus_update_byte_data(client, page, PMBUS_OPERATION, + PB_OPERATION_CONTROL_ON, + enable ? PB_OPERATION_CONTROL_ON : 0); +} + +static int pmbus_regulator_enable(struct regulator_dev *rdev) +{ + return _pmbus_regulator_on_off(rdev, 1); +} + +static int pmbus_regulator_disable(struct regulator_dev *rdev) +{ + return _pmbus_regulator_on_off(rdev, 0); +} + +const struct regulator_ops wb_pmbus_regulator_ops = { + .enable = pmbus_regulator_enable, + .disable = pmbus_regulator_disable, + .is_enabled = pmbus_regulator_is_enabled, +}; +EXPORT_SYMBOL_GPL(wb_pmbus_regulator_ops); + +static int pmbus_regulator_register(struct pmbus_data *data) +{ + struct device *dev = data->dev; + const struct pmbus_driver_info *info = data->info; + const struct pmbus_platform_data *pdata = dev_get_platdata(dev); + struct regulator_dev *rdev; + int i; + + for (i = 0; i < info->num_regulators; i++) { + struct regulator_config config = { }; + + config.dev = dev; + config.driver_data = data; + + if (pdata && pdata->reg_init_data) + config.init_data = &pdata->reg_init_data[i]; + + rdev = devm_regulator_register(dev, &info->reg_desc[i], + &config); + if (IS_ERR(rdev)) { + dev_err(dev, "Failed to register %s regulator\n", + info->reg_desc[i].name); + return PTR_ERR(rdev); + } + } + + return 0; +} +#else +static int pmbus_regulator_register(struct pmbus_data *data) +{ + return 0; +} +#endif + +static struct dentry *pmbus_debugfs_dir; /* pmbus debugfs directory */ + +#if IS_ENABLED(CONFIG_DEBUG_FS) +static int pmbus_debugfs_get(void *data, u64 *val) +{ + int rc; + struct pmbus_debugfs_entry *entry = data; + + rc = _pmbus_read_byte_data(entry->client, entry->page, entry->reg); + if (rc < 0) + return rc; + + *val = rc; + + return 0; +} +DEFINE_DEBUGFS_ATTRIBUTE(pmbus_debugfs_ops, pmbus_debugfs_get, NULL, + "0x%02llx\n"); + +static int pmbus_debugfs_get_status(void *data, u64 *val) +{ + int rc; + struct pmbus_debugfs_entry *entry = data; + struct pmbus_data *pdata = i2c_get_clientdata(entry->client); + + rc = pdata->read_status(entry->client, entry->page); + if (rc < 0) + return rc; + + *val = rc; + + return 0; +} +DEFINE_DEBUGFS_ATTRIBUTE(pmbus_debugfs_ops_status, pmbus_debugfs_get_status, + NULL, "0x%04llx\n"); + +static int pmbus_debugfs_get_pec(void *data, u64 *val) +{ + struct i2c_client *client = data; + + *val = !!(client->flags & I2C_CLIENT_PEC); + + return 0; +} + +static int pmbus_debugfs_set_pec(void *data, u64 val) +{ + int rc; + struct i2c_client *client = data; + + if (!val) { + client->flags &= ~I2C_CLIENT_PEC; + return 0; + } + + if (val != 1) + return -EINVAL; + + rc = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY); + if (rc < 0) + return rc; + + if (!(rc & PB_CAPABILITY_ERROR_CHECK)) + return -EOPNOTSUPP; + + client->flags |= I2C_CLIENT_PEC; + + return 0; +} +DEFINE_DEBUGFS_ATTRIBUTE(pmbus_debugfs_ops_pec, pmbus_debugfs_get_pec, + pmbus_debugfs_set_pec, "%llu\n"); + +static int pmbus_init_debugfs(struct i2c_client *client, + struct pmbus_data *data) +{ + int i, idx = 0; + char name[PMBUS_NAME_SIZE]; + struct pmbus_debugfs_entry *entries; + + if (!pmbus_debugfs_dir) + return -ENODEV; + + /* + * Create the debugfs directory for this device. Use the hwmon device + * name to avoid conflicts (hwmon numbers are globally unique). + */ + data->debugfs = debugfs_create_dir(dev_name(data->hwmon_dev), + pmbus_debugfs_dir); + if (IS_ERR_OR_NULL(data->debugfs)) { + data->debugfs = NULL; + return -ENODEV; + } + + /* Allocate the max possible entries we need. */ + entries = devm_kcalloc(data->dev, + data->info->pages * 10, sizeof(*entries), + GFP_KERNEL); + if (!entries) + return -ENOMEM; + + debugfs_create_file("pec", 0664, data->debugfs, client, + &pmbus_debugfs_ops_pec); + + for (i = 0; i < data->info->pages; ++i) { + /* Check accessibility of status register if it's not page 0 */ + if (!i || pmbus_check_status_register(client, i)) { + /* No need to set reg as we have special read op. */ + entries[idx].client = client; + entries[idx].page = i; + scnprintf(name, PMBUS_NAME_SIZE, "status%d", i); + debugfs_create_file(name, 0444, data->debugfs, + &entries[idx++], + &pmbus_debugfs_ops_status); + } + + if (data->info->func[i] & PMBUS_HAVE_STATUS_VOUT) { + entries[idx].client = client; + entries[idx].page = i; + entries[idx].reg = PMBUS_STATUS_VOUT; + scnprintf(name, PMBUS_NAME_SIZE, "status%d_vout", i); + debugfs_create_file(name, 0444, data->debugfs, + &entries[idx++], + &pmbus_debugfs_ops); + } + + if (data->info->func[i] & PMBUS_HAVE_STATUS_IOUT) { + entries[idx].client = client; + entries[idx].page = i; + entries[idx].reg = PMBUS_STATUS_IOUT; + scnprintf(name, PMBUS_NAME_SIZE, "status%d_iout", i); + debugfs_create_file(name, 0444, data->debugfs, + &entries[idx++], + &pmbus_debugfs_ops); + } + + if (data->info->func[i] & PMBUS_HAVE_STATUS_INPUT) { + entries[idx].client = client; + entries[idx].page = i; + entries[idx].reg = PMBUS_STATUS_INPUT; + scnprintf(name, PMBUS_NAME_SIZE, "status%d_input", i); + debugfs_create_file(name, 0444, data->debugfs, + &entries[idx++], + &pmbus_debugfs_ops); + } + + if (data->info->func[i] & PMBUS_HAVE_STATUS_TEMP) { + entries[idx].client = client; + entries[idx].page = i; + entries[idx].reg = PMBUS_STATUS_TEMPERATURE; + scnprintf(name, PMBUS_NAME_SIZE, "status%d_temp", i); + debugfs_create_file(name, 0444, data->debugfs, + &entries[idx++], + &pmbus_debugfs_ops); + } + + if (wb_pmbus_check_byte_register(client, i, PMBUS_STATUS_CML)) { + entries[idx].client = client; + entries[idx].page = i; + entries[idx].reg = PMBUS_STATUS_CML; + scnprintf(name, PMBUS_NAME_SIZE, "status%d_cml", i); + debugfs_create_file(name, 0444, data->debugfs, + &entries[idx++], + &pmbus_debugfs_ops); + } + + if (wb_pmbus_check_byte_register(client, i, PMBUS_STATUS_OTHER)) { + entries[idx].client = client; + entries[idx].page = i; + entries[idx].reg = PMBUS_STATUS_OTHER; + scnprintf(name, PMBUS_NAME_SIZE, "status%d_other", i); + debugfs_create_file(name, 0444, data->debugfs, + &entries[idx++], + &pmbus_debugfs_ops); + } + + if (wb_pmbus_check_byte_register(client, i, + PMBUS_STATUS_MFR_SPECIFIC)) { + entries[idx].client = client; + entries[idx].page = i; + entries[idx].reg = PMBUS_STATUS_MFR_SPECIFIC; + scnprintf(name, PMBUS_NAME_SIZE, "status%d_mfr", i); + debugfs_create_file(name, 0444, data->debugfs, + &entries[idx++], + &pmbus_debugfs_ops); + } + + if (data->info->func[i] & PMBUS_HAVE_STATUS_FAN12) { + entries[idx].client = client; + entries[idx].page = i; + entries[idx].reg = PMBUS_STATUS_FAN_12; + scnprintf(name, PMBUS_NAME_SIZE, "status%d_fan12", i); + debugfs_create_file(name, 0444, data->debugfs, + &entries[idx++], + &pmbus_debugfs_ops); + } + + if (data->info->func[i] & PMBUS_HAVE_STATUS_FAN34) { + entries[idx].client = client; + entries[idx].page = i; + entries[idx].reg = PMBUS_STATUS_FAN_34; + scnprintf(name, PMBUS_NAME_SIZE, "status%d_fan34", i); + debugfs_create_file(name, 0444, data->debugfs, + &entries[idx++], + &pmbus_debugfs_ops); + } + } + + return 0; +} +#else +static int pmbus_init_debugfs(struct i2c_client *client, + struct pmbus_data *data) +{ + return 0; +} +#endif /* IS_ENABLED(CONFIG_DEBUG_FS) */ + +int wb_pmbus_do_probe(struct i2c_client *client, struct pmbus_driver_info *info) +{ + struct device *dev = &client->dev; + const struct pmbus_platform_data *pdata = dev_get_platdata(dev); + struct pmbus_data *data; + size_t groups_num = 0; + int ret; + + if (!info) + return -ENODEV; + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_BYTE + | I2C_FUNC_SMBUS_BYTE_DATA + | I2C_FUNC_SMBUS_WORD_DATA)) + return -ENODEV; + + data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + if (info->groups) + while (info->groups[groups_num]) + groups_num++; + + data->groups = devm_kcalloc(dev, groups_num + 2, sizeof(void *), + GFP_KERNEL); + if (!data->groups) + return -ENOMEM; + + i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + data->dev = dev; + + if (pdata) + data->flags = pdata->flags; + data->info = info; + data->currpage = -1; + data->currphase = -1; + + ret = pmbus_init_common(client, data, info); + if (ret < 0) + return ret; + + ret = pmbus_find_attributes(client, data); + if (ret) + return ret; + + /* + * If there are no attributes, something is wrong. + * Bail out instead of trying to register nothing. + */ + if (!data->num_attributes) { + dev_err(dev, "No attributes found\n"); + return -ENODEV; + } + + data->groups[0] = &data->group; + memcpy(data->groups + 1, info->groups, sizeof(void *) * groups_num); + data->hwmon_dev = devm_hwmon_device_register_with_groups(dev, + client->name, data, data->groups); + if (IS_ERR(data->hwmon_dev)) { + dev_err(dev, "Failed to register hwmon device\n"); + return PTR_ERR(data->hwmon_dev); + } + + ret = pmbus_regulator_register(data); + if (ret) + return ret; + + ret = pmbus_init_debugfs(client, data); + if (ret) + dev_warn(dev, "Failed to register debugfs\n"); + + return 0; +} +EXPORT_SYMBOL_GPL(wb_pmbus_do_probe); + +void wb_pmbus_do_remove(struct i2c_client *client) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + + debugfs_remove_recursive(data->debugfs); + + return; +} +EXPORT_SYMBOL_GPL(wb_pmbus_do_remove); + +struct dentry *wb_pmbus_get_debugfs_dir(struct i2c_client *client) +{ + struct pmbus_data *data = i2c_get_clientdata(client); + + return data->debugfs; +} +EXPORT_SYMBOL_GPL(wb_pmbus_get_debugfs_dir); + +static int __init pmbus_core_init(void) +{ + pmbus_debugfs_dir = debugfs_create_dir("pmbus", NULL); + if (IS_ERR(pmbus_debugfs_dir)) + pmbus_debugfs_dir = NULL; + + return 0; +} + +static void __exit pmbus_core_exit(void) +{ + debugfs_remove_recursive(pmbus_debugfs_dir); +} + +module_init(pmbus_core_init); +module_exit(pmbus_core_exit); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("PMBus core driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_tmp401.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_tmp401.c new file mode 100644 index 000000000000..b8d3a024f624 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_tmp401.c @@ -0,0 +1,1010 @@ +/* tmp401.c + * + * Copyright (C) 2007,2008 Hans de Goede + * Preliminary tmp411 support by: + * Gabriel Konat, Sander Leget, Wouter Willems + * Copyright (C) 2009 Andre Prendel + * + * Cleanup and support for TMP431 and TMP432 by Guenter Roeck + * Copyright (c) 2013 Guenter Roeck + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * Driver for the Texas Instruments TMP401 SMBUS temperature sensor IC. + * + * Note this IC is in some aspect similar to the LM90, but it has quite a + * few differences too, for example the local temp has a higher resolution + * and thus has 16 bits registers for its value and limit instead of 8 bits. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Addresses to scan */ +/* static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4c, 0x4d, + 0x4e, 0x4f, I2C_CLIENT_END }; */ + +enum chips { tmp401, tmp411, tmp431, tmp432, tmp435, tmp461 }; + +/* + * The TMP401 registers, note some registers have different addresses for + * reading and writing + */ +#define TMP401_STATUS (0x02) +#define TMP401_CONFIG_READ (0x03) +#define TMP401_CONFIG_WRITE (0x09) +#define TMP401_CONVERSION_RATE_READ (0x04) +#define TMP401_CONVERSION_RATE_WRITE (0x0A) +#define TMP401_TEMP_CRIT_HYST (0x21) +#define TMP401_MANUFACTURER_ID_REG (0xFE) +#define TMP401_DEVICE_ID_REG (0xFF) +#define TMP401_DEVICE_CAR_REG (0x22) /* Consecutive Alert Register */ + +static const u8 TMP401_TEMP_MSB_READ[7][2] = { + { 0x00, 0x01 }, /* temp */ + { 0x06, 0x08 }, /* low limit */ + { 0x05, 0x07 }, /* high limit */ + { 0x20, 0x19 }, /* therm (crit) limit */ + { 0x30, 0x34 }, /* lowest */ + { 0x32, 0x36 }, /* highest */ + { 0, 0x11 }, /* offset */ +}; + +static const u8 TMP401_TEMP_MSB_WRITE[7][2] = { + { 0, 0 }, /* temp (unused) */ + { 0x0C, 0x0E }, /* low limit */ + { 0x0B, 0x0D }, /* high limit */ + { 0x20, 0x19 }, /* therm (crit) limit */ + { 0x30, 0x34 }, /* lowest */ + { 0x32, 0x36 }, /* highest */ + { 0, 0x11 }, /* offset */ +}; + +static const u8 TMP401_TEMP_LSB[7][2] = { + { 0x15, 0x10 }, /* temp */ + { 0x17, 0x14 }, /* low limit */ + { 0x16, 0x13 }, /* high limit */ + { 0, 0 }, /* therm (crit) limit (unused) */ + { 0x31, 0x35 }, /* lowest */ + { 0x33, 0x37 }, /* highest */ + { 0, 0x12 }, /* offset */ +}; + +static const u8 TMP432_TEMP_MSB_READ[4][3] = { + { 0x00, 0x01, 0x23 }, /* temp */ + { 0x06, 0x08, 0x16 }, /* low limit */ + { 0x05, 0x07, 0x15 }, /* high limit */ + { 0x20, 0x19, 0x1A }, /* therm (crit) limit */ +}; + +static const u8 TMP432_TEMP_MSB_WRITE[4][3] = { + { 0, 0, 0 }, /* temp - unused */ + { 0x0C, 0x0E, 0x16 }, /* low limit */ + { 0x0B, 0x0D, 0x15 }, /* high limit */ + { 0x20, 0x19, 0x1A }, /* therm (crit) limit */ +}; + +static const u8 TMP432_TEMP_LSB[3][3] = { + { 0x29, 0x10, 0x24 }, /* temp */ + { 0x3E, 0x14, 0x18 }, /* low limit */ + { 0x3D, 0x13, 0x17 }, /* high limit */ +}; + +/* [0] = fault, [1] = low, [2] = high, [3] = therm/crit */ +static const u8 TMP432_STATUS_REG[] = { + 0x1b, 0x36, 0x35, 0x37 }; + +/* Flags */ +#define TMP401_CONFIG_RANGE BIT(2) +#define TMP401_CONFIG_SHUTDOWN BIT(6) +#define TMP401_STATUS_LOCAL_CRIT BIT(0) +#define TMP401_STATUS_REMOTE_CRIT BIT(1) +#define TMP401_STATUS_REMOTE_OPEN BIT(2) +#define TMP401_STATUS_REMOTE_LOW BIT(3) +#define TMP401_STATUS_REMOTE_HIGH BIT(4) +#define TMP401_STATUS_LOCAL_LOW BIT(5) +#define TMP401_STATUS_LOCAL_HIGH BIT(6) + +/* On TMP432, each status has its own register */ +#define TMP432_STATUS_LOCAL BIT(0) +#define TMP432_STATUS_REMOTE1 BIT(1) +#define TMP432_STATUS_REMOTE2 BIT(2) + +/* Manufacturer / Device ID's */ +#define TMP401_MANUFACTURER_ID (0x55) +#define TMP401_DEVICE_ID (0x11) +#define TMP411A_DEVICE_ID (0x12) +#define TMP411B_DEVICE_ID (0x13) +#define TMP411C_DEVICE_ID (0x10) +#define TMP431_DEVICE_ID (0x31) +#define TMP432_DEVICE_ID (0x32) +#define TMP435_DEVICE_ID (0x35) + +/* Timeout function bit */ +#define TIMEOUT_STATE_BIT (7) /* 1:enable 0:disable */ +#define TIMEOUT_STATE_EN (1) /* 1:enable */ +#define TIMEOUT_STATE_IEN (0) /* 0:disable */ +#define TIMEOUT_STATE_NA "NA" +#define TMP401_TEMP_INVALID_RETRY_TIMES (3) + +/* input temp threshold check */ +typedef struct tmp401_temp_threshold_s { + int chip_type; + int temp_max; + int temp_min; +} tmp401_temp_threshold_t; + +static tmp401_temp_threshold_t g_tmp401_input_threshold_info[] = { + { + .chip_type = tmp411, + .temp_max = 127000, + .temp_min = -55000, + }, +}; + +/* + * Driver data (common to all clients) + */ + +static const struct i2c_device_id tmp401_id[] = { + { "wb_tmp401", tmp401 }, + { "wb_tmp411", tmp411 }, + { "wb_tmp431", tmp431 }, + { "wb_tmp432", tmp432 }, + { "wb_tmp435", tmp435 }, + { "wb_tmp461", tmp461 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, tmp401_id); + +/* + * Client data (each client gets its own) + */ + +struct tmp401_data { + struct i2c_client *client; + const struct attribute_group *groups[3]; + struct mutex update_lock; + char valid; /* zero until following fields are valid */ + unsigned long last_updated; /* in jiffies */ + enum chips kind; + + unsigned int update_interval; /* in milliseconds */ + + /* register values */ + u8 status[4]; + u8 config; + u16 temp[7][3]; + u8 temp_crit_hyst; +}; + +/* + * Sysfs attr show / store functions + */ + +static int tmp401_register_to_temp(u16 reg, u8 config) +{ + int temp = reg; + + if (config & TMP401_CONFIG_RANGE) + temp -= 64 * 256; + + return DIV_ROUND_CLOSEST(temp * 125, 32); +} + +static u16 tmp401_temp_to_register(long temp, u8 config, int zbits) +{ + if (config & TMP401_CONFIG_RANGE) { + temp = clamp_val(temp, -64000, 191000); + temp += 64000; + } else + temp = clamp_val(temp, 0, 127000); + + return DIV_ROUND_CLOSEST(temp * (1 << (8 - zbits)), 1000) << zbits; +} + +static int tmp401_update_device_reg16(struct i2c_client *client, + struct tmp401_data *data) +{ + int i, j, val; + int num_regs = data->kind == tmp411 ? 6 : 4; + int num_sensors = data->kind == tmp432 ? 3 : 2; + + for (i = 0; i < num_sensors; i++) { /* local / r1 / r2 */ + for (j = 0; j < num_regs; j++) { /* temp / low / ... */ + u8 regaddr; + /* + * High byte must be read first immediately followed + * by the low byte + */ + regaddr = data->kind == tmp432 ? + TMP432_TEMP_MSB_READ[j][i] : + TMP401_TEMP_MSB_READ[j][i]; + val = i2c_smbus_read_byte_data(client, regaddr); + if (val < 0) + return val; + data->temp[j][i] = val << 8; + if (j == 3) /* crit is msb only */ + continue; + regaddr = data->kind == tmp432 ? TMP432_TEMP_LSB[j][i] + : TMP401_TEMP_LSB[j][i]; + val = i2c_smbus_read_byte_data(client, regaddr); + if (val < 0) + return val; + data->temp[j][i] |= val; + } + } + return 0; +} + +static struct tmp401_data *tmp401_update_device(struct device *dev) +{ + struct tmp401_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->client; + struct tmp401_data *ret = data; + int i, val; + unsigned long next_update; + + mutex_lock(&data->update_lock); + + next_update = data->last_updated + + msecs_to_jiffies(data->update_interval); + if (time_after(jiffies, next_update) || !data->valid) { + if (data->kind != tmp432) { + /* + * The driver uses the TMP432 status format internally. + * Convert status to TMP432 format for other chips. + */ + val = i2c_smbus_read_byte_data(client, TMP401_STATUS); + if (val < 0) { + ret = ERR_PTR(val); + goto abort; + } + data->status[0] = + (val & TMP401_STATUS_REMOTE_OPEN) >> 1; + data->status[1] = + ((val & TMP401_STATUS_REMOTE_LOW) >> 2) | + ((val & TMP401_STATUS_LOCAL_LOW) >> 5); + data->status[2] = + ((val & TMP401_STATUS_REMOTE_HIGH) >> 3) | + ((val & TMP401_STATUS_LOCAL_HIGH) >> 6); + data->status[3] = val & (TMP401_STATUS_LOCAL_CRIT + | TMP401_STATUS_REMOTE_CRIT); + } else { + for (i = 0; i < ARRAY_SIZE(data->status); i++) { + val = i2c_smbus_read_byte_data(client, + TMP432_STATUS_REG[i]); + if (val < 0) { + ret = ERR_PTR(val); + goto abort; + } + data->status[i] = val; + } + } + + val = i2c_smbus_read_byte_data(client, TMP401_CONFIG_READ); + if (val < 0) { + ret = ERR_PTR(val); + goto abort; + } + data->config = val; + val = tmp401_update_device_reg16(client, data); + if (val < 0) { + ret = ERR_PTR(val); + goto abort; + } + val = i2c_smbus_read_byte_data(client, TMP401_TEMP_CRIT_HYST); + if (val < 0) { + ret = ERR_PTR(val); + goto abort; + } + data->temp_crit_hyst = val; + + data->last_updated = jiffies; + data->valid = 1; + } + +abort: + mutex_unlock(&data->update_lock); + return ret; +} + +static int tmp401_input_temp_check(struct tmp401_data *data, int input_val) +{ + int i, size; + + size = ARRAY_SIZE(g_tmp401_input_threshold_info); + + for (i = 0; i < size; i++) { + if (g_tmp401_input_threshold_info[i].chip_type == data->kind) { + if ((input_val > g_tmp401_input_threshold_info[i].temp_max) + || (input_val < g_tmp401_input_threshold_info[i].temp_min)) { + dev_dbg(&data->client->dev, "input temp: %d not in range[%d, %d]\n", + input_val, g_tmp401_input_threshold_info[i].temp_min, + g_tmp401_input_threshold_info[i].temp_max); + return -EINVAL; + } + dev_dbg(&data->client->dev, "input temp: %d in range[%d, %d]", input_val, + g_tmp401_input_threshold_info[i].temp_min, g_tmp401_input_threshold_info[i].temp_max); + return 0; + } + } + return 0; +} + +static ssize_t show_temp(struct device *dev, struct device_attribute *devattr, char *buf) +{ + int nr, index, i, value, ret; + struct tmp401_data *data; + struct i2c_client *client; + + data = dev_get_drvdata(dev); + client = data->client; + + nr = to_sensor_dev_attr_2(devattr)->nr; + index = to_sensor_dev_attr_2(devattr)->index; + + for (i = 0; i < TMP401_TEMP_INVALID_RETRY_TIMES; i++) { + data = tmp401_update_device(dev); + if (IS_ERR(data)) { + return PTR_ERR(data); + } + value = tmp401_register_to_temp(data->temp[nr][index], data->config); + if (nr != 0) { /* not input temp, return value */ + return sprintf(buf, "%d\n", value); + } + /* nr == 0 is temp input, do input_temp_check */ + ret = tmp401_input_temp_check(data, value); + if (ret == 0) { /* input temp check ok */ + return sprintf(buf, "%d\n", value); + } + if ((i + 1) < TMP401_TEMP_INVALID_RETRY_TIMES) { + msleep(data->update_interval); + } + } + dev_info(&client->dev, "temp%d_input value: %d invalid\n", index + 1, value); + return -EINVAL; +} + +static ssize_t show_temp_crit_hyst(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int temp, index = to_sensor_dev_attr(devattr)->index; + struct tmp401_data *data = tmp401_update_device(dev); + + if (IS_ERR(data)) + return PTR_ERR(data); + + mutex_lock(&data->update_lock); + temp = tmp401_register_to_temp(data->temp[3][index], data->config); + temp -= data->temp_crit_hyst * 1000; + mutex_unlock(&data->update_lock); + + return sprintf(buf, "%d\n", temp); +} + +static ssize_t show_status(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int nr = to_sensor_dev_attr_2(devattr)->nr; + int mask = to_sensor_dev_attr_2(devattr)->index; + struct tmp401_data *data = tmp401_update_device(dev); + + if (IS_ERR(data)) + return PTR_ERR(data); + + return sprintf(buf, "%d\n", !!(data->status[nr] & mask)); +} + +static ssize_t store_temp(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + int nr = to_sensor_dev_attr_2(devattr)->nr; + int index = to_sensor_dev_attr_2(devattr)->index; + struct tmp401_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->client; + long val; + u16 reg; + u8 regaddr; + + if (kstrtol(buf, 10, &val)) + return -EINVAL; + + reg = tmp401_temp_to_register(val, data->config, nr == 3 ? 8 : 4); + + mutex_lock(&data->update_lock); + + regaddr = data->kind == tmp432 ? TMP432_TEMP_MSB_WRITE[nr][index] + : TMP401_TEMP_MSB_WRITE[nr][index]; + i2c_smbus_write_byte_data(client, regaddr, reg >> 8); + if (nr != 3) { + regaddr = data->kind == tmp432 ? TMP432_TEMP_LSB[nr][index] + : TMP401_TEMP_LSB[nr][index]; + i2c_smbus_write_byte_data(client, regaddr, reg & 0xFF); + } + data->temp[nr][index] = reg; + + mutex_unlock(&data->update_lock); + + return count; +} + +static ssize_t store_temp_crit_hyst(struct device *dev, struct device_attribute + *devattr, const char *buf, size_t count) +{ + int temp, index = to_sensor_dev_attr(devattr)->index; + struct tmp401_data *data = tmp401_update_device(dev); + long val; + u8 reg; + + if (IS_ERR(data)) + return PTR_ERR(data); + + if (kstrtol(buf, 10, &val)) + return -EINVAL; + + if (data->config & TMP401_CONFIG_RANGE) + val = clamp_val(val, -64000, 191000); + else + val = clamp_val(val, 0, 127000); + + mutex_lock(&data->update_lock); + temp = tmp401_register_to_temp(data->temp[3][index], data->config); + val = clamp_val(val, temp - 255000, temp); + reg = ((temp - val) + 500) / 1000; + + i2c_smbus_write_byte_data(data->client, TMP401_TEMP_CRIT_HYST, + reg); + + data->temp_crit_hyst = reg; + + mutex_unlock(&data->update_lock); + + return count; +} + +/* + * Resets the historical measurements of minimum and maximum temperatures. + * This is done by writing any value to any of the minimum/maximum registers + * (0x30-0x37). + */ +static ssize_t reset_temp_history(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + struct tmp401_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->client; + long val; + + if (kstrtol(buf, 10, &val)) + return -EINVAL; + + if (val != 1) { + dev_err(dev, + "temp_reset_history value %ld not supported. Use 1 to reset the history!\n", + val); + return -EINVAL; + } + mutex_lock(&data->update_lock); + i2c_smbus_write_byte_data(client, TMP401_TEMP_MSB_WRITE[5][0], val); + data->valid = 0; + mutex_unlock(&data->update_lock); + + return count; +} + +static ssize_t show_update_interval(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct tmp401_data *data = dev_get_drvdata(dev); + + return sprintf(buf, "%u\n", data->update_interval); +} + +static ssize_t set_update_interval(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct tmp401_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->client; + unsigned long val; + int err, rate; + + err = kstrtoul(buf, 10, &val); + if (err) + return err; + + /* + * For valid rates, interval can be calculated as + * interval = (1 << (7 - rate)) * 125; + * Rounded rate is therefore + * rate = 7 - __fls(interval * 4 / (125 * 3)); + * Use clamp_val() to avoid overflows, and to ensure valid input + * for __fls. + */ + val = clamp_val(val, 125, 16000); + rate = 7 - __fls(val * 4 / (125 * 3)); + mutex_lock(&data->update_lock); + i2c_smbus_write_byte_data(client, TMP401_CONVERSION_RATE_WRITE, rate); + data->update_interval = (1 << (7 - rate)) * 125; + mutex_unlock(&data->update_lock); + + return count; +} + +/* + * Enable/disable the state of the timeout function + * @dev: device info + * @state: 1:enable 0:disable + */ +static int timeout_cfg(struct device *dev, int state) +{ + int rv, chip_type; + u8 reg_value; + struct tmp401_data *data; + struct i2c_client *client; + + data = dev_get_drvdata(dev); + client = data->client; + + /* get chip type */ + chip_type = data->kind; + dev_dbg(&client->dev, "set timeout. chip:%d, state:%d\n", chip_type, state); + + /* chip type check */ + if(chip_type != tmp401 && chip_type != tmp411) { + dev_info(&client->dev, + "Chip type: %d, not support timeout config.!\n", chip_type); + return -EPERM; + } + + /* parameter check */ + if(state != TIMEOUT_STATE_EN && state != TIMEOUT_STATE_IEN) { + dev_err(&client->dev, + "Parameter check error. state: %d not supported.!\n", state); + return -EINVAL; + } + + mutex_lock(&data->update_lock); + /* read the Consecutive alert register */ + reg_value = i2c_smbus_read_byte_data(client, TMP401_DEVICE_CAR_REG); + if (reg_value < 0) { + dev_err(&client->dev, "Failed to read. reg:0x%0x, value:%d\n", TMP401_DEVICE_CAR_REG, reg_value); + mutex_unlock(&data->update_lock); + return -EIO; + } + dev_dbg(&client->dev, "get register value. reg:0x%0x, value:0x%0x\n", TMP401_DEVICE_CAR_REG, reg_value); + + /* same value case, do not write */ + if((u8)state == (reg_value >> TIMEOUT_STATE_BIT)) { + mutex_unlock(&data->update_lock); + dev_info(&client->dev, "timeout config has been set and the current state is %d.\n", state); + return 0; + } + + /* calculate the register value */ + reg_value = (reg_value & ~(1 << TIMEOUT_STATE_BIT)) | (state << TIMEOUT_STATE_BIT); + + /* set the Consecutive alert register */ + dev_dbg(&client->dev, "set register value. reg:0x%0x, value:0x%0x\n", TMP401_DEVICE_CAR_REG, reg_value); + rv = i2c_smbus_write_byte_data(client, TMP401_DEVICE_CAR_REG, reg_value); + if (rv < 0) { + dev_err(&client->dev, + "set the register Error. reg:0x%0x, value:%d\n", TMP401_DEVICE_CAR_REG, reg_value); + mutex_unlock(&data->update_lock); + return -EIO; + } + mutex_unlock(&data->update_lock); + + dev_info(&client->dev, "set bus timeout success. reg:0x%0x, value:0x%0x\n", TMP401_DEVICE_CAR_REG, reg_value); + + return 0; +} + +static ssize_t set_timeout_en(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + int val, err; + struct i2c_client *client; + struct tmp401_data *data; + + data = dev_get_drvdata(dev); + client = data->client; + + err = kstrtoint(buf, 0, &val); + if (err) { + dev_err(&client->dev, + "kstrtoint error: %d.\n", err); + return err; + } + + err = timeout_cfg(dev, val); + if(err < 0) { + dev_err(&client->dev, + "set bus timeout error: %d. value:%d!\n", err, val); + return err; + } + + return count; +} + +static ssize_t show_timeout_en(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int chip_type; + u8 reg_value; + struct tmp401_data *data; + struct i2c_client *client; + + data = dev_get_drvdata(dev); + client = data->client; + + /* get chip type */ + chip_type = data->kind; + dev_dbg(&client->dev, "get timeout. chip:%d\n", chip_type); + + /* chip type check */ + if(chip_type != tmp401 && chip_type != tmp411) { + dev_info(&client->dev, + "Chip type: %d, not support timeout config.!\n", chip_type); + /* not support, return NA */ + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", TIMEOUT_STATE_NA); + } + + /* read the Consecutive alert register */ + reg_value = i2c_smbus_read_byte_data(client, TMP401_DEVICE_CAR_REG); + if (reg_value < 0) { + dev_err(&client->dev, "Failed to read. reg:0x%0x, value:%d\n", TMP401_DEVICE_CAR_REG, reg_value); + return -EIO; + } + dev_dbg(&client->dev, "get register value. reg:0x%0x, value:0x%0x\n", TMP401_DEVICE_CAR_REG, reg_value); + + /* decode the register value */ + reg_value = reg_value >> TIMEOUT_STATE_BIT; + + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", reg_value); +} + +static SENSOR_DEVICE_ATTR_2(temp1_input, S_IRUGO, show_temp, NULL, 0, 0); +static SENSOR_DEVICE_ATTR_2(temp1_min, S_IWUSR | S_IRUGO, show_temp, + store_temp, 1, 0); +static SENSOR_DEVICE_ATTR_2(temp1_max, S_IWUSR | S_IRUGO, show_temp, + store_temp, 2, 0); +static SENSOR_DEVICE_ATTR_2(temp1_crit, S_IWUSR | S_IRUGO, show_temp, + store_temp, 3, 0); +static SENSOR_DEVICE_ATTR(temp1_crit_hyst, S_IWUSR | S_IRUGO, + show_temp_crit_hyst, store_temp_crit_hyst, 0); +static SENSOR_DEVICE_ATTR_2(temp1_min_alarm, S_IRUGO, show_status, NULL, + 1, TMP432_STATUS_LOCAL); +static SENSOR_DEVICE_ATTR_2(temp1_max_alarm, S_IRUGO, show_status, NULL, + 2, TMP432_STATUS_LOCAL); +static SENSOR_DEVICE_ATTR_2(temp1_crit_alarm, S_IRUGO, show_status, NULL, + 3, TMP432_STATUS_LOCAL); +static SENSOR_DEVICE_ATTR_2(temp2_input, S_IRUGO, show_temp, NULL, 0, 1); +static SENSOR_DEVICE_ATTR_2(temp2_min, S_IWUSR | S_IRUGO, show_temp, + store_temp, 1, 1); +static SENSOR_DEVICE_ATTR_2(temp2_max, S_IWUSR | S_IRUGO, show_temp, + store_temp, 2, 1); +static SENSOR_DEVICE_ATTR_2(temp2_crit, S_IWUSR | S_IRUGO, show_temp, + store_temp, 3, 1); +static SENSOR_DEVICE_ATTR(temp2_crit_hyst, S_IRUGO, show_temp_crit_hyst, + NULL, 1); +static SENSOR_DEVICE_ATTR_2(temp2_fault, S_IRUGO, show_status, NULL, + 0, TMP432_STATUS_REMOTE1); +static SENSOR_DEVICE_ATTR_2(temp2_min_alarm, S_IRUGO, show_status, NULL, + 1, TMP432_STATUS_REMOTE1); +static SENSOR_DEVICE_ATTR_2(temp2_max_alarm, S_IRUGO, show_status, NULL, + 2, TMP432_STATUS_REMOTE1); +static SENSOR_DEVICE_ATTR_2(temp2_crit_alarm, S_IRUGO, show_status, NULL, + 3, TMP432_STATUS_REMOTE1); + +static DEVICE_ATTR(update_interval, S_IRUGO | S_IWUSR, show_update_interval, + set_update_interval); +static DEVICE_ATTR(timeout_en, S_IRUGO | S_IWUSR, show_timeout_en, set_timeout_en); + +static struct attribute *tmp401_attributes[] = { + &sensor_dev_attr_temp1_input.dev_attr.attr, + &sensor_dev_attr_temp1_min.dev_attr.attr, + &sensor_dev_attr_temp1_max.dev_attr.attr, + &sensor_dev_attr_temp1_crit.dev_attr.attr, + &sensor_dev_attr_temp1_crit_hyst.dev_attr.attr, + &sensor_dev_attr_temp1_max_alarm.dev_attr.attr, + &sensor_dev_attr_temp1_min_alarm.dev_attr.attr, + &sensor_dev_attr_temp1_crit_alarm.dev_attr.attr, + + &sensor_dev_attr_temp2_input.dev_attr.attr, + &sensor_dev_attr_temp2_min.dev_attr.attr, + &sensor_dev_attr_temp2_max.dev_attr.attr, + &sensor_dev_attr_temp2_crit.dev_attr.attr, + &sensor_dev_attr_temp2_crit_hyst.dev_attr.attr, + &sensor_dev_attr_temp2_fault.dev_attr.attr, + &sensor_dev_attr_temp2_max_alarm.dev_attr.attr, + &sensor_dev_attr_temp2_min_alarm.dev_attr.attr, + &sensor_dev_attr_temp2_crit_alarm.dev_attr.attr, + + &dev_attr_update_interval.attr, + &dev_attr_timeout_en.attr, + + NULL +}; + +static const struct attribute_group tmp401_group = { + .attrs = tmp401_attributes, +}; + +/* + * Additional features of the TMP411 chip. + * The TMP411 stores the minimum and maximum + * temperature measured since power-on, chip-reset, or + * minimum and maximum register reset for both the local + * and remote channels. + */ +static SENSOR_DEVICE_ATTR_2(temp1_lowest, S_IRUGO, show_temp, NULL, 4, 0); +static SENSOR_DEVICE_ATTR_2(temp1_highest, S_IRUGO, show_temp, NULL, 5, 0); +static SENSOR_DEVICE_ATTR_2(temp2_lowest, S_IRUGO, show_temp, NULL, 4, 1); +static SENSOR_DEVICE_ATTR_2(temp2_highest, S_IRUGO, show_temp, NULL, 5, 1); +static SENSOR_DEVICE_ATTR(temp_reset_history, S_IWUSR, NULL, reset_temp_history, + 0); + +static struct attribute *tmp411_attributes[] = { + &sensor_dev_attr_temp1_highest.dev_attr.attr, + &sensor_dev_attr_temp1_lowest.dev_attr.attr, + &sensor_dev_attr_temp2_highest.dev_attr.attr, + &sensor_dev_attr_temp2_lowest.dev_attr.attr, + &sensor_dev_attr_temp_reset_history.dev_attr.attr, + NULL +}; + +static const struct attribute_group tmp411_group = { + .attrs = tmp411_attributes, +}; + +static SENSOR_DEVICE_ATTR_2(temp3_input, S_IRUGO, show_temp, NULL, 0, 2); +static SENSOR_DEVICE_ATTR_2(temp3_min, S_IWUSR | S_IRUGO, show_temp, + store_temp, 1, 2); +static SENSOR_DEVICE_ATTR_2(temp3_max, S_IWUSR | S_IRUGO, show_temp, + store_temp, 2, 2); +static SENSOR_DEVICE_ATTR_2(temp3_crit, S_IWUSR | S_IRUGO, show_temp, + store_temp, 3, 2); +static SENSOR_DEVICE_ATTR(temp3_crit_hyst, S_IRUGO, show_temp_crit_hyst, + NULL, 2); +static SENSOR_DEVICE_ATTR_2(temp3_fault, S_IRUGO, show_status, NULL, + 0, TMP432_STATUS_REMOTE2); +static SENSOR_DEVICE_ATTR_2(temp3_min_alarm, S_IRUGO, show_status, NULL, + 1, TMP432_STATUS_REMOTE2); +static SENSOR_DEVICE_ATTR_2(temp3_max_alarm, S_IRUGO, show_status, NULL, + 2, TMP432_STATUS_REMOTE2); +static SENSOR_DEVICE_ATTR_2(temp3_crit_alarm, S_IRUGO, show_status, NULL, + 3, TMP432_STATUS_REMOTE2); + +static struct attribute *tmp432_attributes[] = { + &sensor_dev_attr_temp3_input.dev_attr.attr, + &sensor_dev_attr_temp3_min.dev_attr.attr, + &sensor_dev_attr_temp3_max.dev_attr.attr, + &sensor_dev_attr_temp3_crit.dev_attr.attr, + &sensor_dev_attr_temp3_crit_hyst.dev_attr.attr, + &sensor_dev_attr_temp3_fault.dev_attr.attr, + &sensor_dev_attr_temp3_max_alarm.dev_attr.attr, + &sensor_dev_attr_temp3_min_alarm.dev_attr.attr, + &sensor_dev_attr_temp3_crit_alarm.dev_attr.attr, + + NULL +}; + +static const struct attribute_group tmp432_group = { + .attrs = tmp432_attributes, +}; + +/* + * Additional features of the TMP461 chip. + * The TMP461 temperature offset for the remote channel. + */ +static SENSOR_DEVICE_ATTR_2(temp2_offset, S_IWUSR | S_IRUGO, show_temp, + store_temp, 6, 1); + +static struct attribute *tmp461_attributes[] = { + &sensor_dev_attr_temp2_offset.dev_attr.attr, + NULL +}; + +static const struct attribute_group tmp461_group = { + .attrs = tmp461_attributes, +}; + +/* + * Begin non sysfs callback code (aka Real code) + */ + +static int tmp401_init_client(struct tmp401_data *data, + struct i2c_client *client) +{ + int config, config_orig, status = 0; + + /* Set the conversion rate to 2 Hz */ + i2c_smbus_write_byte_data(client, TMP401_CONVERSION_RATE_WRITE, 5); + data->update_interval = 500; + + /* Start conversions (disable shutdown if necessary) */ + config = i2c_smbus_read_byte_data(client, TMP401_CONFIG_READ); + if (config < 0) + return config; + + config_orig = config; + config &= ~TMP401_CONFIG_SHUTDOWN; + + if (config != config_orig) + status = i2c_smbus_write_byte_data(client, + TMP401_CONFIG_WRITE, + config); + + return status; +} + +#if 0 +static int tmp401_detect(struct i2c_client *client, + struct i2c_board_info *info) +{ + enum chips kind; + struct i2c_adapter *adapter = client->adapter; + u8 reg; + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) + return -ENODEV; + + /* Detect and identify the chip */ + reg = i2c_smbus_read_byte_data(client, TMP401_MANUFACTURER_ID_REG); + if (reg != TMP401_MANUFACTURER_ID) + return -ENODEV; + + reg = i2c_smbus_read_byte_data(client, TMP401_DEVICE_ID_REG); + + switch (reg) { + case TMP401_DEVICE_ID: + if (client->addr != 0x4c) + return -ENODEV; + kind = tmp401; + break; + case TMP411A_DEVICE_ID: + if (client->addr != 0x4c) + return -ENODEV; + kind = tmp411; + break; + case TMP411B_DEVICE_ID: + if (client->addr != 0x4d) + return -ENODEV; + kind = tmp411; + break; + case TMP411C_DEVICE_ID: + if (client->addr != 0x4e) + return -ENODEV; + kind = tmp411; + break; + case TMP431_DEVICE_ID: + if (client->addr != 0x4c && client->addr != 0x4d) + return -ENODEV; + kind = tmp431; + break; + case TMP432_DEVICE_ID: + if (client->addr != 0x4c && client->addr != 0x4d) + return -ENODEV; + kind = tmp432; + break; + case TMP435_DEVICE_ID: + kind = tmp435; + break; + default: + return -ENODEV; + } + + reg = i2c_smbus_read_byte_data(client, TMP401_CONFIG_READ); + if (reg & 0x1b) + return -ENODEV; + + reg = i2c_smbus_read_byte_data(client, TMP401_CONVERSION_RATE_READ); + /* Datasheet says: 0x1-0x6 */ + if (reg > 15) + return -ENODEV; + + strlcpy(info->type, tmp401_id[kind].name, I2C_NAME_SIZE); + + return 0; +} +#endif + +static int tmp401_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + static const char * const names[] = { + "TMP401", "TMP411", "TMP431", "TMP432", "TMP435", "TMP461" + }; + struct device *dev = &client->dev; + struct device *hwmon_dev; + struct tmp401_data *data; + int groups = 0, status; + + data = devm_kzalloc(dev, sizeof(struct tmp401_data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->client = client; + mutex_init(&data->update_lock); + data->kind = id->driver_data; + + /* Initialize the TMP401 chip */ + status = tmp401_init_client(data, client); + if (status < 0) + return status; + + /* Register sysfs hooks */ + data->groups[groups++] = &tmp401_group; + + /* Register additional tmp411 sysfs hooks */ + if (data->kind == tmp411) + data->groups[groups++] = &tmp411_group; + + /* Register additional tmp432 sysfs hooks */ + if (data->kind == tmp432) + data->groups[groups++] = &tmp432_group; + + if (data->kind == tmp461) + data->groups[groups++] = &tmp461_group; + + hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, + data, data->groups); + if (IS_ERR(hwmon_dev)) + return PTR_ERR(hwmon_dev); + + /* disable the timeout function */ + status = timeout_cfg(hwmon_dev, TIMEOUT_STATE_IEN); + if((status < 0) && (status != -EPERM)) { + dev_err(dev, + "set bus timeout error when probing: %d.!\n", status); + /* here, no need call devm_hwmon_device_unregister, device managed. */ + return status; + } + + dev_info(dev, "Detected TI %s chip\n", names[data->kind]); + + return 0; +} + +static struct i2c_driver tmp401_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "wb_tmp401", + }, + .probe = tmp401_probe, + .id_table = tmp401_id, + /* .detect = tmp401_detect, */ + /* .address_list = normal_i2c, */ +}; + +module_i2c_driver(tmp401_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("Texas Instruments TMP401 temperature sensor driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_tps53622.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_tps53622.c new file mode 100644 index 000000000000..b68196d9f57c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_tps53622.c @@ -0,0 +1,265 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Hardware monitoring driver for Texas Instruments TPS53679 + * + * Copyright (c) 2017 Mellanox Technologies. All rights reserved. + * Copyright (c) 2017 Vadim Pasternak + */ + +#include +#include +#include +#include +#include +#include +#include +#include "wb_pmbus.h" + +enum chips { + tps53647, tps53667, tps53679, tps53681, tps53688, tps53622 +}; + +#define TPS53647_PAGE_NUM 1 + +#define TPS53679_PROT_VR12_5MV 0x01 /* VR12.0 mode, 5-mV DAC */ +#define TPS53679_PROT_VR12_5_10MV 0x02 /* VR12.5 mode, 10-mV DAC */ +#define TPS53679_PROT_VR13_10MV 0x04 /* VR13.0 mode, 10-mV DAC */ +#define TPS53679_PROT_IMVP8_5MV 0x05 /* IMVP8 mode, 5-mV DAC */ +#define TPS53679_PROT_VR13_5MV 0x07 /* VR13.0 mode, 5-mV DAC */ +#define TPS53679_PAGE_NUM 2 + +#define TPS53681_DEVICE_ID 0x81 + +#define TPS53681_PMBUS_REVISION 0x33 + +#define TPS53681_MFR_SPECIFIC_20 0xe4 /* Number of phases, per page */ + +static const struct i2c_device_id tps53679_id[]; + +static int tps53679_identify_mode(struct i2c_client *client, + struct pmbus_driver_info *info) +{ + u8 vout_params; + int i, ret; + + for (i = 0; i < info->pages; i++) { + /* Read the register with VOUT scaling value.*/ + ret = wb_pmbus_read_byte_data(client, i, PMBUS_VOUT_MODE); + if (ret < 0) + return ret; + + vout_params = ret & GENMASK(4, 0); + + switch (vout_params) { + case TPS53679_PROT_VR13_10MV: + case TPS53679_PROT_VR12_5_10MV: + info->vrm_version[i] = vr13; + break; + case TPS53679_PROT_VR13_5MV: + case TPS53679_PROT_VR12_5MV: + case TPS53679_PROT_IMVP8_5MV: + info->vrm_version[i] = vr12; + break; + default: + return -EINVAL; + } + } + + return 0; +} + +static int tps53679_identify_phases(struct i2c_client *client, + struct pmbus_driver_info *info) +{ + int ret; + + /* On TPS53681, only channel A provides per-phase output current */ + ret = wb_pmbus_read_byte_data(client, 0, TPS53681_MFR_SPECIFIC_20); + if (ret < 0) + return ret; + info->phases[0] = (ret & 0x07) + 1; + + return 0; +} + +static int tps53679_identify_chip(struct i2c_client *client, + u8 revision, u16 id) +{ + u8 buf[I2C_SMBUS_BLOCK_MAX]; + int ret; + + ret = wb_pmbus_read_byte_data(client, 0, PMBUS_REVISION); + if (ret < 0) + return ret; + if (ret != revision) { + dev_err(&client->dev, "Unexpected PMBus revision 0x%x\n", ret); + return -ENODEV; + } + + ret = i2c_smbus_read_block_data(client, PMBUS_IC_DEVICE_ID, buf); + if (ret < 0) + return ret; + if (ret != 1 || buf[0] != id) { + dev_err(&client->dev, "Unexpected device ID 0x%x\n", buf[0]); + return -ENODEV; + } + return 0; +} + +/* + * Common identification function for chips with multi-phase support. + * Since those chips have special configuration registers, we want to have + * some level of reassurance that we are really talking with the chip + * being probed. Check PMBus revision and chip ID. + */ +static int tps53679_identify_multiphase(struct i2c_client *client, + struct pmbus_driver_info *info, + int pmbus_rev, int device_id) +{ + int ret; + + ret = tps53679_identify_chip(client, pmbus_rev, device_id); + if (ret < 0) + return ret; + + ret = tps53679_identify_mode(client, info); + if (ret < 0) + return ret; + + return tps53679_identify_phases(client, info); +} + +static int tps53679_identify(struct i2c_client *client, + struct pmbus_driver_info *info) +{ + return tps53679_identify_mode(client, info); +} + +static int tps53681_identify(struct i2c_client *client, + struct pmbus_driver_info *info) +{ + return tps53679_identify_multiphase(client, info, + TPS53681_PMBUS_REVISION, + TPS53681_DEVICE_ID); +} + +static int tps53681_read_word_data(struct i2c_client *client, int page, + int phase, int reg) +{ + /* + * For reading the total output current (READ_IOUT) for all phases, + * the chip datasheet is a bit vague. It says "PHASE must be set to + * FFh to access all phases simultaneously. PHASE may also be set to + * 80h readack (!) the total phase current". + * Experiments show that the command does _not_ report the total + * current for all phases if the phase is set to 0xff. Instead, it + * appears to report the current of one of the phases. Override phase + * parameter with 0x80 when reading the total output current on page 0. + */ + if (reg == PMBUS_READ_IOUT && page == 0 && phase == 0xff) + return wb_pmbus_read_word_data(client, page, 0x80, reg); + return -ENODATA; +} + +static struct pmbus_driver_info tps53679_info = { + .format[PSC_VOLTAGE_IN] = linear, + .format[PSC_VOLTAGE_OUT] = vid, + .format[PSC_TEMPERATURE] = linear, + .format[PSC_CURRENT_OUT] = linear, + .format[PSC_POWER] = linear, + .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_PIN | + PMBUS_HAVE_STATUS_INPUT | + PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | + PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | + PMBUS_HAVE_POUT, + .func[1] = PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | + PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | + PMBUS_HAVE_POUT, + .pfunc[0] = PMBUS_HAVE_IOUT, + .pfunc[1] = PMBUS_HAVE_IOUT, + .pfunc[2] = PMBUS_HAVE_IOUT, + .pfunc[3] = PMBUS_HAVE_IOUT, + .pfunc[4] = PMBUS_HAVE_IOUT, + .pfunc[5] = PMBUS_HAVE_IOUT, +}; + +static int tps53679_probe(struct i2c_client *client) +{ + struct device *dev = &client->dev; + struct pmbus_driver_info *info; + enum chips chip_id; + + if (dev->of_node) + chip_id = (enum chips)of_device_get_match_data(dev); + else + chip_id = i2c_match_id(tps53679_id, client)->driver_data; + + info = devm_kmemdup(dev, &tps53679_info, sizeof(*info), GFP_KERNEL); + if (!info) + return -ENOMEM; + + switch (chip_id) { + case tps53647: + case tps53667: + info->pages = TPS53647_PAGE_NUM; + info->identify = tps53679_identify; + break; + case tps53679: + case tps53688: + case tps53622: + info->pages = TPS53679_PAGE_NUM; + info->identify = tps53679_identify; + break; + case tps53681: + info->pages = TPS53679_PAGE_NUM; + info->phases[0] = 6; + info->identify = tps53681_identify; + info->read_word_data = tps53681_read_word_data; + break; + default: + return -ENODEV; + } + + return wb_pmbus_do_probe(client, info); +} + +static const struct i2c_device_id tps53679_id[] = { + {"wb_tps53647", tps53647}, + {"wb_tps53667", tps53667}, + {"wb_tps53679", tps53679}, + {"wb_tps53681", tps53681}, + {"wb_tps53688", tps53688}, + {"wb_tps53622", tps53622}, + {} +}; + +MODULE_DEVICE_TABLE(i2c, tps53679_id); + +static const struct of_device_id __maybe_unused tps53679_of_match[] = { + {.compatible = "ti,wb_tps53647", .data = (void *)tps53647}, + {.compatible = "ti,wb_tps53667", .data = (void *)tps53667}, + {.compatible = "ti,wb_tps53679", .data = (void *)tps53679}, + {.compatible = "ti,wb_tps53681", .data = (void *)tps53681}, + {.compatible = "ti,wb_tps53688", .data = (void *)tps53688}, + {.compatible = "ti,wb_tps53622", .data = (void *)tps53622}, + {} +}; +MODULE_DEVICE_TABLE(of, tps53679_of_match); + +static struct i2c_driver tps53679_driver = { + .driver = { + .name = "wb_tps53622", + .of_match_table = of_match_ptr(tps53679_of_match), + }, + .probe_new = tps53679_probe, + .remove = wb_pmbus_do_remove, + .id_table = tps53679_id, +}; + +module_i2c_driver(tps53679_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("PMBus driver for Texas Instruments TPS53679"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_ucd9000.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_ucd9000.c new file mode 100644 index 000000000000..6d60b9d876c2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_ucd9000.c @@ -0,0 +1,720 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Hardware monitoring driver for UCD90xxx Sequencer and System Health + * Controller series + * + * Copyright (C) 2011 Ericsson AB. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "wb_pmbus.h" + +#define mem_clear(data, size) memset((data), 0, (size)) + +enum chips { ucd9000, ucd90120, ucd90124, ucd90160, ucd90320, ucd9090, + ucd90910 }; + +#define UCD9000_MONITOR_CONFIG 0xd5 +#define UCD9000_NUM_PAGES 0xd6 +#define UCD9000_FAN_CONFIG_INDEX 0xe7 +#define UCD9000_FAN_CONFIG 0xe8 +#define UCD9000_MFR_STATUS 0xf3 +#define UCD9000_GPIO_SELECT 0xfa +#define UCD9000_GPIO_CONFIG 0xfb +#define UCD9000_DEVICE_ID 0xfd + +/* GPIO CONFIG bits */ +#define UCD9000_GPIO_CONFIG_ENABLE BIT(0) +#define UCD9000_GPIO_CONFIG_OUT_ENABLE BIT(1) +#define UCD9000_GPIO_CONFIG_OUT_VALUE BIT(2) +#define UCD9000_GPIO_CONFIG_STATUS BIT(3) +#define UCD9000_GPIO_INPUT 0 +#define UCD9000_GPIO_OUTPUT 1 + +#define UCD9000_MON_TYPE(x) (((x) >> 5) & 0x07) +#define UCD9000_MON_PAGE(x) ((x) & 0x1f) + +#define UCD9000_MON_VOLTAGE 1 +#define UCD9000_MON_TEMPERATURE 2 +#define UCD9000_MON_CURRENT 3 +#define UCD9000_MON_VOLTAGE_HW 4 + +#define UCD9000_NUM_FAN 4 + +#define UCD9000_GPIO_NAME_LEN 16 +#define UCD9090_NUM_GPIOS 23 +#define UCD901XX_NUM_GPIOS 26 +#define UCD90320_NUM_GPIOS 84 +#define UCD90910_NUM_GPIOS 26 + +#define UCD9000_DEBUGFS_NAME_LEN 24 +#define UCD9000_GPI_COUNT 8 +#define UCD90320_GPI_COUNT 32 + +#define UCD9000_RETRY_SLEEP_TIME (10000) /* 10ms */ +#define UCD9000_RETRY_TIME (3) +#define WB_DEV_NAME_MAX_LEN (64) + +static int g_wb_ucd9000_debug = 0; +static int g_wb_ucd9000_error = 0; + +module_param(g_wb_ucd9000_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_ucd9000_error, int, S_IRUGO | S_IWUSR); + +#define WB_UDC9000_VERBOSE(fmt, args...) do { \ + if (g_wb_ucd9000_debug) { \ + printk(KERN_INFO "[WB_UCD9000][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_UDC9000_ERROR(fmt, args...) do { \ + if (g_wb_ucd9000_error) { \ + printk(KERN_ERR "[WB_UCD9000][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +struct ucd9000_data { + u8 fan_data[UCD9000_NUM_FAN][I2C_SMBUS_BLOCK_MAX]; + struct pmbus_driver_info info; +#ifdef CONFIG_GPIOLIB + struct gpio_chip gpio; +#endif + struct dentry *debugfs; +}; +#define to_ucd9000_data(_info) container_of(_info, struct ucd9000_data, info) + +struct ucd9000_debugfs_entry { + struct i2c_client *client; + u8 index; +}; + +static int wb_i2c_smbus_read_block_data_tmp(const struct i2c_client *client, u8 command, u8 *values) +{ + + struct i2c_msg msg[2]; + int status; + u8 read_buf[I2C_SMBUS_BLOCK_MAX + 1]; + int read_len, val_len; + + val_len = i2c_smbus_read_byte_data(client, command); + if (val_len < 0) { + WB_UDC9000_ERROR("read byte failed. nr:%d, addr:0x%x, reg:0x%x, ret:%d.\n", + client->adapter->nr, client->addr, command, val_len); + return -ENXIO; + } + read_len = val_len + 1; + if (read_len > sizeof(read_buf)) { + WB_UDC9000_ERROR("Out of memory, val_len: %d, read length: %d, read buf len: %lu.\n", + val_len, read_len, sizeof(read_buf)); + return -ENOMEM; + } + + mem_clear(msg, sizeof(msg)); + msg[0].addr = client->addr; + msg[0].buf = &command; + msg[0].len = 1; + + msg[1].addr = client->addr; + msg[1].flags = I2C_M_RD; + msg[1].buf = read_buf; + msg[1].len = read_len; + + status = i2c_transfer(client->adapter, msg, 2); + if (status != 2) { + WB_UDC9000_ERROR("i2c_transfer failed. nr:%d, addr:0x%x, reg:0x%x, read len:%d, status:%d.\n", + client->adapter->nr, client->addr, command, read_len, status); + return -EIO; + } + WB_UDC9000_VERBOSE("read_block_data success. nr:%d, addr:0x%x, reg:0x%x, read len:%d", + client->adapter->nr, client->addr, command, read_len); + memcpy(values, &read_buf[1], val_len); + return val_len; +} + +static int wb_i2c_smbus_read_block_data(const struct i2c_client *client, u8 command, u8 *values) +{ + int rv, i; + + for(i = 0; i < UCD9000_RETRY_TIME; i++) { + rv = wb_i2c_smbus_read_block_data_tmp(client, command, values); + if(rv >= 0){ + return rv; + } + usleep_range(UCD9000_RETRY_SLEEP_TIME, UCD9000_RETRY_SLEEP_TIME + 1); + } + WB_UDC9000_ERROR("read_block_data failed. nr: %d, addr: 0x%x, reg: 0x%x, rv: %d\n", + client->adapter->nr, client->addr, command, rv); + return rv; +} + +static int ucd9000_get_fan_config(struct i2c_client *client, int fan) +{ + int fan_config = 0; + struct ucd9000_data *data + = to_ucd9000_data(wb_pmbus_get_driver_info(client)); + + if (data->fan_data[fan][3] & 1) + fan_config |= PB_FAN_2_INSTALLED; /* Use lower bit position */ + + /* Pulses/revolution */ + fan_config |= (data->fan_data[fan][3] & 0x06) >> 1; + + return fan_config; +} + +static int ucd9000_read_byte_data(struct i2c_client *client, int page, int reg) +{ + int ret = 0; + int fan_config; + + switch (reg) { + case PMBUS_FAN_CONFIG_12: + if (page > 0) + return -ENXIO; + + ret = ucd9000_get_fan_config(client, 0); + if (ret < 0) + return ret; + fan_config = ret << 4; + ret = ucd9000_get_fan_config(client, 1); + if (ret < 0) + return ret; + fan_config |= ret; + ret = fan_config; + break; + case PMBUS_FAN_CONFIG_34: + if (page > 0) + return -ENXIO; + + ret = ucd9000_get_fan_config(client, 2); + if (ret < 0) + return ret; + fan_config = ret << 4; + ret = ucd9000_get_fan_config(client, 3); + if (ret < 0) + return ret; + fan_config |= ret; + ret = fan_config; + break; + default: + ret = -ENODATA; + break; + } + return ret; +} + +static const struct i2c_device_id ucd9000_id[] = { + {"wb_ucd9000", ucd9000}, + {"wb_ucd90120", ucd90120}, + {"wb_ucd90124", ucd90124}, + {"wb_ucd90160", ucd90160}, + {"wb_ucd90320", ucd90320}, + {"wb_ucd9090", ucd9090}, + {"wb_ucd90910", ucd90910}, + {} +}; +MODULE_DEVICE_TABLE(i2c, ucd9000_id); + +static const struct of_device_id __maybe_unused ucd9000_of_match[] = { + { + .compatible = "ti,wb_ucd9000", + .data = (void *)ucd9000 + }, + { + .compatible = "ti,wb_ucd90120", + .data = (void *)ucd90120 + }, + { + .compatible = "ti,wb_ucd90124", + .data = (void *)ucd90124 + }, + { + .compatible = "ti,wb_ucd90160", + .data = (void *)ucd90160 + }, + { + .compatible = "ti,wb_ucd90320", + .data = (void *)ucd90320 + }, + { + .compatible = "ti,wb_ucd9090", + .data = (void *)ucd9090 + }, + { + .compatible = "ti,wb_ucd90910", + .data = (void *)ucd90910 + }, + { }, +}; +MODULE_DEVICE_TABLE(of, ucd9000_of_match); + +#ifdef CONFIG_GPIOLIB +static int ucd9000_gpio_read_config(struct i2c_client *client, + unsigned int offset) +{ + int ret; + + /* No page set required */ + ret = i2c_smbus_write_byte_data(client, UCD9000_GPIO_SELECT, offset); + if (ret < 0) + return ret; + + return i2c_smbus_read_byte_data(client, UCD9000_GPIO_CONFIG); +} + +static int ucd9000_gpio_get(struct gpio_chip *gc, unsigned int offset) +{ + struct i2c_client *client = gpiochip_get_data(gc); + int ret; + + ret = ucd9000_gpio_read_config(client, offset); + if (ret < 0) + return ret; + + return !!(ret & UCD9000_GPIO_CONFIG_STATUS); +} + +static void ucd9000_gpio_set(struct gpio_chip *gc, unsigned int offset, + int value) +{ + struct i2c_client *client = gpiochip_get_data(gc); + int ret; + + ret = ucd9000_gpio_read_config(client, offset); + if (ret < 0) { + dev_dbg(&client->dev, "failed to read GPIO %d config: %d\n", + offset, ret); + return; + } + + if (value) { + if (ret & UCD9000_GPIO_CONFIG_STATUS) + return; + + ret |= UCD9000_GPIO_CONFIG_STATUS; + } else { + if (!(ret & UCD9000_GPIO_CONFIG_STATUS)) + return; + + ret &= ~UCD9000_GPIO_CONFIG_STATUS; + } + + ret |= UCD9000_GPIO_CONFIG_ENABLE; + + /* Page set not required */ + ret = i2c_smbus_write_byte_data(client, UCD9000_GPIO_CONFIG, ret); + if (ret < 0) { + dev_dbg(&client->dev, "Failed to write GPIO %d config: %d\n", + offset, ret); + return; + } + + ret &= ~UCD9000_GPIO_CONFIG_ENABLE; + + ret = i2c_smbus_write_byte_data(client, UCD9000_GPIO_CONFIG, ret); + if (ret < 0) + dev_dbg(&client->dev, "Failed to write GPIO %d config: %d\n", + offset, ret); +} + +static int ucd9000_gpio_get_direction(struct gpio_chip *gc, + unsigned int offset) +{ + struct i2c_client *client = gpiochip_get_data(gc); + int ret; + + ret = ucd9000_gpio_read_config(client, offset); + if (ret < 0) + return ret; + + return !(ret & UCD9000_GPIO_CONFIG_OUT_ENABLE); +} + +static int ucd9000_gpio_set_direction(struct gpio_chip *gc, + unsigned int offset, bool direction_out, + int requested_out) +{ + struct i2c_client *client = gpiochip_get_data(gc); + int ret, config, out_val; + + ret = ucd9000_gpio_read_config(client, offset); + if (ret < 0) + return ret; + + if (direction_out) { + out_val = requested_out ? UCD9000_GPIO_CONFIG_OUT_VALUE : 0; + + if (ret & UCD9000_GPIO_CONFIG_OUT_ENABLE) { + if ((ret & UCD9000_GPIO_CONFIG_OUT_VALUE) == out_val) + return 0; + } else { + ret |= UCD9000_GPIO_CONFIG_OUT_ENABLE; + } + + if (out_val) + ret |= UCD9000_GPIO_CONFIG_OUT_VALUE; + else + ret &= ~UCD9000_GPIO_CONFIG_OUT_VALUE; + + } else { + if (!(ret & UCD9000_GPIO_CONFIG_OUT_ENABLE)) + return 0; + + ret &= ~UCD9000_GPIO_CONFIG_OUT_ENABLE; + } + + ret |= UCD9000_GPIO_CONFIG_ENABLE; + config = ret; + + /* Page set not required */ + ret = i2c_smbus_write_byte_data(client, UCD9000_GPIO_CONFIG, config); + if (ret < 0) + return ret; + + config &= ~UCD9000_GPIO_CONFIG_ENABLE; + + return i2c_smbus_write_byte_data(client, UCD9000_GPIO_CONFIG, config); +} + +static int ucd9000_gpio_direction_input(struct gpio_chip *gc, + unsigned int offset) +{ + return ucd9000_gpio_set_direction(gc, offset, UCD9000_GPIO_INPUT, 0); +} + +static int ucd9000_gpio_direction_output(struct gpio_chip *gc, + unsigned int offset, int val) +{ + return ucd9000_gpio_set_direction(gc, offset, UCD9000_GPIO_OUTPUT, + val); +} + +static void ucd9000_probe_gpio(struct i2c_client *client, + const struct i2c_device_id *mid, + struct ucd9000_data *data) +{ + int rc; + + switch (mid->driver_data) { + case ucd9090: + data->gpio.ngpio = UCD9090_NUM_GPIOS; + break; + case ucd90120: + case ucd90124: + case ucd90160: + data->gpio.ngpio = UCD901XX_NUM_GPIOS; + break; + case ucd90320: + data->gpio.ngpio = UCD90320_NUM_GPIOS; + break; + case ucd90910: + data->gpio.ngpio = UCD90910_NUM_GPIOS; + break; + default: + return; /* GPIO support is optional. */ + } + + /* + * Pinmux support has not been added to the new gpio_chip. + * This support should be added when possible given the mux + * behavior of these IO devices. + */ + data->gpio.label = client->name; + data->gpio.get_direction = ucd9000_gpio_get_direction; + data->gpio.direction_input = ucd9000_gpio_direction_input; + data->gpio.direction_output = ucd9000_gpio_direction_output; + data->gpio.get = ucd9000_gpio_get; + data->gpio.set = ucd9000_gpio_set; + data->gpio.can_sleep = true; + data->gpio.base = -1; + data->gpio.parent = &client->dev; + + rc = devm_gpiochip_add_data(&client->dev, &data->gpio, client); + if (rc) + dev_warn(&client->dev, "Could not add gpiochip: %d\n", rc); +} +#else +static void ucd9000_probe_gpio(struct i2c_client *client, + const struct i2c_device_id *mid, + struct ucd9000_data *data) +{ +} +#endif /* CONFIG_GPIOLIB */ + +#ifdef CONFIG_DEBUG_FS +static int ucd9000_get_mfr_status(struct i2c_client *client, u8 *buffer) +{ + int ret = wb_pmbus_set_page(client, 0, 0xff); + + if (ret < 0) + return ret; + + return wb_i2c_smbus_read_block_data(client, UCD9000_MFR_STATUS, buffer); +} + +static int ucd9000_debugfs_show_mfr_status_bit(void *data, u64 *val) +{ + struct ucd9000_debugfs_entry *entry = data; + struct i2c_client *client = entry->client; + u8 buffer[I2C_SMBUS_BLOCK_MAX]; + int ret, i; + + ret = ucd9000_get_mfr_status(client, buffer); + if (ret < 0) + return ret; + + /* + * GPI fault bits are in sets of 8, two bytes from end of response. + */ + i = ret - 3 - entry->index / 8; + if (i >= 0) + *val = !!(buffer[i] & BIT(entry->index % 8)); + + return 0; +} +DEFINE_DEBUGFS_ATTRIBUTE(ucd9000_debugfs_mfr_status_bit, + ucd9000_debugfs_show_mfr_status_bit, NULL, "%1lld\n"); + +static ssize_t ucd9000_debugfs_read_mfr_status(struct file *file, + char __user *buf, size_t count, + loff_t *ppos) +{ + struct i2c_client *client = file->private_data; + u8 buffer[I2C_SMBUS_BLOCK_MAX]; + char str[(I2C_SMBUS_BLOCK_MAX * 2) + 2]; + char *res; + int rc; + + rc = ucd9000_get_mfr_status(client, buffer); + if (rc < 0) + return rc; + + res = bin2hex(str, buffer, min(rc, I2C_SMBUS_BLOCK_MAX)); + *res++ = '\n'; + *res = 0; + + return simple_read_from_buffer(buf, count, ppos, str, res - str); +} + +static const struct file_operations ucd9000_debugfs_show_mfr_status_fops = { + .llseek = noop_llseek, + .read = ucd9000_debugfs_read_mfr_status, + .open = simple_open, +}; + +static int ucd9000_init_debugfs(struct i2c_client *client, + const struct i2c_device_id *mid, + struct ucd9000_data *data) +{ + struct dentry *debugfs; + struct ucd9000_debugfs_entry *entries; + int i, gpi_count; + char name[UCD9000_DEBUGFS_NAME_LEN]; + + debugfs = wb_pmbus_get_debugfs_dir(client); + if (!debugfs) + return -ENOENT; + + data->debugfs = debugfs_create_dir(client->name, debugfs); + if (!data->debugfs) + return -ENOENT; + + /* + * Of the chips this driver supports, only the UCD9090, UCD90160, + * UCD90320, and UCD90910 report GPI faults in their MFR_STATUS + * register, so only create the GPI fault debugfs attributes for those + * chips. + */ + if (mid->driver_data == ucd9090 || mid->driver_data == ucd90160 || + mid->driver_data == ucd90320 || mid->driver_data == ucd90910) { + gpi_count = mid->driver_data == ucd90320 ? UCD90320_GPI_COUNT + : UCD9000_GPI_COUNT; + entries = devm_kcalloc(&client->dev, + gpi_count, sizeof(*entries), + GFP_KERNEL); + if (!entries) + return -ENOMEM; + + for (i = 0; i < gpi_count; i++) { + entries[i].client = client; + entries[i].index = i; + scnprintf(name, UCD9000_DEBUGFS_NAME_LEN, + "gpi%d_alarm", i + 1); + debugfs_create_file(name, 0444, data->debugfs, + &entries[i], + &ucd9000_debugfs_mfr_status_bit); + } + } + + scnprintf(name, UCD9000_DEBUGFS_NAME_LEN, "mfr_status"); + debugfs_create_file(name, 0444, data->debugfs, client, + &ucd9000_debugfs_show_mfr_status_fops); + + return 0; +} +#else +static int ucd9000_init_debugfs(struct i2c_client *client, + const struct i2c_device_id *mid, + struct ucd9000_data *data) +{ + return 0; +} +#endif /* CONFIG_DEBUG_FS */ + +static int ucd9000_probe(struct i2c_client *client) +{ + u8 block_buffer[I2C_SMBUS_BLOCK_MAX + 1]; + char wb_device_name[WB_DEV_NAME_MAX_LEN]; + struct ucd9000_data *data; + struct pmbus_driver_info *info; + const struct i2c_device_id *mid; + enum chips chip; + int i, ret; + + if (!i2c_check_functionality(client->adapter, + I2C_FUNC_SMBUS_BYTE_DATA)) + return -ENODEV; + + ret = wb_i2c_smbus_read_block_data(client, UCD9000_DEVICE_ID, + block_buffer); + if (ret < 0) { + dev_err(&client->dev, "Failed to read device ID\n"); + return ret; + } + block_buffer[ret] = '\0'; + dev_info(&client->dev, "Device ID %s\n", block_buffer); + + mem_clear(wb_device_name, sizeof(wb_device_name)); + snprintf(wb_device_name, sizeof(wb_device_name), "wb_%s", block_buffer); + + for (mid = ucd9000_id; mid->name[0]; mid++) { + if (!strncasecmp(mid->name, wb_device_name, strlen(mid->name))) + break; + } + if (!mid->name[0]) { + dev_err(&client->dev, "Unsupported device\n"); + return -ENODEV; + } + + if (client->dev.of_node) + chip = (enum chips)of_device_get_match_data(&client->dev); + else + chip = mid->driver_data; + + if (chip != ucd9000 && strcmp(client->name, mid->name) != 0) + dev_notice(&client->dev, + "Device mismatch: Configured %s, detected %s\n", + client->name, mid->name); + + data = devm_kzalloc(&client->dev, sizeof(struct ucd9000_data), + GFP_KERNEL); + if (!data) + return -ENOMEM; + info = &data->info; + + ret = i2c_smbus_read_byte_data(client, UCD9000_NUM_PAGES); + if (ret < 0) { + dev_err(&client->dev, + "Failed to read number of active pages\n"); + return ret; + } + info->pages = ret; + if (!info->pages) { + dev_err(&client->dev, "No pages configured\n"); + return -ENODEV; + } + + /* The internal temperature sensor is always active */ + /* ucd90160 have no temperature */ + /* info->func[0] = PMBUS_HAVE_TEMP; */ + + /* Everything else is configurable */ + ret = wb_i2c_smbus_read_block_data(client, UCD9000_MONITOR_CONFIG, + block_buffer); + if (ret <= 0) { + dev_err(&client->dev, "Failed to read configuration data\n"); + return -ENODEV; + } + for (i = 0; i < ret; i++) { + int page = UCD9000_MON_PAGE(block_buffer[i]); + + if (page >= info->pages) + continue; + + switch (UCD9000_MON_TYPE(block_buffer[i])) { + case UCD9000_MON_VOLTAGE: + case UCD9000_MON_VOLTAGE_HW: + info->func[page] |= PMBUS_HAVE_VOUT + | PMBUS_HAVE_STATUS_VOUT; + break; + case UCD9000_MON_TEMPERATURE: + info->func[page] |= PMBUS_HAVE_TEMP2 + | PMBUS_HAVE_STATUS_TEMP; + break; + case UCD9000_MON_CURRENT: + info->func[page] |= PMBUS_HAVE_IOUT + | PMBUS_HAVE_STATUS_IOUT; + break; + default: + break; + } + } + + /* Fan configuration */ + if (mid->driver_data == ucd90124) { + for (i = 0; i < UCD9000_NUM_FAN; i++) { + i2c_smbus_write_byte_data(client, + UCD9000_FAN_CONFIG_INDEX, i); + ret = wb_i2c_smbus_read_block_data(client, + UCD9000_FAN_CONFIG, + data->fan_data[i]); + if (ret < 0) + return ret; + } + i2c_smbus_write_byte_data(client, UCD9000_FAN_CONFIG_INDEX, 0); + + info->read_byte_data = ucd9000_read_byte_data; + info->func[0] |= PMBUS_HAVE_FAN12 | PMBUS_HAVE_STATUS_FAN12 + | PMBUS_HAVE_FAN34 | PMBUS_HAVE_STATUS_FAN34; + } + + ucd9000_probe_gpio(client, mid, data); + + ret = wb_pmbus_do_probe(client, info); + if (ret) + return ret; + + ret = ucd9000_init_debugfs(client, mid, data); + if (ret) + dev_warn(&client->dev, "Failed to register debugfs: %d\n", + ret); + + return 0; +} + +/* This is the driver that will be inserted */ +static struct i2c_driver ucd9000_driver = { + .driver = { + .name = "wb_ucd9000", + .of_match_table = of_match_ptr(ucd9000_of_match), + }, + .probe_new = ucd9000_probe, + .remove = wb_pmbus_do_remove, + .id_table = ucd9000_id, +}; + +module_i2c_driver(ucd9000_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("PMBus driver for TI UCD90xxx"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_xdpe12284.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_xdpe12284.c new file mode 100644 index 000000000000..f45d683e3464 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_xdpe12284.c @@ -0,0 +1,499 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Hardware monitoring driver for Infineon Multi-phase Digital VR Controllers + * + * Copyright (c) 2020 Mellanox Technologies. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "wb_pmbus.h" + +#define XDPE122_PROT_VR12_5MV (0x01) /* VR12.0 mode, 5-mV DAC */ +#define XDPE122_PROT_VR12_5_10MV (0x02) /* VR12.5 mode, 10-mV DAC */ +#define XDPE122_PROT_IMVP9_10MV (0x03) /* IMVP9 mode, 10-mV DAC */ +#define XDPE122_AMD_625MV (0x10) /* AMD mode 6.25mV */ +#define XDPE122_PAGE_NUM (2) +#define XDPE122_WRITE_PROTECT_CLOSE (0x00) +#define XDPE122_WRITE_PROTECT_OPEN (0x40) + +static int g_wb_xdpe122_debug = 0; +static int g_wb_xdpe122_error = 0; + +module_param(g_wb_xdpe122_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_xdpe122_error, int, S_IRUGO | S_IWUSR); + +#define WB_XDPE122_VERBOSE(fmt, args...) do { \ + if (g_wb_xdpe122_debug) { \ + printk(KERN_INFO "[WB_XDPE122][VER][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_XDPE122_ERROR(fmt, args...) do { \ + if (g_wb_xdpe122_error) { \ + printk(KERN_ERR "[WB_XDPE122][ERR][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static int xdpe122_data2reg_vid(struct pmbus_data *data, int page, long val) +{ + int vrm_version; + + vrm_version = data->info->vrm_version[page]; + WB_XDPE122_VERBOSE("page%d, vrm_version: %d, data_val: %ld\n", + page, vrm_version, val); + /* Convert data to VID register. */ + switch (vrm_version) { + case vr13: + if (val >= 500) { + return 1 + DIV_ROUND_CLOSEST(val - 500, 10); + } + return 0; + case vr12: + if (val >= 250) { + return 1 + DIV_ROUND_CLOSEST(val - 250, 5); + } + return 0; + case imvp9: + if (val >= 200) { + return 1 + DIV_ROUND_CLOSEST(val - 200, 10); + } + return 0; + case amd625mv: + if (val >= 200 && val <= 1550) { + return DIV_ROUND_CLOSEST((1550 - val) * 100, 625); + } + return 0; + default: + WB_XDPE122_ERROR("Unsupport vrm_version, page%d, vrm_version: %d\n", + page, vrm_version); + return -EINVAL; + } + return 0; +} + +/* + * Convert VID sensor values to milli- or micro-units + * depending on sensor type. + */ +static s64 xdpe122_reg2data_vid(struct pmbus_data *data, int page, long val) +{ + + long rv; + int vrm_version; + + rv = 0; + vrm_version = data->info->vrm_version[page]; + switch (vrm_version) { + case vr11: + if (val >= 0x02 && val <= 0xb2) + rv = DIV_ROUND_CLOSEST(160000 - (val - 2) * 625, 100); + break; + case vr12: + if (val >= 0x01) + rv = 250 + (val - 1) * 5; + break; + case vr13: + if (val >= 0x01) + rv = 500 + (val - 1) * 10; + break; + case imvp9: + if (val >= 0x01) + rv = 200 + (val - 1) * 10; + break; + case amd625mv: + if (val >= 0x0 && val <= 0xd8) + rv = DIV_ROUND_CLOSEST(155000 - val * 625, 100); + break; + } + WB_XDPE122_VERBOSE("page%d, vrm_version: %d, reg_val: 0x%lx, data_val: %ld\n", + page, vrm_version, val, rv); + return rv; +} + +static ssize_t xdpe122_avs_vout_show(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int vout_cmd, vout; + + mutex_lock(&data->update_lock); + vout_cmd = wb_pmbus_read_word_data(client, attr->index, 0xff, PMBUS_VOUT_COMMAND); + if (vout_cmd < 0) { + WB_XDPE122_ERROR("%d-%04x: read page%d, vout command reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, PMBUS_VOUT_COMMAND, vout_cmd); + mutex_unlock(&data->update_lock); + return vout_cmd; + } + + vout = xdpe122_reg2data_vid(data, attr->index, vout_cmd); + vout = vout * 1000; + WB_XDPE122_VERBOSE("%d-%04x: page%d, vout command reg_val: 0x%x, vout: %d uV\n", + client->adapter->nr, client->addr, attr->index, vout_cmd, vout); + + mutex_unlock(&data->update_lock); + return snprintf(buf, PAGE_SIZE, "%d\n", vout); +} + +static ssize_t xdpe122_avs_vout_store(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int vout, vout_max, vout_min, vout_mv; + int ret, vout_cmd, vout_cmd_set; + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_XDPE122_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + ret = kstrtoint(buf, 0, &vout); + if (ret) { + WB_XDPE122_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + + if (vout <= 0) { + WB_XDPE122_ERROR("%d-%04x: invalid value: %d \n", client->adapter->nr, client->addr, vout); + return -EINVAL; + } + + vout_max = data->vout_max[attr->index]; + vout_min = data->vout_min[attr->index]; + if ((vout > vout_max) || (vout < vout_min)) { + WB_XDPE122_ERROR("%d-%04x: vout value: %d, out of range [%d, %d] \n", client->adapter->nr, + client->addr, vout, vout_min, vout_max); + return -EINVAL; + } + + /* calc VOUT_COMMAND set value Unit must be mV*/ + vout_mv = vout / 1000; + vout_cmd_set = xdpe122_data2reg_vid(data, attr->index, vout_mv); + if ((vout_cmd_set < 0) || (vout_cmd_set > 0xffff)) { + WB_XDPE122_ERROR("%d-%04x: invalid value, vout %d uV, vout_cmd_set: %d\n", + client->adapter->nr, client->addr, vout, vout_cmd_set); + return -EINVAL; + } + + mutex_lock(&data->update_lock); + + /* close write protect */ + ret = wb_pmbus_write_byte_data(client, attr->index, PMBUS_WRITE_PROTECT, XDPE122_WRITE_PROTECT_CLOSE); + if (ret < 0) { + WB_XDPE122_ERROR("%d-%04x: close page%d write protect failed, ret: %d\n", client->adapter->nr, + client->addr, attr->index, ret); + mutex_unlock(&data->update_lock); + return ret; + } + + /* set VOUT_COMMAND */ + ret = wb_pmbus_write_word_data(client, attr->index, PMBUS_VOUT_COMMAND, vout_cmd_set); + if (ret < 0) { + WB_XDPE122_ERROR("%d-%04x: set page%d vout cmd reg: 0x%x, value: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, PMBUS_VOUT_COMMAND, vout_cmd_set, ret); + goto error; + } + + /* read back VOUT_COMMAND */ + vout_cmd = wb_pmbus_read_word_data(client, attr->index, 0xff, PMBUS_VOUT_COMMAND); + if (vout_cmd < 0) { + ret = vout_cmd; + WB_XDPE122_ERROR("%d-%04x: read page%d vout command reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, PMBUS_VOUT_COMMAND, ret); + goto error; + } + + /* compare vout_cmd and vout_cmd_set */ + if (vout_cmd != vout_cmd_set) { + ret = -EIO; + WB_XDPE122_ERROR("%d-%04x: vout cmd value check error, vout cmd read: 0x%x, vout cmd set: 0x%x\n", + client->adapter->nr, client->addr, vout_cmd, vout_cmd_set); + goto error; + } + + /* open write protect */ + wb_pmbus_write_byte_data(client, attr->index, PMBUS_WRITE_PROTECT, XDPE122_WRITE_PROTECT_OPEN); + mutex_unlock(&data->update_lock); + WB_XDPE122_VERBOSE("%d-%04x: set page%d vout cmd success, vout %d uV, vout_cmd_set: 0x%x\n", + client->adapter->nr, client->addr, attr->index, vout, vout_cmd_set); + return count; +error: + wb_pmbus_write_byte_data(client, attr->index, PMBUS_WRITE_PROTECT, XDPE122_WRITE_PROTECT_OPEN); + mutex_unlock(&data->update_lock); + return ret; +} + +static ssize_t xdpe122_avs_vout_max_store(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int ret, vout_threshold; + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_XDPE122_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + ret = kstrtoint(buf, 0, &vout_threshold); + if (ret) { + WB_XDPE122_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + + WB_XDPE122_VERBOSE("%d-%04x: vout%d max threshold: %d", client->adapter->nr, client->addr, + attr->index, vout_threshold); + + data->vout_max[attr->index] = vout_threshold; + return count; +} + +static ssize_t xdpe122_avs_vout_max_show(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_XDPE122_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + return snprintf(buf, PAGE_SIZE, "%d\n", data->vout_max[attr->index]); +} + +static ssize_t xdpe122_avs_vout_min_store(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int ret, vout_threshold; + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_XDPE122_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + ret = kstrtoint(buf, 0, &vout_threshold); + if (ret) { + WB_XDPE122_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + + WB_XDPE122_VERBOSE("%d-%04x: vout%d min threshold: %d", client->adapter->nr, client->addr, + attr->index, vout_threshold); + + data->vout_min[attr->index] = vout_threshold; + return count; +} + +static ssize_t xdpe122_avs_vout_min_show(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_XDPE122_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + return snprintf(buf, PAGE_SIZE, "%d\n", data->vout_min[attr->index]); +} + +static SENSOR_DEVICE_ATTR_RW(avs0_vout, xdpe122_avs_vout, 0); +static SENSOR_DEVICE_ATTR_RW(avs1_vout, xdpe122_avs_vout, 1); +static SENSOR_DEVICE_ATTR_RW(avs0_vout_max, xdpe122_avs_vout_max, 0); +static SENSOR_DEVICE_ATTR_RW(avs0_vout_min, xdpe122_avs_vout_min, 0); +static SENSOR_DEVICE_ATTR_RW(avs1_vout_max, xdpe122_avs_vout_max, 1); +static SENSOR_DEVICE_ATTR_RW(avs1_vout_min, xdpe122_avs_vout_min, 1); + +static struct attribute *avs_ctrl_attrs[] = { + &sensor_dev_attr_avs0_vout.dev_attr.attr, + &sensor_dev_attr_avs1_vout.dev_attr.attr, + &sensor_dev_attr_avs0_vout_max.dev_attr.attr, + &sensor_dev_attr_avs0_vout_min.dev_attr.attr, + &sensor_dev_attr_avs1_vout_max.dev_attr.attr, + &sensor_dev_attr_avs1_vout_min.dev_attr.attr, + NULL, +}; + +static const struct attribute_group avs_ctrl_group = { + .attrs = avs_ctrl_attrs, +}; + +static const struct attribute_group *xdpe122_attribute_groups[] = { + &avs_ctrl_group, + NULL, +}; + +static int xdpe122_read_word_data(struct i2c_client *client, int page, + int phase, int reg) +{ + const struct pmbus_driver_info *info = wb_pmbus_get_driver_info(client); + long val; + s16 exponent; + s32 mantissa; + int ret; + + switch (reg) { + case PMBUS_VOUT_OV_FAULT_LIMIT: + case PMBUS_VOUT_UV_FAULT_LIMIT: + ret = wb_pmbus_read_word_data(client, page, phase, reg); + if (ret < 0) + return ret; + + /* Convert register value to LINEAR11 data. */ + exponent = ((s16)ret) >> 11; + mantissa = ((s16)((ret & GENMASK(10, 0)) << 5)) >> 5; + val = mantissa * 1000L; + if (exponent >= 0) + val <<= exponent; + else + val >>= -exponent; + + /* Convert data to VID register. */ + switch (info->vrm_version[page]) { + case vr13: + if (val >= 500) + return 1 + DIV_ROUND_CLOSEST(val - 500, 10); + return 0; + case vr12: + if (val >= 250) + return 1 + DIV_ROUND_CLOSEST(val - 250, 5); + return 0; + case imvp9: + if (val >= 200) + return 1 + DIV_ROUND_CLOSEST(val - 200, 10); + return 0; + case amd625mv: + if (val >= 200 && val <= 1550) + return DIV_ROUND_CLOSEST((1550 - val) * 100, + 625); + return 0; + default: + return -EINVAL; + } + default: + return -ENODATA; + } + + return 0; +} + +static int xdpe122_identify(struct i2c_client *client, + struct pmbus_driver_info *info) +{ + u8 vout_params; + int i, ret; + + for (i = 0; i < XDPE122_PAGE_NUM; i++) { + /* Read the register with VOUT scaling value.*/ + ret = wb_pmbus_read_byte_data(client, i, PMBUS_VOUT_MODE); + if (ret < 0) + return ret; + + vout_params = ret & GENMASK(4, 0); + + switch (vout_params) { + case XDPE122_PROT_VR12_5_10MV: + info->vrm_version[i] = vr13; + break; + case XDPE122_PROT_VR12_5MV: + info->vrm_version[i] = vr12; + break; + case XDPE122_PROT_IMVP9_10MV: + info->vrm_version[i] = imvp9; + break; + case XDPE122_AMD_625MV: + info->vrm_version[i] = amd625mv; + break; + default: + return -EINVAL; + } + } + + return 0; +} + +static struct pmbus_driver_info xdpe122_info = { + .pages = XDPE122_PAGE_NUM, + .format[PSC_VOLTAGE_IN] = linear, + .format[PSC_VOLTAGE_OUT] = vid, + .format[PSC_TEMPERATURE] = linear, + .format[PSC_CURRENT_IN] = linear, + .format[PSC_CURRENT_OUT] = linear, + .format[PSC_POWER] = linear, + .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | + PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | + PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT, + .func[1] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | + PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | + PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT, + .groups = xdpe122_attribute_groups, + .identify = xdpe122_identify, + .read_word_data = xdpe122_read_word_data, +}; + +static int xdpe122_probe(struct i2c_client *client) +{ + struct pmbus_driver_info *info; + + info = devm_kmemdup(&client->dev, &xdpe122_info, sizeof(*info), + GFP_KERNEL); + if (!info) + return -ENOMEM; + + return wb_pmbus_do_probe(client, info); +} + +static const struct i2c_device_id xdpe122_id[] = { + {"wb_xdpe12254", 0}, + {"wb_xdpe12284", 0}, + {} +}; + +MODULE_DEVICE_TABLE(i2c, xdpe122_id); + +static const struct of_device_id __maybe_unused xdpe122_of_match[] = { + {.compatible = "infineon,wb_xdpe12254"}, + {.compatible = "infineon,wb_xdpe12284"}, + {} +}; +MODULE_DEVICE_TABLE(of, xdpe122_of_match); + +static struct i2c_driver xdpe122_driver = { + .driver = { + .name = "wb_xdpe12284", + .of_match_table = of_match_ptr(xdpe122_of_match), + }, + .probe_new = xdpe122_probe, + .remove = wb_pmbus_do_remove, + .id_table = xdpe122_id, +}; + +module_i2c_driver(xdpe122_driver); + +MODULE_AUTHOR("Vadim Pasternak "); +MODULE_DESCRIPTION("PMBus driver for Infineon XDPE122 family"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_xdpe132g5c_pmbus.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_xdpe132g5c_pmbus.c new file mode 100644 index 000000000000..dd7a97afb9ec --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/linux/wb_xdpe132g5c_pmbus.c @@ -0,0 +1,512 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "wb_pmbus.h" + +static int g_wb_xdpe132g5_pmbus_debug = 0; +static int g_wb_xdpe132g5_pmbus_error = 0; + +module_param(g_wb_xdpe132g5_pmbus_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_xdpe132g5_pmbus_error, int, S_IRUGO | S_IWUSR); + +#define WB_XDPE132G5_PMBUS_DEBUG(fmt, args...) do { \ + if (g_wb_xdpe132g5_pmbus_debug) { \ + printk(KERN_INFO "[WB_XDPE132G5_PMBUS][INFO][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_XDPE132G5_PMBUS_ERROR(fmt, args...) do { \ + if (g_wb_xdpe132g5_pmbus_error) { \ + printk(KERN_ERR "[WB_XDPE132G5_PMBUS][ERR][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define BUF_SIZE (256) +#define XDPE132G5C_PAGE_NUM (2) +#define XDPE132G5C_PROT_VR12_5MV (0x01) /* VR12.0 mode, 5-mV DAC */ +#define XDPE132G5C_PROT_VR12_5_10MV (0x02) /* VR12.5 mode, 10-mV DAC */ +#define XDPE132G5C_PROT_IMVP9_10MV (0x03) /* IMVP9 mode, 10-mV DAC */ +#define XDPE132G5C_PROT_VR13_10MV (0x04) /* VR13.0 mode, 10-mV DAC */ +#define XDPE132G5C_PROT_IMVP8_5MV (0x05) /* IMVP8 mode, 5-mV DAC */ +#define XDPE132G5C_PROT_VR13_5MV (0x07) /* VR13.0 mode, 5-mV DAC */ +#define RETRY_TIME (15) + +typedef struct xdpe_vout_data_s { + u8 vout_mode; + int vout_precision; +} xdpe_vout_data_t; + +static xdpe_vout_data_t g_xdpe_vout_group[] = { + {.vout_mode = 0x18, .vout_precision = 256}, + {.vout_mode = 0x17, .vout_precision = 512}, + {.vout_mode = 0x16, .vout_precision = 1024}, + {.vout_mode = 0x15, .vout_precision = 2048}, + {.vout_mode = 0x14, .vout_precision = 4096}, +}; + +static ssize_t set_xdpe132g5c_avs(struct device *dev, struct device_attribute *da, const char *buf, size_t count) +{ + int ret; + unsigned long val; + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct pmbus_data *data; + + data = i2c_get_clientdata(client); + ret = kstrtoul(buf, 0, &val); + if (ret){ + return ret; + } + mutex_lock(&data->update_lock); + /* set value */ + ret = wb_pmbus_write_word_data(client, attr->index, PMBUS_VOUT_COMMAND, (u16)val); + if (ret < 0) { + WB_XDPE132G5_PMBUS_ERROR("set pmbus_vout_command fail\n"); + goto finish_set; + } +finish_set: + wb_pmbus_clear_faults(client); + mutex_unlock(&data->update_lock); + return (ret < 0) ? ret : count; + +} + +static ssize_t show_xdpe132g5c_avs(struct device *dev, struct device_attribute *da, char *buf) +{ + int val; + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct pmbus_data *data; + + data = i2c_get_clientdata(client); + mutex_lock(&data->update_lock); + val = wb_pmbus_read_word_data(client, attr->index, 0xff, PMBUS_VOUT_COMMAND); + if (val < 0) { + WB_XDPE132G5_PMBUS_ERROR("fail val = %d\n", val); + goto finish_show; + } +finish_show: + wb_pmbus_clear_faults(client); + mutex_unlock(&data->update_lock); + return snprintf(buf, BUF_SIZE, "0x%04x\n", val); +} + +static int xdpe_get_vout_precision(struct i2c_client *client, int page, int *vout_precision) +{ + int i, vout_mode, a_size; + + vout_mode = wb_pmbus_read_byte_data(client, page, PMBUS_VOUT_MODE); + if (vout_mode < 0) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: read xdpe page%d vout mode reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, page, PMBUS_VOUT_MODE, vout_mode); + return vout_mode; + } + + a_size = ARRAY_SIZE(g_xdpe_vout_group); + for (i = 0; i < a_size; i++) { + if (g_xdpe_vout_group[i].vout_mode == vout_mode) { + *vout_precision = g_xdpe_vout_group[i].vout_precision; + WB_XDPE132G5_PMBUS_DEBUG("%d-%04x: match, page%d, vout mode: 0x%x, precision: %d\n", + client->adapter->nr, client->addr, page, vout_mode, *vout_precision); + break; + } + } + if (i == a_size) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid, page%d, vout mode: 0x%x\n",client->adapter->nr, client->addr, + page, vout_mode); + return -EINVAL; + } + return 0; +} + +static ssize_t xdpe132g5_avs_vout_show(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int vout_cmd, ret, vout_precision; + long vout; + + mutex_lock(&data->update_lock); + ret = xdpe_get_vout_precision(client, attr->index, &vout_precision); + if (ret < 0) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: get xdpe avs%d vout precision failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, ret); + mutex_unlock(&data->update_lock); + return ret; + } + + vout_cmd = wb_pmbus_read_word_data(client, attr->index, 0xff, PMBUS_VOUT_COMMAND); + if (vout_cmd < 0) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: read page%d, vout command reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, PMBUS_VOUT_COMMAND, vout_cmd); + mutex_unlock(&data->update_lock); + return vout_cmd; + } + + mutex_unlock(&data->update_lock); + vout = vout_cmd * 1000L * 1000L / vout_precision; + WB_XDPE132G5_PMBUS_DEBUG("%d-%04x: page%d vout: %ld, vout_cmd: 0x%x, precision: %d\n", client->adapter->nr, + client->addr, attr->index, vout, vout_cmd, vout_precision); + return snprintf(buf, PAGE_SIZE, "%ld\n", vout); +} + +static ssize_t xdpe132g5_avs_vout_store(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int vout_max, vout_min; + int ret, vout_cmd, vout_cmd_set; + int vout_precision; + long vout; + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + ret = kstrtol(buf, 0, &vout); + if (ret) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + + if (vout <= 0) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid value: %ld \n", client->adapter->nr, client->addr, vout); + return -EINVAL; + } + + vout_max = data->vout_max[attr->index]; + vout_min = data->vout_min[attr->index]; + if ((vout > vout_max) || (vout < vout_min)) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: vout value: %ld, out of range [%d, %d] \n", client->adapter->nr, + client->addr, vout, vout_min, vout_max); + return -EINVAL; + } + + mutex_lock(&data->update_lock); + ret = xdpe_get_vout_precision(client, attr->index, &vout_precision); + if (ret < 0) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: get xdpe avs%d vout precision failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, ret); + mutex_unlock(&data->update_lock); + return ret; + } + + vout_cmd_set = (vout * vout_precision) / (1000L * 1000L); + if (vout_cmd_set > 0xffff) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid value, page%d, vout: %ld, vout_precision: %d, vout_cmd_set: 0x%x\n", + client->adapter->nr, client->addr, attr->index, vout, vout_precision, vout_cmd_set); + mutex_unlock(&data->update_lock); + return -EINVAL; + } + + /* set VOUT_COMMAND */ + ret = wb_pmbus_write_word_data(client, attr->index, PMBUS_VOUT_COMMAND, (u16)vout_cmd_set); + if (ret < 0) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: set xdpe page%d vout cmd reg: 0x%x, value: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, PMBUS_VOUT_COMMAND, vout_cmd_set, ret); + mutex_unlock(&data->update_lock); + return ret; + } + + /* read back VOUT_COMMAND */ + vout_cmd = wb_pmbus_read_word_data(client, attr->index, 0xff, PMBUS_VOUT_COMMAND); + if (vout_cmd < 0) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: read page%d, vout command reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, attr->index, PMBUS_VOUT_COMMAND, vout_cmd); + mutex_unlock(&data->update_lock); + return vout_cmd; + } + + if (vout_cmd != vout_cmd_set) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: page%d vout cmd value check error, vout cmd read: 0x%x, vout cmd set: 0x%x\n", + client->adapter->nr, client->addr, attr->index, vout_cmd, vout_cmd_set); + mutex_unlock(&data->update_lock); + return -EIO; + } + mutex_unlock(&data->update_lock); + WB_XDPE132G5_PMBUS_DEBUG("%d-%04x: set page%d vout cmd success, vout: %ld uV, vout_cmd_set: 0x%x\n", + client->adapter->nr, client->addr, attr->index, vout, vout_cmd_set); + return count; +} + +static ssize_t xdpe132g5_avs_vout_max_store(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int ret, vout_threshold; + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + ret = kstrtoint(buf, 0, &vout_threshold); + if (ret) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + + WB_XDPE132G5_PMBUS_DEBUG("%d-%04x: vout%d max threshold: %d", client->adapter->nr, client->addr, + attr->index, vout_threshold); + + data->vout_max[attr->index] = vout_threshold; + return count; +} + +static ssize_t xdpe132g5_avs_vout_max_show(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + return snprintf(buf, PAGE_SIZE, "%d\n", data->vout_max[attr->index]); +} + +static ssize_t xdpe132g5_avs_vout_min_store(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + int ret, vout_threshold; + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + ret = kstrtoint(buf, 0, &vout_threshold); + if (ret) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + + WB_XDPE132G5_PMBUS_DEBUG("%d-%04x: vout%d min threshold: %d", client->adapter->nr, client->addr, + attr->index, vout_threshold); + + data->vout_min[attr->index] = vout_threshold; + return count; +} + +static ssize_t xdpe132g5_avs_vout_min_show(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev->parent); + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct pmbus_data *data = i2c_get_clientdata(client); + + if ((attr->index < 0) || (attr->index >= PMBUS_PAGES)) { + WB_XDPE132G5_PMBUS_ERROR("%d-%04x: invalid index: %d \n", client->adapter->nr, client->addr, + attr->index); + return -EINVAL; + } + + return snprintf(buf, PAGE_SIZE, "%d\n", data->vout_min[attr->index]); +} + +static SENSOR_DEVICE_ATTR_RW(avs0_vout, xdpe132g5_avs_vout, 0); +static SENSOR_DEVICE_ATTR_RW(avs1_vout, xdpe132g5_avs_vout, 1); +static SENSOR_DEVICE_ATTR_RW(avs0_vout_max, xdpe132g5_avs_vout_max, 0); +static SENSOR_DEVICE_ATTR_RW(avs0_vout_min, xdpe132g5_avs_vout_min, 0); +static SENSOR_DEVICE_ATTR_RW(avs1_vout_max, xdpe132g5_avs_vout_max, 1); +static SENSOR_DEVICE_ATTR_RW(avs1_vout_min, xdpe132g5_avs_vout_min, 1); + +static struct attribute *avs_ctrl_attrs[] = { + &sensor_dev_attr_avs0_vout.dev_attr.attr, + &sensor_dev_attr_avs1_vout.dev_attr.attr, + &sensor_dev_attr_avs0_vout_max.dev_attr.attr, + &sensor_dev_attr_avs0_vout_min.dev_attr.attr, + &sensor_dev_attr_avs1_vout_max.dev_attr.attr, + &sensor_dev_attr_avs1_vout_min.dev_attr.attr, + NULL, +}; + +static const struct attribute_group avs_ctrl_group = { + .attrs = avs_ctrl_attrs, +}; + +static const struct attribute_group *xdpe132g5_attribute_groups[] = { + &avs_ctrl_group, + NULL, +}; + +static SENSOR_DEVICE_ATTR(avs0_vout_command, S_IRUGO | S_IWUSR, show_xdpe132g5c_avs, set_xdpe132g5c_avs, 0); +static SENSOR_DEVICE_ATTR(avs1_vout_command, S_IRUGO | S_IWUSR, show_xdpe132g5c_avs, set_xdpe132g5c_avs, 1); + +static struct attribute *xdpe132g5c_sysfs_attrs[] = { + &sensor_dev_attr_avs0_vout_command.dev_attr.attr, + &sensor_dev_attr_avs1_vout_command.dev_attr.attr, + NULL, +}; + +static const struct attribute_group xdpe132g5c_sysfs_attrs_group = { + .attrs = xdpe132g5c_sysfs_attrs, +}; + +static int xdpe132g5c_identify(struct i2c_client *client, struct pmbus_driver_info *info) +{ + u8 vout_params; + int ret, i, retry; + + /* Read the register with VOUT scaling value.*/ + for (i = 0; i < XDPE132G5C_PAGE_NUM; i++) { + for (retry = 0; retry < RETRY_TIME; retry++) { + ret = wb_pmbus_read_byte_data(client, i, PMBUS_VOUT_MODE); + if (ret < 0 || ret == 0xff) { + msleep(5); + continue; + } else { + break; + } + } + if (ret < 0) { + return ret; + } + + switch (ret >> 5) { + case 0: /* linear mode */ + if (info->format[PSC_VOLTAGE_OUT] != linear) { + return -ENODEV; + } + break; + case 1: /* VID mode */ + if (info->format[PSC_VOLTAGE_OUT] != vid) { + return -ENODEV; + } + vout_params = ret & GENMASK(4, 0); + switch (vout_params) { + case XDPE132G5C_PROT_VR13_10MV: + case XDPE132G5C_PROT_VR12_5_10MV: + info->vrm_version[i] = vr13; + break; + case XDPE132G5C_PROT_VR13_5MV: + case XDPE132G5C_PROT_VR12_5MV: + case XDPE132G5C_PROT_IMVP8_5MV: + info->vrm_version[i] = vr12; + break; + case XDPE132G5C_PROT_IMVP9_10MV: + info->vrm_version[i] = imvp9; + break; + default: + return -EINVAL; + } + break; + case 2: /* direct mode */ + if (info->format[PSC_VOLTAGE_OUT] != direct) { + return -ENODEV; + } + break; + default: + return -ENODEV; + } + } + + return 0; +} + +static struct pmbus_driver_info xdpe132g5c_info = { + .pages = XDPE132G5C_PAGE_NUM, + .format[PSC_VOLTAGE_IN] = linear, + .format[PSC_VOLTAGE_OUT] = linear, + .format[PSC_TEMPERATURE] = linear, + .format[PSC_CURRENT_IN] = linear, + .format[PSC_CURRENT_OUT] = linear, + .format[PSC_POWER] = linear, + .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_PIN + | PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_TEMP + | PMBUS_HAVE_STATUS_TEMP + | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT + | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_POUT, + .func[1] = PMBUS_HAVE_VIN | PMBUS_HAVE_IIN | PMBUS_HAVE_PIN + | PMBUS_HAVE_STATUS_INPUT + | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT + | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_POUT, + .groups = xdpe132g5_attribute_groups, + .identify = xdpe132g5c_identify, +}; + +static int xdpe132g5c_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + int status; + struct pmbus_driver_info *info; + + info = devm_kmemdup(&client->dev, &xdpe132g5c_info, sizeof(*info), GFP_KERNEL); + if (!info) { + return -ENOMEM; + } + + status = wb_pmbus_do_probe(client, &xdpe132g5c_info); + if (status != 0) { + WB_XDPE132G5_PMBUS_ERROR("pmbus probe error %d\n", status); + return status; + } + + status = sysfs_create_group(&client->dev.kobj, &xdpe132g5c_sysfs_attrs_group); + if (status != 0) { + WB_XDPE132G5_PMBUS_ERROR("sysfs_create_group error %d\n", status); + return status; + } + + return status; +} + +static void xdpe132g5c_remove(struct i2c_client *client) +{ + sysfs_remove_group(&client->dev.kobj, &xdpe132g5c_sysfs_attrs_group); + wb_pmbus_do_remove(client); + return; +} + +static const struct i2c_device_id xdpe132g5c_id[] = { + {"wb_xdpe132g5c_pmbus", 0}, + {} +}; + +MODULE_DEVICE_TABLE(i2c, xdpe132g5c_id); + +static const struct of_device_id __maybe_unused xdpe132g5c_of_match[] = { + {.compatible = "infineon,wb_xdpe132g5c_pmbus"}, + {} +}; +MODULE_DEVICE_TABLE(of, xdpe132g5c_of_match); + +static struct i2c_driver xdpe132g5c_driver = { + .driver = { + .name = "wb_xdpe132g5c_pmbus", + .of_match_table = of_match_ptr(xdpe132g5c_of_match), + }, + .probe = xdpe132g5c_probe, + .remove = xdpe132g5c_remove, + .id_table = xdpe132g5c_id, +}; + +module_i2c_driver(xdpe132g5c_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("PMBus driver for Infineon XDPE132g5 family"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/Makefile new file mode 100644 index 000000000000..295934ca4a29 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/Makefile @@ -0,0 +1,17 @@ +PWD = $(shell pwd) + +EXTRA_CFLAGS:= -I$(M)/include +EXTRA_CFLAGS+= -Wall + +obj-m := wb_pinctrl_intel.o +obj-m += wb_gpio_c3000.o +obj-m += wb_gpio_c3000_device.o + +all: + $(MAKE) -C $(KERNEL_SRC)/build M=$(PWD) modules + @if [ ! -d $(module_out_put_dir) ]; then mkdir -p $(module_out_put_dir) ;fi + cp -p $(PWD)/*.ko $(module_out_put_dir) +clean: + rm -f $(PWD)/*.o $(PWD)/*.ko $(PWD)/*.mod.c $(PWD)/.*.cmd $(PWD)/*.mod + rm -f $(PWD)/Module.markers $(PWD)/Module.symvers $(PWD)/modules.order + rm -rf $(PWD)/.tmp_versions diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/core.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/core.h new file mode 100644 index 000000000000..840103c40c14 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/core.h @@ -0,0 +1,249 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Core private header for the pin control subsystem + * + * Copyright (C) 2011 ST-Ericsson SA + * Written on behalf of Linaro for ST-Ericsson + * + * Author: Linus Walleij + */ + +#include +#include +#include +#include +#include + +struct pinctrl_gpio_range; + +/** + * struct pinctrl_dev - pin control class device + * @node: node to include this pin controller in the global pin controller list + * @desc: the pin controller descriptor supplied when initializing this pin + * controller + * @pin_desc_tree: each pin descriptor for this pin controller is stored in + * this radix tree + * @pin_group_tree: optionally each pin group can be stored in this radix tree + * @num_groups: optionally number of groups can be kept here + * @pin_function_tree: optionally each function can be stored in this radix tree + * @num_functions: optionally number of functions can be kept here + * @gpio_ranges: a list of GPIO ranges that is handled by this pin controller, + * ranges are added to this list at runtime + * @dev: the device entry for this pin controller + * @owner: module providing the pin controller, used for refcounting + * @driver_data: driver data for drivers registering to the pin controller + * subsystem + * @p: result of pinctrl_get() for this device + * @hog_default: default state for pins hogged by this device + * @hog_sleep: sleep state for pins hogged by this device + * @mutex: mutex taken on each pin controller specific action + * @device_root: debugfs root for this device + */ +struct pinctrl_dev { + struct list_head node; + struct pinctrl_desc *desc; + struct radix_tree_root pin_desc_tree; +#ifdef CONFIG_GENERIC_PINCTRL_GROUPS + struct radix_tree_root pin_group_tree; + unsigned int num_groups; +#endif +#ifdef CONFIG_GENERIC_PINMUX_FUNCTIONS + struct radix_tree_root pin_function_tree; + unsigned int num_functions; +#endif + struct list_head gpio_ranges; + struct device *dev; + struct module *owner; + void *driver_data; + struct pinctrl *p; + struct pinctrl_state *hog_default; + struct pinctrl_state *hog_sleep; + struct mutex mutex; +#ifdef CONFIG_DEBUG_FS + struct dentry *device_root; +#endif +}; + +/** + * struct pinctrl - per-device pin control state holder + * @node: global list node + * @dev: the device using this pin control handle + * @states: a list of states for this device + * @state: the current state + * @dt_maps: the mapping table chunks dynamically parsed from device tree for + * this device, if any + * @users: reference count + */ +struct pinctrl { + struct list_head node; + struct device *dev; + struct list_head states; + struct pinctrl_state *state; + struct list_head dt_maps; + struct kref users; +}; + +/** + * struct pinctrl_state - a pinctrl state for a device + * @node: list node for struct pinctrl's @states field + * @name: the name of this state + * @settings: a list of settings for this state + */ +struct pinctrl_state { + struct list_head node; + const char *name; + struct list_head settings; +}; + +/** + * struct pinctrl_setting_mux - setting data for MAP_TYPE_MUX_GROUP + * @group: the group selector to program + * @func: the function selector to program + */ +struct pinctrl_setting_mux { + unsigned group; + unsigned func; +}; + +/** + * struct pinctrl_setting_configs - setting data for MAP_TYPE_CONFIGS_* + * @group_or_pin: the group selector or pin ID to program + * @configs: a pointer to an array of config parameters/values to program into + * hardware. Each individual pin controller defines the format and meaning + * of config parameters. + * @num_configs: the number of entries in array @configs + */ +struct pinctrl_setting_configs { + unsigned group_or_pin; + unsigned long *configs; + unsigned num_configs; +}; + +/** + * struct pinctrl_setting - an individual mux or config setting + * @node: list node for struct pinctrl_settings's @settings field + * @type: the type of setting + * @pctldev: pin control device handling to be programmed. Not used for + * PIN_MAP_TYPE_DUMMY_STATE. + * @dev_name: the name of the device using this state + * @data: Data specific to the setting type + */ +struct pinctrl_setting { + struct list_head node; + enum pinctrl_map_type type; + struct pinctrl_dev *pctldev; + const char *dev_name; + union { + struct pinctrl_setting_mux mux; + struct pinctrl_setting_configs configs; + } data; +}; + +/** + * struct pin_desc - pin descriptor for each physical pin in the arch + * @pctldev: corresponding pin control device + * @name: a name for the pin, e.g. the name of the pin/pad/finger on a + * datasheet or such + * @dynamic_name: if the name of this pin was dynamically allocated + * @drv_data: driver-defined per-pin data. pinctrl core does not touch this + * @mux_usecount: If zero, the pin is not claimed, and @owner should be NULL. + * If non-zero, this pin is claimed by @owner. This field is an integer + * rather than a boolean, since pinctrl_get() might process multiple + * mapping table entries that refer to, and hence claim, the same group + * or pin, and each of these will increment the @usecount. + * @mux_owner: The name of device that called pinctrl_get(). + * @mux_setting: The most recent selected mux setting for this pin, if any. + * @gpio_owner: If pinctrl_gpio_request() was called for this pin, this is + * the name of the GPIO that "owns" this pin. + */ +struct pin_desc { + struct pinctrl_dev *pctldev; + const char *name; + bool dynamic_name; + void *drv_data; + /* These fields only added when supporting pinmux drivers */ +#ifdef CONFIG_PINMUX + unsigned mux_usecount; + const char *mux_owner; + const struct pinctrl_setting_mux *mux_setting; + const char *gpio_owner; +#endif +}; + +/** + * struct pinctrl_maps - a list item containing part of the mapping table + * @node: mapping table list node + * @maps: array of mapping table entries + * @num_maps: the number of entries in @maps + */ +struct pinctrl_maps { + struct list_head node; + const struct pinctrl_map *maps; + unsigned num_maps; +}; + +#ifdef CONFIG_GENERIC_PINCTRL_GROUPS + +/** + * struct group_desc - generic pin group descriptor + * @name: name of the pin group + * @pins: array of pins that belong to the group + * @num_pins: number of pins in the group + * @data: pin controller driver specific data + */ +struct group_desc { + const char *name; + int *pins; + int num_pins; + void *data; +}; + +int pinctrl_generic_get_group_count(struct pinctrl_dev *pctldev); + +const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev, + unsigned int group_selector); + +int pinctrl_generic_get_group_pins(struct pinctrl_dev *pctldev, + unsigned int group_selector, + const unsigned int **pins, + unsigned int *npins); + +struct group_desc *pinctrl_generic_get_group(struct pinctrl_dev *pctldev, + unsigned int group_selector); + +int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name, + int *gpins, int ngpins, void *data); + +int pinctrl_generic_remove_group(struct pinctrl_dev *pctldev, + unsigned int group_selector); + +#endif /* CONFIG_GENERIC_PINCTRL_GROUPS */ + +struct pinctrl_dev *get_pinctrl_dev_from_devname(const char *dev_name); +struct pinctrl_dev *get_pinctrl_dev_from_of_node(struct device_node *np); +int pin_get_from_name(struct pinctrl_dev *pctldev, const char *name); +const char *pin_get_name(struct pinctrl_dev *pctldev, const unsigned pin); +int pinctrl_get_group_selector(struct pinctrl_dev *pctldev, + const char *pin_group); + +static inline struct pin_desc *pin_desc_get(struct pinctrl_dev *pctldev, + unsigned int pin) +{ + return radix_tree_lookup(&pctldev->pin_desc_tree, pin); +} + +extern struct pinctrl_gpio_range * +pinctrl_find_gpio_range_from_pin_nolock(struct pinctrl_dev *pctldev, + unsigned int pin); + +extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev); +extern int pinctrl_force_default(struct pinctrl_dev *pctldev); + +extern struct mutex pinctrl_maps_mutex; +extern struct list_head pinctrl_maps; + +#define for_each_maps(_maps_node_, _i_, _map_) \ + list_for_each_entry(_maps_node_, &pinctrl_maps, node) \ + for (_i_ = 0, _map_ = &_maps_node_->maps[_i_]; \ + _i_ < _maps_node_->num_maps; \ + _i_++, _map_ = &_maps_node_->maps[_i_]) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_gpio_c3000.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_gpio_c3000.c new file mode 100644 index 000000000000..753c8a061a86 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_gpio_c3000.c @@ -0,0 +1,452 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Intel Denverton SoC pinctrl/GPIO driver + * + * Copyright (C) 2017, Intel Corporation + * Author: Mika Westerberg + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_pinctrl_intel.h" + +static int g_c3000_gpio_debug = 0; +static int g_c3000_gpio_error = 0; +module_param(g_c3000_gpio_debug, int, S_IRUGO | S_IWUSR); +module_param(g_c3000_gpio_error, int, S_IRUGO | S_IWUSR); + +#define C3000_GPIO_VERBOSE(fmt, args...) do { \ + if (g_c3000_gpio_debug) { \ + printk(KERN_INFO "[GPIO_PCIE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define C3000_GPIO_ERROR(fmt, args...) do { \ + if (g_c3000_gpio_error) { \ + printk(KERN_ERR "[GPIO_PCIE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define DNV_PAD_OWN 0x020 +#define DNV_PADCFGLOCK 0x090 +#define DNV_HOSTSW_OWN 0x0C0 +#define DNV_GPI_IS 0x100 +#define DNV_GPI_IE 0x120 + +#define DNV_GPP(n, s, e) \ + { \ + .reg_num = (n), \ + .base = (s), \ + .size = ((e) - (s) + 1), \ + } + +#define DNV_COMMUNITY(b, s, e, g, d) \ + { \ + .barno = (b), \ + .padown_offset = DNV_PAD_OWN, \ + .padcfglock_offset = DNV_PADCFGLOCK, \ + .hostown_offset = DNV_HOSTSW_OWN, \ + .is_offset = DNV_GPI_IS, \ + .ie_offset = DNV_GPI_IE, \ + .pin_base = (s), \ + .npins = ((e) - (s) + 1), \ + .gpps = (g), \ + .ngpps = ARRAY_SIZE(g), \ + .dw_base = (d), \ + } + +/* Denverton */ +static const struct pinctrl_pin_desc dnv_pins[] = { + /* North ALL */ + PINCTRL_PIN(0, "GBE0_SDP0"), + PINCTRL_PIN(1, "GBE1_SDP0"), + PINCTRL_PIN(2, "GBE0_SDP1"), + PINCTRL_PIN(3, "GBE1_SDP1"), + PINCTRL_PIN(4, "GBE0_SDP2"), + PINCTRL_PIN(5, "GBE1_SDP2"), + PINCTRL_PIN(6, "GBE0_SDP3"), + PINCTRL_PIN(7, "GBE1_SDP3"), + PINCTRL_PIN(8, "GBE2_LED0"), + PINCTRL_PIN(9, "GBE2_LED1"), + PINCTRL_PIN(10, "GBE0_I2C_CLK"), + PINCTRL_PIN(11, "GBE0_I2C_DATA"), + PINCTRL_PIN(12, "GBE1_I2C_CLK"), + PINCTRL_PIN(13, "GBE1_I2C_DATA"), + PINCTRL_PIN(14, "NCSI_RXD0"), + PINCTRL_PIN(15, "NCSI_CLK_IN"), + PINCTRL_PIN(16, "NCSI_RXD1"), + PINCTRL_PIN(17, "NCSI_CRS_DV"), + PINCTRL_PIN(18, "NCSI_ARB_IN"), + PINCTRL_PIN(19, "NCSI_TX_EN"), + PINCTRL_PIN(20, "NCSI_TXD0"), + PINCTRL_PIN(21, "NCSI_TXD1"), + PINCTRL_PIN(22, "NCSI_ARB_OUT"), + PINCTRL_PIN(23, "GBE0_LED0"), + PINCTRL_PIN(24, "GBE0_LED1"), + PINCTRL_PIN(25, "GBE1_LED0"), + PINCTRL_PIN(26, "GBE1_LED1"), + PINCTRL_PIN(27, "GPIO0"), + PINCTRL_PIN(28, "PCIE_CLKREQ0_N"), + PINCTRL_PIN(29, "PCIE_CLKREQ1_N"), + PINCTRL_PIN(30, "PCIE_CLKREQ2_N"), + PINCTRL_PIN(31, "PCIE_CLKREQ3_N"), + PINCTRL_PIN(32, "PCIE_CLKREQ4_N"), + PINCTRL_PIN(33, "GPIO1"), + PINCTRL_PIN(34, "GPIO2"), + PINCTRL_PIN(35, "SVID_ALERT_N"), + PINCTRL_PIN(36, "SVID_DATA"), + PINCTRL_PIN(37, "SVID_CLK"), + PINCTRL_PIN(38, "THERMTRIP_N"), + PINCTRL_PIN(39, "PROCHOT_N"), + PINCTRL_PIN(40, "MEMHOT_N"), + /* South DFX */ + PINCTRL_PIN(41, "DFX_PORT_CLK0"), + PINCTRL_PIN(42, "DFX_PORT_CLK1"), + PINCTRL_PIN(43, "DFX_PORT0"), + PINCTRL_PIN(44, "DFX_PORT1"), + PINCTRL_PIN(45, "DFX_PORT2"), + PINCTRL_PIN(46, "DFX_PORT3"), + PINCTRL_PIN(47, "DFX_PORT4"), + PINCTRL_PIN(48, "DFX_PORT5"), + PINCTRL_PIN(49, "DFX_PORT6"), + PINCTRL_PIN(50, "DFX_PORT7"), + PINCTRL_PIN(51, "DFX_PORT8"), + PINCTRL_PIN(52, "DFX_PORT9"), + PINCTRL_PIN(53, "DFX_PORT10"), + PINCTRL_PIN(54, "DFX_PORT11"), + PINCTRL_PIN(55, "DFX_PORT12"), + PINCTRL_PIN(56, "DFX_PORT13"), + PINCTRL_PIN(57, "DFX_PORT14"), + PINCTRL_PIN(58, "DFX_PORT15"), + /* South GPP0 */ + PINCTRL_PIN(59, "GPIO12"), + PINCTRL_PIN(60, "SMB5_GBE_ALRT_N"), + PINCTRL_PIN(61, "PCIE_CLKREQ5_N"), + PINCTRL_PIN(62, "PCIE_CLKREQ6_N"), + PINCTRL_PIN(63, "PCIE_CLKREQ7_N"), + PINCTRL_PIN(64, "UART0_RXD"), + PINCTRL_PIN(65, "UART0_TXD"), + PINCTRL_PIN(66, "SMB5_GBE_CLK"), + PINCTRL_PIN(67, "SMB5_GBE_DATA"), + PINCTRL_PIN(68, "ERROR2_N"), + PINCTRL_PIN(69, "ERROR1_N"), + PINCTRL_PIN(70, "ERROR0_N"), + PINCTRL_PIN(71, "IERR_N"), + PINCTRL_PIN(72, "MCERR_N"), + PINCTRL_PIN(73, "SMB0_LEG_CLK"), + PINCTRL_PIN(74, "SMB0_LEG_DATA"), + PINCTRL_PIN(75, "SMB0_LEG_ALRT_N"), + PINCTRL_PIN(76, "SMB1_HOST_DATA"), + PINCTRL_PIN(77, "SMB1_HOST_CLK"), + PINCTRL_PIN(78, "SMB2_PECI_DATA"), + PINCTRL_PIN(79, "SMB2_PECI_CLK"), + PINCTRL_PIN(80, "SMB4_CSME0_DATA"), + PINCTRL_PIN(81, "SMB4_CSME0_CLK"), + PINCTRL_PIN(82, "SMB4_CSME0_ALRT_N"), + PINCTRL_PIN(83, "USB_OC0_N"), + PINCTRL_PIN(84, "FLEX_CLK_SE0"), + PINCTRL_PIN(85, "FLEX_CLK_SE1"), + PINCTRL_PIN(86, "GPIO4"), + PINCTRL_PIN(87, "GPIO5"), + PINCTRL_PIN(88, "GPIO6"), + PINCTRL_PIN(89, "GPIO7"), + PINCTRL_PIN(90, "SATA0_LED_N"), + PINCTRL_PIN(91, "SATA1_LED_N"), + PINCTRL_PIN(92, "SATA_PDETECT0"), + PINCTRL_PIN(93, "SATA_PDETECT1"), + PINCTRL_PIN(94, "SATA0_SDOUT"), + PINCTRL_PIN(95, "SATA1_SDOUT"), + PINCTRL_PIN(96, "UART1_RXD"), + PINCTRL_PIN(97, "UART1_TXD"), + PINCTRL_PIN(98, "GPIO8"), + PINCTRL_PIN(99, "GPIO9"), + PINCTRL_PIN(100, "TCK"), + PINCTRL_PIN(101, "TRST_N"), + PINCTRL_PIN(102, "TMS"), + PINCTRL_PIN(103, "TDI"), + PINCTRL_PIN(104, "TDO"), + PINCTRL_PIN(105, "CX_PRDY_N"), + PINCTRL_PIN(106, "CX_PREQ_N"), + PINCTRL_PIN(107, "CTBTRIGINOUT"), + PINCTRL_PIN(108, "CTBTRIGOUT"), + PINCTRL_PIN(109, "DFX_SPARE2"), + PINCTRL_PIN(110, "DFX_SPARE3"), + PINCTRL_PIN(111, "DFX_SPARE4"), + /* South GPP1 */ + PINCTRL_PIN(112, "SUSPWRDNACK"), + PINCTRL_PIN(113, "PMU_SUSCLK"), + PINCTRL_PIN(114, "ADR_TRIGGER"), + PINCTRL_PIN(115, "PMU_SLP_S45_N"), + PINCTRL_PIN(116, "PMU_SLP_S3_N"), + PINCTRL_PIN(117, "PMU_WAKE_N"), + PINCTRL_PIN(118, "PMU_PWRBTN_N"), + PINCTRL_PIN(119, "PMU_RESETBUTTON_N"), + PINCTRL_PIN(120, "PMU_PLTRST_N"), + PINCTRL_PIN(121, "SUS_STAT_N"), + PINCTRL_PIN(122, "SLP_S0IX_N"), + PINCTRL_PIN(123, "SPI_CS0_N"), + PINCTRL_PIN(124, "SPI_CS1_N"), + PINCTRL_PIN(125, "SPI_MOSI_IO0"), + PINCTRL_PIN(126, "SPI_MISO_IO1"), + PINCTRL_PIN(127, "SPI_IO2"), + PINCTRL_PIN(128, "SPI_IO3"), + PINCTRL_PIN(129, "SPI_CLK"), + PINCTRL_PIN(130, "SPI_CLK_LOOPBK"), + PINCTRL_PIN(131, "ESPI_IO0"), + PINCTRL_PIN(132, "ESPI_IO1"), + PINCTRL_PIN(133, "ESPI_IO2"), + PINCTRL_PIN(134, "ESPI_IO3"), + PINCTRL_PIN(135, "ESPI_CS0_N"), + PINCTRL_PIN(136, "ESPI_CLK"), + PINCTRL_PIN(137, "ESPI_RST_N"), + PINCTRL_PIN(138, "ESPI_ALRT0_N"), + PINCTRL_PIN(139, "GPIO10"), + PINCTRL_PIN(140, "GPIO11"), + PINCTRL_PIN(141, "ESPI_CLK_LOOPBK"), + PINCTRL_PIN(142, "EMMC_CMD"), + PINCTRL_PIN(143, "EMMC_STROBE"), + PINCTRL_PIN(144, "EMMC_CLK"), + PINCTRL_PIN(145, "EMMC_D0"), + PINCTRL_PIN(146, "EMMC_D1"), + PINCTRL_PIN(147, "EMMC_D2"), + PINCTRL_PIN(148, "EMMC_D3"), + PINCTRL_PIN(149, "EMMC_D4"), + PINCTRL_PIN(150, "EMMC_D5"), + PINCTRL_PIN(151, "EMMC_D6"), + PINCTRL_PIN(152, "EMMC_D7"), + PINCTRL_PIN(153, "GPIO3"), +}; + +static const unsigned int dnv_uart0_pins[] = { 60, 61, 64, 65 }; +static const unsigned int dnv_uart0_modes[] = { 2, 3, 1, 1 }; +static const unsigned int dnv_uart1_pins[] = { 94, 95, 96, 97 }; +static const unsigned int dnv_uart2_pins[] = { 60, 61, 62, 63 }; +static const unsigned int dnv_uart2_modes[] = { 1, 2, 2, 2 }; +static const unsigned int dnv_emmc_pins[] = { + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, +}; + +static const struct intel_pingroup dnv_groups[] = { + PIN_GROUP("uart0_grp", dnv_uart0_pins, dnv_uart0_modes), + PIN_GROUP("uart1_grp", dnv_uart1_pins, 1), + PIN_GROUP("uart2_grp", dnv_uart2_pins, dnv_uart2_modes), + PIN_GROUP("emmc_grp", dnv_emmc_pins, 1), +}; + +static const char * const dnv_uart0_groups[] = { "uart0_grp" }; +static const char * const dnv_uart1_groups[] = { "uart1_grp" }; +static const char * const dnv_uart2_groups[] = { "uart2_grp" }; +static const char * const dnv_emmc_groups[] = { "emmc_grp" }; + +static const struct intel_function dnv_functions[] = { + FUNCTION("uart0", dnv_uart0_groups), + FUNCTION("uart1", dnv_uart1_groups), + FUNCTION("uart2", dnv_uart2_groups), + FUNCTION("emmc", dnv_emmc_groups), +}; + +static const struct intel_padgroup dnv_north_gpps[] = { + DNV_GPP(0, 0, 31), /* North ALL_0 */ + DNV_GPP(1, 32, 40), /* North ALL_1 */ +}; + +static const struct intel_padgroup dnv_south_gpps[] = { + DNV_GPP(0, 41, 58), /* South DFX */ + DNV_GPP(1, 59, 90), /* South GPP0_0 */ + DNV_GPP(2, 91, 111), /* South GPP0_1 */ + DNV_GPP(3, 112, 143), /* South GPP1_0 */ + DNV_GPP(4, 144, 153), /* South GPP1_1 */ +}; + +static const struct intel_community dnv_communities[] = { + DNV_COMMUNITY(0, 0, 40, dnv_north_gpps, 0xc20000), + DNV_COMMUNITY(1, 41, 153, dnv_south_gpps, 0xc50000), +}; + +static const struct intel_pinctrl_soc_data dnv_soc_data = { + .pins = dnv_pins, + .npins = ARRAY_SIZE(dnv_pins), + .groups = dnv_groups, + .ngroups = ARRAY_SIZE(dnv_groups), + .functions = dnv_functions, + .nfunctions = ARRAY_SIZE(dnv_functions), + .communities = dnv_communities, + .ncommunities = ARRAY_SIZE(dnv_communities), +}; + +static INTEL_PINCTRL_PM_OPS(dnv_pinctrl_pm_ops); + +static int pci_dev_init(wb_gpio_data_t *wb_gpio_data, struct pci_dev *pci_dev) +{ + int err, i; + void __iomem *base; + + C3000_GPIO_VERBOSE("Enter vendor 0x%x, device 0x%x.\n", + pci_dev->vendor, pci_dev->device); + + C3000_GPIO_VERBOSE("start pci_enable_device!\n"); + err = pci_enable_device(pci_dev); + if (err) { + dev_err(&pci_dev->dev, "Failed to enable pci device, ret:%d.\n", err); + return err; + } + + err = pci_request_region(pci_dev, 0, "P2SB"); + if (err) { + dev_err(&pci_dev->dev, "Requesting C3000 P2SB BAR0 region failed, ret: %d\n", err); + goto err_disable; + } + + C3000_GPIO_VERBOSE("start pci_set_master!\n"); + pci_set_master(pci_dev); + + base = pci_iomap(pci_dev, wb_gpio_data->pci_bar, 0); + if (!base) { + dev_err(&pci_dev->dev, "pci_iomap bar: %d failed\n", wb_gpio_data->pci_bar); + err = -ENOMEM; + goto err_release; + } + wb_gpio_data->pci_mem_base = base; + + for (i = 0; i < dnv_soc_data.ncommunities; i++) { + wb_gpio_data->res[i] = base + dnv_soc_data.communities[i].dw_base; + } + return 0; +err_release: + pci_release_region(pci_dev, wb_gpio_data->pci_bar); +err_disable: + pci_disable_device(pci_dev); + return err; +} + +static void pci_dev_release(wb_gpio_data_t *wb_gpio_data) +{ + struct pci_dev *pci_dev; + + pci_dev = wb_gpio_data->pci_dev; + if (wb_gpio_data->pci_mem_base) { + pci_iounmap(pci_dev, wb_gpio_data->pci_mem_base); + } + pci_release_region(pci_dev, wb_gpio_data->pci_bar); + pci_disable_device(pci_dev); + return; +} + +static int wb_gpio_driver_probe(struct platform_device *plat_dev) +{ + int ret, devfn; + wb_gpio_data_t *wb_gpio_data; + wb_gpio_data_t *c3000_gpio_device; + struct pci_dev *pci_dev; + + if (dnv_soc_data.ncommunities > GPIO_RES_MAX) { + dev_err(&plat_dev->dev, "GPIO ncommunities %lu is more than GPIO resource number: %d\n", + dnv_soc_data.ncommunities, GPIO_RES_MAX); + return -EINVAL; + } + + wb_gpio_data = devm_kzalloc(&plat_dev->dev, sizeof(wb_gpio_data_t), GFP_KERNEL); + if (!wb_gpio_data) { + dev_err(&plat_dev->dev, "devm_kzalloc failed.\n"); + ret = -ENOMEM; + return ret; + } + + if (plat_dev->dev.of_node) { + ret = 0; + ret += of_property_read_u32(plat_dev->dev.of_node, "pci_domain", &wb_gpio_data->pci_domain); + ret += of_property_read_u32(plat_dev->dev.of_node, "pci_bus", &wb_gpio_data->pci_bus); + ret += of_property_read_u32(plat_dev->dev.of_node, "pci_slot", &wb_gpio_data->pci_slot); + ret += of_property_read_u32(plat_dev->dev.of_node, "pci_fn", &wb_gpio_data->pci_fn); + ret += of_property_read_u32(plat_dev->dev.of_node, "pci_bar", &wb_gpio_data->pci_bar); + ret += of_property_read_u32(plat_dev->dev.of_node, "irq", &wb_gpio_data->irq); + if (ret != 0) { + dev_err(&plat_dev->dev, "Failed to get dts config, ret:%d.\n", ret); + return -ENXIO; + } + } else { + if (plat_dev->dev.platform_data == NULL) { + dev_err(&plat_dev->dev, "Failed to get platform data config.\n"); + return -ENXIO; + } + c3000_gpio_device = plat_dev->dev.platform_data; + wb_gpio_data->pci_domain = c3000_gpio_device->pci_domain; + wb_gpio_data->pci_bus = c3000_gpio_device->pci_bus; + wb_gpio_data->pci_slot = c3000_gpio_device->pci_slot; + wb_gpio_data->pci_fn = c3000_gpio_device->pci_fn; + wb_gpio_data->pci_bar = c3000_gpio_device->pci_bar; + wb_gpio_data->irq = c3000_gpio_device->irq; + } + + C3000_GPIO_VERBOSE("domain:0x%04x, bus:0x%02x, slot:0x%02x, fn:%u, bar:%u, irq: %d\n", + wb_gpio_data->pci_domain, wb_gpio_data->pci_bus, wb_gpio_data->pci_slot, wb_gpio_data->pci_fn, + wb_gpio_data->pci_bar, wb_gpio_data->irq); + + devfn = PCI_DEVFN(wb_gpio_data->pci_slot, wb_gpio_data->pci_fn); + pci_dev = pci_get_domain_bus_and_slot(wb_gpio_data->pci_domain, wb_gpio_data->pci_bus, devfn); + if (pci_dev == NULL) { + dev_err(&plat_dev->dev, "Failed to find pci_dev, domain:0x%04x, bus:0x%02x, devfn:0x%x\n", + wb_gpio_data->pci_domain, wb_gpio_data->pci_bus, devfn); + return -ENXIO; + } + wb_gpio_data->pci_dev = pci_dev; + ret = pci_dev_init(wb_gpio_data, pci_dev); + if (ret != 0) { + dev_err(&plat_dev->dev, "Failed to get pci bar address.\n"); + return ret; + } + C3000_GPIO_VERBOSE("pci_dev_init success, pci_mem_bae: 0x%pK, res0: 0x%pK, res1: 0x%pK\n", + wb_gpio_data->pci_mem_base, wb_gpio_data->res[0], wb_gpio_data->res[1]); + + platform_set_drvdata(plat_dev, wb_gpio_data); + + ret = wb_pinctrl_probe(plat_dev, &dnv_soc_data); + if (ret) { + dev_err(&plat_dev->dev, "C3000 gpio pinctrl probe failed, ret:%d\n", ret); + pci_dev_release(wb_gpio_data); + return ret; + } + dev_info(&plat_dev->dev, "C3000 gpio pinctrl probe success.\n"); + return 0; +} + +static int wb_gpio_driver_remove(struct platform_device *plat_dev) +{ + wb_gpio_data_t *wb_gpio_data; + + C3000_GPIO_VERBOSE("c3000_gpio_pcie_remove.\n"); + + wb_gpio_data = platform_get_drvdata(plat_dev); + pci_dev_release(wb_gpio_data); + return 0; +} + +static const struct of_device_id gpio_c3000_match[] = { + { + .compatible = "wb_gpio_c3000", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, gpio_c3000_match); + +static struct platform_driver wb_gpio_c3000_driver = { + .driver = { + .name = "wb_gpio_c3000", + .of_match_table = gpio_c3000_match, + }, + .probe = wb_gpio_driver_probe, + .remove = wb_gpio_driver_remove, +}; + +module_platform_driver(wb_gpio_c3000_driver); + +MODULE_DESCRIPTION("C3000 GPIO Controller driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_gpio_c3000_device.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_gpio_c3000_device.c new file mode 100644 index 000000000000..33ab19a5ac44 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_gpio_c3000_device.c @@ -0,0 +1,69 @@ +#include +#include +#include +#include +#include + +#include "wb_pinctrl_intel.h" + +static int g_wb_c300_gpio_device_debug = 0; +static int g_wb_c300_gpio_device_error = 0; + +module_param(g_wb_c300_gpio_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_c300_gpio_device_error, int, S_IRUGO | S_IWUSR); + +#define WB_C3000_GPIO_DEVICE_DEBUG(fmt, args...) do { \ + if (g_wb_c300_gpio_device_debug) { \ + printk(KERN_INFO "[WB_C3000_GPIO_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_C3000_GPIO_DEVICE_ERROR(fmt, args...) do { \ + if (g_wb_c300_gpio_device_error) { \ + printk(KERN_ERR "[WB_C3000_GPIO_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static wb_gpio_data_t c3000_gpio_device_data = { + .irq = 15, + .pci_domain = 0x0000, + .pci_bus = 0x00, + .pci_slot = 0x1f, + .pci_fn = 1, + .pci_bar = 0, +}; + +static void wb_c3000_gpio_device_release(struct device *dev) +{ + return; +} + +static struct platform_device c3000_gpio_device = { + .name = "wb_gpio_c3000", + .id = -1, + .dev = { + .platform_data = &c3000_gpio_device_data, + .release = wb_c3000_gpio_device_release, + }, +}; + +static int __init wb_c3000_gpio_device_init(void) +{ + WB_C3000_GPIO_DEVICE_DEBUG("wb_c3000_gpio_device_init enter!\n"); + return platform_device_register(&c3000_gpio_device); + +} + +static void __exit wb_c3000_gpio_device_exit(void) +{ + + WB_C3000_GPIO_DEVICE_DEBUG("wb_c3000_gpio_device_exit enter!\n"); + platform_device_unregister(&c3000_gpio_device); + return; +} + +module_init(wb_c3000_gpio_device_init); +module_exit(wb_c3000_gpio_device_exit); +MODULE_DESCRIPTION("C3000 GPIO Controller device"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_pinctrl_intel.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_pinctrl_intel.c new file mode 100644 index 000000000000..7a52f17ac8f9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_pinctrl_intel.c @@ -0,0 +1,1829 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Intel pinctrl/GPIO core driver. + * + * Copyright (C) 2015, Intel Corporation + * Authors: Mathias Nyman + * Mika Westerberg + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "core.h" +#include "wb_pinctrl_intel.h" + +/* Offset from regs */ +#define REVID 0x000 +#define REVID_SHIFT 16 +#define REVID_MASK GENMASK(31, 16) + +#define PADBAR 0x00c + +#define PADOWN_BITS 4 +#define PADOWN_SHIFT(p) ((p) % 8 * PADOWN_BITS) +#define PADOWN_MASK(p) (GENMASK(3, 0) << PADOWN_SHIFT(p)) +#define PADOWN_GPP(p) ((p) / 8) + +/* Offset from pad_regs */ +#define PADCFG0 0x000 +#define PADCFG0_RXEVCFG_SHIFT 25 +#define PADCFG0_RXEVCFG_MASK GENMASK(26, 25) +#define PADCFG0_RXEVCFG_LEVEL 0 +#define PADCFG0_RXEVCFG_EDGE 1 +#define PADCFG0_RXEVCFG_DISABLED 2 +#define PADCFG0_RXEVCFG_EDGE_BOTH 3 +#define PADCFG0_PREGFRXSEL BIT(24) +#define PADCFG0_RXINV BIT(23) +#define PADCFG0_GPIROUTIOXAPIC BIT(20) +#define PADCFG0_GPIROUTSCI BIT(19) +#define PADCFG0_GPIROUTSMI BIT(18) +#define PADCFG0_GPIROUTNMI BIT(17) +#define PADCFG0_PMODE_SHIFT 10 +#define PADCFG0_PMODE_MASK GENMASK(13, 10) +#define PADCFG0_PMODE_GPIO 0 +#define PADCFG0_GPIORXDIS BIT(9) +#define PADCFG0_GPIOTXDIS BIT(8) +#define PADCFG0_GPIORXSTATE BIT(1) +#define PADCFG0_GPIOTXSTATE BIT(0) + +#define PADCFG1 0x004 +#define PADCFG1_TERM_UP BIT(13) +#define PADCFG1_TERM_SHIFT 10 +#define PADCFG1_TERM_MASK GENMASK(12, 10) +#define PADCFG1_TERM_20K BIT(2) +#define PADCFG1_TERM_5K BIT(1) +#define PADCFG1_TERM_1K BIT(0) +#define PADCFG1_TERM_833 (BIT(1) | BIT(0)) + +#define PADCFG2 0x008 +#define PADCFG2_DEBEN BIT(0) +#define PADCFG2_DEBOUNCE_SHIFT 1 +#define PADCFG2_DEBOUNCE_MASK GENMASK(4, 1) + +#define DEBOUNCE_PERIOD_NSEC 31250 + +struct intel_pad_context { + u32 padcfg0; + u32 padcfg1; + u32 padcfg2; +}; + +struct intel_community_context { + u32 *intmask; + u32 *hostown; +}; + +#define pin_to_padno(c, p) ((p) - (c)->pin_base) +#define padgroup_offset(g, p) ((p) - (g)->base) + +static struct intel_community *intel_get_community(struct intel_pinctrl *pctrl, + unsigned int pin) +{ + struct intel_community *community; + int i; + + for (i = 0; i < pctrl->ncommunities; i++) { + community = &pctrl->communities[i]; + if (pin >= community->pin_base && + pin < community->pin_base + community->npins) + return community; + } + + dev_warn(pctrl->dev, "failed to find community for pin %u\n", pin); + return NULL; +} + +static const struct intel_padgroup * +intel_community_get_padgroup(const struct intel_community *community, + unsigned int pin) +{ + int i; + + for (i = 0; i < community->ngpps; i++) { + const struct intel_padgroup *padgrp = &community->gpps[i]; + + if (pin >= padgrp->base && pin < padgrp->base + padgrp->size) + return padgrp; + } + + return NULL; +} + +static void __iomem *intel_get_padcfg(struct intel_pinctrl *pctrl, + unsigned int pin, unsigned int reg) +{ + const struct intel_community *community; + unsigned int padno; + size_t nregs; + + community = intel_get_community(pctrl, pin); + if (!community) + return NULL; + + padno = pin_to_padno(community, pin); + nregs = (community->features & PINCTRL_FEATURE_DEBOUNCE) ? 4 : 2; + + if (reg >= nregs * 4) + return NULL; + + return community->pad_regs + reg + padno * nregs * 4; +} + +static bool intel_pad_owned_by_host(struct intel_pinctrl *pctrl, unsigned int pin) +{ + const struct intel_community *community; + const struct intel_padgroup *padgrp; + unsigned int gpp, offset, gpp_offset; + void __iomem *padown; + + community = intel_get_community(pctrl, pin); + if (!community) + return false; + if (!community->padown_offset) + return true; + + padgrp = intel_community_get_padgroup(community, pin); + if (!padgrp) + return false; + + gpp_offset = padgroup_offset(padgrp, pin); + gpp = PADOWN_GPP(gpp_offset); + offset = community->padown_offset + padgrp->padown_num * 4 + gpp * 4; + padown = community->regs + offset; + + return !(readl(padown) & PADOWN_MASK(gpp_offset)); +} + +static bool intel_pad_set_acpi_mode(struct intel_pinctrl *pctrl, + unsigned pin, bool acpi_mode) +{ + const struct intel_community *community; + const struct intel_padgroup *padgrp; + unsigned int offset, gpp_offset; + void __iomem *hostown; + uint32_t value; + + community = intel_get_community(pctrl, pin); + if (!community) + return true; + if (!community->hostown_offset) + return false; + + padgrp = intel_community_get_padgroup(community, pin); + if (!padgrp) + return true; + + gpp_offset = padgroup_offset(padgrp, pin); + offset = community->hostown_offset + padgrp->reg_num * 4; + hostown = community->regs + offset; + + value = readl(hostown); + if (acpi_mode) { + /* ACPI mode */ + value &= ~BIT(gpp_offset); + } else { + /* GPIO mode */ + value |= BIT(gpp_offset); + } + + writel(value, hostown); + + return !(readl(hostown) & BIT(gpp_offset)); +} + +static bool intel_pad_acpi_mode(struct intel_pinctrl *pctrl, unsigned int pin) +{ + const struct intel_community *community; + const struct intel_padgroup *padgrp; + unsigned int offset, gpp_offset; + void __iomem *hostown; + + community = intel_get_community(pctrl, pin); + if (!community) + return true; + if (!community->hostown_offset) + return false; + + padgrp = intel_community_get_padgroup(community, pin); + if (!padgrp) + return true; + + gpp_offset = padgroup_offset(padgrp, pin); + offset = community->hostown_offset + padgrp->reg_num * 4; + hostown = community->regs + offset; + + return !(readl(hostown) & BIT(gpp_offset)); +} + +/** + * enum - Locking variants of the pad configuration + * + * @PAD_UNLOCKED: pad is fully controlled by the configuration registers + * @PAD_LOCKED: pad configuration registers, except TX state, are locked + * @PAD_LOCKED_TX: pad configuration TX state is locked + * @PAD_LOCKED_FULL: pad configuration registers are locked completely + * + * Locking is considered as read-only mode for corresponding registers and + * their respective fields. That said, TX state bit is locked separately from + * the main locking scheme. + */ +enum { + PAD_UNLOCKED = 0, + PAD_LOCKED = 1, + PAD_LOCKED_TX = 2, + PAD_LOCKED_FULL = PAD_LOCKED | PAD_LOCKED_TX, +}; + +static int intel_pad_locked(struct intel_pinctrl *pctrl, unsigned int pin) +{ + struct intel_community *community; + const struct intel_padgroup *padgrp; + unsigned int offset, gpp_offset; + u32 value; + int ret = PAD_UNLOCKED; + + community = intel_get_community(pctrl, pin); + if (!community) + return PAD_LOCKED_FULL; + if (!community->padcfglock_offset) + return PAD_UNLOCKED; + + padgrp = intel_community_get_padgroup(community, pin); + if (!padgrp) + return PAD_LOCKED_FULL; + + gpp_offset = padgroup_offset(padgrp, pin); + + /* + * If PADCFGLOCK and PADCFGLOCKTX bits are both clear for this pad, + * the pad is considered unlocked. Any other case means that it is + * either fully or partially locked. + */ + offset = community->padcfglock_offset + 0 + padgrp->reg_num * 8; + value = readl(community->regs + offset); + if (value & BIT(gpp_offset)) + ret |= PAD_LOCKED; + + offset = community->padcfglock_offset + 4 + padgrp->reg_num * 8; + value = readl(community->regs + offset); + if (value & BIT(gpp_offset)) + ret |= PAD_LOCKED_TX; + + return ret; +} + +static bool intel_pad_is_unlocked(struct intel_pinctrl *pctrl, unsigned int pin) +{ + return (intel_pad_locked(pctrl, pin) & PAD_LOCKED) == PAD_UNLOCKED; +} + +static bool intel_pad_usable(struct intel_pinctrl *pctrl, unsigned int pin) +{ + return intel_pad_owned_by_host(pctrl, pin) && intel_pad_is_unlocked(pctrl, pin); +} + +static int intel_get_groups_count(struct pinctrl_dev *pctldev) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + + return pctrl->soc->ngroups; +} + +static const char *intel_get_group_name(struct pinctrl_dev *pctldev, + unsigned int group) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + + return pctrl->soc->groups[group].name; +} + +static int intel_get_group_pins(struct pinctrl_dev *pctldev, unsigned int group, + const unsigned int **pins, unsigned int *npins) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + + *pins = pctrl->soc->groups[group].pins; + *npins = pctrl->soc->groups[group].npins; + return 0; +} + +static void intel_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, + unsigned int pin) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + void __iomem *padcfg; + u32 cfg0, cfg1, mode; + int locked; + bool acpi; + + if (!intel_pad_owned_by_host(pctrl, pin)) { + seq_puts(s, "not available"); + return; + } + + cfg0 = readl(intel_get_padcfg(pctrl, pin, PADCFG0)); + cfg1 = readl(intel_get_padcfg(pctrl, pin, PADCFG1)); + + mode = (cfg0 & PADCFG0_PMODE_MASK) >> PADCFG0_PMODE_SHIFT; + if (mode == PADCFG0_PMODE_GPIO) + seq_puts(s, "GPIO "); + else + seq_printf(s, "mode %d ", mode); + + seq_printf(s, "0x%08x 0x%08x", cfg0, cfg1); + + /* Dump the additional PADCFG registers if available */ + padcfg = intel_get_padcfg(pctrl, pin, PADCFG2); + if (padcfg) + seq_printf(s, " 0x%08x", readl(padcfg)); + + locked = intel_pad_locked(pctrl, pin); + acpi = intel_pad_acpi_mode(pctrl, pin); + + if (locked || acpi) { + seq_puts(s, " ["); + if (locked) + seq_puts(s, "LOCKED"); + if ((locked & PAD_LOCKED_FULL) == PAD_LOCKED_TX) + seq_puts(s, " tx"); + else if ((locked & PAD_LOCKED_FULL) == PAD_LOCKED_FULL) + seq_puts(s, " full"); + + if (locked && acpi) + seq_puts(s, ", "); + + if (acpi) + seq_puts(s, "ACPI"); + seq_puts(s, "]"); + } +} + +static const struct pinctrl_ops intel_pinctrl_ops = { + .get_groups_count = intel_get_groups_count, + .get_group_name = intel_get_group_name, + .get_group_pins = intel_get_group_pins, + .pin_dbg_show = intel_pin_dbg_show, +}; + +static int intel_get_functions_count(struct pinctrl_dev *pctldev) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + + return pctrl->soc->nfunctions; +} + +static const char *intel_get_function_name(struct pinctrl_dev *pctldev, + unsigned int function) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + + return pctrl->soc->functions[function].name; +} + +static int intel_get_function_groups(struct pinctrl_dev *pctldev, + unsigned int function, + const char * const **groups, + unsigned int * const ngroups) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + + *groups = pctrl->soc->functions[function].groups; + *ngroups = pctrl->soc->functions[function].ngroups; + return 0; +} + +static int intel_pinmux_set_mux(struct pinctrl_dev *pctldev, + unsigned int function, unsigned int group) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + const struct intel_pingroup *grp = &pctrl->soc->groups[group]; + unsigned long flags; + int i; + + raw_spin_lock_irqsave(&pctrl->lock, flags); + + /* + * All pins in the groups needs to be accessible and writable + * before we can enable the mux for this group. + */ + for (i = 0; i < grp->npins; i++) { + if (!intel_pad_usable(pctrl, grp->pins[i])) { + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + return -EBUSY; + } + } + + /* Now enable the mux setting for each pin in the group */ + for (i = 0; i < grp->npins; i++) { + void __iomem *padcfg0; + u32 value; + + padcfg0 = intel_get_padcfg(pctrl, grp->pins[i], PADCFG0); + value = readl(padcfg0); + + value &= ~PADCFG0_PMODE_MASK; + + if (grp->modes) + value |= grp->modes[i] << PADCFG0_PMODE_SHIFT; + else + value |= grp->mode << PADCFG0_PMODE_SHIFT; + + writel(value, padcfg0); + } + + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + + return 0; +} + +static void __intel_gpio_set_direction(void __iomem *padcfg0, bool input) +{ + u32 value; + + value = readl(padcfg0); + if (input) { + value &= ~PADCFG0_GPIORXDIS; + value |= PADCFG0_GPIOTXDIS; + } else { + value &= ~PADCFG0_GPIOTXDIS; + value |= PADCFG0_GPIORXDIS; + } + writel(value, padcfg0); +} + +static int intel_gpio_get_gpio_mode(void __iomem *padcfg0) +{ + return (readl(padcfg0) & PADCFG0_PMODE_MASK) >> PADCFG0_PMODE_SHIFT; +} + +static void intel_gpio_set_gpio_mode(void __iomem *padcfg0) +{ + u32 value; + + value = readl(padcfg0); + + /* Put the pad into GPIO mode */ + value &= ~PADCFG0_PMODE_MASK; + value |= PADCFG0_PMODE_GPIO; + + /* Disable input and output buffers */ + value |= PADCFG0_GPIORXDIS; + value |= PADCFG0_GPIOTXDIS; + + /* Disable SCI/SMI/NMI generation */ + value &= ~(PADCFG0_GPIROUTIOXAPIC | PADCFG0_GPIROUTSCI); + value &= ~(PADCFG0_GPIROUTSMI | PADCFG0_GPIROUTNMI); + + writel(value, padcfg0); +} + +static int intel_gpio_request_enable(struct pinctrl_dev *pctldev, + struct pinctrl_gpio_range *range, + unsigned int pin) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + void __iomem *padcfg0; + unsigned long flags; + + padcfg0 = intel_get_padcfg(pctrl, pin, PADCFG0); + + raw_spin_lock_irqsave(&pctrl->lock, flags); + + if (!intel_pad_owned_by_host(pctrl, pin)) { + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + return -EBUSY; + } + + if (!intel_pad_is_unlocked(pctrl, pin)) { + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + return 0; + } + + /* + * If pin is already configured in GPIO mode, we assume that + * firmware provides correct settings. In such case we avoid + * potential glitches on the pin. Otherwise, for the pin in + * alternative mode, consumer has to supply respective flags. + */ + if (intel_gpio_get_gpio_mode(padcfg0) == PADCFG0_PMODE_GPIO) { + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + return 0; + } + + intel_gpio_set_gpio_mode(padcfg0); + + /* Disable TX buffer and enable RX (this will be input) */ + __intel_gpio_set_direction(padcfg0, true); + + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + + return 0; +} + +static int intel_gpio_set_direction(struct pinctrl_dev *pctldev, + struct pinctrl_gpio_range *range, + unsigned int pin, bool input) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + void __iomem *padcfg0; + unsigned long flags; + + padcfg0 = intel_get_padcfg(pctrl, pin, PADCFG0); + + raw_spin_lock_irqsave(&pctrl->lock, flags); + __intel_gpio_set_direction(padcfg0, input); + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + + return 0; +} + +static const struct pinmux_ops intel_pinmux_ops = { + .get_functions_count = intel_get_functions_count, + .get_function_name = intel_get_function_name, + .get_function_groups = intel_get_function_groups, + .set_mux = intel_pinmux_set_mux, + .gpio_request_enable = intel_gpio_request_enable, + .gpio_set_direction = intel_gpio_set_direction, +}; + +static int intel_config_get_pull(struct intel_pinctrl *pctrl, unsigned int pin, + enum pin_config_param param, u32 *arg) +{ + const struct intel_community *community; + void __iomem *padcfg1; + unsigned long flags; + u32 value, term; + + community = intel_get_community(pctrl, pin); + padcfg1 = intel_get_padcfg(pctrl, pin, PADCFG1); + + raw_spin_lock_irqsave(&pctrl->lock, flags); + value = readl(padcfg1); + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + + term = (value & PADCFG1_TERM_MASK) >> PADCFG1_TERM_SHIFT; + + switch (param) { + case PIN_CONFIG_BIAS_DISABLE: + if (term) + return -EINVAL; + break; + + case PIN_CONFIG_BIAS_PULL_UP: + if (!term || !(value & PADCFG1_TERM_UP)) + return -EINVAL; + + switch (term) { + case PADCFG1_TERM_833: + *arg = 833; + break; + case PADCFG1_TERM_1K: + *arg = 1000; + break; + case PADCFG1_TERM_5K: + *arg = 5000; + break; + case PADCFG1_TERM_20K: + *arg = 20000; + break; + } + + break; + + case PIN_CONFIG_BIAS_PULL_DOWN: + if (!term || value & PADCFG1_TERM_UP) + return -EINVAL; + + switch (term) { + case PADCFG1_TERM_833: + if (!(community->features & PINCTRL_FEATURE_1K_PD)) + return -EINVAL; + *arg = 833; + break; + case PADCFG1_TERM_1K: + if (!(community->features & PINCTRL_FEATURE_1K_PD)) + return -EINVAL; + *arg = 1000; + break; + case PADCFG1_TERM_5K: + *arg = 5000; + break; + case PADCFG1_TERM_20K: + *arg = 20000; + break; + } + + break; + + default: + return -EINVAL; + } + + return 0; +} + +static int intel_config_get_debounce(struct intel_pinctrl *pctrl, unsigned int pin, + enum pin_config_param param, u32 *arg) +{ + void __iomem *padcfg2; + unsigned long flags; + unsigned long v; + u32 value2; + + padcfg2 = intel_get_padcfg(pctrl, pin, PADCFG2); + if (!padcfg2) + return -ENOTSUPP; + + raw_spin_lock_irqsave(&pctrl->lock, flags); + value2 = readl(padcfg2); + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + if (!(value2 & PADCFG2_DEBEN)) + return -EINVAL; + + v = (value2 & PADCFG2_DEBOUNCE_MASK) >> PADCFG2_DEBOUNCE_SHIFT; + *arg = BIT(v) * DEBOUNCE_PERIOD_NSEC / NSEC_PER_USEC; + + return 0; +} + +static int intel_config_get(struct pinctrl_dev *pctldev, unsigned int pin, + unsigned long *config) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + enum pin_config_param param = pinconf_to_config_param(*config); + u32 arg = 0; + int ret; + + if (!intel_pad_owned_by_host(pctrl, pin)) + return -ENOTSUPP; + + switch (param) { + case PIN_CONFIG_BIAS_DISABLE: + case PIN_CONFIG_BIAS_PULL_UP: + case PIN_CONFIG_BIAS_PULL_DOWN: + ret = intel_config_get_pull(pctrl, pin, param, &arg); + if (ret) + return ret; + break; + + case PIN_CONFIG_INPUT_DEBOUNCE: + ret = intel_config_get_debounce(pctrl, pin, param, &arg); + if (ret) + return ret; + break; + + default: + return -ENOTSUPP; + } + + *config = pinconf_to_config_packed(param, arg); + return 0; +} + +static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin, + unsigned long config) +{ + unsigned int param = pinconf_to_config_param(config); + unsigned int arg = pinconf_to_config_argument(config); + const struct intel_community *community; + void __iomem *padcfg1; + unsigned long flags; + int ret = 0; + u32 value; + + community = intel_get_community(pctrl, pin); + padcfg1 = intel_get_padcfg(pctrl, pin, PADCFG1); + + raw_spin_lock_irqsave(&pctrl->lock, flags); + + value = readl(padcfg1); + + switch (param) { + case PIN_CONFIG_BIAS_DISABLE: + value &= ~(PADCFG1_TERM_MASK | PADCFG1_TERM_UP); + break; + + case PIN_CONFIG_BIAS_PULL_UP: + value &= ~PADCFG1_TERM_MASK; + + value |= PADCFG1_TERM_UP; + + /* Set default strength value in case none is given */ + if (arg == 1) + arg = 5000; + + switch (arg) { + case 20000: + value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT; + break; + case 5000: + value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT; + break; + case 1000: + value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT; + break; + case 833: + value |= PADCFG1_TERM_833 << PADCFG1_TERM_SHIFT; + break; + default: + ret = -EINVAL; + } + + break; + + case PIN_CONFIG_BIAS_PULL_DOWN: + value &= ~(PADCFG1_TERM_UP | PADCFG1_TERM_MASK); + + /* Set default strength value in case none is given */ + if (arg == 1) + arg = 5000; + + switch (arg) { + case 20000: + value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT; + break; + case 5000: + value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT; + break; + case 1000: + if (!(community->features & PINCTRL_FEATURE_1K_PD)) { + ret = -EINVAL; + break; + } + value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT; + break; + case 833: + if (!(community->features & PINCTRL_FEATURE_1K_PD)) { + ret = -EINVAL; + break; + } + value |= PADCFG1_TERM_833 << PADCFG1_TERM_SHIFT; + break; + default: + ret = -EINVAL; + } + + break; + } + + if (!ret) + writel(value, padcfg1); + + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + + return ret; +} + +static int intel_config_set_debounce(struct intel_pinctrl *pctrl, + unsigned int pin, unsigned int debounce) +{ + void __iomem *padcfg0, *padcfg2; + unsigned long flags; + u32 value0, value2; + + padcfg2 = intel_get_padcfg(pctrl, pin, PADCFG2); + if (!padcfg2) + return -ENOTSUPP; + + padcfg0 = intel_get_padcfg(pctrl, pin, PADCFG0); + + raw_spin_lock_irqsave(&pctrl->lock, flags); + + value0 = readl(padcfg0); + value2 = readl(padcfg2); + + /* Disable glitch filter and debouncer */ + value0 &= ~PADCFG0_PREGFRXSEL; + value2 &= ~(PADCFG2_DEBEN | PADCFG2_DEBOUNCE_MASK); + + if (debounce) { + unsigned long v; + + v = order_base_2(debounce * NSEC_PER_USEC / DEBOUNCE_PERIOD_NSEC); + if (v < 3 || v > 15) { + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + return -EINVAL; + } + + /* Enable glitch filter and debouncer */ + value0 |= PADCFG0_PREGFRXSEL; + value2 |= v << PADCFG2_DEBOUNCE_SHIFT; + value2 |= PADCFG2_DEBEN; + } + + writel(value0, padcfg0); + writel(value2, padcfg2); + + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + + return 0; +} + +static int intel_config_set(struct pinctrl_dev *pctldev, unsigned int pin, + unsigned long *configs, unsigned int nconfigs) +{ + struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); + int i, ret; + + if (!intel_pad_usable(pctrl, pin)) + return -ENOTSUPP; + + for (i = 0; i < nconfigs; i++) { + switch (pinconf_to_config_param(configs[i])) { + case PIN_CONFIG_BIAS_DISABLE: + case PIN_CONFIG_BIAS_PULL_UP: + case PIN_CONFIG_BIAS_PULL_DOWN: + ret = intel_config_set_pull(pctrl, pin, configs[i]); + if (ret) + return ret; + break; + + case PIN_CONFIG_INPUT_DEBOUNCE: + ret = intel_config_set_debounce(pctrl, pin, + pinconf_to_config_argument(configs[i])); + if (ret) + return ret; + break; + + default: + return -ENOTSUPP; + } + } + + return 0; +} + +static const struct pinconf_ops intel_pinconf_ops = { + .is_generic = true, + .pin_config_get = intel_config_get, + .pin_config_set = intel_config_set, +}; + +static const struct pinctrl_desc intel_pinctrl_desc = { + .pctlops = &intel_pinctrl_ops, + .pmxops = &intel_pinmux_ops, + .confops = &intel_pinconf_ops, + .owner = THIS_MODULE, +}; + +/** + * intel_gpio_to_pin() - Translate from GPIO offset to pin number + * @pctrl: Pinctrl structure + * @offset: GPIO offset from gpiolib + * @community: Community is filled here if not %NULL + * @padgrp: Pad group is filled here if not %NULL + * + * When coming through gpiolib irqchip, the GPIO offset is not + * automatically translated to pinctrl pin number. This function can be + * used to find out the corresponding pinctrl pin. + */ +static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset, + const struct intel_community **community, + const struct intel_padgroup **padgrp) +{ + int i; + + for (i = 0; i < pctrl->ncommunities; i++) { + const struct intel_community *comm = &pctrl->communities[i]; + int j; + + for (j = 0; j < comm->ngpps; j++) { + const struct intel_padgroup *pgrp = &comm->gpps[j]; + + if (pgrp->gpio_base == INTEL_GPIO_BASE_NOMAP) + continue; + + if (offset >= pgrp->gpio_base && + offset < pgrp->gpio_base + pgrp->size) { + int pin; + + pin = pgrp->base + offset - pgrp->gpio_base; + if (community) + *community = comm; + if (padgrp) + *padgrp = pgrp; + + return pin; + } + } + } + + return -EINVAL; +} + +/** + * intel_pin_to_gpio() - Translate from pin number to GPIO offset + * @pctrl: Pinctrl structure + * @pin: pin number + * + * Translate the pin number of pinctrl to GPIO offset + */ +static __maybe_unused int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin) +{ + const struct intel_community *community; + const struct intel_padgroup *padgrp; + + community = intel_get_community(pctrl, pin); + if (!community) + return -EINVAL; + + padgrp = intel_community_get_padgroup(community, pin); + if (!padgrp) + return -EINVAL; + + return pin - padgrp->base + padgrp->gpio_base; +} + +static int intel_gpio_get(struct gpio_chip *chip, unsigned int offset) +{ + struct intel_pinctrl *pctrl = gpiochip_get_data(chip); + void __iomem *reg; + u32 padcfg0; + int pin; + + pin = intel_gpio_to_pin(pctrl, offset, NULL, NULL); + if (pin < 0) + return -EINVAL; + + reg = intel_get_padcfg(pctrl, pin, PADCFG0); + if (!reg) + return -EINVAL; + + padcfg0 = readl(reg); + if (!(padcfg0 & PADCFG0_GPIOTXDIS)) + return !!(padcfg0 & PADCFG0_GPIOTXSTATE); + + return !!(padcfg0 & PADCFG0_GPIORXSTATE); +} + +static void intel_gpio_set(struct gpio_chip *chip, unsigned int offset, + int value) +{ + struct intel_pinctrl *pctrl = gpiochip_get_data(chip); + unsigned long flags; + void __iomem *reg; + u32 padcfg0; + int pin; + + pin = intel_gpio_to_pin(pctrl, offset, NULL, NULL); + if (pin < 0) + return; + + reg = intel_get_padcfg(pctrl, pin, PADCFG0); + if (!reg) + return; + + raw_spin_lock_irqsave(&pctrl->lock, flags); + padcfg0 = readl(reg); + if (value) + padcfg0 |= PADCFG0_GPIOTXSTATE; + else + padcfg0 &= ~PADCFG0_GPIOTXSTATE; + writel(padcfg0, reg); + raw_spin_unlock_irqrestore(&pctrl->lock, flags); +} + +static int intel_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) +{ + struct intel_pinctrl *pctrl = gpiochip_get_data(chip); + unsigned long flags; + void __iomem *reg; + u32 padcfg0; + int pin; + + pin = intel_gpio_to_pin(pctrl, offset, NULL, NULL); + if (pin < 0) + return -EINVAL; + + reg = intel_get_padcfg(pctrl, pin, PADCFG0); + if (!reg) + return -EINVAL; + + raw_spin_lock_irqsave(&pctrl->lock, flags); + padcfg0 = readl(reg); + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + if (padcfg0 & PADCFG0_PMODE_MASK) + return -EINVAL; + + if (padcfg0 & PADCFG0_GPIOTXDIS) + return GPIO_LINE_DIRECTION_IN; + + return GPIO_LINE_DIRECTION_OUT; +} + +static int intel_gpio_direction_input(struct gpio_chip *chip, unsigned int offset) +{ + return pinctrl_gpio_direction_input(chip->base + offset); +} + +static int intel_gpio_direction_output(struct gpio_chip *chip, unsigned int offset, + int value) +{ + intel_gpio_set(chip, offset, value); + return pinctrl_gpio_direction_output(chip->base + offset); +} + +static const struct gpio_chip intel_gpio_chip = { + .owner = THIS_MODULE, + .request = gpiochip_generic_request, + .free = gpiochip_generic_free, + .get_direction = intel_gpio_get_direction, + .direction_input = intel_gpio_direction_input, + .direction_output = intel_gpio_direction_output, + .get = intel_gpio_get, + .set = intel_gpio_set, + .set_config = gpiochip_generic_config, +}; + +static void intel_gpio_irq_ack(struct irq_data *d) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); + struct intel_pinctrl *pctrl = gpiochip_get_data(gc); + const struct intel_community *community; + const struct intel_padgroup *padgrp; + int pin; + + pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), &community, &padgrp); + if (pin >= 0) { + unsigned int gpp, gpp_offset, is_offset; + + gpp = padgrp->reg_num; + gpp_offset = padgroup_offset(padgrp, pin); + is_offset = community->is_offset + gpp * 4; + + raw_spin_lock(&pctrl->lock); + writel(BIT(gpp_offset), community->regs + is_offset); + raw_spin_unlock(&pctrl->lock); + } +} + +static void intel_gpio_irq_mask_unmask(struct irq_data *d, bool mask) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); + struct intel_pinctrl *pctrl = gpiochip_get_data(gc); + const struct intel_community *community; + const struct intel_padgroup *padgrp; + int pin; + + pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), &community, &padgrp); + if (pin >= 0) { + unsigned int gpp, gpp_offset; + unsigned long flags; + void __iomem *reg, *is; + u32 value; + + gpp = padgrp->reg_num; + gpp_offset = padgroup_offset(padgrp, pin); + + reg = community->regs + community->ie_offset + gpp * 4; + is = community->regs + community->is_offset + gpp * 4; + + raw_spin_lock_irqsave(&pctrl->lock, flags); + + /* Clear interrupt status first to avoid unexpected interrupt */ + writel(BIT(gpp_offset), is); + + value = readl(reg); + if (mask) + value &= ~BIT(gpp_offset); + else + value |= BIT(gpp_offset); + writel(value, reg); + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + } +} + +static void intel_gpio_irq_mask(struct irq_data *d) +{ + intel_gpio_irq_mask_unmask(d, true); +} + +static void intel_gpio_irq_unmask(struct irq_data *d) +{ + intel_gpio_irq_mask_unmask(d, false); +} + +static int intel_gpio_irq_type(struct irq_data *d, unsigned int type) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); + struct intel_pinctrl *pctrl = gpiochip_get_data(gc); + unsigned int pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), NULL, NULL); + unsigned long flags; + void __iomem *reg; + u32 value; + + reg = intel_get_padcfg(pctrl, pin, PADCFG0); + if (!reg) + return -EINVAL; + + /* set not ACPI mode */ + intel_pad_set_acpi_mode(pctrl, pin, false); + + /* + * If the pin is in ACPI mode it is still usable as a GPIO but it + * cannot be used as IRQ because GPI_IS status bit will not be + * updated by the host controller hardware. + */ + if (intel_pad_acpi_mode(pctrl, pin)) { + dev_warn(pctrl->dev, "pin %u cannot be used as IRQ\n", pin); + return -EPERM; + } + + raw_spin_lock_irqsave(&pctrl->lock, flags); + + intel_gpio_set_gpio_mode(reg); + + /* Disable TX buffer and enable RX (this will be input) */ + __intel_gpio_set_direction(reg, true); + + value = readl(reg); + + value &= ~(PADCFG0_RXEVCFG_MASK | PADCFG0_RXINV); + + if ((type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) { + value |= PADCFG0_RXEVCFG_EDGE_BOTH << PADCFG0_RXEVCFG_SHIFT; + } else if (type & IRQ_TYPE_EDGE_FALLING) { + value |= PADCFG0_RXEVCFG_EDGE << PADCFG0_RXEVCFG_SHIFT; + value |= PADCFG0_RXINV; + } else if (type & IRQ_TYPE_EDGE_RISING) { + value |= PADCFG0_RXEVCFG_EDGE << PADCFG0_RXEVCFG_SHIFT; + } else if (type & IRQ_TYPE_LEVEL_MASK) { + if (type & IRQ_TYPE_LEVEL_LOW) + value |= PADCFG0_RXINV; + } else { + value |= PADCFG0_RXEVCFG_DISABLED << PADCFG0_RXEVCFG_SHIFT; + } + + writel(value, reg); + + if (type & IRQ_TYPE_EDGE_BOTH) + irq_set_handler_locked(d, handle_edge_irq); + else if (type & IRQ_TYPE_LEVEL_MASK) + irq_set_handler_locked(d, handle_level_irq); + + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + + return 0; +} + +static int intel_gpio_irq_wake(struct irq_data *d, unsigned int on) +{ + struct gpio_chip *gc = irq_data_get_irq_chip_data(d); + struct intel_pinctrl *pctrl = gpiochip_get_data(gc); + unsigned int pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), NULL, NULL); + + if (on) + enable_irq_wake(pctrl->irq); + else + disable_irq_wake(pctrl->irq); + + dev_dbg(pctrl->dev, "%sable wake for pin %u\n", on ? "en" : "dis", pin); + return 0; +} + +static int intel_gpio_community_irq_handler(struct intel_pinctrl *pctrl, + const struct intel_community *community) +{ + struct gpio_chip *gc = &pctrl->chip; + unsigned int gpp; + int ret = 0; + + for (gpp = 0; gpp < community->ngpps; gpp++) { + const struct intel_padgroup *padgrp = &community->gpps[gpp]; + unsigned long pending, enabled, gpp_offset; + unsigned long flags; + + raw_spin_lock_irqsave(&pctrl->lock, flags); + + pending = readl(community->regs + community->is_offset + + padgrp->reg_num * 4); + enabled = readl(community->regs + community->ie_offset + + padgrp->reg_num * 4); + + raw_spin_unlock_irqrestore(&pctrl->lock, flags); + + /* Only interrupts that are enabled */ + pending &= enabled; + + for_each_set_bit(gpp_offset, &pending, padgrp->size) { + unsigned int irq; + + irq = irq_find_mapping(gc->irq.domain, + padgrp->gpio_base + gpp_offset); + generic_handle_irq(irq); + } + + ret += pending ? 1 : 0; + } + + return ret; +} + +static irqreturn_t intel_gpio_irq(int irq, void *data) +{ + const struct intel_community *community; + struct intel_pinctrl *pctrl = data; + unsigned int i; + int ret = 0; + + /* Need to check all communities for pending interrupts */ + for (i = 0; i < pctrl->ncommunities; i++) { + community = &pctrl->communities[i]; + ret += intel_gpio_community_irq_handler(pctrl, community); + } + + return IRQ_RETVAL(ret); +} + +static int intel_gpio_add_community_ranges(struct intel_pinctrl *pctrl, + const struct intel_community *community) +{ + int ret = 0, i; + + for (i = 0; i < community->ngpps; i++) { + const struct intel_padgroup *gpp = &community->gpps[i]; + + if (gpp->gpio_base == INTEL_GPIO_BASE_NOMAP) + continue; + + ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev), + gpp->gpio_base, gpp->base, + gpp->size); + if (ret) + return ret; + } + + return ret; +} + +static int intel_gpio_add_pin_ranges(struct gpio_chip *gc) +{ + struct intel_pinctrl *pctrl = gpiochip_get_data(gc); + int ret, i; + + for (i = 0; i < pctrl->ncommunities; i++) { + struct intel_community *community = &pctrl->communities[i]; + + ret = intel_gpio_add_community_ranges(pctrl, community); + if (ret) { + dev_err(pctrl->dev, "failed to add GPIO pin range\n"); + return ret; + } + } + + return 0; +} + +static unsigned int intel_gpio_ngpio(const struct intel_pinctrl *pctrl) +{ + const struct intel_community *community; + unsigned int ngpio = 0; + int i, j; + + for (i = 0; i < pctrl->ncommunities; i++) { + community = &pctrl->communities[i]; + for (j = 0; j < community->ngpps; j++) { + const struct intel_padgroup *gpp = &community->gpps[j]; + + if (gpp->gpio_base == INTEL_GPIO_BASE_NOMAP) + continue; + + if (gpp->gpio_base + gpp->size > ngpio) + ngpio = gpp->gpio_base + gpp->size; + } + } + + return ngpio; +} + +static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq) +{ + int ret; + struct gpio_irq_chip *girq; + + pctrl->chip = intel_gpio_chip; + + /* Setup GPIO chip */ + pctrl->chip.ngpio = intel_gpio_ngpio(pctrl); + pctrl->chip.label = dev_name(pctrl->dev); + pctrl->chip.parent = pctrl->dev; + pctrl->chip.base = 0; + pctrl->chip.add_pin_ranges = intel_gpio_add_pin_ranges; + pctrl->irq = irq; + + /* Setup IRQ chip */ + pctrl->irqchip.name = dev_name(pctrl->dev); + pctrl->irqchip.irq_ack = intel_gpio_irq_ack; + pctrl->irqchip.irq_mask = intel_gpio_irq_mask; + pctrl->irqchip.irq_unmask = intel_gpio_irq_unmask; + pctrl->irqchip.irq_set_type = intel_gpio_irq_type; + pctrl->irqchip.irq_set_wake = intel_gpio_irq_wake; + pctrl->irqchip.flags = IRQCHIP_MASK_ON_SUSPEND; + + /* + * On some platforms several GPIO controllers share the same interrupt + * line. + */ + ret = devm_request_irq(pctrl->dev, irq, intel_gpio_irq, + IRQF_SHARED | IRQF_NO_THREAD, + dev_name(pctrl->dev), pctrl); + if (ret) { + dev_err(pctrl->dev, "failed to request interrupt\n"); + return ret; + } + + girq = &pctrl->chip.irq; + girq->chip = &pctrl->irqchip; + /* This will let us handle the IRQ in the driver */ + girq->parent_handler = NULL; + girq->num_parents = 0; + girq->default_type = IRQ_TYPE_NONE; + girq->handler = handle_bad_irq; + + ret = devm_gpiochip_add_data(pctrl->dev, &pctrl->chip, pctrl); + if (ret) { + dev_err(pctrl->dev, "failed to register gpiochip\n"); + return ret; + } + + return 0; +} + +static int intel_pinctrl_add_padgroups(struct intel_pinctrl *pctrl, + struct intel_community *community) +{ + struct intel_padgroup *gpps; + unsigned int npins = community->npins; + unsigned int padown_num = 0; + size_t ngpps, i; + + if (community->gpps) + ngpps = community->ngpps; + else + ngpps = DIV_ROUND_UP(community->npins, community->gpp_size); + + gpps = devm_kcalloc(pctrl->dev, ngpps, sizeof(*gpps), GFP_KERNEL); + if (!gpps) + return -ENOMEM; + + for (i = 0; i < ngpps; i++) { + if (community->gpps) { + gpps[i] = community->gpps[i]; + } else { + unsigned int gpp_size = community->gpp_size; + + gpps[i].reg_num = i; + gpps[i].base = community->pin_base + i * gpp_size; + gpps[i].size = min(gpp_size, npins); + npins -= gpps[i].size; + } + + if (gpps[i].size > 32) + return -EINVAL; + + /* Special treatment for GPIO base */ + switch (gpps[i].gpio_base) { + case INTEL_GPIO_BASE_MATCH: + gpps[i].gpio_base = gpps[i].base; + break; + case INTEL_GPIO_BASE_ZERO: + gpps[i].gpio_base = 0; + break; + case INTEL_GPIO_BASE_NOMAP: + default: + break; + } + + gpps[i].padown_num = padown_num; + + /* + * In older hardware the number of padown registers per + * group is fixed regardless of the group size. + */ + if (community->gpp_num_padown_regs) + padown_num += community->gpp_num_padown_regs; + else + padown_num += DIV_ROUND_UP(gpps[i].size * 4, 32); + } + + community->ngpps = ngpps; + community->gpps = gpps; + + return 0; +} + +static int intel_pinctrl_pm_init(struct intel_pinctrl *pctrl) +{ +#ifdef CONFIG_PM_SLEEP + const struct intel_pinctrl_soc_data *soc = pctrl->soc; + struct intel_community_context *communities; + struct intel_pad_context *pads; + int i; + + pads = devm_kcalloc(pctrl->dev, soc->npins, sizeof(*pads), GFP_KERNEL); + if (!pads) + return -ENOMEM; + + communities = devm_kcalloc(pctrl->dev, pctrl->ncommunities, + sizeof(*communities), GFP_KERNEL); + if (!communities) + return -ENOMEM; + + for (i = 0; i < pctrl->ncommunities; i++) { + struct intel_community *community = &pctrl->communities[i]; + u32 *intmask, *hostown; + + intmask = devm_kcalloc(pctrl->dev, community->ngpps, + sizeof(*intmask), GFP_KERNEL); + if (!intmask) + return -ENOMEM; + + communities[i].intmask = intmask; + + hostown = devm_kcalloc(pctrl->dev, community->ngpps, + sizeof(*hostown), GFP_KERNEL); + if (!hostown) + return -ENOMEM; + + communities[i].hostown = hostown; + } + + pctrl->context.pads = pads; + pctrl->context.communities = communities; +#endif + + return 0; +} + +int wb_pinctrl_probe(struct platform_device *pdev, + const struct intel_pinctrl_soc_data *soc_data) +{ + struct intel_pinctrl *pctrl; + struct intel_community *community; + wb_gpio_data_t *wb_gpio_data; + void __iomem *regs; + int i, ret; + u32 padbar, rev; + + if (!soc_data) { + dev_err(&pdev->dev, "soc_data is null\n"); + return -EINVAL; + } + + wb_gpio_data = platform_get_drvdata(pdev); + pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL); + if (!pctrl) { + dev_err(&pdev->dev, "pctrl kzalloc failed\n"); + return -ENOMEM; + } + + /* check resource */ + if (soc_data->ncommunities > GPIO_RES_MAX) { + dev_err(&pdev->dev, "GPIO ncommunities %lu is more than GPIO resource number: %d\n", + soc_data->ncommunities, GPIO_RES_MAX); + return -EINVAL; + } + + pctrl->dev = &pdev->dev; + pctrl->soc = soc_data; + pctrl->irq = wb_gpio_data->irq; + raw_spin_lock_init(&pctrl->lock); + + /* + * Make a copy of the communities which we can use to hold pointers + * to the registers. + */ + pctrl->ncommunities = pctrl->soc->ncommunities; + pctrl->communities = devm_kcalloc(&pdev->dev, pctrl->ncommunities, + sizeof(*pctrl->communities), GFP_KERNEL); + if (!pctrl->communities) { + dev_err(&pdev->dev, "devm_kcalloc communities failed. ret:%d\n", ret); + return -ENOMEM; + } + + for (i = 0; i < pctrl->ncommunities; i++) { + community = &pctrl->communities[i]; + *community = pctrl->soc->communities[i]; + + regs = wb_gpio_data->res[i]; + + /* + * Determine community features based on the revision if + * not specified already. + */ + if (!community->features) { + rev = (readl(regs + REVID) & REVID_MASK) >> REVID_SHIFT; + if (rev >= 0x94) { + community->features |= PINCTRL_FEATURE_DEBOUNCE; + community->features |= PINCTRL_FEATURE_1K_PD; + } + } + + /* Read offset of the pad configuration registers */ + padbar = readl(regs + PADBAR); + + community->regs = regs; + community->pad_regs = regs + padbar; + + ret = intel_pinctrl_add_padgroups(pctrl, community); + if (ret) { + dev_err(&pdev->dev, "intel_pinctrl_add_padgroups failed. ret:%d\n", ret); + return ret; + } + } + + ret = intel_pinctrl_pm_init(pctrl); + if (ret) { + dev_err(&pdev->dev, "intel_pinctrl_pm_init failed. ret:%d\n", ret); + return ret; + } + + pctrl->pctldesc = intel_pinctrl_desc; + pctrl->pctldesc.name = dev_name(&pdev->dev); + pctrl->pctldesc.pins = pctrl->soc->pins; + pctrl->pctldesc.npins = pctrl->soc->npins; + + pctrl->pctldev = devm_pinctrl_register(&pdev->dev, &pctrl->pctldesc, + pctrl); + if (IS_ERR(pctrl->pctldev)) { + dev_err(&pdev->dev, "failed to register pinctrl driver\n"); + return PTR_ERR(pctrl->pctldev); + } + + ret = intel_gpio_probe(pctrl, pctrl->irq); + if (ret) { + dev_err(&pdev->dev, "intel_gpio_probe failed. ret:%d\n", ret); + return ret; + } + return 0; +} +EXPORT_SYMBOL_GPL(wb_pinctrl_probe); + +#if 0 +int intel_pinctrl_probe_by_hid(struct platform_device *pdev) +{ + const struct intel_pinctrl_soc_data *data; + + data = device_get_match_data(&pdev->dev); + if (!data) + return -ENODATA; + + return intel_pinctrl_probe(pdev, data); +} +EXPORT_SYMBOL_GPL(intel_pinctrl_probe_by_hid); + +int intel_pinctrl_probe_by_uid(struct platform_device *pdev) +{ + const struct intel_pinctrl_soc_data *data; + + data = intel_pinctrl_get_soc_data(pdev); + if (IS_ERR(data)) + return PTR_ERR(data); + + return intel_pinctrl_probe(pdev, data); +} +EXPORT_SYMBOL_GPL(intel_pinctrl_probe_by_uid); + +const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_device *pdev) +{ + const struct intel_pinctrl_soc_data *data = NULL; + const struct intel_pinctrl_soc_data **table; + struct acpi_device *adev; + unsigned int i; + + adev = ACPI_COMPANION(&pdev->dev); + if (adev) { + const void *match = device_get_match_data(&pdev->dev); + + table = (const struct intel_pinctrl_soc_data **)match; + for (i = 0; table[i]; i++) { + if (!strcmp(adev->pnp.unique_id, table[i]->uid)) { + data = table[i]; + break; + } + } + } else { + const struct platform_device_id *id; + + id = platform_get_device_id(pdev); + if (!id) + return ERR_PTR(-ENODEV); + + table = (const struct intel_pinctrl_soc_data **)id->driver_data; + data = table[pdev->id]; + } + + return data ?: ERR_PTR(-ENODATA); +} +EXPORT_SYMBOL_GPL(intel_pinctrl_get_soc_data); +#endif + +#ifdef CONFIG_PM_SLEEP +static bool intel_pinctrl_should_save(struct intel_pinctrl *pctrl, unsigned int pin) +{ + const struct pin_desc *pd = pin_desc_get(pctrl->pctldev, pin); + + if (!pd || !intel_pad_usable(pctrl, pin)) + return false; + + /* + * Only restore the pin if it is actually in use by the kernel (or + * by userspace). It is possible that some pins are used by the + * BIOS during resume and those are not always locked down so leave + * them alone. + */ + if (pd->mux_owner || pd->gpio_owner || + gpiochip_line_is_irq(&pctrl->chip, intel_pin_to_gpio(pctrl, pin))) + return true; + + return false; +} + +int wb_intel_pinctrl_suspend_noirq(struct device *dev) +{ + struct intel_pinctrl *pctrl = dev_get_drvdata(dev); + struct intel_community_context *communities; + struct intel_pad_context *pads; + int i; + + pads = pctrl->context.pads; + for (i = 0; i < pctrl->soc->npins; i++) { + const struct pinctrl_pin_desc *desc = &pctrl->soc->pins[i]; + void __iomem *padcfg; + u32 val; + + if (!intel_pinctrl_should_save(pctrl, desc->number)) + continue; + + val = readl(intel_get_padcfg(pctrl, desc->number, PADCFG0)); + pads[i].padcfg0 = val & ~PADCFG0_GPIORXSTATE; + val = readl(intel_get_padcfg(pctrl, desc->number, PADCFG1)); + pads[i].padcfg1 = val; + + padcfg = intel_get_padcfg(pctrl, desc->number, PADCFG2); + if (padcfg) + pads[i].padcfg2 = readl(padcfg); + } + + communities = pctrl->context.communities; + for (i = 0; i < pctrl->ncommunities; i++) { + struct intel_community *community = &pctrl->communities[i]; + void __iomem *base; + unsigned int gpp; + + base = community->regs + community->ie_offset; + for (gpp = 0; gpp < community->ngpps; gpp++) + communities[i].intmask[gpp] = readl(base + gpp * 4); + + base = community->regs + community->hostown_offset; + for (gpp = 0; gpp < community->ngpps; gpp++) + communities[i].hostown[gpp] = readl(base + gpp * 4); + } + + return 0; +} +EXPORT_SYMBOL_GPL(wb_intel_pinctrl_suspend_noirq); + +static void intel_gpio_irq_init(struct intel_pinctrl *pctrl) +{ + size_t i; + + for (i = 0; i < pctrl->ncommunities; i++) { + const struct intel_community *community; + void __iomem *base; + unsigned int gpp; + + community = &pctrl->communities[i]; + base = community->regs; + + for (gpp = 0; gpp < community->ngpps; gpp++) { + /* Mask and clear all interrupts */ + writel(0, base + community->ie_offset + gpp * 4); + writel(0xffff, base + community->is_offset + gpp * 4); + } + } +} + +static bool intel_gpio_update_reg(void __iomem *reg, u32 mask, u32 value) +{ + u32 curr, updated; + + curr = readl(reg); + + updated = (curr & ~mask) | (value & mask); + if (curr == updated) + return false; + + writel(updated, reg); + return true; +} + +static void intel_restore_hostown(struct intel_pinctrl *pctrl, unsigned int c, + void __iomem *base, unsigned int gpp, u32 saved) +{ + const struct intel_community *community = &pctrl->communities[c]; + const struct intel_padgroup *padgrp = &community->gpps[gpp]; + struct device *dev = pctrl->dev; + const char *dummy; + u32 requested = 0; + unsigned int i; + + if (padgrp->gpio_base == INTEL_GPIO_BASE_NOMAP) + return; + + for_each_requested_gpio_in_range(&pctrl->chip, i, padgrp->gpio_base, padgrp->size, dummy) + requested |= BIT(i); + + if (!intel_gpio_update_reg(base + gpp * 4, requested, saved)) + return; + + dev_dbg(dev, "restored hostown %u/%u %#08x\n", c, gpp, readl(base + gpp * 4)); +} + +static void intel_restore_intmask(struct intel_pinctrl *pctrl, unsigned int c, + void __iomem *base, unsigned int gpp, u32 saved) +{ + struct device *dev = pctrl->dev; + + if (!intel_gpio_update_reg(base + gpp * 4, ~0U, saved)) + return; + + dev_dbg(dev, "restored mask %u/%u %#08x\n", c, gpp, readl(base + gpp * 4)); +} + +static void intel_restore_padcfg(struct intel_pinctrl *pctrl, unsigned int pin, + unsigned int reg, u32 saved) +{ + u32 mask = (reg == PADCFG0) ? PADCFG0_GPIORXSTATE : 0; + unsigned int n = reg / sizeof(u32); + struct device *dev = pctrl->dev; + void __iomem *padcfg; + + padcfg = intel_get_padcfg(pctrl, pin, reg); + if (!padcfg) + return; + + if (!intel_gpio_update_reg(padcfg, ~mask, saved)) + return; + + dev_dbg(dev, "restored pin %u padcfg%u %#08x\n", pin, n, readl(padcfg)); +} + +int wb_intel_pinctrl_resume_noirq(struct device *dev) +{ + struct intel_pinctrl *pctrl = dev_get_drvdata(dev); + const struct intel_community_context *communities; + const struct intel_pad_context *pads; + int i; + + /* Mask all interrupts */ + intel_gpio_irq_init(pctrl); + + pads = pctrl->context.pads; + for (i = 0; i < pctrl->soc->npins; i++) { + const struct pinctrl_pin_desc *desc = &pctrl->soc->pins[i]; + + if (!intel_pinctrl_should_save(pctrl, desc->number)) + continue; + + intel_restore_padcfg(pctrl, desc->number, PADCFG0, pads[i].padcfg0); + intel_restore_padcfg(pctrl, desc->number, PADCFG1, pads[i].padcfg1); + intel_restore_padcfg(pctrl, desc->number, PADCFG2, pads[i].padcfg2); + } + + communities = pctrl->context.communities; + for (i = 0; i < pctrl->ncommunities; i++) { + struct intel_community *community = &pctrl->communities[i]; + void __iomem *base; + unsigned int gpp; + + base = community->regs + community->ie_offset; + for (gpp = 0; gpp < community->ngpps; gpp++) + intel_restore_intmask(pctrl, i, base, gpp, communities[i].intmask[gpp]); + + base = community->regs + community->hostown_offset; + for (gpp = 0; gpp < community->ngpps; gpp++) + intel_restore_hostown(pctrl, i, base, gpp, communities[i].hostown[gpp]); + } + + return 0; +} +EXPORT_SYMBOL_GPL(wb_intel_pinctrl_resume_noirq); +#endif + +MODULE_AUTHOR("Mathias Nyman "); +MODULE_AUTHOR("Mika Westerberg "); +MODULE_DESCRIPTION("Intel pinctrl/GPIO core driver"); +MODULE_LICENSE("GPL v2"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_pinctrl_intel.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_pinctrl_intel.h new file mode 100644 index 000000000000..5ed0cc0651a5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/pinctrl/wb_pinctrl_intel.h @@ -0,0 +1,275 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Core pinctrl/GPIO driver for Intel GPIO controllers + * + * Copyright (C) 2015, Intel Corporation + * Authors: Mathias Nyman + * Mika Westerberg + */ + +#ifndef PINCTRL_INTEL_H +#define PINCTRL_INTEL_H + +#include +#include +#include +#include +#include +#include +#include +#include + +struct platform_device; +struct device; + +#define GPIO_RES_MAX (2) + +typedef struct wb_gpio_data_s { + int irq; + void __iomem *res[GPIO_RES_MAX]; + unsigned int pci_domain; + unsigned int pci_bus; + unsigned int pci_slot; + unsigned int pci_fn; + unsigned int pci_bar; + struct pci_dev *pci_dev; + void __iomem *pci_mem_base; +} wb_gpio_data_t; + +/** + * struct intel_pingroup - Description about group of pins + * @name: Name of the groups + * @pins: All pins in this group + * @npins: Number of pins in this groups + * @mode: Native mode in which the group is muxed out @pins. Used if @modes + * is %NULL. + * @modes: If not %NULL this will hold mode for each pin in @pins + */ +struct intel_pingroup { + const char *name; + const unsigned int *pins; + size_t npins; + unsigned short mode; + const unsigned int *modes; +}; + +/** + * struct intel_function - Description about a function + * @name: Name of the function + * @groups: An array of groups for this function + * @ngroups: Number of groups in @groups + */ +struct intel_function { + const char *name; + const char * const *groups; + size_t ngroups; +}; + +/** + * struct intel_padgroup - Hardware pad group information + * @reg_num: GPI_IS register number + * @base: Starting pin of this group + * @size: Size of this group (maximum is 32). + * @gpio_base: Starting GPIO base of this group + * @padown_num: PAD_OWN register number (assigned by the core driver) + * + * If pad groups of a community are not the same size, use this structure + * to specify them. + */ +struct intel_padgroup { + unsigned int reg_num; + unsigned int base; + unsigned int size; + int gpio_base; + unsigned int padown_num; +}; + +/** + * enum - Special treatment for GPIO base in pad group + * + * @INTEL_GPIO_BASE_ZERO: force GPIO base to be 0 + * @INTEL_GPIO_BASE_NOMAP: no GPIO mapping should be created + * @INTEL_GPIO_BASE_MATCH: matches with starting pin number + */ +enum { + INTEL_GPIO_BASE_ZERO = -2, + INTEL_GPIO_BASE_NOMAP = -1, + INTEL_GPIO_BASE_MATCH = 0, +}; + +/** + * struct intel_community - Intel pin community description + * @barno: MMIO BAR number where registers for this community reside + * @padown_offset: Register offset of PAD_OWN register from @regs. If %0 + * then there is no support for owner. + * @padcfglock_offset: Register offset of PADCFGLOCK from @regs. If %0 then + * locking is not supported. + * @hostown_offset: Register offset of HOSTSW_OWN from @regs. If %0 then it + * is assumed that the host owns the pin (rather than + * ACPI). + * @is_offset: Register offset of GPI_IS from @regs. + * @ie_offset: Register offset of GPI_IE from @regs. + * @features: Additional features supported by the hardware + * @pin_base: Starting pin of pins in this community + * @npins: Number of pins in this community + * @gpp_size: Maximum number of pads in each group, such as PADCFGLOCK, + * HOSTSW_OWN, GPI_IS, GPI_IE. Used when @gpps is %NULL. + * @gpp_num_padown_regs: Number of pad registers each pad group consumes at + * minimum. Use %0 if the number of registers can be + * determined by the size of the group. + * @gpps: Pad groups if the controller has variable size pad groups + * @ngpps: Number of pad groups in this community + * @pad_map: Optional non-linear mapping of the pads + * @nirqs: Optional total number of IRQs this community can generate + * @acpi_space_id: Optional address space ID for ACPI OpRegion handler + * @regs: Community specific common registers (reserved for core driver) + * @pad_regs: Community specific pad registers (reserved for core driver) + * + * In some of Intel GPIO host controllers this driver supports each pad group + * is of equal size (except the last one). In that case the driver can just + * fill in @gpp_size field and let the core driver to handle the rest. If + * the controller has pad groups of variable size the client driver can + * pass custom @gpps and @ngpps instead. + */ +struct intel_community { + unsigned int barno; + unsigned int padown_offset; + unsigned int padcfglock_offset; + unsigned int hostown_offset; + unsigned int is_offset; + unsigned int ie_offset; + unsigned int features; + unsigned int pin_base; + size_t npins; + unsigned int gpp_size; + unsigned int gpp_num_padown_regs; + const struct intel_padgroup *gpps; + size_t ngpps; + const unsigned int *pad_map; + unsigned short nirqs; + unsigned short acpi_space_id; + + /* Reserved for the core driver */ + void __iomem *regs; + void __iomem *pad_regs; + u32 dw_base; +}; + +/* Additional features supported by the hardware */ +#define PINCTRL_FEATURE_DEBOUNCE BIT(0) +#define PINCTRL_FEATURE_1K_PD BIT(1) + +/** + * PIN_GROUP - Declare a pin group + * @n: Name of the group + * @p: An array of pins this group consists + * @m: Mode which the pins are put when this group is active. Can be either + * a single integer or an array of integers in which case mode is per + * pin. + */ +#define PIN_GROUP(n, p, m) \ + { \ + .name = (n), \ + .pins = (p), \ + .npins = ARRAY_SIZE((p)), \ + .mode = __builtin_choose_expr( \ + __builtin_constant_p((m)), (m), 0), \ + .modes = __builtin_choose_expr( \ + __builtin_constant_p((m)), NULL, (m)), \ + } + +#define FUNCTION(n, g) \ + { \ + .name = (n), \ + .groups = (g), \ + .ngroups = ARRAY_SIZE((g)), \ + } + +/** + * struct intel_pinctrl_soc_data - Intel pin controller per-SoC configuration + * @uid: ACPI _UID for the probe driver use if needed + * @pins: Array if pins this pinctrl controls + * @npins: Number of pins in the array + * @groups: Array of pin groups + * @ngroups: Number of groups in the array + * @functions: Array of functions + * @nfunctions: Number of functions in the array + * @communities: Array of communities this pinctrl handles + * @ncommunities: Number of communities in the array + * + * The @communities is used as a template by the core driver. It will make + * copy of all communities and fill in rest of the information. + */ +struct intel_pinctrl_soc_data { + const char *uid; + const struct pinctrl_pin_desc *pins; + size_t npins; + const struct intel_pingroup *groups; + size_t ngroups; + const struct intel_function *functions; + size_t nfunctions; + const struct intel_community *communities; + size_t ncommunities; +}; + +struct intel_pad_context; +struct intel_community_context; + +/** + * struct intel_pinctrl_context - context to be saved during suspend-resume + * @pads: Opaque context per pad (driver dependent) + * @communities: Opaque context per community (driver dependent) + */ +struct intel_pinctrl_context { + struct intel_pad_context *pads; + struct intel_community_context *communities; +}; + +/** + * struct intel_pinctrl - Intel pinctrl private structure + * @dev: Pointer to the device structure + * @lock: Lock to serialize register access + * @pctldesc: Pin controller description + * @pctldev: Pointer to the pin controller device + * @chip: GPIO chip in this pin controller + * @irqchip: IRQ chip in this pin controller + * @soc: SoC/PCH specific pin configuration data + * @communities: All communities in this pin controller + * @ncommunities: Number of communities in this pin controller + * @context: Configuration saved over system sleep + * @irq: pinctrl/GPIO chip irq number + */ +struct intel_pinctrl { + struct device *dev; + raw_spinlock_t lock; + struct pinctrl_desc pctldesc; + struct pinctrl_dev *pctldev; + struct gpio_chip chip; + struct irq_chip irqchip; + const struct intel_pinctrl_soc_data *soc; + struct intel_community *communities; + size_t ncommunities; + struct intel_pinctrl_context context; + int irq; +}; + +int wb_pinctrl_probe(struct platform_device *pdev, const struct intel_pinctrl_soc_data *soc_data); + +#if 0 +const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_device *pdev); +int intel_pinctrl_probe_by_hid(struct platform_device *pdev); +int intel_pinctrl_probe_by_uid(struct platform_device *pdev); +#endif + +#ifdef CONFIG_PM_SLEEP +int wb_intel_pinctrl_suspend_noirq(struct device *dev); +int wb_intel_pinctrl_resume_noirq(struct device *dev); +#endif + +#define INTEL_PINCTRL_PM_OPS(_name) \ +const struct dev_pm_ops _name = { \ + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(wb_intel_pinctrl_suspend_noirq, \ + wb_intel_pinctrl_resume_noirq) \ +} + +#endif /* PINCTRL_INTEL_H */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/Makefile new file mode 100644 index 000000000000..369b64605dd3 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/Makefile @@ -0,0 +1,20 @@ +pes_parent_dir:=$(shell pwd)/$(lastword $(MAKEFILE_LIST)) +pes_parent_dir:=$(shell dirname $(pes_parent_dir)) + +SUBDIRS=$(shell ls -l | grep ^d | awk '{if($$9 != "build") print $$9}') +INC = -I./inc + +all : CHECK $(SUBDIRS) +CHECK : + @echo $(pes_parent_dir) + +$(SUBDIRS):ECHO + #@echo $@ + make -C $@ + +ECHO: + @echo $(SUBDIRS) + +.PHONY : clean +clean : + -rm -rf $(SYSFS_OUT_PUT) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/Makefile new file mode 100644 index 000000000000..e516b70b3d92 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/Makefile @@ -0,0 +1,25 @@ +PWD = $(shell pwd) + +EXTRA_CFLAGS:= -I$(M)/include +EXTRA_CFLAGS+= -Wall +SUBDIR_CFG = cfg +plat_dfd-objs := dfd_module.o dfd_fan_driver.o \ +dfd_slot_driver.o \ +dfd_sensors_driver.o \ +dfd_psu_driver.o \ +dfd_sff_driver.o \ +$(SUBDIR_CFG)/dfd_cfg.o \ +$(SUBDIR_CFG)/dfd_cfg_adapter.o \ +$(SUBDIR_CFG)/dfd_cfg_file.o \ +$(SUBDIR_CFG)/dfd_cfg_info.o \ +$(SUBDIR_CFG)/dfd_cfg_listnode.o \ + +obj-m := plat_dfd.o +all: + $(MAKE) -C $(KERNEL_SRC)/build M=$(PWD) modules + @if [ ! -d $(module_out_put_dir) ]; then mkdir -p $(module_out_put_dir) ;fi + cp -p $(PWD)/*.ko $(module_out_put_dir) +clean: + rm -f $(PWD)/*.o $(PWD)/$(SUBDIR_CFG)/*.o $(PWD)/*.ko $(PWD)/*.mod.c $(PWD)/.*.cmd $(PWD)/$(SUBDIR_CFG)/.*.cmd $(PWD)/*.mod + rm -f $(PWD)/Module.markers $(PWD)/Module.symvers $(PWD)/modules.order + rm -rf $(PWD)/.tmp_versions diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg.c new file mode 100644 index 000000000000..22962556eb0d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg.c @@ -0,0 +1,815 @@ +#include +#include +#include +#include +#include +#include + +#include "../include/dfd_module.h" +#include "../include/dfd_cfg_file.h" +#include "../include/dfd_cfg_listnode.h" +#include "../include/dfd_cfg_info.h" +#include "../include/dfd_cfg_adapter.h" +#include "../include/dfd_cfg.h" +#include "../../dev_sysfs/include/sysfs_common.h" + +#ifdef DFD_CFG_ITEM +#undef DFD_CFG_ITEM +#endif +#define DFD_CFG_ITEM(_id, _name, _index_min, _index_max) _name, +static char *dfd_cfg_item_name[] = { + DFD_CFG_ITEM_ALL +}; + +#ifdef DFD_CFG_ITEM +#undef DFD_CFG_ITEM +#endif +#define DFD_CFG_ITEM(_id, _name, _index_min, _index_max) {_index_min, _index_max}, +static index_range_t dfd_cfg_item_index_range[] = { + DFD_CFG_ITEM_ALL +}; + +static lnode_root_t dfd_ko_cfg_list_root; + +static void dfd_ko_cfg_del_space_lf_cr(char *str) +{ + int i, j; + int len; + + len = strlen(str); + for (i = 0; i < len; i++) { + if (str[i] == '\r' || str[i] == '\n' || str[i] == ' ') { + for (j = i; j < len - 1; j++) { + str[j] = str[j + 1]; + } + str[j] = '\0'; + len--; + i--; + } + } +} + +static int dfd_ko_cfg_get_value_from_char(char *value_str, int32_t *value, int line_num) +{ + int value_tmp = 0; + + if (strlen(value_str) == 0) { + DBG_DEBUG(DBG_WARN, "line%d: value str is empty\n", line_num); + *value = DFD_CFG_EMPTY_VALUE; + return 0; + } + + if ((strlen(value_str) > 2) && (value_str[0] == '0') + && (value_str[1] == 'x' || value_str[1] == 'X')) { + value_tmp = (int32_t)simple_strtol(value_str, NULL, 16); + } else { + value_tmp = (int32_t)simple_strtol(value_str, NULL, 10); + } + + *value = value_tmp; + return 0; +} + +static int dfd_ko_cfg_analyse_index(char *index_str, int *index1, int *index2, int line_num) +{ + int rv; + char *index1_begin_char, *index2_begin_char; + + if (index_str[0] != '_') { + DBG_DEBUG(DBG_ERROR, "line%d: no '-' between name and index1\n", line_num); + return -1; + } + + index1_begin_char = index_str; + rv = dfd_ko_cfg_get_value_from_char(++index1_begin_char, index1, line_num); + if (rv < 0) { + return -1; + } + + if (index2 == NULL) { + return 0; + } + + index2_begin_char = strchr(index1_begin_char, '_'); + if (index2_begin_char == NULL) { + DBG_DEBUG(DBG_ERROR, "line%d: no '-' between index1 and index2\n", line_num); + return -1; + } else { + rv = dfd_ko_cfg_get_value_from_char(++index2_begin_char, index2, line_num); + if (rv < 0) { + return -1; + } + } + + return 0; +} + +static int dfd_ko_cfg_check_array_index(index_range_t *index_range, int *index1, int *index2, + int line_num) +{ + + if ((*index1 < 0) || (*index1 > index_range->index1_max)) { + DBG_DEBUG(DBG_ERROR, "line%d: index1[%d] invalid, max=%d\n", line_num, *index1, + index_range->index1_max); + return -1; + } + + if (index2 == NULL) { + return 0; + } + + if ((*index2 < 0) || (*index2 > index_range->index2_max)) { + DBG_DEBUG(DBG_ERROR, "line%d: index2[%d] invalid, max=%d\n", line_num, *index2, + index_range->index2_max); + return -1; + } + + return 0; +} + +static int dfd_ko_cfg_get_index(char *index_str, index_range_t *index_range, int *index1, + int *index2, int line_num) +{ + int rv; + + if (index_range->index2_max == INDEX_NOT_EXIST) { + index2 = NULL; + } + + rv = dfd_ko_cfg_analyse_index(index_str, index1, index2, line_num); + if (rv < 0) { + return -1; + } + + rv = dfd_ko_cfg_check_array_index(index_range, index1, index2, line_num); + if (rv < 0) { + return -1; + } + + return 0; +} + +static int dfd_ko_cfg_add_int_item(int key, int value, int line_num) +{ + int rv; + int *int_cfg; + + int_cfg = lnode_find_node(&dfd_ko_cfg_list_root, key); + if (int_cfg == NULL) { + + int_cfg = (int *)kmalloc(sizeof(int), GFP_KERNEL); + if (int_cfg == NULL) { + DBG_DEBUG(DBG_ERROR, "line%d: kmalloc int fail\n", line_num); + return -1; + } + + *int_cfg = value; + rv = lnode_insert_node(&dfd_ko_cfg_list_root, key, int_cfg); + if (rv == 0) { + DBG_DEBUG(DBG_VERBOSE, "line%d: add int item[%d] success, key=0x%08x\n", line_num, value, key); + } else { + kfree(int_cfg); + int_cfg = NULL; + DBG_DEBUG(DBG_ERROR, "line%d: add int item[%d] fail, key=0x%08x rv=%d \n", line_num, value, key, rv); + return -1; + } + } else { + + DBG_DEBUG(DBG_WARN, "line%d: replace int item[%d->%d], key=0x%08x\n", line_num, *int_cfg, value, key); + *int_cfg = value; + } + + return 0; +} + +static int dfd_ko_cfg_analyse_int_item(dfd_cfg_item_id_t cfg_item_id, char *arg_name, char *arg_value, + char *cfg_pre, index_range_t *index_range, int line_num) +{ + int rv; + int index1 = 0, index2 = 0; + int value, key; + char *arg_name_tmp; + + if (index_range->index1_max != INDEX_NOT_EXIST) { + arg_name_tmp = arg_name + strlen(cfg_pre); + rv = dfd_ko_cfg_get_index(arg_name_tmp, index_range, &index1, &index2, line_num); + if (rv < 0) { + return -1; + } + } + + rv = dfd_ko_cfg_get_value_from_char(arg_value, &value, line_num); + if (rv < 0) { + return -1; + } + + key = DFD_CFG_KEY(cfg_item_id, index1, index2); + rv = dfd_ko_cfg_add_int_item(key, value, line_num); + if (rv < 0) { + return -1; + } + + return 0; +} + +static int dfd_ko_cfg_add_str_item(int key, char *str, int line_num) +{ + int rv; + char *str_cfg; + + str_cfg = lnode_find_node(&dfd_ko_cfg_list_root, key); + if (str_cfg == NULL) { + + str_cfg = (char *)kmalloc(DFD_CFG_STR_MAX_LEN, GFP_KERNEL); + if (str_cfg == NULL) { + DBG_DEBUG(DBG_ERROR, "line%d: kmalloc str[%lu] fail\n", line_num, strlen(str)); + return -1; + } + mem_clear(str_cfg, DFD_CFG_STR_MAX_LEN); + strlcpy(str_cfg, str, DFD_CFG_STR_MAX_LEN); + + rv = lnode_insert_node(&dfd_ko_cfg_list_root, key, str_cfg); + if (rv == 0) { + DBG_DEBUG(DBG_VERBOSE, "line%d: add string item[%s] success, key=0x%08x\n", line_num, str_cfg, key); + } else { + kfree(str_cfg); + str_cfg = NULL; + DBG_DEBUG(DBG_ERROR, "line%d: add string item[%s] fail, key=0x%08x rv=%d \n", line_num, str_cfg, key, rv); + return -1; + } + } else { + DBG_DEBUG(DBG_WARN, "line%d: replace string item[%s->%s], key=0x%08x\n", line_num, str_cfg, str, key); + mem_clear(str_cfg, DFD_CFG_STR_MAX_LEN); + strlcpy(str_cfg, str, DFD_CFG_STR_MAX_LEN); + } + + return 0; +} + +static int dfd_ko_cfg_analyse_str_item(dfd_cfg_item_id_t cfg_item_id, char *arg_name, char *arg_value, + char *cfg_pre, index_range_t *index_range, int line_num) +{ + int rv; + int index1 = 0, index2 = 0; + int btree_key; + char *arg_name_tmp; + + if (index_range->index1_max != INDEX_NOT_EXIST) { + arg_name_tmp = arg_name + strlen(cfg_pre); + rv = dfd_ko_cfg_get_index(arg_name_tmp, index_range, &index1, &index2, line_num); + if (rv < 0) { + return -1; + } + } + + if (strlen(arg_value) >= DFD_CFG_STR_MAX_LEN) { + DBG_DEBUG(DBG_ERROR, "line%d: string item[%s] is too long \n", line_num, arg_value); + return -1; + } + + btree_key = DFD_CFG_KEY(cfg_item_id, index1, index2); + rv = dfd_ko_cfg_add_str_item(btree_key, arg_value, line_num); + if (rv < 0) { + return -1; + } + + return 0; +} + +static int dfd_ko_cfg_get_i2c_dev_member(char *member_str, dfd_i2c_dev_mem_t *member, int line_num) +{ + dfd_i2c_dev_mem_t mem_index; + + for (mem_index = DFD_I2C_DEV_MEM_BUS; mem_index < DFD_I2C_DEV_MEM_END; mem_index++) { + if (memcmp(member_str, g_dfd_i2c_dev_mem_str[mem_index], + strlen(g_dfd_i2c_dev_mem_str[mem_index])) == 0) { + *member = mem_index; + return 0; + } + } + + DBG_DEBUG(DBG_ERROR, "line%d: i2c dev member[%s] invalid\n", line_num, member_str); + return -1; +} + +static void dfd_ko_cfg_set_i2c_dev_mem_value(dfd_i2c_dev_t *i2c_dev, dfd_i2c_dev_mem_t member, + int value) +{ + switch (member) { + case DFD_I2C_DEV_MEM_BUS: + i2c_dev->bus = value; + break; + case DFD_I2C_DEV_MEM_ADDR: + i2c_dev->addr = value; + break; + default: + break; + } +} + +static int dfd_ko_cfg_add_i2c_dev_item(int key, dfd_i2c_dev_mem_t member, int value, int line_num) +{ + int rv; + dfd_i2c_dev_t *i2c_dev_cfg; + + i2c_dev_cfg = lnode_find_node(&dfd_ko_cfg_list_root, key); + if (i2c_dev_cfg == NULL) { + + i2c_dev_cfg = (dfd_i2c_dev_t *)kmalloc(sizeof(dfd_i2c_dev_t), GFP_KERNEL); + if (i2c_dev_cfg == NULL) { + DBG_DEBUG(DBG_ERROR, "line%d: kmalloc i2c_dev fail\n", line_num); + return -1; + } + mem_clear(i2c_dev_cfg, sizeof(dfd_i2c_dev_t)); + + dfd_ko_cfg_set_i2c_dev_mem_value(i2c_dev_cfg, member, value); + rv = lnode_insert_node(&dfd_ko_cfg_list_root, key, i2c_dev_cfg); + if (rv == 0) { + DBG_DEBUG(DBG_VERBOSE, "line%d: add i2c_dev item[%s=%d] success, key=0x%08x\n", line_num, + g_dfd_i2c_dev_mem_str[member], value, key); + } else { + kfree(i2c_dev_cfg); + i2c_dev_cfg = NULL; + DBG_DEBUG(DBG_ERROR, "line%d: add i2c_dev item[%s=%d] fail, key=0x%08x rv=%d\n", line_num, + g_dfd_i2c_dev_mem_str[member], value, key, rv); + return -1; + } + } else { + + DBG_DEBUG(DBG_VERBOSE, "line%d: replace i2c_dev item[%s=%d], key=0x%08x\n", line_num, + g_dfd_i2c_dev_mem_str[member], value, key); + dfd_ko_cfg_set_i2c_dev_mem_value(i2c_dev_cfg, member, value); + } + + return 0; +} + +static int dfd_ko_cfg_analyse_i2c_dev_item(dfd_cfg_item_id_t cfg_item_id, char *arg_name, + char *arg_value, char *cfg_pre, index_range_t *index_range, int line_num) +{ + int rv; + int index1 = 0, index2 = 0; + int value, key; + char *arg_name_tmp; + dfd_i2c_dev_mem_t member; + + arg_name_tmp = arg_name + strlen(cfg_pre); + rv = dfd_ko_cfg_get_i2c_dev_member(arg_name_tmp, &member, line_num); + if (rv < 0) { + return -1; + } + + if (index_range->index1_max != INDEX_NOT_EXIST) { + arg_name_tmp += strlen(g_dfd_i2c_dev_mem_str[member]); + rv = dfd_ko_cfg_get_index(arg_name_tmp, index_range, &index1, &index2, line_num); + if (rv < 0) { + return -1; + } + } + + rv = dfd_ko_cfg_get_value_from_char(arg_value, &value, line_num); + if (rv < 0) { + return -1; + } + + key = DFD_CFG_KEY(cfg_item_id, index1, index2); + rv = dfd_ko_cfg_add_i2c_dev_item(key, member, value, line_num); + if (rv < 0) { + return -1; + } + + return 0; +} + +static int dfd_ko_cfg_get_enum_value_by_str(char *enum_val_str[], int enum_val_end, char *buf) +{ + int i; + int enum_val; + + enum_val = DFD_CFG_INVALID_VALUE; + for (i = 0; i < enum_val_end; i++) { + if (memcmp(buf, enum_val_str[i], strlen(enum_val_str[i])) == 0) { + enum_val = i; + break; + } + } + + return enum_val; +} + +static int dfd_ko_cfg_get_info_ctrl_member(char *member_str, info_ctrl_mem_t *member, int line_num) +{ + info_ctrl_mem_t mem_index; + + for (mem_index = INFO_CTRL_MEM_MODE; mem_index < INFO_CTRL_MEM_END; mem_index++) { + if (memcmp(member_str, g_info_ctrl_mem_str[mem_index], + strlen(g_info_ctrl_mem_str[mem_index])) == 0) { + *member = mem_index; + return 0; + } + } + + DBG_DEBUG(DBG_ERROR, "line%d: info ctrl member[%s] invalid\n", line_num, member_str); + return -1; +} + +static void dfd_ko_cfg_set_info_ctrl_mem_value(info_ctrl_t *info_ctrl, info_ctrl_mem_t member, + char *buf_val, int line_num) +{ + switch (member) { + case INFO_CTRL_MEM_MODE: + info_ctrl->mode = dfd_ko_cfg_get_enum_value_by_str(g_info_ctrl_mode_str, INFO_CTRL_MODE_END, buf_val);; + break; + case INFO_CTRL_MEM_INT_CONS: + dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->int_cons), line_num); + break; + case INFO_CTRL_MEM_SRC: + info_ctrl->src = dfd_ko_cfg_get_enum_value_by_str(g_info_src_str, INFO_SRC_END, buf_val); + break; + case INFO_CTRL_MEM_FRMT: + info_ctrl->frmt = dfd_ko_cfg_get_enum_value_by_str(g_info_frmt_str, INFO_FRMT_END, buf_val); + break; + case INFO_CTRL_MEM_POLA: + info_ctrl->pola = dfd_ko_cfg_get_enum_value_by_str(g_info_pola_str, INFO_POLA_END, buf_val); + break; + case INFO_CTRL_MEM_FPATH: + mem_clear(info_ctrl->fpath, sizeof(info_ctrl->fpath)); + strlcpy(info_ctrl->fpath, buf_val, sizeof(info_ctrl->fpath)); + break; + case INFO_CTRL_MEM_ADDR: + dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->addr), line_num); + break; + case INFO_CTRL_MEM_LEN: + dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->len), line_num); + break; + case INFO_CTRL_MEM_BIT_OFFSET: + dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->bit_offset), line_num); + break; + case INFO_CTRL_MEM_STR_CONS: + mem_clear(info_ctrl->str_cons, sizeof(info_ctrl->str_cons)); + strlcpy(info_ctrl->str_cons, buf_val, sizeof(info_ctrl->str_cons)); + break; + case INFO_CTRL_MEM_INT_EXTRA1: + dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->int_extra1), line_num); + break; + case INFO_CTRL_MEM_INT_EXTRA2: + dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->int_extra2), line_num); + break; + case INFO_CTRL_MEM_INT_EXTRA3: + dfd_ko_cfg_get_value_from_char(buf_val, &(info_ctrl->int_extra3), line_num); + break; + default: + break; + } +} + +static int dfd_ko_cfg_add_info_ctrl_item(int key, info_ctrl_mem_t member, char *buf_val, + int line_num) +{ + int rv; + info_ctrl_t *info_ctrl_cfg; + + info_ctrl_cfg = lnode_find_node(&dfd_ko_cfg_list_root, key); + if (info_ctrl_cfg == NULL) { + + info_ctrl_cfg = (info_ctrl_t *)kmalloc(sizeof(info_ctrl_t), GFP_KERNEL); + if (info_ctrl_cfg == NULL) { + DBG_DEBUG(DBG_ERROR, "line%d: kmalloc info_ctrl fail\n", line_num); + return -1; + } + mem_clear(info_ctrl_cfg, sizeof(info_ctrl_t)); + + dfd_ko_cfg_set_info_ctrl_mem_value(info_ctrl_cfg, member, buf_val, line_num); + rv = lnode_insert_node(&dfd_ko_cfg_list_root, key, info_ctrl_cfg); + if (rv == 0) { + DBG_DEBUG(DBG_VERBOSE, "line%d: add info_ctrl item[%s=%s] success, key=0x%08x\n", line_num, + g_info_ctrl_mem_str[member], buf_val, key); + } else { + kfree(info_ctrl_cfg); + info_ctrl_cfg = NULL; + DBG_DEBUG(DBG_ERROR, "line%d: add info_ctrl item[%s=%s] fail, key=0x%08x rv=%d\n", line_num, + g_info_ctrl_mem_str[member], buf_val, key, rv); + return -1; + } + } else { + + DBG_DEBUG(DBG_VERBOSE, "line%d: replace info_ctrl item[%s=%s], key=0x%08x\n", line_num, + g_info_ctrl_mem_str[member], buf_val, key); + dfd_ko_cfg_set_info_ctrl_mem_value(info_ctrl_cfg, member, buf_val, line_num); + } + + return 0; +} + +static int dfd_ko_cfg_analyse_info_ctrl_item(dfd_cfg_item_id_t cfg_item_id, char *arg_name, + char *arg_value, char *cfg_pre, index_range_t *index_range, int line_num) +{ + int rv; + int index1 = 0, index2 = 0; + int key; + char *arg_name_tmp; + info_ctrl_mem_t member; + + arg_name_tmp = arg_name + strlen(cfg_pre); + rv = dfd_ko_cfg_get_info_ctrl_member(arg_name_tmp, &member, line_num); + if (rv < 0) { + return -1; + } + + if (index_range->index1_max != INDEX_NOT_EXIST) { + arg_name_tmp += strlen(g_info_ctrl_mem_str[member]); + rv = dfd_ko_cfg_get_index(arg_name_tmp, index_range, &index1, &index2, line_num); + if (rv < 0) { + return -1; + } + } + + key = DFD_CFG_KEY(cfg_item_id, index1, index2); + rv = dfd_ko_cfg_add_info_ctrl_item(key, member, arg_value, line_num); + if (rv < 0) { + return -1; + } + + return 0; +} + +static int dfd_ko_cfg_analyse_config(char *arg_name, char*arg_value, int line_num) +{ + int i, rv = 0; + int cfg_item_num; + + cfg_item_num = sizeof(dfd_cfg_item_name) / sizeof(dfd_cfg_item_name[0]); + for (i = 0; i < cfg_item_num; i++) { + if (memcmp(arg_name, dfd_cfg_item_name[i], strlen(dfd_cfg_item_name[i])) == 0){ + if (DFD_CFG_ITEM_IS_INT(i)) { + rv = dfd_ko_cfg_analyse_int_item(i, arg_name, arg_value, dfd_cfg_item_name[i], + &(dfd_cfg_item_index_range[i]), line_num); + } else if (DFD_CFG_ITEM_IS_STRING(i)) { + rv = dfd_ko_cfg_analyse_str_item(i, arg_name, arg_value, dfd_cfg_item_name[i], + &(dfd_cfg_item_index_range[i]), line_num); + } else if (DFD_CFG_ITEM_IS_I2C_DEV(i)) { + rv = dfd_ko_cfg_analyse_i2c_dev_item(i, arg_name, arg_value, dfd_cfg_item_name[i], + &(dfd_cfg_item_index_range[i]), line_num); + } else if (DFD_CFG_ITEM_IS_INFO_CTRL(i)) { + rv = dfd_ko_cfg_analyse_info_ctrl_item(i, arg_name, arg_value, dfd_cfg_item_name[i], + &(dfd_cfg_item_index_range[i]), line_num); + } else { + rv = -1; + } + break; + } + } + + return rv; +} + +static int dfd_ko_cfg_cut_config_line(char *config_line, char *arg_name, char *arg_value) +{ + int i, j = 0, k = 0; + int len, name_value_flag = 0; + + len = strlen(config_line); + for (i = 0; i < len; i++) { + if (config_line[i] == '=') { + name_value_flag = 1; + continue; + } + + if (name_value_flag == 0) { + arg_name[j++] = config_line[i]; + } else { + arg_value[k++] = config_line[i]; + } + } + + if (name_value_flag == 0) { + return -1; + } else { + return 0; + } +} + +static int dfd_ko_cfg_analyse_config_line(char *config_line, int line_num) +{ + int rv; + char arg_name[DFD_CFG_NAME_MAX_LEN] = {0}; + char arg_value[DFD_CFG_VALUE_MAX_LEN] = {0}; + + dfd_ko_cfg_del_space_lf_cr(config_line); + + if (strlen(config_line) == 0) { + DBG_DEBUG(DBG_VERBOSE, "line%d: space line\n", line_num); + return 0; + } + + if (config_line[0] == '#') { + DBG_DEBUG(DBG_VERBOSE, "line%d: comment line[%s]\n", line_num, config_line); + return 0; + } + + rv = dfd_ko_cfg_cut_config_line(config_line, arg_name, arg_value); + if (rv < 0) { + DBG_DEBUG(DBG_VERBOSE, "line%d: [%s]no '=' between name and value\n", line_num, config_line); + return -1; + } + + DBG_DEBUG(DBG_VERBOSE, "line%d: config_line[%s] name[%s] value[%s]\n", line_num, config_line, arg_name, arg_value); + return dfd_ko_cfg_analyse_config(arg_name, arg_value, line_num); +} + +static int dfd_ko_cfg_analyse_config_file(char *fpath) +{ + int rv; + int line_num = 1; + kfile_ctrl_t kfile_ctrl; + char config_line[DFD_CFG_CMDLINE_MAX_LEN] = {0}; + + rv = kfile_open(fpath, &kfile_ctrl); + if (rv != KFILE_RV_OK) { + DBG_DEBUG(DBG_ERROR, "open config file[%s] fail, rv=%d\n", fpath, rv); + return -1; + } + + while(kfile_gets(config_line, sizeof(config_line), &kfile_ctrl) > 0){ + rv = dfd_ko_cfg_analyse_config_line(config_line, line_num++); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "!!!!file[%s] config line[%d %s] analyse fail\n", fpath, line_num - 1, + config_line); + break; + } + + (void)mem_clear(config_line, sizeof(config_line)); + + } + kfile_close(&kfile_ctrl); + + return rv; +} + +void *dfd_ko_cfg_get_item(int key) +{ + return lnode_find_node(&dfd_ko_cfg_list_root, key); +} + +static void dfd_ko_cfg_print_item(int key, const void *cfg) +{ + int item_id; + dfd_i2c_dev_t *i2c_dev; + info_ctrl_t *info_ctrl; + + if (cfg == NULL) { + DBG_DEBUG(DBG_ERROR, "input arguments error\n"); + return; + } + printk(KERN_INFO "**************************\n"); + printk(KERN_INFO "key=0x%08x\n", key); + + item_id = DFD_CFG_ITEM_ID(key); + if (DFD_CFG_ITEM_IS_INT(item_id)) { + printk(KERN_INFO "int=%d\n", *((int *)cfg)); + } else if (DFD_CFG_ITEM_IS_I2C_DEV(item_id)) { + i2c_dev = (dfd_i2c_dev_t *)cfg; + printk(KERN_INFO ".bus=0x%02x\n", i2c_dev->bus); + printk(KERN_INFO ".addr=0x%02x\n", i2c_dev->addr); + } else if (DFD_CFG_ITEM_IS_INFO_CTRL(item_id)) { + info_ctrl = (info_ctrl_t *)cfg; + printk(KERN_INFO ".mode=%s\n", g_info_ctrl_mode_str[info_ctrl->mode]); + printk(KERN_INFO ".int_cons=%d\n", info_ctrl->int_cons); + printk(KERN_INFO ".src=%s\n", g_info_src_str[info_ctrl->src]); + printk(KERN_INFO ".frmt=%s\n", g_info_frmt_str[info_ctrl->frmt]); + printk(KERN_INFO ".pola=%s\n", g_info_pola_str[info_ctrl->pola]); + printk(KERN_INFO ".fpath=%s\n", info_ctrl->fpath); + printk(KERN_INFO ".addr=0x%02x\n", info_ctrl->addr); + printk(KERN_INFO ".len=%d\n", info_ctrl->len); + printk(KERN_INFO ".bit_offset=%d\n", info_ctrl->bit_offset); + } else { + printk(KERN_INFO "item[%d] error!\n", item_id); + } +} + +void dfd_ko_cfg_show_item(int key) +{ + void *cfg; + + cfg = lnode_find_node(&dfd_ko_cfg_list_root, key); + if (cfg == 0) { + printk(KERN_INFO "item[0x%08x] not exist\n", key); + return; + } + + dfd_ko_cfg_print_item(key, cfg); +} + +static int dfd_get_my_dev_type_by_file(void) +{ + struct file *fp; + loff_t pos; + int card_type; + char buf[DFD_PID_BUF_LEN]; + int ret; + + fp= filp_open(DFD_PUB_CARDTYPE_FILE, O_RDONLY, 0); + if (IS_ERR(fp)) { + DBG_DEBUG(DBG_VERBOSE, "open file fail!\n"); + return -1; + } + mem_clear(buf, DFD_PID_BUF_LEN); + pos = 0; + ret = kernel_read(fp, buf, DFD_PRODUCT_ID_LENGTH + 1, &pos); + if (ret < 0) { + DBG_DEBUG(DBG_VERBOSE, "kernel_read failed, path=%s, addr=0, size=%d, ret=%d\n", + DFD_PUB_CARDTYPE_FILE, DFD_PRODUCT_ID_LENGTH + 1, ret); + filp_close(fp, NULL); + return -1; + } + + card_type = simple_strtoul(buf, NULL, 10); + DBG_DEBUG(DBG_VERBOSE, "card_type 0x%x.\n", card_type); + + filp_close(fp, NULL); + return card_type; +} + +static int drv_get_my_dev_type(void) +{ + static int type = -1; + + if (type > 0) { + return type; + } + type = dfd_get_my_dev_type_by_file(); + DBG_DEBUG(DBG_VERBOSE, "ko board type %d\n", type); + return type; +} + +static int dfd_ko_cfg_init(void) +{ + int rv; + int card_type; + char file_name[32] = {0}; + char fpath[128] = {0}; + kfile_ctrl_t kfile_ctrl; + + rv = lnode_init_root(&dfd_ko_cfg_list_root); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "init list root fail, rv=%d\n", rv); + return -1; + } + + card_type = drv_get_my_dev_type(); + if (card_type > 0) { + snprintf(fpath, sizeof(fpath), "%s0x%x", DFD_KO_CFG_FILE_DIR, card_type); + rv = kfile_open(fpath, &kfile_ctrl); + if (rv != KFILE_RV_OK) { + DBG_DEBUG(DBG_VERBOSE, "open config file[%s] fail, rv=%d, maybe not exist\n", + fpath, rv); + + rv = kfile_open(DFD_KO_CFG_FILE_NAME, &kfile_ctrl); + if (rv != KFILE_RV_OK) { + DBG_DEBUG(DBG_ERROR, "open config file[%s] fail, rv=%d\n", DFD_KO_CFG_FILE_NAME, + rv); + return -1; + } + DBG_DEBUG(DBG_ERROR, "get config file from: %s, success.\n", DFD_KO_CFG_FILE_NAME); + } else { + DBG_DEBUG(DBG_VERBOSE, "get config file from: %s, success.\n", fpath); + } + } else { + DBG_DEBUG(DBG_VERBOSE, "get board id failed, try to get config file from: %s\n", + DFD_KO_CFG_FILE_NAME); + + rv = kfile_open(DFD_KO_CFG_FILE_NAME, &kfile_ctrl); + if (rv != KFILE_RV_OK) { + DBG_DEBUG(DBG_ERROR, "open config file[%s] fail, rv=%d\n", DFD_KO_CFG_FILE_NAME, rv); + return -1; + } + DBG_DEBUG(DBG_ERROR, "get config file from: %s, success.\n", DFD_KO_CFG_FILE_NAME); + } + + while (kfile_gets(file_name, sizeof(file_name), &kfile_ctrl) > 0) { + + dfd_ko_cfg_del_space_lf_cr(file_name); + mem_clear(fpath, sizeof(fpath)); + snprintf(fpath, sizeof(fpath), "%s%s.cfg", DFD_KO_CFG_FILE_DIR, file_name); + DBG_DEBUG(DBG_VERBOSE, ">>>>start parsing config file[%s]\n", fpath); + + rv = dfd_ko_cfg_analyse_config_file(fpath); + if (rv < 0) { + break; + } + } + kfile_close(&kfile_ctrl); + + return 0; +} + +int32_t dfd_dev_cfg_init(void) +{ + return dfd_ko_cfg_init(); +} + +void dfd_dev_cfg_exit(void) +{ + lnode_free_list(&dfd_ko_cfg_list_root); + return; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_adapter.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_adapter.c new file mode 100644 index 000000000000..9c8dc6aa098e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_adapter.c @@ -0,0 +1,358 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "../include/dfd_module.h" +#include "../include/dfd_cfg_file.h" +#include "../include/dfd_cfg.h" +#include "../include/dfd_cfg_adapter.h" +#include "../../dev_sysfs/include/sysfs_common.h" + +char *g_dfd_i2c_dev_mem_str[DFD_I2C_DEV_MEM_END] = { + ".bus", + ".addr", +}; + +static dfd_i2c_dev_t* dfd_ko_get_cpld_i2c_dev(int sub_slot, int cpld_id) +{ + int key; + dfd_i2c_dev_t *i2c_dev; + + key = DFD_CFG_KEY(DFD_CFG_ITEM_CPLD_I2C_DEV, sub_slot, cpld_id); + i2c_dev = dfd_ko_cfg_get_item(key); + if (i2c_dev == NULL) { + DBG_DEBUG(DBG_ERROR, "get cpld[%d] i2c dev config fail, key=0x%08x\n", cpld_id, key); + return NULL; + } + + return i2c_dev; +} + +static int32_t dfd_ko_i2c_smbus_transfer(int read_write, int bus, int addr, int offset, uint8_t *buf, uint32_t size) +{ + int rv; + struct i2c_adapter *i2c_adap; + union i2c_smbus_data data; + + i2c_adap = i2c_get_adapter(bus); + if (i2c_adap == NULL) { + DBG_DEBUG(DBG_ERROR, "get i2c bus[%d] adapter fail\n", bus); + return -DFD_RV_DEV_FAIL; + } + + if (read_write == I2C_SMBUS_WRITE) { + data.byte = *buf; + } else { + data.byte = 0; + } + rv = i2c_smbus_xfer(i2c_adap, addr, 0, read_write, offset, I2C_SMBUS_BYTE_DATA, &data); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "i2c dev[bus=%d addr=0x%x offset=0x%x size=%d rw=%d] transfer fail, rv=%d\n", + bus, addr, offset, size, read_write, rv); + rv = -DFD_RV_DEV_FAIL; + } else { + DBG_DEBUG(DBG_VERBOSE, "i2c dev[bus=%d addr=0x%x offset=0x%x size=%d rw=%d] transfer success\n", + bus, addr, offset, size, read_write); + rv = DFD_RV_OK; + } + + if (read_write == I2C_SMBUS_READ) { + if (rv == DFD_RV_OK) { + *buf = data.byte; + } else { + *buf = 0; + } + } + + i2c_put_adapter(i2c_adap); + return rv; +} + +static int32_t dfd_ko_i2c_read_data(int bus, int addr, int offset, uint8_t *buf, uint32_t size) +{ + int i, rv; + for (i = 0; i < DFD_KO_CPLD_I2C_RETRY_TIMES; i++) { + rv = dfd_ko_i2c_smbus_transfer(I2C_SMBUS_READ, bus, addr, offset, buf, size); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "[%d]cpld read[offset=0x%x] fail, rv %d\n", i, addr, rv); + msleep(DFD_KO_CPLD_I2C_RETRY_SLEEP); + } else { + DBG_DEBUG(DBG_VERBOSE, "[%d]cpld read[offset=0x%x] success, value=0x%x\n", + i, addr, *buf); + break; + } + } + return rv; +} + +static int32_t dfd_ko_i2c_write_data(int bus, int addr, int offset, uint8_t data, uint32_t size) +{ + int i, rv; + for (i = 0; i < DFD_KO_CPLD_I2C_RETRY_TIMES; i++) { + rv = dfd_ko_i2c_smbus_transfer(I2C_SMBUS_WRITE, bus, addr, offset, &data, size); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "[%d]cpld write[offset=0x%x] fail, rv=%d\n", i, addr, rv); + msleep(DFD_KO_CPLD_I2C_RETRY_SLEEP); + } else { + DBG_DEBUG(DBG_VERBOSE, "[%d]cpld write[offset=0x%x, data=%d] success\n", i, addr, data); + break; + } + } + + return rv; +} + +static int32_t dfd_ko_cpld_i2c_read(int32_t addr, uint8_t *buf) +{ + int rv; + int sub_slot, cpld_id, cpld_addr; + dfd_i2c_dev_t *i2c_dev; + + if (buf == NULL) { + DBG_DEBUG(DBG_ERROR, "input arguments error\n"); + return -DFD_RV_INDEX_INVALID; + } + + sub_slot = DFD_KO_CPLD_GET_SLOT(addr); + cpld_id = DFD_KO_CPLD_GET_ID(addr); + cpld_addr = DFD_KO_CPLD_GET_INDEX(addr); + + i2c_dev = dfd_ko_get_cpld_i2c_dev(sub_slot, cpld_id); + if (i2c_dev == NULL) { + return -DFD_RV_DEV_NOTSUPPORT; + } + rv = dfd_ko_i2c_read_data(i2c_dev->bus, i2c_dev->addr, cpld_addr, buf, sizeof(uint8_t)); + + return rv; +} + +static int32_t dfd_ko_cpld_i2c_write(int32_t addr, uint8_t data) +{ + int rv; + int sub_slot, cpld_id, cpld_addr; + dfd_i2c_dev_t *i2c_dev; + + sub_slot = DFD_KO_CPLD_GET_SLOT(addr); + cpld_id = DFD_KO_CPLD_GET_ID(addr); + cpld_addr = DFD_KO_CPLD_GET_INDEX(addr); + + i2c_dev = dfd_ko_get_cpld_i2c_dev(sub_slot, cpld_id); + if (i2c_dev == NULL) { + return -DFD_RV_DEV_NOTSUPPORT; + } + + rv = dfd_ko_i2c_write_data(i2c_dev->bus, i2c_dev->addr, cpld_addr, data, sizeof(uint8_t)); + + return rv; +} + +static int32_t dfd_ko_cpld_io_read(int32_t addr, uint8_t *buf) +{ + int cpld_id, sub_slot, offset; + int key; + int *tmp; + uint16_t io_port; + + sub_slot = DFD_KO_CPLD_GET_SLOT(addr); + cpld_id = DFD_KO_CPLD_GET_ID(addr); + offset = DFD_KO_CPLD_GET_INDEX(addr); + + key = DFD_CFG_KEY(DFD_CFG_ITEM_CPLD_LPC_DEV, sub_slot, cpld_id); + tmp = dfd_ko_cfg_get_item(key); + if (tmp == NULL) { + DBG_DEBUG(DBG_ERROR,"get cpld io base config fail, key=0x%08x\n", key); + return -1; + } + + io_port = (u16)(*tmp) + offset; + *buf = inb(io_port); + DBG_DEBUG(DBG_VERBOSE, "read cpld io port addr 0x%x, data 0x%x\n", io_port, *buf); + + return DFD_RV_OK; + +} + +static int32_t dfd_ko_cpld_io_write(int32_t addr, uint8_t data) +{ + int cpld_id, sub_slot, offset; + int key; + int *tmp; + uint16_t io_port; + + sub_slot = DFD_KO_CPLD_GET_SLOT(addr); + cpld_id = DFD_KO_CPLD_GET_ID(addr); + offset = DFD_KO_CPLD_GET_INDEX(addr); + + key = DFD_CFG_KEY(DFD_CFG_ITEM_CPLD_LPC_DEV, sub_slot, cpld_id); + tmp = dfd_ko_cfg_get_item(key); + if (tmp == NULL) { + DBG_DEBUG(DBG_ERROR, "get cpld io base config fail, key=0x%08x\n", key); + return -1; + } + + io_port = (u16)(*tmp) + offset; + DBG_DEBUG(DBG_VERBOSE, "write cpld io port addr 0x%x, data 0x%x\n", io_port, data); + outb(data, (u16)io_port); + + return DFD_RV_OK; +} + +static int dfd_cfg_get_cpld_mode(int sub_slot, int cpld_id, int *mode) +{ + int key; + char *name; + + if (mode == NULL) { + DBG_DEBUG(DBG_ERROR, "input arguments error\n"); + return -DFD_RV_TYPE_ERR; + } + + key = DFD_CFG_KEY(DFD_CFG_ITEM_CPLD_MODE, sub_slot, cpld_id); + name = dfd_ko_cfg_get_item(key); + if (name == NULL) { + DBG_DEBUG(DBG_ERROR, "get cpld[%d] mode info ctrl fail, key=0x%08x\n", cpld_id, key); + return -DFD_RV_NODE_FAIL; + } + + DBG_DEBUG(DBG_VERBOSE, "cpld_id %d mode_name %s.\n", cpld_id, name); + if (!strncmp(name, DFD_KO_CPLD_MODE_I2C_STRING, strlen(DFD_KO_CPLD_MODE_I2C_STRING))) { + *mode = DFD_CPLD_MODE_I2C; + } else if (!strncmp(name, DFD_KO_CPLD_MODE_LPC_STRING, strlen(DFD_KO_CPLD_MODE_LPC_STRING))) { + *mode = DFD_CPLD_MODE_LPC; + } else { + + *mode = DFD_CPLD_MODE_I2C; + } + + DBG_DEBUG(DBG_VERBOSE, "cpld_id %d mode %d.\n", cpld_id, *mode); + return 0; +} + +int32_t dfd_ko_cpld_read(int32_t addr, uint8_t *buf) +{ + int ret; + int sub_slot, cpld_id; + int cpld_mode; + + sub_slot = DFD_KO_CPLD_GET_SLOT(addr); + cpld_id = DFD_KO_CPLD_GET_ID(addr); + + ret = dfd_cfg_get_cpld_mode(sub_slot, cpld_id, &cpld_mode); + if (ret) { + DBG_DEBUG(DBG_WARN, "drv_get_cpld_mode sub_slot %d cpldid %d faile, set default i2c mode.\n", sub_slot, cpld_id); + cpld_mode = DFD_CPLD_MODE_I2C; + } + + if (cpld_mode == DFD_CPLD_MODE_I2C) { + ret = dfd_ko_cpld_i2c_read(addr, buf); + } else if (cpld_mode == DFD_CPLD_MODE_LPC) { + ret = dfd_ko_cpld_io_read(addr, buf); + } else { + DBG_DEBUG(DBG_ERROR, "cpld_mode %d invalid.\n", cpld_mode); + ret = -DFD_RV_DEV_NOTSUPPORT; + } + + DBG_DEBUG(DBG_VERBOSE, "addr 0x%x val 0x%x ret %d\n", addr, *buf, ret); + return ret; +} + +int32_t dfd_ko_cpld_write(int32_t addr, uint8_t val) +{ + int ret; + int sub_slot, cpld_id, cpld_mode; + + sub_slot = DFD_KO_CPLD_GET_SLOT(addr); + cpld_id = DFD_KO_CPLD_GET_ID(addr); + + ret = dfd_cfg_get_cpld_mode(sub_slot, cpld_id, &cpld_mode); + if (ret) { + DBG_DEBUG(DBG_ERROR, "drv_get_cpld_mode sub_slot %d cpldid %d faile, set default local_bus mode.\n", sub_slot, cpld_id); + cpld_mode = DFD_CPLD_MODE_I2C; + } + + if (cpld_mode == DFD_CPLD_MODE_I2C) { + ret = dfd_ko_cpld_i2c_write(addr, val); + } else if (cpld_mode == DFD_CPLD_MODE_LPC) { + ret = dfd_ko_cpld_io_write(addr, val); + } else { + DBG_DEBUG(DBG_ERROR, "cpld_mode %d invalid.\n", cpld_mode); + ret = -DFD_RV_DEV_NOTSUPPORT; + } + + DBG_DEBUG(DBG_VERBOSE, "addr 0x%x val 0x%x ret %d\n", addr, val, ret); + return ret; +} + +int32_t dfd_ko_i2c_read(int bus, int addr, int offset, uint8_t *buf, uint32_t size) +{ + int i, rv; + + for (i = 0; i < size; i++) { + rv = dfd_ko_i2c_read_data(bus, addr, offset, &buf[i], sizeof(uint8_t)); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "dfd_ko_i2c_read[bus=%d addr=0x%x offset=0x%x]fail, rv=%d\n", + bus, addr, offset, rv); + return rv; + } + offset++; + } + + return size; +} + +int32_t dfd_ko_i2c_write(int bus, int addr, int offset, uint8_t *buf, uint32_t size) +{ + int i, rv; + + for (i = 0; i < size; i++) { + rv = dfd_ko_i2c_write_data(bus, addr, offset, buf[i], sizeof(uint8_t)); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "dfd_ko_i2c_write[bus=%d addr=0x%x offset=0x%x]fail, rv=%d\n", + bus, addr, offset, rv); + return rv; + } + offset++; + } + + return size; + +} + +int32_t dfd_ko_read_file(char *fpath, int32_t addr, uint8_t *val, int32_t read_bytes) +{ + int32_t ret; + struct file *filp; + loff_t pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, read_bytes, MAX_RW_COUNT), + }; + struct iov_iter iter; + + if ((fpath == NULL) || (val == NULL) || (addr < 0) || (read_bytes < 0)) { + DBG_DEBUG(DBG_ERROR, "input arguments error, addr=%d read_bytes=%d\n", addr, read_bytes); + return -DFD_RV_INDEX_INVALID; + } + + filp = filp_open(fpath, O_RDONLY, 0); + if (IS_ERR(filp)){ + DBG_DEBUG(DBG_ERROR, "open file[%s] fail\n", fpath); + return -DFD_RV_DEV_FAIL; + } + + pos = addr; + iov_iter_kvec(&iter, ITER_DEST, &iov, 1, iov.iov_len); + ret = vfs_iter_read(filp, &iter, &pos, 0); + if (ret < 0) { + DBG_DEBUG(DBG_ERROR, "vfs_iter_read failed, path=%s, addr=%d, size=%d, ret=%d\n", fpath, addr, read_bytes, ret); + ret = -DFD_RV_DEV_FAIL; + } + + filp_close(filp, NULL); + return ret; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_file.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_file.c new file mode 100644 index 000000000000..ac1c22ff1c51 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_file.c @@ -0,0 +1,236 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../include/dfd_cfg_file.h" +#include "../include/dfd_module.h" +#include "../../dev_sysfs/include/sysfs_common.h" + +struct getdents_callback { + struct dir_context ctx; + const char *obj_name; + char *match_name; + int dir_len; + int found; +}; + +int kfile_open(char *fname, kfile_ctrl_t *kfile_ctrl) +{ + int ret; + struct file *filp; + loff_t pos; + + if ((fname == NULL) || (kfile_ctrl == NULL)) { + return KFILE_RV_INPUT_ERR; + } + + filp = filp_open(fname, O_RDONLY, 0); + if (IS_ERR(filp)){ + return KFILE_RV_OPEN_FAIL; + } + + kfile_ctrl->size = filp->f_inode->i_size; + + kfile_ctrl->buf = kmalloc(kfile_ctrl->size, GFP_KERNEL); + if (kfile_ctrl->buf == NULL) { + ret = KFILE_RV_MALLOC_FAIL; + goto close_fp; + } + mem_clear(kfile_ctrl->buf, kfile_ctrl->size); + + pos = 0; + ret = kernel_read(filp, kfile_ctrl->buf, kfile_ctrl->size, &pos); + if (ret < 0) { + ret = KFILE_RV_RD_FAIL; + goto free_buf; + } + + kfile_ctrl->pos = 0; + + ret = KFILE_RV_OK; + goto close_fp; + +free_buf: + kfree(kfile_ctrl->buf); + kfile_ctrl->buf = NULL; + +close_fp: + filp_close(filp, NULL); + return ret; +} + +void kfile_close(kfile_ctrl_t *kfile_ctrl) +{ + if (kfile_ctrl == NULL) { + return; + } + + kfile_ctrl->size = 0; + kfile_ctrl->pos = 0; + if (kfile_ctrl->buf) { + kfree(kfile_ctrl->buf); + kfile_ctrl->buf = NULL; + } +} + +int kfile_gets(char *buf, int buf_size, kfile_ctrl_t *kfile_ctrl) +{ + int i; + int has_cr = 0; + + if ((buf == NULL) || (buf_size <= 0) || (kfile_ctrl == NULL) || (kfile_ctrl->buf == NULL) + || (kfile_ctrl->size <= 0)) { + return KFILE_RV_INPUT_ERR; + } + + mem_clear(buf, buf_size); + for (i = 0; i < buf_size; i++) { + + if (kfile_ctrl->pos >= kfile_ctrl->size) { + break; + } + + if (has_cr) { + break; + } + + if (IS_CR(kfile_ctrl->buf[kfile_ctrl->pos])) { + has_cr = 1; + } + + buf[i] = kfile_ctrl->buf[kfile_ctrl->pos]; + kfile_ctrl->pos++; + } + + return i; +} + +int kfile_read(int32_t addr, char *buf, int buf_size, kfile_ctrl_t *kfile_ctrl) +{ + int i; + + if ((buf == NULL) || (buf_size <= 0) || (kfile_ctrl == NULL) || (kfile_ctrl->buf == NULL) + || (kfile_ctrl->size <= 0)) { + return KFILE_RV_INPUT_ERR; + } + + if ((addr < 0) || (addr >= kfile_ctrl->size)) { + return KFILE_RV_ADDR_ERR; + } + + mem_clear(buf, buf_size); + + kfile_ctrl->pos = addr; + for (i = 0; i < buf_size; i++) { + + if (kfile_ctrl->pos >= kfile_ctrl->size) { + break; + } + + buf[i] = kfile_ctrl->buf[kfile_ctrl->pos]; + kfile_ctrl->pos++; + } + + return i; +} + +static bool kfile_filldir_one(struct dir_context *ctx, const char * name, int len, + loff_t pos, u64 ino, unsigned int d_type) +{ + struct getdents_callback *buf ; + bool result; + buf = container_of(ctx, struct getdents_callback, ctx); + result = 1; + if (strncmp(buf->obj_name, name, strlen(buf->obj_name)) == 0) { + if (buf->dir_len < len) { + DBG_DEBUG(DBG_ERROR, "match ok. dir name:%s, but buf_len %d small than dir len %d.\n", + name, buf->dir_len, len); + buf->found = 0; + return 0; + } + mem_clear(buf->match_name, buf->dir_len); + memcpy(buf->match_name, name, len); + buf->found = 1; + result = 0; + } + return result; +} + +int kfile_iterate_dir(const char *dir_path, const char *obj_name, char *match_name, int len) +{ + int ret; + struct file *dir; + struct getdents_callback buffer = { + .ctx.actor = kfile_filldir_one, + }; + + if(!dir_path || !obj_name || !match_name) { + DBG_DEBUG(DBG_ERROR, "params error. \n"); + return KFILE_RV_INPUT_ERR; + } + buffer.obj_name = obj_name; + buffer.match_name = match_name; + buffer.dir_len = len; + buffer.found = 0; + + dir = filp_open(dir_path, O_RDONLY, 0); + if (IS_ERR(dir)) { + DBG_DEBUG(DBG_ERROR, "filp_open error, dir path:%s\n", dir_path); + return KFILE_RV_OPEN_FAIL; + } + ret = iterate_dir(dir, &buffer.ctx); + if (buffer.found) { + DBG_DEBUG(DBG_VERBOSE, "match ok, dir name:%s\n", match_name); + filp_close(dir, NULL); + return DFD_RV_OK; + } + filp_close(dir, NULL); + return -DFD_RV_NODE_FAIL; +} + +#if 0 + +int kfile_write(char *fpath, int32_t addr, char *buf, int buf_size) +{ + int ret = KFILE_RV_OK; + struct file *filp; + mm_segment_t old_fs; + int wlen; + + if ((fpath == NULL) || (buf == NULL) || (buf_size <= 0)) { + return KFILE_RV_INPUT_ERR; + } + + if (addr < 0) { + return KFILE_RV_ADDR_ERR; + } + + filp = filp_open(fpath, O_RDWR, 0); + if (IS_ERR(filp)){ + return KFILE_RV_OPEN_FAIL; + } + + old_fs = get_fs(); + set_fs(KERNEL_DS); + + filp->f_op->llseek(filp,0,0); + filp->f_pos = addr; + + wlen = filp->f_op->write(filp, buf, buf_size, &(filp->f_pos)); + if (wlen < 0) { + ret = KFILE_RV_WR_FAIL; + } + + filp->f_op->llseek(filp,0,0); + set_fs(old_fs); + filp_close(filp, NULL); + + return ret; +} +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_info.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_info.c new file mode 100644 index 000000000000..c1ad958bc8bb --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_info.c @@ -0,0 +1,776 @@ +#include +#include +#include + +#include "../include/dfd_module.h" +#include "../include/dfd_cfg_adapter.h" +#include "../include/dfd_cfg.h" +#include "../include/dfd_cfg_info.h" +#include "../include/dfd_cfg_file.h" +#include "../../dev_sysfs/include/sysfs_common.h" + +#define DFD_HWMON_NAME "hwmon" +/* CPLD_VOLATGE_VALUE_MODE1 */ +#define DFD_GET_CPLD_VOLATGE_CODE_VALUE(value) ((value >> 4)& 0xfff) +/* ((code_val * 16 * 33 * k) / ((65536 - 5000) * 10)) = ((code_val * 33 * k) / 37835) */ +#define DFD_GET_CPLD_VOLATGE_REAL_VALUE(code_val, k) ((code_val * 33 * k) / 37835) + + +/* CPLD_VOLATGE_VALUE_MODE2 */ +/* high 8 bit + low 4 bit(bit0-bit3) */ +#define DFD_GET_CPLD_VOLATGE_CODE_VALUE2(value) (((value & 0xff00) >> 4) + (value & 0xf)) +#define DFD_GET_CPLD_VOLATGE_REAL_VALUE2(code_val, k) ((code_val * 33 * k) / 40950) + +typedef enum cpld_volatge_value_s { + CPLD_VOLATGE_VALUE_MODE1, + CPLD_VOLATGE_VALUE_MODE2, +} cpld_volatge_value_t; + +char *g_info_ctrl_mem_str[INFO_CTRL_MEM_END] = { + ".mode", + ".int_cons", + ".src", + ".frmt", + ".pola", + ".fpath", + ".addr", + ".len", + ".bit_offset", + ".str_cons", + ".int_extra1", + ".int_extra2", + ".int_extra3", +}; + +char *g_info_ctrl_mode_str[INFO_CTRL_MODE_END] = { + "none", + "config", + "constant", + "tlv", + "str_constant", +}; + +char *g_info_src_str[INFO_SRC_END] = { + "none", + "cpld", + "fpga", + "other_i2c", + "file", +}; + +char *g_info_frmt_str[INFO_FRMT_END] = { + "none", + "bit", + "byte", + "num_bytes", + "num_str", + "num_buf", + "buf", +}; + +char *g_info_pola_str[INFO_POLA_END] = { + "none", + "positive", + "negative", +}; + +#define MAC_TEMP_INVALID (99999999) + +static int dfd_read_info_from_cpld(int32_t addr, int read_bytes, uint8_t *val) +{ + int i, rv; + + for (i = 0; i < read_bytes; i++) { + rv = dfd_ko_cpld_read(addr, &(val[i])); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "read info[addr=0x%x read_bytes=%d] from cpld fail, reading_byte=%d rv=%d\n", + addr, read_bytes, i, rv); + return rv; + } + addr++; + } + + return read_bytes; +} + +static int dfd_write_info_to_cpld(int32_t addr, int write_bytes, uint8_t *val, uint8_t bit_mask) +{ + int rv; + uint8_t val_tmp; + + if (bit_mask != 0xff) { + rv = dfd_ko_cpld_read(addr, &val_tmp); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "read original info[addr=0x%x] from cpld fail, rv=%d\n", addr, rv); + return -1; + } + + val_tmp = (val_tmp & (~bit_mask)) | (val[0] & bit_mask); + } else { + val_tmp = val[0]; + } + + rv = dfd_ko_cpld_write(addr, val_tmp); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "write info[addr=0x%x val=0x%x] to cpld fail, rv=%d\n", addr, val_tmp, rv); + return -1; + } + + return 0; +} + +static int dfd_read_info(info_src_t src, char *fpath, int32_t addr, int read_bytes, uint8_t *val) +{ + int rv = 0; + + switch (src) { + case INFO_SRC_CPLD: + rv = dfd_read_info_from_cpld(addr, read_bytes, val); + break; + case INFO_SRC_FPGA: + rv = -1; + DBG_DEBUG(DBG_ERROR, "not support read info from fpga\n"); + break; + case INFO_SRC_OTHER_I2C: + rv = -1; + DBG_DEBUG(DBG_ERROR, "not support read info from other i2c\n"); + break; + case INFO_SRC_FILE: + rv = dfd_ko_read_file(fpath, addr, val, read_bytes); + break; + default: + rv = -1; + DBG_DEBUG(DBG_ERROR, "info src[%d] error\n", src); + break; + } + + return rv; +} + +static int dfd_write_info(info_src_t src, char *fpath, int32_t addr, int write_bytes, uint8_t *val, uint8_t bit_mask) +{ + int rv = 0; + + switch (src) { + case INFO_SRC_CPLD: + rv = dfd_write_info_to_cpld(addr, write_bytes, val, bit_mask); + break; + case INFO_SRC_FPGA: + rv = -1; + DBG_DEBUG(DBG_ERROR, "not support write info to fpga\n"); + break; + case INFO_SRC_OTHER_I2C: + rv = -1; + DBG_DEBUG(DBG_ERROR, "not support write info to other i2c\n"); + break; + case INFO_SRC_FILE: + rv = -1; + DBG_DEBUG(DBG_ERROR, "not support write info to file\n"); + break; + default: + rv = -1; + DBG_DEBUG(DBG_ERROR, "info src[%d] error\n", src); + break; + } + + return rv; +} + +static int dfd_get_info_value(info_ctrl_t *info_ctrl, int *ret, info_num_buf_to_value_f pfun) +{ + int i, rv; + int read_bytes, readed_bytes, int_tmp; + uint8_t byte_tmp, val[INFO_INT_MAX_LEN + 1] = {0}; + + if (info_ctrl->mode == INFO_CTRL_MODE_CONS) { + *ret = info_ctrl->int_cons; + return DFD_RV_OK; + } + if (info_ctrl->mode == INFO_CTRL_MODE_TLV) { + return INFO_CTRL_MODE_TLV; + } + + if (IS_INFO_FRMT_BIT(info_ctrl->frmt)) { + if (!INFO_BIT_OFFSET_VALID(info_ctrl->bit_offset)) { + DBG_DEBUG(DBG_ERROR, "info ctrl bit_offsest[%d] invalid\n", + info_ctrl->bit_offset); + return -DFD_RV_TYPE_ERR; + } + read_bytes = 1; + } else if (IS_INFO_FRMT_BYTE(info_ctrl->frmt) || IS_INFO_FRMT_NUM_STR(info_ctrl->frmt) + || IS_INFO_FRMT_NUM_BUF(info_ctrl->frmt)) { + if (!INFO_INT_LEN_VALAID(info_ctrl->len)) { + DBG_DEBUG(DBG_ERROR, "info ctrl len[%d] invalid\n", info_ctrl->len); + return -DFD_RV_TYPE_ERR; + } + read_bytes = info_ctrl->len; + } else { + DBG_DEBUG(DBG_ERROR, "info ctrl info format[%d] error\n", info_ctrl->frmt); + return -DFD_RV_TYPE_ERR; + } + + readed_bytes = dfd_read_info(info_ctrl->src, info_ctrl->fpath, info_ctrl->addr, read_bytes, &(val[0])); + if (readed_bytes <= 0) { + DBG_DEBUG(DBG_ERROR, "read int info[src=%s frmt=%s fpath=%s addr=0x%x read_bytes=%d] fail, rv=%d\n", + g_info_src_str[info_ctrl->src], g_info_frmt_str[info_ctrl->frmt], info_ctrl->fpath, + info_ctrl->addr, read_bytes, readed_bytes); + return -DFD_RV_DEV_FAIL; + } + + if (IS_INFO_FRMT_BIT(info_ctrl->frmt)) { + if (info_ctrl->pola == INFO_POLA_NEGA) { + val[0] = ~val[0]; + } + byte_tmp = (val[0] >> info_ctrl->bit_offset) & (~(0xff << info_ctrl->len)); + if (pfun) { + rv = pfun(&byte_tmp, sizeof(byte_tmp), &int_tmp); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "info ctrl bit process fail, rv=%d\n", rv); + return rv; + } + } else { + int_tmp = (int)byte_tmp; + } + } else if (IS_INFO_FRMT_BYTE(info_ctrl->frmt)) { + int_tmp = 0; + for (i = 0; i < info_ctrl->len; i++) { + if (info_ctrl->pola == INFO_POLA_NEGA) { + int_tmp |= val[info_ctrl->len - i - 1]; + } else { + int_tmp |= val[i]; + } + if (i != (info_ctrl->len - 1)) { + int_tmp <<= 8; + } + } + } else if (IS_INFO_FRMT_NUM_STR(info_ctrl->frmt)) { + val[readed_bytes] = '\0'; + int_tmp = simple_strtol((char *)(&(val[0])), NULL, 10); + } else { + if (pfun == NULL) { + DBG_DEBUG(DBG_ERROR, "info ctrl number buf process function is null\n"); + return -DFD_RV_INDEX_INVALID; + } + rv = pfun(val, readed_bytes, &int_tmp); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "info ctrl number buf process fail, rv=%d\n", rv); + return rv; + } + } + + *ret = int_tmp; + DBG_DEBUG(DBG_VERBOSE, "read int info[src=%s frmt=%s pola=%s fpath=%s addr=0x%x len=%d bit_offset=%d] success, ret=%d\n", + g_info_src_str[info_ctrl->src], g_info_frmt_str[info_ctrl->frmt], g_info_pola_str[info_ctrl->pola], + info_ctrl->fpath, info_ctrl->addr, info_ctrl->len, info_ctrl->bit_offset, *ret); + return DFD_RV_OK; +} + +int dfd_info_get_int(int key, int *ret, info_num_buf_to_value_f pfun) +{ + int rv; + info_ctrl_t *info_ctrl; + + if (!DFD_CFG_ITEM_IS_INFO_CTRL(DFD_CFG_ITEM_ID(key)) || (ret == NULL)) { + DBG_DEBUG(DBG_ERROR, "input arguments error, key=0x%08x\n", key); + return -DFD_RV_INDEX_INVALID; + } + + info_ctrl = dfd_ko_cfg_get_item(key); + if (info_ctrl == NULL) { + DBG_DEBUG(DBG_WARN, "get info ctrl fail, key=0x%08x\n", key); + return -DFD_RV_DEV_NOTSUPPORT; + } + + DBG_DEBUG(DBG_VERBOSE, "get info ctrl value, key=0x%08x\n", key); + rv = dfd_get_info_value(info_ctrl, ret, pfun); + return rv; +} + +int dfd_info_get_buf(int key, uint8_t *buf, int buf_len, info_buf_to_buf_f pfun) +{ + int rv; + int read_bytes, buf_real_len; + uint8_t buf_tmp[INFO_BUF_MAX_LEN]; + info_ctrl_t *info_ctrl; + + if (!DFD_CFG_ITEM_IS_INFO_CTRL(DFD_CFG_ITEM_ID(key)) || (buf == NULL)) { + DBG_DEBUG(DBG_ERROR, "input arguments error, key=0x%08x\n", key); + return -DFD_RV_INDEX_INVALID; + } + + info_ctrl = dfd_ko_cfg_get_item(key); + if (info_ctrl == NULL) { + DBG_DEBUG(DBG_WARN, "get info ctrl fail, key=0x%08x\n", key); + return -DFD_RV_DEV_NOTSUPPORT; + } + + if (info_ctrl->mode != INFO_CTRL_MODE_CFG) { + DBG_DEBUG(DBG_ERROR, "info ctrl[key=0x%08x] mode[%d] invalid\n", key, info_ctrl->mode); + return -DFD_RV_TYPE_ERR; + } + + if (!IS_INFO_FRMT_BUF(info_ctrl->frmt) || !INFO_BUF_LEN_VALAID(info_ctrl->len) + || (buf_len <= info_ctrl->len)) { + DBG_DEBUG(DBG_ERROR, "info ctrl[key=0x%08x] format=%d or len=%d invlaid, buf_len=%d\n", + key, info_ctrl->frmt, info_ctrl->len, buf_len); + return -DFD_RV_TYPE_ERR; + } + + read_bytes = dfd_read_info(info_ctrl->src, info_ctrl->fpath, info_ctrl->addr, info_ctrl->len, buf_tmp); + if (read_bytes <= 0) { + DBG_DEBUG(DBG_ERROR, "read buf info[key=0x%08x src=%s frmt=%s fpath=%s addr=0x%x len=%d] fail, rv=%d\n", + key, g_info_src_str[info_ctrl->src], g_info_frmt_str[info_ctrl->frmt], info_ctrl->fpath, + info_ctrl->addr, info_ctrl->len, read_bytes); + return -DFD_RV_DEV_FAIL; + } + + if (pfun) { + buf_real_len = buf_len; + rv = pfun(buf_tmp, read_bytes, buf, &buf_real_len); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "info ctrl[key=0x%08x] buf process fail, rv=%d\n", key, rv); + return -DFD_RV_DEV_NOTSUPPORT; + } + } else { + buf_real_len = read_bytes; + memcpy(buf, buf_tmp, read_bytes); + } + + return buf_real_len; +} + +static int dfd_2key_info_get_buf(info_ctrl_t *info_ctrl, uint8_t *buf, int buf_len, info_hwmon_buf_f pfun) +{ + int rv; + int read_bytes, buf_real_len; + uint8_t buf_tmp[INFO_BUF_MAX_LEN]; + char temp_fpath[INFO_FPATH_MAX_LEN]; + + if (!IS_INFO_FRMT_BUF(info_ctrl->frmt) || !INFO_BUF_LEN_VALAID(info_ctrl->len) + || (buf_len <= info_ctrl->len)) { + DBG_DEBUG(DBG_ERROR, "key_path info ctrl format=%d or len=%d invlaid, buf_len=%d\n", + info_ctrl->frmt, info_ctrl->len, buf_len); + return -DFD_RV_TYPE_ERR; + } + + mem_clear(buf_tmp, sizeof(buf_tmp)); + rv = kfile_iterate_dir(info_ctrl->fpath, DFD_HWMON_NAME, buf_tmp, INFO_BUF_MAX_LEN); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "dir patch:%s ,can find name %s dir \n", + info_ctrl->fpath, DFD_HWMON_NAME); + return -DFD_RV_NO_NODE; + } + mem_clear(temp_fpath, sizeof(temp_fpath)); + snprintf(temp_fpath, sizeof(temp_fpath), "%s%s/%s", + info_ctrl->fpath, buf_tmp, info_ctrl->str_cons); + DBG_DEBUG(DBG_VERBOSE, "match ok path = %s \n", temp_fpath); + + mem_clear(buf_tmp, sizeof(buf_tmp)); + + read_bytes = dfd_read_info(info_ctrl->src, temp_fpath, info_ctrl->addr, info_ctrl->len, buf_tmp); + if (read_bytes <= 0) { + DBG_DEBUG(DBG_ERROR, "read buf info[src=%s frmt=%s fpath=%s addr=0x%x len=%d] fail, rv=%d\n", + g_info_src_str[info_ctrl->src], g_info_src_str[info_ctrl->frmt], temp_fpath, + info_ctrl->addr, info_ctrl->len, read_bytes); + return -DFD_RV_DEV_FAIL; + } + + if (pfun) { + buf_real_len = buf_len; + rv = pfun(buf_tmp, read_bytes, buf, &buf_real_len, info_ctrl); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "info ctrl buf process fail, rv=%d\n", rv); + return -DFD_RV_DEV_NOTSUPPORT; + } + } else { + buf_real_len = read_bytes; + memcpy(buf, buf_tmp, buf_real_len); + } + return buf_real_len; +} + +int dfd_info_set_int(int key, int val) +{ + int rv; + int write_bytes; + uint8_t byte_tmp, bit_mask; + info_ctrl_t *info_ctrl; + + if (!DFD_CFG_ITEM_IS_INFO_CTRL(DFD_CFG_ITEM_ID(key))) { + DBG_DEBUG(DBG_ERROR, "input arguments error, key=0x%08x\n", key); + return -DFD_RV_INDEX_INVALID; + } + + info_ctrl = dfd_ko_cfg_get_item(key); + if (info_ctrl == NULL) { + DBG_DEBUG(DBG_WARN, "get info ctrl fail, key=0x%08x\n", key); + return -DFD_RV_DEV_NOTSUPPORT; + } + + if (info_ctrl->mode != INFO_CTRL_MODE_CFG) { + DBG_DEBUG(DBG_ERROR, "info ctrl[key=0x%08x] mode[%d] warnning\n", key, info_ctrl->mode); + return -DFD_RV_TYPE_ERR; + } + + if (IS_INFO_FRMT_BIT(info_ctrl->frmt)) { + + if (!INFO_BIT_OFFSET_VALID(info_ctrl->bit_offset)) { + DBG_DEBUG(DBG_ERROR, "info ctrl[key=0x%08x] bit_offsest[%d] invalid\n", + key, info_ctrl->bit_offset); + return -DFD_RV_TYPE_ERR; + } + + write_bytes = 1; + + byte_tmp = (uint8_t)(val & 0xff); + byte_tmp <<= info_ctrl->bit_offset; + if (info_ctrl->pola == INFO_POLA_NEGA) { + byte_tmp = ~byte_tmp; + } + + bit_mask = (~(0xff << info_ctrl->len)) << info_ctrl->bit_offset; + } else if (IS_INFO_FRMT_BYTE(info_ctrl->frmt)) { + + if (!INFO_INT_LEN_VALAID(info_ctrl->len)) { + DBG_DEBUG(DBG_ERROR, "info ctrl[key=0x%08x] len[%d] invalid\n", key, info_ctrl->len); + return -DFD_RV_TYPE_ERR; + } + + write_bytes = 1; + + byte_tmp = (uint8_t)(val & 0xff); + + bit_mask = 0xff; + } else if (IS_INFO_FRMT_NUM_STR(info_ctrl->frmt)) { + + DBG_DEBUG(DBG_ERROR, "not support str int set\n"); + return -1; + } else if (IS_INFO_FRMT_NUM_BUF(info_ctrl->frmt)) { + + if (!INFO_INT_LEN_VALAID(info_ctrl->len)) { + DBG_DEBUG(DBG_ERROR, "info ctrl[key=0x%08x] len[%d] invalid\n", key, info_ctrl->len); + return -DFD_RV_TYPE_ERR; + } + + write_bytes = 1; + + byte_tmp = (uint8_t)(val & 0xff); + + bit_mask = 0xff; + } else { + DBG_DEBUG(DBG_ERROR, "info ctrl[key=0x%08x] format[%d] error\n", key, info_ctrl->frmt); + return -DFD_RV_TYPE_ERR; + } + + rv = dfd_write_info(info_ctrl->src, info_ctrl->fpath, info_ctrl->addr, write_bytes, + &byte_tmp, bit_mask); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "write int info[src=%s frmt=%s fpath=%s addr=0x%x len=%d val=%d] fail, rv=%d\n", + g_info_src_str[info_ctrl->src], g_info_frmt_str[info_ctrl->frmt], info_ctrl->fpath, + info_ctrl->addr, info_ctrl->len, val, rv); + return -DFD_RV_DEV_FAIL; + } + + DBG_DEBUG(DBG_VERBOSE, "write int info[src=%s frmt=%s pola=%s fpath=%s addr=0x%x len=%d bit_offset=%d val=%d] success\n", + g_info_src_str[info_ctrl->src], g_info_frmt_str[info_ctrl->frmt], g_info_pola_str[info_ctrl->pola], + info_ctrl->fpath, info_ctrl->addr, info_ctrl->len, info_ctrl->bit_offset, val); + return DFD_RV_OK; +} + +static int dfd_info_reg2data_linear(int key, int data, int *temp_value) +{ + s16 exponent; + s32 mantissa; + int val; + info_ctrl_t *info_ctrl; + + info_ctrl = dfd_ko_cfg_get_item(key); + if (info_ctrl == NULL) { + DBG_DEBUG(DBG_WARN, "get info ctrl fail, key=%d\n", key); + return -DFD_RV_DEV_NOTSUPPORT; + } + + switch (info_ctrl->int_extra1) { + case LINEAR11: + exponent = ((s16)data) >> 11; + mantissa = ((s16)((data & 0x7ff) << 5)) >> 5; + val = mantissa; + val = val * 1000L; + break; + case LINEAR16: + break; + default: + break; + } + + if (DFD_CFG_ITEM_ID(key) == DFD_CFG_ITEM_HWMON_POWER) { + val = val * 1000L; + } + + if (exponent >= 0) { + val <<= exponent; + } else { + val >>= -exponent; + } + *temp_value = val; + + return DFD_RV_OK; +} + +static int dfd_info_reg2data_tmp464(int data, int *temp_value) +{ + s16 tmp_val; + int val; + + DBG_DEBUG(DBG_VERBOSE, "reg2data_tmp464, data=%d\n", data); + + if (data >= 0) { + val = data*625/80; + } else { + tmp_val = ~(data & 0x7ff) + 1; + val = tmp_val*625/80; + } + *temp_value = val; + + return DFD_RV_OK; +} + +static int dfd_info_reg2data_mac_th5(int data, int *temp_value) +{ + int tmp_val; + int val; + + DBG_DEBUG(DBG_VERBOSE, "reg2data_mac_th5, data=%d\n", data); + + tmp_val = data >> 4; + val = 476359 - (((tmp_val - 2) * 317704) / 2000); + + DBG_DEBUG(DBG_VERBOSE, "reg2data_mac_th5, val=%d\n", val); + *temp_value = val; + + return DFD_RV_OK; +} + +static int dfd_info_reg2data_mac_td3(int data, int *temp_value) +{ + int val; + + if (data == 0) { + DBG_DEBUG(DBG_ERROR,"invalid cpld data=%d\n", data); + *temp_value = -READ_TEMP_FAIL; + return DFD_RV_OK; + } + + DBG_DEBUG(DBG_VERBOSE, "reg2data_mac_td3, data=%d\n", data); + val = 434100 - (12500000 / (data * 100 - 1) *535); + if ((val / 1000 < -70) || (val / 1000 > 200)) { + DBG_DEBUG(DBG_ERROR,"out of range cpld val=%d\n", val); + *temp_value = -READ_TEMP_FAIL; + return DFD_RV_OK; + } + DBG_DEBUG(DBG_VERBOSE, "reg2data_mac_td3, val=%d\n", val); + *temp_value = val; + + return DFD_RV_OK; +} + +static int dfd_info_get_cpld_voltage(int key, uint32_t *value) +{ + int rv; + uint32_t vol_ref_tmp, vol_ref; + uint32_t vol_curr_tmp, vol_curr; + info_ctrl_t *info_ctrl; + info_ctrl_t info_ctrl_tmp; + uint32_t vol_coefficient; + + info_ctrl = dfd_ko_cfg_get_item(key); + if (info_ctrl == NULL) { + DBG_DEBUG(DBG_WARN, "get info ctrl fail, key=0x%08x\n", key); + return -DFD_RV_DEV_NOTSUPPORT; + } + + vol_coefficient = (uint32_t)info_ctrl->int_extra2; + + rv = dfd_get_info_value(info_ctrl, &vol_curr_tmp, NULL); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "get cpld current voltage error, addr:0x%x, rv = %d\n", info_ctrl->addr, rv); + return rv; + } + if (info_ctrl->int_extra3 == CPLD_VOLATGE_VALUE_MODE2) { + vol_curr_tmp = DFD_GET_CPLD_VOLATGE_CODE_VALUE2(vol_curr_tmp); + vol_curr = DFD_GET_CPLD_VOLATGE_REAL_VALUE2(vol_curr_tmp, vol_coefficient); + DBG_DEBUG(DBG_VERBOSE, "vol_curr_tmp = 0x%x, vol_curr = 0x%x, is same.\n", vol_curr_tmp, vol_curr); + } else { + vol_curr_tmp = DFD_GET_CPLD_VOLATGE_CODE_VALUE(vol_curr_tmp); + if (info_ctrl->addr == info_ctrl->int_extra1) { + vol_curr = DFD_GET_CPLD_VOLATGE_REAL_VALUE(vol_curr_tmp, vol_coefficient); + DBG_DEBUG(DBG_VERBOSE, "current voltage is reference voltage, vol_curr_tmp: 0x%x, coefficient: %u, vol_curr: %u\n", + vol_curr_tmp, vol_coefficient, vol_curr); + } else { + memcpy(&info_ctrl_tmp, info_ctrl, sizeof(info_ctrl_t)); + info_ctrl_tmp.addr = info_ctrl->int_extra1; + rv = dfd_get_info_value(&info_ctrl_tmp, &vol_ref_tmp, NULL); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "get cpld reference voltage error, addr: 0x%x, rv: %d\n", info_ctrl_tmp.addr, rv); + return rv; + } + vol_ref = DFD_GET_CPLD_VOLATGE_CODE_VALUE(vol_ref_tmp); + DBG_DEBUG(DBG_VERBOSE, "vol_ref_tmp: 0x%x, vol_ref: 0x%x\n", vol_ref_tmp, vol_ref); + vol_curr = (vol_curr_tmp * vol_coefficient) / vol_ref; + DBG_DEBUG(DBG_VERBOSE, "vol_curr_tmp: 0x%x, vol_ref: 0x%x, coefficient: %u, vol_curr: %u\n", + vol_curr_tmp, vol_ref, vol_coefficient, vol_curr); + } + } + *value = vol_curr; + return DFD_RV_OK; +} + +static int dfd_info_get_cpld_temperature(int key, int *value) +{ + int rv; + int temp_reg; + int temp_value; + info_ctrl_t *info_ctrl; + + info_ctrl = dfd_ko_cfg_get_item(key); + if (info_ctrl == NULL) { + DBG_DEBUG(DBG_WARN, "get info ctrl fail, key=0x%08x\n", key); + return -DFD_RV_DEV_NOTSUPPORT; + } + + rv = dfd_info_get_int(key, &temp_reg, NULL); + if(rv < 0) { + DBG_DEBUG(DBG_ERROR, "get cpld current temperature error, addr:0x%x, rv =%d\n", info_ctrl->addr, rv); + return rv; + } + DBG_DEBUG(DBG_VERBOSE, "get cpld temp:0x%08x, extra1 0x%x\n", temp_reg, info_ctrl->int_extra1); + + switch (info_ctrl->int_extra1) { + case LINEAR11: + rv = dfd_info_reg2data_linear(key, temp_reg, &temp_value); + break; + case TMP464: + rv = dfd_info_reg2data_tmp464(temp_reg, &temp_value); + break; + case MAC_TH5: + rv = dfd_info_reg2data_mac_th5(temp_reg, &temp_value); + break; + case MAC_TD3: + rv = dfd_info_reg2data_mac_td3(temp_reg, &temp_value); + break; + default: + temp_value = temp_reg; + rv = DFD_RV_OK; + break; + } + + DBG_DEBUG(DBG_VERBOSE, "calc temp:%d \n", temp_value); + if ((temp_value < -40000) || (temp_value > 120000)) { + temp_value = -MAC_TEMP_INVALID; + } + *value = temp_value; + + return rv; +} + +static int dfd_info_get_sensor_value(int key, uint8_t *buf, int buf_len, info_hwmon_buf_f pfun) +{ + int rv, buf_real_len; + uint32_t value; + uint8_t buf_tmp[INFO_BUF_MAX_LEN]; + info_ctrl_t *info_ctrl; + + info_ctrl = dfd_ko_cfg_get_item(key); + if (info_ctrl == NULL) { + DBG_DEBUG(DBG_ERROR, "get info ctrl fail, key=0x%08x\n", key); + return -DFD_RV_DEV_NOTSUPPORT; + } + + if ( DFD_CFG_ITEM_ID(key) == DFD_CFG_ITEM_HWMON_IN && info_ctrl->src == INFO_SRC_CPLD) { + rv = dfd_info_get_cpld_voltage(key, &value); + if(rv < 0) { + DBG_DEBUG(DBG_ERROR, "get cpld voltage failed.key=0x%08x, rv:%d\n", key, rv); + return -DFD_RV_DEV_NOTSUPPORT; + } + DBG_DEBUG(DBG_VERBOSE, "get cpld voltage ok, value:%u\n", value); + mem_clear(buf_tmp, sizeof(buf_tmp)); + snprintf(buf_tmp, sizeof(buf_tmp), "%u\n", value); + buf_real_len = strlen(buf_tmp); + if(buf_len <= buf_real_len) { + DBG_DEBUG(DBG_ERROR, "length not enough.buf_len:%d,need length:%d\n", buf_len, buf_real_len); + return -DFD_RV_DEV_FAIL; + } + if (pfun) { + buf_real_len = buf_len; + rv = pfun(buf_tmp, strlen(buf_tmp), buf, &buf_real_len, info_ctrl); + if (rv < 0) { + DBG_DEBUG(DBG_ERROR, "deal date error.org value:%s, buf_len:%d, rv=%d\n", + buf_tmp, buf_len, rv); + return -DFD_RV_DEV_NOTSUPPORT; + } + } else { + memcpy(buf, buf_tmp, buf_real_len); + } + return buf_real_len; + } else if ( DFD_CFG_ITEM_ID(key) == DFD_CFG_ITEM_HWMON_TEMP && info_ctrl->src == INFO_SRC_CPLD ) { + rv = dfd_info_get_cpld_temperature(key, &value); + if(rv < 0) { + DBG_DEBUG(DBG_ERROR, "get cpld temperature failed.key=0x%08x, rv:%d\n", key, rv); + return -DFD_RV_DEV_NOTSUPPORT; + } + DBG_DEBUG(DBG_VERBOSE, "get cpld temperature ok, value:%d buf_len %d\n", value, buf_len); + mem_clear(buf_tmp, sizeof(buf_tmp)); + snprintf(buf_tmp, sizeof(buf_tmp), "%d\n", value); + buf_real_len = strlen(buf_tmp); + if(buf_len <= buf_real_len) { + DBG_DEBUG(DBG_ERROR, "length not enough.buf_len:%d,need length:%d\n", buf_len, buf_real_len); + return -DFD_RV_DEV_FAIL; + } + DBG_DEBUG(DBG_VERBOSE, "buf_real_len %d\n", buf_real_len); + memcpy(buf, buf_tmp, buf_real_len); + return buf_real_len; + } + + DBG_DEBUG(DBG_ERROR, "not support mode. key:0x%08x\n", key); + return -DFD_RV_MODE_NOTSUPPORT; +} + +int dfd_info_get_sensor(uint32_t key, char *buf, int buf_len, info_hwmon_buf_f pfun) +{ + info_ctrl_t *key_info_ctrl; + int rv; + + if (!DFD_CFG_ITEM_IS_INFO_CTRL(DFD_CFG_ITEM_ID(key)) || + (buf == NULL) || buf_len <= 0) { + DBG_DEBUG(DBG_ERROR, "input arguments error, key_path=0x%08x, buf_len:%d.\n", + key, buf_len); + return -DFD_RV_INVALID_VALUE; + } + + key_info_ctrl = dfd_ko_cfg_get_item(key); + if (key_info_ctrl == NULL) { + DBG_DEBUG(DBG_ERROR, "key_path info error, key=0x%08x\n", key); + return -DFD_RV_DEV_NOTSUPPORT; + } + mem_clear(buf, buf_len); + + if (key_info_ctrl->mode == INFO_CTRL_MODE_SRT_CONS) { + snprintf(buf, buf_len, "%s\n", key_info_ctrl->str_cons); + DBG_DEBUG(DBG_VERBOSE, "get sensor value through string config, key=0x%08x, value:%s\n", key, buf); + return strlen(buf); + } + + if (key_info_ctrl->mode == INFO_CTRL_MODE_CFG && key_info_ctrl->src == INFO_SRC_FILE) { + DBG_DEBUG(DBG_VERBOSE, "get sensor value through hwmon, key:0x%08x\n", key); + rv = dfd_2key_info_get_buf(key_info_ctrl, buf, buf_len, pfun); + if (rv < 0) { + DBG_DEBUG(DBG_VERBOSE, "get sensor value through hwmon failed, key:0x%08x, rv:%d\n", key, rv); + } + return rv; + } + rv = dfd_info_get_sensor_value(key, buf, buf_len, pfun); + if( rv < 0) { + DBG_DEBUG(DBG_ERROR, "get sensor value failed, key=0x%08x, rv:%d.\n", key, rv); + } + return rv; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_listnode.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_listnode.c new file mode 100644 index 000000000000..d6fd7e104c9f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/cfg/dfd_cfg_listnode.c @@ -0,0 +1,82 @@ +#include +#include + +#include "../include/dfd_cfg_listnode.h" +#include "../../dev_sysfs/include/sysfs_common.h" + +void *lnode_find_node(lnode_root_t *root, int key) +{ + lnode_node_t *lnode; + + if (root == NULL){ + return NULL; + } + + list_for_each_entry(lnode, &(root->root), lst) { + if (lnode->key == key) { + return lnode->data; + } + } + + return NULL; +} + +int lnode_insert_node(lnode_root_t *root, int key, void *data) +{ + lnode_node_t *lnode; + void *data_tmp; + + if ((root == NULL) || (data == NULL)) { + return LNODE_RV_INPUT_ERR; + } + + data_tmp = lnode_find_node(root, key); + if (data_tmp != NULL) { + return LNODE_RV_NODE_EXIST; + } + + lnode = kmalloc(sizeof(lnode_node_t), GFP_KERNEL); + if (lnode == NULL) { + return LNODE_RV_NOMEM; + } + + lnode->key = key; + lnode->data = data; + list_add_tail(&(lnode->lst), &(root->root)); + + return LNODE_RV_OK; +} + +int lnode_init_root(lnode_root_t *root) +{ + if (root == NULL) { + return LNODE_RV_INPUT_ERR; + } + + INIT_LIST_HEAD(&(root->root)); + + return LNODE_RV_OK; +} + +void lnode_free_list(lnode_root_t *root) +{ + lnode_node_t *lnode, *lnode_next; + + if (root == NULL){ + return ; + } + + list_for_each_entry_safe(lnode, lnode_next, &(root->root), lst) { + if ( lnode->data ) { + kfree(lnode->data); + lnode->data = NULL; + lnode->key = 0; + } + list_del(&lnode->lst); + kfree(lnode); + lnode = NULL; + } + + return ; + +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_fan_driver.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_fan_driver.c new file mode 100644 index 000000000000..d8965d75c9c0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_fan_driver.c @@ -0,0 +1,201 @@ +#include +#include + +#include "./include/dfd_module.h" +#include "./include/dfd_cfg.h" +#include "./include/dfd_cfg_adapter.h" +#include "./include/dfd_cfg_info.h" +#include "../dev_sysfs/include/sysfs_common.h" + +#define FAN_SIZE (256) + +int g_dfd_fan_dbg_level = 0; +module_param(g_dfd_fan_dbg_level, int, S_IRUGO | S_IWUSR); + +typedef enum fan_speed_format_mem_s { + LINEAR120 = 1, +} fan_speed_format_mem_t; + +int dfd_get_fan_roll_status(unsigned int fan_index, unsigned int motor_index) +{ + int key, ret; + int status; + + key = DFD_CFG_KEY(DFD_CFG_ITEM_FAN_ROLL_STATUS, fan_index, motor_index); + ret = dfd_info_get_int(key, &status, NULL); + if (ret < 0) { + DFD_FAN_DEBUG(DBG_ERROR, "get fan roll status error, fan:%d,motor:%d\n", + fan_index, motor_index); + return ret; + } + + DFD_FAN_DEBUG(DBG_VERBOSE, "fan%u motor%u get fan roll status success, status:%d.\n", + fan_index, motor_index, status); + return status; +} + +int dfd_get_fan_present_status(unsigned int fan_index) +{ + int key, ret; + int status; + + key = DFD_CFG_KEY(DFD_CFG_ITEM_DEV_PRESENT_STATUS, WB_MAIN_DEV_FAN, fan_index); + ret = dfd_info_get_int(key, &status, NULL); + if (ret < 0) { + DFD_FAN_DEBUG(DBG_ERROR, "fan%u get present status error, key:0x%x\n", fan_index, key); + return ret; + } + + DFD_FAN_DEBUG(DBG_VERBOSE, "fan%u get present status success, status:%d.\n", fan_index, status); + return status; +} + +static int dfd_get_fan_speed_linear120(int origin_data, int *speed) +{ + *speed = origin_data * 120; + DFD_FAN_DEBUG(DBG_VERBOSE, "get fan speed by linear120 origin_data: %d, speed: %d\n", + origin_data, *speed); + return 0; +} + +static int dfd_get_fan_speed_default(int origin_data, int *speed) +{ + if (origin_data == 0 || origin_data == 0xffff) { + *speed = 0; + } else { + *speed = 15000000 / origin_data; + } + DFD_FAN_DEBUG(DBG_VERBOSE, "get fan speed by default origin_data: %d, speed: %d\n", + origin_data, *speed); + return 0; +} + +ssize_t dfd_get_fan_speed(unsigned int fan_index, unsigned int motor_index,unsigned int *speed) +{ + int key, ret, speed_tmp; + info_ctrl_t *info_ctrl; + + if (speed == NULL) { + DFD_FAN_DEBUG(DBG_ERROR, "param error. fan index:%d, motor index:%d.\n", + fan_index, motor_index); + return -DFD_RV_INVALID_VALUE; + } + + key = DFD_CFG_KEY(DFD_CFG_ITEM_FAN_SPEED, fan_index, motor_index); + ret = dfd_info_get_int(key, &speed_tmp, NULL); + if (ret < 0) { + DFD_FAN_DEBUG(DBG_ERROR, "get fan speed error, key:0x%x,ret:%d\n",key, ret); + return ret; + } + DFD_FAN_DEBUG(DBG_VERBOSE, "get fan origin data: 0x%x\n", speed_tmp); + + info_ctrl = dfd_ko_cfg_get_item(key); + switch (info_ctrl->int_extra1) { + case LINEAR120: + ret = dfd_get_fan_speed_linear120(speed_tmp, speed); + break; + default: + ret = dfd_get_fan_speed_default(speed_tmp, speed); + break; + } + + return ret; +} + +int dfd_set_fan_speed_level(unsigned int fan_index, unsigned int motor_index, int level) +{ + int key, ret; + + if (level < 0 || level > 0xff) { + DFD_FAN_DEBUG(DBG_ERROR, "fan:%u, motor:%u, can not set fan speed level: %d.\n", + fan_index, motor_index, level); + return -DFD_RV_INVALID_VALUE; + } + + key = DFD_CFG_KEY(DFD_CFG_ITEM_FAN_RATIO, fan_index, motor_index); + ret = dfd_info_set_int(key, level); + if (ret < 0) { + DFD_FAN_DEBUG(DBG_ERROR, "fan:%u, motor:%u, set fan level 0x%02x error, key:0x%x,ret:%d\n", + fan_index, motor_index, level, key, ret); + return ret; + } + + DFD_FAN_DEBUG(DBG_VERBOSE, "fan:%u, motor:%u, set fan speed level 0x%02x success.\n", + fan_index, motor_index, level); + return DFD_RV_OK; +} + +int dfd_set_fan_pwm(unsigned int fan_index, unsigned int motor_index, int pwm) +{ + int ret, data; + + if (pwm < 0 || pwm > 100) { + DFD_FAN_DEBUG(DBG_ERROR, "fan:%u, motor:%u, can't set pwm: %d.\n", + fan_index, motor_index, pwm); + return -DFD_RV_INVALID_VALUE; + } + + data = pwm * 255 / 100; + ret = dfd_set_fan_speed_level(fan_index, motor_index, data); + if (ret < 0) { + DFD_FAN_DEBUG(DBG_ERROR, "fan:%u, motor:%u, set fan ratio:%d error, ret:%d\n", + fan_index, motor_index, data, ret); + return ret; + } + + DFD_FAN_DEBUG(DBG_VERBOSE, "fan:%u, motor:%u, set fan ratio %d success.\n", + fan_index, motor_index, data); + return DFD_RV_OK; +} + +int dfd_get_fan_speed_level(unsigned int fan_index, unsigned int motor_index, int *level) +{ + int key, ret, speed_level; + + if (level == NULL) { + DFD_FAN_DEBUG(DBG_ERROR, "param error. fan index:%d, motor index:%d.\n", + fan_index, motor_index); + return -DFD_RV_INVALID_VALUE; + } + + key = DFD_CFG_KEY(DFD_CFG_ITEM_FAN_RATIO, fan_index, motor_index); + ret = dfd_info_get_int(key, &speed_level, NULL); + if (ret < 0) { + DFD_FAN_DEBUG(DBG_ERROR, "fan:%u, motor:%u, get fan speed level error, key:0x%x,ret:%d\n", + fan_index, motor_index, key, ret); + return ret; + } + + DFD_FAN_DEBUG(DBG_VERBOSE, "fan:%u, motor:%u, get fan speed level success, value:0x%02x.\n", + fan_index, motor_index, speed_level); + *level = speed_level; + return DFD_RV_OK; +} + +int dfd_get_fan_pwm(unsigned int fan_index, unsigned int motor_index, int *pwm) +{ + int ret, level; + + if (pwm == NULL) { + DFD_FAN_DEBUG(DBG_ERROR, "param error. fan index:%d, motor index:%d.\n", + fan_index, motor_index); + return -DFD_RV_INVALID_VALUE; + } + + ret = dfd_get_fan_speed_level(fan_index, motor_index, &level); + if (ret < 0) { + DFD_FAN_DEBUG(DBG_ERROR, "fan:%u, motor:%u, get fan pwm error, ret:%d\n", + fan_index, motor_index, ret); + return ret; + } + + if ((level * 100) % 255 > 0) { + *pwm = level * 100 / 255 + 1; + } else { + *pwm = level * 100 / 255; + } + + DFD_FAN_DEBUG(DBG_VERBOSE, "fan:%u, motor:%u, get fan pwm success, value:%d.\n", + fan_index, motor_index, *pwm); + return DFD_RV_OK; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_module.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_module.c new file mode 100644 index 000000000000..9e5b00b795de --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_module.c @@ -0,0 +1,95 @@ +#include + +#include "../dev_sysfs/include/sysfs_common.h" +#include "./include/dfd_module.h" +#include "./include/dfd_cfg.h" +#include "./include/dfd_fan_driver.h" +#include "./include/dfd_slot_driver.h" +#include "./include/dfd_sensors_driver.h" +#include "./include/dfd_psu_driver.h" +#include "./include/dfd_sff_driver.h" + +typedef enum dfd_dev_init_fail_s { + DFD_KO_INIT_CPLD_FAIL = 1, + DFD_KO_INIT_FPGA_FAIL = 2, + DFD_KO_INIT_IRQ_FAIL = 3, + DFD_KO_INIT_CFG_FAIL = 4, + DFD_KO_INIT_DATA_FAIL = 5, +} dfd_dev_init_fail_t; + +int g_dfd_dbg_level = 0; + +int dfd_get_dev_number(unsigned int main_dev_id, unsigned int minor_dev_id) +{ + int key,dev_num; + int *p_dev_num; + + key = DFD_CFG_KEY(DFD_CFG_ITEM_DEV_NUM, main_dev_id, minor_dev_id); + p_dev_num = dfd_ko_cfg_get_item(key); + if (p_dev_num == NULL) { + DBG_DEBUG(DBG_ERROR, "get device number failed, key:0x%x\n",key); + return -DFD_RV_DEV_NOTSUPPORT; + } + dev_num = *p_dev_num; + DBG_DEBUG(DBG_VERBOSE, "get device number ok, number:%d\n",dev_num); + return dev_num; +} + +static struct switch_drivers_t switch_drivers= { + .get_dev_number = dfd_get_dev_number, + /* fan */ + .get_fan_speed = dfd_get_fan_speed, + .get_fan_pwm = dfd_get_fan_pwm, + .set_fan_pwm = dfd_set_fan_pwm, + .get_fan_present_status = dfd_get_fan_present_status, + .get_fan_roll_status = dfd_get_fan_roll_status, + .get_fan_speed_level = dfd_get_fan_speed_level, + .set_fan_speed_level = dfd_set_fan_speed_level, + /* slot */ + .get_slot_present_status = dfd_get_slot_present_status, + /* sensors */ + .get_temp_info = dfd_get_temp_info, + .get_voltage_info = dfd_get_voltage_info, + /* psu */ + .get_psu_present_status = dfd_get_psu_present_status, + .get_psu_output_status = dfd_get_psu_output_status, + .get_psu_alert_status = dfd_get_psu_alert_status, + /* sff */ + .get_sff_cpld_info = dfd_get_sff_cpld_info, + .get_sff_dir_name = dfd_get_sff_dir_name, +}; + +struct switch_drivers_t * dfd_plat_driver_get(void) { + return &switch_drivers; +} + +static int32_t __init dfd_dev_init(void) +{ + int ret; + + DBG_DEBUG(DBG_VERBOSE, "Enter.\n"); + + ret = dfd_dev_cfg_init(); + if (ret != 0) { + DBG_DEBUG(DBG_ERROR, "dfd_dev_cfg_init failed ret %d.\n", ret); + ret = -DFD_KO_INIT_CFG_FAIL; + return ret; + } + + DBG_DEBUG(DBG_VERBOSE, "success.\n"); + return 0; +} + +static void __exit dfd_dev_exit(void) +{ + DBG_DEBUG(DBG_VERBOSE, "dfd_dev_exit.\n"); + dfd_dev_cfg_exit(); + return ; +} + +module_init(dfd_dev_init); +module_exit(dfd_dev_exit); +module_param(g_dfd_dbg_level, int, S_IRUGO | S_IWUSR); +EXPORT_SYMBOL(dfd_plat_driver_get); +MODULE_AUTHOR("support"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_psu_driver.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_psu_driver.c new file mode 100644 index 000000000000..55e2e4339ae7 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_psu_driver.c @@ -0,0 +1,70 @@ +#include +#include + +#include "./include/dfd_module.h" +#include "./include/dfd_cfg.h" +#include "./include/dfd_cfg_adapter.h" +#include "./include/dfd_cfg_info.h" +#include "../dev_sysfs/include/sysfs_common.h" + +#define PSU_SIZE (256) + +typedef enum dfd_psu_status_e { + DFD_PSU_PRESENT_STATUS = 0, + DFD_PSU_OUTPUT_STATUS = 1, + DFD_PSU_ALERT_STATUS = 2, +} dfd_psu_status_t; + +int g_dfd_psu_dbg_level = 0; +module_param(g_dfd_psu_dbg_level, int, S_IRUGO | S_IWUSR); + +int dfd_get_psu_present_status(unsigned int psu_index) +{ + int ret, present_key, present_status; + + present_key = DFD_CFG_KEY(DFD_CFG_ITEM_PSU_STATUS, psu_index, DFD_PSU_PRESENT_STATUS); + ret = dfd_info_get_int(present_key, &present_status, NULL); + if (ret < 0) { + DFD_PSU_DEBUG(DBG_ERROR, "dfd_get_psu_present_status error. psu_index:%d, ret:%d\n", + psu_index, ret); + return ret; + } + + DFD_PSU_DEBUG(DBG_VERBOSE, "dfd_get_psu_present_status success. psu_index:%d, status:%d\n", + psu_index, present_status); + return present_status; +} + +int dfd_get_psu_output_status(unsigned int psu_index) +{ + int ret, output_key, output_status; + + output_key = DFD_CFG_KEY(DFD_CFG_ITEM_PSU_STATUS, psu_index, DFD_PSU_OUTPUT_STATUS); + ret = dfd_info_get_int(output_key, &output_status, NULL); + if (ret < 0) { + DFD_PSU_DEBUG(DBG_ERROR, "dfd_get_psu_output_status error. psu_index:%d, ret:%d\n", + psu_index, ret); + return ret; + } + + DFD_PSU_DEBUG(DBG_VERBOSE, "dfd_get_psu_output_status success. psu_index:%d, status:%d\n", + psu_index, output_status); + return output_status; +} + +int dfd_get_psu_alert_status(unsigned int psu_index) +{ + int ret, alert_key, alert_status; + + alert_key = DFD_CFG_KEY(DFD_CFG_ITEM_PSU_STATUS, psu_index, DFD_PSU_ALERT_STATUS); + ret = dfd_info_get_int(alert_key, &alert_status, NULL); + if (ret < 0) { + DFD_PSU_DEBUG(DBG_ERROR, "dfd_get_psu_alert_status error. psu_index:%d, ret:%d\n", + psu_index, ret); + return ret; + } + + DFD_PSU_DEBUG(DBG_VERBOSE, "dfd_get_psu_alert_status success. psu_index:%d, status:%d\n", + psu_index, alert_status); + return alert_status; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_sensors_driver.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_sensors_driver.c new file mode 100644 index 000000000000..bfca20290efb --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_sensors_driver.c @@ -0,0 +1,149 @@ +#include +#include + +#include "./include/dfd_module.h" +#include "./include/dfd_cfg.h" +#include "./include/dfd_cfg_adapter.h" +#include "./include/dfd_cfg_info.h" +#include "./include/dfd_cfg_file.h" +#include "../dev_sysfs/include/sysfs_common.h" + +#define DFD_GET_TEMP_SENSOR_KEY1(dev_index, temp_index) \ + (((dev_index & 0xff) << 8) | (temp_index & 0xff)) +#define DFD_GET_TEMP_SENSOR_KEY2(main_dev_id, temp_type) \ + (((main_dev_id & 0x0f) << 4) | (temp_type & 0x0f)) +#define DFD_FORMAT_STR_MAX_LEN (32) + +int g_dfd_sensor_dbg_level = 0; +module_param(g_dfd_sensor_dbg_level, int, S_IRUGO | S_IWUSR); + +static int dfd_deal_hwmon_buf(uint8_t *buf, int buf_len, uint8_t *buf_new, int *buf_len_new, info_ctrl_t *info_ctrl) +{ + int i, tmp_len; + int exp, decimal, divisor; + int org_value, tmp_value; + int div_result, div_mod; + char fmt_str[DFD_FORMAT_STR_MAX_LEN]; + + exp = info_ctrl->int_cons; + decimal = info_ctrl->bit_offset; + + if (exp <= 0) { + DBG_DEBUG(DBG_VERBOSE, "exponent %d, don't need transform. buf_len:%d, buf_len_new:%d\n", + exp, buf_len, *buf_len_new); + snprintf(buf_new, *buf_len_new, "%s", buf); + *buf_len_new = strlen(buf_new); + return DFD_RV_OK; + } + divisor = 1; + for (i = 0; i < exp; i++) { + divisor *= 10; + } + org_value = simple_strtol(buf, NULL, 10); + if (org_value < 0) { + tmp_value = 0 - org_value; + } else { + tmp_value = org_value; + } + div_result = tmp_value / divisor; + div_mod = tmp_value % divisor; + DBG_DEBUG(DBG_VERBOSE, "exp:%d, decimal:%d, original value:%d, divisor:%d, result :%d, mod:%d\n", + exp, decimal, org_value, divisor, div_result, div_mod); + + mem_clear(fmt_str, sizeof(fmt_str)); + if (org_value < 0) { + snprintf(fmt_str, sizeof(fmt_str), "-%%d.%%0%dd\n",exp); + } else { + snprintf(fmt_str, sizeof(fmt_str), "%%d.%%0%dd\n",exp); + } + DBG_DEBUG(DBG_VERBOSE, "format string:%s",fmt_str); + snprintf(buf_new, *buf_len_new, fmt_str, div_result, div_mod); + *buf_len_new = strlen(buf_new); + tmp_len = *buf_len_new; + + if ( decimal > 0) { + for(i = 0; i < *buf_len_new; i++) { + if (buf_new[i] == '.') { + if( i + decimal + 2 <= *buf_len_new ) { + buf_new[i + decimal + 1 ] = '\n'; + buf_new[i + decimal + 2 ] = '\0'; + *buf_len_new = strlen(buf_new); + DBG_DEBUG(DBG_VERBOSE, "deal decimal[%d] ok, str len:%d, value:%s\n", + decimal, *buf_len_new, buf_new); + } + break; + } + } + if (tmp_len == *buf_len_new) { + DBG_DEBUG(DBG_WARN, "deal decimal[%d] failed, use original value:%s\n", decimal, buf_new); + } + } + return DFD_RV_OK; +} + +static int dfd_get_sensor_info(uint8_t main_dev_id, uint8_t dev_index, uint8_t sensor_type, + uint8_t sensor_index, uint8_t sensor_attr, char *buf) +{ + uint32_t key; + uint16_t key_index1; + uint8_t key_index2; + int rv; + info_hwmon_buf_f pfunc; + + key_index1 = DFD_GET_TEMP_SENSOR_KEY1(dev_index, sensor_index); + key_index2 = DFD_GET_TEMP_SENSOR_KEY2(main_dev_id, sensor_attr); + if (sensor_type == WB_MINOR_DEV_TEMP ) { + key = DFD_CFG_KEY(DFD_CFG_ITEM_HWMON_TEMP, key_index1, key_index2); + } else if (sensor_type == WB_MINOR_DEV_IN) { + key = DFD_CFG_KEY(DFD_CFG_ITEM_HWMON_IN, key_index1, key_index2); + } else { + DFD_SENSOR_DEBUG(DBG_ERROR, "unknow sensor type:%d.\n",sensor_type); + return -DFD_RV_INVALID_VALUE; + } + + DFD_SENSOR_DEBUG(DBG_VERBOSE, "get sensor info.main_dev_id:%d, dev_index:0x%x, sensor_index:0x%x, sensor_attr:0x%x, key:0x%x,\n", + main_dev_id, dev_index, sensor_index, sensor_attr, key); + + pfunc = dfd_deal_hwmon_buf; + mem_clear(buf, PAGE_SIZE); + rv = dfd_info_get_sensor(key, buf, PAGE_SIZE, pfunc); + return rv; +} + +ssize_t dfd_get_temp_info(uint8_t main_dev_id, uint8_t dev_index, + uint8_t temp_index, uint8_t temp_attr, char *buf) +{ + int rv; + + if (buf == NULL) { + DFD_SENSOR_DEBUG(DBG_ERROR, "param error. buf is NULL.\n"); + return -DFD_RV_INVALID_VALUE; + } + + rv = dfd_get_sensor_info(main_dev_id, dev_index, WB_MINOR_DEV_TEMP, temp_index, temp_attr, buf); + if (rv < 0) { + DFD_SENSOR_DEBUG(DBG_ERROR, "get temp info error. rv:%d\n", rv); + } else { + DFD_SENSOR_DEBUG(DBG_VERBOSE, "get temp info ok.value:%s\n", buf); + } + return rv; +} + +ssize_t dfd_get_voltage_info(uint8_t main_dev_id, uint8_t dev_index, + uint8_t in_index, uint8_t in_attr, char *buf) +{ + int rv; + + if (buf == NULL) { + DFD_SENSOR_DEBUG(DBG_ERROR, "param error. buf is NULL.\n"); + return -DFD_RV_INVALID_VALUE; + } + + rv = dfd_get_sensor_info(main_dev_id, dev_index, WB_MINOR_DEV_IN, in_index, in_attr, buf); + if (rv < 0) { + DFD_SENSOR_DEBUG(DBG_ERROR, "get voltage info error. rv:%d\n", rv); + } else { + DFD_SENSOR_DEBUG(DBG_VERBOSE, "get voltage info ok.value:%s\n", buf); + } + return rv; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_sff_driver.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_sff_driver.c new file mode 100644 index 000000000000..5c1faff975b1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_sff_driver.c @@ -0,0 +1,56 @@ +#include + +#include "./include/dfd_module.h" +#include "./include/dfd_cfg.h" +#include "./include/dfd_cfg_info.h" +#include "./include/dfd_cfg_adapter.h" +#include "../dev_sysfs/include/sysfs_common.h" + +int g_dfd_sff_dbg_level = 0; +module_param(g_dfd_sff_dbg_level, int, S_IRUGO | S_IWUSR); + +ssize_t dfd_get_sff_cpld_info(unsigned int sff_index, int cpld_reg_type, char *buf, int len) +{ + int key, ret, value; + + if(buf == NULL) { + DFD_SFF_DEBUG(DBG_ERROR, "param error, buf is NULL. sff_index:%d, cpld_reg_type:%d.\n", + sff_index, cpld_reg_type); + return -DFD_RV_INVALID_VALUE; + } + + key = DFD_CFG_KEY(DFD_CFG_ITEM_SFF_CPLD_REG, sff_index, cpld_reg_type); + ret = dfd_info_get_int(key, &value, NULL); + if (ret < 0) { + DFD_SFF_DEBUG(DBG_ERROR, "get sff cpld reg error, key:0x%x,ret:%d.\n", key, ret); + return ret; + } + + mem_clear(buf, len); + return (ssize_t)snprintf(buf, len, "%d\n", value); +} + +ssize_t dfd_get_sff_dir_name(unsigned int sff_index, char *buf, int buf_len) +{ + int key; + char *sff_dir_name; + + if (buf == NULL) { + DFD_SFF_DEBUG(DBG_ERROR, "param error. buf is NULL.sff index:%d", sff_index); + return -DFD_RV_INVALID_VALUE; + } + + mem_clear(buf, buf_len); + + key = DFD_CFG_KEY(DFD_CFG_ITEM_SFF_DIR_NAME, sff_index, 0); + sff_dir_name = dfd_ko_cfg_get_item(key); + if (sff_dir_name == NULL) { + DFD_SFF_DEBUG(DBG_ERROR, "sff dir name config error, key=0x%08x\n", key); + return -DFD_RV_NODE_FAIL; + } + + DFD_SFF_DEBUG(DBG_VERBOSE, "%s\n", sff_dir_name); + snprintf(buf, buf_len, "%s", sff_dir_name); + return strlen(buf); + +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_slot_driver.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_slot_driver.c new file mode 100644 index 000000000000..69c82adabef0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/dfd_slot_driver.c @@ -0,0 +1,27 @@ +#include +#include + +#include "./include/dfd_module.h" +#include "./include/dfd_cfg.h" +#include "./include/dfd_cfg_adapter.h" +#include "./include/dfd_cfg_info.h" +#include "../dev_sysfs/include/sysfs_common.h" + +#define SLOT_SIZE (256) + +int g_dfd_slot_dbg_level = 0; +module_param(g_dfd_slot_dbg_level, int, S_IRUGO | S_IWUSR); + +int dfd_get_slot_present_status(unsigned int slot_index) +{ + int key, ret; + int status; + + key = DFD_CFG_KEY(DFD_CFG_ITEM_DEV_PRESENT_STATUS, WB_MAIN_DEV_SLOT, slot_index); + ret = dfd_info_get_int(key, &status, NULL); + if (ret < 0) { + DFD_SLOT_DEBUG(DBG_ERROR, "get slot status error, key:0x%x\n",key); + return ret; + } + return status; +} diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg.h new file mode 100644 index 000000000000..af3de1ca9938 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg.h @@ -0,0 +1,99 @@ +#ifndef __DFD_CFG_H__ +#define __DFD_CFG_H__ + +#include + +#define DFD_KO_CFG_FILE_NAME "/etc/plat_sysfs_cfg/cfg_file_name" +#define DFD_KO_CFG_FILE_DIR "/etc/plat_sysfs_cfg/" +#define DFD_PUB_CARDTYPE_FILE "/sys/module/platform_common/parameters/dfd_my_type" + +#define DFD_CFG_CMDLINE_MAX_LEN (256) +#define DFD_CFG_NAME_MAX_LEN (256) +#define DFD_CFG_VALUE_MAX_LEN (256) +#define DFD_CFG_STR_MAX_LEN (64) +#define DFD_CFG_CPLD_NUM_MAX (16) +#define DFD_PRODUCT_ID_LENGTH (8) +#define DFD_PID_BUF_LEN (32) +#define DFD_TEMP_NAME_BUF_LEN (32) + +#define DFD_CFG_EMPTY_VALUE (-1) +#define DFD_CFG_INVALID_VALUE (0) + +#define DFD_CFG_KEY(item, index1, index2) \ + ((((item) & 0xff) << 24) | (((index1) & 0xffff) << 8) | ((index2) & 0xff)) +#define DFD_CFG_ITEM_ID(key) (((key) >> 24) & 0xff) +#define DFD_CFG_INDEX1(key) (((key) >> 8) & 0xffff) +#define DFD_CFG_INDEX2(key) ((key)& 0xff) + +#define INDEX_NOT_EXIST (-1) +#define INDEX1_MAX (0xffff) +#define INDEX2_MAX (0xff) +#define READ_TEMP_FAIL 1000000 + +#define DFD_CFG_ITEM_ALL \ + DFD_CFG_ITEM(DFD_CFG_ITEM_NONE, "none", INDEX_NOT_EXIST, INDEX_NOT_EXIST) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_DEV_NUM, "dev_num", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_CPLD_LPC_DEV, "cpld_lpc_dev", INDEX1_MAX, DFD_CFG_CPLD_NUM_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_INT_END, "end_int", INDEX_NOT_EXIST, INDEX_NOT_EXIST) \ + \ + DFD_CFG_ITEM(DFD_CFG_ITEM_CPLD_MODE, "mode_cpld", INDEX1_MAX, DFD_CFG_CPLD_NUM_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_SFF_DIR_NAME, "sff_dir_name", INDEX1_MAX, INDEX_NOT_EXIST) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_STRING_END, "end_string", INDEX_NOT_EXIST, INDEX_NOT_EXIST) \ + \ + DFD_CFG_ITEM(DFD_CFG_ITEM_CPLD_I2C_DEV, "cpld_i2c_dev", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_OTHER_I2C_DEV, "other_i2c_dev", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_I2C_DEV_END, "end_i2c_dev", INDEX_NOT_EXIST, INDEX_NOT_EXIST) \ + \ + DFD_CFG_ITEM(DFD_CFG_ITEM_FAN_ROLL_STATUS, "fan_roll_status", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_FAN_SPEED, "fan_speed", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_FAN_RATIO, "fan_ratio", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_DEV_PRESENT_STATUS, "dev_present_status", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_PSU_STATUS, "psu_status", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_HWMON_TEMP, "hwmon_temp", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_HWMON_IN, "hwmon_in", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_SFF_CPLD_REG, "sff_cpld_reg", INDEX1_MAX, INDEX2_MAX) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_INFO_CTRL_END, "end_info_ctrl", INDEX_NOT_EXIST, INDEX_NOT_EXIST) \ + DFD_CFG_ITEM(DFD_CFG_ITEM_HWMON_POWER, "hwmon_power", INDEX1_MAX, INDEX2_MAX) \ + +#ifdef DFD_CFG_ITEM +#undef DFD_CFG_ITEM +#endif +#define DFD_CFG_ITEM(_id, _name, _index_min, _index_max) _id, +typedef enum dfd_cfg_item_id_s { + DFD_CFG_ITEM_ALL +} dfd_cfg_item_id_t; + +#define DFD_CFG_ITEM_IS_INT(item_id) \ + (((item_id) > DFD_CFG_ITEM_NONE) && ((item_id) < DFD_CFG_ITEM_INT_END)) + +#define DFD_CFG_ITEM_IS_STRING(item_id) \ + (((item_id) > DFD_CFG_ITEM_INT_END) && ((item_id) < DFD_CFG_ITEM_STRING_END)) + +#define DFD_CFG_ITEM_IS_I2C_DEV(item_id) \ + (((item_id) > DFD_CFG_ITEM_STRING_END) && ((item_id) < DFD_CFG_ITEM_I2C_DEV_END)) + +#define DFD_CFG_ITEM_IS_INFO_CTRL(item_id) \ + (((item_id) > DFD_CFG_ITEM_I2C_DEV_END) && ((item_id) < DFD_CFG_ITEM_INFO_CTRL_END)) + +typedef struct index_range_s { + int index1_max; + int index2_max; +} index_range_t; + +typedef struct val_convert_node_s { + struct list_head lst; + int int_val; + char str_val[DFD_CFG_STR_MAX_LEN]; + int index1; + int index2; +} val_convert_node_t; + +void *dfd_ko_cfg_get_item(int key); + +void dfd_ko_cfg_show_item(int key); + +int32_t dfd_dev_cfg_init(void); + +void dfd_dev_cfg_exit(void); + +#endif /* __DFD_CFG_H__ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_adapter.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_adapter.h new file mode 100644 index 000000000000..70d8b536c437 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_adapter.h @@ -0,0 +1,46 @@ +#ifndef __DFD_CFG_ADAPTER_H__ +#define __DFD_CFG_ADAPTER_H__ + +#define DFD_KO_CPLD_I2C_RETRY_SLEEP (10) /* ms */ +#define DFD_KO_CPLD_I2C_RETRY_TIMES (50 / DFD_KO_CPLD_I2C_RETRY_SLEEP) + +#define DFD_KO_CPLD_GET_SLOT(addr) ((addr >> 24) & 0xff) +#define DFD_KO_CPLD_GET_ID(addr) ((addr >> 16) & 0xff) +#define DFD_KO_CPLD_GET_INDEX(addr) (addr & 0xffff) +#define DFD_KO_CPLD_MODE_I2C_STRING "i2c" +#define DFD_KO_CPLD_MODE_LPC_STRING "lpc" + +typedef struct dfd_i2c_dev_s { + int bus; + int addr; +} dfd_i2c_dev_t; + +typedef enum dfd_i2c_dev_mem_s { + DFD_I2C_DEV_MEM_BUS, + DFD_I2C_DEV_MEM_ADDR, + DFD_I2C_DEV_MEM_END +} dfd_i2c_dev_mem_t; + +typedef enum cpld_mode_e { + DFD_CPLD_MODE_I2C, + DFD_CPLD_MODE_LPC, +} cpld_mode_t; + +typedef enum i2c_mode_e { + DFD_I2C_MODE_NORMAL_I2C, + DFD_I2C_MODE_SMBUS, +} i2c_mode_t; + +extern char *g_dfd_i2c_dev_mem_str[DFD_I2C_DEV_MEM_END]; + +int32_t dfd_ko_cpld_read(int32_t addr, uint8_t *buf); + +int32_t dfd_ko_cpld_write(int32_t addr, uint8_t val); + +int32_t dfd_ko_i2c_read(int bus, int addr, int offset, uint8_t *buf, uint32_t size); + +int32_t dfd_ko_i2c_write(int bus, int addr, int offset, uint8_t *buf, uint32_t size); + +int32_t dfd_ko_read_file(char *fpath, int32_t addr, uint8_t *val, int32_t read_bytes); + +#endif /* __DFD_CFG_ADAPTER_H__ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_file.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_file.h new file mode 100644 index 000000000000..50d7a42d5564 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_file.h @@ -0,0 +1,37 @@ +#ifndef __DFD_CFG_FILE_H__ +#define __DFD_CFG_FILE_H__ + +#include + +#define KFILE_RV_OK (0) +#define KFILE_RV_INPUT_ERR (-1) +#define KFILE_RV_STAT_FAIL (-2) +#define KFILE_RV_OPEN_FAIL (-3) +#define KFILE_RV_MALLOC_FAIL (-4) +#define KFILE_RV_RD_FAIL (-5) +#define KFILE_RV_ADDR_ERR (-6) +#define KFILE_RV_WR_FAIL (-7) + +#define IS_CR(c) ((c) == '\n') + +typedef struct kfile_ctrl_s { + int32_t size; + int32_t pos; + char *buf; +} kfile_ctrl_t; + +int kfile_open(char *fname, kfile_ctrl_t *kfile_ctrl); + +void kfile_close(kfile_ctrl_t *kfile_ctrl); + +int kfile_gets(char *buf, int buf_size, kfile_ctrl_t *kfile_ctrl); + +int kfile_read(int32_t addr, char *buf, int buf_size, kfile_ctrl_t *kfile_ctrl); + +int kfile_iterate_dir(const char *dir_path, const char *obj_name, char *match_name, int len); + +#if 0 + +int kfile_write(char *fpath, int32_t addr, char *buf, int buf_size); +#endif +#endif /* __DFD_CFG_FILE_H__ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_info.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_info.h new file mode 100644 index 000000000000..88e8f92c10fe --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_info.h @@ -0,0 +1,119 @@ +#ifndef __DFD_CFG_INFO_H__ +#define __DFD_CFG_INFO_H__ + +#include + +typedef int (*info_num_buf_to_value_f)(uint8_t *num_buf, int buf_len, int *num_val); + +typedef int (*info_buf_to_buf_f)(uint8_t *buf, int buf_len, uint8_t *buf_new, int *buf_len_new); + +#define IS_INFO_FRMT_BIT(frmt) ((frmt) == INFO_FRMT_BIT) +#define IS_INFO_FRMT_BYTE(frmt) (((frmt) == INFO_FRMT_BYTE) || ((frmt) == INFO_FRMT_NUM_BYTES)) +#define IS_INFO_FRMT_NUM_STR(frmt) ((frmt) == INFO_FRMT_NUM_STR) +#define IS_INFO_FRMT_NUM_BUF(frmt) ((frmt) == INFO_FRMT_NUM_BUF) +#define IS_INFO_FRMT_BUF(frmt) ((frmt) == INFO_FRMT_BUF) + +#define INFO_INT_MAX_LEN (32) +#define INFO_INT_LEN_VALAID(len) (((len) > 0) && ((len) < INFO_INT_MAX_LEN)) + +#define INFO_BUF_MAX_LEN (128) +#define INFO_BUF_LEN_VALAID(len) (((len) > 0) && ((len) < INFO_BUF_MAX_LEN)) + +#define INFO_BIT_OFFSET_VALID(bit_offset) (((bit_offset) >= 0) && ((bit_offset) < 8)) + +typedef enum info_ctrl_mode_e { + INFO_CTRL_MODE_NONE, + INFO_CTRL_MODE_CFG, + INFO_CTRL_MODE_CONS, + INFO_CTRL_MODE_TLV, + INFO_CTRL_MODE_SRT_CONS, + INFO_CTRL_MODE_END +} info_ctrl_mode_t; + +typedef enum info_frmt_e { + INFO_FRMT_NONE, + INFO_FRMT_BIT, + INFO_FRMT_BYTE, + INFO_FRMT_NUM_BYTES, + INFO_FRMT_NUM_STR, + INFO_FRMT_NUM_BUF, + INFO_FRMT_BUF, + INFO_FRMT_END +} info_frmt_t; + +typedef enum info_src_e { + INFO_SRC_NONE, + INFO_SRC_CPLD, + INFO_SRC_FPGA, + INFO_SRC_OTHER_I2C, + INFO_SRC_FILE, + INFO_SRC_END +} info_src_t; + +typedef enum info_pola_e { + INFO_POLA_NONE, + INFO_POLA_POSI, + INFO_POLA_NEGA, + INFO_POLA_END +} info_pola_t; + +#define INFO_FPATH_MAX_LEN (128) +#define INFO_STR_CONS_MAX_LEN (64) +typedef struct info_ctrl_s { + info_ctrl_mode_t mode; + int32_t int_cons; + info_src_t src; + info_frmt_t frmt; + info_pola_t pola; + char fpath[INFO_FPATH_MAX_LEN]; + int32_t addr; + int32_t len; + int32_t bit_offset; + char str_cons[INFO_STR_CONS_MAX_LEN]; + int32_t int_extra1; + int32_t int_extra2; + int32_t int_extra3; /* cpld voltage mode */ +} info_ctrl_t; + +typedef enum info_ctrl_mem_s { + INFO_CTRL_MEM_MODE, + INFO_CTRL_MEM_INT_CONS, + INFO_CTRL_MEM_SRC, + INFO_CTRL_MEM_FRMT, + INFO_CTRL_MEM_POLA, + INFO_CTRL_MEM_FPATH, + INFO_CTRL_MEM_ADDR, + INFO_CTRL_MEM_LEN, + INFO_CTRL_MEM_BIT_OFFSET, + INFO_CTRL_MEM_STR_CONS, + INFO_CTRL_MEM_INT_EXTRA1, + INFO_CTRL_MEM_INT_EXTRA2, + INFO_CTRL_MEM_INT_EXTRA3, + INFO_CTRL_MEM_END +} info_ctrl_mem_t; + +typedef enum sensor_format_mem_s { + LINEAR11 = 1, + LINEAR16, + TMP464, + MAC_TH5, + MAC_TD3 +} sensor_format_mem_t; + +typedef int (*info_hwmon_buf_f)(uint8_t *buf, int buf_len, uint8_t *buf_new, int *buf_len_new, info_ctrl_t *info_ctrl); + +extern char *g_info_ctrl_mem_str[INFO_CTRL_MEM_END]; +extern char *g_info_src_str[INFO_SRC_END]; +extern char *g_info_frmt_str[INFO_FRMT_END]; +extern char *g_info_pola_str[INFO_POLA_END]; +extern char *g_info_ctrl_mode_str[INFO_CTRL_MODE_END]; + +int dfd_info_get_int(int key, int *ret, info_num_buf_to_value_f pfun); + +int dfd_info_get_buf(int key, uint8_t *buf, int buf_len, info_buf_to_buf_f pfun); + +int dfd_info_set_int(int key, int val); + +int dfd_info_get_sensor(uint32_t key, char *buf, int buf_len, info_hwmon_buf_f pfun); + +#endif /* __DFD_CFG_INFO_H__ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_listnode.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_listnode.h new file mode 100644 index 000000000000..955dfa96e42e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_cfg_listnode.h @@ -0,0 +1,30 @@ +#ifndef __DFD_CFG_LISTNODE_H__ +#define __DFD_CFG_LISTNODE_H__ + +#include + +#define LNODE_RV_OK (0) +#define LNODE_RV_INPUT_ERR (-1) +#define LNODE_RV_NODE_EXIST (-2) +#define LNODE_RV_NOMEM (-3) + +typedef struct lnode_root_s { + struct list_head root; +} lnode_root_t; + +typedef struct lnode_node_s { + struct list_head lst; + + int key; + void *data; +} lnode_node_t; + +void *lnode_find_node(lnode_root_t *root, int key); + +int lnode_insert_node(lnode_root_t *root, int key, void *data); + +int lnode_init_root(lnode_root_t *root); + +void lnode_free_list(lnode_root_t *root); + +#endif /* __DFD_CFG_LISTNODE_H__ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_fan_driver.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_fan_driver.h new file mode 100644 index 000000000000..1065fd9eed3f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_fan_driver.h @@ -0,0 +1,18 @@ +#ifndef _DFD_FAN_DRIVER_H_ +#define _DFD_FAN_DRIVER_H_ + +ssize_t dfd_get_fan_speed(unsigned int fan_index, unsigned int motor_index,unsigned int *speed); + +int dfd_set_fan_pwm(unsigned int fan_index, unsigned int motor_index, int pwm); + +int dfd_get_fan_pwm(unsigned int fan_index, unsigned int motor_index, int *pwm); + +int dfd_get_fan_present_status(unsigned int fan_index); + +int dfd_get_fan_roll_status(unsigned int fan_index, unsigned int motor_index); + +int dfd_get_fan_speed_level(unsigned int fan_index, unsigned int motor_index, int *level); + +int dfd_set_fan_speed_level(unsigned int fan_index, unsigned int motor_index, int level); + +#endif /* _DFD_FAN_DRIVER_H_ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_module.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_module.h new file mode 100644 index 000000000000..a547255cf3ab --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_module.h @@ -0,0 +1,96 @@ +#ifndef __DFD_MODULE_H__ +#define __DFD_MODULE_H__ + +typedef enum dfd_rv_s { + DFD_RV_OK = 0, + DFD_RV_INIT_ERR = 1, + DFD_RV_SLOT_INVALID = 2, + DFD_RV_MODE_INVALID = 3, + DFD_RV_MODE_NOTSUPPORT = 4, + DFD_RV_TYPE_ERR = 5, + DFD_RV_DEV_NOTSUPPORT = 6, + DFD_RV_DEV_FAIL = 7, + DFD_RV_INDEX_INVALID = 8, + DFD_RV_NO_INTF = 9, + DFD_RV_NO_NODE = 10, + DFD_RV_NODE_FAIL = 11, + DFD_RV_INVALID_VALUE = 12, + DFD_RV_NO_MEMORY = 13, +} dfd_rv_t; + +typedef enum { + DBG_VERBOSE = 0x01, + DBG_WARN = 0x02, + DBG_ERROR = 0x04, +} dbg_level_t; + +extern int g_dfd_dbg_level; +extern int g_dfd_fan_dbg_level; +extern int g_dfd_slot_dbg_level; +extern int g_dfd_sensor_dbg_level; +extern int g_dfd_psu_dbg_level; +extern int g_dfd_sff_dbg_level; + +#define DBG_DEBUG(level, fmt, arg...) do { \ + if (g_dfd_dbg_level & level) { \ + if(level >= DBG_ERROR) { \ + printk(KERN_ERR "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } else { \ + printk(KERN_INFO "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } \ + } \ +} while (0) + +#define DFD_FAN_DEBUG(level, fmt, arg...) do { \ + if (g_dfd_fan_dbg_level & level) { \ + if(level >= DBG_ERROR) { \ + printk(KERN_ERR "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } else { \ + printk(KERN_INFO "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } \ + } \ +} while (0) + +#define DFD_SLOT_DEBUG(level, fmt, arg...) do { \ + if (g_dfd_slot_dbg_level & level) { \ + if(level >= DBG_ERROR) { \ + printk(KERN_ERR "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } else { \ + printk(KERN_INFO "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } \ + } \ +} while (0) + +#define DFD_SENSOR_DEBUG(level, fmt, arg...) do { \ + if (g_dfd_sensor_dbg_level & level) { \ + if(level >= DBG_ERROR) { \ + printk(KERN_ERR "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } else { \ + printk(KERN_INFO "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } \ + } \ +} while (0) + +#define DFD_PSU_DEBUG(level, fmt, arg...) do { \ + if (g_dfd_psu_dbg_level & level) { \ + if(level >= DBG_ERROR) { \ + printk(KERN_ERR "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } else { \ + printk(KERN_INFO "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } \ + } \ +} while (0) + +#define DFD_SFF_DEBUG(level, fmt, arg...) do { \ + if (g_dfd_sff_dbg_level & level) { \ + if(level >= DBG_ERROR) { \ + printk(KERN_ERR "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } else { \ + printk(KERN_INFO "[DBG-%d]:<%s, %d>:"fmt, level, __FUNCTION__, __LINE__, ##arg); \ + } \ + } \ +} while (0) + +int dfd_get_dev_number(unsigned int main_dev_id, unsigned int minor_dev_id); + +#endif /* __DFD_MODULE_H__ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_psu_driver.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_psu_driver.h new file mode 100644 index 000000000000..ce7199660557 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_psu_driver.h @@ -0,0 +1,10 @@ +#ifndef _DFD_PSU_DRIVER_H_ +#define _DFD_PSU_DRIVER_H_ + +int dfd_get_psu_present_status(unsigned int psu_index); + +int dfd_get_psu_output_status(unsigned int psu_index); + +int dfd_get_psu_alert_status(unsigned int psu_index); + +#endif /* _DFD_PSU_DRIVER_H_ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_sensors_driver.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_sensors_driver.h new file mode 100644 index 000000000000..16733b26029f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_sensors_driver.h @@ -0,0 +1,10 @@ +#ifndef _DFD_SENSORS_DRIVER_H_ +#define _DFD_SENSORS_DRIVER_H_ + +ssize_t dfd_get_temp_info(uint8_t main_dev_id, uint8_t dev_index, + uint8_t temp_index, uint8_t temp_attr, char *buf); + +ssize_t dfd_get_voltage_info(uint8_t main_dev_id, uint8_t dev_index, + uint8_t in_index, uint8_t in_attr, char *buf); + +#endif /* _DFD_SENSORS_DRIVER_H_ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_sff_driver.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_sff_driver.h new file mode 100644 index 000000000000..7107b72ee4b2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_sff_driver.h @@ -0,0 +1,8 @@ +#ifndef _DFD_SFF_DRIVER_H_ +#define _DFD_SFF_DRIVER_H_ + +ssize_t dfd_get_sff_cpld_info(unsigned int sff_index, int cpld_reg_type, char *buf, int len); + +ssize_t dfd_get_sff_dir_name(unsigned int sff_index, char *buf, int buf_len); + +#endif /* _DFD_SFF_DRIVER_H_ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_slot_driver.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_slot_driver.h new file mode 100644 index 000000000000..c68caecd2e66 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_cfg/include/dfd_slot_driver.h @@ -0,0 +1,6 @@ +#ifndef _DFD_SLOT_DRIVER_H_ +#define _DFD_SLOT_DRIVER_H_ + +int dfd_get_slot_present_status(unsigned int slot_index); + +#endif /* _DFD_SLOT_DRIVER_H_ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/Makefile b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/Makefile new file mode 100644 index 000000000000..1a1044bb1fe8 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/Makefile @@ -0,0 +1,21 @@ +PWD = $(shell pwd) + +EXTRA_CFLAGS:= -I$(M)/include +EXTRA_CFLAGS+= -Wall +KBUILD_EXTRA_SYMBOLS += $(PLAT_SYSFS_DIR)/dev_cfg/Module.symvers + +obj-m := plat_switch.o +obj-m += plat_fan.o +obj-m += plat_psu.o +obj-m += plat_sff.o +obj-m += plat_sensor.o +obj-m += plat_slot.o + +all: + $(MAKE) -C $(KERNEL_SRC)/build M=$(PWD) modules + @if [ ! -d $(module_out_put_dir) ]; then mkdir -p $(module_out_put_dir) ;fi + cp -p $(PWD)/*.ko $(module_out_put_dir) +clean: + rm -f $(PWD)/*.o $(PWD)/*.ko $(PWD)/*.mod.c $(PWD)/.*.cmd $(PWD)/*.mod + rm -f $(PWD)/Module.markers $(PWD)/Module.symvers $(PWD)/modules.order + rm -rf $(PWD)/.tmp_versions diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/include/plat_switch.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/include/plat_switch.h new file mode 100644 index 000000000000..bbd813e87114 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/include/plat_switch.h @@ -0,0 +1,86 @@ +#ifndef _PLAT_SWITCH_H_ +#define _PLAT_SWITCH_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +enum LOG_LEVEL{ + INFO = 0x1, + ERR = 0x2, + DBG = 0x4, + ALL = 0xf +}; + +#define LOG_INFO(_prefix, fmt, args...) \ + do { \ + if (g_loglevel & INFO) \ + { \ + printk( KERN_INFO _prefix "%s "fmt, __FUNCTION__, ##args); \ + } \ + } while (0) + +#define LOG_ERR(_prefix, fmt, args...) \ + do { \ + if (g_loglevel & ERR) \ + { \ + printk( KERN_ERR _prefix "%s "fmt, __FUNCTION__, ##args); \ + } \ + } while (0) + +#define LOG_DBG(_prefix, fmt, args...) \ + do { \ + if (g_loglevel & DBG) \ + { \ + printk( KERN_DEBUG _prefix "%s "fmt, __FUNCTION__, ##args); \ + } \ + } while (0) + +#define check_pfun(p) \ + do { \ + if (p == NULL) { \ + printk( KERN_ERR "%s, %s = NULL.\n", __FUNCTION__, #p); \ + return -ENOSYS; \ + } \ + }while(0) + +#define check_p(p) check_pfun(p) + +#define to_switch_obj(x) container_of(x, struct switch_obj, kobj) +#define to_switch_attr(x) container_of(x, struct switch_attribute, attr) +#define to_switch_device_attr(x) container_of(x, struct switch_device_attribute, switch_attr) + +#define SWITCH_ATTR(_name, _mode, _show, _store, _type) \ + { .switch_attr = __ATTR(_name, _mode, _show, _store), \ + .type = _type } + +#define SWITCH_DEVICE_ATTR(_name, _mode, _show, _store, _type) \ +struct switch_device_attribute switch_dev_attr_##_name \ + = SWITCH_ATTR(_name, _mode, _show, _store, _type) + +struct switch_obj { + struct kobject kobj; + unsigned int index; +}; + +/* a custom attribute that works just for a struct switch_obj. */ +struct switch_attribute { + struct attribute attr; + ssize_t (*show)(struct switch_obj *foo, struct switch_attribute *attr, char *buf); + ssize_t (*store)(struct switch_obj *foo, struct switch_attribute *attr, const char *buf, size_t count); +}; + +struct switch_device_attribute { + struct switch_attribute switch_attr; + int type; +}; + +extern struct switch_obj *wb_plat_kobject_create(const char *name, struct kobject *parent); +extern void wb_plat_kobject_delete(struct switch_obj **obj); + +#endif /* _PLAT_SWITCH_H_ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/include/sysfs_common.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/include/sysfs_common.h new file mode 100644 index 000000000000..5b73731e1fbf --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/include/sysfs_common.h @@ -0,0 +1,90 @@ +#ifndef _SYSFS_COMMON_H_ +#define _SYSFS_COMMON_H_ + +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +#define DIR_NAME_MAX_LEN (64) + +#define WB_SYSFS_DEV_ERROR "NA" +/* sysfs directory name */ +#define FAN_SYSFS_NAME "fan" +#define PSU_SYSFS_NAME "psu" +#define SLOT_SYSFS_NAME "slot" +#define VOLTAGE_SYSFS_NAME "in" +#define TEMP_SYSFS_NAME "temp" +#define SFF_SYSFS_NAME "sff" + +typedef enum wb_main_dev_type_e { + WB_MAIN_DEV_MAINBOARD = 0, + WB_MAIN_DEV_FAN = 1, + WB_MAIN_DEV_PSU = 2, + WB_MAIN_DEV_SFF = 3, + WB_MAIN_DEV_CPLD = 4, + WB_MAIN_DEV_SLOT = 5, +} wb_main_dev_type_t; + +typedef enum wb_minor_dev_type_e { + WB_MINOR_DEV_NONE = 0, /* None */ + WB_MINOR_DEV_TEMP = 1, + WB_MINOR_DEV_IN = 2, + WB_MINOR_DEV_CURR = 3, + WB_MINOR_DEV_POWER = 4, + WB_MINOR_DEV_MOTOR = 5, + WB_MINOR_DEV_PSU = 6, +} wb_minor_dev_type_t; + +typedef enum wb_sensor_type_e { + WB_SENSOR_INPUT = 0, + WB_SENSOR_ALIAS = 1, + WB_SENSOR_TYPE = 2, + WB_SENSOR_MAX = 3, + WB_SENSOR_MAX_HYST = 4, + WB_SENSOR_MIN = 5, + WB_SENSOR_CRIT = 6, +} wb_sensor_type_t; + +typedef enum wb_sff_cpld_attr_e { + WB_SFF_POWER_ON = 0x01, + WB_SFF_TX_FAULT, + WB_SFF_TX_DIS, + WB_SFF_PRE_N, + WB_SFF_RX_LOS, + WB_SFF_RESET, + WB_SFF_LPMODE, + WB_SFF_MODULE_PRESENT, + WB_SFF_INTERRUPT, +} wb_sff_cpld_attr_t; + +struct switch_drivers_t{ + /* device */ + int (*get_dev_number) (unsigned int main_dev_id, unsigned int minor_dev_id); + /* fan */ + int (*get_fan_number) (void); + ssize_t (*get_fan_speed) (unsigned int fan_index, unsigned int motor_index, unsigned int *speed); + int (*get_fan_pwm) (unsigned int fan_index, unsigned int motor_index, int *pwm); + int (*set_fan_pwm) (unsigned int fan_index, unsigned int motor_index, int pwm); + int (*get_fan_present_status)(unsigned int fan_index); + int (*get_fan_roll_status)(unsigned int fan_index, unsigned int motor_index); + int (*get_fan_speed_level)(unsigned int fan_index, unsigned int motor_index, int *level); + int (*set_fan_speed_level)(unsigned int fan_index, unsigned int motor_index, int level); + /* slot */ + int (*get_slot_present_status) (unsigned int slot_index); + /* sensors */ + ssize_t (*get_temp_info)( uint8_t main_dev_id, uint8_t dev_index, + uint8_t temp_index, uint8_t temp_attr, char *buf); + ssize_t (*get_voltage_info)( uint8_t main_dev_id, uint8_t dev_index, + uint8_t in_index, uint8_t in_attr, char *buf); + /* psu */ + int (*get_psu_present_status)(unsigned int psu_index); + int (*get_psu_output_status)(unsigned int psu_index); + int (*get_psu_alert_status)(unsigned int psu_index); + /* sff */ + ssize_t (*get_sff_cpld_info)( unsigned int sff_index, int cpld_reg_type, char *buf, int len); + ssize_t (*get_sff_dir_name)(unsigned int sff_index, char *buf, int buf_len); +}; + +extern struct switch_drivers_t * dfd_plat_driver_get(void); + +#endif /*_SYSFS_COMMON_H_ */ diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_fan.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_fan.c new file mode 100644 index 000000000000..931c7c243a21 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_fan.c @@ -0,0 +1,501 @@ +/* + * plat_fan.c + * + * This module create fan kobjects and attributes in /sys/wb_plat/fan + * + */ + +#include + +#include "./include/plat_switch.h" +#include "./include/sysfs_common.h" + +#define FAN_INFO(fmt, args...) LOG_INFO("fan: ", fmt, ##args) +#define FAN_ERR(fmt, args...) LOG_ERR("fan: ", fmt, ##args) +#define FAN_DBG(fmt, args...) LOG_DBG("fan: ", fmt, ##args) + +struct motor_obj_t{ + struct switch_obj *obj; +}; + +struct fan_obj_t{ + unsigned int motor_number; + struct motor_obj_t *motor; + struct switch_obj *obj; +}; + +struct fan_t{ + unsigned int fan_number; + struct fan_obj_t *fan; +}; + +static int g_loglevel = 0; +static struct fan_t g_fan; +static struct switch_obj *g_fan_obj = NULL; +static struct switch_drivers_t *g_drv = NULL; + +static ssize_t fan_number_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", g_fan.fan_number); +} + +static ssize_t fan_motor_number_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int index; + + index = obj->index; + FAN_DBG("fan_motor_number_show,fan index:%d\n",index); + + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", g_fan.fan[index-1].motor_number); +} + +static ssize_t fan_roll_status_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int fan_index, motor_index; + struct switch_obj *p_obj; + int ret; + + check_p(g_drv); + check_p(g_drv->get_fan_roll_status); + + p_obj = to_switch_obj(obj->kobj.parent); + check_p(p_obj); + + fan_index = p_obj->index; + motor_index = obj->index; + + ret = g_drv->get_fan_roll_status(fan_index, motor_index); + if (ret < 0 ) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", ret); +} + +static ssize_t fan_present_status_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int fan_index; + int ret; + + fan_index = obj->index; + FAN_DBG("fan_present_status_show, fan index:%d\n",fan_index); + check_p(g_drv); + check_p(g_drv->get_fan_present_status); + + ret = g_drv->get_fan_present_status(fan_index); + if(ret < 0) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", ret); +} + +static ssize_t fan_speed_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int fan_index, motor_index, speed; + int ret; + struct switch_obj *p_obj; + + check_p(g_drv); + check_p(g_drv->get_fan_speed); + + p_obj = to_switch_obj(obj->kobj.parent); + check_p(p_obj); + + fan_index = p_obj->index; + motor_index = obj->index; + + ret = g_drv->get_fan_speed(fan_index, motor_index, &speed); + if(ret < 0) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", speed); +} + +static ssize_t fan_motor_ratio_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int fan_index, motor_index; + struct switch_obj *p_obj; + int ret, pwm; + + check_p(g_drv); + check_p(g_drv->get_fan_pwm); + + p_obj = to_switch_obj(obj->kobj.parent); + check_p(p_obj); + fan_index = p_obj->index; + motor_index = obj->index; + ret = g_drv->get_fan_pwm(fan_index, motor_index, &pwm); + + if (ret < 0 ) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", pwm); +} + +static ssize_t fan_motor_ratio_store(struct switch_obj *obj, struct switch_attribute *attr, + const char* buf, size_t count) +{ + unsigned int fan_index, motor_index; + struct switch_obj *p_obj; + int ret, pwm; + + check_p(g_drv); + check_p(g_drv->set_fan_pwm); + + p_obj = to_switch_obj(obj->kobj.parent); + check_p(p_obj); + + fan_index = p_obj->index; + motor_index = obj->index; + sscanf(buf, "%d", &pwm); + + if (pwm < 0 || pwm > 100) { + FAN_ERR("can not set pwm = %d.\n", pwm); + return -EINVAL; + } + ret = g_drv->set_fan_pwm(fan_index, motor_index, pwm); + if (ret < 0) { + FAN_ERR("can not set pwm = %d.\n", pwm); + return -EIO; + } + return count; +} + +/************************************fan dir and attrs*******************************************/ +static struct switch_attribute fan_number_att = __ATTR(num_fans, S_IRUGO, fan_number_show, NULL); + +static struct attribute *fan_dir_attrs[] = { + &fan_number_att.attr, + NULL, +}; + +static struct attribute_group fan_root_attr_group = { + .attrs = fan_dir_attrs, +}; + +/*******************************fan1 fan2 dir and attrs*******************************************/ +static struct switch_attribute fan_num_motors_att = __ATTR(num_motors, S_IRUGO, fan_motor_number_show, NULL); +static struct switch_attribute fan_present_att = __ATTR(present, S_IRUGO, fan_present_status_show, NULL); + +static struct attribute *fan_attrs[] = { + &fan_num_motors_att.attr, + &fan_present_att.attr, + NULL, +}; + +static struct attribute_group fan_attr_group = { + .attrs = fan_attrs, +}; + +/*******************************motor0 motor1 dir and attrs*******************************************/ +static struct switch_attribute motor_speed_att = __ATTR(speed, S_IRUGO, fan_speed_show, NULL); +static struct switch_attribute motor_status_att = __ATTR(status, S_IRUGO, fan_roll_status_show, NULL); +static struct switch_attribute motor_ratio_att = __ATTR(ratio, S_IRUGO | S_IWUSR, fan_motor_ratio_show, fan_motor_ratio_store); + +static struct attribute *motor_attrs[] = { + &motor_speed_att.attr, + &motor_status_att.attr, + &motor_ratio_att.attr, + NULL, +}; + +static struct attribute_group motor_attr_group = { + .attrs = motor_attrs, +}; + +static void fanindex_single_motor_remove_kobj_and_attrs(struct fan_obj_t * curr_fan, unsigned int motor_index) +{ + struct motor_obj_t *curr_motor; /* point to motor0 motor1...*/ + + curr_motor = &curr_fan->motor[motor_index]; + if (curr_motor->obj) { + sysfs_remove_group(&curr_motor->obj->kobj, &motor_attr_group); + wb_plat_kobject_delete(&curr_motor->obj); + FAN_DBG("delete fan:%d motor%d.\n", curr_fan->obj->index, motor_index); + } + return; +} + +static int fanindex_single_motor_create_kobj_and_attrs(struct fan_obj_t * curr_fan, unsigned int motor_index) +{ + char name[DIR_NAME_MAX_LEN]; + struct motor_obj_t *curr_motor; /* point to motor0 motor1...*/ + + FAN_DBG("create fan_index:%d, motor%d ...\n", curr_fan->obj->index, motor_index); + + curr_motor = &curr_fan->motor[motor_index]; + mem_clear(name, sizeof(name)); + snprintf(name, sizeof(name), "motor%d", motor_index); + curr_motor->obj = wb_plat_kobject_create(name, &curr_fan->obj->kobj); + if (!curr_motor->obj) { + FAN_ERR("create fan_index:%d, motor%d object error!\n", curr_fan->obj->index, motor_index); + return -EBADRQC; + } + curr_motor->obj->index = motor_index; + if (sysfs_create_group(&curr_motor->obj->kobj, &motor_attr_group) != 0) { + FAN_ERR("create fan_index:%d, motor%d attrs error.\n", curr_fan->obj->index, motor_index); + wb_plat_kobject_delete(&curr_motor->obj); + return -EBADRQC; + } + FAN_DBG("create fan_index:%d, motor%d ok.\n", curr_fan->obj->index, motor_index); + return 0; +} + +static int fanindex_motor_create_kobj_and_attrs(struct fan_obj_t * curr_fan, int motor_num) +{ + int motor_index, i; + + curr_fan->motor = kzalloc(sizeof(struct motor_obj_t) * motor_num, GFP_KERNEL); + if (!curr_fan->motor) { + FAN_ERR("kzalloc motor error, fan index = %d, motor number = %d.\n", curr_fan->obj->index, motor_num); + return -ENOMEM; + } + curr_fan->motor_number = motor_num; + for (motor_index = 0; motor_index < motor_num; motor_index++) { + if (fanindex_single_motor_create_kobj_and_attrs(curr_fan, motor_index) != 0) { + goto motor_error; + } + } + return 0; +motor_error: + for(i = motor_index - 1; i >= 0; i--) { + fanindex_single_motor_remove_kobj_and_attrs(curr_fan, i); + } + if(curr_fan->motor) { + kfree(curr_fan->motor); + curr_fan->motor = NULL; + } + return -EBADRQC; +} + +static void fanindex_motor_remove_kobj_and_attrs(struct fan_obj_t *curr_fan, int motor_num) +{ + int motor_index; + + for (motor_index = motor_num - 1; motor_index >= 0; motor_index--) { + fanindex_single_motor_remove_kobj_and_attrs(curr_fan, motor_index); + } + return; +} + +static int fan_motor_create(void) +{ + int fan_num, motor_num; + unsigned int fan_index, i; + struct fan_obj_t *curr_fan; /* point to fan1 fan2...*/ + + check_p(g_drv->get_dev_number); + + motor_num = g_drv->get_dev_number(WB_MAIN_DEV_FAN, WB_MINOR_DEV_MOTOR); + if (motor_num <= 0) { + FAN_ERR("get fan motor number error, motor_num:%d error.\n", motor_num); + return -ENODEV; + } + + fan_num = g_fan.fan_number; + for (fan_index = 1; fan_index <= fan_num; fan_index++) { + curr_fan = &g_fan.fan[fan_index - 1]; + if (fanindex_motor_create_kobj_and_attrs(curr_fan, motor_num) != 0) { + goto error; + } + } + return 0; +error: + for (i = fan_index - 1; i > 0; i--) { + curr_fan = &g_fan.fan[i - 1]; + motor_num = curr_fan->motor_number; + fanindex_motor_remove_kobj_and_attrs(curr_fan, motor_num); + } + return -EBADRQC; +} + +static void fan_motor_remove(void) +{ + unsigned int fan_index; + struct fan_obj_t *curr_fan; + + if (g_fan.fan) { + for (fan_index = g_fan.fan_number; fan_index > 0; fan_index--) { + curr_fan = &g_fan.fan[fan_index - 1]; + if (curr_fan->motor) { + fanindex_motor_remove_kobj_and_attrs(curr_fan, curr_fan->motor_number); + kfree(curr_fan->motor); + curr_fan->motor = NULL; + curr_fan->motor_number = 0; + } + } + } + return; +} + +static void fan_sub_single_remove_kobj_and_attrs(unsigned int index) +{ + struct fan_obj_t *curr_fan; + + curr_fan = &g_fan.fan[index - 1]; + if (curr_fan->obj) { + sysfs_remove_group(&curr_fan->obj->kobj, &fan_attr_group); + wb_plat_kobject_delete(&curr_fan->obj); + FAN_DBG("delete fan%d.\n", index); + } + return; +} + +static int fan_sub_single_create_kobj_and_attrs(struct kobject *parent, unsigned int index) +{ + char name[DIR_NAME_MAX_LEN]; + struct fan_obj_t *curr_fan; + + curr_fan = &g_fan.fan[index - 1]; + FAN_DBG("create fan%d ...\n", index); + mem_clear(name, sizeof(name)); + snprintf(name, sizeof(name), "fan%d", index); + curr_fan->obj = wb_plat_kobject_create(name, parent); + if (!curr_fan->obj) { + FAN_ERR("create fan%d object error!\n", index); + return -EBADRQC; + } + curr_fan->obj->index = index; + if (sysfs_create_group(&curr_fan->obj->kobj, &fan_attr_group) != 0) { + FAN_ERR("create fan%d attrs error.\n", index); + wb_plat_kobject_delete(&curr_fan->obj); + return -EBADRQC; + } + FAN_DBG("create fan%d ok.\n", index); + return 0; +} + +static int fan_sub_create_kobj_and_attrs(struct kobject *parent, int fan_num) +{ + unsigned int fan_index, i; + + g_fan.fan = kzalloc(sizeof(struct fan_obj_t) * fan_num, GFP_KERNEL); + if (!g_fan.fan) { + FAN_ERR("kzalloc fan.fan error, fan number = %d.\n", fan_num); + return -ENOMEM; + } + + for (fan_index = 1; fan_index <= fan_num; fan_index++) { + if(fan_sub_single_create_kobj_and_attrs(parent, fan_index) != 0 ) { + goto error; + } + } + return 0; +error: + for (i = fan_index - 1; i > 0; i--) { + fan_sub_single_remove_kobj_and_attrs(i); + } + if (g_fan.fan) { + kfree(g_fan.fan); + g_fan.fan = NULL; + } + return -EBADRQC; +} + +static int fan_sub_create(void) +{ + int ret, fan_num; + + check_p(g_drv->get_dev_number); + fan_num = g_drv->get_dev_number(WB_MAIN_DEV_FAN, WB_MINOR_DEV_NONE); + if (fan_num < 0) { + FAN_ERR("fan number = %d error.\n", fan_num); + return -EINVAL; + } + g_fan.fan_number = fan_num; + ret = fan_sub_create_kobj_and_attrs(&g_fan_obj->kobj, fan_num); + return ret; +} + +static void fan_sub_remove(void) +{ + unsigned int fan_index; + + if (g_fan.fan) { + for (fan_index = g_fan.fan_number; fan_index > 0; fan_index--) { + fan_sub_single_remove_kobj_and_attrs(fan_index); + } + kfree(g_fan.fan); + } + mem_clear(&g_fan, sizeof(struct fan_t)); + return; +} + +static int fan_root_create(void) +{ + g_fan_obj = wb_plat_kobject_create("fan", NULL); + if (!g_fan_obj) { + FAN_ERR("wb_plat_kobject_create fan error!\n"); + return -ENOMEM; + } + + if (sysfs_create_group(&g_fan_obj->kobj, &fan_root_attr_group) != 0) { + wb_plat_kobject_delete(&g_fan_obj); + FAN_ERR("create fan dir attrs error!\n"); + return -EBADRQC; + } + FAN_DBG("wb_plat_kobject_create fan directory and attribute success.\n"); + return 0; +} + +static void fan_root_remove(void) +{ + if (g_fan_obj) { + sysfs_remove_group(&g_fan_obj->kobj, &fan_root_attr_group); + wb_plat_kobject_delete(&g_fan_obj); + FAN_DBG("delete fan root success\n"); + } + + return; +} + +static int fan_init(void) +{ + int ret; + + FAN_INFO("fan_init...\n"); + g_drv = dfd_plat_driver_get(); + check_p(g_drv); + + ret = fan_root_create(); + if (ret < 0) { + goto fan_root_error; + } + + ret = fan_sub_create(); + if (ret < 0) { + goto fan_sub_error; + } + + ret = fan_motor_create(); + if (ret < 0) { + goto fan_motor_error; + } + + FAN_INFO("fan_init ok.\n"); + return 0; +fan_motor_error: + fan_sub_remove(); +fan_sub_error: + fan_root_remove(); +fan_root_error: + return ret; +} + +static void fan_exit(void) +{ + fan_motor_remove(); + fan_sub_remove(); + fan_root_remove(); + FAN_INFO("fan_exit ok.\n"); + return ; +} + +module_init(fan_init); +module_exit(fan_exit); +module_param(g_loglevel, int, 0644); +MODULE_PARM_DESC(g_loglevel, "the log level(info=0x1, err=0x2, dbg=0x4).\n"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("fan sysfs driver"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_psu.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_psu.c new file mode 100644 index 000000000000..197f94b64991 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_psu.c @@ -0,0 +1,426 @@ +/* + * plat_psu.c + * + * This module create psu kobjects and attributes in /sys/wb_plat/psu + * + */ + +#include + +#include "./include/plat_switch.h" +#include "./include/sysfs_common.h" + +#define PSU_INFO(fmt, args...) LOG_INFO("psu: ", fmt, ##args) +#define PSU_ERR(fmt, args...) LOG_ERR("psu: ", fmt, ##args) +#define PSU_DBG(fmt, args...) LOG_DBG("psu: ", fmt, ##args) + +struct temp_obj_t{ + struct switch_obj *obj; +}; + +struct psu_obj_t{ + unsigned int temp_number; + struct temp_obj_t *temp; + struct switch_obj *obj; +}; + +struct psu_t{ + unsigned int psu_number; + struct psu_obj_t *psu; +}; + +static int g_loglevel = 0; +static struct psu_t g_psu; +static struct switch_obj *g_psu_obj = NULL; +static struct switch_drivers_t *g_drv = NULL; + +static ssize_t psu_number_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", g_psu.psu_number); +} + +static ssize_t psu_present_status_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int psu_index; + int ret; + + psu_index = obj->index; + PSU_DBG("psu_present_status_show, psu index:%d\n",psu_index); + check_p(g_drv); + check_p(g_drv->get_psu_present_status); + + ret = g_drv->get_psu_present_status(psu_index); + if(ret < 0) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", ret); +} + +static ssize_t psu_output_status_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int psu_index; + int ret; + + psu_index = obj->index; + PSU_DBG("psu_output_status_show, psu index:%d\n",psu_index); + check_p(g_drv); + check_p(g_drv->get_psu_output_status); + + ret = g_drv->get_psu_output_status(psu_index); + if(ret < 0) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", ret); +} + +static ssize_t psu_alert_status_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int psu_index; + int ret; + + psu_index = obj->index; + PSU_DBG("psu_alert_status_show, psu index:%d\n",psu_index); + check_p(g_drv); + check_p(g_drv->get_psu_alert_status); + + ret = g_drv->get_psu_alert_status(psu_index); + if(ret < 0) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", ret); +} + +/************************************psu dir and attrs*******************************************/ +static struct switch_attribute psu_number_att = __ATTR(num_psus, S_IRUGO, psu_number_show, NULL); + +static struct attribute *psu_dir_attrs[] = { + &psu_number_att.attr, + NULL, +}; + +static struct attribute_group psu_root_attr_group = { + .attrs = psu_dir_attrs, +}; + +/*******************************psu1 psu2 dir and attrs*******************************************/ +static struct switch_attribute psu_present_status_att = __ATTR(present, S_IRUGO, psu_present_status_show, NULL); +static struct switch_attribute psu_output_status_att = __ATTR(output, S_IRUGO, psu_output_status_show, NULL); +static struct switch_attribute psu_alert_status_att = __ATTR(alert, S_IRUGO, psu_alert_status_show, NULL); + +static struct attribute *psu_attrs[] = { + &psu_present_status_att.attr, + &psu_output_status_att.attr, + &psu_alert_status_att.attr, + NULL, +}; + +static struct attribute_group psu_attr_group = { + .attrs = psu_attrs, +}; + +/*******************************psu temp0 temp1 dir and attrs*******************************************/ +static struct attribute *psu_temp_attrs[] = { + NULL, +}; + +static struct attribute_group psu_temp_attr_group = { + .attrs = psu_temp_attrs, +}; + +static void psuindex_single_temp_remove_kobj_and_attrs(struct psu_obj_t * curr_psu, unsigned int temp_index) +{ + + struct temp_obj_t *curr_temp; /* point to temp0 temp1...*/ + + curr_temp = &curr_psu->temp[temp_index]; + if (curr_temp->obj) { + sysfs_remove_group(&curr_temp->obj->kobj, &psu_temp_attr_group); + wb_plat_kobject_delete(&curr_temp->obj); + PSU_DBG("delete psu:%d temp%d.\n", curr_psu->obj->index, temp_index); + } + return; +} + +static int psuindex_single_temp_create_kobj_and_attrs(struct psu_obj_t * curr_psu, unsigned int temp_index) +{ + char name[DIR_NAME_MAX_LEN]; + struct temp_obj_t *curr_temp; /* point to temp0 temp1...*/ + + PSU_DBG("create psu_index:%d, temp%d ...\n", curr_psu->obj->index, temp_index); + + curr_temp = &curr_psu->temp[temp_index]; + mem_clear(name, sizeof(name)); + snprintf(name, sizeof(name), "temp%d", temp_index); + curr_temp->obj = wb_plat_kobject_create(name, &curr_psu->obj->kobj); + if (!curr_temp->obj) { + PSU_ERR("create psu_index:%d, temp%d object error!\n", curr_psu->obj->index, temp_index); + return -EBADRQC; + } + curr_temp->obj->index = temp_index; + if (sysfs_create_group(&curr_temp->obj->kobj, &psu_temp_attr_group) != 0) { + PSU_ERR("create psu_index:%d, temp%d attrs error.\n", curr_psu->obj->index, temp_index); + wb_plat_kobject_delete(&curr_temp->obj); + return -EBADRQC; + } + PSU_DBG("create psu_index:%d, temp%d ok.\n", curr_psu->obj->index, temp_index); + return 0; +} + +static int psuindex_temp_create_kobj_and_attrs(struct psu_obj_t * curr_psu, int temp_num) +{ + int temp_index, i; + + curr_psu->temp = kzalloc(sizeof(struct temp_obj_t) * temp_num, GFP_KERNEL); + if (!curr_psu->temp) { + PSU_ERR("kzalloc temp error, psu index = %d, temp number = %d.\n", curr_psu->obj->index, temp_num); + return -ENOMEM; + } + curr_psu->temp_number = temp_num; + for (temp_index = 0; temp_index < temp_num; temp_index++) { + if (psuindex_single_temp_create_kobj_and_attrs(curr_psu, temp_index) != 0) { + goto temp_error; + } + } + return 0; +temp_error: + for (i = temp_index - 1; i >= 0; i--) { + psuindex_single_temp_remove_kobj_and_attrs(curr_psu, i); + } + if (curr_psu->temp) { + kfree(curr_psu->temp); + curr_psu->temp = NULL; + } + return -EBADRQC; +} + +static void psuindex_temp_remove_kobj_and_attrs(struct psu_obj_t * curr_psu, int temp_num) +{ + unsigned int temp_index; + + for (temp_index = temp_num - 1; temp_index >= 0; temp_index--) { + psuindex_single_temp_remove_kobj_and_attrs(curr_psu, temp_index); + } + return; +} + +static int psu_temp_create(void) +{ + int psu_num, temp_num; + unsigned int psu_index, i; + struct psu_obj_t *curr_psu; /* point to psu1 psu2...*/ + + check_p(g_drv->get_dev_number); + temp_num = g_drv->get_dev_number(WB_MAIN_DEV_PSU, WB_MINOR_DEV_TEMP); + if (temp_num <= 0) { + PSU_INFO("psu temp_num:%d, don't need creat temp directory.\n", temp_num); + return 0; + } + + psu_num = g_psu.psu_number; + for(psu_index = 1; psu_index <= psu_num; psu_index++) { + curr_psu = &g_psu.psu[psu_index - 1]; + if(psuindex_temp_create_kobj_and_attrs(curr_psu, temp_num) != 0) { + goto error; + } + } + return 0; +error: + for(i = psu_index - 1; i > 0; i--) { + curr_psu = &g_psu.psu[i - 1]; + temp_num = curr_psu->temp_number; + psuindex_temp_remove_kobj_and_attrs(curr_psu, temp_num); + } + return -EBADRQC; +} + +static void psu_temp_remove(void) +{ + unsigned int psu_index; + struct psu_obj_t *curr_psu; + + if (g_psu.psu) { + for (psu_index = g_psu.psu_number; psu_index > 0; psu_index--) { + curr_psu = &g_psu.psu[psu_index - 1]; + if (curr_psu->temp) { + psuindex_temp_remove_kobj_and_attrs(curr_psu,curr_psu->temp_number); + kfree(curr_psu->temp); + curr_psu->temp = NULL; + curr_psu->temp_number = 0; + } + } + } + return; +} + +static void psu_sub_single_remove_kobj_and_attrs(unsigned int index) +{ + struct psu_obj_t *curr_psu; + + curr_psu = &g_psu.psu[index - 1]; + if (curr_psu->obj) { + sysfs_remove_group(&curr_psu->obj->kobj, &psu_attr_group); + wb_plat_kobject_delete(&curr_psu->obj); + PSU_DBG("delete psu%d.\n", index); + } + return; +} + +static int psu_sub_single_create_kobj_and_attrs(struct kobject *parent, unsigned int index) +{ + char name[DIR_NAME_MAX_LEN]; + struct psu_obj_t *curr_psu; + + curr_psu = &g_psu.psu[index-1]; + PSU_DBG("create psu%d ...\n", index); + mem_clear(name, sizeof(name)); + snprintf(name, sizeof(name), "%s%d",PSU_SYSFS_NAME, index); + curr_psu->obj = wb_plat_kobject_create(name, parent); + if (!curr_psu->obj) { + PSU_ERR("create psu%d object error!\n", index); + return -EBADRQC; + } + curr_psu->obj->index = index; + if (sysfs_create_group(&curr_psu->obj->kobj, &psu_attr_group) != 0) { + PSU_ERR("create psu%d attrs error.\n", index); + wb_plat_kobject_delete(&curr_psu->obj); + return -EBADRQC; + } + PSU_DBG("create psu%d ok.\n", index); + return 0; +} + +static int psu_sub_create_kobj_and_attrs(struct kobject *parent, int psu_num) +{ + unsigned int psu_index, i; + + g_psu.psu = kzalloc(sizeof(struct psu_obj_t) * psu_num, GFP_KERNEL); + if (!g_psu.psu) { + PSU_ERR("kzalloc psu.psu error, psu number = %d.\n", psu_num); + return -ENOMEM; + } + + for (psu_index = 1; psu_index <= psu_num; psu_index++) { + if (psu_sub_single_create_kobj_and_attrs(parent, psu_index) != 0) { + goto error; + } + } + return 0; +error: + for(i = psu_index - 1; i > 0; i--) { + psu_sub_single_remove_kobj_and_attrs(i); + } + if(g_psu.psu) { + kfree(g_psu.psu); + g_psu.psu = NULL; + } + return -EBADRQC; +} + +static int psu_sub_create(void) +{ + int ret, psu_num; + + check_p(g_drv->get_dev_number); + psu_num = g_drv->get_dev_number(WB_MAIN_DEV_PSU, WB_MINOR_DEV_NONE); + if (psu_num < 0) { + PSU_ERR("psu number = %d error.\n", psu_num); + return -EINVAL; + } + g_psu.psu_number = psu_num; + ret = psu_sub_create_kobj_and_attrs(&g_psu_obj->kobj, psu_num); + return ret; +} + +static void psu_sub_remove(void) +{ + unsigned int psu_index; + + if (g_psu.psu) { + for (psu_index = g_psu.psu_number; psu_index > 0; psu_index--) { + psu_sub_single_remove_kobj_and_attrs(psu_index); + } + kfree(g_psu.psu); + } + mem_clear(&g_psu, sizeof(struct psu_t)); + return ; +} + +static int psu_root_create(void) +{ + g_psu_obj = wb_plat_kobject_create(PSU_SYSFS_NAME, NULL); + if (!g_psu_obj) { + PSU_ERR("wb_plat_kobject_create psu error!\n"); + return -ENOMEM; + } + + if (sysfs_create_group(&g_psu_obj->kobj, &psu_root_attr_group) != 0) { + wb_plat_kobject_delete(&g_psu_obj); + PSU_ERR("create psu dir attrs error!\n"); + return -EBADRQC; + } + PSU_DBG("wb_plat_kobject_create psu directory and attribute success.\n"); + return 0; +} + +static void psu_root_remove(void) +{ + if (g_psu_obj) { + sysfs_remove_group(&g_psu_obj->kobj, &psu_root_attr_group); + wb_plat_kobject_delete(&g_psu_obj); + PSU_DBG("delete psu root success\n"); + } + return; +} + +static int wb_psu_init(void) +{ + int ret; + + PSU_INFO("wb_psu_init...\n"); + g_drv = dfd_plat_driver_get(); + check_p(g_drv); + + ret = psu_root_create(); + if (ret < 0) { + goto psu_root_error; + } + + ret = psu_sub_create(); + if (ret < 0) { + goto psu_sub_error; + } + + ret = psu_temp_create(); + if (ret < 0) { + goto psu_temp_error; + } + + PSU_INFO("wb_psu_init ok.\n"); + return 0; +psu_temp_error: + psu_sub_remove(); +psu_sub_error: + psu_root_remove(); +psu_root_error: + return ret; +} + +static void wb_psu_exit(void) +{ + psu_temp_remove(); + psu_sub_remove(); + psu_root_remove(); + PSU_INFO("wb_psu_exit ok.\n"); + return ; +} + +module_init(wb_psu_init); +module_exit(wb_psu_exit); +module_param(g_loglevel, int, 0644); +MODULE_PARM_DESC(g_loglevel, "the log level(info=0x1, err=0x2, dbg=0x4).\n"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("psu sysfs driver"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_sensor.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_sensor.c new file mode 100644 index 000000000000..aaf62f4c1a3c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_sensor.c @@ -0,0 +1,452 @@ +/* + * plat_sensor.c + * + * This module create sensor kobjects and attributes in /sys/wb_plat/sensor + */ + +#include + +#include "./include/plat_switch.h" +#include "./include/sysfs_common.h" + +#define SENSOR_INFO(fmt, args...) LOG_INFO("sensor: ", fmt, ##args) +#define SENSOR_ERR(fmt, args...) LOG_ERR("sensor: ", fmt, ##args) +#define SENSOR_DBG(fmt, args...) LOG_DBG("sensor: ", fmt, ##args) + +struct sensor_t { + unsigned int in_number; + unsigned int temp_number; + struct sensor_in_t *in; + struct sensor_temp_t *temp; +}; + +struct sensor_temp_t { + struct switch_obj *obj; +}; + +struct sensor_in_t { + struct switch_obj *obj; +}; + +static int g_loglevel = 0; +static struct switch_drivers_t *g_drv = NULL; +static struct sensor_t g_sensor; +static struct switch_obj *g_sensor_obj = NULL; + +static ssize_t sensor_temp_number_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", g_sensor.temp_number); +} + +static ssize_t sensor_in_number_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", g_sensor.in_number); +} + +static ssize_t sensor_voltage_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int in_index; + int ret; + struct switch_device_attribute *in_attr; + + check_p(g_drv); + check_p(g_drv->get_voltage_info); + in_index = obj->index; + + in_attr = to_switch_device_attr(attr); + check_p(in_attr); + SENSOR_DBG("sensor_in_show, in index:0x%x, in type:0x%x\n",in_index, in_attr->type); + ret = g_drv->get_voltage_info(WB_MAIN_DEV_MAINBOARD, WB_MINOR_DEV_NONE, in_index, in_attr->type, buf); + if (ret < 0) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + return ret; +} + +static ssize_t sensor_temp_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int temp_index; + int ret; + struct switch_device_attribute *temp_attr; + + check_p(g_drv); + check_p(g_drv->get_temp_info); + temp_index = obj->index; + + temp_attr = to_switch_device_attr(attr); + check_p(temp_attr); + SENSOR_DBG("sensor_temp_show, temp index:0x%x, temp type:0x%x\n", temp_index, temp_attr->type); + ret = g_drv->get_temp_info(WB_MAIN_DEV_MAINBOARD, WB_MINOR_DEV_NONE, temp_index, temp_attr->type, buf); + if (ret < 0) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + return ret; +} + +/************************************sensor dir and attrs*******************************************/ +static struct switch_attribute num_temp_att = __ATTR(num_temp_sensors, S_IRUGO, sensor_temp_number_show, NULL); +static struct switch_attribute num_in_att = __ATTR(num_in_sensors, S_IRUGO, sensor_in_number_show, NULL); + +static struct attribute *sensor_dir_attrs[] = { + &num_temp_att.attr, + &num_in_att.attr, + NULL, +}; + +static struct attribute_group sensor_root_attr_group = { + .attrs = sensor_dir_attrs, +}; + +/*******************************temp0 temp1 dir and attrs*******************************************/ +static SWITCH_DEVICE_ATTR(temp_input, S_IRUGO, sensor_temp_show, NULL, WB_SENSOR_INPUT); +static SWITCH_DEVICE_ATTR(temp_alias, S_IRUGO, sensor_temp_show, NULL, WB_SENSOR_ALIAS); +static SWITCH_DEVICE_ATTR(temp_type, S_IRUGO, sensor_temp_show, NULL, WB_SENSOR_TYPE); +static SWITCH_DEVICE_ATTR(temp_max, S_IRUGO, sensor_temp_show, NULL, WB_SENSOR_MAX); +static SWITCH_DEVICE_ATTR(temp_max_hyst, S_IRUGO, sensor_temp_show, NULL, WB_SENSOR_MAX_HYST); +static SWITCH_DEVICE_ATTR(temp_min, S_IRUGO, sensor_temp_show, NULL, WB_SENSOR_MIN); + +static struct attribute *sensor_temp_attrs[] = { + &switch_dev_attr_temp_input.switch_attr.attr, + &switch_dev_attr_temp_alias.switch_attr.attr, + &switch_dev_attr_temp_type.switch_attr.attr, + &switch_dev_attr_temp_max.switch_attr.attr, + &switch_dev_attr_temp_max_hyst.switch_attr.attr, + &switch_dev_attr_temp_min.switch_attr.attr, + NULL, +}; + +static struct attribute_group sensor_temp_attr_group = { + .attrs = sensor_temp_attrs, +}; + +/*******************************in0 in1 dir and attrs*******************************************/ +static SWITCH_DEVICE_ATTR(in_input, S_IRUGO, sensor_voltage_show, NULL, WB_SENSOR_INPUT); +static SWITCH_DEVICE_ATTR(in_alias, S_IRUGO, sensor_voltage_show, NULL, WB_SENSOR_ALIAS); +static SWITCH_DEVICE_ATTR(in_type, S_IRUGO, sensor_voltage_show, NULL, WB_SENSOR_TYPE); +static SWITCH_DEVICE_ATTR(in_max, S_IRUGO, sensor_voltage_show, NULL, WB_SENSOR_MAX); +static SWITCH_DEVICE_ATTR(in_min, S_IRUGO, sensor_voltage_show, NULL, WB_SENSOR_MIN); +static SWITCH_DEVICE_ATTR(in_crit, S_IRUGO, sensor_voltage_show, NULL, WB_SENSOR_CRIT); + +static struct attribute *sensor_in_attrs[] = { + &switch_dev_attr_in_input.switch_attr.attr, + &switch_dev_attr_in_alias.switch_attr.attr, + &switch_dev_attr_in_type.switch_attr.attr, + &switch_dev_attr_in_max.switch_attr.attr, + &switch_dev_attr_in_min.switch_attr.attr, + &switch_dev_attr_in_crit.switch_attr.attr, + NULL, +}; + +static struct attribute_group sensor_in_attr_group = { + .attrs = sensor_in_attrs, +}; + +static int sensor_in_sub_single_create_kobj_and_attrs(struct kobject *parent, unsigned int index) +{ + char name[DIR_NAME_MAX_LEN]; + struct sensor_in_t *curr_sensor; + + curr_sensor = &g_sensor.in[index - 1]; + SENSOR_DBG("create sensor in%d ...\n", index); + mem_clear(name, sizeof(name)); + snprintf(name, sizeof(name), "in%d", index); + curr_sensor->obj = wb_plat_kobject_create(name, parent); + if (!curr_sensor->obj) { + SENSOR_ERR("create sensor in%d object error!\n", index); + return -EBADRQC; + } + curr_sensor->obj->index = index; + if (sysfs_create_group(&curr_sensor->obj->kobj, &sensor_in_attr_group) != 0) { + SENSOR_ERR("create sensor in%d attrs error.\n", index); + wb_plat_kobject_delete(&curr_sensor->obj); + return -EBADRQC; + } + SENSOR_DBG("create sensor in%d ok.\n", index); + return 0; + +} + +static void sensor_in_sub_single_remove_kobj_and_attrs(unsigned int index) +{ + struct sensor_in_t *curr_in; + + curr_in = &g_sensor.in[index - 1]; + if (curr_in->obj) { + sysfs_remove_group(&curr_in->obj->kobj, &sensor_in_attr_group); + wb_plat_kobject_delete(&curr_in->obj); + SENSOR_DBG("delete in%d.\n", index); + } + return; +} + +static int sensor_temp_sub_single_create_kobj_and_attrs(struct kobject *parent, unsigned int index) +{ + char name[DIR_NAME_MAX_LEN]; + struct sensor_temp_t *curr_sensor; + + curr_sensor = &g_sensor.temp[index - 1]; + SENSOR_DBG("create sensor temp%d ...\n", index); + mem_clear(name, sizeof(name)); + snprintf(name, sizeof(name), "temp%d", index); + curr_sensor->obj = wb_plat_kobject_create(name, parent); + if (!curr_sensor->obj) { + SENSOR_ERR("create sensor temp%d object error!\n", index); + return -EBADRQC; + } + curr_sensor->obj->index = index; + if (sysfs_create_group(&curr_sensor->obj->kobj, &sensor_temp_attr_group) != 0) { + SENSOR_ERR("create sensor temp%d attrs error.\n", index); + wb_plat_kobject_delete(&curr_sensor->obj); + return -EBADRQC; + } + SENSOR_DBG("create sensor temp%d ok.\n", index); + return 0; + +} + +static void sensor_temp_sub_single_remove_kobj_and_attrs(unsigned int index) +{ + struct sensor_temp_t *curr_temp; + + curr_temp = &g_sensor.temp[index - 1]; + if (curr_temp->obj) { + sysfs_remove_group(&curr_temp->obj->kobj, &sensor_temp_attr_group); + wb_plat_kobject_delete(&curr_temp->obj); + SENSOR_DBG("delete temp%d.\n", index); + } + return; +} + +static int sensor_temp_sub_create_kobj_and_attrs(struct kobject *parent, int temp_num) +{ + unsigned int temp_index, i; + + g_sensor.temp = kzalloc(sizeof(struct sensor_temp_t) * temp_num, GFP_KERNEL); + if (!g_sensor.temp ) { + SENSOR_ERR("kzalloc g_sensor.temp error, temp number = %d.\n", temp_num); + return -ENOMEM; + } + for (temp_index = 1; temp_index <= temp_num; temp_index++) { + if (sensor_temp_sub_single_create_kobj_and_attrs(parent, temp_index) != 0 ) { + goto error; + } + } + return 0; +error: + for (i = temp_index - 1; i > 0; i--) { + sensor_temp_sub_single_remove_kobj_and_attrs(i); + } + + if (g_sensor.temp) { + kfree(g_sensor.temp); + g_sensor.temp = NULL; + } + return -EBADRQC; +} + +static int sensor_in_sub_create_kobj_and_attrs(struct kobject *parent, int in_num) +{ + unsigned int in_index, i; + + g_sensor.in = kzalloc(sizeof(struct sensor_in_t) * in_num, GFP_KERNEL); + if (!g_sensor.in) { + SENSOR_ERR("kzalloc g_sensor.in error, in number = %d.\n", in_num); + return -ENOMEM; + } + + for (in_index = 1; in_index <= in_num; in_index++) { + if (sensor_in_sub_single_create_kobj_and_attrs(parent, in_index) != 0 ) { + goto error; + } + } + return 0; +error: + for (i = in_index - 1; i > 0; i--) { + sensor_in_sub_single_remove_kobj_and_attrs(i); + } + + if (g_sensor.in) { + kfree(g_sensor.in); + g_sensor.in = NULL; + } + return -EBADRQC; +} + +static int sensor_temp_sub_create(void) +{ + int ret, temp_num; + + check_p(g_drv->get_dev_number); + temp_num = g_drv->get_dev_number(WB_MAIN_DEV_MAINBOARD, WB_MINOR_DEV_TEMP); + g_sensor.temp_number = temp_num; + if (temp_num <= 0) { + SENSOR_DBG("Warning:sensor temp number = %d \n", temp_num); + return 0; + } + ret = sensor_temp_sub_create_kobj_and_attrs(&g_sensor_obj->kobj, temp_num); + return ret; +} + +static int sensor_in_sub_create(void) +{ + int ret, in_num; + + check_p(g_drv->get_dev_number); + in_num = g_drv->get_dev_number(WB_MAIN_DEV_MAINBOARD, WB_MINOR_DEV_IN); + g_sensor.in_number = in_num; + + if (in_num <= 0) { + SENSOR_DBG("Warning:sensor in number = %d \n", in_num); + return 0; + } + ret = sensor_in_sub_create_kobj_and_attrs(&g_sensor_obj->kobj, in_num); + return ret; +} + +static void temp_sub_single_remove_kobj_and_attrs(unsigned int index) +{ + struct sensor_temp_t * curr_temp; + + curr_temp = &g_sensor.temp[index - 1]; + if (curr_temp->obj) { + sysfs_remove_group(&curr_temp->obj->kobj, &sensor_temp_attr_group); + wb_plat_kobject_delete(&curr_temp->obj); + SENSOR_DBG("delete sensor temp%d.\n", index); + } + return; +} + +static void in_sub_single_remove_kobj_and_attrs(unsigned int index) +{ + struct sensor_in_t * curr_in; + + curr_in = &g_sensor.in[index - 1]; + if (curr_in->obj) { + sysfs_remove_group(&curr_in->obj->kobj, &sensor_in_attr_group); + wb_plat_kobject_delete(&curr_in->obj); + SENSOR_DBG("delete sensor in%d.\n", index); + } + return; +} + +static void sensor_temp_sub_remove(void) +{ + unsigned int temp_index; + + if (g_sensor.temp) { + for (temp_index = g_sensor.temp_number; temp_index > 0; temp_index--) { + temp_sub_single_remove_kobj_and_attrs(temp_index); + } + kfree(g_sensor.temp); + g_sensor.temp = NULL; + } + return; +} + +static void sensor_in_sub_remove(void) +{ + unsigned int in_index; + + if (g_sensor.in) { + for (in_index = g_sensor.in_number; in_index > 0; in_index--) { + in_sub_single_remove_kobj_and_attrs(in_index); + } + kfree(g_sensor.in); + g_sensor.in = NULL; + } + return; +} + +static void sensor_sub_remove(void) +{ + sensor_temp_sub_remove(); + sensor_in_sub_remove(); +} + +static int sensor_sub_create(void) +{ + int ret; + /* temp creat */ + ret = sensor_temp_sub_create(); + if (ret < 0) { + goto temp_err; + } + /* Voltage creat */ + ret = sensor_in_sub_create(); + if (ret < 0) { + goto in_err; + } + return 0; +in_err: + sensor_temp_sub_remove(); +temp_err: + return ret; +} +static void sensor_root_remove(void) +{ + if (g_sensor_obj) { + sysfs_remove_group(&g_sensor_obj->kobj, &sensor_root_attr_group); + wb_plat_kobject_delete(&g_sensor_obj); + SENSOR_DBG("delete sensor root success\n"); + } + + return; +} + +static int sensor_root_create(void) +{ + g_sensor_obj = wb_plat_kobject_create("sensor", NULL); + if (!g_sensor_obj) { + SENSOR_ERR("wb_plat_kobject_create sensor error!\n"); + return -ENOMEM; + } + + if (sysfs_create_group(&g_sensor_obj->kobj, &sensor_root_attr_group) != 0) { + wb_plat_kobject_delete(&g_sensor_obj); + SENSOR_ERR("create sensor dir attrs error!\n"); + return -EBADRQC; + } + SENSOR_DBG("wb_plat_kobject_create sensor directory and attribute success.\n"); + return 0; +} + +static int wb_sensor_init(void) +{ + int ret; + + SENSOR_INFO("wb_sensor_init...\n"); + g_drv = dfd_plat_driver_get(); + check_p(g_drv); + + ret = sensor_root_create(); + if (ret < 0) { + goto sensor_root_error; + } + + ret = sensor_sub_create(); + if (ret < 0) { + goto sensor_sub_error; + } + SENSOR_INFO("sensor_init ok.\n"); + return 0; +sensor_sub_error: + sensor_root_remove(); +sensor_root_error: + return ret; +} + +static void wb_sensor_exit(void) +{ + sensor_sub_remove(); + sensor_root_remove(); + SENSOR_INFO("sensor_exit ok.\n"); + return; +} + +module_init(wb_sensor_init); +module_exit(wb_sensor_exit); +module_param(g_loglevel, int, 0644); +MODULE_PARM_DESC(g_loglevel, "the log level(info=0x1, err=0x2, dbg=0x4).\n"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("sensors sysfs driver"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_sff.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_sff.c new file mode 100644 index 000000000000..50c0f78aede9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_sff.c @@ -0,0 +1,287 @@ +/* + * plat_sff.c + * + * This module create sff kobjects and attributes in /sys/wb_plat/sff + * + */ + +#include + +#include "./include/plat_switch.h" +#include "./include/sysfs_common.h" + +#define SFF_INFO(fmt, args...) LOG_INFO("sff: ", fmt, ##args) +#define SFF_ERR(fmt, args...) LOG_ERR("sff: ", fmt, ##args) +#define SFF_DBG(fmt, args...) LOG_DBG("sff: ", fmt, ##args) + +struct sff_obj_t{ + struct switch_obj *sff_obj; + struct bin_attribute bin; + int sff_creat_bin_flag; +}; + +struct sff_t{ + unsigned int sff_number; + struct sff_obj_t *sff; +}; + +static int g_loglevel = 0; +static struct sff_t g_sff; +static struct switch_obj *g_sff_obj = NULL; +static struct switch_drivers_t *g_drv = NULL; + +static ssize_t sff_cpld_info_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int sff_index; + int ret; + struct switch_device_attribute *sff_cpld_attr; + + check_p(g_drv); + check_p(g_drv->get_sff_cpld_info); + + sff_index = obj->index; + sff_cpld_attr = to_switch_device_attr(attr); + check_p(sff_cpld_attr); + SFF_DBG("sff_cpld_info_show, sff index:0x%x, sff cpld attr type:0x%x\n", sff_index, sff_cpld_attr->type); + ret = g_drv->get_sff_cpld_info(sff_index, sff_cpld_attr->type, buf, PAGE_SIZE); + if(ret < 0) { + SFF_ERR("sff_cpld_info_show error. sff index:0x%x, sff cpld attr type:0x%x, ret:%d\n", + sff_index, sff_cpld_attr->type,ret ); + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + SFF_DBG("sff_cpld_info_show ok. sff index:0x%x, sff cpld attr type:0x%x, ret:%d\n", sff_index, sff_cpld_attr->type, ret); + return ret; +} + +static ssize_t sff_number_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", g_sff.sff_number); +} + +/************************************sff attrs*******************************************/ +static struct switch_attribute sff_number_att = __ATTR(num_sffs, S_IRUGO, sff_number_show, NULL); +static SWITCH_DEVICE_ATTR(present, S_IRUGO, sff_cpld_info_show, NULL, WB_SFF_MODULE_PRESENT); + +/*******************************xcvr dir and attrs*******************************************/ +static struct attribute *xcvr_dir_attrs[] = { + &sff_number_att.attr, + NULL, +}; + +static struct attribute_group sff_xcvr_attr_group = { + .attrs = xcvr_dir_attrs, +}; + +/*******************************sff dir and attrs*******************************************/ +static struct attribute *sff_attrs[] = { + &switch_dev_attr_present.switch_attr.attr, + NULL, +}; + +static struct attribute_group sff_attr_group = { + .attrs = sff_attrs, +}; + +static int sff_sub_single_create_attrs(unsigned int index) +{ + struct sff_obj_t *curr_sff; + + curr_sff = &g_sff.sff[index-1]; + if (sysfs_create_group(&curr_sff->sff_obj->kobj, &sff_attr_group) != 0) { + SFF_ERR("create sff%d dir attrs error!\n", index); + wb_plat_kobject_delete(&curr_sff->sff_obj); + return -EBADRQC; + } + SFF_DBG("create sff%d dir attrs ok!\n", index); + return 0; +} + +static int sff_sub_single_create_kobj(struct kobject *parent, unsigned int index) +{ + struct sff_obj_t *curr_sff; + char sff_dir_name[DIR_NAME_MAX_LEN]; + int ret; + + check_p(g_drv->get_sff_dir_name); + ret = g_drv->get_sff_dir_name(index, sff_dir_name, sizeof(sff_dir_name)); + if (ret < 0) { + SFF_ERR("sff index:%d, get sff dir name error. please check sff config.\n", index); + return -ENOSYS; + } + + curr_sff = &g_sff.sff[index - 1]; + + curr_sff->sff_obj = wb_plat_kobject_create(sff_dir_name, parent); + if (!curr_sff->sff_obj) { + SFF_ERR("sff index:%d, create %s object error! \n", index, sff_dir_name); + return -EBADRQC; + } + + SFF_DBG("create sff kobj ok. sff index:%d, dir name:%s\n",index, sff_dir_name); + curr_sff->sff_obj->index = index; + + return 0; +} + +static void sff_sub_single_remove_kobj_and_attrs(unsigned int index) +{ + struct sff_obj_t *curr_sff; + + curr_sff = &g_sff.sff[index - 1]; + /* remove sff dir and attr */ + if (curr_sff->sff_obj) { + SFF_DBG("delete sff%d attrs.\n", curr_sff->sff_obj->index); + curr_sff->sff_obj->index = 0; + sysfs_remove_group(&curr_sff->sff_obj->kobj, &sff_attr_group); + wb_plat_kobject_delete(&curr_sff->sff_obj); + } + + return; +} + +static int sff_sub_single_create_kobj_and_attrs(struct kobject *parent, unsigned int index) +{ + int ret; + + ret = sff_sub_single_create_kobj(parent, index); + if (ret < 0) { + SFF_ERR("sff index:%d, create sff dir error.\n", index); + return ret; + } + + ret = sff_sub_single_create_attrs(index); + if (ret < 0) { + SFF_ERR("sff index:%d, create sff attr error.\n", index); + return ret; + } + return 0; +} + +static int sff_sub_create_kobj_and_attrs(struct kobject *parent, int sff_num) +{ + unsigned int sff_index, i; + + g_sff.sff = kzalloc(sizeof(struct sff_obj_t) * sff_num, GFP_KERNEL); + if (!g_sff.sff) { + SFF_ERR("kzalloc g_sff.sff error, sff number = %d.\n", sff_num); + return -ENOMEM; + } + + for (sff_index = 1; sff_index <= sff_num; sff_index++) { + if (sff_sub_single_create_kobj_and_attrs(parent, sff_index) != 0 ) { + goto error; + } + } + return 0; +error: + for (i = sff_index - 1; i > 0; i--) { + sff_sub_single_remove_kobj_and_attrs(i); + } + if (g_sff.sff) { + kfree(g_sff.sff); + g_sff.sff = NULL; + } + return -EBADRQC; +} + +static int sff_sub_create(void) +{ + int ret, sff_num; + + check_p(g_drv->get_dev_number); + sff_num = g_drv->get_dev_number(WB_MAIN_DEV_SFF, WB_MINOR_DEV_NONE); + g_sff.sff_number = sff_num; + if (sff_num <= 0) { + SFF_ERR("ERROR. port number:%d\n", sff_num); + return -EINVAL; + } + + ret = sff_sub_create_kobj_and_attrs(&g_sff_obj->kobj, sff_num); + + return ret; +} + +static void sff_sub_remove(void) +{ + unsigned int sff_index; + + if (g_sff.sff) { + for (sff_index = g_sff.sff_number; sff_index > 0; sff_index--) { + sff_sub_single_remove_kobj_and_attrs(sff_index); + } + kfree(g_sff.sff); + } + mem_clear(&g_sff, sizeof(struct sff_t)); + return ; +} + +static int sff_xcvr_create(void) +{ + g_sff_obj = wb_plat_kobject_create(SFF_SYSFS_NAME, NULL); + if (!g_sff_obj) { + SFF_ERR("wb_plat_kobject_create sff error!\n"); + return -ENOMEM; + } + + g_sff_obj->index = 0; + if (sysfs_create_group(&g_sff_obj->kobj, &sff_xcvr_attr_group) != 0) { + wb_plat_kobject_delete(&g_sff_obj); + SFF_ERR("create sff dir attrs error!\n"); + return -EBADRQC; + } + SFF_DBG("wb_plat_kobject_create sff directory and attribute success.\n"); + return 0; +} + +static void sff_xcvr_remove(void) +{ + if (g_sff_obj) { + sysfs_remove_group(&g_sff_obj->kobj, &sff_xcvr_attr_group); + wb_plat_kobject_delete(&g_sff_obj); + SFF_DBG("delete sff root success\n"); + } + + return; +} + +static int wb_sff_init(void) +{ + int ret; + + SFF_INFO("wb_sff_init...\n"); + g_drv = dfd_plat_driver_get(); + check_p(g_drv); + + ret = sff_xcvr_create(); + if (ret < 0) { + goto sff_root_error; + } + + ret = sff_sub_create(); + if (ret < 0) { + goto sff_sub_error; + } + SFF_INFO("wb_sff_init ok.\n"); + return 0; + +sff_sub_error: + sff_xcvr_remove(); +sff_root_error: + return ret; +} + +static void wb_sff_exit(void) +{ + sff_sub_remove(); + sff_xcvr_remove(); + SFF_INFO("wb_sff_exit ok.\n"); + return ; +} + +module_init(wb_sff_init); +module_exit(wb_sff_exit); +module_param(g_loglevel, int, 0644); +MODULE_PARM_DESC(g_loglevel, "the log level(info=0x1, err=0x2, dbg=0x4).\n"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("sff sysfs driver"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_slot.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_slot.c new file mode 100644 index 000000000000..7c50f283bd06 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_slot.c @@ -0,0 +1,663 @@ +/* + * plat_slot.c + * + * This module create sff kobjects and attributes in /sys/wb_plat/slot + * + */ + +#include + +#include "./include/plat_switch.h" +#include "./include/sysfs_common.h" + +#define SLOT_INFO(fmt, args...) LOG_INFO("slot: ", fmt, ##args) +#define SLOT_ERR(fmt, args...) LOG_ERR("slot: ", fmt, ##args) +#define SLOT_DBG(fmt, args...) LOG_DBG("slot: ", fmt, ##args) + +struct slot_temp_obj_t{ + struct switch_obj *obj; +}; + +struct slot_in_obj_t{ + struct switch_obj *obj; +}; + +struct slot_obj_t{ + unsigned int temp_number; + unsigned int in_number; + struct slot_temp_obj_t *temp; + struct slot_in_obj_t *in; + struct switch_obj *obj; +}; + +struct slot_t{ + unsigned int slot_number; + struct slot_obj_t *slot; +}; + +static int g_loglevel = 0; +static struct slot_t g_slot; +static struct switch_obj *g_slot_obj = NULL; +static struct switch_drivers_t *g_drv = NULL; + +static ssize_t slot_number_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", g_slot.slot_number); +} + +static ssize_t slot_temp_number_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int index; + + index = obj->index; + SLOT_DBG("slot_temp_number_show,slot index:%d\n",index); + + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", g_slot.slot[index-1].temp_number); +} + +static ssize_t slot_in_number_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int index; + + index = obj->index; + SLOT_DBG("slot_in_number_show,slot index:%d\n",index); + + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", g_slot.slot[index-1].in_number); +} + +static ssize_t slot_present_status_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int slot_index; + int ret; + + slot_index = obj->index; + SLOT_DBG("slot_present_status_show, slot index:%d\n",slot_index); + check_p(g_drv); + check_p(g_drv->get_slot_present_status); + + ret = g_drv->get_slot_present_status(slot_index); + if(ret < 0) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + + return (ssize_t)snprintf(buf, PAGE_SIZE, "%d\n", ret); +} + +static ssize_t slot_voltage_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int slot_index, in_index; + int ret; + struct switch_obj *p_obj; + struct switch_device_attribute *in_attr; + + check_p(g_drv); + check_p(g_drv->get_voltage_info); + + p_obj = to_switch_obj(obj->kobj.parent); + check_p(p_obj); + + slot_index = p_obj->index; + in_index = obj->index; + + in_attr = to_switch_device_attr(attr); + check_p(in_attr); + SLOT_DBG("slot_voltage_show, slot index:0x%x, temp index:0x%x, temp type:0x%x\n",slot_index, in_index, in_attr->type); + ret = g_drv->get_voltage_info(WB_MAIN_DEV_SLOT, slot_index, in_index, in_attr->type, buf); + if(ret < 0) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + return ret; +} + +static ssize_t slot_temp_show(struct switch_obj *obj, struct switch_attribute *attr, char *buf) +{ + unsigned int slot_index, temp_index; + int ret; + struct switch_obj *p_obj; + struct switch_device_attribute *temp_attr; + + check_p(g_drv); + check_p(g_drv->get_temp_info); + + p_obj = to_switch_obj(obj->kobj.parent); + check_p(p_obj); + + slot_index = p_obj->index; + temp_index = obj->index; + + temp_attr = to_switch_device_attr(attr); + check_p(temp_attr); + SLOT_DBG("slot_temp_show, slot index:0x%x, temp index:0x%x, temp type:0x%x\n",slot_index, temp_index, temp_attr->type); + ret = g_drv->get_temp_info(WB_MAIN_DEV_SLOT, slot_index, temp_index, temp_attr->type, buf); + if(ret < 0) { + return (ssize_t)snprintf(buf, PAGE_SIZE, "%s\n", WB_SYSFS_DEV_ERROR); + } + return ret; +} + +/************************************slot dir and attrs*******************************************/ +static struct switch_attribute slot_number_att = __ATTR(num_slots, S_IRUGO, slot_number_show, NULL); + +static struct attribute *slot_dir_attrs[] = { + &slot_number_att.attr, + NULL, +}; + +static struct attribute_group slot_root_attr_group = { + .attrs = slot_dir_attrs, +}; + +/*******************************slot1 slot2 dir and attrs*******************************************/ +static struct switch_attribute num_temp_sensors_att = __ATTR(num_temp_sensors, S_IRUGO, slot_temp_number_show, NULL); +static struct switch_attribute num_in_sensors_att = __ATTR(num_in_sensors, S_IRUGO, slot_in_number_show, NULL); +static struct switch_attribute slot_present_status_att = __ATTR(present, S_IRUGO, slot_present_status_show, NULL); + +static struct attribute *slot_attrs[] = { + &num_temp_sensors_att.attr, + &num_in_sensors_att.attr, + &slot_present_status_att.attr, + NULL, +}; + +static struct attribute_group slot_attr_group = { + .attrs = slot_attrs, +}; + +/*******************************temp dir and attrs*******************************************/ +static SWITCH_DEVICE_ATTR(temp_alias, S_IRUGO, slot_temp_show, NULL, WB_SENSOR_ALIAS); +static SWITCH_DEVICE_ATTR(temp_type, S_IRUGO, slot_temp_show, NULL, WB_SENSOR_TYPE); +static SWITCH_DEVICE_ATTR(temp_max, S_IRUGO, slot_temp_show, NULL, WB_SENSOR_MAX); +static SWITCH_DEVICE_ATTR(temp_max_hyst, S_IRUGO, slot_temp_show, NULL, WB_SENSOR_MAX_HYST); +static SWITCH_DEVICE_ATTR(temp_min, S_IRUGO, slot_temp_show, NULL, WB_SENSOR_MIN); +static SWITCH_DEVICE_ATTR(temp_input, S_IRUGO, slot_temp_show, NULL, WB_SENSOR_INPUT); + +static struct attribute *temp_attrs[] = { + &switch_dev_attr_temp_alias.switch_attr.attr, + &switch_dev_attr_temp_type.switch_attr.attr, + &switch_dev_attr_temp_max.switch_attr.attr, + &switch_dev_attr_temp_max_hyst.switch_attr.attr, + &switch_dev_attr_temp_min.switch_attr.attr, + &switch_dev_attr_temp_input.switch_attr.attr, + NULL, +}; + +static struct attribute_group temp_attr_group = { + .attrs = temp_attrs, +}; + +/*******************************Voltage dir and attrs*******************************************/ +static SWITCH_DEVICE_ATTR(in_alias, S_IRUGO, slot_voltage_show, NULL, WB_SENSOR_ALIAS); +static SWITCH_DEVICE_ATTR(in_type, S_IRUGO, slot_voltage_show, NULL, WB_SENSOR_TYPE); +static SWITCH_DEVICE_ATTR(in_max, S_IRUGO, slot_voltage_show, NULL, WB_SENSOR_MAX); +static SWITCH_DEVICE_ATTR(in_crit, S_IRUGO, slot_voltage_show, NULL, WB_SENSOR_CRIT); +static SWITCH_DEVICE_ATTR(in_min, S_IRUGO, slot_voltage_show, NULL, WB_SENSOR_MIN); +static SWITCH_DEVICE_ATTR(in_input, S_IRUGO, slot_voltage_show, NULL, WB_SENSOR_INPUT); + +static struct attribute *in_attrs[] = { + &switch_dev_attr_in_alias.switch_attr.attr, + &switch_dev_attr_in_type.switch_attr.attr, + &switch_dev_attr_in_max.switch_attr.attr, + &switch_dev_attr_in_crit.switch_attr.attr, + &switch_dev_attr_in_min.switch_attr.attr, + &switch_dev_attr_in_input.switch_attr.attr, + NULL, +}; + +static struct attribute_group in_attr_group = { + .attrs = in_attrs, +}; + +static void slotindex_single_temp_remove_kobj_and_attrs(struct slot_obj_t * curr_slot, unsigned int temp_index) +{ + + struct slot_temp_obj_t *curr_temp; /* point to temp1 temp2...*/ + + curr_temp = &curr_slot->temp[temp_index - 1]; + if (curr_temp->obj) { + sysfs_remove_group(&curr_temp->obj->kobj, &temp_attr_group); + wb_plat_kobject_delete(&curr_temp->obj); + SLOT_DBG("delete slot:%d temp%d.\n", curr_slot->obj->index, temp_index); + } + return; +} + +static int slotindex_single_temp_create_kobj_and_attrs(struct slot_obj_t * curr_slot, unsigned int temp_index) +{ + char name[DIR_NAME_MAX_LEN]; + struct slot_temp_obj_t *curr_temp; /* point to temp1 temp2...*/ + + curr_temp = &curr_slot->temp[temp_index - 1]; + mem_clear(name, sizeof(name)); + snprintf(name, sizeof(name), "%s%d", TEMP_SYSFS_NAME, temp_index); + + curr_temp->obj = wb_plat_kobject_create(name, &curr_slot->obj->kobj); + if (!curr_temp->obj) { + SLOT_ERR("create slot_index:%d, temp%d object error!\n", curr_slot->obj->index, temp_index); + return -EBADRQC; + } + curr_temp->obj->index = temp_index; + if (sysfs_create_group(&curr_temp->obj->kobj, &temp_attr_group) != 0) { + SLOT_ERR("create slot_index:%d, temp%d attrs error.\n", curr_slot->obj->index, temp_index); + wb_plat_kobject_delete(&curr_temp->obj); + return -EBADRQC; + } + SLOT_DBG("create slot_index:%d, temp%d ok.\n", curr_slot->obj->index, temp_index); + return 0; +} + +static void slotindex_temp_remove_kobj_and_attrs(struct slot_obj_t * curr_slot) +{ + int temp_index; + + for(temp_index = curr_slot->temp_number; temp_index > 0; temp_index--) { + slotindex_single_temp_remove_kobj_and_attrs(curr_slot, temp_index); + } + + if(curr_slot->temp) { + kfree(curr_slot->temp); + curr_slot->temp = NULL; + curr_slot->temp_number = 0; + } + return; +} + +static int slotindex_temp_create_kobj_and_attrs(struct slot_obj_t * curr_slot, int temp_num) +{ + int temp_index, i; + + curr_slot->temp_number = temp_num; + curr_slot->temp = kzalloc(sizeof(struct slot_temp_obj_t) * temp_num, GFP_KERNEL); + if (!curr_slot->temp) { + SLOT_ERR("kzalloc slot temp error, slot index = %d, temp number = %d.\n", curr_slot->obj->index, temp_num); + return -ENOMEM; + } + + for (temp_index = 1; temp_index <= temp_num; temp_index++) { + if (slotindex_single_temp_create_kobj_and_attrs(curr_slot, temp_index) != 0) { + goto error; + } + } + return 0; +error: + for (i = temp_index - 1; i > 0; i--) { + slotindex_single_temp_remove_kobj_and_attrs(curr_slot, i); + } + + if (curr_slot->temp) { + kfree(curr_slot->temp); + curr_slot->temp = NULL; + curr_slot->temp_number = 0; + } + return -EBADRQC; +} + +static void slotindex_single_in_remove_kobj_and_attrs(struct slot_obj_t * curr_slot, unsigned int in_index) +{ + + struct slot_in_obj_t *curr_in; /* point to in1 in2...*/ + + curr_in = &curr_slot->in[in_index - 1]; + if (curr_in->obj) { + sysfs_remove_group(&curr_in->obj->kobj, &in_attr_group); + wb_plat_kobject_delete(&curr_in->obj); + SLOT_DBG("delete slot:%d in%d.\n", curr_slot->obj->index, in_index); + } + return; +} + +static int slotindex_single_in_create_kobj_and_attrs(struct slot_obj_t * curr_slot, unsigned int in_index) +{ + char name[DIR_NAME_MAX_LEN]; + struct slot_in_obj_t *curr_in; /* point to in1 in2...*/ + + curr_in = &curr_slot->in[in_index - 1]; + mem_clear(name, sizeof(name)); + snprintf(name, sizeof(name), "%s%d", VOLTAGE_SYSFS_NAME, in_index); + curr_in->obj = wb_plat_kobject_create(name, &curr_slot->obj->kobj); + if (!curr_in->obj) { + SLOT_ERR("create slot_index:%d, in%d object error!\n", curr_slot->obj->index, in_index); + return -EBADRQC; + } + curr_in->obj->index = in_index; + if (sysfs_create_group(&curr_in->obj->kobj, &in_attr_group) != 0) { + SLOT_ERR("create slot_index:%d, in%d attrs error.\n", curr_slot->obj->index, in_index); + wb_plat_kobject_delete(&curr_in->obj); + return -EBADRQC; + } + SLOT_DBG("create slot_index:%d, in%d ok.\n", curr_slot->obj->index, in_index); + return 0; +} + +static void slotindex_in_remove_kobj_and_attrs(struct slot_obj_t * curr_slot) +{ + int in_index; + + for(in_index = curr_slot->in_number; in_index > 0; in_index--) { + slotindex_single_in_remove_kobj_and_attrs(curr_slot, in_index); + } + + if(curr_slot->in) { + kfree(curr_slot->in); + curr_slot->in = NULL; + curr_slot->in_number = 0; + } + return; +} + +static int slotindex_in_create_kobj_and_attrs(struct slot_obj_t * curr_slot, int in_num) +{ + int in_index, i; + + curr_slot->in_number = in_num; + curr_slot->in = kzalloc(sizeof(struct slot_in_obj_t) * in_num, GFP_KERNEL); + if (!curr_slot->in) { + SLOT_ERR("kzalloc slot Voltage error, slot index = %d, Voltage number = %d.\n", curr_slot->obj->index, in_num); + return -ENOMEM; + } + + for (in_index = 1; in_index <= in_num; in_index++) { + if (slotindex_single_in_create_kobj_and_attrs(curr_slot, in_index) != 0 ) { + goto error; + } + } + return 0; +error: + for (i = in_index - 1; i > 0; i++) { + slotindex_single_in_remove_kobj_and_attrs(curr_slot, i); + } + + if (curr_slot->in) { + kfree(curr_slot->in); + curr_slot->in = NULL; + curr_slot->in_number = 0; + } + return -EBADRQC; +} + +static void slotindex_obj_remove_kobj_and_attrs(struct slot_obj_t * curr_slot, unsigned int obj_id) +{ + switch (obj_id) { + case WB_MINOR_DEV_TEMP: + slotindex_temp_remove_kobj_and_attrs(curr_slot); + break; + case WB_MINOR_DEV_IN: + slotindex_in_remove_kobj_and_attrs(curr_slot); + break; + default: + SLOT_ERR("Unknow obj id:%d\n", obj_id); + } + return ; +} + +static int slotindex_obj_create_kobj_and_attrs(struct slot_obj_t * curr_slot, unsigned int obj_id, int obj_num) +{ + int ret; + + switch (obj_id) { + case WB_MINOR_DEV_TEMP: + ret = slotindex_temp_create_kobj_and_attrs(curr_slot, obj_num); + break; + case WB_MINOR_DEV_IN: + ret = slotindex_in_create_kobj_and_attrs(curr_slot, obj_num); + break; + default: + SLOT_ERR("Unknow obj id:%d\n", obj_id); + ret = -EINVAL; + } + return ret; +} + +static void slot_child_obj_remove_by_id(unsigned int obj_id) +{ + int slot_num; + unsigned int slot_index; + struct slot_obj_t *curr_slot; /* point to slot1 slot2...*/ + + slot_num = g_slot.slot_number; + if (slot_num <= 0 || !g_slot.slot) { + SLOT_DBG("Warning:slot number = %d\n", slot_num); + return; + } + + for(slot_index = slot_num; slot_index > 0; slot_index--) { + curr_slot = &g_slot.slot[slot_index - 1]; + slotindex_obj_remove_kobj_and_attrs(curr_slot, obj_id); + } + return; +} + +static int slot_child_obj_create_by_id(unsigned int obj_id) +{ + int slot_num, obj_num; + unsigned int slot_index, i; + struct slot_obj_t *curr_slot; /* point to slot1 slot2...*/ + + check_p(g_drv->get_dev_number); + obj_num = g_drv->get_dev_number(WB_MAIN_DEV_SLOT,obj_id); + slot_num = g_slot.slot_number; + if (obj_num <= 0 || slot_num <= 0 || !g_slot.slot) { + SLOT_DBG("Warning:slot number = %d, object number:%d.obj_id:%d\n", slot_num, obj_num, obj_id); + return 0; + } + + for (slot_index = 1; slot_index <= slot_num; slot_index++) { + curr_slot = &g_slot.slot[slot_index - 1]; + if (slotindex_obj_create_kobj_and_attrs(curr_slot, obj_id, obj_num) != 0) { + goto error; + } + } + return 0; +error: + for(i = slot_index - 1; i > 0; i++) { + curr_slot = &g_slot.slot[i - 1]; + slotindex_obj_remove_kobj_and_attrs(curr_slot, obj_id); + } + return -EBADRQC; +} + +static void slot_child_obj_remove(void) +{ + /* temp remove */ + slot_child_obj_remove_by_id(WB_MINOR_DEV_TEMP); + + /* in creat */ + slot_child_obj_remove_by_id(WB_MINOR_DEV_IN); + return; +} + +static int slot_child_obj_create(void) +{ + int ret; + + /* temp creat */ + ret = slot_child_obj_create_by_id(WB_MINOR_DEV_TEMP); + if (ret < 0) { + goto temp_err; + } + /* Voltage creat */ + ret = slot_child_obj_create_by_id(WB_MINOR_DEV_IN); + if(ret < 0) { + goto in_err; + } + return 0; +in_err: + slot_child_obj_remove_by_id(WB_MINOR_DEV_TEMP); +temp_err: + return ret; +} + +static void slot_sub_single_remove_kobj_and_attrs(unsigned int index) +{ + struct slot_obj_t *curr_slot; + + curr_slot = &g_slot.slot[index - 1]; + if (curr_slot->obj) { + sysfs_remove_group(&curr_slot->obj->kobj, &slot_attr_group); + wb_plat_kobject_delete(&curr_slot->obj); + SLOT_DBG("delete slot%d.\n", index); + } + return; +} + +static int slot_sub_single_create_kobj_and_attrs(struct kobject *parent, unsigned int index) +{ + char name[DIR_NAME_MAX_LEN]; + struct slot_obj_t *curr_slot; + + curr_slot = &g_slot.slot[index - 1]; + SLOT_DBG("create %s%d ...\n", SLOT_SYSFS_NAME, index); + mem_clear(name, sizeof(name)); + snprintf(name, sizeof(name), "%s%d", SLOT_SYSFS_NAME, index); + curr_slot->obj = wb_plat_kobject_create(name, parent); + if (!curr_slot->obj) { + SLOT_ERR("create slot%d object error!\n", index); + return -EBADRQC; + } + curr_slot->obj->index = index; + if (sysfs_create_group(&curr_slot->obj->kobj, &slot_attr_group) != 0) { + SLOT_ERR("create slot%d attrs error.\n", index); + wb_plat_kobject_delete(&curr_slot->obj); + return -EBADRQC; + } + SLOT_DBG("create slot%d ok.\n", index); + return 0; +} + +static int slot_sub_create_kobj_and_attrs(struct kobject *parent, int slot_num) +{ + unsigned int slot_index, i; + + g_slot.slot = kzalloc(sizeof(struct slot_obj_t) * slot_num, GFP_KERNEL); + if (!g_slot.slot) { + SLOT_ERR("kzalloc slot.slot error, slot number = %d.\n", slot_num); + return -ENOMEM; + } + + for (slot_index = 1; slot_index <= slot_num; slot_index++) { + if (slot_sub_single_create_kobj_and_attrs(parent, slot_index) != 0) { + goto error; + } + } + return 0; +error: + for (i = slot_index - 1; i > 0; i--) { + slot_sub_single_remove_kobj_and_attrs(i); + } + if (g_slot.slot) { + kfree(g_slot.slot); + g_slot.slot = NULL; + } + return -EBADRQC; +} + +/* create slot1 slot2...dir and attrs */ +static int slot_sub_create(void) +{ + int ret, slot_num; + + check_p(g_drv->get_dev_number); + slot_num = g_drv->get_dev_number(WB_MAIN_DEV_SLOT, WB_MINOR_DEV_NONE); + g_slot.slot_number = slot_num; + if (slot_num <= 0) { + SLOT_DBG("Warning:slot number = %d \n", slot_num); + return 0; + } + ret = slot_sub_create_kobj_and_attrs(&g_slot_obj->kobj, slot_num); + return ret; +} + +/** + * slot_sub_remove - delete slot1 slot2...dir and attrs + */ +static void slot_sub_remove(void) +{ + unsigned int slot_index; + + if (g_slot.slot) { + for (slot_index = g_slot.slot_number; slot_index > 0; slot_index--) { + slot_sub_single_remove_kobj_and_attrs(slot_index); + } + kfree(g_slot.slot); + } + mem_clear(&g_slot, sizeof(struct slot_t)); + return ; +} + +/* create slot dir and num_slots attr */ +static int slot_root_create(void) +{ + g_slot_obj = wb_plat_kobject_create(SLOT_SYSFS_NAME, NULL); + if (!g_slot_obj) { + SLOT_ERR("wb_plat_kobject_create slot error!\n"); + return -ENOMEM; + } + + if (sysfs_create_group(&g_slot_obj->kobj, &slot_root_attr_group) != 0) { + wb_plat_kobject_delete(&g_slot_obj); + SLOT_ERR("create slot dir attrs error!\n"); + return -EBADRQC; + } + SLOT_DBG("wb_plat_kobject_create slot directory and attribute success.\n"); + return 0; +} + +static void slot_root_remove(void) +{ + if (g_slot_obj) { + sysfs_remove_group(&g_slot_obj->kobj, &slot_root_attr_group); + wb_plat_kobject_delete(&g_slot_obj); + SLOT_DBG("delete slot root success\n"); + } + + return; +} + +static int wb_slot_init(void) +{ + int ret; + + SLOT_INFO("wb_slot_init...\n"); + g_drv = dfd_plat_driver_get(); + check_p(g_drv); + + ret = slot_root_create(); + if (ret < 0) { + goto slot_root_error; + } + + ret = slot_sub_create(); + if (ret < 0) { + goto slot_sub_error; + } + + ret = slot_child_obj_create(); + if (ret < 0) { + goto slot_child_obj_error; + } + + SLOT_INFO("wb_slot_init ok.\n"); + return 0; +slot_child_obj_error: + slot_sub_remove(); +slot_sub_error: + slot_root_remove(); +slot_root_error: + return ret; +} + +static void wb_slot_exit(void) +{ + slot_child_obj_remove(); + slot_sub_remove(); + slot_root_remove(); + SLOT_INFO("wb_slot_exit ok.\n"); + return ; +} + +module_init(wb_slot_init); +module_exit(wb_slot_exit); +module_param(g_loglevel, int, 0644); +MODULE_PARM_DESC(g_loglevel, "the log level(info=0x1, err=0x2, dbg=0x4).\n"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("slot sysfs driver"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_switch.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_switch.c new file mode 100644 index 000000000000..fea008b41bfe --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/plat_sysfs/dev_sysfs/plat_switch.c @@ -0,0 +1,130 @@ +/* + * plat_switch.c + * + * This module create a kset in sysfs called /sys/wb_plat + * Then other switch kobjects are created and assigned to this kset, + * such as "board", "cpld", "fan", "psu", "sff", ... + * + */ +#include "./include/plat_switch.h" + +#define SWITCH_INFO(fmt, args...) LOG_INFO("switch: ", fmt, ##args) +#define SWITCH_ERR(fmt, args...) LOG_ERR("switch: ", fmt, ##args) +#define SWITCH_DBG(fmt, args...) LOG_DBG("switch: ", fmt, ##args) + +static int g_loglevel = 0; + +static ssize_t switch_attr_show(struct kobject *kobj, + struct attribute *attr, char *buf) +{ + struct switch_attribute *attribute; + struct switch_obj *device; + + attribute = to_switch_attr(attr); + device = to_switch_obj(kobj); + + if (!attribute->show) + return -ENOSYS; + + return attribute->show(device, attribute, buf); +} + +static ssize_t switch_attr_store(struct kobject *kobj, + struct attribute *attr, const char *buf, size_t len) +{ + struct switch_attribute *attribute; + struct switch_obj *obj; + + attribute = to_switch_attr(attr); + obj = to_switch_obj(kobj); + + if (!attribute->store) + return -ENOSYS; + + return attribute->store(obj, attribute, buf, len); +} + +static const struct sysfs_ops switch_sysfs_ops = { + .show = switch_attr_show, + .store = switch_attr_store, +}; + +static void switch_obj_release(struct kobject *kobj) +{ + struct switch_obj *obj; + + obj = to_switch_obj(kobj); + kfree(obj); +} + +static struct kobj_type switch_ktype = { + .sysfs_ops = &switch_sysfs_ops, + .release = switch_obj_release, +}; + +static struct kset *switch_kset; + +struct switch_obj *wb_plat_kobject_create(const char *name, struct kobject *parent) +{ + struct switch_obj *obj = NULL; + int ret = 0; + + obj = kzalloc(sizeof(*obj), GFP_KERNEL); + if (!obj) { + SWITCH_DBG("wb_plat_kobject_create %s kzalloc error", name); + return NULL; + } + + obj->kobj.kset = switch_kset; + + ret = kobject_init_and_add(&obj->kobj, &switch_ktype, parent, "%s", name); + if (ret) { + kobject_put(&obj->kobj); + SWITCH_DBG("kobject_init_and_add %s error", name); + return NULL; + } + + return obj; +} + +void wb_plat_kobject_delete(struct switch_obj **obj) +{ + if (*obj) { + SWITCH_DBG("%s delete %s.\n", (*obj)->kobj.parent->name, (*obj)->kobj.name); + kobject_put(&((*obj)->kobj)); + *obj = NULL; + } +} + +static int __init switch_init(void) +{ + SWITCH_INFO("...\n"); + + switch_kset = kset_create_and_add("wb_plat", NULL, NULL); + if (!switch_kset) { + SWITCH_ERR("create switch_kset error.\n"); + return -ENOMEM; + } + + SWITCH_INFO("ok.\n"); + return 0; +} + +static void __exit switch_exit(void) +{ + if (switch_kset) { + kset_unregister(switch_kset); + } + + SWITCH_INFO("ok.\n"); +} + +module_init(switch_init); +module_exit(switch_exit); +EXPORT_SYMBOL(wb_plat_kobject_create); +EXPORT_SYMBOL(wb_plat_kobject_delete); +module_param(g_loglevel, int, 0644); +MODULE_PARM_DESC(g_loglevel, "the log level(info=0x1, err=0x2, dbg=0x4).\n"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("Switch driver"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/platform_common.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/platform_common.h new file mode 100644 index 000000000000..9e4a4fae00c1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/platform_common.h @@ -0,0 +1,74 @@ +#ifndef __PLATFORM_COMMON_H__ +#define __PLATFORM_COMMON_H__ + +#include +#include +#include +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +typedef enum { + DBG_START, + DBG_VERBOSE, + DBG_KEY, + DBG_WARN, + DBG_ERROR, + DBG_END, +} dbg_level_t; + + typedef struct dfd_i2c_dev_s { + int bus; + int addr; + } dfd_i2c_dev_t; + +typedef struct dfd_dev_head_info_s { + uint8_t ver; + uint8_t flag; + uint8_t hw_ver; + uint8_t type; + int16_t tlv_len; +} dfd_dev_head_info_t; + +typedef struct dfd_dev_tlv_info_s { + uint8_t type; + uint8_t len; + uint8_t data[0]; +} dfd_dev_tlv_info_t; + +typedef enum dfd_dev_info_type_e { + DFD_DEV_INFO_TYPE_MAC = 1, + DFD_DEV_INFO_TYPE_NAME = 2, + DFD_DEV_INFO_TYPE_SN = 3, + DFD_DEV_INFO_TYPE_PWR_CONS = 4, + DFD_DEV_INFO_TYPE_HW_INFO = 5, + DFD_DEV_INFO_TYPE_DEV_TYPE = 6, +} dfd_dev_tlv_type_t; + +extern int debuglevel; +extern s32 platform_i2c_smbus_read_byte_data(const struct i2c_client *client, u8 command); +extern s32 platform_i2c_smbus_read_i2c_block_data(const struct i2c_client *client, + u8 command, u8 length, u8 *values); +extern s32 platform_i2c_smbus_read_word_data(const struct i2c_client *client, u8 command); + +#define DBG_DEBUG(fmt, arg...) do { \ + if ( debuglevel > DBG_START && debuglevel < DBG_ERROR) { \ + printk(KERN_INFO "[DEBUG]:<%s, %d>:"fmt, __FUNCTION__, __LINE__, ##arg); \ + } else if ( debuglevel >= DBG_ERROR ) { \ + printk(KERN_ERR "[DEBUG]:<%s, %d>:"fmt, __FUNCTION__, __LINE__, ##arg); \ + } else { } \ +} while (0) + +#define DBG_INFO(fmt, arg...) do { \ + if ( debuglevel > DBG_KEY) { \ + printk(KERN_INFO "[INFO]:<%s, %d>:"fmt, __FUNCTION__, __LINE__, ##arg); \ + } \ + } while (0) + +#define DBG_ERROR(fmt, arg...) do { \ + if ( debuglevel > DBG_START) { \ + printk(KERN_ERR "[ERROR]:<%s, %d>:"fmt, __FUNCTION__, __LINE__, ##arg); \ + } \ + } while (0) + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/platform_common_module.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/platform_common_module.c new file mode 100644 index 000000000000..189a3aa056b2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/platform_common_module.c @@ -0,0 +1,210 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,19,152) +#include +#else +#include +#endif +#include +#include +#include +#include +#include "platform_common.h" +#include "dfd_tlveeprom.h" + +#define PLATFORM_I2C_RETRY_TIMES 3 + +#define DFD_TLVEEPROM_I2C_BUS (0) +#define DFD_TLVEEPROM_I2C_ADDR (0x56) +#define DFD_E2PROM_MAX_LEN (256) +#define DFD_CARDTYPE_EXT_TLVLEN (4) + +#define PLATFORM_CARDTYPE_RETRY_CNT (10) +#define PLATFORM_CARDTYPE_RETRY_TIMES (1000) + +int debuglevel = 0; +module_param(debuglevel, int, S_IRUGO | S_IWUSR); + +static int dfd_my_type = 0; +module_param(dfd_my_type, int, S_IRUGO | S_IWUSR); + +int g_common_debug_error = 0; +module_param(g_common_debug_error, int, S_IRUGO | S_IWUSR); + +int g_common_debug_verbose = 0; +module_param(g_common_debug_verbose, int, S_IRUGO | S_IWUSR); + +uint32_t dfd_my_type_i2c_bus = 0; +module_param(dfd_my_type_i2c_bus, int, S_IRUGO | S_IWUSR); + +uint32_t dfd_my_type_i2c_addr = 0; +module_param(dfd_my_type_i2c_addr, int, S_IRUGO | S_IWUSR); + +#define PLATFORM_COMMON_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_common_debug_verbose) { \ + printk(KERN_ERR "[PLATFORM_COMMON][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define PLATFORM_COMMON_DEBUG_ERROR(fmt, args...) do { \ + if (g_common_debug_error) { \ + printk(KERN_ERR "[PLATFORM_COMMON][ERROR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static int32_t dfd_i2c_read(char *dev, uint32_t addr, uint32_t offset_addr, unsigned char * +buf, int32_t size) +{ + struct file *fp; + struct i2c_client client; + int i ,j; + int rv; + s32 val_t; + + val_t = -1; + rv = 0; + fp = filp_open(dev, O_RDWR, S_IRUSR | S_IWUSR); + if (IS_ERR(fp)) { + DBG_ERROR("i2c open fail.\n"); + PLATFORM_COMMON_DEBUG_ERROR("i2c open fail.\n"); + return -1; + } + memcpy(&client, fp->private_data, sizeof(struct i2c_client)); + client.addr = addr; + for (j = 0 ;j < size ;j++){ + for (i = 0; i < PLATFORM_I2C_RETRY_TIMES; i++) { + if ((val_t = i2c_smbus_read_byte_data(&client, (offset_addr + j)))< 0) { + DBG_DEBUG("read try(%d)time offset_addr:%x \n", i, offset_addr); + continue; + } else { + * (buf + j) = val_t; + break; + } + } + if (val_t < 0) { + rv = -1; + break; + } + } + filp_close(fp, NULL); + return rv; +} + +static int dfd_tlvinfo_get_cardtype(void) +{ + char i2c_path[16] = {0}; + int ret; + int cardtype; + u_int8_t eeprom[DFD_E2PROM_MAX_LEN]; + dfd_i2c_dev_t i2c_dev; + uint8_t buf[DFD_CARDTYPE_EXT_TLVLEN]; + uint8_t len; + dfd_tlv_type_t tlv_type; + + if (dfd_my_type_i2c_bus != 0) { + i2c_dev.bus = dfd_my_type_i2c_bus; + } else { + i2c_dev.bus = DFD_TLVEEPROM_I2C_BUS; + } + + if (dfd_my_type_i2c_addr != 0) { + i2c_dev.addr = dfd_my_type_i2c_addr; + } else { + i2c_dev.addr = DFD_TLVEEPROM_I2C_ADDR; + } + snprintf(i2c_path, sizeof(i2c_path), "/dev/i2c-%d", i2c_dev.bus); + PLATFORM_COMMON_DEBUG_VERBOSE("Read device eeprom info:(dev:%s, addr:%02x).\n", i2c_path, i2c_dev.addr); + + ret = dfd_i2c_read(i2c_path, i2c_dev.addr, 0, eeprom, DFD_E2PROM_MAX_LEN); + if (ret != 0) { + DBG_ERROR("Read eeprom info error(dev: %s, addr: %02x).\n", i2c_path, i2c_dev.addr); + PLATFORM_COMMON_DEBUG_ERROR("Read eeprom info error(dev: %s, addr: %02x).\n", i2c_path, i2c_dev.addr); + return ret; + } + + tlv_type.main_type = TLV_CODE_VENDOR_EXT; + tlv_type.ext_type = DFD_TLVINFO_EXT_TLV_TYPE_DEV_TYPE; + len = sizeof(buf); + mem_clear(buf, len); + ret = dfd_tlvinfo_get_e2prom_info(eeprom, DFD_E2PROM_MAX_LEN, &tlv_type, buf, &len); + if (ret) { + DBG_ERROR("dfd_tlvinfo_get_e2prom_info failed ret %d.\n", ret); + return -1; + } + for (ret = 0; ret < 4; ret++) { + DBG_DEBUG("buf 0x%02x.\n", buf[ret]); + } + + cardtype = ntohl(*((uint32_t *)buf)); + DBG_DEBUG("cardtype 0x%x.\n", cardtype); + return cardtype; +} + +static int __dfd_get_my_card_type(void) +{ + return dfd_tlvinfo_get_cardtype(); +} + +int dfd_get_my_card_type(void) +{ + int type; + int cnt; + + if (dfd_my_type != 0) { + DBG_DEBUG("my_type = 0x%x\r\n", dfd_my_type); + return dfd_my_type; + } + + cnt = PLATFORM_CARDTYPE_RETRY_CNT; + while (cnt--) { + type = __dfd_get_my_card_type(); + if (type < 0) { + PLATFORM_COMMON_DEBUG_ERROR("__dfd_get_my_card_type fail cnt %d, ret %d.\n", cnt, type); + msleep(PLATFORM_CARDTYPE_RETRY_TIMES); + continue; + } + PLATFORM_COMMON_DEBUG_VERBOSE("success to get type 0x%x.\n", type); + break; + } + + dfd_my_type = type; + return dfd_my_type; +} +EXPORT_SYMBOL(dfd_get_my_card_type); + +static int __init platform_common_init(void) +{ + int ret; + + PLATFORM_COMMON_DEBUG_VERBOSE("Enter.\n"); + ret = dfd_get_my_card_type(); + if (ret <= 0) { + PLATFORM_COMMON_DEBUG_ERROR("dfd_get_my_card_type failed, ret %d.\n", ret); + printk(KERN_ERR "Warning: Device type get failed, please check the TLV-EEPROM!\n"); + return -1; + } + + PLATFORM_COMMON_DEBUG_VERBOSE("Leave success type 0x%x.\n", ret); + return 0; +} + +static void __exit platform_common_exit(void) +{ + PLATFORM_COMMON_DEBUG_VERBOSE("Exit.\n"); +} + +module_init(platform_common_init); +module_exit(platform_common_exit); + +MODULE_DESCRIPTION("Platform Support"); +MODULE_AUTHOR("support"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_i2c_bus_drv.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_i2c_bus_drv.c new file mode 100644 index 000000000000..22cd9e16de08 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_i2c_bus_drv.c @@ -0,0 +1,1135 @@ +/* + * fpga_i2c_bus_drv.c + * ko to create fpga i2c adapter + */ +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) +#include +#endif +#include +#include +#include +#include +#include +#include +#include "fpga_i2c.h" + +#include +#include +#include + +#define DRV_NAME "wb-fpga-i2c" +#define DRV_VERSION "1.0" +#define DTS_NO_CFG_FLAG (0) + +extern int i2c_device_func_write(const char *path, uint32_t pos, uint8_t *val, size_t size); +extern int i2c_device_func_read(const char *path, uint32_t pos, uint8_t *val, size_t size); +extern int pcie_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int pcie_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int io_device_func_write(const char *path, uint32_t pos, uint8_t *val, size_t size); +extern int io_device_func_read(const char *path, uint32_t pos, uint8_t *val, size_t size); +extern int spi_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int spi_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); + +#define FPGA_I2C_STRETCH_TIMEOUT (0x01) +#define FPGA_I2C_DEADLOCK_FAILED (0x02) +#define FPGA_I2C_SLAVE_NO_RESPOND (0x03) +#define FPGA_I2C_STA_FAIL (0x01) +#define FPGA_I2C_STA_BUSY (0x02) +#define FPGA_I2C_CTL_BG (0x01 << 1) +#define FPGA_I2C_CTL_NO_REG (0x01 << 2) +#define FPGA_I2C_CTL_RD (0x01) +#define FPGA_I2C_CTL_WR (0x00) +#define I2C_READ_MSG_NUM (0x02) +#define I2C_WRITE_MSG_NUM (0x01) +#define FPGA_REG_WIDTH (4) + +#define SYMBOL_I2C_DEV_MODE (1) +#define FILE_MODE (2) +#define SYMBOL_PCIE_DEV_MODE (3) +#define SYMBOL_IO_DEV_MODE (4) +#define SYMBOL_SPI_DEV_MODE (5) + +int g_wb_fpga_i2c_debug = 0; +int g_wb_fpga_i2c_error = 0; + +module_param(g_wb_fpga_i2c_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_fpga_i2c_error, int, S_IRUGO | S_IWUSR); + +#define FPGA_I2C_VERBOSE(fmt, args...) do { \ + if (g_wb_fpga_i2c_debug) { \ + printk(KERN_INFO "[FPFA_I2C_BUS][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define FPGA_I2C_ERROR(fmt, args...) do { \ + if (g_wb_fpga_i2c_error) { \ + printk(KERN_ERR "[FPFA_I2C_BUS][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static int fpga_file_read(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDONLY, 0); + if (IS_ERR(filp)) { + FPGA_I2C_ERROR("read open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_DEST, &iov, 1, iov.iov_len); + ret = vfs_iter_read(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + FPGA_I2C_ERROR("vfs_iter_read failed, path=%s, addr=0x%x, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int fpga_file_write(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDWR, 777); + if (IS_ERR(filp)) { + FPGA_I2C_ERROR("write open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_SOURCE, &iov, 1, iov.iov_len); + ret = vfs_iter_write(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + FPGA_I2C_ERROR("vfs_iter_write failed, path=%s, addr=0x%x, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + vfs_fsync(filp, 1); + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int fpga_device_write(fpga_i2c_dev_t *fpga_i2c, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + + switch (fpga_i2c->i2c_func_mode) { + case SYMBOL_I2C_DEV_MODE: + ret = i2c_device_func_write(fpga_i2c->dev_name, pos, val, size); + break; + case FILE_MODE: + ret = fpga_file_write(fpga_i2c->dev_name, pos, val, size); + break; + case SYMBOL_PCIE_DEV_MODE: + ret = pcie_device_func_write(fpga_i2c->dev_name, pos, val, size); + break; + case SYMBOL_IO_DEV_MODE: + ret = io_device_func_write(fpga_i2c->dev_name, pos, val, size); + break; + case SYMBOL_SPI_DEV_MODE: + ret = spi_device_func_write(fpga_i2c->dev_name, pos, val, size); + break; + default: + FPGA_I2C_ERROR("err func_mode %d, write failed.\n", fpga_i2c->i2c_func_mode); + return -EINVAL; + } + return ret; + +} + +static int fpga_device_read(fpga_i2c_dev_t *fpga_i2c, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + + switch (fpga_i2c->i2c_func_mode) { + case SYMBOL_I2C_DEV_MODE: + ret = i2c_device_func_read(fpga_i2c->dev_name, pos, val, size); + break; + case FILE_MODE: + ret = fpga_file_read(fpga_i2c->dev_name, pos, val, size); + break; + case SYMBOL_PCIE_DEV_MODE: + ret = pcie_device_func_read(fpga_i2c->dev_name, pos, val, size); + break; + case SYMBOL_IO_DEV_MODE: + ret = io_device_func_read(fpga_i2c->dev_name, pos, val, size); + break; + case SYMBOL_SPI_DEV_MODE: + ret = spi_device_func_read(fpga_i2c->dev_name, pos, val, size); + break; + default: + FPGA_I2C_ERROR("err func_mode %d, read failed.\n", fpga_i2c->i2c_func_mode); + return -EINVAL; + } + + return ret; +} + +static int little_endian_dword_to_buf(uint8_t *buf, int len, uint32_t dword) +{ + uint8_t tmp_buf[FPGA_REG_WIDTH]; + + if (len < 4) { + FPGA_I2C_ERROR("Not enough buf, dword to buf: len[%d], dword[0x%x]\n", len, dword); + return -1; + } + + mem_clear(tmp_buf, sizeof(tmp_buf)); + tmp_buf[0] = dword & 0xff; + tmp_buf[1] = (dword >> 8) & 0xff; + tmp_buf[2] = (dword >> 16) & 0xff; + tmp_buf[3] = (dword >> 24) & 0xff; + + memcpy(buf, tmp_buf, sizeof(tmp_buf)); + + return 0; +} + +static int little_endian_buf_to_dword(uint8_t *buf, int len, uint32_t *dword) +{ + int i; + uint32_t dword_tmp; + + if (len != FPGA_REG_WIDTH) { + FPGA_I2C_ERROR("buf length %d error, can't convert to dowrd.\n", len); + return -1; + } + dword_tmp = 0; + for (i = 0; i < FPGA_REG_WIDTH; i++) { + dword_tmp |= (buf[i] << (i * 8)); + } + *dword = dword_tmp; + return 0; +} + +static int fpga_reg_write(fpga_i2c_dev_t *fpga_i2c, uint32_t addr, uint8_t val) +{ + int ret; + + ret = fpga_device_write(fpga_i2c, addr, &val, sizeof(uint8_t)); + if (ret < 0) { + FPGA_I2C_ERROR("fpga reg write failed, dev name:%s, offset:0x%x, value:0x%x.\n", + fpga_i2c->dev_name, addr, val); + return -EIO; + } + + FPGA_I2C_VERBOSE("fpga reg write success, dev name:%s, offset:0x%x, value:0x%x.\n", + fpga_i2c->dev_name, addr, val); + return 0; +} + +static int fpga_reg_read(fpga_i2c_dev_t *fpga_i2c, uint32_t addr, uint8_t *val) +{ + int ret; + + ret = fpga_device_read(fpga_i2c, addr, val, sizeof(uint8_t)); + if (ret < 0) { + FPGA_I2C_ERROR("fpga reg read failed, dev name:%s, offset:0x%x\n", + fpga_i2c->dev_name, addr); + return -EIO; + } + + FPGA_I2C_VERBOSE("fpga reg read success, dev name:%s, offset:0x%x, value:0x%x.\n", + fpga_i2c->dev_name, addr, *val); + return 0; +} + +static int fpga_data_write(fpga_i2c_dev_t *fpga_i2c, uint32_t addr, uint8_t *val, size_t size) +{ + int ret; + + ret = fpga_device_write(fpga_i2c, addr, val, size); + if (ret < 0) { + FPGA_I2C_ERROR("fpga data write failed, dev name:%s, offset:0x%x, size:%lu.\n", + fpga_i2c->dev_name, addr, size); + return -EIO; + } + + FPGA_I2C_VERBOSE("fpga data write success, dev name:%s, offset:0x%x, size:%lu.\n", + fpga_i2c->dev_name, addr, size); + return 0; +} + +static int fpga_data_read(fpga_i2c_dev_t *fpga_i2c, uint32_t addr, uint8_t *val, size_t size) +{ + int ret; + + ret = fpga_device_read(fpga_i2c, addr, val, size); + if (ret < 0) { + FPGA_I2C_ERROR("fpga data read failed, dev name:%s, offset:0x%x, size:%lu.\n", + fpga_i2c->dev_name, addr, size); + return -EIO; + } + + FPGA_I2C_VERBOSE("fpga data read success, dev name:%s, offset:0x%x, size:%lu.\n", + fpga_i2c->dev_name, addr, size); + return 0; +} + +static int fpga_reg_write_32(fpga_i2c_dev_t *fpga_i2c, uint32_t addr, uint32_t val) +{ + int ret; + uint8_t buf[FPGA_REG_WIDTH]; + + mem_clear(buf, sizeof(buf)); + little_endian_dword_to_buf(buf, sizeof(buf), val); + ret = fpga_device_write(fpga_i2c, addr, buf, sizeof(buf)); + if (ret < 0) { + FPGA_I2C_ERROR("fpga reg write failed, dev name: %s, offset: 0x%x, value: 0x%x.\n", + fpga_i2c->dev_name, addr, val); + return -EIO; + } + + FPGA_I2C_VERBOSE("fpga reg write success, dev name: %s, offset: 0x%x, value: 0x%x.\n", + fpga_i2c->dev_name, addr, val); + return 0; +} + +static int fpga_reg_read_32(fpga_i2c_dev_t *fpga_i2c, uint32_t addr, uint32_t *val) +{ + int ret; + uint8_t buf[FPGA_REG_WIDTH]; + + mem_clear(buf, sizeof(buf)); + ret = fpga_device_read(fpga_i2c, addr, buf, sizeof(buf)); + if (ret < 0) { + FPGA_I2C_ERROR("fpga reg read failed, dev name: %s, offset: 0x%x, ret: %d\n", + fpga_i2c->dev_name, addr, ret); + return -EIO; + } + little_endian_buf_to_dword(buf, sizeof(buf), val); + FPGA_I2C_VERBOSE("fpga reg read success, dev name: %s, offset: 0x%x, value: 0x%x.\n", + fpga_i2c->dev_name, addr, *val); + return 0; +} + +static int fpga_i2c_is_busy(fpga_i2c_dev_t *fpga_i2c) +{ + uint8_t val; + int ret; + fpga_i2c_reg_t *reg; + + reg = &fpga_i2c->reg; + ret = fpga_reg_read(fpga_i2c, reg->i2c_status, &val); + if (ret < 0 ) { + FPGA_I2C_ERROR("read fpga i2c status reg failed, reg addr:0x%x, ret:%d.\n", + reg->i2c_status, ret); + return 1; + } + if (val & FPGA_I2C_STA_BUSY) { + FPGA_I2C_ERROR("fpga i2c status busy, reg addr:0x%x, value:0x%x.\n", + reg->i2c_status, val); + return 1; + } else { + return 0; + } +} + +static int fpga_i2c_wait(fpga_i2c_dev_t *fpga_i2c) +{ + int retry_cnt; + + retry_cnt = FPGA_I2C_XFER_TIME_OUT/FPGA_I2C_SLEEP_TIME; + while (retry_cnt--) { + if (fpga_i2c_is_busy(fpga_i2c)) { + usleep_range(FPGA_I2C_SLEEP_TIME, FPGA_I2C_SLEEP_TIME + 1); + } else { + return 0; + } + } + + return -EBUSY; +} + +static int fpga_i2c_check_status(fpga_i2c_dev_t *fpga_i2c) +{ + uint8_t data; + int ret; + fpga_i2c_reg_t *reg; + + reg = &fpga_i2c->reg; + + ret = fpga_reg_read(fpga_i2c, reg->i2c_status, &data); + if (ret) { + FPGA_I2C_ERROR("read fpga i2c status reg failed, reg addr:0x%x, ret:%d.\n", + reg->i2c_status, ret); + return ret; + } + + if (data & FPGA_I2C_STA_FAIL) { + FPGA_I2C_ERROR("fpga i2c status error, reg addr:0x%x, value:%d.\n", + reg->i2c_status, data); + + /* read i2c_err_vec to confirm err type*/ + if (reg->i2c_err_vec != DTS_NO_CFG_FLAG) { + /* read i2c_err_vec reg */ + ret = fpga_reg_read(fpga_i2c, reg->i2c_err_vec, &data); + if (ret) { + FPGA_I2C_ERROR("read fpga i2c err vec reg failed, reg addr:0x%x, ret:%d.\n", + reg->i2c_err_vec, ret); + return ret; + } + FPGA_I2C_VERBOSE("get i2c err vec, reg addr:0x%x, read value:0x%x\n", reg->i2c_err_vec, data); + + /* match i2c_err_vec reg value and err type*/ + switch (data) { + case FPGA_I2C_STRETCH_TIMEOUT: + ret = -ETIMEDOUT; + break; + case FPGA_I2C_DEADLOCK_FAILED: + ret = -EDEADLK; + break; + case FPGA_I2C_SLAVE_NO_RESPOND: + ret = -ENXIO; + break; + default: + FPGA_I2C_ERROR("get i2c err vec value out of range, reg addr:0x%x, read value:0x%x\n", + reg->i2c_err_vec, data); + ret = -EREMOTEIO; + break; + } + return ret; + } else { + FPGA_I2C_VERBOSE("i2c err vec not config, fpga i2c status check return -1\n"); + return -EREMOTEIO; + } + } + return 0; +} + +static int fpga_i2c_do_work(fpga_i2c_dev_t *fpga_i2c, int i2c_addr, + unsigned char *data, uint32_t length, int is_read) +{ + int ret, i; + uint8_t op, i2c_reg_addr_len; + uint8_t *i2c_read_addr_buf; + fpga_i2c_reg_t *reg; + fpga_i2c_reg_addr_t *i2c_addr_desc; + + reg = &fpga_i2c->reg; + + ret = fpga_reg_write(fpga_i2c, reg->i2c_slave, i2c_addr); + if (ret) { + FPGA_I2C_ERROR("write fpga i2c slave reg failed, reg addr:0x%x, value:0x%x, ret:%d.\n", + reg->i2c_slave, i2c_addr, ret); + goto exit; + } + + i2c_addr_desc = &fpga_i2c->i2c_addr_desc; + i2c_reg_addr_len = i2c_addr_desc->reg_addr_len; + i2c_read_addr_buf = &i2c_addr_desc->read_reg_addr[0]; + + if (i2c_reg_addr_len > 0 && i2c_reg_addr_len <= I2C_REG_MAX_WIDTH) { + ret = fpga_data_write(fpga_i2c, reg->i2c_reg, i2c_read_addr_buf, i2c_reg_addr_len); + if (ret) { + FPGA_I2C_ERROR("write fpga i2c offset reg failed, fpga addr:0x%x, reg len:%d, ret:%d\n", + reg->i2c_reg, i2c_reg_addr_len, ret); + for (i = 0; i < i2c_reg_addr_len; i++) { + FPGA_I2C_ERROR("%02d : %02x\n", i, i2c_read_addr_buf[i]); + } + goto exit; + } + } + + ret = fpga_reg_write_32(fpga_i2c, reg->i2c_data_len, length); + if (ret) { + FPGA_I2C_ERROR("write fpga i2c date len reg failed, reg addr:0x%x, value:0x%x, ret:%d.\n", + reg->i2c_data_len, length, ret); + goto exit; + } + + ret = fpga_reg_write(fpga_i2c, reg->i2c_reg_len, i2c_reg_addr_len); + if (ret) { + FPGA_I2C_ERROR("write fpga i2c reg len reg failed, reg addr:0x%x, value:0x%x, ret:%d.\n", + reg->i2c_reg_len, i2c_reg_addr_len, ret); + goto exit; + } + + if (is_read) { + op = FPGA_I2C_CTL_RD | FPGA_I2C_CTL_BG; + } else { + + ret = fpga_data_write(fpga_i2c, reg->i2c_data_buf, data, length); + if (ret) { + FPGA_I2C_ERROR("write fpga i2c date buf failed, reg addr:0x%x, write len:%d, ret:%d.\n", + reg->i2c_data_buf, length, ret); + goto exit; + } + op = FPGA_I2C_CTL_WR | FPGA_I2C_CTL_BG ; + } + + ret = fpga_reg_write(fpga_i2c, reg->i2c_ctrl, op); + if (ret) { + FPGA_I2C_ERROR("write fpga i2c control reg failed, reg addr:0x%x, value:%d, ret:%d.\n", + reg->i2c_ctrl, op, ret); + goto exit; + } + + ret = fpga_i2c_wait(fpga_i2c); + if (ret) { + FPGA_I2C_ERROR("wait fpga i2c status timeout.\n"); + goto exit; + } + + ret = fpga_i2c_check_status(fpga_i2c); + if (ret) { + FPGA_I2C_ERROR("check fpga i2c status error.\n"); + goto exit; + } + + if (is_read) { + + ret = fpga_data_read(fpga_i2c, reg->i2c_data_buf, data, length); + if (ret) { + FPGA_I2C_ERROR("read fpga i2c data buf failed, reg addr:0x%x, read len:%d, ret:%d.\n", + reg->i2c_data_buf, length, ret); + goto exit; + } + } + +exit: + return ret; +} + +static int fpga_i2c_write(fpga_i2c_dev_t *fpga_i2c, int target, + u8 *data, int length, int i2c_msg_num) +{ + int ret, i; + fpga_i2c_reg_addr_t *i2c_addr_desc; + + if (i2c_msg_num == I2C_READ_MSG_NUM) { + + if (length > I2C_REG_MAX_WIDTH) { + FPGA_I2C_ERROR("read reg addr len %d, more than max length.\n", length); + return -EINVAL; + } + + i2c_addr_desc = &fpga_i2c->i2c_addr_desc; + for (i = 0; i < length; i++) { + i2c_addr_desc->read_reg_addr[i] = data[length -i -1]; + FPGA_I2C_VERBOSE("%02d : %02x\n", i, i2c_addr_desc->read_reg_addr[i]); + } + i2c_addr_desc->reg_addr_len = length; + ret = 0; + } else { + + ret = fpga_i2c_do_work(fpga_i2c, target, data, length, 0); + } + + return ret; +} + +/** + * fpga_i2c_read - receive data from the bus. + * @i2c: The struct fpga_i2c_dev_t. + * @target: Target address. + * @data: Pointer to the location to store the datae . + * @length: Length of the data. + * + * The address is sent over the bus, then the data is read. + * + * Returns 0 on success, otherwise a negative errno. + */ +static int fpga_i2c_read(fpga_i2c_dev_t *fpga_i2c, int target, + u8 *data, int length) +{ + int ret, offset_size; + int i, tmp_val; + fpga_i2c_reg_addr_t *i2c_addr_desc; + uint8_t i2c_reg_addr_len; + uint8_t *i2c_read_addr_buf; + + offset_size = 0; + i2c_addr_desc = &fpga_i2c->i2c_addr_desc; + i2c_reg_addr_len = i2c_addr_desc->reg_addr_len; + i2c_read_addr_buf = &i2c_addr_desc->read_reg_addr[0]; + + while (1) { + if (length <= fpga_i2c->reg.i2c_data_buf_len) { + return fpga_i2c_do_work(fpga_i2c, target, data + offset_size, length, 1); + } + + ret = fpga_i2c_do_work(fpga_i2c, target, data + offset_size, fpga_i2c->reg.i2c_data_buf_len, 1); + if (ret != 0) { + FPGA_I2C_ERROR("fpga_i2c_read failed, i2c addr:0x%x, offset:0x%x, ret:%d.\n", + target, offset_size, ret); + return ret; + } + + tmp_val = i2c_read_addr_buf[0]; + tmp_val += fpga_i2c->reg.i2c_data_buf_len; + if (tmp_val > 0xff) { + i2c_read_addr_buf[0] = tmp_val & 0xff; + for (i = 1; i < i2c_reg_addr_len; i++) { + if (i2c_read_addr_buf[i] == 0xff) { + i2c_read_addr_buf[i] = 0; + } else { + i2c_read_addr_buf[i]++; + break; + } + } + } else { + i2c_read_addr_buf[0] = tmp_val & 0xff; + } + offset_size += fpga_i2c->reg.i2c_data_buf_len; + length -= fpga_i2c->reg.i2c_data_buf_len; + } + + return ret; +} + +static void fpga_i2c_reset(fpga_i2c_dev_t *fpga_i2c) { + fpga_i2c_reset_cfg_t *reset_cfg; + uint32_t reset_addr; + + reset_cfg = &fpga_i2c->reset_cfg; + reset_addr = reset_cfg->reset_addr; + if (reset_cfg->reset_delay_b) { + usleep_range(reset_cfg->reset_delay_b, reset_cfg->reset_delay_b + 1); + } + + fpga_reg_write_32(fpga_i2c, reset_addr, reset_cfg->reset_on); + if (reset_cfg->reset_delay) { + usleep_range(reset_cfg->reset_delay, reset_cfg->reset_delay + 1); + } + + fpga_reg_write_32(fpga_i2c, reset_addr, reset_cfg->reset_off); + if (reset_cfg->reset_delay_a) { + usleep_range(reset_cfg->reset_delay_a, reset_cfg->reset_delay_a + 1); + } + + return; +} + +/** + * fpga_i2c_xfer - The driver's master_xfer function. + * @adap: Pointer to the i2c_adapter structure. + * @msgs: Pointer to the messages to be processed. + * @num: Length of the MSGS array. + * + * Returns the number of messages processed, or a negative errno on + * failure. + */ +static int fpga_i2c_adapter_init(fpga_i2c_dev_t *fpga_i2c) +{ + int ret; + fpga_i2c_reg_t *reg; + + reg = &fpga_i2c->reg; + + ret = 0; + ret += fpga_reg_write(fpga_i2c, reg->i2c_scale, fpga_i2c->i2c_scale_value); + ret += fpga_reg_write(fpga_i2c, reg->i2c_filter, fpga_i2c->i2c_filter_value); + ret += fpga_reg_write(fpga_i2c, reg->i2c_stretch, fpga_i2c->i2c_stretch_value); + if (ret < 0) { + FPGA_I2C_ERROR("fpga_i2c_init failed.\n"); + return ret; + } + + FPGA_I2C_VERBOSE("fpga_i2c_init ok.\n"); + return 0; +} + +static int fpga_i2c_params_check(fpga_i2c_dev_t *fpga_i2c) +{ + int ret; + fpga_i2c_reg_t *reg; + uint8_t i2c_scale_value, i2c_filter_value, i2c_stretch_value; + + reg = &fpga_i2c->reg; + ret = 0; + ret += fpga_reg_read(fpga_i2c, reg->i2c_scale, &i2c_scale_value); + ret += fpga_reg_read(fpga_i2c, reg->i2c_filter, &i2c_filter_value); + ret += fpga_reg_read(fpga_i2c, reg->i2c_stretch, &i2c_stretch_value); + if (ret < 0) { + FPGA_I2C_ERROR("read fpga i2c params failed.\n"); + return 1; + } + + if ((i2c_scale_value != fpga_i2c->i2c_scale_value) + || (i2c_filter_value != fpga_i2c->i2c_filter_value) + || (i2c_stretch_value != fpga_i2c->i2c_stretch_value)) { + FPGA_I2C_ERROR("fpga i2c params check error, read value: i2c_scale 0x%x, i2c_filter:0x%x, i2c_stretch:0x%x.\n", + i2c_scale_value, i2c_filter_value, i2c_stretch_value); + FPGA_I2C_ERROR("fpga i2c params check error, config value: i2c_scale 0x%x, i2c_filter:0x%x, i2c_stretch:0x%x.\n", + fpga_i2c->i2c_scale_value, fpga_i2c->i2c_filter_value, fpga_i2c->i2c_stretch_value); + return 1; + } + + FPGA_I2C_VERBOSE("fpga i2c params check ok.\n"); + return 0; +} + +static int fpga_i2c_xfer(struct i2c_adapter *adap, + struct i2c_msg *msgs, int num) +{ + struct i2c_msg *pmsg; + int i; + int ret; + fpga_i2c_dev_t *fpga_i2c; + fpga_i2c_reg_addr_t *i2c_addr_desc; + + fpga_i2c = i2c_get_adapdata(adap); + + if (num != I2C_READ_MSG_NUM && num != I2C_WRITE_MSG_NUM) { + FPGA_I2C_ERROR("unsupport i2c_msg len:%d.\n", num); + return -EINVAL; + } + + if ((num == I2C_WRITE_MSG_NUM) && (msgs[0].len > fpga_i2c->reg.i2c_data_buf_len)) { + FPGA_I2C_ERROR("unsupport i2c_msg type:msg[0].flag:0x%x, buf len:0x%x.\n", + msgs[0].flags, msgs[0].len); + return -EINVAL; + } + + if (num == I2C_READ_MSG_NUM ) { + if ((msgs[0].flags & I2C_M_RD) ||!(msgs[1].flags & I2C_M_RD)) { + FPGA_I2C_ERROR("unsupport i2c_msg type:msg[0].flag:0x%x, msg[1].flag:0x%x.\n", + msgs[0].flags, msgs[1].flags); + return -EINVAL; + } + } + + if (fpga_i2c_is_busy(fpga_i2c)) { + FPGA_I2C_ERROR("fpga i2c adapter %d is busy, do reset.\n", adap->nr); + if (fpga_i2c->reset_cfg.i2c_adap_reset_flag == 1) { + + fpga_i2c_reset(fpga_i2c); + + fpga_i2c_adapter_init(fpga_i2c); + } + return -EAGAIN; + } + + if (fpga_i2c->i2c_params_check && fpga_i2c_params_check(fpga_i2c)) { + FPGA_I2C_ERROR("fpga i2c params check failed, try to reinitialize.\n"); + fpga_i2c_adapter_init(fpga_i2c); + } + + ret = 0; + i2c_addr_desc = &fpga_i2c->i2c_addr_desc; + i2c_addr_desc->reg_addr_len = 0; + mem_clear(i2c_addr_desc->read_reg_addr, sizeof(i2c_addr_desc->read_reg_addr)); + + for (i = 0; ret == 0 && i < num; i++) { + pmsg = &msgs[i]; + FPGA_I2C_VERBOSE("Doing %s %d byte(s) to/from 0x%02x - %d of %d messages\n", + pmsg->flags & I2C_M_RD ? "read" : "write", pmsg->len, pmsg->addr, i + 1, num); + + if (pmsg->flags & I2C_M_RD) { + ret = fpga_i2c_read(fpga_i2c, pmsg->addr, pmsg->buf, pmsg->len); + + if ((pmsg->len == 1) && (pmsg->flags & I2C_M_RECV_LEN)) { + if ((ret != 0) || (pmsg->buf[0] > I2C_SMBUS_BLOCK_MAX)) { + FPGA_I2C_ERROR("smbus block data read failed, ret:%d, read len:%u.\n", + ret, pmsg->buf[0]); + return -EPROTO; + } + pmsg->len = 1 + pmsg->buf[0]; + FPGA_I2C_VERBOSE("smbus block data read, read len:%d.\n", pmsg->len); + ret = fpga_i2c_read(fpga_i2c, pmsg->addr, pmsg->buf, pmsg->len); + } + } else { + ret = fpga_i2c_write(fpga_i2c, pmsg->addr, pmsg->buf, pmsg->len, num); + } + } + + return (ret != 0) ? ret : num; +} + +static u32 fpga_i2c_functionality(struct i2c_adapter *adap) +{ + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_SMBUS_BLOCK_DATA; +} + +static const struct i2c_algorithm fpga_i2c_algo = { + .master_xfer = fpga_i2c_xfer, + .functionality = fpga_i2c_functionality, +}; + +static struct i2c_adapter fpga_i2c_ops = { + .owner = THIS_MODULE, + .name = "wb_fpga_i2c", + .algo = &fpga_i2c_algo, +}; + +static int fpga_i2c_config_init(fpga_i2c_dev_t *fpga_i2c) +{ + int ret = 0, rv = 0; + fpga_i2c_reg_t *reg; + fpga_i2c_reset_cfg_t *reset_cfg; + struct device *dev; + uint32_t i2c_offset_reg, i2c_data_buf_len_reg; + int32_t i2c_offset_val; + + fpga_i2c_bus_device_t *fpga_i2c_bus_device; + + dev = fpga_i2c->dev; + reg = &fpga_i2c->reg; + reset_cfg = &fpga_i2c->reset_cfg; + + i2c_offset_val = 0; + + if (dev->of_node) { + ret = 0; + ret += of_property_read_u32(dev->of_node, "i2c_ext_9548_addr", ®->i2c_ext_9548_addr); + ret += of_property_read_u32(dev->of_node, "i2c_ext_9548_chan", ®->i2c_ext_9548_chan); + ret += of_property_read_u32(dev->of_node, "i2c_slave", ®->i2c_slave); + ret += of_property_read_u32(dev->of_node, "i2c_reg", ®->i2c_reg); + ret += of_property_read_u32(dev->of_node, "i2c_data_len", ®->i2c_data_len); + ret += of_property_read_u32(dev->of_node, "i2c_ctrl", ®->i2c_ctrl); + ret += of_property_read_u32(dev->of_node, "i2c_status", ®->i2c_status); + ret += of_property_read_u32(dev->of_node, "i2c_scale", ®->i2c_scale); + ret += of_property_read_u32(dev->of_node, "i2c_filter", ®->i2c_filter); + ret += of_property_read_u32(dev->of_node, "i2c_stretch", ®->i2c_stretch); + ret += of_property_read_u32(dev->of_node, "i2c_ext_9548_exits_flag", ®->i2c_ext_9548_exits_flag); + ret += of_property_read_u32(dev->of_node, "i2c_reg_len", ®->i2c_reg_len); + ret += of_property_read_u32(dev->of_node, "i2c_in_9548_chan", ®->i2c_in_9548_chan); + ret += of_property_read_u32(dev->of_node, "i2c_data_buf", ®->i2c_data_buf); + ret += of_property_read_string(dev->of_node, "dev_name", &fpga_i2c->dev_name); + ret += of_property_read_u32(dev->of_node, "i2c_scale_value", &fpga_i2c->i2c_scale_value); + ret += of_property_read_u32(dev->of_node, "i2c_filter_value", &fpga_i2c->i2c_filter_value); + ret += of_property_read_u32(dev->of_node, "i2c_stretch_value", &fpga_i2c->i2c_stretch_value); + ret += of_property_read_u32(dev->of_node, "i2c_timeout", &fpga_i2c->i2c_timeout); + ret += of_property_read_u32(dev->of_node, "i2c_func_mode", &fpga_i2c->i2c_func_mode); + ret += of_property_read_u32(dev->of_node, "i2c_reset_addr", &reset_cfg->reset_addr); + ret += of_property_read_u32(dev->of_node, "i2c_reset_on", &reset_cfg->reset_on); + ret += of_property_read_u32(dev->of_node, "i2c_reset_off", &reset_cfg->reset_off); + ret += of_property_read_u32(dev->of_node, "i2c_rst_delay_b", &reset_cfg->reset_delay_b); + ret += of_property_read_u32(dev->of_node, "i2c_rst_delay", &reset_cfg->reset_delay); + ret += of_property_read_u32(dev->of_node, "i2c_rst_delay_a", &reset_cfg->reset_delay_a); + ret += of_property_read_u32(dev->of_node, "i2c_adap_reset_flag", &reset_cfg->i2c_adap_reset_flag); + + if (ret != 0) { + FPGA_I2C_ERROR("dts config error, ret:%d.\n", ret); + ret = -ENXIO; + return ret; + } + + rv = of_property_read_u32(dev->of_node, "i2c_data_buf_len_reg", &i2c_data_buf_len_reg); + if (rv == 0) { + ret = fpga_reg_read_32(fpga_i2c, i2c_data_buf_len_reg, ®->i2c_data_buf_len); + if (ret < 0) { + dev_err(fpga_i2c->dev, "Failed to get fpga i2c data buf length, reg addr: 0x%x, ret: %d\n", + i2c_data_buf_len_reg, ret); + return ret; + } + FPGA_I2C_VERBOSE("fpga i2c data buf length reg addr: 0x%x, value: %d\n", + i2c_data_buf_len_reg, reg->i2c_data_buf_len); + if (reg->i2c_data_buf_len == 0) { + reg->i2c_data_buf_len = FPGA_I2C_RDWR_MAX_LEN_DEFAULT; + } + } else { + ret = of_property_read_u32(dev->of_node, "i2c_data_buf_len", ®->i2c_data_buf_len); + if (ret != 0) { + reg->i2c_data_buf_len = FPGA_I2C_RDWR_MAX_LEN_DEFAULT; + ret = 0; + } + } + + rv = of_property_read_u32(dev->of_node, "i2c_offset_reg", &i2c_offset_reg); + if (rv == 0) { + ret = fpga_reg_read_32(fpga_i2c, i2c_offset_reg, &i2c_offset_val); + if (ret < 0) { + dev_err(fpga_i2c->dev, "Failed to get fpga i2c adapter offset value, reg addr: 0x%x, ret: %d\n", + i2c_offset_reg, ret); + return ret; + } + FPGA_I2C_VERBOSE("fpga i2c adapter offset reg addr: 0x%x, value: %d\n", + i2c_offset_reg, i2c_offset_val); + reg->i2c_scale +=i2c_offset_val; + reg->i2c_filter += i2c_offset_val; + reg->i2c_stretch += i2c_offset_val; + reg->i2c_ext_9548_exits_flag += i2c_offset_val; + reg->i2c_ext_9548_addr += i2c_offset_val; + reg->i2c_ext_9548_chan += i2c_offset_val; + reg->i2c_in_9548_chan += i2c_offset_val; + reg->i2c_slave += i2c_offset_val; + reg->i2c_reg += i2c_offset_val; + reg->i2c_reg_len += i2c_offset_val; + reg->i2c_data_len += i2c_offset_val; + reg->i2c_ctrl += i2c_offset_val; + reg->i2c_status += i2c_offset_val; + reg->i2c_data_buf += i2c_offset_val; + } + + ret = of_property_read_u32(dev->of_node, "i2c_err_vec", ®->i2c_err_vec); + if (ret != 0) { + reg->i2c_err_vec = DTS_NO_CFG_FLAG; + FPGA_I2C_VERBOSE("not support i2c_err_vec cfg. ret: %d, set DTS_NO_CFG_FLAG: %d\n", + ret, reg->i2c_err_vec); + ret = 0; /* Not configuring i2c_err_vec is not an error */ + } else { + if (i2c_offset_val != 0) { + reg->i2c_err_vec += i2c_offset_val; + } + } + } else { + if (dev->platform_data == NULL) { + dev_err(fpga_i2c->dev, "Failed to get platform data config.\n"); + ret = -ENXIO; + return ret; + } + fpga_i2c_bus_device = dev->platform_data; + fpga_i2c->dev_name = fpga_i2c_bus_device->dev_name; + fpga_i2c->adap_nr = fpga_i2c_bus_device->adap_nr; + fpga_i2c->i2c_scale_value = fpga_i2c_bus_device->i2c_scale_value; + fpga_i2c->i2c_filter_value = fpga_i2c_bus_device->i2c_filter_value; + fpga_i2c->i2c_stretch_value = fpga_i2c_bus_device->i2c_stretch_value; + fpga_i2c->i2c_timeout = fpga_i2c_bus_device->i2c_timeout; + fpga_i2c->i2c_func_mode = fpga_i2c_bus_device->i2c_func_mode; + fpga_i2c->i2c_params_check = fpga_i2c_bus_device->i2c_params_check; + + reset_cfg->reset_addr = fpga_i2c_bus_device->i2c_reset_addr; + reset_cfg->reset_on = fpga_i2c_bus_device->i2c_reset_on; + reset_cfg->reset_off = fpga_i2c_bus_device->i2c_reset_off; + reset_cfg->reset_delay_b = fpga_i2c_bus_device->i2c_rst_delay_b; + reset_cfg->reset_delay = fpga_i2c_bus_device->i2c_rst_delay; + reset_cfg->reset_delay_a = fpga_i2c_bus_device->i2c_rst_delay_a; + reset_cfg->i2c_adap_reset_flag = fpga_i2c_bus_device->i2c_adap_reset_flag; + + reg->i2c_ext_9548_addr = fpga_i2c_bus_device->i2c_ext_9548_addr; + reg->i2c_ext_9548_chan = fpga_i2c_bus_device->i2c_ext_9548_chan; + reg->i2c_slave = fpga_i2c_bus_device->i2c_slave; + reg->i2c_reg = fpga_i2c_bus_device->i2c_reg; + reg->i2c_data_len = fpga_i2c_bus_device->i2c_data_len; + reg->i2c_ctrl = fpga_i2c_bus_device->i2c_ctrl; + reg->i2c_status = fpga_i2c_bus_device->i2c_status; + reg->i2c_scale = fpga_i2c_bus_device->i2c_scale; + reg->i2c_filter = fpga_i2c_bus_device->i2c_filter; + reg->i2c_stretch = fpga_i2c_bus_device->i2c_stretch; + reg->i2c_ext_9548_exits_flag = fpga_i2c_bus_device->i2c_ext_9548_exits_flag; + reg->i2c_reg_len = fpga_i2c_bus_device->i2c_reg_len; + reg->i2c_in_9548_chan = fpga_i2c_bus_device->i2c_in_9548_chan; + reg->i2c_data_buf = fpga_i2c_bus_device->i2c_data_buf; + + i2c_data_buf_len_reg = fpga_i2c_bus_device->i2c_data_buf_len_reg; + if (i2c_data_buf_len_reg > 0) { + ret = fpga_reg_read_32(fpga_i2c, i2c_data_buf_len_reg, ®->i2c_data_buf_len); + if (ret < 0) { + dev_err(fpga_i2c->dev, "Failed to get fpga i2c data buf length, reg addr: 0x%x, ret: %d\n", + i2c_data_buf_len_reg, ret); + return ret; + } + FPGA_I2C_VERBOSE("fpga i2c data buf length reg addr: 0x%x, value: %d\n", + i2c_data_buf_len_reg, reg->i2c_data_buf_len); + if (reg->i2c_data_buf_len == 0) { + reg->i2c_data_buf_len = FPGA_I2C_RDWR_MAX_LEN_DEFAULT; + } + } else { + if (fpga_i2c_bus_device->i2c_data_buf_len == 0) { + reg->i2c_data_buf_len = FPGA_I2C_RDWR_MAX_LEN_DEFAULT; + FPGA_I2C_VERBOSE("not support i2c_data_buf_len cfg, set default_val:%d\n", + reg->i2c_data_buf_len); + } else { + reg->i2c_data_buf_len = fpga_i2c_bus_device->i2c_data_buf_len; + } + } + + i2c_offset_reg = fpga_i2c_bus_device->i2c_offset_reg; + if (i2c_offset_reg > 0) { + rv = fpga_reg_read_32(fpga_i2c, i2c_offset_reg, &i2c_offset_val); + if (rv < 0) { + dev_err(fpga_i2c->dev, "Failed to get fpga i2c adapter offset value, reg addr: 0x%x, rv: %d\n", + i2c_offset_reg, rv); + return rv; + } + FPGA_I2C_VERBOSE("fpga i2c adapter offset reg addr: 0x%x, value: %d\n", + i2c_offset_reg, i2c_offset_val); + reg->i2c_scale +=i2c_offset_val; + reg->i2c_filter += i2c_offset_val; + reg->i2c_stretch += i2c_offset_val; + reg->i2c_ext_9548_exits_flag += i2c_offset_val; + reg->i2c_ext_9548_addr += i2c_offset_val; + reg->i2c_ext_9548_chan += i2c_offset_val; + reg->i2c_in_9548_chan += i2c_offset_val; + reg->i2c_slave += i2c_offset_val; + reg->i2c_reg += i2c_offset_val; + reg->i2c_reg_len += i2c_offset_val; + reg->i2c_data_len += i2c_offset_val; + reg->i2c_ctrl += i2c_offset_val; + reg->i2c_status += i2c_offset_val; + reg->i2c_data_buf += i2c_offset_val; + } + + if (fpga_i2c_bus_device->i2c_err_vec == 0) { + reg->i2c_err_vec = DTS_NO_CFG_FLAG; + FPGA_I2C_VERBOSE("not support i2c_err_vec cfg, set DTS_NO_CFG_FLAG:%d\n", + reg->i2c_err_vec); + } else { + reg->i2c_err_vec = fpga_i2c_bus_device->i2c_err_vec; + if (i2c_offset_val != 0) { + reg->i2c_err_vec += i2c_offset_val; + } + } + } + + FPGA_I2C_VERBOSE("i2c_ext_9548_addr:0x%x, i2c_ext_9548_chan:0x%x, i2c_slave:0x%x, i2c_reg:0x%x, i2c_data_len:0x%x.\n", + reg->i2c_ext_9548_addr, reg->i2c_ext_9548_chan, reg->i2c_slave, reg->i2c_reg, reg->i2c_data_len); + FPGA_I2C_VERBOSE("i2c_ctrl:0x%x, i2c_status:0x%x, i2c_scale:0x%x, i2c_filter:0x%x, i2c_stretch:0x%x.\n", + reg->i2c_ctrl, reg->i2c_status, reg->i2c_scale, reg->i2c_filter, reg->i2c_stretch); + FPGA_I2C_VERBOSE("i2c_ext_9548_exits_flag:0x%x, i2c_in_9548_chan:0x%x, i2c_data_buf:0x%x, i2c_reg_len:0x%x, i2c_data_buf_len:0x%x.\n", + reg->i2c_ext_9548_exits_flag, reg->i2c_in_9548_chan, reg->i2c_data_buf, reg->i2c_reg_len, reg->i2c_data_buf_len); + FPGA_I2C_VERBOSE("dev_name:%s, i2c_scale_value:0x%x, i2c_filter_value:0x%x, i2c_stretch_value:0x%x, i2c_timeout:0x%x.\n", + fpga_i2c->dev_name, fpga_i2c->i2c_scale_value, fpga_i2c->i2c_filter_value, fpga_i2c->i2c_stretch_value, fpga_i2c->i2c_timeout); + FPGA_I2C_VERBOSE("i2c_reset_addr:0x%x, i2c_reset_on:0x%x, i2c_reset_off:0x%x, i2c_rst_delay_b:0x%x, i2c_rst_delay:0x%x, i2c_rst_delay_a:0x%x.\n", + reset_cfg->reset_addr, reset_cfg->reset_on, reset_cfg->reset_off, reset_cfg->reset_delay_b, reset_cfg->reset_delay, reset_cfg->reset_delay_a); + FPGA_I2C_VERBOSE("i2c_adap_reset_flag:0x%x.\n", reset_cfg->i2c_adap_reset_flag); + FPGA_I2C_VERBOSE("i2c_err_vec:0x%x\n", reg->i2c_err_vec); + + return ret; +} + +static int fpga_i2c_probe(struct platform_device *pdev) +{ + int ret; + fpga_i2c_dev_t *fpga_i2c; + struct device *dev; + + fpga_i2c = devm_kzalloc(&pdev->dev, sizeof(fpga_i2c_dev_t), GFP_KERNEL); + if (!fpga_i2c) { + dev_err(&pdev->dev, "devm_kzalloc failed.\n"); + ret = -ENOMEM; + goto out; + } + + fpga_i2c->dev = &pdev->dev; + + ret = fpga_i2c_config_init(fpga_i2c); + if (ret !=0) { + dev_err(fpga_i2c->dev, "Failed to get fpga i2c dts config.\n"); + goto out; + } + + ret = fpga_i2c_adapter_init(fpga_i2c); + if (ret !=0) { + dev_err(fpga_i2c->dev, "Failed to init fpga i2c adapter.\n"); + goto out; + } + + if (fpga_i2c->dev->of_node) { + fpga_i2c->i2c_params_check = of_property_read_bool(fpga_i2c->dev->of_node, "i2c_params_check"); + } + FPGA_I2C_VERBOSE("fpga i2c params check flag:%d.\n", fpga_i2c->i2c_params_check); + + init_waitqueue_head(&fpga_i2c->queue); + + dev = fpga_i2c->dev; + fpga_i2c->adap = fpga_i2c_ops; + fpga_i2c->adap.timeout = msecs_to_jiffies(fpga_i2c->i2c_timeout); + fpga_i2c->adap.dev.parent = &pdev->dev; + fpga_i2c->adap.dev.of_node = pdev->dev.of_node; + i2c_set_adapdata(&fpga_i2c->adap, fpga_i2c); + platform_set_drvdata(pdev, fpga_i2c); + + if (fpga_i2c->dev->of_node) { + /* adap.nr get from dts aliases */ + ret = i2c_add_adapter(&fpga_i2c->adap); + } else { + fpga_i2c->adap.nr = fpga_i2c->adap_nr; + ret = i2c_add_numbered_adapter(&fpga_i2c->adap); + } + + if (ret < 0) { + dev_info(fpga_i2c->dev, "Failed to add adapter.\n"); + goto fail_add; + } + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0) + of_i2c_register_devices(&fpga_i2c->adap); +#endif + dev_info(fpga_i2c->dev, "registered i2c-%d for %s using mode %d with base address:0x%x, data buf len: %d success.\n", + fpga_i2c->adap.nr, fpga_i2c->dev_name, fpga_i2c->i2c_func_mode, fpga_i2c->reg.i2c_scale, + fpga_i2c->reg.i2c_data_buf_len); + return 0; + +fail_add: + platform_set_drvdata(pdev, NULL); +out: + return ret; +}; + +static int fpga_i2c_remove(struct platform_device *pdev) +{ + fpga_i2c_dev_t *fpga_i2c; + + fpga_i2c = platform_get_drvdata(pdev); + i2c_del_adapter(&fpga_i2c->adap); + platform_set_drvdata(pdev, NULL); + return 0; +}; + +static struct of_device_id fpga_i2c_match[] = { + { + .compatible = "wb-fpga-i2c", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, fpga_i2c_match); + +static struct platform_driver wb_fpga_i2c_driver = { + .probe = fpga_i2c_probe, + .remove = fpga_i2c_remove, + .driver = { + .owner = THIS_MODULE, + .name = DRV_NAME, + .of_match_table = fpga_i2c_match, + }, +}; + +static int __init wb_fpga_i2c_init(void) +{ + return platform_driver_register(&wb_fpga_i2c_driver); +} + +static void __exit wb_fpga_i2c_exit(void) +{ + platform_driver_unregister(&wb_fpga_i2c_driver); +} + +module_init(wb_fpga_i2c_init); +module_exit(wb_fpga_i2c_exit); +MODULE_DESCRIPTION("fpga i2c adapter driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_pca954x_drv.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_pca954x_drv.c new file mode 100644 index 000000000000..25f2d60b9334 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_pca954x_drv.c @@ -0,0 +1,542 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "fpga_i2c.h" + +extern int i2c_device_func_write(const char *path, uint32_t pos, uint8_t *val, size_t size); +extern int pcie_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int io_device_func_write(const char *path, uint32_t pos, uint8_t *val, size_t size); +extern int spi_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); + +#define PCA954X_MAX_NCHANS (8) +#define FPGA_INTERNAL_PCA9548 (1) +#define FPGA_EXTERNAL_PCA9548 (2) +#define FPGA_I2C_EXT_9548_EXITS (0x01 << 0) +#define FPGA_I2C_9548_NO_RESET (0x01 << 1) + +#define SYMBOL_I2C_DEV_MODE (1) +#define FILE_MODE (2) +#define SYMBOL_PCIE_DEV_MODE (3) +#define SYMBOL_IO_DEV_MODE (4) +#define SYMBOL_SPI_DEV_MODE (5) + +int g_fpga_pca954x_debug = 0; +int g_fpga_pca954x_error = 0; + +module_param(g_fpga_pca954x_debug, int, S_IRUGO | S_IWUSR); +module_param(g_fpga_pca954x_error, int, S_IRUGO | S_IWUSR); + +#define FPGA_PCA954X_VERBOSE(fmt, args...) do { \ + if (g_fpga_pca954x_debug) { \ + printk(KERN_INFO "[FPGA_PCA954X][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define FPGA_PCA954X_ERROR(fmt, args...) do { \ + if (g_fpga_pca954x_error) { \ + printk(KERN_ERR "[FPGA_PCA954X][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +enum pca_type { + pca_9540, + pca_9541, + pca_9542, + pca_9543, + pca_9544, + pca_9545, + pca_9546, + pca_9547, + pca_9548, +}; + +struct pca954x { + enum pca_type type; + struct i2c_adapter *virt_adaps[PCA954X_MAX_NCHANS]; + u8 last_chan; /* last register value */ + uint32_t fpga_9548_flag; + uint32_t fpga_9548_reset_flag; + uint32_t pca9548_base_nr; + struct i2c_client *client; +}; + +struct chip_desc { + u8 nchans; + u8 enable; /* used for muxes only */ + enum muxtype { + pca954x_ismux = 0, + pca954x_isswi + } muxtype; +}; + +/* Provide specs for the PCA954x types we know about */ +static const struct chip_desc chips[] = { + [pca_9540] = { + .nchans = 2, + .enable = 0x4, + .muxtype = pca954x_ismux, + }, + [pca_9541] = { + .nchans = 1, + .muxtype = pca954x_isswi, + }, + [pca_9543] = { + .nchans = 2, + .muxtype = pca954x_isswi, + }, + [pca_9544] = { + .nchans = 4, + .enable = 0x4, + .muxtype = pca954x_ismux, + }, + [pca_9545] = { + .nchans = 4, + .muxtype = pca954x_isswi, + }, + [pca_9547] = { + .nchans = 8, + .enable = 0x8, + .muxtype = pca954x_ismux, + }, + [pca_9548] = { + .nchans = 8, + .muxtype = pca954x_isswi, + }, +}; + +static const struct i2c_device_id fpga_pca954x_id[] = { + { "wb_fpga_pca9540", pca_9540 }, + { "wb_fpga_pca9541", pca_9541 }, + { "wb_fpga_pca9542", pca_9543 }, + { "wb_fpga_pca9543", pca_9543 }, + { "wb_fpga_pca9544", pca_9544 }, + { "wb_fpga_pca9545", pca_9545 }, + { "wb_fpga_pca9546", pca_9545 }, + { "wb_fpga_pca9547", pca_9547 }, + { "wb_fpga_pca9548", pca_9548 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, fpga_pca954x_id); + +static int fpga_file_write(const char *path, int pos, unsigned char *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDWR, 777); + if (IS_ERR(filp)) { + FPGA_PCA954X_ERROR("write open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_SOURCE, &iov, 1, iov.iov_len); + ret = vfs_iter_write(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + FPGA_PCA954X_ERROR("vfs_iter_write failed, path=%s, addr=%d, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + vfs_fsync(filp, 1); + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; + +} + +static int fpga_device_write(fpga_i2c_dev_t *fpga_i2c, int pos, unsigned char *val, size_t size) +{ + int ret; + + switch (fpga_i2c->i2c_func_mode) { + case SYMBOL_I2C_DEV_MODE: + ret = i2c_device_func_write(fpga_i2c->dev_name, pos, val, size); + break; + case FILE_MODE: + ret = fpga_file_write(fpga_i2c->dev_name, pos, val, size); + break; + case SYMBOL_PCIE_DEV_MODE: + ret = pcie_device_func_write(fpga_i2c->dev_name, pos, val, size); + break; + case SYMBOL_IO_DEV_MODE: + ret = io_device_func_write(fpga_i2c->dev_name, pos, val, size); + break; + case SYMBOL_SPI_DEV_MODE: + ret = spi_device_func_write(fpga_i2c->dev_name, pos, val, size); + break; + default: + FPGA_PCA954X_ERROR("err func_mode %d, write failed.\n", fpga_i2c->i2c_func_mode); + return -EINVAL; + } + return ret; +} + +static int fpga_reg_write(fpga_i2c_dev_t *fpga_i2c, uint32_t addr, uint8_t val) +{ + int ret; + + ret = fpga_device_write(fpga_i2c, addr, &val, sizeof(uint8_t)); + if (ret < 0) { + FPGA_PCA954X_ERROR("fpga_device_write failed. name:%s, addr:0x%x, value:0x%x.\n", + fpga_i2c->dev_name, addr, val); + return ret; + } + + FPGA_PCA954X_VERBOSE("fpga reg write success, dev name:%s, offset:0x%x, value:0x%x.\n", + fpga_i2c->dev_name, addr, val); + return 0; +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,7) +static int pca954x_select_chan(struct i2c_adapter *adap, void *client, u32 chan) +{ + struct pca954x *data = i2c_get_clientdata(client); + fpga_i2c_dev_t *fpga_i2c; + fpga_i2c_reg_t *reg; + int ret; + u8 regval, i2c_9548_opt; + + while(i2c_parent_is_i2c_adapter(adap)){ + adap = to_i2c_adapter(adap->dev.parent); + } + + FPGA_PCA954X_VERBOSE("root bus:%d, chan:0x%x, 9548 flag:0x%x, 9548 addr:0x%x.\n", + adap->nr, chan, data->fpga_9548_flag, client->addr); + fpga_i2c = i2c_get_adapdata(adap); + reg = &fpga_i2c->reg; + + regval = 1 << chan; + if (data->fpga_9548_flag == FPGA_INTERNAL_PCA9548) { + ret = fpga_reg_write(fpga_i2c, reg->i2c_in_9548_chan, regval); + } else { + if (data->fpga_9548_reset_flag == 1) { + i2c_9548_opt = FPGA_I2C_EXT_9548_EXITS & ~(FPGA_I2C_9548_NO_RESET); + } else { + i2c_9548_opt = FPGA_I2C_EXT_9548_EXITS | FPGA_I2C_9548_NO_RESET; + } + FPGA_PCA954X_VERBOSE("fpga pca9548 reset flag:0x%x, opt:0x%x.\n", + data->fpga_9548_reset_flag, i2c_9548_opt); + ret = fpga_reg_write(fpga_i2c, reg->i2c_ext_9548_exits_flag, i2c_9548_opt); + ret += fpga_reg_write(fpga_i2c, reg->i2c_ext_9548_addr, client->addr); + ret += fpga_reg_write(fpga_i2c, reg->i2c_ext_9548_chan, regval); + } + + return ret; +} + +static int pca954x_deselect_mux(struct i2c_adapter *adap, void *client, u32 chan) +{ + struct pca954x *data = i2c_get_clientdata(client); + fpga_i2c_dev_t *fpga_i2c; + fpga_i2c_reg_t *reg; + int ret; + + while(i2c_parent_is_i2c_adapter(adap)){ + adap = to_i2c_adapter(adap->dev.parent); + } + + fpga_i2c = i2c_get_adapdata(adap); + reg = &fpga_i2c->reg; + /* Deselect active channel */ + data->last_chan = 0; + if (data->fpga_9548_flag == FPGA_INTERNAL_PCA9548) { + ret = fpga_reg_write(fpga_i2c, reg->i2c_in_9548_chan, 0); + } else { + + ret = fpga_reg_write(fpga_i2c, reg->i2c_ext_9548_exits_flag, FPGA_I2C_9548_NO_RESET); + ret += fpga_reg_write(fpga_i2c, reg->i2c_ext_9548_chan, 0); + } + + return ret; +} +#else +static int pca954x_select_chan(struct i2c_mux_core *muxc, u32 chan) +{ + struct pca954x *data = i2c_mux_priv(muxc); + struct i2c_client *client = data->client; + struct i2c_adapter *adap; + fpga_i2c_dev_t *fpga_i2c; + fpga_i2c_reg_t *reg; + int ret; + u8 regval, i2c_9548_opt; + + adap = muxc->parent; + while(i2c_parent_is_i2c_adapter(adap)){ + adap = to_i2c_adapter(adap->dev.parent); + } + + FPGA_PCA954X_VERBOSE("root bus:%d, chan:0x%x, 9548 flag:0x%x, 9548 addr:0x%x.\n", + adap->nr, chan, data->fpga_9548_flag, client->addr); + fpga_i2c = i2c_get_adapdata(adap); + reg = &fpga_i2c->reg; + + regval = 1 << chan; + if (data->fpga_9548_flag == FPGA_INTERNAL_PCA9548) { + ret = fpga_reg_write(fpga_i2c, reg->i2c_in_9548_chan, regval); + } else { + if (data->fpga_9548_reset_flag == 1) { + i2c_9548_opt = FPGA_I2C_EXT_9548_EXITS & ~(FPGA_I2C_9548_NO_RESET); + } else { + i2c_9548_opt = FPGA_I2C_EXT_9548_EXITS | FPGA_I2C_9548_NO_RESET; + } + FPGA_PCA954X_VERBOSE("fpga pca9548 reset flag:0x%x, opt:0x%x.\n", + data->fpga_9548_reset_flag, i2c_9548_opt); + ret = fpga_reg_write(fpga_i2c, reg->i2c_ext_9548_exits_flag, i2c_9548_opt); + ret += fpga_reg_write(fpga_i2c, reg->i2c_ext_9548_addr, client->addr); + ret += fpga_reg_write(fpga_i2c, reg->i2c_ext_9548_chan, regval); + } + + return ret; +} + +static int pca954x_deselect_mux(struct i2c_mux_core *muxc, u32 chan) +{ + struct pca954x *data = i2c_mux_priv(muxc); + struct i2c_adapter *adap; + fpga_i2c_dev_t *fpga_i2c; + fpga_i2c_reg_t *reg; + int ret; + + adap = muxc->parent; + while(i2c_parent_is_i2c_adapter(adap)){ + adap = to_i2c_adapter(adap->dev.parent); + } + + fpga_i2c = i2c_get_adapdata(adap); + reg = &fpga_i2c->reg; + ret = 0; + /* Deselect active channel */ + data->last_chan = 0; + + if (data->fpga_9548_flag == FPGA_INTERNAL_PCA9548) { + ret = fpga_reg_write(fpga_i2c, reg->i2c_in_9548_chan, 0); + } else { + + ret = fpga_reg_write(fpga_i2c, reg->i2c_ext_9548_exits_flag, FPGA_I2C_9548_NO_RESET); + ret += fpga_reg_write(fpga_i2c, reg->i2c_ext_9548_chan, 0); + } + + return ret; +} +#endif +/* + * I2C init/probing/exit functions + */ +static int fpga_i2c_pca954x_probe(struct i2c_client *client, const struct i2c_device_id *id) +{ + struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent); + int num, force, class; + struct pca954x *data; + int ret = -ENODEV; + struct device *dev; + int dynamic_nr = 1; + fpga_pca954x_device_t *fpga_pca954x_device; + +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,6,7) + struct i2c_mux_core *muxc; +#endif + + if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE)) { + dev_err(&client->dev, "i2c adapter:%d, unsupport I2C_FUNC_SMBUS_BYTE.\n", adap->nr); + goto err; + } + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,6,7) + data = kzalloc(sizeof(struct pca954x), GFP_KERNEL); + if (!data) { + dev_err(&client->dev, "kzalloc failed.\n"); + ret = -ENOMEM; + goto err; + } + + i2c_set_clientdata(client, data); +#else + muxc = i2c_mux_alloc(adap, &client->dev, + PCA954X_MAX_NCHANS, sizeof(*data), 0, + pca954x_select_chan, pca954x_deselect_mux); + if (!muxc) { + dev_err(&client->dev, "i2c_mux_alloc failed.\n"); + return -ENOMEM; + } + data = i2c_mux_priv(muxc); + i2c_set_clientdata(client, muxc); + data->client = client; +#endif + + dev = &client->dev; + if (dev == NULL) { + dev_err(&client->dev, "dev is NULL.\n"); + ret = -ENODEV; + goto exit_free; + } + + if (dev->of_node == NULL) { + if (client->dev.platform_data == NULL) { + dev_err(&client->dev, "Failed to get 954x platform data config.\n"); + ret = -EINVAL; + goto exit_free; + } + fpga_pca954x_device = client->dev.platform_data; + data->fpga_9548_flag = fpga_pca954x_device->fpga_9548_flag; + data->fpga_9548_reset_flag = fpga_pca954x_device->fpga_9548_reset_flag; + data->pca9548_base_nr = fpga_pca954x_device->pca9548_base_nr; + if (data->pca9548_base_nr == 0) { + + dynamic_nr = 1; + } else { + dynamic_nr = 0; + FPGA_PCA954X_VERBOSE("pca9548_base_nr:%u.\n", data->pca9548_base_nr); + } + } else { + data->type = id->driver_data; + /* BUS ID */ + ret = of_property_read_u32(dev->of_node, "fpga_9548_flag", &data->fpga_9548_flag); + ret += of_property_read_u32(dev->of_node, "fpga_9548_reset_flag", &data->fpga_9548_reset_flag); + if (ret != 0) { + dev_err(&client->dev, "Failed to get 954x dts config, ret:%d.\n", ret); + ret = -EINVAL; + goto exit_free; + } + if (of_property_read_u32(dev->of_node, "pca9548_base_nr", &data->pca9548_base_nr)) { + + dynamic_nr = 1; + FPGA_PCA954X_VERBOSE("pca9548_base_nr not found, use dynamic adap number"); + } else { + dynamic_nr = 0; + FPGA_PCA954X_VERBOSE("pca9548_base_nr:%u.\n", data->pca9548_base_nr); + } + } + + if (data->fpga_9548_flag != FPGA_EXTERNAL_PCA9548 && data->fpga_9548_flag != FPGA_INTERNAL_PCA9548) { + dev_err(&client->dev, "Error: fpga 954x flag config error, value:0x%x.\n", data->fpga_9548_flag); + ret = -EINVAL; + goto exit_free; + } + + data->type = id->driver_data; + data->last_chan = 0; /* force the first selection */ + + /* Now create an adapter for each channel */ + for (num = 0; num < chips[data->type].nchans; num++) { + if (dynamic_nr == 1) { + force = 0; /* dynamic adap number */ + } else { + force = data->pca9548_base_nr + num; + } + class = 0; /* no class by default */ +#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,6,7) + data->virt_adaps[num] = + i2c_add_mux_adapter(adap, &client->dev, client, + force, num, class, pca954x_select_chan, pca954x_deselect_mux); + + if (data->virt_adaps[num] == NULL) { + ret = -ENODEV; + dev_err(&client->dev, "Failed to register multiplexed adapter %d as bus %d\n", + num, force); + goto virt_reg_failed; + } +#else + ret = i2c_mux_add_adapter(muxc, force, num, class); + if (ret) { + dev_err(&client->dev, "Failed to register multiplexed adapter %d as bus %d\n", + num, force); + goto virt_reg_failed; + } +#endif + } /* end for num = 0; num < chips[data->type].nchans... */ + + dev_info(&client->dev, "registered %d multiplexed busses for I2C %s %s\n", + num, chips[data->type].muxtype == pca954x_ismux ? "mux" : "switch", client->name); + + return 0; + +virt_reg_failed: +#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,6,7) + for (num--; num >= 0; num--) + i2c_del_mux_adapter(data->virt_adaps[num]); +exit_free: + kfree(data); +#else +exit_free: + i2c_mux_del_adapters(muxc); +#endif +err: + return ret; +} + +static void fpga_i2c_pca954x_remove(struct i2c_client *client) +{ +#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,6,7) + struct pca954x *data = i2c_get_clientdata(client); + const struct chip_desc *chip = &chips[data->type]; + int i; + + for (i = 0; i < chip->nchans; ++i) + if (data->virt_adaps[i]) { + i2c_del_mux_adapter(data->virt_adaps[i]); + data->virt_adaps[i] = NULL; + } + + kfree(data); +#else + struct i2c_mux_core *muxc = i2c_get_clientdata(client); + + i2c_mux_del_adapters(muxc); +#endif + + return; +} + +static struct i2c_driver fpga_i2c_pca954x_driver = { + .driver = { + .name = "wb_fpga_pca954x", + .owner = THIS_MODULE, + }, + .probe = fpga_i2c_pca954x_probe, + .remove = fpga_i2c_pca954x_remove, + .id_table = fpga_pca954x_id, +}; + +static int __init fpga_i2c_pca954x_init(void) +{ + int ret; + + ret = i2c_add_driver(&fpga_i2c_pca954x_driver); + return ret; +} + +static void __exit fpga_i2c_pca954x_exit(void) +{ + i2c_del_driver(&fpga_i2c_pca954x_driver); +} + +module_init(fpga_i2c_pca954x_init); +module_exit(fpga_i2c_pca954x_exit); +MODULE_DESCRIPTION("fpga pca954x driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_pcie.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_pcie.c new file mode 100644 index 000000000000..baabfb5cd4d0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_fpga_pcie.c @@ -0,0 +1,169 @@ +/* + * wb_fpga_pcie.c + * ko to enable fpga pcie + */ +#include +#include +#include +#include +#include + +#define FPGA_MSI_IRQ_BEGIN (0) +#define FPGA_MSI_IRQ_MAX (32) +#define FPGA_MSI_IRQ_MIN (16) +#define XILINX_FPGA_USE_MSI (0) +#define XILINX_FPGA_NUSE_MSI (1) + +int g_fpga_pcie_dev_debug = 0; +int g_fpga_pcie_dev_error = 0; +module_param(g_fpga_pcie_dev_debug, int, S_IRUGO | S_IWUSR); +module_param(g_fpga_pcie_dev_error, int, S_IRUGO | S_IWUSR); + +#define FPGA_PCIE_DEV_VERBOSE(fmt, args...) do { \ + if (g_fpga_pcie_dev_debug) { \ + printk(KERN_INFO "[FPGA_PCIE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define FPGA_PCIE_DEV_ERROR(fmt, args...) do { \ + if (g_fpga_pcie_dev_error) { \ + printk(KERN_ERR "[FPGA_PCIE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +typedef struct wb_fpga_pcie_s { + struct pci_dev *pci_dev; + int driver_data; +} wb_fpga_pcie_t; + +static void fpga_pcie_recover(struct pci_dev *pdev, const struct pci_device_id *id) +{ + struct resource *mem_base; + u32 bar0_val; + int ret; + + mem_base = &pdev->resource[0]; + ret = pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &bar0_val); + if (ret) { + FPGA_PCIE_DEV_ERROR("pci_read_config_dword failed ret %d.\n", ret); + return; + } + FPGA_PCIE_DEV_VERBOSE("mem_base->start[0x%llx], bar0_val[0x%x], ret %d.\n", + mem_base->start, bar0_val, ret); + + if (bar0_val != mem_base->start) { + ret = pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, mem_base->start); + if (ret) { + FPGA_PCIE_DEV_ERROR("pci_write_config_dword mem_base->start[0x%llx], failed ret %d.\n", mem_base->start, ret); + return; + } + FPGA_PCIE_DEV_VERBOSE("pci_write_config_dword mem_base->start[0x%llx] success.\n", mem_base->start); + } else { + FPGA_PCIE_DEV_VERBOSE("mem_base->start[0x%llx], bar0_val[0x%x], do nothing.\n", + mem_base->start, bar0_val); + } +} + +static int fpga_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) +{ + int err; + wb_fpga_pcie_t *wb_fpga_pcie; + + FPGA_PCIE_DEV_VERBOSE("Enter vendor 0x%x, device 0x%x.\n", pdev->vendor, pdev->device); + + wb_fpga_pcie = devm_kzalloc(&pdev->dev, sizeof(wb_fpga_pcie_t), GFP_KERNEL); + if (!wb_fpga_pcie) { + dev_err(&pdev->dev, "devm_kzalloc failed.\n"); + return -ENOMEM; + } + + fpga_pcie_recover(pdev, id); + + /* enable device: ask low-level code to enable I/O and memory */ + FPGA_PCIE_DEV_VERBOSE("start pci_enable_device!\n"); + err = pci_enable_device(pdev); + if (err) { + dev_err(&pdev->dev, "Failed to enable pci device, ret:%d.\n", err); + return err; + } + + FPGA_PCIE_DEV_VERBOSE("start pci_set_master!\n"); + pci_set_master(pdev); + + wb_fpga_pcie->driver_data = id->driver_data; + wb_fpga_pcie->pci_dev = pdev; + pci_set_drvdata(pdev, wb_fpga_pcie); + + if (wb_fpga_pcie->driver_data == XILINX_FPGA_USE_MSI) { + FPGA_PCIE_DEV_VERBOSE("start pci_enable_msi_range!\n"); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,19,152) + err = pci_enable_msi_range(pdev, FPGA_MSI_IRQ_BEGIN + 1, FPGA_MSI_IRQ_MAX); +#else + err = pci_alloc_irq_vectors_affinity(pdev, FPGA_MSI_IRQ_BEGIN + 1, + FPGA_MSI_IRQ_MAX, PCI_IRQ_MSI, NULL); +#endif + if ((err > FPGA_MSI_IRQ_MAX) || (err < FPGA_MSI_IRQ_MIN)) { + FPGA_PCIE_DEV_ERROR("pci_enable_msi_block err %d FPGA_MSI_IRQ_NUM %d.\n", err, + FPGA_MSI_IRQ_MAX); + dev_err(&pdev->dev, "Failed to enable pci msi, ret:%d.\n", err); + return -EINVAL; + } + FPGA_PCIE_DEV_VERBOSE("pci_enable_msi success, ret: %d\n", err); + } + + dev_info(&pdev->dev, "fpga pci device init success.\n"); + return 0; +} + +static void fpga_pcie_remove(struct pci_dev *pdev) +{ + wb_fpga_pcie_t *wb_fpga_pcie; + + FPGA_PCIE_DEV_VERBOSE("fpga_pcie_remove.\n"); + + wb_fpga_pcie = pci_get_drvdata(pdev); + if (wb_fpga_pcie->driver_data == XILINX_FPGA_USE_MSI) { + FPGA_PCIE_DEV_VERBOSE("start pci_disable_msi!\n"); + pci_disable_msi(pdev); + } + + pci_disable_device(pdev); + return; +} + +static const struct pci_device_id fpga_pci_ids[] = { + { PCI_DEVICE(0x10ee, 0x7022), .driver_data = XILINX_FPGA_USE_MSI}, + { PCI_DEVICE(0x10ee, 0x7011), .driver_data = XILINX_FPGA_NUSE_MSI}, + { PCI_DEVICE(0x1ded, 0x7022), .driver_data = XILINX_FPGA_USE_MSI}, + { PCI_DEVICE(0x1ded, 0x7021), .driver_data = XILINX_FPGA_USE_MSI}, + { PCI_DEVICE(0x1ded, 0x5220), .driver_data = XILINX_FPGA_USE_MSI}, + {0} +}; +MODULE_DEVICE_TABLE(pci, fpga_pci_ids); + +static struct pci_driver wb_fpga_pcie_driver = { + .name = "wb_fpga_pcie", + .id_table = fpga_pci_ids,/* only dynamic id's */ + .probe = fpga_pcie_probe, + .remove = fpga_pcie_remove, +}; + +static int __init wb_fpga_pcie_init(void) +{ + + FPGA_PCIE_DEV_VERBOSE("wb_fpga_pcie_init enter!\n"); + return pci_register_driver(&wb_fpga_pcie_driver); +} + +static void __exit wb_fpga_pcie_exit(void) +{ + FPGA_PCIE_DEV_VERBOSE("wb_fpga_pcie_exit enter!\n"); + pci_unregister_driver(&wb_fpga_pcie_driver); + return; +} + +module_init(wb_fpga_pcie_init); +module_exit(wb_fpga_pcie_exit); +MODULE_DESCRIPTION("fpga pcie driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_gpio_d1500.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_gpio_d1500.c new file mode 100644 index 000000000000..7d5d5da87ea7 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_gpio_d1500.c @@ -0,0 +1,367 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2011, 2012 Cavium Inc. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define GPIO_NAME "wb_gpio_d1500" + +#define GPIO_BASE (0x500) +#define GP_IO_SEL (GPIO_BASE + 0x4) +#define GP_LVL (GPIO_BASE + 0xC) +#define GPI_NMI_EN (GPIO_BASE + 0x28) +#define GPI_NMI_STS (GPIO_BASE + 0x2a) +#define GPI_INV (GPIO_BASE + 0x2c) +#define GPIO_USE_SEL2 (GPIO_BASE + 0x30) +#define GP_IO_SEL2 (GPIO_BASE + 0x34) +#define GP_LVL2 (GPIO_BASE + 0x38) +#define GPI_NMI_EN_2 (GPIO_BASE + 0x3c) +#define GPI_NMI_STS_2 (GPIO_BASE + 0x3e) +#define GPIO_USE_SEL3 (GPIO_BASE + 0x40) +#define GP_IO_SEL3 (GPIO_BASE + 0x44) +#define GP_LVL3 (GPIO_BASE + 0x48) +#define GPI_NMI_EN_3 (GPIO_BASE + 0x50) +#define GPI_NMI_STS_3 (GPIO_BASE + 0x54) + +#define GPIO_BASE_ID (0) +#define BANKSIZE (32) +#define D1500_GPIO_PIN_NUM (96) +#define CELL_NUM (2) + +int g_gpio_d1500_debug = 0; +int g_gpio_d1500_error = 0; +module_param(g_gpio_d1500_debug, int, S_IRUGO | S_IWUSR); +module_param(g_gpio_d1500_error, int, S_IRUGO | S_IWUSR); + +#define GPIO_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_gpio_d1500_debug) { \ + printk(KERN_ERR "[GPIO-D1500][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define GPIO_DEBUG_ERROR(fmt, args...) do { \ + if (g_gpio_d1500_error) { \ + printk(KERN_ERR "[GPIO-D1500][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static DEFINE_SPINLOCK(sio_lock); + +struct gpio_d1500_t { + struct gpio_chip chip; + u64 register_base; +}; + +static int wb_gpio_get(struct gpio_chip *gc, unsigned gpio_num) +{ + u32 data = 0; + unsigned int bank, offset; + unsigned long flags; + + bank = gpio_num / BANKSIZE; + offset = gpio_num % BANKSIZE; + + spin_lock_irqsave(&sio_lock, flags); + if (bank == 0) { + data = inl(GP_LVL) & (1 << offset); + if (data) { + data = 1; + } + } else if (bank == 1) { + data = inl(GP_LVL2) & (1 << offset); + if (data) { + data = 1; + } + } else if (bank == 2) { + data = inl(GP_LVL3) & (1 << offset); + if (data) { + data = 1; + } + } + spin_unlock_irqrestore(&sio_lock, flags); + + return data; +} + +static int wb_gpio_direction_in(struct gpio_chip *gc, unsigned gpio_num) +{ + u32 data; + unsigned int bank, offset; + unsigned long flags; + + bank = gpio_num / BANKSIZE; + offset = gpio_num % BANKSIZE; + + spin_lock_irqsave(&sio_lock, flags); + if (bank == 0) { + data = inl(GP_IO_SEL); + data = data | (1 << offset); + outl(data, GP_IO_SEL); + } else if (bank == 1) { + data = inl(GP_IO_SEL2); + data = data | (1 << offset); + outl(data, GP_IO_SEL2); + } else if (bank == 2) { + data = inl(GP_IO_SEL3); + data = data | (1 << offset); + outl(data, GP_IO_SEL3); + } + spin_unlock_irqrestore(&sio_lock, flags); + + return 0; +} + +static void wb_gpio_set(struct gpio_chip *gc, + unsigned gpio_num, int val) +{ + u32 data; + unsigned int bank, offset; + unsigned long flags; + + bank = gpio_num / BANKSIZE; + offset = gpio_num % BANKSIZE; + + spin_lock_irqsave(&sio_lock, flags); + if (bank == 0) { + data = inl(GP_LVL); + if (val) { + data = data | (1 << offset); + } else { + data = data & ~(1 << offset); + } + outl(data, GP_LVL); + } else if (bank == 1) { + data = inl(GP_LVL2); + if (val) { + data = data | (1 << offset); + } else { + data = data & ~(1 << offset); + } + outl(data, GP_LVL2); + } else if (bank == 2) { + data = inl(GP_LVL3); + if (val) { + data = data | (1 << offset); + } else { + data = data & ~(1 << offset); + } + outl(data, GP_LVL3); + } + spin_unlock_irqrestore(&sio_lock, flags); + + return; +} + +static int wb_gpio_direction_out(struct gpio_chip *gc, + unsigned gpio_num, int val) +{ + u32 data; + unsigned int bank, offset; + unsigned long flags; + + bank = gpio_num / BANKSIZE; + offset = gpio_num % BANKSIZE; + + spin_lock_irqsave(&sio_lock, flags); + if (bank == 0) { + data = inl(GP_IO_SEL); + data = data & ~(1 << offset); + outl(data, GP_IO_SEL); + + data = inl(GP_LVL); + if (val) { + data = data | (1 << offset); + } else { + data = data & ~(1 << offset); + } + outl(data, GP_LVL); + } else if (bank == 1) { + data = inl(GP_IO_SEL2); + data = data & ~(1 << offset); + outl(data, GP_IO_SEL2); + + data = inl(GP_LVL2); + if (val) { + data = data | (1 << offset); + } else { + data = data & ~(1 << offset); + } + outl(data, GP_LVL2); + } else if (bank == 2) { + data = inl(GP_IO_SEL3); + data = data & ~(1 << offset); + outl(data, GP_IO_SEL3); + + data = inl(GP_LVL3); + if (val) { + data = data | (1 << offset); + } else { + data = data & ~(1 << offset); + } + outl(data, GP_LVL3); + } + spin_unlock_irqrestore(&sio_lock, flags); + + return 0; +} + +#ifdef CONFIG_OF +static int wb_gpio_of_xlate(struct gpio_chip *chip, + const struct of_phandle_args *gpio_desc, + u32 *flags) +{ + if (chip->of_gpio_n_cells < 2) { + return -EINVAL; + } + + if (flags) { + *flags = gpio_desc->args[1]; + } + + return gpio_desc->args[0]; +} +#endif + +static int wb_gpio_request(struct gpio_chip *chip, unsigned int offset) +{ + u32 data; + unsigned int bank, tmp_offset; + unsigned long flags; + + bank = offset / BANKSIZE; + tmp_offset = offset % BANKSIZE; + + spin_lock_irqsave(&sio_lock, flags); + if (bank == 0) { + data = inl(GPIO_BASE); + data = data | (1 << tmp_offset); + outl(data, GPIO_BASE); + } else if (bank == 1) { + data = inl(GPIO_USE_SEL2); + data = data | (1 << tmp_offset); + outl(data, GPIO_USE_SEL2); + } else if (bank == 2) { + data = inl(GPIO_USE_SEL3); + data = data | (1 << tmp_offset); + outl(data, GPIO_USE_SEL3); + } + spin_unlock_irqrestore(&sio_lock, flags); + + return 0; +} + +#if 0 +static void wb_gpio_free(struct gpio_chip *chip, unsigned int offset) +{ + u32 data; + unsigned int bank, tmp_offset; + unsigned long flags; + + bank = offset / BANKSIZE; + tmp_offset = offset % BANKSIZE; + + spin_lock_irqsave(&sio_lock, flags); + if (bank == 0) { + data = inl(GPIO_BASE); + data = data & ~(1 << tmp_offset); + outl(data, GPIO_BASE); + } else if (bank == 1) { + data = inl(GPIO_USE_SEL2); + data = data & ~(1 << tmp_offset); + outl(data, GPIO_USE_SEL2); + } else if (bank == 2) { + data = inl(GPIO_USE_SEL3); + data = data & ~(1 << tmp_offset); + outl(data, GPIO_USE_SEL3); + } + + spin_unlock_irqrestore(&sio_lock, flags); + + return; +} +#endif + +static struct gpio_chip wb_gpio_chip = { + .label = GPIO_NAME, + .owner = THIS_MODULE, + .base = GPIO_BASE_ID, + .get = wb_gpio_get, + .direction_input = wb_gpio_direction_in, + .set = wb_gpio_set, + .direction_output = wb_gpio_direction_out, +#ifdef CONFIG_OF + .of_xlate = wb_gpio_of_xlate, +#endif + .request = wb_gpio_request, + .ngpio = D1500_GPIO_PIN_NUM, +#ifdef CONFIG_OF + .of_gpio_n_cells = CELL_NUM, +#endif + .can_sleep = false, +}; + +static int wb_gpio_probe(struct platform_device *pdev) +{ + struct gpio_d1500_t *gpio; + int err; + + gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL); + if (!gpio) { + dev_err(&pdev->dev, "gpio kzalloc failed\n"); + return -ENOMEM; + } + + wb_gpio_chip.parent = &pdev->dev; + gpio->register_base = GPIO_BASE; + gpio->chip = wb_gpio_chip; + pdev->dev.platform_data = &wb_gpio_chip; + err = devm_gpiochip_add_data(&pdev->dev, &wb_gpio_chip, gpio); + if (err) { + dev_err(&pdev->dev, "gpiochip add failed\n"); + return err; + } + + dev_info(&pdev->dev, "register %llu gpio success.\n", gpio->register_base); + + return 0; +} + +static int wb_gpio_remove(struct platform_device *pdev) +{ + dev_info(&pdev->dev, "unregister d1500 gpio success\n"); + return 0; +} + +static const struct of_device_id gpio_d1500_match[] = { + { + .compatible = "wb_gpio_d1500", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, gpio_d1500_match); + +static struct platform_driver wb_gpio_driver = { + .driver = { + .name = GPIO_NAME, + .of_match_table = gpio_d1500_match, + }, + .probe = wb_gpio_probe, + .remove = wb_gpio_remove, +}; + +module_platform_driver(wb_gpio_driver); + +MODULE_DESCRIPTION("d1500 gpio driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_gpio_device.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_gpio_device.c new file mode 100644 index 000000000000..75f883b5909d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_gpio_device.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include + +static int g_wb_gpio_device_debug = 0; +static int g_wb_gpio_device_error = 0; + +module_param(g_wb_gpio_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_gpio_device_error, int, S_IRUGO | S_IWUSR); + +#define WB_GPIO_DEVICE_VERBOSE(fmt, args...) do { \ + if (g_wb_gpio_device_debug) { \ + printk(KERN_INFO "[WB_GPIO_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_GPIO_DEVICE_ERROR(fmt, args...) do { \ + if (g_wb_gpio_device_error) { \ + printk(KERN_ERR "[WB_GPIO_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static void wb_gpio_device_release(struct device *dev) +{ + return; +} + +static struct platform_device wb_gpio_d1500_device = { + .name = "wb_gpio_d1500", + .id = -1, + .dev = { + .release = wb_gpio_device_release, + }, +}; + +static int __init wb_gpio_device_init(void) +{ + WB_GPIO_DEVICE_VERBOSE("wb_gpio_device_init enter!\n"); + return platform_device_register(&wb_gpio_d1500_device); +} + +static void __exit wb_gpio_device_exit(void) +{ + WB_GPIO_DEVICE_VERBOSE("wb_gpio_device_exit enter!\n"); + return platform_device_unregister(&wb_gpio_d1500_device); +} + +module_init(wb_gpio_device_init); +module_exit(wb_gpio_device_exit); +MODULE_DESCRIPTION("GPIO Devices"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_dev.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_dev.c new file mode 100644 index 000000000000..59cee0b1e1c0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_dev.c @@ -0,0 +1,843 @@ +/* + * wb_io_dev.c + * ko to read/write i2c client through /dev/XXX device + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_i2c_dev.h" + +#define MAX_I2C_DEV_NUM (256) +#define FPGA_MAX_LEN (256) +#define MAX_NAME_SIZE (20) +#define MAX_BUS_WIDTH (16) +#define TRANSFER_WRITE_BUFF (FPGA_MAX_LEN + MAX_BUS_WIDTH) + +#define WIDTH_1Byte (1) +#define WIDTH_2Byte (2) +#define WIDTH_4Byte (4) + +#define KERNEL_SPASE (0) +#define USER_SPASE (1) + +static int g_i2c_dev_debug = 0; +static int g_i2c_dev_error = 0; + +module_param(g_i2c_dev_debug, int, S_IRUGO | S_IWUSR); +module_param(g_i2c_dev_error, int, S_IRUGO | S_IWUSR); + +#define I2C_DEV_DEBUG_DMESG(fmt, args...) do { \ + if (g_i2c_dev_debug) { \ + printk(KERN_ERR "[I2C_DEV][DEBUG][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define I2C_DEV_DEBUG_ERROR(fmt, args...) do { \ + if (g_i2c_dev_error) { \ + printk(KERN_ERR "[I2C_DEV][ERR][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static struct i2c_dev_info* i2c_dev_arry[MAX_I2C_DEV_NUM]; + +struct i2c_dev_info { + const char *name; + uint32_t data_bus_width; + uint32_t addr_bus_width; + uint32_t per_rd_len; + uint32_t per_wr_len; + uint32_t i2c_len; + struct miscdevice misc; + struct i2c_client *client; +}; + +static int transfer_read(struct i2c_client *client, u8 *buf, loff_t regaddr, size_t count) +{ + struct i2c_adapter *adap; + union i2c_smbus_data data; + int i, j; + u8 offset_buf[MAX_BUS_WIDTH]; + struct i2c_msg msgs[2]; + int msgs_num, ret; + struct i2c_dev_info *i2c_dev; + u8 offset; + u8 length; + + if (!client) { + I2C_DEV_DEBUG_ERROR("can't get read client\n"); + return -ENODEV; + } + + adap = client->adapter; + if (!adap) { + I2C_DEV_DEBUG_ERROR("can't get read adap\n"); + return -ENODEV; + } + + i2c_dev = i2c_get_clientdata(client); + if (!i2c_dev) { + I2C_DEV_DEBUG_ERROR("can't get read i2c_dev\n"); + return -ENODEV; + } + + i = 0; + + mem_clear(offset_buf, sizeof(offset_buf)); + + switch (i2c_dev->addr_bus_width) { + case WIDTH_4Byte: + offset_buf[i++] = (regaddr >> 24) & 0xFF; + offset_buf[i++] = (regaddr >> 16) & 0xFF; + offset_buf[i++] = (regaddr >> 8) & 0xFF; + offset_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_2Byte: + offset_buf[i++] = (regaddr >> 8) & 0xFF; + offset_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_1Byte: + offset_buf[i++] = regaddr & 0xFF; + break; + default: + I2C_DEV_DEBUG_ERROR("Only support 1,2,4 Byte Address Width,but set width = %u\n", + i2c_dev->addr_bus_width); + return -EINVAL; + } + + if (adap->algo->master_xfer) { + mem_clear(msgs, sizeof(msgs)); + msgs[0].addr = client->addr; + msgs[0].flags = 0; + msgs[0].len = i2c_dev->addr_bus_width; + msgs[0].buf = offset_buf; + + msgs[1].addr = client->addr; + msgs[1].flags = I2C_M_RD; + msgs[1].len = count; + msgs[1].buf = buf; + + msgs_num = 2; + ret = i2c_transfer(client->adapter, msgs, msgs_num); + if (ret != msgs_num) { + I2C_DEV_DEBUG_ERROR("i2c_transfer read error\n"); + return -EINVAL; + } + } else { + if (i2c_dev->addr_bus_width == WIDTH_1Byte) { + offset = regaddr & 0xFF; + if (i2c_check_functionality(adap, I2C_FUNC_SMBUS_READ_I2C_BLOCK)) { + for (j = 0; j < count; j += I2C_SMBUS_BLOCK_MAX) { + if (count - j > I2C_SMBUS_BLOCK_MAX) { + length = I2C_SMBUS_BLOCK_MAX; + } else { + length = count - j; + } + data.block[0] = length; + ret = adap->algo->smbus_xfer(adap, client->addr, + 0, + I2C_SMBUS_READ, + offset, I2C_SMBUS_I2C_BLOCK_DATA, &data); + if (ret) { + I2C_DEV_DEBUG_ERROR("smbus_xfer read block error, ret = %d\n", ret); + return -EFAULT; + } + memcpy(buf + j, data.block + 1, length); + offset += length; + } + } else { + for (j = 0; j < count; j++) { + ret = adap->algo->smbus_xfer(adap, client->addr, + 0, + I2C_SMBUS_READ, + offset, I2C_SMBUS_BYTE_DATA, &data); + + if (!ret) { + buf[j] = data.byte; + } else { + I2C_DEV_DEBUG_ERROR("smbus_xfer read byte error, ret = %d\n", ret); + return -EFAULT; + } + offset++; + } + } + } else { + I2C_DEV_DEBUG_ERROR("smbus_xfer not support addr_bus_width = %d\n", i2c_dev->addr_bus_width); + return -EINVAL; + } + } + return 0; +} + +static int transfer_write(struct i2c_client *client, u8 *buf, loff_t regaddr, size_t count) +{ + struct i2c_adapter *adap; + int i; + u8 offset_buf[TRANSFER_WRITE_BUFF]; + struct i2c_msg msgs[1]; + int msgs_num, ret; + struct i2c_dev_info *i2c_dev; + + if (!client) { + I2C_DEV_DEBUG_ERROR("can't get write client\n"); + return -ENODEV; + } + + adap = client->adapter; + if (!adap) { + I2C_DEV_DEBUG_ERROR("can't get write adap\n"); + return -ENODEV; + } + + i2c_dev = i2c_get_clientdata(client); + if (!i2c_dev) { + I2C_DEV_DEBUG_ERROR("can't get read i2c_dev\n"); + return -ENODEV; + } + + i = 0; + + mem_clear(offset_buf, sizeof(offset_buf)); + + switch (i2c_dev->addr_bus_width) { + case WIDTH_4Byte: + offset_buf[i++] = (regaddr >> 24) & 0xFF; + offset_buf[i++] = (regaddr >> 16) & 0xFF; + offset_buf[i++] = (regaddr >> 8) & 0xFF; + offset_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_2Byte: + offset_buf[i++] = (regaddr >> 8) & 0xFF; + offset_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_1Byte: + offset_buf[i++] = regaddr & 0xFF; + break; + default: + I2C_DEV_DEBUG_ERROR("Only support 1,2,4 Byte Address Width,but set width = %u\n", + i2c_dev->addr_bus_width); + return -EINVAL; + } + + memcpy(offset_buf + i2c_dev->addr_bus_width, buf, count); + + if (adap->algo->master_xfer) { + mem_clear(msgs, sizeof(msgs)); + + msgs[0].addr = client->addr; + msgs[0].flags = 0; + msgs[0].len = i2c_dev->addr_bus_width + count; + msgs[0].buf = offset_buf; + + msgs_num = 1; + ret = i2c_transfer(adap, msgs, msgs_num); + if (ret != msgs_num) { + I2C_DEV_DEBUG_ERROR("i2c_transfer write error\n"); + return -EINVAL; + } + } else { + I2C_DEV_DEBUG_ERROR("don't find write master_xfer\n"); + return -EINVAL; + } + + return 0; +} + +static long i2c_dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + return 0; +} + +static int i2c_dev_open(struct inode *inode, struct file *file) +{ + unsigned int minor = iminor(inode); + struct i2c_dev_info *i2c_dev; + + i2c_dev = i2c_dev_arry[minor]; + if (i2c_dev == NULL) { + return -ENODEV; + } + + file->private_data = i2c_dev; + + return 0; +} + +static int i2c_dev_release(struct inode *inode, struct file *file) +{ + file->private_data = NULL; + + return 0; +} + +static int device_read(struct i2c_dev_info *i2c_dev, uint32_t offset, uint8_t *buf, size_t count) +{ + int i, j, ret; + u8 tmp_offset; + u8 val[FPGA_MAX_LEN]; + u32 width, rd_len, per_len, tmp; + u32 max_per_len; + + if (offset > i2c_dev->i2c_len) { + I2C_DEV_DEBUG_DMESG("offset: 0x%x, i2c len: 0x%x, count: %lu, EOF.\n", + offset, i2c_dev->i2c_len, count); + return 0; + } + + if (count > (i2c_dev->i2c_len - offset)) { + I2C_DEV_DEBUG_DMESG("read count out of range. input len:%lu, read len:%u.\n", + count, i2c_dev->i2c_len - offset); + count = i2c_dev->i2c_len - offset; + } + + if (count == 0) { + I2C_DEV_DEBUG_DMESG("offset: 0x%x, i2c len: 0x%x, read len: %lu, EOF.\n", + offset, i2c_dev->i2c_len, count); + return 0; + } + + width = i2c_dev->data_bus_width; + switch (width) { + case WIDTH_4Byte: + tmp_offset = offset & 0x3; + if (tmp_offset) { + I2C_DEV_DEBUG_ERROR("data bus width:%u, offset:%u, read size %lu invalid.\n", + width, offset, count); + return -EINVAL; + } + break; + case WIDTH_2Byte: + tmp_offset = offset & 0x1; + if (tmp_offset) { + I2C_DEV_DEBUG_ERROR("data bus width:%u, offset:%u, read size %lu invalid.\n", + width, offset, count); + return -EINVAL; + } + break; + case WIDTH_1Byte: + break; + default: + I2C_DEV_DEBUG_ERROR("Only support 1,2,4 Byte Data Width,but set width = %u\n", width); + return -EINVAL; + } + + max_per_len = i2c_dev->per_rd_len; + tmp = (width - 1) & count; + rd_len = (tmp == 0) ? count : count + width - tmp; + per_len = (rd_len > max_per_len) ? (max_per_len) : (rd_len); + + mem_clear(val, sizeof(val)); + for (i = 0; i < rd_len; i += per_len) { + ret = transfer_read(i2c_dev->client, val + i, offset + i, per_len); + if (ret < 0) { + I2C_DEV_DEBUG_ERROR("read error.read offset = %u\n", (offset + i)); + return -EFAULT; + } + } + + if (width == WIDTH_1Byte) { + memcpy(buf, val, count); + } else { + for (i = 0; i < count; i += width) { + for (j = 0; (j < width) && (i + j < count); j++) { + buf[i + j] = val[i + width - j - 1]; + } + } + } + + return count; +} + +static int device_write(struct i2c_dev_info *i2c_dev, uint32_t offset, uint8_t *buf, size_t count) +{ + int i, j, ret; + u8 tmp_offset; + u32 width; + u8 val[FPGA_MAX_LEN]; + u32 wr_len, per_len, tmp; + u32 max_per_len; + + if (offset > i2c_dev->i2c_len) { + I2C_DEV_DEBUG_DMESG("offset: 0x%x, i2c len: 0x%x, count: %lu, EOF.\n", + offset, i2c_dev->i2c_len, count); + return 0; + } + + if (count > (i2c_dev->i2c_len - offset)) { + I2C_DEV_DEBUG_DMESG("read count out of range. input len:%lu, read len:%u.\n", + count, i2c_dev->i2c_len - offset); + count = i2c_dev->i2c_len - offset; + } + + if (count == 0) { + I2C_DEV_DEBUG_DMESG("offset: 0x%x, i2c len: 0x%x, read len: %lu, EOF.\n", + offset, i2c_dev->i2c_len, count); + return 0; + } + + width = i2c_dev->data_bus_width; + switch (width) { + case WIDTH_4Byte: + tmp_offset = offset & 0x3; + if (tmp_offset) { + I2C_DEV_DEBUG_ERROR("data bus width:%u, offset:%u, read size %lu invalid.\n", + width, offset, count); + return -EINVAL; + } + break; + case WIDTH_2Byte: + tmp_offset = offset & 0x1; + if (tmp_offset) { + I2C_DEV_DEBUG_ERROR("data bus width:%u, offset:%u, read size %lu invalid.\n", + width, offset, count); + return -EINVAL; + } + break; + case WIDTH_1Byte: + break; + default: + I2C_DEV_DEBUG_ERROR("Only support 1,2,4 Byte Data Width,but set width = %u\n", width); + return -EINVAL; + } + + mem_clear(val, sizeof(val)); + + if (width == WIDTH_1Byte) { + memcpy(val, buf, count); + } else { + for (i = 0; i < count; i += width) { + for (j = 0; (j < width) && (i + j < count); j++) { + val[i + width - j - 1] = buf[i + j]; + } + } + } + + max_per_len = i2c_dev->per_wr_len; + tmp = (width - 1) & count; + wr_len = (tmp == 0) ? count : count + width - tmp; + per_len = (wr_len > max_per_len) ? (max_per_len) : (wr_len); + + for (i = 0; i < wr_len; i += per_len) { + ret = transfer_write(i2c_dev->client, val + i, offset + i, per_len); + if (ret < 0) { + I2C_DEV_DEBUG_ERROR("write error.offset = %u\n", (offset + i)); + return -EFAULT; + } + } + return count; +} + +static ssize_t i2c_dev_read(struct file *file, char __user *buf, size_t count, loff_t *offset, int flag) +{ + u8 val[FPGA_MAX_LEN]; + int ret, read_len; + struct i2c_dev_info *i2c_dev; + + i2c_dev = file->private_data; + if (i2c_dev == NULL) { + I2C_DEV_DEBUG_ERROR("can't get read private_data.\n"); + return -EINVAL; + } + + if (count == 0) { + I2C_DEV_DEBUG_ERROR("Invalid params, read count is 0.\n"); + return -EINVAL; + } + + if (count > sizeof(val)) { + I2C_DEV_DEBUG_DMESG("read count %lu exceed max %lu.\n", count, sizeof(val)); + count = sizeof(val); + } + + mem_clear(val, sizeof(val)); + read_len = device_read(i2c_dev, (uint32_t)*offset, val, count); + if (read_len < 0) { + I2C_DEV_DEBUG_ERROR("i2c dev read failed, dev name:%s, offset:0x%x, len:%lu.\n", + i2c_dev->name, (uint32_t)*offset, count); + return read_len; + } + + /* check flag is user spase or kernel spase */ + if (flag == USER_SPASE) { + I2C_DEV_DEBUG_DMESG("user space read, buf: %p, offset: %lld, read count %lu.\n", + buf, *offset, count); + if (copy_to_user(buf, val, read_len)) { + I2C_DEV_DEBUG_ERROR("copy_to_user failed.\n"); + return -EFAULT; + } + } else { + I2C_DEV_DEBUG_DMESG("kernel space read, buf: %p, offset: %lld, read count %lu.\n", + buf, *offset, count); + memcpy(buf, val, read_len); + } + + *offset += read_len; + ret = read_len; + return ret; +} + +static ssize_t i2c_dev_read_user(struct file *file, char __user *buf, size_t count, loff_t *offset) +{ + int ret; + + I2C_DEV_DEBUG_DMESG("i2c_dev_read_user, file: %p, count: %lu, offset: %lld\n", + file, count, *offset); + ret = i2c_dev_read(file, buf, count, offset, USER_SPASE); + return ret; +} + +static ssize_t i2c_dev_read_iter(struct kiocb *iocb, struct iov_iter *to) +{ + int ret; + + I2C_DEV_DEBUG_DMESG("i2c_dev_read_iter, file: %p, count: %lu, offset: %lld\n", + iocb->ki_filp, to->count, iocb->ki_pos); + ret = i2c_dev_read(iocb->ki_filp, to->kvec->iov_base, to->count, &iocb->ki_pos, KERNEL_SPASE); + return ret; +} + +static ssize_t i2c_dev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset, int flag) +{ + u8 val[FPGA_MAX_LEN]; + int write_len; + struct i2c_dev_info *i2c_dev; + + i2c_dev = file->private_data; + if (i2c_dev == NULL) { + I2C_DEV_DEBUG_ERROR("get write private_data error.\n"); + return -EINVAL; + } + + if (count == 0) { + I2C_DEV_DEBUG_ERROR("Invalid params, write count is 0.\n"); + return -EINVAL; + } + + if (count > sizeof(val)) { + I2C_DEV_DEBUG_DMESG("write count %lu exceed max %lu.\n", count, sizeof(val)); + count = sizeof(val); + } + + mem_clear(val, sizeof(val)); + + /* check flag is user spase or kernel spase */ + if (flag == USER_SPASE) { + I2C_DEV_DEBUG_DMESG("user space write, buf: %p, offset: %lld, write count %lu.\n", + buf, *offset, count); + if (copy_from_user(val, buf, count)) { + I2C_DEV_DEBUG_ERROR("copy_from_user failed.\n"); + return -EFAULT; + } + } else { + I2C_DEV_DEBUG_DMESG("kernel space write, buf: %p, offset: %lld, write count %lu.\n", + buf, *offset, count); + memcpy(val, buf, count); + } + + write_len = device_write(i2c_dev, (uint32_t)*offset, val, count); + if (write_len < 0) { + I2C_DEV_DEBUG_ERROR("i2c dev write failed, dev name:%s, offset:0x%llx, len:%lu.\n", + i2c_dev->name, *offset, count); + return write_len; + } + + *offset += write_len; + return write_len; +} + +static ssize_t i2c_dev_write_user(struct file *file, const char __user *buf, size_t count, loff_t *offset) +{ + int ret; + + I2C_DEV_DEBUG_DMESG("i2c_dev_write_user, file: %p, count: %lu, offset: %lld\n", + file, count, *offset); + ret = i2c_dev_write(file, buf, count, offset, USER_SPASE); + return ret; +} + +static ssize_t i2c_dev_write_iter(struct kiocb *iocb, struct iov_iter *from) +{ + int ret; + + I2C_DEV_DEBUG_DMESG("i2c_dev_write_iter, file: %p, count: %lu, offset: %lld\n", + iocb->ki_filp, from->count, iocb->ki_pos); + ret = i2c_dev_write(iocb->ki_filp, from->kvec->iov_base, from->count, &iocb->ki_pos, KERNEL_SPASE); + return ret; +} + +static loff_t i2c_dev_llseek(struct file *file, loff_t offset, int origin) +{ + loff_t ret = 0; + struct i2c_dev_info *i2c_dev; + + i2c_dev = file->private_data; + if (i2c_dev == NULL) { + I2C_DEV_DEBUG_ERROR("i2c_dev is NULL, llseek failed.\n"); + return -EINVAL; + } + + switch (origin) { + case SEEK_SET: + if (offset < 0) { + I2C_DEV_DEBUG_ERROR("SEEK_SET, offset:%lld, invalid.\n", offset); + ret = -EINVAL; + break; + } + if (offset > i2c_dev->i2c_len) { + I2C_DEV_DEBUG_ERROR("SEEK_SET out of range, offset:%lld, i2c_len:0x%x.\n", + offset, i2c_dev->i2c_len); + ret = - EINVAL; + break; + } + file->f_pos = offset; + ret = file->f_pos; + break; + case SEEK_CUR: + if (((file->f_pos + offset) > i2c_dev->i2c_len) || ((file->f_pos + offset) < 0)) { + I2C_DEV_DEBUG_ERROR("SEEK_CUR out of range, f_ops:%lld, offset:%lld, i2c_len:0x%x.\n", + file->f_pos, offset, i2c_dev->i2c_len); + ret = - EINVAL; + break; + } + file->f_pos += offset; + ret = file->f_pos; + break; + default: + I2C_DEV_DEBUG_ERROR("unsupport llseek type:%d.\n", origin); + ret = -EINVAL; + break; + } + return ret; +} + +static const struct file_operations i2c_dev_fops = { + .owner = THIS_MODULE, + .llseek = i2c_dev_llseek, + .read = i2c_dev_read_user, + .write = i2c_dev_write_user, + .read_iter = i2c_dev_read_iter, + .write_iter = i2c_dev_write_iter, + .unlocked_ioctl = i2c_dev_ioctl, + .open = i2c_dev_open, + .release = i2c_dev_release, +}; + +static struct i2c_dev_info * dev_match(const char *path) +{ + struct i2c_dev_info * i2c_dev; + char dev_name[MAX_NAME_SIZE]; + int i; + for (i = 0; i < MAX_I2C_DEV_NUM; i++) { + if (i2c_dev_arry[ i ] == NULL) { + continue; + } + i2c_dev = i2c_dev_arry[ i ]; + snprintf(dev_name, MAX_NAME_SIZE,"/dev/%s", i2c_dev->name); + if (!strcmp(path, dev_name)) { + I2C_DEV_DEBUG_DMESG("get dev_name = %s, minor = %d\n", dev_name, i); + return i2c_dev; + } + } + + return NULL; +} + +int i2c_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count) +{ + struct i2c_dev_info *i2c_dev = NULL; + int ret; + + if(path == NULL){ + I2C_DEV_DEBUG_ERROR("path NULL"); + return -EINVAL; + } + + if(buf == NULL){ + I2C_DEV_DEBUG_ERROR("buf NULL"); + return -EINVAL; + } + + if (count > FPGA_MAX_LEN) { + I2C_DEV_DEBUG_ERROR("read count %lu, beyond max:%d.\n", count, FPGA_MAX_LEN); + return -EINVAL; + } + + i2c_dev = dev_match(path); + if (i2c_dev == NULL) { + I2C_DEV_DEBUG_ERROR("i2c_dev match failed. dev path = %s", path); + return -EINVAL; + } + + ret = device_read(i2c_dev, offset, buf, count); + if (ret < 0) { + I2C_DEV_DEBUG_ERROR("fpga i2c dev read failed, dev name:%s, offset:0x%x, len:%lu.\n", + i2c_dev->name, offset, count); + return -EINVAL; + } + + return count; +} +EXPORT_SYMBOL(i2c_device_func_read); + +int i2c_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count) +{ + struct i2c_dev_info *i2c_dev = NULL; + int ret; + + if(path == NULL){ + I2C_DEV_DEBUG_ERROR("path NULL"); + return -EINVAL; + } + + if(buf == NULL){ + I2C_DEV_DEBUG_ERROR("buf NULL"); + return -EINVAL; + } + + if (count > FPGA_MAX_LEN) { + I2C_DEV_DEBUG_ERROR("write count %lu, beyond max:%d.\n", count, FPGA_MAX_LEN); + return -EINVAL; + } + + i2c_dev = dev_match(path); + if (i2c_dev == NULL) { + I2C_DEV_DEBUG_ERROR("i2c_dev match failed. dev path = %s", path); + return -EINVAL; + } + + ret = device_write (i2c_dev, offset, buf, count); + if (ret < 0) { + I2C_DEV_DEBUG_ERROR("i2c dev write failed, dev name:%s, offset:0x%x, len:%lu.\n", + i2c_dev->name, offset, count); + return -EINVAL; + } + + return count; +} +EXPORT_SYMBOL(i2c_device_func_write); + +static int i2c_dev_probe(struct i2c_client *client, const struct i2c_device_id *id) +{ + int ret = 0; + struct i2c_dev_info *i2c_dev; + struct miscdevice *misc; + i2c_dev_device_t *i2c_dev_device; + + i2c_dev = devm_kzalloc(&client->dev, sizeof(struct i2c_dev_info), GFP_KERNEL); + if (!i2c_dev) { + dev_err(&client->dev, "devm_kzalloc error. \n"); + return -ENOMEM; + } + + i2c_set_clientdata(client, i2c_dev); + i2c_dev->client = client; + + if (client->dev.of_node) { + + ret += of_property_read_string(client->dev.of_node, "i2c_name", &i2c_dev->name); + ret += of_property_read_u32(client->dev.of_node, "data_bus_width", &i2c_dev->data_bus_width); + ret += of_property_read_u32(client->dev.of_node, "addr_bus_width", &i2c_dev->addr_bus_width); + ret += of_property_read_u32(client->dev.of_node, "per_rd_len", &i2c_dev->per_rd_len); + ret += of_property_read_u32(client->dev.of_node, "per_wr_len", &i2c_dev->per_wr_len); + ret += of_property_read_u32(client->dev.of_node, "i2c_len", &i2c_dev->i2c_len); + if (ret != 0) { + dev_err(&client->dev, "dts config error.ret:%d.\n", ret); + return -ENXIO; + } + } else { + if (client->dev.platform_data == NULL) { + dev_err(&client->dev, "Failed to get platform data config.\n"); + return -ENXIO; + } + i2c_dev_device = client->dev.platform_data; + i2c_dev->name = i2c_dev_device->i2c_name; + i2c_dev->data_bus_width = i2c_dev_device->data_bus_width; + i2c_dev->addr_bus_width = i2c_dev_device->addr_bus_width; + i2c_dev->per_rd_len = i2c_dev_device->per_rd_len; + i2c_dev->per_wr_len = i2c_dev_device->per_wr_len; + i2c_dev->i2c_len = i2c_dev_device->i2c_len; + } + + if ((i2c_dev->per_rd_len & (i2c_dev->data_bus_width - 1)) || + (i2c_dev->per_wr_len & (i2c_dev->data_bus_width - 1))) { + dev_err(&client->dev, "Invalid config per_rd_len %d per_wr_len %d data bus_width %d.\n", + i2c_dev->per_rd_len, i2c_dev->per_wr_len, i2c_dev->data_bus_width); + return -ENXIO; + } + + if ((i2c_dev->i2c_len == 0) || (i2c_dev->i2c_len & (i2c_dev->data_bus_width - 1))) { + dev_err(&client->dev, "Invalid config i2c_len %d, data bus_width %d.\n", + i2c_dev->i2c_len, i2c_dev->data_bus_width); + return -ENXIO; + } + + misc = &i2c_dev->misc; + misc->minor = MISC_DYNAMIC_MINOR; + misc->name = i2c_dev->name; + misc->fops = &i2c_dev_fops; + misc->mode = 0666; + if (misc_register(misc) != 0) { + dev_err(&client->dev, "register %s faild.\n", misc->name); + return -ENXIO; + } + + if (misc->minor >= MAX_I2C_DEV_NUM) { + dev_err(&client->dev, "minor number beyond the limit! is %d.\n", misc->minor); + misc_deregister(misc); + return -ENXIO; + } + i2c_dev_arry[misc->minor] = i2c_dev; + + dev_info(&client->dev, "register %u addr_bus_width %u data_bus_width 0x%x i2c_len device %s with %u per_rd_len %u per_wr_len success.\n", + i2c_dev->addr_bus_width, i2c_dev->data_bus_width, i2c_dev->i2c_len, i2c_dev->name, i2c_dev->per_rd_len, i2c_dev->per_wr_len); + + return 0; +} + +static void i2c_dev_remove(struct i2c_client *client) +{ + int i; + for (i = 0; i < MAX_I2C_DEV_NUM; i++) { + if (i2c_dev_arry[i] != NULL) { + misc_deregister(&i2c_dev_arry[i]->misc); + i2c_dev_arry[i] = NULL; + } + } + return; +} + +static const struct i2c_device_id i2c_dev_id[] = { + { "wb-i2c-dev", 0 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, i2c_dev_id); + +static const struct of_device_id i2c_dev_of_match[] = { + { .compatible = "wb-i2c-dev" }, + { }, +}; +MODULE_DEVICE_TABLE(of, i2c_dev_of_match); + +static struct i2c_driver i2c_dev_driver = { + .driver = { + .name = "wb-i2c-dev", + .of_match_table = i2c_dev_of_match, + }, + .probe = i2c_dev_probe, + .remove = i2c_dev_remove, + .id_table = i2c_dev_id, +}; +module_i2c_driver(i2c_dev_driver); + +MODULE_DESCRIPTION("i2c dev driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_dev.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_dev.h new file mode 100644 index 000000000000..9cc95d88e804 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_dev.h @@ -0,0 +1,20 @@ +#ifndef __WB_I2C_DEV_H__ +#define __WB_I2C_DEV_H__ +#include + +#define mem_clear(data, size) memset((data), 0, (size)) +#define I2C_DEV_NAME_MAX_LEN (64) + +typedef struct i2c_dev_device_s { + struct i2c_client *client; + uint32_t i2c_bus; + uint32_t i2c_addr; + char i2c_name[I2C_DEV_NAME_MAX_LEN]; + uint32_t data_bus_width; + uint32_t addr_bus_width; + uint32_t per_rd_len; + uint32_t per_wr_len; + uint32_t i2c_len; +} i2c_dev_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_ocores.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_ocores.c new file mode 100644 index 000000000000..20f8954cce83 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_ocores.c @@ -0,0 +1,1179 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * i2c-ocores.c: I2C bus driver for OpenCores I2C controller + * (https://opencores.org/project/i2c/overview) + * + * Peter Korsgaard + * + * Support for the GRLIB port of the controller by + * Andreas Larsson + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_i2c_ocores.h" + +#define OCORES_FLAG_POLL BIT(0) + +/* registers */ +#define OCI2C_PRELOW (0) +#define OCI2C_PREHIGH (1) +#define OCI2C_CONTROL (2) +#define OCI2C_DATA (3) +#define OCI2C_CMD (4) /* write only */ +#define OCI2C_STATUS (4) /* read only, same address as OCI2C_CMD */ + +#define OCI2C_CTRL_IEN (0x40) +#define OCI2C_CTRL_EN (0x80) + +#define OCI2C_CMD_START (0x91) +#define OCI2C_CMD_STOP (0x41) +#define OCI2C_CMD_READ (0x21) +#define OCI2C_CMD_WRITE (0x11) +#define OCI2C_CMD_READ_ACK (0x21) +#define OCI2C_CMD_READ_NACK (0x29) +#define OCI2C_CMD_IACK (0x01) + +#define OCI2C_STAT_IF (0x01) +#define OCI2C_STAT_TIP (0x02) +#define OCI2C_STAT_ARBLOST (0x20) +#define OCI2C_STAT_BUSY (0x40) +#define OCI2C_STAT_NACK (0x80) + +#define STATE_DONE (0) +#define STATE_START (1) +#define STATE_WRITE (2) +#define STATE_READ (3) +#define STATE_ERROR (4) + +#define TYPE_OCORES (0) +#define TYPE_GRLIB (1) + +#define OCORE_WAIT_SCH (40) +#define REG_IO_WIDTH_1 (1) +#define REG_IO_WIDTH_2 (2) +#define REG_IO_WIDTH_4 (4) + +#define SYMBOL_I2C_DEV_MODE (1) +#define FILE_MODE (2) +#define SYMBOL_PCIE_DEV_MODE (3) +#define SYMBOL_IO_DEV_MODE (4) + +typedef struct wb_pci_dev_s { + uint32_t domain; + uint32_t bus; + uint32_t slot; + uint32_t fn; + uint32_t check_pci_id; + uint32_t pci_id; +} wb_pci_dev_t; + +/* + * 'process_lock' exists because ocores_process() and ocores_process_timeout() + * can't run in parallel. + */ +struct ocores_i2c { + uint32_t base_addr; + uint32_t reg_shift; + uint32_t reg_io_width; + unsigned long flags; + wait_queue_head_t wait; + struct i2c_adapter adap; + int adap_nr; + struct i2c_msg *msg; + int pos; + int nmsgs; + int state; + spinlock_t process_lock; + uint32_t ip_clock_khz; + uint32_t bus_clock_khz; + void (*setreg)(struct ocores_i2c *i2c, int reg, u32 value); + u32 (*getreg)(struct ocores_i2c *i2c, int reg); + const char *dev_name; + uint32_t reg_access_mode; + uint32_t big_endian; + uint32_t irq_offset; + wb_pci_dev_t wb_pci_dev; + struct device *dev; +}; + +int g_wb_ocores_i2c_debug = 0; +int g_wb_ocores_i2c_error = 0; +int g_wb_ocores_i2c_xfer = 0; + +module_param(g_wb_ocores_i2c_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_ocores_i2c_error, int, S_IRUGO | S_IWUSR); +module_param(g_wb_ocores_i2c_xfer, int, S_IRUGO | S_IWUSR); + +#define OCORES_I2C_VERBOSE(fmt, args...) do { \ + if (g_wb_ocores_i2c_debug) { \ + printk(KERN_INFO "[OCORES_I2C][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define OCORES_I2C_ERROR(fmt, args...) do { \ + if (g_wb_ocores_i2c_error) { \ + printk(KERN_ERR "[OCORES_I2C][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define OCORES_I2C_XFER(fmt, args...) do { \ + if (g_wb_ocores_i2c_xfer) { \ + printk(KERN_INFO "[OCORES_I2C][XFER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +extern int i2c_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int i2c_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int pcie_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int pcie_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int io_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int io_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); +#if 0 +int __attribute__((weak)) i2c_device_func_read(const char *path, uint32_t offset, + uint8_t *buf, size_t count) +{ + OCORES_I2C_ERROR("enter __weak i2c func read\r\n"); + return -EINVAL; +} + +int __attribute__((weak)) i2c_device_func_write(const char *path, uint32_t offset, + uint8_t *buf, size_t count) +{ + OCORES_I2C_ERROR("enter __weak i2c func write\r\n"); + return -EINVAL; +} + +int __attribute__((weak)) pcie_device_func_read(const char *path, uint32_t offset, + uint8_t *buf, size_t count) +{ + OCORES_I2C_ERROR("enter __weak pcie func read\r\n"); + return -EINVAL; +} + +int __attribute__((weak)) pcie_device_func_write(const char *path, uint32_t offset, + uint8_t *buf, size_t count) +{ + OCORES_I2C_ERROR("enter __weak pcie func write\r\n"); + return -EINVAL; +} + +int __attribute__((weak)) io_device_func_read(const char *path, uint32_t offset, + uint8_t *buf, size_t count) +{ + OCORES_I2C_ERROR("enter __weak io func read\r\n"); + return -EINVAL; +} + +int __attribute__((weak)) io_device_func_write(const char *path, uint32_t offset, + uint8_t *buf, size_t count) +{ + OCORES_I2C_ERROR("enter __weak io func write\r\n"); + return -EINVAL; +} +#endif +static int ocores_i2c_file_read(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDONLY, 0); + if (IS_ERR(filp)) { + OCORES_I2C_ERROR("read open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_DEST, &iov, 1, iov.iov_len); + ret = vfs_iter_read(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + OCORES_I2C_ERROR("vfs_iter_read failed, path=%s, addr=%d, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + filp_close(filp, NULL); + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int ocores_i2c_file_write(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDWR, 777); + if (IS_ERR(filp)) { + OCORES_I2C_ERROR("write open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_SOURCE, &iov, 1, iov.iov_len); + ret = vfs_iter_write(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + OCORES_I2C_ERROR("vfs_iter_write failed, path=%s, addr=%d, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + vfs_fsync(filp, 1); + filp_close(filp, NULL); + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int ocores_i2c_reg_write(struct ocores_i2c *i2c, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + + switch (i2c->reg_access_mode) { + case SYMBOL_I2C_DEV_MODE: + ret = i2c_device_func_write(i2c->dev_name, pos, val, size); + break; + case FILE_MODE: + ret = ocores_i2c_file_write(i2c->dev_name, pos, val, size); + break; + case SYMBOL_PCIE_DEV_MODE: + ret = pcie_device_func_write(i2c->dev_name, pos, val, size); + break; + case SYMBOL_IO_DEV_MODE: + ret = io_device_func_write(i2c->dev_name, pos, val, size); + break; + default: + OCORES_I2C_ERROR("err func_mode, write failed.\n"); + return -EINVAL; + } + + return ret; +} + +static int ocores_i2c_reg_read(struct ocores_i2c *i2c, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + + switch (i2c->reg_access_mode) { + case SYMBOL_I2C_DEV_MODE: + ret = i2c_device_func_read(i2c->dev_name, pos, val, size); + break; + case FILE_MODE: + ret = ocores_i2c_file_read(i2c->dev_name, pos, val, size); + break; + case SYMBOL_PCIE_DEV_MODE: + ret = pcie_device_func_read(i2c->dev_name, pos, val, size); + break; + case SYMBOL_IO_DEV_MODE: + ret = io_device_func_read(i2c->dev_name, pos, val, size); + break; + default: + OCORES_I2C_ERROR("err func_mode, read failed.\n"); + return -EINVAL; + } + + return ret; +} +static void oc_setreg_8(struct ocores_i2c *i2c, int reg, u32 value) +{ + u8 buf_tmp[REG_IO_WIDTH_1]; + u32 pos; + + pos = i2c->base_addr + (reg << i2c->reg_shift); + OCORES_I2C_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + i2c->dev_name, i2c->reg_access_mode, pos, value); + + buf_tmp[0] = (value & 0Xff); + ocores_i2c_reg_write(i2c, pos, buf_tmp, REG_IO_WIDTH_1); + return; +} + +static void oc_setreg_16(struct ocores_i2c *i2c, int reg, u32 value) +{ + u8 buf_tmp[REG_IO_WIDTH_2]; + u32 pos; + + pos = i2c->base_addr + (reg << i2c->reg_shift); + OCORES_I2C_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + i2c->dev_name, i2c->reg_access_mode, pos, value); + + buf_tmp[0] = (value & 0Xff); + buf_tmp[1] = (value >> 8) & 0xff; + ocores_i2c_reg_write(i2c, pos, buf_tmp, REG_IO_WIDTH_2); + return; +} + +static void oc_setreg_32(struct ocores_i2c *i2c, int reg, u32 value) +{ + u8 buf_tmp[REG_IO_WIDTH_4]; + u32 pos; + + pos = i2c->base_addr + (reg << i2c->reg_shift); + OCORES_I2C_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + i2c->dev_name, i2c->reg_access_mode, pos, value); + + buf_tmp[0] = (value & 0xff); + buf_tmp[1] = (value >> 8) & 0xff; + buf_tmp[2] = (value >> 16) & 0xff; + buf_tmp[3] = (value >> 24) & 0xff; + + ocores_i2c_reg_write(i2c, pos, buf_tmp, REG_IO_WIDTH_4); + return; +} + +static void oc_setreg_16be(struct ocores_i2c *i2c, int reg, u32 value) +{ + u8 buf_tmp[REG_IO_WIDTH_2]; + u32 pos; + + pos = i2c->base_addr + (reg << i2c->reg_shift); + OCORES_I2C_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + i2c->dev_name, i2c->reg_access_mode, pos, value); + + buf_tmp[0] = (value >> 8) & 0xff; + buf_tmp[1] = (value & 0Xff); + ocores_i2c_reg_write(i2c, pos, buf_tmp, REG_IO_WIDTH_2); + return; +} + +static void oc_setreg_32be(struct ocores_i2c *i2c, int reg, u32 value) +{ + u8 buf_tmp[REG_IO_WIDTH_4]; + u32 pos; + + pos = i2c->base_addr + (reg << i2c->reg_shift); + OCORES_I2C_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + i2c->dev_name, i2c->reg_access_mode, pos, value); + + buf_tmp[0] = (value >> 24) & 0xff; + buf_tmp[1] = (value >> 16) & 0xff; + buf_tmp[2] = (value >> 8) & 0xff; + buf_tmp[3] = (value & 0xff); + ocores_i2c_reg_write(i2c, pos, buf_tmp, REG_IO_WIDTH_4); + return; +} + +static inline u32 oc_getreg_8(struct ocores_i2c *i2c, int reg) +{ + u8 buf_tmp[REG_IO_WIDTH_1]; + u32 value, pos; + + pos = i2c->base_addr + (reg << i2c->reg_shift); + ocores_i2c_reg_read(i2c, pos, buf_tmp, REG_IO_WIDTH_1); + value = buf_tmp[0]; + + OCORES_I2C_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + i2c->dev_name, i2c->reg_access_mode, pos, value); + + return value; +} + +static inline u32 oc_getreg_16(struct ocores_i2c *i2c, int reg) +{ + u8 buf_tmp[REG_IO_WIDTH_2]; + u32 value, pos; + int i; + + pos = i2c->base_addr + (reg << i2c->reg_shift); + mem_clear(buf_tmp, sizeof(buf_tmp)); + ocores_i2c_reg_read(i2c, pos, buf_tmp, REG_IO_WIDTH_2); + + value = 0; + for (i = 0; i < REG_IO_WIDTH_2 ; i++) { + value |= buf_tmp[i] << (8 * i); + } + + OCORES_I2C_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + i2c->dev_name, i2c->reg_access_mode, pos, value); + return value; +} + +static inline u32 oc_getreg_32(struct ocores_i2c *i2c, int reg) +{ + u8 buf_tmp[REG_IO_WIDTH_4]; + u32 value, pos; + int i; + + pos = i2c->base_addr + (reg << i2c->reg_shift); + mem_clear(buf_tmp, sizeof(buf_tmp)); + ocores_i2c_reg_read(i2c, pos, buf_tmp, REG_IO_WIDTH_4); + + value = 0; + for (i = 0; i < REG_IO_WIDTH_4 ; i++) { + value |= buf_tmp[i] << (8 * i); + } + OCORES_I2C_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + i2c->dev_name, i2c->reg_access_mode, pos, value); + return value; +} + +static inline u32 oc_getreg_16be(struct ocores_i2c *i2c, int reg) +{ + u8 buf_tmp[REG_IO_WIDTH_2]; + u32 value, pos; + int i; + + pos = i2c->base_addr + (reg << i2c->reg_shift); + + mem_clear(buf_tmp, sizeof(buf_tmp)); + ocores_i2c_reg_read(i2c, pos, buf_tmp, REG_IO_WIDTH_2); + + value = 0; + for (i = 0; i < REG_IO_WIDTH_2 ; i++) { + value |= buf_tmp[i] << (8 * (REG_IO_WIDTH_2 -i - 1)); + } + + OCORES_I2C_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + i2c->dev_name, i2c->reg_access_mode, pos, value); + return value; +} + +static inline u32 oc_getreg_32be(struct ocores_i2c *i2c, int reg) +{ + u8 buf_tmp[REG_IO_WIDTH_4]; + u32 value, pos; + int i; + + pos = i2c->base_addr + (reg << i2c->reg_shift); + + mem_clear(buf_tmp, sizeof(buf_tmp)); + ocores_i2c_reg_read(i2c, pos, buf_tmp, REG_IO_WIDTH_4); + + value = 0; + for (i = 0; i < REG_IO_WIDTH_4 ; i++) { + value |= buf_tmp[i] << (8 * (REG_IO_WIDTH_4 -i - 1)); + } + + OCORES_I2C_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + i2c->dev_name, i2c->reg_access_mode, pos, value); + return value; + +} + +static inline void oc_setreg(struct ocores_i2c *i2c, int reg, u32 value) +{ + i2c->setreg(i2c, reg, value); + return; +} + +static inline u32 oc_getreg(struct ocores_i2c *i2c, int reg) +{ + return i2c->getreg(i2c, reg); +} + +static int ocores_msg_check(struct i2c_msg *msgs, int num) +{ + int i, ret = 0; + + if (!msgs) { + ret = -EFAULT; + goto out; + } + + for (i = 0; i < num; ++i) { + if (!msgs[i].buf) { + ret = -EFAULT; + goto out; + } + } + +out: + return ret; +} + +static void ocores_process(struct ocores_i2c *i2c, u8 stat) +{ + struct i2c_msg *msg = i2c->msg; + + OCORES_I2C_XFER("Enter nr %d.\n", i2c->adap.nr); + if ((i2c->state == STATE_DONE) || (i2c->state == STATE_ERROR)) { + /* stop has been sent */ + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK); + wake_up(&i2c->wait); + OCORES_I2C_XFER("stop has been sent, exit.\n"); + goto out; + } + + /* error? */ + if (stat & OCI2C_STAT_ARBLOST) { + i2c->state = STATE_ERROR; + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_STOP); + OCORES_I2C_XFER("error exit, lose arbitration.\n"); + goto out; + } + + if (ocores_msg_check(i2c->msg, i2c->nmsgs) != 0) { + OCORES_I2C_XFER("msg buf is NULL\n"); + i2c->state = STATE_ERROR; + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_STOP); + goto out; + } + + if ((i2c->state == STATE_START) || (i2c->state == STATE_WRITE)) { + i2c->state = + (msg->flags & I2C_M_RD) ? STATE_READ : STATE_WRITE; + + if (stat & OCI2C_STAT_NACK) { + i2c->state = STATE_ERROR; + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_STOP); + OCORES_I2C_XFER("OCI2C_STAT_NACK, exit.\n"); + goto out; + } + } else { + msg->buf[i2c->pos++] = oc_getreg(i2c, OCI2C_DATA); + } + + /* end of msg? */ + if (i2c->pos == msg->len) { + OCORES_I2C_XFER("Enter end of msg.\n"); + i2c->nmsgs--; + i2c->msg++; + i2c->pos = 0; + msg = i2c->msg; + + if (i2c->nmsgs) { /* end? */ + /* send start? */ + if (!(msg->flags & I2C_M_NOSTART)) { + u8 addr = i2c_8bit_addr_from_msg(msg); + + i2c->state = STATE_START; + + oc_setreg(i2c, OCI2C_DATA, addr); + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_START); + OCORES_I2C_XFER("send start, exit.\n"); + goto out; + } + i2c->state = (msg->flags & I2C_M_RD) + ? STATE_READ : STATE_WRITE; + } else { + i2c->state = STATE_DONE; + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_STOP); + OCORES_I2C_XFER("send OCI2C_CMD_STOP, exit.\n"); + goto out; + } + } + + if (i2c->state == STATE_READ) { + oc_setreg(i2c, OCI2C_CMD, i2c->pos == (msg->len-1) ? + OCI2C_CMD_READ_NACK : OCI2C_CMD_READ_ACK); + } else { + oc_setreg(i2c, OCI2C_DATA, msg->buf[i2c->pos++]); + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_WRITE); + } + +out: + OCORES_I2C_XFER("normal, exit nr %d.\n", i2c->adap.nr); + return; +} + +static irqreturn_t ocores_isr(int irq, void *dev_id) +{ + struct ocores_i2c *i2c = dev_id; + u8 stat; + unsigned long flags; + + if (!i2c) { + return IRQ_NONE; + } + + spin_lock_irqsave(&i2c->process_lock, flags); + stat = oc_getreg(i2c, OCI2C_STATUS); + if (!(stat & OCI2C_STAT_IF)) { + spin_unlock_irqrestore(&i2c->process_lock, flags); + return IRQ_NONE; + } + OCORES_I2C_XFER("Enter, irq %d nr %d addr 0x%x.\n", irq, i2c->adap.nr, (!i2c->msg)? 0 : i2c->msg->addr); + ocores_process(i2c, stat); + OCORES_I2C_XFER("Leave, irq %d nr %d addr 0x%x.\n", irq, i2c->adap.nr, (!i2c->msg)? 0 : i2c->msg->addr); + spin_unlock_irqrestore(&i2c->process_lock, flags); + + return IRQ_HANDLED; +} + +/** + * Process timeout event + * @i2c: ocores I2C device instance + */ +static void ocores_process_timeout(struct ocores_i2c *i2c) +{ + unsigned long flags; + + spin_lock_irqsave(&i2c->process_lock, flags); + i2c->state = STATE_ERROR; + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_STOP); + mdelay(1); + spin_unlock_irqrestore(&i2c->process_lock, flags); + return; +} + +/** + * Wait until something change in a given register + * @i2c: ocores I2C device instance + * @reg: register to query + * @mask: bitmask to apply on register value + * @val: expected result + * @timeout: timeout in jiffies + * + * Timeout is necessary to avoid to stay here forever when the chip + * does not answer correctly. + * + * Return: 0 on success, -ETIMEDOUT on timeout + */ +static int ocores_wait(struct ocores_i2c *i2c, + int reg, u8 mask, u8 val, + const unsigned long timeout) +{ + u8 status; + unsigned long j, jiffies_tmp; + unsigned int usleep; + + usleep = OCORE_WAIT_SCH; + j = jiffies + timeout; + while (1) { + jiffies_tmp = jiffies; + status = oc_getreg(i2c, reg); + + if ((status & mask) == val) { + break; + } + + if (time_after(jiffies_tmp, j)) { + OCORES_I2C_XFER("STATUS timeout, mask[0x%x] val[0x%x] status[0x%x]\n", mask, val, status); + return -ETIMEDOUT; + } + usleep_range(usleep,usleep + 1); + } + return 0; + +} + +/** + * Wait until is possible to process some data + * @i2c: ocores I2C device instance + * + * Used when the device is in polling mode (interrupts disabled). + * + * Return: 0 on success, -ETIMEDOUT on timeout + */ +static int ocores_poll_wait(struct ocores_i2c *i2c) +{ + u8 mask; + int err; + + if (i2c->state == STATE_DONE || i2c->state == STATE_ERROR) { + /* transfer is over */ + mask = OCI2C_STAT_BUSY; + } else { + /* on going transfer */ + mask = OCI2C_STAT_TIP; + /* + * We wait for the data to be transferred (8bit), + * then we start polling on the ACK/NACK bit + */ + udelay((8 * 1000) / i2c->bus_clock_khz); + } + + /* + * once we are here we expect to get the expected result immediately + * so if after 100ms we timeout then something is broken. + */ + err = ocores_wait(i2c, OCI2C_STATUS, mask, 0, msecs_to_jiffies(100)); + if (err) { + OCORES_I2C_XFER("STATUS timeout, bit 0x%x did not clear in 100ms, err %d\n", mask, err); + } + return err; +} + +/** + * It handles an IRQ-less transfer + * @i2c: ocores I2C device instance + * + * Even if IRQ are disabled, the I2C OpenCore IP behavior is exactly the same + * (only that IRQ are not produced). This means that we can re-use entirely + * ocores_isr(), we just add our polling code around it. + * + * It can run in atomic context + */ +static int ocores_process_polling(struct ocores_i2c *i2c) +{ + irqreturn_t ret; + int err; + + while (1) { + err = ocores_poll_wait(i2c); + if (err) { + i2c->state = STATE_ERROR; + break; /* timeout */ + } + + ret = ocores_isr(-1, i2c); + if (ret == IRQ_NONE) { + break; /* all messages have been transferred */ + } + } + + return err; +} + +static int ocores_xfer_core(struct ocores_i2c *i2c, + struct i2c_msg *msgs, int num, + bool polling) +{ + int ret; + u8 ctrl; + unsigned long flags; + + OCORES_I2C_VERBOSE("Enter ocores_xfer_core. polling mode:%d.\n", polling); + spin_lock_irqsave(&i2c->process_lock, flags); + + ctrl = oc_getreg(i2c, OCI2C_CONTROL); + if (polling) { + oc_setreg(i2c, OCI2C_CONTROL, ctrl & ~OCI2C_CTRL_IEN); + } else { + oc_setreg(i2c, OCI2C_CONTROL, ctrl | OCI2C_CTRL_IEN); + } + + i2c->msg = msgs; + i2c->pos = 0; + i2c->nmsgs = num; + i2c->state = STATE_START; + + oc_setreg(i2c, OCI2C_DATA, i2c_8bit_addr_from_msg(i2c->msg)); + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_START); + + spin_unlock_irqrestore(&i2c->process_lock, flags); + + if (polling) { + ret = ocores_process_polling(i2c); + if (ret) { + ocores_process_timeout(i2c); + return -ETIMEDOUT; + } + } else { + ret = wait_event_timeout(i2c->wait, + (i2c->state == STATE_ERROR) || + (i2c->state == STATE_DONE), HZ); + if (ret == 0) { + ocores_process_timeout(i2c); + return -ETIMEDOUT; + } + } + + return (i2c->state == STATE_DONE) ? num : -EIO; +} + +static int ocores_xfer(struct i2c_adapter *adap, + struct i2c_msg *msgs, int num) +{ + struct ocores_i2c *i2c; + int ret; + + OCORES_I2C_VERBOSE("Enter ocores_xfer.\n"); + if (!adap || ocores_msg_check(msgs, num)) { + OCORES_I2C_ERROR("[MAY BE USER SPACE ERROR]:msg buf is NULL\n"); + return -EFAULT; + } + OCORES_I2C_VERBOSE("i2c bus:%d, msgs num:%d.\n", adap->nr, num); + + i2c = i2c_get_adapdata(adap); + + if (i2c->flags & OCORES_FLAG_POLL) { + ret = ocores_xfer_core(i2c, msgs, num, true); + } else { + ret = ocores_xfer_core(i2c, msgs, num, false); + } + + return ret; +} + +static int ocores_init(struct device *dev, struct ocores_i2c *i2c) +{ + int prescale; + int diff; + u8 ctrl = oc_getreg(i2c, OCI2C_CONTROL); + + /* make sure the device is disabled */ + ctrl &= ~(OCI2C_CTRL_EN | OCI2C_CTRL_IEN); + oc_setreg(i2c, OCI2C_CONTROL, ctrl); + + prescale = (i2c->ip_clock_khz / (5 * i2c->bus_clock_khz)) - 1; + prescale = clamp(prescale, 0, 0xffff); + + diff = i2c->ip_clock_khz / (5 * (prescale + 1)) - i2c->bus_clock_khz; + if (abs(diff) > i2c->bus_clock_khz / 10) { + dev_err(dev, "Unsupported clock settings: core: %d KHz, bus: %d KHz\n", + i2c->ip_clock_khz, i2c->bus_clock_khz); + return -EINVAL; + } + + oc_setreg(i2c, OCI2C_PRELOW, prescale & 0xff); + oc_setreg(i2c, OCI2C_PREHIGH, prescale >> 8); + + /* Init the device */ + oc_setreg(i2c, OCI2C_CMD, OCI2C_CMD_IACK); + oc_setreg(i2c, OCI2C_CONTROL, ctrl | OCI2C_CTRL_EN); + + return 0; +} + +static u32 ocores_func(struct i2c_adapter *adap) +{ + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; +} + +static const struct i2c_algorithm ocores_algorithm = { + .master_xfer = ocores_xfer, + .functionality = ocores_func, +}; + +static const struct i2c_adapter ocores_adapter = { + .owner = THIS_MODULE, + .name = "wb-i2c-ocores", + .class = I2C_CLASS_DEPRECATED, + .algo = &ocores_algorithm, +}; + +static const struct of_device_id ocores_i2c_match[] = { + { + .compatible = "opencores,wb-i2c-ocores", + .data = (void *)TYPE_OCORES, + }, + {}, +}; +MODULE_DEVICE_TABLE(of, ocores_i2c_match); + +static int fpga_ocores_i2c_get_irq(struct ocores_i2c *i2c) +{ + int devfn, irq; + uint32_t pci_id; + struct device *dev; + wb_pci_dev_t *wb_pci_dev; + struct pci_dev *pci_dev; + i2c_ocores_device_t *i2c_ocores_device; + int ret; + + dev = i2c->dev; + wb_pci_dev = &i2c->wb_pci_dev; + + if (dev->of_node) { + ret = 0; + ret += of_property_read_u32(dev->of_node, "pci_domain", &wb_pci_dev->domain); + ret += of_property_read_u32(dev->of_node, "pci_bus", &wb_pci_dev->bus); + ret += of_property_read_u32(dev->of_node, "pci_slot", &wb_pci_dev->slot); + ret += of_property_read_u32(dev->of_node, "pci_fn", &wb_pci_dev->fn); + + if (ret != 0) { + OCORES_I2C_ERROR("dts config error, ret:%d.\n", ret); + ret = -EINVAL; + return ret; + } + ret = of_property_read_u32(dev->of_node, "check_pci_id", &wb_pci_dev->check_pci_id); + if (ret == 0) { + ret = of_property_read_u32(dev->of_node, "pci_id", &wb_pci_dev->pci_id); + if (ret != 0) { + OCORES_I2C_ERROR("need to check pci id, but pci id not config.\n"); + return -EINVAL; + } + } + } else { + if (i2c->dev->platform_data == NULL) { + OCORES_I2C_ERROR("Failed to get platform data config.\n"); + ret = -EINVAL; + return ret; + } + i2c_ocores_device = i2c->dev->platform_data; + wb_pci_dev->domain = i2c_ocores_device->pci_domain; + wb_pci_dev->bus = i2c_ocores_device->pci_bus; + wb_pci_dev->slot = i2c_ocores_device->pci_slot; + wb_pci_dev->fn = i2c_ocores_device->pci_fn; + wb_pci_dev->check_pci_id = i2c_ocores_device->check_pci_id; + wb_pci_dev->pci_id = i2c_ocores_device->pci_id; + } + + OCORES_I2C_VERBOSE("pci_domain:0x%x, pci_bus:0x%x, pci_slot:0x%x, pci_fn:0x%x.\n", + wb_pci_dev->domain, wb_pci_dev->bus, wb_pci_dev->slot, wb_pci_dev->fn); + + devfn = PCI_DEVFN(wb_pci_dev->slot, wb_pci_dev->fn); + pci_dev = pci_get_domain_bus_and_slot(wb_pci_dev->domain, wb_pci_dev->bus, devfn); + if (pci_dev == NULL) { + OCORES_I2C_ERROR("Failed to find pci_dev, domain:0x%04x, bus:0x%02x, devfn:0x%x\n", + wb_pci_dev->domain, wb_pci_dev->bus, devfn); + return -ENODEV; + } + if (wb_pci_dev->check_pci_id == 1) { + pci_id = (pci_dev->vendor << 16) | pci_dev->device; + if (wb_pci_dev->pci_id != pci_id) { + OCORES_I2C_ERROR("Failed to check pci id, except: 0x%x, really: 0x%x\n", + wb_pci_dev->pci_id, pci_id); + return -ENXIO; + } + OCORES_I2C_VERBOSE("pci id check ok, pci_id: 0x%x", pci_id); + } + + irq = pci_dev->irq + i2c->irq_offset; + OCORES_I2C_VERBOSE("get irq no: %d.\n", irq); + return irq; +} + +static int ocores_i2c_config_init(struct ocores_i2c *i2c) +{ + int ret; + struct device *dev; + i2c_ocores_device_t *i2c_ocores_device; + + dev = i2c->dev; + ret = 0; + + if (dev->of_node) { + ret += of_property_read_string(dev->of_node, "dev_name", &i2c->dev_name); + ret += of_property_read_u32(dev->of_node, "dev_base", &i2c->base_addr); + ret += of_property_read_u32(dev->of_node, "reg_shift", &i2c->reg_shift); + ret += of_property_read_u32(dev->of_node, "reg_io_width", &i2c->reg_io_width); + ret += of_property_read_u32(dev->of_node, "ip_clock_khz", &i2c->ip_clock_khz); + ret += of_property_read_u32(dev->of_node, "bus_clock_khz", &i2c->bus_clock_khz); + ret += of_property_read_u32(dev->of_node, "reg_access_mode", &i2c->reg_access_mode); + + if (ret != 0) { + OCORES_I2C_ERROR("dts config error, ret:%d.\n", ret); + ret = -ENXIO; + return ret; + } + } else { + if (i2c->dev->platform_data == NULL) { + OCORES_I2C_ERROR("Failed to get platform data config.\n"); + ret = -ENXIO; + return ret; + } + i2c_ocores_device = i2c->dev->platform_data; + i2c->dev_name = i2c_ocores_device->dev_name; + i2c->adap_nr = i2c_ocores_device->adap_nr; + i2c->big_endian = i2c_ocores_device->big_endian; + i2c->base_addr = i2c_ocores_device->dev_base; + i2c->reg_shift = i2c_ocores_device->reg_shift; + i2c->reg_io_width = i2c_ocores_device->reg_io_width; + i2c->ip_clock_khz = i2c_ocores_device->ip_clock_khz; + i2c->bus_clock_khz = i2c_ocores_device->bus_clock_khz; + i2c->reg_access_mode = i2c_ocores_device->reg_access_mode; + } + + OCORES_I2C_VERBOSE("name:%s, base:0x%x, reg_shift:0x%x, io_width:0x%x, ip_clock_khz:0x%x, bus_clock_khz:0x%x.\n", + i2c->dev_name, i2c->base_addr, i2c->reg_shift, i2c->reg_io_width, i2c->ip_clock_khz, i2c->bus_clock_khz); + OCORES_I2C_VERBOSE("reg access mode:%d.\n", i2c->reg_access_mode); + return ret; +} + +static int ocores_i2c_probe(struct platform_device *pdev) +{ + struct ocores_i2c *i2c; + int irq, ret; + bool be; + i2c_ocores_device_t *i2c_ocores_device; + + OCORES_I2C_VERBOSE("Enter main probe\n"); + + i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL); + if (!i2c) { + dev_err(&pdev->dev, "devm_kzalloc failed.\n"); + return -ENOMEM; + } + + spin_lock_init(&i2c->process_lock); + + i2c->dev = &pdev->dev; + ret = ocores_i2c_config_init(i2c); + if (ret !=0) { + dev_err(i2c->dev, "Failed to get ocores i2c dts config.\n"); + goto out; + } + + if (i2c->dev->of_node) { + if (of_property_read_u32(i2c->dev->of_node, "big_endian", &i2c->big_endian)) { + + be = 0; + } else { + be = i2c->big_endian; + } + } else { + be = i2c->big_endian; + } + + if (i2c->reg_io_width == 0) { + i2c->reg_io_width = 1; /* Set to default value */ + } + + if (!i2c->setreg || !i2c->getreg) { + switch (i2c->reg_io_width) { + case REG_IO_WIDTH_1: + i2c->setreg = oc_setreg_8; + i2c->getreg = oc_getreg_8; + break; + + case REG_IO_WIDTH_2: + i2c->setreg = be ? oc_setreg_16be : oc_setreg_16; + i2c->getreg = be ? oc_getreg_16be : oc_getreg_16; + break; + + case REG_IO_WIDTH_4: + i2c->setreg = be ? oc_setreg_32be : oc_setreg_32; + i2c->getreg = be ? oc_getreg_32be : oc_getreg_32; + break; + + default: + dev_err(i2c->dev, "Unsupported I/O width (%d)\n", + i2c->reg_io_width); + ret = -EINVAL; + goto out; + } + } + + init_waitqueue_head(&i2c->wait); + irq = -1; + + if (i2c->dev->of_node) { + if (of_property_read_u32(i2c->dev->of_node, "irq_offset", &i2c->irq_offset)) { + + i2c->flags |= OCORES_FLAG_POLL; + } else { + + irq = fpga_ocores_i2c_get_irq(i2c); + if (irq < 0 ) { + dev_err(i2c->dev, "Failed to get ocores i2c irq number, ret: %d.\n", irq); + ret = irq; + goto out; + } + } + } else { + if (i2c->dev->platform_data == NULL) { + + i2c->flags |= OCORES_FLAG_POLL; + OCORES_I2C_VERBOSE("Failed to get platform data config, set OCORES_FLAG_POLL.\n"); + } else { + i2c_ocores_device = i2c->dev->platform_data; + if (i2c_ocores_device->irq_type == 0) { + + i2c->flags |= OCORES_FLAG_POLL; + } else { + i2c->irq_offset = i2c_ocores_device->irq_offset; + irq = fpga_ocores_i2c_get_irq(i2c); + if (irq < 0 ) { + dev_err(i2c->dev, "Failed to get ocores i2c irq number, ret: %d.\n", irq); + ret = irq; + goto out; + } + } + } + } + + if (!(i2c->flags & OCORES_FLAG_POLL)) { + ret = devm_request_irq(&pdev->dev, irq, ocores_isr, 0, + pdev->name, i2c); + if (ret) { + dev_err(i2c->dev, "Cannot claim IRQ\n"); + goto out; + } + } + + ret = ocores_init(i2c->dev, i2c); + if (ret) { + goto out; + } + + /* hook up driver to tree */ + platform_set_drvdata(pdev, i2c); + i2c->adap = ocores_adapter; + i2c_set_adapdata(&i2c->adap, i2c); + i2c->adap.dev.parent = &pdev->dev; + i2c->adap.dev.of_node = pdev->dev.of_node; + + if (i2c->dev->of_node) { + /* adap.nr get from dts aliases */ + ret = i2c_add_adapter(&i2c->adap); + } else { + i2c->adap.nr = i2c->adap_nr; + ret = i2c_add_numbered_adapter(&i2c->adap); + } + if (ret) { + goto fail_add; + } + OCORES_I2C_VERBOSE("Main probe out\n"); + dev_info(i2c->dev, "registered i2c-%d for %s with base address:0x%x success.\n", + i2c->adap.nr, i2c->dev_name, i2c->base_addr); + return 0; +fail_add: + platform_set_drvdata(pdev, NULL); +out: + return ret; +} + +static int ocores_i2c_remove(struct platform_device *pdev) +{ + struct ocores_i2c *i2c = platform_get_drvdata(pdev); + u8 ctrl = oc_getreg(i2c, OCI2C_CONTROL); + + /* disable i2c logic */ + ctrl &= ~(OCI2C_CTRL_EN | OCI2C_CTRL_IEN); + oc_setreg(i2c, OCI2C_CONTROL, ctrl); + + /* remove adapter & data */ + i2c_del_adapter(&i2c->adap); + return 0; +} + +static struct platform_driver ocores_i2c_driver = { + .probe = ocores_i2c_probe, + .remove = ocores_i2c_remove, + .driver = { + .name = "wb-ocores-i2c", + .of_match_table = ocores_i2c_match, + }, +}; + +module_platform_driver(ocores_i2c_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("OpenCores I2C bus driver"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:ocores-i2c"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_ocores.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_ocores.h new file mode 100644 index 000000000000..d413ebb3ad44 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_i2c_ocores.h @@ -0,0 +1,30 @@ +#ifndef __WB_I2C_OCORES_H__ +#define __WB_I2C_OCORES_H__ +#include + +#define mem_clear(data, size) memset((data), 0, (size)) +#define I2C_OCORES_DEV_NAME_MAX_LEN (64) + +typedef struct i2c_ocores_device_s { + uint32_t big_endian; + char dev_name[I2C_OCORES_DEV_NAME_MAX_LEN]; + int adap_nr; + uint32_t dev_base; + uint32_t reg_shift; + uint32_t reg_io_width; + uint32_t ip_clock_khz; + uint32_t bus_clock_khz; + uint32_t reg_access_mode; + + uint32_t irq_type; + uint32_t irq_offset; + uint32_t pci_domain; + uint32_t pci_bus; + uint32_t pci_slot; + uint32_t pci_fn; + uint32_t check_pci_id; + uint32_t pci_id; + int device_flag; +} i2c_ocores_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_io_dev.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_io_dev.c new file mode 100644 index 000000000000..03571871014b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_io_dev.c @@ -0,0 +1,598 @@ +/* + * wb_io_dev.c + * ko to read/write ioports through /dev/XXX device + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_io_dev.h" + +#define PROXY_NAME "wb-io-dev" +#define MAX_IO_DEV_NUM (256) +#define IO_RDWR_MAX_LEN (256) +#define MAX_NAME_SIZE (20) +#define IO_INDIRECT_ADDR_H(addr) ((addr >> 8) & 0xff) +#define IO_INDIRECT_ADDR_L(addr) ((addr) & 0xff) +#define IO_INDIRECT_OP_WRITE (0x2) +#define IO_INDIRECT_OP_READ (0X3) + +#define KERNEL_SPASE (0) +#define USER_SPASE (1) + +static int g_io_dev_debug = 0; +static int g_io_dev_error = 0; + +module_param(g_io_dev_debug, int, S_IRUGO | S_IWUSR); +module_param(g_io_dev_error, int, S_IRUGO | S_IWUSR); + +#define IO_DEV_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_io_dev_debug) { \ + printk(KERN_INFO "[IO_DEV][VER][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define IO_DEV_DEBUG_ERROR(fmt, args...) do { \ + if (g_io_dev_error) { \ + printk(KERN_ERR "[IO_DEV][ERR][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +typedef struct wb_io_dev_s { + const char *name; + uint32_t io_base; + uint32_t io_len; + uint32_t indirect_addr; + uint32_t wr_data; + uint32_t addr_low; + uint32_t addr_high; + uint32_t rd_data; + uint32_t opt_ctl; + spinlock_t io_dev_lock; + struct miscdevice misc; +} wb_io_dev_t; + +static wb_io_dev_t* io_dev_arry[MAX_IO_DEV_NUM]; + +static int io_dev_open(struct inode *inode, struct file *file) +{ + unsigned int minor = iminor(inode); + wb_io_dev_t *wb_io_dev; + + if (minor >= MAX_IO_DEV_NUM) { + IO_DEV_DEBUG_ERROR("minor out of range, minor = %d.\n", minor); + return -ENODEV; + } + + wb_io_dev = io_dev_arry[minor]; + if (wb_io_dev == NULL) { + IO_DEV_DEBUG_ERROR("wb_io_dev is NULL, open failed, minor = %d\n", minor); + return -ENODEV; + } + + file->private_data = wb_io_dev; + return 0; +} + +static int io_dev_release(struct inode *inode, struct file *file) +{ + file->private_data = NULL; + return 0; +} + +uint8_t io_indirect_addressing_read(wb_io_dev_t *wb_io_dev, uint32_t address) +{ + uint8_t addr_l, addr_h, value; + unsigned long flags; + + addr_h = IO_INDIRECT_ADDR_H(address); + addr_l = IO_INDIRECT_ADDR_L(address); + IO_DEV_DEBUG_VERBOSE("read one count, addr = 0x%x\n", address); + + spin_lock_irqsave(&wb_io_dev->io_dev_lock, flags); + + outb(addr_l, wb_io_dev->io_base + wb_io_dev->addr_low); + + outb(addr_h, wb_io_dev->io_base + wb_io_dev->addr_high); + + outb(IO_INDIRECT_OP_READ, wb_io_dev->io_base + wb_io_dev->opt_ctl); + + value = inb(wb_io_dev->io_base + wb_io_dev->rd_data); + + spin_unlock_irqrestore(&wb_io_dev->io_dev_lock, flags); + + return value; +} + +static int io_dev_read_tmp(wb_io_dev_t *wb_io_dev, uint32_t offset, uint8_t *buf, size_t count) +{ + int i; + + if (offset > wb_io_dev->io_len) { + IO_DEV_DEBUG_VERBOSE("offset:0x%x, io len:0x%x, EOF.\n", offset, wb_io_dev->io_len); + return 0; + } + + if (count > wb_io_dev->io_len - offset) { + IO_DEV_DEBUG_VERBOSE("read count out of range. input len:%lu, read len:%u.\n", + count, wb_io_dev->io_len - offset); + count = wb_io_dev->io_len - offset; + } + if (wb_io_dev->indirect_addr) { + for (i = 0; i < count; i++) { + buf[i] = io_indirect_addressing_read(wb_io_dev, offset + i); + } + } else { + for (i = 0; i < count; i++) { + buf[i] = inb(wb_io_dev->io_base + offset + i); + } + } + + return count; +} + +static ssize_t io_dev_read(struct file *file, char __user *buf, size_t count, loff_t *offset, int flag) +{ + wb_io_dev_t *wb_io_dev; + int ret, read_len; + u8 buf_tmp[IO_RDWR_MAX_LEN]; + + wb_io_dev = file->private_data; + if (wb_io_dev == NULL) { + IO_DEV_DEBUG_ERROR("wb_io_dev is NULL, read failed.\n"); + return -EINVAL; + } + + if (count == 0) { + IO_DEV_DEBUG_ERROR("Invalid params, read count is 0.\n"); + return -EINVAL; + } + + if (count > sizeof(buf_tmp)) { + IO_DEV_DEBUG_VERBOSE("read count %lu exceed max %lu.\n", count, sizeof(buf_tmp)); + count = sizeof(buf_tmp); + } + + mem_clear(buf_tmp, sizeof(buf_tmp)); + read_len = io_dev_read_tmp(wb_io_dev, *offset, buf_tmp, count); + if (read_len < 0) { + IO_DEV_DEBUG_ERROR("io_dev_read_tmp failed, ret:%d.\n", read_len); + return read_len; + } + + /* check flag is user spase or kernel spase */ + if (flag == USER_SPASE) { + IO_DEV_DEBUG_VERBOSE("user space read, buf: %p, offset: %lld, read count %lu.\n", + buf, *offset, count); + if (copy_to_user(buf, buf_tmp, read_len)) { + IO_DEV_DEBUG_ERROR("copy_to_user failed.\n"); + return -EFAULT; + } + } else { + IO_DEV_DEBUG_VERBOSE("kernel space read, buf: %p, offset: %lld, read count %lu.\n", + buf, *offset, count); + memcpy(buf, buf_tmp, read_len); + } + *offset += read_len; + ret = read_len; + return ret; +} + +static ssize_t io_dev_read_user(struct file *file, char __user *buf, size_t count, loff_t *offset) +{ + int ret; + + IO_DEV_DEBUG_VERBOSE("io_dev_read_user, file: %p, count: %lu, offset: %lld\n", + file, count, *offset); + ret = io_dev_read(file, buf, count, offset, USER_SPASE); + return ret; +} + +static ssize_t io_dev_read_iter(struct kiocb *iocb, struct iov_iter *to) +{ + int ret; + + IO_DEV_DEBUG_VERBOSE("io_dev_read_iter, file: %p, count: %lu, offset: %lld\n", + iocb->ki_filp, to->count, iocb->ki_pos); + ret = io_dev_read(iocb->ki_filp, to->kvec->iov_base, to->count, &iocb->ki_pos, KERNEL_SPASE); + return ret; +} + +void io_indirect_addressing_write(wb_io_dev_t *wb_io_dev, uint32_t address, uint8_t reg_val) +{ + uint8_t addr_l, addr_h; + unsigned long flags; + + addr_h = IO_INDIRECT_ADDR_H(address); + addr_l = IO_INDIRECT_ADDR_L(address); + IO_DEV_DEBUG_VERBOSE("write one count, addr = 0x%x\n", address); + + spin_lock_irqsave(&wb_io_dev->io_dev_lock, flags); + + outb(reg_val, wb_io_dev->io_base + wb_io_dev->wr_data); + + outb(addr_l, wb_io_dev->io_base + wb_io_dev->addr_low); + + outb(addr_h, wb_io_dev->io_base + wb_io_dev->addr_high); + + outb(IO_INDIRECT_OP_WRITE, wb_io_dev->io_base + wb_io_dev->opt_ctl); + + spin_unlock_irqrestore(&wb_io_dev->io_dev_lock, flags); + + return; +} + +static int io_dev_write_tmp(wb_io_dev_t *wb_io_dev, uint32_t offset, uint8_t *buf, size_t count) +{ + int i; + + if (offset > wb_io_dev->io_len) { + IO_DEV_DEBUG_VERBOSE("offset:0x%x, io len:0x%x, EOF.\n", offset, wb_io_dev->io_len); + return 0; + } + + if (count > wb_io_dev->io_len - offset) { + IO_DEV_DEBUG_VERBOSE("write count out of range. input len:%lu, write len:%u.\n", + count, wb_io_dev->io_len - offset); + count = wb_io_dev->io_len - offset; + } + if (wb_io_dev->indirect_addr) { + for (i = 0; i < count; i++) { + io_indirect_addressing_write(wb_io_dev, offset + i, buf[i]); + } + } else { + for (i = 0; i < count; i++) { + outb(buf[i], wb_io_dev->io_base + offset + i); + } + } + + return count; +} + +static ssize_t io_dev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset, int flag) +{ + wb_io_dev_t *wb_io_dev; + int write_len; + u8 buf_tmp[IO_RDWR_MAX_LEN]; + + wb_io_dev = file->private_data; + if (wb_io_dev == NULL) { + IO_DEV_DEBUG_ERROR("wb_io_dev is NULL, write failed.\n"); + return -EINVAL; + } + + if (count == 0) { + IO_DEV_DEBUG_ERROR("Invalid params, write count is 0.\n"); + return -EINVAL; + } + + if (count > sizeof(buf_tmp)) { + IO_DEV_DEBUG_VERBOSE("write count %lu exceed max %lu.\n", count, sizeof(buf_tmp)); + count = sizeof(buf_tmp); + } + + mem_clear(buf_tmp, sizeof(buf_tmp)); + /* check flag is user spase or kernel spase */ + if (flag == USER_SPASE) { + IO_DEV_DEBUG_VERBOSE("user space write, buf: %p, offset: %lld, write count %lu.\n", + buf, *offset, count); + if (copy_from_user(buf_tmp, buf, count)) { + IO_DEV_DEBUG_ERROR("copy_from_user failed.\n"); + return -EFAULT; + } + } else { + IO_DEV_DEBUG_VERBOSE("kernel space write, buf: %p, offset: %lld, write count %lu.\n", + buf, *offset, count); + memcpy(buf_tmp, buf, count); + } + + write_len = io_dev_write_tmp(wb_io_dev, *offset, buf_tmp, count); + if (write_len < 0) { + IO_DEV_DEBUG_ERROR("io_dev_write_tmp failed, ret:%d.\n", write_len); + return write_len; + } + + *offset += write_len; + return write_len; +} + +static ssize_t io_dev_write_user(struct file *file, const char __user *buf, size_t count, loff_t *offset) +{ + int ret; + + IO_DEV_DEBUG_VERBOSE("io_dev_write_user, file: %p, count: %lu, offset: %lld\n", + file, count, *offset); + ret = io_dev_write(file, buf, count, offset, USER_SPASE); + return ret; +} + +static ssize_t io_dev_write_iter(struct kiocb *iocb, struct iov_iter *from) +{ + int ret; + + IO_DEV_DEBUG_VERBOSE("io_dev_write_iter, file: %p, count: %lu, offset: %lld\n", + iocb->ki_filp, from->count, iocb->ki_pos); + ret = io_dev_write(iocb->ki_filp, from->kvec->iov_base, from->count, &iocb->ki_pos, KERNEL_SPASE); + return ret; +} + +static loff_t io_dev_llseek(struct file *file, loff_t offset, int origin) +{ + loff_t ret = 0; + wb_io_dev_t *wb_io_dev; + + wb_io_dev = file->private_data; + if (wb_io_dev == NULL) { + IO_DEV_DEBUG_ERROR("wb_io_dev is NULL, llseek failed.\n"); + return -EINVAL; + } + + switch (origin) { + case SEEK_SET: + if (offset < 0) { + IO_DEV_DEBUG_ERROR("SEEK_SET, offset:%lld, invalid.\n", offset); + ret = -EINVAL; + break; + } + if (offset > wb_io_dev->io_len) { + IO_DEV_DEBUG_ERROR("SEEK_SET out of range, offset:%lld, io_len:0x%x.\n", + offset, wb_io_dev->io_len); + ret = - EINVAL; + break; + } + file->f_pos = offset; + ret = file->f_pos; + break; + case SEEK_CUR: + if (((file->f_pos + offset) > wb_io_dev->io_len) || ((file->f_pos + offset) < 0)) { + IO_DEV_DEBUG_ERROR("SEEK_CUR out of range, f_ops:%lld, offset:%lld, io_len:0x%x.\n", + file->f_pos, offset, wb_io_dev->io_len); + ret = - EINVAL; + break; + } + file->f_pos += offset; + ret = file->f_pos; + break; + default: + IO_DEV_DEBUG_ERROR("unsupport llseek type:%d.\n", origin); + ret = -EINVAL; + break; + } + return ret; +} + +static long io_dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + return 0; +} + +static const struct file_operations io_dev_fops = { + .owner = THIS_MODULE, + .llseek = io_dev_llseek, + .read = io_dev_read_user, + .write = io_dev_write_user, + .read_iter = io_dev_read_iter, + .write_iter = io_dev_write_iter, + .unlocked_ioctl = io_dev_ioctl, + .open = io_dev_open, + .release = io_dev_release, +}; + +static wb_io_dev_t *dev_match(const char *path) +{ + wb_io_dev_t *wb_io_dev; + char dev_name[MAX_NAME_SIZE]; + int i; + + for (i = 0; i < MAX_IO_DEV_NUM; i++) { + if (io_dev_arry[i] == NULL) { + continue; + } + wb_io_dev = io_dev_arry[i]; + snprintf(dev_name, MAX_NAME_SIZE,"/dev/%s", wb_io_dev->name); + if (!strcmp(path, dev_name)) { + IO_DEV_DEBUG_VERBOSE("get dev_name = %s, minor = %d\n", dev_name, i); + return wb_io_dev; + } + } + + return NULL; +} + +int io_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count) +{ + wb_io_dev_t *wb_io_dev; + int read_len; + + if (path == NULL) { + IO_DEV_DEBUG_ERROR("path NULL"); + return -EINVAL; + } + + if (buf == NULL) { + IO_DEV_DEBUG_ERROR("buf NULL"); + return -EINVAL; + } + + wb_io_dev = dev_match(path); + if (wb_io_dev == NULL) { + IO_DEV_DEBUG_ERROR("io_dev match failed. dev path = %s", path); + return -EINVAL; + } + + read_len = io_dev_read_tmp(wb_io_dev, offset, buf, count); + if (read_len < 0) { + IO_DEV_DEBUG_ERROR("io_dev_read_tmp failed, ret:%d.\n", read_len); + } + return read_len; +} +EXPORT_SYMBOL(io_device_func_read); + +int io_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count) +{ + wb_io_dev_t *wb_io_dev; + int write_len; + + if (path == NULL) { + IO_DEV_DEBUG_ERROR("path NULL"); + return -EINVAL; + } + + if (buf == NULL) { + IO_DEV_DEBUG_ERROR("buf NULL"); + return -EINVAL; + } + + wb_io_dev = dev_match(path); + if (wb_io_dev == NULL) { + IO_DEV_DEBUG_ERROR("i2c_dev match failed. dev path = %s", path); + return -EINVAL; + } + + write_len = io_dev_write_tmp(wb_io_dev, offset, buf, count); + if (write_len < 0) { + IO_DEV_DEBUG_ERROR("io_dev_write_tmp failed, ret:%d.\n", write_len); + } + return write_len; +} +EXPORT_SYMBOL(io_device_func_write); + +static int io_dev_probe(struct platform_device *pdev) +{ + int ret; + wb_io_dev_t *wb_io_dev; + struct miscdevice *misc; + io_dev_device_t *io_dev_device; + + wb_io_dev = devm_kzalloc(&pdev->dev, sizeof(wb_io_dev_t), GFP_KERNEL); + if (!wb_io_dev) { + dev_err(&pdev->dev, "devm_kzalloc failed.\n"); + ret = -ENOMEM; + return ret; + } + spin_lock_init(&wb_io_dev->io_dev_lock); + + if (pdev->dev.of_node) { + ret = 0; + ret += of_property_read_string(pdev->dev.of_node, "io_dev_name", &wb_io_dev->name); + ret += of_property_read_u32(pdev->dev.of_node, "io_base", &wb_io_dev->io_base); + ret += of_property_read_u32(pdev->dev.of_node, "io_len", &wb_io_dev->io_len); + if (of_property_read_bool(pdev->dev.of_node, "indirect_addr")) { + + wb_io_dev->indirect_addr = 1; + ret += of_property_read_u32(pdev->dev.of_node, "wr_data", &wb_io_dev->wr_data); + ret += of_property_read_u32(pdev->dev.of_node, "addr_low", &wb_io_dev->addr_low); + ret += of_property_read_u32(pdev->dev.of_node, "addr_high", &wb_io_dev->addr_high); + ret += of_property_read_u32(pdev->dev.of_node, "rd_data", &wb_io_dev->rd_data); + ret += of_property_read_u32(pdev->dev.of_node, "opt_ctl", &wb_io_dev->opt_ctl); + } else { + + wb_io_dev->indirect_addr = 0; + } + if (ret != 0) { + dev_err(&pdev->dev, "Failed to get dts config, ret:%d.\n", ret); + return -ENXIO; + } + } else { + if (pdev->dev.platform_data == NULL) { + dev_err(&pdev->dev, "Failed to get platform data config.\n"); + return -ENXIO; + } + io_dev_device = pdev->dev.platform_data; + wb_io_dev->name = io_dev_device->io_dev_name; + wb_io_dev->io_base = io_dev_device->io_base; + wb_io_dev->io_len = io_dev_device->io_len; + wb_io_dev->indirect_addr = io_dev_device->indirect_addr; + if (wb_io_dev->indirect_addr == 1) { + wb_io_dev->wr_data = io_dev_device->wr_data; + wb_io_dev->addr_low = io_dev_device->addr_low; + wb_io_dev->addr_high = io_dev_device->addr_high; + wb_io_dev->rd_data = io_dev_device->rd_data; + wb_io_dev->opt_ctl = io_dev_device->opt_ctl; + } + } + + IO_DEV_DEBUG_VERBOSE("name:%s, io base:0x%x, io len:0x%x, addressing type:%s.\n", + wb_io_dev->name, wb_io_dev->io_base, wb_io_dev->io_len, + wb_io_dev->indirect_addr ? "indirect" : "direct"); + + misc = &wb_io_dev->misc; + misc->minor = MISC_DYNAMIC_MINOR; + misc->name = wb_io_dev->name; + misc->fops = &io_dev_fops; + misc->mode = 0666; + if (misc_register(misc) != 0) { + dev_err(&pdev->dev, "Failed to register %s device.\n", misc->name); + return -ENXIO; + } + if (misc->minor >= MAX_IO_DEV_NUM) { + dev_err(&pdev->dev, "Error: device minor[%d] more than max io device num[%d].\n", + misc->minor, MAX_IO_DEV_NUM); + misc_deregister(misc); + return -EINVAL; + } + io_dev_arry[misc->minor] = wb_io_dev; + dev_info(&pdev->dev, "register %s device [0x%x][0x%x] with minor %d using %s addressing success.\n", + misc->name, wb_io_dev->io_base, wb_io_dev->io_len, misc->minor, + wb_io_dev->indirect_addr ? "indirect" : "direct"); + + return 0; +} + +static int io_dev_remove(struct platform_device *pdev) +{ + int i; + + for (i = 0; i < MAX_IO_DEV_NUM ; i++) { + if (io_dev_arry[i] != NULL) { + misc_deregister(&io_dev_arry[i]->misc); + io_dev_arry[i] = NULL; + } + } + + return 0; +} + +static struct of_device_id io_dev_match[] = { + { + .compatible = "wb-io-dev", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, io_dev_match); + +static struct platform_driver wb_io_dev_driver = { + .probe = io_dev_probe, + .remove = io_dev_remove, + .driver = { + .owner = THIS_MODULE, + .name = PROXY_NAME, + .of_match_table = io_dev_match, + }, +}; + +static int __init wb_io_dev_init(void) +{ + return platform_driver_register(&wb_io_dev_driver); +} + +static void __exit wb_io_dev_exit(void) +{ + platform_driver_unregister(&wb_io_dev_driver); +} + +module_init(wb_io_dev_init); +module_exit(wb_io_dev_exit); +MODULE_DESCRIPTION("IO device driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_io_dev.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_io_dev.h new file mode 100644 index 000000000000..3a1a10f0f20c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_io_dev.h @@ -0,0 +1,21 @@ +#ifndef __WB_IO_DEV_H__ +#define __WB_IO_DEV_H__ +#include + +#define mem_clear(data, size) memset((data), 0, (size)) +#define IO_DEV_NAME_MAX_LEN (64) + +typedef struct io_dev_device_s { + char io_dev_name[IO_DEV_NAME_MAX_LEN]; + uint32_t io_base; + uint32_t io_len; + uint32_t indirect_addr; + uint32_t wr_data; + uint32_t addr_low; + uint32_t addr_high; + uint32_t rd_data; + uint32_t opt_ctl; + int device_flag; +} io_dev_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_lpc_drv.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_lpc_drv.c new file mode 100644 index 000000000000..c079dc409696 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_lpc_drv.c @@ -0,0 +1,166 @@ +/* + * wb_lpc_drv.c + * ko to set lpc pcie config io addr and enable lpc + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_lpc_drv.h" + +#define LPC_DRIVER_NAME "wb-lpc" +#define LPC_MAKE_PCI_IO_RANGE(__base) ((0xfc0001) | ((__base) & (0xFFFC))) + +int g_lpc_dev_debug = 0; +int g_lpc_dev_error = 0; + +module_param(g_lpc_dev_debug, int, S_IRUGO | S_IWUSR); +module_param(g_lpc_dev_error, int, S_IRUGO | S_IWUSR); + +#define LPC_DEV_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_lpc_dev_debug) { \ + printk(KERN_INFO "[LPC_DEV][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define LPC_DEV_DEBUG_ERROR(fmt, args...) do { \ + if (g_lpc_dev_error) { \ + printk(KERN_ERR "[LPC_DEV][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +typedef struct wb_lpc_dev_s { + const char *lpc_io_name; + uint32_t domain; + uint32_t bus; + uint32_t slot; + uint32_t fn; + uint32_t lpc_io_base; + uint32_t lpc_io_size; + uint32_t lpc_gen_dec; +} wb_lpc_dev_t; + +static int wb_lpc_probe(struct platform_device *pdev) +{ + int ret, devfn; + wb_lpc_dev_t *wb_lpc_dev; + struct pci_dev *pci_dev; + lpc_drv_device_t *lpc_drv_device; + + wb_lpc_dev = devm_kzalloc(&pdev->dev, sizeof(wb_lpc_dev_t), GFP_KERNEL); + if (!wb_lpc_dev) { + dev_err(&pdev->dev, "devm_kzalloc failed.\n"); + ret = -ENOMEM; + return ret; + } + + if (pdev->dev.of_node) { + ret = 0; + ret += of_property_read_string(pdev->dev.of_node, "lpc_io_name", &wb_lpc_dev->lpc_io_name); + ret += of_property_read_u32(pdev->dev.of_node, "pci_domain", &wb_lpc_dev->domain); + ret += of_property_read_u32(pdev->dev.of_node, "pci_bus", &wb_lpc_dev->bus); + ret += of_property_read_u32(pdev->dev.of_node, "pci_slot", &wb_lpc_dev->slot); + ret += of_property_read_u32(pdev->dev.of_node, "pci_fn", &wb_lpc_dev->fn); + ret += of_property_read_u32(pdev->dev.of_node, "lpc_io_base", &wb_lpc_dev->lpc_io_base); + ret += of_property_read_u32(pdev->dev.of_node, "lpc_io_size", &wb_lpc_dev->lpc_io_size); + ret += of_property_read_u32(pdev->dev.of_node, "lpc_gen_dec", &wb_lpc_dev->lpc_gen_dec); + if (ret != 0) { + dev_err(&pdev->dev, "Failed to get dts config, ret:%d.\n", ret); + return -ENXIO; + } + } else { + if (pdev->dev.platform_data == NULL) { + dev_err(&pdev->dev, "Failed to get platform data config.\n"); + return -ENXIO; + } + lpc_drv_device = pdev->dev.platform_data; + wb_lpc_dev->lpc_io_name = lpc_drv_device->lpc_io_name; + wb_lpc_dev->domain = lpc_drv_device->pci_domain; + wb_lpc_dev->bus = lpc_drv_device->pci_bus; + wb_lpc_dev->slot = lpc_drv_device->pci_slot; + wb_lpc_dev->fn = lpc_drv_device->pci_fn; + wb_lpc_dev->lpc_io_base = lpc_drv_device->lpc_io_base; + wb_lpc_dev->lpc_io_size = lpc_drv_device->lpc_io_size; + wb_lpc_dev->lpc_gen_dec = lpc_drv_device->lpc_gen_dec; + } + + LPC_DEV_DEBUG_VERBOSE("domain:0x%04x, bus:0x%02x, slot:0x%02x, fn:%u\n", + wb_lpc_dev->domain,wb_lpc_dev->bus, wb_lpc_dev->slot, wb_lpc_dev->fn); + LPC_DEV_DEBUG_VERBOSE("lpc_io_name:%s, lpc_io_base:0x%x, lpc_io_size:%u, lpc_gen_dec:0x%x.\n", + wb_lpc_dev->lpc_io_name, wb_lpc_dev->lpc_io_base, wb_lpc_dev->lpc_io_size, wb_lpc_dev->lpc_gen_dec); + + devfn = PCI_DEVFN(wb_lpc_dev->slot, wb_lpc_dev->fn); + pci_dev = pci_get_domain_bus_and_slot(wb_lpc_dev->domain, wb_lpc_dev->bus, devfn); + if (pci_dev == NULL) { + dev_err(&pdev->dev, "Failed to find pci_dev, domain:0x%04x, bus:0x%02x, devfn:0x%x\n", + wb_lpc_dev->domain, wb_lpc_dev->bus, devfn); + return -ENXIO; + } + + pci_write_config_dword(pci_dev, wb_lpc_dev->lpc_gen_dec, LPC_MAKE_PCI_IO_RANGE(wb_lpc_dev->lpc_io_base)); + if (!request_region(wb_lpc_dev->lpc_io_base, wb_lpc_dev->lpc_io_size, wb_lpc_dev->lpc_io_name)) { + dev_err(&pdev->dev, "Failed to request_region [0x%x][0x%x].\n", wb_lpc_dev->lpc_io_base, wb_lpc_dev->lpc_io_size); + return -EBUSY; + } + + platform_set_drvdata(pdev, wb_lpc_dev); + + dev_info(&pdev->dev, "lpc request_region [0x%x][0x%x] success.\n", wb_lpc_dev->lpc_io_base, wb_lpc_dev->lpc_io_size); + + return 0; +} + +static int wb_lpc_remove(struct platform_device *pdev) +{ + wb_lpc_dev_t *wb_lpc_dev; + + wb_lpc_dev = platform_get_drvdata(pdev); + if (wb_lpc_dev) { + release_region(wb_lpc_dev->lpc_io_base , wb_lpc_dev->lpc_io_size); + LPC_DEV_DEBUG_VERBOSE("lpc base:0x%x, len:0x%x.\n", wb_lpc_dev->lpc_io_base, wb_lpc_dev->lpc_io_size); + } + LPC_DEV_DEBUG_VERBOSE("lpc remove.\n"); + + return 0; +} + +static struct of_device_id lpc_dev_match[] = { + { + .compatible = "wb-lpc", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, lpc_dev_match); + +static struct platform_driver wb_lpc_driver = { + .probe = wb_lpc_probe, + .remove = wb_lpc_remove, + .driver = { + .owner = THIS_MODULE, + .name = LPC_DRIVER_NAME, + .of_match_table = lpc_dev_match, + }, +}; + +static int __init wb_lpc_init(void) +{ + return platform_driver_register(&wb_lpc_driver); +} + +static void __exit wb_lpc_exit(void) +{ + platform_driver_unregister(&wb_lpc_driver); +} + +module_init(wb_lpc_init); +module_exit(wb_lpc_exit); +MODULE_DESCRIPTION("lpc driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_lpc_drv.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_lpc_drv.h new file mode 100644 index 000000000000..76e8c32c12e9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_lpc_drv.h @@ -0,0 +1,18 @@ +#ifndef __WB_LPC_DRV_H__ +#define __WB_LPC_DRV_H__ + +#define LPC_IO_NAME_MAX_LEN (64) + +typedef struct lpc_drv_device_s { + char lpc_io_name[LPC_IO_NAME_MAX_LEN]; + int pci_domain; + int pci_bus; + int pci_slot; + int pci_fn; + int lpc_io_base; + int lpc_io_size; + int lpc_gen_dec; + int device_flag; +} lpc_drv_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_mac_bsc.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_mac_bsc.c new file mode 100644 index 000000000000..a94ae020a4b7 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_mac_bsc.c @@ -0,0 +1,867 @@ +/* + * + * Copyright (c) 1998, 1999 Frodo Looijaard + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +#define MAC_TEMP_INVALID (99999999) +#define MAC_ID_REG (0x02000000) + +#define MAC_REG_ADDR_WIDTH (4) +#define MAC_REG_DATA_WIDTH (4) +#define MAC_BSC_MAX_TEMP_NUM (16) +#define MAC_BSC_MAX_READ_REG_STEP (6) +#define MAC_BSC_MAX_SETUP_NUM (1) + +#define MAC_BSC_MAX_RETRY (3) +#define MAC_BSC_RETRY_SLEEP_TIME (10000) /* 10ms */ + +static int g_wb_mac_bsc_debug = 0; +static int g_wb_mac_bsc_error = 0; + +module_param(g_wb_mac_bsc_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_mac_bsc_error, int, S_IRUGO | S_IWUSR); + +#define WB_MAC_BSC_DEBUG(fmt, args...) do { \ + if (g_wb_mac_bsc_debug) { \ + printk(KERN_INFO "[MAC_BSC][VER][func:%s line:%d] "fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_MAC_BSC_ERROR(fmt, args...) do { \ + if (g_wb_mac_bsc_error) { \ + printk(KERN_ERR "[MAC_BSC][ERR][func:%s line:%d]"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +typedef enum{ + MAC_TYPE_START, + TD4_X9 = 0xb780, + TD4_X9_8 = 0xb788, + TH3 = 0xb980, + TD3 = 0xb870, + TD3_X2 = 0xb274, + TD4 = 0xb880, + TH4 = 0xb990, + MAC_TYPE_END, +} mac_id; + +typedef enum { + MAC_TEMP_START, + MAC_TEMP_INDEX1, + MAC_TEMP_INDEX2, + MAC_TEMP_INDEX3, + MAC_TEMP_INDEX4, + MAC_TEMP_INDEX5, + MAC_TEMP_INDEX6, + MAC_TEMP_INDEX7, + MAC_TEMP_INDEX8, + MAC_TEMP_INDEX9, + MAC_TEMP_INDEX10, + MAC_TEMP_INDEX11, + MAC_TEMP_INDEX12, + MAC_TEMP_INDEX13, + MAC_TEMP_INDEX14, + MAC_TEMP_INDEX15, + MAC_TEMP_END, +} mac_hwmon_index; + +typedef enum action_e { + I2C_WRITE, + I2C_READ +} action_t; + +typedef struct i2c_op_s { + action_t op; + uint32_t reg_addr; + uint32_t reg_val; + int read_back; +} i2c_op_t; + +typedef struct dev_params_s { + int mac_id; + i2c_op_t sbus_setup[MAC_BSC_MAX_SETUP_NUM]; + i2c_op_t vtmon_read[MAC_BSC_MAX_READ_REG_STEP]; + uint32_t vtmon_reg_addrs[MAC_BSC_MAX_TEMP_NUM]; + uint8_t vtmon_instances; + uint32_t vtmon_data_width; + int vtmon_scalar; + int vtmon_offset; + uint8_t sbus_setup_ops; + int vtmon_read_ops; + int sbus_addr_op; + int sbus_error_op; + uint32_t sbus_error_mask; +} dev_params_t; + +static dev_params_t mac_temp_conf[] = { + { + .mac_id = TD3_X2, + /* CMIC_TOP_SBUS_RING_MAP_0_7 = 0x52222100 */ + .sbus_setup = {{I2C_WRITE, 0x1010000c, 0x52222100, 0}}, + .vtmon_read = { + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRL = 0x00000000 */ + {I2C_WRITE, 0x10110400, 0x00000000, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGE[0] = 0x2c380200 */ + {I2C_WRITE, 0x1011040c, 0x2c380200, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGE[1] = TOP_PVTMON_RESULT_0 */ + {I2C_WRITE, 0x10110410, 0x02005300, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRL = 0x00000001 */ + {I2C_WRITE, 0x10110400, 0x00000001, 0}, + /* CMIC_COMMON_POOL_SCHAN_CH4_ERR */ + {I2C_READ, 0x10110408}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGE[1] */ + {I2C_READ, 0x10110410} + }, + .vtmon_reg_addrs = { + 0x02005300, 0x02005400, 0x02005500, 0x02005600, 0x02005700, 0x02005800 + }, + .vtmon_instances = 6, + .vtmon_data_width = 10, + .vtmon_scalar = -5570, + .vtmon_offset = 4578289, + .sbus_setup_ops = 1, + .vtmon_read_ops = 6, + .sbus_addr_op = 2, + .sbus_error_op = 4, + .sbus_error_mask = 0x00000041, + }, + { + .mac_id = TD3, /* TD3_X7*/ + /* CMIC_TOP_SBUS_RING_MAP_0_7 = 0x52222100 */ + .sbus_setup = {{I2C_WRITE, 0x0320000c, 0x52222100, 0}}, + .vtmon_read = { + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRL = 0x00000000 */ + {I2C_WRITE, 0x03210400, 0x00000000, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGE[0] = 0x2c380200 */ + {I2C_WRITE, 0x0321040c, 0x2c380200, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGE[1] = TOP_PVTMON_RESULT_0 */ + {I2C_WRITE, 0x03210410, 0x02004700, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRL = 0x00000001 */ + {I2C_WRITE, 0x03210400, 0x00000001, 0}, + /* CMIC_COMMON_POOL_SCHAN_CH4_ERR */ + {I2C_READ, 0x03210408}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGE[1] */ + {I2C_READ, 0x03210410} + }, + .vtmon_reg_addrs = { + 0x02004700, 0x02004800, 0x02004900, 0x02004a00, 0x02004b00, 0x02004c00, + 0x02004d00, 0x02004e00, 0x02005200, 0x02005100, 0x02005000, 0x02004f00 + }, + .vtmon_instances = 12, + .vtmon_data_width = 10, + .vtmon_scalar = -5350, + .vtmon_offset = 4341000, + .sbus_setup_ops = 0, + .vtmon_read_ops = 6, + .sbus_addr_op = 2, + .sbus_error_op = 4, + .sbus_error_mask = 0x00000041, + }, + { + .mac_id = TH3, + .vtmon_read = { + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRL = 0x00000000 */ + {I2C_WRITE, 0x03210400, 0x00000000, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGE[0] = 0x2c400200 */ + {I2C_WRITE, 0x0321040c, 0x2c400200, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGE[1] = TOP_PVTMON_RESULT_0 */ + {I2C_WRITE, 0x03210410, 0x02004a00, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRL = 0x00000001 */ + {I2C_WRITE, 0x03210400, 0x00000001, 0}, + /* CMIC_COMMON_POOL_SCHAN_CH4_ERR */ + {I2C_READ, 0x03210408}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGE[1] */ + {I2C_READ, 0x03210410} + }, + .vtmon_reg_addrs = { + 0x02004a00, 0x02004b00, 0x02004c00, 0x02004d00, 0x02004e00, 0x02004f00, + 0x02005000, 0x02005100, 0x02005200, 0x02005300, 0x02005400, 0x02005500, + 0x02005600, 0x02005700, 0x02005800 + }, + .vtmon_instances = 15, + .vtmon_data_width = 10, + .vtmon_scalar = -5350, + .vtmon_offset = 4341000, + .sbus_setup_ops = 0, + .vtmon_read_ops = 6, + .sbus_addr_op = 2, + .sbus_error_op = -1, + }, + { + .mac_id = TD4_X9, + /* CMIC_TOP_SBUS_RING_MAP_8_15r = 0x00000000 */ + .sbus_setup = {{I2C_WRITE, 0x03200010, 0x00000000, 0}}, + .vtmon_read = { + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRLr = 0x00000000 */ + {I2C_WRITE, 0x03210400, 0x00000000, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[0] = 0x2c400200 */ + {I2C_WRITE, 0x0321040c, 0x2c400200, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[1] = TOP_VTMON_0_RESULT_1r */ + {I2C_WRITE, 0x03210410, 0x02005a00, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRLr = 0x00000001 */ + {I2C_WRITE, 0x03210400, 0x00000001, 0}, + /* CMIC_COMMON_POOL_SCHAN_CH4_ERRr */ + {I2C_READ, 0x03210408}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[1] */ + {I2C_READ, 0x03210410} + }, + .vtmon_reg_addrs = { + 0x02005a00, 0x02005c00, 0x02005e00, 0x02006000, 0x02006200, 0x02006400, + 0x02006600, 0x02006800, 0x02006a00 + }, + .vtmon_instances = 9, + .vtmon_data_width = 11, + .vtmon_scalar = -2454, + .vtmon_offset = 3668120, + .sbus_setup_ops = 0, + .vtmon_read_ops = 6, + .sbus_addr_op = 2, + .sbus_error_op = 4, + .sbus_error_mask = 0x00000041, + }, + { + .mac_id = TD4_X9_8, + /* CMIC_TOP_SBUS_RING_MAP_8_15r = 0x00000000 */ + .sbus_setup = {{I2C_WRITE, 0x03200010, 0x00000000, 0}}, + .vtmon_read = { + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRLr = 0x00000000 */ + {I2C_WRITE, 0x03210400, 0x00000000, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[0] = 0x2c400200 */ + {I2C_WRITE, 0x0321040c, 0x2c400200, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[1] = TOP_VTMON_0_RESULT_1r */ + {I2C_WRITE, 0x03210410, 0x02005a00, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRLr = 0x00000001 */ + {I2C_WRITE, 0x03210400, 0x00000001, 0}, + /* CMIC_COMMON_POOL_SCHAN_CH4_ERRr */ + {I2C_READ, 0x03210408}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[1] */ + {I2C_READ, 0x03210410} + }, + .vtmon_reg_addrs = { + 0x02005a00, 0x02005c00, 0x02005e00, 0x02006000, 0x02006200, 0x02006400, + 0x02006600, 0x02006800, 0x02006a00 + }, + .vtmon_instances = 9, + .vtmon_data_width = 11, + .vtmon_scalar = -2454, + .vtmon_offset = 3668120, + .sbus_setup_ops = 0, + .vtmon_read_ops = 6, + .sbus_addr_op = 2, + .sbus_error_op = 4, + .sbus_error_mask = 0x00000041, + }, + { + .mac_id = TD4, /* TD4-X11 */ + /* CMIC_TOP_SBUS_RING_MAP_8_15r = 0x00000000 */ + .sbus_setup = {{I2C_WRITE, 0x03200010, 0x00000000, 0}}, + .vtmon_read = { + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRLr = 0x00000000 */ + {I2C_WRITE, 0x03210400, 0x00000000, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[0] = 0x2c400200 */ + {I2C_WRITE, 0x0321040c, 0x2c400200, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[1] = TOP_VTMON_0_RESULT_1r */ + {I2C_WRITE, 0x03210410, 0x02004900, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRLr = 0x00000001 */ + {I2C_WRITE, 0x03210400, 0x00000001, 0}, + /* CMIC_COMMON_POOL_SCHAN_CH4_ERRr */ + {I2C_READ, 0x03210408}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[1] */ + {I2C_READ, 0x03210410} + }, + .vtmon_reg_addrs = { + 0x02004900, 0x02004b00, 0x02004d00, 0x02004f00, 0x02005100, 0x02005300, + 0x02005500, 0x02005700, 0x02005900, 0x02005b00, 0x02005d00, 0x02005f00, + 0x02006100, 0x02006300, 0x02006500 + }, + .vtmon_instances = 15, + .vtmon_data_width = 11, + .vtmon_scalar = -2454, + .vtmon_offset = 3668120, + .sbus_setup_ops = 0, + .vtmon_read_ops = 6, + .sbus_addr_op = 2, + .sbus_error_op = 4, + .sbus_error_mask = 0x00000041, + }, + { + .mac_id = TH4, + .vtmon_read = { + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRLr = 0x00000000 */ + {I2C_WRITE, 0x03210400, 0x00000000, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[0] = 0x2c400200 */ + {I2C_WRITE, 0x0321040c, 0x2c400200, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[1] = TOP_VTMON_0_RESULT_1r */ + {I2C_WRITE, 0x03210410, 0x0201d800, 1}, + /* CMIC_COMMON_POOL_SCHAN_CH4_CTRLr = 0x00000001 */ + {I2C_WRITE, 0x03210400, 0x00000001, 0}, + /* CMIC_COMMON_POOL_SCHAN_CH4_ERRr */ + {I2C_READ, 0x03210408}, + /* CMIC_COMMON_POOL_SCHAN_CH4_MESSAGEr[1] */ + {I2C_READ, 0x03210410} + }, + .vtmon_reg_addrs = { + 0x0201d800, 0x0201e000, 0x0201e800, 0x0201f000, 0x0201f800, 0x02020000, + 0x02020800, 0x02021000, 0x02021800, 0x02022000, 0x02022800, 0x02023000, + 0x02023800, 0x02024000, 0x02024800, + }, + .vtmon_instances = 15, + .vtmon_data_width = 11, + .vtmon_scalar = -2454, + .vtmon_offset = 3668120, + .sbus_setup_ops = 0, + .vtmon_read_ops = 6, + .sbus_addr_op = 2, + .sbus_error_op = -1, + }, +}; + +struct mac_data { + struct i2c_client *client; + struct device *hwmon_dev; + struct mutex update_lock; + dev_params_t dev_param; +}; + +static int bsc_i2c_read(struct i2c_client *client, uint32_t reg_addr, uint32_t *reg_val) +{ + int msgs_num, ret, i; + uint8_t addr_buf[MAC_REG_ADDR_WIDTH]; + uint8_t data_buf[MAC_REG_DATA_WIDTH]; + uint32_t val; + struct i2c_msg msgs[2]; + + for (i = 0; i < MAC_REG_ADDR_WIDTH; i++) { + addr_buf[i] = (reg_addr >> ((MAC_REG_ADDR_WIDTH -i -1) * 8)) & 0xff; + } + + mem_clear(msgs, sizeof(msgs)); + msgs[0].addr = client->addr; + msgs[0].flags = 0; + msgs[0].len = MAC_REG_ADDR_WIDTH; + msgs[0].buf = addr_buf; + + msgs[1].addr = client->addr; + msgs[1].flags = I2C_M_RD; + msgs[1].len = MAC_REG_DATA_WIDTH; + msgs[1].buf = data_buf; + + msgs_num = 2; + ret = i2c_transfer(client->adapter, msgs, msgs_num); + if (ret != msgs_num) { + WB_MAC_BSC_ERROR("i2c_transfer read failed, reg_addr: 0x%x, ret: %d\n", reg_addr, ret); + return -EIO; + } + val = 0; + for (i = 0; i < MAC_REG_DATA_WIDTH; i++) { + val |= data_buf[i] << ((MAC_REG_DATA_WIDTH - i -1) * 8); + } + WB_MAC_BSC_DEBUG("bsc_i2c_read success, reg_addr: 0x%x, reg_val: 0x%x\n", reg_addr, val); + *reg_val = val; + return 0; +} + +static int bsc_i2c_write(struct i2c_client *client, uint32_t reg_addr, uint32_t reg_val) +{ + int ret, i; + uint8_t write_buf[MAC_REG_ADDR_WIDTH + MAC_REG_DATA_WIDTH]; + struct i2c_msg msgs[1]; + + /* fill reg_addr first*/ + for (i = 0; i < MAC_REG_ADDR_WIDTH; i++) { + write_buf[i] = (reg_addr >> ((MAC_REG_ADDR_WIDTH -i -1) * 8)) & 0xff; + } + for (i = 0; i < MAC_REG_DATA_WIDTH; i++) { + write_buf[i + MAC_REG_ADDR_WIDTH] = (reg_val >> ((MAC_REG_DATA_WIDTH -i -1) * 8)) & 0xff; + } + + mem_clear(msgs, sizeof(msgs)); + msgs[0].len = MAC_REG_ADDR_WIDTH + MAC_REG_DATA_WIDTH; + msgs[0].buf = write_buf; + msgs[0].addr = client->addr; + msgs[0].flags = I2C_M_IGNORE_NAK; + + ret = i2c_transfer(client->adapter, msgs, 1); + if (ret < 0) { + WB_MAC_BSC_DEBUG("i2c_transfer write failed, reg_addr: 0x%x, reg_val: 0x%x, ret: %d\n", + reg_addr, reg_val, ret); + return ret; + } + WB_MAC_BSC_DEBUG("i2c_transfer write reg_addr: 0x%x, reg_val: 0x%x success\n", + reg_addr, reg_val); + return 0; +} + +static int handle_operation_write(struct i2c_client *client, i2c_op_t *operation) +{ + int ret; + uint32_t rd_back_val; + + ret = bsc_i2c_write(client, operation->reg_addr, operation->reg_val); + WB_MAC_BSC_DEBUG("bsc_i2c_write reg_addr: 0x%x, set val: 0x%x, ret: %d\n", + operation->reg_addr, operation->reg_val, ret); + if (operation->read_back) { + ret = bsc_i2c_read(client, operation->reg_addr, &rd_back_val); + if (rd_back_val != operation->reg_val) { + WB_MAC_BSC_ERROR("bsc_i2c_write failed, reg_addr: 0x%x, set val: 0x%x, read back valu: 0x%x\n", + operation->reg_addr, operation->reg_val, rd_back_val); + return -1; + } + WB_MAC_BSC_DEBUG("bsc_i2c_write success, reg_addr: 0x%x, set val: 0x%x, read_back val: 0x%x\n", + operation->reg_addr, operation->reg_val, rd_back_val); + } + return 0; +} + +static int handle_operation(struct i2c_client *client, i2c_op_t *operation) +{ + int ret, i; + + if (operation->op == I2C_WRITE) { + for (i = 0; i < MAC_BSC_MAX_RETRY; i++) { + ret = handle_operation_write(client, operation); + if (ret == 0) { + WB_MAC_BSC_DEBUG("handle_operation_write success, retry: %d\n", i); + return 0; + } + if ((i + 1) < MAC_BSC_MAX_RETRY) { + usleep_range(MAC_BSC_RETRY_SLEEP_TIME, MAC_BSC_RETRY_SLEEP_TIME + 1); + } + } + WB_MAC_BSC_DEBUG("handle_operation_write retry: %d failed, ret: %d, ignore it\n", i, ret); + return 0; + } + + if (operation->op == I2C_READ) { + ret = bsc_i2c_read(client, operation->reg_addr, &operation->reg_val); + WB_MAC_BSC_DEBUG("bsc_i2c_read reg_addr: 0x%x, get val: 0x%x, ret: %d\n", + operation->reg_addr, operation->reg_val, ret); + return ret; + } + + WB_MAC_BSC_ERROR("Unsupport operation type: %d\n", operation->op); + return -EINVAL; +} + +static int get_mac_reg(struct i2c_client *client, uint32_t reg_addr, uint32_t *reg_value) +{ + int i, ret; + i2c_op_t *op; + struct mac_data *data; + dev_params_t *dev_params; + uint32_t val_tmp; + + data = i2c_get_clientdata(client); + dev_params = &data->dev_param; + val_tmp = 0; + for (i = 0; i < dev_params->vtmon_read_ops; i++) { + op = &dev_params->vtmon_read[i]; + if (i == dev_params->sbus_addr_op) { + op->reg_val = reg_addr; + } + WB_MAC_BSC_DEBUG("Start to handle %s operation, step: %d, reg_addr: 0x%x, reg_value: 0x%x, read back flag: %d\n", + op->op == I2C_READ ? "I2C_READ" : "I2C_WRITE", i, op->reg_addr, op->reg_val, op->read_back); + ret = handle_operation(client, op); + if (ret < 0) { + WB_MAC_BSC_ERROR("handle operation %d failed, ret: %d\n", i, ret); + return ret; + } + if (op->op == I2C_READ) { + val_tmp = op->reg_val; + } + + if (i == dev_params->sbus_error_op) { + if (val_tmp & dev_params->sbus_error_mask) { + WB_MAC_BSC_ERROR("SBUS error seen, status value: 0x%x\n", op->reg_val); + return -EIO; + } + WB_MAC_BSC_DEBUG("Error status check ok, status: 0x%x, error_mask: 0x%x \n", + val_tmp, dev_params->sbus_error_mask); + } + } + + if (val_tmp == reg_addr) { + WB_MAC_BSC_ERROR("get mac register error, register value: 0x%x equal to reg_addr: 0x%x\n", + val_tmp, reg_addr); + return -EIO; + } + + *reg_value = val_tmp; + WB_MAC_BSC_DEBUG("get_mac_reg success, reg_addr: 0x%x, reg_value: 0x%x", reg_addr, *reg_value); + return 0; +} + +static int read_vtmon(struct i2c_client *client, uint8_t vtmon, int *temp) +{ + struct mac_data *data; + dev_params_t *dev_params; + uint32_t reg_addr, reg_val; + uint32_t vtmon_val; + int ret; + + data = i2c_get_clientdata(client); + dev_params = &data->dev_param; + + if (vtmon >= dev_params->vtmon_instances) { + WB_MAC_BSC_ERROR("VTMON index [%d] greater or equal to VTMON instance number: %d\n", + vtmon, dev_params->vtmon_instances); + return -1; + } + reg_addr = dev_params->vtmon_reg_addrs[vtmon]; + ret = get_mac_reg(client, reg_addr, ®_val); + if (ret < 0) { + WB_MAC_BSC_ERROR("Read VTMON[%d] failed, reg_addr: 0x%x, ret: %d\n", + vtmon, reg_addr, ret); + return ret; + } + + vtmon_val = reg_val & ((1 << dev_params->vtmon_data_width) - 1); + *temp = ((dev_params->vtmon_scalar * vtmon_val) + dev_params->vtmon_offset) / 10; + + if ((*temp / 1000 < -40) || (*temp / 1000 > 120)) { + WB_MAC_BSC_ERROR("MAC temp invalid, vtmon: %d, temp: %d\n", vtmon, *temp); + return -EINVAL; + } + WB_MAC_BSC_DEBUG("Read mac temp success, index: %d, value: %d\n", vtmon + 1, *temp); + return 0; +} + +static ssize_t show_mac_temp(struct device *dev, struct device_attribute *da, char *buf) +{ + struct mac_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->client; + u32 temp_index = to_sensor_dev_attr(da)->index; + int ret, temp; + + mutex_lock(&data->update_lock); + ret = read_vtmon(client, temp_index - 1, &temp); + if (ret < 0) { + temp = -MAC_TEMP_INVALID; + WB_MAC_BSC_ERROR("get_mactemp index: %d failed, ret = %d\n", temp_index, ret); + } + mutex_unlock(&data->update_lock); + return snprintf(buf, PAGE_SIZE, "%d\n", temp); +} + +static ssize_t show_mac_max_temp(struct device *dev, struct device_attribute *da, char *buf) +{ + struct mac_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->client; + dev_params_t *dev_params; + int i, ret; + int tmp, temp; + + mutex_lock(&data->update_lock); + + dev_params = &data->dev_param; + temp = -MAC_TEMP_INVALID; + for (i = 0; i < dev_params->vtmon_instances ; i++) { + ret = read_vtmon(client, i, &tmp); + if (ret < 0) { + WB_MAC_BSC_ERROR("Get mactemp failed, temp index: %d, ret = %d\n", + i, ret); + tmp = -MAC_TEMP_INVALID; + } + + temp = (temp > tmp) ? temp : tmp; + } + + mutex_unlock(&data->update_lock); + return snprintf(buf, PAGE_SIZE, "%d\n", temp); +} + +static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX1); +static SENSOR_DEVICE_ATTR(temp2_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX2); +static SENSOR_DEVICE_ATTR(temp3_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX3); +static SENSOR_DEVICE_ATTR(temp4_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX4); +static SENSOR_DEVICE_ATTR(temp5_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX5); +static SENSOR_DEVICE_ATTR(temp6_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX6); +static SENSOR_DEVICE_ATTR(temp7_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX7); +static SENSOR_DEVICE_ATTR(temp8_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX8); +static SENSOR_DEVICE_ATTR(temp9_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX9); +static SENSOR_DEVICE_ATTR(temp10_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX10); +static SENSOR_DEVICE_ATTR(temp11_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX11); +static SENSOR_DEVICE_ATTR(temp12_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX12); +static SENSOR_DEVICE_ATTR(temp13_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX13); +static SENSOR_DEVICE_ATTR(temp14_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX14); +static SENSOR_DEVICE_ATTR(temp15_input, S_IRUGO, show_mac_temp, NULL, MAC_TEMP_INDEX15); +static SENSOR_DEVICE_ATTR(temp99_input, S_IRUGO, show_mac_max_temp, NULL, 0); + +static struct attribute *mac_hwmon_attrs[] = { + &sensor_dev_attr_temp1_input.dev_attr.attr, + &sensor_dev_attr_temp2_input.dev_attr.attr, + &sensor_dev_attr_temp3_input.dev_attr.attr, + &sensor_dev_attr_temp4_input.dev_attr.attr, + &sensor_dev_attr_temp5_input.dev_attr.attr, + &sensor_dev_attr_temp6_input.dev_attr.attr, + &sensor_dev_attr_temp7_input.dev_attr.attr, + &sensor_dev_attr_temp8_input.dev_attr.attr, + &sensor_dev_attr_temp9_input.dev_attr.attr, + &sensor_dev_attr_temp10_input.dev_attr.attr, + &sensor_dev_attr_temp11_input.dev_attr.attr, + &sensor_dev_attr_temp12_input.dev_attr.attr, + &sensor_dev_attr_temp13_input.dev_attr.attr, + &sensor_dev_attr_temp14_input.dev_attr.attr, + &sensor_dev_attr_temp15_input.dev_attr.attr, + &sensor_dev_attr_temp99_input.dev_attr.attr, + NULL +}; +ATTRIBUTE_GROUPS(mac_hwmon); + +static void mac_bsc_setup(struct i2c_client *client) +{ + int i, ret; + struct mac_data *data; + dev_params_t *dev_params; + uint32_t reg_value; + + data = i2c_get_clientdata(client); + dev_params = &data->dev_param; + + for (i = 0; i < dev_params->sbus_setup_ops; i++) { + ret = bsc_i2c_read(client, dev_params->sbus_setup[i].reg_addr, ®_value); + if ((ret < 0) || (reg_value != dev_params->sbus_setup[i].reg_val)) { + WB_MAC_BSC_DEBUG("bsc setup op%d, ret: %d, reg_addr: 0x%x, read value: 0x%x not equal to set value: 0x%x\n", + i, ret, dev_params->sbus_setup[i].reg_addr, reg_value, dev_params->sbus_setup[i].reg_val); + bsc_i2c_write(client, dev_params->sbus_setup[i].reg_addr, dev_params->sbus_setup[i].reg_val); + } else { + WB_MAC_BSC_DEBUG("bsc setup op%d, reg_addr: 0x%x, read value: 0x%x equal to set value: 0x%x\n", + i, dev_params->sbus_setup[i].reg_addr, reg_value, dev_params->sbus_setup[i].reg_val); + } + } + return; +} + +static int mac_bsc_init(struct i2c_client *client) +{ + int ret, mac_id; + uint32_t reg_value; + + ret = get_mac_reg(client, MAC_ID_REG, ®_value); + if (ret < 0) { + WB_MAC_BSC_ERROR("Get MAC ID failed, reg_addr: 0x%x, ret = %d\n", + MAC_ID_REG, ret); + return ret; + } + + WB_MAC_BSC_DEBUG("Get MAC ID success, reg_addr: 0x%x, value: 0x%x \n", + MAC_ID_REG, reg_value); + mac_id = reg_value & 0xffff; + return mac_id; +} + +static int find_mac_config(int type, int *index) +{ + int i, size; + + size = ARRAY_SIZE(mac_temp_conf); + for (i = 0; i < size; i++) { + if (mac_temp_conf[i].mac_id == type) { + *index = i; + return 0; + } + } + return -1; +} + +static int mac_bsc_config_check(dev_params_t *dev_params) +{ + i2c_op_t *last_op; + i2c_op_t *err_op; + i2c_op_t *addr_op; + + /* vtmon_instances should not more than the MAC_BSC_MAX_TEMP_NUM */ + if ((dev_params->vtmon_instances > MAC_BSC_MAX_TEMP_NUM) || + (dev_params->vtmon_instances <= 0)) { + WB_MAC_BSC_ERROR("VTMON instance number %d more than the max number: %d\n", + dev_params->vtmon_instances, MAC_BSC_MAX_TEMP_NUM); + return -1; + } + + /* vtmon read operation steps should not more than the MAC_BSC_MAX_READ_REG_STEP */ + if ((dev_params->vtmon_read_ops > MAC_BSC_MAX_READ_REG_STEP) || + (dev_params->vtmon_read_ops <=0)) { + WB_MAC_BSC_ERROR("VTMON read ops number %d more than the max step: %d\n", + dev_params->vtmon_read_ops, MAC_BSC_MAX_READ_REG_STEP); + return -1; + } + + /* the last operation must be I2C_READ to get temperature register value */ + last_op = &dev_params->vtmon_read[dev_params->vtmon_read_ops - 1]; + if (last_op->op != I2C_READ) { + WB_MAC_BSC_ERROR("VTMON read ops config error, last operation not I2C_READ, last step: %d, op_code: %d\n", + dev_params->vtmon_read_ops - 1, last_op->op); + return -1; + } + + /* the address operation steps should not more than the vtmon_read_ops and not the last step */ + if ((dev_params->sbus_addr_op >= (dev_params->vtmon_read_ops - 1)) || + (dev_params->sbus_addr_op < 0)) { + WB_MAC_BSC_ERROR("VTMON addr op step invalid, index %d, read ops: %d\n", + dev_params->sbus_addr_op, dev_params->vtmon_read_ops); + return -1; + } + + /* the address operation must be I2C_WRITE to set temperature register address */ + addr_op = &dev_params->vtmon_read[dev_params->sbus_addr_op]; + if (addr_op->op != I2C_WRITE) { + WB_MAC_BSC_ERROR("VTMON addr op config error, addr operation not I2C_WRITE, addr op step: %d, op_code: %d\n", + dev_params->sbus_addr_op, addr_op->op); + return -1; + } + + /* the error status operation steps should not more than the vtmon_read_ops and not the last step */ + if (dev_params->sbus_error_op >= (dev_params->vtmon_read_ops - 1)) { + WB_MAC_BSC_ERROR("VTMON error op step invalid, index %d, read ops: %d\n", + dev_params->sbus_error_op, dev_params->vtmon_read_ops); + return -1; + } + + /* if error status operation exist, it must be I2C_READ to get error status register */ + if (dev_params->sbus_error_op >=0) { + err_op = &dev_params->vtmon_read[dev_params->sbus_error_op]; + if (err_op->op != I2C_READ) { + WB_MAC_BSC_ERROR("VTMON error op config error, error operation not I2C_READ, error op step: %d, op_code: %d\n", + dev_params->sbus_error_op, err_op->op); + return -1; + } + } + WB_MAC_BSC_DEBUG("dev_params check ok, instance number: %d, read_ops: %d, addr_op: %d, error_op: %d\n", + dev_params->vtmon_instances, dev_params->vtmon_read_ops, + dev_params->sbus_addr_op, dev_params->sbus_error_op); + return 0; +} + +static int mac_probe(struct i2c_client *client, const struct i2c_device_id *id) +{ + struct mac_data *data; + int ret, mac_id, index; + + WB_MAC_BSC_DEBUG("=========mac_probe(%d-%04x)===========\n", + client->adapter->nr, client->addr); + + if (!client->adapter->algo->master_xfer) { + dev_err(&client->adapter->dev, "I2C level transfers not supported\n"); + return -EOPNOTSUPP; + } + + data = devm_kzalloc(&client->dev, sizeof(struct mac_data), GFP_KERNEL); + if (!data) { + dev_err(&client->dev, "Failed to devm_kzalloc.\n"); + return -ENOMEM; + } + + data->client = client; + i2c_set_clientdata(client, data); + + mac_id = id->driver_data; + ret = find_mac_config(mac_id, &index); + if (ret < 0) { + dev_err(&client->dev, "Failed to find mac config, mac id from driver_data: 0x%x\n", mac_id); + return -EINVAL; + } + data->dev_param = mac_temp_conf[index]; + ret = mac_bsc_config_check(&data->dev_param); + if (ret < 0) { + dev_err(&client->dev, "Invalid config parameter, mac id: 0x%x, config index: %d\n", + mac_id, index); + return -EINVAL; + } + + mac_bsc_setup(client); + + if (mac_id == TD4) { + ret = mac_bsc_init(client); + if (ret < 0) { + dev_err(&client->dev, "Failed to get mac id, ret: %d\n", ret); + return -EIO; + } + mac_id = ret; + ret = find_mac_config(mac_id, &index); + if (ret < 0) { + dev_err(&client->dev, "Failed to find mac config, mac id from chip: 0x%x\n", mac_id); + return -EINVAL; + } + data->dev_param = mac_temp_conf[index]; + ret = mac_bsc_config_check(&data->dev_param); + if (ret < 0) { + dev_err(&client->dev, "Invalid config parameter, mac id: 0x%x, config index: %d\n", + mac_id, index); + return -EINVAL; + } + } + + WB_MAC_BSC_DEBUG("mac_id: 0x%x, config index: %d\n", mac_id, index); + + mutex_init(&data->update_lock); + data->hwmon_dev = hwmon_device_register_with_groups(&client->dev, client->name, data, mac_hwmon_groups); + if (IS_ERR(data->hwmon_dev)) { + dev_err(&client->dev, "Failed to register mac bsc hwmon\n"); + return PTR_ERR(data->hwmon_dev); + } + + dev_info(&client->dev, "Register mac bsc %x with %d vtmon instance number success\n", + mac_id, data->dev_param.vtmon_instances); + return 0; +} + +static void mac_remove(struct i2c_client *client) +{ + struct mac_data *data = i2c_get_clientdata(client); + + hwmon_device_unregister(data->hwmon_dev); + return; +} + +static const struct i2c_device_id mac_id_table[] = { + { "wb_mac_bsc_td3", TD3 }, + { "wb_mac_bsc_td3_x2", TD3_X2 }, + { "wb_mac_bsc_td4", TD4 }, + { "wb_mac_bsc_th3", TH3 }, + { "wb_mac_bsc_th4", TH4 }, + {} +}; +MODULE_DEVICE_TABLE(i2c, mac_id_table); + +static struct i2c_driver wb_mac_bsc_driver = { + .driver = { + .name = "wb_mac_bsc", + }, + .probe = mac_probe, + .remove = mac_remove, + .id_table = mac_id_table, +}; + +module_i2c_driver(wb_mac_bsc_driver); + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("mac bsc driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_mdio_gpio_device.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_mdio_gpio_device.c new file mode 100644 index 000000000000..e3198b378a20 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_mdio_gpio_device.c @@ -0,0 +1,110 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int gpio_mdc = 44; +module_param(gpio_mdc, int, S_IRUGO | S_IWUSR); + +static int gpio_mdio = 45; +module_param(gpio_mdio, int, S_IRUGO | S_IWUSR); + +static char *gpio_chip_name = NULL; +module_param(gpio_chip_name, charp, 0644); +MODULE_PARM_DESC(str_var, "A string variable for GPIO controller"); + +static int g_wb_mdio_gpio_device_debug = 0; +static int g_wb_mdio_gpio_device_error = 0; + +module_param(g_wb_mdio_gpio_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_mdio_gpio_device_error, int, S_IRUGO | S_IWUSR); + +#define WB_MIDO_GPIO_DEVICE_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_wb_mdio_gpio_device_debug) { \ + printk(KERN_INFO "[WB_MDIO_GPIO_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_MIDO_GPIO_DEVICE_DEBUG_ERROR(fmt, args...) do { \ + if (g_wb_mdio_gpio_device_error) { \ + printk(KERN_ERR "[WB_MDIO_GPIO_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +struct mdio_gpio_platform_data mdio_gpio_device_data = { + .phy_mask = 0, + .phy_ignore_ta_mask = 0, +}; + +static void wb_mdio_gpio_device_release(struct device *dev) +{ + return; +} + +static struct platform_device mdio_gpio_device = { + .name = "mdio-gpio", + .num_resources = 0, + .id = -1, + .dev = { + .platform_data = &mdio_gpio_device_data, + .release = wb_mdio_gpio_device_release, + }, +}; + +static struct gpiod_lookup_table wb_mdio_gpio_table = { + .dev_id = "mdio-gpio", + .table = { + GPIO_LOOKUP_IDX("wb_gpio_d1500", 44, NULL, MDIO_GPIO_MDC, + GPIO_ACTIVE_HIGH), + GPIO_LOOKUP_IDX("wb_gpio_d1500", 45, NULL, MDIO_GPIO_MDIO, + GPIO_ACTIVE_HIGH), + { }, + }, +}; + +static int __init wb_mdio_gpio_device_init(void) +{ + int err; + + WB_MIDO_GPIO_DEVICE_DEBUG_VERBOSE("wb_mdio_gpio_device_init enter!\n"); + wb_mdio_gpio_table.table[0].chip_hwnum = gpio_mdc; + wb_mdio_gpio_table.table[1].chip_hwnum = gpio_mdio; + + if (gpio_chip_name) { + wb_mdio_gpio_table.table[0].key = gpio_chip_name; + wb_mdio_gpio_table.table[1].key = gpio_chip_name; + } + + gpiod_add_lookup_table(&wb_mdio_gpio_table); + + err = platform_device_register(&mdio_gpio_device); + if (err < 0) { + printk(KERN_ERR "register mdio gpio device fail(%d). \n", err); + gpiod_remove_lookup_table(&wb_mdio_gpio_table); + return -1; + } + return 0; + +} + +static void __exit wb_mdio_gpio_device_exit(void) +{ + WB_MIDO_GPIO_DEVICE_DEBUG_VERBOSE("wb_mdio_gpio_device_exit enter!\n"); + platform_device_unregister(&mdio_gpio_device); + gpiod_remove_lookup_table(&wb_mdio_gpio_table); +} + +module_init(wb_mdio_gpio_device_init); +module_exit(wb_mdio_gpio_device_exit); +MODULE_DESCRIPTION("WB MDIO GPIO Devices"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_pcie_dev.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_pcie_dev.c new file mode 100644 index 000000000000..093d070fd429 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_pcie_dev.c @@ -0,0 +1,819 @@ +/* + * wb_pcie_dev.c + * ko to read/write pcie iomem and ioports through /dev/XXX device + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_pcie_dev.h" + +#define PROXY_NAME "wb-pci-dev" +#define MAX_NAME_SIZE (20) +#define MAX_PCIE_NUM (256) +#define PCI_RDWR_MAX_LEN (256) +#define PCIE_BUS_WIDTH_1 (1) +#define PCIE_BUS_WIDTH_2 (2) +#define PCIE_BUS_WIDTH_4 (4) + +#define KERNEL_SPASE (0) +#define USER_SPASE (1) + +static int g_pcie_dev_debug = 0; +static int g_pcie_dev_error = 0; + +module_param(g_pcie_dev_debug, int, S_IRUGO | S_IWUSR); +module_param(g_pcie_dev_error, int, S_IRUGO | S_IWUSR); + +#define PCIE_DEV_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_pcie_dev_debug) { \ + printk(KERN_INFO "[PCIE_DEV][VER][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define PCIE_DEV_DEBUG_ERROR(fmt, args...) do { \ + if (g_pcie_dev_error) { \ + printk(KERN_ERR "[PCIE_DEV][ERR][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +typedef struct firmware_upg_s { + int upg_ctrl_base; + int upg_flash_base; +} firmware_upg_t; + +typedef struct wb_pci_dev_s { + const char *name; + uint32_t domain; + uint32_t bus; + uint32_t slot; + uint32_t fn; + uint32_t bar; + void __iomem *pci_mem_base; + uint32_t pci_io_base; + uint32_t bar_len; + uint32_t bar_flag; + uint32_t bus_width; + uint32_t check_pci_id; + uint32_t pci_id; + struct miscdevice misc; + void (*setreg)(struct wb_pci_dev_s *wb_pci_dev, int reg, u32 value); + u32 (*getreg)(struct wb_pci_dev_s *wb_pci_dev, int reg); + firmware_upg_t firmware_upg; +} wb_pci_dev_t; + +static wb_pci_dev_t* pcie_dev_arry[MAX_PCIE_NUM]; + +static void pci_dev_setreg_8(wb_pci_dev_t *wb_pci_dev, int reg, u32 value) +{ + u8 w_value; + + w_value = (u8)(value & 0xff); + if (wb_pci_dev->bar_flag == IORESOURCE_MEM) { + writeb(w_value, wb_pci_dev->pci_mem_base + reg); + } else { + outb(w_value, wb_pci_dev->pci_io_base + reg); + } + return; +} + +static void pci_dev_setreg_16(wb_pci_dev_t *wb_pci_dev, int reg, u32 value) +{ + u16 w_value; + + w_value = (u16)(value & 0xffff); + if (wb_pci_dev->bar_flag == IORESOURCE_MEM) { + writew(w_value, wb_pci_dev->pci_mem_base + reg); + } else { + outw(w_value, wb_pci_dev->pci_io_base + reg); + } + + return; +} + +static void pci_dev_setreg_32(wb_pci_dev_t *wb_pci_dev, int reg, u32 value) +{ + + if (wb_pci_dev->bar_flag == IORESOURCE_MEM) { + writel(value, wb_pci_dev->pci_mem_base + reg); + } else { + outl(value, wb_pci_dev->pci_io_base + reg); + } + return; +} + +static inline u32 pci_dev_getreg_8(wb_pci_dev_t *wb_pci_dev, int reg) +{ + u32 value; + + if (wb_pci_dev->bar_flag == IORESOURCE_MEM) { + value = readb(wb_pci_dev->pci_mem_base + reg); + } else { + value = inb(wb_pci_dev->pci_io_base + reg); + } + + return value; +} + +static inline u32 pci_dev_getreg_16(wb_pci_dev_t *wb_pci_dev, int reg) +{ + u32 value; + + if (wb_pci_dev->bar_flag == IORESOURCE_MEM) { + value = readw(wb_pci_dev->pci_mem_base + reg); + } else { + value = inw(wb_pci_dev->pci_io_base + reg); + } + + return value; +} + +static inline u32 pci_dev_getreg_32(wb_pci_dev_t *wb_pci_dev, int reg) +{ + u32 value; + + if (wb_pci_dev->bar_flag == IORESOURCE_MEM) { + value = readl(wb_pci_dev->pci_mem_base + reg); + } else { + value = inl(wb_pci_dev->pci_io_base + reg); + } + + return value; +} + +static inline void pci_dev_setreg(wb_pci_dev_t *wb_pci_dev, int reg, u32 value) +{ + wb_pci_dev->setreg(wb_pci_dev, reg, value); +} + +static inline u32 pci_dev_getreg(wb_pci_dev_t *wb_pci_dev, int reg) +{ + return wb_pci_dev->getreg(wb_pci_dev, reg); +} + +static int pci_dev_open(struct inode *inode, struct file *file) +{ + unsigned int minor = iminor(inode); + wb_pci_dev_t *wb_pci_dev; + + PCIE_DEV_DEBUG_VERBOSE("inode: %p, file: %p, minor: %u", inode, file, minor); + + if (minor >= MAX_PCIE_NUM) { + PCIE_DEV_DEBUG_ERROR("minor out of range, minor = %d.\n", minor); + return -ENODEV; + } + + wb_pci_dev = pcie_dev_arry[minor]; + if (wb_pci_dev == NULL) { + PCIE_DEV_DEBUG_ERROR("wb_pci_dev is NULL, open failed, minor = %d\n", minor); + return -ENODEV; + } + + file->private_data = wb_pci_dev; + return 0; +} + +static int pci_dev_release(struct inode *inode, struct file *file) +{ + file->private_data = NULL; + return 0; +} + +static int pci_dev_read_tmp(wb_pci_dev_t *wb_pci_dev, uint32_t offset, uint8_t *buf, size_t count) +{ + int width, i, j; + u32 val; + + if (offset > wb_pci_dev->bar_len) { + PCIE_DEV_DEBUG_VERBOSE("offset:0x%x, bar len:0x%x, EOF.\n", offset, wb_pci_dev->bar_len); + return 0; + } + + width = wb_pci_dev->bus_width; + + if (offset % width) { + PCIE_DEV_DEBUG_ERROR("pci bus width:%d, offset:0x%x, read size %lu invalid.\n", + width, offset, count); + return -EINVAL; + } + + if (count > wb_pci_dev->bar_len - offset) { + PCIE_DEV_DEBUG_VERBOSE("read count out of range. input len:%lu, read len:%u.\n", + count, wb_pci_dev->bar_len - offset); + count = wb_pci_dev->bar_len - offset; + } + + for (i = 0; i < count; i += width) { + val = pci_dev_getreg(wb_pci_dev, offset + i); + for (j = 0; (j < width) && (i + j < count); j++) { + buf[i + j] = (val >> (8 * j)) & 0xff; + } + } + return count; +} + +static ssize_t pci_dev_read(struct file *file, char __user *buf, size_t count, loff_t *offset, int flag) +{ + wb_pci_dev_t *wb_pci_dev; + int ret, read_len; + u8 buf_tmp[PCI_RDWR_MAX_LEN]; + + wb_pci_dev = file->private_data; + if (wb_pci_dev == NULL) { + PCIE_DEV_DEBUG_ERROR("wb_pci_dev is NULL, read failed.\n"); + return -EINVAL; + } + + if (count == 0) { + PCIE_DEV_DEBUG_ERROR("Invalid params, read count is 0.\n"); + return -EINVAL; + } + + if (count > sizeof(buf_tmp)) { + PCIE_DEV_DEBUG_VERBOSE("read count %lu exceed max %lu.\n", count, sizeof(buf_tmp)); + count = sizeof(buf_tmp); + } + + mem_clear(buf_tmp, sizeof(buf_tmp)); + read_len = pci_dev_read_tmp(wb_pci_dev, *offset, buf_tmp, count); + if (read_len < 0) { + PCIE_DEV_DEBUG_ERROR("pci_dev_read_tmp failed, ret:%d.\n", read_len); + return read_len; + } + /* check flag is user spase or kernel spase */ + if (flag == USER_SPASE) { + PCIE_DEV_DEBUG_VERBOSE("user space read, buf: %p, offset: %lld, read count %lu.\n", + buf, *offset, count); + if (copy_to_user(buf, buf_tmp, read_len)) { + PCIE_DEV_DEBUG_ERROR("copy_to_user failed.\n"); + return -EFAULT; + } + } else { + PCIE_DEV_DEBUG_VERBOSE("kernel space read, buf: %p, offset: %lld, read count %lu.\n", + buf, *offset, count); + memcpy(buf, buf_tmp, read_len); + } + *offset += read_len; + ret = read_len; + return ret; +} + +static ssize_t pci_dev_read_user(struct file *file, char __user *buf, size_t count, loff_t *offset) +{ + int ret; + + PCIE_DEV_DEBUG_VERBOSE("pci_dev_read_user, file: %p, count: %lu, offset: %lld\n", + file, count, *offset); + ret = pci_dev_read(file, buf, count, offset, USER_SPASE); + return ret; +} + +static ssize_t pci_dev_read_iter(struct kiocb *iocb, struct iov_iter *to) +{ + int ret; + + PCIE_DEV_DEBUG_VERBOSE("pci_dev_read_iter, file: %p, count: %lu, offset: %lld\n", + iocb->ki_filp, to->count, iocb->ki_pos); + ret = pci_dev_read(iocb->ki_filp, to->kvec->iov_base, to->count, &iocb->ki_pos, KERNEL_SPASE); + return ret; +} + +static int pci_dev_write_tmp(wb_pci_dev_t *wb_pci_dev, uint32_t offset, uint8_t *buf, size_t count) +{ + int width, i, j; + u32 val; + + if (offset > wb_pci_dev->bar_len) { + PCIE_DEV_DEBUG_VERBOSE("offset:0x%x, bar len:0x%x, EOF.\n", offset, wb_pci_dev->bar_len); + return 0; + } + + width = wb_pci_dev->bus_width; + + if (offset % width) { + PCIE_DEV_DEBUG_ERROR("pci bus width:%d, offset:0x%x, read size %lu invalid.\n", + width, offset, count); + return -EINVAL; + } + + if (count > wb_pci_dev->bar_len - offset) { + PCIE_DEV_DEBUG_VERBOSE("write count out of range. input len:%lu, write len:%u.\n", + count, wb_pci_dev->bar_len - offset); + count = wb_pci_dev->bar_len - offset; + } + + for (i = 0; i < count; i += width) { + val = 0; + for (j = 0; (j < width) && (i + j < count); j++) { + val |= buf[i + j] << (8 * j); + } + pci_dev_setreg(wb_pci_dev, i + offset, val); + } + + return count; +} + +static ssize_t pci_dev_write(struct file *file, const char __user *buf, size_t count, + loff_t *offset, int flag) +{ + wb_pci_dev_t *wb_pci_dev; + u8 buf_tmp[PCI_RDWR_MAX_LEN]; + int write_len; + + wb_pci_dev = file->private_data; + if (wb_pci_dev == NULL) { + PCIE_DEV_DEBUG_ERROR("wb_pci_dev is NULL, write failed.\n"); + return -EINVAL; + } + + if (count == 0) { + PCIE_DEV_DEBUG_ERROR("Invalid params, write count is 0.\n"); + return -EINVAL; + } + + if (count > sizeof(buf_tmp)) { + PCIE_DEV_DEBUG_VERBOSE("write count %lu exceed max %lu.\n", count, sizeof(buf_tmp)); + count = sizeof(buf_tmp); + } + + mem_clear(buf_tmp, sizeof(buf_tmp)); + /* check flag is user spase or kernel spase */ + if (flag == USER_SPASE) { + PCIE_DEV_DEBUG_VERBOSE("user space write, buf: %p, offset: %lld, write count %lu.\n", + buf, *offset, count); + if (copy_from_user(buf_tmp, buf, count)) { + PCIE_DEV_DEBUG_ERROR("copy_from_user failed.\n"); + return -EFAULT; + } + } else { + PCIE_DEV_DEBUG_VERBOSE("kernel space write, buf: %p, offset: %lld, write count %lu.\n", + buf, *offset, count); + memcpy(buf_tmp, buf, count); + } + + write_len = pci_dev_write_tmp(wb_pci_dev, *offset, buf_tmp, count); + if (write_len < 0) { + PCIE_DEV_DEBUG_ERROR("pci_dev_write_tmp failed, ret:%d.\n", write_len); + return write_len; + } + + *offset += write_len; + return write_len; +} + +static ssize_t pci_dev_write_user(struct file *file, const char __user *buf, size_t count, loff_t *offset) +{ + int ret; + + PCIE_DEV_DEBUG_VERBOSE("pci_dev_write_user, file: %p, count: %lu, offset: %lld\n", + file, count, *offset); + ret = pci_dev_write(file, buf, count, offset, USER_SPASE); + return ret; +} + +static ssize_t pci_dev_write_iter(struct kiocb *iocb, struct iov_iter *from) +{ + int ret; + + PCIE_DEV_DEBUG_VERBOSE("pci_dev_write_iter, file: %p, count: %lu, offset: %lld\n", + iocb->ki_filp, from->count, iocb->ki_pos); + ret = pci_dev_write(iocb->ki_filp, from->kvec->iov_base, from->count, &iocb->ki_pos, KERNEL_SPASE); + return ret; +} + +static loff_t pci_dev_llseek(struct file *file, loff_t offset, int origin) +{ + loff_t ret = 0; + wb_pci_dev_t *wb_pci_dev; + + wb_pci_dev = file->private_data; + if (wb_pci_dev == NULL) { + PCIE_DEV_DEBUG_ERROR("wb_pci_dev is NULL, llseek failed.\n"); + return -EINVAL; + } + + switch (origin) { + case SEEK_SET: + if (offset < 0) { + PCIE_DEV_DEBUG_ERROR("SEEK_SET, offset:%lld, invalid.\n", offset); + ret = -EINVAL; + break; + } + if (offset > wb_pci_dev->bar_len) { + PCIE_DEV_DEBUG_ERROR("SEEK_SET out of range, offset:%lld, bar len:0x%x.\n", + offset, wb_pci_dev->bar_len); + ret = - EINVAL; + break; + } + file->f_pos = offset; + ret = file->f_pos; + break; + case SEEK_CUR: + if (((file->f_pos + offset) > wb_pci_dev->bar_len) || ((file->f_pos + offset) < 0)) { + PCIE_DEV_DEBUG_ERROR("SEEK_CUR out of range, f_ops:%lld, offset:%lld, bar len:0x%x.\n", + file->f_pos, offset, wb_pci_dev->bar_len); + ret = - EINVAL; + break; + } + file->f_pos += offset; + ret = file->f_pos; + break; + default: + PCIE_DEV_DEBUG_ERROR("unsupport llseek type:%d.\n", origin); + ret = -EINVAL; + break; + } + return ret; +} + +static long pci_dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + wb_pci_dev_t *wb_pci_dev; + void __user *argp; + firmware_upg_t *firmware_upg; + int upg_ctrl_base; + int upg_flash_base; + + PCIE_DEV_DEBUG_VERBOSE("ioctl, cmd=0x%02x, arg=0x%02lx\n",cmd, arg); + + wb_pci_dev = file->private_data; + if (wb_pci_dev == NULL) { + PCIE_DEV_DEBUG_ERROR("wb_pci_dev is NULL, ioctl failed.\n"); + return -EINVAL; + } + + firmware_upg = &wb_pci_dev->firmware_upg; + + argp = (void __user *)arg; + + switch (cmd) { + case GET_FPGA_UPG_CTL_BASE: + if (firmware_upg->upg_ctrl_base < 0) { + PCIE_DEV_DEBUG_ERROR("dts not adaptive upg_ctrl_base\n"); + return -EFAULT; + } else { + upg_ctrl_base = firmware_upg->upg_ctrl_base; + if (copy_to_user(argp, &upg_ctrl_base, sizeof(upg_ctrl_base))) { + PCIE_DEV_DEBUG_ERROR("upg_ctrl_base copy_from_user failed\n"); + return -EFAULT; + } + } + break; + case GET_FPGA_UPG_FLASH_BASE: + if (firmware_upg->upg_flash_base < 0) { + PCIE_DEV_DEBUG_ERROR("dts not adaptive upg_flash_base\n"); + return -EFAULT; + } else { + upg_flash_base = firmware_upg->upg_flash_base; + if (copy_to_user(argp, &upg_flash_base, sizeof(upg_flash_base))) { + PCIE_DEV_DEBUG_ERROR("upg_flash_base copy_from_user failed\n"); + return -EFAULT; + } + } + break; + default: + PCIE_DEV_DEBUG_ERROR("command unsupported \n"); + return -ENOTTY; + } + + return 0; +} + +static const struct file_operations pcie_dev_fops = { + .owner = THIS_MODULE, + .llseek = pci_dev_llseek, + .read = pci_dev_read_user, + .write = pci_dev_write_user, + .read_iter = pci_dev_read_iter, + .write_iter = pci_dev_write_iter, + .unlocked_ioctl = pci_dev_ioctl, + .open = pci_dev_open, + .release = pci_dev_release, +}; + +static wb_pci_dev_t *dev_match(const char *path) +{ + wb_pci_dev_t *wb_pci_dev; + char dev_name[MAX_NAME_SIZE]; + int i; + + for (i = 0; i < MAX_PCIE_NUM; i++) { + if (pcie_dev_arry[i] == NULL) { + continue; + } + wb_pci_dev = pcie_dev_arry[i]; + snprintf(dev_name, MAX_NAME_SIZE,"/dev/%s", wb_pci_dev->name); + if (!strcmp(path, dev_name)) { + PCIE_DEV_DEBUG_VERBOSE("get dev_name = %s, minor = %d\n", dev_name, i); + return wb_pci_dev; + } + } + + return NULL; +} + +int pcie_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count) +{ + wb_pci_dev_t *wb_pci_dev; + int read_len; + + if (path == NULL) { + PCIE_DEV_DEBUG_ERROR("path NULL"); + return -EINVAL; + } + + if (buf == NULL) { + PCIE_DEV_DEBUG_ERROR("buf NULL"); + return -EINVAL; + } + + wb_pci_dev = dev_match(path); + if (wb_pci_dev == NULL) { + PCIE_DEV_DEBUG_ERROR("i2c_dev match failed. dev path = %s", path); + return -EINVAL; + } + + read_len = pci_dev_read_tmp(wb_pci_dev, offset, buf, count); + if (read_len < 0) { + PCIE_DEV_DEBUG_ERROR("pci_dev_read_tmp failed, ret:%d.\n", read_len); + } + return read_len; +} +EXPORT_SYMBOL(pcie_device_func_read); + +int pcie_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count) +{ + wb_pci_dev_t *wb_pci_dev; + int write_len; + + if (path == NULL) { + PCIE_DEV_DEBUG_ERROR("path NULL"); + return -EINVAL; + } + + if (buf == NULL) { + PCIE_DEV_DEBUG_ERROR("buf NULL"); + return -EINVAL; + } + + wb_pci_dev = dev_match(path); + if (wb_pci_dev == NULL) { + PCIE_DEV_DEBUG_ERROR("i2c_dev match failed. dev path = %s", path); + return -EINVAL; + } + + write_len = pci_dev_write_tmp(wb_pci_dev, offset, buf, count); + if (write_len < 0) { + PCIE_DEV_DEBUG_ERROR("pci_dev_write_tmp failed, ret:%d.\n", write_len); + } + return write_len; +} +EXPORT_SYMBOL(pcie_device_func_write); + +static int pci_setup_bars(wb_pci_dev_t *wb_pci_dev, struct pci_dev *dev) +{ + int ret; + uint32_t addr, len, flags; + + ret = 0; + addr = pci_resource_start(dev, wb_pci_dev->bar); + len = pci_resource_len(dev, wb_pci_dev->bar); + if (addr == 0 || len == 0) { + PCIE_DEV_DEBUG_ERROR("get bar addr failed. bar:%d, addr:0x%x, len:0x%x.\n", + wb_pci_dev->bar, addr, len); + return -EFAULT; + } + wb_pci_dev->bar_len = len; + + flags = pci_resource_flags(dev, wb_pci_dev->bar); + PCIE_DEV_DEBUG_VERBOSE("bar:%d, flag:0x%08x, phys addr:0x%x, len:0x%x\n", + wb_pci_dev->bar, flags, addr, len); + if (flags & IORESOURCE_MEM) { + wb_pci_dev->bar_flag = IORESOURCE_MEM; + wb_pci_dev->pci_mem_base = ioremap(addr, len); + PCIE_DEV_DEBUG_VERBOSE("pci mem base:%p.\n", wb_pci_dev->pci_mem_base); + } else if (flags & IORESOURCE_IO) { + wb_pci_dev->bar_flag = IORESOURCE_IO; + wb_pci_dev->pci_io_base = addr; + PCIE_DEV_DEBUG_VERBOSE("pci io base:0x%x.\n", wb_pci_dev->pci_io_base); + } else { + PCIE_DEV_DEBUG_ERROR("unknow pci bar flag:0x%08x.\n", flags); + ret = -EINVAL; + } + + return ret; +} + +static int pci_dev_probe(struct platform_device *pdev) +{ + int ret, devfn; + uint32_t pci_id; + wb_pci_dev_t *wb_pci_dev; + struct pci_dev *pci_dev; + struct miscdevice *misc; + firmware_upg_t *firmware_upg; + pci_dev_device_t *pci_dev_device; + + wb_pci_dev = devm_kzalloc(&pdev->dev, sizeof(wb_pci_dev_t), GFP_KERNEL); + if (!wb_pci_dev) { + dev_err(&pdev->dev, "devm_kzalloc failed.\n"); + ret = -ENOMEM; + return ret; + } + + firmware_upg = &wb_pci_dev->firmware_upg; + + if (pdev->dev.of_node) { + ret = 0; + ret += of_property_read_string(pdev->dev.of_node, "pci_dev_name", &wb_pci_dev->name); + ret += of_property_read_u32(pdev->dev.of_node, "pci_domain", &wb_pci_dev->domain); + ret += of_property_read_u32(pdev->dev.of_node, "pci_bus", &wb_pci_dev->bus); + ret += of_property_read_u32(pdev->dev.of_node, "pci_slot", &wb_pci_dev->slot); + ret += of_property_read_u32(pdev->dev.of_node, "pci_fn", &wb_pci_dev->fn); + ret += of_property_read_u32(pdev->dev.of_node, "pci_bar", &wb_pci_dev->bar); + ret += of_property_read_u32(pdev->dev.of_node, "bus_width", &wb_pci_dev->bus_width); + + if (ret != 0) { + dev_err(&pdev->dev, "Failed to get dts config, ret:%d.\n", ret); + return -ENXIO; + } + + ret = 0; + ret += of_property_read_u32(pdev->dev.of_node, "upg_ctrl_base", &firmware_upg->upg_ctrl_base); + ret += of_property_read_u32(pdev->dev.of_node, "upg_flash_base", &firmware_upg->upg_flash_base); + if (ret != 0) { + PCIE_DEV_DEBUG_VERBOSE("dts don't adaptive fpga upg related, ret:%d.\n", ret); + firmware_upg->upg_ctrl_base = -1; + firmware_upg->upg_flash_base = -1; + } else { + PCIE_DEV_DEBUG_VERBOSE("upg_ctrl_base:0x%04x, upg_flash_base:0x%02x.\n", + firmware_upg->upg_ctrl_base, firmware_upg->upg_flash_base); + } + ret = of_property_read_u32(pdev->dev.of_node, "check_pci_id", &wb_pci_dev->check_pci_id); + if (ret == 0) { + ret = of_property_read_u32(pdev->dev.of_node, "pci_id", &wb_pci_dev->pci_id); + if (ret != 0) { + dev_err(&pdev->dev, "Failed to get pci_id, ret:%d.\n", ret); + return -ENXIO; + } + } + } else { + if (pdev->dev.platform_data == NULL) { + dev_err(&pdev->dev, "Failed to get platform data config.\n"); + return -ENXIO; + } + pci_dev_device = pdev->dev.platform_data; + wb_pci_dev->name = pci_dev_device->pci_dev_name; + wb_pci_dev->domain = pci_dev_device->pci_domain; + wb_pci_dev->bus = pci_dev_device->pci_bus; + wb_pci_dev->slot = pci_dev_device->pci_slot; + wb_pci_dev->fn = pci_dev_device->pci_fn; + wb_pci_dev->bar = pci_dev_device->pci_bar; + wb_pci_dev->bus_width = pci_dev_device->bus_width; + wb_pci_dev->check_pci_id = pci_dev_device->check_pci_id; + wb_pci_dev->pci_id = pci_dev_device->pci_id; + firmware_upg->upg_ctrl_base = pci_dev_device->upg_ctrl_base; + firmware_upg->upg_flash_base = pci_dev_device->upg_flash_base; + PCIE_DEV_DEBUG_VERBOSE("upg_ctrl_base:0x%04x, upg_flash_base:0x%02x.\n", + firmware_upg->upg_ctrl_base, firmware_upg->upg_flash_base); + } + + PCIE_DEV_DEBUG_VERBOSE("name:%s, domain:0x%04x, bus:0x%02x, slot:0x%02x, fn:%u, bar:%u, bus_width:%d.\n", + wb_pci_dev->name, wb_pci_dev->domain, wb_pci_dev->bus, wb_pci_dev->slot, wb_pci_dev->fn, + wb_pci_dev->bar, wb_pci_dev->bus_width); + + devfn = PCI_DEVFN(wb_pci_dev->slot, wb_pci_dev->fn); + pci_dev = pci_get_domain_bus_and_slot(wb_pci_dev->domain, wb_pci_dev->bus, devfn); + if (pci_dev == NULL) { + dev_err(&pdev->dev, "Failed to find pci_dev, domain:0x%04x, bus:0x%02x, devfn:0x%x\n", + wb_pci_dev->domain, wb_pci_dev->bus, devfn); + return -ENXIO; + } + if (wb_pci_dev->check_pci_id == 1) { + pci_id = (pci_dev->vendor << 16) | pci_dev->device; + if (wb_pci_dev->pci_id != pci_id) { + dev_err(&pdev->dev, "Failed to check pci id, except: 0x%x, really: 0x%x\n", + wb_pci_dev->pci_id, pci_id); + return -ENXIO; + } + PCIE_DEV_DEBUG_VERBOSE("pci id check ok, pci_id: 0x%x", pci_id); + } + ret = pci_setup_bars(wb_pci_dev, pci_dev); + if (ret != 0) { + dev_err(&pdev->dev, "Failed to get pci bar address.\n"); + return ret; + } + + if (!wb_pci_dev->setreg || !wb_pci_dev->getreg) { + switch (wb_pci_dev->bus_width) { + case 1: + wb_pci_dev->setreg = pci_dev_setreg_8; + wb_pci_dev->getreg = pci_dev_getreg_8; + break; + + case 2: + wb_pci_dev->setreg = pci_dev_setreg_16; + wb_pci_dev->getreg = pci_dev_getreg_16; + break; + + case 4: + wb_pci_dev->setreg = pci_dev_setreg_32; + wb_pci_dev->getreg = pci_dev_getreg_32; + break; + default: + dev_err(&pdev->dev, "Error: unsupported I/O width (%d).\n", wb_pci_dev->bus_width); + ret = -EINVAL; + goto io_unmap; + } + } + + misc = &wb_pci_dev->misc; + misc->minor = MISC_DYNAMIC_MINOR; + misc->name = wb_pci_dev->name; + misc->fops = &pcie_dev_fops; + misc->mode = 0666; + if (misc_register(misc) != 0) { + dev_err(&pdev->dev, "Failed to register %s device.\n", misc->name); + ret = -ENXIO; + goto io_unmap; + } + if (misc->minor >= MAX_PCIE_NUM) { + dev_err(&pdev->dev, "Error: device minor[%d] more than max pcie num[%d].\n", + misc->minor, MAX_PCIE_NUM); + misc_deregister(misc); + ret = -EINVAL; + goto io_unmap; + } + pcie_dev_arry[misc->minor] = wb_pci_dev; + dev_info(&pdev->dev, "%04x:%02x:%02x.%d[bar%d: %s]: register %s device with minor:%d success.\n", + wb_pci_dev->domain, wb_pci_dev->bus, wb_pci_dev->slot, wb_pci_dev->fn, wb_pci_dev->bar, + wb_pci_dev->bar_flag == IORESOURCE_MEM ? "IORESOURCE_MEM" : "IORESOURCE_IO", + misc->name, misc->minor ); + return 0; + +io_unmap: + if (wb_pci_dev->pci_mem_base) { + iounmap(wb_pci_dev->pci_mem_base); + } + return ret; +} + +static int pci_dev_remove(struct platform_device *pdev) +{ + int i; + + for (i = 0; i < MAX_PCIE_NUM ; i++) { + if (pcie_dev_arry[i] != NULL) { + if (pcie_dev_arry[i]->pci_mem_base) { + iounmap(pcie_dev_arry[i]->pci_mem_base); + } + misc_deregister(&pcie_dev_arry[i]->misc); + pcie_dev_arry[i] = NULL; + } + } + + return 0; +} + +static struct of_device_id pci_dev_match[] = { + { + .compatible = "wb-pci-dev", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, pci_dev_match); + +static struct platform_driver wb_pci_dev_driver = { + .probe = pci_dev_probe, + .remove = pci_dev_remove, + .driver = { + .owner = THIS_MODULE, + .name = PROXY_NAME, + .of_match_table = pci_dev_match, + }, +}; + +static int __init wb_pci_dev_init(void) +{ + return platform_driver_register(&wb_pci_dev_driver); +} + +static void __exit wb_pci_dev_exit(void) +{ + platform_driver_unregister(&wb_pci_dev_driver); +} + +module_init(wb_pci_dev_init); +module_exit(wb_pci_dev_exit); +MODULE_DESCRIPTION("pcie device driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_pcie_dev.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_pcie_dev.h new file mode 100644 index 000000000000..33da8d475f91 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_pcie_dev.h @@ -0,0 +1,28 @@ +#ifndef __WB_PCIE_DEV_H__ +#define __WB_PCIE_DEV_H__ +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +#define UPG_TYPE 'U' +#define GET_FPGA_UPG_CTL_BASE _IOR(UPG_TYPE, 0, int) +#define GET_FPGA_UPG_FLASH_BASE _IOR(UPG_TYPE, 1, int) + +#define PCI_DEV_NAME_MAX_LEN (64) + +typedef struct pci_dev_device_s { + char pci_dev_name[PCI_DEV_NAME_MAX_LEN]; + int pci_domain; + int pci_bus; + int pci_slot; + int pci_fn; + int pci_bar; + int bus_width; + uint32_t check_pci_id; + uint32_t pci_id; + int upg_ctrl_base; + int upg_flash_base; + int device_flag; +} pci_dev_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_platform_i2c_dev.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_platform_i2c_dev.c new file mode 100644 index 000000000000..092c99da2ad8 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_platform_i2c_dev.c @@ -0,0 +1,749 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_platform_i2c_dev.h" + +#define PROXY_NAME "wb-platform-i2c-dev" +#define MAX_I2C_DEV_NUM (256) +#define FPGA_MAX_LEN (256) +#define MAX_NAME_SIZE (20) +#define MAX_BUS_WIDTH (16) +#define TRANSFER_WRITE_BUFF (FPGA_MAX_LEN + MAX_BUS_WIDTH) + +#define WIDTH_1Byte (1) +#define WIDTH_2Byte (2) +#define WIDTH_4Byte (4) + +int g_i2c_dev_debug = 0; +int g_i2c_dev_error = 0; + +module_param(g_i2c_dev_debug, int, S_IRUGO | S_IWUSR); +module_param(g_i2c_dev_error, int, S_IRUGO | S_IWUSR); + +#define I2C_DEV_DEBUG_DMESG(fmt, args...) do { \ + if (g_i2c_dev_debug) { \ + printk(KERN_ERR "[I2C_DEV][DEBUG][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define I2C_DEV_DEBUG_ERROR(fmt, args...) do { \ + if (g_i2c_dev_error) { \ + printk(KERN_ERR "[I2C_DEV][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static struct platform_i2c_dev_info* i2c_dev_arry[MAX_I2C_DEV_NUM]; + +struct platform_i2c_dev_info { + uint32_t i2c_bus; + uint32_t i2c_addr; + const char *name; + uint32_t data_bus_width; + uint32_t addr_bus_width; + uint32_t per_rd_len; + uint32_t per_wr_len; + struct miscdevice misc; +}; + +static int transfer_read(struct platform_i2c_dev_info *i2c_dev, u8 *buf, loff_t regaddr, size_t count) +{ + int i, j; + struct i2c_adapter *adap; + union i2c_smbus_data data; + u8 offset_buf[MAX_BUS_WIDTH]; + struct i2c_msg msgs[2]; + int msgs_num, ret; + u8 offset; + u8 length; + + if (!i2c_dev) { + I2C_DEV_DEBUG_ERROR("can't get read i2c_dev\r\n"); + return -ENODEV; + } + + i = 0; + + mem_clear(offset_buf, sizeof(offset_buf)); + + switch (i2c_dev->addr_bus_width) { + case WIDTH_4Byte: + offset_buf[i++] = (regaddr >> 24) & 0xFF; + offset_buf[i++] = (regaddr >> 16) & 0xFF; + offset_buf[i++] = (regaddr >> 8) & 0xFF; + offset_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_2Byte: + offset_buf[i++] = (regaddr >> 8) & 0xFF; + offset_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_1Byte: + offset_buf[i++] = regaddr & 0xFF; + break; + default: + I2C_DEV_DEBUG_ERROR("Only support 1,2,4 Byte Address Width,but set width = %u\r\n", i2c_dev->addr_bus_width); + return -EINVAL; + } + + adap = i2c_get_adapter(i2c_dev->i2c_bus); + if (adap == NULL) { + I2C_DEV_DEBUG_ERROR("get i2c adapter %d faild.\n", i2c_dev->i2c_bus); + return -ENXIO; + } + + if (adap->algo->master_xfer) { + mem_clear(msgs, sizeof(msgs)); + msgs[0].addr = i2c_dev->i2c_addr; + msgs[0].flags = 0; + msgs[0].len = i2c_dev->addr_bus_width; + msgs[0].buf = offset_buf; + + msgs[1].addr = i2c_dev->i2c_addr; + msgs[1].flags = I2C_M_RD; + msgs[1].len = count; + msgs[1].buf = buf; + + msgs_num = 2; + ret = i2c_transfer(adap, msgs, msgs_num); + if (ret != msgs_num) { + I2C_DEV_DEBUG_ERROR("i2c_transfer read error\r\n"); + ret = -EFAULT; + goto error_exit; + } + } else { + if (i2c_dev->addr_bus_width == WIDTH_1Byte) { + offset = regaddr & 0xFF; + if (i2c_check_functionality(adap, I2C_FUNC_SMBUS_READ_I2C_BLOCK)) { + for (j = 0; j < count; j += I2C_SMBUS_BLOCK_MAX) { + if (count - j > I2C_SMBUS_BLOCK_MAX) { + length = I2C_SMBUS_BLOCK_MAX; + } else { + length = count - j; + } + data.block[0] = length; + ret = adap->algo->smbus_xfer(adap, i2c_dev->i2c_addr, + 0, + I2C_SMBUS_READ, + offset, I2C_SMBUS_I2C_BLOCK_DATA, &data); + if (ret) { + I2C_DEV_DEBUG_ERROR("smbus_xfer read block error, ret = %d\n", ret); + ret = -EFAULT; + goto error_exit; + } + memcpy(buf + j, data.block + 1, length); + offset += length; + } + } else { + for (j = 0; j < count; j++) { + ret = adap->algo->smbus_xfer(adap, i2c_dev->i2c_addr, + 0, + I2C_SMBUS_READ, + offset, I2C_SMBUS_BYTE_DATA, &data); + + if (!ret) { + buf[j] = data.byte; + } else { + I2C_DEV_DEBUG_ERROR("smbus_xfer read byte error, ret = %d\n", ret); + ret = -EFAULT; + goto error_exit; + } + offset++; + } + } + } else { + I2C_DEV_DEBUG_ERROR("smbus_xfer not support addr_bus_width = %d\n", i2c_dev->addr_bus_width); + ret = -EINVAL; + goto error_exit; + } + } + + i2c_put_adapter(adap); + return 0; +error_exit: + i2c_put_adapter(adap); + return ret; +} + +static int transfer_write(struct platform_i2c_dev_info *i2c_dev, u8 *buf, loff_t regaddr, size_t count) +{ + int i, j; + struct i2c_adapter *adap; + union i2c_smbus_data data; + u8 offset_buf[TRANSFER_WRITE_BUFF]; + struct i2c_msg msgs[1]; + int msgs_num, ret; + u8 offset; + u8 length; + + if (!i2c_dev) { + I2C_DEV_DEBUG_ERROR("can't get read i2c_dev\r\n"); + return -ENODEV; + } + + i = 0; + + mem_clear(offset_buf, sizeof(offset_buf)); + + switch (i2c_dev->addr_bus_width) { + case WIDTH_4Byte: + offset_buf[i++] = (regaddr >> 24) & 0xFF; + offset_buf[i++] = (regaddr >> 16) & 0xFF; + offset_buf[i++] = (regaddr >> 8) & 0xFF; + offset_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_2Byte: + offset_buf[i++] = (regaddr >> 8) & 0xFF; + offset_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_1Byte: + offset_buf[i++] = regaddr & 0xFF; + break; + default: + I2C_DEV_DEBUG_ERROR("Only support 1,2,4 Byte Address Width,but set width = %u\r\n", i2c_dev->addr_bus_width); + return -EINVAL; + } + + memcpy(offset_buf + i2c_dev->addr_bus_width, buf, count); + + adap = i2c_get_adapter(i2c_dev->i2c_bus); + if (adap == NULL) { + I2C_DEV_DEBUG_ERROR("get i2c adapter %d faild.\n", i2c_dev->i2c_bus); + return -ENXIO; + } + + if (adap->algo->master_xfer) { + mem_clear(msgs, sizeof(msgs)); + + msgs[0].addr = i2c_dev->i2c_addr; + msgs[0].flags = 0; + msgs[0].len = i2c_dev->addr_bus_width + count; + msgs[0].buf = offset_buf; + + msgs_num = 1; + ret = i2c_transfer(adap, msgs, msgs_num); + if (ret != msgs_num) { + I2C_DEV_DEBUG_ERROR("i2c_transfer write error\r\n"); + ret = -EFAULT; + goto error_exit; + } + } else { + if (i2c_dev->addr_bus_width == WIDTH_1Byte) { + offset = regaddr & 0xFF; + if (i2c_check_functionality(adap, I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) { + for (j = 0; j < count; j += I2C_SMBUS_BLOCK_MAX) { + if (count - j > I2C_SMBUS_BLOCK_MAX) { + length = I2C_SMBUS_BLOCK_MAX; + } else { + length = count - j; + } + data.block[0] = length; + memcpy(data.block + 1, buf + j, length); + ret = adap->algo->smbus_xfer(adap, i2c_dev->i2c_addr, + 0, + I2C_SMBUS_WRITE, + offset, I2C_SMBUS_I2C_BLOCK_DATA, &data); + if (ret) { + I2C_DEV_DEBUG_ERROR("smbus_xfer write block error, ret = %d\r\n", ret); + ret = -EFAULT; + goto error_exit; + } + offset += length; + } + } else { + for (j = 0; j < count; j++) { + data.byte = buf[j]; + ret = adap->algo->smbus_xfer(adap, i2c_dev->i2c_addr, + 0, + I2C_SMBUS_WRITE, + offset, I2C_SMBUS_BYTE_DATA, &data); + if (ret) { + I2C_DEV_DEBUG_ERROR("smbus_xfer write byte error, ret = %d\r\n", ret); + ret = -EFAULT; + goto error_exit; + } + offset += 1; + } + } + } else { + I2C_DEV_DEBUG_ERROR("smbus_xfer not support addr_bus_width = %d\r\n", i2c_dev->addr_bus_width); + ret = -EINVAL; + goto error_exit; + } + } + + i2c_put_adapter(adap); + return 0; +error_exit: + i2c_put_adapter(adap); + return ret; +} + +static long i2c_dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + return 0; +} + +static int i2c_dev_open(struct inode *inode, struct file *file) +{ + unsigned int minor = iminor(inode); + struct platform_i2c_dev_info *i2c_dev; + + i2c_dev = i2c_dev_arry[minor]; + if (i2c_dev == NULL) { + return -ENODEV; + } + + file->private_data = i2c_dev; + + return 0; +} + +static int i2c_dev_release(struct inode *inode, struct file *file) +{ + file->private_data = NULL; + + return 0; +} + +static int device_read(struct platform_i2c_dev_info *i2c_dev, uint32_t offset, uint8_t *buf, int count) +{ + int i, j, ret; + u8 tmp_offset; + u8 val[FPGA_MAX_LEN]; + u32 width, rd_len, per_len, tmp; + u32 max_per_len; + + width = i2c_dev->data_bus_width; + switch (width) { + case WIDTH_4Byte: + tmp_offset = offset & 0x3; + if (tmp_offset) { + I2C_DEV_DEBUG_ERROR("data bus width:%u, offset:%u, read size %d invalid.\r\n", width, offset, count); + return -EINVAL; + } + break; + case WIDTH_2Byte: + tmp_offset = offset & 0x1; + if (tmp_offset) { + I2C_DEV_DEBUG_ERROR("data bus width:%u, offset:%u, read size %d invalid.\r\n", width, offset, count); + return -EINVAL; + } + break; + case WIDTH_1Byte: + break; + default: + I2C_DEV_DEBUG_ERROR("Only support 1,2,4 Byte Data Width,but set width = %u\r\n", width); + return -EINVAL; + } + + max_per_len = i2c_dev->per_rd_len; + tmp = (width - 1) & count; + rd_len = (tmp == 0) ? count : count + width - tmp; + per_len = (rd_len > max_per_len) ? (max_per_len) : (rd_len); + + mem_clear(val, sizeof(val)); + for (i = 0; i < rd_len; i += per_len) { + ret = transfer_read(i2c_dev, val + i, offset + i, per_len); + if (ret < 0) { + I2C_DEV_DEBUG_ERROR("read error.read offset = %u\r\n", (offset + i)); + return -EFAULT; + } + } + + if (width == WIDTH_1Byte) { + memcpy(buf, val, count); + } else { + for (i = 0; i < count; i += width) { + for (j = 0; (j < width) && (i + j < count); j++) { + buf[i + j] = val[i + width - j - 1]; + } + } + } + + return 0; +} + +static int device_write(struct platform_i2c_dev_info *i2c_dev, uint32_t offset, uint8_t *buf, size_t count) +{ + int i, j, ret; + u8 tmp_offset; + u32 width; + u8 val[FPGA_MAX_LEN]; + u32 wr_len, per_len, tmp; + u32 max_per_len; + + width = i2c_dev->data_bus_width; + switch (width) { + case WIDTH_4Byte: + tmp_offset = offset & 0x3; + if (tmp_offset) { + I2C_DEV_DEBUG_ERROR("data bus width:%u, offset:%u, read size %lu invalid.\r\n", width, offset, count); + return -EINVAL; + } + break; + case WIDTH_2Byte: + tmp_offset = offset & 0x1; + if (tmp_offset) { + I2C_DEV_DEBUG_ERROR("data bus width:%u, offset:%u, read size %lu invalid.\r\n", width, offset, count); + return -EINVAL; + } + break; + case WIDTH_1Byte: + break; + default: + I2C_DEV_DEBUG_ERROR("Only support 1,2,4 Byte Data Width,but set width = %u\r\n", width); + return -EINVAL; + } + + mem_clear(val, sizeof(val)); + + if (width == WIDTH_1Byte) { + memcpy(val, buf, count); + } else { + for (i = 0; i < count; i += width) { + for (j = 0; (j < width) && (i + j < count); j++) { + val[i + width - j - 1] = buf[i + j]; + } + } + } + + max_per_len = i2c_dev->per_wr_len; + tmp = (width - 1) & count; + wr_len = (tmp == 0) ? count : count + width - tmp; + per_len = (wr_len > max_per_len) ? (max_per_len) : (wr_len); + + for (i = 0; i < wr_len; i += per_len) { + ret = transfer_write(i2c_dev, val + i, offset + i, per_len); + if (ret < 0) { + I2C_DEV_DEBUG_ERROR("write error.offset = %u\r\n", (offset + i)); + return -EFAULT; + } + } + return 0; +} + +static ssize_t i2c_dev_read(struct file *file, char __user *buf, size_t count, loff_t *offset) +{ + u8 val[FPGA_MAX_LEN]; + int ret; + struct platform_i2c_dev_info *i2c_dev; + + if (count <= 0 || count > sizeof(val)) { + I2C_DEV_DEBUG_ERROR("read conut %lu , beyond max:%lu.\n", count, sizeof(val)); + return -EINVAL; + } + + i2c_dev = file->private_data; + if (i2c_dev == NULL) { + I2C_DEV_DEBUG_ERROR("can't get read private_data .\r\n"); + return -EINVAL; + } + + ret = device_read(i2c_dev, (uint32_t)*offset, val, count); + if (ret < 0) { + I2C_DEV_DEBUG_ERROR("i2c dev read failed, dev name:%s, offset:0x%x, len:%lu.\n", + i2c_dev->name, (uint32_t)*offset, count); + return -EINVAL; + } + + if (copy_to_user(buf, val, count)) { + I2C_DEV_DEBUG_ERROR("copy_to_user error \r\n"); + return -EFAULT; + } else{ + *offset += count; + } + + return count; +} + +static ssize_t i2c_dev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) +{ + u8 val[FPGA_MAX_LEN]; + int ret; + struct platform_i2c_dev_info *i2c_dev; + + if (count <= 0 || count > sizeof(val)) { + I2C_DEV_DEBUG_ERROR("write conut %lu, beyond max val:%lu.\n", count, sizeof(val)); + return -EINVAL; + } + + i2c_dev = file->private_data; + if (i2c_dev == NULL) { + I2C_DEV_DEBUG_ERROR("get write private_data error.\r\n"); + return -EINVAL; + } + + mem_clear(val, sizeof(val)); + if (copy_from_user(val, buf, count)) { + I2C_DEV_DEBUG_ERROR("copy_from_user error.\r\n"); + return -EFAULT; + } + + ret = device_write (i2c_dev, (uint32_t)*offset, val, count); + if (ret < 0) { + I2C_DEV_DEBUG_ERROR("i2c dev write failed, dev name:%s, offset:0x%llx, len:%lu.\n", + i2c_dev->name, *offset, count); + return -EINVAL; + } + + *offset += count; + return count; +} + +static loff_t i2c_dev_llseek(struct file *file, loff_t offset, int origin) +{ + loff_t ret = 0; + + switch (origin) { + case SEEK_SET: + if (offset < 0) { + I2C_DEV_DEBUG_ERROR("SEEK_SET, offset:%lld, invalid.\r\n", offset); + ret = -EINVAL; + break; + } + file->f_pos = offset; + ret = file->f_pos; + break; + case SEEK_CUR: + if (file->f_pos + offset < 0) { + I2C_DEV_DEBUG_ERROR("SEEK_CUR out of range, f_ops:%lld, offset:%lld.\n", + file->f_pos, offset); + } + file->f_pos += offset; + ret = file->f_pos; + break; + default: + I2C_DEV_DEBUG_ERROR("unsupport llseek type:%d.\n", origin); + ret = -EINVAL; + break; + } + return ret; +} + +static const struct file_operations i2c_dev_fops = { + .owner = THIS_MODULE, + .llseek = i2c_dev_llseek, + .read = i2c_dev_read, + .write = i2c_dev_write, + .unlocked_ioctl = i2c_dev_ioctl, + .open = i2c_dev_open, + .release = i2c_dev_release, +}; + +static struct platform_i2c_dev_info * dev_match(const char *path) +{ + struct platform_i2c_dev_info *i2c_dev; + char dev_name[MAX_NAME_SIZE]; + int i; + for (i = 0; i < MAX_I2C_DEV_NUM; i++) { + if (i2c_dev_arry[ i ] == NULL) { + continue; + } + i2c_dev = i2c_dev_arry[ i ]; + snprintf(dev_name, MAX_NAME_SIZE,"/dev/%s", i2c_dev->name); + if (!strcmp(path, dev_name)) { + I2C_DEV_DEBUG_DMESG("get dev_name = %s, minor = %d\n", dev_name, i); + return i2c_dev; + } + } + + return NULL; +} + +int platform_i2c_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count) +{ + struct platform_i2c_dev_info *i2c_dev = NULL; + int ret; + + if(path == NULL){ + I2C_DEV_DEBUG_ERROR("path NULL"); + return -EINVAL; + } + + if(buf == NULL){ + I2C_DEV_DEBUG_ERROR("buf NULL"); + return -EINVAL; + } + + if (count > FPGA_MAX_LEN) { + I2C_DEV_DEBUG_ERROR("read conut %lu, beyond max:%d.\n", count, FPGA_MAX_LEN); + return -EINVAL; + } + + i2c_dev = dev_match(path); + if (i2c_dev == NULL) { + I2C_DEV_DEBUG_ERROR("i2c_dev match failed. dev path = %s", path); + return -EINVAL; + } + + ret = device_read(i2c_dev, offset, buf, count); + if (ret < 0) { + I2C_DEV_DEBUG_ERROR("fpga i2c dev read failed, dev name:%s, offset:0x%x, len:%lu.\n", + i2c_dev->name, offset, count); + return -EINVAL; + } + + return count; +} +EXPORT_SYMBOL(platform_i2c_device_func_read); + +int platform_i2c_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count) +{ + struct platform_i2c_dev_info *i2c_dev = NULL; + int ret; + + if(path == NULL){ + I2C_DEV_DEBUG_ERROR("path NULL"); + return -EINVAL; + } + + if(buf == NULL){ + I2C_DEV_DEBUG_ERROR("buf NULL"); + return -EINVAL; + } + + if (count > FPGA_MAX_LEN) { + I2C_DEV_DEBUG_ERROR("write conut %lu, beyond max:%d.\n", count, FPGA_MAX_LEN); + return -EINVAL; + } + + i2c_dev = dev_match(path); + if (i2c_dev == NULL) { + I2C_DEV_DEBUG_ERROR("i2c_dev match failed. dev path = %s", path); + return -EINVAL; + } + + ret = device_write (i2c_dev, offset, buf, count); + if (ret < 0) { + I2C_DEV_DEBUG_ERROR("i2c dev write failed, dev name:%s, offset:0x%x, len:%lu.\n", + i2c_dev->name, offset, count); + return -EINVAL; + } + + return count; +} +EXPORT_SYMBOL(platform_i2c_device_func_write); + +static int platform_i2c_dev_probe(struct platform_device *pdev) +{ + int ret = 0; + struct platform_i2c_dev_info *i2c_dev; + struct miscdevice *misc; + platform_i2c_dev_device_t *platform_i2c_dev_device; + + i2c_dev = devm_kzalloc(&pdev->dev, sizeof(struct platform_i2c_dev_info), GFP_KERNEL); + if (!i2c_dev) { + dev_err(&pdev->dev, "devm_kzalloc error. \r\n"); + return -ENOMEM; + } + + if (pdev->dev.of_node) { + + ret += of_property_read_u32(pdev->dev.of_node, "i2c_bus", &i2c_dev->i2c_bus); + ret += of_property_read_u32(pdev->dev.of_node, "i2c_addr", &i2c_dev->i2c_addr); + ret += of_property_read_string(pdev->dev.of_node, "i2c_name", &i2c_dev->name); + ret += of_property_read_u32(pdev->dev.of_node, "data_bus_width", &i2c_dev->data_bus_width); + ret += of_property_read_u32(pdev->dev.of_node, "addr_bus_width", &i2c_dev->addr_bus_width); + ret += of_property_read_u32(pdev->dev.of_node, "per_rd_len", &i2c_dev->per_rd_len); + ret += of_property_read_u32(pdev->dev.of_node, "per_wr_len", &i2c_dev->per_wr_len); + if (ret != 0) { + dev_err(&pdev->dev, "dts config error.ret:%d.\r\n", ret); + return -ENXIO; + } + } else { + if (pdev->dev.platform_data == NULL) { + dev_err(&pdev->dev, "Failed to get platform data config.\n"); + return -ENXIO; + } + platform_i2c_dev_device = pdev->dev.platform_data; + i2c_dev->i2c_bus = platform_i2c_dev_device->i2c_bus; + i2c_dev->i2c_addr = platform_i2c_dev_device->i2c_addr; + i2c_dev->name = platform_i2c_dev_device->i2c_name; + i2c_dev->data_bus_width = platform_i2c_dev_device->data_bus_width; + i2c_dev->addr_bus_width = platform_i2c_dev_device->addr_bus_width; + i2c_dev->per_rd_len = platform_i2c_dev_device->per_rd_len; + i2c_dev->per_wr_len = platform_i2c_dev_device->per_wr_len; + } + + if ((i2c_dev->per_rd_len & (i2c_dev->data_bus_width - 1)) || (i2c_dev->per_wr_len & (i2c_dev->data_bus_width - 1))) { + dev_err(&pdev->dev, "Invalid config per_rd_len %d per_wr_len %d data bus_width %d.\r\n", i2c_dev->per_rd_len, + i2c_dev->per_wr_len, i2c_dev->data_bus_width); + return -ENXIO; + } + + misc = &i2c_dev->misc; + misc->minor = MISC_DYNAMIC_MINOR; + misc->name = i2c_dev->name; + misc->fops = &i2c_dev_fops; + if (misc_register(misc) != 0) { + dev_err(&pdev->dev, "register %s faild.\r\n", misc->name); + return -ENXIO; + } + + if (misc->minor >= MAX_I2C_DEV_NUM) { + dev_err(&pdev->dev, "minor number beyond the limit! is %d.\r\n", misc->minor); + misc_deregister(misc); + return -ENXIO; + } + i2c_dev_arry[misc->minor] = i2c_dev; + + dev_info(&pdev->dev, "register %u addr_bus_width %u data_bus_width device %s with %u per_rd_len %u per_wr_len success.\r\n", + i2c_dev->addr_bus_width, i2c_dev->data_bus_width, i2c_dev->name, i2c_dev->per_rd_len, i2c_dev->per_wr_len); + + return 0; +} + +static int platform_i2c_dev_remove(struct platform_device *pdev) +{ + int i; + + for (i = 0; i < MAX_I2C_DEV_NUM ; i++) { + if (i2c_dev_arry[i] != NULL) { + misc_deregister(&i2c_dev_arry[i]->misc); + i2c_dev_arry[i] = NULL; + } + } + + return 0; +} + +static const struct of_device_id platform_i2c_dev_of_match[] = { + { .compatible = "wb-platform-i2c-dev" }, + { }, +}; +MODULE_DEVICE_TABLE(of, platform_i2c_dev_of_match); + +static struct platform_driver wb_platform_i2c_dev_driver = { + .probe = platform_i2c_dev_probe, + .remove = platform_i2c_dev_remove, + .driver = { + .owner = THIS_MODULE, + .name = PROXY_NAME, + .of_match_table = platform_i2c_dev_of_match, + }, +}; + +static int __init wb_platform_i2c_dev_init(void) +{ + return platform_driver_register(&wb_platform_i2c_dev_driver); +} + +static void __exit wb_platform_i2c_dev_exit(void) +{ + platform_driver_unregister(&wb_platform_i2c_dev_driver); +} + +module_init(wb_platform_i2c_dev_init); +module_exit(wb_platform_i2c_dev_exit); + +MODULE_DESCRIPTION("platform i2c dev driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_platform_i2c_dev.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_platform_i2c_dev.h new file mode 100644 index 000000000000..b5158c9fec57 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_platform_i2c_dev.h @@ -0,0 +1,19 @@ +#ifndef __WB_PLATFORM_I2C_DEV_H__ +#define __WB_PLATFORM_I2C_DEV_H__ +#include + +#define mem_clear(data, size) memset((data), 0, (size)) +#define I2C_DEV_NAME_MAX_LEN (64) + +typedef struct platform_i2c_dev_device_s { + uint32_t i2c_bus; + uint32_t i2c_addr; + char i2c_name[I2C_DEV_NAME_MAX_LEN]; + uint32_t data_bus_width; + uint32_t addr_bus_width; + uint32_t per_rd_len; + uint32_t per_wr_len; + int device_flag; +} platform_i2c_dev_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_dev.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_dev.c new file mode 100644 index 000000000000..d70424afb0e7 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_dev.c @@ -0,0 +1,711 @@ +/* + * wb_spi_dev.c + * ko to read/write spi device through /dev/XXX device + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_spi_dev.h" + +#define MAX_SPI_DEV_NUM (256) +#define MAX_RW_LEN (256) +#define MAX_NAME_SIZE (20) +#define MAX_ADDR_BUS_WIDTH (4) + +#define TRANSFER_WRITE_BUFF (1 + MAX_ADDR_BUS_WIDTH + MAX_RW_LEN) + +#define WIDTH_1Byte (1) +#define WIDTH_2Byte (2) +#define WIDTH_4Byte (4) + +#define OP_READ (0x3) +#define OP_WRITE (0x2) + +#define KERNEL_SPASE (0) +#define USER_SPASE (1) + +static int g_spi_dev_debug = 0; +static int g_spi_dev_error = 0; + +module_param(g_spi_dev_debug, int, S_IRUGO | S_IWUSR); +module_param(g_spi_dev_error, int, S_IRUGO | S_IWUSR); + +#define SPI_DEV_DEBUG(fmt, args...) do { \ + if (g_spi_dev_debug) { \ + printk(KERN_ERR "[SPI_DEV][DEBUG][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define SPI_DEV_ERROR(fmt, args...) do { \ + if (g_spi_dev_error) { \ + printk(KERN_ERR "[SPI_DEV][ERR][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static struct spi_dev_info* spi_dev_arry[MAX_SPI_DEV_NUM]; + +struct spi_dev_info { + const char *name; + uint32_t data_bus_width; + uint32_t addr_bus_width; + uint32_t per_rd_len; + uint32_t per_wr_len; + uint32_t spi_len; + struct miscdevice misc; + struct spi_device *spi_device; +}; + +static int transfer_read(struct spi_dev_info *spi_dev, u8 *buf, uint32_t regaddr, size_t count) +{ + int i, ret; + u8 tx_buf[MAX_ADDR_BUS_WIDTH + 1]; + struct spi_message m; + struct spi_transfer xfer[2]; + + i = 0; + mem_clear(tx_buf, sizeof(tx_buf)); + tx_buf[i++] = OP_READ; + + switch (spi_dev->addr_bus_width) { + case WIDTH_4Byte: + tx_buf[i++] = (regaddr >> 24) & 0xFF; + tx_buf[i++] = (regaddr >> 16) & 0xFF; + tx_buf[i++] = (regaddr >> 8) & 0xFF; + tx_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_2Byte: + tx_buf[i++] = (regaddr >> 8) & 0xFF; + tx_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_1Byte: + tx_buf[i++] = regaddr & 0xFF; + break; + default: + SPI_DEV_ERROR("Only support 1,2,4 Byte Width,but set width = %u\n", + spi_dev->addr_bus_width); + return -EINVAL; + } + + mem_clear(xfer, sizeof(xfer)); + spi_message_init(&m); + xfer[0].tx_buf = tx_buf; + xfer[0].len = spi_dev->addr_bus_width + 1; + spi_message_add_tail(&xfer[0], &m); + + xfer[1].rx_buf = buf; + xfer[1].len = count; + spi_message_add_tail(&xfer[1], &m); + + ret = spi_sync(spi_dev->spi_device, &m); + if (ret) { + SPI_DEV_ERROR("transfer_read failed, reg addr:0x%x, len:%lu, ret:%d.\n", + regaddr, count, ret); + return -EIO; + } + return 0; +} + +static int transfer_write(struct spi_dev_info *spi_dev, u8 *buf, uint32_t regaddr, size_t count) +{ + int i, ret; + u8 tx_buf[TRANSFER_WRITE_BUFF]; + struct spi_message m; + struct spi_transfer xfer ; + + i = 0; + mem_clear(tx_buf, sizeof(tx_buf)); + tx_buf[i++] = OP_WRITE; + switch (spi_dev->addr_bus_width) { + case WIDTH_4Byte: + tx_buf[i++] = (regaddr >> 24) & 0xFF; + tx_buf[i++] = (regaddr >> 16) & 0xFF; + tx_buf[i++] = (regaddr >> 8) & 0xFF; + tx_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_2Byte: + tx_buf[i++] = (regaddr >> 8) & 0xFF; + tx_buf[i++] = regaddr & 0xFF; + break; + case WIDTH_1Byte: + tx_buf[i++] = regaddr & 0xFF; + break; + default: + SPI_DEV_ERROR("Only support 1,2,4 Byte Width, but set width = %u\n", + spi_dev->addr_bus_width); + return -EINVAL; + } + + memcpy(tx_buf + i, buf, count); + + mem_clear(&xfer, sizeof(xfer)); + spi_message_init(&m); + xfer.tx_buf = tx_buf; + xfer.len = count + i; + spi_message_add_tail(&xfer, &m); + + ret = spi_sync(spi_dev->spi_device, &m); + if (ret) { + SPI_DEV_ERROR("transfer_write failed, reg addr:0x%x, len:%lu, ret:%d.\n", + regaddr, count, ret); + return -EIO; + } + return 0; +} + +static long spi_dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + return 0; +} + +static int spi_dev_open(struct inode *inode, struct file *file) +{ + unsigned int minor = iminor(inode); + struct spi_dev_info *spi_dev; + + if (minor >= MAX_SPI_DEV_NUM) { + SPI_DEV_ERROR("minor out of range, minor = %d.\n", minor); + return -ENODEV; + } + + spi_dev = spi_dev_arry[minor]; + if (spi_dev == NULL) { + SPI_DEV_ERROR("spi_dev is NULL, open failed, minor = %d\n", minor); + return -ENODEV; + } + + file->private_data = spi_dev; + + return 0; +} + +static int spi_dev_release(struct inode *inode, struct file *file) +{ + file->private_data = NULL; + + return 0; +} + +static int device_read(struct spi_dev_info *spi_dev, uint32_t offset, uint8_t *buf, size_t count) +{ + int i, j, ret; + u8 val[MAX_RW_LEN]; + u32 data_width, rd_len, per_len, tmp; + u32 max_per_len; + + if (offset > spi_dev->spi_len) { + SPI_DEV_DEBUG("offset: 0x%x, spi len: 0x%x, count: %lu, EOF.\n", + offset, spi_dev->spi_len, count); + return 0; + } + + data_width = spi_dev->data_bus_width; + if (offset % data_width) { + SPI_DEV_ERROR("data bus width:%d, offset:0x%x, read size %lu invalid.\n", + data_width, offset, count); + return -EINVAL; + } + + if (count > (spi_dev->spi_len - offset)) { + SPI_DEV_DEBUG("read count out of range. input len:%lu, read len:%u.\n", + count, spi_dev->spi_len - offset); + count = spi_dev->spi_len - offset; + } + + if (count == 0) { + SPI_DEV_DEBUG("offset: 0x%x, spi len: 0x%x, read len: %lu, EOF.\n", + offset, spi_dev->spi_len, count); + return 0; + } + + max_per_len = spi_dev->per_rd_len; + tmp = (data_width - 1) & count; + rd_len = (tmp == 0) ? count : count + data_width - tmp; + per_len = (rd_len > max_per_len) ? (max_per_len) : (rd_len); + + mem_clear(val, sizeof(val)); + for (i = 0; i < rd_len; i += per_len) { + ret = transfer_read(spi_dev, val + i, offset + i, per_len); + if (ret < 0) { + SPI_DEV_ERROR("read error.read offset = %u\n", (offset + i)); + return -EFAULT; + } + } + + if (data_width == WIDTH_1Byte) { + memcpy(buf, val, count); + } else { + for (i = 0; i < count; i += data_width) { + for (j = 0; (j < data_width) && (i + j < count); j++) { + buf[i + j] = val[i + data_width - j - 1]; + } + } + } + + return count; +} + +static int device_write(struct spi_dev_info *spi_dev, uint32_t offset, uint8_t *buf, size_t count) +{ + int i, j, ret; + u32 data_width; + u8 val[MAX_RW_LEN]; + u32 wr_len, per_len, tmp; + u32 max_per_len; + + if (offset > spi_dev->spi_len) { + SPI_DEV_DEBUG("offset: 0x%x, spi len: 0x%x, count: %lu, EOF.\n", + offset, spi_dev->spi_len, count); + return 0; + } + + data_width = spi_dev->data_bus_width; + if (offset % data_width) { + SPI_DEV_ERROR("data bus width:%d, offset:0x%x, read size %lu invalid.\n", + data_width, offset, count); + return -EINVAL; + } + + if (count > (spi_dev->spi_len - offset)) { + SPI_DEV_DEBUG("read count out of range. input len:%lu, read len:%u.\n", + count, spi_dev->spi_len - offset); + count = spi_dev->spi_len - offset; + } + + if (count == 0) { + SPI_DEV_DEBUG("offset: 0x%x, i2c len: 0x%x, read len: %lu, EOF.\n", + offset, spi_dev->spi_len, count); + return 0; + } + + mem_clear(val, sizeof(val)); + + if (data_width == WIDTH_1Byte) { + memcpy(val, buf, count); + } else { + for (i = 0; i < count; i += data_width) { + for (j = 0; (j < data_width) && (i + j < count); j++) { + val[i + data_width - j - 1] = buf[i + j]; + } + } + } + + max_per_len = spi_dev->per_wr_len; + tmp = (data_width - 1) & count; + wr_len = (tmp == 0) ? count : count + data_width - tmp; + per_len = (wr_len > max_per_len) ? (max_per_len) : (wr_len); + + for (i = 0; i < wr_len; i += per_len) { + ret = transfer_write(spi_dev, val + i, offset + i, per_len); + if (ret < 0) { + SPI_DEV_ERROR("write error.offset = %u\n", (offset + i)); + return -EFAULT; + } + } + return count; +} + +static ssize_t spi_dev_read(struct file *file, char __user *buf, size_t count, loff_t *offset, int flag) +{ + u8 val[MAX_RW_LEN]; + int ret, read_len; + struct spi_dev_info *spi_dev; + + spi_dev = file->private_data; + if (spi_dev == NULL) { + SPI_DEV_ERROR("can't get read private_data.\n"); + return -EINVAL; + } + + if (count == 0) { + SPI_DEV_ERROR("Invalid params, read count is 0.\n"); + return -EINVAL; + } + + if (count > sizeof(val)) { + SPI_DEV_DEBUG("read count %lu exceed max %lu.\n", count, sizeof(val)); + count = sizeof(val); + } + + mem_clear(val, sizeof(val)); + read_len = device_read(spi_dev, (uint32_t)*offset, val, count); + if (read_len < 0) { + SPI_DEV_ERROR("spi dev read failed, dev name:%s, offset:0x%x, len:%lu.\n", + spi_dev->name, (uint32_t)*offset, count); + return read_len; + } + + /* check flag is user spase or kernel spase */ + if (flag == USER_SPASE) { + SPI_DEV_DEBUG("user space read, buf: %p, offset: %lld, read count %lu.\n", + buf, *offset, count); + if (copy_to_user(buf, val, read_len)) { + SPI_DEV_ERROR("copy_to_user failed.\n"); + return -EFAULT; + } + } else { + SPI_DEV_DEBUG("kernel space read, buf: %p, offset: %lld, read count %lu.\n", + buf, *offset, count); + memcpy(buf, val, read_len); + } + + *offset += read_len; + ret = read_len; + return ret; +} + +static ssize_t spi_dev_read_user(struct file *file, char __user *buf, size_t count, loff_t *offset) +{ + int ret; + + SPI_DEV_DEBUG("spi_dev_read_user, file: %p, count: %lu, offset: %lld\n", + file, count, *offset); + ret = spi_dev_read(file, buf, count, offset, USER_SPASE); + return ret; +} + +static ssize_t spi_dev_read_iter(struct kiocb *iocb, struct iov_iter *to) +{ + int ret; + + SPI_DEV_DEBUG("spi_dev_read_iter, file: %p, count: %lu, offset: %lld\n", + iocb->ki_filp, to->count, iocb->ki_pos); + ret = spi_dev_read(iocb->ki_filp, to->kvec->iov_base, to->count, &iocb->ki_pos, KERNEL_SPASE); + return ret; +} + +static ssize_t spi_dev_write(struct file *file, const char __user *buf, + size_t count, loff_t *offset, int flag) +{ + u8 val[MAX_RW_LEN]; + int write_len; + struct spi_dev_info *spi_dev; + + spi_dev = file->private_data; + if (spi_dev == NULL) { + SPI_DEV_ERROR("get write private_data error.\n"); + return -EINVAL; + } + + if (count == 0) { + SPI_DEV_ERROR("Invalid params, write count is 0.\n"); + return -EINVAL; + } + + if (count > sizeof(val)) { + SPI_DEV_DEBUG("write count %lu exceed max %lu.\n", count, sizeof(val)); + count = sizeof(val); + } + + mem_clear(val, sizeof(val)); + /* check flag is user spase or kernel spase */ + if (flag == USER_SPASE) { + SPI_DEV_DEBUG("user space write, buf: %p, offset: %lld, write count %lu.\n", + buf, *offset, count); + if (copy_from_user(val, buf, count)) { + SPI_DEV_ERROR("copy_from_user failed.\n"); + return -EFAULT; + } + } else { + SPI_DEV_DEBUG("kernel space write, buf: %p, offset: %lld, write count %lu.\n", + buf, *offset, count); + memcpy(val, buf, count); + } + + write_len = device_write(spi_dev, (uint32_t)*offset, val, count); + if (write_len < 0) { + SPI_DEV_ERROR("spi dev write failed, dev name:%s, offset:0x%llx, len:%lu.\n", + spi_dev->name, *offset, count); + return write_len; + } + + *offset += write_len; + return write_len; +} + +static ssize_t spi_dev_write_user(struct file *file, const char __user *buf, size_t count, loff_t *offset) +{ + int ret; + + SPI_DEV_DEBUG("spi_dev_write_user, file: %p, count: %lu, offset: %lld\n", + file, count, *offset); + ret = spi_dev_write(file, buf, count, offset, USER_SPASE); + return ret; +} + +static ssize_t spi_dev_write_iter(struct kiocb *iocb, struct iov_iter *from) +{ + int ret; + + SPI_DEV_DEBUG("spi_dev_write_iter, file: %p, count: %lu, offset: %lld\n", + iocb->ki_filp, from->count, iocb->ki_pos); + ret = spi_dev_write(iocb->ki_filp, from->kvec->iov_base, from->count, &iocb->ki_pos, KERNEL_SPASE); + return ret; +} + +static loff_t spi_dev_llseek(struct file *file, loff_t offset, int origin) +{ + loff_t ret = 0; + struct spi_dev_info *spi_dev; + + spi_dev = file->private_data; + if (spi_dev == NULL) { + SPI_DEV_ERROR("spi_dev is NULL, llseek failed.\n"); + return -EINVAL; + } + + switch (origin) { + case SEEK_SET: + if (offset < 0) { + SPI_DEV_ERROR("SEEK_SET, offset:%lld, invalid.\n", offset); + ret = -EINVAL; + break; + } + if (offset > spi_dev->spi_len) { + SPI_DEV_ERROR("SEEK_SET out of range, offset:%lld, i2c_len:0x%x.\n", + offset, spi_dev->spi_len); + ret = - EINVAL; + break; + } + file->f_pos = offset; + ret = file->f_pos; + break; + case SEEK_CUR: + if (((file->f_pos + offset) > spi_dev->spi_len) || ((file->f_pos + offset) < 0)) { + SPI_DEV_ERROR("SEEK_CUR out of range, f_ops:%lld, offset:%lld.\n", + file->f_pos, offset); + } + file->f_pos += offset; + ret = file->f_pos; + break; + default: + SPI_DEV_ERROR("unsupport llseek type:%d.\n", origin); + ret = -EINVAL; + break; + } + return ret; +} + +static const struct file_operations spi_dev_fops = { + .owner = THIS_MODULE, + .llseek = spi_dev_llseek, + .read = spi_dev_read_user, + .write = spi_dev_write_user, + .read_iter = spi_dev_read_iter, + .write_iter = spi_dev_write_iter, + .unlocked_ioctl = spi_dev_ioctl, + .open = spi_dev_open, + .release = spi_dev_release, +}; + +static struct spi_dev_info * dev_match(const char *path) +{ + struct spi_dev_info * spi_dev; + char dev_name[MAX_NAME_SIZE]; + int i; + for (i = 0; i < MAX_SPI_DEV_NUM; i++) { + if (spi_dev_arry[ i ] == NULL) { + continue; + } + spi_dev = spi_dev_arry[ i ]; + snprintf(dev_name, MAX_NAME_SIZE,"/dev/%s", spi_dev->name); + if (!strcmp(path, dev_name)) { + SPI_DEV_DEBUG("get dev_name = %s, minor = %d\n", dev_name, i); + return spi_dev; + } + } + + return NULL; +} + +int spi_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count) +{ + struct spi_dev_info *spi_dev = NULL; + int ret; + + if(path == NULL){ + SPI_DEV_ERROR("path NULL"); + return -EINVAL; + } + + if(buf == NULL){ + SPI_DEV_ERROR("buf NULL"); + return -EINVAL; + } + + if (count > MAX_RW_LEN) { + SPI_DEV_ERROR("read count %lu, beyond max:%d.\n", count, MAX_RW_LEN); + return -EINVAL; + } + + spi_dev = dev_match(path); + if (spi_dev == NULL) { + SPI_DEV_ERROR("spi_dev match failed. dev path = %s", path); + return -EINVAL; + } + + ret = device_read(spi_dev, offset, buf, count); + if (ret < 0) { + SPI_DEV_ERROR("spi dev read failed, dev name:%s, offset:0x%x, len:%lu.\n", + spi_dev->name, offset, count); + return -EINVAL; + } + + return count; +} +EXPORT_SYMBOL(spi_device_func_read); + +int spi_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count) +{ + struct spi_dev_info *spi_dev = NULL; + int ret; + + if(path == NULL){ + SPI_DEV_ERROR("path NULL"); + return -EINVAL; + } + + if(buf == NULL){ + SPI_DEV_ERROR("buf NULL"); + return -EINVAL; + } + + if (count > MAX_RW_LEN) { + SPI_DEV_ERROR("write count %lu, beyond max:%d.\n", count, MAX_RW_LEN); + return -EINVAL; + } + + spi_dev = dev_match(path); + if (spi_dev == NULL) { + SPI_DEV_ERROR("i2c_dev match failed. dev path = %s", path); + return -EINVAL; + } + + ret = device_write (spi_dev, offset, buf, count); + if (ret < 0) { + SPI_DEV_ERROR("i2c dev write failed, dev name:%s, offset:0x%x, len:%lu.\n", + spi_dev->name, offset, count); + return -EINVAL; + } + + return count; +} +EXPORT_SYMBOL(spi_device_func_write); + +static int spi_dev_probe(struct spi_device *spi) +{ + int ret; + struct spi_dev_info *spi_dev; + struct miscdevice *misc; + spi_dev_device_t *spi_dev_device; + + spi_dev = devm_kzalloc(&spi->dev, sizeof(struct spi_dev_info), GFP_KERNEL); + if (!spi_dev) { + dev_err(&spi->dev, "devm_kzalloc error. \n"); + return -ENOMEM; + } + + spi_set_drvdata(spi, spi_dev); + spi_dev->spi_device = spi; + + if (spi->dev.of_node) { + + ret = 0; + ret += of_property_read_string(spi->dev.of_node, "spi_dev_name", &spi_dev->name); + ret += of_property_read_u32(spi->dev.of_node, "data_bus_width", &spi_dev->data_bus_width); + ret += of_property_read_u32(spi->dev.of_node, "addr_bus_width", &spi_dev->addr_bus_width); + ret += of_property_read_u32(spi->dev.of_node, "per_rd_len", &spi_dev->per_rd_len); + ret += of_property_read_u32(spi->dev.of_node, "per_wr_len", &spi_dev->per_wr_len); + ret += of_property_read_u32(spi->dev.of_node, "spi_len", &spi_dev->spi_len); + if (ret != 0) { + dev_err(&spi->dev, "dts config error.ret:%d.\n", ret); + return -ENXIO; + } + } else { + if (spi->dev.platform_data == NULL) { + dev_err(&spi->dev, "Failed to get platform data config.\n"); + return -ENXIO; + } + spi_dev_device = spi->dev.platform_data; + spi_dev->name = spi_dev_device->spi_dev_name; + spi_dev->data_bus_width = spi_dev_device->data_bus_width; + spi_dev->addr_bus_width = spi_dev_device->addr_bus_width; + spi_dev->per_rd_len = spi_dev_device->per_rd_len; + spi_dev->per_wr_len = spi_dev_device->per_wr_len; + spi_dev->spi_len = spi_dev_device->spi_len; + } + + if ((spi_dev->per_rd_len & (spi_dev->data_bus_width - 1)) + || (spi_dev->per_wr_len & (spi_dev->data_bus_width - 1))) { + dev_err(&spi->dev, "Invalid config per_rd_len [%u] per_wr_len [%u] data bus_width [%u], addr bus width [%u].\n", + spi_dev->per_rd_len, spi_dev->per_wr_len, spi_dev->data_bus_width, spi_dev->addr_bus_width); + return -ENXIO; + } + + misc = &spi_dev->misc; + misc->minor = MISC_DYNAMIC_MINOR; + misc->name = spi_dev->name; + misc->fops = &spi_dev_fops; + misc->mode = 0666; + if (misc_register(misc) != 0) { + dev_err(&spi->dev, "register %s faild.\n", misc->name); + return -ENXIO; + } + + if (misc->minor >= MAX_SPI_DEV_NUM) { + dev_err(&spi->dev, "minor number beyond the limit! is %d.\n", misc->minor); + misc_deregister(misc); + return -ENXIO; + } + spi_dev_arry[misc->minor] = spi_dev; + + dev_info(&spi->dev, "register %u data_bus_width %u addr_bus_witdh 0x%x spi_len device %s with %u per_rd_len %u per_wr_len success.\n", + spi_dev->data_bus_width, spi_dev->addr_bus_width, spi_dev->spi_len, spi_dev->name, spi_dev->per_rd_len, spi_dev->per_wr_len); + + return 0; +} + +static void spi_dev_remove(struct spi_device *spi) +{ + int i; + + for (i = 0; i < MAX_SPI_DEV_NUM; i++) { + if (spi_dev_arry[i] != NULL) { + misc_deregister(&spi_dev_arry[i]->misc); + spi_dev_arry[i] = NULL; + } + } + return; +} + +static const struct of_device_id spi_dev_of_match[] = { + { .compatible = "wb-spi-dev" }, + { }, +}; + +MODULE_DEVICE_TABLE(of, spi_dev_of_match); + +static struct spi_driver spi_dev_driver = { + .driver = { + .name = "wb-spi-dev", + .of_match_table = of_match_ptr(spi_dev_of_match), + }, + .probe = spi_dev_probe, + .remove = spi_dev_remove, +}; + +module_spi_driver(spi_dev_driver); + +MODULE_DESCRIPTION("spi dev driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_dev.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_dev.h new file mode 100644 index 000000000000..fed5237e3860 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_dev.h @@ -0,0 +1,17 @@ +#ifndef __WB_SPI_DEV_H__ +#define __WB_SPI_DEV_H__ +#include + +#define mem_clear(data, size) memset((data), 0, (size)) +#define SPI_DEV_NAME_MAX_LEN (64) + +typedef struct spi_dev_device_s { + char spi_dev_name[SPI_DEV_NAME_MAX_LEN]; + uint32_t data_bus_width; + uint32_t addr_bus_width; + uint32_t per_rd_len; + uint32_t per_wr_len; + uint32_t spi_len; +} spi_dev_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_gpio_device.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_gpio_device.c new file mode 100644 index 000000000000..b073dac08a8a --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_gpio_device.c @@ -0,0 +1,163 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define mem_clear(data, size) memset((data), 0, (size)) + +#define DEFAULT_GPIO_SCK (67) +#define DEFAULT_GPIO_MISO (32) +#define DEFAULT_GPIO_MOSI (65) +#define DEFAULT_GPIO_CS (6) +#define DEFAULT_SPI_BUS (0) + +static int sck = DEFAULT_GPIO_SCK; +module_param(sck, int, S_IRUGO | S_IWUSR); + +static int miso = DEFAULT_GPIO_MISO; +module_param(miso, int, S_IRUGO | S_IWUSR); + +static int mosi = DEFAULT_GPIO_MOSI; +module_param(mosi, int, S_IRUGO | S_IWUSR); + +static int cs = DEFAULT_GPIO_CS; +module_param(cs, int, S_IRUGO | S_IWUSR); + +static int bus = DEFAULT_SPI_BUS; +module_param(bus, int, S_IRUGO | S_IWUSR); + +static int g_wb_spi_gpio_device_debug = 0; +static int g_wb_spi_gpio_device_error = 0; + +module_param(g_wb_spi_gpio_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_spi_gpio_device_error, int, S_IRUGO | S_IWUSR); + +static char gpiod_lookup_table_devid[64]; + +static char *gpio_chip_name = NULL; +module_param(gpio_chip_name, charp, 0644); +MODULE_PARM_DESC(str_var, "A string variable for GPIO controller"); + +#define WB_SPI_GPIO_DEVICE_VERBOSE(fmt, args...) do { \ + if (g_wb_spi_gpio_device_debug) { \ + printk(KERN_INFO "[WB_SPI_GPIO_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_SPI_GPIO_DEVICE_ERROR(fmt, args...) do { \ + if (g_wb_spi_gpio_device_error) { \ + printk(KERN_ERR "[WB_SPI_GPIO_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static struct gpiod_lookup_table wb_spi_gpio_table = { + .table = { + GPIO_LOOKUP("wb_gpio_d1500", DEFAULT_GPIO_SCK, + "sck", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("wb_gpio_d1500", DEFAULT_GPIO_MOSI, + "mosi", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("wb_gpio_d1500", DEFAULT_GPIO_MISO, + "miso", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("wb_gpio_d1500", DEFAULT_GPIO_CS, + "cs", GPIO_ACTIVE_HIGH), + { }, + }, +}; + +static struct spi_gpio_platform_data spi_pdata = { + .num_chipselect = 1, +}; + +static void spi_gpio_release(struct device *dev) +{ + return; +} + +static struct platform_device wb_spi_gpio_device = { + .name = "wb_spi_gpio", + .num_resources = 0, + .id = -1, + + .dev = { + .platform_data = &spi_pdata, + .release = spi_gpio_release, + } +}; + +static void wb_spi_gpio_table_devid_name_set(void) { + int size; + + size = sizeof(gpiod_lookup_table_devid); + wb_spi_gpio_device.id = bus; + + mem_clear(gpiod_lookup_table_devid, size); + switch (bus) { + case PLATFORM_DEVID_NONE: + snprintf(gpiod_lookup_table_devid, size, "%s", wb_spi_gpio_device.name); + break; + case PLATFORM_DEVID_AUTO: + snprintf(gpiod_lookup_table_devid, size, "%s.%d.auto", wb_spi_gpio_device.name, bus); + break; + default: + snprintf(gpiod_lookup_table_devid, size, "%s.%d", wb_spi_gpio_device.name, bus); + break; + } + + wb_spi_gpio_table.dev_id = gpiod_lookup_table_devid; + return ; +} +static int __init wb_spi_gpio_device_init(void) +{ + int err; + struct gpiod_lookup *p; + + WB_SPI_GPIO_DEVICE_VERBOSE("enter!\n"); + wb_spi_gpio_table.table[0].chip_hwnum = sck; + wb_spi_gpio_table.table[1].chip_hwnum = mosi; + wb_spi_gpio_table.table[2].chip_hwnum = miso; + wb_spi_gpio_table.table[3].chip_hwnum = cs; + if (gpio_chip_name) { + wb_spi_gpio_table.table[0].key = gpio_chip_name; + wb_spi_gpio_table.table[1].key = gpio_chip_name; + wb_spi_gpio_table.table[2].key = gpio_chip_name; + wb_spi_gpio_table.table[3].key = gpio_chip_name; + } + wb_spi_gpio_table_devid_name_set(); + WB_SPI_GPIO_DEVICE_VERBOSE("spi gpi device table bus[%d] dev id[%s]\n", bus, wb_spi_gpio_table.dev_id); + for (p = &wb_spi_gpio_table.table[0]; p->key; p++) { + WB_SPI_GPIO_DEVICE_VERBOSE("con_id:%s gpio:%d\n", p->con_id, p->chip_hwnum); + } + + gpiod_add_lookup_table(&wb_spi_gpio_table); + err = platform_device_register(&wb_spi_gpio_device); + if (err < 0) { + printk(KERN_ERR "register spi gpio device fail(%d). \n", err); + gpiod_remove_lookup_table(&wb_spi_gpio_table); + return -1; + } + + return 0; +} + +static void __exit wb_spi_gpio_device_exit(void) +{ + WB_SPI_GPIO_DEVICE_VERBOSE("enter!\n"); + platform_device_unregister(&wb_spi_gpio_device); + gpiod_remove_lookup_table(&wb_spi_gpio_table); +} + +module_init(wb_spi_gpio_device_init); +module_exit(wb_spi_gpio_device_exit); +MODULE_DESCRIPTION("SPI GPIO Devices"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_ocores.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_ocores.c new file mode 100644 index 000000000000..5cf3538d88fa --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_ocores.c @@ -0,0 +1,1039 @@ +/* + * wb_spi_ocores.c + * ko to create ocores spi adapter + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_spi_ocores.h" + +#define SPIOC_WAIT_SCH (5) +#define SPIOC_CONF (0x00) +#define SPIOC_LSBF BIT(0) /* 0:MSB 1:LSB */ +#define SPIOC_IDLE_LOW BIT(1) +#define SPIOC_INTREN BIT(2) /* 0:enable 1:disabel */ +#define SPIOC_DIV_MASK (0xf0) +#define SPIOC_MAX_DIV (0x0E) +#define SPIOC_DIV(div) (((div) & 0x0f) << 4) + +#define SPIOC_STS (0x01) +#define SPIOC_INTR_STS BIT(0) +#define SPIOC_BUSY_STS BIT(1) +#define SPIOC_RXNUM_SHIFT (4) +#define SPIOC_RXNUM_MASK (0xf << SPIOC_RXNUM_SHIFT) +/* Just for read */ +#define SPIOC_RXNUM(reg) (((reg) & SPIOC_RXNUM_MASK) >> SPIOC_RXNUM_SHIFT ) + +#define SPIOC_TXTOT_NUM (0x02) +#define SPIOC_TXNUM(reg) ((reg) & 0x0f) +#define SPIOC_TOTNUM(reg) (((reg) & 0x0f) << 4) + +#define SPIOC_TXCTL (0x03) +#define SPIOC_CSLV BIT(0) /* 0:Deassert SPICS 1:Laeve SPICS */ +#define SPIOC_TRSTART BIT(1) +#define SPIOC_CSID_SHIFT (5) +#define SPIOC_CSID_MASK (0x7 << SPIOC_CSID_SHIFT) +/* Just for write */ +#define SPIOC_CSID(id) (((id) << SPIOC_CSID_SHIFT) & SPIOC_CSID_MASK) + +/* Just single byte */ +#define SPIOC_RX(i) ((0x4) + i) +#define SPIOC_TX(i) ((0x4) + i) + +#define SPIOC_MAX_LEN ((unsigned int)8) +#define SPIOC_TXRX_MAX_LEN ((unsigned int)7) + +#define MODEBITS (SPI_CPHA |SPI_CPOL | SPI_LSB_FIRST |SPI_CS_HIGH) + +#define REG_IO_WIDTH_1 (1) +#define REG_IO_WIDTH_2 (2) +#define REG_IO_WIDTH_4 (4) + +#define SYMBOL_I2C_DEV_MODE (1) +#define FILE_MODE (2) +#define SYMBOL_PCIE_DEV_MODE (3) +#define SYMBOL_IO_DEV_MODE (4) + +int g_spi_oc_debug = 0; +int g_spi_oc_error = 0; + +module_param(g_spi_oc_debug, int, S_IRUGO | S_IWUSR); +module_param(g_spi_oc_error, int, S_IRUGO | S_IWUSR); + +#define SPI_OC_VERBOSE(fmt, args...) do { \ + if (g_spi_oc_debug) { \ + printk(KERN_INFO "[OC_SPI_BUS][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define SPI_OC_ERROR(fmt, args...) do { \ + if (g_spi_oc_error) { \ + printk(KERN_ERR "[OC_SPI_BUS][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +struct spioc { + /* bitbang has to be first */ + struct spi_bitbang bitbang; + int irq; + struct completion done; + unsigned int reamin_len; + unsigned int cur_pos; + unsigned int cur_len; + const u8 *txp; + u8 *rxp; + u8 chip_select; + void (*setreg)(struct spioc *spioc, int reg, u32 value); + u32 (*getreg)(struct spioc *spioc, int reg); + uint32_t bus_num; + const char *dev_name; + uint32_t reg_access_mode; + uint32_t base_addr; + uint32_t reg_shift; + uint32_t reg_io_width; + uint32_t num_chipselect; + uint32_t freq; + uint32_t big_endian; + struct device *dev; + int transfer_busy_flag; +}; + +extern int i2c_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int i2c_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int pcie_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int pcie_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int io_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int io_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); + +static int oc_spi_file_read(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDONLY, 0); + if (IS_ERR(filp)) { + SPI_OC_ERROR("read open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_DEST, &iov, 1, iov.iov_len); + ret = vfs_iter_read(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + SPI_OC_ERROR("vfs_iter_read failed, path=%s, addr=%d, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int oc_spi_file_write(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDWR, 777); + if (IS_ERR(filp)) { + SPI_OC_ERROR("write open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_SOURCE, &iov, 1, iov.iov_len); + ret = vfs_iter_write(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + SPI_OC_ERROR("vfs_iter_write failed, path=%s, addr=%d, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + vfs_fsync(filp, 1); + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int oc_spi_reg_write(struct spioc *spioc, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + + switch (spioc->reg_access_mode) { + case SYMBOL_I2C_DEV_MODE: + ret = i2c_device_func_write(spioc->dev_name, pos, val, size); + break; + case FILE_MODE: + ret = oc_spi_file_write(spioc->dev_name, pos, val, size); + break; + case SYMBOL_PCIE_DEV_MODE: + ret = pcie_device_func_write(spioc->dev_name, pos, val, size); + break; + case SYMBOL_IO_DEV_MODE: + ret = io_device_func_write(spioc->dev_name, pos, val, size); + break; + default: + SPI_OC_ERROR("err func_mode, write failed.\n"); + return -EINVAL; + } + + return ret; +} + +static int oc_spi_reg_read(struct spioc *spioc, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + + switch (spioc->reg_access_mode) { + case SYMBOL_I2C_DEV_MODE: + ret = i2c_device_func_read(spioc->dev_name, pos, val, size); + break; + case FILE_MODE: + ret = oc_spi_file_read(spioc->dev_name, pos, val, size); + break; + case SYMBOL_PCIE_DEV_MODE: + ret = pcie_device_func_read(spioc->dev_name, pos, val, size); + break; + case SYMBOL_IO_DEV_MODE: + ret = io_device_func_read(spioc->dev_name, pos, val, size); + break; + default: + SPI_OC_ERROR("err func_mode, read failed.\n"); + return -EINVAL; + } + + return ret; +} + +static void oc_spi_setreg_8(struct spioc *spioc, int reg, u32 value) +{ + u8 buf_tmp[REG_IO_WIDTH_1]; + u32 pos; + + pos = spioc->base_addr + (reg << spioc->reg_shift); + SPI_OC_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + spioc->dev_name, spioc->reg_access_mode, pos, value); + + buf_tmp[0] = (value & 0Xff); + oc_spi_reg_write(spioc, pos, buf_tmp, REG_IO_WIDTH_1); + return; +} + +static void oc_spi_setreg_16(struct spioc *spioc, int reg, u32 value) +{ + u8 buf_tmp[REG_IO_WIDTH_2]; + u32 pos; + + pos = spioc->base_addr + (reg << spioc->reg_shift); + SPI_OC_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + spioc->dev_name, spioc->reg_access_mode, pos, value); + + buf_tmp[0] = (value & 0Xff); + buf_tmp[1] = (value >> 8) & 0xff; + oc_spi_reg_write(spioc, pos, buf_tmp, REG_IO_WIDTH_2); + return; +} + +static void oc_spi_setreg_32(struct spioc *spioc, int reg, u32 value) +{ + u8 buf_tmp[REG_IO_WIDTH_4]; + u32 pos; + + pos = spioc->base_addr + (reg << spioc->reg_shift); + SPI_OC_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + spioc->dev_name, spioc->reg_access_mode, pos, value); + + buf_tmp[0] = (value & 0xff); + buf_tmp[1] = (value >> 8) & 0xff; + buf_tmp[2] = (value >> 16) & 0xff; + buf_tmp[3] = (value >> 24) & 0xff; + + oc_spi_reg_write(spioc, pos, buf_tmp, REG_IO_WIDTH_4); + return; +} + +static void oc_spi_setreg_16be(struct spioc *spioc, int reg, u32 value) +{ + u8 buf_tmp[REG_IO_WIDTH_2]; + u32 pos; + + pos = spioc->base_addr + (reg << spioc->reg_shift); + SPI_OC_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + spioc->dev_name, spioc->reg_access_mode, pos, value); + + buf_tmp[0] = (value >> 8) & 0xff; + buf_tmp[1] = (value & 0Xff); + oc_spi_reg_write(spioc, pos, buf_tmp, REG_IO_WIDTH_2); + return; +} + +static void oc_spi_setreg_32be(struct spioc *spioc, int reg, u32 value) +{ + u8 buf_tmp[REG_IO_WIDTH_4]; + u32 pos; + + pos = spioc->base_addr + (reg << spioc->reg_shift); + SPI_OC_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + spioc->dev_name, spioc->reg_access_mode, pos, value); + + buf_tmp[0] = (value >> 24) & 0xff; + buf_tmp[1] = (value >> 16) & 0xff; + buf_tmp[2] = (value >> 8) & 0xff; + buf_tmp[3] = (value & 0xff); + oc_spi_reg_write(spioc, pos, buf_tmp, REG_IO_WIDTH_4); + return; +} + +static inline u32 oc_spi_getreg_8(struct spioc *spioc, int reg) +{ + u8 buf_tmp[REG_IO_WIDTH_1]; + u32 value, pos; + + pos = spioc->base_addr + (reg << spioc->reg_shift); + oc_spi_reg_read(spioc, pos, buf_tmp, REG_IO_WIDTH_1); + value = buf_tmp[0]; + + SPI_OC_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + spioc->dev_name, spioc->reg_access_mode, pos, value); + + return value; +} + +static inline u32 oc_spi_getreg_16(struct spioc *spioc, int reg) +{ + u8 buf_tmp[REG_IO_WIDTH_2]; + u32 value, pos; + int i; + + pos = spioc->base_addr + (reg << spioc->reg_shift); + mem_clear(buf_tmp, sizeof(buf_tmp)); + oc_spi_reg_read(spioc, pos, buf_tmp, REG_IO_WIDTH_2); + + value = 0; + for (i = 0; i < REG_IO_WIDTH_2 ; i++) { + value |= buf_tmp[i] << (8 * i); + } + + SPI_OC_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + spioc->dev_name, spioc->reg_access_mode, pos, value); + return value; +} + +static inline u32 oc_spi_getreg_32(struct spioc *spioc, int reg) +{ + u8 buf_tmp[REG_IO_WIDTH_4]; + u32 value, pos; + int i; + + pos = spioc->base_addr + (reg << spioc->reg_shift); + mem_clear(buf_tmp, sizeof(buf_tmp)); + oc_spi_reg_read(spioc, pos, buf_tmp, REG_IO_WIDTH_4); + + value = 0; + for (i = 0; i < REG_IO_WIDTH_4 ; i++) { + value |= buf_tmp[i] << (8 * i); + } + SPI_OC_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + spioc->dev_name, spioc->reg_access_mode, pos, value); + return value; +} + +static inline u32 oc_spi_getreg_16be(struct spioc *spioc, int reg) +{ + u8 buf_tmp[REG_IO_WIDTH_2]; + u32 value, pos; + int i; + + pos = spioc->base_addr + (reg << spioc->reg_shift); + + mem_clear(buf_tmp, sizeof(buf_tmp)); + oc_spi_reg_read(spioc, pos, buf_tmp, REG_IO_WIDTH_2); + + value = 0; + for (i = 0; i < REG_IO_WIDTH_2 ; i++) { + value |= buf_tmp[i] << (8 * (REG_IO_WIDTH_2 -i - 1)); + } + + SPI_OC_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + spioc->dev_name, spioc->reg_access_mode, pos, value); + return value; +} + +static inline u32 oc_spi_getreg_32be(struct spioc *spioc, int reg) +{ + u8 buf_tmp[REG_IO_WIDTH_4]; + u32 value, pos; + int i; + + pos = spioc->base_addr + (reg << spioc->reg_shift); + + mem_clear(buf_tmp, sizeof(buf_tmp)); + oc_spi_reg_read(spioc, pos, buf_tmp, REG_IO_WIDTH_4); + + value = 0; + for (i = 0; i < REG_IO_WIDTH_4 ; i++) { + value |= buf_tmp[i] << (8 * (REG_IO_WIDTH_4 -i - 1)); + } + + SPI_OC_VERBOSE("path:%s, access mode:%d, pos:0x%x, value0x%x.\n", + spioc->dev_name, spioc->reg_access_mode, pos, value); + return value; + +} + +static inline void oc_spi_setreg(struct spioc *spioc, int reg, u32 value) +{ + spioc->setreg(spioc, reg, value); + return; +} + +static inline u32 oc_spi_getreg(struct spioc *spioc, int reg) +{ + return spioc->getreg(spioc, reg); +} + +static int spioc_get_clkdiv(struct spioc *spioc, u32 speed) +{ + u32 rate, div; + + rate = spioc->freq; + SPI_OC_VERBOSE("clk get rate:%u, speed:%u\n", rate, speed); + /* fs = fw/((DIV+2)*2) */ + + if (speed > (rate / 4)) { + div = 0; + SPI_OC_VERBOSE("spi device speed[%u] more than a quarter of clk rate[%u].\n", + speed, rate); + return div; + } + div = (rate/(2 * speed)) - 2; + if (div > SPIOC_MAX_DIV) { + SPI_OC_ERROR("Unsupport spi device speed, div:%u.\n", div); + return -1; + } + SPI_OC_VERBOSE("DIV is:0x%x\n", div); + return div; +} + +static inline int spioc_wait_trans(struct spioc *spioc, const unsigned long timeout) +{ + unsigned long j; + unsigned int sch_time; + u8 reg; + + j = jiffies + timeout; + sch_time = SPIOC_WAIT_SCH; + while (1) { + reg = oc_spi_getreg(spioc, SPIOC_STS); + if (!(reg & SPIOC_BUSY_STS)) { + SPI_OC_VERBOSE("wait ok!\n"); + break; + } + + if (time_after(jiffies, j)) { + return -ETIMEDOUT; + } + + usleep_range(sch_time, sch_time + 1); + } + + return 0; +} + +static void spioc_chipselect(struct spi_device *spi, int is_active) +{ + struct spioc *spioc; + u8 tx_conf; + int ret; + + spioc = spi_master_get_devdata(spi->master); + spioc->transfer_busy_flag = 0; + ret = spioc_wait_trans(spioc, msecs_to_jiffies(100)); + if (ret < 0) { + SPI_OC_ERROR("spi transfer is busy, ret=%d.\n", ret); + spioc->transfer_busy_flag = 1; + return; + } + spioc->chip_select = spi->chip_select; + SPI_OC_VERBOSE("spioc_chipselect:%u, value:%d.\n", spioc->chip_select, is_active); + tx_conf = 0; + tx_conf |= SPIOC_CSID(spioc->chip_select); + if (is_active) { + tx_conf |= SPIOC_CSLV; + } + + SPI_OC_VERBOSE("tx_config:[0x%x]\n", tx_conf); + oc_spi_setreg(spioc, SPIOC_TXCTL, tx_conf); + return; +} + +static void spioc_copy_tx(struct spioc *spioc) +{ + const u8 *src; + int i; + + if (!spioc->txp) { + SPI_OC_ERROR("spioc->txp is NULL.\n"); + return; + } + + src = (u8 *)spioc->txp + spioc->cur_pos; + SPI_OC_VERBOSE("current tx len:0x%x, tx pos:[0x%x]\n", spioc->cur_len, spioc->cur_pos); + + for (i = 0; i < spioc->cur_len; i++) { + SPI_OC_VERBOSE("write %d, val:[0x%x]\n", i, src[i]); + oc_spi_setreg(spioc, SPIOC_TX(i), src[i]); + } +} + +static void spioc_copy_rx(struct spioc *spioc) +{ + u8 *dest; + int i; + + if (!spioc->rxp) { + SPI_OC_ERROR("spioc->rxp is NULL.\n"); + return; + } + + dest = (u8 *)spioc->rxp + spioc->cur_pos; + SPI_OC_VERBOSE("current rx len:0x%x, rx pos:[0x%x]\n", spioc->cur_len, spioc->cur_pos); + + for (i = 0; i < spioc->cur_len; i++) { + dest[i] = oc_spi_getreg(spioc, SPIOC_RX(i)); + SPI_OC_VERBOSE("read %d, val:[0x%x]\n", i, dest[i]); + } +} + +static int spioc_setup_transfer(struct spi_device *spi, struct spi_transfer *transfer) +{ + struct spioc *spioc; + u8 ctrl; + u32 hz; + int div; + + spioc = spi_master_get_devdata(spi->master); + ctrl = 0; + + if (spi->mode & SPI_LSB_FIRST) { + ctrl |= SPIOC_LSBF; + } + + if (!(spi->mode & SPI_CPOL)) { + ctrl |= SPIOC_IDLE_LOW; + } + + if (spioc->irq < 0) { + + ctrl |= SPIOC_INTREN; + } + + if (transfer != NULL) { + hz = transfer->speed_hz; + + if (hz == 0) { + hz = spi->max_speed_hz; + } + } else { + hz = spi->max_speed_hz; + } + + if (hz == 0) { + SPI_OC_ERROR("Unsupport zero speed.\n"); + return -EINVAL; + } + + div = spioc_get_clkdiv(spioc, hz); + if (div < 0) { + SPI_OC_ERROR("get div error, div:%d.\n", div); + return -EINVAL; + } + ctrl |= SPIOC_DIV(div); + + SPI_OC_VERBOSE("ctrl:[0x%x].\n", ctrl); + + oc_spi_setreg(spioc, SPIOC_CONF, ctrl); + return 0; +} + +static int spioc_spi_setup(struct spi_device *spi) +{ + struct spioc *spioc; + + if (!(spi->mode & SPI_CPHA)) { + SPI_OC_ERROR("Unsupport spi device mde:0x%x, SPI_CPHA must be 1.\n", spi->mode); + return -EINVAL; + } + + spioc = spi_master_get_devdata(spi->master); + if (spi->chip_select >= spioc->num_chipselect) { + SPI_OC_ERROR("Spi device chipselect:%u, more than max chipselect:%u.\n", + spi->chip_select, spioc->num_chipselect); + return -EINVAL; + } + SPI_OC_VERBOSE("Support spi device mode:0x%x, chip_select:%u.\n", + spi->mode, spi->chip_select); + return 0; +} + +static int spioc_transfer_start(struct spioc *spioc) +{ + u8 tx_conf; + int ret; + + tx_conf = oc_spi_getreg(spioc, SPIOC_TXCTL); + tx_conf |= SPIOC_TRSTART; + + SPI_OC_VERBOSE("tx_config:[0x%x]\n", tx_conf); + oc_spi_setreg(spioc, SPIOC_TXCTL, tx_conf); + + ret = spioc_wait_trans(spioc, msecs_to_jiffies(100)); + return ret; +} + +static int spioc_tx_start_one(struct spioc *spioc) +{ + unsigned int txlen; + u8 txreg; + int ret; + + if (!spioc->reamin_len) { + SPI_OC_VERBOSE("spioc txlen:[0x0]\n"); + return 0; + } + + spioc->cur_len = spioc->reamin_len > SPIOC_MAX_LEN ? SPIOC_MAX_LEN : spioc->reamin_len; + + txlen = spioc->cur_len; + spioc->reamin_len -= txlen; + SPI_OC_VERBOSE("txlen:[0x%x], tx len remain:[0x%x]\n", txlen, spioc->reamin_len); + + spioc_copy_tx(spioc); + + /* when we only send, txlen == totlen */ + txreg = SPIOC_TXNUM(txlen) | SPIOC_TOTNUM(txlen); + SPI_OC_VERBOSE("txreg:[0x%x]\n", txreg); + oc_spi_setreg(spioc, SPIOC_TXTOT_NUM, txreg); + + ret = spioc_transfer_start(spioc); + if (ret) { + SPI_OC_ERROR("spioc tx rx poll wait for transfer timeout.\n"); + return ret; + } + + if (spioc->reamin_len) { + spioc->cur_pos += txlen; + SPI_OC_VERBOSE("cur_txpos:[0x%x]\n", spioc->cur_pos); + } + + return 0; +} + +static int spioc_rx_start_one(struct spioc *spioc) +{ + unsigned int rxlen; + u8 txtnum; + int ret; + + if (!spioc->reamin_len) { + SPI_OC_VERBOSE("spioc reamin_len:[0x0]\n"); + return 0; + } + + spioc->cur_len = spioc->reamin_len > SPIOC_MAX_LEN ? SPIOC_MAX_LEN : spioc->reamin_len; + + rxlen = spioc->cur_len; + spioc->reamin_len -= rxlen; + SPI_OC_VERBOSE("rxlen:[0x%x], rx len remain:[0x%x]\n", rxlen, spioc->reamin_len); + + /* when we only receive, rxnum=totnum. txnum=0 */ + txtnum = SPIOC_TOTNUM(rxlen); + SPI_OC_VERBOSE("tx total reg:0x%x\n", txtnum); + oc_spi_setreg(spioc, SPIOC_TXTOT_NUM, txtnum); + + ret = spioc_transfer_start(spioc); + if (ret) { + SPI_OC_ERROR("spioc tx rx poll wait for transfer timeout.\n"); + return ret; + } + + spioc_copy_rx(spioc); + + if (spioc->reamin_len) { + spioc->cur_pos += rxlen; + SPI_OC_VERBOSE("cur_rxpos:[0x%x]\n", spioc->cur_pos); + } + + return 0; +} + +static int spioc_tx_rx_start_one(struct spioc *spioc) +{ + unsigned int txlen, total_len; + u8 txreg; + int ret; + + if (!spioc->reamin_len) { + SPI_OC_VERBOSE("spioc reamin_len:[0x0]\n"); + return 0; + } + + spioc->cur_len = spioc->reamin_len > SPIOC_TXRX_MAX_LEN ? SPIOC_TXRX_MAX_LEN : spioc->reamin_len; + + txlen = spioc->cur_len; + spioc->reamin_len -= txlen; + SPI_OC_VERBOSE("tx len:[0x%x], tx len remain:[0x%x]\n", txlen, spioc->reamin_len); + + spioc_copy_tx(spioc); + + total_len = 2 * txlen; /* total_len=txlen + rxlen; rxlen=txlen */ + txreg = SPIOC_TXNUM(txlen) | SPIOC_TOTNUM(total_len); + SPI_OC_VERBOSE("txreg:[0x%x]\n", txreg); + oc_spi_setreg(spioc, SPIOC_TXTOT_NUM, txreg); + + ret = spioc_transfer_start(spioc); + if (ret) { + SPI_OC_ERROR("spioc tx rx poll wait for transfer timeout.\n"); + return ret; + } + + spioc_copy_rx(spioc); + if (spioc->reamin_len) { + spioc->cur_pos += txlen; + SPI_OC_VERBOSE("cur_txrx pos:[0x%x]\n", spioc->cur_pos); + } + return 0; +} + +static int spioc_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t) +{ + struct spioc *spioc; + int ret , len; + + if(!t->len || (!t->tx_buf && !t->rx_buf)) { + SPI_OC_ERROR("params error, tx_buf and rx_buf may both NULL, transfer len:0x%x.\n", + t->len); + return 0; + } + + spioc = spi_master_get_devdata(spi->master); + if (spioc->transfer_busy_flag) { + ret = -EBUSY; + goto err; + } + + spioc->txp = t->tx_buf; + spioc->rxp = t->rx_buf; + spioc->reamin_len = t->len; + spioc->cur_len = 0; + spioc->cur_pos = 0; + len = t->len; + ret = 0; + if (spioc->irq >= 0) { + /* use interrupt driven data transfer */ + if (t->tx_buf && t->rx_buf) { + spioc_tx_rx_start_one(spioc); + wait_for_completion(&spioc->done); + } else if (t->tx_buf) { + spioc_tx_start_one(spioc); + wait_for_completion(&spioc->done); + + } else { + spioc_rx_start_one(spioc); + wait_for_completion(&spioc->done); + } + } else { + if (t->tx_buf && t->rx_buf) { + SPI_OC_VERBOSE("start tx rx, len:0x%x\n", t->len); + while (spioc->reamin_len) { + ret = spioc_tx_rx_start_one(spioc); + if (ret) { + goto err; + } + } + } else if (t->tx_buf) { + SPI_OC_VERBOSE("start tx, txlen:0x%x\n", t->len); + while (spioc->reamin_len) { + ret = spioc_tx_start_one(spioc); + if (ret) { + goto err; + } + } + } else { + SPI_OC_VERBOSE("start rx, rxlen:0x%x\n", t->len); + while (spioc->reamin_len) { + ret = spioc_rx_start_one(spioc); + if (ret) { + goto err; + } + } + } + } + SPI_OC_VERBOSE("return num: 0x%x\n", len); + return len; +err: + return ret; +} + +static irqreturn_t spioc_spi_irq(int irq, void *dev) +{ + struct spioc *spioc; + + spioc = dev; + /* gooooohi, interrupt status bit judgment is not done */ + + if (spioc->txp && spioc->rxp) { + if (!spioc->reamin_len) { + complete(&spioc->done); + } else { + spioc_tx_rx_start_one(spioc); + } + } else if (spioc->txp) { + if (!spioc->reamin_len) { + complete(&spioc->done); + } else { + spioc_tx_start_one(spioc); + } + } else if (spioc->rxp){ + if (!spioc->reamin_len) { + complete(&spioc->done); + } else { + spioc_rx_start_one(spioc); + } + } + + return IRQ_HANDLED; +} + +static int ocores_spi_config_init(struct spioc *spioc) +{ + int ret = 0; + struct device *dev; + spi_ocores_device_t *spi_ocores_device; + + dev = spioc->dev; + if (dev->of_node) { + ret += of_property_read_string(dev->of_node, "dev_name", &spioc->dev_name); + ret += of_property_read_u32(dev->of_node, "dev_base", &spioc->base_addr); + ret += of_property_read_u32(dev->of_node, "reg_shift", &spioc->reg_shift); + ret += of_property_read_u32(dev->of_node, "reg_io_width", &spioc->reg_io_width); + ret += of_property_read_u32(dev->of_node, "clock-frequency", &spioc->freq); + ret += of_property_read_u32(dev->of_node, "reg_access_mode", &spioc->reg_access_mode); + ret += of_property_read_u32(dev->of_node, "num_chipselect", &spioc->num_chipselect); + + if (ret != 0) { + SPI_OC_ERROR("dts config error, ret:%d.\n", ret); + ret = -ENXIO; + return ret; + } + } else { + if (spioc->dev->platform_data == NULL) { + SPI_OC_ERROR("platform data config error.\n"); + ret = -ENXIO; + return ret; + } + spi_ocores_device = spioc->dev->platform_data; + spioc->bus_num = spi_ocores_device->bus_num; + spioc->dev_name = spi_ocores_device->dev_name; + spioc->big_endian = spi_ocores_device->big_endian; + spioc->base_addr = spi_ocores_device->dev_base; + spioc->reg_shift = spi_ocores_device->reg_shift; + spioc->reg_io_width = spi_ocores_device->reg_io_width; + spioc->freq = spi_ocores_device->clock_frequency; + spioc->reg_access_mode = spi_ocores_device->reg_access_mode; + spioc->num_chipselect = spi_ocores_device->num_chipselect; + } + + SPI_OC_VERBOSE("name:%s, base:0x%x, reg_shift:0x%x, io_width:0x%x, clock-frequency:0x%x.\n", + spioc->dev_name, spioc->base_addr, spioc->reg_shift, spioc->reg_io_width, spioc->freq); + SPI_OC_VERBOSE("reg access mode:%u, num_chipselect:%u.\n", + spioc->reg_access_mode, spioc->num_chipselect); + return ret; +} + +static int spioc_probe(struct platform_device *pdev) +{ + struct spi_master *master; + struct spioc *spioc; + int ret; + bool be; + + ret = -1; + master = spi_alloc_master(&pdev->dev, sizeof(struct spioc)); + if (!master) { + dev_err(&pdev->dev, "Failed to alloc spi master.\n"); + goto out; + } + + spioc = spi_master_get_devdata(master); + platform_set_drvdata(pdev, spioc); + + spioc->dev = &pdev->dev; + ret = ocores_spi_config_init(spioc); + if (ret != 0) { + dev_err(spioc->dev, "Failed to get ocores spi dts config.\n"); + goto free; + } + + if (spioc->dev->of_node) { + if (of_property_read_u32(spioc->dev->of_node, "big_endian", &spioc->big_endian)) { + + be = 0; + } else { + be = spioc->big_endian; + } + } else { + be = spioc->big_endian; + } + + if (spioc->reg_io_width == 0) { + spioc->reg_io_width = 1; /* Set to default value */ + } + + if (!spioc->setreg || !spioc->getreg) { + switch (spioc->reg_io_width) { + case REG_IO_WIDTH_1: + spioc->setreg = oc_spi_setreg_8; + spioc->getreg = oc_spi_getreg_8; + break; + + case REG_IO_WIDTH_2: + spioc->setreg = be ? oc_spi_setreg_16be : oc_spi_setreg_16; + spioc->getreg = be ? oc_spi_getreg_16be : oc_spi_getreg_16; + break; + + case REG_IO_WIDTH_4: + spioc->setreg = be ? oc_spi_setreg_32be : oc_spi_setreg_32; + spioc->getreg = be ? oc_spi_getreg_32be : oc_spi_getreg_32; + break; + + default: + dev_err(spioc->dev, "Unsupported I/O width (%d)\n", spioc->reg_io_width); + ret = -EINVAL; + goto free; + } + } + + /* master state */ + master->num_chipselect = spioc->num_chipselect; + master->mode_bits = MODEBITS; + master->setup = spioc_spi_setup; + if (spioc->dev->of_node) { + master->dev.of_node = pdev->dev.of_node; + } else { + master->bus_num = spioc->bus_num; + } + + /* setup the state for the bitbang driver */ + spioc->bitbang.master = master; + spioc->bitbang.setup_transfer = spioc_setup_transfer; + spioc->bitbang.chipselect = spioc_chipselect; + spioc->bitbang.txrx_bufs = spioc_spi_txrx_bufs; + + /* gooooohi need revision */ + spioc->irq = platform_get_irq(pdev, 0); + if (spioc->irq >= 0) { + SPI_OC_VERBOSE("spi oc use irq, irq number:%d.\n", spioc->irq); + init_completion(&spioc->done); + ret = devm_request_irq(&pdev->dev, spioc->irq, spioc_spi_irq, 0, + pdev->name, spioc); + if (ret) { + dev_err(spioc->dev, "Failed to request irq:%d.\n", spioc->irq); + goto free; + } + } + + ret = spi_bitbang_start(&spioc->bitbang); + if (ret) { + dev_err(spioc->dev, "Failed to start spi bitbang, ret:%d.\n", ret); + goto free; + } + dev_info(spioc->dev, "registered spi-%d for %s with base address:0x%x success.\n", + master->bus_num, spioc->dev_name, spioc->base_addr); + + return ret; +free: + spi_master_put(master); +out: + return ret; +} + +static int spioc_remove(struct platform_device *pdev) +{ + struct spioc *spioc; + struct spi_master *master; + + spioc = platform_get_drvdata(pdev); + master = spioc->bitbang.master; + spi_bitbang_stop(&spioc->bitbang); + platform_set_drvdata(pdev, NULL); + spi_master_put(master); + + return 0; +} + +static const struct of_device_id spioc_match[] = { + { .compatible = "wb-spi-oc", }, + {}, +}; +MODULE_DEVICE_TABLE(of, spioc_match); + +static struct platform_driver spioc_driver = { + .probe = spioc_probe, + .remove = spioc_remove, + .driver = { + .name = "wb-spioc", + .owner = THIS_MODULE, + .of_match_table = spioc_match, + }, +}; + +module_platform_driver(spioc_driver); + +MODULE_DESCRIPTION("spi open core adapter driver"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_ocores.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_ocores.h new file mode 100644 index 000000000000..647ff0c5f9cf --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_spi_ocores.h @@ -0,0 +1,21 @@ +#ifndef __WB_SPI_OCORES_H__ +#define __WB_SPI_OCORES_H__ +#include + +#define mem_clear(data, size) memset((data), 0, (size)) +#define SPI_OCORES_DEV_NAME_MAX_LEN (64) + +typedef struct spi_ocores_device_s { + uint32_t bus_num; + uint32_t big_endian; + char dev_name[SPI_OCORES_DEV_NAME_MAX_LEN]; + uint32_t reg_access_mode; + uint32_t dev_base; + uint32_t reg_shift; + uint32_t reg_io_width; + uint32_t clock_frequency; + uint32_t num_chipselect; + int device_flag; +} spi_ocores_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_uio_irq.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_uio_irq.c new file mode 100644 index 000000000000..da2b582443b8 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_uio_irq.c @@ -0,0 +1,282 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct dfd_irq_s { + int gpio; + int irq_type; + struct uio_info dfd_irq_info; + spinlock_t lock; + struct attribute_group attr_group; +} dfd_irq_t; + +#define DRV_NAME "uio-irq" +#define DRV_VERSION "1.0" +#define ENABLE_VAL (1) +#define DISABLE_VAL (0) + +#define DEBUG_ERR_LEVEL (0x1) +#define DEBUG_WARN_LEVEL (0x2) +#define DEBUG_INFO_LEVEL (0x4) +#define DEBUG_VER_LEVEL (0x8) + +static int debug = 0; +module_param(debug, int, S_IRUGO | S_IWUSR); +#define DEBUG_ERROR(fmt, args...) \ + do { \ + if (debug & DEBUG_ERR_LEVEL) { \ + printk(KERN_ERR "[ERR][func:%s line:%d] "fmt, __func__, __LINE__, ## args); \ + } else { \ + pr_debug(fmt, ## args); \ + } \ + } while(0) + +#define DEBUG_WARN(fmt, args...) \ + do { \ + if (debug & DEBUG_WARN_LEVEL) { \ + printk(KERN_WARNING "[WARN][func:%s line:%d] "fmt, __func__, __LINE__, ## args); \ + } else { \ + pr_debug(fmt, ## args); \ + } \ + } while(0) + +#define DEBUG_INFO(fmt, args...) \ + do { \ + if (debug & DEBUG_INFO_LEVEL) { \ + printk(KERN_INFO "[INFO][func:%s line:%d] "fmt, __func__, __LINE__, ## args); \ + } else { \ + pr_debug(fmt, ## args); \ + } \ + } while(0) + +#define DEBUG_VERBOSE(fmt, args...) \ + do { \ + if (debug & DEBUG_VER_LEVEL) { \ + printk(KERN_DEBUG "[VER][func:%s line:%d] "fmt, __func__, __LINE__, ## args); \ + } else { \ + pr_debug(fmt, ## args); \ + } \ + } while(0) + +static irqreturn_t dfd_genirq_handler(int irq, struct uio_info *dev_info) +{ + disable_irq_nosync(irq); + DEBUG_VERBOSE("handler disable irq"); + return IRQ_HANDLED; +} + +static int dfd_genirq_irqcontrol(struct uio_info *dev_info, s32 irq_on) +{ + struct irq_data *irqdata; + + irqdata = irq_get_irq_data(dev_info->irq); + + if (irqd_irq_disabled(irqdata) == !irq_on) { + DEBUG_VERBOSE("irq already disable"); + return 0; + } + if (irq_on) { + DEBUG_VERBOSE("irqcontrol enable irq"); + enable_irq(dev_info->irq); + } else { + DEBUG_VERBOSE("irqcontrol disable irq"); + disable_irq(dev_info->irq); + } + + return 0; +} + +static ssize_t set_irq_enable(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + dfd_irq_t *dfd_irq; + struct uio_info *dev_info; + unsigned long flags; + int ret, val; + + dfd_irq = dev_get_drvdata(dev); + dev_info = &dfd_irq->dfd_irq_info; + + spin_lock_irqsave(&dfd_irq->lock, flags); + + sscanf(buf, "%d", &val); + DEBUG_VERBOSE("set val:%d.\n", val); + + if ((val != ENABLE_VAL) && (val != DISABLE_VAL)) { + DEBUG_ERROR("unsupport val:%d ", val); + ret = -EINVAL; + goto fail; + } + + if (val) { + DEBUG_VERBOSE("sysfs enable irq"); + enable_irq(dev_info->irq); + } else { + DEBUG_VERBOSE("sysfs disable irq"); + disable_irq(dev_info->irq); + } + + spin_unlock_irqrestore(&dfd_irq->lock, flags); + return count; + +fail: + spin_unlock_irqrestore(&dfd_irq->lock, flags); + return ret; +} + +static DEVICE_ATTR(irq_enable, S_IWUSR, NULL, set_irq_enable); + +static struct attribute *irq_attrs[] = { + &dev_attr_irq_enable.attr, + NULL, +}; + +static struct attribute_group irq_attr_group = { + .attrs = irq_attrs, +}; + +static int dfd_irq_probe(struct platform_device *pdev) +{ + u32 gpio, irq_type, pirq_line; + int ret, ret1, ret2; + struct uio_info *dfd_irq_info; + dfd_irq_t *dfd_irq; + + dfd_irq = kzalloc(sizeof(dfd_irq_t), GFP_KERNEL); + if (!dfd_irq) { + dev_err(&pdev->dev, "dfd_irq_t kzalloc failed.\n"); + return -ENOMEM; + } + + dfd_irq_info = &dfd_irq->dfd_irq_info; + dfd_irq_info->version = "1.0"; + dfd_irq_info->name = "uio-irq"; + + /* get pirq line for x86 */ + ret1 = of_property_read_u32(pdev->dev.of_node, "pirq-line", &pirq_line); + if (!ret1) { + DEBUG_VERBOSE("use pirq-line method, pirq-line:%u", pirq_line); + dfd_irq_info->irq = pirq_line; + } + + ret2 = of_property_read_u32(pdev->dev.of_node, "gpio", &gpio); + if (!ret2 && ret1) { + dfd_irq->gpio = gpio; + gpio_request(dfd_irq->gpio, "GPIOA"); + dfd_irq_info->irq = gpio_to_irq(dfd_irq->gpio); + DEBUG_VERBOSE("use gpio:%u, irq num:%ld", gpio, dfd_irq_info->irq); + } else if (ret2 && ret1){ + ret = -ENXIO; + dev_err(&pdev->dev, "no define irq num. ret2:%d, ret1:%d.\n", ret2, ret1); + goto free_mem; + } + + ret = of_property_read_u32(pdev->dev.of_node, "irq_type", &irq_type); + if (!ret && ret1) { + DEBUG_VERBOSE("use irq_type:%u", irq_type); + dfd_irq->irq_type = irq_type; + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) + irq_set_irq_type(dfd_irq_info->irq, dfd_irq->irq_type); +#else + set_irq_type(dfd_irq_info->irq, dfd_irq->irq_type); +#endif + } else if (ret && ret1){ + ret = -ENXIO; + dev_err(&pdev->dev, "no define irq type. ret:%d, ret1:%d.\n", ret, ret1); + goto free_mem; + } + + dfd_irq_info->irq_flags = IRQF_SHARED; + dfd_irq_info->handler = dfd_genirq_handler; + dfd_irq_info->irqcontrol = dfd_genirq_irqcontrol; + + if(uio_register_device(&pdev->dev, dfd_irq_info)){ + ret = -ENODEV; + dev_err(&pdev->dev, "uio register failed.\n"); + goto free_mem; + } + + spin_lock_init(&dfd_irq->lock); + + dfd_irq->attr_group = irq_attr_group; + ret = sysfs_create_group(&pdev->dev.kobj, &dfd_irq->attr_group); + if (ret != 0) { + dev_err(&pdev->dev, "sysfs_create_group failed. ret:%d.\n", ret); + goto free_mem; + } + DEBUG_VERBOSE("sysfs create group success\n"); + + platform_set_drvdata(pdev, dfd_irq); + + return 0; + +free_mem: + kfree(dfd_irq); + + return ret; +} + +static int dfd_irq_remove(struct platform_device *pdev) +{ + dfd_irq_t *dfd_irq; + struct uio_info *dfd_irq_info; + + dfd_irq = platform_get_drvdata(pdev); + dfd_irq_info = &dfd_irq->dfd_irq_info; + + uio_unregister_device(dfd_irq_info); + kfree(dfd_irq); + + sysfs_remove_group(&pdev->dev.kobj, &dfd_irq->attr_group); + + return 0; +} + +static struct of_device_id dfd_irq_match[] = { + { + .compatible = "uio-irq", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, dfd_irq_match); + +static struct platform_driver dfd_irq_driver = { + .probe = dfd_irq_probe, + .remove = dfd_irq_remove, + .driver = { + .owner = THIS_MODULE, + .name = DRV_NAME, + .of_match_table = dfd_irq_match, + }, +}; + +static int __init dfd_irq_init(void) +{ + int ret; + + ret = platform_driver_register(&dfd_irq_driver); + if (ret != 0 ) { + return ret; + } + + return 0; +} + +static void __exit dfd_irq_exit(void) +{ + platform_driver_unregister(&dfd_irq_driver); +} + +module_init(dfd_irq_init); +module_exit(dfd_irq_exit); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_wdt.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_wdt.c new file mode 100644 index 000000000000..aa50ef848dde --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_wdt.c @@ -0,0 +1,1202 @@ +/* + * wb_wdt.c + * ko for watchdog function + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "wb_wdt.h" + +#define GPIO_FEED_WDT_MODE (1) +#define LOGIC_FEED_WDT_MODE (2) + +#define SYMBOL_I2C_DEV_MODE (1) +#define SYMBOL_PCIE_DEV_MODE (2) +#define SYMBOL_IO_DEV_MODE (3) +#define FILE_MODE (4) + +#define ONE_BYTE (1) + +#define WDT_OFF (0) +#define WDT_ON (1) + +#define MS_TO_S (1000) +#define MS_TO_NS (1000 * 1000) + +#define MAX_REG_VAL (255) + +extern int i2c_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int i2c_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int pcie_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int pcie_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int io_device_func_write(const char *path, uint32_t offset, uint8_t *buf, size_t count); +extern int io_device_func_read(const char *path, uint32_t offset, uint8_t *buf, size_t count); + +int g_wb_wdt_debug = 0; +int g_wb_wdt_error = 0; + +module_param(g_wb_wdt_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_wdt_error, int, S_IRUGO | S_IWUSR); + +#define WDT_VERBOSE(fmt, args...) do { \ + if (g_wb_wdt_debug) { \ + printk(KERN_INFO "[WDT][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WDT_ERROR(fmt, args...) do { \ + if (g_wb_wdt_error) { \ + printk(KERN_ERR "[WDT][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +enum { + HW_ALGO_TOGGLE, + HW_ALGO_LEVEL, + HW_ALGO_EIGENVALUES, +}; + +enum { + WATCHDOG_DEVICE_TYPE = 0, + HRTIMER_TYPE, + THREAD_TYPE, +}; + +typedef struct wb_wdt_priv_s { + struct task_struct *thread; + struct hrtimer hrtimer; + ktime_t m_kt; + const char *config_dev_name; + uint8_t config_mode; + uint8_t hw_algo; + uint8_t enable_val; + uint8_t disable_val; + uint8_t enable_mask; + uint8_t priv_func_mode; + uint8_t feed_wdt_type; + uint32_t enable_reg; + uint32_t timeout_cfg_reg; + uint32_t timeleft_cfg_reg; + uint32_t hw_margin; + uint32_t feed_time; + uint8_t timer_accuracy_reg_flag; + uint32_t timer_accuracy_reg; + uint8_t timer_accuracy_reg_val; + uint32_t timer_accuracy; + uint8_t timer_update_reg_flag; + uint32_t timer_update_reg; + uint8_t timer_update_reg_val; + gpio_wdt_info_t gpio_wdt; + logic_wdt_info_t logic_wdt; + struct device *dev; + const struct attribute_group *sysfs_group; + uint8_t sysfs_index; + struct mutex update_lock; + struct watchdog_device wdd; +}wb_wdt_priv_t; + +static int wdt_file_read(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDONLY, 0); + if (IS_ERR(filp)) { + WDT_ERROR("read open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_DEST, &iov, 1, iov.iov_len); + ret = vfs_iter_read(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + WDT_ERROR("vfs_iter_read failed, path=%s, addr=0x%x, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int wdt_file_write(const char *path, uint32_t pos, uint8_t *val, size_t size) +{ + int ret; + struct file *filp; + loff_t tmp_pos; + + struct kvec iov = { + .iov_base = val, + .iov_len = min_t(size_t, size, MAX_RW_COUNT), + }; + struct iov_iter iter; + + filp = filp_open(path, O_RDWR, 777); + if (IS_ERR(filp)) { + WDT_ERROR("write open failed errno = %ld\r\n", -PTR_ERR(filp)); + filp = NULL; + goto exit; + } + + tmp_pos = (loff_t)pos; + iov_iter_kvec(&iter, ITER_SOURCE, &iov, 1, iov.iov_len); + ret = vfs_iter_write(filp, &iter, &tmp_pos, 0); + if (ret < 0) { + WDT_ERROR("vfs_iter_write failed, path=%s, addr=0x%x, size=%ld, ret=%d\r\n", path, pos, size, ret); + goto exit; + } + + vfs_fsync(filp, 1); + filp_close(filp, NULL); + + return ret; + +exit: + if (filp != NULL) { + filp_close(filp, NULL); + } + + return -1; +} + +static int wb_wdt_read(uint8_t mode, const char *path, + uint32_t offset, uint8_t *buf, size_t count) +{ + int ret; + + switch (mode) { + case SYMBOL_I2C_DEV_MODE: + ret = i2c_device_func_read(path, offset, buf, count); + break; + case SYMBOL_PCIE_DEV_MODE: + ret = pcie_device_func_read(path, offset, buf, count); + break; + case SYMBOL_IO_DEV_MODE: + ret = io_device_func_read(path, offset, buf, count); + break; + case FILE_MODE: + ret = wdt_file_read(path, offset, buf, count); + break; + default: + WDT_ERROR("mode %u error, wdt func read failed.\n", mode); + return -EINVAL; + } + + WDT_VERBOSE("wdt func read mode:%u,dev_nam:%s, offset:0x%x, read_val:0x%x, size:%lu.\n", + mode, path, offset, *buf, count); + + return ret; +} + +static int wb_wdt_write(uint8_t mode, const char *path, + uint32_t offset, uint8_t *buf, size_t count) +{ + int ret; + + switch (mode) { + case SYMBOL_I2C_DEV_MODE: + ret = i2c_device_func_write(path, offset, buf, count); + break; + case SYMBOL_PCIE_DEV_MODE: + ret = pcie_device_func_write(path, offset, buf, count); + break; + case SYMBOL_IO_DEV_MODE: + ret = io_device_func_write(path, offset, buf, count); + break; + case FILE_MODE: + ret = wdt_file_write(path, offset, buf, count); + break; + default: + WDT_ERROR("mode %u error, wdt func write failed.\n", mode); + return -EINVAL; + } + + WDT_VERBOSE("wdt func write mode:%u, dev_nam:%s, offset:0x%x, write_val:0x%x, size:%lu.\n", + mode, path, offset, *buf, count); + + return ret; +} + +static int wb_wdt_enable_ctrl(wb_wdt_priv_t *priv, uint8_t flag) +{ + int ret; + uint8_t val; + uint8_t ctrl_val; + + switch (flag) { + case WDT_ON: + ctrl_val = priv->enable_val; + break; + case WDT_OFF: + ctrl_val = priv->disable_val; + break; + default: + WDT_ERROR("unsupport wdt enable ctrl:%u.\n", flag); + return -EINVAL; + } + + ret = wb_wdt_read(priv->priv_func_mode, priv->config_dev_name, + priv->enable_reg, &val, ONE_BYTE); + if (ret < 0) { + dev_err(priv->dev, "read wdt control reg error.\n"); + return ret; + } + + val &= ~priv->enable_mask; + + val |= ctrl_val & priv->enable_mask; + + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->enable_reg, &val, ONE_BYTE); + if (ret < 0) { + dev_err(priv->dev, "write wdt control reg error.\n"); + return ret; + } + + return 0; +} + +static void wdt_hwping(wb_wdt_priv_t *priv) +{ + gpio_wdt_info_t *gpio_wdt; + logic_wdt_info_t *logic_wdt; + uint8_t tmp_val; + int ret; + + if (priv->config_mode == GPIO_FEED_WDT_MODE) { + gpio_wdt = &priv->gpio_wdt; + switch (priv->hw_algo) { + case HW_ALGO_TOGGLE: + gpio_wdt = &priv->gpio_wdt; + gpio_wdt->state = !gpio_wdt->state; + gpio_set_value_cansleep(gpio_wdt->gpio, gpio_wdt->state); + WDT_VERBOSE("gpio toggle wdt work. val:%u\n", gpio_wdt->state); + break; + case HW_ALGO_LEVEL: + gpio_wdt = &priv->gpio_wdt; + /* Pulse */ + gpio_set_value_cansleep(gpio_wdt->gpio, !gpio_wdt->active_low); + udelay(1); + gpio_set_value_cansleep(gpio_wdt->gpio, gpio_wdt->active_low); + WDT_VERBOSE("gpio level wdt work.\n"); + break; + } + } else { + logic_wdt = &priv->logic_wdt; + switch (priv->hw_algo) { + case HW_ALGO_TOGGLE: + logic_wdt->active_val = !logic_wdt->active_val; + ret = wb_wdt_write(logic_wdt->logic_func_mode, logic_wdt->feed_dev_name, + logic_wdt->feed_reg, &logic_wdt->active_val, ONE_BYTE); + if (ret < 0) { + WDT_ERROR("logic toggle wdt write failed.ret = %d\n", ret); + } + WDT_VERBOSE("logic toggle wdt work.\n"); + break; + case HW_ALGO_LEVEL: + tmp_val = !logic_wdt->active_val; + ret = wb_wdt_write(logic_wdt->logic_func_mode, logic_wdt->feed_dev_name, + logic_wdt->feed_reg, &tmp_val, ONE_BYTE); + if (ret < 0) { + WDT_ERROR("logic level wdt write first failed.ret = %d\n", ret); + } + udelay(1); + ret = wb_wdt_write(logic_wdt->logic_func_mode, logic_wdt->feed_dev_name, + logic_wdt->feed_reg, &logic_wdt->active_val, ONE_BYTE); + if (ret < 0) { + WDT_ERROR("logic level wdt write second failed.ret = %d\n", ret); + } + WDT_VERBOSE("logic level wdt work.\n"); + break; + case HW_ALGO_EIGENVALUES: + ret = wb_wdt_write(logic_wdt->logic_func_mode, logic_wdt->feed_dev_name, + logic_wdt->feed_reg, &logic_wdt->active_val, ONE_BYTE); + if (ret < 0) { + WDT_ERROR("logic eigenvalues wdt write failed, path: %s, mode: %d, reg: 0x%x, val: 0x%x, ret: %d\n", + logic_wdt->feed_dev_name, logic_wdt->logic_func_mode, logic_wdt->feed_reg, + logic_wdt->active_val, ret); + } + WDT_VERBOSE("logic eigenvalues wdt work, path: %s, mode: %d, reg: 0x%x, val: 0x%x\n", + logic_wdt->feed_dev_name, logic_wdt->logic_func_mode, logic_wdt->feed_reg, logic_wdt->active_val); + break; + } + } + return; +} + +static enum hrtimer_restart hrtimer_hwping(struct hrtimer *timer) +{ + wb_wdt_priv_t *priv = container_of(timer, wb_wdt_priv_t, hrtimer); + + wdt_hwping(priv); + hrtimer_forward(timer, timer->base->get_time(), priv->m_kt); + return HRTIMER_RESTART; +} + +static int thread_timer_cfg(wb_wdt_priv_t *priv, wb_wdt_device_t *wb_wdt_device) +{ + struct device *dev; + uint32_t hw_margin; + uint32_t feed_time; + uint32_t accuracy; + uint8_t set_time_val; + int ret; + + dev = priv->dev; + + ret = 0; + if (dev->of_node) { + ret += of_property_read_u32(dev->of_node, "feed_time", &priv->feed_time); + if (ret != 0) { + dev_err(dev, "thread Failed to priv dts.\n"); + return -ENXIO; + } + } else { + priv->feed_time = wb_wdt_device->feed_time; + } + WDT_VERBOSE("thread priv->feed_time: %u.\n", priv->feed_time); + + hw_margin = priv->hw_margin; + feed_time = priv->feed_time; + accuracy = priv->timer_accuracy; + + if ((feed_time > (hw_margin / 2)) || (feed_time == 0)) { + dev_err(dev, "thread timer feed_time[%d] should be less than half hw_margin or zero.\n", feed_time); + return -EINVAL; + } + + if (priv->timer_accuracy_reg_flag != 0) { + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timer_accuracy_reg, &priv->timer_accuracy_reg_val, ONE_BYTE); + if (ret < 0) { + dev_err(priv->dev, "set timer_accuracy_reg error, reg_addr: 0x%x, value: 0x%x, ret: %d.\n", + priv->timer_accuracy_reg, priv->timer_accuracy_reg_val, ret); + return ret; + } + } + + set_time_val = hw_margin / accuracy; + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timeout_cfg_reg, &set_time_val, ONE_BYTE); + if (ret < 0) { + dev_err(dev, "set wdt thread timer reg error.\n"); + return ret; + } + + if (priv->timer_update_reg_flag != 0) { + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timer_update_reg, &priv->timer_update_reg_val, ONE_BYTE); + if (ret < 0) { + dev_err(priv->dev, "set timer_update_reg error, reg_addr: 0x%x, value: 0x%x, ret: %d.\n", + priv->timer_update_reg, priv->timer_update_reg_val, ret); + return ret; + } + } + + return 0; +} + +static int wdt_thread_timer(void *data) +{ + wb_wdt_priv_t *priv = data; + + while (!kthread_should_stop()) { + schedule_timeout_uninterruptible(msecs_to_jiffies(priv->feed_time)); + wdt_hwping(priv); + } + return 0; +} + +static int thread_timer_create(wb_wdt_priv_t *priv, wb_wdt_device_t *wb_wdt_device) +{ + struct task_struct *p; + int ret; + + ret = thread_timer_cfg(priv, wb_wdt_device); + if (ret < 0) { + dev_err(priv->dev, "set wdt thread timer failed.\n"); + return ret; + } + + p = kthread_create(wdt_thread_timer, (void *)priv, "%s", "wb_wdt"); + if (!IS_ERR(p)) { + WDT_VERBOSE("timer thread create success.\n"); + priv->thread = p; + wake_up_process(p); + } else { + dev_err(priv->dev, "timer thread create failed.\n"); + return -ENXIO; + } + + ret = wb_wdt_enable_ctrl(priv, WDT_ON); + if (ret < 0) { + dev_err(priv->dev, "thread enable wdt failed.\n"); + return -ENXIO; + } + + return 0; +} + +static int hrtimer_cfg(wb_wdt_priv_t *priv, wb_wdt_device_t *wb_wdt_device) +{ + struct device *dev; + struct hrtimer *hrtimer; + uint8_t set_time_val; + uint8_t hrtimer_s; + uint32_t hrtimer_ns; + int ret; + uint32_t hw_margin; + uint32_t feed_time; + uint32_t accuracy; + uint32_t max_timeout; + + dev = priv->dev; + + ret = 0; + if (dev->of_node) { + ret += of_property_read_u32(dev->of_node, "feed_time", &priv->feed_time); + if (ret != 0) { + dev_err(dev, "hrtimer Failed to priv dts.\n"); + return -ENXIO; + } + } else { + priv->feed_time = wb_wdt_device->feed_time; + } + WDT_VERBOSE("hrtimer priv->feed_time: %u.\n", priv->feed_time); + + hrtimer = &priv->hrtimer; + hw_margin = priv->hw_margin; + feed_time = priv->feed_time; + accuracy = priv->timer_accuracy; + max_timeout = accuracy * 255; + + if (hw_margin < accuracy || hw_margin > max_timeout) { + dev_err(dev, "hrtimer_hw_margin should be between %u and %u.\n", + accuracy, max_timeout); + return -EINVAL; + } + if ((feed_time > (hw_margin / 2)) || (feed_time == 0)) { + dev_err(dev, "feed_time[%d] should be less than half hw_margin or zeor.\n", feed_time); + return -EINVAL; + } + + hrtimer_s = feed_time / MS_TO_S; + hrtimer_ns = (feed_time % MS_TO_S) * MS_TO_NS; + set_time_val = hw_margin / accuracy; + + if (priv->timer_accuracy_reg_flag != 0) { + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timer_accuracy_reg, &priv->timer_accuracy_reg_val, ONE_BYTE); + if (ret < 0) { + dev_err(priv->dev, "set timer_accuracy_reg error, reg_addr: 0x%x, value: 0x%x, ret: %d.\n", + priv->timer_accuracy_reg, priv->timer_accuracy_reg_val, ret); + return ret; + } + } + + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timeout_cfg_reg, &set_time_val, ONE_BYTE); + if (ret < 0) { + dev_err(dev, "set wdt time reg error.\n"); + return ret; + } + + if (priv->timer_update_reg_flag != 0) { + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timer_update_reg, &priv->timer_update_reg_val, ONE_BYTE); + if (ret < 0) { + dev_err(priv->dev, "set timer_update_reg error, reg_addr: 0x%x, value: 0x%x, ret: %d.\n", + priv->timer_update_reg, priv->timer_update_reg_val, ret); + return ret; + } + } + + priv->m_kt = ktime_set(hrtimer_s, hrtimer_ns); + hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); + hrtimer->function = hrtimer_hwping; + hrtimer_start(hrtimer, priv->m_kt, HRTIMER_MODE_REL); + + ret = wb_wdt_enable_ctrl(priv, WDT_ON); + if (ret < 0) { + dev_err(dev, "hrtimer enable wdt failed.\n"); + return -ENXIO; + } + + return 0; +} + +static int wb_wdt_ping(struct watchdog_device *wdd) +{ + wb_wdt_priv_t *priv = watchdog_get_drvdata(wdd); + + wdt_hwping(priv); + return 0; +} + +static int wb_wdt_start(struct watchdog_device *wdd) +{ + wb_wdt_priv_t *priv = watchdog_get_drvdata(wdd); + int ret; + + ret = wb_wdt_enable_ctrl(priv, WDT_ON); + if (ret < 0) { + WDT_ERROR("start wdt enable failed.\n"); + return -ENXIO; + } + set_bit(WDOG_HW_RUNNING, &wdd->status); + return 0; +} + +static int wb_wdt_stop(struct watchdog_device *wdd) +{ + wb_wdt_priv_t *priv = watchdog_get_drvdata(wdd); + int ret; + + ret = wb_wdt_enable_ctrl(priv, WDT_OFF); + if (ret < 0) { + WDT_ERROR("stop wdt enable failed.\n"); + return -ENXIO; + } + clear_bit(WDOG_HW_RUNNING, &wdd->status); + return 0; +} + +static int wb_wdt_set_timeout(struct watchdog_device *wdd, unsigned int t) +{ + wb_wdt_priv_t *priv = watchdog_get_drvdata(wdd); + uint32_t timeout_ms; + uint32_t accuracy; + uint8_t set_time_val; + int ret; + + accuracy = priv->timer_accuracy; + timeout_ms = t * 1000; + if (timeout_ms > accuracy * 255) { + WDT_ERROR("set wdt timeout too larger error.timeout_ms:%u\n", timeout_ms); + return -EINVAL; + } + + if (priv->timer_accuracy_reg_flag != 0) { + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timer_accuracy_reg, &priv->timer_accuracy_reg_val, ONE_BYTE); + if (ret < 0) { + WDT_ERROR("set timer_accuracy_reg error, reg_addr: 0x%x, value: 0x%x, ret: %d.\n", + priv->timer_accuracy_reg, priv->timer_accuracy_reg_val, ret); + return ret; + } + } + + set_time_val = timeout_ms / accuracy; + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timeout_cfg_reg, &set_time_val, ONE_BYTE); + if (ret < 0) { + WDT_ERROR("set wdt timeout reg error, set_time_val:%u ret:%d\n", set_time_val, ret); + return ret; + } + + if (priv->timer_update_reg_flag != 0) { + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timer_update_reg, &priv->timer_update_reg_val, ONE_BYTE); + if (ret < 0) { + WDT_ERROR("set timer_update_reg error, reg_addr: 0x%x, value: 0x%x, ret: %d.\n", + priv->timer_update_reg, priv->timer_update_reg_val, ret); + return ret; + } + } + + wdd->timeout = t; + + return 0; +} + +static unsigned int wb_wdt_get_timeleft(struct watchdog_device *wdd) +{ + wb_wdt_priv_t *priv = watchdog_get_drvdata(wdd); + unsigned int time_left; + uint32_t accuracy; + uint8_t get_time_val; + int ret; + + accuracy = priv->timer_accuracy; + + ret = wb_wdt_read(priv->priv_func_mode, priv->config_dev_name, + priv->timeleft_cfg_reg, &get_time_val, ONE_BYTE); + if (ret < 0) { + WDT_ERROR("get wdt timeout reg error.ret:%d\n", ret); + return ret; + } + time_left = get_time_val * accuracy / MS_TO_S; + + WDT_VERBOSE("get wdt timeleft %d get_time_val %d accuracy=%d\n", + time_left, get_time_val, accuracy); + return time_left; +} + +static const struct watchdog_info wb_wdt_ident = { + .options = WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT, + .firmware_version = 0, + .identity = "CPLD Watchdog", +}; + +static const struct watchdog_ops wb_wdt_ops = { + .owner = THIS_MODULE, + .start = wb_wdt_start, + .stop = wb_wdt_stop, + .ping = wb_wdt_ping, + .set_timeout = wb_wdt_set_timeout, + .get_timeleft = wb_wdt_get_timeleft, +}; + +static int watchdog_device_cfg(wb_wdt_priv_t *priv) +{ + int ret; + uint8_t set_time_val; + + ret = wb_wdt_enable_ctrl(priv, WDT_OFF); + if (ret < 0) { + dev_err(priv->dev, "probe disable wdt failed.\n"); + return -ENXIO; + } + + if (priv->timer_accuracy_reg_flag != 0) { + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timer_accuracy_reg, &priv->timer_accuracy_reg_val, ONE_BYTE); + if (ret < 0) { + dev_err(priv->dev, "set timer_accuracy_reg error, reg_addr: 0x%x, value: 0x%x, ret: %d.\n", + priv->timer_accuracy_reg, priv->timer_accuracy_reg_val, ret); + return ret; + } + } + + set_time_val = priv->hw_margin / priv->timer_accuracy; + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timeout_cfg_reg, &set_time_val, ONE_BYTE); + if (ret < 0) { + dev_err(priv->dev, "set wdt time reg error.\n"); + return ret; + } + + if (priv->timer_update_reg_flag != 0) { + ret = wb_wdt_write(priv->priv_func_mode, priv->config_dev_name, + priv->timer_update_reg, &priv->timer_update_reg_val, ONE_BYTE); + if (ret < 0) { + dev_err(priv->dev, "set timer_update_reg error, reg_addr: 0x%x, value: 0x%x, ret: %d.\n", + priv->timer_update_reg, priv->timer_update_reg_val, ret); + return ret; + } + } + + watchdog_set_drvdata(&priv->wdd, priv); + + priv->wdd.info = &wb_wdt_ident; + priv->wdd.ops = &wb_wdt_ops; + priv->wdd.bootstatus = 0; + priv->wdd.timeout = priv->hw_margin / MS_TO_S; + priv->wdd.min_timeout = priv->timer_accuracy / MS_TO_S; + priv->wdd.max_timeout = priv->timer_accuracy * MAX_REG_VAL / MS_TO_S; + priv->wdd.parent = priv->dev; + + watchdog_stop_on_reboot(&priv->wdd); + + ret = devm_watchdog_register_device(priv->dev, &priv->wdd); + if (ret != 0) { + dev_err(priv->dev, "cannot register watchdog device (err=%d)\n", ret); + return -ENXIO; + } + + return 0; +} + +static int logic_wdt_init(wb_wdt_priv_t *priv, wb_wdt_device_t *wb_wdt_device) +{ + struct device *dev; + logic_wdt_info_t *logic_wdt; + int ret; + + dev = priv->dev; + logic_wdt = &priv->logic_wdt; + + ret = 0; + if (dev->of_node) { + ret += of_property_read_string(dev->of_node, "feed_dev_name", &logic_wdt->feed_dev_name); + ret += of_property_read_u32(dev->of_node, "feed_reg", &logic_wdt->feed_reg); + ret += of_property_read_u8(dev->of_node, "active_val", &logic_wdt->active_val); + ret += of_property_read_u8(dev->of_node, "logic_func_mode", &logic_wdt->logic_func_mode); + if (ret != 0) { + dev_err(dev, "Failed to logic_wdt dts.\n"); + return -ENXIO; + } + } else { + logic_wdt->feed_dev_name = wb_wdt_device->wdt_config_mode.logic_wdt.feed_dev_name; + logic_wdt->feed_reg = wb_wdt_device->wdt_config_mode.logic_wdt.feed_reg; + logic_wdt->active_val = wb_wdt_device->wdt_config_mode.logic_wdt.active_val; + logic_wdt->logic_func_mode = wb_wdt_device->wdt_config_mode.logic_wdt.logic_func_mode; + } + + logic_wdt->state_val = logic_wdt->active_val; + + WDT_VERBOSE("feed_dev_name:%s, feed_reg:0x%x, active_val:%u, logic_func_mode:%u\n", + logic_wdt->feed_dev_name, logic_wdt->feed_reg, + logic_wdt->active_val, logic_wdt->logic_func_mode); + + return 0; +} + +static int gpio_wdt_init(wb_wdt_priv_t *priv, wb_wdt_device_t *wb_wdt_device) +{ + struct device *dev; + gpio_wdt_info_t *gpio_wdt; + enum of_gpio_flags flags; + uint32_t f = 0; + int ret; + + dev = priv->dev; + gpio_wdt = &priv->gpio_wdt; + + if (dev->of_node) { + gpio_wdt->gpio = of_get_gpio_flags(dev->of_node, 0, &flags); + } else { + gpio_wdt->gpio = wb_wdt_device->wdt_config_mode.gpio_wdt.gpio; + flags = wb_wdt_device->wdt_config_mode.gpio_wdt.flags; + } + if (!gpio_is_valid(gpio_wdt->gpio)) { + dev_err(dev, "gpio is invalid.\n"); + return gpio_wdt->gpio; + } + + gpio_wdt->active_low = flags & OF_GPIO_ACTIVE_LOW; + + if(priv->hw_algo == HW_ALGO_TOGGLE) { + f = GPIOF_IN; + } else { + f = gpio_wdt->active_low ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW; + } + + ret = devm_gpio_request_one(dev, gpio_wdt->gpio, f, + dev_name(dev)); + if (ret) { + dev_err(dev, "devm_gpio_request_one failed.\n"); + return ret; + } + + gpio_wdt->state = gpio_wdt->active_low; + gpio_direction_output(gpio_wdt->gpio, gpio_wdt->state); + + WDT_VERBOSE("active_low:%d\n", gpio_wdt->active_low); + return 0; +} + +static ssize_t set_wdt_sysfs_value(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + wb_wdt_priv_t *priv = dev_get_drvdata(dev); + int ret, val; + + val = 0; + sscanf(buf, "%d", &val); + WDT_VERBOSE("set wdt, val:%d.\n", val); + + if (val < 0 || val > 255) { + WDT_ERROR("set wdt val %d failed.\n", val); + return -EINVAL; + } + + mutex_lock(&priv->update_lock); + + ret = wb_wdt_enable_ctrl(priv, val); + if (ret < 0) { + WDT_ERROR("set wdt sysfs value:%u failed.\n", val); + goto fail; + } + + WDT_VERBOSE("set wdt sysfs value:%u successed.\n", val); + mutex_unlock(&priv->update_lock); + return count; + +fail: + mutex_unlock(&priv->update_lock); + return ret; +} + +static ssize_t show_wdt_sysfs_value(struct device *dev, + struct device_attribute *da, char *buf) +{ + wb_wdt_priv_t *priv = dev_get_drvdata(dev); + uint8_t val, status; + int ret; + + mutex_lock(&priv->update_lock); + + ret = wb_wdt_read(priv->priv_func_mode, priv->config_dev_name, + priv->enable_reg, &val, ONE_BYTE); + if (ret < 0) { + dev_err(priv->dev, "read wdt enable reg val error.\n"); + goto fail; + } + + val &= priv->enable_mask; + if (val == priv->enable_val) { + status = WDT_ON; + } else if(val == priv->disable_val) { + status = WDT_OFF; + } else { + WDT_ERROR("enable reg read val not match set val, read val:%u, mask:%u, enable_val:%u, disable_val:%u", + val, priv->enable_mask, priv->enable_val, priv->disable_val); + ret = -EIO; + goto fail; + } + + WDT_VERBOSE("read_val:%u, mask:%u, enable_val:%u, disable_val:%u, status:%u", + val, priv->enable_mask, priv->enable_val, priv->disable_val, status); + + mutex_unlock(&priv->update_lock); + return sprintf(buf, "%u\n", status); + +fail: + mutex_unlock(&priv->update_lock); + return ret; +} + +static SENSOR_DEVICE_ATTR(wdt_status, S_IRUGO | S_IWUSR, show_wdt_sysfs_value, set_wdt_sysfs_value, 0); + +static struct attribute *wdt_sysfs_attrs[] = { + &sensor_dev_attr_wdt_status.dev_attr.attr, + NULL +}; + +static const struct attribute_group wdt_sysfs_group = { + .attrs = wdt_sysfs_attrs, +}; + +struct wdt_attr_match_group { + uint8_t index; + const struct attribute_group *attr_group_ptr; +}; + +static struct wdt_attr_match_group g_wdt_attr_match[] = { + {0, &wdt_sysfs_group}, +}; + +static const struct attribute_group *wdt_get_attr_group(uint32_t index) +{ + int i; + struct wdt_attr_match_group *group; + + for (i = 0; i < ARRAY_SIZE(g_wdt_attr_match); i++) { + group = &g_wdt_attr_match[i]; + if (index == group->index) { + WDT_VERBOSE("get wdt attr, index:%u.\n", index); + return group->attr_group_ptr; + } + } + + return NULL; +} + +static int wb_wdt_probe(struct platform_device *pdev) +{ + wb_wdt_priv_t *priv; + int ret; + const char *algo; + wb_wdt_device_t *wb_wdt_device; + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) { + dev_err(&pdev->dev, "devm_kzalloc failed.\n"); + return -ENOMEM; + } + + platform_set_drvdata(pdev, priv); + + if (pdev->dev.of_node) { + ret = 0; + ret += of_property_read_string(pdev->dev.of_node, "config_dev_name", &priv->config_dev_name); + ret += of_property_read_string(pdev->dev.of_node, "hw_algo", &algo); + ret += of_property_read_u8(pdev->dev.of_node, "config_mode", &priv->config_mode); + ret += of_property_read_u8(pdev->dev.of_node, "priv_func_mode", &priv->priv_func_mode); + ret += of_property_read_u8(pdev->dev.of_node, "enable_val", &priv->enable_val); + ret += of_property_read_u8(pdev->dev.of_node, "disable_val", &priv->disable_val); + ret += of_property_read_u8(pdev->dev.of_node, "enable_mask", &priv->enable_mask); + ret += of_property_read_u32(pdev->dev.of_node, "enable_reg", &priv->enable_reg); + ret += of_property_read_u32(pdev->dev.of_node, "timeout_cfg_reg", &priv->timeout_cfg_reg); + ret += of_property_read_u32(pdev->dev.of_node,"hw_margin_ms", &priv->hw_margin); + ret += of_property_read_u8(pdev->dev.of_node,"feed_wdt_type", &priv->feed_wdt_type); + ret += of_property_read_u32(pdev->dev.of_node,"timer_accuracy", &priv->timer_accuracy); + if (ret != 0) { + dev_err(&pdev->dev, "Failed to priv dts.\n"); + return -ENXIO; + } + + priv->sysfs_index = SYSFS_NO_CFG; + of_property_read_u8(pdev->dev.of_node,"sysfs_index", &priv->sysfs_index); + + priv->timeleft_cfg_reg = priv->timeout_cfg_reg; + of_property_read_u32(pdev->dev.of_node,"timeleft_cfg_reg", &priv->timeleft_cfg_reg); + + /* timer accuracy register is optional */ + ret = of_property_read_u8(pdev->dev.of_node,"timer_accuracy_reg_flag", &priv->timer_accuracy_reg_flag); + if (ret < 0) { + /* case: don't has timer_accuracy_reg */ + dev_dbg(&pdev->dev, "Failed to get property in dts: timer_accuracy_reg_flag.\n"); + priv->timer_accuracy_reg_flag = 0; + } else { + ret = of_property_read_u32(pdev->dev.of_node, "timer_accuracy_reg", &priv->timer_accuracy_reg); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to get timer accuracy register address.\n"); + return -ENXIO; + } + ret = of_property_read_u8(pdev->dev.of_node, "timer_accuracy_reg_val", &priv->timer_accuracy_reg_val); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to get timer accuracy register value.\n"); + return -ENXIO; + } + } + + /* timer update register is optional */ + ret = of_property_read_u8(pdev->dev.of_node,"timer_update_reg_flag", &priv->timer_update_reg_flag); + if (ret < 0) { + /* case: don't has timer_update_reg */ + dev_dbg(&pdev->dev, "Failed to get property in dts: timer_update_reg_flag.\n"); + priv->timer_update_reg_flag = 0; /* no timer update register */ + } else { + ret = of_property_read_u32(pdev->dev.of_node, "timer_update_reg", &priv->timer_update_reg); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to get timer update register address.\n"); + return -ENXIO; + } + ret = of_property_read_u8(pdev->dev.of_node, "timer_update_reg_val", &priv->timer_update_reg_val); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to get timer update register value.\n"); + return -ENXIO; + } + } + } else { + if (pdev->dev.platform_data == NULL) { + dev_err(&pdev->dev, "Failed to get platform data config.\n"); + return -ENXIO; + } + wb_wdt_device = pdev->dev.platform_data; + priv->config_dev_name = wb_wdt_device->config_dev_name; + algo = wb_wdt_device->hw_algo; + priv->config_mode = wb_wdt_device->config_mode; + priv->priv_func_mode = wb_wdt_device->priv_func_mode; + priv->enable_val = wb_wdt_device->enable_val; + priv->disable_val = wb_wdt_device->disable_val; + priv->enable_mask = wb_wdt_device->enable_mask; + priv->enable_reg = wb_wdt_device->enable_reg; + priv->timeout_cfg_reg = wb_wdt_device->timeout_cfg_reg; + priv->hw_margin = wb_wdt_device->hw_margin; + priv->timer_accuracy = wb_wdt_device->timer_accuracy; + priv->feed_wdt_type = wb_wdt_device->feed_wdt_type; + priv->sysfs_index = wb_wdt_device->sysfs_index; + priv->timeleft_cfg_reg = wb_wdt_device->timeleft_cfg_reg; + priv->timer_accuracy_reg_flag = wb_wdt_device->timer_accuracy_reg_flag; + priv->timer_accuracy_reg = wb_wdt_device->timer_accuracy_reg; + priv->timer_accuracy_reg_val = wb_wdt_device->timer_accuracy_reg_val; + priv->timer_update_reg_flag = wb_wdt_device->timer_update_reg_flag; + priv->timer_update_reg = wb_wdt_device->timer_update_reg; + priv->timer_update_reg_val = wb_wdt_device->timer_update_reg_val; + } + + if (!strcmp(algo, "toggle")) { + priv->hw_algo = HW_ALGO_TOGGLE; + } else if (!strcmp(algo, "level")) { + priv->hw_algo = HW_ALGO_LEVEL; + } else if (!strcmp(algo, "eigenvalues")) { + priv->hw_algo = HW_ALGO_EIGENVALUES; + } else { + dev_err(&pdev->dev, "hw_algo config error.must be toggle or level.\n"); + return -EINVAL; + } + + WDT_VERBOSE("config_dev_name:%s, config_mode:%u, priv_func_mode:%u, enable_reg:0x%x, timeout_cfg_reg:0x%x\n", + priv->config_dev_name, priv->config_mode, priv->priv_func_mode, priv->enable_reg, priv->timeout_cfg_reg); + WDT_VERBOSE("timeout_cfg_reg:0x%x, enable_val:0x%x, disable_val:0x%x, enable_mask:0x%x, hw_margin:%u, feed_wdt_type:%u\n", + priv->timeleft_cfg_reg, priv->enable_val, priv->disable_val, priv->enable_mask, priv->hw_margin, priv->feed_wdt_type); + WDT_VERBOSE("timer_accuracy_reg_flag: %d, timer_accuracy_reg: 0x%x, timer_accuracy_reg_val: 0x%x, timer_accuracy: %d\n", + priv->timer_accuracy_reg_flag, priv->timer_accuracy_reg, priv->timer_accuracy_reg_val, priv->timer_accuracy); + WDT_VERBOSE("timer_update_reg_flag: %d, timer_update_reg: 0x%x, timer_update_reg_val: 0x%x\n", priv->timer_update_reg_flag, + priv->timer_update_reg, priv->timer_update_reg_val); + + priv->dev = &pdev->dev; + if (priv->config_mode == GPIO_FEED_WDT_MODE) { + ret = gpio_wdt_init(priv, wb_wdt_device); + if (ret < 0) { + dev_err(&pdev->dev, "init gpio mode wdt failed.\n"); + return -ENXIO; + } + } else if (priv->config_mode == LOGIC_FEED_WDT_MODE) { + ret = logic_wdt_init(priv, wb_wdt_device); + if (ret < 0) { + dev_err(&pdev->dev, "init func mode wdt failed.\n"); + return -ENXIO; + } + } else { + dev_err(&pdev->dev, "unsupport %u config_mode, dts configure error.\n", + priv->config_mode); + return -ENXIO; + } + + switch (priv->feed_wdt_type) { + case WATCHDOG_DEVICE_TYPE: + ret = watchdog_device_cfg(priv); + break; + case HRTIMER_TYPE: + ret = hrtimer_cfg(priv, wb_wdt_device); + break; + case THREAD_TYPE: + ret = thread_timer_create(priv, wb_wdt_device); + break; + default: + dev_err(&pdev->dev, "timer type %u unsupport.\n", priv->feed_wdt_type); + return -EINVAL; + } + if (ret < 0) { + dev_err(&pdev->dev, "init timer feed_wdt_type %u failed.\n", priv->feed_wdt_type); + return -ENXIO; + } + + dev_info(&pdev->dev, "register %s mode, config_mode %u, func_mode %u, %u ms overtime wdt success\n", + algo, priv->config_mode, priv->priv_func_mode, priv->hw_margin); + + if (priv->sysfs_index != SYSFS_NO_CFG) { + + priv->sysfs_group = wdt_get_attr_group(priv->sysfs_index); + if (priv->sysfs_group) { + ret = sysfs_create_group(&pdev->dev.kobj, priv->sysfs_group); + if (ret != 0) { + dev_err(&pdev->dev, "sysfs_create_group failed. ret:%d.\n", ret); + return -ENOMEM; + } + dev_info(&pdev->dev, "sysfs create group success\n"); + } else { + dev_err(&pdev->dev, "failed to find %u index wdt, return NULL.\n", priv->sysfs_index); + return -ENOMEM; + } + + mutex_init(&priv->update_lock); + + dev_info(&pdev->dev, "register %u index wdt sysfs success." ,priv->sysfs_index); + } + + return 0; +} + +static void unregister_action(struct platform_device *pdev) +{ + wb_wdt_priv_t *priv = platform_get_drvdata(pdev); + gpio_wdt_info_t *gpio_wdt; + logic_wdt_info_t *logic_wdt; + int ret; + + ret = wb_wdt_enable_ctrl(priv, WDT_OFF); + if (ret < 0) { + dev_err(&pdev->dev, "remove disable wdt failed.\n"); + } + + if (priv->sysfs_index != SYSFS_NO_CFG) { + sysfs_remove_group(&pdev->dev.kobj, priv->sysfs_group); + } + + if (priv->feed_wdt_type == HRTIMER_TYPE) { + hrtimer_cancel(&priv->hrtimer); + } else if (priv->feed_wdt_type == THREAD_TYPE) { + kthread_stop(priv->thread); + priv->thread = NULL; + } else { + WDT_VERBOSE("wdd type, do nothing.\n"); + } + + if (priv->config_mode == GPIO_FEED_WDT_MODE) { + gpio_wdt = &priv->gpio_wdt; + gpio_set_value_cansleep(gpio_wdt->gpio, !gpio_wdt->active_low); + + if (priv->hw_algo == HW_ALGO_TOGGLE) { + gpio_direction_input(gpio_wdt->gpio); + } + } else { + logic_wdt = &priv->logic_wdt; + logic_wdt->state_val = !logic_wdt->state_val; + ret = wb_wdt_write(logic_wdt->logic_func_mode, logic_wdt->feed_dev_name, + logic_wdt->feed_reg, &logic_wdt->state_val, ONE_BYTE); + if (ret < 0) { + dev_err(&pdev->dev, "set wdt control reg error.\n"); + } + } + + return; +} + +static int wb_wdt_remove(struct platform_device *pdev) +{ + WDT_VERBOSE("enter remove wdt.\n"); + unregister_action(pdev); + dev_info(&pdev->dev, "remove wdt finish.\n"); + + return 0; +} + +static void wb_wdt_shutdown(struct platform_device *pdev) +{ + WDT_VERBOSE("enter shutdown wdt.\n"); + unregister_action(pdev); + dev_info(&pdev->dev, "shutdown wdt finish.\n"); + + return; +} + +static const struct of_device_id wb_wdt_dt_ids[] = { + { .compatible = "wb_wdt", }, + { } +}; +MODULE_DEVICE_TABLE(of, wb_wdt_dt_ids); + +static struct platform_driver wb_wdt_driver = { + .driver = { + .name = "wb_wdt", + .of_match_table = wb_wdt_dt_ids, + }, + .probe = wb_wdt_probe, + .remove = wb_wdt_remove, + .shutdown = wb_wdt_shutdown, +}; + +#ifdef CONFIG_GPIO_WATCHDOG_ARCH_INITCALL +static int __init wb_wdt_init(void) +{ + return platform_driver_register(&wb_wdt_driver); +} +arch_initcall(wb_wdt_init); +#else +module_platform_driver(wb_wdt_driver); +#endif + +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("watchdog driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_wdt.h b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_wdt.h new file mode 100644 index 000000000000..d45904ba32ea --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_wdt.h @@ -0,0 +1,53 @@ +#ifndef __WB_WDT_H__ +#define __WB_WDT_H__ + +#include + +#define SYSFS_NO_CFG (0xff) +#define INVALID_REG_ADDR (0xffffffff) + +typedef struct gpio_wdt_info_s { + int gpio; + enum of_gpio_flags flags; + bool active_low; + bool state; +}gpio_wdt_info_t; + +typedef struct logic_wdt_info_s { + const char *feed_dev_name; + uint8_t logic_func_mode; + uint32_t feed_reg; + uint8_t active_val; + uint8_t state_val; +}logic_wdt_info_t; + +typedef struct wb_wdt_device_s { + int device_flag; + const char *config_dev_name; + uint8_t config_mode; + const char *hw_algo; + uint8_t enable_val; + uint8_t disable_val; + uint8_t enable_mask; + uint8_t priv_func_mode; + uint8_t feed_wdt_type; + uint32_t enable_reg; + uint32_t timeout_cfg_reg; + uint32_t timeleft_cfg_reg; + uint32_t hw_margin; + uint32_t feed_time; + uint8_t timer_accuracy_reg_flag; + uint32_t timer_accuracy_reg; + uint8_t timer_accuracy_reg_val; + uint32_t timer_accuracy; + uint8_t timer_update_reg_flag; + uint32_t timer_update_reg; + uint8_t timer_update_reg_val; + union { + gpio_wdt_info_t gpio_wdt; + logic_wdt_info_t logic_wdt; + } wdt_config_mode; + uint8_t sysfs_index; +} wb_wdt_device_t; + +#endif diff --git a/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_xdpe132g5c.c b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_xdpe132g5c.c new file mode 100644 index 000000000000..51c5b4143df8 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/modules/wb_xdpe132g5c.c @@ -0,0 +1,579 @@ +/* + * xdpe132g5c_i2c_drv.c + * + * This module create sysfs to set AVS and create hwmon to get out power + * through xdpe132g5c I2C address. + * + * History + * [Version] [Date] [Description] + * * v1.0 2021-09-17 Initial version + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define WB_I2C_RETRY_SLEEP_TIME (10000) /* 10ms */ +#define WB_I2C_RETRY_TIME (10) +#define WB_XDPE_I2C_PAGE_ADDR (0xff) +#define WB_XDPE_I2C_VOUT_MODE (0x40) +#define WB_XDPE_I2C_VOUT_COMMAND (0x42) +#define WB_XDPE_I2C_VOUT_PAGE (0x06) +#define WB_XDPE_VOUT_MAX_THRESHOLD ((0xFFFF * 1000L * 1000L) / (256)) +#define WB_XDPE_VOUT_MIN_THRESHOLD (0) + +static int g_wb_xdpe_debug = 0; +static int g_wb_xdpe_error = 0; + +module_param(g_wb_xdpe_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_xdpe_error, int, S_IRUGO | S_IWUSR); + +#define WB_XDPE_VERBOSE(fmt, args...) do { \ + if (g_wb_xdpe_debug) { \ + printk(KERN_INFO "[WB_XDPE][VER][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_XDPE_ERROR(fmt, args...) do { \ + if (g_wb_xdpe_error) { \ + printk(KERN_ERR "[WB_XDPE][ERR][func:%s line:%d]\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +struct xdpe_data { + struct i2c_client *client; + struct device *hwmon_dev; + struct mutex update_lock; + long vout_max; + long vout_min; +}; + +typedef struct xdpe_vout_data_s { + u8 vout_mode; + int vout_precision; +} xdpe_vout_data_t; + +static xdpe_vout_data_t g_xdpe_vout_group[] = { + {.vout_mode = 0x18, .vout_precision = 256}, + {.vout_mode = 0x17, .vout_precision = 512}, + {.vout_mode = 0x16, .vout_precision = 1024}, + {.vout_mode = 0x15, .vout_precision = 2048}, + {.vout_mode = 0x14, .vout_precision = 4096}, +}; + +static s32 wb_i2c_smbus_read_byte_data(const struct i2c_client *client, u8 command) +{ + int i; + s32 ret; + + for (i = 0; i < WB_I2C_RETRY_TIME; i++) { + ret = i2c_smbus_read_byte_data(client, command); + if (ret >= 0) { + return ret; + } + usleep_range(WB_I2C_RETRY_SLEEP_TIME, WB_I2C_RETRY_SLEEP_TIME + 1); + } + return ret; +} + +static s32 wb_i2c_smbus_write_byte_data(const struct i2c_client *client, u8 command, u8 value) +{ + int i; + s32 ret; + + for (i = 0; i < WB_I2C_RETRY_TIME; i++) { + ret = i2c_smbus_write_byte_data(client, command, value); + if (ret >= 0) { + return ret; + } + usleep_range(WB_I2C_RETRY_SLEEP_TIME, WB_I2C_RETRY_SLEEP_TIME + 1); + } + return ret; +} + +static s32 wb_i2c_smbus_read_word_data(const struct i2c_client *client, u8 command) +{ + int i; + s32 ret; + + for (i = 0; i < WB_I2C_RETRY_TIME; i++) { + ret = i2c_smbus_read_word_data(client, command); + if (ret >= 0) { + return ret; + } + usleep_range(WB_I2C_RETRY_SLEEP_TIME, WB_I2C_RETRY_SLEEP_TIME + 1); + } + return ret; +} + +static s32 wb_i2c_smbus_write_word_data(const struct i2c_client *client, u8 command, + u16 value) +{ + int i; + s32 ret; + + for (i = 0; i < WB_I2C_RETRY_TIME; i++) { + ret = i2c_smbus_write_word_data(client, command, value); + if (ret >= 0) { + return ret; + } + usleep_range(WB_I2C_RETRY_SLEEP_TIME, WB_I2C_RETRY_SLEEP_TIME + 1); + } + return ret; +} + +static long calc_power_linear11_data(int data) +{ + s16 exponent; + s32 mantissa; + long val; + + exponent = ((s16)data) >> 11; + mantissa = ((s16)((data & 0x7ff) << 5)) >> 5; + val = mantissa; + val = val * 1000L * 1000L; + + if (exponent >= 0) { + val <<= exponent; + } else { + val >>= -exponent; + } + return val; +} + +static int read_xdpe_power_value(const struct i2c_client *client, u8 page, u8 reg, long *value) +{ + int ret, data; + + ret = wb_i2c_smbus_write_byte_data(client, WB_XDPE_I2C_PAGE_ADDR, page); + if (ret < 0) { + WB_XDPE_ERROR("%d-%04x: set xdpe page%u failed, ret: %d\n", client->adapter->nr, + client->addr, page, ret); + return ret; + } + data = wb_i2c_smbus_read_word_data(client, reg); + if (data < 0) { + WB_XDPE_ERROR("%d-%04x: read xdpe page%u reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, page, reg, data); + return data; + } + *value = calc_power_linear11_data(data); + WB_XDPE_VERBOSE("%d-%04x: page%u reg: 0x%x rd_data: 0x%x, decode linear11 value: %ld\n", + client->adapter->nr, client->addr, page, reg, data, *value); + return 0; +} + +static ssize_t xdpe_power_value_show(struct device *dev, struct device_attribute *da, + char *buf) +{ + int ret, ori_page; + u16 sensor_h, sensor_l; + u8 page, reg; + struct sensor_device_attribute *attr; + struct i2c_client *client; + struct xdpe_data *data; + long value1, value2; + + data = dev_get_drvdata(dev); + client = data->client; + attr = to_sensor_dev_attr(da); + sensor_h = ((attr->index) >> 16) & 0xffff; + sensor_l = (attr->index) & 0xffff; + + mutex_lock(&data->update_lock); + + ori_page = wb_i2c_smbus_read_byte_data(client, WB_XDPE_I2C_PAGE_ADDR); + if (ori_page < 0) { + WB_XDPE_ERROR("%d-%04x: read xdpe origin page failed, ret: %d\n", client->adapter->nr, + client->addr, ori_page); + mutex_unlock(&data->update_lock); + return ori_page; + } + value1 = 0; + value2 = 0; + + if (sensor_h) { + page = (sensor_h >> 8) & 0xff; + reg = sensor_h & 0xff; + ret = read_xdpe_power_value(client, page, reg, &value1); + if (ret < 0) { + WB_XDPE_ERROR("%d-%04x: read xdpe sensor high sensor page%u reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, page, reg, ret); + goto error; + } + WB_XDPE_VERBOSE("%d-%04x: read xdpe sensor high sensor page%u reg: 0x%x success, value: %ld\n", + client->adapter->nr, client->addr, page, reg, value1); + } + + page = (sensor_l >> 8) & 0xff; + reg = sensor_l & 0xff; + ret = read_xdpe_power_value(client, page, reg, &value2); + if (ret < 0) { + WB_XDPE_ERROR("%d-%04x: read xdpe sensor low sensor page%u reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, page, reg, ret); + goto error; + } + WB_XDPE_VERBOSE("%d-%04x: read xdpe sensor low sensor page%u reg: 0x%x success, value: %ld\n", + client->adapter->nr, client->addr, page, reg, value2); + + wb_i2c_smbus_write_byte_data(client, WB_XDPE_I2C_PAGE_ADDR, ori_page); + mutex_unlock(&data->update_lock); + return snprintf(buf, PAGE_SIZE, "%ld\n", value1 + value2); +error: + wb_i2c_smbus_write_byte_data(client, WB_XDPE_I2C_PAGE_ADDR, ori_page); + mutex_unlock(&data->update_lock); + return ret; +} + +static int xdpe_get_vout_precision(const struct i2c_client *client, int *vout_precision) +{ + int i, vout_mode, a_size; + + vout_mode = wb_i2c_smbus_read_byte_data(client, WB_XDPE_I2C_VOUT_MODE); + if (vout_mode < 0) { + WB_XDPE_ERROR("%d-%04x: read xdpe vout mode reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, WB_XDPE_I2C_VOUT_MODE, vout_mode); + return vout_mode; + } + + a_size = ARRAY_SIZE(g_xdpe_vout_group); + for (i = 0; i < a_size; i++) { + if (g_xdpe_vout_group[i].vout_mode == vout_mode) { + *vout_precision = g_xdpe_vout_group[i].vout_precision; + WB_XDPE_VERBOSE("%d-%04x: match, vout mode: 0x%x, precision: %d\n", + client->adapter->nr, client->addr, vout_mode, *vout_precision); + break; + } + } + if (i == a_size) { + WB_XDPE_ERROR("%d-%04x: invalid vout mode: 0x%x\n",client->adapter->nr, client->addr, + vout_mode); + return -EINVAL; + } + return 0; +} + +static ssize_t xdpe_avs_vout_show(struct device *dev, struct device_attribute *da, char *buf) +{ + int ret, ori_page, vout_cmd, vout_precision; + struct i2c_client *client; + struct xdpe_data *data; + long vout; + + client = to_i2c_client(dev); + data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + ori_page = wb_i2c_smbus_read_byte_data(client, WB_XDPE_I2C_PAGE_ADDR); + if (ori_page < 0) { + WB_XDPE_ERROR("%d-%04x: read xdpe origin page failed, ret: %d\n", client->adapter->nr, + client->addr, ori_page); + mutex_unlock(&data->update_lock); + return ori_page; + } + + ret = wb_i2c_smbus_write_byte_data(client, WB_XDPE_I2C_PAGE_ADDR, WB_XDPE_I2C_VOUT_PAGE); + if (ret < 0) { + WB_XDPE_ERROR("%d-%04x: set xdpe avs vout page%u failed, ret: %d\n", client->adapter->nr, + client->addr, WB_XDPE_I2C_VOUT_PAGE, ret); + goto error; + } + + ret = xdpe_get_vout_precision(client, &vout_precision); + if (ret < 0) { + WB_XDPE_ERROR("%d-%04x: get xdpe avs vout precision failed, ret: %d\n", + client->adapter->nr, client->addr, ret); + goto error; + } + + vout_cmd = wb_i2c_smbus_read_word_data(client, WB_XDPE_I2C_VOUT_COMMAND); + if (vout_cmd < 0) { + ret = vout_cmd; + WB_XDPE_ERROR("%d-%04x: read xdpe vout command reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, WB_XDPE_I2C_VOUT_COMMAND, ret); + goto error; + } + + wb_i2c_smbus_write_byte_data(client, WB_XDPE_I2C_PAGE_ADDR, ori_page); + mutex_unlock(&data->update_lock); + + vout = vout_cmd * 1000L * 1000L / vout_precision; + WB_XDPE_VERBOSE("%d-%04x: vout: %ld, vout_cmd: 0x%x, precision: %d\n", client->adapter->nr, + client->addr, vout, vout_cmd, vout_precision); + return snprintf(buf, PAGE_SIZE, "%ld\n", vout); +error: + wb_i2c_smbus_write_byte_data(client, WB_XDPE_I2C_PAGE_ADDR, ori_page); + mutex_unlock(&data->update_lock); + return ret; +} + +static ssize_t xdpe_avs_vout_store(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + int ret, ori_page, vout_cmd, vout_cmd_set, vout_precision; + struct i2c_client *client; + struct xdpe_data *data; + long vout, vout_max, vout_min; + + client = to_i2c_client(dev); + ret = kstrtol(buf, 0, &vout); + if (ret) { + WB_XDPE_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + + if (vout <= 0) { + WB_XDPE_ERROR("%d-%04x: invalid value: %ld \n", client->adapter->nr, client->addr, vout); + return -EINVAL; + } + + data = i2c_get_clientdata(client); + vout_max = data->vout_max; + vout_min = data->vout_min; + if ((vout > vout_max) || (vout < vout_min)) { + WB_XDPE_ERROR("%d-%04x: vout value: %ld, out of range [%ld, %ld] \n", client->adapter->nr, + client->addr, vout, vout_min, vout_max); + return -EINVAL; + } + + mutex_lock(&data->update_lock); + + ori_page = wb_i2c_smbus_read_byte_data(client, WB_XDPE_I2C_PAGE_ADDR); + if (ori_page < 0) { + WB_XDPE_ERROR("%d-%04x: read xdpe origin page failed, ret: %d\n", client->adapter->nr, + client->addr, ori_page); + mutex_unlock(&data->update_lock); + return ori_page; + } + + ret = wb_i2c_smbus_write_byte_data(client, WB_XDPE_I2C_PAGE_ADDR, WB_XDPE_I2C_VOUT_PAGE); + if (ret < 0) { + WB_XDPE_ERROR("%d-%04x: set xdpe avs vout page%u failed, ret: %d\n", client->adapter->nr, + client->addr, WB_XDPE_I2C_VOUT_PAGE, ret); + goto error; + } + + ret = xdpe_get_vout_precision(client, &vout_precision); + if (ret < 0) { + WB_XDPE_ERROR("%d-%04x: get xdpe avs vout precision failed, ret: %d\n", + client->adapter->nr, client->addr, ret); + goto error; + } + + vout_cmd_set = (vout * vout_precision) / (1000L * 1000L); + if (vout_cmd_set > 0xffff) { + WB_XDPE_ERROR("%d-%04x: invalid value, vout %ld, vout_precision: %d, vout_cmd_set: 0x%x\n", + client->adapter->nr, client->addr, vout, vout_precision, vout_cmd_set); + ret = -EINVAL; + goto error; + } + ret = wb_i2c_smbus_write_word_data(client, WB_XDPE_I2C_VOUT_COMMAND, vout_cmd_set); + if (ret < 0) { + WB_XDPE_ERROR("%d-%04x: set xdpe vout cmd reg: 0x%x, value: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, WB_XDPE_I2C_VOUT_COMMAND, vout_cmd_set, ret); + goto error; + } + + vout_cmd = wb_i2c_smbus_read_word_data(client, WB_XDPE_I2C_VOUT_COMMAND); + if (vout_cmd < 0) { + ret = vout_cmd; + WB_XDPE_ERROR("%d-%04x: read xdpe vout command reg: 0x%x failed, ret: %d\n", + client->adapter->nr, client->addr, WB_XDPE_I2C_VOUT_COMMAND, ret); + goto error; + } + if (vout_cmd != vout_cmd_set) { + ret = -EIO; + WB_XDPE_ERROR("%d-%04x: vout cmd value check error, vout cmd read: 0x%x, vout cmd set: 0x%x\n", + client->adapter->nr, client->addr, vout_cmd, vout_cmd_set); + goto error; + + } + + wb_i2c_smbus_write_byte_data(client, WB_XDPE_I2C_PAGE_ADDR, ori_page); + mutex_unlock(&data->update_lock); + WB_XDPE_VERBOSE("%d-%04x: set vout cmd success, vout %ld, vout_precision: %d, vout_cmd_set: 0x%x\n", + client->adapter->nr, client->addr, vout, vout_precision, vout_cmd_set); + return count; +error: + wb_i2c_smbus_write_byte_data(client, WB_XDPE_I2C_PAGE_ADDR, ori_page); + mutex_unlock(&data->update_lock); + return ret; +} + +static ssize_t xdpe_avs_vout_max_show(struct device *dev, struct device_attribute *da, char *buf) +{ + struct i2c_client *client; + struct xdpe_data *data; + long vout_max; + + client = to_i2c_client(dev); + data = i2c_get_clientdata(client); + vout_max = data->vout_max; + return snprintf(buf, PAGE_SIZE, "%ld\n", vout_max); +} + +static ssize_t xdpe_avs_vout_max_store(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + int ret; + struct i2c_client *client; + struct xdpe_data *data; + long vout_max; + + client = to_i2c_client(dev); + ret = kstrtol(buf, 10, &vout_max); + if (ret) { + WB_XDPE_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + WB_XDPE_VERBOSE("%d-%04x: vout max threshold: %ld", client->adapter->nr, client->addr, + vout_max); + data = i2c_get_clientdata(client); + data->vout_max = vout_max; + return count; +} + +static ssize_t xdpe_avs_vout_min_show(struct device *dev, struct device_attribute *da, char *buf) +{ + struct i2c_client *client; + struct xdpe_data *data; + long vout_min; + + client = to_i2c_client(dev); + data = i2c_get_clientdata(client); + vout_min = data->vout_min; + return snprintf(buf, PAGE_SIZE, "%ld\n", vout_min); +} + +static ssize_t xdpe_avs_vout_min_store(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + int ret; + struct i2c_client *client; + struct xdpe_data *data; + long vout_min; + + client = to_i2c_client(dev); + ret = kstrtol(buf, 10, &vout_min); + if (ret) { + WB_XDPE_ERROR("%d-%04x: invalid value: %s \n", client->adapter->nr, client->addr, buf); + return -EINVAL; + } + WB_XDPE_VERBOSE("%d-%04x: vout min threshold: %ld", client->adapter->nr, client->addr, + vout_min); + data = i2c_get_clientdata(client); + data->vout_min = vout_min; + return count; +} + +/* xdpe hwmon */ +static SENSOR_DEVICE_ATTR(power1_input, S_IRUGO ,xdpe_power_value_show, NULL, 0x072c); +static SENSOR_DEVICE_ATTR(power2_input, S_IRUGO ,xdpe_power_value_show, NULL, 0x0b2c); +static SENSOR_DEVICE_ATTR(power3_input, S_IRUGO ,xdpe_power_value_show, NULL, 0x072c0b2c); + +static struct attribute *xdpe_hwmon_attrs[] = { + &sensor_dev_attr_power1_input.dev_attr.attr, + &sensor_dev_attr_power2_input.dev_attr.attr, + &sensor_dev_attr_power3_input.dev_attr.attr, + NULL +}; +ATTRIBUTE_GROUPS(xdpe_hwmon); + +/* xdpe sysfs */ +static SENSOR_DEVICE_ATTR(avs_vout, S_IRUGO | S_IWUSR, xdpe_avs_vout_show, xdpe_avs_vout_store, 0); +static SENSOR_DEVICE_ATTR(avs_vout_max, S_IRUGO | S_IWUSR, xdpe_avs_vout_max_show, xdpe_avs_vout_max_store, 0); +static SENSOR_DEVICE_ATTR(avs_vout_min, S_IRUGO | S_IWUSR, xdpe_avs_vout_min_show, xdpe_avs_vout_min_store, 0); + +static struct attribute *xdpe132g5c_sysfs_attrs[] = { + &sensor_dev_attr_avs_vout.dev_attr.attr, + &sensor_dev_attr_avs_vout_max.dev_attr.attr, + &sensor_dev_attr_avs_vout_min.dev_attr.attr, + NULL, +}; + +static const struct attribute_group xdpe132g5c_sysfs_attrs_group = { + .attrs = xdpe132g5c_sysfs_attrs, +}; + +static int xdpe132g5c_probe(struct i2c_client *client, const struct i2c_device_id *id) +{ + struct xdpe_data *data; + int ret; + + WB_XDPE_VERBOSE("bus: %d, addr: 0x%02x do probe.\n", client->adapter->nr, client->addr); + data = devm_kzalloc(&client->dev, sizeof(struct xdpe_data), GFP_KERNEL); + if (!data) { + dev_err(&client->dev, "devm_kzalloc failed.\n"); + return -ENOMEM; + } + + data->client = client; + i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + + ret = sysfs_create_group(&client->dev.kobj, &xdpe132g5c_sysfs_attrs_group); + if (ret != 0) { + dev_err(&client->dev, "Create xdpe132g5c sysfs failed, ret: %d\n", ret); + return ret; + } + data->hwmon_dev = hwmon_device_register_with_groups(&client->dev, client->name, data, + xdpe_hwmon_groups); + if (IS_ERR(data->hwmon_dev)) { + ret = PTR_ERR(data->hwmon_dev); + sysfs_remove_group(&client->dev.kobj, &xdpe132g5c_sysfs_attrs_group); + dev_err(&client->dev, "Failed to register xdpe hwmon device, ret: %d\n", ret); + return ret; + } + data->vout_max = WB_XDPE_VOUT_MAX_THRESHOLD; + data->vout_min = WB_XDPE_VOUT_MIN_THRESHOLD; + dev_info(&client->dev, "xdpe132g5c probe success\n"); + return 0; +} + +static void xdpe132g5c_remove(struct i2c_client *client) +{ + struct xdpe_data *data; + + WB_XDPE_VERBOSE("bus: %d, addr: 0x%02x do remove\n", client->adapter->nr, client->addr); + data = i2c_get_clientdata(client); + hwmon_device_unregister(data->hwmon_dev); + sysfs_remove_group(&client->dev.kobj, &xdpe132g5c_sysfs_attrs_group); + return; +} + +static const struct i2c_device_id xdpe132g5c_id[] = { + {"wb_xdpe132g5c", 0}, + {} +}; + +MODULE_DEVICE_TABLE(i2c, xdpe132g5c_id); + +static const struct of_device_id __maybe_unused xdpe132g5c_of_match[] = { + {.compatible = "infineon,wb_xdpe132g5c"}, + {} +}; +MODULE_DEVICE_TABLE(of, xdpe132g5c_of_match); + +static struct i2c_driver wb_xdpe132g5c_driver = { + .driver = { + .name = "wb_xdpe132g5c", + .of_match_table = of_match_ptr(xdpe132g5c_of_match), + }, + .probe = xdpe132g5c_probe, + .remove = xdpe132g5c_remove, + .id_table = xdpe132g5c_id, +}; + +module_i2c_driver(wb_xdpe132g5c_driver); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); +MODULE_DESCRIPTION("I2C driver for Infineon XDPE132 family"); diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/auto_update.py b/platform/broadcom/sonic-platform-modules-micas/common/script/auto_update.py new file mode 100755 index 000000000000..838e64f6b417 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/auto_update.py @@ -0,0 +1,196 @@ +#!/usr/bin/env python3 + +try: + import os + import json + import logging + import sys + from sonic_py_common import device_info + from sonic_platform.platform import Platform +except ImportError as e: + raise ImportError(str(e) + "- required module not found") from e + +PLATFORM_COMPONENTS_FILE = "platform_components.json" +CHASSIS_KEY = "chassis" +COMPONENT_KEY = "component" +FIRMWARE_KEY = "firmware" +VERSION_KEY = "version" +chassis_component_map = {} +current_chassis_component_map = {} +current_chassis = Platform().get_chassis() + + +def parse_component_section(section, component): + if not isinstance(component, dict): + logging.error("dictionary is expected: key=%s", COMPONENT_KEY) + return False + + if not component: + return False + + missing_key = None + chassis_component_map[section] = {} + + for key1, value1 in component.items(): + if not isinstance(value1, dict): + logging.error("dictionary is expected: key=%s", key1) + return False + + if value1: + if len(value1) < 1 or len(value1) > 3: + logging.error("unexpected number of records: key=%s", key1) + return False + + if FIRMWARE_KEY not in value1: + missing_key = FIRMWARE_KEY + break + + for key2, value2 in value1.items(): + if not isinstance(value2, str): + logging.error("string is expected: key=%s", key2) + return False + + chassis_component_map[section][key1] = value1 + + if missing_key is not None: + logging.error("\"%s\" key hasn't been found", missing_key) + return False + + return True + + +def parse_chassis_section(chassis): + if not isinstance(chassis, dict): + logging.error("dictionary is expected: key=%s", CHASSIS_KEY) + return False + + if not chassis: + logging.error("dictionary is empty: key=%s", CHASSIS_KEY) + return False + + if len(chassis) != 1: + logging.error("unexpected number of records: key=%s", CHASSIS_KEY) + return False + + for key, value in chassis.items(): + if not isinstance(value, dict): + logging.error("dictionary is expected: key=%s", key) + return False + + if not value: + logging.error("dictionary is empty: key=%s", key) + return False + + if COMPONENT_KEY not in value: + logging.error("\"%s\" key hasn't been found", COMPONENT_KEY) + return False + + if len(value) != 1: + logging.error("unexpected number of records: key=%s", key) + return False + + return parse_component_section(key, value[COMPONENT_KEY]) + + return False + + +def get_platform_components_path(): + PLATFORM_COMPONENTS_PATH_TEMPLATE = "/usr/share/sonic/device/{}/{}" + PLATFORM_COMPONENTS_FILE_PATH = PLATFORM_COMPONENTS_PATH_TEMPLATE.format( + device_info.get_platform(), PLATFORM_COMPONENTS_FILE) + return PLATFORM_COMPONENTS_FILE_PATH + + +def parse_platform_components(): + platform_components_path = get_platform_components_path() + with open(platform_components_path) as platform_components: + data = json.load(platform_components) + + if not isinstance(data, dict): + logging.error("dictionary is expected: key=root") + return False + + if not data: + logging.error("dictionary is empty: key=root") + return False + + if CHASSIS_KEY not in data: + logging.error("\"%s\" key hasn't been found", CHASSIS_KEY) + return False + + return parse_chassis_section(data[CHASSIS_KEY]) + + +def get_current_chassis_component_map(): + chassis_name = current_chassis.get_name() + current_chassis_component_map[chassis_name] = {} + + component_list = current_chassis.get_all_components() + for component in component_list: + component_name = component.get_name() + current_chassis_component_map[chassis_name][component_name] = component + + return current_chassis_component_map + + +def get_upgrade_dict(): + upgrade_dict = {} + firmware_version_current = "" + firmware_version_available = "" + + if not parse_platform_components(): + logging.error("Reading platform_components.json i, ion exception") + sys.exit(1) + + if not get_current_chassis_component_map(): + logging.error("Reading firmware i, ion from the driver is abnormal") + sys.exit(1) + + chassis_name = current_chassis.get_name() + diff_keys = set(chassis_component_map.keys()) ^ set(current_chassis_component_map.keys()) + if diff_keys: + logging.error("%s names mismatch: keys=%s", chassis_name, str(list(diff_keys))) + return None + + for chassis_name, component_map in current_chassis_component_map.items(): + for component_name, component in component_map.items(): + firmware_version_current = component.get_firmware_version() + if component_name in chassis_component_map[chassis_name]: + firmware_version_available = chassis_component_map[chassis_name][component_name][VERSION_KEY] + else: + logging.warning("can't find %s in %s", component_name, PLATFORM_COMPONENTS_FILE) + break + + if not os.path.exists(chassis_component_map[chassis_name][component_name][FIRMWARE_KEY]): + logging.error("%s does not exist", chassis_component_map[chassis_name][component_name][FIRMWARE_KEY]) + break + + if firmware_version_available != firmware_version_current: + upgrade_dict[component_name] = chassis_component_map[chassis_name][component_name][FIRMWARE_KEY] + + return upgrade_dict + + +def auto_upgrade(): + upgrade_result_dict = {} + chassis_name = current_chassis.get_name() + + upgrade_dict = get_upgrade_dict() + if not upgrade_dict: + logging.info("No firmware found for automatic upgrade") + return None + + component_map = current_chassis_component_map[chassis_name] + for value, path in upgrade_dict.items(): + status = component_map[value].install_firmware(path) + if status: + upgrade_result_dict[value] = "success" + logging.info("%s Upgrade Success", value) + else: + upgrade_result_dict[value] = "failed" + logging.error("%s Upgrade Failed", value) + return upgrade_result_dict + + +if __name__ == '__main__': + auto_upgrade() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/avscontrol.py b/platform/broadcom/sonic-platform-modules-micas/common/script/avscontrol.py new file mode 100755 index 000000000000..1f367133a89b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/avscontrol.py @@ -0,0 +1,203 @@ +#!/usr/bin/env python3 +import sys +import os +import time +import syslog +import glob +import click +from platform_config import MAC_DEFAULT_PARAM +from platform_util import getSdkReg, write_sysfs, get_value, get_format_value + + +AVSCTROL_DEBUG_FILE = "/etc/.avscontrol_debug_flag" + +AVSCTROLERROR = 1 +AVSCTROLDEBUG = 2 + +debuglevel = 0 + +CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']} + + +class AliasedGroup(click.Group): + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + if len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + return None + + +def avscontrol_debug(s): + if AVSCTROLDEBUG & debuglevel: + syslog.openlog("AVSCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def avscontrol_error(s): + if AVSCTROLERROR & debuglevel: + syslog.openlog("AVSCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def avserror(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("AVSCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def avsinfo(s): + syslog.openlog("AVSCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_INFO, s) + + +def debug_init(): + global debuglevel + if os.path.exists(AVSCTROL_DEBUG_FILE): + debuglevel = debuglevel | AVSCTROLDEBUG | AVSCTROLERROR + else: + debuglevel = debuglevel & ~(AVSCTROLDEBUG | AVSCTROLERROR) + + +def set_avs_value_sysfs(conf, dcdc_value): + msg = "" + formula = conf.get("formula", None) + loc = conf.get("loc") + locations = glob.glob(loc) + if len(locations) == 0: + msg = "avs sysfs loc: %s not found" % loc + avscontrol_error(msg) + return False, msg + sysfs_loc = locations[0] + avscontrol_debug("set_avs_value_sysfs, loc: %s, origin dcdc value: %s, formula: %s" % + (sysfs_loc, dcdc_value, formula)) + if formula is not None: + dcdc_value = get_format_value(formula % (dcdc_value)) + wr_val = str(dcdc_value) + avscontrol_debug("set_avs_value_sysfs, write val: %s" % wr_val) + ret, log = write_sysfs(sysfs_loc, wr_val) + if ret is False: + msg = "set_avs_value_sysfs failed, msg: %s" % log + avscontrol_error(msg) + return ret, msg + + +def set_avs_value(avs_conf, dcdc_value): + set_avs_way = avs_conf.get("set_avs", {}).get("gettype") + if set_avs_way != "sysfs": + msg = "unsupport set avs value type: %s" % set_avs_way + avscontrol_error(msg) + return False, msg + ret, msg = set_avs_value_sysfs(avs_conf["set_avs"], dcdc_value) + return ret, msg + + +def get_dcdc_value(avs_conf, rov_value): + msg = "" + mac_avs_param = avs_conf.get("mac_avs_param", {}) + if rov_value not in mac_avs_param.keys(): + if avs_conf["type"] == 0: + msg = "VID:0x%x out of range, voltage regulate stop" % rov_value + avsinfo(msg) + return False, msg + dcdc_value = mac_avs_param[avs_conf["default"]] + avsinfo("VID:0x%x out of range, use default VID:0x%x" % (rov_value, dcdc_value)) + else: + dcdc_value = mac_avs_param[rov_value] + return True, dcdc_value + + +def get_rov_value_cpld(avs_conf): + cpld_avs_config = avs_conf["cpld_avs"] + return get_value(cpld_avs_config) + + +def get_rov_value_sdk(avs_conf): + name = avs_conf["sdkreg"] + ret, status = getSdkReg(name) + if ret is False: + return False, status + status = int(status, 16) + # shift operation + if avs_conf["sdktype"] != 0: + status = (status >> avs_conf["macregloc"]) & avs_conf["mask"] + macavs = status + return True, macavs + + +def doAvsCtrol_single(avs_conf): + try: + avs_name = avs_conf.get("name") + rov_source = avs_conf["rov_source"] + if rov_source == 0: + ret, rov_value = get_rov_value_cpld(avs_conf) # get rov from cpld reg + else: + ret, rov_value = get_rov_value_sdk(avs_conf) # get rov from sdk reg + if ret is False: + msg = "%s get rov_value failed, msg: %s" % (avs_name, rov_value) + avscontrol_error(msg) + return False, msg + avscontrol_debug("%s rov_value: 0x%x" % (avs_name, rov_value)) + ret, dcdc_value = get_dcdc_value(avs_conf, rov_value) + if ret is False: + msg = "%s get output voltage value failed, msg: %s" % (avs_name, dcdc_value) + avscontrol_error(msg) + return False, msg + ret, msg = set_avs_value(avs_conf, dcdc_value) + return ret, msg + except Exception as e: + msg = "%s avscontrol raise exception, msg: %s" % (avs_name, str(e)) + avscontrol_error(msg) + return False, msg + + +def doAvsCtrol(avs_conf): + retry_time = avs_conf.get("retry", 10) + for i in range(retry_time): + debug_init() + ret, log = doAvsCtrol_single(avs_conf) + if ret is True: + return True, log + time.sleep(10) + return False, log + + +def run(): + # wait 30s for device steady + time.sleep(30) + errcnt = 0 + msg = "" + for item in MAC_DEFAULT_PARAM: + status, log = doAvsCtrol(item) + if status is False: + errcnt += 1 + msg += log + + if errcnt == 0: + avsinfo("%%AVSCONTROL success") + sys.exit(0) + avserror("%%DEV_MONITOR-AVS: MAC Voltage adjust failed.") + avserror("%%DEV_MONITOR-AVS: errmsg: %s" % msg) + sys.exit(1) + + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''device operator''' + + +@main.command() +def start(): + '''start AVS control''' + avsinfo("%%AVSCONTROL start") + run() + + +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/dev_monitor.py b/platform/broadcom/sonic-platform-modules-micas/common/script/dev_monitor.py new file mode 100755 index 000000000000..8ce06db061bf --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/dev_monitor.py @@ -0,0 +1,303 @@ +#!/usr/bin/env python3 +import sys +import os +import time +import syslog +import traceback +import click +from platform_config import DEV_MONITOR_PARAM +from platform_util import io_rd, wbi2cget, exec_os_cmd + + +CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']} + + +class AliasedGroup(click.Group): + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + if len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + return None + + +DEVMONITOR_DEBUG_FILE = "/etc/.devmonitor_debug_flag" + +debuglevel = 0 + + +def debug_init(): + global debuglevel + if os.path.exists(DEVMONITOR_DEBUG_FILE): + debuglevel = 1 + else: + debuglevel = 0 + + +def devwarninglog(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("DEVMONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_WARNING, s) + + +def devcriticallog(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("DEVMONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_CRIT, s) + + +def deverror(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("DEVMONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def devinfo(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("DEVMONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_INFO, s) + + +def devdebuglog(s): + # s = s.decode('utf-8').encode('gb2312') + if debuglevel == 1: + syslog.openlog("DEVMONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +class DevMonitor(): + + def getpresentstatus(self, param): + try: + ret = {} + ret["status"] = '' + gettype = param.get('gettype') + presentbit = param.get('presentbit') + okval = param.get('okval') + if gettype == "io": + io_addr = param.get('io_addr') + val = io_rd(io_addr) + if val is None: + ret["status"] = "NOT OK" + return ret + retval = val + else: + bus = param.get('bus') + loc = param.get('loc') + offset = param.get('offset') + ind, val = wbi2cget(bus, loc, offset) + if ind is not True: + ret["status"] = "NOT OK" + return ret + retval = val + val_t = (int(retval, 16) & (1 << presentbit)) >> presentbit + if val_t != okval: + ret["status"] = "ABSENT" + else: + ret["status"] = "PRESENT" + except Exception as e: + ret["status"] = "NOT OK" + deverror("getpresentstatus error") + deverror(str(e)) + return ret + + def removeDev(self, bus, loc): + cmd = "echo 0x%02x > /sys/bus/i2c/devices/i2c-%d/delete_device" % (loc, bus) + devpath = "/sys/bus/i2c/devices/%d-%04x" % (bus, loc) + if os.path.exists(devpath): + exec_os_cmd(cmd) + + def addDev(self, name, bus, loc): + if name == "lm75": + time.sleep(0.1) + cmd = "echo %s 0x%02x > /sys/bus/i2c/devices/i2c-%d/new_device" % (name, loc, bus) + devpath = "/sys/bus/i2c/devices/%d-%04x" % (bus, loc) + if os.path.exists(devpath) is False: + exec_os_cmd(cmd) + + def checkattr(self, bus, loc, attr): + try: + attrpath = "/sys/bus/i2c/devices/%d-%04x/%s" % (bus, loc, attr) + if os.path.exists(attrpath): + return True + except Exception as e: + deverror("checkattr error") + deverror(str(e)) + return False + + def monitor(self, ret): + totalerr = 0 + for item in ret: + try: + name = item.get('name') + itemattr = '%sattr' % name + val_t = getattr(DevMonitor, itemattr, None) + if val_t == 'OK': + continue + present = item.get('present', None) + devices = item.get('device') + err_t = 0 + for item_dev in devices: + item_devattr = '%s' % (item_dev['id']) + val_t = getattr(DevMonitor, item_devattr, None) + if val_t == 'OK': + continue + devname = item_dev.get('name') + bus = item_dev.get('bus') + loc = item_dev.get('loc') + attr = item_dev.get('attr') + if self.checkattr(bus, loc, attr) is False: + err_t -= 1 + setattr(DevMonitor, item_devattr, 'NOT OK') + if present is not None: + presentstatus = self.getpresentstatus(present) + devdebuglog("%s present status:%s" % (name, presentstatus.get('status'))) + if presentstatus.get('status') == 'PRESENT': + self.removeDev(bus, loc) + time.sleep(0.1) + self.addDev(devname, bus, loc) + else: + self.removeDev(bus, loc) + time.sleep(0.1) + self.addDev(devname, bus, loc) + else: + setattr(DevMonitor, item_devattr, 'OK') + val_t = getattr(DevMonitor, item_devattr, None) + devdebuglog("%s status %s" % (item_devattr, val_t)) + if err_t == 0: + setattr(DevMonitor, itemattr, 'OK') + else: + totalerr -= 1 + setattr(DevMonitor, itemattr, 'NOT OK') + val_t = getattr(DevMonitor, itemattr, None) + devdebuglog("%s status %s" % (itemattr, val_t)) + except Exception as e: + totalerr -= 1 + deverror("monitor error") + deverror(str(e)) + return totalerr + + def psusmonitor(self): + psus_conf = DEV_MONITOR_PARAM.get('psus') + if psus_conf is None: + return 0 + psusattr = 'psusattr' + val_t = getattr(DevMonitor, psusattr, None) + if val_t == 'OK': + return 0 + ret = self.monitor(psus_conf) + if ret == 0: + setattr(DevMonitor, psusattr, 'OK') + else: + setattr(DevMonitor, psusattr, 'NOT OK') + val_t = getattr(DevMonitor, psusattr, None) + devdebuglog("psusattr:value:%s" % (val_t)) + return ret + + def fansmonitor(self): + fans_conf = DEV_MONITOR_PARAM.get('fans') + if fans_conf is None: + return 0 + fansattr = 'fansattr' + val_t = getattr(DevMonitor, fansattr, None) + if val_t == 'OK': + return 0 + ret = self.monitor(fans_conf) + if ret == 0: + setattr(DevMonitor, fansattr, 'OK') + else: + setattr(DevMonitor, fansattr, 'NOT OK') + val_t = getattr(DevMonitor, fansattr, None) + devdebuglog("fansattr:value:%s" % (val_t)) + return ret + + def slotsmonitor(self): + slots_conf = DEV_MONITOR_PARAM.get('slots') + if slots_conf is None: + return 0 + slotsattr = 'slotsattr' + val_t = getattr(DevMonitor, slotsattr, None) + if val_t == 'OK': + return 0 + ret = self.monitor(slots_conf) + if ret == 0: + setattr(DevMonitor, slotsattr, 'OK') + else: + setattr(DevMonitor, slotsattr, 'NOT OK') + val_t = getattr(DevMonitor, slotsattr, None) + devdebuglog("slotsattr:value:%s" % (val_t)) + return ret + + def othersmonitor(self): + others_conf = DEV_MONITOR_PARAM.get('others') + if others_conf is None: + return 0 + othersattr = 'othersattr' + val_t = getattr(DevMonitor, othersattr, None) + if val_t == 'OK': + return 0 + ret = self.monitor(others_conf) + if ret == 0: + setattr(DevMonitor, othersattr, 'OK') + else: + setattr(DevMonitor, othersattr, 'NOT OK') + val_t = getattr(DevMonitor, othersattr, None) + devdebuglog("othersattr:value:%s" % (val_t)) + return ret + + +def doDevMonitor(devMonitor): + ret_t = 0 + ret_t += devMonitor.psusmonitor() + ret_t += devMonitor.fansmonitor() + ret_t += devMonitor.slotsmonitor() + ret_t += devMonitor.othersmonitor() + return ret_t + + +def run(interval, devMonitor): + # devMonitor.devattrinit() + while True: + try: + debug_init() + ret = doDevMonitor(devMonitor) + except Exception as e: + traceback.print_exc() + deverror(str(e)) + ret = -1 + if ret == 0: + time.sleep(5) + devinfo("dev_monitor finished!") + sys.exit(0) + time.sleep(interval) + + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''device operator''' + + +@main.command() +def start(): + '''start device monitor''' + devinfo("dev_monitor start") + devMonitor = DevMonitor() + interval = DEV_MONITOR_PARAM.get('polling_time', 10) + run(interval, devMonitor) + + +@main.command() +def stop(): + '''stop device monitor ''' + devinfo("stop") + + +# device_i2c operation +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/drv_update.py b/platform/broadcom/sonic-platform-modules-micas/common/script/drv_update.py new file mode 100755 index 000000000000..ac7c189f1b8f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/drv_update.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*- +import syslog +import os +import shutil +from platform_config import DRVIER_UPDATE_CONF +from platform_util import exec_os_cmd + + +DRV_UPDATE_DEBUG_FILE = "/etc/.drv_update_debug_flag" + +DRVUPDATEERROR = 1 +DRVUPDATEDEBUG = 2 +debuglevel = 0 + + +def drv_update_debug(s): + if DRVUPDATEDEBUG & debuglevel: + syslog.openlog("DRV_UPDATE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_INFO, s) + + +def drv_update_error(s): + if DRVUPDATEERROR & debuglevel: + syslog.openlog("DRV_UPDATE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def drv_update_info(s): + syslog.openlog("DRV_UPDATE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_LOCAL1 | syslog.LOG_NOTICE, s) + +def debug_init(): + global debuglevel + try: + with open(DRV_UPDATE_DEBUG_FILE, "r") as fd: + value = fd.read() + debuglevel = int(value) + except Exception: + debuglevel = 0 + + +def get_driver_md5sum(drv_path): + status, output = exec_os_cmd("md5sum %s" % drv_path) + if status or len(output) == 0: + return False, output + drv_md5 = output.strip().split(" ")[0] + return True, drv_md5 + + +def do_driver_replace(src_file, target_file): + # Backup target file + src_file_dir = os.path.dirname(src_file) + target_file_name = os.path.basename(target_file) + drv_update_debug("src_file: %s, src_file_dir: %s" % (src_file, src_file_dir)) + drv_update_debug("target_file: %s, target_file_name: %s" % (target_file, target_file_name)) + try: + shutil.copyfile(target_file, "%s/%s.bak" % (src_file_dir, target_file_name)) + shutil.copyfile(src_file, target_file) + return True + except Exception as e: + drv_update_error("do_driver_replace error, msg: %s" % str(e)) + return False + + +def doDrvUpdate(): + reboot_flag = DRVIER_UPDATE_CONF.get("reboot_flag", 0) + drv_list = DRVIER_UPDATE_CONF.get("drv_list", []) + err_cnt = 0 + update_initramfs_flag = 0 + # get kernel version + status, output = exec_os_cmd("uname -r") + if status or len(output) == 0: + drv_update_error("Failed to get kernel version, status: %s, log: %s" % (status, output)) + return + kversion = output.strip() + drv_update_debug("kernel version: %s" % kversion) + for item in drv_list: + try: + source_drv = item.get("source") + target_drv = item.get("target") + judge_flag = item.get("judge_flag") + if source_drv is None or target_drv is None or judge_flag is None: + drv_update_error("driver update config error, source_drv: %s, target_drv: %s, judge_file: %s" % (source_drv, target_drv, judge_flag)) + err_cnt += 1 + continue + drv_update_debug("source_drv: %s, target_drv: %s, judge_flag: %s" % (source_drv, target_drv, judge_flag)) + + # Check if the current driver is expected + if os.path.exists(judge_flag): + drv_update_debug("The current driver is expected, do nothing") + continue + + # get source driver file path + source_drv_path = "/lib/modules/%s/%s" % (kversion, source_drv) + drv_update_debug("source driver: %s, file path: %s" % (source_drv, source_drv_path)) + + # get target driver file path + target_drv_path = "/lib/modules/%s/%s" % (kversion, target_drv) + drv_update_debug("target driver: %s, file path: %s" % (target_drv, target_drv_path)) + + # get source driver md5sum + status, source_drv_md5 = get_driver_md5sum(source_drv_path) + if status is False: + msg = "get %s md5sum failed msg: %s" % (source_drv_path, source_drv_md5) + drv_update_error(msg) + err_cnt += 1 + continue + drv_update_debug("source driver file path: %s, md5sum: %s" % (source_drv_path, source_drv_md5)) + + # get target driver md5sum + status, target_drv_md5 = get_driver_md5sum(target_drv_path) + if status is False: + msg = "get %s md5sum failed msg: %s" % (target_drv_path, target_drv_md5) + drv_update_error(msg) + err_cnt += 1 + continue + drv_update_debug("target driver file path: %s, md5sum: %s" % (target_drv_path, target_drv_md5)) + + if source_drv_md5 != target_drv_md5: + drv_update_debug("source_drv_md5 not equal to target_drv_md5, try to use source driver replace target driver") + status = do_driver_replace(source_drv_path, target_drv_path) + if status is False: + err_cnt += 1 + continue + else: + drv_update_debug("source_drv_md5 equal to target_drv_md5, do nothing") + + drv_update_debug("Driver replacement completed, set update_initramfs_flag") + update_initramfs_flag = 1 + + except Exception as e: + err_cnt += 1 + drv_update_error(str(e)) + + if update_initramfs_flag == 1: + drv_update_debug("starting to update initramfs") + exec_os_cmd("update-initramfs -u") + drv_update_debug("update initramfs finish") + + exec_os_cmd("sync") + if update_initramfs_flag == 1 and err_cnt == 0 and reboot_flag == 1: + reboot_log = "%DRV_UPDATE-5-REBOOT: Update initramfs is completed, restarting the system to take effect." + reboot_log_cmd = "echo '%s' > /dev/ttyS0" % reboot_log + exec_os_cmd(reboot_log_cmd) + drv_update_info(reboot_log) + exec_os_cmd("/sbin/reboot") + return + +if __name__ == '__main__': + debug_init() + doDrvUpdate() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/generate_airflow.py b/platform/broadcom/sonic-platform-modules-micas/common/script/generate_airflow.py new file mode 100755 index 000000000000..ff4fed46fa13 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/generate_airflow.py @@ -0,0 +1,254 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*- +''' +generate board air flow according to fan and psu air flow +write resulet to AIRFLOW_RESULT_FILE, file format: +{ + "FAN1": { + "model":"M1HFAN I-F", + "airflow":"intake", + }, + "PSU1": { + "model":"CSU550AP-3-500", + "airflow":"intake", + }, + "board":"intake" +} +''' +import os +import syslog +import json +from platform_config import AIR_FLOW_CONF, AIRFLOW_RESULT_FILE +from platform_util import dev_file_read, byteTostr, exec_os_cmd +from eepromutil.fru import ipmifru +from eepromutil.cust_fru import CustFru +from eepromutil.fantlv import fan_tlv + + +AIRFLOW_DEBUG_FILE = "/etc/.airflow_debug_flag" + +AIRFLOWERROR = 1 +AIRFLOWDEBUG = 2 + +debuglevel = 0 + + +def airflow_info(s): + syslog.openlog("AIRFLOW", syslog.LOG_PID) + syslog.syslog(syslog.LOG_INFO, s) + + +def airflow_error(s): + syslog.openlog("AIRFLOW", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def airflow_debug(s): + if AIRFLOWDEBUG & debuglevel: + syslog.openlog("AIRFLOW", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def airflow_debug_error(s): + if AIRFLOWERROR & debuglevel: + syslog.openlog("AIRFLOW", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def debug_init(): + global debuglevel + try: + with open(AIRFLOW_DEBUG_FILE, "r") as fd: + value = fd.read() + debuglevel = int(value) + except Exception: + debuglevel = 0 + + +def get_model_fru(device, eeprom): + try: + fru = ipmifru() + fru.decodeBin(eeprom) + dev_name = device.get("name") + area = device.get("area") + field = device.get("field") + tmp_area = getattr(fru, area, None) + if tmp_area is None: + msg = "%s fru %s area config error" % (dev_name, area) + return False, msg + model = getattr(tmp_area, field, None) + if model is None: + msg = "%s get model error, area: %s, field: %s" % (dev_name, area, field) + return False, msg + airflow_debug("%s get model success, model: %s" % (dev_name, model)) + return True, model + except Exception as e: + return False, str(e) + +def get_model_custfru(device, eeprom): + try: + custfru = CustFru() + custfru.decode(eeprom) + dev_name = device.get("name") + field = device.get("field") + model = getattr(custfru, field, None) + if model is None: + msg = "%s get model error, field: %s" % (dev_name, field) + return False, msg + airflow_debug("%s get model success, model: %s" % (dev_name, model)) + return True, model + except Exception as e: + return False, str(e) + + +def get_model_fantlv(device, eeprom): + try: + dev_name = device.get("name") + tlv = fan_tlv() + rets = tlv.decode(eeprom) + if len(rets) == 0: + msg = "%s decode fantlv eeprom info error" % dev_name + return False, msg + + field = device.get("field") + for fantlv_item in rets: + if fantlv_item.get("name") == field: + return True, fantlv_item["value"] + msg = "%s get model error, field: %s not found" % (dev_name, field) + return False, msg + except Exception as e: + return False, str(e) + + +def get_device_modele(device): + e2_type = device.get("e2_type") + dev_name = device.get("name") + support_e2_type = ("fru", "fantlv", "custfru") + if e2_type not in support_e2_type: + msg = "%s unsupport e2_type: %s" % (dev_name, e2_type) + return False, msg + + e2_path = device.get("e2_path") + e2_size = device.get("e2_size", 256) + ret, binval_bytes = dev_file_read(e2_path, 0, e2_size) + if ret is False: + msg = "%s eeprom read error, eeprom path: %s, msg: %s" % (dev_name, e2_path, binval_bytes) + return False, msg + + binval = byteTostr(binval_bytes) + if e2_type == "fru": + return get_model_fru(device, binval) + if e2_type == "custfru": + return get_model_custfru(device, binval) + return get_model_fantlv(device, binval) + + +def get_board_air_flow(fan_intake_num, fan_exhaust_num, psu_intake_num, psu_exhaust_num): + airflow_debug("fan_intake_num: %d, fan_exhaust_num: %d, psu_intake_num: %d, psu_exhaust_num: %d" % + (fan_intake_num, fan_exhaust_num, psu_intake_num, psu_exhaust_num)) + + if fan_intake_num == 0 and fan_exhaust_num == 0 and psu_intake_num == 0 and psu_exhaust_num == 0: + airflow_error("get all fans and psus air flow failed") + return "N/A" + + if fan_intake_num > fan_exhaust_num: + airflow_debug("fan intake number more than fan exhaust number, set board air flow: intake") + return "intake" + + if fan_intake_num < fan_exhaust_num: + airflow_debug("fan intake number less than fan exhaust number, set board air flow: exhaust") + return "exhaust" + + airflow_debug("fan intake number equal to exhaust number, check psu air flow") + + if psu_intake_num > psu_exhaust_num: + airflow_debug("psu intake number more than psu exhaust number, set board air flow: intake") + return "intake" + + if psu_intake_num < psu_exhaust_num: + airflow_debug("psu intake number less than psu exhaust number, set board air flow: exhaust") + return "exhaust" + + airflow_debug("fan and psu intake and exhaust number equal, return intake") + return "intake" + + +def generate_airflow(): + fan_intake_list = [] + fan_exhaust_list = [] + psu_intake_list = [] + psu_exhaust_list = [] + ret = {} + fans = AIR_FLOW_CONF.get("fans", []) + psus = AIR_FLOW_CONF.get("psus", []) + + for fan in fans: + dev_name = fan.get("name") + air_flow = "N/A" + status, model = get_device_modele(fan) + if status is False: + ret[dev_name] = {"model": "N/A", "airflow": "N/A"} + airflow_error(model) + continue + model = model.strip() + airflowconifg = AIR_FLOW_CONF[fan["decode"]] + for key, value in airflowconifg.items(): + if model in value: + air_flow = key + ret[dev_name] = {"model": model, "airflow": air_flow} + airflow_debug("%s model: %s, airflow: %s" % (dev_name, model, air_flow)) + if air_flow == "intake": + fan_intake_list.append(fan.get("name")) + elif air_flow == "exhaust": + fan_exhaust_list.append(fan.get("name")) + + airflow_debug("fan_intake_list: %s" % fan_intake_list) + airflow_debug("fan_exhaust_list: %s" % fan_exhaust_list) + + for psu in psus: + dev_name = psu.get("name") + air_flow = "N/A" + status, model = get_device_modele(psu) + if status is False: + ret[dev_name] = {"model": "N/A", "airflow": "N/A"} + airflow_error(model) + continue + model = model.strip() + airflowconifg = AIR_FLOW_CONF[psu["decode"]] + for key, value in airflowconifg.items(): + if model in value: + air_flow = key + ret[dev_name] = {"model": model, "airflow": air_flow} + airflow_debug("%s model: %s, airflow: %s" % (dev_name, model, air_flow)) + if air_flow == "intake": + psu_intake_list.append(psu.get("name")) + elif air_flow == "exhaust": + psu_exhaust_list.append(psu.get("name")) + + airflow_debug("psu_intake_list: %s" % psu_intake_list) + airflow_debug("psu_exhaust_list: %s" % psu_exhaust_list) + + fan_intake_num = len(fan_intake_list) + fan_exhaust_num = len(fan_exhaust_list) + psu_intake_num = len(psu_intake_list) + psu_exhaust_num = len(psu_exhaust_list) + + board_airflow = get_board_air_flow(fan_intake_num, fan_exhaust_num, psu_intake_num, psu_exhaust_num) + airflow_debug("board_airflow: %s" % board_airflow) + ret["board"] = board_airflow + ret_json = json.dumps(ret, ensure_ascii=False, indent=4) + + out_file_dir = os.path.dirname(AIRFLOW_RESULT_FILE) + if len(out_file_dir) != 0: + cmd = "mkdir -p %s" % out_file_dir + exec_os_cmd(cmd) + exec_os_cmd("sync") + with open(AIRFLOW_RESULT_FILE, "w") as fd: + fd.write(ret_json) + exec_os_cmd("sync") + + +if __name__ == '__main__': + debug_init() + airflow_debug("enter main") + generate_airflow() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/hal_fanctrl.py b/platform/broadcom/sonic-platform-modules-micas/common/script/hal_fanctrl.py new file mode 100755 index 000000000000..5a12b88ac463 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/hal_fanctrl.py @@ -0,0 +1,1190 @@ +#!/usr/bin/env python3 +import os +import subprocess +import time +import syslog +import traceback +from plat_hal.interface import interface +from plat_hal.baseutil import baseutil +from algorithm.pid import pid +from algorithm.openloop import openloop +from algorithm.hysteresis import hysteresis + + +SWITCH_TEMP = "SWITCH_TEMP" +INLET_TEMP = "INLET_TEMP" +BOARD_TEMP = "BOARD_TEMP" +OUTLET_TEMP = "OUTLET_TEMP" +CPU_TEMP = "CPU_TEMP" + +FANCTROL_DEBUG_FILE = "/etc/.fancontrol_debug_flag" +# coordination with REBOOT_CAUSE_PARA +OTP_SWITCH_REBOOT_JUDGE_FILE = "/etc/.otp_reboot_flag" +OTP_OTHER_REBOOT_JUDGE_FILE = OTP_SWITCH_REBOOT_JUDGE_FILE + +FANCTROLERROR = 1 +FANCTROLDEBUG = 2 +FANAIRFLOWDEBUG = 4 + +debuglevel = 0 + +F2B_AIR_FLOW = "intake" +B2F_AIR_FLOW = "exhaust" +ONIE_E2_NAME = "ONIE_E2" + +TEMP_REBOOT_CRIT_SWITCH_FLAG = 1 +TEMP_REBOOT_CRIT_OTHER_FLAG = 2 + + +def fancontrol_debug(s): + if FANCTROLDEBUG & debuglevel: + syslog.openlog("FANCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def fancontrol_error(s): + if FANCTROLERROR & debuglevel: + syslog.openlog("FANCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def fanairflow_debug(s): + if FANAIRFLOWDEBUG & debuglevel: + syslog.openlog("AIR_FLOW_MONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def fancontrol_warn(s): + syslog.openlog("FANCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_LOCAL1 | syslog.LOG_WARNING, s) + + +def fancontrol_crit(s): + syslog.openlog("FANCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_LOCAL1 | syslog.LOG_CRIT, s) + + +def fancontrol_alert(s): + syslog.openlog("FANCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_LOCAL1 | syslog.LOG_ALERT, s) + + +def fancontrol_emerg(s): + syslog.openlog("FANCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_LOCAL1 | syslog.LOG_EMERG, s) + + +def exec_os_cmd(cmd): + status, output = subprocess.getstatusoutput(cmd) + if status: + print(output) + return status, output + + +def debug_init(): + global debuglevel + try: + with open(FANCTROL_DEBUG_FILE, "r") as fd: + value = fd.read() + debuglevel = int(value) + except Exception: + debuglevel = 0 + + +error_temp = -9999 # get temp error +invalid_temp = -10000 # get temp invalid +PRE_FAN_NOK_UNKNOWN = "UNKNOWN" + + +class DevFan(object): + + def __init__(self, name, hal_interface): + self.__name = name + self.origin_name = None + self.display_name = None + self.air_flow = None + self.air_flow_inconsistent = False + self.int_case = hal_interface + + @property + def name(self): + return self.__name + + def get_fan_rotor_number(self): + return self.int_case.get_fan_rotor_number(self.name) + + def get_fan_presence(self): + return self.int_case.get_fan_presence(self.name) + + def get_fan_rotor_status(self, rotor_name): + return self.int_case.get_fan_rotor_status(self.name, rotor_name) + + def get_fan_fru_info(self): + return self.int_case.get_fan_fru_info(self.name) + + @property + def na_ret(self): + return self.int_case.na_ret + + def update_fru_info(self): + try: + dic = self.get_fan_fru_info() + self.origin_name = dic["PN"] + self.air_flow = dic["AirFlow"] + self.display_name = dic["DisplayName"] + except Exception as e: + fanairflow_debug("update %s fru info error, msg: %s" % (self.name, str(e))) + self.origin_name = self.na_ret + self.air_flow = self.na_ret + self.display_name = self.na_ret + + +class DevPsu(object): + + def __init__(self, name, hal_interface): + self.__name = name + self.origin_name = None + self.display_name = None + self.air_flow = None + self.air_flow_inconsistent = False + self.int_case = hal_interface + + @property + def name(self): + return self.__name + + def get_psu_fru_info(self): + return self.int_case.get_psu_fru_info(self.name) + + @property + def na_ret(self): + return self.int_case.na_ret + + def update_fru_info(self): + try: + dic = self.get_psu_fru_info() + self.origin_name = dic["PN"] + self.air_flow = dic["AirFlow"] + self.display_name = dic["DisplayName"] + except Exception as e: + fanairflow_debug("update %s fru info error, msg: %s" % (self.name, str(e))) + self.origin_name = self.na_ret + self.air_flow = self.na_ret + self.display_name = self.na_ret + + +class fancontrol(object): + __int_case = None + + __pwm = 0x80 + + def __init__(self): + self.int_case = interface() + self.__config = baseutil.get_monitor_config() + self.__pid_config = self.__config["pid"] + self.__hyst_config = self.__config.get("hyst", {}) + self.__temps_threshold_config = self.__config["temps_threshold"] + for temp_threshold in self.__temps_threshold_config.values(): + temp_threshold['temp'] = 0 + temp_threshold['fail_num'] = 0 + temp_threshold['warning_num'] = 0 # temp warning times + temp_threshold['critical_num'] = 0 # temp critical times + temp_threshold['emergency_num'] = 0 # temp emergency times + temp_threshold.setdefault('ignore_threshold', 0) # default temp threshold on + temp_threshold.setdefault('invalid', invalid_temp) + temp_threshold.setdefault('error', error_temp) + + self.__otp_reboot_judge_file_config = self.__config.get("otp_reboot_judge_file", None) + if self.__otp_reboot_judge_file_config is None: + self.__otp_switch_reboot_judge_file = OTP_SWITCH_REBOOT_JUDGE_FILE + self.__otp_other_reboot_judge_file = OTP_OTHER_REBOOT_JUDGE_FILE + else: + self.__otp_switch_reboot_judge_file = self.__otp_reboot_judge_file_config.get( + "otp_switch_reboot_judge_file", OTP_SWITCH_REBOOT_JUDGE_FILE) + self.__otp_other_reboot_judge_file = self.__otp_reboot_judge_file_config.get( + "otp_other_reboot_judge_file", OTP_OTHER_REBOOT_JUDGE_FILE) + + self.__fan_rotor_error_num = {} + self.__fan_present_status = {} # {"FAN1":0, "FAN2":1...} 1:present, 0:absent + self.__fan_rotate_status = {} # {"FAN1":0, "FAN2":1...} 1:OK, 0:NOT OK + self.__fan_repair_flag = {} # {"FAN1":0, "FAN2":1...} 1:repair, 0:give up + fan_num = self.get_fan_total_number() + for i in range(fan_num): + fan_name = "FAN" + str(i + 1) + self.__fan_present_status[fan_name] = 1 # present + self.__fan_rotate_status[fan_name] = 1 # OK + self.__fan_repair_flag[fan_name] = 1 # repair + rotor_num = self.get_rotor_number(fan_name) + tmp_fan = {} + for j in range(rotor_num): + rotor_name = "Rotor" + str(j + 1) + tmp_fan[rotor_name] = 0 # not error + self.__fan_rotor_error_num[fan_name] = tmp_fan + + self.__fancontrol_para = self.__config["fancontrol_para"] + self.__interval = self.__fancontrol_para.get("interval", 5) + self.__fan_status_interval = self.__fancontrol_para.get("fan_status_interval", 0) + self.__max_pwm = self.__fancontrol_para.get("max_pwm", 0xff) + self.__min_pwm = self.__fancontrol_para.get("min_pwm", 0x80) + self.__abnormal_pwm = self.__fancontrol_para.get("abnormal_pwm", 0xbb) + self.__warning_pwm = self.__fancontrol_para.get("warning_pwm", 0xff) + self.__temp_invalid_pid_pwm = self.__fancontrol_para.get("temp_invalid_pid_pwm", 0x80) + self.__temp_error_pid_pwm = self.__fancontrol_para.get("temp_error_pid_pwm", 0x80) + self.__temp_fail_num = self.__fancontrol_para.get("temp_fail_num", 3) + self.__check_temp_fail = self.__fancontrol_para.get("check_temp_fail", []) + self.__temp_warning_num = self.__fancontrol_para.get("temp_warning_num", 3) + self.__temp_critical_num = self.__fancontrol_para.get("temp_critical_num", 3) + self.__temp_emergency_num = self.__fancontrol_para.get("temp_emergency_num", 3) + self.__temp_warning_countdown = self.__fancontrol_para.get("temp_warning_countdown", 60) + self.__temp_critical_countdown = self.__fancontrol_para.get("temp_critical_countdown", 60) + self.__temp_emergency_countdown = self.__fancontrol_para.get("temp_emergency_countdown", 60) + self.__rotor_error_count = self.__fancontrol_para.get("rotor_error_count", 6) + self.__inlet_mac_diff = self.__fancontrol_para.get("inlet_mac_diff", 50) + self.__check_crit_reboot_flag = self.__fancontrol_para.get("check_crit_reboot_flag", 1) + self.__check_emerg_reboot_flag = self.__fancontrol_para.get("check_emerg_reboot_flag", 1) + self.__check_crit_reboot_num = self.__fancontrol_para.get("check_crit_reboot_num", 3) + self.__check_crit_sleep_time = self.__fancontrol_para.get("check_crit_sleep_time", 20) + self.__check_emerg_reboot_num = self.__fancontrol_para.get("check_emerg_reboot_num", 3) + self.__check_emerg_sleep_time = self.__fancontrol_para.get("check_emerg_sleep_time", 20) + self.__check_temp_emergency = self.__fancontrol_para.get("check_temp_emergency", 0) + self.__check_temp_critical = self.__fancontrol_para.get("check_temp_critical", 1) + self.__check_temp_warning = self.__fancontrol_para.get("check_temp_warning", 1) + self.__check_temp_emergency_reboot = self.__fancontrol_para.get("check_temp_emergency_reboot", []) + self.__psu_absent_fullspeed_num = self.__fancontrol_para.get("psu_absent_fullspeed_num", 1) + self.__fan_absent_fullspeed_num = self.__fancontrol_para.get("fan_absent_fullspeed_num", 1) + self.__rotor_error_fullspeed_num = self.__fancontrol_para.get("rotor_error_fullspeed_num", 1) + self.__psu_fan_control = self.__fancontrol_para.get("psu_fan_control", 1) # default control psu fan + self.__fan_plug_in_pwm = self.__fancontrol_para.get("fan_plug_in_pwm", 0x80) + self.__fan_plug_in_default_countdown = self.__fancontrol_para.get("fan_plug_in_default_countdown", 0) + self.__deal_fan_error_policy = self.__fancontrol_para.get("deal_fan_error", 0) + self.__deal_fan_error_conf = self.__fancontrol_para.get("deal_fan_error_conf", {}) + self.__deal_fan_error_default_countdown = self.__deal_fan_error_conf.get("countdown", 0) + + self.__deal_all_fan_error_method_flag = self.__fancontrol_para.get("deal_all_fan_error_method_flag", 0) + if self.__deal_all_fan_error_method_flag: + self.__all_fan_error_switch_temp_critical_temp = self.__fancontrol_para.get("all_fan_error_switch_temp_critical_temp", 100) + self.__all_fan_error_recover_log = self.__fancontrol_para.get("all_fan_error_recover_log", "Reboot the system.") + self.__all_fan_error_recover_cmd = self.__fancontrol_para.get("all_fan_error_recover_cmd", "/sbin/reboot") + self.__all_fan_error_check_crit_reboot_num = self.__fancontrol_para.get("all_fan_error_check_crit_reboot_num", 3) + self.__all_fan_error_check_crit_sleep_time = self.__fancontrol_para.get("all_fan_error_check_crit_sleep_time", 20) + + self.__warning_countdown = 0 # temp warning flag for normal fancontrol + self.__critical_countdown = 0 # temp critical flag for normal fancontrol + self.__emergency_countdown = 0 # temp emergency flag for normal fancontrol + self.__fan_plug_in_countdown = 0 # fan plug in flag for normal fancontrol + self.__deal_fan_error_countdown = 0 + self.__fan_absent_num = 0 + self.__fan_nok_num = 0 + self.__pre_fan_nok = PRE_FAN_NOK_UNKNOWN + self.openloop = openloop() + self.pid = pid() + self.hyst = hysteresis() + self.__pwm = self.__min_pwm + + self.__board_air_flow = "" + self.__fan_air_flow_monitor = self.__fancontrol_para.get("fan_air_flow_monitor", 0) + self.__psu_air_flow_monitor = self.__fancontrol_para.get("psu_air_flow_monitor", 0) + self.__air_flow_correct_fan_pwm = self.__fancontrol_para.get("air_flow_correct_fan_pwm", 0xff) + self.__air_flow_correct_psu_pwm = self.__fancontrol_para.get("air_flow_correct_psu_pwm", 0xff) + self.__air_flow_error_fan_pwm = self.__fancontrol_para.get("air_flow_error_fan_pwm", 0) + self.__air_flow_error_psu_pwm = self.__fancontrol_para.get("air_flow_error_psu_pwm", 0) + self.fan_air_flow_inconsistent_flag = False + self.psu_air_flow_inconsistent_flag = False + self.air_flow_inconsistent_flag = False + self.fan_obj_list = [] + self.psu_obj_list = [] + + @property + def na_ret(self): + return self.int_case.na_ret + + def get_onie_e2_obj(self, name): + return self.int_case.get_onie_e2_obj(name) + + @property + def board_air_flow(self): + air_flow_tuple = (F2B_AIR_FLOW, B2F_AIR_FLOW) + if self.__board_air_flow not in air_flow_tuple: + self.__board_air_flow = self.int_case.get_device_airflow(ONIE_E2_NAME) + fanairflow_debug("board_air_flow: %s" % self.__board_air_flow) + return self.__board_air_flow + + @property + def fan_air_flow_monitor(self): + return self.__fan_air_flow_monitor + + @property + def psu_air_flow_monitor(self): + return self.__psu_air_flow_monitor + + @property + def air_flow_correct_fan_pwm(self): + return self.__air_flow_correct_fan_pwm + + @property + def air_flow_correct_psu_pwm(self): + return self.__air_flow_correct_psu_pwm + + @property + def air_flow_error_fan_pwm(self): + return self.__air_flow_error_fan_pwm + + @property + def air_flow_error_psu_pwm(self): + return self.__air_flow_error_psu_pwm + + def get_para(self, t): + para = self.__pid_config.get(t) + return para + + def update_over_temp_threshold_num(self): + for temp_threshold in self.__temps_threshold_config.values(): + if temp_threshold['ignore_threshold']: + continue + emergency_threshold = temp_threshold.get('emergency', None) + critical_threshold = temp_threshold.get('critical', None) + warning_threshold = temp_threshold.get('warning', None) + fancontrol_debug("%s warning = %s, critical = %s, emergency = %s" % + (temp_threshold['name'], warning_threshold, critical_threshold, emergency_threshold)) + + if emergency_threshold is not None and temp_threshold['temp'] >= emergency_threshold: + temp_threshold['emergency_num'] += 1 + else: + temp_threshold['emergency_num'] = 0 + + if critical_threshold is not None and temp_threshold['temp'] >= critical_threshold: + temp_threshold['critical_num'] += 1 + else: + temp_threshold['critical_num'] = 0 + + if warning_threshold is not None and temp_threshold['temp'] >= warning_threshold: + temp_threshold['warning_num'] += 1 + else: + temp_threshold['warning_num'] = 0 + + fancontrol_debug("%s warning_num = %d, critical_num = %d, emergency_num = %d" % + (temp_threshold['name'], temp_threshold['warning_num'], temp_threshold['critical_num'], temp_threshold.get("emergency_num"))) + + def get_monitor_temp(self): + sensorlist = self.int_case.get_temp_info() + + for temp_threshold in self.__temps_threshold_config.values(): + sensor = sensorlist.get(temp_threshold['name']) + if sensor["Value"] is None or int(sensor["Value"]) == self.int_case.error_ret: + temp_threshold['fail_num'] += 1 + fancontrol_error("get %s failed, fail_num = %d" % (temp_threshold['name'], temp_threshold['fail_num'])) + else: + temp_threshold['fail_num'] = 0 + temp_threshold.setdefault('fix', 0) + temp_threshold['temp'] = sensor["Value"] + temp_threshold['fix'] + fancontrol_debug("%s = %d" % (temp_threshold['name'], temp_threshold['temp'])) + self.update_over_temp_threshold_num() + + def is_temp_warning(self): + warning_flag = False + for temp_threshold in self.__temps_threshold_config.values(): + if temp_threshold['ignore_threshold']: + continue + if temp_threshold['warning_num'] >= self.__temp_warning_num: + warning_flag = True + fancontrol_warn("%%FANCONTROL-4-TEMP_HIGH: %s temperature %sC is larger than warning threshold %sC." % + (temp_threshold['name'], temp_threshold['temp'], temp_threshold.get('warning'))) + return warning_flag + + def checkTempWarning(self): + try: + if self.is_temp_warning(): + self.__warning_countdown = self.__temp_warning_countdown + fancontrol_debug("temp is over warning") + return True + if self.__warning_countdown > 0: + self.__warning_countdown -= 1 + return False + except Exception as e: + fancontrol_error("%%policy: checkTempWarning failed") + fancontrol_error(str(e)) + return False + + def checkTempWarningCountdown(self): + if self.__warning_countdown > 0: + return True + return False + + def is_temp_critical(self): + critical_flag = False + for temp_threshold in self.__temps_threshold_config.values(): + temp_threshold['critical_flag'] = False + if temp_threshold['ignore_threshold']: + continue + if temp_threshold['critical_num'] >= self.__temp_critical_num: + critical_flag = True + temp_threshold['critical_flag'] = True + fancontrol_crit("%%FANCONTROL-2-TEMP_HIGH: %s temperature %sC is larger than critical threshold %sC." % + (temp_threshold['name'], temp_threshold['temp'], temp_threshold.get('critical'))) + return critical_flag + + def checkTempCritical(self): + try: + if self.is_temp_critical(): + self.__critical_countdown = self.__temp_critical_countdown + fancontrol_debug("temp is over critical") + return True + if self.__critical_countdown > 0: + self.__critical_countdown -= 1 + return False + except Exception as e: + fancontrol_error("%%policy: checkTempCrit failed") + fancontrol_error(str(e)) + return False + + def is_temp_emergency(self): + emergency_flag = False + for temp_threshold in self.__temps_threshold_config.values(): + temp_threshold['emergency_flag'] = False + if temp_threshold['ignore_threshold']: + continue + if temp_threshold['emergency_num'] >= self.__temp_emergency_num: + emergency_flag = True + temp_threshold['emergency_flag'] = True + fancontrol_alert("%%FANCONTROL-1-TEMP_HIGH: %s temperature %sC is larger than emergency threshold %sC." % + (temp_threshold['name'], temp_threshold['temp'], temp_threshold.get('emergency'))) + return emergency_flag + + def checkTempEmergency(self): + try: + if self.is_temp_emergency(): + self.__emergency_countdown = self.__temp_emergency_countdown + fancontrol_debug("temp is over emergency") + return True + if self.__emergency_countdown > 0: + self.__emergency_countdown -= 1 + return False + except Exception as e: + fancontrol_error("%%policy: checkTempEmergency failed") + fancontrol_error(str(e)) + return False + + def checkTempCriticalCountdown(self): + if self.__critical_countdown > 0: + return True + return False + + def checkTempEmergencyCountdown(self): + if self.__emergency_countdown > 0: + return True + return False + + def checkTempRebootCrit(self): + try: + if self.is_temp_critical(): + temp_dict = dict(self.__temps_threshold_config) + tmp = temp_dict.get(SWITCH_TEMP) + if tmp['critical_flag'] is True: + fancontrol_debug("switch temp is over reboot critical") + return TEMP_REBOOT_CRIT_SWITCH_FLAG + del temp_dict[SWITCH_TEMP] + for temp_items in temp_dict.values(): + if temp_items['ignore_threshold']: + continue + if temp_items['critical_flag'] is False: + return 0 + + fancontrol_debug("other temp is over reboot critical") + return TEMP_REBOOT_CRIT_OTHER_FLAG + except Exception as e: + fancontrol_error("%%policy: checkTempRebootCrit failed") + fancontrol_error(str(e)) + return 0 + + def checkCritReboot(self): + try: + reboot_flag = self.checkTempRebootCrit() + if reboot_flag > 0: + self.set_all_fan_speed_pwm(self.__max_pwm) + for i in range(self.__check_crit_reboot_num): + time.sleep(self.__check_crit_sleep_time) + self.get_monitor_temp() + reboot_flag = self.checkTempRebootCrit() + if reboot_flag > 0: + fancontrol_emerg("%%FANCONTROL-0-TEMP_EMERG: The temperature of device over reboot critical value lasts for %d seconds." % + (self.__check_crit_sleep_time * (i + 1))) + continue + fancontrol_debug("The temperature of device is not over reboot critical value.") + break + if reboot_flag > 0: + fancontrol_emerg( + "%%FANCONTROL-0-TEMP_EMERG: The temperature of device over reboot critical value, system is going to reboot now.") + for temp_threshold in self.__temps_threshold_config.values(): + fancontrol_emerg( + "%%FANCONTROL-TEMP_EMERG: %s temperature: %sC." % + (temp_threshold['name'], temp_threshold['temp'])) + if reboot_flag == TEMP_REBOOT_CRIT_SWITCH_FLAG: + create_judge_file = "touch %s" % self.__otp_switch_reboot_judge_file + else: + create_judge_file = "touch %s" % self.__otp_other_reboot_judge_file + exec_os_cmd(create_judge_file) + exec_os_cmd("sync") + time.sleep(3) + exec_os_cmd("/sbin/reboot") + except Exception as e: + fancontrol_error("%%policy: checkCritReboot failed") + fancontrol_error(str(e)) + + def checkTempRebootEmerg(self): + try: + if self.is_temp_emergency(): + temp_emerg_reboot_flag = False + for temp_list in self.__check_temp_emergency_reboot: + for temp in temp_list: + tmp = self.__temps_threshold_config.get(temp) + if tmp['emergency_flag'] is False: + fancontrol_debug("temp_list %s, temp: %s not emergency" % (temp_list, temp)) + temp_emerg_reboot_flag = False + break + temp_emerg_reboot_flag = True + if temp_emerg_reboot_flag is True: + fancontrol_debug("temp_list %s, all temp is over emergency reboot" % temp_list) + return True + except Exception as e: + fancontrol_error("%%policy: checkTempRebootEmerg failed") + fancontrol_error(str(e)) + return False + + def checkEmergReboot(self): + try: + reboot_flag = False + if self.checkTempRebootEmerg() is True: + self.set_all_fan_speed_pwm(self.__max_pwm) + for i in range(self.__check_emerg_reboot_num): + time.sleep(self.__check_emerg_sleep_time) + self.get_monitor_temp() + if self.checkTempRebootEmerg() is True: + fancontrol_emerg("%%FANCONTROL-0-TEMP_EMERG: The temperature of device over reboot emergency value lasts for %d seconds." % + (self.__check_emerg_sleep_time * (i + 1))) + reboot_flag = True + continue + fancontrol_debug("The temperature of device is not over reboot emergency value.") + reboot_flag = False + break + if reboot_flag is True: + fancontrol_emerg( + "%%FANCONTROL-0-TEMP_EMERG: The temperature of device over reboot emergency value, system is going to reboot now.") + for temp_threshold in self.__temps_threshold_config.values(): + fancontrol_emerg( + "%%FANCONTROL-0-TEMP_EMERG: %s temperature: %sC." % + (temp_threshold['name'], temp_threshold['temp'])) + create_judge_file = "touch %s" % OTP_SWITCH_REBOOT_JUDGE_FILE + exec_os_cmd(create_judge_file) + exec_os_cmd("sync") + time.sleep(3) + exec_os_cmd("/sbin/reboot") + except Exception as e: + fancontrol_error("%%policy: checkEmergReboot failed") + fancontrol_error(str(e)) + + def all_fan_error_checkTempRebootCrit(self): + try: + temp_dict = dict(self.__temps_threshold_config) + tmp = temp_dict.get(SWITCH_TEMP) + switch_temp_value = tmp['temp'] + if switch_temp_value >= self.__all_fan_error_switch_temp_critical_temp: + fancontrol_debug("all fan error, switch temp[%d] is over critical[%d]." + % (switch_temp_value, self.__all_fan_error_switch_temp_critical_temp)) + return True + except Exception as e: + fancontrol_error("%%policy: all_fan_error_checkTempRebootCrit failed") + fancontrol_error(str(e)) + return False + + def all_fan_error_checkCritReboot(self): + try: + reboot_flag = self.all_fan_error_checkTempRebootCrit() + if reboot_flag > 0: + self.set_all_fan_speed_pwm(self.__max_pwm) + for i in range(self.__all_fan_error_check_crit_reboot_num): + time.sleep(self.__all_fan_error_check_crit_sleep_time) + self.get_monitor_temp() + reboot_flag = self.all_fan_error_checkTempRebootCrit() + if reboot_flag > 0: + fancontrol_emerg("%%FANCONTROL-0-TEMP_EMERG: The temperature of device over reboot critical value lasts for %d seconds." % + (self.__all_fan_error_check_crit_sleep_time * (i + 1))) + continue + else: + fancontrol_debug("The temperature of device is not over reboot critical value.") + break + if reboot_flag > 0: + fancontrol_emerg("%%FANCONTROL-0-TEMP_EMERG: The temperature of device over reboot critical value.") + fancontrol_emerg(self.__all_fan_error_recover_log) + exec_os_cmd("sync") + time.sleep(3) + exec_os_cmd(self.__all_fan_error_recover_cmd) + except Exception as e: + fancontrol_error("%%policy: all_fan_error_checkCritReboot failed") + fancontrol_error(str(e)) + + def get_fan_total_number(self): + return self.int_case.get_fan_total_number() + + def get_rotor_number(self, fan_name): + return self.int_case.get_fan_rotor_number(fan_name) + + def get_fan_presence(self, fan_name): + return self.int_case.get_fan_presence(fan_name) + + def get_fan_rotor_status(self, fan_name, rotor_name): + return self.int_case.get_fan_rotor_status(fan_name, rotor_name) + + def get_psu_total_number(self): + return self.int_case.get_psu_total_number() + + def get_psu_presence(self, psu_name): + return self.int_case.get_psu_presence(psu_name) + + def get_psu_input_output_status(self, psu_name): + return self.int_case.get_psu_input_output_status(psu_name) + + def checkFanPresence(self): + absent_num = 0 + + fan_num = self.get_fan_total_number() + for i in range(fan_num): + fan_name = "FAN" + str(i + 1) + rotor_num = self.get_rotor_number(fan_name) + tmp_fan = self.__fan_rotor_error_num.get(fan_name) + status = self.get_fan_presence(fan_name) + if status is False: + absent_num = absent_num + 1 + self.__fan_present_status[fan_name] = 0 + fancontrol_debug("%s absent" % fan_name) + else: + if self.__fan_present_status[fan_name] == 0: # absent -> present + self.__pre_fan_nok = PRE_FAN_NOK_UNKNOWN + self.__fan_plug_in_countdown = self.__fan_plug_in_default_countdown + self.__fan_repair_flag[fan_name] = 1 + for j in range(rotor_num): + rotor_name = "Rotor" + str(j + 1) + tmp_fan[rotor_name] = 0 + self.__fan_present_status[fan_name] = 1 + fancontrol_debug("%s presence" % fan_name) + return absent_num + + def checkFanRotorStatus(self): + err_num = 0 + self.__fan_nok_num = 0 + fan_num = self.get_fan_total_number() + for i in range(fan_num): + fan_name = "FAN" + str(i + 1) + rotor_num = self.get_rotor_number(fan_name) + tmp_fan = self.__fan_rotor_error_num.get(fan_name) + fan_rotor_err_cnt = 0 + for j in range(rotor_num): + rotor_name = "Rotor" + str(j + 1) + status = self.get_fan_rotor_status(fan_name, rotor_name) + if status is True: + tmp_fan[rotor_name] = 0 + fancontrol_debug("%s %s ok" % (fan_name, rotor_name)) + else: + tmp_fan[rotor_name] += 1 + if tmp_fan[rotor_name] >= self.__rotor_error_count: + err_num = err_num + 1 + fan_rotor_err_cnt += 1 + fancontrol_debug("%s %s error" % (fan_name, rotor_name)) + fancontrol_debug("%s %s error %d times" % (fan_name, rotor_name, tmp_fan[rotor_name])) + if fan_rotor_err_cnt == 0: + self.__fan_rotate_status[fan_name] = 1 # FAN is ok + else: + self.__fan_rotate_status[fan_name] = 0 # FAN is not ok + self.__fan_nok_num += 1 + fancontrol_debug("fan not ok number:%d." % self.__fan_nok_num) + return err_num + + def checkPsuPresence(self): + absent_num = 0 + psu_num = self.get_psu_total_number() + for i in range(psu_num): + psu_name = "PSU" + str(i + 1) + status = self.get_psu_presence(psu_name) + if status is False: + absent_num = absent_num + 1 + fancontrol_debug("%s absent" % psu_name) + else: + fancontrol_debug("%s presence" % psu_name) + return absent_num + + def checkPsuStatus(self): + err_num = 0 + psu_num = self.get_psu_total_number() + for i in range(psu_num): + psu_name = "PSU" + str(i + 1) + status = self.get_psu_input_output_status(psu_name) + if status is False: + err_num = err_num + 1 + fancontrol_debug("%s error" % psu_name) + else: + fancontrol_debug("%s ok" % psu_name) + return err_num + + def checkDevError(self): + pwm = self.__min_pwm + switchtemp = self.__temps_threshold_config.get(SWITCH_TEMP)['temp'] + inlettemp = self.__temps_threshold_config.get(INLET_TEMP)['temp'] + temp_diff = abs(switchtemp - inlettemp) + fancontrol_debug("|switchtemp - inlettemp| = %d" % temp_diff) + if temp_diff >= self.__inlet_mac_diff: + fancontrol_debug("temp_diff is over than inlet_mac_diff(%d)" % self.__inlet_mac_diff) + if self.__pwm > self.__abnormal_pwm: + pwm = self.__max_pwm + else: + pwm = self.__abnormal_pwm + return pwm + + def checktempfail(self): + pwm = self.__min_pwm + for temp in self.__check_temp_fail: + temp_name = temp.get("temp_name") + temp_fail_num = self.__temps_threshold_config.get(temp_name)['fail_num'] + if temp_fail_num >= self.__temp_fail_num: + pwm = self.__abnormal_pwm + fancontrol_debug("%s temp_fail_num = %d" % (temp_name, temp_fail_num)) + fancontrol_debug("self.__temp_fail_num = %d" % self.__temp_fail_num) + return pwm + + def abnormal_check(self): + pwm_list = [] + pwm_min = self.__min_pwm + pwm_list.append(pwm_min) + + self.__fan_absent_num = self.checkFanPresence() + if self.__fan_absent_num >= self.__fan_absent_fullspeed_num: + fan_absent_pwm = self.__max_pwm + pwm_list.append(fan_absent_pwm) + fancontrol_debug("fan_absent_pwm = 0x%x" % fan_absent_pwm) + + rotor_err_num = self.checkFanRotorStatus() + if rotor_err_num >= self.__rotor_error_fullspeed_num: + rotor_err_pwm = self.__max_pwm + pwm_list.append(rotor_err_pwm) + fancontrol_debug("rotor_err_pwm = 0x%x" % rotor_err_pwm) + + if self.__deal_all_fan_error_method_flag: + fan_num = self.get_fan_total_number() + # all fan absent or fail + if (self.__fan_absent_num == fan_num) or (self.__fan_nok_num == fan_num): + fancontrol_debug("All fan error or absent.") + self.all_fan_error_checkCritReboot() + + if self.__check_temp_emergency == 1: + status = self.checkTempEmergency() + if status is True: + over_emerg_pwm = self.__max_pwm + pwm_list.append(over_emerg_pwm) + fancontrol_debug("over_emerg_pwm = 0x%x" % over_emerg_pwm) + # do reset check + if self.__check_emerg_reboot_flag == 1: + self.checkEmergReboot() + else: + if self.checkTempEmergencyCountdown() is True: # temp lower than emergency in 5 min + over_emerg_countdown_pwm = self.__max_pwm + pwm_list.append(over_emerg_countdown_pwm) + fancontrol_debug("TempEmergencyCountdown: %d, over_emerg_countdown_pwm = 0x%x" % + (self.__emergency_countdown, over_emerg_countdown_pwm)) + + if self.__check_temp_critical == 1: + status = self.checkTempCritical() + if status is True: + over_crit_pwm = self.__max_pwm + pwm_list.append(over_crit_pwm) + fancontrol_debug("over_crit_pwm = 0x%x" % over_crit_pwm) + # do reset check + if self.__check_crit_reboot_flag == 1: + self.checkCritReboot() + else: + if self.checkTempCriticalCountdown() is True: # temp lower than critical in 5 min + over_crit_countdown_pwm = self.__max_pwm + pwm_list.append(over_crit_countdown_pwm) + fancontrol_debug("TempCriticalCountdown: %d, over_crit_countdown_pwm = 0x%x" % + (self.__critical_countdown, over_crit_countdown_pwm)) + + if self.__check_temp_warning == 1: + status = self.checkTempWarning() + if status is True: + over_warn_pwm = self.__warning_pwm + pwm_list.append(over_warn_pwm) + fancontrol_debug("over_warn_pwm = 0x%x" % over_warn_pwm) + else: + if self.checkTempWarningCountdown() is True: # temp lower than warning in 5 min + over_warn_countdown_pwm = self.__warning_pwm + pwm_list.append(over_warn_countdown_pwm) + fancontrol_debug("TempWarningCountdown: %d, over_warn_countdown_pwm = 0x%x" % + (self.__warning_countdown, over_warn_countdown_pwm)) + + psu_absent_num = self.checkPsuPresence() + if psu_absent_num >= self.__psu_absent_fullspeed_num: + psu_absent_pwm = self.__max_pwm + pwm_list.append(psu_absent_pwm) + fancontrol_debug("psu_absent_pwm = 0x%x" % psu_absent_pwm) + + dev_err_pwm = self.checkDevError() + pwm_list.append(dev_err_pwm) + fancontrol_debug("dev_err_pwm = 0x%x" % dev_err_pwm) + + temp_fail_pwm = self.checktempfail() + pwm_list.append(temp_fail_pwm) + fancontrol_debug("temp_fail_pwm = 0x%x" % temp_fail_pwm) + + pwm = max(pwm_list) + return pwm + + def get_error_fan(self): + fan_num = self.get_fan_total_number() + for i in range(fan_num): + fan_name = "FAN" + str(i + 1) + if self.__fan_rotate_status[fan_name] == 0: + return fan_name + return None + + def fan_error_update_pwm(self, fan_pwm_dict): + try: + fancontrol_debug("enter deal fan error policy") + ori_fan_pwm_dict = fan_pwm_dict.copy() + + err_fan_name = self.get_error_fan() + if err_fan_name is None: + fancontrol_debug("fan name is None, do nothing.") + return ori_fan_pwm_dict + + if self.__fan_repair_flag[err_fan_name] == 0: + fancontrol_debug("%s already repaired, do nothing." % err_fan_name) + return ori_fan_pwm_dict + + if self.__pre_fan_nok != err_fan_name: + fancontrol_debug( + "not ok fan change from %s to %s, update countdown." % + (self.__pre_fan_nok, err_fan_name)) + self.__deal_fan_error_countdown = self.__deal_fan_error_default_countdown + if self.__pre_fan_nok != PRE_FAN_NOK_UNKNOWN: + fancontrol_debug( + "%s repaire success, %s NOT OK, try to repaire." % + (self.__pre_fan_nok, err_fan_name)) + self.__fan_repair_flag[self.__pre_fan_nok] = 0 + self.__pre_fan_nok = err_fan_name + + if self.__deal_fan_error_countdown > 0: + self.__deal_fan_error_countdown -= 1 + fancontrol_debug("%s repaire, countdown %d." % (err_fan_name, self.__deal_fan_error_countdown)) + + if self.__deal_fan_error_countdown == 0: + self.__fan_repair_flag[err_fan_name] = 0 + fancontrol_debug("%s set repaire fail flag, use origin pwm." % err_fan_name) + return ori_fan_pwm_dict + + fan_err_pwm_conf_list = self.__deal_fan_error_conf[err_fan_name] + for item in fan_err_pwm_conf_list: + fan_pwm_dict[item["name"]] = item["pwm"] + fancontrol_debug("fan pwm update, fan pwm dict:%s" % fan_pwm_dict) + + return fan_pwm_dict + except Exception as e: + fancontrol_error("%%policy: deal_fan_error raise Exception:%s" % str(e)) + self.__pre_fan_nok = PRE_FAN_NOK_UNKNOWN + return ori_fan_pwm_dict + + def get_fan_pwm_dict(self, default_pwm): + fan_pwm_dict = {} + fan_num = self.get_fan_total_number() + for i in range(fan_num): + fan_name = "FAN" + str(i + 1) + fan_pwm_dict[fan_name] = default_pwm + if self.__deal_fan_error_policy: + if self.__fan_absent_num == 0 and self.__fan_nok_num == 1: + fan_pwm_dict = self.fan_error_update_pwm(fan_pwm_dict) + else: + if self.__pre_fan_nok != PRE_FAN_NOK_UNKNOWN and self.__fan_rotate_status[self.__pre_fan_nok] == 1: + fancontrol_debug("%s repaire success." % (self.__pre_fan_nok)) + self.__fan_repair_flag[self.__pre_fan_nok] = 0 + self.__pre_fan_nok = PRE_FAN_NOK_UNKNOWN + return fan_pwm_dict + + def get_psu_pwm_dict(self, default_pwm): + psu_pwm_dict = {} + psu_num = self.get_psu_total_number() + for i in range(psu_num): + psu_name = "PSU" + str(i + 1) + psu_pwm_dict[psu_name] = default_pwm + return psu_pwm_dict + + def check_board_air_flow(self): + board_air_flow = self.board_air_flow + air_flow_tuple = (F2B_AIR_FLOW, B2F_AIR_FLOW) + if board_air_flow not in air_flow_tuple: + fanairflow_debug("get board air flow error, value [%s]" % board_air_flow) + return False + fanairflow_debug("board air flow check ok: %s" % board_air_flow) + return True + + def check_fan_air_flow(self): + if self.fan_air_flow_monitor: + fanairflow_debug("open air flow monitor, check fan air flow") + ret = self.check_board_air_flow() + if ret is False: + fanairflow_debug("get board air flow error, set fan_air_flow_inconsistent_flag False") + self.fan_air_flow_inconsistent_flag = False + return + air_flow_inconsistent_flag_tmp = False + for fan_obj in self.fan_obj_list: + fan_obj.update_fru_info() + fanairflow_debug("%s origin name: [%s], display name: [%s] air flow [%s]" % + (fan_obj.name, fan_obj.origin_name, fan_obj.display_name, fan_obj.air_flow)) + if fan_obj.air_flow == self.na_ret: + fanairflow_debug("%s get air flow failed, set air_flow_inconsistent flag False" % fan_obj.name) + fan_obj.air_flow_inconsistent = False + continue + if fan_obj.air_flow != self.board_air_flow: + fanairflow_debug("%s air flow error, origin name: [%s], display name: [%s], fan air flow [%s], board air flow [%s]" % + (fan_obj.name, fan_obj.origin_name, fan_obj.display_name, fan_obj.air_flow, self.board_air_flow)) + air_flow_inconsistent_flag_tmp = True + fan_obj.air_flow_inconsistent = True + else: + fanairflow_debug("%s air flow check ok, origin name: [%s], display name: [%s], fan air flow: [%s], board air flow: [%s]" % + (fan_obj.name, fan_obj.origin_name, fan_obj.display_name, fan_obj.air_flow, self.board_air_flow)) + fan_obj.air_flow_inconsistent = False + self.fan_air_flow_inconsistent_flag = air_flow_inconsistent_flag_tmp + else: + fanairflow_debug("air flow monitor not open, set fan_air_flow_inconsistent_flag False") + self.fan_air_flow_inconsistent_flag = False + return + + def check_psu_air_flow(self): + if self.psu_air_flow_monitor: + fanairflow_debug("open air flow monitor, check psu air flow") + ret = self.check_board_air_flow() + if ret is False: + fanairflow_debug("get board air flow error, set psu_air_flow_inconsistent_flag False") + self.psu_air_flow_inconsistent_flag = False + return + air_flow_inconsistent_flag_tmp = False + for psu_obj in self.psu_obj_list: + psu_obj.update_fru_info() + fanairflow_debug("%s origin name: [%s], display name: [%s] air flow [%s]" % + (psu_obj.name, psu_obj.origin_name, psu_obj.display_name, psu_obj.air_flow)) + if psu_obj.air_flow == self.na_ret: + fanairflow_debug("%s get air flow failed, set air_flow_inconsistent flag False" % psu_obj.name) + psu_obj.air_flow_inconsistent = False + continue + if psu_obj.air_flow != self.board_air_flow: + fanairflow_debug("%s air flow error, origin name: [%s], display name: [%s], psu air flow [%s], board air flow [%s]" % + (psu_obj.name, psu_obj.origin_name, psu_obj.display_name, psu_obj.air_flow, self.board_air_flow)) + air_flow_inconsistent_flag_tmp = True + psu_obj.air_flow_inconsistent = True + else: + fanairflow_debug("%s air flow check ok, origin name: [%s], display name: [%s], psu air flow: [%s], board air flow: [%s]" % + (psu_obj.name, psu_obj.origin_name, psu_obj.display_name, psu_obj.air_flow, self.board_air_flow)) + psu_obj.air_flow_inconsistent = False + self.psu_air_flow_inconsistent_flag = air_flow_inconsistent_flag_tmp + else: + fanairflow_debug("air flow monitor not open, set psu_air_flow_inconsistent_flag False") + self.psu_air_flow_inconsistent_flag = False + return + + def do_fancontrol(self): + pwm_list = [] + pwm_min = self.__min_pwm + pwm_list.append(pwm_min) + + # first check air flow + self.check_fan_air_flow() + self.check_psu_air_flow() + if self.fan_air_flow_inconsistent_flag is True or self.psu_air_flow_inconsistent_flag is True: + self.air_flow_inconsistent_flag = True + else: + self.air_flow_inconsistent_flag = False + fanairflow_debug("check_air_flow, air_flow_inconsistent_flag: %s" % self.air_flow_inconsistent_flag) + # get_monitor_temp + self.get_monitor_temp() + fancontrol_debug("last_pwm = 0x%x" % self.__pwm) + # openloop + inlettemp = self.__temps_threshold_config.get(INLET_TEMP)['temp'] + linear_value = self.openloop.linear_cacl(inlettemp) + if linear_value is None: + linear_value = self.__min_pwm + pwm_list.append(linear_value) + fancontrol_debug("linear_value = 0x%x" % linear_value) + + curve_value = self.openloop.curve_cacl(inlettemp) + if curve_value is None: + curve_value = self.__min_pwm + pwm_list.append(curve_value) + fancontrol_debug("curve_value = 0x%x" % curve_value) + + # hyst + for hyst_index in self.__hyst_config.values(): + temp_name = hyst_index.get("name") + hyst_flag = hyst_index.get("flag", 0) + if hyst_flag == 0: + fancontrol_debug("%s hyst flag is 0, do nothing" % temp_name) + continue + tmp_temp = int(self.__temps_threshold_config.get(temp_name)['temp']) # make sure temp is int + hyst_value = self.hyst.cacl(temp_name, tmp_temp) + if hyst_value is None: + hyst_value = self.__min_pwm + pwm_list.append(hyst_value) + fancontrol_debug("%s hyst_value = 0x%x" % (temp_name, hyst_value)) + + # pid + for pid_index in self.__pid_config.values(): + temp_name = pid_index.get("name") + pid_flag = pid_index.get("flag", 0) + if pid_flag == 0: + fancontrol_debug("%s pid flag is 0, do nothing" % temp_name) + continue + tmp_temp = self.__temps_threshold_config.get(temp_name)['temp'] + if tmp_temp is not None: + tmp_temp = int(tmp_temp) # make sure temp is int + invalid_temp_val = self.__temps_threshold_config.get(temp_name)['invalid'] + error_temp_val = self.__temps_threshold_config.get(temp_name)['error'] + if tmp_temp == invalid_temp_val: # temp is invalid + temp = None + self.pid.cacl(self.__pwm, temp_name, temp) # temp invalid, PID need to record None + pid_value = self.__temp_invalid_pid_pwm + fancontrol_debug("%s is invalid, pid_value = 0x%x" % (temp_name, pid_value)) + fancontrol_debug("temp = %d, invalid_temp = %d" % (tmp_temp, invalid_temp_val)) + elif tmp_temp == error_temp_val: # temp is error + temp = None + self.pid.cacl(self.__pwm, temp_name, temp) # temp error, PID need to record None + pid_value = self.__temp_error_pid_pwm + fancontrol_debug("%s is error, pid_value = 0x%x" % (temp_name, pid_value)) + fancontrol_debug("temp = %d, error_temp = %d" % (tmp_temp, error_temp_val)) + else: + pid_value = self.pid.cacl(self.__pwm, temp_name, tmp_temp) + else: # temp get failed + pid_value = self.pid.cacl(self.__pwm, temp_name, tmp_temp) + if pid_value is None: + pid_value = self.__min_pwm + pwm_list.append(pid_value) + fancontrol_debug("%s pid_value = 0x%x" % (temp_name, pid_value)) + + # abnormal + abnormal_value = self.abnormal_check() + pwm_list.append(abnormal_value) + fancontrol_debug("abnormal_value = 0x%x" % abnormal_value) + + if self.__fan_plug_in_countdown > 0 and self.__fan_absent_num == 0: + fancontrol_debug("fan plug in countdown %d, set plug in pwm: 0x%x" % + (self.__fan_plug_in_countdown, self.__fan_plug_in_pwm)) + self.__pwm = self.__fan_plug_in_pwm + self.__fan_plug_in_countdown -= 1 + else: + self.__pwm = max(pwm_list) + fancontrol_debug("__pwm = 0x%x\n" % self.__pwm) + if self.air_flow_inconsistent_flag is True: + fanairflow_debug("air flow inconsistent, set all fan speed pwm") + self.set_all_fan_speed_pwm(self.__pwm) + else: + fanairflow_debug("air flow consistent, deal fan error policy") + fan_pwm_dict = self.get_fan_pwm_dict(self.__pwm) + psu_pwm_dict = self.get_psu_pwm_dict(self.__pwm) + self.set_fan_pwm_independent(fan_pwm_dict, psu_pwm_dict) + + def run(self): + start_time = time.time() + while True: + try: + debug_init() + if self.__fan_status_interval > 0 and self.__fan_status_interval < self.__interval: + delta_time = time.time() - start_time + if delta_time >= self.__interval or delta_time < 0: + self.do_fancontrol() + start_time = time.time() + else: + self.checkFanPresence() + time.sleep(self.__fan_status_interval) + else: + self.do_fancontrol() + time.sleep(self.__interval) + except Exception as e: + traceback.print_exc() + fancontrol_error(str(e)) + + def set_all_fan_speed_pwm(self, pwm): + fan_pwm_dict = {} + psu_pwm_dict = {} + fan_num = self.get_fan_total_number() + for i in range(fan_num): + fan_name = "FAN" + str(i + 1) + fan_pwm_dict[fan_name] = pwm + + psu_num = self.get_psu_total_number() + for i in range(psu_num): + psu_name = "PSU" + str(i + 1) + psu_pwm_dict[psu_name] = pwm + self.set_fan_pwm_independent(fan_pwm_dict, psu_pwm_dict) + + def set_fan_pwm_independent(self, fan_pwm_dict, psu_pwm_dict): + if self.air_flow_inconsistent_flag is True: + for psu_obj in self.psu_obj_list: + if psu_obj.air_flow_inconsistent is True: + psu_pwm_dict[psu_obj.name] = self.air_flow_error_psu_pwm + fanairflow_debug("%s air flow error, origin name: [%s], display name: [%s], psu air flow: [%s], board air flow: [%s], set psu pwm: 0x%x" % + (psu_obj.name, psu_obj.origin_name, psu_obj.display_name, psu_obj.air_flow, self.board_air_flow, self.air_flow_error_psu_pwm)) + else: + psu_pwm_dict[psu_obj.name] = self.air_flow_correct_psu_pwm + fanairflow_debug("%s air flow correct, origin name: [%s], display name: [%s], psu air flow: [%s], board air flow: [%s], set psu pwm: 0x%x" % + (psu_obj.name, psu_obj.origin_name, psu_obj.display_name, psu_obj.air_flow, self.board_air_flow, self.air_flow_correct_psu_pwm)) + + for fan_obj in self.fan_obj_list: + if fan_obj.air_flow_inconsistent is True: + fan_pwm_dict[fan_obj.name] = self.air_flow_error_fan_pwm + fanairflow_debug("%s air flow error, origin name: [%s], display name: [%s], fan air flow: [%s], board air flow: [%s], set fan pwm: 0x%x" % + (fan_obj.name, fan_obj.origin_name, fan_obj.display_name, fan_obj.air_flow, self.board_air_flow, self.air_flow_error_fan_pwm)) + else: + fan_pwm_dict[fan_obj.name] = self.air_flow_correct_fan_pwm + fanairflow_debug("%s air flow correct, origin name: [%s], display name: [%s], fan air flow: [%s], board air flow: [%s], set fan pwm: 0x%x" % + (fan_obj.name, fan_obj.origin_name, fan_obj.display_name, fan_obj.air_flow, self.board_air_flow, self.air_flow_correct_fan_pwm)) + fan_num = self.get_fan_total_number() + for i in range(fan_num): + fan_name = "FAN" + str(i + 1) + self.fan_set_speed_pwm_by_name(fan_name, fan_pwm_dict[fan_name]) + if self.__psu_fan_control == 1: + psu_num = self.get_psu_total_number() + for i in range(psu_num): + psu_name = "PSU" + str(i + 1) + self.psu_set_speed_pwm_by_name(psu_name, psu_pwm_dict[psu_name]) + + def fan_set_speed_pwm_by_name(self, fan_name, pwm): + duty = round(pwm * 100 / 255) + rotor_len = self.get_rotor_number(fan_name) + for i in range(rotor_len): + val = self.int_case.set_fan_speed_pwm(fan_name, i + 1, duty) + if val != 0: + fancontrol_error("%s rotor%d: %d" % (fan_name, i + 1, val)) + + def psu_set_speed_pwm_by_name(self, psu_name, pwm): + duty = round(pwm * 100 / 255) + status = self.int_case.set_psu_fan_speed_pwm(psu_name, int(duty)) + if status is not True: + fancontrol_error("set %s speed fail" % psu_name) + + def fan_obj_init(self): + fan_num = self.get_fan_total_number() + for i in range(fan_num): + fan_name = "FAN" + str(i + 1) + fan_obj = DevFan(fan_name, self.int_case) + self.fan_obj_list.append(fan_obj) + fanairflow_debug("fan object initialize success") + + def psu_obj_init(self): + psu_num = self.get_psu_total_number() + for i in range(psu_num): + psu_name = "PSU" + str(i + 1) + psu_obj = DevPsu(psu_name, self.int_case) + self.psu_obj_list.append(psu_obj) + fanairflow_debug("psu object initialize success") + + +if __name__ == '__main__': + debug_init() + fancontrol_debug("enter main") + fan_control = fancontrol() + fan_control.fan_obj_init() + fan_control.psu_obj_init() + fan_control.run() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/hal_ledctrl.py b/platform/broadcom/sonic-platform-modules-micas/common/script/hal_ledctrl.py new file mode 100755 index 000000000000..c21fd3c1f585 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/hal_ledctrl.py @@ -0,0 +1,830 @@ +#!/usr/bin/env python3 +import time +import syslog +import traceback +from plat_hal.interface import interface +from plat_hal.baseutil import baseutil +try: + import abc +except ImportError as error: + raise ImportError(str(error) + " - required module not found") from error + +SWITCH_TEMP = "SWITCH_TEMP" +F2B_AIR_FLOW = "intake" +B2F_AIR_FLOW = "exhaust" +ONIE_E2_NAME = "ONIE_E2" + +# status +STATUS_PRESENT = "PRESENT" +STATUS_ABSENT = "ABSENT" +STATUS_OK = "OK" +STATUS_NOT_OK = "NOT OK" +STATUS_FAILED = "FAILED" +STATUS_UNKNOWN = "UNKNOWN" + +LEDCTROL_DEBUG_FILE = "/etc/.ledcontrol_debug_flag" + +LEDCTROLERROR = 1 +LEDCTROLDEBUG = 2 + +debuglevel = 0 +# led status defined +COLOR_GREEN = 1 +COLOR_AMBER = 2 +COLOR_RED = 3 +LED_STATUS_DICT = {COLOR_GREEN: "green", COLOR_AMBER: "amber", COLOR_RED: "red"} + + +def ledcontrol_debug(s): + if LEDCTROLDEBUG & debuglevel: + syslog.openlog("LEDCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def ledcontrol_error(s): + if LEDCTROLERROR & debuglevel: + syslog.openlog("LEDCONTROL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def air_flow_warn(s): + syslog.openlog("AIR_FLOW_MONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_LOCAL1 | syslog.LOG_WARNING, s) + + +def air_flow_error(s): + syslog.openlog("AIR_FLOW_MONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_LOCAL1 | syslog.LOG_ERR, s) + + +def air_flow_emerg(s): + syslog.openlog("AIR_FLOW_MONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_LOCAL1 | syslog.LOG_EMERG, s) + + +def debug_init(): + global debuglevel + try: + with open(LEDCTROL_DEBUG_FILE, "r") as fd: + value = fd.read() + debuglevel = int(value) + except Exception: + debuglevel = 0 + + +class DevBase(object): + __metaclass__ = abc.ABCMeta + + def __init__(self, name, air_flow_monitor): + self.__name = name + self.__air_flow_monitor = air_flow_monitor + self.present = STATUS_UNKNOWN + self.status = STATUS_UNKNOWN + self.status_summary = STATUS_UNKNOWN + self.origin_name = STATUS_UNKNOWN + self.display_name = STATUS_UNKNOWN + self.air_flow = STATUS_UNKNOWN + self.led_status = COLOR_GREEN + + @property + def name(self): + return self.__name + + @property + def air_flow_monitor(self): + return self.__air_flow_monitor + + @abc.abstractmethod + def get_present(self): + """ + Gets the present status of PSU/FAN + + Returns: + A string, e.g. 'PRESENT, ABSENT, FAILED' + """ + raise NotImplementedError + + @abc.abstractmethod + def get_status(self): + """ + Gets the status of PSU/FAN + + Returns: + A string, e.g. 'OK, NOT OK, FAILED' + """ + raise NotImplementedError + + @abc.abstractmethod + def update_dev_info(self): + """ + update status and fru info of PSU/FAN + + include present, status, status_summary, part_model_name, product_name, air_flow + """ + raise NotImplementedError + + @abc.abstractmethod + def set_module_led(self, color): + """ + set PSU/FAN module LED status + + Args: + color: A string representing the color with which to set the + PSU/FAN module LED status + + Returns: + bool: True if status LED state is set successfully, False if not + """ + raise NotImplementedError + + +class DevPsu(DevBase): + + def __init__(self, name, air_flow_monitor, hal_interface): + super(DevPsu, self).__init__(name, air_flow_monitor) + self.int_case = hal_interface + + def get_psu_presence(self): + return self.int_case.get_psu_presence(self.name) + + def get_psu_input_output_status(self): + return self.int_case.get_psu_input_output_status(self.name) + + def get_psu_fru_info(self): + return self.int_case.get_psu_fru_info(self.name) + + @property + def na_ret(self): + return self.int_case.na_ret + + def get_present(self): + try: + status = self.get_psu_presence() + if status is True: + return STATUS_PRESENT + if status is False: + return STATUS_ABSENT + except Exception as e: + ledcontrol_error("get %s present status error, msg: %s" % (self.name, str(e))) + return STATUS_FAILED + + def get_status(self): + try: + status = self.get_psu_input_output_status() + if status is True: + return STATUS_OK + if status is False: + return STATUS_NOT_OK + except Exception as e: + ledcontrol_error("get %s status error, msg: %s" % (self.name, str(e))) + return STATUS_FAILED + + def update_dev_info(self): + try: + # update status + self.present = self.get_present() + if self.present != STATUS_PRESENT: + self.status = STATUS_UNKNOWN + self.status_summary = self.present + else: + self.status = self.get_status() + self.status_summary = self.status + # update fru info if need air flow monitor + if self.air_flow_monitor: + dic = self.get_psu_fru_info() + self.origin_name = dic["PN"] + self.air_flow = dic["AirFlow"] + self.display_name = dic["DisplayName"] + except Exception as e: + ledcontrol_error("update %s info error, msg: %s" % (self.name, str(e))) + self.present = STATUS_FAILED + self.status = STATUS_FAILED + self.status_summary = STATUS_FAILED + self.origin_name = self.na_ret + self.air_flow = self.na_ret + self.display_name = self.na_ret + + def set_module_led(self, color): + """ + set PSU module LED is not support, always return True + """ + return True + + +class DevFan(DevBase): + + def __init__(self, name, air_flow_monitor, hal_interface): + super(DevFan, self).__init__(name, air_flow_monitor) + self.int_case = hal_interface + + def get_fan_rotor_number(self): + return self.int_case.get_fan_rotor_number(self.name) + + def get_fan_presence(self): + return self.int_case.get_fan_presence(self.name) + + def get_fan_rotor_status(self, rotor_name): + return self.int_case.get_fan_rotor_status(self.name, rotor_name) + + def get_fan_fru_info(self): + return self.int_case.get_fan_fru_info(self.name) + + @property + def na_ret(self): + return self.int_case.na_ret + + def get_present(self): + try: + status = self.get_fan_presence() + if status is True: + return STATUS_PRESENT + if status is False: + return STATUS_ABSENT + except Exception as e: + ledcontrol_error("get %s present status error, msg: %s" % (self.name, str(e))) + return STATUS_FAILED + + def get_status(self): + try: + rotor_num = self.get_fan_rotor_number() + err_motor_num = 0 + for j in range(rotor_num): + rotor_name = "Rotor" + str(j + 1) + roll_status = self.get_fan_rotor_status(rotor_name) + if roll_status is not True: + err_motor_num += 1 + ledcontrol_debug("%s %s error, status %s" % (self.name, rotor_name, roll_status)) + else: + ledcontrol_debug("%s %s ok" % (self.name, rotor_name)) + if err_motor_num > 0: + return STATUS_NOT_OK + return STATUS_OK + except Exception as e: + ledcontrol_error("get %s status error, msg: %s" % (self.name, str(e))) + return STATUS_FAILED + + def update_dev_info(self): + try: + # update status + self.present = self.get_present() + if self.present != STATUS_PRESENT: + self.status = STATUS_UNKNOWN + self.status_summary = self.present + else: + self.status = self.get_status() + self.status_summary = self.status + # update fru info if need air flow monitor + if self.air_flow_monitor: + dic = self.get_fan_fru_info() + self.origin_name = dic["PN"] + self.air_flow = dic["AirFlow"] + self.display_name = dic["DisplayName"] + except Exception as e: + ledcontrol_error("update %s fru info error, msg: %s" % (self.name, str(e))) + self.present = STATUS_FAILED + self.status = STATUS_FAILED + self.status_summary = STATUS_FAILED + self.origin_name = self.na_ret + self.air_flow = self.na_ret + self.display_name = self.na_ret + + def set_module_led(self, color): + ret = self.int_case.set_fan_led(self.name, color) + if ret == 0: + return True + return False + + +class ledcontrol(object): + + def __init__(self): + self.fan_obj_list = [] + self.psu_obj_list = [] + self.board_psu_led_status = COLOR_GREEN + self.board_fan_led_status = COLOR_GREEN + self.__board_air_flow = "" + self.int_case = interface() + self.__config = baseutil.get_monitor_config() + self.__temps_threshold_config = self.__config["temps_threshold"] + for temp_threshold in self.__temps_threshold_config.values(): + temp_threshold['temp'] = 0 + temp_threshold['fail_num'] = 0 + self.__ledcontrol_para = self.__config["ledcontrol_para"] + self.__interval = self.__ledcontrol_para.get("interval", 5) + self.__checkpsu = self.__ledcontrol_para.get("checkpsu", 0) + self.__checkfan = self.__ledcontrol_para.get("checkfan", 0) + self.__psu_amber_num = self.__ledcontrol_para.get("psu_amber_num") + self.__fan_amber_num = self.__ledcontrol_para.get("fan_amber_num") + self.__psu_air_flow_amber_num = self.__ledcontrol_para.get("psu_air_flow_amber_num", 0) + self.__fan_air_flow_amber_num = self.__ledcontrol_para.get("fan_air_flow_amber_num", 0) + self.__board_sys_led = self.__ledcontrol_para.get("board_sys_led", []) + self.__board_psu_led = self.__ledcontrol_para.get("board_psu_led", []) + self.__board_fan_led = self.__ledcontrol_para.get("board_fan_led", []) + self.__psu_air_flow_monitor = self.__ledcontrol_para.get("psu_air_flow_monitor", 0) + self.__fan_air_flow_monitor = self.__ledcontrol_para.get("fan_air_flow_monitor", 0) + self.__fan_mix_list = self.__ledcontrol_para.get("fan_mix_list", []) + + @property + def na_ret(self): + return self.int_case.na_ret + + @property + def checkpsu(self): + return self.__checkpsu + + @property + def checkfan(self): + return self.__checkfan + + @property + def psu_amber_num(self): + return self.__psu_amber_num + + @property + def fan_amber_num(self): + return self.__fan_amber_num + + @property + def psu_air_flow_amber_num(self): + return self.__psu_air_flow_amber_num + + @property + def fan_air_flow_amber_num(self): + return self.__fan_air_flow_amber_num + + @property + def psu_air_flow_monitor(self): + return self.__psu_air_flow_monitor + + @property + def fan_air_flow_monitor(self): + return self.__fan_air_flow_monitor + + @property + def board_sys_led(self): + return self.__board_sys_led + + @property + def board_psu_led(self): + return self.__board_psu_led + + @property + def board_fan_led(self): + return self.__board_fan_led + + @property + def fan_mix_list(self): + return self.__fan_mix_list + + @property + def interval(self): + return self.__interval + + def get_fan_total_number(self): + return self.int_case.get_fan_total_number() + + def get_psu_total_number(self): + return self.int_case.get_psu_total_number() + + def get_onie_e2_obj(self, name): + return self.int_case.get_onie_e2_obj(name) + + def set_led_color(self, led_name, color): + try: + ret = self.int_case.set_led_color(led_name, color) + except Exception as e: + ledcontrol_error("set %s led %s error, msg: %s" % (led_name, color, str(e))) + ret = False + return ret + + def set_sys_led(self, color): + for led in self.board_sys_led: + led_name = led.get("led_name") + ret = self.set_led_color(led_name, color) + if ret is True: + ledcontrol_debug("set %s success, color:%s," % (led_name, color)) + else: + ledcontrol_debug("set %s failed, color:%s," % (led_name, color)) + + def set_psu_led(self, color): + for led in self.board_psu_led: + led_name = led.get("led_name") + ret = self.set_led_color(led_name, color) + if ret is True: + ledcontrol_debug("set %s success, color:%s," % (led_name, color)) + else: + ledcontrol_debug("set %s failed, color:%s," % (led_name, color)) + + def set_fan_led(self, color): + for led in self.board_fan_led: + led_name = led.get("led_name") + ret = self.set_led_color(led_name, color) + if ret is True: + ledcontrol_debug("set %s success, color:%s," % (led_name, color)) + else: + ledcontrol_debug("set %s failed, color:%s," % (led_name, color)) + + def set_fan_module_led(self): + for fan_obj in self.fan_obj_list: + color = LED_STATUS_DICT.get(fan_obj.led_status) + ret = fan_obj.set_module_led(color) + if ret is True: + ledcontrol_debug("set %s module led success, color: %s," % (fan_obj.name, color)) + else: + ledcontrol_debug("set %s module led failed, color: %s," % (fan_obj.name, color)) + + @property + def board_air_flow(self): + air_flow_tuple = (F2B_AIR_FLOW, B2F_AIR_FLOW) + if self.__board_air_flow not in air_flow_tuple: + self.__board_air_flow = self.int_case.get_device_airflow(ONIE_E2_NAME) + ledcontrol_debug("board_air_flow: %s" % self.__board_air_flow) + return self.__board_air_flow + + def update_psu_info(self): + for psu_obj in self.psu_obj_list: + psu_obj.update_dev_info() + ledcontrol_debug("%s present: [%s], status: [%s] status_summary [%s]" % + (psu_obj.name, psu_obj.present, psu_obj.status, psu_obj.status_summary)) + if psu_obj.air_flow_monitor: + ledcontrol_debug("%s origin name: [%s], display name: [%s] air flow [%s]" % + (psu_obj.name, psu_obj.origin_name, psu_obj.display_name, psu_obj.air_flow)) + + def update_fan_info(self): + for fan_obj in self.fan_obj_list: + fan_obj.update_dev_info() + ledcontrol_debug("%s present: [%s], status: [%s] status_summary [%s]" % + (fan_obj.name, fan_obj.present, fan_obj.status, fan_obj.status_summary)) + if fan_obj.air_flow_monitor: + ledcontrol_debug("%s origin name: [%s], display name: [%s] air flow [%s]" % + (fan_obj.name, fan_obj.origin_name, fan_obj.display_name, fan_obj.air_flow)) + + def get_monitor_temp(self): + sensorlist = self.int_case.get_temp_info() + + for temp_threshold in self.__temps_threshold_config.values(): + sensor = sensorlist.get(temp_threshold['name']) + if sensor["Value"] is None: + temp_threshold['fail_num'] += 1 + ledcontrol_error("get %s failed, fail_num = %d" % (temp_threshold['name'], temp_threshold['fail_num'])) + else: + temp_threshold['fail_num'] = 0 + temp_threshold.setdefault('fix', 0) + temp_threshold['temp'] = sensor["Value"] + temp_threshold['fix'] + ledcontrol_debug("%s = %d" % (temp_threshold['name'], temp_threshold['temp'])) + ledcontrol_debug("warning = %d, critical = %d" % (temp_threshold['warning'], temp_threshold['critical'])) + + def is_temp_warning(self): + warning_flag = False + for temp_threshold in self.__temps_threshold_config.values(): + if temp_threshold['temp'] >= temp_threshold['warning']: + warning_flag = True + ledcontrol_debug("%s is over warning" % temp_threshold['name']) + ledcontrol_debug( + "%s = %d, warning = %d" % + (temp_threshold['name'], + temp_threshold['temp'], + temp_threshold['warning'])) + return warning_flag + + def checkTempWarning(self): + try: + if self.is_temp_warning(): + ledcontrol_debug("temp is over warning") + return True + except Exception as e: + ledcontrol_error("%%policy: checkTempWarning failed") + ledcontrol_error(str(e)) + return False + + def is_temp_critical(self): + critical_flag = False + for temp_threshold in self.__temps_threshold_config.values(): + temp_threshold['critical_flag'] = False + if temp_threshold['temp'] >= temp_threshold['critical']: + critical_flag = True + temp_threshold['critical_flag'] = True + ledcontrol_debug("%s is over critical" % temp_threshold['name']) + ledcontrol_debug( + "%s = %d, critical = %d" % + (temp_threshold['name'], + temp_threshold['temp'], + temp_threshold['critical'])) + return critical_flag + + def checkTempCrit(self): + try: + if self.is_temp_critical(): + temp_dict = dict(self.__temps_threshold_config) + tmp = temp_dict.get(SWITCH_TEMP) + if tmp['critical_flag'] is True: + ledcontrol_debug("temp is over critical") + return True + + del temp_dict[SWITCH_TEMP] + for temp_items in temp_dict.values(): + if temp_items['critical_flag'] is False: + return False + + ledcontrol_debug("temp is over critical") + return True + except Exception as e: + ledcontrol_error("%%policy: checkTempCrit failed") + ledcontrol_error(str(e)) + return False + + def check_board_air_flow(self): + board_air_flow = self.board_air_flow + air_flow_tuple = (F2B_AIR_FLOW, B2F_AIR_FLOW) + if board_air_flow not in air_flow_tuple: + air_flow_error("%%AIR_FLOW_MONITOR-3-BOARD: Get board air flow failed, value: %s." % board_air_flow) + return False + ledcontrol_debug("board air flow check ok: %s" % board_air_flow) + return True + + def get_monitor_fan_status(self): + fanerrnum = 0 + for fan_obj in self.fan_obj_list: + status = fan_obj.status_summary + ledcontrol_debug("%s status: %s" % (fan_obj.name, status)) + if status != STATUS_OK: + fan_obj.led_status = COLOR_RED + fanerrnum += 1 + else: + fan_obj.led_status = COLOR_GREEN + ledcontrol_debug("fan error number: %d" % fanerrnum) + + if fanerrnum == 0: + fan_led_status = COLOR_GREEN + elif fanerrnum <= self.fan_amber_num: + fan_led_status = COLOR_AMBER + else: + fan_led_status = COLOR_RED + ledcontrol_debug("monitor fan status, set fan led: %s" % LED_STATUS_DICT.get(fan_led_status)) + return fan_led_status + + def get_monitor_psu_status(self): + psuerrnum = 0 + for psu_obj in self.psu_obj_list: + status = psu_obj.status_summary + ledcontrol_debug("%s status: %s" % (psu_obj.name, status)) + if status != STATUS_OK: + psu_obj.led_status = COLOR_RED + psuerrnum += 1 + else: + psu_obj.led_status = COLOR_GREEN + ledcontrol_debug("psu error number: %d" % psuerrnum) + + if psuerrnum == 0: + psu_led_status = COLOR_GREEN + elif psuerrnum <= self.psu_amber_num: + psu_led_status = COLOR_AMBER + else: + psu_led_status = COLOR_RED + ledcontrol_debug("monitor psu status, set psu led: %s" % LED_STATUS_DICT.get(psu_led_status)) + return psu_led_status + + def get_monitor_fan_air_flow(self): + if self.fan_air_flow_monitor == 0: + ledcontrol_debug("fan air flow monitor not open, default green") + return COLOR_GREEN + + ret = self.check_board_air_flow() + if ret is False: + ledcontrol_debug("check board air flow error, skip fan air flow monitor.") + return COLOR_GREEN + + fan_led_status_list = [] + fan_air_flow_ok_obj_list = [] + fan_air_flow_ok_set = set() + fan_module_led_list = [] + fan_air_flow_err_num = 0 + for fan_obj in self.fan_obj_list: + if fan_obj.present != STATUS_PRESENT: + fan_module_led_list.append(COLOR_GREEN) + continue + if fan_obj.air_flow == self.na_ret: + air_flow_warn("%%AIR_FLOW_MONITOR-4-FAN: %s get air flow failed, fan model: %s, air flow: %s." % + (fan_obj.name, fan_obj.display_name, fan_obj.air_flow)) + led_status = COLOR_AMBER + fan_module_led_list.append(led_status) + elif fan_obj.air_flow != self.board_air_flow: + air_flow_emerg("%%AIR_FLOW_MONITOR-0-FAN: %s air flow error, fan model: %s, fan air flow: %s, board air flow: %s." % + (fan_obj.name, fan_obj.display_name, fan_obj.air_flow, self.board_air_flow)) + led_status = COLOR_RED + fan_air_flow_err_num += 1 + else: + fan_air_flow_ok_obj_list.append(fan_obj) + fan_air_flow_ok_set.add(fan_obj.origin_name) + ledcontrol_debug("%s air flow check ok, origin name: [%s], display name: [%s], fan air flow: [%s], board air flow: [%s]" % + (fan_obj.name, fan_obj.origin_name, fan_obj.display_name, fan_obj.air_flow, self.board_air_flow)) + led_status = COLOR_GREEN + fan_module_led_list.append(led_status) + if led_status > fan_obj.led_status: + fan_obj.led_status = led_status + if len(fan_module_led_list) != 0: + fan_led_status = max(fan_module_led_list) + fan_led_status_list.append(fan_led_status) + # check fan mixing + if len(fan_air_flow_ok_set) > 1 and fan_air_flow_ok_set not in self.fan_mix_list: + for fan_obj in fan_air_flow_ok_obj_list: + air_flow_warn("%%AIR_FLOW_MONITOR-4-FAN: %s mixing, fan model: %s, air flow: %s." % + (fan_obj.name, fan_obj.origin_name, fan_obj.air_flow)) + fan_led_status = COLOR_AMBER + fan_led_status_list.append(fan_led_status) + # check fan air flow error number + if fan_air_flow_err_num == 0: + fan_led_status = COLOR_GREEN + elif fan_air_flow_err_num <= self.fan_air_flow_amber_num: + fan_led_status = COLOR_AMBER + else: + fan_led_status = COLOR_RED + fan_led_status_list.append(fan_led_status) + + fan_led_status = max(fan_led_status_list) + ledcontrol_debug("monitor fan air flow, set fan led: %s" % LED_STATUS_DICT.get(fan_led_status)) + return fan_led_status + + def get_monitor_psu_air_flow(self): + if self.psu_air_flow_monitor == 0: + ledcontrol_debug("psu air flow monitor not open, default green") + return COLOR_GREEN + + ret = self.check_board_air_flow() + if ret is False: + ledcontrol_debug("check board air flow error, skip psu air flow monitor.") + return COLOR_GREEN + + psu_led_status_list = [] + psu_module_led_list = [] + psu_air_flow_err_num = 0 + for psu_obj in self.psu_obj_list: + if psu_obj.present != STATUS_PRESENT: + psu_module_led_list.append(COLOR_GREEN) + continue + if psu_obj.air_flow == self.na_ret: + air_flow_warn("%%AIR_FLOW_MONITOR-4-PSU: %s get air flow failed, psu model: %s, air flow: %s." % + (psu_obj.name, psu_obj.display_name, psu_obj.air_flow)) + led_status = COLOR_AMBER + psu_module_led_list.append(led_status) + elif psu_obj.air_flow != self.board_air_flow: + air_flow_emerg("%%AIR_FLOW_MONITOR-0-PSU: %s air flow error, psu model: %s, psu air flow: %s, board air flow: %s." % + (psu_obj.name, psu_obj.display_name, psu_obj.air_flow, self.board_air_flow)) + led_status = COLOR_RED + psu_air_flow_err_num += 1 + else: + ledcontrol_debug("%s psu air flow check ok, origin name: [%s], display name: [%s], psu air flow: [%s], board air flow: [%s]" % + (psu_obj.name, psu_obj.origin_name, psu_obj.display_name, psu_obj.air_flow, self.board_air_flow)) + led_status = COLOR_GREEN + psu_module_led_list.append(led_status) + if led_status > psu_obj.led_status: + psu_obj.led_status = led_status + + if len(psu_module_led_list) != 0: + psu_led_status = max(psu_module_led_list) + psu_led_status_list.append(psu_led_status) + + # check fan air flow error number + if psu_air_flow_err_num == 0: + psu_led_status = COLOR_GREEN + elif psu_air_flow_err_num <= self.psu_air_flow_amber_num: + psu_led_status = COLOR_AMBER + else: + psu_led_status = COLOR_RED + psu_led_status_list.append(psu_led_status) + + psu_led_status = max(psu_led_status_list) + ledcontrol_debug("monitor psu air flow, set psu led: %s" % LED_STATUS_DICT.get(psu_led_status)) + return psu_led_status + + def get_temp_sys_led_status(self): + if self.checkTempCrit() is True: + sys_led_status = COLOR_RED + elif self.checkTempWarning() is True: + sys_led_status = COLOR_AMBER + else: + sys_led_status = COLOR_GREEN + ledcontrol_debug("monitor temperature, set sys led: %s" % LED_STATUS_DICT.get(sys_led_status)) + return sys_led_status + + def get_sys_led_follow_fan_status(self): + + if self.checkfan: + sys_led_status = self.board_fan_led_status + ledcontrol_debug("sys led follow fan led, set sys led: %s" % LED_STATUS_DICT.get(sys_led_status)) + else: + sys_led_status = COLOR_GREEN + ledcontrol_debug("sys led don't follow fan led, set default green") + return sys_led_status + + def get_sys_led_follow_psu_status(self): + if self.checkpsu: + sys_led_status = self.board_psu_led_status + ledcontrol_debug("sys led follow psu led, set sys led: %s" % LED_STATUS_DICT.get(sys_led_status)) + else: + sys_led_status = COLOR_GREEN + ledcontrol_debug("sys led don't follow psu led, set default green") + return sys_led_status + + def dealSysLedStatus(self): + sys_led_status_list = [] + # get_monitor_temp + self.get_monitor_temp() + + # monitor temp get sys led status + sys_led_status = self.get_temp_sys_led_status() + sys_led_status_list.append(sys_led_status) + + # check sys led follow fan led status + sys_led_status = self.get_sys_led_follow_fan_status() + sys_led_status_list.append(sys_led_status) + + # check sys led follow psu led status + sys_led_status = self.get_sys_led_follow_psu_status() + sys_led_status_list.append(sys_led_status) + + sys_led_status = max(sys_led_status_list) + sys_led_color = LED_STATUS_DICT.get(sys_led_status) + + # set sys led + self.set_sys_led(sys_led_color) + + def dealFanLedStatus(self): + fan_led_status_list = [] + # update fan info + self.update_fan_info() + + # monitor fan status first + fan_led_status = self.get_monitor_fan_status() + fan_led_status_list.append(fan_led_status) + + # monitor fan air flow + fan_led_status = self.get_monitor_fan_air_flow() + fan_led_status_list.append(fan_led_status) + + self.board_fan_led_status = max(fan_led_status_list) + fan_led_color = LED_STATUS_DICT.get(self.board_fan_led_status) + + # set fan led + self.set_fan_led(fan_led_color) + # set fan module led + self.set_fan_module_led() + + def dealPsuLedStatus(self): + psu_led_status_list = [] + # update psu info + self.update_psu_info() + + # monitor psu status first + psu_led_status = self.get_monitor_psu_status() + psu_led_status_list.append(psu_led_status) + + # monitor psu air flow + psu_led_status = self.get_monitor_psu_air_flow() + psu_led_status_list.append(psu_led_status) + + self.board_psu_led_status = max(psu_led_status_list) + psu_led_color = LED_STATUS_DICT.get(self.board_psu_led_status) + + # set psu led + self.set_psu_led(psu_led_color) + + def do_ledcontrol(self): + self.dealPsuLedStatus() + self.dealFanLedStatus() + self.dealSysLedStatus() + + def fan_obj_init(self): + fan_num = self.get_fan_total_number() + for i in range(fan_num): + fan_name = "FAN" + str(i + 1) + fan_obj = DevFan(fan_name, self.fan_air_flow_monitor, self.int_case) + self.fan_obj_list.append(fan_obj) + ledcontrol_debug("fan object initialize success") + + def psu_obj_init(self): + psu_num = self.get_psu_total_number() + for i in range(psu_num): + psu_name = "PSU" + str(i + 1) + psu_obj = DevPsu(psu_name, self.psu_air_flow_monitor, self.int_case) + self.psu_obj_list.append(psu_obj) + ledcontrol_debug("psu object initialize success") + + def run(self): + while True: + try: + debug_init() + self.do_ledcontrol() + time.sleep(self.interval) + except Exception as e: + traceback.print_exc() + ledcontrol_error(str(e)) + + +if __name__ == '__main__': + debug_init() + ledcontrol_debug("enter main") + led_control = ledcontrol() + led_control.fan_obj_init() + led_control.psu_obj_init() + led_control.run() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/hal_pltfm.py b/platform/broadcom/sonic-platform-modules-micas/common/script/hal_pltfm.py new file mode 100755 index 000000000000..11196f507ef1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/hal_pltfm.py @@ -0,0 +1,492 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- +import inspect +import sys +import json +import time +from plat_hal.interface import interface + + +class Command(): + def __init__(self, name, f): + self.name = name + self.f = f + self.paramcount = self.f.__code__.co_argcount + + def dofun(self, args): + fn = self.f.__call__ + fn(*args) + + +class Group(): + def __init__(self, name, f): + self.groups = [] + self.commands = [] + self.name = name + self.f = f + + def add_groups(self, command): + self.groups.append(command) + + def add_commands(self, commnad): + x = Command(commnad.__name__, commnad) + self.commands.append(x) + + def find_valuebyname(self, name): + for item in self.groups: + if name == item.name: + return item + for item in self.commands: + if name == item.name: + return item + return None + + def deal(self, args): + if len(args) <= 0: + return self.print_help() + funclevel = args[0] + val = self.find_valuebyname(funclevel) + if val is None: + return self.print_help() + if isinstance(val, Command): + if len(args) < (val.paramcount + 1): + return self.print_help() + inputargs = args[1: (1 + val.paramcount)] + return val.dofun(inputargs) + if isinstance(val, Group): + args = args[1:] + return val.deal(args) + return self.print_help() + + def get_max(self, arr): + lentmp = 0 + for ar in arr: + lentmp = len(ar) if (len(ar) > lentmp) else lentmp + return lentmp + + def print_help(self): + + namesize = [] + for item in self.groups: + namesize.append(item.name) + for item in self.commands: + namesize.append(item.name) + maxvalue = self.get_max(namesize) + + if len(self.groups) > 0: + print("Groups:") + for item in self.groups: + print(" %-*s %s" % (maxvalue, item.name, item.f.__doc__ or '')) + if len(self.commands) > 0: + print("Commands:") + for item in self.commands: + print(" %-*s %s" % (maxvalue, item.name, item.f.__doc__ or '')) + + +class clival(): + @staticmethod + def Fire(val=None): + group = Group("top", 'mainlevel') + clival.iterGroup(val, group) + # context = {} + # caller = inspect.stack()[1] + # caller_frame = caller[0] + # caller_globals = caller_frame.f_globals + # caller_locals = caller_frame.f_locals + # context.update(caller_globals) + # context.update(caller_locals) + args = sys.argv[1:] + group.deal(args) + + @staticmethod + def iterGroup(val, group): + for key, item in val.items(): + if item is None: # first level + if inspect.isfunction(key): + group.add_commands(key) + else: + group1 = Group(key.__name__, key) + clival.iterGroup(item, group1) + group.add_groups(group1) + + +def psu(): + r'''test psu ''' + + +def fan(): + r'''test fan ''' + + +def sensor(): + r'''test sensor ''' + + +def dcdc(): + r'''test dcdc ''' + + +def led(): + r'''test led ''' + + +def e2(): + r'''test onie eeprom ''' + + +def temps(): + r'''test temps sensor''' + +def cpu(): + r'''test cpu''' + + +int_case = interface() + + +def get_total_number(): + r'''psu get_total_number ''' + print("=================get_total_number======================") + print(int_case.get_psu_total_number()) + + +def get_presence(): + r'''psu get_presence ''' + print("=================get_presence======================") + psus = int_case.get_psus() + for psu_item in psus: + print(psu_item.name, end=' ') + print(int_case.get_psu_presence(psu_item.name)) + + +def get_fru_info(): + r'''psu get_fru_info ''' + print("=================get_fru_info======================") + psus = int_case.get_psus() + for psu_item in psus: + print(psu_item.name, end=' ') + print(json.dumps(int_case.get_psu_fru_info(psu_item.name), ensure_ascii=False, indent=4)) + + +def get_status(): + r'''psu get_status ''' + print("=================get_status======================") + psus = int_case.get_psus() + for psu_item in psus: + print(psu_item.name, end=' ') + print(json.dumps(int_case.get_psu_status(psu_item.name), ensure_ascii=False, indent=4)) + + +def set_psu_fan_speed_pwm(realspeed): + r'''set_psu_fan_speed_pwm''' + print("=================set_psu_fan_speed_pwm======================") + psus = int_case.get_psus() + for psu_item in psus: + print(psu_item.name, end=' ') + print(int_case.set_psu_fan_speed_pwm(psu_item.name, int(realspeed))) + + +def get_psu_fan_speed_pwm(): + r'''get_psu_fan_speed_pwm''' + print("=================get_psu_fan_speed_pwm======================") + psus = int_case.get_psus() + for psu_item in psus: + print(psu_item.name, end=' ') + print(json.dumps(int_case.get_psu_fan_speed_pwm(psu_item.name))) + + +def get_psu_power_status(): + r'''psu get_psu_power_status ''' + print("=================get_psu_power_status======================") + psus = int_case.get_psus() + for psu_item in psus: + print(psu_item.name, end=' ') + print(json.dumps(int_case.get_psu_power_status(psu_item.name), ensure_ascii=False, indent=4)) + + +def get_info_all(): + r'''psu get_info_all ''' + print("=================get_info_all======================") + print(json.dumps(int_case.get_psu_info_all(), ensure_ascii=False, indent=4)) + + +def fan_get_total_number(): + print("=================get_info_all======================") + print(json.dumps(int_case.get_fan_total_number(), ensure_ascii=False, indent=4)) + + +def fan_get_rotor_number(): + r'''fan_get_rotor_number''' + print("=================fan_get_rotor_number======================") + fans = int_case.get_fans() + for fan_item in fans: + print(fan_item.name, end=' ') + print(int_case.get_fan_rotor_number(fan_item.name)) + + +def fan_get_speed(): + r'''fan_get_speed''' + print("=================fan_get_speed======================") + fans = int_case.get_fans() + for fan_item in fans: + rotors = fan_item.rotor_list + for rotor in rotors: + index = rotors.index(rotor) + print("%s rotor%d" % (fan_item.name, index + 1), end=' ') + print(int_case.get_fan_speed(fan_item.name, index + 1)) + + +def fan_get_speed_pwm(): + r'''fan_get_speed_pwm''' + print("=================fan_get_speed_pwm======================") + fans = int_case.get_fans() + for fan_item in fans: + rotors = fan_item.rotor_list + for rotor in rotors: + index = rotors.index(rotor) + print("%s rotor%d" % (fan_item.name, index + 1), end=' ') + print(int_case.get_fan_speed_pwm(fan_item.name, index + 1)) + + +def fan_set_speed_pwm(pwm): + r'''fan_set_speed_pwm''' + print("=================fan_set_speed_pwm======================") + fans = int_case.get_fans() + for fan_item in fans: + rotors = fan_item.rotor_list + for rotor in rotors: + index = rotors.index(rotor) + print("%s %s" % (fan_item.name, rotor.name), end=' ') + val = int_case.set_fan_speed_pwm(fan_item.name, index + 1, pwm) + print(val) + + +def fan_get_watchdog_status(): + r'''fan_get_watchdog_status''' + print("=================fan_get_watchdog_status======================") + print(int_case.get_fan_watchdog_status()) + + +def fan_enable_watchdog(): + r'''fan_enable_watchdog''' + print("=================fan_enable_watchdog======================") + print('enable', int_case.enable_fan_watchdog()) + + +def fan_disable_watchdog(): + r'''fan_disable_watchdog''' + print("=================fan_disable_watchdog======================") + print('disable', int_case.enable_fan_watchdog(enable=False)) + + +def fan_get_speed1(): + r'''fan_get_speed''' + print("=================fan_get_speed======================") + fans = int_case.get_fans() + for fan_item in fans: + rotors = fan_item.rotor_list + for rotor in rotors: + print("%s %s" % (fan_item.name, rotor.name), end=' ') + print(int_case.get_fan_speed(fan_item.name, rotor.name)) + + +def fan_feed_watchdog(): + r'''fan_feed_watchdog''' + print("=================fan_feed_watchdog======================") + fan_get_speed() + print(int_case.feed_fan_watchdog()) + time.sleep(2) + fan_get_speed() + + +def fan_set_led(color): + r'''fan_set_led''' + print("=================fan_set_led======================") + fans = int_case.get_fans() + for fan_item in fans: + print("%s" % fan_item.name) + print(color, int_case.set_fan_led(fan_item.name, color)) + +def fan_get_led(): + r'''fan_get_led''' + print("=================fan_get_led======================") + fans = int_case.get_fans() + for fan_item in fans: + print("%s" % fan_item.name) + print(int_case.get_fan_led(fan_item.name)) + + +def fan_get_presence(): + r'''fan_get_presence''' + print("=================fan_get_presence======================") + fans = int_case.get_fans() + for fan_item in fans: + print("%s" % fan_item.name) + print(int_case.get_fan_presence(fan_item.name)) + + +def fan_get_info(): + r'''fan_get_info''' + print("=================fan_get_info======================") + fans = int_case.get_fans() + for fan_item in fans: + print("%s" % fan_item.name) + print(json.dumps(int_case.get_fan_info(fan_item.name), ensure_ascii=False, indent=4)) + + +def fan_get_status(): + r'''fan_get_status''' + print("=================fan_get_status======================") + fans = int_case.get_fans() + for fan_item in fans: + print("%s" % fan_item.name) + print(json.dumps(int_case.get_fan_status(fan_item.name), ensure_ascii=False, indent=4)) + + +def fan_get_info_all(): + r'''fan_get_info_all''' + print("=================fan_get_info_all======================") + print(json.dumps(int_case.get_fan_info_all(), ensure_ascii=False, indent=4)) + + +def get_sensor_info(): + r'''get_sensor_info''' + print("=================get_sensor_info======================") + print(json.dumps(int_case.get_sensor_info(), ensure_ascii=False, indent=4)) + + +def get_dcdc_all_info(): + r'''get_dcdc_all_info''' + print("=================get_dcdc_all_info======================") + print(json.dumps(int_case.get_dcdc_all_info(), ensure_ascii=False, indent=4)) + + +def set_all_led_color(color): + r'''set_all_led_color color''' + print("=================set_all_led_color======================") + leds = int_case.get_leds() + for led_item in leds: + print("%s" % led_item.name) + print(color, int_case.set_led_color(led_item.name, color)) + + +def get_all_led_color(): + r'''get_all_led_color''' + print("=================get_all_led_color======================") + leds = int_case.get_leds() + for led_item in leds: + print("%s" % led_item.name) + print(int_case.get_led_color(led_item.name)) + + +def set_single_led_color(led_name, color): + r'''set_single_led_color led_name color''' + print("=================set_single_led_color======================") + leds = int_case.get_leds() + for led_item in leds: + if led_name == led_item.name: + print("%s" % led_item.name) + print(color, int_case.set_led_color(led_item.name, color)) + + +def get_single_led_color(led_name): + r'''get_single_led_color''' + print("=================get_single_led_color======================") + leds = int_case.get_leds() + for led_item in leds: + if led_name == led_item.name: + print("%s" % led_item.name) + print(int_case.get_led_color(led_item.name)) + + +def get_onie_e2_path(): + r'''get_onie_e2_path''' + print("=================get_onie_e2_path======================") + path = int_case.get_onie_e2_path("ONIE_E2") + print("%s" % path) + + +def get_device_airflow(): + r'''get_device_airflow''' + print("=================get_device_airflow======================") + airflow = int_case.get_device_airflow("ONIE_E2") + print("%s" % airflow) + + +def get_temps_sensor(): + r'''get_temps_sensor''' + print("=================get_temps_sensor======================") + temp_list = int_case.get_temps() + for temp in temp_list: + print("id: %s, name: %s, API name: %s, value: %s" % (temp.temp_id, temp.name, temp.api_name, temp.Value)) + +def get_cpu_reset_num(): + r'''get_cpu_reset_num''' + print("=================get_cpu_reset_num======================") + print(int_case.get_cpu_reset_num()) + +def get_cpu_reboot_cause(): + r'''get_cpu_reboot_cause''' + print("=================get_cpu_reboot_cause======================") + print(int_case.get_cpu_reboot_cause()) + + +def run_cli_man(): + clival.Fire( + { + psu: { + get_total_number: None, + get_presence: None, + get_fru_info: None, + set_psu_fan_speed_pwm: None, + get_psu_fan_speed_pwm: None, + get_status: None, + get_psu_power_status: None, + get_info_all: None + }, + fan: { + fan_get_total_number: None, + fan_get_rotor_number: None, + fan_get_speed: None, + fan_get_speed_pwm: None, + fan_set_speed_pwm: None, + fan_get_watchdog_status: None, + fan_enable_watchdog: None, + fan_disable_watchdog: None, + fan_feed_watchdog: None, + fan_set_led: None, + fan_get_led: None, + fan_get_presence: None, + fan_get_info: None, + fan_get_status: None, + fan_get_info_all: None + }, + sensor: { + get_sensor_info: None + }, + dcdc: { + get_dcdc_all_info: None + }, + led: { + set_all_led_color: None, + set_single_led_color: None, + get_all_led_color: None, + get_single_led_color: None, + }, + e2: { + get_onie_e2_path: None, + get_device_airflow: None, + }, + temps: { + get_temps_sensor: None, + }, + cpu: { + get_cpu_reset_num: None, + get_cpu_reboot_cause: None, + } + } + ) + + +if __name__ == '__main__': + run_cli_man() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/intelligent_monitor.py b/platform/broadcom/sonic-platform-modules-micas/common/script/intelligent_monitor.py new file mode 100755 index 000000000000..33d5bfba64e6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/intelligent_monitor.py @@ -0,0 +1,144 @@ +#!/usr/bin/python3 +# -*- coding: UTF-8 -*- + +import os +import time +import syslog +from plat_hal.interface import interface +from plat_hal.baseutil import baseutil +from platform_util import io_rd, wbi2cget + +INTELLIGENT_MONITOR_DEBUG_FILE = "/etc/.intelligent_monitor_debug" + +debuglevel = 0 + + +def monitor_syslog_debug(s): + if debuglevel: + syslog.openlog("INTELLIGENT_MONITOR_DEBUG", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def monitor_syslog(s): + syslog.openlog("INTELLIGENT_MONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_WARNING, s) + + +def pmon_syslog_notice(s): + syslog.openlog("PMON_SYSLOG", syslog.LOG_PID) + syslog.syslog(syslog.LOG_NOTICE, s) + + +class IntelligentMonitor(): + def __init__(self): + self.dcdc_dict = {} + self.int_case = interface() + self.__config = baseutil.get_monitor_config() + self.__intelligent_monitor_para = self.__config.get('intelligent_monitor_para', {}) + self.__interval = self.__intelligent_monitor_para.get('interval', 60) + self.__dcdc_whitelist = self.__config.get('dcdc_monitor_whitelist', {}) + self.__error_ret = self.int_case.error_ret + + @property + def error_ret(self): + return self.__error_ret + + @property + def interval(self): + return self.__interval + + def debug_init(self): + global debuglevel + if os.path.exists(INTELLIGENT_MONITOR_DEBUG_FILE): + debuglevel = 1 + else: + debuglevel = 0 + + def dcdc_whitelist_check(self, dcdc_name): + try: + check_item = self.__dcdc_whitelist.get(dcdc_name, {}) + if len(check_item) == 0: + return False + gettype = check_item.get("gettype", None) + checkbit = check_item.get("checkbit", None) + okval = check_item.get("okval", None) + if gettype is None or checkbit is None or okval is None: + monitor_syslog('%%INTELLIGENT_MONITOR-3-DCDC_WHITELIST_FAILED: %s config error. gettype:%s, checkbit:%s, okval:%s' % + (dcdc_name, gettype, checkbit, okval)) + return False + if gettype == "io": + io_addr = check_item.get('io_addr', None) + val = io_rd(io_addr) + if val is not None: + retval = val + else: + monitor_syslog( + '%%INTELLIGENT_MONITOR-3-DCDC_WHITELIST_FAILED: %s io_rd error. io_addr:%s' % + (dcdc_name, io_addr)) + return False + elif gettype == "i2c": + bus = check_item.get('bus', None) + addr = check_item.get('addr', None) + offset = check_item.get('offset', None) + ind, val = wbi2cget(bus, addr, offset) + if ind is True: + retval = val + else: + monitor_syslog('%%INTELLIGENT_MONITOR-3-DCDC_WHITELIST_FAILED: %s i2cget error. bus:%s, addr:%s, offset:%s' % + (dcdc_name, bus, addr, offset)) + return False + else: + monitor_syslog('%%INTELLIGENT_MONITOR-3-DCDC_WHITELIST_FAILED: %s gettype not support' % dcdc_name) + return False + + val_t = (int(retval, 16) & (1 << checkbit)) >> checkbit + if val_t != okval: + return False + return True + except Exception as e: + monitor_syslog('%%WHITELIST_CHECK: %s check error, msg: %s.' % (dcdc_name, str(e))) + return False + + def update_dcdc_status(self): + try: + self.dcdc_dict = self.int_case.get_dcdc_all_info() + for dcdc_name, item in self.dcdc_dict.items(): + ret = self.dcdc_whitelist_check(dcdc_name) + if ret is False: + if item['Value'] == self.error_ret: + monitor_syslog( + '%%INTELLIGENT_MONITOR-3-DCDC_SENSOR_FAILED: The value of %s read failed.' % + (dcdc_name)) + elif float(item['Value']) > float(item['Max']): + pmon_syslog_notice('%%PMON-5-VOLTAGE_HIGH: %s voltage %.3f%s is larger than max threshold %.3f%s.' % + (dcdc_name, float(item['Value']), item['Unit'], float(item['Max']), item['Unit'])) + elif float(item['Value']) < float(item['Min']): + pmon_syslog_notice('%%PMON-5-VOLTAGE_LOW: %s voltage %.3f%s is lower than min threshold %.3f%s.' % + (dcdc_name, float(item['Value']), item['Unit'], float(item['Min']), item['Unit'])) + else: + monitor_syslog_debug('%%INTELLIGENT_MONITOR-6-DCDC_SENSOR_OK: %s normal, value is %.3f%s.' % + (dcdc_name, item['Value'], item['Unit'])) + else: + monitor_syslog_debug( + '%%INTELLIGENT_MONITOR-6-DCDC_WHITELIST_CHECK: %s is in dcdc whitelist, not monitor voltage' % + dcdc_name) + continue + except Exception as e: + monitor_syslog('%%INTELLIGENT_MONITOR-3-EXCEPTION: update dcdc sensors status error, msg: %s.' % (str(e))) + + def doWork(self): + self.update_dcdc_status() + + def run(self): + while True: + try: + self.debug_init() + self.doWork() + time.sleep(self.interval) + except Exception as e: + monitor_syslog('%%INTELLIGENT_MONITOR-3-EXCEPTION: %s.' % (str(e))) + + +if __name__ == '__main__': + intelligent_monitor = IntelligentMonitor() + intelligent_monitor.run() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/intelligent_monitor/monitor_fan.py b/platform/broadcom/sonic-platform-modules-micas/common/script/intelligent_monitor/monitor_fan.py new file mode 100755 index 000000000000..bb596a94cc94 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/intelligent_monitor/monitor_fan.py @@ -0,0 +1,285 @@ +#!/usr/bin/python3 +# -*- coding: UTF-8 -*- + +import os +import time +import logging +from logging.handlers import RotatingFileHandler + +from plat_hal.interface import interface +from plat_hal.baseutil import baseutil +from platform_util import exec_os_cmd + + +DEBUG_FILE = "/etc/.monitor_fan_debug_flag" + +LOG_FILE = "/var/log/intelligent_monitor/monitor_fan_log" + +E2_NAME = "ONIE_E2" + + +def _init_logger(): + if not os.path.exists(LOG_FILE): + exec_os_cmd("mkdir -p %s" % os.path.dirname(LOG_FILE)) + exec_os_cmd("sync") + handler = RotatingFileHandler(filename=LOG_FILE, maxBytes=5 * 1024 * 1024, backupCount=1) + formatter = logging.Formatter("%(asctime)s %(levelname)s %(filename)s[%(funcName)s][%(lineno)s]: %(message)s") + handler.setFormatter(formatter) + logger = logging.getLogger(__name__) + logger.setLevel(logging.INFO) + logger.addHandler(handler) + return logger + + +class Fan(object): + + def __init__(self, name, hal_interface): + self.name = name + self.fan_dict = {} + self.int_case = hal_interface + self.update_time = 0 + self.pre_present = False + self.pre_status = True + self.plugin_cnt = 0 + self.plugout_cnt = 0 + self.status_normal_cnt = 0 + self.status_error_cnt = 0 + + def fan_dict_update(self): + local_time = time.time() + if not self.fan_dict or (local_time - self.update_time) >= 1: # update data every 1 seconds + self.update_time = local_time + self.fan_dict = self.int_case.get_fan_info(self.name) + + def get_model(self): + self.fan_dict_update() + return self.fan_dict["NAME"] + + def get_serial(self): + self.fan_dict_update() + return self.fan_dict["SN"] + + def get_presence(self): + return self.int_case.get_fan_presence(self.name) + + def get_rotor_speed(self, rotor_name): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + fan_dir = {} + fan_dir = self.int_case.get_fan_info_rotor(self.name) + # get fan rotor pwm + value = fan_dir[rotor_name]["Speed"] + max_speed = fan_dir[rotor_name]["SpeedMax"] + + if isinstance(value, str) or value is None: + return 0 + pwm = value * 100 / max_speed + if pwm > 100: + pwm = 100 + elif pwm < 0: + pwm = 0 + return int(pwm) + + def get_rotor_speed_tolerance(self, rotor_name): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + # The default tolerance value is fixed as 30% + fan_dir = {} + fan_dir = self.int_case.get_fan_info_rotor(self.name) + # get fan rotor tolerance + tolerance = fan_dir[rotor_name]["Tolerance"] + + if isinstance(tolerance, str) or tolerance is None: + return 30 + return tolerance + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + pwm = self.int_case.get_fan_speed_pwm(self.name, 0) + return int(pwm) + + def get_status(self): + """ + Retrieves the operational status of the FAN + Returns: + bool: True if FAN is operating properly, False if not + """ + if not self.get_presence(): + return False + + rotor_num = self.int_case.get_fan_rotor_number(self.name) + for i in range(rotor_num): + rotor_name = "Rotor" + str(i + 1) + speed = self.get_rotor_speed(rotor_name) + tolerance = self.get_rotor_speed_tolerance(rotor_name) + target = self.get_target_speed() + if (speed - target) > target * tolerance / 100: + return False + if (target - speed) > target * tolerance / 100: + return False + + return True + + def get_direction(self): + """ + Retrieves the fan airflow direction + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + + Notes: + - Forward/Exhaust : Air flows from Port side to Fan side. + - Reverse/Intake : Air flows from Fan side to Port side. + """ + self.fan_dict_update() + return self.fan_dict["AirFlow"] + + +class MonitorFan(object): + + def __init__(self): + self.int_case = interface() + self.logger = _init_logger() + self.fan_obj_list = [] + self.__config = baseutil.get_monitor_config() + self.__monitor_fan_config = self.__config.get("monitor_fan_para", {}) + self.__present_interval = self.__monitor_fan_config.get("present_interval", 0.5) + self.__status_interval = self.__monitor_fan_config.get("status_interval", 5) + self.__present_check_cnt = self.__monitor_fan_config.get("present_check_cnt", 3) + self.__status_check_cnt = self.__monitor_fan_config.get("status_check_cnt", 3) + + def debug_init(self): + if os.path.exists(DEBUG_FILE): + self.logger.setLevel(logging.DEBUG) + else: + self.logger.setLevel(logging.INFO) + + def get_fan_total_number(self): + return self.int_case.get_fan_total_number() + + def get_device_airflow(self): + return self.int_case.get_device_airflow(E2_NAME) + + def fan_obj_init(self): + fan_num = self.get_fan_total_number() + for i in range(fan_num): + fan_name = "FAN" + str(i + 1) + fan_obj = Fan(fan_name, self.int_case) + self.fan_obj_list.append(fan_obj) + self.logger.info("fan object initialize success") + + def fan_airflow_check(self, fan_obj): + fan_airflow = fan_obj.get_direction() + device_airflow = self.get_device_airflow() + if fan_airflow != device_airflow: + self.logger.error("%s airflow[%s] not match device airflow[%s]", fan_obj.name, fan_airflow, device_airflow) + else: + self.logger.debug("%s airflow[%s] match device airflow[%s]", fan_obj.name, fan_airflow, device_airflow) + + def fan_plug_in_out_check(self, fan_obj): + present = fan_obj.get_presence() + if present is True: + self.logger.debug("%s is present", fan_obj.name) + else: + self.logger.debug("%s is absent", fan_obj.name) + + if present != fan_obj.pre_present: + if present is True: + fan_obj.plugin_cnt += 1 + fan_obj.plugout_cnt = 0 + if fan_obj.plugin_cnt >= self.__present_check_cnt: + fan_obj.pre_present = True + self.logger.info("%s [serial:%s] is plugin", fan_obj.name, fan_obj.get_serial()) + self.fan_airflow_check(fan_obj) + else: + fan_obj.plugin_cnt = 0 + fan_obj.plugout_cnt += 1 + if fan_obj.plugout_cnt >= self.__present_check_cnt: + fan_obj.pre_present = False + self.logger.info("%s is plugout", fan_obj.name) + else: + fan_obj.plugin_cnt = 0 + fan_obj.plugout_cnt = 0 + self.logger.debug("%s present status is not change", fan_obj.name) + + def fan_status_check(self, fan_obj): + status = fan_obj.get_status() + if status is True: + self.logger.debug("%s is normal", fan_obj.name) + else: + self.logger.debug("%s is error", fan_obj.name) + + if status != fan_obj.pre_status: + if status is True: + fan_obj.status_normal_cnt += 1 + fan_obj.status_error_cnt = 0 + if fan_obj.status_normal_cnt >= self.__status_check_cnt: + fan_obj.pre_status = True + self.logger.info( + "%s [serial:%s] is form error change to normal", + fan_obj.name, + fan_obj.get_serial()) + else: + fan_obj.status_normal_cnt = 0 + fan_obj.status_error_cnt += 1 + if fan_obj.status_error_cnt >= self.__status_check_cnt: + fan_obj.pre_status = False + self.logger.info( + "%s [serial:%s] is form normal change to error", + fan_obj.name, + fan_obj.get_serial()) + else: + fan_obj.status_normal_cnt = 0 + fan_obj.status_error_cnt = 0 + self.logger.debug("%s status is not change", fan_obj.name) + + def checkFanPresence(self): + for fan_obj in self.fan_obj_list: + self.fan_plug_in_out_check(fan_obj) + + def checkFanStatus(self): + for fan_obj in self.fan_obj_list: + self.fan_status_check(fan_obj) + + def run(self): + start_time = time.time() + while True: + try: + self.debug_init() + delta_time = time.time() - start_time + if self.__present_interval <= self.__status_interval: + if delta_time >= self.__status_interval or delta_time < 0: + self.checkFanStatus() + start_time = time.time() + else: + self.checkFanPresence() + time.sleep(self.__present_interval) + else: + if delta_time >= self.__present_interval or delta_time < 0: + self.checkFanPresence() + start_time = time.time() + else: + self.checkFanStatus() + time.sleep(self.__status_interval) + except Exception as e: + self.logger.error('EXCEPTION: %s.', str(e)) + + +if __name__ == '__main__': + monitor_fan = MonitorFan() + monitor_fan.fan_obj_init() + monitor_fan.run() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_common.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_common.py new file mode 100755 index 000000000000..35c16728f72c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_common.py @@ -0,0 +1,186 @@ +#!/usr/bin/python3 + +__all__ = [ + "BLACKLIST_DRIVERS", + "DRIVERLISTS", + "DEVICE", + "STARTMODULE", + "MAC_LED_RESET", + "MAC_DEFAULT_PARAM", + "DEV_MONITOR_PARAM", + "SLOT_MONITOR_PARAM", + "MANUINFO_CONF", + "REBOOT_CTRL_PARAM", + "PMON_SYSLOG_STATUS", + "OPTOE", + "REBOOT_CAUSE_PARA", + "UPGRADE_SUMMARY", + "WARM_UPGRADE_PARAM", + "WARM_UPG_FLAG", + "WARM_UPGRADE_STARTED_FLAG", + "PLATFORM_E2_CONF", + "AIR_FLOW_CONF", + "AIRFLOW_RESULT_FILE", + "INIT_PARAM_PRE", + "INIT_COMMAND_PRE", + "INIT_PARAM", + "INIT_COMMAND", + "SET_MAC_CONF", + "DRVIER_UPDATE_CONF", + "MONITOR_TEMP_MIN", + "MONITOR_K", + "MONITOR_MAC_IN", + "MONITOR_DEFAULT_SPEED", + "MONITOR_MAX_SPEED", + "MONITOR_MIN_SPEED", + "MONITOR_MAC_ERROR_SPEED", + "MONITOR_FAN_TOTAL_NUM", + "MONITOR_MAC_UP_TEMP", + "MONITOR_MAC_LOWER_TEMP", + "MONITOR_MAC_MAX_TEMP", + "MONITOR_FALL_TEMP", + "MONITOR_MAC_WARNING_THRESHOLD", + "MONITOR_OUTTEMP_WARNING_THRESHOLD", + "MONITOR_BOARDTEMP_WARNING_THRESHOLD", + "MONITOR_CPUTEMP_WARNING_THRESHOLD", + "MONITOR_INTEMP_WARNING_THRESHOLD", + "MONITOR_MAC_CRITICAL_THRESHOLD", + "MONITOR_OUTTEMP_CRITICAL_THRESHOLD", + "MONITOR_BOARDTEMP_CRITICAL_THRESHOLD", + "MONITOR_CPUTEMP_CRITICAL_THRESHOLD", + "MONITOR_INTEMP_CRITICAL_THRESHOLD", + "MONITOR_CRITICAL_NUM", + "MONITOR_SHAKE_TIME", + "MONITOR_INTERVAL", + "MONITOR_LED_INTERVAL", + "MONITOR_PID_FLAG", + "MONITOR_MAC_SOURCE_SYSFS", + "MONITOR_MAC_SOURCE_PATH", + "MONITOR_PID_MODULE", + "PSU_FAN_FOLLOW", + "MONITOR_SYS_LED", + "MONITOR_SYS_FAN_LED", + "MONITOR_FANS_LED", + "MONITOR_SYS_PSU_LED", + "MONITOR_FAN_STATUS", + "MONITOR_PSU_STATUS", + "MONITOR_DEV_STATUS", + "MONITOR_DEV_STATUS_DECODE", + "DEV_LEDS", + "fanloc" +] + +# driver blacklist parameter +BLACKLIST_DRIVERS = [] + +# driver list parameter +DRIVERLISTS = [] + +# device list parameter +DEVICE = [] + +# start module parameters +STARTMODULE = {} + +# mac led reset parameter +MAC_LED_RESET = {} + +# avscontrol parameter +MAC_DEFAULT_PARAM = [] + +# dev_monitor parameter +DEV_MONITOR_PARAM = {} + +# slot_monitor parameter +SLOT_MONITOR_PARAM = {} + +# platform_manufacturer parameter +MANUINFO_CONF = {} + +# reboot_ctrl parameter +REBOOT_CTRL_PARAM = {} + +# pmon_syslog parameter +PMON_SYSLOG_STATUS = {} + +# sfp optoe device parameter +OPTOE = [] + +# reboot_cause parameter +REBOOT_CAUSE_PARA = [] + +# upgrade parameter +UPGRADE_SUMMARY = {} + +# warm_uprade parameter +WARM_UPGRADE_PARAM = {} +WARM_UPG_FLAG = "/etc/sonic/.warm_upg_flag" +WARM_UPGRADE_STARTED_FLAG = "/etc/sonic/.doing_warm_upg" + +# platform_e2 parameter +PLATFORM_E2_CONF = {} + +# generate_airflow parameter +AIR_FLOW_CONF = {} +AIRFLOW_RESULT_FILE = "/etc/sonic/.airflow" + +# Initialization parameters +INIT_PARAM_PRE = [] +INIT_COMMAND_PRE = [] +INIT_PARAM = [] +INIT_COMMAND = [] + +# Set eth mac address parameters +SET_MAC_CONF = [] + +# driver update config +DRVIER_UPDATE_CONF = {} + +################################ fancontrol parameter################################### +MONITOR_TEMP_MIN = 38 +MONITOR_K = 11 +MONITOR_MAC_IN = 35 +MONITOR_DEFAULT_SPEED = 0x60 +MONITOR_MAX_SPEED = 0xFF +MONITOR_MIN_SPEED = 0x60 +MONITOR_MAC_ERROR_SPEED = 0XBB +MONITOR_FAN_TOTAL_NUM = 4 +MONITOR_MAC_UP_TEMP = 50 +MONITOR_MAC_LOWER_TEMP = -50 +MONITOR_MAC_MAX_TEMP = 100 # + +MONITOR_FALL_TEMP = 4 +MONITOR_MAC_WARNING_THRESHOLD = 100 +MONITOR_OUTTEMP_WARNING_THRESHOLD = 85 +MONITOR_BOARDTEMP_WARNING_THRESHOLD = 85 +MONITOR_CPUTEMP_WARNING_THRESHOLD = 85 +MONITOR_INTEMP_WARNING_THRESHOLD = 70 + +MONITOR_MAC_CRITICAL_THRESHOLD = 105 +MONITOR_OUTTEMP_CRITICAL_THRESHOLD = 90 +MONITOR_BOARDTEMP_CRITICAL_THRESHOLD = 90 +MONITOR_CPUTEMP_CRITICAL_THRESHOLD = 100 +MONITOR_INTEMP_CRITICAL_THRESHOLD = 80 +MONITOR_CRITICAL_NUM = 3 +MONITOR_SHAKE_TIME = 20 +MONITOR_INTERVAL = 60 +MONITOR_LED_INTERVAL = 2 +MONITOR_PID_FLAG = 0 + +MONITOR_MAC_SOURCE_SYSFS = 0 +MONITOR_MAC_SOURCE_PATH = None + +MONITOR_PID_MODULE = {} + +PSU_FAN_FOLLOW = {} + +MONITOR_SYS_LED = [] +MONITOR_SYS_FAN_LED = [] +MONITOR_FANS_LED = [] +MONITOR_SYS_PSU_LED = [] +MONITOR_FAN_STATUS = [] +MONITOR_PSU_STATUS = [] +MONITOR_DEV_STATUS = {} +MONITOR_DEV_STATUS_DECODE = {} +DEV_LEDS = {} +fanloc = [] diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_config.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_config.py new file mode 100755 index 000000000000..d6b3151e47cf --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_config.py @@ -0,0 +1,192 @@ +#!/usr/bin/python3 + +import sys +import os +from wbutil.baseutil import get_machine_info +from wbutil.baseutil import get_platform_info +from wbutil.baseutil import get_board_id + +__all__ = [ + "MAILBOX_DIR", + "PLATFORM_GLOBALCONFIG", + "GLOBALCONFIG", + "STARTMODULE", + "MAC_LED_RESET", + "MAC_DEFAULT_PARAM", + "DEV_MONITOR_PARAM", + "SLOT_MONITOR_PARAM", + "MANUINFO_CONF", + "REBOOT_CTRL_PARAM", + "PMON_SYSLOG_STATUS", + "REBOOT_CAUSE_PARA", + "UPGRADE_SUMMARY", + "WARM_UPGRADE_PARAM", + "WARM_UPG_FLAG", + "WARM_UPGRADE_STARTED_FLAG", + "PLATFORM_E2_CONF", + "AIR_FLOW_CONF", + "AIRFLOW_RESULT_FILE", + "GLOBALINITPARAM", + "GLOBALINITCOMMAND", + "GLOBALINITPARAM_PRE", + "GLOBALINITCOMMAND_PRE", + "SET_MAC_CONF", + "DRVIER_UPDATE_CONF", + "MONITOR_CONST", + "PSU_FAN_FOLLOW", + "MONITOR_SYS_LED", + "MONITOR_FANS_LED", + "MONITOR_SYS_FAN_LED", + "MONITOR_SYS_PSU_LED", + "MONITOR_FAN_STATUS", + "MONITOR_PSU_STATUS", + "MONITOR_DEV_STATUS", + "MONITOR_DEV_STATUS_DECODE", + "DEV_LEDS", + "fanloc" +] + + +def getdeviceplatform(): + x = get_platform_info(get_machine_info()) + if x is not None: + filepath = "/usr/share/sonic/device/" + x + return filepath + return None + + +platform = get_platform_info(get_machine_info()) +board_id = get_board_id(get_machine_info()) +platformpath = getdeviceplatform() +MAILBOX_DIR = "/sys/bus/i2c/devices/" +grtd_productfile = (platform + "_config").replace("-", "_") +common_productfile = "platform_common" +platform_configfile = (platform + "_" + board_id + "_config").replace("-", "_") # platfrom + board_id +configfile_pre = "/usr/local/bin/" +sys.path.append(platformpath) +sys.path.append(configfile_pre) + +############################################################################################ +if os.path.exists(configfile_pre + platform_configfile + ".py"): + module_product = __import__(platform_configfile, globals(), locals(), [], 0) +elif os.path.exists(configfile_pre + grtd_productfile + ".py"): + module_product = __import__(grtd_productfile, globals(), locals(), [], 0) +elif os.path.exists(configfile_pre + common_productfile + ".py"): + module_product = __import__(common_productfile, globals(), locals(), [], 0) +else: + print("config file not exist") + sys.exit(-1) +############################################################################################ + +PLATFORM_GLOBALCONFIG = { + "DRIVERLISTS": module_product.DRIVERLISTS, + "OPTOE": module_product.OPTOE, + "DEVS": module_product.DEVICE, + "BLACKLIST_DRIVERS": module_product.BLACKLIST_DRIVERS +} +GLOBALCONFIG = PLATFORM_GLOBALCONFIG + +# start module parameters +STARTMODULE = module_product.STARTMODULE + +# mac led reset parameter +MAC_LED_RESET = module_product.MAC_LED_RESET + +# avscontrol parameter +MAC_DEFAULT_PARAM = module_product.MAC_DEFAULT_PARAM + +# dev_monitor parameter +DEV_MONITOR_PARAM = module_product.DEV_MONITOR_PARAM + +# slot_monitor parameter +SLOT_MONITOR_PARAM = module_product.SLOT_MONITOR_PARAM + +# platform_manufacturer parameter +MANUINFO_CONF = module_product.MANUINFO_CONF + +# reboot_ctrl parameter +REBOOT_CTRL_PARAM = module_product.REBOOT_CTRL_PARAM + +# pmon_syslog parameter +PMON_SYSLOG_STATUS = module_product.PMON_SYSLOG_STATUS + +# reboot_cause parameter +REBOOT_CAUSE_PARA = module_product.REBOOT_CAUSE_PARA + +# upgrade parameter +UPGRADE_SUMMARY = module_product.UPGRADE_SUMMARY + +# warm_uprade parameter +WARM_UPGRADE_PARAM = module_product.WARM_UPGRADE_PARAM +WARM_UPG_FLAG = module_product.WARM_UPG_FLAG +WARM_UPGRADE_STARTED_FLAG = module_product.WARM_UPGRADE_STARTED_FLAG + +# platform_e2 parameter +PLATFORM_E2_CONF = module_product.PLATFORM_E2_CONF + +# generate_airflow parameter +AIR_FLOW_CONF = module_product.AIR_FLOW_CONF +AIRFLOW_RESULT_FILE = module_product.AIRFLOW_RESULT_FILE + +# Initialization parameters +GLOBALINITPARAM = module_product.INIT_PARAM +GLOBALINITCOMMAND = module_product.INIT_COMMAND +GLOBALINITPARAM_PRE = module_product.INIT_PARAM_PRE +GLOBALINITCOMMAND_PRE = module_product.INIT_COMMAND_PRE + +# Set eth mac address parameters +SET_MAC_CONF = module_product.SET_MAC_CONF + +# driver update config +DRVIER_UPDATE_CONF = module_product.DRVIER_UPDATE_CONF + +################################ fancontrol parameter################################### + + +class MONITOR_CONST: + TEMP_MIN = module_product.MONITOR_TEMP_MIN + K = module_product.MONITOR_K + MAC_IN = module_product.MONITOR_MAC_IN + DEFAULT_SPEED = module_product.MONITOR_DEFAULT_SPEED + MAX_SPEED = module_product.MONITOR_MAX_SPEED + MIN_SPEED = module_product.MONITOR_MIN_SPEED + MAC_ERROR_SPEED = module_product.MONITOR_MAC_ERROR_SPEED + FAN_TOTAL_NUM = module_product.MONITOR_FAN_TOTAL_NUM + MAC_UP_TEMP = module_product.MONITOR_MAC_UP_TEMP + MAC_LOWER_TEMP = module_product.MONITOR_MAC_LOWER_TEMP + MAC_MAX_TEMP = module_product.MONITOR_MAC_MAX_TEMP + + MAC_WARNING_THRESHOLD = module_product.MONITOR_MAC_WARNING_THRESHOLD + OUTTEMP_WARNING_THRESHOLD = module_product.MONITOR_OUTTEMP_WARNING_THRESHOLD + BOARDTEMP_WARNING_THRESHOLD = module_product.MONITOR_BOARDTEMP_WARNING_THRESHOLD + CPUTEMP_WARNING_THRESHOLD = module_product.MONITOR_CPUTEMP_WARNING_THRESHOLD + INTEMP_WARNING_THRESHOLD = module_product.MONITOR_INTEMP_WARNING_THRESHOLD + + MAC_CRITICAL_THRESHOLD = module_product.MONITOR_MAC_CRITICAL_THRESHOLD + OUTTEMP_CRITICAL_THRESHOLD = module_product.MONITOR_OUTTEMP_CRITICAL_THRESHOLD + BOARDTEMP_CRITICAL_THRESHOLD = module_product.MONITOR_BOARDTEMP_CRITICAL_THRESHOLD + CPUTEMP_CRITICAL_THRESHOLD = module_product.MONITOR_CPUTEMP_CRITICAL_THRESHOLD + INTEMP_CRITICAL_THRESHOLD = module_product.MONITOR_INTEMP_CRITICAL_THRESHOLD + CRITICAL_NUM = module_product.MONITOR_CRITICAL_NUM + SHAKE_TIME = module_product.MONITOR_SHAKE_TIME + MONITOR_INTERVAL = module_product.MONITOR_INTERVAL + MONITOR_LED_INTERVAL = module_product.MONITOR_LED_INTERVAL + MONITOR_FALL_TEMP = module_product.MONITOR_FALL_TEMP + MONITOR_PID_FLAG = module_product.MONITOR_PID_FLAG + MONITOR_PID_MODULE = module_product.MONITOR_PID_MODULE + + MONITOR_MAC_SOURCE_SYSFS = module_product.MONITOR_MAC_SOURCE_SYSFS + MONITOR_MAC_SOURCE_PATH = module_product.MONITOR_MAC_SOURCE_PATH + + +PSU_FAN_FOLLOW = module_product.PSU_FAN_FOLLOW +MONITOR_SYS_LED = module_product.MONITOR_SYS_LED +MONITOR_FANS_LED = module_product.MONITOR_FANS_LED +MONITOR_SYS_FAN_LED = module_product.MONITOR_SYS_FAN_LED +MONITOR_SYS_PSU_LED = module_product.MONITOR_SYS_PSU_LED +MONITOR_FAN_STATUS = module_product.MONITOR_FAN_STATUS +MONITOR_PSU_STATUS = module_product.MONITOR_PSU_STATUS +MONITOR_DEV_STATUS = module_product.MONITOR_DEV_STATUS +MONITOR_DEV_STATUS_DECODE = module_product.MONITOR_DEV_STATUS_DECODE +DEV_LEDS = module_product.DEV_LEDS +fanloc = module_product.fanloc diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_driver.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_driver.py new file mode 100755 index 000000000000..e27d461bab81 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_driver.py @@ -0,0 +1,258 @@ +#!/usr/bin/env python3 +import os +import subprocess +import time +import click +from platform_config import GLOBALCONFIG, WARM_UPGRADE_STARTED_FLAG, WARM_UPG_FLAG + + +CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']} + + +class AliasedGroup(click.Group): + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + if len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + return None + + +def log_os_system(cmd): + status, output = subprocess.getstatusoutput(cmd) + if status: + print(output) + return status, output + + +def platform_process_file_check(): + # WARM_UPGRADE_STARTED_FLAG is used as warm_upgrade.py process start flag + if os.path.exists(WARM_UPGRADE_STARTED_FLAG): + os.remove(WARM_UPGRADE_STARTED_FLAG) + + # WARM_UPG_FLAG is used as port related service judgment flag + if os.path.exists(WARM_UPG_FLAG): + os.remove(WARM_UPG_FLAG) + + +def startCommon_operation(): + platform_process_file_check() + + +def check_driver(): + status, output = log_os_system("lsmod | grep wb | wc -l") + if status: + return False + if output.isdigit() and int(output) > 0: + return True + return False + + +def removeDev(bus, loc): + cmd = "echo 0x%02x > /sys/bus/i2c/devices/i2c-%d/delete_device" % (loc, bus) + devpath = "/sys/bus/i2c/devices/%d-%04x" % (bus, loc) + if os.path.exists(devpath): + log_os_system(cmd) + + +def addDev(name, bus, loc): + if name == "lm75": + time.sleep(0.1) + pdevpath = "/sys/bus/i2c/devices/i2c-%d/" % (bus) + for i in range(1, 100): + if os.path.exists(pdevpath) is True: + break + time.sleep(0.1) + if i % 10 == 0: + click.echo("%%WB_PLATFORM_DRIVER-INIT: %s not found, wait 0.1 second ! i %d " % (pdevpath, i)) + + cmd = "echo %s 0x%02x > /sys/bus/i2c/devices/i2c-%d/new_device" % (name, loc, bus) + devpath = "/sys/bus/i2c/devices/%d-%04x" % (bus, loc) + if os.path.exists(devpath) is False: + log_os_system(cmd) + + +def removeOPTOE(startbus, endbus): + for bus in range(endbus, startbus - 1, -1): + removeDev(bus, 0x50) + + +def addOPTOE(name, startbus, endbus): + for bus in range(startbus, endbus + 1): + addDev(name, bus, 0x50) + + +def removeoptoes(): + optoes = GLOBALCONFIG["OPTOE"] + for index in range(len(optoes) - 1, -1, -1): + removeOPTOE(optoes[index]["startbus"], optoes[index]["endbus"]) + + +def addoptoes(): + optoes = GLOBALCONFIG["OPTOE"] + for optoe in optoes: + addOPTOE(optoe["name"], optoe["startbus"], optoe["endbus"]) + + +def removedevs(): + devs = GLOBALCONFIG["DEVS"] + for index in range(len(devs) - 1, -1, -1): + removeDev(devs[index]["bus"], devs[index]["loc"]) + + +def adddevs(): + devs = GLOBALCONFIG["DEVS"] + for dev in devs: + addDev(dev["name"], dev["bus"], dev["loc"]) + + +def checksignaldriver(name): + modisexistcmd = "lsmod | grep -w %s | wc -l" % name + status, output = log_os_system(modisexistcmd) + if status: + return False + if output.isdigit() and int(output) > 0: + return True + return False + + +def adddriver(name, delay): + cmd = "modprobe %s" % name + if delay != 0: + time.sleep(delay) + if checksignaldriver(name) is not True: + log_os_system(cmd) + + +def removedriver(name, delay, removeable=1): + realname = name.lstrip().split(" ")[0] + cmd = "rmmod -f %s" % realname + if checksignaldriver(realname) and removeable: + log_os_system(cmd) + if delay > 0: + time.sleep(delay) + + +def removedrivers(): + if GLOBALCONFIG is None: + click.echo("%%WB_PLATFORM_DRIVER-INIT: load global config failed.") + return + drivers = GLOBALCONFIG.get("DRIVERLISTS", None) + if drivers is None: + click.echo("%%WB_PLATFORM_DRIVER-INIT: load driver list failed.") + return + for index in range(len(drivers) - 1, -1, -1): + delay = 0 + name = "" + removeable = drivers[index].get("removable", 1) + if isinstance(drivers[index], dict) and "delay" in drivers[index]: + name = drivers[index].get("name") + delay = drivers[index]["delay"] + else: + name = drivers[index] + removedriver(name, delay, removeable) + + +def adddrivers(): + if GLOBALCONFIG is None: + click.echo("%%WB_PLATFORM_DRIVER-INIT: load global config failed.") + return + drivers = GLOBALCONFIG.get("DRIVERLISTS", None) + if drivers is None: + click.echo("%%WB_PLATFORM_DRIVER-INIT: load driver list failed.") + return + for driver in drivers: + delay = 0 + name = "" + if isinstance(driver, dict) and "delay" in driver: + name = driver.get("name") + delay = driver["delay"] + else: + name = driver + adddriver(name, delay) + + +def blacklist_driver_remove(): + if GLOBALCONFIG is None: + click.echo("%%WB_PLATFORM_DRIVER-INIT: load global config failed.") + return + blacklist_drivers = GLOBALCONFIG.get("BLACKLIST_DRIVERS", []) + for driver in blacklist_drivers: + delay = 0 + name = "" + if isinstance(driver, dict) and "delay" in driver: + name = driver.get("name") + delay = driver["delay"] + else: + name = driver + removedriver(name, delay) + + +def unload_driver(): + removeoptoes() + removedevs() + removedrivers() + + +def reload_driver(): + removedevs() + removedrivers() + time.sleep(1) + adddrivers() + adddevs() + + +def i2c_check(bus, retrytime=6): + try: + i2cpath = "/sys/bus/i2c/devices/" + bus + while retrytime and not os.path.exists(i2cpath): + click.echo("%%WB_PLATFORM_DRIVER-HA: i2c bus abnormal, last bus %s is not exist." % i2cpath) + reload_driver() + retrytime -= 1 + time.sleep(1) + except Exception as e: + click.echo("%%WB_PLATFORM_DRIVER-HA: %s" % str(e)) + + +def load_driver(): + startCommon_operation() + adddrivers() + adddevs() + addoptoes() + + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''device operator''' + + +@main.command() +def start(): + '''load drivers and device ''' + blacklist_driver_remove() + if check_driver(): + unload_driver() + load_driver() + + +@main.command() +def stop(): + '''stop drivers device ''' + unload_driver() + + +@main.command() +def restart(): + '''restart drivers and device''' + unload_driver() + load_driver() + + +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_e2.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_e2.py new file mode 100755 index 000000000000..4dafde2701cb --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_e2.py @@ -0,0 +1,444 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- +import click +import os +import sys + +from eepromutil.fru import ipmifru +from eepromutil.cust_fru import CustFru +from eepromutil.fantlv import fan_tlv +import eepromutil.onietlv as ot +from platform_config import PLATFORM_E2_CONF +from platform_util import byteTostr, dev_file_read + +CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']} + + +class AliasedGroup(click.Group): + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + if len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + return None + + +class ExtraFunc(object): + @staticmethod + def decode_mac(encodedata): + if encodedata is None: + return None + ret = ":".join("%02x" % ord(data) for data in encodedata) + return ret.upper() + + @staticmethod + def decode_mac_number(encodedata): + if encodedata is None: + return None + return (ord(encodedata[0]) << 8) | (ord(encodedata[1]) & 0x00ff) + + @staticmethod + @staticmethod + def fru_decode_mac_number(params): + ipmi_fru = params.get("fru") + area = params.get("area") + field = params.get("field") + area_info = getattr(ipmi_fru, area, None) + if area_info is not None: + raw_mac_number = getattr(area_info, field, None) + mac_number = decode_mac_number(raw_mac_number) + ipmi_fru.setValue(area, field, mac_number) + + @staticmethod + def fru_decode_mac(params): + ipmi_fru = params.get("fru") + area = params.get("area") + field = params.get("field") + area_info = getattr(ipmi_fru, area, None) + if area_info is not None: + raw_mac = getattr(area_info, field, None) + decoded_mac = decode_mac(raw_mac) + ipmi_fru.setValue(area, field, decoded_mac) + + @staticmethod + def fru_decode_hw(params): + ipmi_fru = params.get("fru") + area = params.get("area") + field = params.get("field") + area_info = getattr(ipmi_fru, area, None) + if area_info is not None: + raw_hw = getattr(area_info, field, None) + decode_hw = str(int(raw_hw, 16)) + ipmi_fru.setValue(area, field, decode_hw) + + +def set_onie_value(params): + onie = params.get("onie") + field = params.get("field") + config_value = params.get("config_value") + for index, onie_item in enumerate(onie): + if onie_item.get("name") == field: + if "value" in onie_item.keys(): + onie[index]["value"] = config_value + + +def onie_eeprom_decode(onie, e2_decode): + for e2_decode_item in e2_decode: + field = e2_decode_item.get("field") + decode_type = e2_decode_item.get("decode_type") + if decode_type == 'func': + params = { + "onie": onie, + "field": field + } + func_name = e2_decode_item.get("func_name") + if func_name is not None: + run_func(func_name, params) + elif decode_type == 'config': + config_value = e2_decode_item.get("config_value") + if config_value is not None: + params = { + "onie": onie, + "field": field, + "config_value": config_value + } + set_onie_value(params) + else: + print("unsupport decode type") + continue + + +def onie_eeprom_show(eeprom, e2_decode=None): + try: + onietlv = ot.onie_tlv() + rets = onietlv.decode(eeprom) + if e2_decode is not None: + onie_eeprom_decode(rets, e2_decode) + print("%-20s %-5s %-5s %-20s" % ("TLV name", "Code", "lens", "Value")) + for item in rets: + if item["code"] == 0xfd: + print("%-20s 0x%-02X %-5s" % (item["name"], item["code"], item["lens"])) + else: + print("%-20s 0x%-02X %-5s %-20s" % (item["name"], item["code"], item["lens"], item["value"])) + except Exception as e: + print(str(e)) + + +def set_fantlv_value(params): + fantlv_dict = params.get("fantlv") + field = params.get("field") + config_value = params.get("config_value") + for index, fantlv_item in enumerate(fantlv_dict): + if fantlv_item.get("name") == field: + if "value" in fantlv_item.keys(): + fantlv_dict[index]["value"] = config_value + + +def fantlv_eeprom_decode(fantlv_dict, e2_decode): + for e2_decode_item in e2_decode: + field = e2_decode_item.get("field") + decode_type = e2_decode_item.get("decode_type") + if decode_type == 'func': + params = { + "fantlv": fantlv_dict, + "field": field + } + func_name = e2_decode_item.get("func_name") + if func_name is not None: + run_func(func_name, params) + elif decode_type == 'config': + config_value = e2_decode_item.get("config_value") + if config_value is not None: + params = { + "fantlv": fantlv_dict, + "field": field, + "config_value": config_value + } + set_fantlv_value(params) + else: + print("unsupport decode type") + continue + + +def fantlv_eeprom_show(eeprom, e2_decode=None): + try: + tlv = fan_tlv() + rets = tlv.decode(eeprom) + if len(rets) == 0: + print("fan tlv eeprom info error.!") + return + if e2_decode is not None: + fantlv_eeprom_decode(rets, e2_decode) + print("%-15s %-5s %-5s %-20s" % ("TLV name", "Code", "lens", "Value")) + for item in rets: + print("%-15s 0x%-02X %-5s %-20s" % (item["name"], item["code"], item["lens"], item["value"])) + except Exception as e: + print(str(e)) + return + + +def run_func(funcname, params): + try: + func = getattr(ExtraFunc, funcname) + func(params) + except Exception as e: + print(str(e)) + +def set_fru_value(params): + ipmi_fru = params.get("fru") + area = params.get("area") + field = params.get("field") + config_value = params.get("config_value") + ipmi_fru.setValue(area, field, config_value) + + +def fru_eeprom_decode(ipmi_fru, e2_decode): + for e2_decode_item in e2_decode: + area = e2_decode_item.get("area") + field = e2_decode_item.get("field") + decode_type = e2_decode_item.get("decode_type") + if decode_type == 'func': + params = { + "fru": ipmi_fru, + "area": area, + "field": field + } + func_name = e2_decode_item.get("func_name") + if func_name is not None: + run_func(func_name, params) + elif decode_type == 'config': + config_value = e2_decode_item.get("config_value") + if config_value is not None: + params = { + "fru": ipmi_fru, + "area": area, + "field": field, + "config_value": config_value + } + set_fru_value(params) + else: + print("unsupport decode type") + continue + + +def fru_eeprom_show(eeprom, e2_decode=None): + try: + ipmi_fru = ipmifru() + ipmi_fru.decodeBin(eeprom) + if e2_decode is not None: + fru_eeprom_decode(ipmi_fru, e2_decode) + print("=================board=================") + print(ipmi_fru.boardInfoArea) + print("=================product=================") + print(ipmi_fru.productInfoArea) + except Exception as e: + print(str(e)) + + +def custfru_eeprom_show(eeprom, e2_decode=None): + try: + custfru = CustFru() + custfru.decode(eeprom) + print(custfru) + except Exception as e: + print(str(e)) + + +def eeprom_parase(eeprom_conf): + name = eeprom_conf.get("name") + e2_type = eeprom_conf.get("e2_type") + e2_path = eeprom_conf.get("e2_path") + e2_size = eeprom_conf.get("e2_size", 256) + e2_decode = eeprom_conf.get("e2_decode") + print("===================%s===================" % name) + ret, binval_bytes = dev_file_read(e2_path, 0, e2_size) + if ret is False: + print("eeprom read error, eeprom path: %s, msg: %s" % (e2_path, binval_bytes)) + return + binval = byteTostr(binval_bytes) + if e2_type == "onie_tlv": + onie_eeprom_show(binval, e2_decode) + elif e2_type == "fru": + fru_eeprom_show(binval, e2_decode) + elif e2_type == "fantlv": + fantlv_eeprom_show(binval, e2_decode) + elif e2_type == "custfru": + custfru_eeprom_show(binval, e2_decode) + else: + print("Unknow eeprom type: %s" % e2_type) + return + + +def get_fans_eeprom_info(param): + fan_eeprom_conf = PLATFORM_E2_CONF.get("fan", []) + fan_num = len(fan_eeprom_conf) + if fan_num == 0: + print("fan number is 0, can't get fan eeprom info") + return + if param == 'all': + for conf in fan_eeprom_conf: + eeprom_parase(conf) + return + if not param.isdigit(): + print("param error, %s is not digital or 'all'" % param) + return + fan_index = int(param, 10) - 1 + if fan_index < 0 or fan_index >= fan_num: + print("param error, total fan number: %d, fan index: %d" % (fan_num, fan_index + 1)) + return + eeprom_parase(fan_eeprom_conf[fan_index]) + return + + +def get_psus_eeprom_info(param): + psu_eeprom_conf = PLATFORM_E2_CONF.get("psu", []) + psu_num = len(psu_eeprom_conf) + if psu_num == 0: + print("psu number is 0, can't get psu eeprom info") + return + if param == 'all': + for conf in psu_eeprom_conf: + eeprom_parase(conf) + return + if not param.isdigit(): + print("param error, %s is not digital or 'all'" % param) + return + psu_index = int(param, 10) - 1 + if psu_index < 0 or psu_index >= psu_num: + print("param error, total psu number: %d, psu index: %d" % (psu_num, psu_index + 1)) + return + eeprom_parase(psu_eeprom_conf[psu_index]) + return + + +def get_slots_eeprom_info(param): + slot_eeprom_conf = PLATFORM_E2_CONF.get("slot", []) + slot_num = len(slot_eeprom_conf) + if slot_num == 0: + print("slot number is 0, can't get slot eeprom info") + return + if param == 'all': + for conf in slot_eeprom_conf: + eeprom_parase(conf) + return + if not param.isdigit(): + print("param error, %s is not digital or 'all'" % param) + return + slot_index = int(param, 10) - 1 + if slot_index < 0 or slot_index >= slot_num: + print("param error, total slot number: %d, slot index: %d" % (slot_num, slot_index + 1)) + return + eeprom_parase(slot_eeprom_conf[slot_index]) + return + + +def get_syseeprom_info(param): + syseeprom_conf = PLATFORM_E2_CONF.get("syseeprom", []) + syseeprom_num = len(syseeprom_conf) + if syseeprom_num == 0: + print("syseeprom number is 0, can't get syseeprom info") + return + if param == 'all': + for conf in syseeprom_conf: + eeprom_parase(conf) + return + if not param.isdigit(): + print("param error, %s is not digital or 'all'" % param) + return + syseeprom_index = int(param, 10) - 1 + if syseeprom_index < 0 or syseeprom_index >= syseeprom_num: + print("param error, total syseeprom number: %d, syseeprom index: %d" % (syseeprom_num, syseeprom_index + 1)) + return + eeprom_parase(syseeprom_conf[syseeprom_index]) + return + + +def decode_eeprom_info(e2_type, e2_path, e2_size): + if not e2_size.isdigit(): + print("param error, e2_size %s is not digital" % e2_size) + return + e2_size = int(e2_size, 10) + eeprom_conf = {} + eeprom_conf["name"] = e2_type + eeprom_conf["e2_type"] = e2_type + eeprom_conf["e2_path"] = e2_path + eeprom_conf["e2_size"] = e2_size + eeprom_parase(eeprom_conf) + return + + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''platform eeprom display script''' + + +# fan eeprom info display +@main.command() +@click.argument('fan_index', required=True) +def fan(fan_index): + '''fan_index(1, 2, 3...)/all''' + get_fans_eeprom_info(fan_index) + + +# psu eeprom info display +@main.command() +@click.argument('psu_index', required=True) +def psu(psu_index): + '''psu_index(1, 2, 3...)/all''' + get_psus_eeprom_info(psu_index) + + +# slot eeprom info display +@main.command() +@click.argument('slot_index', required=True) +def slot(slot_index): + '''slot_index(1, 2, 3...)/all''' + get_slots_eeprom_info(slot_index) + + +# syseeprom info display +@main.command() +@click.argument('syseeprom_index', required=True) +def syseeprom(syseeprom_index): + '''syseeprom_index(1, 2, 3...)/all''' + get_syseeprom_info(syseeprom_index) + + +# fru eeprom info decode +@main.command() +@click.argument('e2_path', required=True) +@click.argument('e2_size', required=False, default="256") +def fru(e2_path, e2_size): + '''e2_path''' + decode_eeprom_info("fru", e2_path, e2_size) + + +# fantlv eeprom info decode +@main.command() +@click.argument('e2_path', required=True) +@click.argument('e2_size', required=False, default="256") +def fantlv(e2_path, e2_size): + '''e2_path''' + decode_eeprom_info("fantlv", e2_path, e2_size) + + +# onie_tlv eeprom info decode +@main.command() +@click.argument('e2_path', required=True) +@click.argument('e2_size', required=False, default="256") +def onie_tlv(e2_path, e2_size): + '''e2_path''' + decode_eeprom_info("onie_tlv", e2_path, e2_size) + + +if __name__ == '__main__': + if os.geteuid() != 0: + print("Root privileges are required for this operation") + sys.exit(1) + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_intf.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_intf.py new file mode 100755 index 000000000000..ef27c2392eb4 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_intf.py @@ -0,0 +1,389 @@ +#!/usr/bin/env python3 +import os +import syslog +import glob +import importlib.machinery +from platform_util import getplatform_name, dev_file_read, dev_file_write, write_sysfs, read_sysfs + +__all__ = [ + "platform_reg_read", + "platform_reg_write", + "platform_set_optoe_type", + "platform_get_optoe_type", + "platform_sfp_read", + "platform_sfp_write", +] + +CPLD = 0 +FPGA = 1 +CPLD_PATH = "/dev/cpld%d" +FPGA_PATH = "/dev/fpga%d" + + +OPTOE_PATH = "/sys/bus/i2c/devices/%d-0050/" +OPTOE_DEV_CLASS = "dev_class" +OPTOE_EEPROM = "eeprom" + + +PLATFORM_INTF_DEBUG_FILE = "/etc/.platform_intf_debug_flag" + + +CONFIG_FILE_LIST = [ + "/usr/local/bin/", + "/usr/local/lib/*/dist-packages/config/" +] + + +def platform_intf_debug(s): + if os.path.exists(PLATFORM_INTF_DEBUG_FILE): + syslog.openlog("PLATFORM_INTF_DEBUG", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def platform_intf_error(s): + if os.path.exists(PLATFORM_INTF_DEBUG_FILE): + syslog.openlog("PLATFORM_INTF_ERROR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +class IntfPlatform: + CONFIG_NAME = 'PLATFORM_INTF_OPTOE' + __port_optoe_dict = {} + + def __init__(self): + real_path = None + platform_name = (getplatform_name()).replace("-", "_") + for configfile_path in CONFIG_FILE_LIST: + if "/*/" in configfile_path: + filepath = glob.glob(configfile_path) + if len(filepath) == 0: + continue + configfile_path = filepath[0] + configfile = configfile_path + platform_name + "_port_config.py" + if os.path.exists(configfile): + real_path = configfile + break + if real_path is None: + raise Exception("get port config error") + config = importlib.machinery.SourceFileLoader(self.CONFIG_NAME, real_path).load_module() + self.__port_optoe_dict = config.PLATFORM_INTF_OPTOE + + def get_dev_path(self, dev_type, dev_id): + if dev_type == CPLD: + path = CPLD_PATH % dev_id + elif dev_type == FPGA: + path = FPGA_PATH % dev_id + else: + msg = "dev_type error!" + return False, msg + platform_intf_debug("path:%s" % path) + return True, path + + def get_port_path(self, port): + port_num = self.__port_optoe_dict.get("port_num", 0) + if port_num <= 0: + msg = "PLATFORM_INTF_OPTOE port_num config error, port_num: %d!" % port_num + return False, msg + + if port <= 0 or port > port_num: + msg = "port out of range !" + return False, msg + + port_bus_map = self.__port_optoe_dict.get("port_bus_map") + optoe_start_bus = self.__port_optoe_dict.get("optoe_start_bus", 0) + if port_bus_map is None: # get port bus by optoe_start_bus + if optoe_start_bus <= 0: + msg = "PLATFORM_INTF_OPTOE optoe_start_bus config error, optoe_start_bus: %d" % optoe_start_bus + return False, msg + port_bus = port + optoe_start_bus - 1 + else: # get port bus by port_bus_map + port_bus = port_bus_map.get(port) + if port_bus is None: + msg = "port %d don't has i2c bus" % port + return False, msg + if not isinstance(port_bus, int) or port_bus < 0: + msg = "port %d i2c bus config error, port_bus: %s " % port_bus + return False, msg + + path = OPTOE_PATH % (port_bus) + platform_intf_debug("path:%s" % path) + return True, path + + ########################################### + # reg_read - read logic device register + # @dev_type: 0: CPLD, 1: FPGA + # @dev_id: device ID, start from 0 + # @offset: register offset + # @size: read length + # return: + # @ret: True if read success, False if not + # @info: The read value list if read success, otherwise the detail error message + ########################################### + def reg_read(self, dev_type, dev_id, offset, size): + ret, path = self.get_dev_path(dev_type, dev_id) + if ret is False: + return False, path + ret, info = dev_file_read(path, offset, size) + return ret, info + + ########################################### + # platform_reg_write - write logic device register + # @dev_type: 0: CPLD, 1: FPGA + # @dev_id: device ID, start from 0 + # @offset: register offset + # @val_list: The write value list + # return: + # @ret: True if write success, False if not + # @info: The write value length if write success, otherwise the detail error message + ########################################### + def reg_write(self, dev_type, dev_id, offset, val_list): + ret, path = self.get_dev_path(dev_type, dev_id) + if ret is False: + return False, path + ret, info = dev_file_write(path, offset, val_list) + return ret, info + + ########################################### + # set_optoe_type - set port optoe type + # @port: port index start from 1 + # @optoe_type: optoe type, including the following values + # 1: OPTOE1 + # 2: OPTOE2 + # 3: OPTOE3 + # return: + # @ret: True if set optoe type success, False if not + # @info: None if set optoe type success, otherwise the detail error message + ########################################### + def set_optoe_type(self, port, optoe_type): + ret, path = self.get_port_path(port) + if ret is False: + return False, path + optoe_type_path = path + OPTOE_DEV_CLASS + ret, info = write_sysfs(optoe_type_path, "%d" % optoe_type) + if ret is False: + return False, info + return True, None + + ########################################### + # get_optoe_type - get port optoe type + # @port: port index start from 1 + # return: + # @ret: True if set optoe type success, False if not + # @info: Optoe type value if get optoe type success, otherwise the detail error message + # optoe type including the following values + # 1: OPTOE1 + # 2: OPTOE2 + # 3: OPTOE3 + ########################################### + def get_optoe_type(self, port): + ret, path = self.get_port_path(port) + if ret is False: + return False, path + optoe_type_path = path + OPTOE_DEV_CLASS + ret, info = read_sysfs(optoe_type_path) + if ret is False: + return False, info + return True, int(info) + + ########################################### + # sfp_read -read sfp eeprom + # @port_id: port index start from 1 + # @offset: sfp eeprom offset + # @size: read sfp eeprom length + # return: + # @ret: True if read success, False if not + # @info: The read value list if read success, otherwise the detail error message + ########################################### + def sfp_read(self, port_id, offset, size): + ret, path = self.get_port_path(port_id) + if ret is False: + return False, path + optoe_eeprom_path = path + OPTOE_EEPROM + ret, info = dev_file_read(optoe_eeprom_path, offset, size) + return ret, info + + ########################################### + # sfp_write -write sfp eeprom + # @port_id: port index start from 1 + # @offset: sfp eeprom offset + # @val_list: The write value list + # return: + # @ret: True if read success, False if not + # @info: The write value length if write success, otherwise the detail error message + ########################################### + def sfp_write(self, port_id, offset, val_list): + ret, path = self.get_port_path(port_id) + if ret is False: + return False, path + optoe_eeprom_path = path + OPTOE_EEPROM + ret, info = dev_file_write(optoe_eeprom_path, offset, val_list) + return ret, info + + +platform = IntfPlatform() + + +########################################### +# platform_reg_read - read logic device register +# @dev_type: 0: CPLD, 1: FPGA +# @dev_id: device ID, start from 0 +# @offset: register offset +# @size: read length +# return: +# @ret: True if read success, False if not +# @info: The read value list if read success, otherwise the detail error message +########################################### +def platform_reg_read(dev_type, dev_id, offset, size): + ret = False + info = None + + # params check + if (isinstance(dev_type, int) is False or isinstance(dev_id, int) is False or + isinstance(offset, int) is False or isinstance(size, int) is False): + info = "params type check fail in platform_reg_read" + return ret, info + if dev_id < 0 or offset < 0 or size <= 0: + info = "params value check fail in platform_reg_read" + return ret, info + support_dev_type = (CPLD, FPGA) + if dev_type not in support_dev_type: + info = "dev_type match erro, fail in platform_reg_read" + return ret, info + + # call the solve func + return platform.reg_read(dev_type, dev_id, offset, size) + + +########################################### +# platform_reg_write - write logic device register +# @dev_type: 0: CPLD, 1: FPGA +# @dev_id: device ID, start from 0 +# @offset: register offset +# @val_list: The write value list +# return: +# @ret: True if write success, False if not +# @info: The write value length if write success, otherwise the detail error message +########################################### +def platform_reg_write(dev_type, dev_id, offset, val_list): + ret = False + info = None + + # params check + if (isinstance(dev_type, int) is False or isinstance(dev_id, int) is False or + isinstance(offset, int) is False or isinstance(val_list, list) is False): + info = "params type check fail in platform_reg_write" + return ret, info + if dev_id < 0 or offset < 0 or len(val_list) <= 0: + info = "params value check fail in platform_reg_write" + return ret, info + support_dev_type = (CPLD, FPGA) + if dev_type not in support_dev_type: + info = "dev_type match erro, fail in platform_reg_write" + return ret, info + + # call the solve func + return platform.reg_write(dev_type, dev_id, offset, val_list) + + +########################################### +# platform_set_optoe_type - set port optoe type +# @port: port index start from 1 +# @optoe_type: optoe type, including the following values +# 1: OPTOE1 +# 2: OPTOE2 +# 3: OPTOE3 +# return: +# @ret: True if set optoe type success, False if not +# @info: None if set optoe type success, otherwise the detail error message +########################################### +def platform_set_optoe_type(port, optoe_type): + ret = False + info = None + + # params check + if isinstance(port, int) is False or isinstance(optoe_type, int) is False: + info = "params type check fail in platform_set_optoe_type" + return ret, info + if port < 0 or optoe_type < 1 or optoe_type > 3: + info = "params value check fail in platform_set_optoe_type" + return ret, info + + # call the solve func + return platform.set_optoe_type(port, optoe_type) + + +########################################### +# platform_get_optoe_type - get port optoe type +# @port: port index start from 1 +# return: +# @ret: True if set optoe type success, False if not +# @info: Optoe type value if get optoe type success, otherwise the detail error message +# optoe type including the following values +# 1: OPTOE1 +# 2: OPTOE2 +# 3: OPTOE3 +########################################### +def platform_get_optoe_type(port): + ret = False + info = None + + # params check + if isinstance(port, int) is False: + info = "params type check fail in platform_get_optoe_type" + return ret, info + if port < 0: + info = "params value check fail in platform_get_optoe_type" + return ret, info + + # call the solve func + return platform.get_optoe_type(port) + + +########################################### +# platform_sfp_read -read sfp eeprom +# @port_id: port index start from 1 +# @offset: sfp eeprom offset +# @size: read sfp eeprom length +# return: +# @ret: True if read success, False if not +# @info: The read value list if read success, otherwise the detail error message +########################################### +def platform_sfp_read(port_id, offset, size): + ret = False + info = None + + # params check + if isinstance(port_id, int) is False or isinstance(offset, int) is False or isinstance(size, int) is False: + info = "params type check fail in platform_sfp_read" + return ret, info + if port_id < 0 or offset < 0 or size <= 0: + info = "params value check fail in platform_sfp_read" + return ret, info + + # call the solve func + return platform.sfp_read(port_id, offset, size) + + +########################################### +# platform_sfp_write -write sfp eeprom +# @port_id: port index start from 1 +# @offset: sfp eeprom offset +# @val_list: The write value list +# return: +# @ret: True if read success, False if not +# @info: The write value length if write success, otherwise the detail error message +########################################### +def platform_sfp_write(port_id, offset, val_list): + ret = False + info = None + + # params check + if isinstance(port_id, int) is False or isinstance(offset, int) is False or isinstance(val_list, list) is False: + info = "params type check fail in platform_sfp_write" + return ret, info + if port_id < 0 or offset < 0 or len(val_list) <= 0: + info = "params value check fail in platform_sfp_write" + return ret, info + + # call the solve func + return platform.sfp_write(port_id, offset, val_list) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_ipmi.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_ipmi.py new file mode 100755 index 000000000000..c9b72c99cca9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_ipmi.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +import sys +import os +import syslog +import click +from platform_util import exec_os_cmd + + +IPMITOOL_CMD = "ipmitool raw 0x32 0x04" # All products are the same command + +PLATFORM_IPMI_DEBUG_FILE = "/etc/.platform_ipmi_debug_flag" +UPGRADEDEBUG = 1 +debuglevel = 0 + + +def debug_init(): + global debuglevel + if os.path.exists(PLATFORM_IPMI_DEBUG_FILE): + debuglevel = debuglevel | UPGRADEDEBUG + else: + debuglevel = debuglevel & ~(UPGRADEDEBUG) + + +def ipmidebuglog(s): + # s = s.decode('utf-8').encode('gb2312') + if UPGRADEDEBUG & debuglevel: + syslog.openlog("PLATFORM_IPMI", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def ipmierror(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("PLATFORM_IPMI", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +@click.command() +@click.argument('cmd', required=True) +def platform_ipmi_main(cmd): + '''Send command to BMC through ipmi''' + try: + # Convert string command to ASCII + user_cmd = "" + for ch in cmd: + user_cmd += " " + str(ord(ch)) + + final_cmd = IPMITOOL_CMD + user_cmd + ipmidebuglog("final cmd:%s" % final_cmd) + + # exec ipmitool cmd + status, output = exec_os_cmd(final_cmd) + if status: + ipmierror("exec ipmitool_cmd:%s user_cmd:%s failed" % (IPMITOOL_CMD, cmd)) + ipmierror("failed log: %s" % output) + return False, "exec final_cmd failed" + + # the data read by ipmitool is hex value, needs transformation + data_list = output.replace("\n", "").strip(' ').split(' ') + ipmidebuglog("data_list: %s" % data_list) + result = "" + for data in data_list: + result += chr(int(data, 16)) + + # 'result' string include ret and log, separated by , + result_list = result.split(',', 2) + if len(result_list) != 2: + log = "split failed. len(result) != 2. result:%s" % result + ipmierror(log) + return False, log + if int(result_list[0]) != 0: + ipmierror("finally analy ipmitool_cmd:%s user_cmd:%s exec failed" % (IPMITOOL_CMD, cmd)) + ipmierror("failed return log: %s" % result_list[1]) + print(result_list[1]) + return False, result_list[1] + + ipmidebuglog("finally exec ipmitool_cmd:%s user_cmd:%s success" % (IPMITOOL_CMD, cmd)) + print(result_list[1]) + return True, result_list[1] + + except Exception as e: + log = "An exception occurred, exception log:%s" % str(e) + ipmierror(log) + return False, log + + +if __name__ == '__main__': + debug_init() + ret, msg = platform_ipmi_main() + if ret is False: + sys.exit(1) + sys.exit(0) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_manufacturer.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_manufacturer.py new file mode 100755 index 000000000000..b2643da9bce4 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_manufacturer.py @@ -0,0 +1,562 @@ +#!/usr/bin/env python3 + +import re +import mmap +import fcntl +import subprocess +import shlex +import signal +import os +import time +import sys +from platform_config import MANUINFO_CONF +from monitor import status + + +INDENT = 4 + + +def printerr(vchar): + sys.stderr.write(vchar + '\n') + + +g_extra_cache = {} +g_meminfo_cache = {} +g_exphy_cache = {} + + +def exec_os_cmd(cmd, timeout = None): + status, output = subprocess.getstatusoutput(cmd) + return status, output + + +def exphyfwsplit(): + # improve performance + global g_exphy_cache + if g_exphy_cache: + return + cmd = "bcmcmd -t 1 \"phy control xe,ce fw_get\" |grep fw_version" + ret, output = exec_os_cmd(cmd) + if ret or len(output) == 0: + raise Exception("run cmd: {} error, status: {}, msg: {}".format(cmd, ret, output)) + exphyfwstr = output.strip() + portlist = exphyfwstr.split("\n") + for port in portlist: + phy_addr_str = get_regular_val(port, r"phy_addr\s*=\s*\w+", 0) + if phy_addr_str.startswith("ERR"): + continue + phy_addr_key = phy_addr_str.replace(" ", "") + if phy_addr_key in g_exphy_cache: + continue + + g_exphy_cache[phy_addr_key] = {} + + fw_version_str = get_regular_val(port, r"fw_version\s*=\s*\w+", 0) + if fw_version_str.startswith("ERR"): + del g_exphy_cache[phy_addr_key] + continue + + fw_version = fw_version_str.split("=")[1].strip() + g_exphy_cache[phy_addr_key]["fw_version"] = fw_version + + if "success" in port: + ret = "OK" + else: + ret = "Unexpected" + g_exphy_cache[phy_addr_key]["status"] = ret + return + + +def lshwmemorysplit(): + # improve performance + global g_meminfo_cache + if g_meminfo_cache: + return + cmd = "lshw -c memory" + ret, output = exec_os_cmd(cmd) + if ret or len(output) == 0: + raise Exception("run cmd: {} error, status: {}, msg: {}".format(cmd, ret, output)) + memstr = output.strip() + memlist = memstr.split("*-") + for item in memlist: + if item.strip().startswith("memory") and "System Memory" not in item: + continue + line_index = 0 + for line in item.splitlines(): + line_index += 1 + if line_index == 1: + memdict_key = line + g_meminfo_cache[memdict_key] = {} + else: + if ":" not in line: + continue + key = line.split(":", 1)[0].strip() + value = line.split(":", 1)[1].strip() + g_meminfo_cache[memdict_key][key] = value + if "empty" in item: + break + return + + +def run_extra_func(funcname): + # improve performance + if funcname in g_extra_cache: + return g_extra_cache.get(funcname) + func = getattr(status, funcname) + ret = [] + func(ret) + if ret: + g_extra_cache[funcname] = ret + return ret + + +def get_extra_value(funcname, itemid, key): + for item in run_extra_func(funcname): + if item.get("id") == itemid: + return item.get(key, "NA") + return "NA" + + +def io_wr(reg_addr, reg_data): + try: + regdata = 0 + regaddr = 0 + if isinstance(reg_addr, int): + regaddr = reg_addr + else: + regaddr = int(reg_addr, 16) + if isinstance(reg_data, int): + regdata = reg_data + else: + regdata = int(reg_data, 16) + devfile = "/dev/port" + fd = os.open(devfile, os.O_RDWR | os.O_CREAT) + os.lseek(fd, regaddr, os.SEEK_SET) + os.write(fd, regdata.to_bytes(1, 'little')) + return True + except ValueError as e: + print(e) + return False + except Exception as e: + print(e) + return False + finally: + os.close(fd) + + +def checksignaldriver(name): + modisexistcmd = "lsmod | grep -w %s | wc -l" % name + ret, output = exec_os_cmd(modisexistcmd) + if ret: + return False + if output.isdigit() and int(output) > 0: + return True + return False + + +def adddriver(name): + cmd = "modprobe %s" % name + if checksignaldriver(name) is not True: + ret, log = exec_os_cmd(cmd) + if ret != 0 or len(log) > 0: + return False + return True + return True + + +def removedriver(name): + cmd = "rmmod %s" % name + if checksignaldriver(name): + exec_os_cmd(cmd) + +def deal_itmes(item_list): + for item in item_list: + dealtype = item.get("dealtype") + if dealtype == "shell": + cmd = item.get("cmd") + timeout = item.get("timeout", 10) + exec_os_cmd(cmd, timeout) + elif dealtype == "io_wr": + io_addr = item.get("io_addr") + wr_value = item.get("value") + io_wr(io_addr, wr_value) + + +def get_func_value(funcname, params): + func = getattr(ExtraFunc, funcname) + ret = func(params) + return ret + + +def read_pci_reg(pcibus, slot, fn, resource, offset): + '''read pci register''' + if offset % 4 != 0: + return "ERR offset: %d not 4 bytes align" + filename = "/sys/bus/pci/devices/0000:%02x:%02x.%x/resource%d" % (int(pcibus), int(slot), int(fn), int(resource)) + size = os.path.getsize(filename) + with open(filename, "r+") as file: + data = mmap.mmap(file.fileno(), size) + result = data[offset: offset + 4] + s = result[::-1] + val = 0 + for value in s: + val = val << 8 | value + data.close() + return "%08x" % val + + +def devfileread(path, offset, length, bit_width): + ret = "" + val_str = '' + val_list = [] + fd = -1 + if not os.path.exists(path): + return "%s not found !" % path + if length % bit_width != 0: + return "only support read by bit_width" + if length < bit_width: + return "len needs to greater than or equal to bit_width" + + try: + fd = os.open(path, os.O_RDONLY) + os.lseek(fd, offset, os.SEEK_SET) + ret = os.read(fd, length) + for item in ret: + val_list.append(item) + + for i in range(0, length, bit_width): + for j in range(0, bit_width): + val_str += "%02x" % val_list[i + bit_width - j - 1] + except Exception as e: + return str(e) + finally: + if fd > 0: + os.close(fd) + return val_str + + +def read_reg(loc, offset, size): + with open(loc, 'rb') as file: + file.seek(offset) + return ' '.join(["%02x" % item for item in file.read(size)]) + + +def std_match(stdout, pattern): + if pattern is None: + return stdout.strip() + for line in stdout.splitlines(): + if re.match(pattern, line): + return line.strip() + raise EOFError("pattern: {} does not match anything in stdout {}".format( + pattern, stdout)) + + +def i2c_rd(bus, loc, offset): + ''' + read i2c with i2cget command + ''' + cmd = "i2cget -f -y {} {} {}".format(bus, loc, offset) + retrytime = 6 + for i in range(retrytime): + ret, stdout = subprocess.getstatusoutput(cmd) + if ret == 0: + return stdout + time.sleep(0.1) + raise RuntimeError("run cmd: {} error, status {}".format(cmd, ret)) + + +def i2c_rd_bytes(bus, loc, offset, size): + blist = [] + for i in range(size): + ret = i2c_rd(bus, loc, offset + i) + blist.append(ret) + + return blist + + +def get_pair_val(source, separator): + try: + value = source.split(separator, 1)[1] + except (ValueError, IndexError): + return "ERR separator: {} does not match in source: {}".format(separator, source) + return value.strip() + + +def get_regular_val(source, pattern, group): + try: + value = re.findall(pattern, source)[group] + except Exception: + return "ERR pattern: {} does not match in source: {} with group: {}".format(pattern, source, group) + return value.strip() + + +def find_match(file2read, pattern): + with open(file2read, 'r') as file: + for line in file: + if not re.match(pattern, line): + continue + return line.strip() + return "ERR pattern %s not match in %s" % (pattern, file2read) + + +def readaline(file2read): + with open(file2read, 'r') as file: + return file.readline() + + +def sort_key(e): + return e.arrt_index + + +class ExtraFunc(object): + @staticmethod + def get_bcm5387_version(params): + version = "" + try: + before_deal_list = params.get("before", []) + deal_itmes(before_deal_list) + + ret, version = exec_os_cmd(params["get_version"]) + if ret != 0: + version = "ERR " + version + + after_deal_list = params.get("after", []) + deal_itmes(after_deal_list) + + except Exception as e: + version = "ERR %s" % (str(e)) + finally: + finally_deal_list = params.get("finally", []) + deal_itmes(finally_deal_list) + return version + + @staticmethod + def get_memory_value(params): + root_key = params.get("root_key") + sub_key = params.get("sub_key") + lshwmemorysplit() + return g_meminfo_cache.get(root_key, {}).get(sub_key, "NA") + + @staticmethod + def get_memory_bank_value(params): + lshwmemorysplit() + bank = params.get("bankid") + if g_meminfo_cache.get(bank, {}): + return True + return False + + @staticmethod + def get_exphy_fw(phyid): + exphyfwsplit() + if phyid not in g_exphy_cache: + return "ERR %s not found." % phyid + fw_version = g_exphy_cache.get(phyid).get("fw_version") + ret = g_exphy_cache.get(phyid).get("status") + msg = "%s %s" % (fw_version, ret) + return msg + +class CallbackSet: + def cpld_format(self, blist): + if isinstance(blist, str): + blist = blist.split() + elif not isinstance(blist, list) or len(blist) != 4: + raise ValueError("cpld format: wrong parameter: {}".format(blist)) + + return "{}{}{}{}".format(*blist).replace("0x", "") + + +class VersionHunter: + call = CallbackSet() + + def __init__(self, entires): + self.head = None + self.next = None + self.key = None + self.cmd = None + self.file = None + self.reg = None + self.i2c = None + self.extra = None + self.pattern = None + self.separator = None + self.parent = None + self.ignore = False + self.children = [] + self.level = 0 + self.callback = None + self.delspace = None + self.arrt_index = None + self.config = None + self.precheck = None + self.func = None + self.regular = None + self.group = 0 + self.pci = None + self.devfile = None + self.decode = None + self.timeout = 10 + self.__dict__.update(entires) + + def check_para(self): + if self.pattern is None: + return False + if self.cmd is None or self.file is None: + return False + return True + + def get_version(self): + ret = "NA" + try: + if self.cmd is not None: + ret, output = exec_os_cmd(self.cmd, self.timeout) + if ret or len(output) == 0: + raise RuntimeError("run cmd: {} error, status: {}, msg: {}".format(self.cmd, ret, output)) + ret = std_match(output, self.pattern) + elif self.file is not None: + ret = self.read_file() + elif self.reg is not None: + ret = read_reg(self.reg.get("loc"), self.reg.get("offset"), + self.reg.get("size")) + elif self.extra: + ret = get_extra_value(self.extra.get("funcname"), + self.extra.get("id"), + self.extra.get("key")) + elif self.i2c: + ret = i2c_rd_bytes(self.i2c.get("bus"), self.i2c.get("loc"), + self.i2c.get("offset"), + self.i2c.get("size")) + elif self.config: + ret = self.config + elif self.func: + ret = get_func_value(self.func.get("funcname"), + self.func.get("params")) + elif self.pci: + ret = read_pci_reg(self.pci.get("bus"), self.pci.get("slot"), + self.pci.get("fn"), self.pci.get("bar"), self.pci.get("offset")) + elif self.devfile: + ret = devfileread(self.devfile.get("loc"), self.devfile.get("offset"), + self.devfile.get("len"), self.devfile.get("bit_width")) + + except Exception as e: + # printerr(e.message) + return "ERR %s" % str(e) + return self.exe_callback(ret) + + def exe_callback(self, data): + try: + if self.callback: + method = getattr(self.call, self.callback) + return method(data) + except Exception: + return "ERR run callback method: {} error, data: {}".format(self.callback, data) + return data + + def read_file(self): + if self.pattern is not None: + return find_match(self.file, self.pattern) + return readaline(self.file) + + def hunt(self): + if self.ignore: + return + indent = self.level * INDENT * " " + + if self.precheck: + try: + ret = get_func_value(self.precheck.get("funcname"), self.precheck.get("params")) + if ret is not True: + return + except Exception as e: + err_msg = "ERR %s" % str(e) + format_str = "{}{:<{}}{}".format(indent, self.key + ':', + (30 - len(indent)), err_msg) + print(format_str) + return + # has children + if self.children: + self.children.sort(key=sort_key) + format_str = "{}{}:".format(indent, self.key) + print(format_str) + for child in self.children: + if not isinstance(child, VersionHunter): + continue + child.level = self.level + 1 + child.hunt() + else: + version = self.get_version() or "" + if not version.startswith("ERR"): + version = version.replace("\x00", "").strip() + if self.separator is not None: + version = get_pair_val(version, self.separator) + if self.delspace is not None: + version = version.replace(" ", "") + if self.regular is not None: + version = get_regular_val(version, self.regular, self.group) + if self.decode is not None: + tmp_version = self.decode.get(version) + if tmp_version is None: + version = "ERR decode %s failed" % version + else: + version = tmp_version + format_str = "{}{:<{}}{}".format(indent, self.key + ':', + (30 - len(indent)), version) + print(format_str) + + if self.next: + print("") + self.next.hunt() + + +pidfile = 0 + + +def ApplicationInstance(): + global pidfile + pidfile = open(os.path.realpath(__file__), "r") + try: + fcntl.flock(pidfile, fcntl.LOCK_EX | fcntl.LOCK_NB) + return True + except Exception: + return False + + +def run(): + if os.geteuid() != 0: + print("Root privileges are required for this operation") + sys.exit(1) + + start_time = time.time() + while True: + ret = ApplicationInstance() + if ret is True: + break + if time.time() - start_time > 10: + printerr("manufacturer is running.") + sys.exit(1) + time.sleep(0.5) + + objmap = {} + + try: + target = {} + target.update(MANUINFO_CONF) + for objname, value in target.items(): + objmap[objname] = VersionHunter(value) + except Exception as e: + printerr(str(e)) + sys.exit(1) + + head = None + for objname, obj in objmap.items(): + if head is None and obj.head: + head = obj + if obj.parent: + objmap.get(obj.parent).children.append(obj) + if obj.next: + obj.next = objmap.get(obj.next) + + head.hunt() + + +if __name__ == "__main__": + run() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_process.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_process.py new file mode 100755 index 000000000000..6013c5d65853 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_process.py @@ -0,0 +1,413 @@ +#!/usr/bin/env python3 +import os +import subprocess +import glob +import time +import click +import shutil +from platform_config import STARTMODULE, MAC_LED_RESET, AIRFLOW_RESULT_FILE +from platform_config import GLOBALINITPARAM, GLOBALINITCOMMAND, GLOBALINITPARAM_PRE, GLOBALINITCOMMAND_PRE +from platform_util import wbpciwr + + +CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']} + + +class AliasedGroup(click.Group): + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + if len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + return None + + +def log_os_system(cmd): + status, output = subprocess.getstatusoutput(cmd) + if status: + print(output) + return status, output + + +def write_sysfs_value(reg_name, value): + mb_reg_file = "/sys/bus/i2c/devices/" + reg_name + locations = glob.glob(mb_reg_file) + if len(locations) == 0: + print("%s not found" % mb_reg_file) + return False + sysfs_loc = locations[0] + try: + with open(sysfs_loc, 'w') as fd: + fd.write(value) + except Exception: + return False + return True + + +def getPid(name): + ret = [] + for dirname in os.listdir('/proc'): + if dirname == 'curproc': + continue + try: + with open('/proc/{}/cmdline'.format(dirname), mode='r') as fd: + content = fd.read() + except Exception: + continue + if name in content: + ret.append(dirname) + return ret + + +def startAvscontrol(): + if STARTMODULE.get('avscontrol', 0) == 1: + cmd = "nohup avscontrol.py start >/dev/null 2>&1 &" + rets = getPid("avscontrol.py") + if len(rets) == 0: + log_os_system(cmd) + + +def startFanctrol(): + if STARTMODULE.get('fancontrol', 0) == 1: + cmd = "nohup fancontrol.py start >/dev/null 2>&1 &" + rets = getPid("fancontrol.py") + if len(rets) == 0: + log_os_system(cmd) + + +def starthal_fanctrl(): + if STARTMODULE.get('hal_fanctrl', 0) == 1: + cmd = "nohup hal_fanctrl.py start >/dev/null 2>&1 &" + rets = getPid("hal_fanctrl.py") + if len(rets) == 0: + log_os_system(cmd) + + +def starthal_ledctrl(): + if STARTMODULE.get('hal_ledctrl', 0) == 1: + cmd = "nohup hal_ledctrl.py start >/dev/null 2>&1 &" + rets = getPid("hal_ledctrl.py") + if len(rets) == 0: + log_os_system(cmd) + + +def startDevmonitor(): + if STARTMODULE.get('dev_monitor', 0) == 1: + cmd = "nohup dev_monitor.py start >/dev/null 2>&1 &" + rets = getPid("dev_monitor.py") + if len(rets) == 0: + log_os_system(cmd) + + +def startSlotmonitor(): + if STARTMODULE.get('slot_monitor', 0) == 1: + cmd = "nohup slot_monitor.py start >/dev/null 2>&1 &" + rets = getPid("slot_monitor.py") + if len(rets) == 0: + log_os_system(cmd) + + +def startIntelligentmonitor(): + if STARTMODULE.get('intelligent_monitor', 0) == 1: + cmd = "nohup intelligent_monitor.py >/dev/null 2>&1 &" + rets = getPid("intelligent_monitor.py") + if len(rets) == 0: + log_os_system(cmd) + + +def startSignalmonitor(): + if STARTMODULE.get('signal_monitor', 0) == 1: + cmd = "nohup signal_monitor.py start >/dev/null 2>&1 &" + rets = getPid("signal_monitor.py") + if len(rets) == 0: + log_os_system(cmd) + + +def startSff_temp_polling(): + if STARTMODULE.get('sff_temp_polling', 0) == 1: + cmd = "nohup sfp_highest_temperatue.py >/dev/null 2>&1 &" + rets = getPid("sfp_highest_temperatue.py") + if len(rets) == 0: + log_os_system(cmd) + + +def startRebootCause(): + if STARTMODULE.get('reboot_cause', 0) == 1: + cmd = "nohup reboot_cause.py >/dev/null 2>&1 &" + rets = getPid("reboot_cause.py") + if len(rets) == 0: + log_os_system(cmd) + + +def startPMON_sys(): + if STARTMODULE.get('pmon_syslog', 0) == 1: + cmd = "nohup pmon_syslog.py >/dev/null 2>&1 &" + rets = getPid("pmon_syslog.py") + if len(rets) == 0: + log_os_system(cmd) + + +def startSff_polling(): + if STARTMODULE.get('sff_polling', 0) == 1: + cmd = "nohup sff_polling.py start > /dev/null 2>&1 &" + rets = getPid("sff_polling.py") + if len(rets) == 0: + log_os_system(cmd) + + +def generate_air_flow(): + cmd = "nohup generate_airflow.py > /dev/null 2>&1 &" + rets = getPid("generate_airflow.py") + if len(rets) == 0: + log_os_system(cmd) + time.sleep(1) + + +def startGenerate_air_flow(): + if STARTMODULE.get('generate_airflow', 0) == 1: + for i in range(10): + generate_air_flow() + if os.path.exists(AIRFLOW_RESULT_FILE): + click.echo("%%WB_PLATFORM_PROCESS: generate air flow success") + return + time.sleep(1) + click.echo("%%WB_PLATFORM_PROCESS: generate air flow,failed, %s not exits" % AIRFLOW_RESULT_FILE) + return + + +def start_tty_console(): + if STARTMODULE.get('tty_console', 0) == 1: + cmd = "nohup tty_console.py > /dev/null 2>&1 &" + rets = getPid("tty_console.py") + if len(rets) == 0: + log_os_system(cmd) + +def startDrvUpdate(): + if STARTMODULE.get('drv_update', 0) == 1: + cmd = "nohup drv_update.py >/dev/null 2>&1 &" + rets = getPid("drv_update.py") + if len(rets) == 0: + log_os_system(cmd) + + +def stopAvscontrol(): + if STARTMODULE.get('avscontrol', 0) == 1: + rets = getPid("avscontrol.py") + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stopFanctrol(): + if STARTMODULE.get('fancontrol', 0) == 1: + rets = getPid("fancontrol.py") # + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stophal_fanctrl(): + if STARTMODULE.get('hal_fanctrl', 0) == 1: + rets = getPid("hal_fanctrl.py") + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stophal_ledctrl(): + if STARTMODULE.get('hal_ledctrl', 0) == 1: + rets = getPid("hal_ledctrl.py") + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stopDevmonitor(): + if STARTMODULE.get('dev_monitor', 0) == 1: + rets = getPid("dev_monitor.py") # + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stopSlotmonitor(): + if STARTMODULE.get('slot_monitor', 0) == 1: + rets = getPid("slot_monitor.py") # + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stopIntelligentmonitor(): + if STARTMODULE.get('intelligent_monitor', 0) == 1: + rets = getPid("intelligent_monitor.py") + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stopSignalmonitor(): + if STARTMODULE.get('signal_monitor', 0) == 1: + rets = getPid("signal_monitor.py") # + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stopSff_temp_polling(): + if STARTMODULE.get('sff_temp_polling', 0) == 1: + rets = getPid("sfp_highest_temperatue.py") + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stopPMON_sys(): + if STARTMODULE.get('pmon_syslog', 0) == 1: + rets = getPid("pmon_syslog.py") + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stopRebootCause(): + if STARTMODULE.get('reboot_cause', 0) == 1: + rets = getPid("reboot_cause.py") + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stopSff_polling(): + if STARTMODULE.get('sff_polling', 0) == 1: + rets = getPid("sff_polling.py") + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stopGenerate_air_flow(): + if STARTMODULE.get('generate_airflow', 0) == 1: + rets = getPid("generate_airflow.py") + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def stop_tty_console(): + if STARTMODULE.get('tty_console', 0) == 1: + rets = getPid("tty_console.py") + for ret in rets: + cmd = "kill " + ret + log_os_system(cmd) + + +def otherinit(): + for index in GLOBALINITPARAM: + write_sysfs_value(index["loc"], index["value"]) + + for index in GLOBALINITCOMMAND: + log_os_system(index) + + +def otherinit_pre(): + for index in GLOBALINITPARAM_PRE: + write_sysfs_value(index["loc"], index["value"]) + + for index in GLOBALINITCOMMAND_PRE: + log_os_system(index) + + +def unload_apps(): + stopSff_polling() + stopPMON_sys() + stopSignalmonitor() + stopIntelligentmonitor() + stopSlotmonitor() + stopDevmonitor() + stopAvscontrol() + stophal_ledctrl() + stophal_fanctrl() + stopFanctrol() + stopSff_temp_polling() + stopRebootCause() + stop_tty_console() + stopGenerate_air_flow() + + +def MacLedSet(data): + '''write pci register''' + pcibus = MAC_LED_RESET.get("pcibus") + slot = MAC_LED_RESET.get("slot") + fn = MAC_LED_RESET.get("fn") + resource = MAC_LED_RESET.get("bar") + offset = MAC_LED_RESET.get("offset") + val = MAC_LED_RESET.get(data, None) + if val is None: + click.echo("%%WB_PLATFORM_PROCESS-INIT: MacLedSet wrong input") + return + wbpciwr(pcibus, slot, fn, resource, offset, val) + + +def copy_machineconf(): + try: + shutil.copyfile("/host/machine.conf", "/etc/sonic/machine.conf") + return True + except Exception: + return False + +def load_apps(): + copy_machineconf() + otherinit_pre() + startDrvUpdate() + startGenerate_air_flow() + start_tty_console() + startRebootCause() + startSff_temp_polling() + startFanctrol() + starthal_fanctrl() + starthal_ledctrl() + startAvscontrol() + startDevmonitor() + startSlotmonitor() + startIntelligentmonitor() + startSignalmonitor() + startPMON_sys() + startSff_polling() + otherinit() + if STARTMODULE.get("macledreset", 0) == 1: + MacLedSet("reset") + + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''device operator''' + + +@main.command() +def start(): + '''load process ''' + load_apps() + + +@main.command() +def stop(): + '''stop process ''' + unload_apps() + + +@main.command() +def restart(): + '''restart process''' + unload_apps() + load_apps() + + +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_sensors.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_sensors.py new file mode 100755 index 000000000000..cea20393195f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_sensors.py @@ -0,0 +1,283 @@ +#!/usr/bin/python3 + +import os +import sys +import importlib.machinery + + +def get_machine_info(): + if not os.path.isfile('/host/machine.conf'): + return None + machine_vars = {} + with open('/host/machine.conf') as machine_file: + for line in machine_file: + tokens = line.split('=') + if len(tokens) < 2: + continue + machine_vars[tokens[0]] = tokens[1].strip() + return machine_vars + + +def get_platform_info(machine_info): + if machine_info is not None: + if 'onie_platform' in machine_info: + return machine_info['onie_platform'] + if 'aboot_platform' in machine_info: + return machine_info['aboot_platform'] + return None + + +PLATFORM_ROOT_PATH = '/usr/share/sonic/device' +PLATFORM_SPECIFIC_MODULE_NAME = 'monitor' +PLATFORM_SPECIFIC_CLASS_NAME = 'status' +platform_status_class = None +platform = None + + +def get_platform_name(): + global platform + platform = get_platform_info(get_machine_info()) + return platform + + +val = get_platform_name() +sys.path.append("/".join([PLATFORM_ROOT_PATH, platform])) + +# Loads platform specific sfputil module from source + + +def load_platform_monitor(): + global platform_status_class + platform_name = get_platform_info(get_machine_info()) + platform_path = "/".join([PLATFORM_ROOT_PATH, platform_name]) + try: + module_file = "/".join([platform_path, PLATFORM_SPECIFIC_MODULE_NAME + ".py"]) + module = importlib.machinery.SourceFileLoader(PLATFORM_SPECIFIC_MODULE_NAME, module_file).load_module() + except IOError: + return -1 + try: + platform_status_class = getattr(module, PLATFORM_SPECIFIC_CLASS_NAME) + except AttributeError: + return -2 + return 0 + + +def printerr(msg): + print("\033[0;31m%s\033[0m" % msg) + + +def print_console(msg): + print(msg) + + +val_t = load_platform_monitor() +if val_t != 0: + raise Exception("load monitor.py error") + + +def print_platform(): + platform_info = get_platform_name() + print_console(platform_info) + print_console("") + + +def print_cputemp_sensors(): + val_ret = get_call_value_by_function("getcputemp") + print_info_str = "" + toptile = "Onboard coretemp Sensors:" + formatstr = " {name:<20} : {temp} C (high = {max} C , crit = {crit} C )" + + if len(val_ret) != 0: + print_info_str += toptile + '\n' + for item in val_ret: + print_info_str += formatstr.format(**item) + '\n' + print_console(print_info_str) + + +def print_boardtemp(): + val_ret = get_call_value_by_function("getTemp") + print_info_str = "" + toptile = "Onboard Temperature Sensors:" + errformat = " {id:<20} : {errmsg}" + formatstr = " {id:<20} : {temp1_input} C (high = {temp1_max} C, hyst = {temp1_max_hyst} C)" + + if len(val_ret) != 0: + print_info_str += toptile + '\n' + for item in val_ret: + realformat = formatstr if item.get('errcode', 0) == 0 else errformat + print_info_str += realformat.format(**item) + '\n' + print_console(print_info_str) + + +def print_mactemp_sensors(): + val_ret = get_call_value_by_function("getmactemp") + print_info_str = "" + toptile = "Onboard MAC Temperature Sensors:" + errformat = " {id:<20} : {errmsg}" + formatstr = " {id:<20} : {temp_input} C" + + if len(val_ret) != 0: + print_info_str += toptile + '\n' + for item in val_ret: + realformat = formatstr if item.get('errcode', 0) == 0 else errformat + print_info_str += realformat.format(**item) + '\n' + print_console(print_info_str) + + +def print_macpower_sensors(): + val_ret = get_call_value_by_function("getmacpower") + print_info_str = "" + toptile = "Onboard MAC Power Sensors:" + errformat = " {id:<20} : {errmsg}" + formatstr = " {id:<20} : {power_input} W" + + if len(val_ret) != 0: + print_info_str += toptile + '\n' + for item in val_ret: + realformat = formatstr if item.get('errcode', 0) == 0 else errformat + print_info_str += realformat.format(**item) + '\n' + print_console(print_info_str) + + +def print_fan_sensor(): + val_ret = get_call_value_by_function("checkFan") + print_info_str = "" + toptile = "Onboard fan Sensors:" + errformat = " {id} : {errmsg}\n" # " {id:<20} : {errmsg}" + fan_signle_rotor_format = " {id} : \n" \ + " fan_type : {fan_type}\n" \ + " sn : {sn}\n" \ + " hw_version: {hw_version}\n" \ + " Speed : {Speed} RPM\n" \ + " status : {errmsg} \n" + fan_double_rotor_format = " {id} : \n" \ + " fan_type : {fan_type}\n" \ + " sn : {sn}\n" \ + " hw_version: {hw_version}\n" \ + " Speed :\n" \ + " speed_front : {rotor1_speed:<5} RPM\n" \ + " speed_rear : {rotor2_speed:<5} RPM\n" \ + " status : {errmsg} \n" + + if len(val_ret) != 0: + print_info_str += toptile + '\n' + for item in val_ret: + if item.get('Speed', None) is None: + realformat = fan_double_rotor_format if item.get('errcode', 0) == 0 else errformat + else: + realformat = fan_signle_rotor_format if item.get('errcode', 0) == 0 else errformat + print_info_str += realformat.format(**item) + print_console(print_info_str) + + +def print_psu_sensor(): + val_ret = get_call_value_by_function("getPsu") + print_info_str = "" + toptile = "Onboard Power Supply Unit Sensors:" + errformat = " {id} : {errmsg}\n" # " {id:<20} : {errmsg}" + psuformat = " {id} : \n" \ + " type : {type1}\n" \ + " sn : {sn}\n" \ + " in_current : {in_current} A\n" \ + " in_voltage : {in_voltage} V\n" \ + " out_current: {out_current} A\n" \ + " out_voltage: {out_voltage} V\n" \ + " temp : {temp} C \n" \ + " fan_speed : {fan_speed} RPM\n" \ + " in_power : {in_power} W\n" \ + " out_power : {out_power} W\n" + + if len(val_ret) != 0: + print_info_str += toptile + '\r\n' + for item in val_ret: + realformat = psuformat if item.get('errcode', 0) == 0 else errformat + print_info_str += realformat.format(**item) + print_console(print_info_str) + +def print_cust_psu_sensor(): + val_ret = get_call_value_by_function("getCustPsu") + print_info_str = "" + toptile = "Onboard Power Supply Unit Sensors:" + errformat = " {id} : {errmsg}\n" # " {id:<20} : {errmsg}" + psuformat = " {id} : \n" \ + " Model : {type1}\n" \ + " Serial : {sn}\n" \ + " HW Rev : {hw_version}\n" \ + " Status : {errmsg}\n" + + if len(val_ret) != 0: + print_info_str += toptile + '\r\n' + for item in val_ret: + realformat = psuformat if item.get('errcode', 0) == 0 else errformat + print_info_str += realformat.format(**item) + print_console(print_info_str) + + +def print_slot_sensor(): + val_ret = get_call_value_by_function("checkSlot") + print_info_str = "" + toptile = "Onboard slot Sensors:" + errformat = " {id} : {errmsg}\n" # " {id:<20} : {errmsg}" + psuformat = " {id} : \n" \ + " slot_type : {slot_type}\n" \ + " sn : {sn}\n" \ + " hw_version : {hw_version} \n" \ + " status : {errmsg}\n" + + if len(val_ret) != 0: + print_info_str += toptile + '\r\n' + for item in val_ret: + realformat = psuformat if item.get('errcode', 0) == 0 else errformat + print_info_str += realformat.format(**item) + print_console(print_info_str) + + +def print_boarddcdc(): + val_ret = get_call_value_by_function("getDcdc") + print_info_str = "" + toptile = "Onboard DCDC Sensors:" + errformat = " {id:<26} : {errmsg}" + ok_formatstr = " {id:<26} : {dcdc_input:<6} {dcdc_unit:<1} (Min = {dcdc_min:<6} {dcdc_unit:<1}, Max = {dcdc_max:<6} {dcdc_unit:<1})" + nok_formatstr = " {id:<26} : {dcdc_input:<6} {dcdc_unit:<1} (Min = {dcdc_min:<6} {dcdc_unit:<1}, Max = {dcdc_max:<6} {dcdc_unit:<1}) ({dcdc_status:<6})" + + if len(val_ret) != 0: + print_info_str += toptile + '\n' + for item in val_ret: + if item.get('errcode', 0) == 0: + if float(item["dcdc_input"]) > float(item["dcdc_max"]) or float(item["dcdc_input"]) < float(item["dcdc_min"]): + item["dcdc_status"] = "NOT OK" + realformat = nok_formatstr + else: + realformat = ok_formatstr + else: + realformat = errformat + print_info_str += realformat.format(**item) + '\n' + print_console(print_info_str) + + +def get_call_value_by_function(function_name): + valtemp = [] + if hasattr(platform_status_class, function_name): + test2_func = getattr(platform_status_class, function_name) + test2_func(valtemp) + return valtemp + + +def getsensors(): + print_platform() + print_cputemp_sensors() + print_boardtemp() + print_mactemp_sensors() + print_macpower_sensors() + print_fan_sensor() + print_psu_sensor() + print_cust_psu_sensor() + print_slot_sensor() + print_boarddcdc() + + +if __name__ == "__main__": + if os.geteuid() != 0: + print("Root privileges are required for this operation") + sys.exit(1) + getsensors() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_test.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_test.py new file mode 100755 index 000000000000..da7119a9ce49 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_test.py @@ -0,0 +1,142 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- + +try: + import click + from platform_intf import platform_reg_read, platform_reg_write, platform_get_optoe_type + from platform_intf import platform_set_optoe_type, platform_sfp_read, platform_sfp_write +except ImportError as error: + raise ImportError('%s - required module not found' % str(error)) from error + + +CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']} + + +class AliasedGroup(click.Group): + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + if len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + return None + + +def print_reg(info, offset): + try: + size = len(info) + j = offset % 16 + tmp = j + offset -= j + print_buf = "\n " + + for i in range(16): + print_buf = print_buf + "%2x " % i + print(print_buf) + + print_buf = None + for i in range(size + j): + if i % 16 == 0: + print_buf = "" + print_buf = "0x%08x " % offset + offset = offset + 16 + if tmp: + print_buf = print_buf + " " + tmp = tmp - 1 + else: + print_buf = print_buf + "%02x " % info[i - j] + if (i + 1) % 16 == 0 or i == size + j - 1: + print(print_buf) + except Exception as e: + msg = str(e) + print("i = %d, j = %d," % (i, j)) + print(msg) + + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''platform_test main''' + + +@main.command() +@click.argument('dev_type', required=True) +@click.argument('dev_id', required=True) +@click.argument('offset', required=True) +@click.argument('size', required=True) +def reg_rd(dev_type, dev_id, offset, size): + '''read cpld/fpga reg''' + ret, info = platform_reg_read(int(dev_type), int(dev_id), int(offset), int(size)) + print(ret) + if ret is True: + print_reg(info, int(offset)) + else: + print(info) + + +@main.command() +@click.argument('dev_type', required=True) +@click.argument('dev_id', required=True) +@click.argument('offset', required=True) +@click.argument('value', required=True) +def reg_wr(dev_type, dev_id, offset, value): + '''write cpld/fpga reg''' + value_list = [] + value_list.append(int(value)) + ret, info = platform_reg_write(int(dev_type), int(dev_id), int(offset), value_list) + print(ret) + print(info) + + +@main.command() +@click.argument('port', required=True) +def get_optoe_type(port): + '''get optoe type''' + ret, info = platform_get_optoe_type(int(port)) + print(ret) + print(info) + + +@main.command() +@click.argument('port', required=True) +@click.argument('optoe_type', required=True) +def set_optoe_type(port, optoe_type): + '''set optoe type''' + ret, info = platform_set_optoe_type(int(port), int(optoe_type)) + print(ret) + print(info) + + +@main.command() +@click.argument('port_id', required=True) +@click.argument('offset', required=True) +@click.argument('size', required=True) +def sfp_rd(port_id, offset, size): + '''read sfp''' + ret, info = platform_sfp_read(int(port_id), int(offset), int(size)) + print(ret) + if ret is True: + print_reg(info, int(offset)) + else: + print(info) + + +@main.command() +@click.argument('port_id', required=True) +@click.argument('offset', required=True) +@click.argument('value', required=True) +def sfp_wr(port_id, offset, value): + '''write sfp''' + value_list = [] + value_list.append(int(value)) + ret, info = platform_sfp_write(int(port_id), int(offset), value_list) + print(ret) + print(info) + + +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/platform_util.py b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_util.py new file mode 100755 index 000000000000..fe4d564ad604 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/platform_util.py @@ -0,0 +1,838 @@ +#!/usr/bin/python3 + +import sys +import os +import re +import subprocess +import shlex +import time +import mmap +import glob +import logging.handlers +import shutil +import gzip +import ast + + +CONFIG_DB_PATH = "/etc/sonic/config_db.json" +MAILBOX_DIR = "/sys/bus/i2c/devices/" + + +__all__ = [ + "strtoint", + "byteTostr", + "getplatform_name", + "wbi2cget", + "wbi2cset", + "wbpcird", + "wbpciwr", + "wbi2cgetWord", + "wbi2csetWord", + "wbi2cset_pec", + "wbi2cset_wordpec", + "wbsysset", + "dev_file_read", + "dev_file_write", + "wb_os_system", + "io_rd", + "io_wr", + "exec_os_cmd", + "exec_os_cmd_log", + "write_sysfs", + "read_sysfs", + "get_sysfs_value", + "write_sysfs_value", + "get_value", + "set_value", + "getSdkReg", + "getMacTemp", + "getMacTemp_sysfs", + "get_format_value" +] + +class CodeVisitor(ast.NodeVisitor): + + def __init__(self): + self.value = None + + def get_value(self): + return self.value + + def get_op_value(self, node): + if isinstance(node, ast.Call): # node is func call + value = self.visit_Call(node) + elif isinstance(node, ast.BinOp): # node is BinOp + value = self.visit_BinOp(node) + elif isinstance(node, ast.UnaryOp): # node is UnaryOp + value = self.visit_UnaryOp(node) + elif isinstance(node, ast.Num): # node is Num Constant + value = node.n + elif isinstance(node, ast.Str): # node is Str Constant + value = node.s + else: + raise NotImplementedError("Unsupport operand type: %s" % type(node)) + return value + + def visit_UnaryOp(self, node): + ''' + node.op: operand type, only support ast.UAdd/ast.USub + node.operand: only support ast.Call/ast.Constant(ast.Num/ast.Str)/ast.BinOp/ast.UnaryOp + ''' + + operand_value = self.get_op_value(node.operand) + if isinstance(node.op, ast.UAdd): + self.value = operand_value + elif isinstance(node.op, ast.USub): + self.value = 0 - operand_value + else: + raise NotImplementedError("Unsupport arithmetic methods %s" % type(node.op)) + return self.value + + def visit_BinOp(self, node): + ''' + node.left: left operand, only support ast.Call/ast.Constant(ast.Num)/ast.BinOp + node.op: operand type, only support ast.Add/ast.Sub/ast.Mult/ast.Div + node.right: right operan, only support ast.Call/ast.Constant(ast.Num/ast.Str)/ast.BinOp + ''' + left_value = self.get_op_value(node.left) + right_value = self.get_op_value(node.right) + + if isinstance(node.op, ast.Add): + self.value = left_value + right_value + elif isinstance(node.op, ast.Sub): + self.value = left_value - right_value + elif isinstance(node.op, ast.Mult): + self.value = left_value * right_value + elif isinstance(node.op, ast.Div): + self.value = left_value / right_value + else: + raise NotImplementedError("Unsupport arithmetic methods %s" % type(node.op)) + return self.value + + def visit_Call(self, node): + ''' + node.func.id: func name, only support 'float', 'int', 'str' + node.args: func args list,only support ast.Constant(ast.Num/ast.Str)/ast.BinOp/ast.Call + str/float only support one parameter, eg: float(XXX), str(xxx) + int support one or two parameters, eg: int(xxx) or int(xxx, 16) + xxx can be ast.Call/ast.Constant(ast.Num/ast.Str)/ast.BinOp + ''' + calc_tuple = ("float", "int", "str") + + if node.func.id not in calc_tuple: + raise NotImplementedError("Unsupport function call type: %s" % node.func.id) + + args_val_list = [] + for item in node.args: + ret = self.get_op_value(item) + args_val_list.append(ret) + + if node.func.id == "str": + if len(args_val_list) != 1: + raise TypeError("str() takes 1 positional argument but %s were given" % len(args_val_list)) + value = str(args_val_list[0]) + self.value = value + return value + + if node.func.id == "float": + if len(args_val_list) != 1: + raise TypeError("float() takes 1 positional argument but %s were given" % len(args_val_list)) + value = float(args_val_list[0]) + self.value = value + return value + # int + if len(args_val_list) == 1: + value = int(args_val_list[0]) + self.value = value + return value + if len(args_val_list) == 2: + value = int(args_val_list[0], args_val_list[1]) + self.value = value + return value + raise TypeError("int() takes 1 or 2 arguments (%s given)" % len(args_val_list)) + +def inttostr(vl, length): + if not isinstance(vl, int): + raise Exception(" type error") + index = 0 + ret_t = "" + while index < length: + ret = 0xff & (vl >> index * 8) + ret_t += chr(ret) + index += 1 + return ret_t + + +def strtoint(str_tmp): + value = 0 + rest_v = str_tmp.replace("0X", "").replace("0x", "") + str_len = len(rest_v) + for index, val in enumerate(rest_v): + value |= int(val, 16) << ((str_len - index - 1) * 4) + return value + + +def inttobytes(val, length): + if not isinstance(val, int): + raise Exception("type error") + data_array = bytearray() + index = 0 + while index < length: + ret = 0xff & (val >> index * 8) + data_array.append(ret) + index += 1 + return data_array + + +def byteTostr(val): + strtmp = '' + for value in val: + strtmp += chr(value) + return strtmp + + +def typeTostr(val): + strtmp = '' + if isinstance(val, bytes): + strtmp = byteTostr(val) + return strtmp + + +def getonieplatform(path): + if not os.path.isfile(path): + return "" + machine_vars = {} + with open(path) as machine_file: + for line in machine_file: + tokens = line.split('=') + if len(tokens) < 2: + continue + machine_vars[tokens[0]] = tokens[1].strip() + return machine_vars.get("onie_platform") + + +def getplatform_config_db(): + if not os.path.isfile(CONFIG_DB_PATH): + return "" + val = subprocess.check_output(["sonic-cfggen", "-j", CONFIG_DB_PATH, "-v", "DEVICE_METADATA.localhost.platform"]).decode().strip() + if len(val) <= 0: + return "" + return val + + +def getplatform_name(): + if os.path.isfile('/host/machine.conf'): + return getonieplatform('/host/machine.conf') + if os.path.isfile('/etc/sonic/machine.conf'): + return getonieplatform('/etc/sonic/machine.conf') + return getplatform_config_db() + + +def wbi2cget(bus, devno, address, word=None): + if word is None: + command_line = "i2cget -f -y %d 0x%02x 0x%02x " % (bus, devno, address) + else: + command_line = "i2cget -f -y %d 0x%02x 0x%02x %s" % (bus, devno, address, word) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = wb_os_system(command_line) + if ret == 0: + return True, ret_t + time.sleep(0.1) + return False, ret_t + + +def wbi2cset(bus, devno, address, byte): + command_line = "i2cset -f -y %d 0x%02x 0x%02x 0x%02x" % ( + bus, devno, address, byte) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = wb_os_system(command_line) + if ret == 0: + return True, ret_t + return False, ret_t + + +def wbpcird(pcibus, slot, fn, resource, offset): + '''read pci register''' + if offset % 4 != 0: + return "ERR offset: %d not 4 bytes align" + filename = "/sys/bus/pci/devices/0000:%02x:%02x.%x/resource%d" % (int(pcibus), int(slot), int(fn), int(resource)) + with open(filename, "r+") as file: + size = os.path.getsize(filename) + data = mmap.mmap(file.fileno(), size) + result = data[offset: offset + 4] + s = result[::-1] + val = 0 + for value in s: + val = val << 8 | value + data.close() + return "0x%08x" % val + + +def wbpciwr(pcibus, slot, fn, resource, offset, data): + '''write pci register''' + ret = inttobytes(data, 4) + filename = "/sys/bus/pci/devices/0000:%02x:%02x.%x/resource%d" % (int(pcibus), int(slot), int(fn), int(resource)) + with open(filename, "r+") as file: + size = os.path.getsize(filename) + data = mmap.mmap(file.fileno(), size) + data[offset: offset + 4] = ret + result = data[offset: offset + 4] + s = result[::-1] + val = 0 + for value in s: + val = val << 8 | value + data.close() + + +def wbi2cgetWord(bus, devno, address): + command_line = "i2cget -f -y %d 0x%02x 0x%02x w" % (bus, devno, address) + retrytime = 3 + ret_t = "" + for i in range(retrytime): + ret, ret_t = wb_os_system(command_line) + if ret == 0: + return True, ret_t + return False, ret_t + + +def wbi2csetWord(bus, devno, address, byte): + command_line = "i2cset -f -y %d 0x%02x 0x%02x 0x%x w" % ( + bus, devno, address, byte) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = wb_os_system(command_line) + if ret == 0: + return True, ret_t + return False, ret_t + + +def wbi2cset_pec(bus, devno, address, byte): + command_line = "i2cset -f -y %d 0x%02x 0x%02x 0x%02x bp" % ( + bus, devno, address, byte) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = wb_os_system(command_line) + if ret == 0: + return True, ret_t + return False, ret_t + + +def wbi2cset_wordpec(bus, devno, address, byte): + command_line = "i2cset -f -y %d 0x%02x 0x%02x 0x%02x wp" % ( + bus, devno, address, byte) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = wb_os_system(command_line) + if ret == 0: + return True, ret_t + return False, ret_t + + +def wbsysset(location, value): + command_line = "echo 0x%02x > %s" % (value, location) + retrytime = 6 + ret_t = "" + for i in range(retrytime): + ret, ret_t = wb_os_system(command_line) + if ret == 0: + return True, ret_t + return False, ret_t + + +def dev_file_read(path, offset, read_len): + val_list = [] + msg = "" + ret = "" + fd = -1 + + if not os.path.exists(path): + msg = path + " not found !" + return False, msg + + try: + fd = os.open(path, os.O_RDONLY) + os.lseek(fd, offset, os.SEEK_SET) + ret = os.read(fd, read_len) + for item in ret: + val_list.append(item) + except Exception as e: + msg = str(e) + return False, msg + finally: + if fd > 0: + os.close(fd) + return True, val_list + + +def dev_file_write(path, offset, buf_list): + msg = "" + fd = -1 + + if not isinstance(buf_list, list) or len(buf_list) == 0: + msg = "buf:%s is not list type or is NONE !" % buf_list + return False, msg + + if not os.path.exists(path): + msg = path + " not found !" + return False, msg + + try: + fd = os.open(path, os.O_WRONLY) + os.lseek(fd, offset, os.SEEK_SET) + ret = os.write(fd, bytes(buf_list)) + except Exception as e: + msg = str(e) + return False, msg + finally: + if fd > 0: + os.close(fd) + + return True, ret + + +def wb_os_system(cmd): + status, output = subprocess.getstatusoutput(cmd) + return status, output + + +def io_rd(reg_addr, read_len=1): + try: + regaddr = 0 + if isinstance(reg_addr, int): + regaddr = reg_addr + else: + regaddr = int(reg_addr, 16) + devfile = "/dev/port" + fd = os.open(devfile, os.O_RDWR | os.O_CREAT) + os.lseek(fd, regaddr, os.SEEK_SET) + val = os.read(fd, read_len) + return "".join(["%02x" % item for item in val]) + except ValueError: + return None + except Exception as e: + print(e) + return None + finally: + os.close(fd) + + +def io_wr(reg_addr, reg_data): + try: + regdata = 0 + regaddr = 0 + if isinstance(reg_addr, int): + regaddr = reg_addr + else: + regaddr = int(reg_addr, 16) + if isinstance(reg_data, int): + regdata = reg_data + else: + regdata = int(reg_data, 16) + devfile = "/dev/port" + fd = os.open(devfile, os.O_RDWR | os.O_CREAT) + os.lseek(fd, regaddr, os.SEEK_SET) + os.write(fd, regdata.to_bytes(1, 'little')) + return True + except ValueError as e: + print(e) + return False + except Exception as e: + print(e) + return False + finally: + os.close(fd) + + +def exec_os_cmd(cmd): + status, output = subprocess.getstatusoutput(cmd) + return status, output + + +def exec_os_cmd_log(cmd): + proc = subprocess.Popen(shlex.split(cmd), stdin=subprocess.PIPE, shell=False, stderr=sys.stderr, close_fds=True, + stdout=sys.stdout, universal_newlines=True, bufsize=1) + proc.wait() + stdout = proc.communicate()[0] + stdout = typeTostr(stdout) + return proc.returncode, stdout + + +def write_sysfs(location, value): + try: + if not os.path.isfile(location): + return False, ("location[%s] not found !" % location) + with open(location, 'w') as fd1: + fd1.write(value) + except Exception as e: + return False, (str(e) + " location[%s]" % location) + return True, ("set location[%s] %s success !" % (location, value)) + + +def read_sysfs(location): + try: + locations = glob.glob(location) + with open(locations[0], 'rb') as fd1: + retval = fd1.read() + retval = typeTostr(retval) + retval = retval.rstrip('\r\n') + retval = retval.lstrip(" ") + except Exception as e: + return False, (str(e) + "location[%s]" % location) + return True, retval + + +def get_pmc_register(reg_name): + retval = 'ERR' + mb_reg_file = MAILBOX_DIR + reg_name + filepath = glob.glob(mb_reg_file) + if len(filepath) == 0: + return "%s %s notfound" % (retval, mb_reg_file) + mb_reg_file = filepath[0] + if not os.path.isfile(mb_reg_file): + return "%s %s notfound" % (retval, mb_reg_file) + try: + with open(mb_reg_file, 'r') as fd: + retval = fd.read() + except Exception as error: + retval = retval + str(error) + retval = retval.rstrip('\r\n') + retval = retval.lstrip(" ") + return retval + + +def get_sysfs_value(location): + pos_t = str(location) + name = get_pmc_register(pos_t) + return name + + +def write_sysfs_value(reg_name, value): + fileLoc = MAILBOX_DIR + reg_name + try: + if not os.path.isfile(fileLoc): + print(fileLoc, 'not found !') + return False + with open(fileLoc, 'w') as fd: + fd.write(value) + except Exception: + print("Unable to open " + fileLoc + "file !") + return False + return True + + +def get_value_once(config): + try: + way = config.get("gettype") + int_decode = config.get("int_decode", 16) + if way == 'sysfs': + loc = config.get("loc") + ret, val = read_sysfs(loc) + if ret is True: + return True, int(val, int_decode) + return False, ("sysfs read %s failed. log:%s" % (loc, val)) + if way == "i2c": + bus = config.get("bus") + addr = config.get("loc") + offset = config.get("offset", 0) + ret, val = wbi2cget(bus, addr, offset) + if ret is True: + return True, int(val, int_decode) + return False, ("i2c read failed. bus:%d , addr:0x%x, offset:0x%x" % (bus, addr, offset)) + if way == "io": + io_addr = config.get('io_addr') + val = io_rd(io_addr) + if len(val) != 0: + return True, int(val, int_decode) + return False, ("io_addr read 0x%x failed" % io_addr) + if way == "i2cword": + bus = config.get("bus") + addr = config.get("loc") + offset = config.get("offset") + ret, val = wbi2cgetWord(bus, addr, offset) + if ret is True: + return True, int(val, int_decode) + return False, ("i2cword read failed. bus:%d, addr:0x%x, offset:0x%x" % (bus, addr, offset)) + if way == "devfile": + path = config.get("path") + offset = config.get("offset") + read_len = config.get("read_len") + ret, val_list = dev_file_read(path, offset, read_len) + if ret is True: + return True, val_list + return False, ("devfile read failed. path:%s, offset:0x%x, read_len:%d" % (path, offset, read_len)) + if way == 'cmd': + cmd = config.get("cmd") + ret, val = exec_os_cmd(cmd) + if ret: + return False, ("cmd read exec %s failed, log: %s" % (cmd, val)) + return True, int(val, int_decode) + if way == 'file_exist': + judge_file = config.get('judge_file', None) + if os.path.exists(judge_file): + return True, True + return True, False + return False, "not support read type" + except Exception as e: + return False, ("get_value_once exception:%s happen" % str(e)) + + +def set_value_once(config): + try: + delay_time = config.get("delay", None) + if delay_time is not None: + time.sleep(delay_time) + + way = config.get("gettype") + if way == 'sysfs': + loc = config.get("loc") + value = config.get("value") + mask = config.get("mask", 0xff) + mask_tuple = (0xff, 0) + if mask not in mask_tuple: + ret, read_value = read_sysfs(loc) + if ret is True: + read_value = int(read_value, base=16) + value = (read_value & mask) | value + else: + return False, ("sysfs read %s failed. log:%s" % (loc, read_value)) + ret, log = write_sysfs(loc, "0x%02x" % value) + if ret is not True: + return False, ("sysfs %s write 0x%x failed" % (loc, value)) + return True, ("sysfs write 0x%x success" % value) + if way == "i2c": + bus = config.get("bus") + addr = config.get("loc") + offset = config.get("offset") + value = config.get("value") + mask = config.get("mask", 0xff) + mask_tuple = (0xff, 0) + if mask not in mask_tuple: + ret, read_value = wbi2cget(bus, addr, offset) + if ret is True: + read_value = int(read_value, base=16) + value = (read_value & mask) | value + else: + return False, ("i2c read failed. bus:%d , addr:0x%x, offset:0x%x" % (bus, addr, offset)) + ret, log = wbi2cset(bus, addr, offset, value) + if ret is not True: + return False, ("i2c write bus:%d, addr:0x%x, offset:0x%x, value:0x%x failed" % + (bus, addr, offset, value)) + return True, ("i2c write bus:%d, addr:0x%x, offset:0x%x, value:0x%x success" % + (bus, addr, offset, value)) + if way == "io": + io_addr = config.get('io_addr') + value = config.get('value') + mask = config.get("mask", 0xff) + mask_tuple = (0xff, 0) + if mask not in mask_tuple: + read_value = io_rd(io_addr) + if read_value is None: + return False, ("io_addr 0x%x read failed" % (io_addr)) + read_value = int(read_value, base=16) + value = (read_value & mask) | value + ret = io_wr(io_addr, value) + if ret is not True: + return False, ("io_addr 0x%x write 0x%x failed" % (io_addr, value)) + return True, ("io_addr 0x%x write 0x%x success" % (io_addr, value)) + if way == 'i2cword': + bus = config.get("bus") + addr = config.get("loc") + offset = config.get("offset") + value = config.get("value") + mask = config.get("mask", 0xff) + mask_tuple = (0xff, 0) + if mask not in mask_tuple: + ret, read_value = wbi2cgetWord(bus, addr, offset) + if ret is True: + read_value = int(read_value, base=16) + value = (read_value & mask) | value + else: + return False, ("i2c read word failed. bus:%d , addr:0x%x, offset:0x%x" % (bus, addr, offset)) + ret, log = wbi2csetWord(bus, addr, offset, value) + if ret is not True: + return False, ("i2cword write bus:%d, addr:0x%x, offset:0x%x, value:0x%x failed" % + (bus, addr, offset, value)) + return True, ("i2cword write bus:%d, addr:0x%x, offset:0x%x, value:0x%x success" % + (bus, addr, offset, value)) + if way == "devfile": + path = config.get("path") + offset = config.get("offset") + buf_list = config.get("value") + ret, log = dev_file_write(path, offset, buf_list) + if ret is True: + return True, ("devfile write path:%s, offset:0x%x, buf_list:%s success." % (path, offset, buf_list)) + return False, ("devfile read path:%s, offset:0x%x, buf_list:%s failed.log:%s" % + (path, offset, buf_list, log)) + if way == 'cmd': + cmd = config.get("cmd") + ret, log = exec_os_cmd(cmd) + if ret: + return False, ("cmd write exec %s failed, log: %s" % (cmd, log)) + return True, ("cmd write exec %s success" % cmd) + if way == 'bit_wr': + mask = config.get("mask") + bit_val = config.get("value") + val_config = config.get("val_config") + ret, rd_value = get_value_once(val_config) + if ret is False: + return False, ("bit_wr read failed, log: %s" % rd_value) + wr_val = (rd_value & mask) | bit_val + val_config["value"] = wr_val + ret, log = set_value_once(val_config) + if ret is False: + return False, ("bit_wr failed, log: %s" % log) + return True, ("bit_wr success, log: %s" % log) + if way == 'creat_file': + file_name = config.get("file") + ret, log = exec_os_cmd("touch %s" % file_name) + if ret: + return False, ("creat file %s failed, log: %s" % (file_name, log)) + exec_os_cmd("sync") + return True, ("creat file %s success" % file_name) + if way == 'remove_file': + file_name = config.get("file") + ret, log = exec_os_cmd("rm -rf %s" % file_name) + if ret: + return False, ("remove file %s failed, log: %s" % (file_name, log)) + exec_os_cmd("sync") + return True, ("remove file %s success" % file_name) + return False, "not support write type" + except Exception as e: + return False, ("set_value_once exception:%s happen" % str(e)) + + +def get_value(config): + retrytime = 6 + for i in range(retrytime): + ret, val = get_value_once(config) + if ret is True: + return True, val + time.sleep(0.1) + return False, val + + +def set_value(config): + retrytime = 6 + ignore_result_flag = config.get("ignore_result", 0) + for i in range(retrytime): + ret, log = set_value_once(config) + if ret is True: + return True, log + if ignore_result_flag == 1: + return True, log + time.sleep(0.1) + return False, log + + +class CompressedRotatingFileHandler(logging.handlers.RotatingFileHandler): + def doRollover(self): + """ + Do a rollover, as described in __init__(). + """ + if self.stream: + self.stream.close() + self.stream = None + if self.backupCount > 0: + for i in range(self.backupCount - 1, 0, -1): + sfn = "%s.%d.gz" % (self.baseFilename, i) + dfn = "%s.%d.gz" % (self.baseFilename, i + 1) + if os.path.exists(sfn): + if os.path.exists(dfn): + os.remove(dfn) + os.rename(sfn, dfn) + dfn = self.baseFilename + ".1.gz" + if os.path.exists(dfn): + os.remove(dfn) + # These two lines below are the only new lines. I commented out the os.rename(self.baseFilename, dfn) and + # replaced it with these two lines. + with open(self.baseFilename, 'rb') as f_in, gzip.open(dfn, 'wb') as f_out: + shutil.copyfileobj(f_in, f_out) + self.mode = 'w' + self.stream = self._open() + + +def getSdkReg(reg): + try: + cmd = "bcmcmd -t 1 'getr %s ' < /dev/null" % reg + ret, result = wb_os_system(cmd) + result_t = result.strip().replace("\r", "").replace("\n", "") + if ret != 0 or "Error:" in result_t: + return False, result + patt = r"%s.(.*):(.*)>drivshell" % reg + rt = re.findall(patt, result_t, re.S) + test = re.findall("=(.*)", rt[0][0])[0] + except Exception: + return False, 'getsdk register error' + return True, test + + +def getMacTemp(): + result = {} + wb_os_system("bcmcmd -t 1 \"show temp\" < /dev/null") + ret, log = wb_os_system("bcmcmd -t 1 \"show temp\" < /dev/null") + if ret: + return False, result + logs = log.splitlines() + for line in logs: + if "average" in line: + b = re.findall(r'\d+.\d+', line) + result["average"] = b[0] + elif "maximum" in line: + b = re.findall(r'\d+.\d+', line) + result["maximum"] = b[0] + return True, result + + +def getMacTemp_sysfs(mactempconf): + temp = -1000000 + try: + temp_list = [] + mac_temp_loc = mactempconf.get("loc", []) + mac_temp_flag = mactempconf.get("flag", None) + if mac_temp_flag is not None: + gettype = mac_temp_flag.get('gettype') + okbit = mac_temp_flag.get('okbit') + okval = mac_temp_flag.get('okval') + if gettype == "io": + io_addr = mac_temp_flag.get('io_addr') + val = io_rd(io_addr) + if val is None: + raise Exception("get mac_flag by io failed.") + else: + bus = mac_temp_flag.get('bus') + loc = mac_temp_flag.get('loc') + offset = mac_temp_flag.get('offset') + ind, val = wbi2cget(bus, loc, offset) + if ind is not True: + raise Exception("get mac_flag by i2c failed.") + val_t = (int(val, 16) & (1 << okbit)) >> okbit + if val_t != okval: + raise Exception("mac_flag invalid, val_t:%d." % val_t) + for loc in mac_temp_loc: + temp_s = get_sysfs_value(loc) + if isinstance(temp_s, str) and temp_s.startswith("ERR"): + raise Exception("get mac temp error. loc:%s" % loc) + temp_t = int(temp_s) + if temp_t == -1000000: + raise Exception("mac temp invalid.loc:%s" % loc) + temp_list.append(temp_t) + temp_list.sort(reverse=True) + temp = temp_list[0] + except Exception: + return False, temp + return True, temp + +def get_format_value(format_str): + ast_obj = ast.parse(format_str, mode='eval') + visitor = CodeVisitor() + visitor.visit(ast_obj) + ret = visitor.get_value() + return ret + diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/pmon_syslog.py b/platform/broadcom/sonic-platform-modules-micas/common/script/pmon_syslog.py new file mode 100755 index 000000000000..8bdceef8c1b5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/pmon_syslog.py @@ -0,0 +1,519 @@ +#!/usr/bin/python3 +# * onboard interval check +# * FAN trays +# * PSU +# * SFF +import time +import syslog +import traceback +import glob +from platform_config import PMON_SYSLOG_STATUS + +PMON_DEBUG_FILE = "/etc/.pmon_syslog_debug_flag" +debuglevel = 0 +PMONERROR = 1 +PMONDEBUG = 2 + + +def pmon_debug(s): + if PMONDEBUG & debuglevel: + syslog.openlog("PMON_SYSLOG", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def pmon_error(s): + if PMONERROR & debuglevel: + syslog.openlog("PMON_SYSLOG", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def dev_syslog(s): + syslog.openlog("PMON_SYSLOG", syslog.LOG_PID) + syslog.syslog(syslog.LOG_LOCAL1 | syslog.LOG_NOTICE, s) + + +# status +STATUS_PRESENT = 'PRESENT' +STATUS_ABSENT = 'ABSENT' +STATUS_OK = 'OK' +STATUS_NOT_OK = 'NOT OK' +STATUS_FAILED = 'FAILED' + + +class checkBase(object): + def __init__(self, path, dev_name, display_name, obj_type, config): + self._peroid_syslog = None + self._peroid_failed_syslog = None # exception + self._preDevStatus = None + self._path = path + self._name = dev_name + self._display_name = display_name + self._type = obj_type + self._config = config + + def getCurstatus(self): + # get ok/not ok/absent status + status, log = self.getPresent() + if status == STATUS_PRESENT: + # check status + property_status, log = self.getStatus() + if property_status is not None: + status = property_status + return status, log + + def getPresent(self): + presentFilepath = self.getPath() + try: + # get ok/not ok/absent status + presentConfig = self._config["present"] + mask = presentConfig.get("mask", 0xff) + absent_val = presentConfig.get("ABSENT", None) + absent_val = absent_val & mask + with open(presentFilepath, "r") as fd: + retval = fd.read() + if int(retval) == absent_val: + return STATUS_ABSENT, None + return STATUS_PRESENT, None + except Exception as e: + return STATUS_FAILED, (str(e) + " location[%s]" % presentFilepath) + + def getStatus(self): + if "status" in self._config: + statusConfig = self._config["status"] + for itemConfig in statusConfig: + mask = itemConfig.get("mask", 0xff) + ok_val = itemConfig.get("okval", None) + ok_val = ok_val & mask + Filepath = itemConfig["path"] % self._name + try: + with open(Filepath, "r") as fd1: + retval = fd1.read() + if int(retval) != ok_val: + return STATUS_NOT_OK, None + except Exception as e: + return STATUS_FAILED, (str(e) + " location[%s]" % Filepath) + return STATUS_OK, None + return None, None + + def getPath(self): + return self._path + + def getName(self): + return self._name + + def getType(self): + return self._type + + def getDisplayName(self): + return self._display_name + + def getnochangedMsgFlag(self): + return self._config["nochangedmsgflag"] + + def getnochangedMsgTime(self): + return self._config["nochangedmsgtime"] + + def getnoprintFirstTimeFlag(self): + return self._config["noprintfirsttimeflag"] + + def checkStatus(self): + # syslog msg + dev_type = self.getType() + display_name = self.getDisplayName() + nochangedMsgTime = self.getnochangedMsgTime() + getnochangedMsgFlag = self.getnochangedMsgFlag() + noprintFirstTimeFlag = self.getnoprintFirstTimeFlag() + MSG_IN = '%%PMON-5-' + dev_type + '_PLUG_IN: %s is PRESENT.' + MSG_OUT = '%%PMON-5-' + dev_type + '_PLUG_OUT: %s is ABSENT.' + MSG_OK = '%%PMON-5-' + dev_type + '_OK: %s is OK.' + MSG_NOT_OK = '%%PMON-5-' + dev_type + '_FAILED: %s is NOT OK.' + MSG_ABSENT = '%%PMON-5-' + dev_type + '_ABSENT: %s is ABSENT.' + MSG_UNKNOWN = '%%PMON-5-' + dev_type + '_UNKNOWN: %s is UNKNOWN.%s' + MSG_RECOVER = '%%PMON-5-' + dev_type + '_OK: %s is OK. Recover from ' + dev_type + ' FAILED.' + + curStatus, log = self.getCurstatus() + pmon_debug("%s: current status %s" % (display_name, curStatus)) + pmon_debug("%s: pre status %s" % (display_name, self._preDevStatus)) + pmon_debug("%s: peroid_syslog %s" % (display_name, self._peroid_syslog)) + + if curStatus == STATUS_FAILED: + # get status failed + if self._peroid_failed_syslog is not None: + if getnochangedMsgFlag and time.time() - self._peroid_failed_syslog >= nochangedMsgTime: + # absent as before for some time, notice + dev_syslog(MSG_UNKNOWN % (display_name, log)) + self._peroid_failed_syslog = time.time() + else: # first time failed + dev_syslog(MSG_UNKNOWN % (display_name, log)) + self._peroid_failed_syslog = time.time() + return + self._peroid_failed_syslog = time.time() + + if self._preDevStatus is None: + # 1st time + if noprintFirstTimeFlag == 1: + self._peroid_syslog = time.time() + else: + if curStatus == STATUS_PRESENT: + # present + dev_syslog(MSG_IN % display_name) + elif curStatus == STATUS_OK: + # ok + dev_syslog(MSG_OK % display_name) + elif curStatus == STATUS_NOT_OK: + # not ok + dev_syslog(MSG_NOT_OK % display_name) + self._peroid_syslog = time.time() + else: + # absent + dev_syslog(MSG_ABSENT % display_name) + self._peroid_syslog = time.time() + else: + # from 2nd time... + if self._preDevStatus == curStatus: + # status not changed + if self._preDevStatus == STATUS_ABSENT: + if self._peroid_syslog is not None: + if getnochangedMsgFlag and time.time() - self._peroid_syslog >= nochangedMsgTime: + # absent as before for some time, notice + dev_syslog(MSG_ABSENT % display_name) + self._peroid_syslog = time.time() + elif self._preDevStatus == STATUS_NOT_OK: + if self._peroid_syslog is not None: + if getnochangedMsgFlag and time.time() - self._peroid_syslog >= nochangedMsgTime: + # not ok as before for some time, notice + dev_syslog(MSG_NOT_OK % display_name) + self._peroid_syslog = time.time() + else: + # status changed + if self._preDevStatus == STATUS_ABSENT: + if curStatus == STATUS_NOT_OK: + # absent -> not ok + dev_syslog(MSG_IN % display_name) + dev_syslog(MSG_NOT_OK % display_name) + self._peroid_syslog = time.time() + elif curStatus == STATUS_OK: + # absent -> ok + dev_syslog(MSG_IN % display_name) + dev_syslog(MSG_OK % display_name) + else: + # absent -> prsent + dev_syslog(MSG_IN % display_name) + + elif self._preDevStatus == STATUS_OK: + if curStatus == STATUS_NOT_OK: + # ok -> not ok + dev_syslog(MSG_NOT_OK % display_name) + self._peroid_syslog = time.time() + elif curStatus == STATUS_ABSENT: + # ok -> absent + dev_syslog(MSG_OUT % display_name) + self._peroid_syslog = time.time() + elif self._preDevStatus == STATUS_PRESENT: + # present -> absent + dev_syslog(MSG_OUT % display_name) + self._peroid_syslog = time.time() + else: # not ok + if curStatus == STATUS_OK: + # not ok -> ok + dev_syslog(MSG_RECOVER % display_name) + dev_syslog(MSG_OK % display_name) + else: + # not ok -> absent + dev_syslog(MSG_OUT % display_name) + self._peroid_syslog = time.time() + self._preDevStatus = curStatus + + +class checkSfp(checkBase): + def __init__(self, path, dev_name, display_name, config): + super(checkSfp, self).__init__(path, dev_name, display_name, 'XCVR', config) + + def getPath(self): + super(checkSfp, self).getPath() + return self._path + + def getName(self): + super(checkSfp, self).getName() + return self._name + + def getType(self): + super(checkSfp, self).getType() + return self._type + + +class checkSlot(checkBase): + def __init__(self, path, dev_name, display_name, config): + super(checkSlot, self).__init__(path, dev_name, display_name, 'SLOT', config) + + def getPath(self): + super(checkSlot, self).getPath() + return self._path + + def getName(self): + super(checkSlot, self).getName() + return self._name + + def getType(self): + super(checkSlot, self).getType() + return self._type + + +class checkPSU(checkBase): + def __init__(self, path, dev_name, display_name, config): + super(checkPSU, self).__init__(path, dev_name, display_name, 'PSU', config) + + def getPath(self): + super(checkPSU, self).getPath() + return self._path + + def getName(self): + super(checkPSU, self).getName() + return self._name + + def getType(self): + super(checkPSU, self).getType() + return self._type + + +class checkFAN(checkBase): + def __init__(self, path, dev_name, display_name, config): + super(checkFAN, self).__init__(path, dev_name, display_name, 'FAN', config) + + def getPath(self): + super(checkFAN, self).getPath() + return self._path + + def getName(self): + super(checkFAN, self).getName() + return self._name + + def getType(self): + super(checkFAN, self).getType() + return self._type + + +class platformSyslog(): + def __init__(self): + self.__sfp_checklist = [] + self.__fan_checklist = [] + self.__psu_checklist = [] + self.__slot_checklist = [] + self.__temp_checklist = [] + self.temps_peroid_syslog = {} + self.normal_status = 0 + self.warning_status = 1 + self.critical_status = 2 + self.poweron_flag = 0 + + self.pmon_syslog_config = PMON_SYSLOG_STATUS.copy() + self.__pollingtime = self.pmon_syslog_config.get('polling_time', 3) + + tmpconfig = self.pmon_syslog_config.get('sffs', None) + if tmpconfig is not None: + preset_item = tmpconfig.get("present", {}) + path = preset_item.get("path", []) + for location in path: + if '*' not in location: + pmon_error("sff location config error: %s" % location) + continue + dev_name_index = 0 + loc_split_list = location.split('/') + for i, item in enumerate(loc_split_list): + if '*' in item: + dev_name_index = i + break + locations = glob.glob(location) + for dev_path in locations: + dev_name_list = dev_path.split('/') + # explame:get eth1 from /sys_switch/transceiver/eth1/present + dev_name = dev_name_list[dev_name_index] + dev_name_alias = tmpconfig.get("alias", {}) + display_name = dev_name_alias.get(dev_name, dev_name) + dev = checkSfp(dev_path, dev_name, display_name, tmpconfig) + self.__sfp_checklist.append(dev) + + tmpconfig = self.pmon_syslog_config.get('fans', None) + if tmpconfig is not None: + preset_item = tmpconfig.get("present", {}) + path = preset_item.get("path", []) + for location in path: + if '*' not in location: + pmon_error("fan location config error: %s" % location) + continue + dev_name_index = 0 + loc_split_list = location.split('/') + for i, item in enumerate(loc_split_list): + if '*' in item: + dev_name_index = i + break + locations = glob.glob(location) + for dev_path in locations: + dev_name_list = dev_path.split('/') + dev_name = dev_name_list[dev_name_index] + dev_name_alias = tmpconfig.get("alias", {}) + display_name = dev_name_alias.get(dev_name, dev_name) + dev = checkFAN(dev_path, dev_name, display_name, tmpconfig) + self.__fan_checklist.append(dev) + + tmpconfig = self.pmon_syslog_config.get('psus', None) + if tmpconfig is not None: + preset_item = tmpconfig.get("present", {}) + path = preset_item.get("path", []) + for location in path: + if '*' not in location: + pmon_error("psu location config error: %s" % location) + continue + dev_name_index = 0 + loc_split_list = location.split('/') + for i, item in enumerate(loc_split_list): + if '*' in item: + dev_name_index = i + break + locations = glob.glob(location) + for dev_path in locations: + dev_name_list = dev_path.split('/') + dev_name = dev_name_list[dev_name_index] + dev_name_alias = tmpconfig.get("alias", {}) + display_name = dev_name_alias.get(dev_name, dev_name) + dev = checkPSU(dev_path, dev_name, display_name, tmpconfig) + self.__psu_checklist.append(dev) + + tmpconfig = self.pmon_syslog_config.get('slots', None) + if tmpconfig is not None: + preset_item = tmpconfig.get("present", {}) + path = preset_item.get("path", []) + for location in path: + if '*' not in location: + pmon_error("slot location config error: %s" % location) + continue + dev_name_index = 0 + loc_split_list = location.split('/') + for i, item in enumerate(loc_split_list): + if '*' in item: + dev_name_index = i + break + locations = glob.glob(location) + for dev_path in locations: + dev_name_list = dev_path.split('/') + dev_name = dev_name_list[dev_name_index] + dev_name_alias = tmpconfig.get("alias", {}) + display_name = dev_name_alias.get(dev_name, dev_name) + dev = checkSlot(dev_path, dev_name, display_name, tmpconfig) + self.__slot_checklist.append(dev) + + tmpconfig = self.pmon_syslog_config.get('temps', None) + if tmpconfig is not None: + self.__temp_checklist = tmpconfig.get('temps_list', []) + self.__temps_pollingseconds = tmpconfig.get('over_temps_polling_seconds', None) + + def checkTempStaus(self, temp_item): + temp_name = temp_item.get('name', None) + input_path = temp_item.get('input_path', None) + warning_temp = temp_item.get('warning', None) + critical_temp = temp_item.get('critical', None) + input_accuracy = temp_item.get('input_accuracy', None) + if temp_name is None or input_path is None or warning_temp is None or critical_temp is None: + dev_syslog('%%PMON-5-TEMP_NOTICE: get temperature config parament failed.') + return + try: + locations = glob.glob(input_path) + with open(locations[0], "r") as fd: + input_temp = fd.read() + input_temp = float(input_temp) / float(input_accuracy) + + if 'time' not in temp_item: + temp_item['time'] = time.time() + temp_item['status'] = self.normal_status + if float(input_temp) >= float(warning_temp): + if float(input_temp) >= float(critical_temp): + if time.time() - \ + temp_item['time'] >= self.__temps_pollingseconds or temp_item['status'] != self.critical_status: + dev_syslog('%%PMON-5-TEMP_HIGH: %s temperature %sC is larger than max critical threshold %sC.' + % (temp_name, input_temp, critical_temp)) + temp_item['status'] = self.critical_status + temp_item['time'] = time.time() + else: + if time.time() - \ + temp_item['time'] >= self.__temps_pollingseconds or temp_item['status'] != self.warning_status: + dev_syslog('%%PMON-5-TEMP_HIGH: %s temperature %sC is larger than max warning threshold %sC.' + % (temp_name, input_temp, warning_temp)) + temp_item['status'] = self.warning_status + temp_item['time'] = time.time() + else: + pmon_debug( + "%s temperature %sC is in range [%s, %s]" % + (temp_name, input_temp, warning_temp, critical_temp)) + temp_item['status'] = self.normal_status + temp_item['time'] = time.time() + except Exception as e: + dev_syslog('%%PMON-5-TEMP_NOTICE: Cannot get %s temperature. Exception log: %s' % (temp_name, str(e))) + return + + def sysfs_precondition_check(self, check_module, check_project): + try: + tmpconfig = self.pmon_syslog_config.get(check_module, None) + if tmpconfig is not None: + check_list = tmpconfig.get(check_project, []) + for check_item in check_list: + location = check_item.get("path", None) + ok_val = check_item.get("ok_val", None) + mask = check_item.get("mask", 0xff) + ok_val = ok_val & mask + locations = glob.glob(location) + for power_path in locations: + with open(power_path, "r") as fd: + retval = fd.read() + if int(retval) != ok_val: + return + self.poweron_flag = 1 + except Exception as e: + dev_syslog('%%PMON-5-TEMP_NOTICE: Cannot check power status. Exception log: %s' % str(e)) + return + + def updateSysDeviceStatus(self): + if self.poweron_flag == 1: + for dev in self.__sfp_checklist: + dev.checkStatus() + else: + self.sysfs_precondition_check('sffs', 'power') + + for dev in self.__fan_checklist: + dev.checkStatus() + for dev in self.__psu_checklist: + dev.checkStatus() + for dev in self.__slot_checklist: + dev.checkStatus() + for temp_item in self.__temp_checklist: + self.checkTempStaus(temp_item) + + def getPollingtime(self): + return self.__pollingtime + + def debug_init(self): + global debuglevel + try: + with open(PMON_DEBUG_FILE, "r") as fd: + value = fd.read() + debuglevel = int(value) + except Exception: + debuglevel = 0 + + def doWork(self): + try: + self.debug_init() + self.updateSysDeviceStatus() + except Exception as e: + MSG_EXCEPTION = '%%PMON-5-NOTICE: Exception happened! info:%s' % str(e) + pmon_error(MSG_EXCEPTION % traceback.format_exc()) + + +def run(): + platform = platformSyslog() + while True: + platform.doWork() + time.sleep(platform.getPollingtime()) + + +if __name__ == '__main__': + run() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/reboot_cause.py b/platform/broadcom/sonic-platform-modules-micas/common/script/reboot_cause.py new file mode 100755 index 000000000000..2f125c5084c2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/reboot_cause.py @@ -0,0 +1,183 @@ +#!/usr/bin/python3 +# -*- coding: UTF-8 -*- +import sys +import os +import time +import syslog +from platform_util import get_value, set_value, exec_os_cmd, wb_os_system +from platform_config import REBOOT_CAUSE_PARA + +REBOOT_CAUSE_DEBUG_FILE = "/etc/.reboot_cause_debug" +REBOOT_CAUSE_STARTED_FLAG = "/tmp/.reboot_cause_started_flag" + +debuglevel = 0 + + +def record_syslog_debug(s): + if debuglevel: + syslog.openlog("REBOOT_CAUSE_DEBUG", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def record_syslog(s): + syslog.openlog("REBOOT_CAUSE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_WARNING, s) + + +class RebootCause(): + def __init__(self): + self.reboot_cause_para = REBOOT_CAUSE_PARA.copy() + self.reboot_cause_list = self.reboot_cause_para.get('reboot_cause_list', None) + self.other_reboot_cause_record = self.reboot_cause_para.get('other_reboot_cause_record', None) + + def debug_init(self): + global debuglevel + if os.path.exists(REBOOT_CAUSE_DEBUG_FILE): + debuglevel = 1 + else: + debuglevel = 0 + + def monitor_point_check(self, item): + try: + gettype = item.get('gettype', None) + okval = item.get('okval', None) + compare_mode = item.get('compare_mode', "equal") + ret, value = get_value(item) + if ret is True: + if compare_mode == "equal": + if value == okval: + return True + elif compare_mode == "great": + if value > okval: + return True + elif compare_mode == "ignore": + return True + else: + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: compare_mode %s not match error.' % (compare_mode)) + else: + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: base point check type:%s not support.' % gettype) + except Exception as e: + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: base point check error. msg: %s.' % (str(e))) + return False + + def reboot_cause_record(self, item_list): + RET = {"RETURN_KEY1": 0} + try: + for item in item_list: + record_type = item.get('record_type', None) + if record_type == 'file': + file_mode = item.get('mode', None) + file_log = item.get('log', None) + file_path = item.get('path', None) + file_max_size = item.get('file_max_size', 0) + + if file_path is None: + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: record type is file, but path is none.') + continue + + if file_max_size > 0: + file_size = 0 + if os.path.exists(file_path): + file_size = os.path.getsize(file_path) // file_max_size + if file_size >= 1: + reocrd_cmd = "mv %s %s_bak" % (file_path, file_path) + status, output = exec_os_cmd(reocrd_cmd) + if status: + record_syslog( + '%%REBOOT_CAUSE-3-EXCEPTION: exec cmd %s failed, %s' % + (reocrd_cmd, output)) + + if file_mode == 'cover': + operate_cmd = ">" + elif file_mode == 'add': + operate_cmd = ">>" + else: + RET["RETURN_KEY1"] = -1 + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: file record mode:%s not support.' % file_mode) + continue + + create_dir = "mkdir -p %s" % os.path.dirname(file_path) + status, ret_t = wb_os_system(create_dir) + if status != 0: + RET["RETURN_KEY1"] = -1 + record_syslog( + '%%REBOOT_CAUSE-3-EXCEPTION: create %s failed, msg: %s' % + (os.path.dirname(file_path), ret_t)) + continue + + status, date = wb_os_system("date") + if status != 0 or len(date) == 0: + RET["RETURN_KEY1"] = -1 + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: get date failed.') + continue + + reocrd_cmd = "echo %s %s %s %s" % (file_log, date, operate_cmd, file_path) + status, ret_t = wb_os_system(reocrd_cmd) + if status != 0: + RET["RETURN_KEY1"] = -1 + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: get date failed, msg: %s' % ret_t) + continue + wb_os_system('sync') + else: + RET["RETURN_KEY1"] = -1 + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: record_type:%s not support.' % record_type) + continue + except Exception as e: + RET["RETURN_KEY1"] = -1 + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: reboot cause record error. msg: %s.' % (str(e))) + if RET["RETURN_KEY1"] == 0: + return True + return False + + def reboot_cause_check(self): + try: + reboot_cause_flag = False + if self.reboot_cause_list is None: + record_syslog_debug('%%REBOOT_CAUSE-6-DEBUG: reboot cause check config not found') + return + for item in self.reboot_cause_list: + name = item.get('name', None) + monitor_point = item.get('monitor_point', None) + record = item.get('record', None) + finish_operation_list = item.get('finish_operation', []) + if name is None or monitor_point is None or record is None: + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: reboot cause check get config failed.name:%s, monitor_point:%s, record:%s' % + (name, monitor_point, record)) + return + ret = self.monitor_point_check(monitor_point) + if ret is True: + record_syslog_debug('%%REBOOT_CAUSE-6-DEBUG: %s reboot cause is happen' % name) + self.reboot_cause_record(record) + reboot_cause_flag = True + for finish_operation_item in finish_operation_list: + ret, log = set_value(finish_operation_item) + if ret is False: + log = "%%REBOOT_CAUSE-3-EXCEPTION: " + log + record_syslog(log) + + if reboot_cause_flag is False and self.other_reboot_cause_record is not None: + record_syslog_debug('%%REBOOT_CAUSE-6-DEBUG: other reboot cause is happen') + self.reboot_cause_record(self.other_reboot_cause_record) + except Exception as e: + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: reboot cause check error. msg: %s.' % (str(e))) + return + + def run(self): + try: + self.debug_init() + if os.path.exists(REBOOT_CAUSE_STARTED_FLAG): + record_syslog_debug( + '%%REBOOT_CAUSE-6-DEBUG: Reboot cause has been started and will not be started again') + sys.exit(0) + self.reboot_cause_check() + wb_os_system("touch %s" % REBOOT_CAUSE_STARTED_FLAG) + wb_os_system("sync") + time.sleep(5) + sys.exit(0) + except Exception as e: + record_syslog('%%REBOOT_CAUSE-3-EXCEPTION: %s.' % (str(e))) + + +if __name__ == '__main__': + reboot_cause = RebootCause() + reboot_cause.run() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/reboot_ctrl.py b/platform/broadcom/sonic-platform-modules-micas/common/script/reboot_ctrl.py new file mode 100755 index 000000000000..17d3f5902b9d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/reboot_ctrl.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- +import time +import syslog +import click +from platform_util import write_sysfs, wbi2cset, io_wr, wbi2csetWord +from platform_config import REBOOT_CTRL_PARAM + + +REBOOTCTLDEBUG = 0 + +CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']} + + +class AliasedGroup(click.Group): + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + if len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + return None + + +def rebootctrlwarning(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("REBOOTCTRL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_WARNING, s) + + +def rebootctrlcritical(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("REBOOTCTRL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_CRIT, s) + + +def rebootctrlerror(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("REBOOTCTRL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def rebootctrldebug(s): + # s = s.decode('utf-8').encode('gb2312') + if REBOOTCTLDEBUG == 1: + syslog.openlog("REBOOTCTRL", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +class RebootCtrl(): + def __init__(self): + self.config = REBOOT_CTRL_PARAM.copy() + + def set_value(self, config, val): + way = config.get("gettype") + if way == 'sysfs': + loc = config.get("loc") + value = config.get(val) + rebootctrldebug("sysfs type.loc:0x%x, value:0x%x" % (loc, value)) + return write_sysfs(loc, "0x%02x" % value) + if way == "i2c": + bus = config.get("bus") + addr = config.get("loc") + offset = config.get("offset") + value = config.get(val) + rebootctrldebug("i2c type.bus:0x%x, addr:0x%x, offset:0x%x, value:0x%x" % (bus, addr, offset, value)) + return wbi2cset(bus, addr, offset, value) + if way == "io": + io_addr = config.get('io_addr') + value = config.get(val) + rebootctrldebug("io type.io_addr:0x%x, value:0x%x" % (io_addr, value)) + ret = io_wr(io_addr, value) + if ret is not True: + return False, ("write 0x%x failed" % io_addr) + return True, ("write 0x%x success" % io_addr) + if way == 'i2cword': + bus = config.get("bus") + addr = config.get("loc") + offset = config.get("offset") + value = config.get(val) + rebootctrldebug("i2cword type.bus:0x%x, addr:0x%x, offset:0x%x, value:0x%x" % (bus, addr, offset, value)) + return wbi2csetWord(bus, addr, offset, value) + return False, "unsupport way: %s" % way + + def reset_operate(self, config): + ret, log = self.set_value(config, "rst_val") + rst_delay = config.get("rst_delay", 0) + time.sleep(rst_delay) + return ret, log + + def unlock_reset_operate(self, config): + ret, log = self.set_value(config, "unlock_rst_val") + unlock_rst_delay = config.get("unlock_rst_delay", 0) + time.sleep(unlock_rst_delay) + return ret, log + + def do_rebootctrl(self, option): + if self.config is None: + rebootctrlerror("Reset failed, REBOOT_CTRL_PARAM cfg get failed.") + return + try: + name_conf = self.config.get(option, None) + if name_conf is None: + print("Reset %s not support" % option) + return + try: + click.confirm("Are you sure you want to reset " + option + "?", + default=False, abort=True, show_default=True) + except Exception as e: + print("Aborted, msg: %s" % str(e)) + return + print("Reset %s start" % option) + ret, log = self.reset_operate(name_conf) + if ret is False: + rebootctrlerror(log) + print("Reset %s failed" % option) + return + if "unlock_rst_val" in name_conf: + ret, log = self.unlock_reset_operate(name_conf) + if ret is False: + rebootctrlerror(log) + print("%s unlock reset failed" % option) + return + print("Reset %s success" % option) + except Exception: + rebootctrlerror("do_rebootctrl Exception error") + return + + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''reboot_ctrl reset [option]''' + + +@main.command() +@click.argument('option', required=True) +def reset(option): + '''reset device''' + rebootctrldebug("reboot ctrl option %s" % option) + rebootctrl = RebootCtrl() + rebootctrl.do_rebootctrl(option) + + +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/sensors b/platform/broadcom/sonic-platform-modules-micas/common/script/sensors new file mode 100755 index 000000000000..a2c72b123a43 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/sensors @@ -0,0 +1,8 @@ +#!/bin/bash +#docker exec -i pmon sensors "$@" + + +#To probe sensors not part of lm-sensors +if [ -r /usr/local/bin/platform_sensors.py ]; then + python /usr/local/bin/platform_sensors.py +fi diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/set_eth_mac.py b/platform/broadcom/sonic-platform-modules-micas/common/script/set_eth_mac.py new file mode 100755 index 000000000000..f4727d802753 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/set_eth_mac.py @@ -0,0 +1,274 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*- +import syslog +import os +import re +import eepromutil.onietlv as ot +from eepromutil.fru import ipmifru +from platform_config import STARTMODULE, SET_MAC_CONF +from platform_util import byteTostr, dev_file_read, exec_os_cmd + + +STANDARD_MAC_LEN = 12 +SETMAC_DEBUG_FILE = "/etc/.setmac_debug_flag" + +SETMACERROR = 1 +SETMACDEBUG = 2 +debuglevel = 0 + +cfg_prefix = "iface" +mac_prefix = "hwaddress ether" + +def setmac_debug(s): + if SETMACDEBUG & debuglevel: + syslog.openlog("SETMAC", syslog.LOG_PID) + syslog.syslog(syslog.LOG_INFO, s) + + +def setmac_error(s): + if SETMACERROR & debuglevel: + syslog.openlog("SETMAC", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + +def setmac_info(s): + syslog.openlog("SETMAC", syslog.LOG_PID) + syslog.syslog(syslog.LOG_INFO, s) + + +def debug_init(): + global debuglevel + try: + with open(SETMAC_DEBUG_FILE, "r") as fd: + value = fd.read() + debuglevel = int(value) + except Exception: + debuglevel = 0 + + +def decode_mac(encodedata): + if encodedata == None: + return None + ret = ":".join("%02x" % ord(data) for data in encodedata) + return ret.upper() + + +def validate_mac(value): + if value is None: + setmac_error("mac is none") + return False + if value.find('-') != -1: + pattern = re.compile(r"^\s*([0-9a-fA-F]{2,2}-){5,5}[0-9a-fA-F]{2,2}\s*$") + temp_value = value.replace("-", "") + elif value.find(':') != -1: + pattern = re.compile(r"^\s*([0-9a-fA-F]{2,2}:){5,5}[0-9a-fA-F]{2,2}\s*$") + temp_value = value.replace(":", "") + else: + pattern = re.compile(r"^\s*([0-9a-fA-F]{2,2}){5,5}[0-9a-fA-F]{2,2}\s*$") + temp_value = value + if not pattern.match(value): + setmac_error("mac format error") + return False + if len(temp_value) != STANDARD_MAC_LEN: + setmac_error("mac len error len:%d" % len(temp_value)) + return False + if temp_value == "000000000000": + setmac_error("illegal zero mac") + return False + if int(temp_value, 16) >> 40 & 1 == 1: + setmac_error("illegal mac") + return False + setmac_debug("mac validate success") + return True + + +def get_onie_eeprom(eeprom): + try: + onietlv = ot.onie_tlv() + rets = onietlv.decode(eeprom) + setmac_debug("%-20s %-5s %-5s %-20s" % ("TLV name", "Code", "lens", "Value")) + for item in rets: + if item["code"] == 0xfd: + setmac_debug("%-20s 0x%-02X %-5s" % (item["name"], item["code"], item["lens"])) + else: + setmac_debug("%-20s 0x%-02X %-5s %-20s" % (item["name"], item["code"], item["lens"], item["value"])) + except Exception as e: + setmac_error(str(e)) + return False, str(e) + return True, rets + + +def get_fru_eeprom_info(eeprom): + try: + fru = ipmifru() + fru.decodeBin(eeprom) + except Exception as e: + setmac_error(str(e)) + return False, str(e) + return True, fru + + +def get_mac_from_eeprom(eeprom_conf): + name = eeprom_conf.get("name") + e2_type = eeprom_conf.get("e2_type") + e2_path = eeprom_conf.get("e2_path") + e2_size = eeprom_conf.get("e2_size", 256) + mac_location = eeprom_conf.get("mac_location", {}) + e2_mac = None + + support_e2_type = ("fru", "onie_tlv") + if e2_type not in support_e2_type: + msg = "Unsupport e2 type: %s" % e2_type + return False, msg + + setmac_debug("===================%s===================" % name) + ret, binval_bytes = dev_file_read(e2_path, 0, e2_size) + if ret is False: + msg = "eeprom read error, eeprom path: %s, msg: %s" % (e2_path, binval_bytes) + return False, msg + binval = byteTostr(binval_bytes) + + # onie_tlv + if e2_type == "onie_tlv": + status, eeprom_info = get_onie_eeprom(binval) + if status is False: + msg = "get_onie_eeprom failed, msg: %s" % (eeprom_info) + return False, msg + + field = mac_location.get("field", "") + for eeprom_info_item in eeprom_info: + if eeprom_info_item.get("name") == field: + e2_mac = eeprom_info_item.get("value") + break + if e2_mac is None: + msg = "get_onie_eeprom mac address failed, e2_mac is None" + return False, msg + return True, e2_mac + + # fru + status, eeprom_info = get_fru_eeprom_info(binval) + if status is False: + msg = "get_fru_eeprom_info failed, msg: %s" % (eeprom_info) + return False, msg + + area = mac_location.get("area", "") + field = mac_location.get("field", "") + fru_area = getattr(eeprom_info, area, None) + fru_field = getattr(fru_area, field, None) + e2_mac = decode_mac(fru_field) + if e2_mac is None: + msg = "decode_mac failed, area: %s, field: %s, value: %s" % (area, field, fru_field) + return False, msg + return True, e2_mac + + +def read_mac_from_config_file(ifcfg): + ifcfg_file_path = ifcfg.get("ifcfg_file_path") + if not os.path.exists(ifcfg_file_path): + msg = "%s not exist" % ifcfg_file_path + return False, msg + try: + fd = open(ifcfg_file_path, 'r') + for line in reversed(fd.readlines()): + if line.strip().startswith(mac_prefix): + mac = line.strip().replace(mac_prefix, "").strip() + return True, mac + except Exception as e: + setmac_error(str(e)) + return False, str(e) + return False, "mac address not found in %s" % ifcfg_file_path + + +def set_e2_mac_to_config_file(eth_name, mac, ifcfg): + try: + ifcfg_file_path = ifcfg.get("ifcfg_file_path") + cfg_file_dir = os.path.dirname(ifcfg_file_path) + if not os.path.exists(cfg_file_dir): + cmd = "mkdir -p %s" % cfg_file_dir + setmac_info("Create interfaces config directory: %s" % cfg_file_dir) + exec_os_cmd(cmd) + exec_os_cmd("sync") + wr_val = cfg_prefix + " %s\n" % eth_name + wr_val += " %s %s\n" % (mac_prefix, mac) + with open(ifcfg_file_path, "w") as fd: + fd.write(wr_val) + exec_os_cmd("sync") + setmac_info("Create interfaces config: %s with mac address: %s" % (ifcfg_file_path, mac)) + return True + except Exception as e: + setmac_error(str(e)) + return False + +def get_eth_current_mac(eth_name): + get_mac_cmd = "ifconfig %s |grep ether |awk '{print $2}'" % eth_name + status, output = exec_os_cmd(get_mac_cmd) + if status or len(output) == 0: + msg = "get mac exec cmd : %s fail, msg: %s" % (get_mac_cmd, output) + setmac_error(msg) + return False, msg + mac = output.replace("\n", "").upper() + return True, mac + +def set_eth_mac(eth_name, mac): + set_mac_cmd = "ifconfig %s hw ether %s" % (eth_name, mac) + status, output = exec_os_cmd(set_mac_cmd) + if status: + setmac_error("run cmd: %s fail, msg: %s" % (set_mac_cmd, output)) + return False + setmac_info("ifconfig %s with mac address: %s success" % (eth_name, mac)) + return True + + +def doSetmac(): + if STARTMODULE.get('set_eth_mac', 0) == 0: + setmac_debug("set_eth_mac config not set") + return + + try: + if SET_MAC_CONF is None: + setmac_debug("set_mac_conf in none") + return + + if len(SET_MAC_CONF) == 0: + setmac_debug("set_mac_conf list is none") + return + + for setmac_item in SET_MAC_CONF: + eth_name = setmac_item.get("eth_name") + e2_name = setmac_item.get("e2_name", "") + ifcfg = setmac_item.get("ifcfg") + if eth_name is None or ifcfg is None: + setmac_error("set_mac_conf error, eth_name or ifcfg is None") + continue + + # decode mac by eeprom + status, e2_mac = get_mac_from_eeprom(setmac_item) + if status is False: + setmac_error("get mac from %s eeprom fail, msg: %s" % (e2_name, e2_mac)) + continue + status = validate_mac(e2_mac) + if status is False: + setmac_error("e2_mac: %s invalid" % e2_mac) + continue + setmac_debug("get mac from %s eeprom info success, mac: %s" % (e2_name, e2_mac)) + + # read config file mac address + status, cfg_mac = read_mac_from_config_file(ifcfg) + setmac_debug("read_mac_from_config_file, status: %s, cfg_mac: %s" % (status, cfg_mac)) + if status is False or cfg_mac != e2_mac: + set_e2_mac_to_config_file(eth_name, e2_mac, ifcfg) + # check current eth mac + status, current_mac = get_eth_current_mac(eth_name) + if status is False: + setmac_error("get %s current mac fail" % eth_name) + continue + setmac_debug("current_mac:%s len:%d" % (current_mac, len(current_mac))) + if current_mac != e2_mac: + set_eth_mac(eth_name, e2_mac) + except Exception as e: + setmac_error(str(e)) + return + + +if __name__ == '__main__': + debug_init() + doSetmac() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/sfp_highest_temperatue.py b/platform/broadcom/sonic-platform-modules-micas/common/script/sfp_highest_temperatue.py new file mode 100755 index 000000000000..4dd98f3a36b3 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/sfp_highest_temperatue.py @@ -0,0 +1,148 @@ +#!/usr/bin/python3 +import os +import importlib.machinery +import time +import syslog +import subprocess +import fcntl + +sfp_temperature_file = "/tmp/highest_sff_temp" + +SFP_TEMP_DEBUG_FILE = "/etc/.sfp_temp_debug_flag" +SFP_TEMP_RECORD_DEBUG = 1 +SFP_TEMP_RECORD_ERROR = 2 +debuglevel = 0 + + +def sfp_temp_debug(s): + if SFP_TEMP_RECORD_DEBUG & debuglevel: + syslog.openlog("SFP_TEMP_DEBUG", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def sfp_temp_error(s): + if SFP_TEMP_RECORD_ERROR & debuglevel: + syslog.openlog("SFP_TEMP_ERROR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +pidfile = None + + +def file_rw_lock(): + global pidfile + pidfile = open(sfp_temperature_file, "r") + try: + fcntl.flock(pidfile, fcntl.LOCK_EX | fcntl.LOCK_NB) + sfp_temp_debug("file lock success") + return True + except Exception: + if pidfile is not None: + pidfile.close() + pidfile = None + return False + + +def file_rw_unlock(): + try: + global pidfile + + if pidfile is not None: + fcntl.flock(pidfile, fcntl.LOCK_UN) + pidfile.close() + pidfile = None + sfp_temp_debug("file unlock success") + else: + sfp_temp_debug("pidfile is invalid, do nothing") + return True + except Exception as e: + sfp_temp_error("file unlock err, msg:%s" % (str(e))) + return False + + +def get_sfp_highest_temperature(): + highest_temperature = 0 + platform_sfputil = None + + sfputil_dir = "/usr/share/sonic/device/" + try: + if not os.path.exists(sfputil_dir): + sfputil_dir = "/usr/share/sonic/platform/" + sfputil_path = sfputil_dir + "/plugins/sfputil.py" + else: + cmd = "cat /host/machine.conf | grep onie_build_platform" + ret, output = subprocess.getstatusoutput(cmd) + if ret != 0: + sfp_temp_error("cmd: %s execution fail, output: %s" % (cmd, output)) + + onie_platform = output.split("=")[1] + sfputil_path = sfputil_dir + onie_platform + "/plugins/sfputil.py" + + module = importlib.machinery.SourceFileLoader("sfputil", sfputil_path).load_module() + platform_sfputil_class = getattr(module, "SfpUtil") + platform_sfputil = platform_sfputil_class() + + temperature = platform_sfputil.get_highest_temperature() + highest_temperature = int(temperature) * 1000 + except Exception as e: + sfp_temp_error("get sfp temperature error, msg:%s" % str(e)) + highest_temperature = -9999000 + + return highest_temperature + + +def write_sfp_highest_temperature(temperature): + + loop = 1000 + ret = False + try: + if os.path.exists(sfp_temperature_file) is False: + with open(sfp_temperature_file, 'w') as sfp_f: + pass + for i in range(0, loop): + ret = file_rw_lock() + if ret is True: + break + time.sleep(0.001) + + if ret is False: + sfp_temp_error("take file lock timeout") + return + + with open(sfp_temperature_file, 'w') as sfp_f: + sfp_f.write("%s\n" % str(temperature)) + + file_rw_unlock() + return + except Exception as e: + sfp_temp_error("write sfp temperature error, msg:%s" % str(e)) + file_rw_unlock() + return + + +def debug_init(): + global debuglevel + + try: + with open(SFP_TEMP_DEBUG_FILE, "r") as fd: + value = fd.read() + debuglevel = int(value) + except Exception: + debuglevel = 0 + + +def main(): + while True: + debug_init() + temperature = 0 + try: + temperature = get_sfp_highest_temperature() + write_sfp_highest_temperature(temperature) + except Exception as e: + sfp_temp_error("get/write sfp temperature error, msg:%s" % str(e)) + write_sfp_highest_temperature(-9999000) + time.sleep(5) + + +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/slot_monitor.py b/platform/broadcom/sonic-platform-modules-micas/common/script/slot_monitor.py new file mode 100755 index 000000000000..0385f50b6f50 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/slot_monitor.py @@ -0,0 +1,253 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- +import time +import syslog +import traceback +import operator +import click +import os +from platform_config import SLOT_MONITOR_PARAM +from platform_util import io_rd, io_wr, wbi2cget, wbi2cset + + +SLOTMONITORDEBUG = 0 +SLOTMONITOR_DEBUG_FILE = "/etc/.slotmonitor_debug_flag" + + +CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']} + + +class AliasedGroup(click.Group): + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + if len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + return None + + +def debug_init(): + global SLOTMONITORDEBUG + if os.path.exists(SLOTMONITOR_DEBUG_FILE): + SLOTMONITORDEBUG = 1 + else: + SLOTMONITORDEBUG = 0 + + +def slotwarninglog(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("SLOTMONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_WARNING, s) + + +def slotcriticallog(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("SLOTMONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_CRIT, s) + + +def sloterror(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("SLOTMONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def slotinfo(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("SLOTMONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_INFO, s) + + +def slotdebuglog(s): + # s = s.decode('utf-8').encode('gb2312') + if SLOTMONITORDEBUG == 1: + syslog.openlog("SLOTMONITOR", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +class SlotMonitor(): + def __init__(self): + self.preSlotStatus = [] + + def checkslot(self, ret): + slots_conf = SLOT_MONITOR_PARAM.get('slots', None) + + if slots_conf is None: + return False + for item_slot in slots_conf: + totalerr = 0 + try: + ret_t = {} + ret_t["id"] = item_slot.get('name') + ret_t["status"] = "" + presentattr = item_slot.get('present') + gettype = presentattr.get('gettype') + presentbit = presentattr.get('presentbit') + if gettype == "io": + io_addr = presentattr.get('io_addr') + val = io_rd(io_addr) + if val is not None: + retval = val + else: + totalerr -= 1 + sloterror(" %s %s" % (item_slot.get('name'), "lpc read failed")) + else: + bus = presentattr.get('bus') + loc = presentattr.get('loc') + offset = presentattr.get('offset') + ind, val = wbi2cget(bus, loc, offset) + if ind is True: + retval = val + else: + totalerr -= 1 + sloterror(" %s %s" % (item_slot.get('name'), "i2c read failed")) + if totalerr < 0: + ret_t["status"] = "NOT OK" + ret.append(ret_t) + continue + val_t = (int(retval, 16) & (1 << presentbit)) >> presentbit + if val_t != presentattr.get('okval'): + ret_t["status"] = "ABSENT" + else: + ret_t["status"] = "PRESENT" + except Exception as e: + ret_t["status"] = "NOT OK" + totalerr -= 1 + sloterror("checkslot error") + sloterror(str(e)) + slotdebuglog("%s status: %s" % (ret_t["id"], ret_t["status"])) + ret.append(ret_t) + return True + + def dealslotplugin(self, name): + slotdebuglog("enter dealslotplugin %s" % name) + # wait for slot stable + time.sleep(5) + slots_conf = SLOT_MONITOR_PARAM.get('slots', None) + if slots_conf is None: + return False + for item_slot in slots_conf: + try: + slotdebuglog("name %s, item_slot.get('name') %s" % (name, item_slot.get('name'))) + if name == item_slot.get('name'): + actattr = item_slot.get('act') + for item_act in actattr: + gettype = item_act.get('gettype') + if gettype == "io": + io_addr = item_act.get('io_addr') + value = item_act.get('value') + mask = item_act.get('mask') + val = io_rd(io_addr) + if val is None: + sloterror(" %s %s" % (name, "lpc read failed")) + continue + set_val = (int(val, 16) & mask) | value + ret = io_wr(io_addr, set_val) + if ret is not True: + sloterror(" %s %s" % (name, "lpc write failed")) + continue + slotdebuglog("io set io_addr:0x%x value:0x%x success" % (io_addr, set_val)) + elif gettype == "i2c": + bus = item_act.get('bus') + loc = item_act.get('loc') + offset = item_act.get('offset') + value = item_act.get('value') + ret, log = wbi2cset(bus, loc, offset, value) + if ret is not True: + sloterror(" %s %s %s" % (name, "i2c write failed", log)) + continue + slotdebuglog( + "i2c set bus:%d loc:0x%x offset:0x%x value:0x%x success" % + (bus, loc, offset, value)) + else: + sloterror("gettype error") + break + except Exception as e: + sloterror("dealslotplugin failed") + sloterror(str(e)) + return False + return True + + def updateSlotStatus(self): + ''' + Only two status: PRESENT and ABSENT + ''' + curSlotStatus = [] + self.checkslot(curSlotStatus) + slotdebuglog('curSlotStatus: {}\n preSlotStatus: {}'.format(curSlotStatus, self.preSlotStatus)) + if operator.eq(self.preSlotStatus, curSlotStatus) is False: + if len(self.preSlotStatus) == 0: + # first time + for i, item in enumerate(curSlotStatus): + if item['status'] == 'PRESENT': + slotdebuglog('SLOT_PLUG_IN: %s' % (item['id'])) + elif item['status'] == 'ABSENT': + slotdebuglog('SLOT_ABSENT: %s' % (item['id'])) + else: + slotdebuglog('SLOT_FAILED: %s status %s not support yet' % (item['id'], item['status'])) + self.preSlotStatus.append(item) + else: + for i, item in enumerate(curSlotStatus): + if item['status'] == self.preSlotStatus[i]['status']: + continue + if item['status'] == 'PRESENT' and self.preSlotStatus[i]['status'] == 'ABSENT': + self.dealslotplugin(item['id']) + slotinfo('SLOT_PLUG_IN: %s' % (item['id'])) + elif item['status'] == 'ABSENT' and self.preSlotStatus[i]['status'] == 'PRESENT': + slotwarninglog('SLOT_PLUG_OUT: %s' % (item['id'])) + else: + slotwarninglog('SLOT_PLUG_OUT: %s status change from %s to %s not support' % + (item['id'], self.preSlotStatus[i]['status'], item['status'])) + self.preSlotStatus.remove(self.preSlotStatus[i]) + self.preSlotStatus.insert(i, item) + + def slotmonitor(self): + self.updateSlotStatus() + return 0 + + +def doSlotMonitor(slotMonitor): + slotMonitor.slotmonitor() + + +def run(interval, slotMonitor): + # slotMonitor.devattrinit() + while True: + try: + debug_init() + doSlotMonitor(slotMonitor) + except Exception as e: + traceback.print_exc() + sloterror(str(e)) + time.sleep(interval) + + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''slot monitor operator''' + + +@main.command() +def start(): + '''start slot monitor''' + slotinfo("slot_monitor start") + slotMonitor = SlotMonitor() + interval = SLOT_MONITOR_PARAM.get('polling_time', 1) + run(interval, slotMonitor) + + +@main.command() +def stop(): + '''stop slot monitor ''' + slotinfo("stop") + + +# device_i2c operation +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/ssdmon b/platform/broadcom/sonic-platform-modules-micas/common/script/ssdmon new file mode 100755 index 000000000000..4290b0a68725 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/ssdmon @@ -0,0 +1,82 @@ +#!/usr/bin/env python3 +# +# ssdmon +# +# Command-line utility to check SSD health and parameters +# + +try: + import argparse + import os + import sys + + from sonic_py_common import device_info, logger +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + +DEFAULT_DEVICE = "/dev/sda" +SYSLOG_IDENTIFIER = "ssdmon" + +# Global logger instance +log = logger.Logger(SYSLOG_IDENTIFIER) + +def import_ssd_api(diskdev): + """ + Loads platform specific or generic ssd_mon module from source + Raises an ImportError exception if none of above available + + Returns: + Instance of the class with SSD API implementation (vendor or generic) + """ + + # try to load platform specific module + try: + platform_path, _ = device_info.get_paths_to_platform_and_hwsku_dirs() + platform_plugins_path = os.path.join(platform_path, "plugins") + sys.path.append(os.path.abspath(platform_plugins_path)) + from ssd_util import SsdUtil + except ImportError as e: + log.log_warning("Platform specific SsdMon module not found.") + + return SsdUtil(diskdev) + +def is_number(s): + try: + float(s) + return True + except ValueError: + return False + +# ==================== Entry point ==================== +def ssdmon(): + if os.geteuid() != 0: + print("Root privileges are required for this operation") + sys.exit(1) + + parser = argparse.ArgumentParser() + parser.add_argument("-d", "--device", help="Device name to show health info", default=DEFAULT_DEVICE) + parser.add_argument("-t", "--temperature", action="store_true", default=False, help="Show only temperature") + parser.add_argument("-j", "--health", action="store_true", default=False, help="Show only health") + + args = parser.parse_args() + + ssd = import_ssd_api(args.device) + + if args.temperature: + print(ssd.get_temperature()) + return + + if args.health: + print(ssd.get_health()) + return + + print("Device Model : {}".format(ssd.get_model())) + print("Firmware : {}".format(ssd.get_firmware())) + print("Serial : {}".format(ssd.get_serial())) + print("Health : {}{}".format(ssd.get_health(), "%" if is_number(ssd.get_health()) else "")) + print("Remain Life : {}{}".format(ssd.get_remaining_life(), "%" if is_number(ssd.get_remaining_life()) else "")) + print("Temperature : {}{}".format(ssd.get_temperature(), "C" if is_number(ssd.get_temperature()) else "")) + print("SATA Rate : {}".format(ssd.get_sata_rate())) + +if __name__ == '__main__': + ssdmon() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/subnetwork.py b/platform/broadcom/sonic-platform-modules-micas/common/script/subnetwork.py new file mode 100755 index 000000000000..5f9df14c8696 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/subnetwork.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- +import os +import re +import subprocess +import sys +import time + + +def start(): + subnet_path = "/sys/class/net/eth0.4088" + retry_count = 10 + subnet_cmds = [] + subnet_cmds.append("ip link add link eth0 name eth0.4088 type vlan id 4088") + subnet_cmds.append("ip addr add 240.1.1.1/30 brd 240.1.1.3 dev eth0.4088") + subnet_cmds.append("ip link set dev eth0.4088 up") + + retry = 0 + while not os.path.exists(subnet_path) and retry < retry_count: + try: + for cmd in subnet_cmds: + subprocess.run(cmd.split(), check=True) + except subprocess.CalledProcessError as e: + print("Start subnetwork Failed, retrying: %d, cmd: %s, returncode: %d" % (retry, cmd, e.returncode)) + retry = retry + 1 + time.sleep(5) + + if os.path.exists(subnet_path): + print("Start subnetwork Success.") + + +def stop(): + subnet_path = "/sys/class/net/eth0.4088" + subnet_cmds = [] + subnet_cmds.append("ip link set dev eth0.4088 down") + subnet_cmds.append("ip link del eth0.4088") + + try: + for cmd in subnet_cmds: + subprocess.run(cmd.split(), check=True) + except subprocess.CalledProcessError as e: + print("Stop subnetwork Failed, returncode: " + e.returncode) + + if not os.path.exists(subnet_path): + print("Stop subnetwork Success.") + + +def main(): + print(sys.argv[1]) + if sys.argv[1] == 'start': + start() + elif sys.argv[1] == 'stop': + stop() + else: + print("Error parameter!\nRequired parameters : start or stop.") + + +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/tty_console.py b/platform/broadcom/sonic-platform-modules-micas/common/script/tty_console.py new file mode 100755 index 000000000000..4fae02f5128e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/tty_console.py @@ -0,0 +1,91 @@ +#!/usr/bin/python3 +# -*- coding: UTF-8 -*- + +import logging.handlers +import subprocess +import shlex +import time +import sys +import os +from platform_util import CompressedRotatingFileHandler, exec_os_cmd + +console_file = "/dev/ttyS1" +console_logfile = "/var/log/bmc-console.log" +MAX_LOG_BYTES = 20 * 1024 * 1024 +BACKUP_COUNT = 9 + +READ_SIZE = 1024 + +logger = logging.getLogger("cpu_monitor_bmc") +logger.setLevel(logging.DEBUG) +fh = CompressedRotatingFileHandler( + console_logfile, + mode='a', + maxBytes=MAX_LOG_BYTES, + backupCount=BACKUP_COUNT, + encoding=None, + delay=0) +fh.setLevel(logging.DEBUG) + +formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s") +fh.setFormatter(formatter) +logger.addHandler(fh) + + +def tty_system_cmd(cmd, print_log=True): + if print_log: + logger.debug("command: %s", cmd) + status, output = exec_os_cmd(cmd) + logger.debug("command status %s", status) + logger.debug("command output:\n%s", output) + else: + status, output = exec_os_cmd(cmd) + return status, output + + +if __name__ == '__main__': + try_times = 0 + while try_times < 3: + try_times = try_times + 1 + ret, log = tty_system_cmd("stty -F /dev/ttyS1 | grep 115200", True) + if len(log) != 0 and "115200" in log: + break + tty_system_cmd("stty -F /dev/ttyS1 115200", True) + if try_times > 1: + logger.error("The %d time try to set SONiC /dev/ttyS1 115200", try_times) + + if not os.path.exists(console_file): + logger.error("device %s not exist", console_file) + sys.exit(1) + + nopen = 3 + while nopen > 0: + try: + console_fd = os.open(console_file, os.O_RDONLY) + break + except Exception as e: + logger.error(e) + logger.error("open %s failed", console_file) + nopen = nopen - 1 + time.sleep(1) + if nopen == 0: + sys.exit(1) + + try: + tmp_read = "" + while True: + dev_read = os.read(console_fd, READ_SIZE) + dev_read = str(dev_read, encoding='utf-8') + if len(dev_read) == 1 and dev_read == "\n": + continue + if dev_read[len(dev_read) - 1] == '\n': + tmp_read = tmp_read + dev_read[0:(len(dev_read) - 1)] + logger.info(tmp_read) + tmp_read = "" + else: + tmp_read = tmp_read + dev_read + + except Exception as e: + if console_fd is not None: + os.close(console_fd) + logger.error(e) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/upgrade.py b/platform/broadcom/sonic-platform-modules-micas/common/script/upgrade.py new file mode 100755 index 000000000000..1b2523198ed8 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/upgrade.py @@ -0,0 +1,991 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- +import sys +import os +import time +import syslog +import signal +import click +from platform_util import get_value, set_value, exec_os_cmd, exec_os_cmd_log +from platform_config import UPGRADE_SUMMARY, WARM_UPGRADE_STARTED_FLAG +from warm_upgrade import WarmBasePlatform + + +############################# Error code defined ############################# +ERR_FW_CHECK_CPLD_UPGRADE = -601 # "Failed to check the device CPLD information" +ERR_FW_CHECK_FPGA_UPGRADE = -602 # "Failed to check the device FPGA information" +ERR_FW_MATCH_CPLD_UPGRADE = -603 # "Not found upgrade CPLD file." +ERR_FW_MATCH_FPGA_UPGRADE = -604 # "Not found upgrade FPGA file." +ERR_FW_SAMEVER_CPLD_UPGRADE = -605 # "The CPLD version in device is same" +ERR_FW_SAMEVER_FPGA_UPGRADE = -606 # "The FPGA version in device is same" +ERR_FW_DO_CPLD_UPGRADE = -607 # "Doing upgrade CPLD is failed." +ERR_FW_DO_FPGA_UPGRADE = -608 # "Doing upgrade FPGA is failed." +ERR_FW_UPGRADE = -609 # "Failed to upgrade firmware" +FIRMWARE_PROGRAM_EXEC_ERR = -610 # "Firmware program run error!" +ERR_FW_FILE_FOUND = -701 # "Failed to find upgrade file" +ERR_FW_HEAD_PARSE = -702 # "Failed to parse upgrade firmware head info" +ERR_FW_CONFIG_FOUND = -703 # "Failed to find config item" +ERR_FW_NOSUPPORT_HOT = -704 # "No support hot upgrade" +ERR_FW_CHECK_SIZE = -705 # "Failed to check file size" +ERR_FW_DEVICE_ACCESS = -706 # "Failed to access device" +ERR_FW_NO_FILE_SUCCESS = -707 # "No files were successfully upgraded" +ERR_FW_CARD_ABSENT = -708 # "The subcard not present" +ERR_FW_HEAD_CHECK = -709 # "Failed to check head info" +ERR_FW_FOOL_PROOF = -710 # "Failed to fool proof verification" +ERR_FW_RAISE_EXCEPTION = -711 # Code raise exception +ERR_FW_INVALID_PARAM = -712 # Invalid parameter +ERR_FW_UNZIP_FAILED = -713 # Unzip firmware failed + +FIRMWARE_SUCCESS = 0 +CHECK_OK = 0 + + +UPGRADE_DEBUG_FILE = "/etc/.upgrade_debug_flag" +UPGRADE_FILE_DIR = "/tmp/firmware/" + +UPGRADEDEBUG = 1 + +debuglevel = 0 + +COLD_UPGRADE = 1 +WARM_UPGRADE = 2 +TEST_UPGRADE = 3 +BMC_UPGRADE = 4 + +CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']} + + +class AliasedGroup(click.Group): + + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + if len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + return None + + +def debug_init(): + global debuglevel + if os.path.exists(UPGRADE_DEBUG_FILE): + debuglevel = debuglevel | UPGRADEDEBUG + else: + debuglevel = debuglevel & ~(UPGRADEDEBUG) + + +def upgradewarninglog(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("UPGRADE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_WARNING, s) + + +def upgradecriticallog(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("UPGRADE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_CRIT, s) + + +def upgradeerror(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("UPGRADE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def upgradedebuglog(s): + # s = s.decode('utf-8').encode('gb2312') + if UPGRADEDEBUG & debuglevel: + syslog.openlog("UPGRADE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def signal_init(): + signal.signal(signal.SIGINT, signal.SIG_IGN) # ignore ctrl+c signal + signal.signal(signal.SIGTERM, signal.SIG_IGN) # ignore kill signal + signal.signal(signal.SIGTSTP, signal.SIG_IGN) # ignore ctrl+z signal + + +class BasePlatform(): + + def __init__(self): + self.upgrade_param = UPGRADE_SUMMARY.copy() + self.devtype = self.upgrade_param.get('devtype', None) + self.max_slot_num = self.upgrade_param.get("max_slot_num", 0) + self.head_info_config = {} + self.slot_config = {} + self.cold_chain_config = {} + self.subtype = None + self.chain = None + self.filetype = None + self.DEVTYPE = None + self.SUBTYPE = '0' + self.TYPE = None + self.CHAIN = None + self.CHIPNAME = None + self.VERSION = None + self.FILETYPE = None + self.CRC = None + self.SUBTYPE_LIST = None + + def save_and_set_value(self, cfg_list): + for config in cfg_list: + ret, val = get_value(config) + if ret: + config["save_value"] = val + else: + upgradeerror(val) + return False, "get save value fail" + + set_val = config.get("set_value", None) + if set_val is None: + log = "save_and_set_value lack of set_val config" + upgradeerror(log) + return log + + gettype = config.get("gettype", None) + set_cmd = config.get("set_cmd", None) + if gettype == "cmd": + if set_cmd is None: + log = "save_and_set_value lack of set_cmd config" + upgradeerror(log) + return False, log + config["cmd"] = set_cmd % set_val + upgradedebuglog("save_and_set_value modify set cmd to %s" % config["cmd"]) + else: + config["value"] = set_val + upgradedebuglog("save_and_set_value modify set val to %s" % config["value"]) + + ret, log = set_value(config) + if ret is False: + upgradeerror(log) + return False, log + return True, "save and set value success" + + def recover_save_value(self, cfg_list): + total_err = 0 + for config in cfg_list: + upgradedebuglog("config: %s, recover save value" % config) + val = config.get("save_value", None) + if val is None: + upgradeerror("recover_save_value lack of save_value config") + total_err -= 1 + continue + gettype = config.get("gettype", None) + set_cmd = config.get("set_cmd", None) + if gettype == "cmd": + config["cmd"] = set_cmd % val + upgradedebuglog("recover_save_value modify set cmd to %s" % config["cmd"]) + else: + config["value"] = val + upgradedebuglog("recover_save_value modify set val to %s" % config["value"]) + + ret, log = set_value(config) + if ret is False: + upgradeerror("recover save value write failed, log: %s" % log) + total_err -= 1 + else: + upgradedebuglog("recover save value success") + if total_err < 0: + return False, "recover save value failed" + return True, "recover save value success" + + def check_slot_present(self, slot_present_config): + presentbit = slot_present_config.get('presentbit') + ret, value = get_value(slot_present_config) + if ret is False: + return "NOT OK" + if isinstance(value, str): + val_t = int(value, 16) + else: + val_t = value + val_t = (val_t & (1 << presentbit)) >> presentbit + if val_t != slot_present_config.get('okval'): + status = "ABSENT" + else: + status = "PRESENT" + return status + + def linecard_present_check(self, slot_present_config): + present_status = self.check_slot_present(slot_present_config) + if present_status == "NOT OK": + return ERR_FW_DEVICE_ACCESS, "get slot present status failed." + if present_status == "ABSENT": + return ERR_FW_CARD_ABSENT, "slot absent" + return CHECK_OK, "slot present" + + def subprocess_warm_upgrade(self, config, file, main_type, sub_type, slot): + dev_name = config.get("name", None) + status, output = self.subprocess_firmware_upgrade(config, file, main_type, sub_type, slot) + if status is False: + upgradeerror("%s warm upgrade failed" % dev_name) + return False, output + command = "warm_upgrade.py %s 0x%x 0x%x %s %s %s" % (file, main_type, sub_type, slot, self.filetype, self.chain) + upgradedebuglog("warm upgrade cmd: %s" % command) + if os.path.exists(UPGRADE_DEBUG_FILE): + status, output = exec_os_cmd_log(command) + else: + status, output = exec_os_cmd(command) + if status: + upgradeerror("%s warm upgrade failed" % dev_name) + return False, output + upgradedebuglog("%s warm upgrade success" % dev_name) + return True, "upgrade success" + + def do_fw_upg_init_cmd(self, dev_name, init_cmd_list): + # pre operation + try: + for init_cmd_config in init_cmd_list: + ret, log = set_value(init_cmd_config) + if ret is False: + upgradeerror("%s do init cmd: %s failed, msg: %s" % (dev_name, init_cmd_config, log)) + return False, log + msg = "%s firmware init cmd all set success" % dev_name + upgradedebuglog(msg) + return True, msg + except Exception as e: + return False, str(e) + + def do_fw_upg_finish_cmd(self, dev_name, finish_cmd_list): + # end operation + ret = 0 + for finish_cmd_config in finish_cmd_list: + ret_t, log = set_value(finish_cmd_config) + if ret_t is False: + upgradeerror("%s do finish cmd: %s failed, msg: %s" % (dev_name, finish_cmd_config, log)) + ret = -1 + if ret != 0: + msg = "%s firmware finish cmd exec failed" % dev_name + upgradeerror(msg) + return False, msg + msg = "%s firmware finish cmd all set success" % dev_name + upgradedebuglog(msg) + return True, msg + + def subprocess_firmware_upgrade(self, config, file, main_type, sub_type, slot): + dev_name = config.get("name", None) + init_cmd_list = config.get("init_cmd", []) + finish_cmd_list = config.get("finish_cmd", []) + try: + ret, log = self.do_fw_upg_init_cmd(dev_name, init_cmd_list) + if ret is False: + self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + return False, log + time.sleep(0.5) # delay 0.5s after execute init_cmd + command = "firmware_upgrade %s 0x%x 0x%x %s" % (file, main_type, sub_type, slot) + upgradedebuglog("firmware upgrade cmd: %s" % command) + if os.path.exists(UPGRADE_DEBUG_FILE): + status, output = exec_os_cmd_log(command) + else: + status, output = exec_os_cmd(command) + if status: + self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + upgradeerror("%s firmware upgrade failed, msg: %s" % (dev_name, output)) + return False, output + upgradedebuglog("%s firmware upgrade success" % dev_name) + ret, log = self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + if ret is False: + return False, log + return True, "upgrade success" + except Exception as e: + self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + return False, str(e) + + def subprocess_test_upgrade(self, config, file, main_type, sub_type, slot): + dev_name = config.get("name", None) + init_cmd_list = config.get("init_cmd", []) + finish_cmd_list = config.get("finish_cmd", []) + try: + ret, log = self.do_fw_upg_init_cmd(dev_name, init_cmd_list) + if ret is False: + self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + return False, log + time.sleep(0.5) # delay 0.5s after execute init_cmd + command = "firmware_upgrade test %s 0x%x 0x%x %s" % (file, main_type, sub_type, slot) + upgradedebuglog("firmware upgrade cmd: %s" % command) + if os.path.exists(UPGRADE_DEBUG_FILE): + status, output = exec_os_cmd_log(command) + else: + status, output = exec_os_cmd(command) + if status: + self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + upgradeerror("%s test upgrade failed, msg: %s" % (dev_name, output)) + return False, output + upgradedebuglog("%s test upgrade success" % dev_name) + ret, log = self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + if ret is False: + return False, log + return True, "upgrade success" + except Exception as e: + self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + return False, str(e) + + def subprocess_bmc_upgrade(self, config, file, chip_select, erase_type): + dev_name = config.get("name", None) + init_cmd_list = config.get("init_cmd", []) + finish_cmd_list = config.get("finish_cmd", []) + save_set_reg_list = config.get("save_set_reg", []) + try: + # save and set reg + ret, log = self.save_and_set_value(save_set_reg_list) + if ret is False: + upgradeerror(log) + self.recover_save_value(save_set_reg_list) + self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + return False, log + upgradedebuglog("%s save and set cmd all set success" % dev_name) + time.sleep(0.5) # delay 0.5s after execute save and set reg + + # pre operation + ret, log = self.do_fw_upg_init_cmd(dev_name, init_cmd_list) + if ret is False: + self.recover_save_value(save_set_reg_list) + self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + return False, log + + upgradedebuglog("%s bmc init cmd all set success" % dev_name) + time.sleep(0.5) # delay 0.5s after execute init_cmd + + command = "fw_upgrade upgrade %s %s %s" % (file, chip_select, erase_type) + upgradedebuglog("fw_upgrade upgrade cmd: %s" % command) + status, output = exec_os_cmd_log(command) + if status: + upgradeerror("%s bmc upgrade failed" % dev_name) + self.recover_save_value(save_set_reg_list) + self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + return False, output + upgradedebuglog("%s bmc upgrade success" % dev_name) + + ret1, log1 = self.recover_save_value(save_set_reg_list) + if ret1 is False: + upgradeerror("bmc upgrade recover save value failed, msg: %s" % log1) + ret2, log2 = self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + if ret2 is False: + upgradeerror("bmc upgrade do finish command failed, msg: %s" % log2) + if ret1 is False or ret2 is False: + return False, "bmc upgrade do recover save value or finish command failed" + return True, "upgrade success" + + except Exception as e: + self.recover_save_value(save_set_reg_list) + self.do_fw_upg_finish_cmd(dev_name, finish_cmd_list) + return False, str(e) + + def file_head_param_check(self, head_info_config): + try: + self.DEVTYPE = head_info_config.get('DEVTYPE', None) + self.SUBTYPE = head_info_config.get('SUBTYPE', '0') + self.TYPE = head_info_config.get('TYPE', None) + self.CHAIN = head_info_config.get('CHAIN', None) + self.CHIPNAME = head_info_config.get('CHIPNAME', None) + self.VERSION = head_info_config.get('VERSION', None) + self.FILETYPE = head_info_config.get('FILETYPE', None) + self.CRC = head_info_config.get('CRC', None) + + if self.devtype != int(self.DEVTYPE, 16): + return ERR_FW_HEAD_CHECK, ("no support %s devtype" % self.DEVTYPE) + + if self.SUBTYPE is not None: + self.SUBTYPE_LIST = self.SUBTYPE.split(',') + self.SUBTYPE_LIST = [int(tmp_subtype, base=16) for tmp_subtype in self.SUBTYPE_LIST] + if len(self.SUBTYPE) != 0 and self.subtype not in self.SUBTYPE_LIST: + return ERR_FW_HEAD_CHECK, ("no support %s SUBTYPE" % self.SUBTYPE) + + if len(self.CHAIN) == 0 or len(self.FILETYPE) == 0: + return ERR_FW_HEAD_CHECK, ("CHAIN:%s, FILETYPE:%s get failed" % (self.CHAIN, self.FILETYPE)) + self.chain = int(self.CHAIN) + self.filetype = self.FILETYPE + upgradedebuglog("file head param: devtype:0x%x, subtype:0x%x, chain:%s, filetype:%s" + % (self.devtype, self.subtype, self.chain, self.filetype)) + return CHECK_OK, "SUCCESS" + except Exception as e: + return ERR_FW_RAISE_EXCEPTION, str(e) + + def parse_file_head(self, file): + try: + self.head_info_config = {} + with open(file, 'r', errors='ignore') as fd: + rdbuf = fd.read() + upgradedebuglog("start parse upgrade file head") + file_head_start = rdbuf.index('FILEHEADER(\n') # ponit to F + file_head_start += rdbuf[file_head_start:].index('\n') # ponit to \n + file_head_end = rdbuf.index(')\n') + header_buf = rdbuf[file_head_start + 1: file_head_end - 1] + upgradedebuglog("upgrade file head find FILEHEADER") + for line in header_buf.split('\n'): + head_list = line.split('=', 1) + head_key = head_list[0] + head_val = head_list[1] + self.head_info_config[head_key] = head_val + upgradedebuglog("file: %s head_info_config: %s" % (file, self.head_info_config)) + return CHECK_OK, "SUCCESS" + except Exception as e: + msg = "parse %s head failed, msg: %s" % (file, str(e)) + upgradeerror(msg) + return ERR_FW_RAISE_EXCEPTION, msg + + def get_file_size_k(self, file): + fsize = os.path.getsize(file) + fsize = fsize / float(1024) + return round(fsize, 2) + + def get_device_model(self, conf): + ret, val = get_value(conf) + if ret is False: + msg = "get device model failed, msg: %s" % val + return False, msg + decode_val = conf.get("decode") + if decode_val is None: + return True, val + for k, v in decode_val.items(): + if val == v: + return True, k + msg = "device model decode error, val: %s" % val + return False, msg + + def upgrade_fool_proofing(self, conf): + try: + status, dev_model = self.get_device_model(conf) + if status is False: + msg = "upgrade fool proofing get device model failed, msg: %s" % dev_model + upgradeerror(msg) + return False, msg + upgradedebuglog("get device model success, device model: %s" % dev_model) + if dev_model != self.VERSION: + msg = "upgrade fool proofing failed, device model: %s, upgrade file version: %s" % ( + dev_model, self.VERSION) + upgradedebuglog(msg) + return False, msg + msg = "upgrade fool proofing pass, device model: %s, upgrade file version: %s" % (dev_model, self.VERSION) + upgradedebuglog(msg) + return True, msg + except Exception as e: + upgradeerror(str(e)) + return False, str(e) + + def upgrading(self, config, file, devtype, subtype, slot, option_flag, erase_type=None): + dev_name = config.get("name", None) + if option_flag == COLD_UPGRADE: + status, output = self.subprocess_firmware_upgrade(config, file, devtype, subtype, slot) + elif option_flag == WARM_UPGRADE: + status, output = self.subprocess_warm_upgrade(config, file, devtype, subtype, slot) + elif option_flag == TEST_UPGRADE: + status, output = self.subprocess_test_upgrade(config, file, devtype, subtype, slot) + elif option_flag == BMC_UPGRADE: + status, output = self.subprocess_bmc_upgrade(config, file, slot, erase_type) + else: + log = "%s set error option flag" % dev_name + upgradeerror(log) + return False, log + + if status is False: + upgradeerror("%s upgrade failed" % dev_name) + return False, output + upgradedebuglog("%s upgrade success" % dev_name) + return True, "upgrade success" + + def initial_check(self, file, slot, upg_type): + try: + upgradedebuglog("BasePlatform initial_check, file: %s, slot: %s, upg_type: %s" % + (file, slot, upg_type)) + + upgradedebuglog("do file exist check...") + if not os.path.isfile(file): + msg = "%s not found" % file + upgradedebuglog(msg) + return ERR_FW_FILE_FOUND, msg + upgradedebuglog("file exist check ok") + + slot_name = "slot%d" % slot + slot_config = self.upgrade_param.get(slot_name, {}) + slot_present_config = slot_config.get("present", {}) + if len(slot_present_config) != 0: + upgradedebuglog("do %s present check..." % slot_name) + ret, log = self.linecard_present_check(slot_present_config) + if ret != CHECK_OK: + msg = "check %s present error, msg: %s" % (slot_name, log) + upgradedebuglog(msg) + return ret, msg + upgradedebuglog("%s present check ok" % slot_name) + + upgradedebuglog("do file head parse...") + self.subtype = slot_config.get("subtype", 0) + ret, log = self.parse_file_head(file) + if ret != CHECK_OK: + return ret, log + upgradedebuglog("file head parse success") + + upgradedebuglog("do file head check...") + ret, log = self.file_head_param_check(self.head_info_config) + if ret != CHECK_OK: + msg = "file: %s, head check failed, msg: %s" % (file, log) + upgradedebuglog(msg) + return ret, msg + upgradedebuglog("file head check ok") + + upgradedebuglog("get upgrade chain config...") + filetype_config = slot_config.get(self.filetype, {}) + if len(filetype_config) == 0: + msg = "file: %s filetype: %s no support" % (file, self.filetype) + upgradedebuglog(msg) + return ERR_FW_CONFIG_FOUND, msg + chain_num = "chain%s" % self.chain + chain_config = filetype_config.get(chain_num, {}) + if len(chain_config) == 0: + msg = "file: %s get %s config failed" % (file, chain_num) + upgradedebuglog(msg) + return ERR_FW_CONFIG_FOUND, msg + self.cold_chain_config = chain_config + upgradedebuglog("get %s filetype: %s %s config success" % (slot_name, self.filetype, chain_num)) + + fool_proofing = chain_config.get("fool_proofing") + if fool_proofing is not None: + upgradedebuglog("do fool proofing check...") + status, log = self.upgrade_fool_proofing(fool_proofing) + if status is False: + msg = "upgrade fool proofing check failed, msg: %s" % log + upgradedebuglog(msg) + return ERR_FW_FOOL_PROOF, msg + upgradedebuglog("do fool proofing check ok") + + if upg_type == WARM_UPGRADE: + upgradedebuglog("do support warm upgrade check...") + if chain_config.get("is_support_warm_upg", 0) != 1: + msg = "file: %s %s chain config not support warm upgrade" % (file, slot_name) + upgradedebuglog(msg) + return ERR_FW_NOSUPPORT_HOT, msg + upgradedebuglog("file: %s %s chain config support warm upgrade" % (file, slot_name)) + + filesizecheck = chain_config.get("filesizecheck", 0) + if filesizecheck != 0: + upgradedebuglog("do file size check...") + file_size = self.get_file_size_k(file) + if file_size > filesizecheck: + msg = "file: %s size: %s exceed %s" % (file, file_size, filesizecheck) + upgradedebuglog(msg) + return ERR_FW_CHECK_SIZE, msg + msg = "file: %s size: %s check ok" % (file, file_size) + upgradedebuglog(msg) + + msg = "file: %s slot: %s upgrade type: %s check ok" % (file, slot, upg_type) + upgradedebuglog(msg) + return CHECK_OK, msg + except Exception as e: + return ERR_FW_RAISE_EXCEPTION, str(e) + + def do_upgrade(self, file, slot, upg_type): + try: + ret, log = self.initial_check(file, slot, upg_type) + if ret != CHECK_OK: + return ret, log + + # start upgrading + upgradedebuglog("start upgrading") + ret, log = self.upgrading(self.cold_chain_config, file, self.devtype, self.subtype, slot, upg_type) + if ret is False: + upgradeerror("upgrade failed") + return ERR_FW_UPGRADE, log + upgradedebuglog("upgrade success") + return FIRMWARE_SUCCESS, "SUCCESS" + except Exception as e: + return ERR_FW_RAISE_EXCEPTION, str(e) + + def do_pre_check(self, conf): + ret, val = get_value(conf) + if ret is False: + msg = "pre check get value failed, msg: %s" % val + return False, msg + ok_val = conf.get("ok_val") + if val == ok_val: + msg = "pre check success, ok_val: %s, get value: %s" % (ok_val, val) + return True, msg + msg = "pre check failed, ok_val: %s, get value: %s" % (ok_val, val) + return False, msg + + def do_test(self, device, slot): + try: + # slot present check + slot_name = "slot%d" % slot + slot_config = self.upgrade_param.get(slot_name, {}) + slot_present_config = slot_config.get("present", {}) + if len(slot_present_config) != 0: + ret, log = self.linecard_present_check(slot_present_config) + if ret != CHECK_OK: + msg = "check %s present error, msg: %s" % (slot_name, log) + upgradedebuglog(msg) + return ret, msg + upgradedebuglog("%s present" % slot_name) + + # get list of devices to be tested + test_config = slot_config.get("TEST", {}) + if len(test_config) == 0: + return ERR_FW_CONFIG_FOUND, "test config no found" + device_list = test_config.get(device, []) + if len(device_list) == 0: + return ERR_FW_CONFIG_FOUND, ("logic device %s test config list not found" % device) + + # test_file existence check + for test_config in device_list: + chain_num = test_config.get("chain", None) + test_file = test_config.get("file", None) + display_name = test_config.get("display_name", None) + if chain_num is None or test_file is None or display_name is None: + log = "test_config:%s lack of config" % test_config + upgradeerror(log) + return ERR_FW_CONFIG_FOUND, log + if not os.path.isfile(test_file): + return ERR_FW_FILE_FOUND, ("%s not found" % test_file) + + # start testing + RET = 0 + pre_check_failed = 0 + pre_check_failed_summary = "" + failed_summary = "chain test failed.\ntest fail chain:" + success_summary = "test success chain:" + for test_config in device_list: + chain_num = test_config.get("chain", None) + test_file = test_config.get("file", None) + display_name = test_config.get("display_name", None) + pre_check_conf = test_config.get("pre_check", None) + if pre_check_conf is not None: + status, msg = self.do_pre_check(pre_check_conf) + if status is False: + pre_check_failed += 1 + log = "\nchain:%d, name:%s, pre check failed, msg: %s" % (chain_num, display_name, msg) + upgradedebuglog(log) + pre_check_failed_summary += log + continue + upgradedebuglog("chain:%d, name:%s, pre check ok, msg: %s" % (chain_num, display_name, msg)) + ret, log = self.do_upgrade(test_file, slot, TEST_UPGRADE) + if ret != FIRMWARE_SUCCESS: + RET = -1 + upgradeerror("chain:%d, name:%s test failed" % (chain_num, display_name)) + failed_summary += "\n chain:%d, name:%s;" % (chain_num, display_name) + else: + upgradedebuglog("chain:%d, name:%s test success" % (chain_num, display_name)) + success_summary += "\n chain:%d, name:%s;" % (chain_num, display_name) + if RET != 0: + return ERR_FW_UPGRADE, failed_summary + if pre_check_failed == len(device_list): + return ERR_FW_NO_FILE_SUCCESS, failed_summary + pre_check_failed_summary + return FIRMWARE_SUCCESS, success_summary + except Exception as e: + return ERR_FW_RAISE_EXCEPTION, str(e) + + def do_test_main(self, device, slot): + print("+================================+") + print("|Doing upgrade test, please wait.|") + ret, log = self.do_test(device, slot) + if ret == FIRMWARE_SUCCESS: + print("| test succeeded! |") + print("+================================+") + print(log) + sys.exit(0) + else: + print("| test failed! |") + print("+================================+") + print("FAILED REASON:") + print(log) + sys.exit(1) + + def do_bmc_upgrade_main(self, file, chip_select, erase_type): + bmc_upgrade_config = self.upgrade_param.get("BMC", {}) + ret, log = self.upgrading(bmc_upgrade_config, file, self.devtype, + self.subtype, chip_select, BMC_UPGRADE, erase_type) + if ret is True: + print("===========upgrade succeeded!============") + sys.exit(0) + else: + print("============upgrade failed!==============") + print("FAILED REASON:") + print("%s" % log) + sys.exit(1) + + +class FileUpg(object): + def __init__(self, config, file, devtype, subtype, slot, filetype, chain, upg_type): + self.config = config + self.file = file + self.devtype = devtype + self.subtype = subtype + self.slot = slot + self.filetype = filetype + self.chain = chain + self.upg_type = upg_type + + def __repr__(self): + return "file:%s slot:%d" % (self.file, self.slot) + + +class FwUpg(object): + def __init__(self): + self.upg_platform = BasePlatform() + self.warm_upg_platform = WarmBasePlatform() + self.max_slot_num = self.upg_platform.max_slot_num + self.file_list = [] + + def do_file_refresh(self, fw_upg_instance): + fw_upg_config = fw_upg_instance.config + fw_upg_file = fw_upg_instance.file + fw_upg_devtype = fw_upg_instance.devtype + fw_upg_subype = fw_upg_instance.subtype + fw_upg_slot = fw_upg_instance.slot + fw_upg_filetype = fw_upg_instance.filetype + fw_upg_chain = fw_upg_instance.chain + dev_name = fw_upg_config.get("name", None) + upgradedebuglog("%s start warm upgrade, file: %s, devtype:0x%x, subype: 0x%x, slot: %d, filetype: %s, chain: %d" % + (dev_name, fw_upg_file, fw_upg_devtype, fw_upg_subype, fw_upg_slot, fw_upg_filetype, fw_upg_chain)) + status, output = self.warm_upg_platform.do_warmupgrade(fw_upg_file, fw_upg_devtype, fw_upg_subype, fw_upg_slot, + fw_upg_filetype, fw_upg_chain) + if status is False: + upgradeerror("%s warm upgrade failed, msg: %s" % (dev_name, output)) + return False, output + upgradedebuglog("%s warm upgrade success" % dev_name) + return True, "upgrade success" + + def do_refresh(self): + try: + exec_os_cmd("touch %s" % WARM_UPGRADE_STARTED_FLAG) + exec_os_cmd("sync") + + # stop upper layer services access + ret, log = self.warm_upg_platform.stop_services_access() + if ret is False: + upgradeerror("stop upper layer services access failed") + upgradeerror(log) + return ERR_FW_UPGRADE, log + upgradedebuglog("stop upper layer services access success") + + for file_instance in self.file_list: + file_info = repr(file_instance) + ret, log = self.do_file_refresh(file_instance) + if ret is False: + msg = "%s refresh failed, ret:%s, \n log:%s." % (file_info, ret, log) + upgradeerror(msg) + return ERR_FW_UPGRADE, msg + upgradedebuglog("%s refresh success." % file_info) + msg = "all files refresh success." + return FIRMWARE_SUCCESS, msg + except Exception as e: + msg = "do warm upg exception happend. log:%s" % str(e) + upgradeerror(msg) + return ERR_FW_UPGRADE, msg + finally: + self.warm_upg_platform.start_services_access() + if os.path.isfile(WARM_UPGRADE_STARTED_FLAG): + exec_os_cmd("rm -rf %s" % WARM_UPGRADE_STARTED_FLAG) + exec_os_cmd("sync") + + def do_file_cold_upg(self, fw_upg_instance): + try: + upgradedebuglog("start cold upgrade") + fw_upg_config = fw_upg_instance.config + fw_upg_file = fw_upg_instance.file + fw_upg_devtype = fw_upg_instance.devtype + fw_upg_subype = fw_upg_instance.subtype + fw_upg_slot = fw_upg_instance.slot + ret, log = self.upg_platform.upgrading( + fw_upg_config, fw_upg_file, fw_upg_devtype, fw_upg_subype, fw_upg_slot, COLD_UPGRADE) + if ret is False: + upgradeerror("cold upgrade %s slot%d failed, log:%s" % (fw_upg_file, fw_upg_slot, log)) + return ERR_FW_UPGRADE, log + log = "cold upgrade %s slot%d success" % (fw_upg_file, fw_upg_slot) + upgradedebuglog(log) + return FIRMWARE_SUCCESS, log + except Exception as e: + msg = "do cold upg exception happend. log:%s" % str(e) + upgradeerror(msg) + return ERR_FW_UPGRADE, msg + + def do_file_init_check(self, file_path, slot, upg_type): + upgradedebuglog("do_file_init_check, file_path: %s, slot: %s, upg_type: %s" % (file_path, slot, upg_type)) + + if slot is None: # traverse all slots + for i in range(0, self.max_slot_num + 1): + ret, log = self.upg_platform.initial_check(file_path, i, upg_type) + if ret != CHECK_OK: + upgradedebuglog( + "file: %s, slot%d initial check not ok, ret: %d, msg: %s" % + (file_path, i, ret, log)) + accept_error = (ERR_FW_CARD_ABSENT, ERR_FW_HEAD_CHECK, ERR_FW_FOOL_PROOF) + if ret in accept_error: + msg = "file: %s, slot%d initial check ret: %d, acceptable error." % (file_path, i, ret) + upgradedebuglog(msg) + continue + return ret, log + file_instance = FileUpg(self.upg_platform.cold_chain_config, file_path, self.upg_platform.devtype, + self.upg_platform.subtype, i, self.upg_platform.filetype, self.upg_platform.chain, upg_type) + self.file_list.append(file_instance) + else: + slot = int(slot, 10) + ret, log = self.upg_platform.initial_check(file_path, slot, upg_type) + if ret != CHECK_OK: + msg = "file: %s, slot%d initial check not ok, ret: %d, msg: %s" % (file_path, slot, ret, log) + return ret, msg + file_instance = FileUpg(self.upg_platform.cold_chain_config, file_path, self.upg_platform.devtype, + self.upg_platform.subtype, slot, self.upg_platform.filetype, self.upg_platform.chain, upg_type) + self.file_list.append(file_instance) + msg = "file: %s all slots init check ok" % file_path + return CHECK_OK, msg + + def do_dir_init_check(self, path, slot, upg_type): + for root, dirs, names in os.walk(path): + # root: directory absolute path + # dirs: folder path collection under directory + # names: file path collection under directory + for filename in names: + # file_path is file absolute path + file_path = os.path.join(root, filename) + ret, log = self.do_file_init_check(file_path, slot, upg_type) + if ret != CHECK_OK: + return ret, log + msg = "all files in dir have been check ok" + upgradedebuglog(msg) + return CHECK_OK, msg + + def do_fw_upg(self, path, slot, upg_type): + match_zip_file_flag = False + try: + upgradedebuglog("do_fw_upg, path: %s, slot: %s, upg_type: %s" % (path, slot, upg_type)) + if slot is not None and not slot.isdigit(): + msg = "invalid slot param: %s" % slot + upgradeerror(msg) + return ERR_FW_INVALID_PARAM, msg + + upgradedebuglog("start init check") + if os.path.isfile(path) and path.endswith(".zip"): + upgradedebuglog("firmware upgrade via compressed package: %s" % path) + # remove origin firmware upgrade file + exec_os_cmd("rm -rf %s" % UPGRADE_FILE_DIR) + cmd = "unzip -o %s -d /tmp/" % path + if os.path.exists(UPGRADE_DEBUG_FILE): + status, output = exec_os_cmd_log(cmd) + else: + status, output = exec_os_cmd(cmd) + if status: + msg = "unzip %s failed, log: %s" % (path, output) + upgradeerror(msg) + return ERR_FW_UNZIP_FAILED, msg + match_zip_file_flag = True + path = UPGRADE_FILE_DIR + + if os.path.isdir(path): + ret, msg = self.do_dir_init_check(path, slot, upg_type) + elif os.path.isfile(path): + ret, msg = self.do_file_init_check(path, slot, upg_type) + else: + ret = ERR_FW_FILE_FOUND + msg = "path: %s not found" % path + upgradeerror(msg) + + if ret != CHECK_OK: + return ret, msg + + # self.file_list is a collection of all check ok files + if len(self.file_list) == 0: + msg = "all file upgrade check not be satisfied." + upgradeerror(msg) + return ERR_FW_NO_FILE_SUCCESS, msg + + SUCCUSS_FILE_SUMMARY = "SUCCESS FILE: \n" + # file cold upgrade + upgradedebuglog("start all files cold upgrade") + for file_instance in self.file_list: + file_info = repr(file_instance) + ret, log = self.do_file_cold_upg(file_instance) + if ret != FIRMWARE_SUCCESS: + msg = "%s cold upgrade failed, ret:%d, \n log:\n%s." % (file_info, ret, log) + upgradeerror(msg) + return ret, msg + SUCCUSS_FILE_SUMMARY += "%s \n" % file_info + upgradedebuglog("%s cold upgrade success." % file_info) + + # file refresh upgrade + if upg_type == WARM_UPGRADE: + upgradedebuglog("start all files refresh upgrade") + ret, log = self.do_refresh() + if ret != FIRMWARE_SUCCESS: + return ret, log + + msg = "all file upgrade success" + upgradedebuglog(msg) + return FIRMWARE_SUCCESS, SUCCUSS_FILE_SUMMARY + except Exception as e: + msg = "do dir upgrade exception happend. log: %s" % str(e) + upgradeerror(msg) + return ERR_FW_UPGRADE, msg + finally: + if match_zip_file_flag is True: + exec_os_cmd("rm -rf %s" % UPGRADE_FILE_DIR) + + def fw_upg(self, path, slot, upg_type): + print("+================================+") + print("| Doing upgrade, please wait... |") + ret, log = self.do_fw_upg(path, slot, upg_type) + if ret == FIRMWARE_SUCCESS: + print("| upgrade succeeded! |") + print("+================================+") + print(log) + sys.exit(0) + else: + print("| upgrade failed! |") + print("+================================+") + print("FAILED REASON:") + print("%s" % log) + sys.exit(1) + + +@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS) +def main(): + '''upgrade script''' + + +# cold upgrade +@main.command() +@click.argument('file_name', required=True) +@click.argument('slot_num', required=False, default=None) +def cold(file_name, slot_num): + '''cold upgrade''' + fwupg = FwUpg() + fwupg.fw_upg(file_name, slot_num, COLD_UPGRADE) + + +# warm upgrade +@main.command() +@click.argument('file_name', required=True) +@click.argument('slot_num', required=False, default=None) +def warm(file_name, slot_num): + '''warm upgrade''' + fwupg = FwUpg() + fwupg.fw_upg(file_name, slot_num, WARM_UPGRADE) + + +# test upgrade +@main.command() +@click.argument('device', required=True) +@click.argument('slot_num', required=True) +def test(device, slot_num): + '''upgrade test''' + platform = BasePlatform() + platform.do_test_main(device, int(slot_num)) + + +# BMC upgrade +@main.command() +@click.argument('file_name', required=True) +@click.argument('chip_select', required=False, default="2") +@click.argument('erase_type', required=False, default="full") +def bmc(file_name, chip_select, erase_type): + '''BMC upgrade''' + platform = BasePlatform() + platform.do_bmc_upgrade_main(file_name, chip_select, erase_type) + + +if __name__ == '__main__': + signal_init() + debug_init() + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/script/warm_upgrade.py b/platform/broadcom/sonic-platform-modules-micas/common/script/warm_upgrade.py new file mode 100755 index 000000000000..69a310faa606 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/script/warm_upgrade.py @@ -0,0 +1,514 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- +import sys +import os +import time +import syslog +import signal +import click +from platform_util import get_value, set_value, exec_os_cmd, exec_os_cmd_log +from platform_config import WARM_UPGRADE_PARAM + + +WARM_UPGRADE_DEBUG_FILE = "/etc/.warm_upgrade_debug_flag" + +WARMUPGRADEDEBUG = 1 + +debuglevel = 0 + +CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']} + + +class AliasedGroup(click.Group): + + def get_command(self, ctx, cmd_name): + rv = click.Group.get_command(self, ctx, cmd_name) + if rv is not None: + return rv + matches = [x for x in self.list_commands(ctx) + if x.startswith(cmd_name)] + if not matches: + return None + if len(matches) == 1: + return click.Group.get_command(self, ctx, matches[0]) + ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) + return None + + +def debug_init(): + global debuglevel + if os.path.exists(WARM_UPGRADE_DEBUG_FILE): + debuglevel = debuglevel | WARMUPGRADEDEBUG + else: + debuglevel = debuglevel & ~(WARMUPGRADEDEBUG) + + +def warmupgradewarninglog(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("WARMUPGRADE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_WARNING, s) + + +def warmupgradecriticallog(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("WARMUPGRADE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_CRIT, s) + + +def warmupgradeerror(s): + # s = s.decode('utf-8').encode('gb2312') + syslog.openlog("WARMUPGRADE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_ERR, s) + + +def warmupgradedebuglog(s): + # s = s.decode('utf-8').encode('gb2312') + if WARMUPGRADEDEBUG & debuglevel: + syslog.openlog("WARMUPGRADE", syslog.LOG_PID) + syslog.syslog(syslog.LOG_DEBUG, s) + + +def subprocess_warm_upgrade(file, main_type, sub_type, slot): + command = "firmware_upgrade %s 0x%x 0x%x %s" % (file, main_type, sub_type, slot) + warmupgradedebuglog("warm upgrade firmware cmd:%s" % command) + if os.path.exists(WARM_UPGRADE_DEBUG_FILE): + return exec_os_cmd_log(command) + return exec_os_cmd(command) + + +def signal_init(): + signal.signal(signal.SIGINT, signal.SIG_IGN) # ignore ctrl+c signal + signal.signal(signal.SIGTERM, signal.SIG_IGN) # ignore kill signal + signal.signal(signal.SIGTSTP, signal.SIG_IGN) # ignore ctrl+z signal + + +class RefreshUpgradeBase(object): + + def __init__(self, config, slot_num, devtype, subtype): + self._config = config + self._slot_num = slot_num + self._devtype = devtype + self._subtype = subtype + self.device_name = self._config.get("name", None) + self.refresh_file = self._config.get("refresh_file", None) + self.init_cmd_list = self._config.get("init_cmd", []) + self.save_set_reg_list = self._config.get("save_set_reg", []) + self.rw_recover_reg_list = self._config.get("rw_recover_reg", []) + self.after_upgrade_delay = self._config.get("after_upgrade_delay", None) + self.after_upgrade_delay_timeout = self._config.get("after_upgrade_delay_timeout", None) + self.refresh_finish_flag_check_config = self._config.get("refresh_finish_flag_check", None) + self.access_check_reg_config = self._config.get("access_check_reg", {}) + self.time_delay = 0 + self.finish_cmd_list = self._config.get("finish_cmd", []) + + def get_config(self): + pass + + def get_slot_num(self): + pass + + def save_value(self, cfg_list): + for config in cfg_list: + ret, val = get_value(config) + if ret: + config["value"] = val + else: + warmupgradeerror(val) + return False, val + return True, "save value success" + + def save_and_set_value(self, cfg_list): + for config in cfg_list: + ret, val = get_value(config) + if ret: + config["save_value"] = val + else: + warmupgradeerror(val) + return False, "get save value fail" + set_val = config.get("set_value", None) + if set_val is not None: + config["value"] = set_val + else: + warmupgradeerror("save_and_set_value lack of set_val config") + return False, "set value is not config" + ret, log = set_value(config) + if ret is False: + warmupgradeerror(log) + return False, log + return True, "save value success" + + def recover_value(self, cfg_list): + fail_flag = 0 + for config in cfg_list: + ret, log = set_value(config) + if ret is False: + fail_flag = -1 + warmupgradeerror("recover_value set_value failed, log: %s" % log) + if fail_flag != 0: + warmupgradeerror("recover_value write failed") + return False, "recover write failed" + return True, "recover write success" + + def recover_save_value(self, cfg_list): + total_err = 0 + for config in cfg_list: + val = config.get("save_value", None) + if val is None: + warmupgradeerror("recover_save_value lack of save_value config") + total_err -= 1 + continue + config["value"] = val + ret, log = set_value(config) + if ret is False: + total_err -= 1 + warmupgradeerror("recover save value write failed, log: %s" % log) + else: + warmupgradedebuglog("recover save value success") + if total_err < 0: + return False, "recover save value failed" + return True, "recover save value success" + + def do_fw_upg_init_cmd(self, init_cmd_list): + # pre operation + try: + for init_cmd_config in init_cmd_list: + ret, log = set_value(init_cmd_config) + if ret is False: + warmupgradeerror("%s do init cmd: %s failed, msg: %s" % (self.device_name, init_cmd_config, log)) + return False, log + msg = "%s warm upgrade init cmd all set success" % self.device_name + warmupgradedebuglog(msg) + return True, msg + except Exception as e: + return False, str(e) + + def do_fw_upg_finish_cmd(self, finish_cmd_list): + # end operation + total_err = 0 + for finish_cmd_config in finish_cmd_list: + ret_t, log = set_value(finish_cmd_config) + if ret_t is False: + warmupgradeerror("%s do finish cmd: %s failed, msg: %s" % (self.device_name, finish_cmd_config, log)) + total_err -= 1 + if total_err < 0: + msg = "%s warm upgrade finish cmd exec failed" % self.device_name + warmupgradeerror(msg) + return False, msg + msg = "%s warm upgrade finish cmd all set success" % self.device_name + warmupgradedebuglog(msg) + return True, msg + + def access_test(self, config): + # polling execute command + polling_cmd_list = config.get("polling_cmd", []) + for polling_cmd_config in polling_cmd_list: + ret, log = set_value(polling_cmd_config) + if ret is False: + warmupgradeerror(log) + return False + polling_delay = config.get("polling_delay", None) + if polling_delay is not None: + time.sleep(polling_delay) + + # record check val + check_val = config.get("value", None) + # write value + ret, log = set_value(config) + if ret is False: + warmupgradeerror(log) + return False + # read value + ret, val = get_value(config) + if ret is False: + warmupgradeerror(val) + return False + + # compare write and read val + warmupgradedebuglog("check_val:%s" % check_val) + warmupgradedebuglog("get_value:%s" % val) + if val != check_val: + warmupgradeerror("check_val:%s != get_value:%s" % (check_val, val)) + return False + return True + + def check_value(self, config): + # record check val + check_val = config.get("value", None) + ret, val = get_value(config) + if ret is False: + warmupgradeerror(val) + return False + # compare write and read val + warmupgradedebuglog("check_val:%s" % check_val) + warmupgradedebuglog("get_value:%s" % val) + if val != check_val: + warmupgradeerror("check_val:%s != get_value:%s" % (check_val, val)) + return False + return True + + def refresh_file_upgrade(self): + try: + warmupgradedebuglog("start %s warm upgrading" % self.device_name) + + # save and set reg + ret, log = self.save_and_set_value(self.save_set_reg_list) + if ret is False: + warmupgradeerror(log) + self.recover_save_value(self.save_set_reg_list) + self.do_fw_upg_finish_cmd(self.finish_cmd_list) + return False, log + warmupgradedebuglog("%s save and set reg cmd all set success" % self.device_name) + time.sleep(0.5) # delay 0.5s after execute save and set reg + + # pre operation + ret, log = self.do_fw_upg_init_cmd(self.init_cmd_list) + if ret is False: + warmupgradeerror(log) + self.recover_save_value(self.save_set_reg_list) + self.do_fw_upg_finish_cmd(self.finish_cmd_list) + return False, log + time.sleep(0.5) # delay 0.5s after execute init_cmd + + # save reg + ret, log = self.save_value(self.rw_recover_reg_list) + if ret is False: + warmupgradeerror("%s save reg failed" % self.device_name) + self.recover_save_value(self.save_set_reg_list) + self.do_fw_upg_finish_cmd(self.finish_cmd_list) + return False, log + warmupgradedebuglog("%s all reg save success" % self.device_name) + + # upgrade refresh file + if self.refresh_file is not None: + status, output = subprocess_warm_upgrade( + self.refresh_file, self._devtype, self._subtype, self._slot_num) + if status: + log = "%s refresh file upg failed, msg: %s" % (self.device_name, output) + warmupgradeerror(log) + self.recover_save_value(self.save_set_reg_list) + self.do_fw_upg_finish_cmd(self.finish_cmd_list) + return False, log + warmupgradedebuglog("%s refresh file upg success" % self.device_name) + + # delay the preset time after the upgrade is complete + if self.after_upgrade_delay is not None: + time.sleep(self.after_upgrade_delay) + + # check something in the timeout period + if self.after_upgrade_delay_timeout is not None: + while self.time_delay < self.after_upgrade_delay_timeout: + + # check refresh finish flag + if self.refresh_finish_flag_check_config is not None: + ret = self.check_value(self.refresh_finish_flag_check_config) + if ret is False: + time.sleep(1) + self.time_delay = self.time_delay + 1 + warmupgradedebuglog("doing refresh_finish_flag_check, time_delay:%s" % self.time_delay) + continue + warmupgradedebuglog("%s upgrade_finish_flag_check success. self.time_delay:%d" + % (self.device_name, self.time_delay)) + + # doing logic device rw access test + ret = self.access_test(self.access_check_reg_config) + if ret: + warmupgradedebuglog( + "%s rw test success. self.time_delay:%d" % + (self.device_name, self.time_delay)) + break + time.sleep(1) + self.time_delay = self.time_delay + 1 + warmupgradedebuglog("doing access_test, self.time_delay:%s" % self.time_delay) + + if self.time_delay >= self.after_upgrade_delay_timeout: + log = "wait %s access test timeout" % self.device_name + warmupgradeerror(log) + self.recover_save_value(self.save_set_reg_list) + self.do_fw_upg_finish_cmd(self.finish_cmd_list) + return False, log + warmupgradedebuglog("%s access test success" % self.device_name) + + # recover reg + ret, log = self.recover_value(self.rw_recover_reg_list) + if ret is False: + warmupgradeerror("recover %s reg failed" % self.device_name) + self.recover_save_value(self.save_set_reg_list) + self.do_fw_upg_finish_cmd(self.finish_cmd_list) + return False, log + warmupgradedebuglog("recover %s reg success" % self.device_name) + # finally + ret1, log1 = self.recover_save_value(self.save_set_reg_list) + if ret1 is False: + warmupgradeerror("bmc upgrade recover save value failed, msg: %s" % log1) + ret2, log2 = self.do_fw_upg_finish_cmd(self.finish_cmd_list) + if ret2 is False: + warmupgradeerror("bmc upgrade do finish command failed, msg: %s" % log2) + if ret1 is False or ret2 is False: + return False, "upgrading %s recover save value or finish command failed" % self.device_name + return True, "upgrading %s success" % self.device_name + + except Exception as e: + log = "refresh file upgrade Exception happend, error log : %s" % str(e) + self.recover_save_value(self.save_set_reg_list) + self.do_fw_upg_finish_cmd(self.finish_cmd_list) + return False, log + + +class RefreshUpgrade(RefreshUpgradeBase): + + def __init__(self, config, slot_num, devtype, subtype): + super(RefreshUpgrade, self).__init__(config, slot_num, devtype, subtype) + + def get_config(self): + super(RefreshUpgrade, self).get_config() + return self._config + + def get_slot_num(self): + super(RefreshUpgrade, self).get_slot_num() + return self._slot_num + + +class WarmBasePlatform(): + + def __init__(self): + signal_init() + debug_init() + self.warm_upgrade_param = WARM_UPGRADE_PARAM.copy() + self.stop_services_cmd_list = self.warm_upgrade_param.get("stop_services_cmd", []) + self.start_services_cmd_list = self.warm_upgrade_param.get("start_services_cmd", []) + self.__warm_upgrade_config_list = [] + + def execute_command_list(self, cmd_list): + for cmd_item in cmd_list: + warmupgradedebuglog("execute cmd: %s" % cmd_item) + status, output = exec_os_cmd(cmd_item) + if status: + log = "execute %s failed, msg: %s" % (cmd_item, output) + warmupgradeerror(log) + return False, log + return True, "execute success" + + def stop_services_access(self): + return self.execute_command_list(self.stop_services_cmd_list) + + def start_services_access(self): + return self.execute_command_list(self.start_services_cmd_list) + + def check_slot_present(self, slot_present_config): + totalerr = 0 + presentbit = slot_present_config.get('presentbit') + ret, value = get_value(slot_present_config) + if ret is False: + return "NOT OK" + if isinstance(value, str): + val_t = int(value, 16) + else: + val_t = value + val_t = (val_t & (1 << presentbit)) >> presentbit + if val_t != slot_present_config.get('okval'): + status = "ABSENT" + else: + status = "PRESENT" + return status + + def linecard_present_check(self, slot_name, slot_present_config): + present_status = self.check_slot_present(slot_present_config) + present_status_tuple = ("ABSENT", "NOT OK") + if present_status in present_status_tuple: + return False, ("%s not present, warm upgrade exit" % slot_name) + warmupgradedebuglog("%s present" % slot_name) + return True, ("%s present" % slot_name) + + def start_warmupgrade(self): + try: + # start refresh file upgrade process + for dev in self.__warm_upgrade_config_list: + ret, log = dev.refresh_file_upgrade() + if ret is False: + return ret, log + return True, "all success" + except Exception as e: + log = "Exception happend, error log : %s" % str(e) + return False, log + + def do_warmupgrade(self, file, main_type, sub_type, slot, file_type, chain): + try: + # upgrade file existence check + if not os.path.isfile(file): + return False, "%s not found" % file + + # get slot config + slot_name = "slot%d" % slot + slot_config = self.warm_upgrade_param.get(slot_name, {}) + if len(slot_config) == 0: + return False, ("%s config not found" % slot_name) + + # linecard present check + slot_present_config = slot_config.get("present", {}) + if len(slot_present_config) != 0: + ret, log = self.linecard_present_check(slot_name, slot_present_config) + if ret is False: + return False, log + + # match file_type and chain_num get chain_config + file_type_config = slot_config.get(file_type, {}) + chain_name = "chain%d" % chain + chain_list = file_type_config.get(chain_name, []) + self.__warm_upgrade_config_list = [] + for refresh_config in chain_list: + # refresh_file existence check + refresh_file_judge_flag = refresh_config.get("refresh_file_judge_flag", 0) + if refresh_file_judge_flag == 1: + refresh_file = refresh_config.get("refresh_file", None) + if not os.path.isfile(refresh_file): + log = "%s not found" % refresh_file + return False, log + # each refresh_config add as an instance of RefreshUpgrade Class + refresh_instance = RefreshUpgrade(refresh_config, slot, main_type, sub_type) + self.__warm_upgrade_config_list.append(refresh_instance) + + ret, log = self.start_warmupgrade() + if ret is False: + warmupgradeerror("doing warm upgrade failed") + warmupgradeerror(log) + return ret, log + + except Exception as e: + log = "Exception happend, error log : %s" % str(e) + return False, log + return True, "all success" + + def do_warm_upgrade(self, file, main_type, sub_type, slot, file_type, chain): + print("+================================+") + print("|Begin warm upgrade, please wait..|") + ret, log = self.do_warmupgrade(file, main_type, sub_type, slot, file_type, chain) + if ret: + print("| warm upgrade succeeded! |") + print("+================================+") + sys.exit(0) + else: + print("| warm upgrade failed! |") + print("+================================+") + print("FAILED REASON:") + print("%s" % log) + sys.exit(1) + + +@click.group(invoke_without_command=True, context_settings=CONTEXT_SETTINGS) +@click.argument('file', required=True) +@click.argument('main_type', required=True) +@click.argument('sub_type', required=True) +@click.argument('slot', required=True) +@click.argument('file_type', required=True) +@click.argument('chain', required=True) +def main(file, main_type, sub_type, slot, file_type, chain): + '''warm upgrade''' + signal_init() + debug_init() + platform = WarmBasePlatform() + platform.do_warm_upgrade(file, int(main_type, 16), int(sub_type, 16), int(slot), file_type, int(chain)) + + +# warm upgrade +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/service/platform_driver.service b/platform/broadcom/sonic-platform-modules-micas/common/service/platform_driver.service new file mode 100644 index 000000000000..08a49d695c92 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/service/platform_driver.service @@ -0,0 +1,15 @@ +[Unit] +Description= Global Initialize platform drivers. +After=local-fs.target +Before=pmon.service platform_process.service +#DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/platform_driver.py start +ExecStop=/usr/local/bin/platform_driver.py stop +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target + diff --git a/platform/broadcom/sonic-platform-modules-micas/common/service/platform_process.service b/platform/broadcom/sonic-platform-modules-micas/common/service/platform_process.service new file mode 100644 index 000000000000..13dd778559f2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/service/platform_process.service @@ -0,0 +1,16 @@ +[Unit] +Description= Global Load process. +After=platform_driver.service +Before=determine-reboot-cause.service pmon.service +Requires=platform_driver.service +#DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/platform_process.py start +ExecStop=/usr/local/bin/platform_process.py stop +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target + diff --git a/platform/broadcom/sonic-platform-modules-micas/common/service/subnetwork.service b/platform/broadcom/sonic-platform-modules-micas/common/service/subnetwork.service new file mode 100644 index 000000000000..666046592116 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/service/subnetwork.service @@ -0,0 +1,13 @@ +[Unit] +Description=Configuration eth0.4088 subnetwork +After=network.target +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/subnetwork.py start +ExecStop=/usr/local/bin/subnetwork.py stop +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/__init__.py new file mode 100644 index 000000000000..b70995a582fc --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/__init__.py @@ -0,0 +1,2 @@ +__all__ = ["platform", "chassis", "sfp", "eeprom", "component", "thermal", "psu", "fan", "fan_drawer", "watchdog"] +from . import platform diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/chassis.py new file mode 100644 index 000000000000..b0ddc8691f2e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/chassis.py @@ -0,0 +1,530 @@ +#!/usr/bin/env python3 + +############################################################################# +# +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + +try: + import time + import sys + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.sfp import Sfp + from sonic_platform.psu import Psu + # from sonic_platform.fan import Fan + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.thermal import Thermal + # from sonic_platform.watchdog import Watchdog + from sonic_platform.component import Component + from sonic_platform.eeprom import Eeprom + from sonic_platform.dcdc import Dcdc + from plat_hal.baseutil import baseutil + + from plat_hal.interface import interface + +except ImportError as error: + raise ImportError(str(error) + "- required module not found")from error + + +class Chassis(ChassisBase): + """ + Platform-specific Chassis class + """ + # List of Dcdc objects representing all dcdc + # available on the chassis + _dcdc_list = None + + STATUS_INSERTED = "1" + STATUS_REMOVED = "0" + STATUS_NORMAL = "0" + STATUS_ABNORMAL = "1" + sfp_present_dict = {} + fan_present_dict = {} + voltage_status_dict = {} + + def __init__(self): + ChassisBase.__init__(self) + self._dcdc_list = [] + self.int_case = interface() + # Initialize SFP list + + # sfp.py will read eeprom contents and retrive the eeprom data. + # It will also provide support sfp controls like reset and setting + # low power mode. + # We pass the eeprom path and sfp control path from chassis.py + # So that sfp.py implementation can be generic to all platforms + try: + self._sfp_list = [] + self.port_num = baseutil.get_config().get("sfps", None).get("port_num", 0) + self.port_start_index = baseutil.get_config().get("sfps", None).get("port_index_start", 0) + # fix problem with first index is 1, we add a fake sfp node + if self.port_start_index == 1: + self._sfp_list.append(Sfp(1)) + + # sfp id always start at 1 + for index in range(1, self.port_num + 1): + self._sfp_list.append(Sfp(index)) + + for i in range(self.port_start_index, self.port_start_index + self.port_num): + self.sfp_present_dict[i] = self.STATUS_REMOVED + + except Exception as err: + print("SFP init error: %s" % str(err)) + + try: + self._eeprom = Eeprom(self.int_case) + except Exception as err: + print("EEPROM INIT ERROR %s" % str(err)) + + # Initialize watchdog + # self._watchdog = Watchdog() + fantray_num = self.int_case.get_fan_total_number() + for index in range(fantray_num): + fandrawer = FanDrawer(self.int_case, index + 1) + self._fan_drawer_list.append(fandrawer) + self._fan_list.extend(fandrawer._fan_list) + + psu_num = self.int_case.get_psu_total_number() + for index in range(psu_num): + psuobj = Psu(self.int_case, index + 1) + self._psu_list.append(psuobj) + + thermal_num = self.int_case.get_temp_id_number() + for index in range(thermal_num): + thermalobj = Thermal(self.int_case, index + 1) + self._thermal_list.append(thermalobj) + + component_num = self.int_case.get_cpld_total_number() + for index in range(component_num): + componentobj = Component(self.int_case, index + 1) + self._component_list.append(componentobj) + + dcdc_num = self.int_case.get_dcdc_total_number() + for index in range(dcdc_num): + dcdcobj = Dcdc(self.int_case, index + 1) + self._dcdc_list.append(dcdcobj) + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + name = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + name = sys_eeprom.modelstr(e) + if name is None: + return '' + return name + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + model = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + model = sys_eeprom.modelnumber(e) + if model is None: + return '' + return model + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this chassis. + """ + serial_number = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + serial_number = sys_eeprom.serial_number_str(e) + if serial_number is None: + return '' + + return serial_number + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + device_version = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + device_version = sys_eeprom.deviceversion(e) + if device_version is None: + return '' + + return device_version + + def get_serial(self): + """ + Retrieves the serial number of the chassis (Service tag) + Returns: + string: Serial number of chassis + """ + return self.get_serial_number() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def initizalize_system_led(self): + return True + + def set_status_led(self, color): + return False + + def get_status_led(self): + """ + Gets the state of the system LED + + Returns: + A string, one of the valid LED color strings which could be vendor + specified. + """ + ret, color = self.int_case.get_led_color_by_type('SYS_LED') + if ret is True: + return color + return 'N/A' + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + base_mac = '' + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return '' + + e = sys_eeprom.read_eeprom() + base_mac = sys_eeprom.base_mac_addr(e) + if base_mac is None: + return '' + + return base_mac.upper() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + """ + sys_eeprom = self.get_eeprom() + if sys_eeprom is None: + return {} + return sys_eeprom.system_eeprom_info() + + def get_thermal_manager(self): + """ + Retrieves thermal manager class on this chassis + :return: A class derived from ThermalManagerBase representing the + specified thermal manager. ThermalManagerBase is returned as default + """ + return False + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + reboot_cause_msg = self.int_case.get_cpu_reboot_cause() + if "Power Loss" in reboot_cause_msg: + reboot_cause_type = self.REBOOT_CAUSE_POWER_LOSS + elif "Watchdog" in reboot_cause_msg: + reboot_cause_type = self.REBOOT_CAUSE_WATCHDOG + elif "BMC reboot" in reboot_cause_msg or "BMC powerdown" in reboot_cause_msg: + reboot_cause_type = self.REBOOT_CAUSE_HARDWARE_OTHER + elif "Thermal Overload: ASIC" in reboot_cause_msg: + reboot_cause_type = self.REBOOT_CAUSE_THERMAL_OVERLOAD_ASIC + elif "Thermal Overload: Other" in reboot_cause_msg: + reboot_cause_type = self.REBOOT_CAUSE_THERMAL_OVERLOAD_OTHER + elif "Other" in reboot_cause_msg: + reboot_cause_type = self.REBOOT_CAUSE_NON_HARDWARE + else: + reboot_cause_type = self.REBOOT_CAUSE_NON_HARDWARE + return (reboot_cause_type, reboot_cause_msg) + + def get_module(self, index): + """ + Retrieves module represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the module to + retrieve + + Returns: + An object dervied from ModuleBase representing the specified + module + """ + module = None + + try: + if self.get_num_modules(): + module = self._module_list[index] + except IndexError: + sys.stderr.write("Module index {} out of range (0-{})\n".format( + index, len(self._module_list) - 1)) + + return module + + def get_fan_drawer(self, index): + """ + Retrieves fan drawers represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the fan drawer to + retrieve + + Returns: + An object dervied from FanDrawerBase representing the specified fan + drawer + """ + fan_drawer = None + + try: + if self.get_num_fan_drawers(): + fan_drawer = self._fan_drawer_list[index] + except IndexError: + sys.stderr.write("Fan drawer index {} out of range (0-{})\n".format( + index, len(self._fan_drawer_list) - 1)) + + return fan_drawer + + def get_change_event(self, timeout=0): + """ + Returns a nested dictionary containing all devices which have + experienced a change at chassis level + + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + + Returns: + (bool, dict): + - bool: True if call successful, False if not; + - dict: A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, where device_id is the device ID + for this device and device_event. + The known devices's device_id and device_event was defined as table below. + ----------------------------------------------------------------- + device | device_id | device_event | annotate + ----------------------------------------------------------------- + 'fan' '' '0' Fan removed + '1' Fan inserted + + 'sfp' '' '0' Sfp removed + '1' Sfp inserted + '2' I2C bus stuck + '3' Bad eeprom + '4' Unsupported cable + '5' High Temperature + '6' Bad cable + + 'voltage' '' '0' Vout normal + '1' Vout abnormal + -------------------------------------------------------------------- + Ex. {'fan':{'0':'0', '2':'1'}, 'sfp':{'11':'0', '12':'1'}, + 'voltage':{'U20':'0', 'U21':'1'}} + Indicates that: + fan 0 has been removed, fan 2 has been inserted. + sfp 11 has been removed, sfp 12 has been inserted. + monitored voltage U20 became normal, voltage U21 became abnormal. + Note: For sfp, when event 3-6 happened, the module will not be avalaible, + XCVRD shall stop to read eeprom before SFP recovered from error status. + """ + + change_event_dict = {"fan": {}, "sfp": {}, "voltage": {}} + + start_time = time.time() + forever = False + + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + print("get_change_event:Invalid timeout value: %s" % timeout) + return False, change_event_dict + + end_time = start_time + timeout + if start_time > end_time: + print("get_change_event:time wrap / invalid timeout value: %s" % timeout) + return False, change_event_dict # Time wrap or possibly incorrect timeout + try: + while timeout >= 0: + # check for sfp + sfp_change_dict = self.get_transceiver_change_event() + # check for fan + fan_change_dict = self.get_fan_change_event() + # check for voltage + voltage_change_dict = self.get_voltage_change_event() + + if sfp_change_dict or fan_change_dict or voltage_change_dict: + change_event_dict["sfp"] = sfp_change_dict + change_event_dict["fan"] = fan_change_dict + change_event_dict["voltage"] = voltage_change_dict + return True, change_event_dict + if forever: + time.sleep(1) + else: + timeout = end_time - time.time() + if timeout >= 1: + time.sleep(1) # We poll at 1 second granularity + else: + if timeout > 0: + time.sleep(timeout) + return True, change_event_dict + except Exception as e: + print(e) + print("get_change_event: Should not reach here.") + return False, change_event_dict + + def get_transceiver_change_event(self): + current_sfp_present_dict = {} + ret_dict = {} + + # Check for OIR events and return ret_dict + for i in range(self.port_start_index, self.port_start_index + self.port_num): + sfp = self._sfp_list[i] + if sfp.get_presence(): + current_sfp_present_dict[i] = self.STATUS_INSERTED + + else: + current_sfp_present_dict[i] = self.STATUS_REMOVED + + # Update reg value + if current_sfp_present_dict == self.sfp_present_dict: + return ret_dict + + for index, status in current_sfp_present_dict.items(): + if self.sfp_present_dict[index] != status: + ret_dict[index] = status + + self.sfp_present_dict = current_sfp_present_dict + + return ret_dict + + def get_fan_change_event(self): + current_fan_present_dict = {} + ret_dict = {} + + # Check for OIR events and return ret_dict + for index, fan in enumerate(self._fan_list): + if fan.get_presence() is True: + current_fan_present_dict[index] = self.STATUS_INSERTED + else: + current_fan_present_dict[index] = self.STATUS_REMOVED + + if len(self.fan_present_dict) == 0: # first time + self.fan_present_dict = current_fan_present_dict + return {} + + if current_fan_present_dict == self.fan_present_dict: + return {} + + # updated fan_present_dict + for index, status in current_fan_present_dict.items(): + if self.fan_present_dict[index] != status: + ret_dict[str(index)] = status + self.fan_present_dict = current_fan_present_dict + return ret_dict + + def get_voltage_change_event(self): + current_voltage_status_dict = {} + ret_dict = {} + + # Check for OIR events and return ret_dict + for index, dcdc in enumerate(self._dcdc_list): + name = dcdc.get_name() + value = dcdc.get_value() + high = dcdc.get_high_threshold() + low = dcdc.get_low_threshold() + if (value is None) or (value > high) or (value < low): + current_voltage_status_dict[name] = self.STATUS_ABNORMAL + else: + current_voltage_status_dict[name] = self.STATUS_NORMAL + + if len(self.voltage_status_dict) == 0: # first time + self.voltage_status_dict = current_voltage_status_dict + return {} + + if current_voltage_status_dict == self.voltage_status_dict: + return {} + + # updated voltage_status_dict + for name, status in current_voltage_status_dict.items(): + if self.voltage_status_dict[name] != status: + ret_dict[name] = status + self.voltage_status_dict = current_voltage_status_dict + return ret_dict + + diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/component.py new file mode 100644 index 000000000000..fa674a98a6bf --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/component.py @@ -0,0 +1,226 @@ +#!/usr/bin/env python3 + +######################################################################## +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Components' (e.g., BIOS, CPLD, FPGA, etc.) available in +# the platform +# +######################################################################## + +try: + import time + import subprocess + import os + from sonic_platform_base.component_base import ComponentBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") from e + + +FIRMWARE_UPDATE_DIR = "/tmp/.firmwareupdate/" + +class Component(ComponentBase): + """Platform-specific Component class""" + + def __init__(self, interface_obj, index): + self.cpld_dict = {} + self.int_case = interface_obj + self.index = index + self.update_time = 0 + self.cpld_id = "CPLD" + str(index) + + def cpld_dict_update(self): + local_time = time.time() + if not self.cpld_dict or (local_time - self.update_time) >= 1: # update data every 1 seconds + self.update_time = local_time + self.cpld_dict = self.int_case.get_cpld_version_by_id(self.cpld_id) + + def get_slot(self): + self.cpld_dict_update() + return self.cpld_dict["Slot"] + + def get_warm_upgrade_flag(self): + self.cpld_dict_update() + return self.cpld_dict["Warm"] + + def get_name(self): + """ + Retrieves the name of the component + + Returns: + A string containing the name of the component + """ + self.cpld_dict_update() + return self.cpld_dict["Name"] + + def get_description(self): + """ + Retrieves the description of the component + + Returns: + A string containing the description of the component + """ + self.cpld_dict_update() + return self.cpld_dict["Desc"] + + def get_firmware_version(self): + """ + Retrieves the firmware version of the component + + Note: the firmware version will be read from HW + + Returns: + A string containing the firmware version of the component + """ + self.cpld_dict_update() + return self.cpld_dict["Version"] + + def get_available_firmware_version(self, image_path): + """ + Retrieves the available firmware version of the component + + Note: the firmware version will be read from image + + Args: + image_path: A string, path to firmware image + + Returns: + A string containing the available firmware version of the component + """ + raise NotImplementedError + + def get_firmware_update_notification(self, image_path): + """ + Retrieves a notification on what should be done in order to complete + the component firmware update + + Args: + image_path: A string, path to firmware image + + Returns: + A string containing the component firmware update notification if required. + By default 'None' value will be used, which indicates that no actions are required + """ + return None + + def install_firmware(self, image_path): + """ + Installs firmware to the component + + This API performs firmware installation only: this may/may not be the same as firmware update. + In case platform component requires some extra steps (apart from calling Low Level Utility) + to load the installed firmware (e.g, reboot, power cycle, etc.) - this must be done manually by user + + Note: in case immediate actions are required to complete the component firmware update + (e.g., reboot, power cycle, etc.) - will be done automatically by API and no return value provided + + Args: + image_path: A string, path to firmware image + + Returns: + A boolean, True if install was successful, False if not + """ + if not os.path.isfile(image_path): + print("ERROR: %s not found" % image_path) + return False + cmdstr = "upgrade.py cold %s %d" % (image_path, self.get_slot()) + status, output = subprocess.getstatusoutput(cmdstr) + if status == 0: + print("INFO: %s firmware install succeeded" % self.get_name()) + return True + print("%s install failed. status:%d, output:\n%s" % (self.get_name(), status, output)) + return False + + def update_firmware(self, image_path): + """ + Updates firmware of the component + + This API performs firmware update: it assumes firmware installation and loading in a single call. + In case platform component requires some extra steps (apart from calling Low Level Utility) + to load the installed firmware (e.g, reboot, power cycle, etc.) - this will be done automatically by API + + Args: + image_path: A string, path to firmware image + + Raises: + RuntimeError: update failed + """ + if not os.path.isfile(image_path): + raise RuntimeError("ERROR: %s not found" % image_path) + + if self.get_warm_upgrade_flag() == 1: # use warm upgrade + cmdstr = "upgrade.py warm %s %d" % (image_path, self.get_slot()) + else: + cmdstr = "upgrade.py cold %s %d" % (image_path, self.get_slot()) + status, output = subprocess.getstatusoutput(cmdstr) + if status == 0: + if self.get_warm_upgrade_flag() != 1: # not support warm upgrade, need to cold reboot + print("INFO: %s firmware install succeeded" % self.get_name()) + print("INFO: please cold reboot to make the %s firmware up-to-date" % self.get_name()) + else: + print("INFO: %s firmware update succeeded" % self.get_name()) + print("INFO: %s firmware version up-to-date" % self.get_name()) + return None + raise RuntimeError(output) + + def auto_update_firmware(self, image_path, boot_type): + """ + Updates firmware of the component + + This API performs firmware update automatically based on boot_type: it assumes firmware installation + and/or creating a loading task during the reboot, if needed, in a single call. + In case platform component requires some extra steps (apart from calling Low Level Utility) + to load the installed firmware (e.g, reboot, power cycle, etc.) - this will be done automatically during the reboot. + The loading task will be created by API. + + Args: + image_path: A string, path to firmware image + boot_type: A string, reboot type following the upgrade + - none/fast/warm/cold + + Returns: + Output: A return code + return_code: An integer number, status of component firmware auto-update + - return code of a positive number indicates successful auto-update + - status_installed = 1 + - status_updated = 2 + - status_scheduled = 3 + - return_code of a negative number indicates failed auto-update + - status_err_boot_type = -1 + - status_err_image = -2 + - status_err_unknown = -3 + + Raises: + RuntimeError: auto-update failure cause + """ + if not os.path.isfile(image_path): + print("ERROR: %s not found" % image_path) + return -2 + + if not os.path.isdir(FIRMWARE_UPDATE_DIR): + os.mkdir(FIRMWARE_UPDATE_DIR) + + warm_upgrade_flag = self.get_warm_upgrade_flag() + file_name = os.path.basename(image_path) + file_path = os.path.join(FIRMWARE_UPDATE_DIR, file_name) + if os.path.exists(file_path): # firmware already update + if warm_upgrade_flag == 1: + print("INFO: %s firmware update succeeded, firmware version up-to-date" % self.get_name()) + return 2 + print("INFO: %s firmware install succeeded, please cold reboot to make it up-to-date" % self.get_name()) + return 1 + + if warm_upgrade_flag == 1: # use warm upgrade + cmdstr = "upgrade.py warm %s %d" % (image_path, self.get_slot()) + else: + cmdstr = "upgrade.py cold %s %d" % (image_path, self.get_slot()) + status, output = subprocess.getstatusoutput(cmdstr) + if status == 0: + os.mknod(file_path) + if warm_upgrade_flag == 1: + print("INFO: %s firmware update succeeded, firmware version up-to-date" % self.get_name()) + return 2 + print("INFO: %s firmware install succeeded, please cold reboot to make it up-to-date" % self.get_name()) + return 1 + print("%s update failed, status:%d, output:\n%s" % (self.get_name(), status, output)) + return -3 diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/dcdc.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/dcdc.py new file mode 100644 index 000000000000..494d4aa610dc --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/dcdc.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python3 + +######################################################################## +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Thermals' information which are available in the platform +# +######################################################################## +import time + + +class Dcdc(object): + + def __init__(self, interface_obj, index): + self.dcdc_dict = {} + self.int_case = interface_obj + self.index = index + self.update_time = 0 + self.dcdc_id = "DCDC" + str(index) + + def dcdc_dict_update(self): + local_time = time.time() + if not self.dcdc_dict or (local_time - self.update_time) >= 1: # update data every 1 seconds + self.update_time = local_time + self.dcdc_dict = self.int_case.get_dcdc_by_id(self.dcdc_id) + + def get_name(self): + """ + Retrieves the name of the sensor + + Returns: + string: The name of the sensor + """ + self.dcdc_dict_update() + return self.dcdc_dict["Name"] + + def get_value(self): + """ + Retrieves current value reading from sensor + """ + self.dcdc_dict_update() + value = self.dcdc_dict["Value"] + if value is None: + value = 0 + return round(float(value), 3) + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of sensor + """ + self.dcdc_dict_update() + value = self.dcdc_dict["High"] + if value is None: + value = 0 + return round(float(value), 3) + + def get_low_threshold(self): + """ + Retrieves the low threshold temperature of sensor + """ + self.dcdc_dict_update() + value = self.dcdc_dict["Low"] + if value is None: + value = 0 + return round(float(value), 3) + + def get_high_critical_threshold(self): + """ + Retrieves the high critical threshold temperature of sensor + """ + self.dcdc_dict_update() + value = self.dcdc_dict["Max"] + if value is None: + value = 0 + return round(float(value), 3) + + def get_low_critical_threshold(self): + """ + Retrieves the low critical threshold temperature of sensor + """ + self.dcdc_dict_update() + value = self.dcdc_dict["Min"] + if value is None: + value = 0 + return round(float(value), 3) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/eeprom.py new file mode 100644 index 000000000000..05fcc3c25678 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/eeprom.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python3 +######################################################################## +# +# Module contains platform specific implementation of SONiC Platform +# Base API and provides the EEPROMs' information. +# +# The different EEPROMs available are as follows: +# - System EEPROM : Contains Serial number, Service tag, Base MA +# address, etc. in ONIE TlvInfo EEPROM format. +# - PSU EEPROM : Contains Serial number, Part number, Service Tag, +# PSU type, Revision. +# - Fan EEPROM : Contains Serial number, Part number, Service Tag, +# Fan type, Number of Fans in Fantray, Revision. +######################################################################## + +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError as error: + raise ImportError(str(error) + "- required module not found") from error + + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self, interface_obj): + self.int_case = interface_obj + self.name = "ONIE_E2" + + eeprom_path = self.int_case.get_onie_e2_path(self.name) + if eeprom_path is None: + raise ValueError("get eeprom path failed") + + super().__init__(eeprom_path, 0, "", True) + + def modelnumber(self, e): + ''' + Returns the value field of the model(part) number TLV as a string + ''' + (is_valid, t) = self.get_tlv_field(e, self._TLV_CODE_PART_NUMBER) + if not is_valid: + return super().part_number_str(e) + + return t[2].decode("ascii") + + def deviceversion(self, e): + ''' + Returns the value field of the Device Version as a string + ''' + (is_valid, t) = self.get_tlv_field(e, self._TLV_CODE_DEVICE_VERSION) + if not is_valid: + return "N/A" + + return str(ord(t[2])) + + def system_eeprom_info(self): + ''' + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + ''' + sys_eeprom_dict = {} + e = self.read_eeprom() + if self._TLV_HDR_ENABLED: + if not self.is_valid_tlvinfo_header(e): + return {} + total_len = (e[9] << 8) | e[10] + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_len + else: + tlv_index = self.eeprom_start + tlv_end = self._TLV_INFO_MAX_LEN + + while (tlv_index + 2) < len(e) and tlv_index < tlv_end: + if not self.is_valid_tlv(e[tlv_index:]): + break + + tlv = e[tlv_index:tlv_index + 2 + e[tlv_index + 1]] + code = "0x%02X" % tlv[0] + name, value = self.decoder(None, tlv) + sys_eeprom_dict[code] = value + + if e[tlv_index] == self._TLV_CODE_QUANTA_CRC or \ + e[tlv_index] == self._TLV_CODE_CRC_32: + break + tlv_index += e[tlv_index + 1] + 2 + + return sys_eeprom_dict diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/fan.py new file mode 100644 index 000000000000..c693ad9f0ac5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/fan.py @@ -0,0 +1,310 @@ +#!/usr/bin/env python3 +######################################################################## +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Fans' information which are available in the platform. +# +######################################################################## + +try: + import time + from sonic_platform_base.fan_base import FanBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") from e + + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, interface_obj, fantray_index, fan_index, psu_fan=False, psu_index=0): + self.fan_dict = {} + self.int_case = interface_obj + self.fantray_index = fantray_index + self.fan_index = fan_index + self.psu_index = psu_index + self.is_psu_fan = psu_fan + self.update_time = 0 + if not self.is_psu_fan: + self.name = "FAN" + str(fantray_index) + else: + self.name = "PSU" + str(psu_index) + + def fan_dict_update(self): + local_time = time.time() + if not self.fan_dict or (local_time - self.update_time) >= 1: # update data every 1 seconds + self.update_time = local_time + if not self.is_psu_fan: + self.fan_dict = self.int_case.get_fan_info(self.name) + else: + self.fan_dict = self.int_case.get_psu_fru_info(self.name) + + def get_name(self): + """ + Retrieves the fan name + Returns: + string: The name of the device + """ + if not self.is_psu_fan: + return "Fantray{}_{}".format(self.fantray_index, self.fan_index) + return "PSU{}_FAN{}".format(self.psu_index, self.fan_index) + + def get_model(self): + """ + Retrieves the part number of the FAN + Returns: + string: Part number of FAN + """ + if not self.is_psu_fan: + self.fan_dict_update() + return self.fan_dict["DisplayName"] + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the FAN + Returns: + string: Serial number of FAN + """ + if not self.is_psu_fan: + self.fan_dict_update() + return self.fan_dict["SN"] + return 'N/A' + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if fan is present, False if not + """ + if not self.is_psu_fan: + return self.int_case.get_fan_presence(self.name) + return self.int_case.get_psu_presence(self.name) + + def get_status(self): + """ + Retrieves the operational status of the FAN + Returns: + bool: True if FAN is operating properly, False if not + """ + if not self.get_presence(): + return False + + if not self.is_psu_fan: + fan_dir = {} + fan_dir = self.int_case.get_fan_info_rotor(self.name) + # get fan rotor pwm + rotor_name = "Rotor" + str(self.fan_index) + value = fan_dir[rotor_name]["Speed"] + min_speed = fan_dir[rotor_name]["SpeedMin"] + max_speed = fan_dir[rotor_name]["SpeedMax"] + tolerance = fan_dir[rotor_name]["Tolerance"] + else: + psu_status_dict = self.int_case.get_psu_status(self.name) + value = psu_status_dict["FanSpeed"]["Value"] + min_speed = psu_status_dict["FanSpeed"]["Min"] + max_speed = psu_status_dict["FanSpeed"]["Max"] + tolerance = psu_status_dict["FanSpeed"]["Tolerance"] + + if isinstance(tolerance, str) or tolerance is None: + tolerance = 30 + + if isinstance(value, str) or value is None: + if self.is_psu_fan: + psu_status_dict = self.int_case.get_psu_status(self.name) + if psu_status_dict["OutputStatus"] is True: + return True + return False + + if value < min_speed: + return False + + speed = int(value * 100 / max_speed) + if speed > 100: + speed = 100 + elif speed < 0: + speed = 0 + target = self.get_target_speed() + + if (speed - target) > target * tolerance / 100: + return False + if (target - speed) > target * tolerance / 100: + return False + + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def get_direction(self): + """ + Retrieves the fan airflow direction + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + + Notes: + - Forward/Exhaust : Air flows from Port side to Fan side. + - Reverse/Intake : Air flows from Fan side to Port side. + """ + self.fan_dict_update() + air_flow = self.fan_dict["AirFlow"] + if air_flow is not None: + return air_flow + return self.FAN_DIRECTION_NOT_APPLICABLE + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + if not self.get_presence(): + return 0 + + if not self.is_psu_fan: + fan_dir = {} + fan_dir = self.int_case.get_fan_info_rotor(self.name) + # get fan rotor pwm + rotor_name = "Rotor" + str(self.fan_index) + value = fan_dir[rotor_name]["Speed"] + max_speed = fan_dir[rotor_name]["SpeedMax"] + else: + psu_status_dict = self.int_case.get_psu_status(self.name) + value = psu_status_dict["FanSpeed"]["Value"] + max_speed = psu_status_dict["FanSpeed"]["Max"] + + if isinstance(value, str) or value is None: + return None + pwm = value * 100 / max_speed + if pwm > 100: + pwm = 100 + elif pwm < 0: + pwm = 0 + return int(pwm) + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + # The default tolerance value is fixed as 30% + if not self.is_psu_fan: + fan_dir = {} + fan_dir = self.int_case.get_fan_info_rotor(self.name) + # get fan rotor tolerance + rotor_name = "Rotor" + str(self.fan_index) + tolerance = fan_dir[rotor_name]["Tolerance"] + else: + psu_status_dict = self.int_case.get_psu_status(self.name) + tolerance = psu_status_dict["FanSpeed"]["Tolerance"] + + if isinstance(tolerance, str) or tolerance is None: + return 30 + return tolerance + + def fan_set_speed_pwm(self, pwm): + status = self.int_case.set_fan_speed_pwm(self.name, self.fan_index, pwm) + if status == -1: + return False + return True + + def set_speed(self, speed): + """ + Set fan speed to expected value + Args: + speed: An integer, the percentage of full fan speed to set fan to, + in the range 0 (off) to 100 (full speed) + Returns: + bool: True if set success, False if fail. + """ + if not self.is_psu_fan: + return self.fan_set_speed_pwm(speed) + return self.int_case.set_psu_fan_speed_pwm(self.name, int(speed)) + + def set_status_led(self, color): + """ + Set led to expected color + Args: + color: A string representing the color with which to set the + fan module status LED + Returns: + bool: True if set success, False if fail. + """ + # not supported + return False + + def get_status_led(self): + """ + Gets the state of the Fan status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings. + """ + if self.is_psu_fan: + # No LED available for PSU Fan + return 'N/A' + + if not self.get_presence(): + return 'N/A' + + ret, color = self.int_case.get_fan_led(self.name) + if ret is True: + return color + return 'N/A' + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + if not self.is_psu_fan: + # get fan rotor pwm + pwm = int(self.int_case.get_fan_speed_pwm(self.name, self.fan_index)) + else: + pwm = self.get_speed() # target equal to real pwm, to avoid alarm + if pwm is None: + return None + return int(pwm) + + def get_vendor(self): + """ + Retrieves the vendor name of the fan + + Returns: + string: Vendor name of fan + """ + if not self.is_psu_fan: + return "Micas" + return 'N/A' + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + if not self.is_psu_fan: + self.fan_dict_update() + return self.fan_dict["HW"] + return 'N/A' diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..f0b039648158 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/fan_drawer.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python3 +# +# fan_drawer_base.py +# +# Abstract base class for implementing a platform-specific class with which +# to interact with a fan drawer module in SONiC +# + +try: + import time + from sonic_platform_base.fan_drawer_base import FanDrawerBase + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") from e + + +class FanDrawer(FanDrawerBase): + """ + Abstract base class for interfacing with a fan drawer + """ + # Device type definition. Note, this is a constant. + DEVICE_TYPE = "fan_drawer" + + def __init__(self, interface_obj, fantray_index): + FanDrawerBase.__init__(self) + self.fantray_dict = {} + self.fantray_update_time = 0 + self.fantray_index = fantray_index + self.int_case = interface_obj + self.fantrayname = "FAN" + str(fantray_index) + self.num_fans_per_fantray = self.int_case.get_fan_rotor_number(self.fantrayname) + for i in range(self.num_fans_per_fantray): + self._fan_list.append(Fan(interface_obj, fantray_index, i + 1)) + + def fantray_dict_update(self): + local_time = time.time() + # update data every 1 seconds + if not self.fantray_dict or (local_time - self.fantray_update_time) >= 1: + self.fantray_update_time = local_time + self.fantray_dict = self.int_case.get_fan_info(self.fantrayname) + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return "Fantray{}".format(self.fantray_index) + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if fan is present, False if not + """ + return self.int_case.get_fan_presence(self.fantrayname) + + def get_model(self): + """ + Retrieves the part number of the FAN + Returns: + string: Part number of FAN + """ + self.fantray_dict_update() + return self.fantray_dict["NAME"] + + def get_serial(self): + """ + Retrieves the serial number of the FAN + Returns: + string: Serial number of FAN + """ + self.fantray_dict_update() + return self.fantray_dict["SN"] + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + self.fantray_dict_update() + return self.fantray_dict["HW"] + + def get_status(self): + """ + Retrieves the operational status of the FAN + Returns: + bool: True if FAN is operating properly, False if not + """ + for i in range(self.num_fans_per_fantray): + if self._fan_list[i].get_status() is False: + return False + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def get_num_fans(self): + """ + Retrieves the number of fans available on this fan drawer + Returns: + An integer, the number of fan modules available on this fan drawer + """ + return len(self._fan_list) + + def get_all_fans(self): + """ + Retrieves all fan modules available on this fan drawer + Returns: + A list of objects derived from FanBase representing all fan + modules available on this fan drawer + """ + return self._fan_list + + def set_status_led(self, color): + """ + Sets the state of the fan drawer status LED + Args: + color: A string representing the color with which to set the + fan drawer status LED + Returns: + bool: True if status LED state is set successfully, False if not + """ + # not supported + return False + + def get_status_led(self): + """ + Gets the state of the Fan status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings. + """ + if not self.get_presence(): + return 'N/A' + + ret, color = self.int_case.get_fan_led(self.fantrayname) + if ret is True: + return color + return 'N/A' + + def get_maximum_consumed_power(self): + """ + Retrives the maximum power drawn by Fan Drawer + + Returns: + A float, with value of the maximum consumable power of the + component. + """ + self.fantray_dict_update() + return self.fantray_dict["PowerMax"] diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/pcie.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/pcie.py new file mode 100644 index 000000000000..8ea66f339e96 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/pcie.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +######################################################################## +# +# Module contains a platform specific implementation of SONiC Platform +# Base PCIe class +# +######################################################################## + +try: + from sonic_platform_base.sonic_pcie.pcie_common import PcieUtil +except ImportError as e: + raise ImportError(str(e) + "- required module not found") from e + + +class Pcie(PcieUtil): + """Platform-specific Pcie class""" + + def __init__(self, platform_path): + PcieUtil.__init__(self, platform_path) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/platform.py new file mode 100644 index 000000000000..4d6fe03d93ac --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/platform.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 + +############################################################################# +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") from e + + +class Platform(PlatformBase): + """ + Platform-specific class + """ + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/psu.py new file mode 100644 index 000000000000..de661dacdff6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/psu.py @@ -0,0 +1,388 @@ +#!/usr/bin/env python3 +######################################################################## +# +# Module contains an implementation of SONiC Platform Base API and +# provides the PSUs' information which are available in the platform +# +######################################################################## + + +try: + import time + from sonic_platform_base.psu_base import PsuBase + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") from e + + +class Psu(PsuBase): + """Platform-specific PSU class""" + + def __init__(self, interface_obj, index): + self.psu_dict = {} + self.psu_status_dict = {} + self.psu_power_dict = {} + self._fan_list = [] + self._thermal_list = [] + self.int_case = interface_obj + self.index = index + self.name = "PSU" + str(index) + + self.psu_dict_update_time = 0 + self.psu_status_dict_update_time = 0 + self.psu_power_dict_update_time = 0 + + self._fan_list.append(Fan(self.int_case, 1, 1, psu_fan=True, psu_index=index)) + + def psu_dict_update(self): + local_time = time.time() + if not self.psu_dict or (local_time - self.psu_dict_update_time) >= 1: # update data every 1 seconds + self.psu_dict_update_time = local_time + self.psu_dict = self.int_case.get_psu_fru_info(self.name) + + def psu_status_dict_update(self): + local_time = time.time() + if not self.psu_status_dict or ( + local_time - self.psu_status_dict_update_time) >= 1: # update data every 1 seconds + self.psu_status_dict_update_time = local_time + self.psu_status_dict = self.int_case.get_psu_status(self.name) + + def psu_power_dict_update(self): + local_time = time.time() + if not self.psu_power_dict or ( + local_time - self.psu_power_dict_update_time) >= 1: # update data every 1 seconds + self.psu_power_dict_update_time = local_time + self.psu_power_dict = self.int_case.get_psu_power_status(self.name) + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "Psu{}".format(self.index) + + def get_presence(self): + """ + Retrieves the presence of the Power Supply Unit (PSU) + + Returns: + bool: True if PSU is present, False if not + """ + return self.int_case.get_psu_presence(self.name) + + def get_model(self): + """ + Retrieves the part number of the PSU + + Returns: + string: Part number of PSU + """ + self.psu_dict_update() + return self.psu_dict["DisplayName"] + + def get_serial(self): + """ + Retrieves the serial number of the PSU + + Returns: + string: Serial number of PSU + """ + self.psu_dict_update() + return self.psu_dict["SN"] + + def get_status(self): + """ + Retrieves the operational status of the PSU + + Returns: + bool: True if PSU is operating properly, False if not + """ + return self.int_case.get_psu_input_output_status(self.name) + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def get_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + self.psu_status_dict_update() + if self.psu_status_dict["OutputStatus"] is False: + value = 0 + else: + self.psu_power_dict_update() + value = self.psu_power_dict["Outputs"]["Voltage"]["Value"] + if value is None: + return None + return round(float(value), 1) + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, electric current in amperes, + e.g. 15.4 + """ + self.psu_status_dict_update() + if self.psu_status_dict["OutputStatus"] is False: + value = 0 + else: + self.psu_power_dict_update() + value = self.psu_power_dict["Outputs"]["Current"]["Value"] + if value is None: + return None + return round(float(value), 1) + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, + e.g. 302.6 + """ + self.psu_status_dict_update() + if self.psu_status_dict["OutputStatus"] is False: + value = 0 + else: + self.psu_power_dict_update() + value = self.psu_power_dict["Outputs"]["Power"]["Value"] + if value is None: + return None + return round(float(value), 1) + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + + Returns: + A boolean, True if PSU has stablized its output voltages and + passed all its internal self-tests, False if not. + """ + return self.int_case.get_psu_input_output_status(self.name) + + def get_status_led(self): + """ + Gets the state of the PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings. + """ + if not self.get_presence(): + return "N/A" + if self.int_case.get_psu_input_output_status(self.name): + return self.STATUS_LED_COLOR_GREEN + return self.STATUS_LED_COLOR_RED + + def set_status_led(self, color): + """ + Sets the state of the PSU status LED + Args: + color: A string representing the color with which to set the + PSU status LED + Returns: + bool: True if status LED state is set successfully, False if + not + """ + # not supported + return False + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + self.psu_status_dict_update() + value = self.psu_status_dict["Temperature"]["Value"] + if value is None: + return None + return round(float(value), 1) + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + self.psu_status_dict_update() + value = self.psu_status_dict["Temperature"]["Max"] + if value is None: + return None + return round(float(value), 1) + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + self.psu_power_dict_update() + value = self.psu_power_dict["Outputs"]["Voltage"]["HighAlarm"] + if value is None: + return None + return round(float(value), 1) + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + self.psu_power_dict_update() + value = self.psu_power_dict["Outputs"]["Voltage"]["LowAlarm"] + if value is None: + return None + return round(float(value), 1) + + def get_input_voltage(self): + """ + Get the input voltage of the PSU + + Returns: + A float number, the input voltage in volts, + """ + self.psu_status_dict_update() + if self.psu_status_dict["InputStatus"] is False: + value = 0 + else: + self.psu_power_dict_update() + value = self.psu_power_dict["Inputs"]["Voltage"]["Value"] + if value is None: + return None + return round(float(value), 1) + + def get_input_current(self): + """ + Get the input electric current of the PSU + + Returns: + A float number, the input current in amperes, e.g 220.3 + """ + self.psu_status_dict_update() + if self.psu_status_dict["InputStatus"] is False: + value = 0 + else: + self.psu_power_dict_update() + value = self.psu_power_dict["Inputs"]["Current"]["Value"] + if value is None: + return None + return round(float(value), 1) + + def get_input_power(self): + """ + Get the input current energy of the PSU + + Returns: + A float number, the input power in watts, e.g. 302.6 + """ + self.psu_status_dict_update() + if self.psu_status_dict["InputStatus"] is False: + value = 0 + else: + self.psu_power_dict_update() + value = self.psu_power_dict["Inputs"]["Power"]["Value"] + if value is None: + return None + return round(float(value), 1) + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + self.psu_dict_update() + return self.psu_dict["HW"] + + def get_vendor(self): + """ + Retrieves the vendor name of the psu + + Returns: + string: Vendor name of psu + """ + self.psu_dict_update() + return self.psu_dict["VENDOR"] + + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU + + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return False + + def get_thermal(self, index): + """ + Retrieves thermal unit represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the thermal to + retrieve + + Returns: + An object dervied from ThermalBase representing the specified thermal + """ + return False + + def get_psu_power_warning_suppress_threshold(self): + """ + Retrieve the warning suppress threshold of the power on this PSU + The value can be volatile, so the caller should call the API each time it is used. + + Returns: + A float number, the warning suppress threshold of the PSU in watts. + """ + self.psu_power_dict_update() + value = self.psu_power_dict["Outputs"]["Power"]["HighAlarm"] + if value is None: + return None + return round(float(value), 1) + + def get_psu_power_critical_threshold(self): + """ + Retrieve the critical threshold of the power on this PSU + The value can be volatile, so the caller should call the API each time it is used. + + Returns: + A float number, the critical threshold of the PSU in watts. + """ + self.psu_power_dict_update() + value = self.psu_power_dict["Outputs"]["Power"]["HighAlarm"] + if value is None: + return None + return round(float(value), 1) + diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/sfp.py new file mode 100644 index 000000000000..3fc22b4b6618 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/sfp.py @@ -0,0 +1,634 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +############################################################################# +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +# +# *_device.py config version instruction: +# ver 1.0 - platform api: +# "presence_cpld": { +# "dev_id": { +# [dev_id]: { +# "offset": { +# [offset]: [port_id] +# } +# } +# } +# } +# "reset_cpld": { +# "dev_id": { +# [dev_id]: { +# "offset": { +# [offset]: [port_id] +# } +# } +# } +# } +# ver 2.0 - wb_plat: +# "presence_path": "/xx/wb_plat/xx[port_id]/present" +# "eeprom_path": "/sys/bus/i2c/devices/i2c-[bus]/[bus]-0050/eeprom" +# "reset_path": "/xx/wb_plat/xx[port_id]/reset" +############################################################################# +import sys +import time +import syslog +import traceback +from abc import abstractmethod + +configfile_pre = "/usr/local/bin/" +sys.path.append(configfile_pre) + +try: + from platform_intf import * + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase + from plat_hal.baseutil import baseutil + +except ImportError as error: + raise ImportError(str(error) + "- required module not found") from error + +LOG_DEBUG_LEVEL = 1 +LOG_WARNING_LEVEL = 2 +LOG_ERROR_LEVEL = 3 + + +class Sfp(SfpOptoeBase): + + OPTOE_DRV_TYPE1 = 1 + OPTOE_DRV_TYPE2 = 2 + OPTOE_DRV_TYPE3 = 3 + + # index must start at 1 + def __init__(self, index): + SfpOptoeBase.__init__(self) + self.sfp_type = None + sfp_config = baseutil.get_config().get("sfps", None) + self.log_level_config = sfp_config.get("log_level", LOG_WARNING_LEVEL) + # Init instance of SfpCust + ver = sfp_config.get("ver", None) + if ver is None: + self._sfplog(LOG_ERROR_LEVEL, "Get Ver Config Error!") + vers = int(float(ver)) + if vers == 1: + self._sfp_api = SfpV1(index) + elif vers == 2: + self._sfp_api = SfpV2(index) + else: + self._sfplog(LOG_ERROR_LEVEL, "Get SfpVer Error!") + + def get_eeprom_path(self): + return self._sfp_api._get_eeprom_path() + + def read_eeprom(self, offset, num_bytes): + return self._sfp_api.read_eeprom(offset, num_bytes) + + def get_presence(self): + return self._sfp_api.get_presence() + + def get_transceiver_info(self): + # temporary solution for a sonic202111 bug + transceiver_info = super().get_transceiver_info() + try: + if transceiver_info == None: + return None + if transceiver_info['cable_type'] == None: + transceiver_info['cable_type'] = 'N/A' + if transceiver_info["vendor_rev"] is not None: + transceiver_info["hardware_rev"] = transceiver_info["vendor_rev"] + except BaseException: + print(traceback.format_exc()) + return None + return transceiver_info + + def get_reset_status(self): + if self.get_presence() is False: + return False + + if self.sfp_type is None: + self.refresh_xcvr_api() + + if self.sfp_type == 'SFP': + self._sfplog(LOG_ERROR_LEVEL, 'SFP does not support reset') + return False + + ret = self._sfp_api.get_reset_status() + return ret + + def reset(self): + if self.get_presence() is False: + return False + + if self.sfp_type is None: + self.refresh_xcvr_api() + + if self.sfp_type == 'SFP': + self._sfplog(LOG_ERROR_LEVEL, 'SFP does not support reset') + return False + + self._sfplog(LOG_DEBUG_LEVEL, 'resetting...') + ret = self._sfp_api.set_reset(True) + if ret: + time.sleep(0.5) + ret = self._sfp_api.set_reset(False) + + return ret + + def get_lpmode(self): + if self.get_presence() is False: + return False + + if self.sfp_type is None: + self.refresh_xcvr_api() + + if self.sfp_type == 'QSFP' or self.sfp_type == 'QSFP-DD': + return SfpOptoeBase.get_lpmode(self) + + self._sfplog(LOG_WARNING_LEVEL, 'SFP does not support lpmode') + return False + + def set_lpmode(self, lpmode): + if self.get_presence() is False: + return False + + if self.sfp_type is None or self._xcvr_api is None: + self.refresh_xcvr_api() + + if self.sfp_type == 'QSFP-DD' or self.sfp_type == 'QSFP': + return SfpOptoeBase.set_lpmode(self, lpmode) + + self._sfplog(LOG_WARNING_LEVEL, 'SFP does not support lpmode') + return False + + def get_tx_disable(self): + if self.get_presence() is False: + return False + + if self.sfp_type is None: + self.refresh_xcvr_api() + + if self.sfp_type == 'SFP': + return self._sfp_api.get_tx_disable() + + return SfpOptoeBase.get_tx_disable(self) + + def get_tx_disable_channel(self): + if self.get_presence() is False: + return False + + if self.sfp_type is None: + self.refresh_xcvr_api() + + if self.sfp_type == 'SFP': + return self._sfp_api.get_tx_disable_channel() + + return SfpOptoeBase.get_tx_disable_channel(self) + + def tx_disable(self, tx_disable): + if self.get_presence() is False: + return False + + if self.sfp_type is None: + self.refresh_xcvr_api() + + if self.sfp_type == 'SFP': + return self._sfp_api.set_tx_disable(tx_disable) + + return SfpOptoeBase.tx_disable(self, tx_disable) + + def tx_disable_channel(self, channel, disable): + if self.get_presence() is False: + return False + + if self.sfp_type is None: + self.refresh_xcvr_api() + + if self.sfp_type == 'SFP': + self._sfplog(LOG_WARNING_LEVEL, 'SFP does not support tx disable channel') + return False + + return SfpOptoeBase.tx_disable_channel(self, channel, disable) + + def set_optoe_write_max(self, write_max): + """ + This func is declared and implemented by SONiC but we're not supported + so override it as NotImplemented + """ + self._sfplog(LOG_DEBUG_LEVEL, "set_optoe_write_max NotImplemented") + + def refresh_xcvr_api(self): + """ + Updates the XcvrApi associated with this SFP + """ + self._xcvr_api = self._xcvr_api_factory.create_xcvr_api() + class_name = self._xcvr_api.__class__.__name__ + optoe_type = None + # set sfp_type + if 'CmisApi' in class_name: + self.sfp_type = 'QSFP-DD' + optoe_type = self.OPTOE_DRV_TYPE3 + elif 'Sff8472Api' in class_name: + self.sfp_type = 'SFP' + optoe_type = self.OPTOE_DRV_TYPE2 + elif ('Sff8636Api' in class_name or 'Sff8436Api' in class_name): + self.sfp_type = 'QSFP' + optoe_type = self.OPTOE_DRV_TYPE1 + # set optoe driver + if optoe_type is not None: + self._sfp_api.set_optoe_type(optoe_type) + + def _sfplog(self, log_level, msg): + if log_level >= self.log_level_config: + try: + syslog.openlog("Sfp") + if log_level == LOG_DEBUG_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_WARNING_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_ERROR_LEVEL: + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + except BaseException: + print(traceback.format_exc()) + + +class SfpCust(): + def __init__(self, index): + self.eeprom_path = None + self._init_config(index) + + def _init_config(self, index): + sfp_config = baseutil.get_config().get("sfps", None) + self.log_level_config = sfp_config.get("log_level", LOG_WARNING_LEVEL) + self._port_id = index + self.eeprom_retry_times = sfp_config.get("eeprom_retry_times", 0) + self.eeprom_retry_break_sec = sfp_config.get("eeprom_retry_break_sec", 0) + + def _get_eeprom_path(self): + return self.eeprom_path or None + + @abstractmethod + def get_presence(self): + pass + + def read_eeprom(self, offset, num_bytes): + try: + for i in range(self.eeprom_retry_times): + with open(self._get_eeprom_path(), mode='rb', buffering=0) as f: + f.seek(offset) + result = f.read(num_bytes) + # temporary solution for a sonic202111 bug + if len(result) < num_bytes: + result = result[::-1].zfill(num_bytes)[::-1] + if result is not None: + return bytearray(result) + time.sleep(self.eeprom_retry_break_sec) + continue + + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return None + + def write_eeprom(self, offset, num_bytes, write_buffer): + try: + for i in range(self.eeprom_retry_times): + ret = SfpOptoeBase.write_eeprom(self, offset, num_bytes, write_buffer) + if ret is False: + time.sleep(self.eeprom_retry_break_sec) + continue + break + + return ret + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + + @abstractmethod + def set_optoe_type(self, optoe_type): + pass + + @abstractmethod + def set_reset(self, reset): + pass + + def _convert_str_range_to_int_arr(self, range_str): + if not range_str: + return [] + + int_range_strs = range_str.split(',') + range_res = [] + for int_range_str in int_range_strs: + if '-' in int_range_str: + range_s = int(int_range_str.split('-')[0]) + range_e = int(int_range_str.split('-')[1]) + 1 + else: + range_s = int(int_range_str) + range_e = int(int_range_str) + 1 + + range_res = range_res + list(range(range_s, range_e)) + + return range_res + + def _sfplog(self, log_level, msg): + if log_level >= self.log_level_config: + try: + syslog.openlog("SfpCust") + if log_level == LOG_DEBUG_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_WARNING_LEVEL: + syslog.syslog(syslog.LOG_DEBUG, msg) + elif log_level == LOG_ERROR_LEVEL: + syslog.syslog(syslog.LOG_ERR, msg) + syslog.closelog() + + except BaseException: + print(traceback.format_exc()) + + +class SfpV1(SfpCust): + def _init_config(self, index): + super()._init_config(index) + # init presence path + sfp_config = baseutil.get_config().get("sfps", None) + + eeprom_path_config = sfp_config.get("eeprom_path", None) + eeprom_path_key = sfp_config.get("eeprom_path_key")[self._port_id - 1] + self.eeprom_path = None if eeprom_path_config is None else eeprom_path_config % ( + eeprom_path_key, eeprom_path_key) + self._sfplog(LOG_DEBUG_LEVEL, "Done init eeprom path: %s" % self.eeprom_path) + + self.presence_cpld = sfp_config.get("presence_cpld", None) + self.presence_val_is_present = sfp_config.get("presence_val_is_present", 0) + self._sfplog(LOG_DEBUG_LEVEL, "Done init presence path") + + # init reset path + self.reset_cpld = sfp_config.get("reset_cpld", None) + self.reset_val_is_reset = sfp_config.get("reset_val_is_reset", 0) + self._sfplog(LOG_DEBUG_LEVEL, "Done init cpld path") + + # init tx_disable path + self.txdis_cpld = sfp_config.get("txdis_cpld", None) + self.txdisable_val_is_on = sfp_config.get("txdisable_val_is_on", 0) + self._sfplog(LOG_DEBUG_LEVEL, "Done init cpld tx_disable path") + + def get_presence(self): + if self.presence_cpld is None: + self._sfplog(LOG_ERROR_LEVEL, "presence_cpld is None!") + return False + try: + dev_id, offset, offset_bit = self._get_sfp_cpld_info(self.presence_cpld) + if dev_id == -1: + return False + ret, info = platform_reg_read(0, dev_id, offset, 1) + if (ret is False + or info is None): + return False + return info[0] & (1 << offset_bit) == self.presence_val_is_present + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + + def get_reset_status(self): + if self.reset_cpld is None: + self._sfplog(LOG_ERROR_LEVEL, "reset_cpld is None!") + return False + try: + dev_id, offset, offset_bit = self._get_sfp_cpld_info(self.reset_cpld) + if dev_id == -1: + return False + ret, info = platform_reg_read(0, dev_id, offset, 1) + if (ret is False + or info is None): + self._sfplog(LOG_ERROR_LEVEL, "platform_reg_read error!") + return False + + return (info[0] & (1 << offset_bit) == self.reset_val_is_reset) + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + + def get_tx_disable(self): + if self.reset_cpld is None: + self._sfplog(LOG_ERROR_LEVEL, "txdis_cpld is None!") + return None + + try: + tx_disable_list = [] + dev_id, offset, offset_bit = self._get_sfp_cpld_info(self.txdis_cpld) + if dev_id == -1: + return False + ret, info = platform_reg_read(0, dev_id, offset, 1) + if (ret is False + or info is None): + self._sfplog(LOG_ERROR_LEVEL, "platform_reg_read error!") + return None + if self.txdisable_val_is_on == 1: + tx_disable_list.append(info[0] & (1 << offset_bit) != 0) + else: + tx_disable_list.append(info[0] & (1 << offset_bit) == 0) + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return None + + return tx_disable_list + + def get_tx_disable_channel(self): + tx_disable_list = [] + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + + return tx_disabled + + def read_eeprom(self, offset, num_bytes): + try: + for i in range(self.eeprom_retry_times): + ret, info = platform_sfp_read(self._port_id, offset, num_bytes) + if (ret is False + or info is None): + time.sleep(self.eeprom_retry_break_sec) + continue + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append(0) + for n in range(0, len(info)): + eeprom_raw[n] = info[n] + # temporary solution for a sonic202111 bug + if len(eeprom_raw) < num_bytes: + eeprom_raw = eeprom_raw[::-1].zfill(num_bytes)[::-1] + return bytearray(eeprom_raw) + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return None + + def set_optoe_type(self, optoe_type): + ret, info = platform_get_optoe_type(self._port_id) + if ret is True and info != optoe_type: + try: + ret, _ = platform_set_optoe_type(self._port_id, optoe_type) + except Exception as err: + self._sfplog(LOG_ERROR_LEVEL, "Set optoe err %s" % err) + + def set_reset(self, reset): + if self.reset_cpld is None: + self._sfplog(LOG_ERROR_LEVEL, "reset_cpld is None!") + return False + try: + val = [] + dev_id, offset, offset_bit = self._get_sfp_cpld_info(self.reset_cpld) + if dev_id == -1: + return False + ret, info = platform_reg_read(0, dev_id, offset, 1) + if (ret is False + or info is None): + self._sfplog(LOG_ERROR_LEVEL, "platform_reg_read error!") + return False + + if self.reset_val_is_reset == 0: + if reset: + val.append(info[0] & (~(1 << offset_bit))) + else: + val.append(info[0] | (1 << offset_bit)) + else: + if reset: + val.append(info[0] | (1 << offset_bit)) + else: + val.append(info[0] & (~(1 << offset_bit))) + + ret, info = platform_reg_write(0, dev_id, offset, val) + if ret is False: + self._sfplog(LOG_ERROR_LEVEL, "platform_reg_write error!") + return False + + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + + return True + + def set_tx_disable(self, tx_disable): + if self.txdis_cpld is None: + self._sfplog(LOG_ERROR_LEVEL, "txdis_cpld is None!") + return False + try: + val = [] + dev_id, offset, offset_bit = self._get_sfp_cpld_info(self.txdis_cpld) + if dev_id == -1: + return False + ret, info = platform_reg_read(0, dev_id, offset, 1) + if (ret is False + or info is None): + self._sfplog(LOG_ERROR_LEVEL, "platform_reg_read error!") + return False + + if self.txdisable_val_is_on == 0: + if tx_disable: + val.append(info[0] & (~(1 << offset_bit))) + else: + val.append(info[0] | (1 << offset_bit)) + else: + if tx_disable: + val.append(info[0] | (1 << offset_bit)) + else: + val.append(info[0] & (~(1 << offset_bit))) + + ret, info = platform_reg_write(0, dev_id, offset, val) + if ret is False: + self._sfplog(LOG_ERROR_LEVEL, "platform_reg_write error!") + return False + + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + + return True + + def _get_sfp_cpld_info(self, cpld_config): + dev_id = -1 + offset = -1 + offset_bit = -1 + for dev_id_temp in cpld_config["dev_id"]: + for offset_temp in cpld_config["dev_id"][dev_id_temp]["offset"]: + port_range_str = cpld_config["dev_id"][dev_id_temp]["offset"][offset_temp] + port_range_int = self._convert_str_range_to_int_arr(port_range_str) + if self._port_id in port_range_int: + dev_id = dev_id_temp + offset = offset_temp + offset_bit = port_range_int.index(self._port_id) + break + + return dev_id, offset, offset_bit + + +class SfpV2(SfpCust): + def _init_config(self, index): + super()._init_config(index) + # init eeprom path + sfp_config = baseutil.get_config().get("sfps", None) + eeprom_path_config = sfp_config.get("eeprom_path", None) + eeprom_path_key = sfp_config.get("eeprom_path_key")[self._port_id - 1] + self.eeprom_path = None if eeprom_path_config is None else eeprom_path_config % ( + eeprom_path_key, eeprom_path_key) + self._sfplog(LOG_DEBUG_LEVEL, "Done init eeprom path: %s" % self.eeprom_path) + + # init presence path + self.presence_path = None if sfp_config.get("presence_path", + None) is None else sfp_config.get("presence_path") % self._port_id + self.presence_val_is_present = sfp_config.get("presence_val_is_present", 0) + self._sfplog(LOG_DEBUG_LEVEL, "Done init presence path: %s" % self.presence_path) + + # init optoe driver path + optoe_driver_path = sfp_config.get("optoe_driver_path", None) + optoe_driver_key = sfp_config.get("optoe_driver_key")[self._port_id - 1] + self.dev_class_path = None if optoe_driver_path is None else optoe_driver_path % ( + optoe_driver_key, optoe_driver_key) + self._sfplog(LOG_DEBUG_LEVEL, "Done init optoe driver path: %s" % self.dev_class_path) + + # init reset path + self.reset_path = None if sfp_config.get( + "reset_path", + None) is None else sfp_config.get( + "reset_path", + None) % self._port_id + self.reset_val_is_reset = sfp_config.get("reset_val_is_reset", 0) + self._sfplog(LOG_DEBUG_LEVEL, "Done init reset path: %s" % self.reset_path) + + def get_presence(self): + if self.presence_path is None: + self._sfplog(LOG_ERROR_LEVEL, "presence_path is None!") + return False + try: + with open(self.presence_path, "rb") as data: + sysfs_data = data.read(1) + if sysfs_data != "": + result = int(sysfs_data, 16) + return result == self.presence_val_is_present + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + + def set_reset(self, reset): + return True + + def set_optoe_type(self, optoe_type): + if self.dev_class_path is None: + self._sfplog(LOG_ERROR_LEVEL, "dev_class_path is None!") + return False + try: + with open(self.dev_class_path, "r+") as dc_file: + dc_file_val = dc_file.read(1) + if int(dc_file_val) != optoe_type: + dc_str = "%s" % str(optoe_type) + dc_file.write(dc_str) + # dc_file.close() + except BaseException: + self._sfplog(LOG_ERROR_LEVEL, traceback.format_exc()) + return False + return True diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/thermal.py new file mode 100644 index 000000000000..4632de3bc1e4 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/thermal.py @@ -0,0 +1,234 @@ +#!/usr/bin/env python3 + +######################################################################## +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Thermals' information which are available in the platform +# +######################################################################## + + +try: + import time + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") from e + + +class Thermal(ThermalBase): + + def __init__(self, interface_obj, index): + self.temp_dict = {} + self.temperature_list = [] + self.int_case = interface_obj + self.index = index + self.update_time = 0 + self.temp_id = "TEMP" + str(index) + + def temp_dict_update(self): + local_time = time.time() + if not self.temp_dict or (local_time - self.update_time) >= 1: # update data every 1 seconds + self.update_time = local_time + self.temp_dict = self.int_case.get_monitor_temp_by_id(self.temp_id) + + def get_name(self): + """ + Retrieves the name of the thermal + + Returns: + string: The name of the thermal + """ + self.temp_dict_update() + return self.temp_dict["Api_name"] + + def get_presence(self): + """ + Retrieves the presence of the thermal + + Returns: + bool: True if thermal is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the Thermal + + Returns: + string: Model/part number of Thermal + """ + return "N/A" + + def get_serial(self): + """ + Retrieves the serial number of the Thermal + + Returns: + string: Serial number of Thermal + """ + return "N/A" + + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + return "N/A" + + def get_status(self): + """ + Retrieves the operational status of the thermal + + Returns: + A boolean value, True if thermal is operating properly, + False if not + """ + self.temp_dict_update() + if (self.temp_dict["Value"] >= self.temp_dict["High"]) or (self.temp_dict["Value"] <= self.temp_dict["Low"]): + return False + + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + self.temp_dict_update() + value = self.temp_dict["Value"] + if value is None or value == self.int_case.error_ret: + return "N/A" + if len(self.temperature_list) >= 1000: + del self.temperature_list[0] + self.temperature_list.append(float(value)) + return round(float(value), 1) + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + self.temp_dict_update() + value = self.temp_dict["High"] + if value is None or value == self.int_case.error_ret: + return "N/A" + return round(float(value), 1) + + def get_low_threshold(self): + """ + Retrieves the low threshold temperature of thermal + + Returns: + A float number, the low threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + self.temp_dict_update() + value = self.temp_dict["Low"] + if value is None or value == self.int_case.error_ret: + return "N/A" + return round(float(value), 1) + + def set_high_threshold(self, temperature): + """ + Sets the high threshold temperature of thermal + + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + + Returns: + A boolean, True if threshold is set successfully, False if not + """ + # not supported + return False + + def set_low_threshold(self, temperature): + """ + Sets the low threshold temperature of thermal + + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + + Returns: + A boolean, True if threshold is set successfully, False if not + """ + # not supported + return False + + def get_high_critical_threshold(self): + """ + Retrieves the high critical threshold temperature of thermal + + Returns: + A float number, the high critical threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + self.temp_dict_update() + value = self.temp_dict["Max"] + if value is None or value == self.int_case.error_ret: + return "N/A" + return round(float(value), 1) + + def get_low_critical_threshold(self): + """ + Retrieves the low critical threshold temperature of thermal + + Returns: + A float number, the low critical threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + self.temp_dict_update() + value = self.temp_dict["Min"] + if value is None or value == self.int_case.error_ret: + return "N/A" + return round(float(value), 1) + + def get_minimum_recorded(self): + """ + Retrieves the minimum recorded temperature of thermal + + Returns: + A float number, the minimum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + if len(self.temperature_list) == 0: + return "N/A" + return round(float(min(self.temperature_list)), 1) + + def get_maximum_recorded(self): + """ + Retrieves the maximum recorded temperature of thermal + + Returns: + A float number, the maximum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + if len(self.temperature_list) == 0: + return "N/A" + return round(float(max(self.temperature_list)), 1) diff --git a/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/watchdog.py new file mode 100644 index 000000000000..948337f47a9a --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/common/sonic_platform/watchdog.py @@ -0,0 +1,236 @@ +#!/usr/bin/env python3 + +######################################################################## +# +# +# Abstract base class for implementing a platform-specific class with +# which to interact with a hardware watchdog module in SONiC +# +######################################################################## + +import fcntl +import os +import array + +try: + from sonic_platform_base.watchdog_base import WatchdogBase +except ImportError as error: + raise ImportError(str(error) + "- required module not found") from error + + +# ioctl constants +IO_WRITE = 0x40000000 +IO_READ = 0x80000000 +IO_READ_WRITE = 0xC0000000 +IO_SIZE_INT = 0x00040000 +IO_SIZE_40 = 0x00280000 +IO_TYPE_WATCHDOG = ord('W') << 8 + +WDR_INT = IO_READ | IO_SIZE_INT | IO_TYPE_WATCHDOG +WDR_40 = IO_READ | IO_SIZE_40 | IO_TYPE_WATCHDOG +WDWR_INT = IO_READ_WRITE | IO_SIZE_INT | IO_TYPE_WATCHDOG + +# Watchdog ioctl command +WDIOC_GETSUPPORT = 0 | WDR_40 +WDIOC_GETSTATUS = 1 | WDR_INT +WDIOC_GETBOOTSTATUS = 2 | WDR_INT +WDIOC_GETTEMP = 3 | WDR_INT +WDIOC_SETOPTIONS = 4 | WDR_INT +WDIOC_KEEPALIVE = 5 | WDR_INT +WDIOC_SETTIMEOUT = 6 | WDWR_INT +WDIOC_GETTIMEOUT = 7 | WDR_INT +WDIOC_SETPRETIMEOUT = 8 | WDWR_INT +WDIOC_GETPRETIMEOUT = 9 | WDR_INT +WDIOC_GETTIMELEFT = 10 | WDR_INT + +# Watchdog status constants +WDIOS_DISABLECARD = 0x0001 +WDIOS_ENABLECARD = 0x0002 + +WDT_COMMON_ERROR = -1 +WDT_IDENTITY = "CPLD Watchdog" +WDT_SYSFS_PATH = "/sys/class/watchdog/" + +DEFAULT_TIMEOUT = 180 + + +class Watchdog(WatchdogBase): + """ + Abstract base class for interfacing with a hardware watchdog module + """ + + def __init__(self): + self.watchdog, self.wdt_main_dev_name = self._get_wdt() + self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name + self.state_path = "/sys/class/watchdog/%s/state" % self.wdt_main_dev_name + self.timeout_path = "/sys/class/watchdog/%s/timeout" % self.wdt_main_dev_name + # Set default value + self._disable() + self.armed = False + self.timeout = self._gettimeout() + + def _is_wd_main(self, dev): + """ + Checks watchdog identity + """ + identity = self._read_file( + "{}/{}/identity".format(WDT_SYSFS_PATH, dev)) + return identity == WDT_IDENTITY + + def _get_wdt(self): + """ + Retrieves watchdog device + """ + wdt_main_dev_list = [dev for dev in os.listdir( + "/dev/") if dev.startswith("watchdog") and self._is_wd_main(dev)] + if not wdt_main_dev_list: + return None + wdt_main_dev_name = wdt_main_dev_list[0] + watchdog_device_path = "/dev/{}".format(wdt_main_dev_name) + watchdog = os.open(watchdog_device_path, os.O_RDWR) + return watchdog, wdt_main_dev_name + + def _read_file(self, file_path): + """ + Read text file + """ + try: + with open(file_path, "r") as fd: + txt = fd.read() + except IOError: + return WDT_COMMON_ERROR + return txt.strip() + + def _enable(self): + """ + Turn on the watchdog timer + """ + req = array.array('h', [WDIOS_ENABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _disable(self): + """ + Turn off the watchdog timer + """ + req = array.array('h', [WDIOS_DISABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _keepalive(self): + """ + Keep alive watchdog timer + """ + fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) + + def _settimeout(self, seconds): + """ + Set watchdog timer timeout + @param seconds - timeout in seconds + @return is the actual set timeout + """ + req = array.array('I', [seconds]) + fcntl.ioctl(self.watchdog, WDIOC_SETTIMEOUT, req, True) + return int(req[0]) + + def _gettimeout(self): + """ + Get watchdog timeout + @return watchdog timeout + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMEOUT, req, True) + + return int(req[0]) + + def _gettimeleft(self): + """ + Get time left before watchdog timer expires + @return time left in seconds + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMELEFT, req, True) + + return int(req[0]) + + def arm(self, seconds): + """ + Arm the hardware watchdog with a timeout of seconds. + If the watchdog is currently armed, calling this function will + simply reset the timer to the provided value. If the underlying + hardware does not support the value provided in , this + method should arm the watchdog with the *next greater* available + value. + + Returns: + An integer specifying the *actual* number of seconds the watchdog + was armed with. On failure returns -1. + """ + ret = WDT_COMMON_ERROR + if seconds < 0: + return ret + + try: + if self.timeout != seconds: + self.timeout = self._settimeout(seconds) + if self.armed: + self._keepalive() + else: + self._settimeout(seconds) + self._enable() + self.armed = True + ret = self.timeout + except IOError: + pass + + return ret + + def disarm(self): + """ + Disarm the hardware watchdog + + Returns: + A boolean, True if watchdog is disarmed successfully, False if not + """ + disarmed = False + if self.is_armed(): + try: + self._disable() + self.armed = False + disarmed = True + except IOError: + pass + + return disarmed + + def is_armed(self): + """ + Retrieves the armed state of the hardware watchdog. + + Returns: + A boolean, True if watchdog is armed, False if not + """ + return self.armed + + def get_remaining_time(self): + """ + If the watchdog is armed, retrieve the number of seconds remaining on + the watchdog timer + + Returns: + An integer specifying the number of seconds remaining on thei + watchdog timer. If the watchdog is not armed, returns -1. + """ + timeleft = WDT_COMMON_ERROR + + if self.armed: + try: + timeleft = self._gettimeleft() + except IOError: + pass + + return timeleft + + def __del__(self): + """ + Close watchdog + """ + os.close(self.watchdog) diff --git a/platform/broadcom/sonic-platform-modules-micas/debian/changelog b/platform/broadcom/sonic-platform-modules-micas/debian/changelog new file mode 100644 index 000000000000..d908208c5e37 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/debian/changelog @@ -0,0 +1,5 @@ +sonic-micas-platform-modules (1.0) unstable; urgency=low + + * Initial release + + -- support Fri, 21 APR 2017 11:11:11 -0800 diff --git a/platform/broadcom/sonic-platform-modules-micas/debian/compat b/platform/broadcom/sonic-platform-modules-micas/debian/compat new file mode 100644 index 000000000000..f599e28b8ab0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/debian/compat @@ -0,0 +1 @@ +10 diff --git a/platform/broadcom/sonic-platform-modules-micas/debian/control b/platform/broadcom/sonic-platform-modules-micas/debian/control new file mode 100644 index 000000000000..55b5837776d5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/debian/control @@ -0,0 +1,9 @@ +Source: sonic-micas-platform-modules +Section: main +Priority: extra +Maintainer: support +Standards-Version: 3.9.3 + +Package: platform-modules-micas-m2-w6510-48v8c +Architecture: amd64 +Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/broadcom/sonic-platform-modules-micas/debian/copyright b/platform/broadcom/sonic-platform-modules-micas/debian/copyright new file mode 100644 index 000000000000..676cdeec726b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/debian/copyright @@ -0,0 +1,15 @@ +Copyright (C) 2016 Microsoft, 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. diff --git a/platform/broadcom/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6510-48v8c.install b/platform/broadcom/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6510-48v8c.install new file mode 100644 index 000000000000..6f3e9b257f5d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6510-48v8c.install @@ -0,0 +1 @@ +m2-w6510-48v8c/modules/sonic_platform-1.0-py3-none-any.whl /usr/share/sonic/device/x86_64-micas_m2-w6510-48v8c-r0 diff --git a/platform/broadcom/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6510-48v8c.postinst b/platform/broadcom/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6510-48v8c.postinst new file mode 100644 index 000000000000..a8132f4f65a9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/debian/platform-modules-micas-m2-w6510-48v8c.postinst @@ -0,0 +1,10 @@ +#!/bin/sh +# postinst + +kernel_version=$(uname -r) + +if [ -e /boot/System.map-${kernel_version} ]; then + depmod -a -F /boot/System.map-${kernel_version} ${kernel_version} || true +fi + +#DEBHELPER# diff --git a/platform/broadcom/sonic-platform-modules-micas/debian/rule.mk b/platform/broadcom/sonic-platform-modules-micas/debian/rule.mk new file mode 100644 index 000000000000..f27bca1d6579 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/debian/rule.mk @@ -0,0 +1,5 @@ +currentdir = $(shell pwd) + +MODULE_DIRS := m2-w6510-48v8c + +export MODULE_DIRS diff --git a/platform/broadcom/sonic-platform-modules-micas/debian/rules b/platform/broadcom/sonic-platform-modules-micas/debian/rules new file mode 100755 index 000000000000..baa92b2338e4 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/debian/rules @@ -0,0 +1,98 @@ +#!/usr/bin/make -f +CC=gcc +INSTALL_MOD_DIR:=extra +KVERSION ?= $(shell uname -r) +KERNEL_SRC := /lib/modules/$(KVERSION) +MOD_SRC_DIR:= $(shell pwd) +KBUILD_OUTPUT=$(KERNEL_SRC)/build + +LIB_DIR = usr/lib/python3/dist-packages +CUSTOM_RULES_DIR := $(shell pwd)/debian + +export INSTALL_MOD_DIR top_srcdir KVERSION KERNEL_SRC CC KBUILD_OUTPUT CUSTOM_RULES_DIR + +include $(CUSTOM_RULES_DIR)/rule.mk + +#all products need common +COMPILE_DIRS = $(MODULE_DIRS) + +clean_dirs = $(MODULE_DIRS) +clean_dirs += common + +complie_clean_dirs := $(addprefix _clean_,$(clean_dirs) ) + +%: + dh $@ +build: COMPILE_WHL + @echo "build success" + +$(complie_clean_dirs): + $(MAKE) -C $(patsubst _clean_%,%,$@) clean + +common_build : + $(MAKE) -C $(MOD_SRC_DIR)/common + +$(COMPILE_DIRS): common_build + $(MAKE) -C $(MOD_SRC_DIR)/$@ + dh_testdir + dh_installdirs + cp -r $(MOD_SRC_DIR)/common/build/* debian/platform-modules-micas-$@/; \ + cp -r $(MOD_SRC_DIR)/$@/build/* debian/platform-modules-micas-$@/; \ + +COMPILE_WHL: $(COMPILE_DIRS) + @(for mod in $(MODULE_DIRS); do \ + cd $(MOD_SRC_DIR)/$${mod}; \ + cp -r $(MOD_SRC_DIR)/common/lib/plat_hal $(MOD_SRC_DIR)/$${mod}/; \ + cp -r $(MOD_SRC_DIR)/common/lib/wbutil $(MOD_SRC_DIR)/$${mod}/; \ + cp -r $(MOD_SRC_DIR)/common/lib/eepromutil $(MOD_SRC_DIR)/$${mod}/; \ + cp -r $(MOD_SRC_DIR)/common/lib/restful_util $(MOD_SRC_DIR)/$${mod}/; \ + if [ $$mod != "m2-w6940-128qc" ]; then \ + cp -r $(MOD_SRC_DIR)/common/sonic_platform $(MOD_SRC_DIR)/$${mod}/; \ + fi; \ + cp $(MOD_SRC_DIR)/common/script/hal_pltfm.py $(MOD_SRC_DIR)/$${mod}/hal_pltfm.py; \ + cp $(MOD_SRC_DIR)/common/script/platform_util.py $(MOD_SRC_DIR)/$${mod}/platform_util.py; \ + cp $(MOD_SRC_DIR)/common/script/platform_intf.py $(MOD_SRC_DIR)/$${mod}/platform_intf.py; \ + python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ + rm -rf $(MOD_SRC_DIR)/$${mod}/plat_hal; \ + rm -rf $(MOD_SRC_DIR)/$${mod}/wbutil; \ + rm -rf $(MOD_SRC_DIR)/$${mod}/eepromutil; \ + rm -rf $(MOD_SRC_DIR)/$${mod}/restful_util; \ + if [ $$mod != "m2-w6940-128qc" ]; then \ + rm -rf $(MOD_SRC_DIR)/$${mod}/sonic_platform; \ + fi; \ + rm -rf $(MOD_SRC_DIR)/$${mod}/hal_pltfm.py; \ + rm -rf $(MOD_SRC_DIR)/$${mod}/platform_intf.py; \ + rm -rf $(MOD_SRC_DIR)/$${mod}/platform_util.py; \ + cd $(MOD_SRC_DIR); \ + done) + +binary: binary-indep + @echo "=======================================================" + +binary-indep: + # Resuming debhelper scripts + dh_testroot + dh_install + dh_installchangelogs + dh_installdocs + dh_systemd_enable + dh_installinit + dh_systemd_start + dh_link + dh_fixperms + dh_compress + dh_strip + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb +override_dh_usrlocal: + +override_dh_pysupport: + +clean: $(complie_clean_dirs) + dh_testdir + dh_testroot + dh_clean + +.PHONY: build $(COMPILE_DIRS) binary binary-arch binary-indep clean diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/Makefile b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/Makefile new file mode 100644 index 000000000000..052a5a6a0773 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/Makefile @@ -0,0 +1,25 @@ +PWD = $(shell pwd) +DIR_KERNEL_SRC = $(PWD)/modules/driver +EXTRA_CFLAGS:= -I$(M)/include +EXTRA_CFLAGS+= -Wall +SUB_BUILD_DIR = $(PWD)/build +INSTALL_DIR = $(SUB_BUILD_DIR)/$(KERNEL_SRC)/$(INSTALL_MOD_DIR) +INSTALL_SCRIPT_DIR = $(SUB_BUILD_DIR)/usr/local/bin +INSTALL_LIB_DIR = $(SUB_BUILD_DIR)/usr/lib/python3/dist-packages +INSTALL_SYSFS_CFG_DIR = $(SUB_BUILD_DIR)/etc/plat_sysfs_cfg + +all: + $(MAKE) -C $(KBUILD_OUTPUT) M=$(DIR_KERNEL_SRC) modules + @if [ ! -d ${INSTALL_DIR} ]; then mkdir -p ${INSTALL_DIR} ;fi + cp -r $(DIR_KERNEL_SRC)/*.ko $(INSTALL_DIR) + @if [ ! -d ${INSTALL_SCRIPT_DIR} ]; then mkdir -p ${INSTALL_SCRIPT_DIR} ;fi + cp -r $(PWD)/config/* $(INSTALL_SCRIPT_DIR) + @if [ ! -d ${INSTALL_LIB_DIR} ]; then mkdir -p ${INSTALL_LIB_DIR} ;fi + @if [ -d $(PWD)/hal-config/ ]; then cp -r $(PWD)/hal-config/* ${INSTALL_LIB_DIR} ;fi + @if [ ! -d ${INSTALL_SYSFS_CFG_DIR} ]; then mkdir -p ${INSTALL_SYSFS_CFG_DIR} ;fi + @if [ -d $(PWD)/plat_sysfs_cfg/ ]; then cp -r $(PWD)/plat_sysfs_cfg/* ${INSTALL_SYSFS_CFG_DIR} ;fi +clean: + rm -f ${DIR_KERNEL_SRC}/*.o ${DIR_KERNEL_SRC}/*.ko ${DIR_KERNEL_SRC}/*.mod.c ${DIR_KERNEL_SRC}/.*.cmd + rm -f ${DIR_KERNEL_SRC}/Module.markers ${DIR_KERNEL_SRC}/Module.symvers ${DIR_KERNEL_SRC}/modules.order + rm -rf ${DIR_KERNEL_SRC}/.tmp_versions + rm -rf $(SUB_BUILD_DIR) diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/config/x86_64_micas_m2_w6510_48v8c_r0_config.py b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/config/x86_64_micas_m2_w6510_48v8c_r0_config.py new file mode 100755 index 000000000000..546e125314ff --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/config/x86_64_micas_m2_w6510_48v8c_r0_config.py @@ -0,0 +1,1106 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- +from platform_common import * + +STARTMODULE = { + "hal_fanctrl": 1, + "hal_ledctrl": 1, + "avscontrol": 1, + "dev_monitor": 1, + "pmon_syslog": 1, + "tty_console": 1, + "macledreset": 1, + "sff_temp_polling": 1, + "generate_airflow": 1, + "reboot_cause": 1, +} + +MAC_LED_RESET = {"pcibus": 8, "slot": 0, "fn": 0, "bar": 0, "offset": 64, "reset": 0x98} + +MANUINFO_CONF = { + "bios": { + "key": "BIOS", + "head": True, + "next": "onie" + }, + "bios_vendor": { + "parent": "bios", + "key": "Vendor", + "cmd": "dmidecode -t 0 |grep Vendor", + "pattern": r".*Vendor", + "separator": ":", + "arrt_index": 1, + }, + "bios_version": { + "parent": "bios", + "key": "Version", + "cmd": "dmidecode -t 0 |grep Version", + "pattern": r".*Version", + "separator": ":", + "arrt_index": 2, + }, + "bios_date": { + "parent": "bios", + "key": "Release Date", + "cmd": "dmidecode -t 0 |grep Release", + "pattern": r".*Release Date", + "separator": ":", + "arrt_index": 3, + }, + "onie": { + "key": "ONIE", + "next": "cpu" + }, + "onie_date": { + "parent": "onie", + "key": "Build Date", + "file": "/host/machine.conf", + "pattern": r"^onie_build_date", + "separator": "=", + "arrt_index": 1, + }, + "onie_version": { + "parent": "onie", + "key": "Version", + "file": "/host/machine.conf", + "pattern": r"^onie_version", + "separator": "=", + "arrt_index": 2, + }, + + "cpu": { + "key": "CPU", + "next": "ssd" + }, + "cpu_vendor": { + "parent": "cpu", + "key": "Vendor", + "cmd": "dmidecode --type processor |grep Manufacturer", + "pattern": r".*Manufacturer", + "separator": ":", + "arrt_index": 1, + }, + "cpu_model": { + "parent": "cpu", + "key": "Device Model", + "cmd": "dmidecode --type processor | grep Version", + "pattern": r".*Version", + "separator": ":", + "arrt_index": 2, + }, + "cpu_core": { + "parent": "cpu", + "key": "Core Count", + "cmd": "dmidecode --type processor | grep \"Core Count\"", + "pattern": r".*Core Count", + "separator": ":", + "arrt_index": 3, + }, + "cpu_thread": { + "parent": "cpu", + "key": "Thread Count", + "cmd": "dmidecode --type processor | grep \"Thread Count\"", + "pattern": r".*Thread Count", + "separator": ":", + "arrt_index": 4, + }, + "ssd": { + "key": "SSD", + "next": "cpld" + }, + "ssd_model": { + "parent": "ssd", + "key": "Device Model", + "cmd": "smartctl -i /dev/sda |grep \"Device Model\"", + "pattern": r".*Device Model", + "separator": ":", + "arrt_index": 1, + }, + "ssd_fw": { + "parent": "ssd", + "key": "Firmware Version", + "cmd": "smartctl -i /dev/sda |grep \"Firmware Version\"", + "pattern": r".*Firmware Version", + "separator": ":", + "arrt_index": 2, + }, + "ssd_user_cap": { + "parent": "ssd", + "key": "User Capacity", + "cmd": "smartctl -i /dev/sda |grep \"User Capacity\"", + "pattern": r".*User Capacity", + "separator": ":", + "arrt_index": 3, + }, + + "cpld": { + "key": "CPLD", + "next": "psu" + }, + + "cpld1": { + "key": "CPLD1", + "parent": "cpld", + "arrt_index": 1, + }, + "cpld1_model": { + "key": "Device Model", + "parent": "cpld1", + "config": "LCMXO3LF-2100C-5BG256C", + "arrt_index": 1, + }, + "cpld1_vender": { + "key": "Vendor", + "parent": "cpld1", + "config": "LATTICE", + "arrt_index": 2, + }, + "cpld1_desc": { + "key": "Description", + "parent": "cpld1", + "config": "CPU_CPLD", + "arrt_index": 3, + }, + "cpld1_version": { + "key": "Firmware Version", + "parent": "cpld1", + "reg": { + "loc": "/dev/port", + "offset": 0x700, + "size": 4 + }, + "callback": "cpld_format", + "arrt_index": 4, + }, + + "cpld2": { + "key": "CPLD2", + "parent": "cpld", + "arrt_index": 2, + }, + "cpld2_model": { + "key": "Device Model", + "parent": "cpld2", + "config": "LCMXO3LF-2100C-5BG256C", + "arrt_index": 1, + }, + "cpld2_vender": { + "key": "Vendor", + "parent": "cpld2", + "config": "LATTICE", + "arrt_index": 2, + }, + "cpld2_desc": { + "key": "Description", + "parent": "cpld2", + "config": "CONNECT_CPLD", + "arrt_index": 3, + }, + "cpld2_version": { + "key": "Firmware Version", + "parent": "cpld2", + "reg": { + "loc": "/dev/port", + "offset": 0x900, + "size": 4 + }, + "callback": "cpld_format", + "arrt_index": 4, + }, + + "cpld3": { + "key": "CPLD3", + "parent": "cpld", + "arrt_index": 3, + }, + "cpld3_model": { + "key": "Device Model", + "parent": "cpld3", + "config": "LCMXO3LF-2100C-5BG256C", + "arrt_index": 1, + }, + "cpld3_vender": { + "key": "Vendor", + "parent": "cpld3", + "config": "LATTICE", + "arrt_index": 2, + }, + "cpld3_desc": { + "key": "Description", + "parent": "cpld3", + "config": "CONNECT_CPLD-FAN", + "arrt_index": 3, + }, + "cpld3_version": { + "key": "Firmware Version", + "parent": "cpld3", + "i2c": { + "bus": "2", + "loc": "0x0d", + "offset": 0, + "size": 4 + }, + "callback": "cpld_format", + "arrt_index": 4, + }, + + "cpld4": { + "key": "CPLD4", + "parent": "cpld", + "arrt_index": 4, + }, + "cpld4_model": { + "key": "Device Model", + "parent": "cpld4", + "config": "LCMXO3LF-2100C-5BG256C", + "arrt_index": 1, + }, + "cpld4_vender": { + "key": "Vendor", + "parent": "cpld4", + "config": "LATTICE", + "arrt_index": 2, + }, + "cpld4_desc": { + "key": "Description", + "parent": "cpld4", + "config": "MAC_CPLD1", + "arrt_index": 3, + }, + "cpld4_version": { + "key": "Firmware Version", + "parent": "cpld4", + "i2c": { + "bus": "8", + "loc": "0x30", + "offset": 0, + "size": 4 + }, + "callback": "cpld_format", + "arrt_index": 4, + }, + + "cpld5": { + "key": "CPLD5", + "parent": "cpld", + "arrt_index": 5, + }, + "cpld5_model": { + "key": "Device Model", + "parent": "cpld5", + "config": "LCMXO3LF-2100C-5BG256C", + "arrt_index": 1, + }, + "cpld5_vender": { + "key": "Vendor", + "parent": "cpld5", + "config": "LATTICE", + "arrt_index": 2, + }, + "cpld5_desc": { + "key": "Description", + "parent": "cpld5", + "config": "MAC_CPLD2", + "arrt_index": 3, + }, + "cpld5_version": { + "key": "Firmware Version", + "parent": "cpld5", + "i2c": { + "bus": "8", + "loc": "0x31", + "offset": 0, + "size": 4 + }, + "callback": "cpld_format", + "arrt_index": 4, + }, + + "psu": { + "key": "PSU", + "next": "fan" + }, + + "psu1": { + "parent": "psu", + "key": "PSU1", + "arrt_index": 1, + }, + "psu1_hw_version": { + "key": "Hardware Version", + "parent": "psu1", + "extra": { + "funcname": "getPsu", + "id": "psu1", + "key": "hw_version" + }, + "arrt_index": 1, + }, + "psu1_fw_version": { + "key": "Firmware Version", + "parent": "psu1", + "config": "NA", + "arrt_index": 2, + }, + + "psu2": { + "parent": "psu", + "key": "PSU2", + "arrt_index": 2, + }, + "psu2_hw_version": { + "key": "Hardware Version", + "parent": "psu2", + "extra": { + "funcname": "getPsu", + "id": "psu2", + "key": "hw_version" + }, + "arrt_index": 1, + }, + "psu2_fw_version": { + "key": "Firmware Version", + "parent": "psu2", + "config": "NA", + "arrt_index": 2, + }, + + "fan": { + "key": "FAN", + "next": "i210" + }, + + "fan1": { + "key": "FAN1", + "parent": "fan", + "arrt_index": 1, + }, + "fan1_hw_version": { + "key": "Hardware Version", + "parent": "fan1", + "extra": { + "funcname": "checkFan", + "id": "fan1", + "key": "hw_version" + }, + "arrt_index": 1, + }, + "fan1_fw_version": { + "key": "Firmware Version", + "parent": "fan1", + "config": "NA", + "arrt_index": 2, + }, + + "fan2": { + "key": "FAN2", + "parent": "fan", + "arrt_index": 2, + }, + "fan2_hw_version": { + "key": "Hardware Version", + "parent": "fan2", + "extra": { + "funcname": "checkFan", + "id": "fan2", + "key": "hw_version" + }, + "arrt_index": 1, + }, + "fan2_fw_version": { + "key": "Firmware Version", + "parent": "fan2", + "config": "NA", + "arrt_index": 2, + }, + + "fan3": { + "key": "FAN3", + "parent": "fan", + "arrt_index": 3, + }, + "fan3_hw_version": { + "key": "Hardware Version", + "parent": "fan3", + "extra": { + "funcname": "checkFan", + "id": "fan3", + "key": "hw_version" + }, + "arrt_index": 1, + }, + "fan3_fw_version": { + "key": "Firmware Version", + "parent": "fan3", + "config": "NA", + "arrt_index": 2, + }, + + "fan4": { + "key": "FAN4", + "parent": "fan", + "arrt_index": 4, + }, + "fan4_hw_version": { + "key": "Hardware Version", + "parent": "fan4", + "extra": { + "funcname": "checkFan", + "id": "fan4", + "key": "hw_version" + }, + "arrt_index": 1, + }, + "fan4_fw_version": { + "key": "Firmware Version", + "parent": "fan4", + "config": "NA", + "arrt_index": 2, + }, + + "i210": { + "key": "NIC", + "next": "fpga" + }, + "i210_model": { + "parent": "i210", + "config": "NA", + "key": "Device Model", + "arrt_index": 1, + }, + "i210_vendor": { + "parent": "i210", + "config": "INTEL", + "key": "Vendor", + "arrt_index": 2, + }, + "i210_version": { + "parent": "i210", + "cmd": "ethtool -i eth0", + "pattern": r"firmware-version", + "separator": ":", + "key": "Firmware Version", + "arrt_index": 3, + }, + + "fpga": { + "key": "FPGA", + "next": "asic" + }, + "fpga_model": { + "parent": "fpga", + "config": "XC7A15T-2FGG484C", + "key": "Device Model", + "arrt_index": 1, + }, + "fpga_vendor": { + "parent": "fpga", + "config": "XILINX", + "key": "Vendor", + "arrt_index": 2, + }, + "fpga_desc": { + "parent": "fpga", + "config": "NA", + "key": "Description", + "arrt_index": 3, + }, + "fpga_hw_version": { + "parent": "fpga", + "config": "NA", + "key": "Hardware Version", + "arrt_index": 4, + }, + "fpga_fw_version": { + "parent": "fpga", + "pci": { + "bus": 8, + "slot": 0, + "fn": 0, + "bar": 0, + "offset": 0 + }, + "key": "Firmware Version", + "arrt_index": 5, + }, + "fpga_date": { + "parent": "fpga", + "pci": { + "bus": 8, + "slot": 0, + "fn": 0, + "bar": 0, + "offset": 4 + }, + "key": "Build Date", + "arrt_index": 6, + }, + "asic": { + "key": "ASIC", + }, + "sdk_model": { + "parent": "asic", + "cmd": "bcmcmd -t 1 att", + "pattern": r"^Attach", + "regular": r"(?<=\()[^)]*(?=\))", + "key": "Device Model", + "arrt_index": 1, + }, + "sdk_version": { + "parent": "asic", + "cmd": "bcmcmd -t 1 version | grep Release", + "pattern": r".*Release", + "separator": ":", + "key": "SDK Version", + "arrt_index": 2, + }, + "pci_version": { + "parent": "asic", + "cmd": "bcmcmd -t 1 \"pciephy fw version\" |grep \"PCIe FW version\"", + "pattern": r".*PCIe FW version", + "separator": ":", + "key": "PCIe Firmware Version", + "arrt_index": 3, + }, +} + +PMON_SYSLOG_STATUS = { + "polling_time": 3, + "sffs": { + "present": {"path": ["/sys/wb_plat/sff/*/present"], "ABSENT": 0}, + "nochangedmsgflag": 0, + "nochangedmsgtime": 60, + "noprintfirsttimeflag": 1, + "alias": { + "sff1": "Ethernet1", + "sff2": "Ethernet2", + "sff3": "Ethernet3", + "sff4": "Ethernet4", + "sff5": "Ethernet5", + "sff6": "Ethernet6", + "sff7": "Ethernet7", + "sff8": "Ethernet8", + "sff9": "Ethernet9", + "sff10": "Ethernet10", + "sff11": "Ethernet11", + "sff12": "Ethernet12", + "sff13": "Ethernet13", + "sff14": "Ethernet14", + "sff15": "Ethernet15", + "sff16": "Ethernet16", + "sff17": "Ethernet17", + "sff18": "Ethernet18", + "sff19": "Ethernet19", + "sff20": "Ethernet20", + "sff21": "Ethernet21", + "sff22": "Ethernet22", + "sff23": "Ethernet23", + "sff24": "Ethernet24", + "sff25": "Ethernet25", + "sff26": "Ethernet26", + "sff27": "Ethernet27", + "sff28": "Ethernet28", + "sff29": "Ethernet29", + "sff30": "Ethernet30", + "sff31": "Ethernet31", + "sff32": "Ethernet32", + "sff33": "Ethernet33", + "sff34": "Ethernet34", + "sff35": "Ethernet35", + "sff36": "Ethernet36", + "sff37": "Ethernet37", + "sff38": "Ethernet38", + "sff39": "Ethernet39", + "sff40": "Ethernet40", + "sff41": "Ethernet41", + "sff42": "Ethernet42", + "sff43": "Ethernet43", + "sff44": "Ethernet44", + "sff45": "Ethernet45", + "sff46": "Ethernet46", + "sff47": "Ethernet47", + "sff48": "Ethernet48", + "sff49": "Ethernet49", + "sff50": "Ethernet50", + "sff51": "Ethernet51", + "sff52": "Ethernet52", + "sff53": "Ethernet53", + "sff54": "Ethernet54", + "sff55": "Ethernet55", + "sff56": "Ethernet56", + } + }, + "fans": { + "present": {"path": ["/sys/wb_plat/fan/*/present"], "ABSENT": 0}, + "status": [ + {"path": "/sys/wb_plat/fan/%s/motor0/status", 'okval': 1}, + {"path": "/sys/wb_plat/fan/%s/motor1/status", 'okval': 1}, + ], + "nochangedmsgflag": 1, + "nochangedmsgtime": 60, + "noprintfirsttimeflag": 0, + "alias": { + "fan1": "FAN1", + "fan2": "FAN2", + "fan3": "FAN3", + "fan4": "FAN4" + } + }, + "psus": { + "present": {"path": ["/sys/wb_plat/psu/*/present"], "ABSENT": 0}, + "status": [ + {"path": "/sys/wb_plat/psu/%s/output", "okval": 1}, + {"path": "/sys/wb_plat/psu/%s/alert", "okval": 0}, + ], + "nochangedmsgflag": 1, + "nochangedmsgtime": 60, + "noprintfirsttimeflag": 0, + "alias": { + "psu1": "PSU1", + "psu2": "PSU2" + } + } +} + +##################### MAC Voltage adjust#################################### +MAC_DEFAULT_PARAM = [ + { + "name": "mac_core", # AVS name + "type": 1, # 1: used default value, if rov value not in range. 0: do nothing, if rov value not in range + "default": 0x74, # default value, if rov value not in range + "sdkreg": "TOP_AVS_SEL_REG", # SDK register name + "sdktype": 0, # 0: No shift operation required, 1: shift operation required + "macregloc": 24, # Shift right 24 bits + "mask": 0xff, # Use with macregloc + "rov_source": 1, # 0:get rov value from cpld, 1: get rov value from SDK + "cpld_avs": {"bus": 6, "loc": 0x0d, "offset": 0xc3, "gettype": "i2c"}, + "set_avs": { + "loc": "/sys/bus/i2c/devices/7-0064/hwmon/hwmon*/avs0_vout", + "gettype": "sysfs", "formula": "int((%f)*1000000)" + }, + "mac_avs_param": { + 0x08: 0.888, + 0x72: 0.900, + 0x73: 0.894, + 0x74: 0.888, + 0x75: 0.882, + 0x76: 0.875, + 0x77: 0.869, + 0x78: 0.863, + 0x79: 0.857, + 0x7a: 0.850, + 0x7b: 0.844, + 0x7c: 0.838, + 0x7d: 0.832, + 0x7e: 0.825, + 0x7f: 0.819, + 0x80: 0.813, + 0x81: 0.807, + 0x82: 0.800, + 0x83: 0.794, + 0x84: 0.788, + 0x85: 0.782, + 0x86: 0.775, + 0x87: 0.769, + 0x88: 0.763, + 0x89: 0.757, + 0x8A: 0.750 + } + } +] + +BLACKLIST_DRIVERS = [ + {"name": "i2c_i801", "delay": 0}, +] + +DRIVERLISTS = [ + {"name": "wb_i2c_i801", "delay": 0}, + {"name": "wb_gpio_d1500", "delay": 0}, + {"name": "i2c_dev", "delay": 0}, + {"name": "wb_i2c_algo_bit", "delay": 0}, + {"name": "wb_i2c_gpio", "delay": 0}, + {"name": "i2c_mux", "delay": 0}, + {"name": "wb_gpio_device", "delay": 0}, + {"name": "wb_i2c_gpio_device gpio_sda=17 gpio_scl=1 gpio_udelay=2", "delay": 0}, + {"name": "platform_common dfd_my_type=0x404a", "delay": 0}, + {"name": "wb_lpc_drv", "delay": 0}, + {"name": "wb_lpc_drv_device", "delay": 0}, + {"name": "wb_io_dev", "delay": 0}, + {"name": "wb_io_dev_device", "delay": 0}, + {"name": "wb_fpga_pcie", "delay": 0}, + {"name": "wb_pcie_dev", "delay": 0}, + {"name": "wb_pcie_dev_device", "delay": 0}, + {"name": "wb_i2c_dev", "delay": 0}, + {"name": "wb_i2c_ocores", "delay": 0}, + {"name": "wb_i2c_ocores_device", "delay": 0}, + {"name": "wb_i2c_mux_pca9641", "delay": 0}, + {"name": "wb_i2c_mux_pca954x", "delay": 0}, + {"name": "wb_i2c_mux_pca954x_device", "delay": 0}, + {"name": "wb_i2c_dev_device", "delay": 0}, + {"name": "wb_lm75", "delay": 0}, + {"name": "optoe", "delay": 0}, + {"name": "at24", "delay": 0}, + {"name": "wb_mac_bsc", "delay": 0}, + {"name": "wb_pmbus_core", "delay": 0}, + {"name": "wb_isl68137", "delay": 0}, + {"name": "wb_csu550", "delay": 0}, + {"name": "wb_ina3221", "delay": 0}, + {"name": "wb_tps53622", "delay": 0}, + {"name": "plat_dfd", "delay": 0}, + {"name": "plat_switch", "delay": 0}, + {"name": "plat_fan", "delay": 0}, + {"name": "plat_psu", "delay": 0}, + {"name": "plat_sff", "delay": 0}, +] + +DEVICE = [ + {"name": "24c02", "bus": 0, "loc": 0x56}, + {"name": "wb_mac_bsc_td3", "bus": 3, "loc": 0x44}, + # fan + {"name": "24c02", "bus": 16, "loc": 0x50}, + {"name": "24c02", "bus": 17, "loc": 0x50}, + {"name": "24c02", "bus": 18, "loc": 0x50}, + {"name": "24c02", "bus": 19, "loc": 0x50}, + # psu + {"name": "24c02", "bus": 24, "loc": 0x50}, + {"name": "wb_dps550", "bus": 24, "loc": 0x58}, + {"name": "24c02", "bus": 25, "loc": 0x50}, + {"name": "wb_dps550", "bus": 25, "loc": 0x58}, + # temp + {"name": "wb_lm75", "bus": 3, "loc": 0x48}, + {"name": "wb_lm75", "bus": 3, "loc": 0x49}, + {"name": "wb_lm75", "bus": 3, "loc": 0x4a}, + {"name": "wb_lm75", "bus": 3, "loc": 0x4b}, + {"name": "wb_lm75", "bus": 3, "loc": 0x4c}, + # dcdc + {"name": "wb_ina3221", "bus": 7, "loc": 0x40}, + {"name": "wb_ina3221", "bus": 7, "loc": 0x41}, + {"name": "wb_ina3221", "bus": 7, "loc": 0x42}, + {"name": "wb_ina3221", "bus": 7, "loc": 0x43}, + {"name": "wb_tps53622", "bus": 7, "loc": 0x60}, + {"name": "wb_tps53622", "bus": 7, "loc": 0x6c}, + {"name": "wb_isl68127", "bus": 7, "loc": 0x64}, +] + +OPTOE = [ + {"name": "optoe2", "startbus": 32, "endbus": 79}, + {"name": "optoe1", "startbus": 80, "endbus": 87}, +] + +DEV_MONITOR_PARAM = { + "polling_time": 10, + "psus": [ + { + "name": "psu1", + "present": {"gettype": "i2c", "bus": 6, "loc": 0x0d, "offset": 0x51, "presentbit": 0, "okval": 0}, + "device": [ + {"id": "psu1pmbus", "name": "wb_dps550", "bus": 24, "loc": 0x58, "attr": "hwmon"}, + {"id": "psu1frue2", "name": "24c02", "bus": 24, "loc": 0x50, "attr": "eeprom"}, + ], + }, + { + "name": "psu2", + "present": {"gettype": "i2c", "bus": 6, "loc": 0x0d, "offset": 0x51, "presentbit": 4, "okval": 0}, + "device": [ + {"id": "psu2pmbus", "name": "wb_dps550", "bus": 25, "loc": 0x58, "attr": "hwmon"}, + {"id": "psu2frue2", "name": "24c02", "bus": 25, "loc": 0x50, "attr": "eeprom"}, + ], + }, + ], + "fans": [ + { + "name": "fan1", + "present": {"gettype": "i2c", "bus": 2, "loc": 0x0d, "offset": 0x30, "presentbit": 0, "okval": 0}, + "device": [ + {"id": "fan1frue2", "name": "24c02", "bus": 16, "loc": 0x50, "attr": "eeprom"}, + ], + }, + { + "name": "fan2", + "present": {"gettype": "i2c", "bus": 2, "loc": 0x0d, "offset": 0x30, "presentbit": 1, "okval": 0}, + "device": [ + {"id": "fan2frue2", "name": "24c02", "bus": 17, "loc": 0x50, "attr": "eeprom"}, + ], + }, + { + "name": "fan3", + "present": {"gettype": "i2c", "bus": 2, "loc": 0x0d, "offset": 0x30, "presentbit": 2, "okval": 0}, + "device": [ + {"id": "fan3frue2", "name": "24c02", "bus": 18, "loc": 0x50, "attr": "eeprom"}, + ], + }, + { + "name": "fan4", + "present": {"gettype": "i2c", "bus": 2, "loc": 0x0d, "offset": 0x30, "presentbit": 3, "okval": 0}, + "device": [ + {"id": "fan4frue2", "name": "24c02", "bus": 19, "loc": 0x50, "attr": "eeprom"}, + ], + }, + ], + "others": [ + { + "name": "eeprom", + "device": [ + {"id": "eeprom_1", "name": "24c02", "bus": 0, "loc": 0x56, "attr": "eeprom"}, + ], + }, + { + "name": "lm75", + "device": [ + {"id": "lm75_1", "name": "wb_lm75", "bus": 3, "loc": 0x48, "attr": "hwmon"}, + {"id": "lm75_2", "name": "wb_lm75", "bus": 3, "loc": 0x49, "attr": "hwmon"}, + {"id": "lm75_3", "name": "wb_lm75", "bus": 3, "loc": 0x4a, "attr": "hwmon"}, + {"id": "lm75_4", "name": "wb_lm75", "bus": 3, "loc": 0x4b, "attr": "hwmon"}, + {"id": "lm75_5", "name": "wb_lm75", "bus": 3, "loc": 0x4c, "attr": "hwmon"}, + ], + }, + { + "name": "mac_bsc", + "device": [ + {"id": "mac_bsc_1", "name": "wb_mac_bsc_td3", "bus": 3, "loc": 0x44, "attr": "hwmon"}, + ], + }, + { + "name": "ina3221", + "device": [ + {"id": "ina3221_1", "name": "wb_ina3221", "bus": 7, "loc": 0x40, "attr": "hwmon"}, + {"id": "ina3221_2", "name": "wb_ina3221", "bus": 7, "loc": 0x41, "attr": "hwmon"}, + {"id": "ina3221_3", "name": "wb_ina3221", "bus": 7, "loc": 0x42, "attr": "hwmon"}, + {"id": "ina3221_4", "name": "wb_ina3221", "bus": 7, "loc": 0x43, "attr": "hwmon"}, + ], + }, + { + "name": "tps53622", + "device": [ + {"id": "tps53622_1", "name": "wb_tps53622", "bus": 7, "loc": 0x60, "attr": "hwmon"}, + {"id": "tps53622_2", "name": "wb_tps53622", "bus": 7, "loc": 0x6c, "attr": "hwmon"}, + ], + }, + { + "name": "isl68127", + "device": [ + {"id": "isl68127_1", "name": "wb_isl68127", "bus": 7, "loc": 0x64, "attr": "hwmon"}, + ], + } + ], +} + +INIT_PARAM_PRE = [ + {"loc": "7-0064/hwmon/hwmon*/avs0_vout_max", "value": "900000"}, + {"loc": "7-0064/hwmon/hwmon*/avs0_vout_min", "value": "750000"}, +] +INIT_COMMAND_PRE = [ + "i2cset -y -f 6 0x0d 0x91 0x48", + "i2cset -y -f 6 0x0d 0x92 0x01", # MAC_PWR_EN + "i2cset -y -f 6 0x0d 0x94 0x01", # SFF_PWR_EN + "i2cset -y -f 6 0x0d 0xbf 0x01", # enbale tty_console monitor +] + +INIT_PARAM = [] + +INIT_COMMAND = [ + "i2cset -y -f 8 0x30 0x60 0x00", # enable txdis[1~8] + "i2cset -y -f 8 0x30 0x61 0x00", # enable txdis[9~16] + "i2cset -y -f 8 0x30 0x62 0x00", # enable txdis[17~24] + "i2cset -y -f 8 0x31 0x60 0x00", # enable txdis[24~32] + "i2cset -y -f 8 0x31 0x61 0x00", # enable txdis[33~40] + "i2cset -y -f 8 0x31 0x62 0x00", # enable txdis[41~48] +] + +REBOOT_CAUSE_PARA = { + "reboot_cause_list": [ + { + "name": "otp_switch_reboot", + "monitor_point": {"gettype": "file_exist", "judge_file": "/etc/.otp_switch_reboot_flag", "okval": True}, + "record": [ + {"record_type": "file", "mode": "cover", "log": "Thermal Overload: ASIC, ", + "path": "/etc/sonic/.reboot/.previous-reboot-cause.txt"}, + {"record_type": "file", "mode": "add", "log": "Thermal Overload: ASIC, ", + "path": "/etc/sonic/.reboot/.history-reboot-cause.txt", "file_max_size": 1 * 1024 * 1024} + ], + "finish_operation": [ + {"gettype": "cmd", "cmd": "rm -rf /etc/.otp_switch_reboot_flag"}, + ] + }, + { + "name": "otp_other_reboot", + "monitor_point": {"gettype": "file_exist", "judge_file": "/etc/.otp_other_reboot_flag", "okval": True}, + "record": [ + {"record_type": "file", "mode": "cover", "log": "Thermal Overload: Other, ", + "path": "/etc/sonic/.reboot/.previous-reboot-cause.txt"}, + {"record_type": "file", "mode": "add", "log": "Thermal Overload: Other, ", + "path": "/etc/sonic/.reboot/.history-reboot-cause.txt", "file_max_size": 1 * 1024 * 1024} + ], + "finish_operation": [ + {"gettype": "cmd", "cmd": "rm -rf /etc/.otp_other_reboot_flag"}, + ] + }, + ], + "other_reboot_cause_record": [ + {"record_type": "file", "mode": "cover", "log": "Other, ", "path": "/etc/sonic/.reboot/.previous-reboot-cause.txt"}, + {"record_type": "file", "mode": "add", "log": "Other, ", "path": "/etc/sonic/.reboot/.history-reboot-cause.txt"} + ], +} + +UPGRADE_SUMMARY = { + "devtype": 0x404a, + + "slot0": { + "subtype": 0, + "VME": { + "chain1": { + "name": "VME_CPLD", + "is_support_warm_upg": 0, + }, + }, + + "SPI-LOGIC-DEV": { + "chain3": { + "name": "FPGA", + "is_support_warm_upg": 0, + }, + }, + + "MTD": { + "chain2": { + "name": "BIOS", + "is_support_warm_upg": 0, + "filesizecheck": 10240, # bios check file size, Unit: K + "init_cmd": [ + {"io_addr": 0x722, "value": 0x02, "gettype": "io"}, + {"cmd": "modprobe mtd", "gettype": "cmd"}, + {"cmd": "modprobe spi_nor", "gettype": "cmd"}, + {"cmd": "modprobe ofpart", "gettype": "cmd"}, + {"cmd": "modprobe spi_intel writeable=1", "gettype": "cmd"}, + {"cmd": "modprobe spi_intel_platform", "gettype": "cmd"}, + ], + "finish_cmd": [ + {"cmd": "rmmod spi_intel_platform", "gettype": "cmd"}, + {"cmd": "rmmod spi_intel", "gettype": "cmd"}, + {"cmd": "rmmod ofpart", "gettype": "cmd"}, + {"cmd": "rmmod spi_nor", "gettype": "cmd"}, + {"cmd": "rmmod mtd", "gettype": "cmd"}, + ], + }, + }, + + "TEST": { + "cpld": [ + {"chain": 1, "file": "/etc/.upgrade_test/cpld_test_header.vme", "display_name": "CPLD"}, + ], + "fpga": [ + { + "chain": 3, + "file": "/etc/.upgrade_test/fpga_test_header.bin", + "display_name": "FPGA", + }, + ], + }, + }, + + "BMC": { + "name": "BMC", + "init_cmd": [ + ], + "finish_cmd": [], + }, +} + + +PLATFORM_E2_CONF = { + "fan": [ + { + "name": "fan1", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/16-0050/eeprom", + "e2_decode": [ + { + "area": "productInfoArea", "field": "productVersion", "decode_type": "func", "func_name": "fru_decode_hw" + }, + { + "area": "boardInfoArea", "field": "boardextra1", "decode_type": "func", "func_name": "fru_decode_hw" + }, + ], + }, + { + "name": "fan2", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/17-0050/eeprom", + "e2_decode": [ + { + "area": "productInfoArea", "field": "productVersion", "decode_type": "func", "func_name": "fru_decode_hw" + }, + { + "area": "boardInfoArea", "field": "boardextra1", "decode_type": "func", "func_name": "fru_decode_hw" + }, + ], + }, + { + "name": "fan3", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/18-0050/eeprom", + "e2_decode": [ + { + "area": "productInfoArea", "field": "productVersion", "decode_type": "func", "func_name": "fru_decode_hw" + }, + { + "area": "boardInfoArea", "field": "boardextra1", "decode_type": "func", "func_name": "fru_decode_hw" + }, + ], + }, + { + "name": "fan4", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/19-0050/eeprom", + "e2_decode": [ + { + "area": "productInfoArea", "field": "productVersion", "decode_type": "func", "func_name": "fru_decode_hw" + }, + { + "area": "boardInfoArea", "field": "boardextra1", "decode_type": "func", "func_name": "fru_decode_hw" + }, + ], + }, + ], + "psu": [ + {"name": "psu1", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/24-0050/eeprom"}, + {"name": "psu2", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/25-0050/eeprom"}, + ], + "syseeprom": [ + {"name": "syseeprom", "e2_type": "onie_tlv", "e2_path": "/sys/bus/i2c/devices/0-0056/eeprom"}, + ], +} + +AIR_FLOW_CONF = { + "psu_fan_airflow": { + "intake": ['CSU550AP-3-500', 'DPS-550AB-39 A', 'GW-CRPS550N2C', 'CSU550AP-3-300', 'DPS-550AB-39 B', 'CSU550AP-3', 'U1D-D10800-DRB'], + "exhaust": ['CSU550AP-3-501', 'DPS-550AB-40 A', 'GW-CRPS550N2RC'] + }, + + "fanairflow": { + "intake": ['M1HFAN III-F'], + "exhaust": ['M1HFAN III-R'] + }, + + "fans": [ + { + "name": "FAN1", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/16-0050/eeprom", + "area": "productInfoArea", "field": "productName", "decode": "fanairflow" + }, + { + "name": "FAN2", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/17-0050/eeprom", + "area": "productInfoArea", "field": "productName", "decode": "fanairflow" + }, + { + "name": "FAN3", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/18-0050/eeprom", + "area": "productInfoArea", "field": "productName", "decode": "fanairflow" + }, + { + "name": "FAN4", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/19-0050/eeprom", + "area": "productInfoArea", "field": "productName", "decode": "fanairflow" + } + ], + + "psus": [ + { + "name": "PSU1", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/24-0050/eeprom", + "area": "productInfoArea", "field": "productPartModelName", "decode": "psu_fan_airflow" + }, + { + "name": "PSU2", "e2_type": "fru", "e2_path": "/sys/bus/i2c/devices/25-0050/eeprom", + "area": "productInfoArea", "field": "productPartModelName", "decode": "psu_fan_airflow" + } + ] +} diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/config/x86_64_micas_m2_w6510_48v8c_r0_port_config.py b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/config/x86_64_micas_m2_w6510_48v8c_r0_port_config.py new file mode 100755 index 000000000000..26f92a77a020 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/config/x86_64_micas_m2_w6510_48v8c_r0_port_config.py @@ -0,0 +1,7 @@ +#!/usr/bin/python3 +# -*- coding: UTF-8 -*- + +PLATFORM_INTF_OPTOE = { + "port_num": 56, + "optoe_start_bus": 32, +} diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_device.py b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_device.py new file mode 100755 index 000000000000..c1eb46247086 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_device.py @@ -0,0 +1,1371 @@ +#!/usr/bin/python3 + +psu_fan_airflow = { + "intake": ['CSU550AP-3-500', 'DPS-550AB-39 A', 'GW-CRPS550N2C', 'CSU550AP-3-300', 'DPS-550AB-39 B', 'CSU550AP-3', 'U1D-D10800-DRB'], + "exhaust": ['CSU550AP-3-501', 'DPS-550AB-40 A', 'GW-CRPS550N2RC'] +} + +fanairflow = { + "intake": ['M1HFAN III-F'], + "exhaust": ['M1HFAN III-R'], +} + +psu_display_name = { + "PA550II-F": ['CSU550AP-3-500', 'DPS-550AB-39 A', 'GW-CRPS550N2C', 'CSU550AP-3-300', 'DPS-550AB-39 B', 'CSU550AP-3'], + "PA550II-R": ['CSU550AP-3-501', 'DPS-550AB-40 A', 'GW-CRPS550N2RC'], + "PD800I-F": ['U1D-D10800-DRB'] +} + +psutypedecode = { + 0x00: 'N/A', + 0x01: 'AC', + 0x02: 'DC', +} + + +class Unit: + Temperature = "C" + Voltage = "V" + Current = "A" + Power = "W" + Speed = "RPM" + + +PSU_NOT_PRESENT_PWM = 100 + + +class threshold: + PSU_TEMP_MIN = -20 * 1000 + PSU_TEMP_MAX = 60 * 1000 + + PSU_FAN_SPEED_MIN = 2000 + PSU_FAN_SPEED_MAX = 18000 + + PSU_OUTPUT_VOLTAGE_MIN = 11 * 1000 + PSU_OUTPUT_VOLTAGE_MAX = 14 * 1000 + + PSU_AC_INPUT_VOLTAGE_MIN = 200 * 1000 + PSU_AC_INPUT_VOLTAGE_MAX = 240 * 1000 + + PSU_DC_INPUT_VOLTAGE_MIN = 190 * 1000 + PSU_DC_INPUT_VOLTAGE_MAX = 290 * 1000 + + ERR_VALUE = -9999999 + + PSU_OUTPUT_POWER_MIN = 10 * 1000 * 1000 + PSU_OUTPUT_POWER_MAX = 560 * 1000 * 1000 + + PSU_INPUT_POWER_MIN = 10 * 1000 * 1000 + PSU_INPUT_POWER_MAX = 625 * 1000 * 1000 + + PSU_OUTPUT_CURRENT_MIN = 1 * 1000 + PSU_OUTPUT_CURRENT_MAX = 45 * 1000 + + PSU_INPUT_CURRENT_MIN = 0 * 1000 + PSU_INPUT_CURRENT_MAX = 7 * 1000 + + FRONT_FAN_SPEED_MAX = 24000 + REAR_FAN_SPEED_MAX = 22500 + FAN_SPEED_MIN = 5000 + + + ASPOWER_DC_PSU_TEMP_MIN = -10 * 1000 + ASPOWER_DC_PSU_TEMP_MAX = 55 * 1000 + + ASPOWER_DC_PSU_FAN_SPEED_MIN = 800 + ASPOWER_DC_PSU_FAN_SPEED_MAX = 24000 + + ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MIN = 11.4 * 1000 + ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MAX = 12.6 * 1000 + + ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MIN = 36 * 1000 + ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MAX = 72 * 1000 + + ASPOWER_DC_ERR_VALUE = -9999999 + + ASPOWER_DC_PSU_OUTPUT_POWER_MIN = 5 * 1000 * 1000 + ASPOWER_DC_PSU_OUTPUT_POWER_MAX = 800 * 1000 * 1000 + + ASPOWER_DC_PSU_INPUT_POWER_MIN = 5 * 1000 * 1000 + ASPOWER_DC_PSU_INPUT_POWER_MAX = 880 * 1000 * 1000 + + ASPOWER_DC_PSU_OUTPUT_CURRENT_MIN = 0.5 * 1000 + ASPOWER_DC_PSU_OUTPUT_CURRENT_MAX = 66 * 1000 + + ASPOWER_DC_PSU_INPUT_CURRENT_MIN = 1 * 1000 + ASPOWER_DC_PSU_INPUT_CURRENT_MAX = 28 * 1000 + + +class Description: + CPLD = "Used for managing IO modules, SFP+ modules and system LEDs" + BIOS = "Performs initialization of hardware components during booting" + FPGA = "Platform management controller for on-board temperature monitoring, in-chassis power" + + +devices = { + "onie_e2": [ + { + "name": "ONIE_E2", + "e2loc": {"loc": "/sys/bus/i2c/devices/0-0056/eeprom", "way": "sysfs"}, + "airflow": "intake" + }, + ], + "psus": [ + { + "e2loc": {"loc": "/sys/bus/i2c/devices/24-0050/eeprom", "way": "sysfs"}, + "pmbusloc": {"bus": 24, "addr": 0x58, "way": "i2c"}, + "present": {"loc": "/sys/wb_plat/psu/psu1/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "name": "PSU1", + "get_threshold_by_model": 1, + "psu_display_name": psu_display_name, + "airflow": psu_fan_airflow, + "TempStatus": {"bus": 24, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x0004}, + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_TEMP_MIN, + "other": threshold.PSU_TEMP_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_TEMP_MAX, + "other": threshold.PSU_TEMP_MAX, + }, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + }, + "FanStatus": {"bus": 24, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x0400}, + "FanSpeed": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/fan1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_FAN_SPEED_MIN, + "other": threshold.PSU_FAN_SPEED_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_FAN_SPEED_MAX, + "other": threshold.PSU_FAN_SPEED_MAX, + }, + "Unit": Unit.Speed + }, + "psu_fan_tolerance": 40, + "InputsStatus": {"bus": 24, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x2000}, + "InputsType": {"bus": 24, "addr": 0x58, "offset": 0x80, "way": "i2c", 'psutypedecode': psutypedecode}, + "InputsVoltage": { + 'AC': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": threshold.PSU_AC_INPUT_VOLTAGE_MIN, + "Max": threshold.PSU_AC_INPUT_VOLTAGE_MAX, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + + }, + 'DC': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MIN, + "other": threshold.PSU_DC_INPUT_VOLTAGE_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MAX, + "other": threshold.PSU_DC_INPUT_VOLTAGE_MAX, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + }, + 'other': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MIN, + "other": threshold.ERR_VALUE, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MAX, + "other": threshold.ERR_VALUE, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + } + }, + "InputsCurrent": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/curr1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_CURRENT_MIN, + "other": threshold.PSU_INPUT_CURRENT_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_CURRENT_MAX, + "other": threshold.PSU_INPUT_CURRENT_MAX, + }, + "Unit": Unit.Current, + "format": "float(float(%s)/1000)" + }, + "InputsPower": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/power1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_POWER_MIN, + "other": threshold.PSU_INPUT_POWER_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_POWER_MAX, + "other": threshold.PSU_INPUT_POWER_MAX, + }, + "Unit": Unit.Power, + "format": "float(float(%s)/1000000)" + }, + "OutputsStatus": {"bus": 24, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x8800}, + "OutputsVoltage": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/in2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MIN, + "other": threshold.PSU_OUTPUT_VOLTAGE_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MAX, + "other": threshold.PSU_OUTPUT_VOLTAGE_MAX, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + }, + "OutputsCurrent": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/curr2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_CURRENT_MIN, + "other": threshold.PSU_OUTPUT_CURRENT_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_CURRENT_MAX, + "other": threshold.PSU_OUTPUT_CURRENT_MAX, + }, + "Unit": Unit.Current, + "format": "float(float(%s)/1000)" + }, + "OutputsPower": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/power2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_POWER_MIN, + "other": threshold.PSU_OUTPUT_POWER_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_POWER_MAX, + "other": threshold.PSU_OUTPUT_POWER_MAX, + }, + "Unit": Unit.Power, + "format": "float(float(%s)/1000000)" + }, + }, + { + "e2loc": {"loc": "/sys/bus/i2c/devices/25-0050/eeprom", "way": "sysfs"}, + "pmbusloc": {"bus": 25, "addr": 0x58, "way": "i2c"}, + "present": {"loc": "/sys/wb_plat/psu/psu2/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "name": "PSU2", + "get_threshold_by_model": 1, + "psu_display_name": psu_display_name, + "airflow": psu_fan_airflow, + "TempStatus": {"bus": 25, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x0004}, + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_TEMP_MIN, + "other": threshold.PSU_TEMP_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_TEMP_MAX, + "other": threshold.PSU_TEMP_MAX, + }, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + }, + "FanStatus": {"bus": 25, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x0400}, + "FanSpeed": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/fan1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_FAN_SPEED_MIN, + "other": threshold.PSU_FAN_SPEED_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_FAN_SPEED_MAX, + "other": threshold.PSU_FAN_SPEED_MAX, + }, + "Unit": Unit.Speed + }, + "psu_fan_tolerance": 40, + "InputsStatus": {"bus": 25, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x2000}, + "InputsType": {"bus": 25, "addr": 0x58, "offset": 0x80, "way": "i2c", 'psutypedecode': psutypedecode}, + "InputsVoltage": { + 'AC': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": threshold.PSU_AC_INPUT_VOLTAGE_MIN, + "Max": threshold.PSU_AC_INPUT_VOLTAGE_MAX, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + + }, + 'DC': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MIN, + "other": threshold.PSU_DC_INPUT_VOLTAGE_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MAX, + "other": threshold.PSU_DC_INPUT_VOLTAGE_MAX, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + }, + 'other': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MIN, + "other": threshold.ERR_VALUE, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MAX, + "other": threshold.ERR_VALUE, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + } + }, + "InputsCurrent": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/curr1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_CURRENT_MIN, + "other": threshold.PSU_INPUT_CURRENT_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_CURRENT_MAX, + "other": threshold.PSU_INPUT_CURRENT_MAX, + }, + "Unit": Unit.Current, + "format": "float(float(%s)/1000)" + }, + "InputsPower": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/power1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_POWER_MIN, + "other": threshold.PSU_INPUT_POWER_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_POWER_MAX, + "other": threshold.PSU_INPUT_POWER_MAX, + }, + "Unit": Unit.Power, + "format": "float(float(%s)/1000000)" + }, + "OutputsStatus": {"bus": 25, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x8800}, + "OutputsVoltage": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/in2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MIN, + "other": threshold.PSU_OUTPUT_VOLTAGE_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MAX, + "other": threshold.PSU_OUTPUT_VOLTAGE_MAX, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + }, + "OutputsCurrent": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/curr2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_CURRENT_MIN, + "other": threshold.PSU_OUTPUT_CURRENT_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_CURRENT_MAX, + "other": threshold.PSU_OUTPUT_CURRENT_MAX, + }, + "Unit": Unit.Current, + "format": "float(float(%s)/1000)" + }, + "OutputsPower": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/power2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_POWER_MIN, + "other": threshold.PSU_OUTPUT_POWER_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_POWER_MAX, + "other": threshold.PSU_OUTPUT_POWER_MAX, + }, + "Unit": Unit.Power, + "format": "float(float(%s)/1000000)" + }, + } + ], + "temps": [ + { + "name": "SWITCH_TEMP", + "temp_id": "TEMP1", + "api_name": "ASIC_TEMP", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/3-0044/hwmon/hwmon*/temp99_input", "way": "sysfs"}, + "Min": -30000, + "Low": 0, + "High": 105000, + "Max": 110000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "CPU_TEMP", + "temp_id": "TEMP2", + "Temperature": { + "value": {"loc": "/sys/bus/platform/devices/coretemp.0/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -15000, + "Low": 0, + "High": 100000, + "Max": 102000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "INLET_TEMP", + "temp_id": "TEMP3", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/3-0048/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -30000, + "Low": 0, + "High": 55000, + "Max": 60000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + }, + "fix_value": { + "fix_type": "config", + "addend": -3, + } + }, + { + "name": "OUTLET_TEMP", + "temp_id": "TEMP4", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/3-004c/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -30000, + "Low": 0, + "High": 75000, + "Max": 80000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "BOARD_TEMP", + "temp_id": "TEMP5", + "api_name": "MAC_OUT_TEMP", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/3-004a/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -30000, + "Low": 0, + "High": 75000, + "Max": 80000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "MAC_IN_TEMP", + "temp_id": "TEMP6", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/3-0049/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -30000, + "Low": 0, + "High": 75000, + "Max": 80000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "PSU1_TEMP", + "temp_id": "TEMP7", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -20000, + "Low": 0, + "High": 55000, + "Max": 60000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "PSU2_TEMP", + "temp_id": "TEMP8", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -20000, + "Low": 0, + "High": 55000, + "Max": 60000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "SFF_TEMP", + "Temperature": { + "value": {"loc": "/tmp/highest_sff_temp", "way": "sysfs", "flock_path": "/tmp/highest_sff_temp"}, + "Min": -30000, + "Low": 0, + "High": 90000, + "Max": 100000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + }, + "invalid": -10000, + "error": -9999, + } + ], + "leds": [ + { + "name": "FRONT_SYS_LED", + "led_type": "SYS_LED", + "led": {"bus": 6, "addr": 0x0d, "offset": 0x72, "way": "i2c"}, + "led_attrs": { + "off": 0x00, "red_flash": 0x01, "red": 0x02, + "green_flash": 0x03, "green": 0x04, "amber_flash": 0x05, + "amber": 0x06, "mask": 0x07 + }, + }, + { + "name": "FRONT_PSU_LED", + "led_type": "PSU_LED", + "led": {"bus": 6, "addr": 0x0d, "offset": 0x73, "way": "i2c"}, + "led_attrs": { + "off": 0x10, "red_flash": 0x11, "red": 0x12, + "green_flash": 0x13, "green": 0x14, "amber_flash": 0x15, + "amber": 0x16, "mask": 0x17 + }, + }, + { + "name": "FRONT_FAN_LED", + "led_type": "FAN_LED", + "led": {"bus": 6, "addr": 0x0d, "offset": 0x74, "way": "i2c"}, + "led_attrs": { + "off": 0x10, "red_flash": 0x11, "red": 0x12, + "green_flash": 0x13, "green": 0x14, "amber_flash": 0x15, + "amber": 0x16, "mask": 0x17 + }, + }, + ], + "fans": [ + { + "name": "FAN1", + "airflow": fanairflow, + "e2loc": {'loc': '/sys/bus/i2c/devices/i2c-16/16-0050/eeprom', 'way': 'sysfs'}, + "present": {"loc": "/sys/wb_plat/fan/fan1/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "led": {"bus": 2, "addr": 0x0d, "offset": 0x3b, "way": "i2c"}, + "led_attrs": { + "off": 0x0b, "red_flash": 0x0e, "red": 0x0a, + "green_flash": 0x0d, "green": 0x09, "amber_flash": 0x07, + "amber": 0x03, "mask": 0x0f + }, + "PowerMax": 38.4, + "Rotor": { + "Rotor1_config": { + "name": "Rotor1", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x14, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan1/motor1/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan1/motor1/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan1/motor1/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.FRONT_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + "Rotor2_config": { + "name": "Rotor2", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x14, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan1/motor0/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan1/motor0/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.REAR_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan1/motor0/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.REAR_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + }, + }, + { + "name": "FAN2", + "airflow": fanairflow, + "e2loc": {'loc': '/sys/bus/i2c/devices/i2c-17/17-0050/eeprom', 'way': 'sysfs'}, + "present": {"loc": "/sys/wb_plat/fan/fan2/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "led": {"bus": 2, "addr": 0x0d, "offset": 0x3c, "way": "i2c"}, + "led_attrs": { + "off": 0x0b, "red_flash": 0x0e, "red": 0x0a, + "green_flash": 0x0d, "green": 0x09, "amber_flash": 0x07, + "amber": 0x03, "mask": 0x0f + }, + "PowerMax": 38.4, + "Rotor": { + "Rotor1_config": { + "name": "Rotor1", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x15, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan2/motor1/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan2/motor1/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan2/motor1/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.FRONT_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + "Rotor2_config": { + "name": "Rotor2", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x15, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan2/motor0/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan2/motor0/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.REAR_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan2/motor0/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.REAR_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + }, + }, + { + "name": "FAN3", + "airflow": fanairflow, + "e2loc": {'loc': '/sys/bus/i2c/devices/i2c-18/18-0050/eeprom', 'way': 'sysfs'}, + "present": {"loc": "/sys/wb_plat/fan/fan3/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "led": {"bus": 2, "addr": 0x0d, "offset": 0x3d, "way": "i2c"}, + "led_attrs": { + "off": 0x0b, "red_flash": 0x0e, "red": 0x0a, + "green_flash": 0x0d, "green": 0x09, "amber_flash": 0x07, + "amber": 0x03, "mask": 0x0f + }, + "PowerMax": 38.4, + "Rotor": { + "Rotor1_config": { + "name": "Rotor1", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x16, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan3/motor1/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan3/motor1/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan3/motor1/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.FRONT_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + "Rotor2_config": { + "name": "Rotor2", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x16, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan3/motor0/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan3/motor0/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.REAR_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan3/motor0/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.REAR_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + }, + }, + + { + "name": "FAN4", + "airflow": fanairflow, + "e2loc": {'loc': '/sys/bus/i2c/devices/i2c-19/19-0050/eeprom', 'way': 'sysfs'}, + "present": {"loc": "/sys/wb_plat/fan/fan4/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "led": {"bus": 2, "addr": 0x0d, "offset": 0x3e, "way": "i2c"}, + "led_attrs": { + "off": 0x0b, "red_flash": 0x0e, "red": 0x0a, + "green_flash": 0x0d, "green": 0x09, "amber_flash": 0x07, + "amber": 0x03, "mask": 0x0f + }, + "PowerMax": 38.4, + "Rotor": { + "Rotor1_config": { + "name": "Rotor1", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x17, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan4/motor1/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan4/motor1/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan4/motor1/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.FRONT_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + "Rotor2_config": { + "name": "Rotor2", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x17, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan4/motor0/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan4/motor0/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.REAR_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan4/motor0/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.REAR_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + }, + }, + + ], + "cplds": [ + { + "name": "CPU_CPLD", + "cpld_id": "CPLD1", + "VersionFile": {"loc": "/dev/cpld0", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for system power", + "slot": 0, + "warm": 0, + }, + { + "name": "CONNECT_CPLD", + "cpld_id": "CPLD2", + "VersionFile": {"loc": "/dev/cpld1", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for base functions", + "slot": 0, + "warm": 0, + }, + { + "name": "CONNECT_CPLD-FAN", + "cpld_id": "CPLD3", + "VersionFile": {"loc": "/dev/cpld2", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for fan modules", + "slot": 0, + "warm": 0, + }, + { + "name": "MAC_CPLD1", + "cpld_id": "CPLD4", + "VersionFile": {"loc": "/dev/cpld3", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for sff modules", + "slot": 0, + "warm": 0, + }, + { + "name": "MAC_CPLD2", + "cpld_id": "CPLD5", + "VersionFile": {"loc": "/dev/cpld4", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for sff modules", + "slot": 0, + "warm": 0, + }, + { + "name": "FPGA", + "cpld_id": "CPLD6", + "VersionFile": {"loc": "/dev/fpga0", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for base functions", + "slot": 0, + "format": "little_endian", + "warm": 0, + }, + { + "name": "BIOS", + "cpld_id": "CPLD7", + "VersionFile": {"cmd": "dmidecode -s bios-version", "way": "cmd"}, + "desc": "Performs initialization of hardware components during booting", + "slot": 0, + "type": "str", + "warm": 0, + }, + ], + "dcdc": [ + { + "name": "Switch_ZSFP1_3v3_C", + "dcdc_id": "DCDC1", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 22000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_QSFP1_3v3_C", + "dcdc_id": "DCDC2", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/curr3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 22000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_5v0_C", + "dcdc_id": "DCDC3", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 1000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_ZSFP1_3v3_V", + "dcdc_id": "DCDC4", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/in1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_QSFP1_3v3_V", + "dcdc_id": "DCDC5", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_5v0_V", + "dcdc_id": "DCDC6", + "Min": 4000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 6000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_1v2_C", + "dcdc_id": "DCDC7", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_3v3_C", + "dcdc_id": "DCDC8", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 1000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_Cpld_3v3_C", + "dcdc_id": "DCDC9", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/curr3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_1v2_V", + "dcdc_id": "DCDC10", + "Min": 960, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/in1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 1440, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_3v3_V", + "dcdc_id": "DCDC11", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_Cpld_3v3_V", + "dcdc_id": "DCDC12", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_1v2_C", + "dcdc_id": "DCDC13", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 1300, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_3v3_C", + "dcdc_id": "DCDC14", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2800, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_SSD_3v3_C", + "dcdc_id": "DCDC15", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/curr3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 4500, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_1v2_V", + "dcdc_id": "DCDC16", + "Min": 960, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/in1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 1440, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_3v3_V", + "dcdc_id": "DCDC17", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_SSD_3v3_V", + "dcdc_id": "DCDC18", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_3v3_C", + "dcdc_id": "DCDC19", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 4686, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_5v_C", + "dcdc_id": "DCDC20", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2200, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v7_C", + "dcdc_id": "DCDC21", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/curr3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2200, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_3v3_V", + "dcdc_id": "DCDC22", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/in1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_5v_V", + "dcdc_id": "DCDC23", + "Min": 4000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 6000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v7_V", + "dcdc_id": "DCDC24", + "Min": 1360, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 2040, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_CORE_C", + "dcdc_id": "DCDC25", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0060/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 47300, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v05_C", + "dcdc_id": "DCDC26", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0060/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 15400, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_CORE_V", + "dcdc_id": "DCDC27", + "Min": 1456, + "value": { + "loc": "/sys/bus/i2c/devices/7-0060/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 2184, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v05_V", + "dcdc_id": "DCDC28", + "Min": 840, + "value": { + "loc": "/sys/bus/i2c/devices/7-0060/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 1260, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_CORE_C", + "dcdc_id": "DCDC29", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0064/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 220000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_ANALOG_C", + "dcdc_id": "DCDC30", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0064/hwmon/hwmon*/curr3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 18000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_CORE_V", + "dcdc_id": "DCDC31", + "Min": 600, + "value": { + "loc": "/sys/bus/i2c/devices/7-0064/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 1200, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_ANALOG_V", + "dcdc_id": "DCDC32", + "Min": 640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0064/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v2_C", + "dcdc_id": "DCDC33", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-006c/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 9900, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_2v23_C", + "dcdc_id": "DCDC34", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-006c/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2200, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v2_V", + "dcdc_id": "DCDC35", + "Min": 960, + "value": { + "loc": "/sys/bus/i2c/devices/7-006c/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 1440, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_2v23_V", + "dcdc_id": "DCDC36", + "Min": 1784, + "value": { + "loc": "/sys/bus/i2c/devices/7-006c/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 2676, + "format": "float(float(%s)/1000)", + }, + ], + "cpu": [ + { + "name": "cpu", + "reboot_cause_path": "/etc/sonic/.reboot/.previous-reboot-cause.txt" + } + ], + "sfps": { + "ver": '1.0', + "port_index_start": 1, + "port_num": 56, + "log_level": 2, + "eeprom_retry_times": 5, + "eeprom_retry_break_sec": 0.2, + "presence_cpld": { + "dev_id": { + 3: { + "offset": { + 0x30: "1-8", + 0x31: "9-16", + 0x32: "17-24", + }, + }, + 4: { + "offset": { + 0x30: "25-32", + 0x31: "33-40", + 0x32: "41-48", + 0x33: "49-56", + }, + }, + }, + }, + "presence_val_is_present": 0, + "eeprom_path": "/sys/bus/i2c/devices/i2c-%d/%d-0050/eeprom", + "eeprom_path_key": list(range(32, 88)), + "optoe_driver_path": "/sys/bus/i2c/devices/i2c-%d/%d-0050/dev_class", + "optoe_driver_key": list(range(32, 88)), + "txdis_cpld": { + "dev_id": { + 3: { + "offset": { + 0x60: "1-8", + 0x61: "9-16", + 0x62: "17-24", + }, + }, + 4: { + "offset": { + 0x60: "25-32", + 0x61: "33-40", + 0x62: "41-48", + }, + }, + }, + }, + "txdisable_val_is_on": 1, + "reset_cpld": { + "dev_id": { + 4: { + "offset": { + 0xb9: "49-56", + }, + }, + }, + }, + "reset_val_is_reset": 0, + } +} diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_exhaust_device.py b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_exhaust_device.py new file mode 100755 index 000000000000..c2b857975382 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_exhaust_device.py @@ -0,0 +1,1371 @@ +#!/usr/bin/python3 + +psu_fan_airflow = { + "intake": ['CSU550AP-3-500', 'DPS-550AB-39 A', 'GW-CRPS550N2C', 'CSU550AP-3-300', 'DPS-550AB-39 B', 'CSU550AP-3', 'U1D-D10800-DRB'], + "exhaust": ['CSU550AP-3-501', 'DPS-550AB-40 A', 'GW-CRPS550N2RC'] +} + +fanairflow = { + "intake": ['M1HFAN III-F'], + "exhaust": ['M1HFAN III-R'], +} + +psu_display_name = { + "PA550II-F": ['CSU550AP-3-500', 'DPS-550AB-39 A', 'GW-CRPS550N2C', 'CSU550AP-3-300', 'DPS-550AB-39 B', 'CSU550AP-3'], + "PA550II-R": ['CSU550AP-3-501', 'DPS-550AB-40 A', 'GW-CRPS550N2RC'], + "PD800I-F": ['U1D-D10800-DRB'] +} + +psutypedecode = { + 0x00: 'N/A', + 0x01: 'AC', + 0x02: 'DC', +} + + +class Unit: + Temperature = "C" + Voltage = "V" + Current = "A" + Power = "W" + Speed = "RPM" + + +PSU_NOT_PRESENT_PWM = 100 + + +class threshold: + PSU_TEMP_MIN = -20 * 1000 + PSU_TEMP_MAX = 60 * 1000 + + PSU_FAN_SPEED_MIN = 2000 + PSU_FAN_SPEED_MAX = 18000 + + PSU_OUTPUT_VOLTAGE_MIN = 11 * 1000 + PSU_OUTPUT_VOLTAGE_MAX = 14 * 1000 + + PSU_AC_INPUT_VOLTAGE_MIN = 200 * 1000 + PSU_AC_INPUT_VOLTAGE_MAX = 240 * 1000 + + PSU_DC_INPUT_VOLTAGE_MIN = 190 * 1000 + PSU_DC_INPUT_VOLTAGE_MAX = 290 * 1000 + + ERR_VALUE = -9999999 + + PSU_OUTPUT_POWER_MIN = 10 * 1000 * 1000 + PSU_OUTPUT_POWER_MAX = 560 * 1000 * 1000 + + PSU_INPUT_POWER_MIN = 10 * 1000 * 1000 + PSU_INPUT_POWER_MAX = 625 * 1000 * 1000 + + PSU_OUTPUT_CURRENT_MIN = 1 * 1000 + PSU_OUTPUT_CURRENT_MAX = 45 * 1000 + + PSU_INPUT_CURRENT_MIN = 0 * 1000 + PSU_INPUT_CURRENT_MAX = 7 * 1000 + + FRONT_FAN_SPEED_MAX = 24000 + REAR_FAN_SPEED_MAX = 22500 + FAN_SPEED_MIN = 5000 + + + ASPOWER_DC_PSU_TEMP_MIN = -10 * 1000 + ASPOWER_DC_PSU_TEMP_MAX = 55 * 1000 + + ASPOWER_DC_PSU_FAN_SPEED_MIN = 800 + ASPOWER_DC_PSU_FAN_SPEED_MAX = 24000 + + ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MIN = 11.4 * 1000 + ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MAX = 12.6 * 1000 + + ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MIN = 36 * 1000 + ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MAX = 72 * 1000 + + ASPOWER_DC_ERR_VALUE = -9999999 + + ASPOWER_DC_PSU_OUTPUT_POWER_MIN = 5 * 1000 * 1000 + ASPOWER_DC_PSU_OUTPUT_POWER_MAX = 800 * 1000 * 1000 + + ASPOWER_DC_PSU_INPUT_POWER_MIN = 5 * 1000 * 1000 + ASPOWER_DC_PSU_INPUT_POWER_MAX = 880 * 1000 * 1000 + + ASPOWER_DC_PSU_OUTPUT_CURRENT_MIN = 0.5 * 1000 + ASPOWER_DC_PSU_OUTPUT_CURRENT_MAX = 66 * 1000 + + ASPOWER_DC_PSU_INPUT_CURRENT_MIN = 1 * 1000 + ASPOWER_DC_PSU_INPUT_CURRENT_MAX = 28 * 1000 + + +class Description: + CPLD = "Used for managing IO modules, SFP+ modules and system LEDs" + BIOS = "Performs initialization of hardware components during booting" + FPGA = "Platform management controller for on-board temperature monitoring, in-chassis power" + + +devices = { + "onie_e2": [ + { + "name": "ONIE_E2", + "e2loc": {"loc": "/sys/bus/i2c/devices/0-0056/eeprom", "way": "sysfs"}, + "airflow": "exhaust" + }, + ], + "psus": [ + { + "e2loc": {"loc": "/sys/bus/i2c/devices/24-0050/eeprom", "way": "sysfs"}, + "pmbusloc": {"bus": 24, "addr": 0x58, "way": "i2c"}, + "present": {"loc": "/sys/wb_plat/psu/psu1/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "name": "PSU1", + "get_threshold_by_model": 1, + "psu_display_name": psu_display_name, + "airflow": psu_fan_airflow, + "TempStatus": {"bus": 24, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x0004}, + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_TEMP_MIN, + "other": threshold.PSU_TEMP_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_TEMP_MAX, + "other": threshold.PSU_TEMP_MAX, + }, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + }, + "FanStatus": {"bus": 24, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x0400}, + "FanSpeed": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/fan1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_FAN_SPEED_MIN, + "other": threshold.PSU_FAN_SPEED_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_FAN_SPEED_MAX, + "other": threshold.PSU_FAN_SPEED_MAX, + }, + "Unit": Unit.Speed + }, + "psu_fan_tolerance": 40, + "InputsStatus": {"bus": 24, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x2000}, + "InputsType": {"bus": 24, "addr": 0x58, "offset": 0x80, "way": "i2c", 'psutypedecode': psutypedecode}, + "InputsVoltage": { + 'AC': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": threshold.PSU_AC_INPUT_VOLTAGE_MIN, + "Max": threshold.PSU_AC_INPUT_VOLTAGE_MAX, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + + }, + 'DC': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MIN, + "other": threshold.PSU_DC_INPUT_VOLTAGE_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MAX, + "other": threshold.PSU_DC_INPUT_VOLTAGE_MAX, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + }, + 'other': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MIN, + "other": threshold.ERR_VALUE, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MAX, + "other": threshold.ERR_VALUE, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + } + }, + "InputsCurrent": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/curr1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_CURRENT_MIN, + "other": threshold.PSU_INPUT_CURRENT_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_CURRENT_MAX, + "other": threshold.PSU_INPUT_CURRENT_MAX, + }, + "Unit": Unit.Current, + "format": "float(float(%s)/1000)" + }, + "InputsPower": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/power1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_POWER_MIN, + "other": threshold.PSU_INPUT_POWER_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_POWER_MAX, + "other": threshold.PSU_INPUT_POWER_MAX, + }, + "Unit": Unit.Power, + "format": "float(float(%s)/1000000)" + }, + "OutputsStatus": {"bus": 24, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x8800}, + "OutputsVoltage": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/in2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MIN, + "other": threshold.PSU_OUTPUT_VOLTAGE_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MAX, + "other": threshold.PSU_OUTPUT_VOLTAGE_MAX, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + }, + "OutputsCurrent": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/curr2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_CURRENT_MIN, + "other": threshold.PSU_OUTPUT_CURRENT_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_CURRENT_MAX, + "other": threshold.PSU_OUTPUT_CURRENT_MAX, + }, + "Unit": Unit.Current, + "format": "float(float(%s)/1000)" + }, + "OutputsPower": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/power2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_POWER_MIN, + "other": threshold.PSU_OUTPUT_POWER_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_POWER_MAX, + "other": threshold.PSU_OUTPUT_POWER_MAX, + }, + "Unit": Unit.Power, + "format": "float(float(%s)/1000000)" + }, + }, + { + "e2loc": {"loc": "/sys/bus/i2c/devices/25-0050/eeprom", "way": "sysfs"}, + "pmbusloc": {"bus": 25, "addr": 0x58, "way": "i2c"}, + "present": {"loc": "/sys/wb_plat/psu/psu2/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "name": "PSU2", + "get_threshold_by_model": 1, + "psu_display_name": psu_display_name, + "airflow": psu_fan_airflow, + "TempStatus": {"bus": 25, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x0004}, + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_TEMP_MIN, + "other": threshold.PSU_TEMP_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_TEMP_MAX, + "other": threshold.PSU_TEMP_MAX, + }, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + }, + "FanStatus": {"bus": 25, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x0400}, + "FanSpeed": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/fan1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_FAN_SPEED_MIN, + "other": threshold.PSU_FAN_SPEED_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_FAN_SPEED_MAX, + "other": threshold.PSU_FAN_SPEED_MAX, + }, + "Unit": Unit.Speed + }, + "psu_fan_tolerance": 40, + "InputsStatus": {"bus": 25, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x2000}, + "InputsType": {"bus": 25, "addr": 0x58, "offset": 0x80, "way": "i2c", 'psutypedecode': psutypedecode}, + "InputsVoltage": { + 'AC': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": threshold.PSU_AC_INPUT_VOLTAGE_MIN, + "Max": threshold.PSU_AC_INPUT_VOLTAGE_MAX, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + + }, + 'DC': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MIN, + "other": threshold.PSU_DC_INPUT_VOLTAGE_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MAX, + "other": threshold.PSU_DC_INPUT_VOLTAGE_MAX, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + }, + 'other': { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/in1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MIN, + "other": threshold.ERR_VALUE, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_DC_INPUT_VOLTAGE_MAX, + "other": threshold.ERR_VALUE, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + } + }, + "InputsCurrent": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/curr1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_CURRENT_MIN, + "other": threshold.PSU_INPUT_CURRENT_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_CURRENT_MAX, + "other": threshold.PSU_INPUT_CURRENT_MAX, + }, + "Unit": Unit.Current, + "format": "float(float(%s)/1000)" + }, + "InputsPower": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/power1_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_POWER_MIN, + "other": threshold.PSU_INPUT_POWER_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_INPUT_POWER_MAX, + "other": threshold.PSU_INPUT_POWER_MAX, + }, + "Unit": Unit.Power, + "format": "float(float(%s)/1000000)" + }, + "OutputsStatus": {"bus": 25, "addr": 0x58, "offset": 0x79, "way": "i2cword", "mask": 0x8800}, + "OutputsVoltage": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/in2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MIN, + "other": threshold.PSU_OUTPUT_VOLTAGE_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_VOLTAGE_MAX, + "other": threshold.PSU_OUTPUT_VOLTAGE_MAX, + }, + "Unit": Unit.Voltage, + "format": "float(float(%s)/1000)" + }, + "OutputsCurrent": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/curr2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_CURRENT_MIN, + "other": threshold.PSU_OUTPUT_CURRENT_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_CURRENT_MAX, + "other": threshold.PSU_OUTPUT_CURRENT_MAX, + }, + "Unit": Unit.Current, + "format": "float(float(%s)/1000)" + }, + "OutputsPower": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/power2_input", "way": "sysfs"}, + "Min": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_POWER_MIN, + "other": threshold.PSU_OUTPUT_POWER_MIN, + }, + "Max": { + "U1D-D10800-DRB": threshold.ASPOWER_DC_PSU_OUTPUT_POWER_MAX, + "other": threshold.PSU_OUTPUT_POWER_MAX, + }, + "Unit": Unit.Power, + "format": "float(float(%s)/1000000)" + }, + } + ], + "temps": [ + { + "name": "SWITCH_TEMP", + "temp_id": "TEMP1", + "api_name": "ASIC_TEMP", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/3-0044/hwmon/hwmon*/temp99_input", "way": "sysfs"}, + "Min": -30000, + "Low": 0, + "High": 105000, + "Max": 110000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "CPU_TEMP", + "temp_id": "TEMP2", + "Temperature": { + "value": {"loc": "/sys/bus/platform/devices/coretemp.0/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -15000, + "Low": 0, + "High": 100000, + "Max": 102000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "INLET_TEMP", + "temp_id": "TEMP3", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/3-004c/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -30000, + "Low": 0, + "High": 55000, + "Max": 60000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + }, + "fix_value": { + "fix_type": "config", + "addend": -3, + } + }, + { + "name": "OUTLET_TEMP", + "temp_id": "TEMP4", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/3-0048/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -30000, + "Low": 0, + "High": 75000, + "Max": 80000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "BOARD_TEMP", + "temp_id": "TEMP5", + "api_name": "MAC_OUT_TEMP", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/3-0049/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -30000, + "Low": 0, + "High": 75000, + "Max": 80000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "MAC_IN_TEMP", + "temp_id": "TEMP6", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/3-004a/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -30000, + "Low": 0, + "High": 75000, + "Max": 80000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "PSU1_TEMP", + "temp_id": "TEMP7", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-24/24-0058/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -20000, + "Low": 0, + "High": 55000, + "Max": 60000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "PSU2_TEMP", + "temp_id": "TEMP8", + "Temperature": { + "value": {"loc": "/sys/bus/i2c/devices/i2c-25/25-0058/hwmon/hwmon*/temp1_input", "way": "sysfs"}, + "Min": -20000, + "Low": 0, + "High": 55000, + "Max": 60000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + } + }, + { + "name": "SFF_TEMP", + "Temperature": { + "value": {"loc": "/tmp/highest_sff_temp", "way": "sysfs", "flock_path": "/tmp/highest_sff_temp"}, + "Min": -30000, + "Low": 0, + "High": 90000, + "Max": 100000, + "Unit": Unit.Temperature, + "format": "float(float(%s)/1000)" + }, + "invalid": -10000, + "error": -9999, + } + ], + "leds": [ + { + "name": "FRONT_SYS_LED", + "led_type": "SYS_LED", + "led": {"bus": 6, "addr": 0x0d, "offset": 0x72, "way": "i2c"}, + "led_attrs": { + "off": 0x00, "red_flash": 0x01, "red": 0x02, + "green_flash": 0x03, "green": 0x04, "amber_flash": 0x05, + "amber": 0x06, "mask": 0x07 + }, + }, + { + "name": "FRONT_PSU_LED", + "led_type": "PSU_LED", + "led": {"bus": 6, "addr": 0x0d, "offset": 0x73, "way": "i2c"}, + "led_attrs": { + "off": 0x10, "red_flash": 0x11, "red": 0x12, + "green_flash": 0x13, "green": 0x14, "amber_flash": 0x15, + "amber": 0x16, "mask": 0x17 + }, + }, + { + "name": "FRONT_FAN_LED", + "led_type": "FAN_LED", + "led": {"bus": 6, "addr": 0x0d, "offset": 0x74, "way": "i2c"}, + "led_attrs": { + "off": 0x10, "red_flash": 0x11, "red": 0x12, + "green_flash": 0x13, "green": 0x14, "amber_flash": 0x15, + "amber": 0x16, "mask": 0x17 + }, + }, + ], + "fans": [ + { + "name": "FAN1", + "airflow": fanairflow, + "e2loc": {'loc': '/sys/bus/i2c/devices/i2c-16/16-0050/eeprom', 'way': 'sysfs'}, + "present": {"loc": "/sys/wb_plat/fan/fan1/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "led": {"bus": 2, "addr": 0x0d, "offset": 0x3b, "way": "i2c"}, + "led_attrs": { + "off": 0x0b, "red_flash": 0x0e, "red": 0x0a, + "green_flash": 0x0d, "green": 0x09, "amber_flash": 0x07, + "amber": 0x03, "mask": 0x0f + }, + "PowerMax": 38.4, + "Rotor": { + "Rotor1_config": { + "name": "Rotor1", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x14, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan1/motor1/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan1/motor1/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan1/motor1/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.FRONT_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + "Rotor2_config": { + "name": "Rotor2", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x14, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan1/motor0/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan1/motor0/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.REAR_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan1/motor0/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.REAR_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + }, + }, + { + "name": "FAN2", + "airflow": fanairflow, + "e2loc": {'loc': '/sys/bus/i2c/devices/i2c-17/17-0050/eeprom', 'way': 'sysfs'}, + "present": {"loc": "/sys/wb_plat/fan/fan2/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "led": {"bus": 2, "addr": 0x0d, "offset": 0x3c, "way": "i2c"}, + "led_attrs": { + "off": 0x0b, "red_flash": 0x0e, "red": 0x0a, + "green_flash": 0x0d, "green": 0x09, "amber_flash": 0x07, + "amber": 0x03, "mask": 0x0f + }, + "PowerMax": 38.4, + "Rotor": { + "Rotor1_config": { + "name": "Rotor1", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x15, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan2/motor1/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan2/motor1/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan2/motor1/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.FRONT_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + "Rotor2_config": { + "name": "Rotor2", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x15, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan2/motor0/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan2/motor0/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.REAR_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan2/motor0/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.REAR_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + }, + }, + { + "name": "FAN3", + "airflow": fanairflow, + "e2loc": {'loc': '/sys/bus/i2c/devices/i2c-18/18-0050/eeprom', 'way': 'sysfs'}, + "present": {"loc": "/sys/wb_plat/fan/fan3/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "led": {"bus": 2, "addr": 0x0d, "offset": 0x3d, "way": "i2c"}, + "led_attrs": { + "off": 0x0b, "red_flash": 0x0e, "red": 0x0a, + "green_flash": 0x0d, "green": 0x09, "amber_flash": 0x07, + "amber": 0x03, "mask": 0x0f + }, + "PowerMax": 38.4, + "Rotor": { + "Rotor1_config": { + "name": "Rotor1", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x16, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan3/motor1/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan3/motor1/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan3/motor1/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.FRONT_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + "Rotor2_config": { + "name": "Rotor2", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x16, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan3/motor0/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan3/motor0/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.REAR_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan3/motor0/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.REAR_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + }, + }, + + { + "name": "FAN4", + "airflow": fanairflow, + "e2loc": {'loc': '/sys/bus/i2c/devices/i2c-19/19-0050/eeprom', 'way': 'sysfs'}, + "present": {"loc": "/sys/wb_plat/fan/fan4/present", "way": "sysfs", "mask": 0x01, "okval": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "led": {"bus": 2, "addr": 0x0d, "offset": 0x3e, "way": "i2c"}, + "led_attrs": { + "off": 0x0b, "red_flash": 0x0e, "red": 0x0a, + "green_flash": 0x0d, "green": 0x09, "amber_flash": 0x07, + "amber": 0x03, "mask": 0x0f + }, + "PowerMax": 38.4, + "Rotor": { + "Rotor1_config": { + "name": "Rotor1", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x17, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan4/motor1/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan4/motor1/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.FRONT_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan4/motor1/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.FRONT_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + "Rotor2_config": { + "name": "Rotor2", + "Set_speed": {"bus": 2, "addr": 0x0d, "offset": 0x17, "way": "i2c"}, + "Running": {"loc": "/sys/wb_plat/fan/fan4/motor0/status", "way": "sysfs", "mask": 0x01, "is_runing": 1}, + "HwAlarm": {"loc": "/sys/wb_plat/fan/fan4/motor0/status", "way": "sysfs", "mask": 0x01, "no_alarm": 1}, + "SpeedMin": threshold.FAN_SPEED_MIN, + "SpeedMax": threshold.REAR_FAN_SPEED_MAX, + "Speed": { + "value": {"loc": "/sys/wb_plat/fan/fan4/motor0/speed", "way": "sysfs"}, + "Min": threshold.FAN_SPEED_MIN, + "Max": threshold.REAR_FAN_SPEED_MAX, + "Unit": Unit.Speed, + }, + }, + }, + }, + + ], + "cplds": [ + { + "name": "CPU_CPLD", + "cpld_id": "CPLD1", + "VersionFile": {"loc": "/dev/cpld0", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for system power", + "slot": 0, + "warm": 0, + }, + { + "name": "CONNECT_CPLD", + "cpld_id": "CPLD2", + "VersionFile": {"loc": "/dev/cpld1", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for base functions", + "slot": 0, + "warm": 0, + }, + { + "name": "CONNECT_CPLD-FAN", + "cpld_id": "CPLD3", + "VersionFile": {"loc": "/dev/cpld2", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for fan modules", + "slot": 0, + "warm": 0, + }, + { + "name": "MAC_CPLD1", + "cpld_id": "CPLD4", + "VersionFile": {"loc": "/dev/cpld3", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for sff modules", + "slot": 0, + "warm": 0, + }, + { + "name": "MAC_CPLD2", + "cpld_id": "CPLD5", + "VersionFile": {"loc": "/dev/cpld4", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for sff modules", + "slot": 0, + "warm": 0, + }, + { + "name": "FPGA", + "cpld_id": "CPLD6", + "VersionFile": {"loc": "/dev/fpga0", "offset": 0, "len": 4, "way": "devfile_ascii"}, + "desc": "Used for base functions", + "slot": 0, + "format": "little_endian", + "warm": 0, + }, + { + "name": "BIOS", + "cpld_id": "CPLD7", + "VersionFile": {"cmd": "dmidecode -s bios-version", "way": "cmd"}, + "desc": "Performs initialization of hardware components during booting", + "slot": 0, + "type": "str", + "warm": 0, + }, + ], + "dcdc": [ + { + "name": "Switch_ZSFP1_3v3_C", + "dcdc_id": "DCDC1", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 22000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_QSFP1_3v3_C", + "dcdc_id": "DCDC2", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/curr3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 22000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_5v0_C", + "dcdc_id": "DCDC3", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 1000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_ZSFP1_3v3_V", + "dcdc_id": "DCDC4", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/in1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_QSFP1_3v3_V", + "dcdc_id": "DCDC5", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_5v0_V", + "dcdc_id": "DCDC6", + "Min": 4000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0040/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 6000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_1v2_C", + "dcdc_id": "DCDC7", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_3v3_C", + "dcdc_id": "DCDC8", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 1000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_Cpld_3v3_C", + "dcdc_id": "DCDC9", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/curr3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_1v2_V", + "dcdc_id": "DCDC10", + "Min": 960, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/in1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 1440, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_3v3_V", + "dcdc_id": "DCDC11", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_Cpld_3v3_V", + "dcdc_id": "DCDC12", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0041/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_1v2_C", + "dcdc_id": "DCDC13", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 1300, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_3v3_C", + "dcdc_id": "DCDC14", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2800, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_SSD_3v3_C", + "dcdc_id": "DCDC15", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/curr3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 4500, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_1v2_V", + "dcdc_id": "DCDC16", + "Min": 960, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/in1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 1440, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_3v3_V", + "dcdc_id": "DCDC17", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Con_SSD_3v3_V", + "dcdc_id": "DCDC18", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0042/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_3v3_C", + "dcdc_id": "DCDC19", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 4686, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_5v_C", + "dcdc_id": "DCDC20", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2200, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v7_C", + "dcdc_id": "DCDC21", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/curr3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2200, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_3v3_V", + "dcdc_id": "DCDC22", + "Min": 2640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/in1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 3960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_5v_V", + "dcdc_id": "DCDC23", + "Min": 4000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 6000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v7_V", + "dcdc_id": "DCDC24", + "Min": 1360, + "value": { + "loc": "/sys/bus/i2c/devices/7-0043/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 2040, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_CORE_C", + "dcdc_id": "DCDC25", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0060/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 47300, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v05_C", + "dcdc_id": "DCDC26", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0060/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 15400, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_CORE_V", + "dcdc_id": "DCDC27", + "Min": 1456, + "value": { + "loc": "/sys/bus/i2c/devices/7-0060/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 2184, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v05_V", + "dcdc_id": "DCDC28", + "Min": 840, + "value": { + "loc": "/sys/bus/i2c/devices/7-0060/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 1260, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_CORE_C", + "dcdc_id": "DCDC29", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0064/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 220000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_ANALOG_C", + "dcdc_id": "DCDC30", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-0064/hwmon/hwmon*/curr3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 18000, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_CORE_V", + "dcdc_id": "DCDC31", + "Min": 600, + "value": { + "loc": "/sys/bus/i2c/devices/7-0064/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 1200, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Switch_ANALOG_V", + "dcdc_id": "DCDC32", + "Min": 640, + "value": { + "loc": "/sys/bus/i2c/devices/7-0064/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 960, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v2_C", + "dcdc_id": "DCDC33", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-006c/hwmon/hwmon*/curr1_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 9900, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_2v23_C", + "dcdc_id": "DCDC34", + "Min": -1000, + "value": { + "loc": "/sys/bus/i2c/devices/7-006c/hwmon/hwmon*/curr2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "A", + "Max": 2200, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_1v2_V", + "dcdc_id": "DCDC35", + "Min": 960, + "value": { + "loc": "/sys/bus/i2c/devices/7-006c/hwmon/hwmon*/in2_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 1440, + "format": "float(float(%s)/1000)", + }, + + { + "name": "Cpu_2v23_V", + "dcdc_id": "DCDC36", + "Min": 1784, + "value": { + "loc": "/sys/bus/i2c/devices/7-006c/hwmon/hwmon*/in3_input", + "way": "sysfs", + }, + "read_times": 5, + "Unit": "V", + "Max": 2676, + "format": "float(float(%s)/1000)", + }, + ], + "cpu": [ + { + "name": "cpu", + "reboot_cause_path": "/etc/sonic/.reboot/.previous-reboot-cause.txt" + } + ], + "sfps": { + "ver": '1.0', + "port_index_start": 1, + "port_num": 56, + "log_level": 2, + "eeprom_retry_times": 5, + "eeprom_retry_break_sec": 0.2, + "presence_cpld": { + "dev_id": { + 3: { + "offset": { + 0x30: "1-8", + 0x31: "9-16", + 0x32: "17-24", + }, + }, + 4: { + "offset": { + 0x30: "25-32", + 0x31: "33-40", + 0x32: "41-48", + 0x33: "49-56", + }, + }, + }, + }, + "presence_val_is_present": 0, + "eeprom_path": "/sys/bus/i2c/devices/i2c-%d/%d-0050/eeprom", + "eeprom_path_key": list(range(32, 88)), + "optoe_driver_path": "/sys/bus/i2c/devices/i2c-%d/%d-0050/dev_class", + "optoe_driver_key": list(range(32, 88)), + "txdis_cpld": { + "dev_id": { + 3: { + "offset": { + 0x60: "1-8", + 0x61: "9-16", + 0x62: "17-24", + }, + }, + 4: { + "offset": { + 0x60: "25-32", + 0x61: "33-40", + 0x62: "41-48", + }, + }, + }, + }, + "txdisable_val_is_on": 0, + "reset_cpld": { + "dev_id": { + 4: { + "offset": { + 0xb9: "49-56", + }, + }, + }, + }, + "reset_val_is_reset": 0, + } +} diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_monitor.py b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_monitor.py new file mode 100755 index 000000000000..aab279a21da2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/hal-config/x86_64_micas_m2_w6510_48v8c_r0_monitor.py @@ -0,0 +1,206 @@ +# coding:utf-8 + + +monitor = { + "openloop": { + "linear": { + "name": "linear", + "flag": 0, + "pwm_min": 0x80, + "pwm_max": 0xff, + "K": 11, + "tin_min": 38, + }, + "curve": { + "name": "curve", + "flag": 0, + "pwm_min": 0x5a, + "pwm_max": 0xff, + "a": 0.086, + "b": 0.318, + "c": 28, + "tin_min": 25, + }, + }, + + "pid": { + "CPU_TEMP": { + "name": "CPU_TEMP", + "flag": 1, + "type": "duty", + "pwm_min": 0x80, + "pwm_max": 0xff, + "Kp": 3, + "Ki": 0.5, + "Kd": 0.5, + "target": 89, + "value": [None, None, None], + }, + "SWITCH_TEMP": { + "name": "SWITCH_TEMP", + "flag": 1, + "type": "duty", + "pwm_min": 0x80, + "pwm_max": 0xff, + "Kp": 3, + "Ki": 0.4, + "Kd": 0.4, + "target": 82, + "value": [None, None, None], + }, + "OUTLET_TEMP": { + "name": "OUTLET_TEMP", + "flag": 0, + "type": "duty", + "pwm_min": 0x80, + "pwm_max": 0xff, + "Kp": 2, + "Ki": 0.4, + "Kd": 0.3, + "target": 65, + "value": [None, None, None], + }, + "BOARD_TEMP": { + "name": "BOARD_TEMP", + "flag": 0, + "type": "duty", + "pwm_min": 0x80, + "pwm_max": 0xff, + "Kp": 2, + "Ki": 0.4, + "Kd": 0.3, + "target": 65, + "value": [None, None, None], + }, + "SFF_TEMP": { + "name": "SFF_TEMP", + "flag": 1, + "type": "duty", + "pwm_min": 0x80, + "pwm_max": 0xff, + "Kp": 0.1, + "Ki": 0.4, + "Kd": 0, + "target": 60, + "value": [None, None, None], + }, + }, + + "hyst": { + "INLET_TEMP": { + "name": "INLET_TEMP", + "flag": 1, + "type": "duty", + "hyst_min": 50, # duty + "hyst_max": 100, # duty + "last_hyst_value": 50, # duty + "temp_min": 23, + "temp_max": 40, + "value": [None, None], + "rising": { + 23: 50, + 24: 50, + 25: 50, + 26: 53, + 27: 56, + 28: 59, + 29: 62, + 30: 65, + 31: 68, + 32: 71, + 33: 74, + 34: 77, + 35: 80, + 36: 84, + 37: 88, + 38: 92, + 39: 96, + 40: 100, + }, + "descending": { + 23: 50, + 24: 53, + 25: 56, + 26: 59, + 27: 62, + 28: 65, + 29: 68, + 30: 71, + 31: 74, + 32: 77, + 33: 80, + 34: 84, + 35: 88, + 36: 92, + 37: 96, + 38: 100, + 39: 100, + 40: 100, + }, + } + }, + + "temps_threshold": { + "SWITCH_TEMP": {"name": "SWITCH_TEMP", "warning": 100, "critical": 105}, + "INLET_TEMP": {"name": "INLET_TEMP", "warning": 40, "critical": 50}, + "BOARD_TEMP": {"name": "BOARD_TEMP", "warning": 70, "critical": 80}, + "OUTLET_TEMP": {"name": "OUTLET_TEMP", "warning": 70, "critical": 80}, + "CPU_TEMP": {"name": "CPU_TEMP", "warning": 100, "critical": 102}, + "SFF_TEMP": {"name": "SFF_TEMP", "warning": 999, "critical": 1000, "ignore_threshold": 1, "invalid": -10000, "error": -9999}, + }, + + "fancontrol_para": { + "interval": 5, + "fan_air_flow_monitor": 1, + "psu_air_flow_monitor": 1, + "max_pwm": 0xff, + "min_pwm": 0x80, + "abnormal_pwm": 0xff, + "warning_pwm": 0xff, + "temp_invalid_pid_pwm": 0x80, + "temp_error_pid_pwm": 0x80, + "temp_fail_num": 3, + "check_temp_fail": [ + {"temp_name": "INLET_TEMP"}, + {"temp_name": "SWITCH_TEMP"}, + {"temp_name": "CPU_TEMP"}, + ], + "temp_warning_num": 3, # temp over warning 3 times continuously + "temp_critical_num": 3, # temp over critical 3 times continuously + "temp_warning_countdown": 60, # 5 min warning speed after not warning + "temp_critical_countdown": 60, # 5 min full speed after not critical + "rotor_error_count": 6, # fan rotor error 6 times continuously + "inlet_mac_diff": 999, + "check_crit_reboot_flag": 1, + "check_crit_reboot_num": 3, + "check_crit_sleep_time": 20, + "psu_absent_fullspeed_num": 0xFF, + "fan_absent_fullspeed_num": 1, + "rotor_error_fullspeed_num": 1, + }, + + "ledcontrol_para": { + "interval": 5, + "checkpsu": 0, # 0: sys led don't follow psu led + "checkfan": 0, # 0: sys led don't follow fan led + "psu_amber_num": 1, + "fan_amber_num": 1, + "board_sys_led": [ + {"led_name": "FRONT_SYS_LED"}, + ], + "board_psu_led": [ + {"led_name": "FRONT_PSU_LED"}, + ], + "board_fan_led": [ + {"led_name": "FRONT_FAN_LED"}, + ], + "psu_air_flow_monitor": 1, + "fan_air_flow_monitor": 1, + "psu_air_flow_amber_num": 1, + "fan_air_flow_amber_num": 1, + }, + "otp_reboot_judge_file": { + "otp_switch_reboot_judge_file": "/etc/.otp_switch_reboot_flag", + "otp_other_reboot_judge_file": "/etc/.otp_other_reboot_flag", + }, +} diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/Makefile b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/Makefile new file mode 100755 index 000000000000..5573a18f0fcc --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/Makefile @@ -0,0 +1,12 @@ +MAKEFILE_FILE_PATH = $(abspath $(lastword $(MAKEFILE_LIST))) +MODULES_DIR = $(abspath $(MAKEFILE_FILE_PATH)/../../../../common/modules) + +EXTRA_CFLAGS+= -I$(MODULES_DIR) +EXTRA_CFLAGS+= -I$(MODULES_DIR)/linux + +obj-m := wb_pcie_dev_device.o +obj-m += wb_i2c_mux_pca954x_device.o +obj-m += wb_i2c_ocores_device.o +obj-m += wb_lpc_drv_device.o +obj-m += wb_i2c_dev_device.o +obj-m += wb_io_dev_device.o diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_dev_device.c b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_dev_device.c new file mode 100644 index 000000000000..865e7afea44c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_dev_device.c @@ -0,0 +1,140 @@ +#include +#include +#include +#include +#include +#include + +#include + +static int g_wb_i2c_dev_device_debug = 0; +static int g_wb_i2c_dev_device_error = 0; + +module_param(g_wb_i2c_dev_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_i2c_dev_device_error, int, S_IRUGO | S_IWUSR); + +#define WB_I2C_DEV_DEVICE_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_wb_i2c_dev_device_debug) { \ + printk(KERN_INFO "[WB_I2C_DEV_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_I2C_DEV_DEVICE_DEBUG_ERROR(fmt, args...) do { \ + if (g_wb_i2c_dev_device_error) { \ + printk(KERN_ERR "[WB_I2C_DEV_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static i2c_dev_device_t i2c_dev_device_data0 = { + .i2c_bus = 2, + .i2c_addr = 0x0d, + .i2c_name = "cpld2", + .data_bus_width = 1, + .addr_bus_width = 1, + .per_rd_len = 256, + .per_wr_len = 256, + .i2c_len = 256, +}; + +static i2c_dev_device_t i2c_dev_device_data1 = { + .i2c_bus = 8, + .i2c_addr = 0x30, + .i2c_name = "cpld3", + .data_bus_width = 1, + .addr_bus_width = 1, + .per_rd_len = 256, + .per_wr_len = 256, + .i2c_len = 256, +}; + +static i2c_dev_device_t i2c_dev_device_data2 = { + .i2c_bus = 8, + .i2c_addr = 0x31, + .i2c_name = "cpld4", + .data_bus_width = 1, + .addr_bus_width = 1, + .per_rd_len = 256, + .per_wr_len = 256, + .i2c_len = 256, +}; + +static i2c_dev_device_t i2c_dev_device_data3 = { + .i2c_bus = 6, + .i2c_addr = 0x0d, + .i2c_name = "cpld5", + .data_bus_width = 1, + .addr_bus_width = 1, + .per_rd_len = 256, + .per_wr_len = 256, + .i2c_len = 256, +}; + +struct i2c_board_info i2c_dev_device_info[] = { + { + .type = "wb-i2c-dev", + .platform_data = &i2c_dev_device_data0, + }, + { + .type = "wb-i2c-dev", + .platform_data = &i2c_dev_device_data1, + }, + { + .type = "wb-i2c-dev", + .platform_data = &i2c_dev_device_data2, + }, + { + .type = "wb-i2c-dev", + .platform_data = &i2c_dev_device_data3, + }, +}; + +static int __init wb_i2c_dev_device_init(void) +{ + int i; + struct i2c_adapter *adap; + struct i2c_client *client; + i2c_dev_device_t *i2c_dev_device_data; + + WB_I2C_DEV_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = 0; i < ARRAY_SIZE(i2c_dev_device_info); i++) { + i2c_dev_device_data = i2c_dev_device_info[i].platform_data; + i2c_dev_device_info[i].addr = i2c_dev_device_data->i2c_addr; + adap = i2c_get_adapter(i2c_dev_device_data->i2c_bus); + if (adap == NULL) { + i2c_dev_device_data->client = NULL; + printk(KERN_ERR "get i2c bus %d adapter fail.\n", i2c_dev_device_data->i2c_bus); + continue; + } + client = i2c_new_client_device(adap, &i2c_dev_device_info[i]); + if (!client) { + i2c_dev_device_data->client = NULL; + printk(KERN_ERR "Failed to register i2c dev device %d at bus %d!\n", + i2c_dev_device_data->i2c_addr, i2c_dev_device_data->i2c_bus); + } else { + i2c_dev_device_data->client = client; + } + i2c_put_adapter(adap); + } + return 0; +} + +static void __exit wb_i2c_dev_device_exit(void) +{ + int i; + i2c_dev_device_t *i2c_dev_device_data; + + WB_I2C_DEV_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = ARRAY_SIZE(i2c_dev_device_info) - 1; i >= 0; i--) { + i2c_dev_device_data = i2c_dev_device_info[i].platform_data; + if (i2c_dev_device_data->client) { + i2c_unregister_device(i2c_dev_device_data->client); + i2c_dev_device_data->client = NULL; + } + } +} + +module_init(wb_i2c_dev_device_init); +module_exit(wb_i2c_dev_device_exit); +MODULE_DESCRIPTION("I2C DEV Devices"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_mux_pca954x_device.c b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_mux_pca954x_device.c new file mode 100644 index 000000000000..f12a71013451 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_mux_pca954x_device.c @@ -0,0 +1,296 @@ +#include +#include +#include +#include +#include +#include + +#include + +static int g_wb_i2c_mux_pca954x_device_debug = 0; +static int g_wb_i2c_mux_pca954x_device_error = 0; + +module_param(g_wb_i2c_mux_pca954x_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_i2c_mux_pca954x_device_error, int, S_IRUGO | S_IWUSR); + +#define WB_I2C_MUX_PCA954X_DEVICE_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_wb_i2c_mux_pca954x_device_debug) { \ + printk(KERN_INFO "[WB_I2C_MUX_PCA954X_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_I2C_MUX_PCA954X_DEVICE_DEBUG_ERROR(fmt, args...) do { \ + if (g_wb_i2c_mux_pca954x_device_error) { \ + printk(KERN_ERR "[WB_I2C_MUX_PCA954X_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static i2c_mux_pca954x_device_t i2c_mux_pca954x_device_data0 = { + .i2c_bus = 2, + .i2c_addr = 0x77, + .probe_disable = 1, + .select_chan_check = 0, + .close_chan_force_reset = 0, + .pca9548_base_nr = 16, + .pca9548_reset_type = PCA9548_RESET_FILE, + .rst_delay_b = 0, + .rst_delay = 1000, + .rst_delay_a = 1000, + .attr = { + .file_attr.dev_name = "/dev/cpld5", + .file_attr.offset = 0x60, + .file_attr.mask = 0x02, + .file_attr.reset_on = 0x00, + .file_attr.reset_off = 0x02, + }, +}; + +static i2c_mux_pca954x_device_t i2c_mux_pca954x_device_data1 = { + .i2c_bus = 4, + .i2c_addr = 0x77, + .probe_disable = 1, + .select_chan_check = 0, + .close_chan_force_reset = 0, + .pca9548_base_nr = 24, + .pca9548_reset_type = PCA9548_RESET_FILE, + .rst_delay_b = 0, + .rst_delay = 1000, + .rst_delay_a = 1000, + .attr = { + .file_attr.dev_name = "/dev/cpld5", + .file_attr.offset = 0x60, + .file_attr.mask = 0x01, + .file_attr.reset_on = 0x00, + .file_attr.reset_off = 0x01, + }, +}; + +static i2c_mux_pca954x_device_t i2c_mux_pca954x_device_data2 = { + .i2c_bus = 12, + .i2c_addr = 0x70, + .probe_disable = 1, + .select_chan_check = 0, + .close_chan_force_reset = 0, + .pca9548_base_nr = 32, + .pca9548_reset_type = PCA9548_RESET_FILE, + .rst_delay_b = 0, + .rst_delay = 1000, + .rst_delay_a = 1000, + .attr = { + .file_attr.dev_name = "/dev/fpga0", + .file_attr.offset = 0x20, + .file_attr.mask = 0x01, + .file_attr.reset_on = 0x00, + .file_attr.reset_off = 0x01, + }, +}; + +static i2c_mux_pca954x_device_t i2c_mux_pca954x_device_data3 = { + .i2c_bus = 12, + .i2c_addr = 0x71, + .probe_disable = 1, + .select_chan_check = 0, + .close_chan_force_reset = 0, + .pca9548_base_nr = 40, + .pca9548_reset_type = PCA9548_RESET_FILE, + .rst_delay_b = 0, + .rst_delay = 1000, + .rst_delay_a = 1000, + .attr = { + .file_attr.dev_name = "/dev/fpga0", + .file_attr.offset = 0x20, + .file_attr.mask = 0x01, + .file_attr.reset_on = 0x00, + .file_attr.reset_off = 0x01, + }, +}; + +static i2c_mux_pca954x_device_t i2c_mux_pca954x_device_data4 = { + .i2c_bus = 12, + .i2c_addr = 0x72, + .probe_disable = 1, + .select_chan_check = 0, + .close_chan_force_reset = 0, + .pca9548_base_nr = 48, + .pca9548_reset_type = PCA9548_RESET_FILE, + .rst_delay_b = 0, + .rst_delay = 1000, + .rst_delay_a = 1000, + .attr = { + .file_attr.dev_name = "/dev/fpga0", + .file_attr.offset = 0x20, + .file_attr.mask = 0x01, + .file_attr.reset_on = 0x00, + .file_attr.reset_off = 0x01, + }, +}; + +static i2c_mux_pca954x_device_t i2c_mux_pca954x_device_data5 = { + .i2c_bus = 12, + .i2c_addr = 0x73, + .probe_disable = 1, + .select_chan_check = 0, + .close_chan_force_reset = 0, + .pca9548_base_nr = 56, + .pca9548_reset_type = PCA9548_RESET_FILE, + .rst_delay_b = 0, + .rst_delay = 1000, + .rst_delay_a = 1000, + .attr = { + .file_attr.dev_name = "/dev/fpga0", + .file_attr.offset = 0x20, + .file_attr.mask = 0x01, + .file_attr.reset_on = 0x00, + .file_attr.reset_off = 0x01, + }, +}; + +static i2c_mux_pca954x_device_t i2c_mux_pca954x_device_data6 = { + .i2c_bus = 13, + .i2c_addr = 0x70, + .probe_disable = 1, + .select_chan_check = 0, + .close_chan_force_reset = 0, + .pca9548_base_nr = 64, + .pca9548_reset_type = PCA9548_RESET_FILE, + .rst_delay_b = 0, + .rst_delay = 1000, + .rst_delay_a = 1000, + .attr = { + .file_attr.dev_name = "/dev/fpga0", + .file_attr.offset = 0x20, + .file_attr.mask = 0x01, + .file_attr.reset_on = 0x00, + .file_attr.reset_off = 0x01, + }, +}; + +static i2c_mux_pca954x_device_t i2c_mux_pca954x_device_data7 = { + .i2c_bus = 13, + .i2c_addr = 0x71, + .probe_disable = 1, + .select_chan_check = 0, + .close_chan_force_reset = 0, + .pca9548_base_nr = 72, + .pca9548_reset_type = PCA9548_RESET_FILE, + .rst_delay_b = 0, + .rst_delay = 1000, + .rst_delay_a = 1000, + .attr = { + .file_attr.dev_name = "/dev/fpga0", + .file_attr.offset = 0x20, + .file_attr.mask = 0x01, + .file_attr.reset_on = 0x00, + .file_attr.reset_off = 0x01, + }, +}; + +static i2c_mux_pca954x_device_t i2c_mux_pca954x_device_data8 = { + .i2c_bus = 13, + .i2c_addr = 0x72, + .probe_disable = 1, + .select_chan_check = 0, + .close_chan_force_reset = 0, + .pca9548_base_nr = 80, + .pca9548_reset_type = PCA9548_RESET_FILE, + .rst_delay_b = 0, + .rst_delay = 1000, + .rst_delay_a = 1000, + .attr = { + .file_attr.dev_name = "/dev/fpga0", + .file_attr.offset = 0x20, + .file_attr.mask = 0x01, + .file_attr.reset_on = 0x00, + .file_attr.reset_off = 0x01, + }, +}; + +struct i2c_board_info i2c_mux_pca954x_device_info[] = { + { + .type = "wb_pca9548", + .platform_data = &i2c_mux_pca954x_device_data0, + }, + { + .type = "wb_pca9548", + .platform_data = &i2c_mux_pca954x_device_data1, + }, + { + .type = "wb_pca9548", + .platform_data = &i2c_mux_pca954x_device_data2, + }, + { + .type = "wb_pca9548", + .platform_data = &i2c_mux_pca954x_device_data3, + }, + { + .type = "wb_pca9548", + .platform_data = &i2c_mux_pca954x_device_data4, + }, + { + .type = "wb_pca9548", + .platform_data = &i2c_mux_pca954x_device_data5, + }, + { + .type = "wb_pca9548", + .platform_data = &i2c_mux_pca954x_device_data6, + }, + { + .type = "wb_pca9548", + .platform_data = &i2c_mux_pca954x_device_data7, + }, + { + .type = "wb_pca9548", + .platform_data = &i2c_mux_pca954x_device_data8, + }, +}; + +static int __init wb_i2c_mux_pca954x_device_init(void) +{ + int i; + struct i2c_adapter *adap; + struct i2c_client *client; + i2c_mux_pca954x_device_t *i2c_mux_pca954x_device_data; + + WB_I2C_MUX_PCA954X_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = 0; i < ARRAY_SIZE(i2c_mux_pca954x_device_info); i++) { + i2c_mux_pca954x_device_data = i2c_mux_pca954x_device_info[i].platform_data; + i2c_mux_pca954x_device_info[i].addr = i2c_mux_pca954x_device_data->i2c_addr; + adap = i2c_get_adapter(i2c_mux_pca954x_device_data->i2c_bus); + if (adap == NULL) { + i2c_mux_pca954x_device_data->client = NULL; + printk(KERN_ERR "get i2c bus %d adapter fail.\n", i2c_mux_pca954x_device_data->i2c_bus); + continue; + } + client = i2c_new_client_device(adap, &i2c_mux_pca954x_device_info[i]); + if (!client) { + i2c_mux_pca954x_device_data->client = NULL; + printk(KERN_ERR "Failed to register pca954x device %d at bus %d!\n", + i2c_mux_pca954x_device_data->i2c_addr, i2c_mux_pca954x_device_data->i2c_bus); + } else { + i2c_mux_pca954x_device_data->client = client; + } + i2c_put_adapter(adap); + } + return 0; +} + +static void __exit wb_i2c_mux_pca954x_device_exit(void) +{ + int i; + i2c_mux_pca954x_device_t *i2c_mux_pca954x_device_data; + + WB_I2C_MUX_PCA954X_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = ARRAY_SIZE(i2c_mux_pca954x_device_info) - 1; i >= 0; i--) { + i2c_mux_pca954x_device_data = i2c_mux_pca954x_device_info[i].platform_data; + if (i2c_mux_pca954x_device_data->client) { + i2c_unregister_device(i2c_mux_pca954x_device_data->client); + i2c_mux_pca954x_device_data->client = NULL; + } + } +} + +module_init(wb_i2c_mux_pca954x_device_init); +module_exit(wb_i2c_mux_pca954x_device_exit); +MODULE_DESCRIPTION("I2C MUX PCA954X Devices"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_ocores_device.c b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_ocores_device.c new file mode 100644 index 000000000000..ff7ba9d26fbc --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_i2c_ocores_device.c @@ -0,0 +1,423 @@ +#include +#include +#include +#include +#include + +#include + +static int g_wb_i2c_ocores_device_debug = 0; +static int g_wb_i2c_ocores_device_error = 0; + +module_param(g_wb_i2c_ocores_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_i2c_ocores_device_error, int, S_IRUGO | S_IWUSR); + +#define WB_I2C_OCORE_DEVICE_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_wb_i2c_ocores_device_debug) { \ + printk(KERN_INFO "[WB_I2C_OCORE_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_I2C_OCORE_DEVICE_DEBUG_ERROR(fmt, args...) do { \ + if (g_wb_i2c_ocores_device_error) { \ + printk(KERN_ERR "[WB_I2C_OCORE_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static i2c_ocores_device_t i2c_ocores_device_data0 = { + .adap_nr = 2, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x0800, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 0, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data1 = { + .adap_nr = 3, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x0820, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 1, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data2 = { + .adap_nr = 4, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x0840, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 2, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data3 = { + .adap_nr = 5, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x0860, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 3, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data4 = { + .adap_nr = 6, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x0880, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 4, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data5 = { + .adap_nr = 7, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x08a0, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 5, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data6 = { + .adap_nr = 8, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x08c0, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 6, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data7 = { + .adap_nr = 9, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x08e0, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 7, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data8 = { + .adap_nr = 10, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x0900, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 8, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data9 = { + .adap_nr = 11, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x0920, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 9, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data10 = { + .adap_nr = 12, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x0940, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 10, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data11 = { + .adap_nr = 13, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x0960, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 11, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data12 = { + .adap_nr = 14, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x0980, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 12, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static i2c_ocores_device_t i2c_ocores_device_data13 = { + .adap_nr = 15, + .big_endian = 0, + .dev_name = "/dev/fpga0", + .reg_access_mode = 3, + .dev_base = 0x09a0, + .reg_shift = 2, + .reg_io_width = 4, + .ip_clock_khz = 125000, + .bus_clock_khz = 100, + .irq_offset = 13, + .pci_domain = 0, + .pci_bus = 8, + .pci_slot = 0, + .pci_fn = 0, +}; + +static void wb_i2c_ocores_device_release(struct device *dev) +{ + return; +} + +static struct platform_device i2c_ocores_device[] = { + { + .name = "wb-ocores-i2c", + .id = 1, + .dev = { + .platform_data = &i2c_ocores_device_data0, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 2, + .dev = { + .platform_data = &i2c_ocores_device_data1, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 3, + .dev = { + .platform_data = &i2c_ocores_device_data2, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 4, + .dev = { + .platform_data = &i2c_ocores_device_data3, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 5, + .dev = { + .platform_data = &i2c_ocores_device_data4, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 6, + .dev = { + .platform_data = &i2c_ocores_device_data5, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 7, + .dev = { + .platform_data = &i2c_ocores_device_data6, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 8, + .dev = { + .platform_data = &i2c_ocores_device_data7, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 9, + .dev = { + .platform_data = &i2c_ocores_device_data8, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 10, + .dev = { + .platform_data = &i2c_ocores_device_data9, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 11, + .dev = { + .platform_data = &i2c_ocores_device_data10, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 12, + .dev = { + .platform_data = &i2c_ocores_device_data11, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 13, + .dev = { + .platform_data = &i2c_ocores_device_data12, + .release = wb_i2c_ocores_device_release, + }, + }, + { + .name = "wb-ocores-i2c", + .id = 14, + .dev = { + .platform_data = &i2c_ocores_device_data13, + .release = wb_i2c_ocores_device_release, + }, + }, +}; + +static int __init wb_i2c_ocores_device_init(void) +{ + int i; + int ret = 0; + i2c_ocores_device_t *i2c_ocores_device_data; + + WB_I2C_OCORE_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = 0; i < ARRAY_SIZE(i2c_ocores_device); i++) { + i2c_ocores_device_data = i2c_ocores_device[i].dev.platform_data; + ret = platform_device_register(&i2c_ocores_device[i]); + if (ret < 0) { + i2c_ocores_device_data->device_flag = -1; /* device register failed, set flag -1 */ + printk(KERN_ERR "wb-ocores-i2c.%d register failed!\n", i + 1); + } else { + i2c_ocores_device_data->device_flag = 0; /* device register suucess, set flag 0 */ + } + } + return 0; +} + +static void __exit wb_i2c_ocores_device_exit(void) +{ + int i; + i2c_ocores_device_t *i2c_ocores_device_data; + + WB_I2C_OCORE_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = ARRAY_SIZE(i2c_ocores_device) - 1; i >= 0; i--) { + i2c_ocores_device_data = i2c_ocores_device[i].dev.platform_data; + if (i2c_ocores_device_data->device_flag == 0) { /* device register success, need unregister */ + platform_device_unregister(&i2c_ocores_device[i]); + } + } +} + +module_init(wb_i2c_ocores_device_init); +module_exit(wb_i2c_ocores_device_exit); +MODULE_DESCRIPTION("I2C OCORES Devices"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_io_dev_device.c b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_io_dev_device.c new file mode 100644 index 000000000000..cc84938fff0e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_io_dev_device.c @@ -0,0 +1,103 @@ +#include +#include +#include +#include +#include + +#include + +static int g_wb_io_dev_device_debug = 0; +static int g_wb_io_dev_device_error = 0; + +module_param(g_wb_io_dev_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_io_dev_device_error, int, S_IRUGO | S_IWUSR); + +#define WB_IO_DEV_DEVICE_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_wb_io_dev_device_debug) { \ + printk(KERN_INFO "[WB_IO_DEV_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_IO_DEV_DEVICE_DEBUG_ERROR(fmt, args...) do { \ + if (g_wb_io_dev_device_error) { \ + printk(KERN_ERR "[WB_IO_DEV_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static io_dev_device_t io_dev_device_data0 = { + .io_dev_name = "cpld0", + .io_base = 0x700, + .io_len = 0x100, + .indirect_addr = 0, +}; + +static io_dev_device_t io_dev_device_data1 = { + .io_dev_name = "cpld1", + .io_base = 0x900, + .io_len = 0x100, + .indirect_addr = 0, +}; + +static void wb_io_dev_device_release(struct device *dev) +{ + return; +} + +static struct platform_device io_dev_device[] = { + { + .name = "wb-io-dev", + .id = 1, + .dev = { + .platform_data = &io_dev_device_data0, + .release = wb_io_dev_device_release, + }, + }, + { + .name = "wb-io-dev", + .id = 2, + .dev = { + .platform_data = &io_dev_device_data1, + .release = wb_io_dev_device_release, + }, + }, +}; + +static int __init wb_io_dev_device_init(void) +{ + int i; + int ret = 0; + io_dev_device_t *io_dev_device_data; + + WB_IO_DEV_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = 0; i < ARRAY_SIZE(io_dev_device); i++) { + io_dev_device_data = io_dev_device[i].dev.platform_data; + ret = platform_device_register(&io_dev_device[i]); + if (ret < 0) { + io_dev_device_data->device_flag = -1; /* device register failed, set flag -1 */ + printk(KERN_ERR "wb-io-dev.%d register failed!\n", i + 1); + } else { + io_dev_device_data->device_flag = 0; /* device register suucess, set flag 0 */ + } + } + return 0; +} + +static void __exit wb_io_dev_device_exit(void) +{ + int i; + io_dev_device_t *io_dev_device_data; + + WB_IO_DEV_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = ARRAY_SIZE(io_dev_device) - 1; i >= 0; i--) { + io_dev_device_data = io_dev_device[i].dev.platform_data; + if (io_dev_device_data->device_flag == 0) { /* device register success, need unregister */ + platform_device_unregister(&io_dev_device[i]); + } + } +} + +module_init(wb_io_dev_device_init); +module_exit(wb_io_dev_device_exit); +MODULE_DESCRIPTION("IO DEV Devices"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_lpc_drv_device.c b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_lpc_drv_device.c new file mode 100644 index 000000000000..9b6b61a51735 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_lpc_drv_device.c @@ -0,0 +1,130 @@ +#include +#include +#include +#include +#include + +#include + +static int g_wb_lpc_drv_device_debug = 0; +static int g_wb_lpc_drv_device_error = 0; + +module_param(g_wb_lpc_drv_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_lpc_drv_device_error, int, S_IRUGO | S_IWUSR); + +#define WB_LPC_DRV_DEVICE_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_wb_lpc_drv_device_debug) { \ + printk(KERN_INFO "[WB_LPC_DRV_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_LPC_DRV_DEVICE_DEBUG_ERROR(fmt, args...) do { \ + if (g_wb_lpc_drv_device_error) { \ + printk(KERN_ERR "[WB_LPC_DRV_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static lpc_drv_device_t lpc_drv_device_data_0 = { + .lpc_io_name = "wb_lpc", + .pci_domain = 0x0000, + .pci_bus = 0x00, + .pci_slot = 0x1f, + .pci_fn = 0, + .lpc_io_base = 0x700, + .lpc_io_size = 0x100, + .lpc_gen_dec = 0x84, +}; + +static lpc_drv_device_t lpc_drv_device_data_1 = { + .lpc_io_name = "wb_lpc", + .pci_domain = 0x0000, + .pci_bus = 0x00, + .pci_slot = 0x1f, + .pci_fn = 0, + .lpc_io_base = 0x900, + .lpc_io_size = 0x100, + .lpc_gen_dec = 0x88, +}; + +static lpc_drv_device_t lpc_drv_device_data_2 = { + .lpc_io_name = "wb_lpc", + .pci_domain = 0x0000, + .pci_bus = 0x00, + .pci_slot = 0x1f, + .pci_fn = 0, + .lpc_io_base = 0xb00, + .lpc_io_size = 0x100, + .lpc_gen_dec = 0x90, +}; + +static void wb_lpc_drv_device_release(struct device *dev) +{ + return; +} + +static struct platform_device lpc_drv_device[] = { + { + .name = "wb-lpc", + .id = 1, + .dev = { + .platform_data = &lpc_drv_device_data_0, + .release = wb_lpc_drv_device_release, + }, + }, + { + .name = "wb-lpc", + .id = 2, + .dev = { + .platform_data = &lpc_drv_device_data_1, + .release = wb_lpc_drv_device_release, + }, + }, + { + .name = "wb-lpc", + .id = 3, + .dev = { + .platform_data = &lpc_drv_device_data_2, + .release = wb_lpc_drv_device_release, + }, + }, +}; + +static int __init wb_lpc_drv_device_init(void) +{ + int i; + int ret = 0; + lpc_drv_device_t *lpc_drv_device_data; + + WB_LPC_DRV_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = 0; i < ARRAY_SIZE(lpc_drv_device); i++) { + lpc_drv_device_data = lpc_drv_device[i].dev.platform_data; + ret = platform_device_register(&lpc_drv_device[i]); + if (ret < 0) { + lpc_drv_device_data->device_flag = -1; /* device register failed, set flag -1 */ + printk(KERN_ERR "wb-lpc.%d register failed!\n", i + 1); + } else { + lpc_drv_device_data->device_flag = 0; /* device register suucess, set flag 0 */ + } + } + return 0; +} + +static void __exit wb_lpc_drv_device_exit(void) +{ + int i; + lpc_drv_device_t *lpc_drv_device_data; + + WB_LPC_DRV_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = ARRAY_SIZE(lpc_drv_device) - 1; i >= 0; i--) { + lpc_drv_device_data = lpc_drv_device[i].dev.platform_data; + if (lpc_drv_device_data->device_flag == 0) { /* device register success, need unregister */ + platform_device_unregister(&lpc_drv_device[i]); + } + } +} + +module_init(wb_lpc_drv_device_init); +module_exit(wb_lpc_drv_device_exit); +MODULE_DESCRIPTION("LPC DRV Devices"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_pcie_dev_device.c b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_pcie_dev_device.c new file mode 100644 index 000000000000..f79b29770d29 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/modules/driver/wb_pcie_dev_device.c @@ -0,0 +1,93 @@ +#include +#include +#include +#include +#include + +#include + +static int g_wb_pcie_dev_device_debug = 0; +static int g_wb_pcie_dev_device_error = 0; + +module_param(g_wb_pcie_dev_device_debug, int, S_IRUGO | S_IWUSR); +module_param(g_wb_pcie_dev_device_error, int, S_IRUGO | S_IWUSR); + +#define WB_PCIE_DEV_DEVICE_DEBUG_VERBOSE(fmt, args...) do { \ + if (g_wb_pcie_dev_device_debug) { \ + printk(KERN_INFO "[WB_PCIE_DEV_DEVICE][VER][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +#define WB_PCIE_DEV_DEVICE_DEBUG_ERROR(fmt, args...) do { \ + if (g_wb_pcie_dev_device_error) { \ + printk(KERN_ERR "[WB_PCIE_DEV_DEVICE][ERR][func:%s line:%d]\r\n"fmt, __func__, __LINE__, ## args); \ + } \ +} while (0) + +static pci_dev_device_t pcie_dev_device_data0 = { + .pci_dev_name = "fpga0", + .pci_domain = 0x0000, + .pci_bus = 0x08, + .pci_slot = 0x00, + .pci_fn = 0, + .pci_bar = 0, + .bus_width = 4, + .upg_ctrl_base = 0xa00, + .upg_flash_base = 0x1a0000, +}; + +static void wb_pcie_dev_device_release(struct device *dev) +{ + return; +} + +static struct platform_device pcie_dev_device[] = { + { + .name = "wb-pci-dev", + .id = 1, + .dev = { + .platform_data = &pcie_dev_device_data0, + .release = wb_pcie_dev_device_release, + }, + }, +}; + +static int __init wb_pcie_dev_device_init(void) +{ + int i; + int ret = 0; + pci_dev_device_t *pcie_dev_device_data; + + WB_PCIE_DEV_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = 0; i < ARRAY_SIZE(pcie_dev_device); i++) { + pcie_dev_device_data = pcie_dev_device[i].dev.platform_data; + ret = platform_device_register(&pcie_dev_device[i]); + if (ret < 0) { + pcie_dev_device_data->device_flag = -1; /* device register failed, set flag -1 */ + printk(KERN_ERR "wb-pci-dev.%d register failed!\n", i + 1); + } else { + pcie_dev_device_data->device_flag = 0; /* device register suucess, set flag 0 */ + } + } + return 0; +} + +static void __exit wb_pcie_dev_device_exit(void) +{ + int i; + pci_dev_device_t *pcie_dev_device_data; + + WB_PCIE_DEV_DEVICE_DEBUG_VERBOSE("enter!\n"); + for (i = ARRAY_SIZE(pcie_dev_device) - 1; i >= 0; i--) { + pcie_dev_device_data = pcie_dev_device[i].dev.platform_data; + if (pcie_dev_device_data->device_flag == 0) { /* device register success, need unregister */ + platform_device_unregister(&pcie_dev_device[i]); + } + } +} + +module_init(wb_pcie_dev_device_init); +module_exit(wb_pcie_dev_device_exit); +MODULE_DESCRIPTION("PCIE DEV Devices"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("support"); diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_CPLD.cfg b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_CPLD.cfg new file mode 100644 index 000000000000..98d1da1750c3 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_CPLD.cfg @@ -0,0 +1,41 @@ +# configuration item: I2C address of CPLD +# format: cpld_i2c_dev.bus_[cpld_slot]_[cpld_id] cpld_i2c_dev.addr_[cpld_slot]_[cpld_id] +# cpld_slot: Main card: 0, linear card: start from 1 +# cpld_id: start from 0 +# bus: I2C bus number of CPLD +# addr: I2C address of CPLD +cpld_i2c_dev.bus_0_2=2 +cpld_i2c_dev.addr_0_2=0x0d +cpld_i2c_dev.bus_0_3=8 +cpld_i2c_dev.addr_0_3=0x30 +cpld_i2c_dev.bus_0_4=8 +cpld_i2c_dev.addr_0_4=0x31 +cpld_i2c_dev.bus_0_5=6 +cpld_i2c_dev.addr_0_5=0x0d + + +# configuration item: LPC address of CPLD +# format: cpld_lpc_addr_[cpld_slot]_[cpld_id] +# cpld_slot: Main card: 0, linear card: start from 1 +# cpld_id: start from 0 +cpld_lpc_dev_0_0=0x700 +cpld_lpc_dev_0_1=0x900 + + +# configuration item: CPLD access method, lpc or i2c +# format: mode_cpld_[cpld_slot][cpld_slot]=lpc/i2c +# cpld_slot: Main card: 0, linear card: start from 1 +# cpld_id: start from 0 +mode_cpld_0_0=lpc +mode_cpld_0_1=lpc +mode_cpld_0_2=i2c +mode_cpld_0_3=i2c +mode_cpld_0_4=i2c +mode_cpld_0_5=i2c + + +# configuration item: the number of CPLD +# format: dev_num_[main_dev]_[minor_dev] +# main_dev: CPLD main_dev is 4 +# minor_dev: CPLD minor_dev not exist +dev_num_4_0=6 diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_FAN.cfg b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_FAN.cfg new file mode 100644 index 000000000000..2350b74eb8bc --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_FAN.cfg @@ -0,0 +1,304 @@ +# configuration item: the number of fans +# format: dev_num_[main_dev]_[minor_dev] +# main_dev: fan main_dev is 1 +# minor_dev: fan minor_dev not exist(0) +dev_num_1_0=4 + + +# configuration item: the number of rotors +# format: dev_num_[main_dev]_[minor_dev] +# main_dev: rotor main_dev is 1 +# minor_dev: rotor minor_dev is 5 +dev_num_1_5=2 + + +# configuration item: fan presence status +# format: dev_present_status_[main_dev_id][fan_index] +# main_dev_id: fan main_dev_id is 1 +# fan_index: start from 1 +dev_present_status.mode_1_1=config +dev_present_status.src_1_1=cpld +dev_present_status.frmt_1_1=bit +dev_present_status.pola_1_1=negative +dev_present_status.addr_1_1=0x00020030 +dev_present_status.len_1_1=1 +dev_present_status.bit_offset_1_1=0 + +dev_present_status.mode_1_2=config +dev_present_status.src_1_2=cpld +dev_present_status.frmt_1_2=bit +dev_present_status.pola_1_2=negative +dev_present_status.addr_1_2=0x00020030 +dev_present_status.len_1_2=1 +dev_present_status.bit_offset_1_2=1 + +dev_present_status.mode_1_3=config +dev_present_status.src_1_3=cpld +dev_present_status.frmt_1_3=bit +dev_present_status.pola_1_3=negative +dev_present_status.addr_1_3=0x00020030 +dev_present_status.len_1_3=1 +dev_present_status.bit_offset_1_3=2 + +dev_present_status.mode_1_4=config +dev_present_status.src_1_4=cpld +dev_present_status.frmt_1_4=bit +dev_present_status.pola_1_4=negative +dev_present_status.addr_1_4=0x00020030 +dev_present_status.len_1_4=1 +dev_present_status.bit_offset_1_4=3 + + +# configuration item: fan rotor status +# format: fan_roll_status_[fan_id]_[motor_id] +# fan_id: start from 1 +# motor_id: start from 0 +fan_roll_status.mode_1_0=config +fan_roll_status.int_cons_1_0= +fan_roll_status.src_1_0=cpld +fan_roll_status.frmt_1_0=bit +fan_roll_status.pola_1_0=positive +fan_roll_status.fpath_1_0= +fan_roll_status.addr_1_0=0x00020031 +fan_roll_status.len_1_0=1 +fan_roll_status.bit_offset_1_0=0 + +fan_roll_status.mode_1_1=config +fan_roll_status.int_cons_1_1= +fan_roll_status.src_1_1=cpld +fan_roll_status.frmt_1_1=bit +fan_roll_status.pola_1_1=positive +fan_roll_status.fpath_1_1= +fan_roll_status.addr_1_1=0x00020034 +fan_roll_status.len_1_1=1 +fan_roll_status.bit_offset_1_1=0 + +fan_roll_status.mode_2_0=config +fan_roll_status.int_cons_2_0= +fan_roll_status.src_2_0=cpld +fan_roll_status.frmt_2_0=bit +fan_roll_status.pola_2_0=positive +fan_roll_status.fpath_2_0= +fan_roll_status.addr_2_0=0x00020031 +fan_roll_status.len_2_0=1 +fan_roll_status.bit_offset_2_0=1 + +fan_roll_status.mode_2_1=config +fan_roll_status.int_cons_2_1= +fan_roll_status.src_2_1=cpld +fan_roll_status.frmt_2_1=bit +fan_roll_status.pola_2_1=positive +fan_roll_status.fpath_2_1= +fan_roll_status.addr_2_1=0x00020034 +fan_roll_status.len_2_1=1 +fan_roll_status.bit_offset_2_1=1 + +fan_roll_status.mode_3_0=config +fan_roll_status.int_cons_3_0= +fan_roll_status.src_3_0=cpld +fan_roll_status.frmt_3_0=bit +fan_roll_status.pola_3_0=positive +fan_roll_status.fpath_3_0= +fan_roll_status.addr_3_0=0x00020031 +fan_roll_status.len_3_0=1 +fan_roll_status.bit_offset_3_0=2 + +fan_roll_status.mode_3_1=config +fan_roll_status.int_cons_3_1= +fan_roll_status.src_3_1=cpld +fan_roll_status.frmt_3_1=bit +fan_roll_status.pola_3_1=positive +fan_roll_status.fpath_3_1= +fan_roll_status.addr_3_1=0x00020034 +fan_roll_status.len_3_1=1 +fan_roll_status.bit_offset_3_1=2 + +fan_roll_status.mode_4_0=config +fan_roll_status.int_cons_4_0= +fan_roll_status.src_4_0=cpld +fan_roll_status.frmt_4_0=bit +fan_roll_status.pola_4_0=positive +fan_roll_status.fpath_4_0= +fan_roll_status.addr_4_0=0x00020031 +fan_roll_status.len_4_0=1 +fan_roll_status.bit_offset_4_0=3 + +fan_roll_status.mode_4_1=config +fan_roll_status.int_cons_4_1= +fan_roll_status.src_4_1=cpld +fan_roll_status.frmt_4_1=bit +fan_roll_status.pola_4_1=positive +fan_roll_status.fpath_4_1= +fan_roll_status.addr_4_1=0x00020034 +fan_roll_status.len_4_1=1 +fan_roll_status.bit_offset_4_1=3 + + +# configuration item: fan speed +# format: fan_speed_[fan_id]_[motor_id] +# fan_id: start from 1 +# motor_id: start from 0 +fan_speed.mode_1_0=config +fan_speed.int_cons_1_0= +fan_speed.src_1_0=cpld +fan_speed.frmt_1_0=num_bytes +fan_speed.pola_1_0=negative +fan_speed.fpath_1_0= +fan_speed.addr_1_0=0x0002001b +fan_speed.len_1_0=2 +fan_speed.bit_offset_1_0= + +fan_speed.mode_1_1=config +fan_speed.int_cons_1_1= +fan_speed.src_1_1=cpld +fan_speed.frmt_1_1=num_bytes +fan_speed.pola_1_1=negative +fan_speed.fpath_1_1= +fan_speed.addr_1_1=0x00020025 +fan_speed.len_1_1=2 +fan_speed.bit_offset_1_1= + +fan_speed.mode_2_0=config +fan_speed.int_cons_2_0= +fan_speed.src_2_0=cpld +fan_speed.frmt_2_0=num_bytes +fan_speed.pola_2_0=negative +fan_speed.fpath_2_0= +fan_speed.addr_2_0=0x0002001d +fan_speed.len_2_0=2 +fan_speed.bit_offset_2_0= + +fan_speed.mode_2_1=config +fan_speed.int_cons_2_1= +fan_speed.src_2_1=cpld +fan_speed.frmt_2_1=num_bytes +fan_speed.pola_2_1=negative +fan_speed.fpath_2_1= +fan_speed.addr_2_1=0x00020027 +fan_speed.len_2_1=2 +fan_speed.bit_offset_2_1= + +fan_speed.mode_3_0=config +fan_speed.int_cons_3_0= +fan_speed.src_3_0=cpld +fan_speed.frmt_3_0=num_bytes +fan_speed.pola_3_0=negative +fan_speed.fpath_3_0= +fan_speed.addr_3_0=0x0002001f +fan_speed.len_3_0=2 +fan_speed.bit_offset_3_0= + +fan_speed.mode_3_1=config +fan_speed.int_cons_3_1= +fan_speed.src_3_1=cpld +fan_speed.frmt_3_1=num_bytes +fan_speed.pola_3_1=negative +fan_speed.fpath_3_1= +fan_speed.addr_3_1=0x00020029 +fan_speed.len_3_1=2 +fan_speed.bit_offset_3_1= + +fan_speed.mode_4_0=config +fan_speed.int_cons_4_0= +fan_speed.src_4_0=cpld +fan_speed.frmt_4_0=num_bytes +fan_speed.pola_4_0=negative +fan_speed.fpath_4_0= +fan_speed.addr_4_0=0x00020021 +fan_speed.len_4_0=2 +fan_speed.bit_offset_4_0= + +fan_speed.mode_4_1=config +fan_speed.int_cons_4_1= +fan_speed.src_4_1=cpld +fan_speed.frmt_4_1=num_bytes +fan_speed.pola_4_1=negative +fan_speed.fpath_4_1= +fan_speed.addr_4_1=0x0002002b +fan_speed.len_4_1=2 +fan_speed.bit_offset_4_1= + + +# configuration item: fan pwm +# format: fan_ratio_[fan_id]_[motor_id] +# fan_id: start from 1 +# motor_id: start from 0 +fan_ratio.mode_1_0=config +fan_ratio.int_cons_1_0= +fan_ratio.src_1_0=cpld +fan_ratio.frmt_1_0=byte +fan_ratio.pola_1_0= +fan_ratio.fpath_1_0= +fan_ratio.addr_1_0=0x00020014 +fan_ratio.len_1_0=1 +fan_ratio.bit_offset_1_0= + +fan_ratio.mode_1_1=config +fan_ratio.int_cons_1_1= +fan_ratio.src_1_1=cpld +fan_ratio.frmt_1_1=byte +fan_ratio.pola_1_1= +fan_ratio.fpath_1_1= +fan_ratio.addr_1_1=0x00020014 +fan_ratio.len_1_1=1 +fan_ratio.bit_offset_1_1= + +fan_ratio.mode_2_0=config +fan_ratio.int_cons_2_0= +fan_ratio.src_2_0=cpld +fan_ratio.frmt_2_0=byte +fan_ratio.pola_2_0= +fan_ratio.fpath_2_0= +fan_ratio.addr_2_0=0x00020015 +fan_ratio.len_2_0=1 +fan_ratio.bit_offset_2_0= + +fan_ratio.mode_2_1=config +fan_ratio.int_cons_2_1= +fan_ratio.src_2_1=cpld +fan_ratio.frmt_2_1=byte +fan_ratio.pola_2_1= +fan_ratio.fpath_2_1= +fan_ratio.addr_2_1=0x00020015 +fan_ratio.len_2_1=1 +fan_ratio.bit_offset_2_1= + +fan_ratio.mode_3_0=config +fan_ratio.int_cons_3_0= +fan_ratio.src_3_0=cpld +fan_ratio.frmt_3_0=byte +fan_ratio.pola_3_0= +fan_ratio.fpath_3_0= +fan_ratio.addr_3_0=0x00020016 +fan_ratio.len_3_0=1 +fan_ratio.bit_offset_3_0= + +fan_ratio.mode_3_1=config +fan_ratio.int_cons_3_1= +fan_ratio.src_3_1=cpld +fan_ratio.frmt_3_1=byte +fan_ratio.pola_3_1= +fan_ratio.fpath_3_1= +fan_ratio.addr_3_1=0x00020016 +fan_ratio.len_3_1=1 +fan_ratio.bit_offset_3_1= + +fan_ratio.mode_4_0=config +fan_ratio.int_cons_4_0= +fan_ratio.src_4_0=cpld +fan_ratio.frmt_4_0=byte +fan_ratio.pola_4_0= +fan_ratio.fpath_4_0= +fan_ratio.addr_4_0=0x00020017 +fan_ratio.len_4_0=1 +fan_ratio.bit_offset_4_0= + +fan_ratio.mode_4_1=config +fan_ratio.int_cons_4_1= +fan_ratio.src_4_1=cpld +fan_ratio.frmt_4_1=byte +fan_ratio.pola_4_1= +fan_ratio.fpath_4_1= +fan_ratio.addr_4_1=0x00020017 +fan_ratio.len_4_1=1 +fan_ratio.bit_offset_4_1= diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_PSU.cfg b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_PSU.cfg new file mode 100644 index 000000000000..082ef20fe97f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_PSU.cfg @@ -0,0 +1,64 @@ +# configuration item: the number of psus +# format: dev_num_[main_dev]_[minor_dev] +# main_dev: psu main_dev is 2 +# minor_dev: psu minor_dev not exist(0) +dev_num_2_0=2 + + +# configuration item: psu status +# format: psu_status_[psu_index]_[status_id] +# psu_index: start from 1 +# status_id: 0: presence 1: output 2: alert +# psu1 presence status +psu_status.mode_1_0=config +psu_status.src_1_0=cpld +psu_status.frmt_1_0=bit +psu_status.pola_1_0=negative +psu_status.addr_1_0=0x00050051 +psu_status.len_1_0=1 +psu_status.bit_offset_1_0=0 + +# psu1 output status +psu_status.mode_1_1=config +psu_status.src_1_1=cpld +psu_status.frmt_1_1=bit +psu_status.pola_1_1=positive +psu_status.addr_1_1=0x00050051 +psu_status.len_1_1=1 +psu_status.bit_offset_1_1=1 + +# psu1 alert status +psu_status.mode_1_2=config +psu_status.src_1_2=cpld +psu_status.frmt_1_2=bit +psu_status.pola_1_2=negative +psu_status.addr_1_2=0x00050051 +psu_status.len_1_2=1 +psu_status.bit_offset_1_2=2 + +# psu2 presence status +psu_status.mode_2_0=config +psu_status.src_2_0=cpld +psu_status.frmt_2_0=bit +psu_status.pola_2_0=negative +psu_status.addr_2_0=0x00050051 +psu_status.len_2_0=1 +psu_status.bit_offset_2_0=4 + +# psu2 output status +psu_status.mode_2_1=config +psu_status.src_2_1=cpld +psu_status.frmt_2_1=bit +psu_status.pola_2_1=positive +psu_status.addr_2_1=0x00050051 +psu_status.len_2_1=1 +psu_status.bit_offset_2_1=5 + +# psu2 alert status +psu_status.mode_2_2=config +psu_status.src_2_2=cpld +psu_status.frmt_2_2=bit +psu_status.pola_2_2=negative +psu_status.addr_2_2=0x00050051 +psu_status.len_2_2=1 +psu_status.bit_offset_2_2=6 diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_SFF.cfg b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_SFF.cfg new file mode 100644 index 000000000000..7f57dfd93c5b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/WB_PLAT_SFF.cfg @@ -0,0 +1,521 @@ +# configuration item: the number of sffs +# format: dev_num_[main_dev]_[minor_dev] +# main_dev: sff main_dev is 3 +# minor_dev: sff minor_dev not exist(0) +dev_num_3_0=56 + +# configuration item: The directory name of sff sysfs +# format: sff_dir_name_[sff_index] +# sff_index: start from 1 +sff_dir_name_1 =sff1 +sff_dir_name_2 =sff2 +sff_dir_name_3 =sff3 +sff_dir_name_4 =sff4 +sff_dir_name_5 =sff5 +sff_dir_name_6 =sff6 +sff_dir_name_7 =sff7 +sff_dir_name_8 =sff8 +sff_dir_name_9 =sff9 +sff_dir_name_10 =sff10 +sff_dir_name_11 =sff11 +sff_dir_name_12 =sff12 +sff_dir_name_13 =sff13 +sff_dir_name_14 =sff14 +sff_dir_name_15 =sff15 +sff_dir_name_16 =sff16 +sff_dir_name_17 =sff17 +sff_dir_name_18 =sff18 +sff_dir_name_19 =sff19 +sff_dir_name_20 =sff20 +sff_dir_name_21 =sff21 +sff_dir_name_22 =sff22 +sff_dir_name_23 =sff23 +sff_dir_name_24 =sff24 +sff_dir_name_25 =sff25 +sff_dir_name_26 =sff26 +sff_dir_name_27 =sff27 +sff_dir_name_28 =sff28 +sff_dir_name_29 =sff29 +sff_dir_name_30 =sff30 +sff_dir_name_31 =sff31 +sff_dir_name_32 =sff32 +sff_dir_name_33 =sff33 +sff_dir_name_34 =sff34 +sff_dir_name_35 =sff35 +sff_dir_name_36 =sff36 +sff_dir_name_37 =sff37 +sff_dir_name_38 =sff38 +sff_dir_name_39 =sff39 +sff_dir_name_40 =sff40 +sff_dir_name_41 =sff41 +sff_dir_name_42 =sff42 +sff_dir_name_43 =sff43 +sff_dir_name_44 =sff44 +sff_dir_name_45 =sff45 +sff_dir_name_46 =sff46 +sff_dir_name_47 =sff47 +sff_dir_name_48 =sff48 +sff_dir_name_49 =sff49 +sff_dir_name_50 =sff50 +sff_dir_name_51 =sff51 +sff_dir_name_52 =sff52 +sff_dir_name_53 =sff53 +sff_dir_name_54 =sff54 +sff_dir_name_55 =sff55 +sff_dir_name_56 =sff56 + + +# configuration item: sff cpld register status +# format: sff_cpld_reg_[sff_index]_[cpld_reg] +# sff_index: start from 1 +# cpld_reg: 1: power_on, 2: tx_fault, 3: tx_dis, 4:pre_n, 5:rx_los +# 6: reset, 7: lpmode, 8: module_present, 9: interrupt + +# sff cpld presence status +sff_cpld_reg.mode_1_8=config +sff_cpld_reg.src_1_8=cpld +sff_cpld_reg.frmt_1_8=bit +sff_cpld_reg.pola_1_8=negative +sff_cpld_reg.addr_1_8=0x00030030 +sff_cpld_reg.len_1_8=1 +sff_cpld_reg.bit_offset_1_8=0 + +sff_cpld_reg.mode_2_8=config +sff_cpld_reg.src_2_8=cpld +sff_cpld_reg.frmt_2_8=bit +sff_cpld_reg.pola_2_8=negative +sff_cpld_reg.addr_2_8=0x00030030 +sff_cpld_reg.len_2_8=1 +sff_cpld_reg.bit_offset_2_8=1 + +sff_cpld_reg.mode_3_8=config +sff_cpld_reg.src_3_8=cpld +sff_cpld_reg.frmt_3_8=bit +sff_cpld_reg.pola_3_8=negative +sff_cpld_reg.addr_3_8=0x00030030 +sff_cpld_reg.len_3_8=1 +sff_cpld_reg.bit_offset_3_8=2 + +sff_cpld_reg.mode_4_8=config +sff_cpld_reg.src_4_8=cpld +sff_cpld_reg.frmt_4_8=bit +sff_cpld_reg.pola_4_8=negative +sff_cpld_reg.addr_4_8=0x00030030 +sff_cpld_reg.len_4_8=1 +sff_cpld_reg.bit_offset_4_8=3 + +sff_cpld_reg.mode_5_8=config +sff_cpld_reg.src_5_8=cpld +sff_cpld_reg.frmt_5_8=bit +sff_cpld_reg.pola_5_8=negative +sff_cpld_reg.addr_5_8=0x00030030 +sff_cpld_reg.len_5_8=1 +sff_cpld_reg.bit_offset_5_8=4 + +sff_cpld_reg.mode_6_8=config +sff_cpld_reg.src_6_8=cpld +sff_cpld_reg.frmt_6_8=bit +sff_cpld_reg.pola_6_8=negative +sff_cpld_reg.addr_6_8=0x00030030 +sff_cpld_reg.len_6_8=1 +sff_cpld_reg.bit_offset_6_8=5 + +sff_cpld_reg.mode_7_8=config +sff_cpld_reg.src_7_8=cpld +sff_cpld_reg.frmt_7_8=bit +sff_cpld_reg.pola_7_8=negative +sff_cpld_reg.addr_7_8=0x00030030 +sff_cpld_reg.len_7_8=1 +sff_cpld_reg.bit_offset_7_8=6 + +sff_cpld_reg.mode_8_8=config +sff_cpld_reg.src_8_8=cpld +sff_cpld_reg.frmt_8_8=bit +sff_cpld_reg.pola_8_8=negative +sff_cpld_reg.addr_8_8=0x00030030 +sff_cpld_reg.len_8_8=1 +sff_cpld_reg.bit_offset_8_8=7 + +sff_cpld_reg.mode_9_8=config +sff_cpld_reg.src_9_8=cpld +sff_cpld_reg.frmt_9_8=bit +sff_cpld_reg.pola_9_8=negative +sff_cpld_reg.addr_9_8=0x00030031 +sff_cpld_reg.len_9_8=1 +sff_cpld_reg.bit_offset_9_8=0 + +sff_cpld_reg.mode_10_8=config +sff_cpld_reg.src_10_8=cpld +sff_cpld_reg.frmt_10_8=bit +sff_cpld_reg.pola_10_8=negative +sff_cpld_reg.addr_10_8=0x00030031 +sff_cpld_reg.len_10_8=1 +sff_cpld_reg.bit_offset_10_8=1 + +sff_cpld_reg.mode_11_8=config +sff_cpld_reg.src_11_8=cpld +sff_cpld_reg.frmt_11_8=bit +sff_cpld_reg.pola_11_8=negative +sff_cpld_reg.addr_11_8=0x00030031 +sff_cpld_reg.len_11_8=1 +sff_cpld_reg.bit_offset_11_8=2 + +sff_cpld_reg.mode_12_8=config +sff_cpld_reg.src_12_8=cpld +sff_cpld_reg.frmt_12_8=bit +sff_cpld_reg.pola_12_8=negative +sff_cpld_reg.addr_12_8=0x00030031 +sff_cpld_reg.len_12_8=1 +sff_cpld_reg.bit_offset_12_8=3 + +sff_cpld_reg.mode_13_8=config +sff_cpld_reg.src_13_8=cpld +sff_cpld_reg.frmt_13_8=bit +sff_cpld_reg.pola_13_8=negative +sff_cpld_reg.addr_13_8=0x00030031 +sff_cpld_reg.len_13_8=1 +sff_cpld_reg.bit_offset_13_8=4 + +sff_cpld_reg.mode_14_8=config +sff_cpld_reg.src_14_8=cpld +sff_cpld_reg.frmt_14_8=bit +sff_cpld_reg.pola_14_8=negative +sff_cpld_reg.addr_14_8=0x00030031 +sff_cpld_reg.len_14_8=1 +sff_cpld_reg.bit_offset_14_8=5 + +sff_cpld_reg.mode_15_8=config +sff_cpld_reg.src_15_8=cpld +sff_cpld_reg.frmt_15_8=bit +sff_cpld_reg.pola_15_8=negative +sff_cpld_reg.addr_15_8=0x00030031 +sff_cpld_reg.len_15_8=1 +sff_cpld_reg.bit_offset_15_8=6 + +sff_cpld_reg.mode_16_8=config +sff_cpld_reg.src_16_8=cpld +sff_cpld_reg.frmt_16_8=bit +sff_cpld_reg.pola_16_8=negative +sff_cpld_reg.addr_16_8=0x00030031 +sff_cpld_reg.len_16_8=1 +sff_cpld_reg.bit_offset_16_8=7 + +sff_cpld_reg.mode_17_8=config +sff_cpld_reg.src_17_8=cpld +sff_cpld_reg.frmt_17_8=bit +sff_cpld_reg.pola_17_8=negative +sff_cpld_reg.addr_17_8=0x00030032 +sff_cpld_reg.len_17_8=1 +sff_cpld_reg.bit_offset_17_8=0 + +sff_cpld_reg.mode_18_8=config +sff_cpld_reg.src_18_8=cpld +sff_cpld_reg.frmt_18_8=bit +sff_cpld_reg.pola_18_8=negative +sff_cpld_reg.addr_18_8=0x00030032 +sff_cpld_reg.len_18_8=1 +sff_cpld_reg.bit_offset_18_8=1 + +sff_cpld_reg.mode_19_8=config +sff_cpld_reg.src_19_8=cpld +sff_cpld_reg.frmt_19_8=bit +sff_cpld_reg.pola_19_8=negative +sff_cpld_reg.addr_19_8=0x00030032 +sff_cpld_reg.len_19_8=1 +sff_cpld_reg.bit_offset_19_8=2 + +sff_cpld_reg.mode_20_8=config +sff_cpld_reg.src_20_8=cpld +sff_cpld_reg.frmt_20_8=bit +sff_cpld_reg.pola_20_8=negative +sff_cpld_reg.addr_20_8=0x00030032 +sff_cpld_reg.len_20_8=1 +sff_cpld_reg.bit_offset_20_8=3 + +sff_cpld_reg.mode_21_8=config +sff_cpld_reg.src_21_8=cpld +sff_cpld_reg.frmt_21_8=bit +sff_cpld_reg.pola_21_8=negative +sff_cpld_reg.addr_21_8=0x00030032 +sff_cpld_reg.len_21_8=1 +sff_cpld_reg.bit_offset_21_8=4 + +sff_cpld_reg.mode_22_8=config +sff_cpld_reg.src_22_8=cpld +sff_cpld_reg.frmt_22_8=bit +sff_cpld_reg.pola_22_8=negative +sff_cpld_reg.addr_22_8=0x00030032 +sff_cpld_reg.len_22_8=1 +sff_cpld_reg.bit_offset_22_8=5 + +sff_cpld_reg.mode_23_8=config +sff_cpld_reg.src_23_8=cpld +sff_cpld_reg.frmt_23_8=bit +sff_cpld_reg.pola_23_8=negative +sff_cpld_reg.addr_23_8=0x00030032 +sff_cpld_reg.len_23_8=1 +sff_cpld_reg.bit_offset_23_8=6 + +sff_cpld_reg.mode_24_8=config +sff_cpld_reg.src_24_8=cpld +sff_cpld_reg.frmt_24_8=bit +sff_cpld_reg.pola_24_8=negative +sff_cpld_reg.addr_24_8=0x00030032 +sff_cpld_reg.len_24_8=1 +sff_cpld_reg.bit_offset_24_8=7 + +sff_cpld_reg.mode_25_8=config +sff_cpld_reg.src_25_8=cpld +sff_cpld_reg.frmt_25_8=bit +sff_cpld_reg.pola_25_8=negative +sff_cpld_reg.addr_25_8=0x00040030 +sff_cpld_reg.len_25_8=1 +sff_cpld_reg.bit_offset_25_8=0 + +sff_cpld_reg.mode_26_8=config +sff_cpld_reg.src_26_8=cpld +sff_cpld_reg.frmt_26_8=bit +sff_cpld_reg.pola_26_8=negative +sff_cpld_reg.addr_26_8=0x00040030 +sff_cpld_reg.len_26_8=1 +sff_cpld_reg.bit_offset_26_8=1 + +sff_cpld_reg.mode_27_8=config +sff_cpld_reg.src_27_8=cpld +sff_cpld_reg.frmt_27_8=bit +sff_cpld_reg.pola_27_8=negative +sff_cpld_reg.addr_27_8=0x00040030 +sff_cpld_reg.len_27_8=1 +sff_cpld_reg.bit_offset_27_8=2 + +sff_cpld_reg.mode_28_8=config +sff_cpld_reg.src_28_8=cpld +sff_cpld_reg.frmt_28_8=bit +sff_cpld_reg.pola_28_8=negative +sff_cpld_reg.addr_28_8=0x00040030 +sff_cpld_reg.len_28_8=1 +sff_cpld_reg.bit_offset_28_8=3 + +sff_cpld_reg.mode_29_8=config +sff_cpld_reg.src_29_8=cpld +sff_cpld_reg.frmt_29_8=bit +sff_cpld_reg.pola_29_8=negative +sff_cpld_reg.addr_29_8=0x00040030 +sff_cpld_reg.len_29_8=1 +sff_cpld_reg.bit_offset_29_8=4 + +sff_cpld_reg.mode_30_8=config +sff_cpld_reg.src_30_8=cpld +sff_cpld_reg.frmt_30_8=bit +sff_cpld_reg.pola_30_8=negative +sff_cpld_reg.addr_30_8=0x00040030 +sff_cpld_reg.len_30_8=1 +sff_cpld_reg.bit_offset_30_8=5 + +sff_cpld_reg.mode_31_8=config +sff_cpld_reg.src_31_8=cpld +sff_cpld_reg.frmt_31_8=bit +sff_cpld_reg.pola_31_8=negative +sff_cpld_reg.addr_31_8=0x00040030 +sff_cpld_reg.len_31_8=1 +sff_cpld_reg.bit_offset_31_8=6 + +sff_cpld_reg.mode_32_8=config +sff_cpld_reg.src_32_8=cpld +sff_cpld_reg.frmt_32_8=bit +sff_cpld_reg.pola_32_8=negative +sff_cpld_reg.addr_32_8=0x00040030 +sff_cpld_reg.len_32_8=1 +sff_cpld_reg.bit_offset_32_8=7 + +sff_cpld_reg.mode_33_8=config +sff_cpld_reg.src_33_8=cpld +sff_cpld_reg.frmt_33_8=bit +sff_cpld_reg.pola_33_8=negative +sff_cpld_reg.addr_33_8=0x00040031 +sff_cpld_reg.len_33_8=1 +sff_cpld_reg.bit_offset_33_8=0 + +sff_cpld_reg.mode_34_8=config +sff_cpld_reg.src_34_8=cpld +sff_cpld_reg.frmt_34_8=bit +sff_cpld_reg.pola_34_8=negative +sff_cpld_reg.addr_34_8=0x00040031 +sff_cpld_reg.len_34_8=1 +sff_cpld_reg.bit_offset_34_8=1 + +sff_cpld_reg.mode_35_8=config +sff_cpld_reg.src_35_8=cpld +sff_cpld_reg.frmt_35_8=bit +sff_cpld_reg.pola_35_8=negative +sff_cpld_reg.addr_35_8=0x00040031 +sff_cpld_reg.len_35_8=1 +sff_cpld_reg.bit_offset_35_8=2 + +sff_cpld_reg.mode_36_8=config +sff_cpld_reg.src_36_8=cpld +sff_cpld_reg.frmt_36_8=bit +sff_cpld_reg.pola_36_8=negative +sff_cpld_reg.addr_36_8=0x00040031 +sff_cpld_reg.len_36_8=1 +sff_cpld_reg.bit_offset_36_8=3 + +sff_cpld_reg.mode_37_8=config +sff_cpld_reg.src_37_8=cpld +sff_cpld_reg.frmt_37_8=bit +sff_cpld_reg.pola_37_8=negative +sff_cpld_reg.addr_37_8=0x00040031 +sff_cpld_reg.len_37_8=1 +sff_cpld_reg.bit_offset_37_8=4 + +sff_cpld_reg.mode_38_8=config +sff_cpld_reg.src_38_8=cpld +sff_cpld_reg.frmt_38_8=bit +sff_cpld_reg.pola_38_8=negative +sff_cpld_reg.addr_38_8=0x00040031 +sff_cpld_reg.len_38_8=1 +sff_cpld_reg.bit_offset_38_8=5 + +sff_cpld_reg.mode_39_8=config +sff_cpld_reg.src_39_8=cpld +sff_cpld_reg.frmt_39_8=bit +sff_cpld_reg.pola_39_8=negative +sff_cpld_reg.addr_39_8=0x00040031 +sff_cpld_reg.len_39_8=1 +sff_cpld_reg.bit_offset_39_8=6 + +sff_cpld_reg.mode_40_8=config +sff_cpld_reg.src_40_8=cpld +sff_cpld_reg.frmt_40_8=bit +sff_cpld_reg.pola_40_8=negative +sff_cpld_reg.addr_40_8=0x00040031 +sff_cpld_reg.len_40_8=1 +sff_cpld_reg.bit_offset_40_8=7 + +sff_cpld_reg.mode_41_8=config +sff_cpld_reg.src_41_8=cpld +sff_cpld_reg.frmt_41_8=bit +sff_cpld_reg.pola_41_8=negative +sff_cpld_reg.addr_41_8=0x00040032 +sff_cpld_reg.len_41_8=1 +sff_cpld_reg.bit_offset_41_8=0 + +sff_cpld_reg.mode_42_8=config +sff_cpld_reg.src_42_8=cpld +sff_cpld_reg.frmt_42_8=bit +sff_cpld_reg.pola_42_8=negative +sff_cpld_reg.addr_42_8=0x00040032 +sff_cpld_reg.len_42_8=1 +sff_cpld_reg.bit_offset_42_8=1 + +sff_cpld_reg.mode_43_8=config +sff_cpld_reg.src_43_8=cpld +sff_cpld_reg.frmt_43_8=bit +sff_cpld_reg.pola_43_8=negative +sff_cpld_reg.addr_43_8=0x00040032 +sff_cpld_reg.len_43_8=1 +sff_cpld_reg.bit_offset_43_8=2 + +sff_cpld_reg.mode_44_8=config +sff_cpld_reg.src_44_8=cpld +sff_cpld_reg.frmt_44_8=bit +sff_cpld_reg.pola_44_8=negative +sff_cpld_reg.addr_44_8=0x00040032 +sff_cpld_reg.len_44_8=1 +sff_cpld_reg.bit_offset_44_8=3 + +sff_cpld_reg.mode_45_8=config +sff_cpld_reg.src_45_8=cpld +sff_cpld_reg.frmt_45_8=bit +sff_cpld_reg.pola_45_8=negative +sff_cpld_reg.addr_45_8=0x00040032 +sff_cpld_reg.len_45_8=1 +sff_cpld_reg.bit_offset_45_8=4 + +sff_cpld_reg.mode_46_8=config +sff_cpld_reg.src_46_8=cpld +sff_cpld_reg.frmt_46_8=bit +sff_cpld_reg.pola_46_8=negative +sff_cpld_reg.addr_46_8=0x00040032 +sff_cpld_reg.len_46_8=1 +sff_cpld_reg.bit_offset_46_8=5 + +sff_cpld_reg.mode_47_8=config +sff_cpld_reg.src_47_8=cpld +sff_cpld_reg.frmt_47_8=bit +sff_cpld_reg.pola_47_8=negative +sff_cpld_reg.addr_47_8=0x00040032 +sff_cpld_reg.len_47_8=1 +sff_cpld_reg.bit_offset_47_8=6 + +sff_cpld_reg.mode_48_8=config +sff_cpld_reg.src_48_8=cpld +sff_cpld_reg.frmt_48_8=bit +sff_cpld_reg.pola_48_8=negative +sff_cpld_reg.addr_48_8=0x00040032 +sff_cpld_reg.len_48_8=1 +sff_cpld_reg.bit_offset_48_8=7 + +sff_cpld_reg.mode_49_8=config +sff_cpld_reg.src_49_8=cpld +sff_cpld_reg.frmt_49_8=bit +sff_cpld_reg.pola_49_8=negative +sff_cpld_reg.addr_49_8=0x00040033 +sff_cpld_reg.len_49_8=1 +sff_cpld_reg.bit_offset_49_8=0 + +sff_cpld_reg.mode_50_8=config +sff_cpld_reg.src_50_8=cpld +sff_cpld_reg.frmt_50_8=bit +sff_cpld_reg.pola_50_8=negative +sff_cpld_reg.addr_50_8=0x00040033 +sff_cpld_reg.len_50_8=1 +sff_cpld_reg.bit_offset_50_8=1 + +sff_cpld_reg.mode_51_8=config +sff_cpld_reg.src_51_8=cpld +sff_cpld_reg.frmt_51_8=bit +sff_cpld_reg.pola_51_8=negative +sff_cpld_reg.addr_51_8=0x00040033 +sff_cpld_reg.len_51_8=1 +sff_cpld_reg.bit_offset_51_8=2 + +sff_cpld_reg.mode_52_8=config +sff_cpld_reg.src_52_8=cpld +sff_cpld_reg.frmt_52_8=bit +sff_cpld_reg.pola_52_8=negative +sff_cpld_reg.addr_52_8=0x00040033 +sff_cpld_reg.len_52_8=1 +sff_cpld_reg.bit_offset_52_8=3 + +sff_cpld_reg.mode_53_8=config +sff_cpld_reg.src_53_8=cpld +sff_cpld_reg.frmt_53_8=bit +sff_cpld_reg.pola_53_8=negative +sff_cpld_reg.addr_53_8=0x00040033 +sff_cpld_reg.len_53_8=1 +sff_cpld_reg.bit_offset_53_8=4 + +sff_cpld_reg.mode_54_8=config +sff_cpld_reg.src_54_8=cpld +sff_cpld_reg.frmt_54_8=bit +sff_cpld_reg.pola_54_8=negative +sff_cpld_reg.addr_54_8=0x00040033 +sff_cpld_reg.len_54_8=1 +sff_cpld_reg.bit_offset_54_8=5 + +sff_cpld_reg.mode_55_8=config +sff_cpld_reg.src_55_8=cpld +sff_cpld_reg.frmt_55_8=bit +sff_cpld_reg.pola_55_8=negative +sff_cpld_reg.addr_55_8=0x00040033 +sff_cpld_reg.len_55_8=1 +sff_cpld_reg.bit_offset_55_8=6 + +sff_cpld_reg.mode_56_8=config +sff_cpld_reg.src_56_8=cpld +sff_cpld_reg.frmt_56_8=bit +sff_cpld_reg.pola_56_8=negative +sff_cpld_reg.addr_56_8=0x00040033 +sff_cpld_reg.len_56_8=1 +sff_cpld_reg.bit_offset_56_8=7 diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/cfg_file_name b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/cfg_file_name new file mode 100644 index 000000000000..5f49420441a5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/plat_sysfs_cfg/cfg_file_name @@ -0,0 +1,4 @@ +WB_PLAT_CPLD +WB_PLAT_FAN +WB_PLAT_PSU +WB_PLAT_SFF diff --git a/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/setup.py b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/setup.py new file mode 100644 index 000000000000..6c3916921abb --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-micas/m2-w6510-48v8c/setup.py @@ -0,0 +1,39 @@ +from setuptools import setup + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation', + license='Apache 2.0', + author='SONiC Team', + author_email='support', + url='', + maintainer='support', + maintainer_email='', + packages=[ + 'sonic_platform', + 'plat_hal', + 'wbutil', + 'eepromutil', + 'hal-config', + 'config', + ], + py_modules=[ + 'hal_pltfm', + 'platform_util', + 'platform_intf', + ], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/src/sonic-device-data/tests/permitted_list b/src/sonic-device-data/tests/permitted_list index f89d80ac8bad..625e6afccad2 100644 --- a/src/sonic-device-data/tests/permitted_list +++ b/src/sonic-device-data/tests/permitted_list @@ -340,5 +340,9 @@ svi_my_station_optimization sai_nbr_bcast_ifp_optimized sai_pfc_defaults_disable sai_optimized_mmu +svi_my_station_optimization +warmboot_knet_shutdown_mode +sai_stats_support_mask sai_default_cpu_tx_tc +oversubscribe_mixed_sister_25_50_enable sai_disable_srcmacqedstmac_ctrl From d9123664ce189e7b2a53c728216cff48d50a31aa Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Fri, 31 May 2024 09:30:08 -0700 Subject: [PATCH 205/282] Added Yang Support for attribute slice_type to DEVICE_METADATA (#19094) *Added Yang model support for new attribute in DEVICE_METADATA of slice_type --------- Signed-off-by: Abhishek Dosi --- src/sonic-yang-models/tests/files/sample_config_db.json | 3 ++- .../tests/yang_model_tests/tests/device_metadata.json | 3 +++ .../yang_model_tests/tests_config/device_metadata.json | 9 +++++++++ .../yang-models/sonic-device_metadata.yang | 6 ++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 2d2c2e63d4ec..850785624f76 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -370,7 +370,8 @@ "rack_mgmt_map": "dummy_value", "timezone": "Europe/Kiev", "bgp_router_id": "8.8.8.8", - "chassis_hostname": "str-sonic-chassis-1" + "chassis_hostname": "str-sonic-chassis-1", + "slice_type": "AZNG_Production" } }, "VLAN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 5f81f02a3c7e..3acfff5c42ad 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -172,5 +172,8 @@ }, "DEVICE_METADATA_VALID_CHASSIS_HOSTNAME": { "desc": "Verifying valid chassis hostname configuration." + }, + "DEVICE_METADATA_VALID_SLICE_TYPE": { + "desc": "Verifying valid slice_type configuration." } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index 75d08694a5a5..74f4d17dd518 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -471,5 +471,14 @@ } } } + }, + "DEVICE_METADATA_VALID_SLICE_TYPE": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "slice_type": "AZNG_Production" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index e201b4bfde81..61f6888ded6d 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -259,6 +259,12 @@ module sonic-device_metadata { description "hostname of the chassis to which this linecard or supervisor belongs to"; type stypes:hostname; } + + leaf slice_type { + description "Metadata tag for the device."; + type string; + } + } /* end of container localhost */ } From 9d5fb207593d83661e18603141735fd05f222327 Mon Sep 17 00:00:00 2001 From: fountzou <169114916+fountzou@users.noreply.github.com> Date: Fri, 31 May 2024 12:57:17 -0400 Subject: [PATCH 206/282] Reliable TSA implementation (#18928) * Reliable TSA implementation --------- Signed-off-by: fountzou --- dockers/docker-fpm-frr/base_image_files/TS | 14 +- dockers/docker-fpm-frr/base_image_files/TSA | 13 +- dockers/docker-fpm-frr/base_image_files/TSB | 16 +- files/build_templates/docker_image_ctl.j2 | 8 + files/image_config/config-setup/config-setup | 6 + src/sonic-bgpcfgd/bgpcfgd/main.py | 2 + .../bgpcfgd/managers_chassis_app_db.py | 50 ++++++ .../bgpcfgd/managers_device_global.py | 23 ++- src/sonic-bgpcfgd/bgpcfgd/runner.py | 5 +- .../tests/test_chassis_app_db.py | 142 ++++++++++++++++++ src/sonic-bgpcfgd/tests/test_device_global.py | 65 +++++++- 11 files changed, 328 insertions(+), 16 deletions(-) create mode 100644 src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py create mode 100644 src/sonic-bgpcfgd/tests/test_chassis_app_db.py diff --git a/dockers/docker-fpm-frr/base_image_files/TS b/dockers/docker-fpm-frr/base_image_files/TS index fcff1f80674c..948da490f04a 100755 --- a/dockers/docker-fpm-frr/base_image_files/TS +++ b/dockers/docker-fpm-frr/base_image_files/TS @@ -6,13 +6,23 @@ PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} if [[ $1 == "TSA" ]]; then + TSA_CHASSIS_STATE="$(sonic-db-cli CHASSIS_APP_DB HGET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled)" TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "true"}}}' - log_msg='System Mode: Normal -> Maintenance' + if [[ $TSA_CHASSIS_STATE == true ]]; then + log_msg='System Mode: Maintenance -> Maintenance' + else + log_msg='System Mode: Normal -> Maintenance' + fi err_msg='System is already in Maintenance' desired_tsa_state=true elif [[ $1 == "TSB" ]]; then + TSA_CHASSIS_STATE="$(sonic-db-cli CHASSIS_APP_DB HGET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled)" TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "false"}}}' - log_msg='System Mode: Maintenance -> Normal' + if [[ $TSA_CHASSIS_STATE == true ]]; then + log_msg='System Mode: Maintenance -> Maintenance' + else + log_msg='System Mode: Maintenance -> Normal' + fi err_msg='System is already in Normal mode' desired_tsa_state=false fi diff --git a/dockers/docker-fpm-frr/base_image_files/TSA b/dockers/docker-fpm-frr/base_image_files/TSA index 4b26b2d430b5..2cd29e92afb1 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSA +++ b/dockers/docker-fpm-frr/base_image_files/TSA @@ -7,7 +7,18 @@ if [ "$EUID" -ne 0 ] ; then fi if [ -f /etc/sonic/chassisdb.conf ]; then - rexec all -c "sudo TSA chassis" + CHASSIS_TSA_STATE_UPDATE="CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL\|STATE" tsa_enabled "true"" + CONFIG_DB_TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "true"}}}' + current_tsa_state="$(sonic-cfggen -d -v BGP_DEVICE_GLOBAL.STATE.tsa_enabled)" + if [[ $current_tsa_state == true ]]; then + echo "Chassis is already in Maintenance" + logger -t TSA -p user.info "Chassis is already in Maintenance" + else + sonic-db-cli $CHASSIS_TSA_STATE_UPDATE + sonic-cfggen -a "$CONFIG_DB_TSA_STATE_UPDATE" -w + echo "Chassis Mode: Normal -> Maintenance" + logger -t TSA -p user.info "Chassis Mode: Normal -> Maintenance" + fi echo "Please execute \"rexec all -c 'sudo config save -y'\" to preserve System mode in Maintenance after reboot\ or config reload on all linecards" exit 0 diff --git a/dockers/docker-fpm-frr/base_image_files/TSB b/dockers/docker-fpm-frr/base_image_files/TSB index ec353148a72f..c09126e1d12d 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSB +++ b/dockers/docker-fpm-frr/base_image_files/TSB @@ -6,11 +6,21 @@ if [ "$EUID" -ne 0 ] ; then exit 1 fi -# If run on supervisor of chassis, trigger remote execution of TSB on all linecards if [ -f /etc/sonic/chassisdb.conf ]; then - rexec all -c "sudo TSB chassis" + CHASSIS_TSA_STATE_UPDATE="CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL\|STATE" tsa_enabled "false"" + CONFIG_DB_TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "false"}}}' + current_tsa_state="$(sonic-cfggen -d -v BGP_DEVICE_GLOBAL.STATE.tsa_enabled)" + if [[ $current_tsa_state == false ]]; then + echo "Chassis is already in Normal mode" + logger -t TSB -p user.info "Chassis is already in Normal mode" + else + sonic-db-cli $CHASSIS_TSA_STATE_UPDATE + sonic-cfggen -a "$CONFIG_DB_TSA_STATE_UPDATE" -w + echo "Chassis Mode: Maintenance -> Normal" + logger -t TSB -p user.info "Chassis Mode: Maintenance -> Normal" + fi echo "Please execute \"rexec all -c 'sudo config save -y'\" to preserve System mode in Normal state after reboot\ - or config reload on all linecards" + or config reload on all linecards" exit 0 fi diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index f0208d32f1e5..626c2de63139 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -269,6 +269,14 @@ function postStartAction() $SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" fi + # In SUP, enforce CHASSIS_APP_DB.tsa_enabled to be in sync with BGP_DEVICE_GLOBAL.STATE.tsa_enabled + if [[ -z "$DEV" ]] && [[ -f /etc/sonic/chassisdb.conf ]]; then + tsa_cfg="$($SONIC_DB_CLI CONFIG_DB HGET "BGP_DEVICE_GLOBAL|STATE" "tsa_enabled")" + if [[ -n "$tsa_cfg" ]]; then + docker exec -i ${DOCKERNAME} $SONIC_DB_CLI CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled ${tsa_cfg} + fi + fi + # Add redis UDS to the redis group and give read/write access to the group REDIS_SOCK="/var/run/redis${DEV}/redis.sock" else diff --git a/files/image_config/config-setup/config-setup b/files/image_config/config-setup/config-setup index 21d56217c349..f66409913e01 100755 --- a/files/image_config/config-setup/config-setup +++ b/files/image_config/config-setup/config-setup @@ -330,6 +330,12 @@ do_db_migration() /usr/local/bin/db_migrator.py -o migrate fi sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" + #Enforce CHASSIS_APP_DB.tsa_enabled to be in sync with BGP_DEVICE_GLOBAL.STATE.tsa_enabled + + if [[ -f /etc/sonic/chassisdb.conf ]]; then + tsa_cfg="$(sonic-db-cli CONFIG_DB HGET "BGP_DEVICE_GLOBAL|STATE" "tsa_enabled")" + sonic-db-cli CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled ${tsa_cfg} + fi } # Perform configuration migration from backup copy. diff --git a/src/sonic-bgpcfgd/bgpcfgd/main.py b/src/sonic-bgpcfgd/bgpcfgd/main.py index 624d311037ad..b6580ab91121 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/main.py +++ b/src/sonic-bgpcfgd/bgpcfgd/main.py @@ -20,6 +20,7 @@ from .managers_static_rt import StaticRouteMgr from .managers_rm import RouteMapMgr from .managers_device_global import DeviceGlobalCfgMgr +from .managers_chassis_app_db import ChassisAppDbMgr from .static_rt_timer import StaticRouteTimer from .runner import Runner, signal_handler from .template import TemplateFabric @@ -73,6 +74,7 @@ def do_work(): RouteMapMgr(common_objs, "APPL_DB", swsscommon.APP_BGP_PROFILE_TABLE_NAME), # Device Global Manager DeviceGlobalCfgMgr(common_objs, "CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME), + ChassisAppDbMgr(common_objs, "CHASSIS_APP_DB", "BGP_DEVICE_GLOBAL"), ] runner = Runner(common_objs['cfg_mgr']) for mgr in managers: diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py b/src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py new file mode 100644 index 000000000000..7969ae828d80 --- /dev/null +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py @@ -0,0 +1,50 @@ +from .manager import Manager +from .managers_device_global import DeviceGlobalCfgMgr +from .log import log_err, log_debug, log_notice +import re +from swsscommon import swsscommon + +class ChassisAppDbMgr(Manager): + """This class responds to change in tsa_enabled state of the supervisor""" + + def __init__(self, common_objs, db, table): + """ + Initialize the object + :param common_objs: common object dictionary + :param db: name of the db + :param table: name of the table in the db + """ + self.lc_tsa = "" + self.directory = common_objs['directory'] + self.dev_cfg_mgr = DeviceGlobalCfgMgr(common_objs, "CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME) + self.directory.subscribe([("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"),], self.on_lc_tsa_status_change) + super(ChassisAppDbMgr, self).__init__( + common_objs, + [], + db, + table, + ) + + def on_lc_tsa_status_change(self): + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"): + self.lc_tsa = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["tsa_enabled"] + log_debug("ChassisAppDbMgr:: LC TSA update handler status %s" % self.lc_tsa) + + def set_handler(self, key, data): + log_debug("ChassisAppDbMgr:: set handler") + + if not data: + log_err("ChassisAppDbMgr:: data is None") + return False + + if "tsa_enabled" in data: + if self.lc_tsa == "false": + self.dev_cfg_mgr.cfg_mgr.commit() + self.dev_cfg_mgr.cfg_mgr.update() + self.dev_cfg_mgr.isolate_unisolate_device(data["tsa_enabled"]) + return True + return False + + def del_handler(self, key): + log_debug("ChassisAppDbMgr:: del handler") + return True diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py index 5c42e4415f16..639624128820 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py @@ -14,6 +14,7 @@ def __init__(self, common_objs, db, table): :param table: name of the table in the db """ self.switch_type = "" + self.chassis_tsa = "" self.directory = common_objs['directory'] self.cfg_mgr = common_objs['cfg_mgr'] self.constants = common_objs['constants'] @@ -54,12 +55,13 @@ def set_handler(self, key, data): if "tsa_enabled" in data: self.directory.put(self.db_name, self.table_name, "tsa_enabled", data["tsa_enabled"]) - if tsa_status != data["tsa_enabled"]: + + self.chassis_tsa = self.get_chassis_tsa_status() + if self.chassis_tsa == "false" and tsa_status != data["tsa_enabled"]: self.cfg_mgr.commit() self.cfg_mgr.update() self.isolate_unisolate_device(data["tsa_enabled"]) - if "idf_isolation_state" in data: self.directory.put(self.db_name, self.table_name, "idf_isolation_state", data["idf_isolation_state"]) if idf_isolation_state != data["idf_isolation_state"]: @@ -79,7 +81,9 @@ def check_state_and_get_tsa_routemaps(self, cfg): cmd = "" if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"): tsa_status = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["tsa_enabled"] - if tsa_status == "true": + chassis_tsa = self.get_chassis_tsa_status() + + if tsa_status == "true" or chassis_tsa == "true": cmds = cfg.replace("#012", "\n").split("\n") log_notice("DeviceGlobalCfgMgr:: Device is isolated. Applying TSA route-maps") cmd = self.get_ts_routemaps(cmds, self.tsa_template) @@ -133,6 +137,17 @@ def __extract_out_route_map_names(self, cmds): route_map_names.add(result.group(1)) return route_map_names + def get_chassis_tsa_status(self): + chassis_tsa_status = "false" + try: + ch = swsscommon.SonicV2Connector(use_unix_socket_path=False) + ch.connect(ch.CHASSIS_APP_DB, False) + chassis_tsa_status = ch.get(ch.CHASSIS_APP_DB, "BGP_DEVICE_GLOBAL|STATE", 'tsa_enabled') + except Exception: + pass + + return chassis_tsa_status + def downstream_isolate_unisolate(self, idf_isolation_state): cmd = "\n" if idf_isolation_state == "unisolated": @@ -153,4 +168,4 @@ def check_state_and_get_idf_isolation_routemaps(self): if idf_isolation_state != "unisolated": log_notice("DeviceGlobalCfgMgr:: IDF is isolated. Applying required route-maps") cmd = self.idf_isolate_template.render(isolation_status=idf_isolation_state, constants=self.constants) - return cmd \ No newline at end of file + return cmd diff --git a/src/sonic-bgpcfgd/bgpcfgd/runner.py b/src/sonic-bgpcfgd/bgpcfgd/runner.py index 4c160e5967cf..75df6f902e9a 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/runner.py +++ b/src/sonic-bgpcfgd/bgpcfgd/runner.py @@ -39,7 +39,10 @@ def add_manager(self, manager): table_name = manager.get_table_name() db = swsscommon.SonicDBConfig.getDbId(db_name) if db not in self.db_connectors: - self.db_connectors[db] = swsscommon.DBConnector(db_name, 0) + if db_name == "CHASSIS_APP_DB": + self.db_connectors[db] = swsscommon.DBConnector(db_name, 0, True, '') + else: + self.db_connectors[db] = swsscommon.DBConnector(db_name, 0) if table_name not in self.callbacks[db]: conn = self.db_connectors[db] diff --git a/src/sonic-bgpcfgd/tests/test_chassis_app_db.py b/src/sonic-bgpcfgd/tests/test_chassis_app_db.py new file mode 100644 index 000000000000..edb08595ade1 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/test_chassis_app_db.py @@ -0,0 +1,142 @@ +from unittest.mock import MagicMock, patch + +import os +from bgpcfgd.directory import Directory +from bgpcfgd.template import TemplateFabric +from . import swsscommon_test +from .util import load_constants +import bgpcfgd.managers_chassis_app_db +import bgpcfgd.managers_device_global +from swsscommon import swsscommon +from copy import deepcopy + +TEMPLATE_PATH = os.path.abspath('../../dockers/docker-fpm-frr/frr') +BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/general/peer-group.conf/') +INTERNAL_BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/internal/peer-group.conf/') +global_constants = { + "bgp": { + "traffic_shift_community" :"12345:12345", + "internal_community_match_tag" : "1001" + } +} + +def constructor(check_internal=False): + cfg_mgr = MagicMock() + def get_text(): + text = [] + for line in cfg_mgr.changes.split('\n'): + if line.lstrip().startswith('!'): + continue + text.append(line) + text += [" "] + return text + def update(): + if check_internal: + cfg_mgr.changes = get_string_from_file("/result_chasiss_packet.conf", INTERNAL_BASE_PATH) + else: + cfg_mgr.changes = get_string_from_file("/result_all.conf") + def push(cfg): + cfg_mgr.changes += cfg + "\n" + def get_config(): + return cfg_mgr.changes + cfg_mgr.get_text = get_text + cfg_mgr.update = update + cfg_mgr.push = push + cfg_mgr.get_config = get_config + + constants = deepcopy(global_constants) + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'tf': TemplateFabric(TEMPLATE_PATH), + 'constants': constants + } + mgr = bgpcfgd.managers_chassis_app_db.ChassisAppDbMgr(common_objs, "CHASSIS_APP_DB", "BGP_DEVICE_GLOBAL") + cfg_mgr.update() + return mgr + + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_isolate_device(mocked_log_info): + m = constructor() + + m.lc_tsa = "false" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_isolate.conf") + + curr_cfg = m.cfg_mgr.get_config() + m.lc_tsa = "true" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_isolate_device_internal_session(mocked_log_info): + m = constructor(check_internal=True) + + m.lc_tsa = "false" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_isolate.conf", INTERNAL_BASE_PATH) + + curr_cfg = m.cfg_mgr.get_config() + m.lc_tsa = "true" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_unisolate_device(mocked_log_info): + m = constructor() + + m.lc_tsa = "false" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_unisolate.conf") + + curr_cfg = m.cfg_mgr.get_config() + m.lc_tsa = "true" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_unisolate_device_internal_session(mocked_log_info): + m = constructor(check_internal=True) + + m.lc_tsa = "false" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_unisolate.conf", INTERNAL_BASE_PATH) + + curr_cfg = m.cfg_mgr.get_config() + m.lc_tsa = "true" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + + +def get_string_from_file(filename, base_path=BASE_PATH): + fp = open(base_path + filename, "r") + cfg = fp.read() + fp.close() + + return cfg + +@patch('bgpcfgd.managers_chassis_app_db.log_err') +def test_set_handler_failure_case(mocked_log_info): + m = constructor() + res = m.set_handler("STATE", {}) + assert res == False, "Expect False return value for invalid data passed to set_handler" + mocked_log_info.assert_called_with("ChassisAppDbMgr:: data is None") + +def test_del_handler(): + m = constructor() + res = m.del_handler("STATE") + assert res, "Expect True return value for del_handler" diff --git a/src/sonic-bgpcfgd/tests/test_device_global.py b/src/sonic-bgpcfgd/tests/test_device_global.py index 12dd895f58d7..bed0a3271a05 100644 --- a/src/sonic-bgpcfgd/tests/test_device_global.py +++ b/src/sonic-bgpcfgd/tests/test_device_global.py @@ -55,14 +55,24 @@ def get_config(): return mgr +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_isolate_device(mocked_log_info): +def test_isolate_device(mocked_log_info, mock_get_chassis_tsa_status): m = constructor() + + mock_get_chassis_tsa_status.return_value = "false" res = m.set_handler("STATE", {"tsa_enabled": "true"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_isolate.conf") + curr_cfg = m.cfg_mgr.get_config() + mock_get_chassis_tsa_status.return_value = "true" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + + @patch('bgpcfgd.managers_device_global.log_debug') def test_idf_isolation_no_export(mocked_log_info): m = constructor() @@ -88,44 +98,89 @@ def test_idf_unisolation(mocked_log_info): mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_unisolated.conf") +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_isolate_device_internal_session(mocked_log_info): +def test_isolate_device_internal_session(mocked_log_info, mock_get_chassis_tsa_status): m = constructor(check_internal=True) + + mock_get_chassis_tsa_status.return_value = "false" res = m.set_handler("STATE", {"tsa_enabled": "true"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_isolate.conf", INTERNAL_BASE_PATH) + curr_cfg = m.cfg_mgr.get_config() + mock_get_chassis_tsa_status.return_value = "true" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_unisolate_device(mocked_log_info): +def test_unisolate_device(mocked_log_info, mock_get_chassis_tsa_status): m = constructor() + + mock_get_chassis_tsa_status.return_value = "false" m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") + res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_unisolate.conf") + curr_cfg = m.cfg_mgr.get_config() + mock_get_chassis_tsa_status.return_value = "true" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + + +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_unisolate_device_internal_session(mocked_log_info): +def test_unisolate_device_internal_session(mocked_log_info, mock_get_chassis_tsa_status): m = constructor(check_internal=True) + + mock_get_chassis_tsa_status.return_value = "false" m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") + res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_unisolate.conf", INTERNAL_BASE_PATH) + curr_cfg = m.cfg_mgr.get_config() + mock_get_chassis_tsa_status.return_value = "true" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + -def test_check_state_and_get_tsa_routemaps(): +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') +def test_check_state_and_get_tsa_routemaps(mock_get_chassis_tsa_status): m = constructor() + + mock_get_chassis_tsa_status.return_value = "false" m.set_handler("STATE", {"tsa_enabled": "true"}) res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) assert res == get_string_from_file("/result_isolate.conf") + mock_get_chassis_tsa_status.return_value = "true" + m.set_handler("STATE", {"tsa_enabled": "true"}) + res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) + assert res == get_string_from_file("/result_isolate.conf") + + mock_get_chassis_tsa_status.return_value = "false" m.set_handler("STATE", {"tsa_enabled": "false"}) res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) assert res == "" + mock_get_chassis_tsa_status.return_value = "true" + m.set_handler("STATE", {"tsa_enabled": "false"}) + res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) + assert res == get_string_from_file("/result_isolate.conf") + + def test_check_state_and_get_idf_isolation_routemaps(): m = constructor() m.set_handler("STATE", {"idf_isolation_state": "isolated_no_export"}) From 6a7aa29d89d90781b6ab0af0f1a29bd8176a14c8 Mon Sep 17 00:00:00 2001 From: saksarav-nokia Date: Fri, 31 May 2024 12:58:55 -0400 Subject: [PATCH 207/282] [Nokia][Device] Add device files for fabric monitor feature and set linkscan interval for Ramon (#19144) * [Nokia][Device] Add device files for fabric monitor feature and set linkscan interval for Ramon * Enable fabric link monitoring by default --------- Signed-off-by: saksarav --- .../fabric_monitor_config.json | 10 + .../fabric_port_config.ini | 193 ++++++++++++++++++ .../fabric_monitor_config.json | 10 + .../fabric_port_config.ini | 193 ++++++++++++++++++ .../0/config-ramon-1-0.bcm | 2 +- .../0/sai_postinit_cmd.soc | 1 + .../1/config-ramon-1-1.bcm | 2 +- .../1/sai_postinit_cmd.soc | 1 + .../10/config-ramon-6-0.bcm | 2 +- .../10/sai_postinit_cmd.soc | 1 + .../11/config-ramon-6-1.bcm | 2 +- .../11/sai_postinit_cmd.soc | 1 + .../12/config-ramon-7-0.bcm | 2 +- .../12/sai_postinit_cmd.soc | 1 + .../13/config-ramon-7-1.bcm | 2 +- .../13/sai_postinit_cmd.soc | 1 + .../14/config-ramon-8-0.bcm | 2 +- .../14/sai_postinit_cmd.soc | 1 + .../15/config-ramon-8-1.bcm | 2 +- .../15/sai_postinit_cmd.soc | 1 + .../2/config-ramon-2-0.bcm | 2 +- .../2/sai_postinit_cmd.soc | 1 + .../3/config-ramon-2-1.bcm | 2 +- .../3/sai_postinit_cmd.soc | 1 + .../4/config-ramon-3-0.bcm | 2 +- .../4/sai_postinit_cmd.soc | 1 + .../5/config-ramon-3-1.bcm | 2 +- .../5/sai_postinit_cmd.soc | 1 + .../6/config-ramon-4-0.bcm | 2 +- .../6/sai_postinit_cmd.soc | 1 + .../7/config-ramon-4-1.bcm | 2 +- .../7/sai_postinit_cmd.soc | 1 + .../8/config-ramon-5-0.bcm | 2 +- .../8/sai_postinit_cmd.soc | 1 + .../9/config-ramon-5-1.bcm | 2 +- .../9/sai_postinit_cmd.soc | 1 + .../fabric_monitor_config.json | 10 + .../fabric_port_config.ini | 193 ++++++++++++++++++ 38 files changed, 641 insertions(+), 16 deletions(-) create mode 100644 device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/fabric_monitor_config.json create mode 100644 device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/fabric_port_config.ini create mode 100644 device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/fabric_monitor_config.json create mode 100644 device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/fabric_port_config.ini create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/0/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/1/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/10/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/11/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/12/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/13/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/14/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/15/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/2/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/3/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/4/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/5/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/6/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/7/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/8/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/9/sai_postinit_cmd.soc create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/fabric_monitor_config.json create mode 100644 device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/fabric_port_config.ini diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/fabric_monitor_config.json b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/fabric_monitor_config.json new file mode 100644 index 000000000000..2d641f92ac89 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/fabric_monitor_config.json @@ -0,0 +1,10 @@ +{ + "FABRIC_MONITOR_DATA": { + "monErrThreshCrcCells": 1, + "monErrThreshRxCells": 61035156, + "monPollThreshRecovery": 8, + "monPollThreshIsolation": 1, + "monCapacityThreshWarn": 85, + "monState": enable + } +} diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/fabric_port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/fabric_port_config.ini new file mode 100644 index 000000000000..1ffb084a1334 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/fabric_port_config.ini @@ -0,0 +1,193 @@ +# name lanes isolateStatus forceUnisolateStatus +Fabric0 0 False 0 +Fabric1 1 False 0 +Fabric2 2 False 0 +Fabric3 3 False 0 +Fabric4 4 False 0 +Fabric5 5 False 0 +Fabric6 6 False 0 +Fabric7 7 False 0 +Fabric8 8 False 0 +Fabric9 9 False 0 +Fabric10 10 False 0 +Fabric11 11 False 0 +Fabric12 12 False 0 +Fabric13 13 False 0 +Fabric14 14 False 0 +Fabric15 15 False 0 +Fabric16 16 False 0 +Fabric17 17 False 0 +Fabric18 18 False 0 +Fabric19 19 False 0 +Fabric20 20 False 0 +Fabric21 21 False 0 +Fabric22 22 False 0 +Fabric23 23 False 0 +Fabric24 24 False 0 +Fabric25 25 False 0 +Fabric26 26 False 0 +Fabric27 27 False 0 +Fabric28 28 False 0 +Fabric29 29 False 0 +Fabric30 30 False 0 +Fabric31 31 False 0 +Fabric32 32 False 0 +Fabric33 33 False 0 +Fabric34 34 False 0 +Fabric35 35 False 0 +Fabric36 36 False 0 +Fabric37 37 False 0 +Fabric38 38 False 0 +Fabric39 39 False 0 +Fabric40 40 False 0 +Fabric41 41 False 0 +Fabric42 42 False 0 +Fabric43 43 False 0 +Fabric44 44 False 0 +Fabric45 45 False 0 +Fabric46 46 False 0 +Fabric47 47 False 0 +Fabric48 48 False 0 +Fabric49 49 False 0 +Fabric50 50 False 0 +Fabric51 51 False 0 +Fabric52 52 False 0 +Fabric53 53 False 0 +Fabric54 54 False 0 +Fabric55 55 False 0 +Fabric56 56 False 0 +Fabric57 57 False 0 +Fabric58 58 False 0 +Fabric59 59 False 0 +Fabric60 60 False 0 +Fabric61 61 False 0 +Fabric62 62 False 0 +Fabric63 63 False 0 +Fabric64 64 False 0 +Fabric65 65 False 0 +Fabric66 66 False 0 +Fabric67 67 False 0 +Fabric68 68 False 0 +Fabric69 69 False 0 +Fabric70 70 False 0 +Fabric71 71 False 0 +Fabric72 72 False 0 +Fabric73 73 False 0 +Fabric74 74 False 0 +Fabric75 75 False 0 +Fabric76 76 False 0 +Fabric77 77 False 0 +Fabric78 78 False 0 +Fabric79 79 False 0 +Fabric80 80 False 0 +Fabric81 81 False 0 +Fabric82 82 False 0 +Fabric83 83 False 0 +Fabric84 84 False 0 +Fabric85 85 False 0 +Fabric86 86 False 0 +Fabric87 87 False 0 +Fabric88 88 False 0 +Fabric89 89 False 0 +Fabric90 90 False 0 +Fabric91 91 False 0 +Fabric92 92 False 0 +Fabric93 93 False 0 +Fabric94 94 False 0 +Fabric95 95 False 0 +Fabric96 96 False 0 +Fabric97 97 False 0 +Fabric98 98 False 0 +Fabric99 99 False 0 +Fabric100 100 False 0 +Fabric101 101 False 0 +Fabric102 102 False 0 +Fabric103 103 False 0 +Fabric104 104 False 0 +Fabric105 105 False 0 +Fabric106 106 False 0 +Fabric107 107 False 0 +Fabric108 108 False 0 +Fabric109 109 False 0 +Fabric110 110 False 0 +Fabric111 111 False 0 +Fabric112 112 False 0 +Fabric113 113 False 0 +Fabric114 114 False 0 +Fabric115 115 False 0 +Fabric116 116 False 0 +Fabric117 117 False 0 +Fabric118 118 False 0 +Fabric119 119 False 0 +Fabric120 120 False 0 +Fabric121 121 False 0 +Fabric122 122 False 0 +Fabric123 123 False 0 +Fabric124 124 False 0 +Fabric125 125 False 0 +Fabric126 126 False 0 +Fabric127 127 False 0 +Fabric128 128 False 0 +Fabric129 129 False 0 +Fabric130 130 False 0 +Fabric131 131 False 0 +Fabric132 132 False 0 +Fabric133 133 False 0 +Fabric134 134 False 0 +Fabric135 135 False 0 +Fabric136 136 False 0 +Fabric137 137 False 0 +Fabric138 138 False 0 +Fabric139 139 False 0 +Fabric140 140 False 0 +Fabric141 141 False 0 +Fabric142 142 False 0 +Fabric143 143 False 0 +Fabric144 144 False 0 +Fabric145 145 False 0 +Fabric146 146 False 0 +Fabric147 147 False 0 +Fabric148 148 False 0 +Fabric149 149 False 0 +Fabric150 150 False 0 +Fabric151 151 False 0 +Fabric152 152 False 0 +Fabric153 153 False 0 +Fabric154 154 False 0 +Fabric155 155 False 0 +Fabric156 156 False 0 +Fabric157 157 False 0 +Fabric158 158 False 0 +Fabric159 159 False 0 +Fabric160 160 False 0 +Fabric161 161 False 0 +Fabric162 162 False 0 +Fabric163 163 False 0 +Fabric164 164 False 0 +Fabric165 165 False 0 +Fabric166 166 False 0 +Fabric167 167 False 0 +Fabric168 168 False 0 +Fabric169 169 False 0 +Fabric170 170 False 0 +Fabric171 171 False 0 +Fabric172 172 False 0 +Fabric173 173 False 0 +Fabric174 174 False 0 +Fabric175 175 False 0 +Fabric176 176 False 0 +Fabric177 177 False 0 +Fabric178 178 False 0 +Fabric179 179 False 0 +Fabric180 180 False 0 +Fabric181 181 False 0 +Fabric182 182 False 0 +Fabric183 183 False 0 +Fabric184 184 False 0 +Fabric185 185 False 0 +Fabric186 186 False 0 +Fabric187 187 False 0 +Fabric188 188 False 0 +Fabric189 189 False 0 +Fabric190 190 False 0 +Fabric191 191 False 0 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/fabric_monitor_config.json b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/fabric_monitor_config.json new file mode 100644 index 000000000000..2d641f92ac89 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/fabric_monitor_config.json @@ -0,0 +1,10 @@ +{ + "FABRIC_MONITOR_DATA": { + "monErrThreshCrcCells": 1, + "monErrThreshRxCells": 61035156, + "monPollThreshRecovery": 8, + "monPollThreshIsolation": 1, + "monCapacityThreshWarn": 85, + "monState": enable + } +} diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/fabric_port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/fabric_port_config.ini new file mode 100644 index 000000000000..1ffb084a1334 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/fabric_port_config.ini @@ -0,0 +1,193 @@ +# name lanes isolateStatus forceUnisolateStatus +Fabric0 0 False 0 +Fabric1 1 False 0 +Fabric2 2 False 0 +Fabric3 3 False 0 +Fabric4 4 False 0 +Fabric5 5 False 0 +Fabric6 6 False 0 +Fabric7 7 False 0 +Fabric8 8 False 0 +Fabric9 9 False 0 +Fabric10 10 False 0 +Fabric11 11 False 0 +Fabric12 12 False 0 +Fabric13 13 False 0 +Fabric14 14 False 0 +Fabric15 15 False 0 +Fabric16 16 False 0 +Fabric17 17 False 0 +Fabric18 18 False 0 +Fabric19 19 False 0 +Fabric20 20 False 0 +Fabric21 21 False 0 +Fabric22 22 False 0 +Fabric23 23 False 0 +Fabric24 24 False 0 +Fabric25 25 False 0 +Fabric26 26 False 0 +Fabric27 27 False 0 +Fabric28 28 False 0 +Fabric29 29 False 0 +Fabric30 30 False 0 +Fabric31 31 False 0 +Fabric32 32 False 0 +Fabric33 33 False 0 +Fabric34 34 False 0 +Fabric35 35 False 0 +Fabric36 36 False 0 +Fabric37 37 False 0 +Fabric38 38 False 0 +Fabric39 39 False 0 +Fabric40 40 False 0 +Fabric41 41 False 0 +Fabric42 42 False 0 +Fabric43 43 False 0 +Fabric44 44 False 0 +Fabric45 45 False 0 +Fabric46 46 False 0 +Fabric47 47 False 0 +Fabric48 48 False 0 +Fabric49 49 False 0 +Fabric50 50 False 0 +Fabric51 51 False 0 +Fabric52 52 False 0 +Fabric53 53 False 0 +Fabric54 54 False 0 +Fabric55 55 False 0 +Fabric56 56 False 0 +Fabric57 57 False 0 +Fabric58 58 False 0 +Fabric59 59 False 0 +Fabric60 60 False 0 +Fabric61 61 False 0 +Fabric62 62 False 0 +Fabric63 63 False 0 +Fabric64 64 False 0 +Fabric65 65 False 0 +Fabric66 66 False 0 +Fabric67 67 False 0 +Fabric68 68 False 0 +Fabric69 69 False 0 +Fabric70 70 False 0 +Fabric71 71 False 0 +Fabric72 72 False 0 +Fabric73 73 False 0 +Fabric74 74 False 0 +Fabric75 75 False 0 +Fabric76 76 False 0 +Fabric77 77 False 0 +Fabric78 78 False 0 +Fabric79 79 False 0 +Fabric80 80 False 0 +Fabric81 81 False 0 +Fabric82 82 False 0 +Fabric83 83 False 0 +Fabric84 84 False 0 +Fabric85 85 False 0 +Fabric86 86 False 0 +Fabric87 87 False 0 +Fabric88 88 False 0 +Fabric89 89 False 0 +Fabric90 90 False 0 +Fabric91 91 False 0 +Fabric92 92 False 0 +Fabric93 93 False 0 +Fabric94 94 False 0 +Fabric95 95 False 0 +Fabric96 96 False 0 +Fabric97 97 False 0 +Fabric98 98 False 0 +Fabric99 99 False 0 +Fabric100 100 False 0 +Fabric101 101 False 0 +Fabric102 102 False 0 +Fabric103 103 False 0 +Fabric104 104 False 0 +Fabric105 105 False 0 +Fabric106 106 False 0 +Fabric107 107 False 0 +Fabric108 108 False 0 +Fabric109 109 False 0 +Fabric110 110 False 0 +Fabric111 111 False 0 +Fabric112 112 False 0 +Fabric113 113 False 0 +Fabric114 114 False 0 +Fabric115 115 False 0 +Fabric116 116 False 0 +Fabric117 117 False 0 +Fabric118 118 False 0 +Fabric119 119 False 0 +Fabric120 120 False 0 +Fabric121 121 False 0 +Fabric122 122 False 0 +Fabric123 123 False 0 +Fabric124 124 False 0 +Fabric125 125 False 0 +Fabric126 126 False 0 +Fabric127 127 False 0 +Fabric128 128 False 0 +Fabric129 129 False 0 +Fabric130 130 False 0 +Fabric131 131 False 0 +Fabric132 132 False 0 +Fabric133 133 False 0 +Fabric134 134 False 0 +Fabric135 135 False 0 +Fabric136 136 False 0 +Fabric137 137 False 0 +Fabric138 138 False 0 +Fabric139 139 False 0 +Fabric140 140 False 0 +Fabric141 141 False 0 +Fabric142 142 False 0 +Fabric143 143 False 0 +Fabric144 144 False 0 +Fabric145 145 False 0 +Fabric146 146 False 0 +Fabric147 147 False 0 +Fabric148 148 False 0 +Fabric149 149 False 0 +Fabric150 150 False 0 +Fabric151 151 False 0 +Fabric152 152 False 0 +Fabric153 153 False 0 +Fabric154 154 False 0 +Fabric155 155 False 0 +Fabric156 156 False 0 +Fabric157 157 False 0 +Fabric158 158 False 0 +Fabric159 159 False 0 +Fabric160 160 False 0 +Fabric161 161 False 0 +Fabric162 162 False 0 +Fabric163 163 False 0 +Fabric164 164 False 0 +Fabric165 165 False 0 +Fabric166 166 False 0 +Fabric167 167 False 0 +Fabric168 168 False 0 +Fabric169 169 False 0 +Fabric170 170 False 0 +Fabric171 171 False 0 +Fabric172 172 False 0 +Fabric173 173 False 0 +Fabric174 174 False 0 +Fabric175 175 False 0 +Fabric176 176 False 0 +Fabric177 177 False 0 +Fabric178 178 False 0 +Fabric179 179 False 0 +Fabric180 180 False 0 +Fabric181 181 False 0 +Fabric182 182 False 0 +Fabric183 183 False 0 +Fabric184 184 False 0 +Fabric185 185 False 0 +Fabric186 186 False 0 +Fabric187 187 False 0 +Fabric188 188 False 0 +Fabric189 189 False 0 +Fabric190 190 False 0 +Fabric191 191 False 0 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/0/config-ramon-1-0.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/0/config-ramon-1-0.bcm index 4d84d93be146..3ebf67393531 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/0/config-ramon-1-0.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/0/config-ramon-1-0.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=1 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/0/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/0/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/0/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/1/config-ramon-1-1.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/1/config-ramon-1-1.bcm index 8bbe2ff74752..e4b15db2a021 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/1/config-ramon-1-1.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/1/config-ramon-1-1.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=2 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/1/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/1/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/1/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/10/config-ramon-6-0.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/10/config-ramon-6-0.bcm index 9f155988cff2..6bc3e88c91a3 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/10/config-ramon-6-0.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/10/config-ramon-6-0.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=11 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/10/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/10/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/10/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/11/config-ramon-6-1.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/11/config-ramon-6-1.bcm index 915ecc0777df..6fcec3b66c3e 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/11/config-ramon-6-1.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/11/config-ramon-6-1.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=12 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/11/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/11/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/11/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/12/config-ramon-7-0.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/12/config-ramon-7-0.bcm index 131c55e93c99..2e0aedcc03ba 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/12/config-ramon-7-0.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/12/config-ramon-7-0.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=13 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/12/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/12/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/12/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/13/config-ramon-7-1.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/13/config-ramon-7-1.bcm index 1096803edd2a..faea7ed7189a 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/13/config-ramon-7-1.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/13/config-ramon-7-1.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=14 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/13/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/13/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/13/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/14/config-ramon-8-0.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/14/config-ramon-8-0.bcm index 455ae7eae6a5..8a03f70e4064 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/14/config-ramon-8-0.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/14/config-ramon-8-0.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=15 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/14/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/14/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/14/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/15/config-ramon-8-1.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/15/config-ramon-8-1.bcm index ad2580fc9b69..94afa0bc139a 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/15/config-ramon-8-1.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/15/config-ramon-8-1.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=16 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/15/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/15/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/15/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/2/config-ramon-2-0.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/2/config-ramon-2-0.bcm index 21c77791667d..182fdc17615a 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/2/config-ramon-2-0.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/2/config-ramon-2-0.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=3 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/2/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/2/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/2/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/3/config-ramon-2-1.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/3/config-ramon-2-1.bcm index 3509b6ef3132..199a57b72b9f 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/3/config-ramon-2-1.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/3/config-ramon-2-1.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=4 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/3/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/3/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/3/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/4/config-ramon-3-0.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/4/config-ramon-3-0.bcm index f0be45c4da19..dac08d72acca 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/4/config-ramon-3-0.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/4/config-ramon-3-0.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=5 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/4/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/4/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/4/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/5/config-ramon-3-1.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/5/config-ramon-3-1.bcm index 358f96344b75..d60d6a4f7bee 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/5/config-ramon-3-1.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/5/config-ramon-3-1.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=6 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/5/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/5/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/5/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/6/config-ramon-4-0.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/6/config-ramon-4-0.bcm index c42441dbcbad..1b1932a99673 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/6/config-ramon-4-0.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/6/config-ramon-4-0.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=7 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/6/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/6/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/6/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/7/config-ramon-4-1.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/7/config-ramon-4-1.bcm index 761e75cccd86..8f7adaaff115 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/7/config-ramon-4-1.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/7/config-ramon-4-1.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=8 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/7/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/7/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/7/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/8/config-ramon-5-0.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/8/config-ramon-5-0.bcm index 524a2f4b3004..96ceaa6cfec2 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/8/config-ramon-5-0.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/8/config-ramon-5-0.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=9 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/8/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/8/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/8/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/9/config-ramon-5-1.bcm b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/9/config-ramon-5-1.bcm index 289ffff958d3..abc566225a23 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/9/config-ramon-5-1.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/9/config-ramon-5-1.bcm @@ -1,7 +1,7 @@ appl_enable_intr_init.BCM8879X=0 appl_param_module_id.BCM8879X=10 -bcm_linkscan_interval.BCM8879X=0 +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc bcm_stat_interval.BCM8879X=5000000 bist_enable.BCM8879X=0 core_clock_speed_khz.BCM8879X=1000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/9/sai_postinit_cmd.soc b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/9/sai_postinit_cmd.soc new file mode 100644 index 000000000000..bc73c6b1792f --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/9/sai_postinit_cmd.soc @@ -0,0 +1 @@ +linkscan interval=15000000 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/fabric_monitor_config.json b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/fabric_monitor_config.json new file mode 100644 index 000000000000..0476a2c15fd3 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/fabric_monitor_config.json @@ -0,0 +1,10 @@ +{ + "FABRIC_MONITOR_DATA": { + "monErrThreshCrcCells": 1, + "monErrThreshRxCells": 61035156, + "monPollThreshRecovery": 8, + "monPollThreshIsolation": 1, + "monCapacityThreshWarn": 10, + "monState": enable + } +} diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/fabric_port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/fabric_port_config.ini new file mode 100644 index 000000000000..1ffb084a1334 --- /dev/null +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/Nokia-IXR7250E-SUP-10/fabric_port_config.ini @@ -0,0 +1,193 @@ +# name lanes isolateStatus forceUnisolateStatus +Fabric0 0 False 0 +Fabric1 1 False 0 +Fabric2 2 False 0 +Fabric3 3 False 0 +Fabric4 4 False 0 +Fabric5 5 False 0 +Fabric6 6 False 0 +Fabric7 7 False 0 +Fabric8 8 False 0 +Fabric9 9 False 0 +Fabric10 10 False 0 +Fabric11 11 False 0 +Fabric12 12 False 0 +Fabric13 13 False 0 +Fabric14 14 False 0 +Fabric15 15 False 0 +Fabric16 16 False 0 +Fabric17 17 False 0 +Fabric18 18 False 0 +Fabric19 19 False 0 +Fabric20 20 False 0 +Fabric21 21 False 0 +Fabric22 22 False 0 +Fabric23 23 False 0 +Fabric24 24 False 0 +Fabric25 25 False 0 +Fabric26 26 False 0 +Fabric27 27 False 0 +Fabric28 28 False 0 +Fabric29 29 False 0 +Fabric30 30 False 0 +Fabric31 31 False 0 +Fabric32 32 False 0 +Fabric33 33 False 0 +Fabric34 34 False 0 +Fabric35 35 False 0 +Fabric36 36 False 0 +Fabric37 37 False 0 +Fabric38 38 False 0 +Fabric39 39 False 0 +Fabric40 40 False 0 +Fabric41 41 False 0 +Fabric42 42 False 0 +Fabric43 43 False 0 +Fabric44 44 False 0 +Fabric45 45 False 0 +Fabric46 46 False 0 +Fabric47 47 False 0 +Fabric48 48 False 0 +Fabric49 49 False 0 +Fabric50 50 False 0 +Fabric51 51 False 0 +Fabric52 52 False 0 +Fabric53 53 False 0 +Fabric54 54 False 0 +Fabric55 55 False 0 +Fabric56 56 False 0 +Fabric57 57 False 0 +Fabric58 58 False 0 +Fabric59 59 False 0 +Fabric60 60 False 0 +Fabric61 61 False 0 +Fabric62 62 False 0 +Fabric63 63 False 0 +Fabric64 64 False 0 +Fabric65 65 False 0 +Fabric66 66 False 0 +Fabric67 67 False 0 +Fabric68 68 False 0 +Fabric69 69 False 0 +Fabric70 70 False 0 +Fabric71 71 False 0 +Fabric72 72 False 0 +Fabric73 73 False 0 +Fabric74 74 False 0 +Fabric75 75 False 0 +Fabric76 76 False 0 +Fabric77 77 False 0 +Fabric78 78 False 0 +Fabric79 79 False 0 +Fabric80 80 False 0 +Fabric81 81 False 0 +Fabric82 82 False 0 +Fabric83 83 False 0 +Fabric84 84 False 0 +Fabric85 85 False 0 +Fabric86 86 False 0 +Fabric87 87 False 0 +Fabric88 88 False 0 +Fabric89 89 False 0 +Fabric90 90 False 0 +Fabric91 91 False 0 +Fabric92 92 False 0 +Fabric93 93 False 0 +Fabric94 94 False 0 +Fabric95 95 False 0 +Fabric96 96 False 0 +Fabric97 97 False 0 +Fabric98 98 False 0 +Fabric99 99 False 0 +Fabric100 100 False 0 +Fabric101 101 False 0 +Fabric102 102 False 0 +Fabric103 103 False 0 +Fabric104 104 False 0 +Fabric105 105 False 0 +Fabric106 106 False 0 +Fabric107 107 False 0 +Fabric108 108 False 0 +Fabric109 109 False 0 +Fabric110 110 False 0 +Fabric111 111 False 0 +Fabric112 112 False 0 +Fabric113 113 False 0 +Fabric114 114 False 0 +Fabric115 115 False 0 +Fabric116 116 False 0 +Fabric117 117 False 0 +Fabric118 118 False 0 +Fabric119 119 False 0 +Fabric120 120 False 0 +Fabric121 121 False 0 +Fabric122 122 False 0 +Fabric123 123 False 0 +Fabric124 124 False 0 +Fabric125 125 False 0 +Fabric126 126 False 0 +Fabric127 127 False 0 +Fabric128 128 False 0 +Fabric129 129 False 0 +Fabric130 130 False 0 +Fabric131 131 False 0 +Fabric132 132 False 0 +Fabric133 133 False 0 +Fabric134 134 False 0 +Fabric135 135 False 0 +Fabric136 136 False 0 +Fabric137 137 False 0 +Fabric138 138 False 0 +Fabric139 139 False 0 +Fabric140 140 False 0 +Fabric141 141 False 0 +Fabric142 142 False 0 +Fabric143 143 False 0 +Fabric144 144 False 0 +Fabric145 145 False 0 +Fabric146 146 False 0 +Fabric147 147 False 0 +Fabric148 148 False 0 +Fabric149 149 False 0 +Fabric150 150 False 0 +Fabric151 151 False 0 +Fabric152 152 False 0 +Fabric153 153 False 0 +Fabric154 154 False 0 +Fabric155 155 False 0 +Fabric156 156 False 0 +Fabric157 157 False 0 +Fabric158 158 False 0 +Fabric159 159 False 0 +Fabric160 160 False 0 +Fabric161 161 False 0 +Fabric162 162 False 0 +Fabric163 163 False 0 +Fabric164 164 False 0 +Fabric165 165 False 0 +Fabric166 166 False 0 +Fabric167 167 False 0 +Fabric168 168 False 0 +Fabric169 169 False 0 +Fabric170 170 False 0 +Fabric171 171 False 0 +Fabric172 172 False 0 +Fabric173 173 False 0 +Fabric174 174 False 0 +Fabric175 175 False 0 +Fabric176 176 False 0 +Fabric177 177 False 0 +Fabric178 178 False 0 +Fabric179 179 False 0 +Fabric180 180 False 0 +Fabric181 181 False 0 +Fabric182 182 False 0 +Fabric183 183 False 0 +Fabric184 184 False 0 +Fabric185 185 False 0 +Fabric186 186 False 0 +Fabric187 187 False 0 +Fabric188 188 False 0 +Fabric189 189 False 0 +Fabric190 190 False 0 +Fabric191 191 False 0 From f182d140b1d2a1bfea6a3a480f1de44731718d82 Mon Sep 17 00:00:00 2001 From: jfeng-arista <98421150+jfeng-arista@users.noreply.github.com> Date: Fri, 31 May 2024 09:59:58 -0700 Subject: [PATCH 208/282] Add monState field in config file so we can enable fabric link monitor (#19128) The fabric link monitoring feature is disabled by default, and we need to issue CLI to enable it. Before figuring out a more generic way of enable it by default, added a monState field in the fabric config file so we can enable the feature by default. --- .../Arista-7804R3-FM/fabric_monitor_config.json | 3 ++- .../Arista-7808R3-FM/fabric_monitor_config.json | 3 ++- .../Arista-7808R3A-FM/fabric_monitor_config.json | 3 ++- .../Arista-7800R3-48CQ2-C48/fabric_monitor_config.json | 3 ++- .../x86_64-arista_7800r3_48cq2_lc/fabric_monitor_config.json | 3 ++- .../Arista-7800R3-48CQM2-C48/fabric_monitor_config.json | 3 ++- .../x86_64-arista_7800r3_48cqm2_lc/fabric_monitor_config.json | 3 ++- .../Arista-7800R3A-36D2-C36/fabric_monitor_config.json | 3 ++- .../Arista-7800R3A-36D2-C72/fabric_monitor_config.json | 3 ++- .../Arista-7800R3A-36D2-D36/fabric_monitor_config.json | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/device/arista/x86_64-arista_7800_sup/Arista-7804R3-FM/fabric_monitor_config.json b/device/arista/x86_64-arista_7800_sup/Arista-7804R3-FM/fabric_monitor_config.json index 725eb9df5ea7..0476a2c15fd3 100644 --- a/device/arista/x86_64-arista_7800_sup/Arista-7804R3-FM/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800_sup/Arista-7804R3-FM/fabric_monitor_config.json @@ -4,6 +4,7 @@ "monErrThreshRxCells": 61035156, "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, - "monCapacityThreshWarn": 10 + "monCapacityThreshWarn": 10, + "monState": enable } } diff --git a/device/arista/x86_64-arista_7800_sup/Arista-7808R3-FM/fabric_monitor_config.json b/device/arista/x86_64-arista_7800_sup/Arista-7808R3-FM/fabric_monitor_config.json index 725eb9df5ea7..0476a2c15fd3 100644 --- a/device/arista/x86_64-arista_7800_sup/Arista-7808R3-FM/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800_sup/Arista-7808R3-FM/fabric_monitor_config.json @@ -4,6 +4,7 @@ "monErrThreshRxCells": 61035156, "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, - "monCapacityThreshWarn": 10 + "monCapacityThreshWarn": 10, + "monState": enable } } diff --git a/device/arista/x86_64-arista_7800_sup/Arista-7808R3A-FM/fabric_monitor_config.json b/device/arista/x86_64-arista_7800_sup/Arista-7808R3A-FM/fabric_monitor_config.json index 725eb9df5ea7..0476a2c15fd3 100644 --- a/device/arista/x86_64-arista_7800_sup/Arista-7808R3A-FM/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800_sup/Arista-7808R3A-FM/fabric_monitor_config.json @@ -4,6 +4,7 @@ "monErrThreshRxCells": 61035156, "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, - "monCapacityThreshWarn": 10 + "monCapacityThreshWarn": 10, + "monState": enable } } diff --git a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/fabric_monitor_config.json index 94def242e55d..f5a6ea72bca9 100644 --- a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/fabric_monitor_config.json @@ -4,6 +4,7 @@ "monErrThreshRxCells": 61035156, "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, - "monCapacityThreshWarn": 86 + "monCapacityThreshWarn": 86, + "monState": enable } } diff --git a/device/arista/x86_64-arista_7800r3_48cq2_lc/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3_48cq2_lc/fabric_monitor_config.json index 94def242e55d..f5a6ea72bca9 100644 --- a/device/arista/x86_64-arista_7800r3_48cq2_lc/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3_48cq2_lc/fabric_monitor_config.json @@ -4,6 +4,7 @@ "monErrThreshRxCells": 61035156, "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, - "monCapacityThreshWarn": 86 + "monCapacityThreshWarn": 86, + "monState": enable } } diff --git a/device/arista/x86_64-arista_7800r3_48cqm2_lc/Arista-7800R3-48CQM2-C48/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3_48cqm2_lc/Arista-7800R3-48CQM2-C48/fabric_monitor_config.json index 94def242e55d..f5a6ea72bca9 100644 --- a/device/arista/x86_64-arista_7800r3_48cqm2_lc/Arista-7800R3-48CQM2-C48/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3_48cqm2_lc/Arista-7800R3-48CQM2-C48/fabric_monitor_config.json @@ -4,6 +4,7 @@ "monErrThreshRxCells": 61035156, "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, - "monCapacityThreshWarn": 86 + "monCapacityThreshWarn": 86, + "monState": enable } } diff --git a/device/arista/x86_64-arista_7800r3_48cqm2_lc/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3_48cqm2_lc/fabric_monitor_config.json index 94def242e55d..f5a6ea72bca9 100644 --- a/device/arista/x86_64-arista_7800r3_48cqm2_lc/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3_48cqm2_lc/fabric_monitor_config.json @@ -4,6 +4,7 @@ "monErrThreshRxCells": 61035156, "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, - "monCapacityThreshWarn": 86 + "monCapacityThreshWarn": 86, + "monState": enable } } diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/fabric_monitor_config.json index 0f67504caa61..f34b21d3fbd6 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/fabric_monitor_config.json @@ -4,6 +4,7 @@ "monErrThreshRxCells": 61035156, "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, - "monCapacityThreshWarn": 100 + "monCapacityThreshWarn": 100, + "monState": enable } } diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/fabric_monitor_config.json index 94def242e55d..f5a6ea72bca9 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/fabric_monitor_config.json @@ -4,6 +4,7 @@ "monErrThreshRxCells": 61035156, "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, - "monCapacityThreshWarn": 86 + "monCapacityThreshWarn": 86, + "monState": enable } } diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/fabric_monitor_config.json index 0f67504caa61..f34b21d3fbd6 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/fabric_monitor_config.json @@ -4,6 +4,7 @@ "monErrThreshRxCells": 61035156, "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, - "monCapacityThreshWarn": 100 + "monCapacityThreshWarn": 100, + "monState": enable } } From 510ebb075b51b271628996eae4df665fa304be88 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Fri, 31 May 2024 16:49:09 -0400 Subject: [PATCH 209/282] [Nokia][supervisor] add linecard_reboot_timeout value to platform_env for Nokia-IXR7250E platform (#18862) This PR add the platform specified linecard_reboot_timeout value to the platform_evn.conf. It works PR sonic-net/sonic-platform-daemons#480 and sonic-net/sonic-utilities#3292 to address issue #18540 Signed-off-by: mlok --- device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_env.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_env.conf b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_env.conf index d4a267afb984..df041049bfb4 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_env.conf +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_env.conf @@ -2,3 +2,4 @@ usemsi=1 dmasize=128M default_mtu=9100 supervisor=1 +linecard_reboot_timeout=180 From b4c2ee0e5ce20b5aef6210d971f423cea5baa2c8 Mon Sep 17 00:00:00 2001 From: snider-nokia <76123698+snider-nokia@users.noreply.github.com> Date: Fri, 31 May 2024 19:28:21 -0400 Subject: [PATCH 210/282] Support SAI native ASIC DRAM thermal sensor polling (#19141) --- .../nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json | 8 ++++---- .../x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json | 4 ---- platform/broadcom/sonic-platform-modules-nokia | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json index 3980c99648bc..ab881c4ccfdd 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform.json @@ -68,11 +68,11 @@ "controllable": false }, { - "name": "ASIC0_dram-0x0", + "name": "ASIC0_9--DRAM0", "controllable": false }, { - "name": "ASIC0_dram-0x1", + "name": "ASIC0_10--DRAM1", "controllable": false }, { @@ -112,11 +112,11 @@ "controllable": false }, { - "name": "ASIC1_dram-0x0", + "name": "ASIC1_9--DRAM0", "controllable": false }, { - "name": "ASIC1_dram-0x1", + "name": "ASIC1_10--DRAM1", "controllable": false }, { diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json index 57bc959d7104..1ff090c31f33 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json @@ -28,10 +28,6 @@ "key": "sonic_bdb_mode", "intval": 0 }, - { - "key": "update_asic_pvt", - "intval": 10 - }, { "key": "amd_pcon", "intval": 4 diff --git a/platform/broadcom/sonic-platform-modules-nokia b/platform/broadcom/sonic-platform-modules-nokia index 20f82d0144b4..87915b72714d 160000 --- a/platform/broadcom/sonic-platform-modules-nokia +++ b/platform/broadcom/sonic-platform-modules-nokia @@ -1 +1 @@ -Subproject commit 20f82d0144b4afb71389f82636ba0e98a09c07a6 +Subproject commit 87915b72714d4f76f3ff1359fea730385235954b From ab08b78006d53f9536d0746434ffb632b1a39850 Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Mon, 3 Jun 2024 08:47:54 -0700 Subject: [PATCH 211/282] Revert "Reliable TSA implementation (#18928)" (#19173) This reverts commit 9d5fb207593d83661e18603141735fd05f222327. --- dockers/docker-fpm-frr/base_image_files/TS | 14 +- dockers/docker-fpm-frr/base_image_files/TSA | 13 +- dockers/docker-fpm-frr/base_image_files/TSB | 16 +- files/build_templates/docker_image_ctl.j2 | 8 - files/image_config/config-setup/config-setup | 6 - src/sonic-bgpcfgd/bgpcfgd/main.py | 2 - .../bgpcfgd/managers_chassis_app_db.py | 50 ------ .../bgpcfgd/managers_device_global.py | 23 +-- src/sonic-bgpcfgd/bgpcfgd/runner.py | 5 +- .../tests/test_chassis_app_db.py | 142 ------------------ src/sonic-bgpcfgd/tests/test_device_global.py | 65 +------- 11 files changed, 16 insertions(+), 328 deletions(-) delete mode 100644 src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py delete mode 100644 src/sonic-bgpcfgd/tests/test_chassis_app_db.py diff --git a/dockers/docker-fpm-frr/base_image_files/TS b/dockers/docker-fpm-frr/base_image_files/TS index 948da490f04a..fcff1f80674c 100755 --- a/dockers/docker-fpm-frr/base_image_files/TS +++ b/dockers/docker-fpm-frr/base_image_files/TS @@ -6,23 +6,13 @@ PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} if [[ $1 == "TSA" ]]; then - TSA_CHASSIS_STATE="$(sonic-db-cli CHASSIS_APP_DB HGET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled)" TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "true"}}}' - if [[ $TSA_CHASSIS_STATE == true ]]; then - log_msg='System Mode: Maintenance -> Maintenance' - else - log_msg='System Mode: Normal -> Maintenance' - fi + log_msg='System Mode: Normal -> Maintenance' err_msg='System is already in Maintenance' desired_tsa_state=true elif [[ $1 == "TSB" ]]; then - TSA_CHASSIS_STATE="$(sonic-db-cli CHASSIS_APP_DB HGET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled)" TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "false"}}}' - if [[ $TSA_CHASSIS_STATE == true ]]; then - log_msg='System Mode: Maintenance -> Maintenance' - else - log_msg='System Mode: Maintenance -> Normal' - fi + log_msg='System Mode: Maintenance -> Normal' err_msg='System is already in Normal mode' desired_tsa_state=false fi diff --git a/dockers/docker-fpm-frr/base_image_files/TSA b/dockers/docker-fpm-frr/base_image_files/TSA index 2cd29e92afb1..4b26b2d430b5 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSA +++ b/dockers/docker-fpm-frr/base_image_files/TSA @@ -7,18 +7,7 @@ if [ "$EUID" -ne 0 ] ; then fi if [ -f /etc/sonic/chassisdb.conf ]; then - CHASSIS_TSA_STATE_UPDATE="CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL\|STATE" tsa_enabled "true"" - CONFIG_DB_TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "true"}}}' - current_tsa_state="$(sonic-cfggen -d -v BGP_DEVICE_GLOBAL.STATE.tsa_enabled)" - if [[ $current_tsa_state == true ]]; then - echo "Chassis is already in Maintenance" - logger -t TSA -p user.info "Chassis is already in Maintenance" - else - sonic-db-cli $CHASSIS_TSA_STATE_UPDATE - sonic-cfggen -a "$CONFIG_DB_TSA_STATE_UPDATE" -w - echo "Chassis Mode: Normal -> Maintenance" - logger -t TSA -p user.info "Chassis Mode: Normal -> Maintenance" - fi + rexec all -c "sudo TSA chassis" echo "Please execute \"rexec all -c 'sudo config save -y'\" to preserve System mode in Maintenance after reboot\ or config reload on all linecards" exit 0 diff --git a/dockers/docker-fpm-frr/base_image_files/TSB b/dockers/docker-fpm-frr/base_image_files/TSB index c09126e1d12d..ec353148a72f 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSB +++ b/dockers/docker-fpm-frr/base_image_files/TSB @@ -6,21 +6,11 @@ if [ "$EUID" -ne 0 ] ; then exit 1 fi +# If run on supervisor of chassis, trigger remote execution of TSB on all linecards if [ -f /etc/sonic/chassisdb.conf ]; then - CHASSIS_TSA_STATE_UPDATE="CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL\|STATE" tsa_enabled "false"" - CONFIG_DB_TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "false"}}}' - current_tsa_state="$(sonic-cfggen -d -v BGP_DEVICE_GLOBAL.STATE.tsa_enabled)" - if [[ $current_tsa_state == false ]]; then - echo "Chassis is already in Normal mode" - logger -t TSB -p user.info "Chassis is already in Normal mode" - else - sonic-db-cli $CHASSIS_TSA_STATE_UPDATE - sonic-cfggen -a "$CONFIG_DB_TSA_STATE_UPDATE" -w - echo "Chassis Mode: Maintenance -> Normal" - logger -t TSB -p user.info "Chassis Mode: Maintenance -> Normal" - fi + rexec all -c "sudo TSB chassis" echo "Please execute \"rexec all -c 'sudo config save -y'\" to preserve System mode in Normal state after reboot\ - or config reload on all linecards" + or config reload on all linecards" exit 0 fi diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 626c2de63139..f0208d32f1e5 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -269,14 +269,6 @@ function postStartAction() $SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" fi - # In SUP, enforce CHASSIS_APP_DB.tsa_enabled to be in sync with BGP_DEVICE_GLOBAL.STATE.tsa_enabled - if [[ -z "$DEV" ]] && [[ -f /etc/sonic/chassisdb.conf ]]; then - tsa_cfg="$($SONIC_DB_CLI CONFIG_DB HGET "BGP_DEVICE_GLOBAL|STATE" "tsa_enabled")" - if [[ -n "$tsa_cfg" ]]; then - docker exec -i ${DOCKERNAME} $SONIC_DB_CLI CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled ${tsa_cfg} - fi - fi - # Add redis UDS to the redis group and give read/write access to the group REDIS_SOCK="/var/run/redis${DEV}/redis.sock" else diff --git a/files/image_config/config-setup/config-setup b/files/image_config/config-setup/config-setup index f66409913e01..21d56217c349 100755 --- a/files/image_config/config-setup/config-setup +++ b/files/image_config/config-setup/config-setup @@ -330,12 +330,6 @@ do_db_migration() /usr/local/bin/db_migrator.py -o migrate fi sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" - #Enforce CHASSIS_APP_DB.tsa_enabled to be in sync with BGP_DEVICE_GLOBAL.STATE.tsa_enabled - - if [[ -f /etc/sonic/chassisdb.conf ]]; then - tsa_cfg="$(sonic-db-cli CONFIG_DB HGET "BGP_DEVICE_GLOBAL|STATE" "tsa_enabled")" - sonic-db-cli CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled ${tsa_cfg} - fi } # Perform configuration migration from backup copy. diff --git a/src/sonic-bgpcfgd/bgpcfgd/main.py b/src/sonic-bgpcfgd/bgpcfgd/main.py index b6580ab91121..624d311037ad 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/main.py +++ b/src/sonic-bgpcfgd/bgpcfgd/main.py @@ -20,7 +20,6 @@ from .managers_static_rt import StaticRouteMgr from .managers_rm import RouteMapMgr from .managers_device_global import DeviceGlobalCfgMgr -from .managers_chassis_app_db import ChassisAppDbMgr from .static_rt_timer import StaticRouteTimer from .runner import Runner, signal_handler from .template import TemplateFabric @@ -74,7 +73,6 @@ def do_work(): RouteMapMgr(common_objs, "APPL_DB", swsscommon.APP_BGP_PROFILE_TABLE_NAME), # Device Global Manager DeviceGlobalCfgMgr(common_objs, "CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME), - ChassisAppDbMgr(common_objs, "CHASSIS_APP_DB", "BGP_DEVICE_GLOBAL"), ] runner = Runner(common_objs['cfg_mgr']) for mgr in managers: diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py b/src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py deleted file mode 100644 index 7969ae828d80..000000000000 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py +++ /dev/null @@ -1,50 +0,0 @@ -from .manager import Manager -from .managers_device_global import DeviceGlobalCfgMgr -from .log import log_err, log_debug, log_notice -import re -from swsscommon import swsscommon - -class ChassisAppDbMgr(Manager): - """This class responds to change in tsa_enabled state of the supervisor""" - - def __init__(self, common_objs, db, table): - """ - Initialize the object - :param common_objs: common object dictionary - :param db: name of the db - :param table: name of the table in the db - """ - self.lc_tsa = "" - self.directory = common_objs['directory'] - self.dev_cfg_mgr = DeviceGlobalCfgMgr(common_objs, "CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME) - self.directory.subscribe([("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"),], self.on_lc_tsa_status_change) - super(ChassisAppDbMgr, self).__init__( - common_objs, - [], - db, - table, - ) - - def on_lc_tsa_status_change(self): - if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"): - self.lc_tsa = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["tsa_enabled"] - log_debug("ChassisAppDbMgr:: LC TSA update handler status %s" % self.lc_tsa) - - def set_handler(self, key, data): - log_debug("ChassisAppDbMgr:: set handler") - - if not data: - log_err("ChassisAppDbMgr:: data is None") - return False - - if "tsa_enabled" in data: - if self.lc_tsa == "false": - self.dev_cfg_mgr.cfg_mgr.commit() - self.dev_cfg_mgr.cfg_mgr.update() - self.dev_cfg_mgr.isolate_unisolate_device(data["tsa_enabled"]) - return True - return False - - def del_handler(self, key): - log_debug("ChassisAppDbMgr:: del handler") - return True diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py index 639624128820..5c42e4415f16 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py @@ -14,7 +14,6 @@ def __init__(self, common_objs, db, table): :param table: name of the table in the db """ self.switch_type = "" - self.chassis_tsa = "" self.directory = common_objs['directory'] self.cfg_mgr = common_objs['cfg_mgr'] self.constants = common_objs['constants'] @@ -55,13 +54,12 @@ def set_handler(self, key, data): if "tsa_enabled" in data: self.directory.put(self.db_name, self.table_name, "tsa_enabled", data["tsa_enabled"]) - - self.chassis_tsa = self.get_chassis_tsa_status() - if self.chassis_tsa == "false" and tsa_status != data["tsa_enabled"]: + if tsa_status != data["tsa_enabled"]: self.cfg_mgr.commit() self.cfg_mgr.update() self.isolate_unisolate_device(data["tsa_enabled"]) + if "idf_isolation_state" in data: self.directory.put(self.db_name, self.table_name, "idf_isolation_state", data["idf_isolation_state"]) if idf_isolation_state != data["idf_isolation_state"]: @@ -81,9 +79,7 @@ def check_state_and_get_tsa_routemaps(self, cfg): cmd = "" if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"): tsa_status = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["tsa_enabled"] - chassis_tsa = self.get_chassis_tsa_status() - - if tsa_status == "true" or chassis_tsa == "true": + if tsa_status == "true": cmds = cfg.replace("#012", "\n").split("\n") log_notice("DeviceGlobalCfgMgr:: Device is isolated. Applying TSA route-maps") cmd = self.get_ts_routemaps(cmds, self.tsa_template) @@ -137,17 +133,6 @@ def __extract_out_route_map_names(self, cmds): route_map_names.add(result.group(1)) return route_map_names - def get_chassis_tsa_status(self): - chassis_tsa_status = "false" - try: - ch = swsscommon.SonicV2Connector(use_unix_socket_path=False) - ch.connect(ch.CHASSIS_APP_DB, False) - chassis_tsa_status = ch.get(ch.CHASSIS_APP_DB, "BGP_DEVICE_GLOBAL|STATE", 'tsa_enabled') - except Exception: - pass - - return chassis_tsa_status - def downstream_isolate_unisolate(self, idf_isolation_state): cmd = "\n" if idf_isolation_state == "unisolated": @@ -168,4 +153,4 @@ def check_state_and_get_idf_isolation_routemaps(self): if idf_isolation_state != "unisolated": log_notice("DeviceGlobalCfgMgr:: IDF is isolated. Applying required route-maps") cmd = self.idf_isolate_template.render(isolation_status=idf_isolation_state, constants=self.constants) - return cmd + return cmd \ No newline at end of file diff --git a/src/sonic-bgpcfgd/bgpcfgd/runner.py b/src/sonic-bgpcfgd/bgpcfgd/runner.py index 75df6f902e9a..4c160e5967cf 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/runner.py +++ b/src/sonic-bgpcfgd/bgpcfgd/runner.py @@ -39,10 +39,7 @@ def add_manager(self, manager): table_name = manager.get_table_name() db = swsscommon.SonicDBConfig.getDbId(db_name) if db not in self.db_connectors: - if db_name == "CHASSIS_APP_DB": - self.db_connectors[db] = swsscommon.DBConnector(db_name, 0, True, '') - else: - self.db_connectors[db] = swsscommon.DBConnector(db_name, 0) + self.db_connectors[db] = swsscommon.DBConnector(db_name, 0) if table_name not in self.callbacks[db]: conn = self.db_connectors[db] diff --git a/src/sonic-bgpcfgd/tests/test_chassis_app_db.py b/src/sonic-bgpcfgd/tests/test_chassis_app_db.py deleted file mode 100644 index edb08595ade1..000000000000 --- a/src/sonic-bgpcfgd/tests/test_chassis_app_db.py +++ /dev/null @@ -1,142 +0,0 @@ -from unittest.mock import MagicMock, patch - -import os -from bgpcfgd.directory import Directory -from bgpcfgd.template import TemplateFabric -from . import swsscommon_test -from .util import load_constants -import bgpcfgd.managers_chassis_app_db -import bgpcfgd.managers_device_global -from swsscommon import swsscommon -from copy import deepcopy - -TEMPLATE_PATH = os.path.abspath('../../dockers/docker-fpm-frr/frr') -BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/general/peer-group.conf/') -INTERNAL_BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/internal/peer-group.conf/') -global_constants = { - "bgp": { - "traffic_shift_community" :"12345:12345", - "internal_community_match_tag" : "1001" - } -} - -def constructor(check_internal=False): - cfg_mgr = MagicMock() - def get_text(): - text = [] - for line in cfg_mgr.changes.split('\n'): - if line.lstrip().startswith('!'): - continue - text.append(line) - text += [" "] - return text - def update(): - if check_internal: - cfg_mgr.changes = get_string_from_file("/result_chasiss_packet.conf", INTERNAL_BASE_PATH) - else: - cfg_mgr.changes = get_string_from_file("/result_all.conf") - def push(cfg): - cfg_mgr.changes += cfg + "\n" - def get_config(): - return cfg_mgr.changes - cfg_mgr.get_text = get_text - cfg_mgr.update = update - cfg_mgr.push = push - cfg_mgr.get_config = get_config - - constants = deepcopy(global_constants) - common_objs = { - 'directory': Directory(), - 'cfg_mgr': cfg_mgr, - 'tf': TemplateFabric(TEMPLATE_PATH), - 'constants': constants - } - mgr = bgpcfgd.managers_chassis_app_db.ChassisAppDbMgr(common_objs, "CHASSIS_APP_DB", "BGP_DEVICE_GLOBAL") - cfg_mgr.update() - return mgr - - -@patch('bgpcfgd.managers_device_global.log_debug') -def test_isolate_device(mocked_log_info): - m = constructor() - - m.lc_tsa = "false" - res = m.set_handler("STATE", {"tsa_enabled": "true"}) - assert res, "Expect True return value for set_handler" - mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") - assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_isolate.conf") - - curr_cfg = m.cfg_mgr.get_config() - m.lc_tsa = "true" - res = m.set_handler("STATE", {"tsa_enabled": "true"}) - assert res, "Expect True return value for set_handler" - assert m.cfg_mgr.get_config() == curr_cfg - -@patch('bgpcfgd.managers_device_global.log_debug') -def test_isolate_device_internal_session(mocked_log_info): - m = constructor(check_internal=True) - - m.lc_tsa = "false" - res = m.set_handler("STATE", {"tsa_enabled": "true"}) - assert res, "Expect True return value for set_handler" - mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") - assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_isolate.conf", INTERNAL_BASE_PATH) - - curr_cfg = m.cfg_mgr.get_config() - m.lc_tsa = "true" - res = m.set_handler("STATE", {"tsa_enabled": "true"}) - assert res, "Expect True return value for set_handler" - assert m.cfg_mgr.get_config() == curr_cfg - - -@patch('bgpcfgd.managers_device_global.log_debug') -def test_unisolate_device(mocked_log_info): - m = constructor() - - m.lc_tsa = "false" - res = m.set_handler("STATE", {"tsa_enabled": "false"}) - assert res, "Expect True return value for set_handler" - mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") - assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_unisolate.conf") - - curr_cfg = m.cfg_mgr.get_config() - m.lc_tsa = "true" - res = m.set_handler("STATE", {"tsa_enabled": "false"}) - assert res, "Expect True return value for set_handler" - assert m.cfg_mgr.get_config() == curr_cfg - -@patch('bgpcfgd.managers_device_global.log_debug') -def test_unisolate_device_internal_session(mocked_log_info): - m = constructor(check_internal=True) - - m.lc_tsa = "false" - res = m.set_handler("STATE", {"tsa_enabled": "false"}) - assert res, "Expect True return value for set_handler" - mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") - assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_unisolate.conf", INTERNAL_BASE_PATH) - - curr_cfg = m.cfg_mgr.get_config() - m.lc_tsa = "true" - res = m.set_handler("STATE", {"tsa_enabled": "false"}) - assert res, "Expect True return value for set_handler" - assert m.cfg_mgr.get_config() == curr_cfg - - -def get_string_from_file(filename, base_path=BASE_PATH): - fp = open(base_path + filename, "r") - cfg = fp.read() - fp.close() - - return cfg - -@patch('bgpcfgd.managers_chassis_app_db.log_err') -def test_set_handler_failure_case(mocked_log_info): - m = constructor() - res = m.set_handler("STATE", {}) - assert res == False, "Expect False return value for invalid data passed to set_handler" - mocked_log_info.assert_called_with("ChassisAppDbMgr:: data is None") - -def test_del_handler(): - m = constructor() - res = m.del_handler("STATE") - assert res, "Expect True return value for del_handler" diff --git a/src/sonic-bgpcfgd/tests/test_device_global.py b/src/sonic-bgpcfgd/tests/test_device_global.py index bed0a3271a05..12dd895f58d7 100644 --- a/src/sonic-bgpcfgd/tests/test_device_global.py +++ b/src/sonic-bgpcfgd/tests/test_device_global.py @@ -55,24 +55,14 @@ def get_config(): return mgr -@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_isolate_device(mocked_log_info, mock_get_chassis_tsa_status): +def test_isolate_device(mocked_log_info): m = constructor() - - mock_get_chassis_tsa_status.return_value = "false" res = m.set_handler("STATE", {"tsa_enabled": "true"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_isolate.conf") - curr_cfg = m.cfg_mgr.get_config() - mock_get_chassis_tsa_status.return_value = "true" - res = m.set_handler("STATE", {"tsa_enabled": "true"}) - assert res, "Expect True return value for set_handler" - assert m.cfg_mgr.get_config() == curr_cfg - - @patch('bgpcfgd.managers_device_global.log_debug') def test_idf_isolation_no_export(mocked_log_info): m = constructor() @@ -98,89 +88,44 @@ def test_idf_unisolation(mocked_log_info): mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_unisolated.conf") -@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_isolate_device_internal_session(mocked_log_info, mock_get_chassis_tsa_status): +def test_isolate_device_internal_session(mocked_log_info): m = constructor(check_internal=True) - - mock_get_chassis_tsa_status.return_value = "false" res = m.set_handler("STATE", {"tsa_enabled": "true"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_isolate.conf", INTERNAL_BASE_PATH) - curr_cfg = m.cfg_mgr.get_config() - mock_get_chassis_tsa_status.return_value = "true" - res = m.set_handler("STATE", {"tsa_enabled": "true"}) - assert res, "Expect True return value for set_handler" - assert m.cfg_mgr.get_config() == curr_cfg - -@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_unisolate_device(mocked_log_info, mock_get_chassis_tsa_status): +def test_unisolate_device(mocked_log_info): m = constructor() - - mock_get_chassis_tsa_status.return_value = "false" m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") - res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_unisolate.conf") - curr_cfg = m.cfg_mgr.get_config() - mock_get_chassis_tsa_status.return_value = "true" - res = m.set_handler("STATE", {"tsa_enabled": "false"}) - assert res, "Expect True return value for set_handler" - assert m.cfg_mgr.get_config() == curr_cfg - - -@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_unisolate_device_internal_session(mocked_log_info, mock_get_chassis_tsa_status): +def test_unisolate_device_internal_session(mocked_log_info): m = constructor(check_internal=True) - - mock_get_chassis_tsa_status.return_value = "false" m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") - res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_unisolate.conf", INTERNAL_BASE_PATH) - curr_cfg = m.cfg_mgr.get_config() - mock_get_chassis_tsa_status.return_value = "true" - res = m.set_handler("STATE", {"tsa_enabled": "false"}) - assert res, "Expect True return value for set_handler" - assert m.cfg_mgr.get_config() == curr_cfg - -@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') -def test_check_state_and_get_tsa_routemaps(mock_get_chassis_tsa_status): +def test_check_state_and_get_tsa_routemaps(): m = constructor() - - mock_get_chassis_tsa_status.return_value = "false" m.set_handler("STATE", {"tsa_enabled": "true"}) res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) assert res == get_string_from_file("/result_isolate.conf") - mock_get_chassis_tsa_status.return_value = "true" - m.set_handler("STATE", {"tsa_enabled": "true"}) - res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) - assert res == get_string_from_file("/result_isolate.conf") - - mock_get_chassis_tsa_status.return_value = "false" m.set_handler("STATE", {"tsa_enabled": "false"}) res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) assert res == "" - mock_get_chassis_tsa_status.return_value = "true" - m.set_handler("STATE", {"tsa_enabled": "false"}) - res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) - assert res == get_string_from_file("/result_isolate.conf") - - def test_check_state_and_get_idf_isolation_routemaps(): m = constructor() m.set_handler("STATE", {"idf_isolation_state": "isolated_no_export"}) From 9cbaf42f10a6843ec16c1c8a70c8cfa0853caf78 Mon Sep 17 00:00:00 2001 From: Hasan Naqvi <56742004+hasan-brcm@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:48:43 -0700 Subject: [PATCH 212/282] [Frr]: Frr bookworm upgrade (#18233) Co-authored-by: Kalimuthu Velappan --- dockers/docker-fpm-frr/Dockerfile.j2 | 2 +- rules/docker-fpm-frr.mk | 10 +++++----- rules/libyang.mk | 3 --- src/sonic-bgpcfgd/tests/test_bbr.py | 5 +++-- src/sonic-bgpcfgd/tests/test_setsrc.py | 6 ++++-- src/sonic-frr/Makefile | 3 +++ 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/dockers/docker-fpm-frr/Dockerfile.j2 b/dockers/docker-fpm-frr/Dockerfile.j2 index d0cb32d02ec5..b0dc413c8c89 100644 --- a/dockers/docker-fpm-frr/Dockerfile.j2 +++ b/dockers/docker-fpm-frr/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-swss-layer-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} +FROM docker-swss-layer-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} ARG docker_container_name ARG frr_user_uid diff --git a/rules/docker-fpm-frr.mk b/rules/docker-fpm-frr.mk index b866960d6d73..f3353e3a34d9 100644 --- a/rules/docker-fpm-frr.mk +++ b/rules/docker-fpm-frr.mk @@ -8,13 +8,13 @@ $(DOCKER_FPM_FRR)_PATH = $(DOCKERS_PATH)/$(DOCKER_FPM_FRR_STEM) $(DOCKER_FPM_FRR)_PYTHON_WHEELS += $(SONIC_BGPCFGD) $(SONIC_FRR_MGMT_FRAMEWORK) $(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(FRR_SNMP) $(SWSS) $(LIBYANG2) $(SONIC_RSYSLOG_PLUGIN) -$(DOCKER_FPM_FRR)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_DEPENDS) +$(DOCKER_FPM_FRR)_DBG_DEPENDS = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_DEPENDS) $(DOCKER_FPM_FRR)_DBG_DEPENDS += $(SWSS_DBG) $(LIBSWSSCOMMON_DBG) \ $(FRR_DBG) $(FRR_SNMP_DBG) $(LIBYANG2_DBG) $(SONIC_RSYSLOG_PLUGIN) -$(DOCKER_FPM_FRR)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BULLSEYE)_DBG_IMAGE_PACKAGES) +$(DOCKER_FPM_FRR)_DBG_IMAGE_PACKAGES = $($(DOCKER_SWSS_LAYER_BOOKWORM)_DBG_IMAGE_PACKAGES) -$(DOCKER_FPM_FRR)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BULLSEYE) +$(DOCKER_FPM_FRR)_LOAD_DOCKERS += $(DOCKER_SWSS_LAYER_BOOKWORM) $(DOCKER_FPM_FRR)_VERSION = 1.0.0 $(DOCKER_FPM_FRR)_PACKAGE_NAME = fpm-frr @@ -42,5 +42,5 @@ $(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += TSC:/usr/bin/TSC $(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += TS:/usr/bin/TS $(DOCKER_FPM_FRR)_BASE_IMAGE_FILES += idf_isolation:/usr/bin/idf_isolation -SONIC_BULLSEYE_DOCKERS += $(DOCKER_FPM_FRR) -SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_FPM_FRR_DBG) +SONIC_BOOKWORM_DOCKERS += $(DOCKER_FPM_FRR) +SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_FPM_FRR_DBG) diff --git a/rules/libyang.mk b/rules/libyang.mk index 6f7483ee5bd6..a8e6734459ea 100644 --- a/rules/libyang.mk +++ b/rules/libyang.mk @@ -12,10 +12,7 @@ LIBYANG = libyang_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb $(LIBYANG)_SRC_PATH = $(SRC_PATH)/libyang # introduce artifical dependency between LIBYANG and FRR # make sure LIBYANG is compile after FRR -# TODO: Remove once snmp build has been updated -ifeq ($(BLDENV),bullseye) $(LIBYANG)_AFTER = $(FRR) -endif SONIC_MAKE_DEBS += $(LIBYANG) LIBYANG_DEV = libyang-dev_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb diff --git a/src/sonic-bgpcfgd/tests/test_bbr.py b/src/sonic-bgpcfgd/tests/test_bbr.py index b11277bae7b8..b95b94493af4 100644 --- a/src/sonic-bgpcfgd/tests/test_bbr.py +++ b/src/sonic-bgpcfgd/tests/test_bbr.py @@ -5,9 +5,10 @@ from copy import deepcopy from . import swsscommon_test +import sys +sys.modules["swsscommon"] = swsscommon_test -with patch.dict("sys.modules", swsscommon=swsscommon_test): - from bgpcfgd.managers_bbr import BBRMgr +from bgpcfgd.managers_bbr import BBRMgr global_constants = { "bgp": { diff --git a/src/sonic-bgpcfgd/tests/test_setsrc.py b/src/sonic-bgpcfgd/tests/test_setsrc.py index 4de72102b613..17d6ea96f2e9 100644 --- a/src/sonic-bgpcfgd/tests/test_setsrc.py +++ b/src/sonic-bgpcfgd/tests/test_setsrc.py @@ -7,8 +7,10 @@ from . import swsscommon_test from swsscommon import swsscommon -with patch.dict("sys.modules", swsscommon=swsscommon_test): - from bgpcfgd.managers_setsrc import ZebraSetSrc +import sys +sys.modules["swsscommon"] = swsscommon_test + +from bgpcfgd.managers_setsrc import ZebraSetSrc TEMPLATE_PATH = os.path.abspath('../../dockers/docker-fpm-frr/frr') diff --git a/src/sonic-frr/Makefile b/src/sonic-frr/Makefile index 704786daae17..c7c43ccecc0e 100644 --- a/src/sonic-frr/Makefile +++ b/src/sonic-frr/Makefile @@ -7,6 +7,9 @@ DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG) $(FRR_SNMP) $(FRR_SNMP_DBG) SUFFIX = $(shell date +%Y%m%d\.%H%M%S) STG_BRANCH = stg_temp.$(SUFFIX) +# DEBEMAIL required by gpb dch +export DEBEMAIL := sonicproject@googlegroups.com + $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build the package pushd ./frr From 9d9d843c950795be7e0cf5034aeb5935b66d1490 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:01:08 +0800 Subject: [PATCH 213/282] [submodule] Update submodule sonic-restapi to the latest HEAD automatically (#19169) #### Why I did it src/sonic-restapi ``` * 4a564ba - (HEAD -> master, origin/master, origin/HEAD) Fix buster-backports debian mirror issue. (#152) (4 days ago) [Liu Shilong] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-restapi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-restapi b/src/sonic-restapi index 24d440ff6469..4a564baddf7a 160000 --- a/src/sonic-restapi +++ b/src/sonic-restapi @@ -1 +1 @@ -Subproject commit 24d440ff6469432001a82be3e6f44579afcba395 +Subproject commit 4a564baddf7abe8fb904ed9fbb4f713954a84573 From 15e4976155bdfb594c5d1c94bc92371589ee42a3 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:01:13 +0800 Subject: [PATCH 214/282] [submodule] Update submodule sonic-mgmt-common to the latest HEAD automatically (#19168) #### Why I did it src/sonic-mgmt-common ``` * 81bf799 - (HEAD -> master, origin/master, origin/HEAD) Adding subscription support for ethernet interfaces. (#140) (3 days ago) [Nikita Agarwal] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-mgmt-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-common b/src/sonic-mgmt-common index 8b18795325b2..81bf799d8e34 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit 8b18795325b2b47f8863ab9497fa844501a2f08c +Subproject commit 81bf799d8e346817ccd335dcd4da6258f8edd7f1 From f4fa96c215cafb6c19b3729c98c885d27675aae8 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:01:18 +0800 Subject: [PATCH 215/282] [submodule] Update submodule sonic-host-services to the latest HEAD automatically (#19167) #### Why I did it src/sonic-host-services ``` * 29a04f5 - (HEAD -> master, origin/master, origin/HEAD) Add dbus service to support restart and kill process (#111) (4 days ago) [isabelmsft] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-host-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services b/src/sonic-host-services index 36e410d24e66..29a04f5bc06f 160000 --- a/src/sonic-host-services +++ b/src/sonic-host-services @@ -1 +1 @@ -Subproject commit 36e410d24e66ab717c3c83e95630436cc6efb729 +Subproject commit 29a04f5bc06fbb2772565d404d91e0452d229f19 From 359453e2412d9ee69f9114ac2b16591789692d33 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:01:32 +0800 Subject: [PATCH 216/282] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#19130) #### Why I did it src/sonic-platform-daemons ``` * 76cf1dc - (HEAD -> master, origin/master, origin/HEAD) Fix for #19116 [xcvrd] typo "log_notifce" results in port oper down (#493) (4 days ago) [Anoop Kamath] * f41ecca - Implementation of a Monitoring Daemon for storage devices in SONiC switches (#433) (4 days ago) [Ashwin Srinivasan] * 28302d4 - Update for the procedures for insertion/hot swap of Switch Fabric Module (SFM) by using "config chassis modules shutdown/startup" commands (#491) (5 days ago) [JunhongMao] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 9ffce2036d53..76cf1dc9fd8f 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 9ffce2036d53571bd23b4a630ac285039e383c4f +Subproject commit 76cf1dc9fd8fb609dbf071be7028c09b61c83815 From 99b31c22e00e8844985ca4abf08b6cb3eb3537c1 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:01:37 +0800 Subject: [PATCH 217/282] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#19129) #### Why I did it src/sonic-gnmi ``` * 50817e6 - (HEAD -> master, origin/master, origin/HEAD) Add KillProcess gNOI API (#213) (3 days ago) [isabelmsft] * 3ea4fe5 - Revert "Account for GLOBAL key in PFC_WD (#178)" (#221) (5 days ago) [Zain Budhwani] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index 585f4419f983..50817e697d3c 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit 585f4419f983b8d931121fdcb8acfe549bb06fba +Subproject commit 50817e697d3c85abc8aac7d4a1565e003bf5159a From 3bfbb15f16fc8aad953571d2561add22daabdbce Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Tue, 4 Jun 2024 20:57:23 +0800 Subject: [PATCH 218/282] [ci] Fix false reference in docker slave build pipeline. #19188 Why I did it When upgrade to bookworm container, this file is changed by mistake. bookworm branch is out of date. It breaks pipeline to build sonic-slave-*. Work item tracking Microsoft ADO (number only): 28290170 How I did it How to verify it --- .azure-pipelines/docker-sonic-slave.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index 9633c32f607b..9d8b30210ac4 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -8,7 +8,7 @@ resources: - repository: buildimage type: github name: sonic-net/sonic-buildimage - ref: bookworm + ref: master endpoint: sonic-net schedules: From f7d86153e5910927219c867ab45ba4f09dbb1fdb Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Jun 2024 22:01:08 +0800 Subject: [PATCH 219/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### Why I did it src/sonic-swss ``` * 98012ed4 - (HEAD -> master, origin/master, origin/HEAD) [build-docker-sonic-vs] Allowing partial build for sairedis (#3177) (3 days ago) [Nikola Dancejic] * 6568193c - Do not apply QoS mapping item on the switch until the object is created (#3163) (3 days ago) [Stephen Sun] * 1876a306 - Revert "Added support for "UNDERLAY_SET_DSCP" and "UNDERLAY_SET_DSCPV6" table…" (#3175) (3 days ago) [Prince Sunny] * 1f12a8db - [subnet decap] Add subnet decap rule based on overlay ECMP (#3153) (3 days ago) [Longxiang Lyu] * 8e8fc66c - [ci] Migrate from sonicbld to sonicbld-1es to fix S360 alert. (#3171) (4 days ago) [Liu Shilong] * 4ae8bfa3 - Read switch_id of fabric switch from config_db (#3102) (4 days ago) [Song Yuan] * f7376636 - Add sai call to isolate/unisolate a fabric port (#3141) (4 days ago) [jfeng-arista] * 7c7cece4 - [Chassis][voq] remote link down ECMP acceleration (#3150) (4 days ago) [Arvindsrinivasan Lakshmi Narasimhan] * c7ecd7db - Add fabric port monitoring toggle check (#3132) (4 days ago) [jfeng-arista] * 9ffbcd58 - Added support for "UNDERLAY_SET_DSCP" and "UNDERLAY_SET_DSCPV6" tables (#3145) (4 days ago) [siqbal1986] * ef9dcdbe - Handle learning duplicate IPs on different VRFs (#3165) (5 days ago) [Lawrence Lee] * cc5a02c4 - [ci] use sonictest instead of sonic-common-test #3170 (6 days ago) [Liu Shilong] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 835e576dbaca..98012ed411d4 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 835e576dbaca4391277002f1856db629f91d783f +Subproject commit 98012ed411d4e83ac01dabbb6d03e4f122ad1545 From f01becdd0d382af7f9e681d7dc3e8c0447f9d970 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 4 Jun 2024 22:01:16 +0800 Subject: [PATCH 220/282] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#19121) #### Why I did it src/sonic-swss-common ``` * 391e27b - (HEAD -> master, origin/master, origin/HEAD) Add new table schema for BMP feature. (#879) (4 days ago) [Feng-msft] * 138b32e - [swig]: Fix swig template memory leak on issue 17025 (#876) (6 days ago) [Ze Gan] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 3750752dfaf6..391e27bd6769 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 3750752dfaf68d3d2cecf49ad77cdadde3c9a955 +Subproject commit 391e27bd6769fa64d483c2c67a1079c174f4975f From c2d06ee77a6d114e8c6ef19d708f33ca1ca78395 Mon Sep 17 00:00:00 2001 From: Tomer Shalvi <116184476+tshalvi@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:18:52 +0300 Subject: [PATCH 221/282] [Mellanox] Validate Module Presence Via Sysfs Before Accessing EEPROM in Thermal Control Daemon (#19178) - Why I did it Currently, on Mellanox platforms, when trying to read from the EEPROM of an unplugged module from thermalctld, we get the following error: ERR kernel: [ 2446.261799] sxd_kernel: [error] Failed to get module page valid, err: -5 We need to ensure the EEPROM is not accessed if a module is not connected. - How I did it I updated the logic of get_presence() to rely on the present/hw_present sysfs values and called get_presence() from within the relevant methods in thermalctld. - How to verify it Unplug a module and ensure the following error does not appear: ERR kernel: [ 2446.261799] sxd_kernel: [error] Failed to get module page valid, err: -5 --- .../mellanox/mlnx-platform-api/sonic_platform/sfp.py | 3 +++ .../mlnx-platform-api/sonic_platform/thermal.py | 6 ++++++ .../mellanox/mlnx-platform-api/tests/test_sfp.py | 12 ++++++++++-- .../mellanox/mlnx-platform-api/tests/test_thermal.py | 9 +++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 7b21f22ca110..58fe71b84c87 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -483,6 +483,9 @@ def get_presence(self): Returns: bool: True if device is present, False if not """ + presence_sysfs = f'/sys/module/sx_core/asic0/module{self.sdk_index}/hw_present' if self.is_sw_control() else f'/sys/module/sx_core/asic0/module{self.sdk_index}/present' + if utils.read_int_from_file(presence_sysfs) != 1: + return False eeprom_raw = self._read_eeprom(0, 1, log_on_error=False) return eeprom_raw is not None diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py index 7ac703b7841c..219fe2418080 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py @@ -435,6 +435,8 @@ def get_temperature(self): A float number of current temperature in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ + if not self.sfp.get_presence(): + return None value = self.sfp.get_temperature() return value if (value != 0.0 and value is not None) else None @@ -446,6 +448,8 @@ def get_high_threshold(self): A float number, the high threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ + if not self.sfp.get_presence(): + return None value = self.sfp.get_temperature_warning_threshold() return value if (value != 0.0 and value is not None) else None @@ -457,6 +461,8 @@ def get_high_critical_threshold(self): A float number, the high critical threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ + if not self.sfp.get_presence(): + return None value = self.sfp.get_temperature_critical_threshold() return value if (value != 0.0 and value is not None) else None diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 92f5d0d51616..947736f3660d 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -247,15 +247,23 @@ def test_get_page_and_page_offset(self, mock_get_type_str, mock_eeprom_path, moc assert page == '/tmp/1/data' assert page_offset is 0 + @mock.patch('sonic_platform.utils.read_int_from_file') @mock.patch('sonic_platform.sfp.SFP._read_eeprom') - def test_sfp_get_presence(self, mock_read): + def test_sfp_get_presence(self, mock_read, mock_read_int): sfp = SFP(0) + + mock_read_int.return_value = 1 mock_read.return_value = None assert not sfp.get_presence() - mock_read.return_value = 0 assert sfp.get_presence() + mock_read_int.return_value = 0 + mock_read.return_value = None + assert not sfp.get_presence() + mock_read.return_value = 0 + assert not sfp.get_presence() + @mock.patch('sonic_platform.utils.read_int_from_file') def test_rj45_get_presence(self, mock_read_int): sfp = RJ45Port(0) diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py index e17d91cb0818..a92322264eee 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py @@ -159,12 +159,21 @@ def test_sfp_thermal(self): assert thermal.get_name() == rule['name'].format(start_index) assert thermal.get_position_in_parent() == 1 assert thermal.is_replaceable() == False + sfp.get_presence = mock.MagicMock(return_value=True) sfp.get_temperature = mock.MagicMock(return_value=35.4) sfp.get_temperature_warning_threshold = mock.MagicMock(return_value=70) sfp.get_temperature_critical_threshold = mock.MagicMock(return_value=80) assert thermal.get_temperature() == 35.4 assert thermal.get_high_threshold() == 70 assert thermal.get_high_critical_threshold() == 80 + sfp.get_presence = mock.MagicMock(return_value=False) + sfp.get_temperature = mock.MagicMock(return_value=35.4) + sfp.get_temperature_warning_threshold = mock.MagicMock(return_value=70) + sfp.get_temperature_critical_threshold = mock.MagicMock(return_value=80) + assert thermal.get_temperature() is None + assert thermal.get_high_threshold() is None + assert thermal.get_high_critical_threshold() is None + sfp.get_presence = mock.MagicMock(return_value=True) sfp.get_temperature = mock.MagicMock(return_value=0) sfp.get_temperature_warning_threshold = mock.MagicMock(return_value=0) sfp.get_temperature_critical_threshold = mock.MagicMock(return_value=None) From 6d4a9159a6f1b838919c5a4f8d55c5facb306837 Mon Sep 17 00:00:00 2001 From: sophiek Date: Tue, 4 Jun 2024 18:30:13 +0300 Subject: [PATCH 222/282] [Mellanox] Changed platform summary to reflect HW revision from vpd_data (#19098) - Why I did it The command 'show platform summary' reflected the wrong HW revision. In order to have the correct HW revision, we need to read it from vpd_data file that HW management provide. - How I did it Changed the source from which the HW revision is taken. --- .../sonic_platform/chassis.py | 45 +++++----------- .../mellanox/mlnx-platform-api/tests/dmi_file | Bin 96 -> 0 bytes .../mlnx-platform-api/tests/test_chassis.py | 19 ++----- .../mlnx-platform-api/tests/vpd_data_file | 51 ++++++++++++++++++ 4 files changed, 66 insertions(+), 49 deletions(-) delete mode 100644 platform/mellanox/mlnx-platform-api/tests/dmi_file create mode 100644 platform/mellanox/mlnx-platform-api/tests/vpd_data_file diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index 935a2fa5f1f8..a616b28e0c02 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -41,22 +41,8 @@ RJ45_TYPE = "RJ45" -DMI_FILE = '/sys/firmware/dmi/entries/2-0/raw' -DMI_HEADER_LEN = 15 -DMI_PRODUCT_NAME = "Product Name" -DMI_MANUFACTURER = "Manufacturer" -DMI_VERSION = "Version" -DMI_SERIAL = "Serial Number" -DMI_ASSET_TAG = "Asset Tag" -DMI_LOC = "Location In Chassis" -DMI_TABLE_MAP = { - DMI_PRODUCT_NAME: 0, - DMI_MANUFACTURER: 1, - DMI_VERSION: 2, - DMI_SERIAL: 3, - DMI_ASSET_TAG: 4, - DMI_LOC: 5 - } +VPD_DATA_FILE = "/var/run/hw-management/eeprom/vpd_data" +REVISION = "REV" HWMGMT_SYSTEM_ROOT = '/var/run/hw-management/system/' @@ -87,8 +73,8 @@ class Chassis(ChassisBase): def __init__(self): super(Chassis, self).__init__() - # Initialize DMI data - self.dmi_data = None + # Initialize vpd data + self.vpd_data = None # move the initialization of each components to their dedicated initializer # which will be called from platform @@ -933,14 +919,14 @@ def get_revision(self): Returns: string: Revision value of device """ - if self.dmi_data is None: - self.dmi_data = self._parse_dmi(DMI_FILE) + if not self.vpd_data: + self.vpd_data = self._parse_vpd_data(VPD_DATA_FILE) - return self.dmi_data.get(DMI_VERSION, "N/A") + return self.vpd_data.get(REVISION, "N/A") - def _parse_dmi(self, filename): + def _parse_vpd_data(self, filename): """ - Read DMI data chassis data and returns a dictionary of values + Read vpd_data and returns a dictionary of values Returns: A dictionary containing the dmi table of the switch chassis info @@ -950,17 +936,10 @@ def _parse_dmi(self, filename): if not os.access(filename, os.R_OK): return result - with open(filename, "rb") as fileobj: - data = fileobj.read() - - body = data[DMI_HEADER_LEN:] - records = body.split(b'\x00') - - for k, v in DMI_TABLE_MAP.items(): - result[k] = records[v].decode("utf-8") - + result = utils.read_key_value_file(filename, delimeter=": ") + except Exception as e: - logger.log_error("Fail to decode DMI {} due to {}".format(filename, repr(e))) + logger.log_error("Fail to decode vpd_data {} due to {}".format(filename, repr(e))) return result diff --git a/platform/mellanox/mlnx-platform-api/tests/dmi_file b/platform/mellanox/mlnx-platform-api/tests/dmi_file deleted file mode 100644 index f9b1cdcd505ba559c54cfa755445eaf08d4817ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 96 zcmZSLXJTMvVrF6GWMgLFV(?AP$w|!1uTTg{P0q;6&&f~EOf6RMDM`^|2=n!KF)%PN mWpFfM@C`AvG&YGaFfcSTV(`l^Q3x(bP0mcqOie-KF#rH7UKrv4 diff --git a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py index 49dfa8ff3fa9..19ceb7f29951 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_chassis.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_chassis.py @@ -324,19 +324,6 @@ def test_module(self): assert len(module_list) == 3 assert chassis.module_initialized_count == 3 - def test_revision_permission(self): - old_dmi_file = sonic_platform.chassis.DMI_FILE - #Override the dmi file - sonic_platform.chassis.DMI_FILE = "/tmp/dmi_file" - new_dmi_file = sonic_platform.chassis.DMI_FILE - subprocess.call(["touch", new_dmi_file]) - subprocess.call(["chmod", "-r", new_dmi_file]) - chassis = Chassis() - rev = chassis.get_revision() - sonic_platform.chassis.DMI_FILE = old_dmi_file - subprocess.call(["rm", "-f", new_dmi_file]) - assert rev == "N/A" - def test_get_port_or_cage_type(self): chassis = Chassis() chassis._RJ45_port_inited = True @@ -351,7 +338,7 @@ def test_get_port_or_cage_type(self): assert exceptionRaised - def test_parse_dmi(self): + def test_parse_vpd(self): chassis = Chassis() - content = chassis._parse_dmi(os.path.join(test_path, 'dmi_file')) - assert content.get('Version') == 'A4' + content = chassis._parse_vpd_data(os.path.join(test_path, 'vpd_data_file')) + assert content.get('REV') == 'A7' diff --git a/platform/mellanox/mlnx-platform-api/tests/vpd_data_file b/platform/mellanox/mlnx-platform-api/tests/vpd_data_file new file mode 100644 index 000000000000..a46087b841c7 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/tests/vpd_data_file @@ -0,0 +1,51 @@ +Part Number: MSN4700-WS2FO +Serial Number: MT2022X08597 +Base MAC Address: 1c34da1d4200 +Manufacture Date: 07/02/2020 02:38:26 +MAC Addresses: 254 +SN: MT2022X08597 +PN: MSN4700-WS2FO +REV: A7 +MFG_DATE: 8561348 +PROD_NAME: Leopard Eth 400 +HW_MGT_ID: 122 +HW_MGT_REV: 0 +SW_MGT_ID: 4700 +SYS_DISPLAY: MSN4700 +MAX_POWER: 0 +CRIT_AMB_TEMP: 0 +CRIT_IC_TEMP: 0 +ALERT_AMB_TEMP: 0 +ALERT_IC_TEMP: 0 +FAN_DIR: 0 +LENGTH: 0 +WIDTH: 0 +LED: 0 +GUID_TYPE: 0xd +BASE_MAC_1: 1C:34:DA:1D:42:00 +MAC_RANGE_1: 0xfe00 +BASE_GUID_1: 1C:34:DA:03:00:1D:42:00 +FEATURE_EN_0: 0 +FEATURE_EN_1: 70 +FEATURE_EN_2: 0 +FEATURE_EN_3: 0 +FEATURE_EN_4: 8 +FEATURE_EN_5: 0 +FEATURE_EN_6: 7 +FEATURE_EN_7: 7 +FEATURE_EN_8: 7 +FEATURE_EN_9: 7 +FEATURE_EN_10: 0 +FEATURE_EN_11: 0 +NUM_SCHEME: 0 +EN_PORTS_NUM: 32 +PORTS_INC_SCHEME: 0 +PORTS_INC_ORDER_0: 0 +PORTS_INC_ORDER_1: 0 +PORTS_INC_ORDER_2: 0 +PORTS_INC_ORDER_3: 0 +Product Name: MSN4700 +Manufacturer: Mellanox +Platform Name: x86_64-mlnx_msn4700-r0 +ONIE Version: 2023.11-5.3.0011-9600 +CHSUM_FIELD: 0XBB262C35 \ No newline at end of file From 7a3b651d590129617c9b583e798f47851e68206e Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 4 Jun 2024 10:50:15 -0700 Subject: [PATCH 223/282] [baseimage]: Upgrade docker-py to 7.1.0 (#19181) This version of docker-py has the fix for the issue caused by requests 2.32, and has the added benefit of upgrading to the latest version of docker-py. Signed-off-by: Saikrishna Arcot --- build_debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_debian.sh b/build_debian.sh index 352c642caecf..08b2b720fa1b 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -537,7 +537,7 @@ sudo cp files/image_config/pip/pip.conf $FILESYSTEM_ROOT/etc/pip.conf sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install python3-setuptools python3-wheel # docker Python API package is needed by Ansible docker module as well as some SONiC applications -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'docker==6.1.1' +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'docker==7.1.0' # Install scapy sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'scapy==2.4.4' From 6fb279aa0b1067b548f7e7b3e5e280cfb2a40032 Mon Sep 17 00:00:00 2001 From: Patrick MacArthur Date: Tue, 4 Jun 2024 14:18:56 -0400 Subject: [PATCH 224/282] Arista: Fix fabric monitor monState (#19183) Fix the missing quotes in the new monState field in the fabric monitor config. --- .../Arista-7804R3-FM/fabric_monitor_config.json | 2 +- .../Arista-7808R3-FM/fabric_monitor_config.json | 2 +- .../Arista-7808R3A-FM/fabric_monitor_config.json | 2 +- .../Arista-7800R3-48CQ2-C48/fabric_monitor_config.json | 2 +- .../x86_64-arista_7800r3_48cq2_lc/fabric_monitor_config.json | 2 +- .../Arista-7800R3-48CQM2-C48/fabric_monitor_config.json | 2 +- .../x86_64-arista_7800r3_48cqm2_lc/fabric_monitor_config.json | 2 +- .../Arista-7800R3A-36D2-C36/fabric_monitor_config.json | 2 +- .../Arista-7800R3A-36D2-C72/fabric_monitor_config.json | 2 +- .../Arista-7800R3A-36D2-D36/fabric_monitor_config.json | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/device/arista/x86_64-arista_7800_sup/Arista-7804R3-FM/fabric_monitor_config.json b/device/arista/x86_64-arista_7800_sup/Arista-7804R3-FM/fabric_monitor_config.json index 0476a2c15fd3..acea5cc6bda2 100644 --- a/device/arista/x86_64-arista_7800_sup/Arista-7804R3-FM/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800_sup/Arista-7804R3-FM/fabric_monitor_config.json @@ -5,6 +5,6 @@ "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, "monCapacityThreshWarn": 10, - "monState": enable + "monState": "enable" } } diff --git a/device/arista/x86_64-arista_7800_sup/Arista-7808R3-FM/fabric_monitor_config.json b/device/arista/x86_64-arista_7800_sup/Arista-7808R3-FM/fabric_monitor_config.json index 0476a2c15fd3..acea5cc6bda2 100644 --- a/device/arista/x86_64-arista_7800_sup/Arista-7808R3-FM/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800_sup/Arista-7808R3-FM/fabric_monitor_config.json @@ -5,6 +5,6 @@ "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, "monCapacityThreshWarn": 10, - "monState": enable + "monState": "enable" } } diff --git a/device/arista/x86_64-arista_7800_sup/Arista-7808R3A-FM/fabric_monitor_config.json b/device/arista/x86_64-arista_7800_sup/Arista-7808R3A-FM/fabric_monitor_config.json index 0476a2c15fd3..acea5cc6bda2 100644 --- a/device/arista/x86_64-arista_7800_sup/Arista-7808R3A-FM/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800_sup/Arista-7808R3A-FM/fabric_monitor_config.json @@ -5,6 +5,6 @@ "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, "monCapacityThreshWarn": 10, - "monState": enable + "monState": "enable" } } diff --git a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/fabric_monitor_config.json index f5a6ea72bca9..d67ec1518a22 100644 --- a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/fabric_monitor_config.json @@ -5,6 +5,6 @@ "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, "monCapacityThreshWarn": 86, - "monState": enable + "monState": "enable" } } diff --git a/device/arista/x86_64-arista_7800r3_48cq2_lc/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3_48cq2_lc/fabric_monitor_config.json index f5a6ea72bca9..d67ec1518a22 100644 --- a/device/arista/x86_64-arista_7800r3_48cq2_lc/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3_48cq2_lc/fabric_monitor_config.json @@ -5,6 +5,6 @@ "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, "monCapacityThreshWarn": 86, - "monState": enable + "monState": "enable" } } diff --git a/device/arista/x86_64-arista_7800r3_48cqm2_lc/Arista-7800R3-48CQM2-C48/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3_48cqm2_lc/Arista-7800R3-48CQM2-C48/fabric_monitor_config.json index f5a6ea72bca9..d67ec1518a22 100644 --- a/device/arista/x86_64-arista_7800r3_48cqm2_lc/Arista-7800R3-48CQM2-C48/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3_48cqm2_lc/Arista-7800R3-48CQM2-C48/fabric_monitor_config.json @@ -5,6 +5,6 @@ "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, "monCapacityThreshWarn": 86, - "monState": enable + "monState": "enable" } } diff --git a/device/arista/x86_64-arista_7800r3_48cqm2_lc/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3_48cqm2_lc/fabric_monitor_config.json index f5a6ea72bca9..d67ec1518a22 100644 --- a/device/arista/x86_64-arista_7800r3_48cqm2_lc/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3_48cqm2_lc/fabric_monitor_config.json @@ -5,6 +5,6 @@ "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, "monCapacityThreshWarn": 86, - "monState": enable + "monState": "enable" } } diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/fabric_monitor_config.json index f34b21d3fbd6..34e3f5e6ead9 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/fabric_monitor_config.json @@ -5,6 +5,6 @@ "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, "monCapacityThreshWarn": 100, - "monState": enable + "monState": "enable" } } diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/fabric_monitor_config.json index f5a6ea72bca9..d67ec1518a22 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/fabric_monitor_config.json @@ -5,6 +5,6 @@ "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, "monCapacityThreshWarn": 86, - "monState": enable + "monState": "enable" } } diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/fabric_monitor_config.json b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/fabric_monitor_config.json index f34b21d3fbd6..34e3f5e6ead9 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/fabric_monitor_config.json +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/fabric_monitor_config.json @@ -5,6 +5,6 @@ "monPollThreshRecovery": 8, "monPollThreshIsolation": 1, "monCapacityThreshWarn": 100, - "monState": enable + "monState": "enable" } } From ca5e3b2c78f05073f5a6862056facc21861355bd Mon Sep 17 00:00:00 2001 From: Longxiang Lyu <35479537+lolyu@users.noreply.github.com> Date: Wed, 5 Jun 2024 02:59:49 +0800 Subject: [PATCH 225/282] [subnet_decap] Use new tunnel&&decap term db schema and add subnet decap tunnel to `ipinip.json` (#18752) * [decap] Enhance `ipinip.json.j2` template to use new db schema Signed-off-by: Longxiang Lyu Co-authored-by: bingwang --- dockers/docker-orchagent/ipinip.json.j2 | 65 +++++++++- .../tests/multi_npu_data/py2/ipinip.json | 53 +++++++- .../tests/multi_npu_data/py3/ipinip.json | 53 +++++++- .../tests/sample_output/py2/ipinip.json | 89 ++++++++++++- .../py2/ipinip_subnet_decap_enable.json | 122 ++++++++++++++++++ .../tests/sample_output/py3/ipinip.json | 89 ++++++++++++- .../py3/ipinip_subnet_decap_enable.json | 122 ++++++++++++++++++ src/sonic-config-engine/tests/test_j2files.py | 9 ++ 8 files changed, 583 insertions(+), 19 deletions(-) create mode 100644 src/sonic-config-engine/tests/sample_output/py2/ipinip_subnet_decap_enable.json create mode 100644 src/sonic-config-engine/tests/sample_output/py3/ipinip_subnet_decap_enable.json diff --git a/dockers/docker-orchagent/ipinip.json.j2 b/dockers/docker-orchagent/ipinip.json.j2 index 9d40ec68cd12..f25f7d9fb695 100644 --- a/dockers/docker-orchagent/ipinip.json.j2 +++ b/dockers/docker-orchagent/ipinip.json.j2 @@ -20,6 +20,12 @@ {%- set ipv6_loopback_addresses = ipv6_loopback_addresses.append(prefix) %} {%- endif %} {% endfor %} +{% set subnet_decap = namespace(enable=false) %} +{% for config in SUBNET_DECAP %} + {%- if SUBNET_DECAP[config].status == 'enable' %} + {%- set subnet_decap.enable = true %} + {%- endif %} +{% endfor %} {% for (name, prefix) in INTERFACE|pfx_filter %} {%- if prefix | ipv4 %} {%- set ipv4_addresses = ipv4_addresses.append(prefix) %} @@ -46,10 +52,24 @@ {% endfor %} [ {% if ipv4_loopback_addresses %} +{% if subnet_decap.enable %} + { + "TUNNEL_DECAP_TABLE:IPINIP_SUBNET" : { + "tunnel_type":"IPINIP", + "dscp_mode":"uniform", +{% if "mlnx" in DEVICE_METADATA.localhost.platform %} + "ecn_mode":"standard", +{% else %} + "ecn_mode":"copy_from_outer", +{% endif %} + "ttl_mode":"pipe" + }, + "OP": "SET" + }, +{% endif %} { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"{% for prefix in ipv4_addresses|sort %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}", "dscp_mode":"uniform", {% if "mlnx" in DEVICE_METADATA.localhost.platform %} "ecn_mode":"standard", @@ -60,14 +80,40 @@ }, "OP": "SET" } +{%- if ipv4_addresses -%} +, +{% endif %} +{% for prefix in ipv4_addresses|sort %} + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:{{ prefix | ip }}" : { + "term_type":"P2MP" + }, + "OP": "SET" + }{% if not loop.last %}, +{% endif %} +{% endfor %} {% endif %} -{% if ipv4_loopback_addresses and ipv6_loopback_addresses %} , +{% if ipv4_loopback_addresses and ipv6_loopback_addresses %}, {% endif %} {% if ipv6_loopback_addresses %} +{% if subnet_decap.enable %} + { + "TUNNEL_DECAP_TABLE:IPINIP_SUBNET_V6" : { + "tunnel_type":"IPINIP", + "dscp_mode":"uniform", +{% if "mlnx" in DEVICE_METADATA.localhost.platform %} + "ecn_mode":"standard", +{% else %} + "ecn_mode":"copy_from_outer", +{% endif %} + "ttl_mode":"pipe" + }, + "OP": "SET" + }, +{% endif %} { "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"{% for prefix in ipv6_addresses|sort %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}", "dscp_mode":"uniform", {% if "mlnx" in DEVICE_METADATA.localhost.platform %} "ecn_mode":"standard", @@ -77,8 +123,21 @@ "ttl_mode":"pipe" }, "OP": "SET" + }{% if ipv6_addresses %}, +{% endif %} +{% for prefix in ipv6_addresses|sort %} + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:{{ prefix | ip }}" : { + "term_type":"P2MP" + }, + "OP": "SET" } +{%- if not loop.last -%} +, +{% endif %} +{% endfor %} {% endif %} + ] {% endif %} diff --git a/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json b/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json index 82d583de6078..94196a0a4878 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json +++ b/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json @@ -2,22 +2,67 @@ { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"10.0.0.0,10.1.0.1,10.1.0.3,10.1.0.32,8.0.0.0", "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, "OP": "SET" - } - , + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.0" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.1.0.1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.1.0.3" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.1.0.32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:8.0.0.0" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, { "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"fc00:1::32,fc00::1,fd00:1::32", "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00:1::32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fd00:1::32" : { + "term_type":"P2MP" + }, + "OP": "SET" } ] diff --git a/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json b/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json index 82d583de6078..94196a0a4878 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json +++ b/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json @@ -2,22 +2,67 @@ { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"10.0.0.0,10.1.0.1,10.1.0.3,10.1.0.32,8.0.0.0", "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, "OP": "SET" - } - , + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.0" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.1.0.1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.1.0.3" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.1.0.32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:8.0.0.0" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, { "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"fc00:1::32,fc00::1,fd00:1::32", "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00:1::32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fd00:1::32" : { + "term_type":"P2MP" + }, + "OP": "SET" } ] diff --git a/src/sonic-config-engine/tests/sample_output/py2/ipinip.json b/src/sonic-config-engine/tests/sample_output/py2/ipinip.json index 0a01058463bd..755e954cfb59 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/ipinip.json +++ b/src/sonic-config-engine/tests/sample_output/py2/ipinip.json @@ -2,22 +2,103 @@ { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,10.1.0.32,10.21.0.64,10.21.64.2,192.168.0.1,192.168.200.1", "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, "OP": "SET" - } - , + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.56" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.58" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.60" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.62" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.1.0.32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.21.0.64" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.21.64.2" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:192.168.0.1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:192.168.200.1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, { "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"fc00:1::32,fc00::71,fc00::75,fc00::79,fc00::7d", "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00:1::32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::71" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::75" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::79" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::7d" : { + "term_type":"P2MP" + }, + "OP": "SET" } ] diff --git a/src/sonic-config-engine/tests/sample_output/py2/ipinip_subnet_decap_enable.json b/src/sonic-config-engine/tests/sample_output/py2/ipinip_subnet_decap_enable.json new file mode 100644 index 000000000000..ad978b8865a7 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/ipinip_subnet_decap_enable.json @@ -0,0 +1,122 @@ +[ + { + "TUNNEL_DECAP_TABLE:IPINIP_SUBNET" : { + "tunnel_type":"IPINIP", + "dscp_mode":"uniform", + "ecn_mode":"copy_from_outer", + "ttl_mode":"pipe" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { + "tunnel_type":"IPINIP", + "dscp_mode":"uniform", + "ecn_mode":"copy_from_outer", + "ttl_mode":"pipe" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.56" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.58" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.60" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.62" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.1.0.32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.21.0.64" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.21.64.2" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:192.168.0.1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:192.168.200.1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TABLE:IPINIP_SUBNET_V6" : { + "tunnel_type":"IPINIP", + "dscp_mode":"uniform", + "ecn_mode":"copy_from_outer", + "ttl_mode":"pipe" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { + "tunnel_type":"IPINIP", + "dscp_mode":"uniform", + "ecn_mode":"copy_from_outer", + "ttl_mode":"pipe" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00:1::32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::71" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::75" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::79" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::7d" : { + "term_type":"P2MP" + }, + "OP": "SET" + } +] diff --git a/src/sonic-config-engine/tests/sample_output/py3/ipinip.json b/src/sonic-config-engine/tests/sample_output/py3/ipinip.json index 0a01058463bd..755e954cfb59 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/ipinip.json +++ b/src/sonic-config-engine/tests/sample_output/py3/ipinip.json @@ -2,22 +2,103 @@ { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,10.1.0.32,10.21.0.64,10.21.64.2,192.168.0.1,192.168.200.1", "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, "OP": "SET" - } - , + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.56" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.58" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.60" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.62" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.1.0.32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.21.0.64" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.21.64.2" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:192.168.0.1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:192.168.200.1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, { "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"fc00:1::32,fc00::71,fc00::75,fc00::79,fc00::7d", "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00:1::32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::71" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::75" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::79" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::7d" : { + "term_type":"P2MP" + }, + "OP": "SET" } ] diff --git a/src/sonic-config-engine/tests/sample_output/py3/ipinip_subnet_decap_enable.json b/src/sonic-config-engine/tests/sample_output/py3/ipinip_subnet_decap_enable.json new file mode 100644 index 000000000000..ad978b8865a7 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/ipinip_subnet_decap_enable.json @@ -0,0 +1,122 @@ +[ + { + "TUNNEL_DECAP_TABLE:IPINIP_SUBNET" : { + "tunnel_type":"IPINIP", + "dscp_mode":"uniform", + "ecn_mode":"copy_from_outer", + "ttl_mode":"pipe" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { + "tunnel_type":"IPINIP", + "dscp_mode":"uniform", + "ecn_mode":"copy_from_outer", + "ttl_mode":"pipe" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.56" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.58" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.60" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.0.0.62" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.1.0.32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.21.0.64" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:10.21.64.2" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:192.168.0.1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_TUNNEL:192.168.200.1" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TABLE:IPINIP_SUBNET_V6" : { + "tunnel_type":"IPINIP", + "dscp_mode":"uniform", + "ecn_mode":"copy_from_outer", + "ttl_mode":"pipe" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { + "tunnel_type":"IPINIP", + "dscp_mode":"uniform", + "ecn_mode":"copy_from_outer", + "ttl_mode":"pipe" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00:1::32" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::71" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::75" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::79" : { + "term_type":"P2MP" + }, + "OP": "SET" + }, + { + "TUNNEL_DECAP_TERM_TABLE:IPINIP_V6_TUNNEL:fc00::7d" : { + "term_type":"P2MP" + }, + "OP": "SET" + } +] diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index b83926d4c9e6..cf8907bf1c2b 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -223,6 +223,15 @@ def test_ipinip(self): sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'ipinip.json') assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) + def test_ipinip_subnet_decap_enable(self): + ipinip_file = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ipinip.json.j2') + extra_data = {"SUBNET_DECAP": {"AZURE": {"status": "enable"}}} + argument = ['-m', self.t0_minigraph, '-p', self.t0_port_config, '-a', json.dumps(extra_data), '-t', ipinip_file] + self.run_script(argument, output_file=self.output_file) + + sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'ipinip_subnet_decap_enable.json') + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) + def test_l2switch_template(self): argument = ['-k', 'Mellanox-SN2700', '--preset', 'l2', '-p', self.t0_port_config] output = self.run_script(argument) From df553ec32068ad83488b4e15b9a7ca504c674b0d Mon Sep 17 00:00:00 2001 From: sophiek Date: Tue, 4 Jun 2024 22:19:25 +0300 Subject: [PATCH 226/282] [Mellanox] Fix SN5400 lane number of service port from 513 to 520 (#19137) Fixed a lane numbering bug with service ports on SN5400 --- device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json | 2 +- .../x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini | 2 +- device/mellanox/x86_64-nvidia_sn5400-r0/platform.json | 4 ++-- device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json index abe6649e7db1..096249718223 100644 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/hwsku.json @@ -195,7 +195,7 @@ "Ethernet512": { "default_brkout_mode": "1x25G[10G]" }, - "Ethernet513": { + "Ethernet520": { "default_brkout_mode": "1x25G[10G]" } } diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini index 4b62d3abf172..3fe2027e9052 100644 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/port_config.ini @@ -81,4 +81,4 @@ Ethernet488 488,489,490,491,492,493,494,495 etp62 62 Ethernet496 496,497,498,499,500,501,502,503 etp63 63 Ethernet504 504,505,506,507,508,509,510,511 etp64 64 Ethernet512 512 etp65 65 -Ethernet513 513 etp66 66 +Ethernet520 520 etp66 66 diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json b/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json index 274a12d0c715..f4f9ed17d60e 100644 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/platform.json @@ -1322,9 +1322,9 @@ "1x25G[10G]": ["etp65"] } }, - "Ethernet513": { + "Ethernet520": { "index": "66", - "lanes": "513", + "lanes": "520", "breakout_modes": { "1x25G[10G]": ["etp66"] } diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json index a2a9ad437419..e85c160d0cc2 100644 --- a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/platform.json @@ -1325,9 +1325,9 @@ "1x25G[10G]": ["etp65"] } }, - "Ethernet513": { + "Ethernet520": { "index": "66", - "lanes": "513", + "lanes": "520", "breakout_modes": { "1x25G[10G]": ["etp66"] } From 268e02ffe3f5b584085c81004c6d9da376b8944a Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Tue, 4 Jun 2024 22:20:08 +0300 Subject: [PATCH 227/282] [Build]: Fix dep files for sairedis, syncd and libsaithrift-dev (#19172) Fix DPKG cache errors when configure or build SONiC: /bin/bash: line 1: cd: src/sonic-sairedis/SAI/bm/behavioral-model: No such file or directory /bin/bash: line 1: cd: src/sonic-sairedis/SAI/bm/behavioral-model: No such file or directory Submodule bm/behavioral-model has been removed from SAI repo in opencomputeproject/SAI#1954 But dep files in sonic-buildimage haven't been updated. --- platform/broadcom/libsaithrift-dev.dep | 2 +- platform/innovium/libsaithrift-dev.dep | 2 +- platform/marvell/libsaithrift-dev.dep | 2 +- platform/vs/libsaithrift-dev.dep | 2 +- rules/sairedis.dep | 2 +- rules/syncd.dep | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/broadcom/libsaithrift-dev.dep b/platform/broadcom/libsaithrift-dev.dep index 2ae0106247e4..632095d3a377 100644 --- a/platform/broadcom/libsaithrift-dev.dep +++ b/platform/broadcom/libsaithrift-dev.dep @@ -2,7 +2,7 @@ SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/libsaithrift-dev.mk platform/broadcom/libsaithrift-dev.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen +SMDEP_PATHS := $(SPATH) $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen $(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " ))))) $(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA diff --git a/platform/innovium/libsaithrift-dev.dep b/platform/innovium/libsaithrift-dev.dep index f9d75d284ca6..eee628b5f235 100644 --- a/platform/innovium/libsaithrift-dev.dep +++ b/platform/innovium/libsaithrift-dev.dep @@ -2,7 +2,7 @@ SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/innovium/libsaithrift-dev.mk platform/innovium/libsaithrift-dev.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen +SMDEP_PATHS := $(SPATH) $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen $(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " ))))) $(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA diff --git a/platform/marvell/libsaithrift-dev.dep b/platform/marvell/libsaithrift-dev.dep index d7d08f14a319..7260effa000a 100644 --- a/platform/marvell/libsaithrift-dev.dep +++ b/platform/marvell/libsaithrift-dev.dep @@ -1,7 +1,7 @@ SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/libsaithrift-dev.mk $(PLATFORM_PATH)/libsaithrift-dev.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen +SMDEP_PATHS := $(SPATH) $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen $(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " ))))) $(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA diff --git a/platform/vs/libsaithrift-dev.dep b/platform/vs/libsaithrift-dev.dep index be1d3f74b23f..ed69b297ebfa 100644 --- a/platform/vs/libsaithrift-dev.dep +++ b/platform/vs/libsaithrift-dev.dep @@ -2,7 +2,7 @@ SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/libsaithrift-dev.mk platform/broadcom/libsaithrift-dev.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen +SMDEP_PATHS := $(SPATH) $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen $(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " ))))) $(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA diff --git a/rules/sairedis.dep b/rules/sairedis.dep index f501a78932c5..8674dc29335f 100644 --- a/rules/sairedis.dep +++ b/rules/sairedis.dep @@ -4,7 +4,7 @@ SPATH := $($(LIBSAIREDIS)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sairedis.mk rules/sairedis.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_PATHS := $(SPATH) $(SPATH)/SAI $(SPATH)/SAI/bm/behavioral-model $(SPATH)/SAI/test/ptf $(SPATH)/SAI/test/saithrift/ctypesgen +SMDEP_PATHS := $(SPATH) $(SPATH)/SAI $(SPATH)/SAI/test/ptf $(SPATH)/SAI/test/saithrift/ctypesgen $(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, \ $(shell cd $(path) && git ls-files | grep -v " "))))) diff --git a/rules/syncd.dep b/rules/syncd.dep index fe0706ff9754..a9a72d4f2a80 100644 --- a/rules/syncd.dep +++ b/rules/syncd.dep @@ -6,7 +6,7 @@ SPATH := $($(SYNCD)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/syncd.mk rules/syncd.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_PATHS := $(SPATH) $(SPATH)/SAI $(SPATH)/SAI/bm/behavioral-model $(SPATH)/SAI/test/ptf $(SPATH)/SAI/test/saithrift/ctypesgen +SMDEP_PATHS := $(SPATH) $(SPATH)/SAI $(SPATH)/SAI/test/ptf $(SPATH)/SAI/test/saithrift/ctypesgen $(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, \ $(shell cd $(path) && git ls-files | grep -v " "))))) From 4d6d808b850ecd56d42739a5313d1fb17483fe04 Mon Sep 17 00:00:00 2001 From: Ashwin Srinivasan <93744978+assrinivasan@users.noreply.github.com> Date: Tue, 4 Jun 2024 22:00:56 -0700 Subject: [PATCH 228/282] Added makefile and dependencies for building sonic-stormond whl (#19042) * Added makefile and dependencies for building sonic-stormond whl * Added sonic-stormond to supervisord and wheel to pmon container makefile * Advanced submodules of platform-common and daemons to pick up stormond * Changed the import path of ssdutil in vendor ssdutil to match stormon changes * Advancing the sonic-utilities submodule to include stormon-related change * Advanced sonic-platform-daemons submodule to the latest HEAD * Advanced sonic-utilities to include fix for test_iface_namingmode --- .../arista/x86_64-arista_common/plugins/ssd_util.py | 2 +- .../plugins/ssd_util.py | 4 ++-- .../plugins/ssd_util.py | 4 ++-- .../arm64-nokia_ixs7215_52xb-r0/plugins/ssd_util.py | 2 +- .../plugins/ssd_util.py | 4 ++-- .../pensando/arm64-elba-asic-r0/plugins/ssd_util.py | 4 ++-- .../plugins/ssd_util.py | 4 ++-- .../plugins/ssd_util.py | 4 ++-- .../plugins/ssd_util.py | 2 +- .../docker-pmon.supervisord.conf.j2 | 13 +++++++++++++ .../sonic-platform-nokia/7215-a1/utils/sonic_ssd.py | 6 +++--- rules/docker-platform-monitor.mk | 1 + rules/sonic-stormond.dep | 10 ++++++++++ rules/sonic-stormond.mk | 9 +++++++++ src/sonic-platform-common | 2 +- src/sonic-utilities | 2 +- 16 files changed, 53 insertions(+), 20 deletions(-) create mode 100644 rules/sonic-stormond.dep create mode 100644 rules/sonic-stormond.mk diff --git a/device/arista/x86_64-arista_common/plugins/ssd_util.py b/device/arista/x86_64-arista_common/plugins/ssd_util.py index c9ca1e2a722c..6e5b2ab91578 100644 --- a/device/arista/x86_64-arista_common/plugins/ssd_util.py +++ b/device/arista/x86_64-arista_common/plugins/ssd_util.py @@ -2,4 +2,4 @@ try: from arista.utils.sonic_ssd import SsdUtil except ImportError: - from sonic_platform_base.sonic_ssd.ssd_generic import SsdUtil + from sonic_platform_base.sonic_storage.ssd import SsdUtil diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/ssd_util.py b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/ssd_util.py index 95ca23e8b351..d7bc164627b4 100644 --- a/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/ssd_util.py +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-fa-r0/plugins/ssd_util.py @@ -9,7 +9,7 @@ try: import subprocess - from sonic_platform_base.sonic_ssd.ssd_base import SsdBase + from sonic_platform_base.sonic_storage.storage_base import StorageBase except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -18,7 +18,7 @@ FIRMWARE_CMD = "cat /sys/kernel/debug/mmc0/mmc0:0001/ext_csd | cut -c 509-522" NOT_AVAILABLE = "N/A" -class SsdUtil(SsdBase): +class SsdUtil(StorageBase): """ Generic implementation of the SSD health API """ diff --git a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/ssd_util.py b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/ssd_util.py index 95ca23e8b351..d7bc164627b4 100644 --- a/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/ssd_util.py +++ b/device/micas/arm64-micas_m2-w6010-48gt4x-ra-r0/plugins/ssd_util.py @@ -9,7 +9,7 @@ try: import subprocess - from sonic_platform_base.sonic_ssd.ssd_base import SsdBase + from sonic_platform_base.sonic_storage.storage_base import StorageBase except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -18,7 +18,7 @@ FIRMWARE_CMD = "cat /sys/kernel/debug/mmc0/mmc0:0001/ext_csd | cut -c 509-522" NOT_AVAILABLE = "N/A" -class SsdUtil(SsdBase): +class SsdUtil(StorageBase): """ Generic implementation of the SSD health API """ diff --git a/device/nokia/arm64-nokia_ixs7215_52xb-r0/plugins/ssd_util.py b/device/nokia/arm64-nokia_ixs7215_52xb-r0/plugins/ssd_util.py index 11b407bb8dd5..5ec00b69e7c8 100644 --- a/device/nokia/arm64-nokia_ixs7215_52xb-r0/plugins/ssd_util.py +++ b/device/nokia/arm64-nokia_ixs7215_52xb-r0/plugins/ssd_util.py @@ -1,4 +1,4 @@ try: from sonic_ssd import SsdUtil except ImportError: - from sonic_platform_base.sonic_ssd.ssd_generic import SsdUtil \ No newline at end of file + from sonic_platform_base.sonic_storage.ssd import SsdUtil \ No newline at end of file diff --git a/device/nvidia-bluefield/arm64-nvda_bf-9009d3b600cvaa/plugins/ssd_util.py b/device/nvidia-bluefield/arm64-nvda_bf-9009d3b600cvaa/plugins/ssd_util.py index de570f00f43e..22a6f3eca14f 100644 --- a/device/nvidia-bluefield/arm64-nvda_bf-9009d3b600cvaa/plugins/ssd_util.py +++ b/device/nvidia-bluefield/arm64-nvda_bf-9009d3b600cvaa/plugins/ssd_util.py @@ -1,8 +1,8 @@ import os -from sonic_platform_base.sonic_ssd.ssd_emmc import EmmcUtil -from sonic_platform_base.sonic_ssd.ssd_generic import SsdUtil as SsdUtilDefault +from sonic_platform_base.sonic_storage.emmc import EmmcUtil +from sonic_platform_base.sonic_storage.ssd import SsdUtil as SsdUtilDefault def SsdUtil(diskdev): if os.path.basename(diskdev).startswith('mmcblk'): diff --git a/device/pensando/arm64-elba-asic-r0/plugins/ssd_util.py b/device/pensando/arm64-elba-asic-r0/plugins/ssd_util.py index 6ca016e20b47..e6c1b157fdb9 100644 --- a/device/pensando/arm64-elba-asic-r0/plugins/ssd_util.py +++ b/device/pensando/arm64-elba-asic-r0/plugins/ssd_util.py @@ -10,14 +10,14 @@ try: import re import subprocess - from sonic_platform_base.sonic_ssd.ssd_base import SsdBase + from sonic_platform_base.sonic_storage.storage_base import StorageBase except ImportError as e: raise ImportError (str(e) + "- required module not found") NOT_AVAILABLE = "N/A" MMC_DATA_PATH = "/sys/class/mmc_host/mmc0/mmc0:0001/{}" -class SsdUtil(SsdBase): +class SsdUtil(StorageBase): """ Generic implementation of the SSD health API """ diff --git a/device/ragile/x86_64-ragile_ra-b6510-48v8c-r0/plugins/ssd_util.py b/device/ragile/x86_64-ragile_ra-b6510-48v8c-r0/plugins/ssd_util.py index 89d3ccd770bd..beec4c17ff63 100755 --- a/device/ragile/x86_64-ragile_ra-b6510-48v8c-r0/plugins/ssd_util.py +++ b/device/ragile/x86_64-ragile_ra-b6510-48v8c-r0/plugins/ssd_util.py @@ -11,7 +11,7 @@ import re import os import subprocess - from sonic_platform_base.sonic_ssd.ssd_base import SsdBase + from sonic_platform_base.sonic_storage.storage_base import StorageBase except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -30,7 +30,7 @@ INNODISK_HEALTH_ID = 169 INNODISK_TEMPERATURE_ID = 194 -class SsdUtil(SsdBase): +class SsdUtil(StorageBase): """ Generic implementation of the SSD health API """ diff --git a/device/ragile/x86_64-ragile_ra-b6920-4s-r0/plugins/ssd_util.py b/device/ragile/x86_64-ragile_ra-b6920-4s-r0/plugins/ssd_util.py index 268d9ab633b1..214c563dfdd2 100644 --- a/device/ragile/x86_64-ragile_ra-b6920-4s-r0/plugins/ssd_util.py +++ b/device/ragile/x86_64-ragile_ra-b6920-4s-r0/plugins/ssd_util.py @@ -2,14 +2,14 @@ # ssd_health # -from sonic_platform_base.sonic_ssd.ssd_base import SsdBase +from sonic_platform_base.sonic_storage.storage_base import StorageBase from subprocess import Popen, PIPE from re import findall from os.path import exists NOT_AVAILABLE = "N/A" -class SsdUtil(SsdBase): +class SsdUtil(StorageBase): def __init__(self, diskdev): """ diff --git a/device/supermicro/x86_64-supermicro_sse_t7132s-r0/plugins/ssd_util.py b/device/supermicro/x86_64-supermicro_sse_t7132s-r0/plugins/ssd_util.py index 3a26dbfe4388..627d41f270cd 100644 --- a/device/supermicro/x86_64-supermicro_sse_t7132s-r0/plugins/ssd_util.py +++ b/device/supermicro/x86_64-supermicro_sse_t7132s-r0/plugins/ssd_util.py @@ -1,4 +1,4 @@ -from sonic_platform_base.sonic_ssd.ssd_generic import SsdUtil as SsdUtilGeneric +from sonic_platform_base.sonic_storage.ssd import SsdUtil as SsdUtilGeneric class SsdUtil(SsdUtilGeneric): def parse_innodisk_info(self): diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 index 4673b62da6e5..1cfd61ee8474 100644 --- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 +++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 @@ -206,3 +206,16 @@ startsecs=10 dependent_startup=true dependent_startup_wait_for=rsyslogd:running {% endif %} + +{% if not skip_stormond %} +[program:stormond] +command=/usr/local/bin/stormond +priority=10 +autostart=false +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +startsecs=10 +dependent_startup=true +dependent_startup_wait_for=rsyslogd:running +{% endif %} diff --git a/platform/marvell/sonic-platform-nokia/7215-a1/utils/sonic_ssd.py b/platform/marvell/sonic-platform-nokia/7215-a1/utils/sonic_ssd.py index 563a0b22ce2d..6b2eac44580b 100644 --- a/platform/marvell/sonic-platform-nokia/7215-a1/utils/sonic_ssd.py +++ b/platform/marvell/sonic-platform-nokia/7215-a1/utils/sonic_ssd.py @@ -2,10 +2,10 @@ import os # pylint: disable=import-error -from sonic_platform_base.sonic_ssd.ssd_base import SsdBase -from sonic_platform_base.sonic_ssd.ssd_generic import SsdUtil as SsdUtilDefault +from sonic_platform_base.sonic_storage.storage_base import StorageBase +from sonic_platform_base.sonic_storage.ssd import SsdUtil as SsdUtilDefault -class EmmcUtil(SsdBase): +class EmmcUtil(StorageBase): def __init__(self, diskdev): self.diskdev = diskdev self.path = os.path.join('/sys/block', os.path.basename(diskdev)) diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index bf72808e00ad..71f9678b5f6a 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -22,6 +22,7 @@ $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SENSORMOND_PY3) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD_PY3) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_YCABLED_PY3) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_CHASSISD_PY3) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_STORMOND_PY3) ifeq ($(PDDF_SUPPORT),y) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(PDDF_PLATFORM_API_BASE_PY3) diff --git a/rules/sonic-stormond.dep b/rules/sonic-stormond.dep new file mode 100644 index 000000000000..94b019913421 --- /dev/null +++ b/rules/sonic-stormond.dep @@ -0,0 +1,10 @@ +SPATH:= $($(SONIC_STORMOND_PY3)_SRC_PATH) +DEP_FILES:= $(SONIC_COMMON_FILES_LIST) rules/sonic-stormond.mk rules/sonic-stormond.dep +DEP_FILES+= $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES:= $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) + +$(SONIC_STORMOND_PY3)_CACHE_MODE:= GIT_CONTENT_SHA +$(SONIC_STORMOND_PY3)_DEP_FLAGS:= $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_STORMOND_PY3)_DEP_FILES:= $(DEP_FILES) +$(SONIC_STORMOND_PY3)_SMDEP_FILES:= $(SMDEP_FILES) +$(SONIC_STORMOND_PY3)_SMDEP_PATHS:= $(SPATH) diff --git a/rules/sonic-stormond.mk b/rules/sonic-stormond.mk new file mode 100644 index 000000000000..714dd61df4a4 --- /dev/null +++ b/rules/sonic-stormond.mk @@ -0,0 +1,9 @@ +# sonic-stormond (SONiC Storage Monitoring daemon) Debian package + +# SONIC_STORMOND_PY3 package + +SONIC_STORMOND_PY3 = sonic_stormond-1.0-py3-none-any.whl +$(SONIC_STORMOND_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-stormond +$(SONIC_STORMOND_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) +$(SONIC_STORMOND_PY3)_PYTHON_VERSION = 3 +SONIC_PYTHON_WHEELS += $(SONIC_STORMOND_PY3) diff --git a/src/sonic-platform-common b/src/sonic-platform-common index 862a67c59de2..cd6a5a42d2d9 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit 862a67c59de267567563e003f5d0845b5f939527 +Subproject commit cd6a5a42d2d9e4973afe1bc5d8b1b5ff5f02d54c diff --git a/src/sonic-utilities b/src/sonic-utilities index 9b463ca54b4d..f14ed66e8b37 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 9b463ca54b4d65cb77aa733224e2bed2ec4cd22a +Subproject commit f14ed66e8b37801ffd217276d3103c8a881983f9 From 5c9ec20c4676e8b21004c7493d43e0d50d4e7063 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:54:39 +1000 Subject: [PATCH 229/282] [Secureboot] Revert the changes done to only do Kernel Signnning (#19199) What I did: Before this feature sonic-net/SONiC#1028 got merged their was intermediate change done to just support Kernel Signing via: #10557. However once this feature is merged : sonic-net/SONiC#1028 (Which support sign of all boot components not just Kernel) we do not need the Kernel only signing changes as it define new rules macro which just create confusion. So as part of this PR i am reverting the Kernel -only sign PR #10557 Signed-off-by: Abhishek Dosi --- Makefile.work | 12 ------------ build_debian.sh | 23 +---------------------- rules/config | 7 ------- slave.mk | 6 ------ 4 files changed, 1 insertion(+), 47 deletions(-) diff --git a/Makefile.work b/Makefile.work index 69cf6e5b180f..c81fe2483096 100644 --- a/Makefile.work +++ b/Makefile.work @@ -339,17 +339,6 @@ ifneq ($(SONIC_VERSION_CACHE_SOURCE),) DOCKER_RUN += -v "$(SONIC_VERSION_CACHE_SOURCE):/vcache:rw" endif -ifeq ($(SONIC_ENABLE_SECUREBOOT_SIGNATURE), y) -ifneq ($(SIGNING_KEY),) - DOCKER_SIGNING_SOURCE := $(shell dirname $(SIGNING_KEY)) - DOCKER_RUN += -v "$(DOCKER_SIGNING_SOURCE):$(DOCKER_SIGNING_SOURCE):ro" -endif -ifneq ($(SIGNING_CERT),) - DOCKER_SIGNING_SOURCE := $(shell dirname $(SIGNING_CERT)) - DOCKER_RUN += -v "$(DOCKER_SIGNING_SOURCE):$(DOCKER_SIGNING_SOURCE):ro" -endif -endif - # User name and tag for "docker-*" images created by native dockerd mode. ifeq ($(strip $(SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD)),y) DOCKER_USERNAME = $(USER_LC) @@ -551,7 +540,6 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \ EXTRA_DOCKER_TARGETS=$(EXTRA_DOCKER_TARGETS) \ BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \ SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \ - SONIC_ENABLE_SECUREBOOT_SIGNATURE=$(SONIC_ENABLE_SECUREBOOT_SIGNATURE) \ SECURE_UPGRADE_MODE=$(SECURE_UPGRADE_MODE) \ SECURE_UPGRADE_DEV_SIGNING_KEY=$(SECURE_UPGRADE_DEV_SIGNING_KEY) \ SECURE_UPGRADE_SIGNING_CERT=$(SECURE_UPGRADE_SIGNING_CERT) \ diff --git a/build_debian.sh b/build_debian.sh index 08b2b720fa1b..3763e5e25336 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -172,24 +172,6 @@ if [[ $CONFIGURED_ARCH == amd64 ]]; then sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install dmidecode hdparm fi -## Sign the Linux kernel -# note: when flag SONIC_ENABLE_SECUREBOOT_SIGNATURE is enabled the Secure Upgrade flags should be disabled (no_sign) to avoid conflict between the features. -if [ "$SONIC_ENABLE_SECUREBOOT_SIGNATURE" = "y" ] && [ "$SECURE_UPGRADE_MODE" != 'dev' ] && [ "$SECURE_UPGRADE_MODE" != "prod" ]; then - if [ ! -f $SIGNING_KEY ]; then - echo "Error: SONiC linux kernel signing key missing" - exit 1 - fi - if [ ! -f $SIGNING_CERT ]; then - echo "Error: SONiC linux kernel signing certificate missing" - exit 1 - fi - - echo '[INFO] Signing SONiC linux kernel image' - K=$FILESYSTEM_ROOT/boot/vmlinuz-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH} - sbsign --key $SIGNING_KEY --cert $SIGNING_CERT --output /tmp/${K##*/} ${K} - sudo cp -f /tmp/${K##*/} ${K} -fi - ## Update initramfs for booting with squashfs+overlay cat files/initramfs-tools/modules | sudo tee -a $FILESYSTEM_ROOT/etc/initramfs-tools/modules > /dev/null @@ -696,10 +678,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo 0 > /etc/fips/fips_enable # ################# # secure boot # ################# -if [[ $SECURE_UPGRADE_MODE == 'dev' || $SECURE_UPGRADE_MODE == "prod" && $SONIC_ENABLE_SECUREBOOT_SIGNATURE != 'y' ]]; then - # note: SONIC_ENABLE_SECUREBOOT_SIGNATURE is a feature that signing just kernel, - # SECURE_UPGRADE_MODE is signing all the boot component including kernel. - # its required to do not enable both features together to avoid conflicts. +if [[ $SECURE_UPGRADE_MODE == 'dev' || $SECURE_UPGRADE_MODE == "prod" ]]; then echo "Secure Boot support build stage: Starting .." # debian secure boot dependecies diff --git a/rules/config b/rules/config index d081fd5aab91..06a6f256f8e6 100644 --- a/rules/config +++ b/rules/config @@ -227,13 +227,6 @@ MASTER_FLUENTD_VERSION = mariner_20230517.1 # The relative path is build root folder. SONIC_ENABLE_IMAGE_SIGNATURE ?= n -# SONIC_ENABLE_SECUREBOOT_SIGNATURE - enable SONiC kernel signing to support UEFI secureboot -# To support UEFI secureboot chain of trust requires EFI kernel to be signed as a PE binary -# SIGNING_KEY = -# SIGNING_CERT = -# The absolute path should be provided. -SONIC_ENABLE_SECUREBOOT_SIGNATURE ?= n - # Full Secure Boot feature flags. # SECURE_UPGRADE_DEV_SIGNING_KEY - path to development signing key, used for image signing during build # SECURE_UPGRADE_SIGNING_CERT - path to development signing certificate, used for image signing during build diff --git a/slave.mk b/slave.mk index 29f6baa25694..a08778bed145 100644 --- a/slave.mk +++ b/slave.mk @@ -1327,9 +1327,6 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_RFS_TARGETS)) : $(TARGET_PATH)/% : \ IMAGE_TYPE=$($(installer)_IMAGE_TYPE) \ TARGET_PATH=$(TARGET_PATH) \ TRUSTED_GPG_URLS=$(TRUSTED_GPG_URLS) \ - SONIC_ENABLE_SECUREBOOT_SIGNATURE="$(SONIC_ENABLE_SECUREBOOT_SIGNATURE)" \ - SIGNING_KEY="$(SIGNING_KEY)" \ - SIGNING_CERT="$(SIGNING_CERT)" \ PACKAGE_URL_PREFIX=$(PACKAGE_URL_PREFIX) \ DBGOPT='$(DBGOPT)' \ SONIC_VERSION_CACHE=$(SONIC_VERSION_CACHE) \ @@ -1581,9 +1578,6 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ ONIE_IMAGE_PART_SIZE=$(ONIE_IMAGE_PART_SIZE) \ SONIC_ENFORCE_VERSIONS=$(SONIC_ENFORCE_VERSIONS) \ TRUSTED_GPG_URLS=$(TRUSTED_GPG_URLS) \ - SONIC_ENABLE_SECUREBOOT_SIGNATURE="$(SONIC_ENABLE_SECUREBOOT_SIGNATURE)" \ - SIGNING_KEY="$(SIGNING_KEY)" \ - SIGNING_CERT="$(SIGNING_CERT)" \ PACKAGE_URL_PREFIX=$(PACKAGE_URL_PREFIX) \ DBGOPT='$(DBGOPT)' \ SONIC_VERSION_CACHE=$(SONIC_VERSION_CACHE) \ From ac9ca022ceef471df826f1061df54f222b2ce7fe Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Wed, 5 Jun 2024 22:01:23 +0800 Subject: [PATCH 230/282] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#19201) #### Why I did it src/sonic-linux-kernel ``` * f9bfb90 - (HEAD -> master, origin/master, origin/HEAD) [ci] Migrate to sonicbld1es agent pool. (#397) (15 minutes ago) [Liu Shilong] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index 9770e1382add..f9bfb90cefbd 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 9770e1382add4f667d1e809a7d03de76e69a6c60 +Subproject commit f9bfb90cefbd00e0a485a0ce4f7bd60134f3eabf From ff39ff6b13fb8fad16de31d5a72371dfb4fced05 Mon Sep 17 00:00:00 2001 From: Konstantin Vasin <126960927+k-v1@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:51:47 +0300 Subject: [PATCH 231/282] [build] use overlay2 for DinD by default (#19078) overlay2 is more faster comparing to vfs (more info in #11111) And we use this option to build SONiC almost two years. But it may be not obvious for some people that default choice is slow. I think we should set overlay2 as a default storage driver for DinD. --- rules/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/config b/rules/config index 06a6f256f8e6..6425005d646b 100644 --- a/rules/config +++ b/rules/config @@ -306,7 +306,7 @@ INCLUDE_FIPS ?= y ENABLE_FIPS ?= n # SONIC_SLAVE_DOCKER_DRIVER - set the sonic slave docker storage driver -SONIC_SLAVE_DOCKER_DRIVER ?= vfs +SONIC_SLAVE_DOCKER_DRIVER ?= overlay2 # SONIC_OS_VERSION - sonic os version SONIC_OS_VERSION ?= 12 From f161794eda45dc3e76cbc151da000c4b4051de86 Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Thu, 6 Jun 2024 00:22:24 +0800 Subject: [PATCH 232/282] [dhcp_relay] Revert cli for dhcp per-interface counter (#19154) * Revert "add show dhcp_relay ipv4 counter entry, fix interface name offset issue (#16507)" This reverts commit 9c1c82e9ff708616017d391213751a3b02492e6d. * Revert "[dhcp-relay]: dhcp/dhcpv6 per interface counter support (#16377)" This reverts commit a522a63e25e2a17ce04c57540117d339fadfb5c5. * Remove test_show_dhcp_relay_ipv4_counter_with_enabled_dhcp_server --- dockers/docker-dhcp-relay/Dockerfile.j2 | 2 - .../test_show_dhcp6relay_counters.py | 44 +++--- .../cli-plugin-tests/test_show_dhcp_relay.py | 10 -- .../cli/show/plugins/show_dhcp_relay.py | 131 +++--------------- sonic-slave-bullseye/Dockerfile.j2 | 1 - 5 files changed, 38 insertions(+), 150 deletions(-) diff --git a/dockers/docker-dhcp-relay/Dockerfile.j2 b/dockers/docker-dhcp-relay/Dockerfile.j2 index 9d0614ce4ae1..48375e214689 100644 --- a/dockers/docker-dhcp-relay/Dockerfile.j2 +++ b/dockers/docker-dhcp-relay/Dockerfile.j2 @@ -19,8 +19,6 @@ RUN apt-get install -y libjsoncpp-dev \ RUN pip3 install psutil -RUN apt-get install -y libjsoncpp-dev - {% if docker_dhcp_relay_debs.strip() -%} # Copy built Debian packages {{ copy_files("debs/", docker_dhcp_relay_debs.split(' '), "/debs/") }} diff --git a/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp6relay_counters.py b/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp6relay_counters.py index 7f7edca64d0d..3cb2d2bb5443 100644 --- a/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp6relay_counters.py +++ b/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp6relay_counters.py @@ -17,21 +17,24 @@ except KeyError: pass -expected_counts_v6 = """\ - Message Type Vlan1000(RX) --------------- --------------- - - Message Type Vlan1000(TX) --------------- --------------- - -""" - -expected_counts_v4 = """\ - Message Type Vlan1000(RX) --------------- --------------- - - Message Type Vlan1000(TX) --------------- --------------- +expected_counts = """\ + Message Type Vlan1000 +------------------- ----------- + Unknown + Solicit + Advertise + Request + Confirm + Renew + Rebind + Reply + Release + Decline + Reconfigure +Information-Request + Relay-Forward + Relay-Reply + Malformed """ @@ -40,14 +43,5 @@ class TestDhcp6RelayCounters(object): def test_show_counts(self): runner = CliRunner() result = runner.invoke(show.dhcp6relay_counters.commands["counts"], ["-i Vlan1000"]) - print(result.output) - assert result.output == expected_counts_v6 - -class TestDhcpRelayCounters(object): - - def test_show_counts(self): - runner = CliRunner() - result = runner.invoke(show.dhcp4relay_counters.commands["counts"], ["-i Vlan1000"]) - print(result.output) - assert result.output == expected_counts_v4 + assert result.output == expected_counts diff --git a/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp_relay.py b/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp_relay.py index 387e052c143a..de55af82d9d4 100644 --- a/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp_relay.py +++ b/dockers/docker-dhcp-relay/cli-plugin-tests/test_show_dhcp_relay.py @@ -173,16 +173,6 @@ def test_show_multi_dhcp_relay(test_name, test_data, fs): assert result == expected_output -def test_show_dhcp_relay_ipv4_counter_with_enabled_dhcp_server(): - with mock.patch.object(show, "is_dhcp_server_enabled", return_value=True), \ - mock.patch.object(swsscommon.ConfigDBConnector, "connect", return_value=None), \ - mock.patch.object(swsscommon.ConfigDBConnector, "get_table", return_value=None), \ - mock.patch.object(click, "echo", return_value=None) as mock_echo: - show.ipv4_counters("Etherner1") - expected_param = "Unsupport to check dhcp_relay ipv4 counter when dhcp_server feature is enabled" - mock_echo.assert_called_once_with(expected_param) - - @pytest.mark.parametrize("enable_dhcp_server", [True, False]) def test_is_dhcp_server_enabled(enable_dhcp_server): result = show.is_dhcp_server_enabled({"dhcp_server": {"state": "enabled" if enable_dhcp_server else "disabled"}}) diff --git a/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py b/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py index 7f99102f9917..d9e87b2b347c 100644 --- a/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py +++ b/dockers/docker-dhcp-relay/cli/show/plugins/show_dhcp_relay.py @@ -1,5 +1,4 @@ import click -import ast from natsort import natsorted from tabulate import tabulate import show.vlan as show_vlan @@ -8,20 +7,13 @@ from swsscommon.swsscommon import ConfigDBConnector from swsscommon.swsscommon import SonicV2Connector + # STATE_DB Table -DHCPv4_COUNTER_TABLE = 'DHCP_COUNTER_TABLE' DHCPv6_COUNTER_TABLE = 'DHCPv6_COUNTER_TABLE' -# DHCPv4 Counter Messages -dhcpv4_messages = [ - "Unknown", "Discover", "Offer", "Request", "Decline", "Ack", "Nack", "Release", "Inform" -] - # DHCPv6 Counter Messages -dhcpv6_messages = [ - "Unknown", "Solicit", "Advertise", "Request", "Confirm", "Renew", "Rebind", "Reply", "Release", - "Decline", "Reconfigure", "Information-Request", "Relay-Forward", "Relay-Reply", "Malformed" -] +messages = ["Unknown", "Solicit", "Advertise", "Request", "Confirm", "Renew", "Rebind", "Reply", "Release", "Decline", + "Reconfigure", "Information-Request", "Relay-Forward", "Relay-Reply", "Malformed"] # DHCP_RELAY Config Table DHCP_RELAY = 'DHCP_RELAY' @@ -47,80 +39,6 @@ def get_dhcp_helper_address(ctx, vlan): show_vlan.VlanBrief.register_column('DHCP Helper Address', get_dhcp_helper_address) -class DHCPv4_Counter(object): - def __init__(self): - self.db = SonicV2Connector(use_unix_socket_path=False) - self.db.connect(self.db.STATE_DB) - self.table_name = DHCPv4_COUNTER_TABLE + self.db.get_db_separator(self.db.STATE_DB) - - def get_interface(self): - """ Get all names of all interfaces in DHCPv4_COUNTER_TABLE """ - interfaces = [] - for key in self.db.keys(self.db.STATE_DB): - if DHCPv4_COUNTER_TABLE in key: - interfaces.append(key[19:]) - return interfaces - - def get_dhcp4relay_msg_count(self, interface, dir): - """ Get count of a dhcprelay message """ - value = self.db.get(self.db.STATE_DB, self.table_name + str(interface), str(dir)) - cnts = ast.literal_eval(str(value)) - data = [] - if cnts is not None: - for k, v in cnts.items(): - data.append([k, v]) - return data - - def clear_table(self, interface): - """ Reset all message counts to 0 """ - v4_cnts = {} - for msg in dhcpv4_messages: - v4_cnts[msg] = '0' - self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("RX"), str(v4_cnts)) - self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("TX"), str(v4_cnts)) - -def print_dhcpv4_count(counter, intf): - """Print count of each message""" - rx_data = counter.get_dhcp4relay_msg_count(intf, "RX") - print(tabulate(rx_data, headers=["Message Type", intf+"(RX)"], tablefmt='simple', stralign='right') + "\n") - tx_data = counter.get_dhcp4relay_msg_count(intf, "TX") - print(tabulate(tx_data, headers=["Message Type", intf+"(TX)"], tablefmt='simple', stralign='right') + "\n") - -# -# 'dhcp4relay_counters' group ### -# - - -@click.group(cls=clicommon.AliasedGroup, name="dhcp4relay_counters") -def dhcp4relay_counters(): - """Show DHCPv4 counter""" - pass - - -def ipv4_counters(interface): - config_db.connect() - feature_tbl = config_db.get_table("FEATURE") - if is_dhcp_server_enabled(feature_tbl): - click.echo("Unsupport to check dhcp_relay ipv4 counter when dhcp_server feature is enabled") - return - counter = DHCPv4_Counter() - counter_intf = counter.get_interface() - - if interface: - print_dhcpv4_count(counter, interface) - else: - for intf in counter_intf: - print_dhcpv4_count(counter, intf) - - -# 'counts' subcommand ("show dhcp4relay_counters counts") -@dhcp4relay_counters.command('counts') -@click.option('-i', '--interface', required=False) -@click.option('--verbose', is_flag=True, help="Enable verbose output") -def counts(interface, verbose): - """Show dhcp4relay message counts""" - ipv4_counters(interface) - class DHCPv6_Counter(object): def __init__(self): @@ -130,37 +48,30 @@ def __init__(self): def get_interface(self): """ Get all names of all interfaces in DHCPv6_COUNTER_TABLE """ - interfaces = [] + vlans = [] for key in self.db.keys(self.db.STATE_DB): if DHCPv6_COUNTER_TABLE in key: - interfaces.append(key[21:]) - return interfaces + vlans.append(key[21:]) + return vlans - def get_dhcp6relay_msg_count(self, interface, dir): + def get_dhcp6relay_msg_count(self, interface, msg): """ Get count of a dhcp6relay message """ - value = self.db.get(self.db.STATE_DB, self.table_name + str(interface), str(dir)) - cnts = ast.literal_eval(str(value)) - data = [] - if cnts is not None: - for k, v in cnts.items(): - data.append([k, v]) + count = self.db.get(self.db.STATE_DB, self.table_name + str(interface), str(msg)) + data = [str(msg), count] return data def clear_table(self, interface): """ Reset all message counts to 0 """ - v6_cnts = {} - for msg in dhcpv6_messages: - v6_cnts[msg] = '0' - self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("RX"), str(v6_cnts)) - self.db.set(self.db.STATE_DB, self.table_name + str(interface), str("TX"), str(v6_cnts)) + for msg in messages: + self.db.set(self.db.STATE_DB, self.table_name + str(interface), str(msg), '0') -def print_dhcpv6_count(counter, intf): +def print_count(counter, intf): """Print count of each message""" - rx_data = counter.get_dhcp6relay_msg_count(intf, "RX") - print(tabulate(rx_data, headers=["Message Type", intf+"(RX)"], tablefmt='simple', stralign='right') + "\n") - tx_data = counter.get_dhcp6relay_msg_count(intf, "TX") - print(tabulate(tx_data, headers=["Message Type", intf+"(TX)"], tablefmt='simple', stralign='right') + "\n") + data = [] + for i in messages: + data.append(counter.get_dhcp6relay_msg_count(intf, i)) + print(tabulate(data, headers=["Message Type", intf], tablefmt='simple', stralign='right') + "\n") # @@ -179,10 +90,10 @@ def ipv6_counters(interface): counter_intf = counter.get_interface() if interface: - print_dhcpv6_count(counter, interface) + print_count(counter, interface) else: for intf in counter_intf: - print_dhcpv6_count(counter, intf) + print_count(counter, intf) # 'counts' subcommand ("show dhcp6relay_counters counts") @@ -191,6 +102,7 @@ def ipv6_counters(interface): @click.option('--verbose', is_flag=True, help="Enable verbose output") def counts(interface, verbose): """Show dhcp6relay message counts""" + ipv6_counters(interface) @@ -296,10 +208,6 @@ def dhcp_relay_ipv4_destination(): def dhcp_relay_ipv6_destination(): get_dhcp_relay(DHCP_RELAY, DHCPV6_SERVERS, with_header=True) -@dhcp_relay_ipv4.command("counters") -@click.option('-i', '--interface', required=False) -def dhcp_relay_ip4counters(interface): - ipv4_counters(interface) @dhcp_relay_ipv6.command("counters") @click.option('-i', '--interface', required=False) @@ -308,7 +216,6 @@ def dhcp_relay_ip6counters(interface): def register(cli): - cli.add_command(dhcp4relay_counters) cli.add_command(dhcp6relay_counters) cli.add_command(dhcp_relay_helper) cli.add_command(dhcp_relay) diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index 2272dac60f94..ea3cd41ef028 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -359,7 +359,6 @@ RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install # For DHCP Monitor tool libexplain-dev \ libevent-dev \ - libjsoncpp-dev \ # For libyang swig \ # For build dtb From 7966f8acdbdcbac66d892267e6333368616da78a Mon Sep 17 00:00:00 2001 From: Pavan Prakash <120486223+Pavan-Nokia@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:27:54 -0400 Subject: [PATCH 233/282] [Nokia-7215] Enhance Watchdog service (#18850) Mask Watchdog-control.service and make sure only one watchdog service starts on this platform --- .../marvell/sonic-platform-nokia/7215/service/cpu_wdt.service | 1 + .../debian/sonic-platform-nokia-7215.postinst | 2 ++ 2 files changed, 3 insertions(+) diff --git a/platform/marvell/sonic-platform-nokia/7215/service/cpu_wdt.service b/platform/marvell/sonic-platform-nokia/7215/service/cpu_wdt.service index 761deec569cc..993070a14a2a 100644 --- a/platform/marvell/sonic-platform-nokia/7215/service/cpu_wdt.service +++ b/platform/marvell/sonic-platform-nokia/7215/service/cpu_wdt.service @@ -1,5 +1,6 @@ [Unit] Description=CPU WDT +Conflicts=watchdog-control.service After=nokia-7215init.service [Service] ExecStart=/usr/local/bin/cpu_wdt.py diff --git a/platform/marvell/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst b/platform/marvell/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst index 9dfcc91de046..1a5f95c1a21e 100644 --- a/platform/marvell/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst +++ b/platform/marvell/sonic-platform-nokia/debian/sonic-platform-nokia-7215.postinst @@ -9,6 +9,8 @@ systemctl restart kmod systemctl enable nokia-7215init.service systemctl start nokia-7215init.service +systemctl mask --now watchdog-control.service + systemctl enable cpu_wdt.service systemctl start cpu_wdt.service From 222ce1717d2d581f7b99214af5120b8f6bc00f63 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Wed, 5 Jun 2024 15:54:38 -0700 Subject: [PATCH 234/282] Include unresolved neighbors when comparing APPL_DB and kernel neighbors (#19164) Signed-off-by: Lawrence Lee Include unresolved neighbors when comparing APPL_DB and kernel neighbors. --- files/scripts/arp_update | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/scripts/arp_update b/files/scripts/arp_update index 7fd5667bca83..5b2b6989ee4b 100755 --- a/files/scripts/arp_update +++ b/files/scripts/arp_update @@ -178,8 +178,8 @@ while /bin/true; do # resolve neighbor entries from CONFIG_DB in case of mismatch with kernel DBNEIGH="$DBNEIGH $(sonic-db-cli CONFIG_DB keys NEIGH* | sed -e 's/|/:/g')" - KERNEIGH4=$(ip -4 neigh show | grep Vlan | grep -v 'FAILED\|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',') - KERNEIGH6=$(ip -6 neigh show | grep -v fe80 | grep Vlan | grep -v 'FAILED\|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',') + KERNEIGH4=$(ip -4 neigh show | grep Vlan | cut -d ' ' -f 1,3 --output-delimiter=',') + KERNEIGH6=$(ip -6 neigh show | grep -v fe80 | grep Vlan | cut -d ' ' -f 1,3 --output-delimiter=',') for neigh in $DBNEIGH; do intf="$( cut -d ':' -f 2 <<< "$neigh" )" ip="$( cut -d ':' -f 3- <<< "$neigh" )" From 962577ac0245063df69969b9fe74fa028b69b933 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Wed, 5 Jun 2024 15:57:47 -0700 Subject: [PATCH 235/282] [Mellanox]Updating SDK/FW to 4.6.4062/2012.4062 SAI to SAIBuild2405.28.0.30 (#19198) - Why I did it Updating SDK/FW to 4.6.4062/2012.4062 SAI to SAIBuild2405.28.0.30 - How I did it Updating Makefiles - How to verify it Running sonic-mgmt tests --- platform/mellanox/fw.mk | 12 ++++++------ platform/mellanox/mlnx-sai.mk | 2 +- platform/mellanox/sdk.mk | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 8409f60861b7..62014478b3f2 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -21,33 +21,33 @@ MLNX_FW_BASE_PATH = $(MLNX_SDK_BASE_PATH) # Place an URL here to FW if you want to download FW instead MLNX_FW_BASE_URL = -SIMX_VERSION = 24.4-1067 +SIMX_VERSION = 24.4-1091 FW_FROM_URL = y -MLNX_FW_ASSETS_RELEASE_TAG = fw-2012.3064 +MLNX_FW_ASSETS_RELEASE_TAG = fw-2012.4062 MLNX_FW_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_FW_ASSETS_RELEASE_TAG) ifeq ($(MLNX_FW_BASE_URL), ) MLNX_FW_BASE_URL = $(MLNX_FW_ASSETS_URL) endif -MLNX_SPC_FW_VERSION = 13.2012.3064 +MLNX_SPC_FW_VERSION = 13.2012.4062 MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa $(MLNX_SPC_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC_FW_FILE) -MLNX_SPC2_FW_VERSION = 29.2012.3064 +MLNX_SPC2_FW_VERSION = 29.2012.4062 MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa $(MLNX_SPC2_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC2_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC2_FW_FILE) -MLNX_SPC3_FW_VERSION = 30.2012.3064 +MLNX_SPC3_FW_VERSION = 30.2012.4062 MLNX_SPC3_FW_FILE = fw-SPC3-rel-$(subst .,_,$(MLNX_SPC3_FW_VERSION))-EVB.mfa $(MLNX_SPC3_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC3_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC3_FW_FILE) -MLNX_SPC4_FW_VERSION = 34.2012.3064 +MLNX_SPC4_FW_VERSION = 34.2012.4062 MLNX_SPC4_FW_FILE = fw-SPC4-rel-$(subst .,_,$(MLNX_SPC4_FW_VERSION))-EVB.mfa $(MLNX_SPC4_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC4_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC4_FW_FILE) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index d9b3102b3f73..8eae89f3a7ef 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,6 +1,6 @@ # Mellanox SAI -MLNX_SAI_VERSION = SAIBuild2311.27.0.16 +MLNX_SAI_VERSION = SAIBuild2405.28.0.30 MLNX_SAI_ASSETS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins MLNX_SAI_ASSETS_RELEASE_TAG = sai-$(MLNX_SAI_VERSION)-$(BLDENV)-$(CONFIGURED_ARCH) MLNX_SAI_ASSETS_URL = $(MLNX_SAI_ASSETS_GITHUB_URL)/releases/download/$(MLNX_SAI_ASSETS_RELEASE_TAG) diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index 8554e9a03792..15ccedc7b606 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -MLNX_SDK_VERSION = 4.6.3064 +MLNX_SDK_VERSION = 4.6.4062 MLNX_SDK_ISSU_VERSION = 101 MLNX_SDK_DRIVERS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers From 6fdb3cacadc842e537fb03bcced16850ab446546 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 6 Jun 2024 07:57:18 +0800 Subject: [PATCH 236/282] [ci/build]: Upgrade SONiC package versions (#19207) --- .../versions-deb-bookworm | 22 +- .../build-sonic-slave-bookworm/versions-py3 | 3 +- .../build-sonic-slave-bullseye/versions-py3 | 3 +- files/build/versions/default/versions-docker | 29 ++- files/build/versions/default/versions-git | 17 +- files/build/versions/default/versions-mirror | 40 +-- files/build/versions/default/versions-web | 238 +++++++++++++----- .../versions-deb-bookworm | 10 +- .../versions-deb-bullseye | 1 - .../versions-deb-bullseye-armhf | 1 - .../versions-py3 | 2 +- .../versions-deb-bullseye | 2 +- .../versions-py3 | 2 +- .../docker-fpm-frr/versions-deb-bookworm | 49 ++++ .../docker-fpm-frr/versions-deb-bullseye | 45 ---- .../versions-deb-bullseye | 2 +- .../versions-deb-bookworm | 1 + .../docker-platform-monitor/versions-py3 | 4 +- .../dockers/docker-ptf/versions-deb-buster | 6 +- .../docker-sonic-mgmt-framework/versions-py3 | 4 +- .../docker-sonic-vs/versions-deb-bullseye | 2 +- .../dockers/docker-sonic-vs/versions-py3 | 8 +- .../versions-deb-bullseye | 1 + .../versions-deb-bookworm | 53 ++++ .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../versions-deb-bullseye | 2 +- .../docker-syncd-mlnx/versions-deb-bookworm | 2 +- .../versions-deb-bookworm | 15 +- .../versions-deb-bullseye | 23 +- .../versions-deb-bullseye-armhf | 8 +- .../sonic-slave-buster/versions-deb-buster | 11 +- .../versions/host-image/versions-deb-bookworm | 33 ++- files/build/versions/host-image/versions-py3 | 10 +- 34 files changed, 429 insertions(+), 224 deletions(-) delete mode 100644 files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye-armhf create mode 100644 files/build/versions/dockers/docker-fpm-frr/versions-deb-bookworm delete mode 100644 files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye create mode 100644 files/build/versions/dockers/docker-syncd-bluefield/versions-deb-bookworm diff --git a/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm b/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm index d53a235ff3d8..97bc192b067e 100644 --- a/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm +++ b/files/build/versions/build/build-sonic-slave-bookworm/versions-deb-bookworm @@ -1,7 +1,15 @@ applibs==1.mlnx.4.6.3064 applibs-dev==1.mlnx.4.6.3064 -kernel-mft-dkms==4.27.0-83 +bfscripts==4.6.0-13035 +doca-cx-libs==2.7.0034-1 +ibverbs-providers==2307mlnx47-1.2310036 +kernel-mft-dkms==4.28.0-96 +kernel-mft-dkms-modules-6.1.0-11-2-arm64==4.26.1 libdashapi==1.0.0 +libdoca-cx-libs-dev==2.7.0034-1 +libgrpc-dev==1.39.0-1 +libibverbs-dev==2307mlnx47-1.2310036 +libibverbs1==2307mlnx47-1.2310036 libnl-3-200==3.5.0-1 libnl-3-dev==3.5.0-1 libnl-cli-3-200==3.5.0-1 @@ -12,6 +20,7 @@ libnl-nf-3-200==3.5.0-1 libnl-nf-3-dev==3.5.0-1 libnl-route-3-200==3.5.0-1 libnl-route-3-dev==3.5.0-1 +librxpcompiler-dev==22.05.1 libsai==1.0.0 libsaimetadata==1.0.0 libsaimetadata-dev==1.0.0 @@ -33,11 +42,22 @@ libyang-dev==1.0.73 linux-headers-6.1.0-11-2-amd64==6.1.38-4 linux-headers-6.1.0-11-2-arm64==6.1.38-4 linux-headers-6.1.0-11-2-common==6.1.38-4 +mft==4.26.1-3 +mlnx-dpdk==22.11.0-2404.0.2 +mlnx-dpdk-dev==22.11.0-2404.0.2 +mlnx-iproute2==6.4.0-1.2310036 +mlnx-ofed-kernel-utils==23.10.OFED.23.10.0.3.6.1-1 +mlnx-tools==23.10.0-1.2310036 +mlxbf-bootctl==2.1 +mlxbf-bootimages==4.6.0-13035 p4lang-bmv2==1.15.0-7 p4lang-p4c==1.2.4.2-2 p4lang-pi==0.1.0-15 python3-swsscommon==1.0.0 python3-yang==1.0.73 +rdma-core==2307mlnx47-1.2310036 +rxp-compiler==22.05.1 +sdn-appliance==1.5-1mlnx1 sonic-mgmt-common==1.0.0 sonic-mgmt-common-codegen==1.0.0 sonic-platform-pddf==1.1 diff --git a/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 b/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 index eb8e166158a1..cabe3e8db4cd 100644 --- a/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bookworm/versions-py3 @@ -5,7 +5,7 @@ click==7.0 click-log==0.4.0 colorful==0.5.6 deepdiff==6.2.2 -docker==7.0.0 +docker==7.1.0 docker-image-py==0.1.12 enlighten==1.12.4 filelock==3.14.0 @@ -40,3 +40,4 @@ urllib3==2.2.1 wcwidth==0.2.13 www-authenticate==0.9.2 xmltodict==0.12.0 +zipp==1.2.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 index 97b8c8233b11..ab8c14a49c65 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -4,7 +4,7 @@ cffi==1.16.0 charset-normalizer==3.3.2 click-log==0.4.0 colorful==0.5.6 -docker==7.0.0 +docker==7.1.0 docker-image-py==0.1.12 enlighten==1.12.4 filelock==3.14.0 @@ -29,4 +29,3 @@ tabulate==0.9.0 toposort==1.6 www-authenticate==0.9.2 xmltodict==0.12.0 -zipp==1.2.0 diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker index 75ade2ee96de..0a183990093f 100644 --- a/files/build/versions/default/versions-docker +++ b/files/build/versions/default/versions-docker @@ -1,16 +1,15 @@ -amd64:amd64/debian:bookworm==sha256:40f71cd223a60afc1bac2adf1b204bfabef29cdef725e74993f86098ff87f92f -amd64:amd64/debian:bullseye==sha256:38fb0f1618bfa65b0cf1dd279293ebc70ef94aab2f2dc49274a2efc6ee29880e -amd64:debian:bookworm==sha256:1aadfee8d292f64b045adb830f8a58bfacc15789ae5f489a0fedcd517a862cb9 -amd64:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 -amd64:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 +amd64:amd64/debian:bookworm==sha256:08f76151d500d9e021b9f793364a3e9e534433297d16ba0152d69d1914b64d17 +amd64:amd64/debian:bullseye==sha256:5f2875f43c30349791f096598cbc96a774c422eeb2405e09ac4a7fc97492b623 +amd64:debian:bookworm==sha256:fac2c0fd33e88dfd3bc88a872cfb78dcb167e74af6162d31724df69e482f886c +amd64:debian:bullseye==sha256:2c7a92a41cb814c00e7d455b2bc0c90ccdb9a4ced2ffdc10e562c7a84a186032 +amd64:debian:buster==sha256:6e7bd55a5705914837aad8db01b349f4617510c11e47ccae8e87f6f14e489626 amd64:p4lang/behavioral-model@sha256:ce45720e28a96a50f275c1b511cd84c2558b62f2cf7a7e506765183bc3fb2e32==sha256:ce45720e28a96a50f275c1b511cd84c2558b62f2cf7a7e506765183bc3fb2e32 -arm64:arm64v8/debian:bookworm==sha256:40374b5cdc928ffc606cb5c2bbf5e2b2eb6eb918a8e62104ae1f001c49dcbe3a -arm64:arm64v8/debian:bullseye==sha256:284d075b0fd0350198c79fcb19b9b0fccac6ade8ada1b1309aee35dd223fc802 -arm64:debian:bookworm==sha256:1aadfee8d292f64b045adb830f8a58bfacc15789ae5f489a0fedcd517a862cb9 -arm64:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 -arm64:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 -armhf:arm32v7/debian:bookworm==sha256:4c1f203254edd0f60bf8269d57f64c3cfc238af1d13d4f8e484c05af2154046b -armhf:arm32v7/debian:bullseye==sha256:c1205d95cc1479322f5c34df0a98f62ede571d041cb02a48ccca34209b3f7be9 -armhf:debian:bookworm==sha256:1aadfee8d292f64b045adb830f8a58bfacc15789ae5f489a0fedcd517a862cb9 -armhf:debian:bullseye==sha256:f860cec7ccaf31b42cd60b6a409f9dad9510ea27fca9c2864741087b4298a1e3 -armhf:debian:buster==sha256:bce46a1c39574f98c845df4a5acc6c70c211df5a6182e428c1155c33317d4920 +arm64:arm64v8/debian:bookworm==sha256:3d67cec2f6aa8a4d6aa496ae8097747f216fe850aebc8db99548cb8a85e73181 +arm64:arm64v8/debian:bullseye==sha256:2fcb4b943d3c026dff3bb55f470140bea8c1ce2e05a03e62185d6f12dd131ac2 +arm64:debian:bookworm==sha256:fac2c0fd33e88dfd3bc88a872cfb78dcb167e74af6162d31724df69e482f886c +arm64:debian:bullseye==sha256:2c7a92a41cb814c00e7d455b2bc0c90ccdb9a4ced2ffdc10e562c7a84a186032 +arm64:debian:buster==sha256:6e7bd55a5705914837aad8db01b349f4617510c11e47ccae8e87f6f14e489626 +armhf:arm32v7/debian:bookworm==sha256:c5f29bcdb75f6a394c94d3f57daa79503870d45a3cd48b4a04fda725e9bd45db +armhf:debian:bookworm==sha256:fac2c0fd33e88dfd3bc88a872cfb78dcb167e74af6162d31724df69e482f886c +armhf:debian:bullseye==sha256:2c7a92a41cb814c00e7d455b2bc0c90ccdb9a4ced2ffdc10e562c7a84a186032 +armhf:debian:buster==sha256:6e7bd55a5705914837aad8db01b349f4617510c11e47ccae8e87f6f14e489626 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index db1e94a1aa2d..7ac0b5c3bc23 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,11 +1,11 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==6708d95ec6d819098093cd57c746636a5bb9a4ea +https://chromium.googlesource.com/chromium/tools/depot_tools.git==ada9211999786073eb44acab46e596311523e0df https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==4c733412e7173219166be7053940326a92699765 https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 -https://github.com/flashrom/flashrom.git==85b977151b8f5717ad00b7b7204521a823ac1ad2 -https://github.com/FreeRADIUS/freeradius-server.git==3310bf65f2912231fcb1dc59b1624d6894e3ca2a +https://github.com/flashrom/flashrom.git==e25129d9b6cf5bc39fed03cbf60af2378a3e745f +https://github.com/FreeRADIUS/freeradius-server.git==3eb4a4b01e4b33a44b07a6ae6b50071fe09ad1f8 https://github.com/FreeRADIUS/pam_radius.git==d802da75cbfc3062ae1b18d0bf26ac2a030ffdaa https://github.com/jeroennijhof/pam_tacplus.git==b839c440e33c36eced9dcbc287fcfe6237c4c4ce https://github.com/lguohan/gnxi.git==3adf8b97755b49947e465b5a14645f11e79fa0cd @@ -13,10 +13,11 @@ https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74 https://github.com/openconfig/oc-pyang.git==4607fd1987d4f586aba03b40f222015cb3ef8161 https://github.com/p4lang/ptf.git==c554f83685186be4cfa9387eb5d6d700d2bbd7c0 https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==6edc82d62a1cf0f7fb821587af67e5520624f50d +https://github.com/sflow/host-sflow==a3ce4814bb6673a314142183e22c0e710cd21292 https://github.com/sflow/sflowtool==c42c49cb80b927a4c02e54fc26430417f18f4833 -https://github.com/sonic-net/DASH.git==2cb918fbe22eee60296c7326af530bd25b23398f -https://github.com/thom311/libnl==49f7822961f5bc6b18cd2a2d3f3b8d2ab0896d3f -https://salsa.debian.org/kernel-team/initramfs-tools.git==b7f5a3ceaa306212aa5c7810d5fc5faf82bc4ffe +https://github.com/sonic-net/DASH.git==b3d7a6a61bb1d9322718e3e289603512a692b31f +https://github.com/thom311/libnl==5248e1a45576617b349465997822cef34cbc5053 +https://salsa.debian.org/kernel-team/initramfs-tools.git==84e5c0f7dac1a17e980ed8dfb0e0e8729d9388db https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d -https://salsa.debian.org/ssh-team/openssh.git==d150d0d69246f55c711684078f47f999a4bfd6bc +https://salsa.debian.org/ssh-team/openssh.git==096572ea878f93fe2c85d8e86e43e2281f3f46d7 +https://salsa.debian.org/tai271828/rasdaemon.git==51a7f485f8b2e2ae43e613f19c5a387595174132 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 9ed36688b2dc..8fbce29f2a86 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,24 +1,24 @@ archive.ubuntu.com_ubuntu_dists_focal==2020-04-23T17:33:17Z -archive.ubuntu.com_ubuntu_dists_focal-backports==2023-11-13T00:36:10Z -archive.ubuntu.com_ubuntu_dists_focal-updates==2024-05-20T01:41:38Z +archive.ubuntu.com_ubuntu_dists_focal-backports==2024-05-31T11:48:10Z +archive.ubuntu.com_ubuntu_dists_focal-updates==2024-06-05T02:25:09Z deb.nodesource.com_node%5f14.x_dists_bookworm==2023-02-17T00:35:29Z deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20240519T000308Z -debian-security==20240519T000258Z -download.docker.com_linux_debian_dists_bookworm==2024-05-16T12:25:40Z -download.docker.com_linux_debian_dists_bullseye==2024-05-16T12:25:40Z -download.docker.com_linux_debian_dists_buster==2024-05-16T12:25:40Z -packages.trafficmanager.net_snapshot_debian-security_20240519T000258Z_dists_bookworm-security==2024-05-17T18:44:06Z -packages.trafficmanager.net_snapshot_debian-security_20240519T000258Z_dists_bullseye-security==2024-05-17T18:44:06Z -packages.trafficmanager.net_snapshot_debian-security_20240519T000258Z_dists_buster_updates==2024-05-17T18:44:07Z -packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bookworm==2024-02-10T11:07:25Z -packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bookworm-backports==2024-05-18T20:11:44Z -packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bookworm-updates==2024-05-18T20:11:44Z -packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bullseye==2024-02-10T12:40:37Z -packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bullseye-backports==2024-05-18T20:11:44Z -packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_bullseye-updates==2024-05-18T20:11:43Z -packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_buster-backports==2024-03-09T20:54:54Z -packages.trafficmanager.net_snapshot_debian_20240519T000308Z_dists_buster-updates==2023-06-10T08:55:10Z -security.ubuntu.com_ubuntu_dists_focal-security==2024-05-15T17:54:08Z +debian==20240605T000248Z +debian-security==20240605T000248Z +download.docker.com_linux_debian_dists_bookworm==2024-05-28T14:05:22Z +download.docker.com_linux_debian_dists_bullseye==2024-05-28T14:05:22Z +download.docker.com_linux_debian_dists_buster==2024-05-23T13:29:25Z +packages.trafficmanager.net_snapshot_debian-security_20240605T000248Z_dists_bookworm-security==2024-06-02T16:19:05Z +packages.trafficmanager.net_snapshot_debian-security_20240605T000248Z_dists_bullseye-security==2024-06-02T16:19:06Z +packages.trafficmanager.net_snapshot_debian-security_20240605T000248Z_dists_buster_updates==2024-06-02T16:19:05Z +packages.trafficmanager.net_snapshot_debian_20240605T000248Z_dists_bookworm==2024-02-10T11:07:25Z +packages.trafficmanager.net_snapshot_debian_20240605T000248Z_dists_bookworm-backports==2024-06-04T20:13:32Z +packages.trafficmanager.net_snapshot_debian_20240605T000248Z_dists_bookworm-updates==2024-06-04T20:13:32Z +packages.trafficmanager.net_snapshot_debian_20240605T000248Z_dists_bullseye==2024-02-10T12:40:37Z +packages.trafficmanager.net_snapshot_debian_20240605T000248Z_dists_bullseye-backports==2024-06-04T20:13:32Z +packages.trafficmanager.net_snapshot_debian_20240605T000248Z_dists_bullseye-updates==2024-06-04T20:13:32Z +packages.trafficmanager.net_snapshot_debian_20240605T000248Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20240605T000248Z_dists_buster-backports==2024-03-09T20:54:54Z +packages.trafficmanager.net_snapshot_debian_20240605T000248Z_dists_buster-updates==2023-06-10T08:55:10Z +security.ubuntu.com_ubuntu_dists_focal-security==2024-05-31T18:15:07Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index bb96556092b9..1147fa6e5dec 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -23,8 +23,9 @@ http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-p4c_1.2. http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-pi_0.1.0-15.debian.tar.xz==b9d8e4ce4cb66385250cf6dded0ef57a http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-pi_0.1.0-15.dsc==9bfdfc3b6bf96e4e8c3a6a72fc56fded http://download.opensuse.org/repositories/home:/p4lang/Debian_11/p4lang-pi_0.1.0.orig.tar.gz==551d3780d615557674e93fa11210499d -http://www.iana.org/assignments/enterprise-numbers.txt==a08ba53e0976a8776b3b1a2cc9f91feb -http://www.mellanox.com/downloads/MFT/mft-4.27.0-83-x86_64-deb.tgz==e475ca87a9252ba8d0abb6b05d5d94d0 +http://www.iana.org/assignments/enterprise-numbers.txt==63fa3879db4888f790293029f63dbac6 +http://www.mellanox.com/downloads/MFT/mft-4.26.1-3-arm64-deb.tgz==0dda58196e4a303be1b7d570d3c25e68 +http://www.mellanox.com/downloads/MFT/mft-4.28.0-96-x86_64-deb.tgz==f552e1faddc8f76fe4eb0b8902606c2a https://archive.apache.org/dist/thrift/0.14.1/thrift-0.14.1.tar.gz==c64434548438df2cb1e53fb27c600e85 https://bootstrap.pypa.io/pip/2.7/get-pip.py==60e8267eb1b7bc71dc4843eb7bd294d3 https://deb.debian.org/debian/pool/main/i/ipmitool/ipmitool_1.8.19-4.debian.tar.xz==aee97d7c05ca32815652bf899a029f9d @@ -51,6 +52,43 @@ https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/third_party/ad https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc-dev_1.13.0-1_arm64.deb==1162131e154bba573bf7502d743f1d81 https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsaictc_1.13.0-1_arm64.deb==b8b25694a1dc9b4d8dffc2f2c04ddaed https://github.com/CumulusNetworks/ifupdown2/archive/3.0.0-1.tar.gz==755459b3a58fbc11625336846cea7420 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/bfscripts_4.6.0-13035_all.deb==232bdd3dcdf705530b82d1079a4bcd60 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/gpio-mlxbf3.ko==0397c082e8127d7d529e4f1dc1551855 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/mlx-bootctl.ko==addf7a88f10e8bc3278d222437aefdbb +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/mlxbf-bootctl_2.1_arm64.deb==aa521424ae27f4ec6e3348143ff1087a +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/mlxbf-bootimages-signed_4.6.0-13035_arm64.deb==4a91c6143375cf4a8bb7cfecf961c16d +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/mlxbf-gige.ko==4a439c3b2fb924f4fce5ba4293bb962e +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/mlxbf-pka.ko==7cfa549ce77aa57698864b9b3fe81ae2 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/mlxbf-ptm.ko==7e642ebab66631ff9b4bbb47fd83c32c +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/mlxbf-tmfifo.ko==5ea4e550f189dd9df5c3ef405e2e6136 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/pinctrl-mlxbf3.ko==91322cde339d51eee234c430e84cd2e3 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/pwr-mlxbf.ko==64be93a5e2b03816cb67f1a40105d6d9 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-bfsoc-4.6.0-13035-bookworm/sdhci-of-dwcmshc.ko==41d47a5ec7062fb28f444f393685b9f9 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-fw-32.39.1002/fw-BlueField-3-rel-32_39_1002.mfa==4c47ee2fc6f7a368617f6bc216f3ddb0 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sai-SAIBuild0.0.30.0-bookworm/mlnx-sai-dbgsym_1.mlnx.SAIBuild0.0.30.0_arm64.deb==938914ad288c4093bbee065e9836554b +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sai-SAIBuild0.0.30.0-bookworm/mlnx-sai_1.mlnx.SAIBuild0.0.30.0_arm64.deb==f5a05290490f9db067e31519a680c2e6 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//doca-cx-libs-dbgsym_2.7.0034-1_arm64.deb==ce958227fddc4527b8b86472b42ec2d5 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//doca-cx-libs_2.7.0034-1_arm64.deb==bcda8fe15d490fbf2fc9d198b1b9bcb1 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//ibverbs-providers_2307mlnx47-1.2310036_arm64.deb==1eabbdc70e0b0be9543560f672d22486 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//libdoca-cx-libs-dev_2.7.0034-1_arm64.deb==440aa546e7a7a4c546b8ca3b43592aa0 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//libgrpc-dev-dbgsym_1.39.0-1_arm64.deb==fd2d91dabc8904a504dc6e26b96305d9 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//libgrpc-dev_1.39.0-1_arm64.deb==efefb0ac891143cfb50e3848ada265ee +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//libibumad-dev_2307mlnx47-1.2310036_arm64.deb==53fc07764e6730c25f15cde8e06d526d +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//libibumad3_2307mlnx47-1.2310036_arm64.deb==083f1b171039174844ffa538913b5ce3 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//libibverbs-dev_2307mlnx47-1.2310036_arm64.deb==cbacf0ebac5035f16e073c7f62487f67 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//libibverbs1_2307mlnx47-1.2310036_arm64.deb==d4d1361e418f3da5a6d52eafd589a8e4 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//librdmacm-dev_2307mlnx47-1.2310036_arm64.deb==e46272ac390f3df672e24abdb34092dd +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//librdmacm1_2307mlnx47-1.2310036_arm64.deb==d2d588e7c568ad283a0a5429a719c099 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//librxpcompiler-dev_22.05.1_arm64.deb==ec65d50661b6ae02c3ae60bd500f21b7 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//mlnx-dpdk-dev_22.11.0-2404.0.2_arm64.deb==f0dcdd56441d15ab47a73dcf00a2716c +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//mlnx-dpdk_22.11.0-2404.0.2_arm64.deb==c915b634f08cd056d09c7605ab1167bc +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//mlnx-iproute2_6.4.0-1.2310036_arm64.deb==2ceff828edfd36ecc102dabdc762de67 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//mlnx-ofed-kernel-modules-6.1.0-11-2-arm64_23.10.OFED.23.10.0.3.6.1_arm64.deb==06713b207281fdd723b94302a481bf53 +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//mlnx-ofed-kernel-utils_23.10.OFED.23.10.0.3.6.1-1_arm64.deb==b6f2c43c9ae7a3e05a0712eae06e47ff +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//mlnx-tools_23.10.0-1.2310036_arm64.deb==b1c46f7bbadce251d7bd02054aefb1fc +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//rdma-core_2307mlnx47-1.2310036_arm64.deb==2f9e98f0e381dbcebcc25c808e3f257a +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//rxp-compiler_22.05.1_arm64.deb==dd7265c708beffaf4a1dc4cdeac28c6e +https://github.com/Mellanox/sonic-bluefield-packages/releases/download/dpu-sdk-24.4-RC2-bookworm//sdn-appliance_1.5-1mlnx1_arm64.deb==21ddb6583872579ee2d282117bb8d043 https://github.com/Mellanox/sonic-bluefield-packages/releases/download/rshim-2.0.19-bookworm-amd64/rshim_2.0.19_amd64.deb==8128219b0328704b67def640a356df1f https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.3064/fw-SPC-rel-13_2012_3064-EVB.mfa==55a6024132fb9192fe4a5a1804b4526c https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2012.3064/fw-SPC2-rel-29_2012_3064-EVB.mfa==093179eb16f8f2e296369015d627af14 @@ -95,6 +133,9 @@ https://sonicstorage.blob.core.windows.net/debian/pool/main/l/lldpd/lldpd_1.0.16 https://sonicstorage.blob.core.windows.net/debian/pool/main/liby/libyang/libyang2_2.0.112-6.debian.tar.xz==aa798a069f506a243d337c18600477e5 https://sonicstorage.blob.core.windows.net/debian/pool/main/liby/libyang/libyang2_2.0.112-6.dsc==da4924086edc4911c6fca21ca46fdb1d https://sonicstorage.blob.core.windows.net/debian/pool/main/liby/libyang/libyang2_2.0.112.orig.tar.gz==4ac414ef27f3c4d14f96c2f49c58c2be +https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.7.3+dfsg-5.debian.tar.xz==ad957e90207d0669beb2109e4e325def +https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.7.3+dfsg-5.dsc==2443e4dffbdb020e7ab4f947a7904912 +https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.7.3+dfsg.orig.tar.xz==6391ae27eb1ae34ff5530712bb1c4209 https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9+dfsg-4+deb11u1.debian.tar.xz==a3e626b1ed5adc26430e1727d81641df https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9+dfsg-4+deb11u1.dsc==a36ed553b5034b7400d9e9a8d529b27e https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.9+dfsg.orig.tar.xz==6c2d346ce3320e8999500497e9bacc99 @@ -112,62 +153,143 @@ https://sonicstorage.blob.core.windows.net/public/debian/socat_1.7.4.1.orig.tar. https://sonicstorage.blob.core.windows.net/public/debian/thrift_0.11.0-4.debian.tar.xz==52ad383b97ad051f4d1d25b54aaad569 https://sonicstorage.blob.core.windows.net/public/debian/thrift_0.11.0-4.dsc==6917fe7b3ada9313be94713dd50fee7b https://sonicstorage.blob.core.windows.net/public/debian/thrift_0.11.0.orig.tar.gz==0be59730ebce071eceaf6bfdb8d3a20e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_amd64.deb==b60f6db62805696b47ab422ab798fe56 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/amd64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_amd64.deb==1c920937aa49b602a1bfec3c49747131 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-go_1.15.15-1~deb11u4%2Bfips_arm64.deb==0b70c104b907db13ff2fe5d52b3d0008 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.1/arm64/golang-1.15-src_1.15.15-1~deb11u4%2Bfips_arm64.deb==1d06900f03424fa5ce34a782605983fe -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb==145e103357a915cc759cc93de602b631 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb==1c1a46d5599be92777702643c37d5751 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/krb5-multidev_1.18.3-6+deb11u4+fips_amd64.deb==41c7aecaf738ceb8e0348b9420d0aa3f -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libgssapi-krb5-2_1.18.3-6+deb11u4+fips_amd64.deb==9ab263ae9192bf4c964ea3ad86012c9a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libgssrpc4_1.18.3-6+deb11u4+fips_amd64.deb==4913523ed341663cd9a8bd2ea0e5c64a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libk5crypto3_1.18.3-6+deb11u4+fips_amd64.deb==5c89f642c4265a2f53d8788f93b37aaf -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkadm5clnt-mit12_1.18.3-6+deb11u4+fips_amd64.deb==19a7a6eeae8387d4114a6b76ff5fc7c8 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkadm5srv-mit12_1.18.3-6+deb11u4+fips_amd64.deb==2bdb2e358091302bb66f9208cf082807 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkrb5-3_1.18.3-6+deb11u4+fips_amd64.deb==ba2b9c93e084c442cb1495eef5979b05 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkrb5-dev_1.18.3-6+deb11u4+fips_amd64.deb==6ffd25f46089ad674fe20f074454297c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libkrb5support0_1.18.3-6+deb11u4+fips_amd64.deb==851abebe415c61f98bfc5024ef2e54fb -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libpython3.9-minimal_3.9.2-1+fips_amd64.deb==71b75222c8bcd5ede55693a9223a3246 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libpython3.9-stdlib_3.9.2-1+fips_amd64.deb==f4274260999ba26346dc60f95b1cf91c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libpython3.9_3.9.2-1+fips_amd64.deb==c405132eacaf059c7c903f853d48be7e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libssl-dev_1.1.1n-0+deb11u5+fips_amd64.deb==7deccb6cb0197bd9dc257d54505533cf -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/libssl1.1_1.1.1n-0+deb11u5+fips_amd64.deb==6a4505b82957d711e983e03364275521 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssh-client_8.4p1-5+deb11u2+fips_amd64.deb==1fb734b040398b0fb9c674385253b993 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssh-server_8.4p1-5+deb11u2+fips_amd64.deb==8ec9f1fbfedd6c36312c5181d9950b58 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssh-sftp-server_8.4p1-5+deb11u2+fips_amd64.deb==02e8be0633aff33497655261256eadca -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/openssl_1.1.1n-0+deb11u5+fips_amd64.deb==ee086d7e1fb0cfd36513ec242381af53 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/python3.9-minimal_3.9.2-1+fips_amd64.deb==ff2d0b457ef7872e0a9c6da65cd2f146 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/python3.9_3.9.2-1+fips_amd64.deb==30be224443931a2a3428aa270b87384a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/amd64/symcrypt-openssl_0.10_amd64.deb==01bc30a1bc6fc07be723258f7a6566b6 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15-go_1.15.15-1~deb11u4+fips_arm64.deb==b59f315800ca2ec31de79136dfb8979d -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15-src_1.15.15-1~deb11u4+fips_arm64.deb==0038c68ed1e3adb1b43434af81cff678 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/krb5-multidev_1.18.3-6+deb11u4+fips_arm64.deb==53130dd865aeedf3f99cc0deca4ae50a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libgssapi-krb5-2_1.18.3-6+deb11u4+fips_arm64.deb==49255677e3c149d29d059aa2af18747a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libgssrpc4_1.18.3-6+deb11u4+fips_arm64.deb==1f939eb23261667a9e920d1acb08969c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libk5crypto3_1.18.3-6+deb11u4+fips_arm64.deb==5b7eb6aa93b20949d7422ad25fe73549 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkadm5clnt-mit12_1.18.3-6+deb11u4+fips_arm64.deb==c5d5a81770b64a33d6d87f288fdb974c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkadm5srv-mit12_1.18.3-6+deb11u4+fips_arm64.deb==267114332521c5de4c88de464fc098de -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkrb5-3_1.18.3-6+deb11u4+fips_arm64.deb==ce88c2527f79baa4cd29c71580e57807 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkrb5-dev_1.18.3-6+deb11u4+fips_arm64.deb==6af1cfd53e8e55b5619365d4a462ee35 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libkrb5support0_1.18.3-6+deb11u4+fips_arm64.deb==86768f22a3d883d9d19a814e075a9a1b -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libpython3.9-minimal_3.9.2-1+fips_arm64.deb==870a96b0d9d7fe753d495ad6574e4c03 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libpython3.9-stdlib_3.9.2-1+fips_arm64.deb==f944ca0b75549d6f24d07deb1ea897d4 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libpython3.9_3.9.2-1+fips_arm64.deb==edae5c269e2c401873e7cff3d4f93a7a -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libssl-dev_1.1.1n-0+deb11u5+fips_arm64.deb==2116b0e949a521b02098f01aee5a33d4 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/libssl1.1_1.1.1n-0+deb11u5+fips_arm64.deb==a6a6a6f2d23d91398f44570da6e2e80c -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssh-client_8.4p1-5+deb11u2+fips_arm64.deb==b30c745ca94e392740c67225802e9068 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssh-server_8.4p1-5+deb11u2+fips_arm64.deb==8ab6d9e3bac9d486bda5664e40f634ef -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssh-sftp-server_8.4p1-5+deb11u2+fips_arm64.deb==73c51fa8f165a014571c2bdbd843c517 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/openssl_1.1.1n-0+deb11u5+fips_arm64.deb==5c16b501e97678e7f55c616afa6423bb -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==3ad5f86b07a3f5794ddee1dcd69c1d7e -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 -https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.10/arm64/symcrypt-openssl_0.10_arm64.deb==7b709cbe2ccbe62fa207b8cae0f88d46 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/golang-1.19-doc_1.19.8-2+fips_all.deb==8d04d49c27e4e66fdeed7f332d5fa1fb +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/golang-1.19-go_1.19.8-2+fips_amd64.deb==0dfdcc063eab209c229a210311d40fcd +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/golang-1.19-src_1.19.8-2+fips_all.deb==b30c2fbe20c2e9308ab07cbaec0733c4 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/golang-1.19_1.19.8-2+fips_all.deb==f9f022be39abe8dd4311ed7fc6444b23 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/krb5-multidev_1.20.1-2+deb12u1+fips_amd64.deb==89be2bb2c171185756935fca6d1e1bae +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libgssapi-krb5-2_1.20.1-2+deb12u1+fips_amd64.deb==2db580ce5d076a60661fc9b0d389592d +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libgssrpc4_1.20.1-2+deb12u1+fips_amd64.deb==23755dc4befcb6c104ef72eb1458dcbd +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libk5crypto3_1.20.1-2+deb12u1+fips_amd64.deb==8ee1850d5e215a1f97133a051d2e7e01 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libkadm5clnt-mit12_1.20.1-2+deb12u1+fips_amd64.deb==bf24d179a8ee26686e0c555b064b6357 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libkadm5srv-mit12_1.20.1-2+deb12u1+fips_amd64.deb==57bc0414beffb0949801cc5fab146cce +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libkrb5-3_1.20.1-2+deb12u1+fips_amd64.deb==e89320500326e18ac97654ca91cae326 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libkrb5-dev_1.20.1-2+deb12u1+fips_amd64.deb==7bf44b5d4f0dbdd91a14d80a82176c2c +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libkrb5support0_1.20.1-2+deb12u1+fips_amd64.deb==6cad2b8416f023cee7909ab1c6744d2c +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libpython3.11-minimal_3.11.2-6+fips_amd64.deb==909774035df21141f431696d3bbf5f45 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libpython3.11-stdlib_3.11.2-6+fips_amd64.deb==dfc53d8c5da74cc8227ec0ee8f480e97 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libpython3.11_3.11.2-6+fips_amd64.deb==f0a6b4cf3dcd9be3621b55e6f099afea +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libssl-dev_3.0.11-1~deb12u2+fips_amd64.deb==d734db125775314f7c68a1f055e199f8 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libssl-doc_3.0.11-1~deb12u2+fips_all.deb==8d8f1e277a3ca66f8c0c2ec6d78c91dc +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/libssl3_3.0.11-1~deb12u2+fips_amd64.deb==8de66ba66c98883f9ff16f61a01f51eb +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/openssh-client_9.2p1-2+deb12u2+fips_amd64.deb==fe2d301a5ba39447a48d3dcbbebf4159 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/openssh-server_9.2p1-2+deb12u2+fips_amd64.deb==cd95a06d60b481259ee2f5b554d4e019 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/openssh-sftp-server_9.2p1-2+deb12u2+fips_amd64.deb==277053c92320de72968220cd2130d784 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/openssl_3.0.11-1~deb12u2+fips_amd64.deb==f3dbff5ad9c169b20ab8a806f5fd1c19 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/python3.11-minimal_3.11.2-6+fips_amd64.deb==c67134ebefa1226540880151936d2efe +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/python3.11_3.11.2-6+fips_amd64.deb==03e9bd8c303e27a5d0c879bc49ea7b5e +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/ssh_9.2p1-2+deb12u2+fips_all.deb==8edc4ee2d712151ca237166087b37565 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/amd64/symcrypt-openssl_1.4.3-preview_amd64.deb==b16eaf86673e3b7efc1dc8b5c44c154f +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/golang-1.19-doc_1.19.8-2+fips_all.deb==8d04d49c27e4e66fdeed7f332d5fa1fb +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/golang-1.19-go_1.19.8-2+fips_arm64.deb==52a872e19f52398ce5eb11d7be896b23 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/golang-1.19-src_1.19.8-2+fips_all.deb==b30c2fbe20c2e9308ab07cbaec0733c4 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/golang-1.19_1.19.8-2+fips_all.deb==f9f022be39abe8dd4311ed7fc6444b23 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/krb5-multidev_1.20.1-2+deb12u1+fips_arm64.deb==8341ce97f8bd2f7f9d2432fd3cdc5947 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libgssapi-krb5-2_1.20.1-2+deb12u1+fips_arm64.deb==b33ceccd4a8db188195c58cd6d6e4c07 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libgssrpc4_1.20.1-2+deb12u1+fips_arm64.deb==2d2ba73fc2d923b448910b28a08271e1 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libk5crypto3_1.20.1-2+deb12u1+fips_arm64.deb==64be0c39eeca71710ede0506da03a8b9 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libkadm5clnt-mit12_1.20.1-2+deb12u1+fips_arm64.deb==d78e0160dcadd47b8e1d0bc71b85ba60 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libkadm5srv-mit12_1.20.1-2+deb12u1+fips_arm64.deb==e975f668a37b70b5affa10d80da9ffed +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libkrb5-3_1.20.1-2+deb12u1+fips_arm64.deb==4d95fc32169a32fdd3b9daf7fb4cb4e3 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libkrb5-dev_1.20.1-2+deb12u1+fips_arm64.deb==ace9bf091b269f6e511f672aa2a9981d +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libkrb5support0_1.20.1-2+deb12u1+fips_arm64.deb==3aa024e10ae78c3635b869a18336dcc4 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libpython3.11-minimal_3.11.2-6+fips_arm64.deb==2cea19de4dcf96a9a64d39978ed6e12f +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libpython3.11-stdlib_3.11.2-6+fips_arm64.deb==4119c3e03ccb6d495405de4d70f487a3 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libpython3.11_3.11.2-6+fips_arm64.deb==70c9319b6fe8aa424fe9de72b72808e5 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libssl-dev_3.0.11-1~deb12u2+fips_arm64.deb==9e92e45ec063264e97aefa7608d70484 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libssl-doc_3.0.11-1~deb12u2+fips_all.deb==8d8f1e277a3ca66f8c0c2ec6d78c91dc +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/libssl3_3.0.11-1~deb12u2+fips_arm64.deb==df22ed972e763554d025984fe62c3eec +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/openssh-client_9.2p1-2+deb12u2+fips_arm64.deb==d9321471e3259c44d11846463e740e66 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/openssh-server_9.2p1-2+deb12u2+fips_arm64.deb==10639408656db910f50748e92e53d59e +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/openssh-sftp-server_9.2p1-2+deb12u2+fips_arm64.deb==7418c3551510535292b5ec0f3c26f3a5 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/openssl_3.0.11-1~deb12u2+fips_arm64.deb==51d631c0d1c328bf22b57b4ae36ccf97 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/python3.11-minimal_3.11.2-6+fips_arm64.deb==2af762681ef81bb6fc4ad8aed438aa1c +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/python3.11_3.11.2-6+fips_arm64.deb==78386bb5b012dc8eb57781be41a0bd3e +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/ssh_9.2p1-2+deb12u2+fips_all.deb==8edc4ee2d712151ca237166087b37565 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/arm64/symcrypt-openssl_1.4.3-preview_arm64.deb==c737cb3251c3e59042e48b6687359aca +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/golang-1.19-doc_1.19.8-2+fips_all.deb==8d04d49c27e4e66fdeed7f332d5fa1fb +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/golang-1.19-go_1.19.8-2+fips_armhf.deb==f365e2ec1ec60abebee33eb9b3dcd380 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/golang-1.19-src_1.19.8-2+fips_all.deb==b30c2fbe20c2e9308ab07cbaec0733c4 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/golang-1.19_1.19.8-2+fips_all.deb==f9f022be39abe8dd4311ed7fc6444b23 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/krb5-multidev_1.20.1-2+deb12u1+fips_armhf.deb==b295653312b2abc93989aeb7dbb7f39d +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libgssapi-krb5-2_1.20.1-2+deb12u1+fips_armhf.deb==56bddcc75e0f5a1cff534f57afb55af8 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libgssrpc4_1.20.1-2+deb12u1+fips_armhf.deb==4863c8b91418c0f54b9a90a3d59323ff +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libk5crypto3_1.20.1-2+deb12u1+fips_armhf.deb==d9e70bcd1c510df543bb95ed4acf9e2a +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libkadm5clnt-mit12_1.20.1-2+deb12u1+fips_armhf.deb==16255322d48b422191e7c2819882db19 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libkadm5srv-mit12_1.20.1-2+deb12u1+fips_armhf.deb==65f3fd49882d9675e41089ff2783c9eb +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libkrb5-3_1.20.1-2+deb12u1+fips_armhf.deb==c8b14969303da2ae486b724a87b10ad9 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libkrb5-dev_1.20.1-2+deb12u1+fips_armhf.deb==f6a3a165388d1781152c2bc8dfdf71fd +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libkrb5support0_1.20.1-2+deb12u1+fips_armhf.deb==afadb629c44242b2d4b90f5c2f0fd2f1 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libpython3.11-minimal_3.11.2-6+fips_armhf.deb==a107f4d8fe43dfd63c71ff349fa2613b +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libpython3.11-stdlib_3.11.2-6+fips_armhf.deb==c4d9f764b0bfc283169e713d9de38a78 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libpython3.11_3.11.2-6+fips_armhf.deb==b10ed820e4cf9f89b33e61d798c082f6 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libssl-dev_3.0.11-1~deb12u2+fips_armhf.deb==76e7ec8db99b3d7ec9edb1f10c1929a4 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libssl-doc_3.0.11-1~deb12u2+fips_all.deb==8d8f1e277a3ca66f8c0c2ec6d78c91dc +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/libssl3_3.0.11-1~deb12u2+fips_armhf.deb==beeb04ed1d387a81f3117bc05d896d98 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/openssh-client_9.2p1-2+deb12u2+fips_armhf.deb==7ad8166f4835be8e6489fdbac5a310a6 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/openssh-server_9.2p1-2+deb12u2+fips_armhf.deb==eb2f8f7e9d8c47e065a6a877625f071a +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/openssh-sftp-server_9.2p1-2+deb12u2+fips_armhf.deb==2c70ed3d0423bf442a53f09e6404884b +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/openssl_3.0.11-1~deb12u2+fips_armhf.deb==ff644075bc7408984b1218e718951d02 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/python3.11-minimal_3.11.2-6+fips_armhf.deb==7aa42c9564c7be0776d1f7c532e5a15c +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/python3.11_3.11.2-6+fips_armhf.deb==d173b9f1e9f49f40b637e13ee9ba9b5a +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/ssh_9.2p1-2+deb12u2+fips_all.deb==8edc4ee2d712151ca237166087b37565 +https://sonicstorage.blob.core.windows.net/public/fips/bookworm/1.4.3-preview/armhf/symcrypt-openssl_1.4.3-preview_armhf.deb==ba82be158901a4165210587b335e4ca8 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/golang-1.15-go_1.15.15-1~deb11u4+fips_amd64.deb==145e103357a915cc759cc93de602b631 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/golang-1.15-src_1.15.15-1~deb11u4+fips_amd64.deb==1c1a46d5599be92777702643c37d5751 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/krb5-multidev_1.18.3-6+deb11u4+fips_amd64.deb==41c7aecaf738ceb8e0348b9420d0aa3f +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libgssapi-krb5-2_1.18.3-6+deb11u4+fips_amd64.deb==9ab263ae9192bf4c964ea3ad86012c9a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libgssrpc4_1.18.3-6+deb11u4+fips_amd64.deb==4913523ed341663cd9a8bd2ea0e5c64a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libk5crypto3_1.18.3-6+deb11u4+fips_amd64.deb==5c89f642c4265a2f53d8788f93b37aaf +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libkadm5clnt-mit12_1.18.3-6+deb11u4+fips_amd64.deb==19a7a6eeae8387d4114a6b76ff5fc7c8 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libkadm5srv-mit12_1.18.3-6+deb11u4+fips_amd64.deb==2bdb2e358091302bb66f9208cf082807 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libkrb5-3_1.18.3-6+deb11u4+fips_amd64.deb==ba2b9c93e084c442cb1495eef5979b05 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libkrb5-dev_1.18.3-6+deb11u4+fips_amd64.deb==6ffd25f46089ad674fe20f074454297c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libkrb5support0_1.18.3-6+deb11u4+fips_amd64.deb==851abebe415c61f98bfc5024ef2e54fb +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libpython3.9-minimal_3.9.2-1+fips_amd64.deb==411d2092cd614dd187bdc0ec0bb9598f +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libpython3.9-stdlib_3.9.2-1+fips_amd64.deb==050267fce1204d8accd8b551a30a66e6 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libpython3.9_3.9.2-1+fips_amd64.deb==c405132eacaf059c7c903f853d48be7e +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libssl-dev_1.1.1n-0+deb11u5+fips_amd64.deb==7deccb6cb0197bd9dc257d54505533cf +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/libssl1.1_1.1.1n-0+deb11u5+fips_amd64.deb==6a4505b82957d711e983e03364275521 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/openssh-client_8.4p1-5+deb11u2+fips_amd64.deb==1fb734b040398b0fb9c674385253b993 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/openssh-server_8.4p1-5+deb11u2+fips_amd64.deb==8ec9f1fbfedd6c36312c5181d9950b58 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/openssh-sftp-server_8.4p1-5+deb11u2+fips_amd64.deb==02e8be0633aff33497655261256eadca +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/openssl_1.1.1n-0+deb11u5+fips_amd64.deb==ee086d7e1fb0cfd36513ec242381af53 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/python3.9-minimal_3.9.2-1+fips_amd64.deb==b6a0f0d84c8bec43fe49b12092bf3209 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/python3.9_3.9.2-1+fips_amd64.deb==30be224443931a2a3428aa270b87384a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/ssh_8.4p1-5+deb11u2+fips_all.deb==d1f50482046b4b4e39fd2a0273f5ecef +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/amd64/symcrypt-openssl_0.12_amd64.deb==46411c8f45a1382af5d3ee8ef7f150aa +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/golang-1.15-doc_1.15.15-1~deb11u4+fips_all.deb==72ead09139135d4ecd91b76c89128567 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/golang-1.15-go_1.15.15-1~deb11u4+fips_arm64.deb==b59f315800ca2ec31de79136dfb8979d +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/golang-1.15-src_1.15.15-1~deb11u4+fips_arm64.deb==0038c68ed1e3adb1b43434af81cff678 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/golang-1.15_1.15.15-1~deb11u4+fips_all.deb==847bc1fc5ce9c8ebae5176947ab34d30 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/krb5-multidev_1.18.3-6+deb11u4+fips_arm64.deb==53130dd865aeedf3f99cc0deca4ae50a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libgssapi-krb5-2_1.18.3-6+deb11u4+fips_arm64.deb==49255677e3c149d29d059aa2af18747a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libgssrpc4_1.18.3-6+deb11u4+fips_arm64.deb==1f939eb23261667a9e920d1acb08969c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libk5crypto3_1.18.3-6+deb11u4+fips_arm64.deb==5b7eb6aa93b20949d7422ad25fe73549 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libkadm5clnt-mit12_1.18.3-6+deb11u4+fips_arm64.deb==c5d5a81770b64a33d6d87f288fdb974c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libkadm5srv-mit12_1.18.3-6+deb11u4+fips_arm64.deb==267114332521c5de4c88de464fc098de +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libkrb5-3_1.18.3-6+deb11u4+fips_arm64.deb==ce88c2527f79baa4cd29c71580e57807 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libkrb5-dev_1.18.3-6+deb11u4+fips_arm64.deb==6af1cfd53e8e55b5619365d4a462ee35 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libkrb5support0_1.18.3-6+deb11u4+fips_arm64.deb==86768f22a3d883d9d19a814e075a9a1b +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libpython3.9-minimal_3.9.2-1+fips_arm64.deb==7e6ac5f9bce1ecd59532ed669040436d +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libpython3.9-stdlib_3.9.2-1+fips_arm64.deb==60615729bf2eada00dab3245c986bb4a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libpython3.9_3.9.2-1+fips_arm64.deb==edae5c269e2c401873e7cff3d4f93a7a +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libssl-dev_1.1.1n-0+deb11u5+fips_arm64.deb==2116b0e949a521b02098f01aee5a33d4 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libssl-doc_1.1.1n-0+deb11u5+fips_all.deb==3ac7462c370d85e42c03b11d26f35016 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/libssl1.1_1.1.1n-0+deb11u5+fips_arm64.deb==a6a6a6f2d23d91398f44570da6e2e80c +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/openssh-client_8.4p1-5+deb11u2+fips_arm64.deb==b30c745ca94e392740c67225802e9068 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/openssh-server_8.4p1-5+deb11u2+fips_arm64.deb==8ab6d9e3bac9d486bda5664e40f634ef +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/openssh-sftp-server_8.4p1-5+deb11u2+fips_arm64.deb==73c51fa8f165a014571c2bdbd843c517 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/openssl_1.1.1n-0+deb11u5+fips_arm64.deb==5c16b501e97678e7f55c616afa6423bb +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/python3.9-minimal_3.9.2-1+fips_arm64.deb==846cdb2b1b7a5677699128021c4a40f3 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/python3.9_3.9.2-1+fips_arm64.deb==4d6307dabcd3060235d6188cfa0346b8 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/ssh_8.4p1-5+deb11u2+fips_all.deb==d1f50482046b4b4e39fd2a0273f5ecef +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/arm64/symcrypt-openssl_0.12_arm64.deb==d59b59b4d157feedeaa27a23b35007b4 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/armhf/golang-1.15-go_1.15.15-1~deb11u4+fips_armhf.deb==62c200bd7bf79df11cfdace12a351a73 +https://sonicstorage.blob.core.windows.net/public/fips/bullseye/0.12/armhf/golang-1.15-src_1.15.15-1~deb11u4+fips_armhf.deb==644145b4473d863edc1aaf98dfc92acf https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64-r0.iso==54e11e450a461b1f4ae39c3ce3f15eff https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64_4_asic-r0.iso==1d8b8d3fa37f842d0184b5205be22be9 https://sonicstorage.blob.core.windows.net/public/onie/onie-recovery-x86_64-kvm_x86_64_6_asic-r0.iso==58494305d4ac201daedf9364a1018a1b diff --git a/files/build/versions/dockers/docker-base-bookworm/versions-deb-bookworm b/files/build/versions/dockers/docker-base-bookworm/versions-deb-bookworm index 501094edff8a..023141a8fb42 100644 --- a/files/build/versions/dockers/docker-base-bookworm/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-base-bookworm/versions-deb-bookworm @@ -7,8 +7,6 @@ libatomic1==12.2.0-14 libbpf1==1:1.1.0-1 libbrotli1==1.0.9-2+b6 libbsd0==0.11.7-2 -libc-bin==2.36-9+deb12u7 -libc6==2.36-9+deb12u7 libcap2-bin==1:2.66-4 libcurl4==7.88.1-10+deb12u5 libdaemon0==0.14-7.1 @@ -23,7 +21,7 @@ libgssapi-krb5-2==1.20.1-2+deb12u1 libjansson4==2.14-2 libjemalloc2==5.3.0-1 libjq1==1.6-2.1 -libk5crypto3==1.20.1-2+deb12u1 +libk5crypto3==1.20.1-2+deb12u1+fips libkeyutils1==1.6.3-2 libkrb5-3==1.20.1-2+deb12u1 libkrb5support0==1.20.1-2+deb12u1 @@ -50,7 +48,8 @@ libsasl2-modules-db==2.1.28+dfsg-10 libsodium23==1.0.18-1 libsqlite3-0==3.40.1-2 libssh2-1==1.10.0-3+b1 -libssl3==3.0.11-1~deb12u2 +libssl-dev==3.0.11-1~deb12u2+fips +libssl3==3.0.11-1~deb12u2+fips libtirpc-common==1.3.3+ds-1 libtirpc3==1.3.3+ds-1 libwrap0==7.6.q-32 @@ -58,7 +57,7 @@ libxtables12==1.8.9-2 libzmq5==4.3.4-6 media-types==10.0.0 net-tools==2.10-0.1 -openssl==3.0.11-1~deb12u2 +openssl==3.0.11-1~deb12u2+fips perl==5.36.0-7+deb12u1 perl-modules-5.36==5.36.0-7+deb12u1 procps==2:4.0.2-3 @@ -76,5 +75,6 @@ readline-common==8.2-1.3 redis-tools==5:7.0.15-1~deb12u1 rsyslog==8.2302.0-1 socat==1.7.4.1-3 +symcrypt-openssl==0.1 vim-common==2:9.0.1378-2 vim-tiny==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye index 1a43c5332ff9..f27b2dcab27a 100644 --- a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye @@ -7,7 +7,6 @@ libatomic1==10.2.1-6 libbpf0==1:0.3-2 libbrotli1==1.0.9-2+b2 libbsd0==0.11.3-1+deb11u1 -libc6==2.31-13+deb11u10 libcap2==1:2.44-1 libcap2-bin==1:2.44-1 libcurl4==7.74.0-1.3+deb11u11 diff --git a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye-armhf b/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye-armhf deleted file mode 100644 index 3546f534b2c9..000000000000 --- a/files/build/versions/dockers/docker-base-bullseye/versions-deb-bullseye-armhf +++ /dev/null @@ -1 +0,0 @@ -openssl==1.1.1w-0+deb11u1 diff --git a/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 b/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 index d28ce7ea2b6c..22c19f5eb583 100644 --- a/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-bookworm/versions-py3 @@ -5,7 +5,7 @@ jsondiff==2.0.0 lxml==4.9.1 natsort==6.2.1 netaddr==0.8.0 -pyang==2.6.0 +pyang==2.6.1 pyangbind==0.8.2 pyyaml==6.0.1 redis==5.0.1 diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye index f833c3a67be2..e1c0445e1539 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-deb-bullseye @@ -24,7 +24,7 @@ libxslt1-dev==1.1.34-4+deb11u1 libxslt1.1==1.1.34-4+deb11u1 libyang==1.0.73 libyang-cpp==1.0.73 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-1 python3-swsscommon==1.0.0 python3-yang==1.0.73 sonic-db-cli==1.0.0 diff --git a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 index e3564c3c8ecf..4ee744daedb7 100644 --- a/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 +++ b/files/build/versions/dockers/docker-config-engine-bullseye/versions-py3 @@ -5,7 +5,7 @@ jsondiff==2.0.0 lxml==4.9.1 natsort==6.2.1 netaddr==0.8.0 -pyang==2.6.0 +pyang==2.6.1 pyangbind==0.8.1 pyyaml==6.0.1 redis==4.5.4 diff --git a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bookworm b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bookworm new file mode 100644 index 000000000000..0da31e794f37 --- /dev/null +++ b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bookworm @@ -0,0 +1,49 @@ +cron==3.0pl1-162 +cron-daemon-common==3.0pl1-162 +frr==8.5.4-sonic-0 +frr-dbgsym==8.5.4-sonic-0 +frr-snmp==8.5.4-sonic-0 +frr-snmp-dbgsym==8.5.4-sonic-0 +gdb==13.1-3 +gdbserver==13.1-3 +libbabeltrace1==1.5.11-1+b2 +libboost-regex1.74.0==1.74.0+ds1-21 +libc-ares2==1.18.1-3 +libcbor0.8==0.8.0-2+b1 +libcurl3-gnutls==7.88.1-10+deb12u5 +libdebuginfod-common==0.188-2.1 +libdebuginfod1==0.188-2.1 +libdw1==0.188-2.1 +libedit2==3.1-20221030-2 +libfido2-1==1.12.0-2+b1 +libglib2.0-0==2.74.6-2+deb12u2 +libgpm2==1.20.7-10+b1 +libicu72==72.1-3 +libipt2==2.0.5-1 +libjson-c5==0.16-2 +liblua5.1-0==5.1.5-9 +libmpfr6==4.2.0-1 +libpci3==1:3.9.0-4 +libpopt0==1.19+dfsg-1 +libsensors-config==1:3.6.0-7.1 +libsensors5==1:3.6.0-7.1 +libsnmp-base==5.9.3+dfsg-2 +libsnmp40==5.9.3+dfsg-2 +libsource-highlight-common==3.1.9-4.2 +libsource-highlight4v5==3.1.9-4.2+b3 +libswsscommon-dbgsym==1.0.0 +libunwind8==1.6.2-3 +libyang2==2.0.112-6 +libyang2-dbgsym==2.0.112-6 +logrotate==3.21.0-1 +lsof==4.95.0-1 +openssh-client==1:9.2p1-2+deb12u2 +pci.ids==0.0~2023.04.11-1 +sensible-utils==0.0.17+nmu1 +sonic-rsyslog-plugin==1.0.0-0 +sshpass==1.09-1+b1 +strace==6.1-0.1 +swss-dbg==1.0.0 +ucf==3.0043+nmu1 +vim==2:9.0.1378-2 +vim-runtime==2:9.0.1378-2 diff --git a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye b/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye deleted file mode 100644 index 551d1b7e5bd1..000000000000 --- a/files/build/versions/dockers/docker-fpm-frr/versions-deb-bullseye +++ /dev/null @@ -1,45 +0,0 @@ -cron==3.0pl1-137 -frr==8.5.4-sonic-0 -frr-dbgsym==8.5.4-sonic-0 -frr-snmp==8.5.4-sonic-0 -frr-snmp-dbgsym==8.5.4-sonic-0 -gdb==10.1-1.7 -gdbserver==10.1-1.7 -libbabeltrace1==1.5.8-1+b3 -libboost-regex1.74.0==1.74.0-9 -libc-ares2==1.17.1-1+deb11u3 -libcbor0==0.5.0+dfsg-2 -libcurl3-gnutls==7.74.0-1.3+deb11u11 -libdebuginfod1==0.183-1 -libdw1==0.183-1 -libedit2==3.1-20191231-2+b1 -libfido2-1==1.6.0-2 -libglib2.0-0==2.66.8-1+deb11u3 -libgpm2==1.20.7-8 -libicu67==67.1-7 -libipt2==2.0.3-1 -libjson-c5==0.15-2+deb11u1 -libmpfr6==4.1.0-3 -libpci3==1:3.7.0-5 -libpopt0==1.18-2 -libsensors-config==1:3.6.0-7 -libsensors5==1:3.6.0-7 -libsnmp-base==5.9+dfsg-4+deb11u1 -libsnmp40==5.9+dfsg-4+deb11u1 -libsource-highlight-common==3.1.9-3 -libsource-highlight4v5==3.1.9-3+b1 -libswsscommon-dbgsym==1.0.0 -libunwind8==1.3.2-2 -libyang2==2.0.112-6 -libyang2-dbgsym==2.0.112-6 -logrotate==3.18.0-2+deb11u2 -lsof==4.93.2+dfsg-1.1 -openssh-client==1:8.4p1-5+deb11u3 -pci.ids==0.0~2021.02.08-1 -sensible-utils==0.0.14 -sonic-rsyslog-plugin==1.0.0-0 -sshpass==1.09-1+b1 -strace==5.10-1 -swss-dbg==1.0.0 -vim==2:8.2.2434-3+deb11u1 -vim-runtime==2:8.2.2434-3+deb11u1 diff --git a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye index 99169d93b946..5c4d5df38329 100644 --- a/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-gbsyncd-broncos/versions-deb-bullseye @@ -28,7 +28,7 @@ libsource-highlight4v5==3.1.9-3+b1 libswsscommon-dbgsym==1.0.0 libtirpc-dev==1.3.1-1+deb11u1 libunwind8==1.3.2-2 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-1 openssh-client==1:8.4p1-5+deb11u3 sshpass==1.09-1+b1 strace==5.10-1 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm index 066fa012d545..293dabbf967b 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-bookworm @@ -67,6 +67,7 @@ libxml2==2.9.14+dfsg-1.3~deb12u1 libxrender1==1:0.9.10-1.1 lm-sensors==1:3.6.0-7.1 lm-sensors-dbgsym==1:3.6.0-7.1 +mft==4.26.1-3 nvme-cli==2.4+really2.3-3 openssh-client==1:9.2p1-2+deb12u2 pci.ids==0.0~2023.04.11-1 diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-py3 b/files/build/versions/dockers/docker-platform-monitor/versions-py3 index 40dd5328cd5c..62d7ff68a570 100644 --- a/files/build/versions/dockers/docker-platform-monitor/versions-py3 +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py3 @@ -1,5 +1,5 @@ attrs==22.2.0 -certifi==2024.2.2 +certifi==2024.6.2 charset-normalizer==3.3.2 grpcio==1.51.1 grpcio-tools==1.51.1 @@ -12,6 +12,6 @@ protobuf==4.25.3 psutil==5.9.8 pyrsistent==0.18.1 python-sdk-api==4.6.3064 -requests==2.31.0 +requests==2.32.3 thrift==0.13.0 urllib3==2.2.1 diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-buster b/files/build/versions/dockers/docker-ptf/versions-deb-buster index dd4ff86f9104..529178c9cb97 100644 --- a/files/build/versions/dockers/docker-ptf/versions-deb-buster +++ b/files/build/versions/dockers/docker-ptf/versions-deb-buster @@ -63,7 +63,7 @@ gpgconf==2.2.12-1+deb10u2 gpgsm==2.2.12-1+deb10u2 graphviz==2.40.1-6+deb10u1 gsettings-desktop-schemas==3.28.1-1 -gstreamer1.0-plugins-base==1.14.4-2+deb10u2 +gstreamer1.0-plugins-base==1.14.4-2+deb10u3 gtk-update-icon-cache==3.24.5-1 hicolor-icon-theme==0.17-2 hping3==3.a2.ds2-7 @@ -71,7 +71,7 @@ ipython3==5.8.0-1+deb10u1 iso-codes==4.2-1 javascript-common==11 krb5-locales==1.17-3+deb10u6 -less==487-0.1+b1 +less==487-0.1+deb10u1 libalgorithm-diff-perl==1.19.03-2 libalgorithm-diff-xs-perl==0.04-5+b1 libalgorithm-merge-perl==0.08-3 @@ -187,7 +187,7 @@ libgraphite2-3==1.3.13-7 libgs9==9.27~dfsg-2+deb10u9 libgs9-common==9.27~dfsg-2+deb10u9 libgssapi-krb5-2==1.17-3+deb10u6 -libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u2 +libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u3 libgstreamer1.0-0==1.14.4-1 libgtk-3-0==3.24.5-1 libgtk-3-bin==3.24.5-1 diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 index 2179078d0ed6..fd8654bb5b14 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -1,5 +1,5 @@ -certifi==2024.2.2 +certifi==2024.6.2 charset-normalizer==3.3.2 idna==3.7 -requests==2.31.0 +requests==2.32.3 urllib3==2.2.1 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye index 27ec4b678e17..c8b815af33ab 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-bullseye @@ -104,7 +104,7 @@ libxml2==2.9.10+dfsg-6.7+deb11u4 libxml2-dev==2.9.10+dfsg-6.7+deb11u4 libyang2==2.0.112-6 libzmq3-dev==4.3.4-1+deb11u1 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-1 logrotate==3.18.0-2+deb11u2 lsof==4.93.2+dfsg-1.1 mailcap==3.69 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index d0d352f18c01..72e3c60d5bee 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -1,15 +1,15 @@ async-timeout==4.0.2 bcrypt==3.2.2 blessed==1.20.0 -certifi==2024.2.2 +certifi==2024.6.2 cffi==1.16.0 charset-normalizer==3.3.2 click==7.0 click-log==0.4.0 colorful==0.5.6 -cryptography==42.0.7 +cryptography==42.0.8 dbus-python==1.3.2 -docker==7.0.0 +docker==7.1.0 docker-image-py==0.1.12 enlighten==1.12.4 filelock==3.14.0 @@ -34,7 +34,7 @@ pygobject==3.48.2 pynacl==1.5.0 pyroute2==0.5.14 redis==4.5.2 -requests==2.31.0 +requests==2.32.3 scapy==2.4.4 semantic-version==2.10.0 systemd-python==235 diff --git a/files/build/versions/dockers/docker-swss-layer-bullseye/versions-deb-bullseye b/files/build/versions/dockers/docker-swss-layer-bullseye/versions-deb-bullseye index 214df182b81c..d917398cb693 100644 --- a/files/build/versions/dockers/docker-swss-layer-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-swss-layer-bullseye/versions-deb-bullseye @@ -1,4 +1,5 @@ iputils-ping==3:20210202-1 +libasan6==10.2.1-6 libdashapi==1.0.0 libprotobuf-lite32==3.21.12-3 libprotobuf32==3.21.12-3 diff --git a/files/build/versions/dockers/docker-syncd-bluefield/versions-deb-bookworm b/files/build/versions/dockers/docker-syncd-bluefield/versions-deb-bookworm new file mode 100644 index 000000000000..15f6df1d437d --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-bluefield/versions-deb-bookworm @@ -0,0 +1,53 @@ +binutils==2.40-2 +binutils-aarch64-linux-gnu==2.40-2 +binutils-dev==2.40-2 +doca-cx-libs==2.7.0034-1 +ethtool==1:6.1-1 +hwdata==0.368-1 +ibverbs-providers==2307mlnx47-1.2310036 +kmod==30+20221128-1 +libatm1==1:2.5.1-4+b2 +libbinutils==2.40-2 +libctf-nobfd0==2.40-2 +libctf0==2.40-2 +libexpat1-dev==2.5.0-1 +libgprofng0==2.40-2 +libgrpc-dev==1.39.0-1 +libibverbs-dev==2307mlnx47-1.2310036 +libibverbs1==2307mlnx47-1.2310036 +libjs-sphinxdoc==5.3.0-4 +libjs-underscore==1.13.4~dfsg+~1.11.4-3 +libjson-c5==0.16-2 +libkmod2==30+20221128-1 +libnl-3-200==3.7.0-0.2+b1 +libnl-3-dev==3.7.0-0.2+b1 +libnl-cli-3-200==3.7.0-0.2+b1 +libnl-genl-3-200==3.7.0-0.2+b1 +libnl-nf-3-200==3.7.0-0.2+b1 +libnl-route-3-200==3.7.0-0.2+b1 +libnl-route-3-dev==3.7.0-0.2+b1 +libnuma1==2.0.16-1 +libpcap0.8==1.10.3-1 +libpci3==1:3.9.0-4 +libpython3-dev==3.11.2-1+b1 +libpython3.11-dev==3.11.2-6 +librxpcompiler-dev==22.05.1 +libsaimetadata==1.0.0 +libsairedis==1.0.0 +lsof==4.95.0-1 +mft==4.26.1-3 +mlnx-dpdk==22.11.0-2404.0.2 +mlnx-iproute2==6.4.0-1.2310036 +mlnx-ofed-kernel-utils==23.10.OFED.23.10.0.3.6.1-1 +mlnx-sai==1.mlnx.SAIBuild0.0.30.0 +mlnx-tools==23.10.0-1.2310036 +pci.ids==0.0~2023.04.11-1 +pciutils==1:3.9.0-4 +python3-dev==3.11.2-1+b1 +python3-pip==23.0.1+dfsg-1 +python3.11-dev==3.11.2-6 +rxp-compiler==22.05.1 +sdn-appliance==1.5-1mlnx1 +syncd==1.0.0 +udev==252.22-1~deb12u1 +usb.ids==2024.01.20-0+deb12u1 diff --git a/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye index ccec9b25c822..200b0c679d5e 100644 --- a/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm-dnx-rpc/versions-deb-bullseye @@ -57,7 +57,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 diff --git a/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye index ccec9b25c822..200b0c679d5e 100644 --- a/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-bullseye @@ -57,7 +57,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 diff --git a/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye index ccec9b25c822..200b0c679d5e 100644 --- a/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye +++ b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-bullseye @@ -57,7 +57,7 @@ libtsan0==10.2.1-6 libubsan1==10.2.1-6 libuv1==1.40.0-2+deb11u1 libxml2==2.9.10+dfsg-6.7+deb11u4 -linux-libc-dev==5.10.216-1 +linux-libc-dev==5.10.218-1 mailcap==3.69 make==4.3-4.1 mime-support==3.66 diff --git a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bookworm b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bookworm index c6b09dbd0b75..f0be6ba0d45c 100644 --- a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bookworm +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-bookworm @@ -36,7 +36,7 @@ libtirpc-dev==1.3.3+ds-1 libunwind8==1.6.2-3 libxml2==2.9.14+dfsg-1.3~deb12u1 linux-libc-dev==6.1.90-1 -mft==4.27.0-83 +mft==4.28.0-96 mft-fwtrace-cfg==1.0.0 mlnx-sai==1.mlnx.SAIBuild2311.27.0.16 openssh-client==1:9.2p1-2+deb12u2 diff --git a/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm b/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm index 7b30e7e95527..dabe98c5ae2f 100644 --- a/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm +++ b/files/build/versions/dockers/sonic-slave-bookworm/versions-deb-bookworm @@ -191,8 +191,8 @@ gobject-introspection==1.74.0-3 golang==2:1.19~1 golang-1.19==1.19.8-2 golang-1.19-doc==1.19.8-2 -golang-1.19-go==1.19.8-2 -golang-1.19-src==1.19.8-2 +golang-1.19-go==1.19.8-2+fips +golang-1.19-src==1.19.8-2+fips golang-doc==2:1.19~1 golang-go==2:1.19~1 golang-src==2:1.19~1 @@ -213,9 +213,9 @@ grub2-common==2.06-13+deb12u1 gsettings-desktop-schemas==43.0-1 gsfonts==2:20200910-7 gstreamer1.0-libav==1.22.0-2 -gstreamer1.0-plugins-base==1.22.0-3+deb12u1 +gstreamer1.0-plugins-base==1.22.0-3+deb12u2 gstreamer1.0-plugins-good==1.22.0-5+deb12u1 -gstreamer1.0-x==1.22.0-3+deb12u1 +gstreamer1.0-x==1.22.0-3+deb12u2 gtk-update-icon-cache==3.24.38-2~deb12u1 guile-3.0-libs==3.0.8-2 hicolor-icon-theme==0.17-2 @@ -451,11 +451,9 @@ libbsh-java==2.0b4-20 libbz2-dev==1.0.8-5+b1 libc-ares-dev==1.18.1-3 libc-ares2==1.18.1-3 -libc-bin==2.36-9+deb12u7 libc-dev-bin==2.36-9+deb12u7 libc-devtools==2.36-9+deb12u7 libc-l10n==2.36-9+deb12u7 -libc6==2.36-9+deb12u7 libc6-armhf-cross==2.36-8cross1 libc6-dbg==2.36-9+deb12u7 libc6-dev==2.36-9+deb12u7 @@ -711,6 +709,8 @@ libgdk-pixbuf2.0-common==2.42.10+dfsg-1 libgeronimo-annotation-1.3-spec-java==1.3-1 libgeronimo-interceptor-3.0-spec-java==1.0.1-4 libgetopt-long-descriptive-perl==0.111-1 +libgettextpo-dev==0.21-12 +libgettextpo0==0.21-12 libgfapi0==10.3-5 libgfortran-12-dev==12.2.0-14 libgfortran5==12.2.0-14 @@ -770,7 +770,7 @@ libgspell-1-2==1.12.0-1+b2 libgspell-1-common==1.12.0-1 libgssapi-krb5-2==1.20.1-2+deb12u1 libgssrpc4==1.20.1-2+deb12u1 -libgstreamer-plugins-base1.0-0==1.22.0-3+deb12u1 +libgstreamer-plugins-base1.0-0==1.22.0-3+deb12u2 libgstreamer1.0-0==1.22.0-2 libgtest-dev==1.12.1-0.2 libgtk-3-0==3.24.38-2~deb12u1 @@ -1315,6 +1315,7 @@ libspice-server1==0.15.1-1 libspreadsheet-parseexcel-perl==0.6500-4~deb12u1 libspreadsheet-writeexcel-perl==2.40-4 libsqlite3-0==3.40.1-2 +libsqlite3-dev==3.40.1-2 libsratom-0-0==0.6.14-1 libsrt1.5-gnutls==1.5.1-1 libssh-4==0.10.6-0+deb12u1 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye index 7e60275d0189..055af05f9698 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -205,9 +205,9 @@ gsasl-common==1.10.0-4+deb11u1 gsettings-desktop-schemas==3.38.0-2 gsfonts==1:8.11+urwcyr1.0.7~pre44-4.5 gstreamer1.0-libav==1.18.4-3 -gstreamer1.0-plugins-base==1.18.4-2+deb11u1 +gstreamer1.0-plugins-base==1.18.4-2+deb11u2 gstreamer1.0-plugins-good==1.18.4-2+deb11u2 -gstreamer1.0-x==1.18.4-2+deb11u1 +gstreamer1.0-x==1.18.4-2+deb11u2 gtk-update-icon-cache==3.24.24-4+deb11u3 guile-2.2-libs==2.2.7+1-6 guile-3.0-libs==3.0.5-4 @@ -438,7 +438,6 @@ libc-ares2==1.17.1-1+deb11u3 libc-dev-bin==2.31-13+deb11u10 libc-devtools==2.31-13+deb11u10 libc-l10n==2.31-13+deb11u10 -libc6==2.31-13+deb11u10 libc6-armhf-cross==2.31-9cross4 libc6-dbg==2.31-13+deb11u10 libc6-dev==2.31-13+deb11u10 @@ -719,7 +718,7 @@ libgs9-common==9.53.3~dfsg-7+deb11u7 libgsasl7==1.10.0-4+deb11u1 libgsm1==1.0.18-2 libgssrpc4==1.18.3-6+deb11u4 -libgstreamer-plugins-base1.0-0==1.18.4-2+deb11u1 +libgstreamer-plugins-base1.0-0==1.18.4-2+deb11u2 libgstreamer1.0-0==1.18.4-2.1 libgtest-dev==1.10.0.20201025-1.1 libgtk-3-0==3.24.24-4+deb11u3 @@ -1491,14 +1490,14 @@ libzvbi0==0.2.35-18 libzzip-0-13==0.13.62-3.3+deb11u1 licensecheck==3.1.1-2 lintian==2.104.0 -linux-compiler-gcc-10-x86==5.10.216-1 -linux-headers-5.10.0-29-amd64==5.10.216-1 -linux-headers-5.10.0-29-arm64==5.10.216-1 -linux-headers-5.10.0-29-common==5.10.216-1 -linux-headers-amd64==5.10.216-1 -linux-headers-arm64==5.10.216-1 -linux-kbuild-5.10==5.10.216-1 -linux-libc-dev==5.10.216-1 +linux-compiler-gcc-10-x86==5.10.218-1 +linux-headers-5.10.0-30-amd64==5.10.218-1 +linux-headers-5.10.0-30-arm64==5.10.218-1 +linux-headers-5.10.0-30-common==5.10.218-1 +linux-headers-amd64==5.10.218-1 +linux-headers-arm64==5.10.218-1 +linux-kbuild-5.10==5.10.218-1 +linux-libc-dev==5.10.218-1 linuxdoc-tools==0.9.82-1 llvm==1:11.0-51+nmu5 llvm-11==1:11.0.1-2 diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf index 27aa80758120..bd29040d6542 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye-armhf @@ -1,11 +1,9 @@ dctrl-tools==2.24-3 dvipng==1.15-1.1 -golang-1.15-go==1.15.15-1~deb11u4 -golang-1.15-src==1.15.15-1~deb11u4 libjpeg-dev==1:2.0.6-4 libjpeg62-turbo-dev==1:2.0.6-4 libunicode-linebreak-perl==0.0.20190101-1+b2 -linux-compiler-gcc-10-arm==5.10.216-1 -linux-headers-5.10.0-29-armmp==5.10.216-1 -linux-headers-armmp==5.10.216-1 +linux-compiler-gcc-10-arm==5.10.218-1 +linux-headers-5.10.0-30-armmp==5.10.218-1 +linux-headers-armmp==5.10.218-1 nasm==2.15.05-1 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index cb3a5da28159..c51600950891 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -180,10 +180,10 @@ groff-base==1.22.4-3+deb10u1 gsettings-desktop-schemas==3.28.1-1 gsfonts==1:8.11+urwcyr1.0.7~pre44-4.4 gstreamer1.0-libav==1.15.0.1+git20180723+db823502-2+deb10u1 -gstreamer1.0-plugins-base==1.14.4-2+deb10u2 +gstreamer1.0-plugins-base==1.14.4-2+deb10u3 gstreamer1.0-plugins-good==1.14.4-1+deb10u3 gstreamer1.0-plugins-ugly==1.14.4-1+deb10u2 -gstreamer1.0-x==1.14.4-2+deb10u2 +gstreamer1.0-x==1.14.4-2+deb10u3 gtk-update-icon-cache==3.24.5-1 guile-2.0-libs==2.0.13+1-5.1 hicolor-icon-theme==0.17-2 @@ -211,7 +211,7 @@ kmod==26-1 krb5-locales==1.17-3+deb10u6 krb5-multidev==1.17-3+deb10u6 lcov==1.13-4 -less==487-0.1+b1 +less==487-0.1+deb10u1 lib32asan5==8.3.0-6 lib32atomic1==8.3.0-6 lib32gcc-8-dev==8.3.0-6 @@ -293,7 +293,7 @@ libbinutils==2.31.1-16 libbison-dev==2:3.3.2.dfsg-1 libbit-vector-perl==7.4-1+b5 libblkid-dev==2.33.1-0.1+deb10u1 -libbluetooth3==5.50-1.2~deb10u4 +libbluetooth3==5.50-1.2~deb10u5 libbluray2==1:1.1.0-1+deb10u1 libboost-atomic1.71-dev==1.71.0-6~bpo10+1 libboost-atomic1.71.0==1.71.0-6~bpo10+1 @@ -344,7 +344,6 @@ libc-ares-dev==1.14.0-1+deb10u4 libc-ares2==1.14.0-1+deb10u4 libc-dev-bin==2.28-10+deb10u3 libc-l10n==2.28-10+deb10u3 -libc6==2.28-10+deb10u3 libc6-dbg==2.28-10+deb10u3 libc6-dev==2.28-10+deb10u3 libc6-dev-i386==2.28-10+deb10u3 @@ -601,7 +600,7 @@ libgs9-common==9.27~dfsg-2+deb10u9 libgsm1==1.0.18-2 libgssapi-krb5-2==1.17-3+deb10u6 libgssrpc4==1.17-3+deb10u6 -libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u2 +libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u3 libgstreamer1.0-0==1.14.4-1 libgtest-dev==1.8.1-3 libgtk-3-0==3.24.5-1 diff --git a/files/build/versions/host-image/versions-deb-bookworm b/files/build/versions/host-image/versions-deb-bookworm index d5af0316f8da..b3d1df0f77df 100644 --- a/files/build/versions/host-image/versions-deb-bookworm +++ b/files/build/versions/host-image/versions-deb-bookworm @@ -7,10 +7,12 @@ auditd==1:3.0.9-1 bash==5.1-2 bash-completion==1:2.11-6 bash-tacplus==1.0.0 +bfscripts==4.6.0-13035 binutils==2.40-2 binutils-aarch64-linux-gnu==2.40-2 binutils-common==2.40-2 binutils-x86-64-linux-gnu==2.40-2 +bluefield-platform-modules==1.0 bridge-utils==1.7.1-1 bsdextrautils==2.38.1-5+deb12u1 bsdmainutils==12.1.8 @@ -80,7 +82,8 @@ isc-dhcp-client==4.4.3-P1-2 j2cli==0.3.12b-4 jq==1.6-2.1 kdump-tools==1:1.8.1 -kernel-mft-dkms-modules-6.1.0-11-2-amd64==4.27.0 +kernel-mft-dkms-modules-6.1.0-11-2-amd64==4.28.0 +kernel-mft-dkms-modules-6.1.0-11-2-arm64==4.26.1 kexec-tools==1:2.0.25-3+b1 klibc-utils==2.0.12-1 kmod==30+20221128-1 @@ -91,6 +94,7 @@ libapparmor1==3.0.8-3 libargon2-1==0~20171227-0.3+deb12u1 libasan8==12.2.0-14 libassuan0==2.5.5-5 +libatm1==1:2.5.1-4+b2 libatomic1==12.2.0-14 libauparse0==1:3.0.9-1 libbabeltrace1==1.5.11-1+b2 @@ -161,7 +165,7 @@ libjansson4==2.14-2 libjq1==1.6-2.1 libjs-jquery==3.6.1+dfsg+~3.5.14-1 libjson-c5==0.16-2 -libk5crypto3==1.20.1-2+deb12u1 +libk5crypto3==1.20.1-2+deb12u1+fips libkeyutils1==1.6.3-2 libklibc==2.0.12-1 libkmod2==30+20221128-1 @@ -234,8 +238,8 @@ libsmartcols1==2.38.1-5+deb12u1 libsodium23==1.0.18-1 libsqlite3-0==3.40.1-2 libssh2-1==1.10.0-3+b1 -libssl-dev==3.0.11-1~deb12u2 -libssl3==3.0.11-1~deb12u2 +libssl-dev==3.0.11-1~deb12u2+fips +libssl3==3.0.11-1~deb12u2+fips libswsscommon==1.0.0 libsysfs2==2.1.1-4 libsystemd-shared==252.22-1~deb12u1 @@ -284,10 +288,16 @@ lsof==4.95.0-1 makedev==2.3.1-97 makedumpfile==1:1.7.2-1 media-types==10.0.0 -mft==4.27.0-83 +mft==4.28.0-96 mft-fwtrace-cfg==1.0.0 -mft-oem==4.27.0-83 +mft-oem==4.28.0-96 minicom==2.8-2 +mlnx-iproute2==6.4.0-1.2310036 +mlnx-ofed-kernel-modules-6.1.0-11-2-arm64==23.10.OFED.23.10.0.3.6.1 +mlnx-ofed-kernel-utils==23.10.OFED.23.10.0.3.6.1-1 +mlnx-tools==23.10.0-1.2310036 +mlxbf-bootctl==2.1 +mlxbf-bootimages==4.6.0-13035 mokutil==0.6.0-2 monit==1:5.20.0-6 mount==2.38.1-5+deb12u1 @@ -307,10 +317,10 @@ ntpsec-ntpdig==1.2.2+dfsg1-1+deb12u1 ntpstat==0.0.0.1-2+b1 nvme-cli==2.4+really2.3-3 opennsl-modules==7.1.0.0 -openssh-client==1:9.2p1-2+deb12u1 -openssh-server==1:9.2p1-2+deb12u1 -openssh-sftp-server==1:9.2p1-2+deb12u1 -openssl==3.0.11-1~deb12u2 +openssh-client==1:9.2p1-2+deb12u2+fips +openssh-server==1:9.2p1-2+deb12u2+fips +openssh-sftp-server==1:9.2p1-2+deb12u2+fips +openssl==3.0.11-1~deb12u2+fips pci.ids==0.0~2023.04.11-1 pciutils==1:3.9.0-4 perl==5.36.0-7+deb12u1 @@ -347,7 +357,7 @@ python3-yaml==6.0-3+b2 python3-yang==1.0.73 python3.11==3.11.2-6 python3.11-minimal==3.11.2-6 -rasdaemon==0.6.8-1.1 +rasdaemon==0.6.8-1 readline-common==8.2-1.3 resolvconf==1.91+nmu1 rpcsvc-proto==1.4.3-1 @@ -369,6 +379,7 @@ sqlite3==3.40.1-2 squashfs-tools==1:4.5.1-1 sudo==1.9.13p3-1+deb12u1 sx-kernel==1.mlnx.4.6.3064 +symcrypt-openssl==0.1 sysfsutils==2.1.1-4 sysstat==12.6.1-1 systemd==252.22-1~deb12u1 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index eae03d6c4970..34011efb42e6 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -4,7 +4,7 @@ azure-storage==0.36.0 bcrypt==3.2.2 bitarray==2.8.1 blessed==1.20.0 -certifi==2024.2.2 +certifi==2024.6.2 cffi==1.15.1 charset-normalizer==3.3.2 click==7.0 @@ -12,7 +12,7 @@ click-log==0.4.0 colorful==0.5.6 cryptography==38.0.4 dbus-python==1.3.2 -docker==6.1.1 +docker==7.1.0 docker-image-py==0.1.12 enlighten==1.12.4 filelock==3.14.0 @@ -36,7 +36,6 @@ natsort==6.2.1 netaddr==0.8.0 netifaces==0.11.0 ntpsec==1.2.2 -packaging==24.0 paramiko==2.11.0 pathtools==0.1.2 perf==0.1 @@ -48,7 +47,7 @@ prettyprinter==0.18.0 protobuf==4.25.3 psutil==5.9.8 ptyprocess==0.7.0 -pyang==2.6.0 +pyang==2.6.1 pyangbind==0.8.2 pycairo==1.26.0 pycparser==2.21 @@ -61,7 +60,7 @@ python-dateutil==2.9.0.post0 pyyaml==6.0.1 redis==3.5.3 regex==2024.5.15 -requests==2.31.0 +requests==2.32.3 scapy==2.4.4 semantic-version==2.10.0 setuptools==66.1.1 @@ -72,7 +71,6 @@ toposort==1.6 urllib3==2.2.1 watchdog==0.10.3 wcwidth==0.2.13 -websocket-client==1.8.0 wheel==0.38.4 www-authenticate==0.9.2 xmltodict==0.12.0 From bd7733774bdca3d553d4feecb7f960b6059072c9 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:05:18 +1000 Subject: [PATCH 237/282] [minigraph] Added support to parse "AssociatedSliceStr" attribute of minigraph (#19160) What I did: Added support to parse "AssociatedSliceStr" attribute of minigraph and save as slice_type as part of DEVICE_METADATA for Chassis Device Type. Yang model are done as part of : #19094 Also as part of this change fixed issue of current device not selected correctly as asic_hostname not being correct. Why I did: In BGP Templates we need to take different action based on this attribute. Signed-off-by: Abhishek Dosi --- src/sonic-config-engine/minigraph.py | 22 +++++++++++---- .../voq_chassis_lc_single_asic.xml | 28 +++++++++---------- .../tests/test_chassis_cfggen.py | 5 ++-- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 390410067feb..0d5d4424c208 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -470,6 +470,7 @@ def parse_device(device): deployment_id = None cluster = None d_subtype = None + slice_type = None for node in device: if node.tag == str(QName(ns, "Address")): @@ -492,11 +493,13 @@ def parse_device(device): cluster = node.text elif node.tag == str(QName(ns, "SubType")): d_subtype = node.text + elif node.tag == str(QName(ns, "AssociatedSliceStr")) and node.text and "AZNG_Production" in node.text: + slice_type = "AZNG_Production" if d_type is None and str(QName(ns3, "type")) in device.attrib: d_type = device.attrib[str(QName(ns3, "type"))] - return (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, name, hwsku, d_type, deployment_id, cluster, d_subtype) + return (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, name, hwsku, d_type, deployment_id, cluster, d_subtype, slice_type) def calculate_lcm_for_ecmp (nhdevices_bank_map, nhip_bank_map): @@ -634,7 +637,8 @@ def parse_png(png, hname, dpg_ecmp_content = None): if child.tag == str(QName(ns, "Devices")): for device in child.findall(str(QName(ns, "Device"))): - (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, name, hwsku, d_type, deployment_id, cluster, d_subtype) = parse_device(device) + (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, name, hwsku, d_type, deployment_id, cluster, d_subtype, slice_type) = \ + parse_device(device) device_data = {} if hwsku != None: device_data['hwsku'] = hwsku @@ -654,6 +658,8 @@ def parse_png(png, hname, dpg_ecmp_content = None): device_data['type'] = d_type if d_subtype != None: device_data['subtype'] = d_subtype + if slice_type != None: + device_data['slice_type'] = slice_type devices[name] = device_data if child.tag == str(QName(ns, "DeviceInterfaceLinks")): @@ -775,7 +781,7 @@ def parse_asic_png(png, asic_name, hostname): if child.tag == str(QName(ns, "Devices")): for device in child.findall(str(QName(ns, "Device"))): - (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, name, hwsku, d_type, deployment_id, cluster, _) = parse_device(device) + (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, name, hwsku, d_type, deployment_id, cluster, _, slice_type) = parse_device(device) device_data = {} if hwsku != None: device_data['hwsku'] = hwsku @@ -793,6 +799,8 @@ def parse_asic_png(png, asic_name, hostname): device_data['mgmt_addr_v6'] = mgmt_prefix_v6 if d_type != None: device_data['type'] = d_type + if slice_type != None: + device_data['slice_type'] = slice_type devices[name] = device_data return (neighbors, devices, port_speeds) @@ -2101,7 +2109,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw current_device = [devices[key] for key in devices if key.lower() == hostname.lower()][0] else: try: - current_device = [devices[key] for key in devices if key.lower() == asic_name.lower()][0] + current_device = [devices[key] for key in devices if key.lower() == asic_hostname.lower()][0] except: current_device = {} @@ -2137,6 +2145,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if cluster: results['DEVICE_METADATA']['localhost']['cluster'] = cluster + # Update Slice Type for T2/Chassis Role + if current_device and 'slice_type' in current_device and current_device['slice_type'] and chassis_hostname: + results['DEVICE_METADATA']['localhost']['slice_type'] = current_device['slice_type'] + if kube_data: results['KUBERNETES_MASTER'] = { 'SERVER': { @@ -2809,7 +2821,7 @@ def get_mux_cable_entries(ports, mux_cable_ports, active_active_ports, neighbors def parse_device_desc_xml(filename): root = ET.parse(filename).getroot() - (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, hostname, hwsku, d_type, _, _, _) = parse_device(root) + (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, hostname, hwsku, d_type, _, _, _, _) = parse_device(root) results = {} results['DEVICE_METADATA'] = {'localhost': { diff --git a/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_single_asic.xml b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_single_asic.xml index 1e80a5bcbd58..bb237ecbd79d 100644 --- a/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_single_asic.xml +++ b/src/sonic-config-engine/tests/chassis_data/voq_chassis_data/voq_chassis_lc_single_asic.xml @@ -45188,7 +45188,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -45215,7 +45215,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -45242,7 +45242,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -45269,7 +45269,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -45296,7 +45296,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -45323,7 +45323,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -45350,7 +45350,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -45377,7 +45377,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -45404,7 +45404,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -45431,7 +45431,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -45458,7 +45458,7 @@ ::/0 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -46133,7 +46133,7 @@ fc00:23::1/128 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -46160,7 +46160,7 @@ 2a01:111:e210:5e::/128 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production TestbedForstr-sonic @@ -46187,7 +46187,7 @@ 2a01:111:e210:5e::/128 TestbedForstr-sonic - TestbedForstr-sonic + AZNG_Production None TestbedForstr-sonic diff --git a/src/sonic-config-engine/tests/test_chassis_cfggen.py b/src/sonic-config-engine/tests/test_chassis_cfggen.py index b4cd571bd577..c309e7f2d694 100644 --- a/src/sonic-config-engine/tests/test_chassis_cfggen.py +++ b/src/sonic-config-engine/tests/test_chassis_cfggen.py @@ -137,7 +137,8 @@ def test_device_metadata(self): 'sub_role': 'FrontEnd', 'switch_type': 'voq', 'switch_id': 20, - 'max_cores': 64}) + 'max_cores': 64, + 'slice_type': 'AZNG_Production'}) def test_port(self): argument = ['-m', self.sample_graph, '-p', @@ -1156,4 +1157,4 @@ def tearDown(self): os.environ['CFGGEN_UNIT_TESTING'] = '' os.environ['CFGGEN_UNIT_TESTING_TOPOLOGY'] = '' if os.path.exists(self.output_file): - os.remove(self.output_file) \ No newline at end of file + os.remove(self.output_file) From dadf0ddf5a4d4dce6636fed8e7923dfd2b1c131d Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 6 Jun 2024 16:01:17 +0800 Subject: [PATCH 238/282] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#19225) #### Why I did it src/sonic-utilities ``` * 1ebd0993 - (HEAD -> master, origin/master, origin/HEAD) Fix show fabric monitor capacity command when the feature is disabled. (#3347) (8 hours ago) [jfeng-arista] * 6829ded4 - Add W-ECMP CLI (#3253) (10 hours ago) [Nazarii Hnydyn] * 4133ef54 - [chassis][voq] Added support for Voq Counters(SAI_SWITCH_STAT_PACKET_INTEGRITY_DROP,SAI_QUEUE_STAT_CREDIT_WD_DELETED_PACKETS) for Voq/Fabric switches (#3322) (25 hours ago) [saksarav-nokia] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index f14ed66e8b37..1ebd09938c5c 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit f14ed66e8b37801ffd217276d3103c8a881983f9 +Subproject commit 1ebd09938c5c95746a957d5f40009950d63a8ce1 From 68815b7c5f88e3a938249a65428aae1c5450b1ba Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:27:18 +0800 Subject: [PATCH 239/282] [Mellanox] Disable TPM on SN5600 and SN5400 platform (#19221) Disable TPM module for SN5600 and SN5400 to avoid following error message: ERR kernel: [ 3.434153] tpm tpm0: [Firmware Bug]: TPM interrupt not working, polling instead --- device/mellanox/x86_64-nvidia_sn5400-r0/installer.conf | 1 + device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/installer.conf diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/installer.conf b/device/mellanox/x86_64-nvidia_sn5400-r0/installer.conf new file mode 100644 index 000000000000..d43a240ee0ad --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/installer.conf @@ -0,0 +1 @@ +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="modprobe.blacklist=tpm_tis,tpm_crb,tpm" diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf b/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf index c46f0eb7a459..306cde03b174 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/installer.conf @@ -1 +1 @@ -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq modprobe.blacklist=tpm_tis,tpm_crb,tpm" From 54628b208f5ef22d32b8aaa3af4c70f23746cddf Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 6 Jun 2024 19:01:24 +0800 Subject: [PATCH 240/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19203) #### Why I did it src/sonic-swss ``` * 8f333b69 - (HEAD -> master, origin/master, origin/HEAD, origin/202405) [subnet decap] Support decap rule generation based on T0 VIP route (#3183) (22 hours ago) [Longxiang Lyu] * 9bcb9b6e - Fixing appl_db FABRIC_MONITOR notification issue. (#3176) (25 hours ago) [jfeng-arista] * fff544e6 - Rotate record file before writing new log. (#3158) (29 hours ago) [mint570] * 80f52079 - Add SWSS support for link event damping feature (#2933) (29 hours ago) [Roy Yi] * b3ebfc46 - [muxorch] Using bulker to program routes/neighbors during switchover (#3148) (29 hours ago) [Nikola Dancejic] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 98012ed411d4..8f333b692308 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 98012ed411d4e83ac01dabbb6d03e4f122ad1545 +Subproject commit 8f333b6923083d6c575a5a5db9aa448d9cb74abc From 78e139389c0d4520f5190ef86fb8d437da667b08 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 6 Jun 2024 19:01:30 +0800 Subject: [PATCH 241/282] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#19131) #### Why I did it src/sonic-sairedis ``` * c8cede0f - (HEAD -> master, origin/master, origin/HEAD) [syncd] Enable bulk api for neighbor entries (#1373) (6 days ago) [Nikola Dancejic] * 270fed7e - Clean up and refactor duplicated code and auto generate sai stub for libraries (#1384) (8 days ago) [Kamil Cudnik] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 20bcfe1965a8..c8cede0f405b 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 20bcfe1965a8f9f64e25355783994165b780839a +Subproject commit c8cede0f405b6f6ee65fca48a8c5e4261e93fb04 From b1491945f61cb57890796c5896d7fc8c174f077d Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Thu, 6 Jun 2024 18:18:14 +0300 Subject: [PATCH 242/282] Add W-ECMP to BGP OA (#18533) - Why I did it W-ECMP feature implementation is according to the HLD - How I did it Added W-ECMP YANG model implementation Added W-ECMP BGP OA implementation - How to verify it Run UTs Verified manually with the feature qualification Signed-off-by: Nazarii Hnydyn --- .../frr/bgpd/wcmp/bgpd.wcmp.conf.j2 | 21 +++ files/build_templates/init_cfg.json.j2 | 1 + .../bgpcfgd/managers_device_global.py | 165 +++++++++++++++--- .../tests/data/wcmp/wcmp.set.conf | 14 ++ .../tests/data/wcmp/wcmp.unset.conf | 14 ++ src/sonic-bgpcfgd/tests/test_device_global.py | 156 +++++++++++++---- src/sonic-yang-models/doc/Configuration.md | 35 +++- .../tests/files/sample_config_db.json | 1 + .../tests/bgp_device_global.json | 71 ++++++-- .../tests_config/bgp_device_global.json | 76 +++++--- .../yang-models/sonic-bgp-device-global.yang | 37 +++- 11 files changed, 477 insertions(+), 114 deletions(-) create mode 100644 dockers/docker-fpm-frr/frr/bgpd/wcmp/bgpd.wcmp.conf.j2 create mode 100644 src/sonic-bgpcfgd/tests/data/wcmp/wcmp.set.conf create mode 100644 src/sonic-bgpcfgd/tests/data/wcmp/wcmp.unset.conf diff --git a/dockers/docker-fpm-frr/frr/bgpd/wcmp/bgpd.wcmp.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/wcmp/bgpd.wcmp.conf.j2 new file mode 100644 index 000000000000..a570c89acfd1 --- /dev/null +++ b/dockers/docker-fpm-frr/frr/bgpd/wcmp/bgpd.wcmp.conf.j2 @@ -0,0 +1,21 @@ +! +! template: bgpd/wcmp/bgpd.wcmp.conf.j2 +! +route-map TO_BGP_PEER_V4 permit 100 +{%- if wcmp_enabled == 'true' %} + set extcommunity bandwidth num-multipaths +{%- else %} + no set extcommunity bandwidth +{%- endif %} +exit +! +route-map TO_BGP_PEER_V6 permit 100 +{%- if wcmp_enabled == 'true' %} + set extcommunity bandwidth num-multipaths +{%- else %} + no set extcommunity bandwidth +{%- endif %} +exit +! +! end of template: bgpd/wcmp/bgpd.wcmp.conf.j2 +! diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 31be59e35017..0a185680e690 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -31,6 +31,7 @@ "BGP_DEVICE_GLOBAL": { "STATE": { "tsa_enabled": "false", + "wcmp_enabled": "false", "idf_isolation_state": "unisolated" } }, diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py index 5c42e4415f16..1943dfa5d709 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py @@ -1,11 +1,17 @@ +import re +import jinja2 + from .manager import Manager from .log import log_err, log_debug, log_notice -import re from swsscommon import swsscommon class DeviceGlobalCfgMgr(Manager): """This class responds to change in device-specific state""" + TSA_DEFAULTS = "false" + WCMP_DEFAULTS = "false" + IDF_DEFAULTS = "unisolated" + def __init__(self, common_objs, db, table): """ Initialize the object @@ -19,6 +25,7 @@ def __init__(self, common_objs, db, table): self.constants = common_objs['constants'] self.tsa_template = common_objs['tf'].from_file("bgpd/tsa/bgpd.tsa.isolate.conf.j2") self.tsb_template = common_objs['tf'].from_file("bgpd/tsa/bgpd.tsa.unisolate.conf.j2") + self.wcmp_template = common_objs['tf'].from_file("bgpd/wcmp/bgpd.wcmp.conf.j2") self.idf_isolate_template = common_objs['tf'].from_file("bgpd/idf_isolate/idf_isolate.conf.j2") self.idf_unisolate_template = common_objs['tf'].from_file("bgpd/idf_isolate/idf_unisolate.conf.j2") self.directory.subscribe([("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/switch_type"),], self.on_switch_type_change) @@ -29,6 +36,16 @@ def __init__(self, common_objs, db, table): table, ) + # By default TSA feature is disabled + if not self.directory.path_exist(self.db_name, self.table_name, "tsa_enabled"): + self.directory.put(self.db_name, self.table_name, "tsa_enabled", self.TSA_DEFAULTS) + # By default W-ECMP feature is disabled + if not self.directory.path_exist(self.db_name, self.table_name, "wcmp_enabled"): + self.directory.put(self.db_name, self.table_name, "wcmp_enabled", self.WCMP_DEFAULTS) + # By default IDF feature is unisolated + if not self.directory.path_exist(self.db_name, self.table_name, "idf_isolation_state"): + self.directory.put(self.db_name, self.table_name, "idf_isolation_state", self.IDF_DEFAULTS) + def on_switch_type_change(self): log_debug("DeviceGlobalCfgMgr:: Switch type update handler") if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/switch_type"): @@ -36,42 +53,113 @@ def on_switch_type_change(self): log_debug("DeviceGlobalCfgMgr:: Switch type: %s" % self.switch_type) def set_handler(self, key, data): + """ Handle device TSA/W-ECMP state change """ log_debug("DeviceGlobalCfgMgr:: set handler") + if self.switch_type: log_debug("DeviceGlobalCfgMgr:: Switch type: %s" % self.switch_type) - """ Handle device tsa_enabled state change """ if not data: log_err("DeviceGlobalCfgMgr:: data is None") return False - tsa_status = "false" - idf_isolation_state = "unisolated" + # TSA configuration + self.configure_tsa(data) + # W-ECMP configuration + self.configure_wcmp(data) + # IDF configuration + self.configure_idf(data) - if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"): - tsa_status = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["tsa_enabled"] - if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "idf_isolation_state"): - idf_isolation_state = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["idf_isolation_state"] - - if "tsa_enabled" in data: - self.directory.put(self.db_name, self.table_name, "tsa_enabled", data["tsa_enabled"]) - if tsa_status != data["tsa_enabled"]: - self.cfg_mgr.commit() - self.cfg_mgr.update() - self.isolate_unisolate_device(data["tsa_enabled"]) - - - if "idf_isolation_state" in data: - self.directory.put(self.db_name, self.table_name, "idf_isolation_state", data["idf_isolation_state"]) - if idf_isolation_state != data["idf_isolation_state"]: - if self.switch_type and self.switch_type != "SpineRouter": - log_debug("DeviceGlobalCfgMgr:: Skipping IDF isolation configuration on Switch type: %s" % self.switch_type) - return True - self.downstream_isolate_unisolate(data["idf_isolation_state"]) - return True def del_handler(self, key): log_debug("DeviceGlobalCfgMgr:: del handler") + + # TSA configuration + self.configure_tsa() + # W-ECMP configuration + self.configure_wcmp() + # IDF configuration + self.configure_idf() + + return True + + def is_update_required(self, key, value): + if self.directory.path_exist(self.db_name, self.table_name, key): + return value != self.directory.get(self.db_name, self.table_name, key) + return True + + def configure_tsa(self, data=None): + """ Configure TSA feature""" + + state = self.TSA_DEFAULTS + + if data is not None: + if "tsa_enabled" in data: + state = data["tsa_enabled"] + + if self.is_update_required("tsa_enabled", state): + self.cfg_mgr.commit() + self.cfg_mgr.update() + if self.isolate_unisolate_device(state): + self.directory.put(self.db_name, self.table_name, "tsa_enabled", state) + else: + log_notice("DeviceGlobalCfgMgr:: TSA configuration is up-to-date") + + def configure_wcmp(self, data=None): + """ Configure W-ECMP feature""" + + state = self.WCMP_DEFAULTS + + if data is not None: + if "wcmp_enabled" in data: + state = data["wcmp_enabled"] + + if self.is_update_required("wcmp_enabled", state): + if self.set_wcmp(state): + self.directory.put(self.db_name, self.table_name, "wcmp_enabled", state) + else: + log_notice("DeviceGlobalCfgMgr:: W-ECMP configuration is up-to-date") + + def configure_idf(self, data=None): + """ Configure IDF feature""" + + state = self.IDF_DEFAULTS + + if data is not None: + if "idf_isolation_state" in data: + state = data["idf_isolation_state"] + + if self.is_update_required("idf_isolation_state", state): + if self.downstream_isolate_unisolate(state): + self.directory.put(self.db_name, self.table_name, "idf_isolation_state", state) + else: + log_notice("DeviceGlobalCfgMgr:: IDF configuration is up-to-date") + + def set_wcmp(self, status): + """ API to set/unset W-ECMP """ + + if status not in ["true", "false"]: + log_err("W-ECMP: invalid value({}) is provided".format(status)) + return False + + if status == "true": + log_notice("DeviceGlobalCfgMgr:: Enabling W-ECMP...") + else: + log_notice("DeviceGlobalCfgMgr:: Disabling W-ECMP...") + + cmd = "\n" + + try: + cmd += self.wcmp_template.render(wcmp_enabled=status) + except jinja2.TemplateError as e: + msg = "W-ECMP: error in template rendering" + log_err("%s: %s" % (msg, str(e))) + return False + + self.cfg_mgr.push(cmd) + + log_debug("DeviceGlobalCfgMgr::Done") + return True def check_state_and_get_tsa_routemaps(self, cfg): @@ -87,6 +175,11 @@ def check_state_and_get_tsa_routemaps(self, cfg): def isolate_unisolate_device(self, tsa_status): """ API to get TSA/TSB route-maps and apply configuration""" + + if tsa_status not in ["true", "false"]: + log_err("TSA: invalid value({}) is provided".format(tsa_status)) + return False + cmd = "\n" if tsa_status == "true": log_notice("DeviceGlobalCfgMgr:: Device isolated. Executing TSA") @@ -98,6 +191,8 @@ def isolate_unisolate_device(self, tsa_status): self.cfg_mgr.push(cmd) log_debug("DeviceGlobalCfgMgr::Done") + return True + def get_ts_routemaps(self, cmds, ts_template): if not cmds: return "" @@ -134,6 +229,16 @@ def __extract_out_route_map_names(self, cmds): return route_map_names def downstream_isolate_unisolate(self, idf_isolation_state): + """ API to apply IDF configuration """ + + if idf_isolation_state not in ["unisolated", "isolated_withdraw_all", "isolated_no_export"]: + log_err("IDF: invalid value({}) is provided".format(idf_isolation_state)) + return False + + if self.switch_type and self.switch_type != "SpineRouter": + log_debug("DeviceGlobalCfgMgr:: Skipping IDF isolation configuration on Switch type: %s" % self.switch_type) + return True + cmd = "\n" if idf_isolation_state == "unisolated": cmd += self.idf_unisolate_template.render(constants=self.constants) @@ -145,12 +250,16 @@ def downstream_isolate_unisolate(self, idf_isolation_state): self.cfg_mgr.push(cmd) log_debug("DeviceGlobalCfgMgr::Done") + return True + def check_state_and_get_idf_isolation_routemaps(self): """ API to get TSA route-maps if device is isolated""" + cmd = "" if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "idf_isolation_state"): idf_isolation_state = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["idf_isolation_state"] - if idf_isolation_state != "unisolated": + if idf_isolation_state != "unisolated": log_notice("DeviceGlobalCfgMgr:: IDF is isolated. Applying required route-maps") - cmd = self.idf_isolate_template.render(isolation_status=idf_isolation_state, constants=self.constants) - return cmd \ No newline at end of file + cmd = self.idf_isolate_template.render(isolation_status=idf_isolation_state, constants=self.constants) + + return cmd diff --git a/src/sonic-bgpcfgd/tests/data/wcmp/wcmp.set.conf b/src/sonic-bgpcfgd/tests/data/wcmp/wcmp.set.conf new file mode 100644 index 000000000000..77066a3057a2 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/wcmp/wcmp.set.conf @@ -0,0 +1,14 @@ + +! +! template: bgpd/wcmp/bgpd.wcmp.conf.j2 +! +route-map TO_BGP_PEER_V4 permit 100 + set extcommunity bandwidth num-multipaths +exit +! +route-map TO_BGP_PEER_V6 permit 100 + set extcommunity bandwidth num-multipaths +exit +! +! end of template: bgpd/wcmp/bgpd.wcmp.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/wcmp/wcmp.unset.conf b/src/sonic-bgpcfgd/tests/data/wcmp/wcmp.unset.conf new file mode 100644 index 000000000000..df107e432f7b --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/wcmp/wcmp.unset.conf @@ -0,0 +1,14 @@ + +! +! template: bgpd/wcmp/bgpd.wcmp.conf.j2 +! +route-map TO_BGP_PEER_V4 permit 100 + no set extcommunity bandwidth +exit +! +route-map TO_BGP_PEER_V6 permit 100 + no set extcommunity bandwidth +exit +! +! end of template: bgpd/wcmp/bgpd.wcmp.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/test_device_global.py b/src/sonic-bgpcfgd/tests/test_device_global.py index 12dd895f58d7..fc1c5e702d10 100644 --- a/src/sonic-bgpcfgd/tests/test_device_global.py +++ b/src/sonic-bgpcfgd/tests/test_device_global.py @@ -1,3 +1,4 @@ +import pytest from unittest.mock import MagicMock, patch import os @@ -9,9 +10,14 @@ from swsscommon import swsscommon from copy import deepcopy +# +# Constants ----------------------------------------------------------------------------------------------------------- +# + TEMPLATE_PATH = os.path.abspath('../../dockers/docker-fpm-frr/frr') BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/general/peer-group.conf/') INTERNAL_BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/internal/peer-group.conf/') +WCMP_BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/wcmp/') global_constants = { "bgp": { "traffic_shift_community" :"12345:12345", @@ -19,6 +25,10 @@ } } +# +# Helpers ------------------------------------------------------------------------------------------------------------- +# + def constructor(check_internal=False): cfg_mgr = MagicMock() def get_text(): @@ -54,6 +64,9 @@ def get_config(): cfg_mgr.update() return mgr +# +# TSA ----------------------------------------------------------------------------------------------------------------- +# @patch('bgpcfgd.managers_device_global.log_debug') def test_isolate_device(mocked_log_info): @@ -63,31 +76,6 @@ def test_isolate_device(mocked_log_info): mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_isolate.conf") -@patch('bgpcfgd.managers_device_global.log_debug') -def test_idf_isolation_no_export(mocked_log_info): - m = constructor() - res = m.set_handler("STATE", {"idf_isolation_state": "isolated_no_export"}) - assert res, "Expect True return value for set_handler" - mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") - assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_isolated_no_export.conf") - -@patch('bgpcfgd.managers_device_global.log_debug') -def test_idf_isolation_withdraw_all(mocked_log_info): - m = constructor() - res = m.set_handler("STATE", {"idf_isolation_state": "isolated_withdraw_all"}) - assert res, "Expect True return value for set_handler" - mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") - assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_isolated_withdraw_all.conf") - -@patch('bgpcfgd.managers_device_global.log_debug') -def test_idf_unisolation(mocked_log_info): - m = constructor() - m.directory.put(m.db_name, m.table_name, "idf_isolation_state", "isolated_no_export") - res = m.set_handler("STATE", {"idf_isolation_state": "unisolated"}) - assert res, "Expect True return value for set_handler" - mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") - assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_unisolated.conf") - @patch('bgpcfgd.managers_device_global.log_debug') def test_isolate_device_internal_session(mocked_log_info): m = constructor(check_internal=True) @@ -96,10 +84,10 @@ def test_isolate_device_internal_session(mocked_log_info): mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_isolate.conf", INTERNAL_BASE_PATH) - @patch('bgpcfgd.managers_device_global.log_debug') def test_unisolate_device(mocked_log_info): m = constructor() + # By default feature is disabled. Simulate enabled state m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" @@ -109,13 +97,13 @@ def test_unisolate_device(mocked_log_info): @patch('bgpcfgd.managers_device_global.log_debug') def test_unisolate_device_internal_session(mocked_log_info): m = constructor(check_internal=True) - m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") + # By default feature is disabled. Simulate enabled state + m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_unisolate.conf", INTERNAL_BASE_PATH) - def test_check_state_and_get_tsa_routemaps(): m = constructor() m.set_handler("STATE", {"tsa_enabled": "true"}) @@ -126,16 +114,6 @@ def test_check_state_and_get_tsa_routemaps(): res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) assert res == "" -def test_check_state_and_get_idf_isolation_routemaps(): - m = constructor() - m.set_handler("STATE", {"idf_isolation_state": "isolated_no_export"}) - res = m.check_state_and_get_idf_isolation_routemaps() - assert res == get_string_from_file("/result_idf_isolated.conf") - - m.set_handler("STATE", {"idf_isolation_state": "unisolated"}) - res = m.check_state_and_get_idf_isolation_routemaps() - assert res == "" - def test_get_tsa_routemaps(): m = constructor() assert m.get_ts_routemaps([], m.tsa_template) == "" @@ -171,3 +149,105 @@ def test_del_handler(): res = m.del_handler("STATE") assert res, "Expect True return value for del_handler" +@pytest.mark.parametrize( + "value", [ "invalid_value" ] +) +@patch('bgpcfgd.managers_device_global.log_err') +def test_tsa_neg(mocked_log_err, value): + m = constructor() + m.cfg_mgr.changes = "" + res = m.set_handler("STATE", {"tsa_enabled": value}) + assert res, "Expect True return value for set_handler" + mocked_log_err.assert_called_with("TSA: invalid value({}) is provided".format(value)) + +# +# W-ECMP -------------------------------------------------------------------------------------------------------------- +# + +@pytest.mark.parametrize( + "value,result", [ + pytest.param( + "true", + get_string_from_file("/wcmp.set.conf", WCMP_BASE_PATH), + id="enabled" + ), + pytest.param( + "false", + get_string_from_file("/wcmp.unset.conf", WCMP_BASE_PATH), + id="disabled" + ) + ] +) +@patch('bgpcfgd.managers_device_global.log_debug') +def test_wcmp(mocked_log_info, value, result): + m = constructor() + m.cfg_mgr.changes = "" + if value == "false": + # By default feature is disabled. Simulate enabled state + m.directory.put(m.db_name, m.table_name, "wcmp_enabled", "true") + res = m.set_handler("STATE", {"wcmp_enabled": value}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == result + +@pytest.mark.parametrize( + "value", [ "invalid_value" ] +) +@patch('bgpcfgd.managers_device_global.log_err') +def test_wcmp_neg(mocked_log_err, value): + m = constructor() + m.cfg_mgr.changes = "" + res = m.set_handler("STATE", {"wcmp_enabled": value}) + assert res, "Expect True return value for set_handler" + mocked_log_err.assert_called_with("W-ECMP: invalid value({}) is provided".format(value)) + +# +# IDF ----------------------------------------------------------------------------------------------------------------- +# + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_idf_isolation_no_export(mocked_log_info): + m = constructor() + res = m.set_handler("STATE", {"idf_isolation_state": "isolated_no_export"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_isolated_no_export.conf") + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_idf_isolation_withdraw_all(mocked_log_info): + m = constructor() + res = m.set_handler("STATE", {"idf_isolation_state": "isolated_withdraw_all"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_isolated_withdraw_all.conf") + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_idf_unisolation(mocked_log_info): + m = constructor() + # By default feature is unisolated. Simulate a different state + m.directory.put(m.db_name, m.table_name, "idf_isolation_state", "isolated_no_export") + res = m.set_handler("STATE", {"idf_isolation_state": "unisolated"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_idf_unisolated.conf") + +def test_check_state_and_get_idf_isolation_routemaps(): + m = constructor() + m.set_handler("STATE", {"idf_isolation_state": "isolated_no_export"}) + res = m.check_state_and_get_idf_isolation_routemaps() + assert res == get_string_from_file("/result_idf_isolated.conf") + + m.set_handler("STATE", {"idf_isolation_state": "unisolated"}) + res = m.check_state_and_get_idf_isolation_routemaps() + assert res == "" + +@pytest.mark.parametrize( + "value", [ "invalid_value" ] +) +@patch('bgpcfgd.managers_device_global.log_err') +def test_idf_neg(mocked_log_err, value): + m = constructor() + m.cfg_mgr.changes = "" + res = m.set_handler("STATE", {"idf_isolation_state": value}) + assert res, "Expect True return value for set_handler" + mocked_log_err.assert_called_with("IDF: invalid value({}) is provided".format(value)) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index f1bc162cb831..cafc4fcaac16 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -384,6 +384,7 @@ The **BGP_BBR** table contains device-level BBR state. } } ``` + ### ASIC SDK health event ASIC/SDK health event related configuration is defined in **SUPPRESS_ASIC_SDK_HEALTH_EVENT** table. @@ -407,21 +408,43 @@ ASIC/SDK health event related configuration is defined in **SUPPRESS_ASIC_SDK_HE ### BGP Device Global -The **BGP_DEVICE_GLOBAL** table contains device-level BGP global state. -It has a STATE object containing device state like **tsa_enabled** -which is set to true if device is currently isolated using -traffic-shift-away (TSA) route-maps in BGP. It also holds IDF isolation state -which could be one of isolated_no_export, isolated_withdraw_all or unisolated +The **BGP_DEVICE_GLOBAL** table contains device-level BGP global state. +It has a STATE object containing device state like **tsa_enabled**, **wcmp_enabled** and **idf_isolation_state**. + +When **tsa_enabled** is set to true, the device is isolated using traffic-shift-away (TSA) route-maps in BGP. +```json +{ +"BGP_DEVICE_GLOBAL": { + "STATE": { + "tsa_enabled": "true" + } +} ``` + +When **wcmp_enabled** is set to true, the device is configured to use BGP Link Bandwidth Extended Community. +Weighted ECMP load balances traffic between the equal cost paths in proportion to the capacity of the local links. + +```json +{ +"BGP_DEVICE_GLOBAL": { + "STATE": { + "wcmp_enabled": "true" + } +} +``` + +The IDF isolation state **idf_isolation_state** could be one of isolated_no_export, isolated_withdraw_all or unisolated. + +```json { "BGP_DEVICE_GLOBAL": { "STATE": { - "tsa_enabled": "true", "idf_isolation_state": "isolated_no_export" } } ``` + ### BGP Sessions BGP session configuration is defined in **BGP_NEIGHBOR** table. BGP diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 850785624f76..ed1f75c65795 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1710,6 +1710,7 @@ "BGP_DEVICE_GLOBAL": { "STATE": { "tsa_enabled": "false", + "wcmp_enabled": "false", "idf_isolation_state": "unisolated" } }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json index 3c3a8559b3e6..b9cc07ed54e5 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp_device_global.json @@ -1,6 +1,12 @@ { - "BGP_DEVICE_GLOBAL_WITH_DEFAULT_VALUES": { - "desc": "Load bgp device global table with fields set to default values" + "BGP_DEVICE_GLOBAL_WITH_TSA_DEFAULT_VALUE": { + "desc": "Load bgp device global table with tsa_enabled set to default value", + "eStrKey": "Verify", + "verify": { + "xpath": "/sonic-bgp-device-global:sonic-bgp-device-global/BGP_DEVICE_GLOBAL/STATE/tsa_enabled", + "key": "sonic-bgp-device-global:tsa_enabled", + "value": false + } }, "BGP_DEVICE_GLOBAL_WITH_TSA_TEST": { "desc": "Load bgp device global table with tsa_enabled set to true" @@ -8,23 +14,64 @@ "BGP_DEVICE_GLOBAL_WITH_TSB_TEST": { "desc": "Load bgp device global table with tsa_enabled set to false" }, + "BGP_DEVICE_GLOBAL_WITH_TSA_INVALID_VALUE": { + "desc": "Load bgp device global table with tsa_enabled set to invalid value", + "eStrKey": "InvalidValue", + "eStr": ["tsa_enabled"] + }, + "BGP_DEVICE_GLOBAL_WITH_WCMP_DEFAULT_VALUE": { + "desc": "Verify default value for WCMP_ENABLED field in BGP_DEVICE_GLOBAL.", + "eStrKey": "Verify", + "verify": { + "xpath": "/sonic-bgp-device-global:sonic-bgp-device-global/BGP_DEVICE_GLOBAL/STATE/wcmp_enabled", + "key": "sonic-bgp-device-global:wcmp_enabled", + "value": false + } + }, + "BGP_DEVICE_GLOBAL_WITH_WCMP_ENABLED": { + "desc": "Verify value for WCMP_ENABLED in BGP_DEVICE_GLOBAL is set to true.", + "eStrKey": "Verify", + "verify": { + "xpath": "/sonic-bgp-device-global:sonic-bgp-device-global/BGP_DEVICE_GLOBAL/STATE/wcmp_enabled", + "key": "sonic-bgp-device-global:wcmp_enabled", + "value": true + } + }, + "BGP_DEVICE_GLOBAL_WITH_WCMP_DISABLED": { + "desc": "Verify value for WCMP_ENABLED in BGP_DEVICE_GLOBAL is set to false.", + "eStrKey": "Verify", + "verify": { + "xpath": "/sonic-bgp-device-global:sonic-bgp-device-global/BGP_DEVICE_GLOBAL/STATE/wcmp_enabled", + "key": "sonic-bgp-device-global:wcmp_enabled", + "value": false + } + }, + "BGP_DEVICE_GLOBAL_WITH_WCMP_INVALID_VALUE": { + "desc": "Configure invalid WCMP_ENABLED in BGP_DEVICE_GLOBAL.", + "eStrKey": "InvalidValue", + "eStr": ["wcmp_enabled"] + }, + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_DEFAULT_VALUE": { + "desc": "Load bgp device global table with idf_isolation_state set to default value", + "eStrKey": "Verify", + "verify": { + "xpath": "/sonic-bgp-device-global:sonic-bgp-device-global/BGP_DEVICE_GLOBAL/STATE/idf_isolation_state", + "key": "sonic-bgp-device-global:idf_isolation_state", + "value": "unisolated" + } + }, "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_1": { "desc": "Load bgp device global table with idf_isolation_state set to isolated_no_export" }, "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_2": { - "desc": "Load bgp device global table with idf_isolation_state set to isolated_withdraw_all" + "desc": "Load bgp device global table with idf_isolation_state set to isolated_withdraw_all" }, "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_3": { - "desc": "Load bgp device global table with idf_isolation_state set to unisolated" - }, - "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE_1": { - "desc": "Load bgp device global table with invalid value", - "eStrKey": "InvalidValue", - "eStr": ["tsa_enabled"] + "desc": "Load bgp device global table with idf_isolation_state set to unisolated" }, - "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE_2": { - "desc": "Load bgp device global table with invalid value", + "BGP_DEVICE_GLOBAL_WITH_IDF_INVALID_VALUE": { + "desc": "Load bgp device global table with idf_isolation_state set to invalid value", "eStrKey": "InvalidValue", "eStr": ["idf_isolation_state"] } -} \ No newline at end of file +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_device_global.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_device_global.json index b9bb4fe007c0..f1be80b6b421 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_device_global.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp_device_global.json @@ -1,10 +1,8 @@ { - "BGP_DEVICE_GLOBAL_WITH_DEFAULT_VALUES": { + "BGP_DEVICE_GLOBAL_WITH_TSA_DEFAULT_VALUE": { "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "false", - "idf_isolation_state": "unisolated" } } } @@ -13,8 +11,7 @@ "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "true", - "idf_isolation_state": "unisolated" + "tsa_enabled": "true" } } } @@ -23,58 +20,95 @@ "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "false", - "idf_isolation_state": "unisolated" + "tsa_enabled": "false" } } } }, - "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_1": { + "BGP_DEVICE_GLOBAL_WITH_TSA_INVALID_VALUE": { "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "true", - "idf_isolation_state": "isolated_no_export" + "tsa_enabled": "invalid_value" } } } }, - "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_2": { + "BGP_DEVICE_GLOBAL_WITH_WCMP_DEFAULT_VALUE": { + "sonic-bgp-device-global:sonic-bgp-device-global": { + "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { + "STATE": { + } + } + } + }, + "BGP_DEVICE_GLOBAL_WITH_WCMP_ENABLED": { + "sonic-bgp-device-global:sonic-bgp-device-global": { + "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { + "STATE": { + "wcmp_enabled": "true" + } + } + } + }, + "BGP_DEVICE_GLOBAL_WITH_WCMP_DISABLED": { + "sonic-bgp-device-global:sonic-bgp-device-global": { + "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { + "STATE": { + "wcmp_enabled": "false" + } + } + } + }, + "BGP_DEVICE_GLOBAL_WITH_WCMP_INVALID_VALUE": { + "sonic-bgp-device-global:sonic-bgp-device-global": { + "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { + "STATE": { + "wcmp_enabled": "invalid_value" + } + } + } + }, + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_DEFAULT_VALUE": { "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "false", - "idf_isolation_state": "isolated_withdraw_all" } } } }, - "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_3": { + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_1": { "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "false", - "idf_isolation_state": "unisolated" + "idf_isolation_state": "isolated_no_export" } } } }, - "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE_1": { + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_2": { + "sonic-bgp-device-global:sonic-bgp-device-global": { + "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { + "STATE":{ + "idf_isolation_state": "isolated_withdraw_all" + } + } + } + }, + "BGP_DEVICE_GLOBAL_WITH_IDF_ISOLATION_TEST_3": { "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "FALSE", "idf_isolation_state": "unisolated" } } } }, - "BGP_DEVICE_GLOBAL_WITH_INVALID_VALUE_2": { + "BGP_DEVICE_GLOBAL_WITH_IDF_INVALID_VALUE": { "sonic-bgp-device-global:sonic-bgp-device-global": { "sonic-bgp-device-global:BGP_DEVICE_GLOBAL": { "STATE":{ - "tsa_enabled": "false", - "idf_isolation_state": "isolated" + "idf_isolation_state": "invalid_value" } } } diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-device-global.yang b/src/sonic-yang-models/yang-models/sonic-bgp-device-global.yang index 07e763735f8f..447b89f10eb6 100644 --- a/src/sonic-yang-models/yang-models/sonic-bgp-device-global.yang +++ b/src/sonic-yang-models/yang-models/sonic-bgp-device-global.yang @@ -12,22 +12,39 @@ module sonic-bgp-device-global { description "SONIC Device-specific BGP global data"; + revision 2024-01-28 { + description "Add Weighted ECMP using BGP link bandwidth"; + } + revision 2022-06-26 { - description - "Initial revision"; + description "Initial revision"; } container sonic-bgp-device-global { + container BGP_DEVICE_GLOBAL { + + description "BGP_DEVICE_GLOBAL part of config_db.json"; + container STATE { + description "BGP device-specific global data"; + leaf tsa_enabled { type boolean; default "false"; description "When set to true, Traffic is shifted away (TSA), i.e, BGP routes are not advertised to neighboring routers"; } + + leaf wcmp_enabled { + description "Enables/Disables Weighted-Equal Cost-Multipath using BGP link bandwidth"; + type boolean; + default "false"; + } + leaf idf_isolation_state { + description "Configures device IDF isolation state"; type enumeration { enum isolated_no_export { description "IDF isolated using no-export community tag"; @@ -39,12 +56,14 @@ module sonic-bgp-device-global { description "IDF un-isolated"; } } - default unisolated; + default "unisolated"; } - } /* end of STATE container */ - } /* end of BGP_DEVICE_GLOBAL container */ - - } /* end of top level container */ - -} /* end of module sonic-bgp-device-global */ + } + /* end of STATE container */ + } + /* end of BGP_DEVICE_GLOBAL container */ + } + /* end of container sonic-bgp-device-global */ +} +/* end of module sonic-bgp-device-global */ From 17f3d7db439dd1370f1539ce64c43c5c7b82e56d Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Thu, 6 Jun 2024 20:25:34 +0300 Subject: [PATCH 243/282] [Mellanox] route config/set/delete performance improvement(#18801) - Why I did it Increase significantly the rate of routes config/set/delete to HW. - How I did it Add required flag in sai.profile and increase orchagent bulk size. - How to verify it Measure rate of route set/del operations at scale. --- platform/mellanox/docker-syncd-mlnx/sai-common.profile | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/mellanox/docker-syncd-mlnx/sai-common.profile b/platform/mellanox/docker-syncd-mlnx/sai-common.profile index 3b9e6fe00573..62e4323e2e24 100644 --- a/platform/mellanox/docker-syncd-mlnx/sai-common.profile +++ b/platform/mellanox/docker-syncd-mlnx/sai-common.profile @@ -1,2 +1,3 @@ SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps SAI_DUMP_STORE_AMOUNT=10 +SAI_ASYNC_ROUTING_ENABLED=1 From 6968aaa85d37b6d83549d0d4ea25c56d16f7207f Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Fri, 7 Jun 2024 00:48:46 +0300 Subject: [PATCH 244/282] [Mellanox] Remove pmon delay for certain platforms (#19190) * [nvidia] Remove pmon delay for certain platforms Signed-off-by: Stepan Blyschak --- .../x86_64-mlnx_msn4410-r0/pmon_daemon_control.json | 2 +- .../x86_64-mlnx_msn4410-r0/pmon_immediate_start | 0 .../x86_64-mlnx_msn4600-r0/pmon_daemon_control.json | 2 +- .../x86_64-mlnx_msn4600-r0/pmon_immediate_start | 0 .../pmon_daemon_control.json | 2 +- .../x86_64-mlnx_msn4600c-r0/pmon_immediate_start | 0 .../Mellanox-SN4700-O8C48/pmon_daemon_control.json | 2 +- .../Mellanox-SN4700-O8V48/pmon_daemon_control.json | 2 +- .../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json | 7 ++++++- .../x86_64-mlnx_msn4700-r0/pmon_immediate_start | 0 .../pmon_immediate_start | 0 .../pmon_daemon_control.json | 6 +----- .../pmon_immediate_start | 0 .../pmon_daemon_control.json | 2 +- .../x86_64-nvidia_sn4800-r0/pmon_immediate_start | 0 .../pmon_daemon_control.json | 2 +- .../pmon_immediate_start | 0 .../pmon_daemon_control.json | 2 +- .../x86_64-nvidia_sn5400-r0/pmon_immediate_start | 0 .../pmon_daemon_control.json | 2 +- .../pmon_immediate_start | 0 .../pmon_daemon_control.json | 7 ++++++- .../x86_64-nvidia_sn5600-r0/pmon_immediate_start | 0 .../pmon_immediate_start | 0 files/scripts/syncd.sh | 13 +++++-------- 25 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 device/mellanox/x86_64-mlnx_msn4410-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-mlnx_msn4600-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_immediate_start mode change 120000 => 100644 device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json create mode 100644 device/mellanox/x86_64-mlnx_msn4700-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-mlnx_msn4700_simx-r0/pmon_immediate_start mode change 100644 => 120000 device/mellanox/x86_64-nvidia_sn4280_simx-r0/pmon_daemon_control.json create mode 100644 device/mellanox/x86_64-nvidia_sn4280_simx-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-nvidia_sn4800-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_immediate_start mode change 120000 => 100644 device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/pmon_immediate_start create mode 100644 device/mellanox/x86_64-nvidia_sn5600_simx-r0/pmon_immediate_start diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_daemon_control.json index 435a2ce7c0ba..af0a90e77603 120000 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_immediate_start b/device/mellanox/x86_64-mlnx_msn4410-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json index 435a2ce7c0ba..af0a90e77603 120000 --- a/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_immediate_start b/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_daemon_control.json index 435a2ce7c0ba..af0a90e77603 120000 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_immediate_start b/device/mellanox/x86_64-mlnx_msn4600c-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json index ac8cc05f63dc..3ada0d34478e 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8C48/pmon_daemon_control.json @@ -1,6 +1,6 @@ { "skip_ledd": true, "skip_fancontrol": true, - "delay_xcvrd": true, + "delay_xcvrd": false, "skip_xcvrd_cmis_mgr": false } diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json index ac8cc05f63dc..3ada0d34478e 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-O8V48/pmon_daemon_control.json @@ -1,6 +1,6 @@ { "skip_ledd": true, "skip_fancontrol": true, - "delay_xcvrd": true, + "delay_xcvrd": false, "skip_xcvrd_cmis_mgr": false } diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json deleted file mode 120000 index 435a2ce7c0ba..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..fefdfb327396 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_daemon_control.json @@ -0,0 +1,6 @@ +{ + "skip_ledd": true, + "skip_fancontrol": true, + "skip_xcvrd_cmis_mgr": true +} + diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_immediate_start b/device/mellanox/x86_64-mlnx_msn4700-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-mlnx_msn4700_simx-r0/pmon_immediate_start b/device/mellanox/x86_64-mlnx_msn4700_simx-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn4280_simx-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn4280_simx-r0/pmon_daemon_control.json deleted file mode 100644 index b2c37062fe08..000000000000 --- a/device/mellanox/x86_64-nvidia_sn4280_simx-r0/pmon_daemon_control.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "skip_ledd": true, - "skip_xcvrd": true, - "skip_fancontrol": true -} diff --git a/device/mellanox/x86_64-nvidia_sn4280_simx-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn4280_simx-r0/pmon_daemon_control.json new file mode 120000 index 000000000000..af0a90e77603 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn4280_simx-r0/pmon_daemon_control.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn4280_simx-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn4280_simx-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_daemon_control.json index 435a2ce7c0ba..af0a90e77603 120000 --- a/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn4800-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_daemon_control.json index d9fa54f8d2b9..af0a90e77603 120000 --- a/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700_simx-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-mlnx_msn4700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn4800_simx-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json index 435a2ce7c0ba..f56b32678200 120000 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-nvidia_sn5600-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn5400-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json index 435a2ce7c0ba..f56b32678200 120000 --- a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_daemon_control.json @@ -1 +1 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file +../x86_64-nvidia_sn5600-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn5400_simx-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json deleted file mode 120000 index 435a2ce7c0ba..000000000000 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json b/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..fefdfb327396 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_daemon_control.json @@ -0,0 +1,6 @@ +{ + "skip_ledd": true, + "skip_fancontrol": true, + "skip_xcvrd_cmis_mgr": true +} + diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn5600-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/mellanox/x86_64-nvidia_sn5600_simx-r0/pmon_immediate_start b/device/mellanox/x86_64-nvidia_sn5600_simx-r0/pmon_immediate_start new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/files/scripts/syncd.sh b/files/scripts/syncd.sh index c6fbf008c6dc..0930de72b87c 100755 --- a/files/scripts/syncd.sh +++ b/files/scripts/syncd.sh @@ -57,7 +57,7 @@ function startplatform() { platform=$aboot_platform elif [ -n "$onie_platform" ]; then platform=$onie_platform - else + else platform="unknown" fi if [[ x"$platform" == x"x86_64-arista_720dt_48s" ]]; then @@ -96,13 +96,10 @@ function waitplatform() { BOOT_TYPE=`getBootType` if [[ x"$sonic_asic_platform" == x"mellanox" ]]; then - if [[ x"$BOOT_TYPE" = @(x"fast"|x"warm"|x"fastfast") ]]; then - PMON_TIMER_STATUS=$(systemctl is-active pmon.timer) - if [[ x"$PMON_TIMER_STATUS" = x"inactive" ]]; then - systemctl start pmon.timer - else - debug "PMON service is delayed by a timer for better fast/warm boot performance" - fi + PLATFORM=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' platform` + PMON_IMMEDIATE_START="/usr/share/sonic/device/$PLATFORM/pmon_immediate_start" + if [[ x"$BOOT_TYPE" = @(x"fast"|x"warm"|x"fastfast") ]] && [[ ! -f $PMON_IMMEDIATE_START ]]; then + debug "PMON service is delayed by for better fast/warm boot performance" else debug "Starting pmon service..." /bin/systemctl start pmon From a81b7dce185872eb552ef38e97dd98d4370c7fed Mon Sep 17 00:00:00 2001 From: anamehra <54692434+anamehra@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:25:15 -0700 Subject: [PATCH 245/282] [cisco]: Update cisco-8000.ini to 0.master.0.2 release (#19247) Signed-off-by: anamehra anamehra@cisco.com --- platform/checkout/cisco-8000.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/checkout/cisco-8000.ini b/platform/checkout/cisco-8000.ini index 709f576b1e2a..6c33ec6a895d 100644 --- a/platform/checkout/cisco-8000.ini +++ b/platform/checkout/cisco-8000.ini @@ -1,3 +1,3 @@ [module] repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git -ref=0.master.0.1 +ref=0.master.0.2 From 04bad023340c57154fb600ad204f1f8a7885e47b Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Fri, 7 Jun 2024 15:34:20 -0700 Subject: [PATCH 246/282] [database] Fix database config template for remote Redis instance (#19239) The local Redis daemon should not run for a remote database. How I did it Do not generate a supervisord configuration entry for the remote database instances. How to verify it Compile and run the DPU image. The database container on the DPU should run Redis daemons only for local DB instances. --- dockers/docker-database/database_config.json.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-database/database_config.json.j2 b/dockers/docker-database/database_config.json.j2 index b5c231a93f41..65db6cb72641 100644 --- a/dockers/docker-database/database_config.json.j2 +++ b/dockers/docker-database/database_config.json.j2 @@ -20,7 +20,7 @@ ,"remote_redis":{ "hostname" : "{{REMOTE_DB_IP}}", "port" : {{REMOTE_DB_PORT}}, - "unix_socket_path": "" + "unix_socket_path": "", "persistence_for_warm_boot" : "yes" } {% endif %} From c617e81608d7276feb11c17e94e2f5e6d42a5f02 Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Fri, 7 Jun 2024 15:36:08 -0700 Subject: [PATCH 247/282] [database] Do not run local a Redis instance for the remote database (#19238) The local Redis daemon should not run for a remote database. How I did it Do not generate a supervisord configuration entry for the remote database instances. How to verify it Compile and run the DPU image. The database container on the DPU should run Redis daemons only for local DB instances. --- dockers/docker-database/supervisord.conf.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dockers/docker-database/supervisord.conf.j2 b/dockers/docker-database/supervisord.conf.j2 index 62909aae3dd0..232b8ffcbfa7 100644 --- a/dockers/docker-database/supervisord.conf.j2 +++ b/dockers/docker-database/supervisord.conf.j2 @@ -30,6 +30,7 @@ dependent_startup=true {% if INSTANCES %} {% for redis_inst, redis_items in INSTANCES.items() %} +{%- if redis_inst != 'remote_redis' %} [program:{{ redis_inst }}] {% if redis_items['hostname'] != '127.0.0.1' %} {%- set ADDITIONAL_OPTS = '--protected-mode no' %} @@ -47,6 +48,7 @@ autostart=true autorestart=false stdout_logfile=syslog stderr_logfile=syslog +{%- endif -%} {% endfor %} {% endif %} From cd578ac9c2aa1e7d12cd3f7a0da7ba65c6d8e283 Mon Sep 17 00:00:00 2001 From: rick-arista <148895369+rick-arista@users.noreply.github.com> Date: Fri, 7 Jun 2024 19:02:44 -0700 Subject: [PATCH 248/282] [Arista]: Add QoS configurations for Quicksilver (#19161) These are likely not the optimal configurations but a first draft. Most of QuicksilverP and QuicksilverDD HwSku should be supported. Co-authored-by: Samuel Angebault --- .../Arista-7060X6-64DE-64x400G/BALANCED | 1 + .../buffers.json.j2 | 2 ++ .../buffers_defaults_t0.j2 | 1 + .../buffers_defaults_t1.j2 | 1 + .../pg_profile_lookup.ini | 1 + .../Arista-7060X6-64DE-64x400G/qos.json.j2 | 1 + .../Arista-7060X6-64DE/BALANCED | 1 + .../Arista-7060X6-64DE/buffers.json.j2 | 2 ++ .../Arista-7060X6-64DE/buffers_defaults_t0.j2 | 1 + .../Arista-7060X6-64DE/buffers_defaults_t1.j2 | 1 + .../Arista-7060X6-64DE/pg_profile_lookup.ini | 1 + .../Arista-7060X6-64DE/qos.json.j2 | 1 + .../Arista-7060X6-64PE-128x400G/BALANCED | 1 + .../buffer_ports.j2 | 6 ++++ .../buffers.json.j2 | 2 ++ .../buffers_defaults_t0.j2 | 1 + .../buffers_defaults_t1.j2 | 1 + .../pg_profile_lookup.ini | 1 + .../Arista-7060X6-64PE-128x400G/qos.json.j2 | 1 + .../Arista-7060X6-64PE-256x200G/BALANCED | 1 + .../buffer_ports.j2 | 6 ++++ .../buffers.json.j2 | 2 ++ .../buffers_defaults_t0.j2 | 1 + .../buffers_defaults_t1.j2 | 1 + .../pg_profile_lookup.ini | 1 + .../Arista-7060X6-64PE-256x200G/qos.json.j2 | 1 + .../Arista-7060X6-64PE-64x400G/BALANCED | 1 + .../buffer_ports.j2 | 6 ++++ .../buffers.json.j2 | 2 ++ .../buffers_defaults_t0.j2 | 1 + .../buffers_defaults_t1.j2 | 1 + .../pg_profile_lookup.ini | 1 + .../Arista-7060X6-64PE-64x400G/qos.json.j2 | 1 + .../Arista-7060X6-64PE/BALANCED | 1 + .../Arista-7060X6-64PE/buffer_ports.j2 | 6 ++++ .../Arista-7060X6-64PE/buffers.json.j2 | 2 ++ .../Arista-7060X6-64PE/buffers_defaults_t0.j2 | 1 + .../Arista-7060X6-64PE/buffers_defaults_t1.j2 | 1 + .../Arista-7060X6-64PE/pg_profile_lookup.ini | 1 + .../Arista-7060X6-64PE/qos.json.j2 | 1 + .../th5/gen/BALANCED/buffers_defaults_t0.j2 | 36 +++++++++++++++++++ .../th5/gen/BALANCED/buffers_defaults_t1.j2 | 36 +++++++++++++++++++ .../th5/gen/BALANCED/pg_profile_lookup.ini | 20 +++++++++++ 43 files changed, 158 insertions(+) create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/qos.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/qos.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffer_ports.j2 create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/qos.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffer_ports.j2 create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/qos.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffer_ports.j2 create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/qos.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/BALANCED create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffer_ports.j2 create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers.json.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t0.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t1.j2 create mode 120000 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/pg_profile_lookup.ini create mode 100644 device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/qos.json.j2 create mode 100644 device/common/profiles/th5/gen/BALANCED/buffers_defaults_t0.j2 create mode 100644 device/common/profiles/th5/gen/BALANCED/buffers_defaults_t1.j2 create mode 100644 device/common/profiles/th5/gen/BALANCED/pg_profile_lookup.ini diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/BALANCED b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE-64x400G/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/BALANCED b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64de/Arista-7060X6-64DE/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/BALANCED b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffer_ports.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffer_ports.j2 new file mode 100644 index 000000000000..725347049cf1 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffer_ports.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 512, 4) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-128x400G/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/BALANCED b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffer_ports.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffer_ports.j2 new file mode 100644 index 000000000000..55d8aacb3400 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffer_ports.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 512, 2) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-256x200G/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/BALANCED b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffer_ports.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffer_ports.j2 new file mode 100644 index 000000000000..6b6ae10e51c1 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffer_ports.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 512, 8) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE-64x400G/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/BALANCED b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/BALANCED new file mode 120000 index 000000000000..afd21766cc64 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th5/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffer_ports.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffer_ports.j2 new file mode 100644 index 000000000000..6b6ae10e51c1 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffer_ports.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 512, 8) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers.json.j2 new file mode 100644 index 000000000000..0b1cb2c541b6 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/qos.json.j2 b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/arista/x86_64-arista_7060x6_64pe/Arista-7060X6-64PE/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t0.j2 b/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..dc707599f70a --- /dev/null +++ b/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t0.j2 @@ -0,0 +1,36 @@ +{%- set default_cable = '5m' %} + +{%- include 'buffer_ports.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "type": "ingress", + "mode": "dynamic", + "size": "60000000", + "xoff": "22600000" + }, + "egress_lossless_pool": { + "type": "egress", + "mode": "static", + "size": "82600000" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool": "ingress_lossless_pool", + "size": "0", + "dynamic_th": "3" + }, + "egress_lossless_profile": { + "pool": "egress_lossless_pool", + "size": "0", + "static_th": "82600000" + }, + "egress_lossy_profile": { + "pool": "egress_lossless_pool", + "size": "0", + "dynamic_th": "3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t1.j2 b/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..dc707599f70a --- /dev/null +++ b/device/common/profiles/th5/gen/BALANCED/buffers_defaults_t1.j2 @@ -0,0 +1,36 @@ +{%- set default_cable = '5m' %} + +{%- include 'buffer_ports.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "type": "ingress", + "mode": "dynamic", + "size": "60000000", + "xoff": "22600000" + }, + "egress_lossless_pool": { + "type": "egress", + "mode": "static", + "size": "82600000" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool": "ingress_lossless_pool", + "size": "0", + "dynamic_th": "3" + }, + "egress_lossless_profile": { + "pool": "egress_lossless_pool", + "size": "0", + "static_th": "82600000" + }, + "egress_lossy_profile": { + "pool": "egress_lossless_pool", + "size": "0", + "dynamic_th": "3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th5/gen/BALANCED/pg_profile_lookup.ini b/device/common/profiles/th5/gen/BALANCED/pg_profile_lookup.ini new file mode 100644 index 000000000000..ec695eca62d0 --- /dev/null +++ b/device/common/profiles/th5/gen/BALANCED/pg_profile_lookup.ini @@ -0,0 +1,20 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 1248 2288 35776 0 2288 + 25000 5m 1248 2288 53248 0 2288 + 40000 5m 1248 2288 66560 0 2288 + 50000 5m 1248 2288 90272 0 2288 + 100000 5m 1248 2288 165568 0 2288 + 400000 5m 1248 2288 165568 0 2288 + 10000 40m 1248 2288 37024 0 2288 + 25000 40m 1248 2288 53248 0 2288 + 40000 40m 1248 2288 71552 0 2288 + 50000 40m 1248 2288 96096 0 2288 + 100000 40m 1248 2288 177632 0 2288 + 400000 40m 1248 2288 177632 0 2288 + 10000 300m 1248 2288 46176 0 2288 + 25000 300m 1248 2288 79040 0 2288 + 40000 300m 1248 2288 108160 0 2288 + 50000 300m 1248 2288 141856 0 2288 + 100000 300m 1248 2288 268736 0 2288 + 400000 300m 1248 2288 268736 0 2288 From ff77018ef5df3ac800070767e576d64d9e3d7374 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Fri, 7 Jun 2024 22:24:47 -0700 Subject: [PATCH 249/282] used parent script PID for logger calls (#19219) [arp_update]: Use parent script PID for logger calls Signed-off-by: Lawrence Lee --- files/scripts/arp_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/scripts/arp_update b/files/scripts/arp_update index 5b2b6989ee4b..73a454ea2acd 100755 --- a/files/scripts/arp_update +++ b/files/scripts/arp_update @@ -11,7 +11,7 @@ ARP_UPDATE_VARS_FILE="/usr/share/sonic/templates/arp_update_vars.j2" # Overload `logger` command to include arp_update tag logger () { - command logger -t "arp_update" "$@" + command logger -i "$$" -t "arp_update" "$@" } while /bin/true; do From 843ebf77b2fa624011886a95b157b423158a31cb Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 8 Jun 2024 19:04:58 +0800 Subject: [PATCH 250/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19250) #### Why I did it src/sonic-swss ``` * f497c4a0 - (HEAD -> master, origin/master, origin/HEAD) [muxorch] Fixing bug with updateRoute and mux neighbors (#3187) (3 hours ago) [Nikola Dancejic] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 8f333b692308..f497c4a0da2a 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 8f333b6923083d6c575a5a5db9aa448d9cb74abc +Subproject commit f497c4a0da2ac040e36dcf72433d5b20a93639fe From 797b183d6f229b577fbf338e3ffe180d92b54630 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 8 Jun 2024 19:05:02 +0800 Subject: [PATCH 251/282] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#19242) #### Why I did it src/sonic-sairedis ``` * 10483502 - (HEAD -> master, origin/master, origin/HEAD) [saiproxy] Implement all APIs except bulk (#1386) (30 hours ago) [Kamil Cudnik] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index c8cede0f405b..104835026159 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit c8cede0f405b6f6ee65fca48a8c5e4261e93fb04 +Subproject commit 104835026159093aca3438548dcb129dfd940441 From 8877bdfd10aa456d3e8762983f3304145d403439 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sun, 9 Jun 2024 16:10:31 +0800 Subject: [PATCH 252/282] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#19255) #### Why I did it src/sonic-utilities ``` * f96a1322 - (HEAD -> master, origin/master, origin/HEAD) [consutil] Fix consule CLI and enhance unittest (#3360) (7 minutes ago) [Zhijian Li] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 1ebd09938c5c..f96a132278fd 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 1ebd09938c5c95746a957d5f40009950d63a8ce1 +Subproject commit f96a132278fdc3545c3f6a609dc5a21149c49240 From f99ac6cd753527c3d8e6c1d226a8c64e3c91dc5e Mon Sep 17 00:00:00 2001 From: DavidZagury <32644413+DavidZagury@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:55:46 +0300 Subject: [PATCH 253/282] [Mellanox] Support SKU Mellanox-SN5600-V256 (#18926) - Why I did it Support Mellanox-SN5600-V256 - How I did it Add relevant files to support the new SKU - How to verify it Regression test --- .../Mellanox-SN5600-V256/buffers.json.j2 | 1 + .../buffers_defaults_objects.j2 | 1 + .../buffers_defaults_t0.j2 | 47 ++ .../buffers_defaults_t1.j2 | 47 ++ .../buffers_dynamic.json.j2 | 16 + .../create_only_config_db_buffers.json | 7 + .../Mellanox-SN5600-V256/hwsku.json | 775 ++++++++++++++++++ .../pg_profile_lookup.ini | 42 + .../Mellanox-SN5600-V256/port_config.ini | 275 +++++++ .../Mellanox-SN5600-V256/qos.json.j2 | 1 + .../Mellanox-SN5600-V256/sai.profile | 1 + .../sai_5600_256x200g.xml | 627 ++++++++++++++ 12 files changed, 1840 insertions(+) create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers.json.j2 create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_objects.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t0.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t1.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_dynamic.json.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/create_only_config_db_buffers.json create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/hwsku.json create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/pg_profile_lookup.ini create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/port_config.ini create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/qos.json.j2 create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai.profile create mode 100644 device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai_5600_256x200g.xml diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers.json.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers.json.j2 new file mode 120000 index 000000000000..add8bf8bb7c2 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/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-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_objects.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t0.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..70e701884eea --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t0.j2 @@ -0,0 +1,47 @@ +{# + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '300m' %} +{% set ingress_lossless_pool_size = '73684992' %} +{% set ingress_lossless_pool_xoff = '60293120' %} +{% set egress_lossless_pool_size = '158229504' %} +{% set egress_lossy_pool_size = '73684992' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports(port_names_active, port_names_extra_pgs, port_names_inactive) %} +{{ defs.generate_pg_profiles_with_extra_lossless_pgs(port_names_active, port_names_extra_pgs, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t1.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..70e701884eea --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_defaults_t1.j2 @@ -0,0 +1,47 @@ +{# + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '300m' %} +{% set ingress_lossless_pool_size = '73684992' %} +{% set ingress_lossless_pool_xoff = '60293120' %} +{% set egress_lossless_pool_size = '158229504' %} +{% set egress_lossy_pool_size = '73684992' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports(port_names_active, port_names_extra_pgs, port_names_inactive) %} +{{ defs.generate_pg_profiles_with_extra_lossless_pgs(port_names_active, port_names_extra_pgs, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_dynamic.json.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_dynamic.json.j2 new file mode 100644 index 000000000000..b2cc958b7c45 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/buffers_dynamic.json.j2 @@ -0,0 +1,16 @@ +{# + Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't0' %} +{%- set dynamic_mode = 'true' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/create_only_config_db_buffers.json b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/create_only_config_db_buffers.json new file mode 100644 index 000000000000..6feb156714fe --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/hwsku.json b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/hwsku.json new file mode 100644 index 000000000000..04211490cdf6 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/hwsku.json @@ -0,0 +1,775 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet2": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet4": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet6": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet8": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet10": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet12": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet14": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet16": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet18": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet20": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet22": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet24": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet26": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet28": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet30": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet32": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet34": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet36": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet38": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet40": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet42": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet44": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet46": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet48": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet50": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet52": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet54": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet56": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet58": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet60": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet62": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet64": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet66": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet68": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet70": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet72": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet74": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet76": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet78": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet80": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet82": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet84": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet86": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet88": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet90": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet92": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet94": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet96": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet98": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet100": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet102": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet104": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet106": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet108": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet110": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet112": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet114": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet116": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet118": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet120": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet122": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet124": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet126": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet128": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet130": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet132": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet134": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet136": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet138": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet140": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet142": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet144": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet146": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet148": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet150": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet152": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet154": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet156": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet158": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet160": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet162": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet164": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet166": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet168": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet170": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet172": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet174": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet176": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet178": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet180": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet182": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet184": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet186": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet188": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet190": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet192": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet194": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet196": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet198": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet200": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet202": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet204": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet206": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet208": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet210": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet212": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet214": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet216": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet218": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet220": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet222": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet224": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet226": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet228": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet230": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet232": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet234": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet236": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet238": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet240": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet242": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet244": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet246": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet248": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet250": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet252": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet254": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet256": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet258": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet260": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet262": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet264": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet266": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet268": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet270": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet272": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet274": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet276": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet278": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet280": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet282": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet284": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet286": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet288": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet290": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet292": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet294": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet296": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet298": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet300": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet302": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet304": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet306": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet308": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet310": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet312": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet314": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet316": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet318": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet320": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet322": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet324": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet326": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet328": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet330": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet332": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet334": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet336": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet338": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet340": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet342": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet344": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet346": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet348": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet350": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet352": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet354": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet356": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet358": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet360": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet362": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet364": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet366": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet368": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet370": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet372": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet374": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet376": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet378": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet380": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet382": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet384": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet386": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet388": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet390": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet392": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet394": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet396": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet398": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet400": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet402": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet404": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet406": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet408": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet410": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet412": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet414": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet416": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet418": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet420": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet422": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet424": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet426": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet428": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet430": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet432": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet434": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet436": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet438": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet440": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet442": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet444": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet446": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet448": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet450": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet452": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet454": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet456": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet458": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet460": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet462": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet464": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet466": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet468": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet470": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet472": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet474": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet476": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet478": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet480": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet482": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet484": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet486": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet488": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet490": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet492": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet494": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet496": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet498": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet500": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet502": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet504": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet506": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet508": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet510": { + "default_brkout_mode": "4x200G[100G,50G,25G,10G]" + }, + "Ethernet512": { + "default_brkout_mode": "1x25G[10G]" + } + } +} diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/pg_profile_lookup.ini b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/pg_profile_lookup.ini new file mode 100644 index 000000000000..c7d8a3b5ca01 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/pg_profile_lookup.ini @@ -0,0 +1,42 @@ +## +## Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## +# PG lossless profiles. +# speed cable size xon xoff threshold + 10000 5m 19456 19456 33792 0 + 25000 5m 19456 19456 35840 0 + 40000 5m 19456 19456 41984 0 + 50000 5m 19456 19456 46080 0 + 100000 5m 19456 19456 79872 0 + 200000 5m 19456 19456 91136 0 + 400000 5m 19456 19456 157696 0 + 800000 5m 38912 38912 175104 0 + 10000 40m 19456 19456 34816 0 + 25000 40m 19456 19456 37888 0 + 40000 40m 19456 19456 45056 0 + 50000 40m 19456 19456 50176 0 + 100000 40m 19456 19456 88064 0 + 200000 40m 19456 19456 108544 0 + 400000 40m 19456 19456 192512 0 + 800000 40m 38912 38912 245760 0 + 10000 300m 19456 19456 40960 0 + 25000 300m 19456 19456 54272 0 + 40000 300m 19456 19456 71680 0 + 50000 300m 19456 19456 82944 0 + 100000 300m 19456 19456 153600 0 + 200000 300m 19456 19456 240640 0 + 400000 300m 19456 19456 455680 0 + 800000 300m 38912 38912 771072 0 diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/port_config.ini b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/port_config.ini new file mode 100644 index 000000000000..a995d8ed29fe --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/port_config.ini @@ -0,0 +1,275 @@ +## +## Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +# name lanes alias index speed fec +Ethernet0 0,1 etp1a 1 200000 rs +Ethernet2 2,3 etp1b 1 200000 rs +Ethernet4 4,5 etp1c 1 200000 rs +Ethernet6 6,7 etp1d 1 200000 rs +Ethernet8 8,9 etp2a 2 200000 rs +Ethernet10 10,11 etp2b 2 200000 rs +Ethernet12 12,13 etp2c 2 200000 rs +Ethernet14 14,15 etp2d 2 200000 rs +Ethernet16 16,17 etp3a 3 200000 rs +Ethernet18 18,19 etp3b 3 200000 rs +Ethernet20 20,21 etp3c 3 200000 rs +Ethernet22 22,23 etp3d 3 200000 rs +Ethernet24 24,25 etp4a 4 200000 rs +Ethernet26 26,27 etp4b 4 200000 rs +Ethernet28 28,29 etp4c 4 200000 rs +Ethernet30 30,31 etp4d 4 200000 rs +Ethernet32 32,33 etp5a 5 200000 rs +Ethernet34 34,35 etp5b 5 200000 rs +Ethernet36 36,37 etp5c 5 200000 rs +Ethernet38 38,39 etp5d 5 200000 rs +Ethernet40 40,41 etp6a 6 200000 rs +Ethernet42 42,43 etp6b 6 200000 rs +Ethernet44 44,45 etp6c 6 200000 rs +Ethernet46 46,47 etp6d 6 200000 rs +Ethernet48 48,49 etp7a 7 200000 rs +Ethernet50 50,51 etp7b 7 200000 rs +Ethernet52 52,53 etp7c 7 200000 rs +Ethernet54 54,55 etp7d 7 200000 rs +Ethernet56 56,57 etp8a 8 200000 rs +Ethernet58 58,59 etp8b 8 200000 rs +Ethernet60 60,61 etp8c 8 200000 rs +Ethernet62 62,63 etp8d 8 200000 rs +Ethernet64 64,65 etp9a 9 200000 rs +Ethernet66 66,67 etp9b 9 200000 rs +Ethernet68 68,69 etp9c 9 200000 rs +Ethernet70 70,71 etp9d 9 200000 rs +Ethernet72 72,73 etp10a 10 200000 rs +Ethernet74 74,75 etp10b 10 200000 rs +Ethernet76 76,77 etp10c 10 200000 rs +Ethernet78 78,79 etp10d 10 200000 rs +Ethernet80 80,81 etp11a 11 200000 rs +Ethernet82 82,83 etp11b 11 200000 rs +Ethernet84 84,85 etp11c 11 200000 rs +Ethernet86 86,87 etp11d 11 200000 rs +Ethernet88 88,89 etp12a 12 200000 rs +Ethernet90 90,91 etp12b 12 200000 rs +Ethernet92 92,93 etp12c 12 200000 rs +Ethernet94 94,95 etp12d 12 200000 rs +Ethernet96 96,97 etp13a 13 200000 rs +Ethernet98 98,99 etp13b 13 200000 rs +Ethernet100 100,101 etp13c 13 200000 rs +Ethernet102 102,103 etp13d 13 200000 rs +Ethernet104 104,105 etp14a 14 200000 rs +Ethernet106 106,107 etp14b 14 200000 rs +Ethernet108 108,109 etp14c 14 200000 rs +Ethernet110 110,111 etp14d 14 200000 rs +Ethernet112 112,113 etp15a 15 200000 rs +Ethernet114 114,115 etp15b 15 200000 rs +Ethernet116 116,117 etp15c 15 200000 rs +Ethernet118 118,119 etp15d 15 200000 rs +Ethernet120 120,121 etp16a 16 200000 rs +Ethernet122 122,123 etp16b 16 200000 rs +Ethernet124 124,125 etp16c 16 200000 rs +Ethernet126 126,127 etp16d 16 200000 rs +Ethernet128 128,129 etp17a 17 200000 rs +Ethernet130 130,131 etp17b 17 200000 rs +Ethernet132 132,133 etp17c 17 200000 rs +Ethernet134 134,135 etp17d 17 200000 rs +Ethernet136 136,137 etp18a 18 200000 rs +Ethernet138 138,139 etp18b 18 200000 rs +Ethernet140 140,141 etp18c 18 200000 rs +Ethernet142 142,143 etp18d 18 200000 rs +Ethernet144 144,145 etp19a 19 200000 rs +Ethernet146 146,147 etp19b 19 200000 rs +Ethernet148 148,149 etp19c 19 200000 rs +Ethernet150 150,151 etp19d 19 200000 rs +Ethernet152 152,153 etp20a 20 200000 rs +Ethernet154 154,155 etp20b 20 200000 rs +Ethernet156 156,157 etp20c 20 200000 rs +Ethernet158 158,159 etp20d 20 200000 rs +Ethernet160 160,161 etp21a 21 200000 rs +Ethernet162 162,163 etp21b 21 200000 rs +Ethernet164 164,165 etp21c 21 200000 rs +Ethernet166 166,167 etp21d 21 200000 rs +Ethernet168 168,169 etp22a 22 200000 rs +Ethernet170 170,171 etp22b 22 200000 rs +Ethernet172 172,173 etp22c 22 200000 rs +Ethernet174 174,175 etp22d 22 200000 rs +Ethernet176 176,177 etp23a 23 200000 rs +Ethernet178 178,179 etp23b 23 200000 rs +Ethernet180 180,181 etp23c 23 200000 rs +Ethernet182 182,183 etp23d 23 200000 rs +Ethernet184 184,185 etp24a 24 200000 rs +Ethernet186 186,187 etp24b 24 200000 rs +Ethernet188 188,189 etp24c 24 200000 rs +Ethernet190 190,191 etp24d 24 200000 rs +Ethernet192 192,193 etp25a 25 200000 rs +Ethernet194 194,195 etp25b 25 200000 rs +Ethernet196 196,197 etp25c 25 200000 rs +Ethernet198 198,199 etp25d 25 200000 rs +Ethernet200 200,201 etp26a 26 200000 rs +Ethernet202 202,203 etp26b 26 200000 rs +Ethernet204 204,205 etp26c 26 200000 rs +Ethernet206 206,207 etp26d 26 200000 rs +Ethernet208 208,209 etp27a 27 200000 rs +Ethernet210 210,211 etp27b 27 200000 rs +Ethernet212 212,213 etp27c 27 200000 rs +Ethernet214 214,215 etp27d 27 200000 rs +Ethernet216 216,217 etp28a 28 200000 rs +Ethernet218 218,219 etp28b 28 200000 rs +Ethernet220 220,221 etp28c 28 200000 rs +Ethernet222 222,223 etp28d 28 200000 rs +Ethernet224 224,225 etp29a 29 200000 rs +Ethernet226 226,227 etp29b 29 200000 rs +Ethernet228 228,229 etp29c 29 200000 rs +Ethernet230 230,231 etp29d 29 200000 rs +Ethernet232 232,233 etp30a 30 200000 rs +Ethernet234 234,235 etp30b 30 200000 rs +Ethernet236 236,237 etp30c 30 200000 rs +Ethernet238 238,239 etp30d 30 200000 rs +Ethernet240 240,241 etp31a 31 200000 rs +Ethernet242 242,243 etp31b 31 200000 rs +Ethernet244 244,245 etp31c 31 200000 rs +Ethernet246 246,247 etp31d 31 200000 rs +Ethernet248 248,249 etp32a 32 200000 rs +Ethernet250 250,251 etp32b 32 200000 rs +Ethernet252 252,253 etp32c 32 200000 rs +Ethernet254 254,255 etp32d 32 200000 rs +Ethernet256 256,257 etp33a 33 200000 rs +Ethernet258 258,259 etp33b 33 200000 rs +Ethernet260 260,261 etp33c 33 200000 rs +Ethernet262 262,263 etp33d 33 200000 rs +Ethernet264 264,265 etp34a 34 200000 rs +Ethernet266 266,267 etp34b 34 200000 rs +Ethernet268 268,269 etp34c 34 200000 rs +Ethernet270 270,271 etp34d 34 200000 rs +Ethernet272 272,273 etp35a 35 200000 rs +Ethernet274 274,275 etp35b 35 200000 rs +Ethernet276 276,277 etp35c 35 200000 rs +Ethernet278 278,279 etp35d 35 200000 rs +Ethernet280 280,281 etp36a 36 200000 rs +Ethernet282 282,283 etp36b 36 200000 rs +Ethernet284 284,285 etp36c 36 200000 rs +Ethernet286 286,287 etp36d 36 200000 rs +Ethernet288 288,289 etp37a 37 200000 rs +Ethernet290 290,291 etp37b 37 200000 rs +Ethernet292 292,293 etp37c 37 200000 rs +Ethernet294 294,295 etp37d 37 200000 rs +Ethernet296 296,297 etp38a 38 200000 rs +Ethernet298 298,299 etp38b 38 200000 rs +Ethernet300 300,301 etp38c 38 200000 rs +Ethernet302 302,303 etp38d 38 200000 rs +Ethernet304 304,305 etp39a 39 200000 rs +Ethernet306 306,307 etp39b 39 200000 rs +Ethernet308 308,309 etp39c 39 200000 rs +Ethernet310 310,311 etp39d 39 200000 rs +Ethernet312 312,313 etp40a 40 200000 rs +Ethernet314 314,315 etp40b 40 200000 rs +Ethernet316 316,317 etp40c 40 200000 rs +Ethernet318 318,319 etp40d 40 200000 rs +Ethernet320 320,321 etp41a 41 200000 rs +Ethernet322 322,323 etp41b 41 200000 rs +Ethernet324 324,325 etp41c 41 200000 rs +Ethernet326 326,327 etp41d 41 200000 rs +Ethernet328 328,329 etp42a 42 200000 rs +Ethernet330 330,331 etp42b 42 200000 rs +Ethernet332 332,333 etp42c 42 200000 rs +Ethernet334 334,335 etp42d 42 200000 rs +Ethernet336 336,337 etp43a 43 200000 rs +Ethernet338 338,339 etp43b 43 200000 rs +Ethernet340 340,341 etp43c 43 200000 rs +Ethernet342 342,343 etp43d 43 200000 rs +Ethernet344 344,345 etp44a 44 200000 rs +Ethernet346 346,347 etp44b 44 200000 rs +Ethernet348 348,349 etp44c 44 200000 rs +Ethernet350 350,351 etp44d 44 200000 rs +Ethernet352 352,353 etp45a 45 200000 rs +Ethernet354 354,355 etp45b 45 200000 rs +Ethernet356 356,357 etp45c 45 200000 rs +Ethernet358 358,359 etp45d 45 200000 rs +Ethernet360 360,361 etp46a 46 200000 rs +Ethernet362 362,363 etp46b 46 200000 rs +Ethernet364 364,365 etp46c 46 200000 rs +Ethernet366 366,367 etp46d 46 200000 rs +Ethernet368 368,369 etp47a 47 200000 rs +Ethernet370 370,371 etp47b 47 200000 rs +Ethernet372 372,373 etp47c 47 200000 rs +Ethernet374 374,375 etp47d 47 200000 rs +Ethernet376 376,377 etp48a 48 200000 rs +Ethernet378 378,379 etp48b 48 200000 rs +Ethernet380 380,381 etp48c 48 200000 rs +Ethernet382 382,383 etp48d 48 200000 rs +Ethernet384 384,385 etp49a 49 200000 rs +Ethernet386 386,387 etp49b 49 200000 rs +Ethernet388 388,389 etp49c 49 200000 rs +Ethernet390 390,391 etp49d 49 200000 rs +Ethernet392 392,393 etp50a 50 200000 rs +Ethernet394 394,395 etp50b 50 200000 rs +Ethernet396 396,397 etp50c 50 200000 rs +Ethernet398 398,399 etp50d 50 200000 rs +Ethernet400 400,401 etp51a 51 200000 rs +Ethernet402 402,403 etp51b 51 200000 rs +Ethernet404 404,405 etp51c 51 200000 rs +Ethernet406 406,407 etp51d 51 200000 rs +Ethernet408 408,409 etp52a 52 200000 rs +Ethernet410 410,411 etp52b 52 200000 rs +Ethernet412 412,413 etp52c 52 200000 rs +Ethernet414 414,415 etp52d 52 200000 rs +Ethernet416 416,417 etp53a 53 200000 rs +Ethernet418 418,419 etp53b 53 200000 rs +Ethernet420 420,421 etp53c 53 200000 rs +Ethernet422 422,423 etp53d 53 200000 rs +Ethernet424 424,425 etp54a 54 200000 rs +Ethernet426 426,427 etp54b 54 200000 rs +Ethernet428 428,429 etp54c 54 200000 rs +Ethernet430 430,431 etp54d 54 200000 rs +Ethernet432 432,433 etp55a 55 200000 rs +Ethernet434 434,435 etp55b 55 200000 rs +Ethernet436 436,437 etp55c 55 200000 rs +Ethernet438 438,439 etp55d 55 200000 rs +Ethernet440 440,441 etp56a 56 200000 rs +Ethernet442 442,443 etp56b 56 200000 rs +Ethernet444 444,445 etp56c 56 200000 rs +Ethernet446 446,447 etp56d 56 200000 rs +Ethernet448 448,449 etp57a 57 200000 rs +Ethernet450 450,451 etp57b 57 200000 rs +Ethernet452 452,453 etp57c 57 200000 rs +Ethernet454 454,455 etp57d 57 200000 rs +Ethernet456 456,457 etp58a 58 200000 rs +Ethernet458 458,459 etp58b 58 200000 rs +Ethernet460 460,461 etp58c 58 200000 rs +Ethernet462 462,463 etp58d 58 200000 rs +Ethernet464 464,465 etp59a 59 200000 rs +Ethernet466 466,467 etp59b 59 200000 rs +Ethernet468 468,469 etp59c 59 200000 rs +Ethernet470 470,471 etp59d 59 200000 rs +Ethernet472 472,473 etp60a 60 200000 rs +Ethernet474 474,475 etp60b 60 200000 rs +Ethernet476 476,477 etp60c 60 200000 rs +Ethernet478 478,479 etp60d 60 200000 rs +Ethernet480 480,481 etp61a 61 200000 rs +Ethernet482 482,483 etp61b 61 200000 rs +Ethernet484 484,485 etp61c 61 200000 rs +Ethernet486 486,487 etp61d 61 200000 rs +Ethernet488 488,489 etp62a 62 200000 rs +Ethernet490 490,491 etp62b 62 200000 rs +Ethernet492 492,493 etp62c 62 200000 rs +Ethernet494 494,495 etp62d 62 200000 rs +Ethernet496 496,497 etp63a 63 200000 rs +Ethernet498 498,499 etp63b 63 200000 rs +Ethernet500 500,501 etp63c 63 200000 rs +Ethernet502 502,503 etp63d 63 200000 rs +Ethernet504 504,505 etp64a 64 200000 rs +Ethernet506 506,507 etp64b 64 200000 rs +Ethernet508 508,509 etp64c 64 200000 rs +Ethernet510 510,511 etp64d 64 200000 rs +Ethernet512 512 etp65 65 25000 rs diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/qos.json.j2 b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/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-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai.profile b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai.profile new file mode 100644 index 000000000000..0d93ea989b31 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5600_256x200g.xml diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai_5600_256x200g.xml b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai_5600_256x200g.xml new file mode 100644 index 000000000000..89518aa8cfca --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-V256/sai_5600_256x200g.xml @@ -0,0 +1,627 @@ + + + + + + + 00:02:03:04:05:00 + + + 0 + + + 65 + + + + + 1 + 8 + 34 + 3 + 4096 + 4 + true + + + 5 + 8 + 35 + 3 + 4096 + 4 + true + + + 9 + 8 + 33 + 3 + 4096 + 4 + true + + + 13 + 8 + 32 + 3 + 4096 + 4 + true + + + 17 + 8 + 38 + 3 + 4096 + 4 + true + + + 21 + 8 + 39 + 3 + 4096 + 4 + true + + + 25 + 8 + 37 + 3 + 4096 + 4 + true + + + 29 + 8 + 36 + 3 + 4096 + 4 + true + + + 33 + 8 + 42 + 3 + 4096 + 4 + true + + + 37 + 8 + 43 + 3 + 4096 + 4 + true + + + 41 + 8 + 41 + 3 + 4096 + 4 + true + + + 45 + 8 + 40 + 3 + 4096 + 4 + true + + + 49 + 8 + 46 + 3 + 4096 + 4 + true + + + 53 + 8 + 47 + 3 + 4096 + 4 + true + + + 57 + 8 + 45 + 3 + 4096 + 4 + true + + + 61 + 8 + 44 + 3 + 4096 + 4 + true + + + 65 + 8 + 51 + 3 + 4096 + 4 + true + + + 69 + 8 + 50 + 3 + 4096 + 4 + true + + + 73 + 8 + 48 + 3 + 4096 + 4 + true + + + 77 + 8 + 49 + 3 + 4096 + 4 + true + + + 81 + 8 + 55 + 3 + 4096 + 4 + true + + + 85 + 8 + 54 + 3 + 4096 + 4 + true + + + 89 + 8 + 52 + 3 + 4096 + 4 + true + + + 93 + 8 + 53 + 3 + 4096 + 4 + true + + + 97 + 8 + 59 + 3 + 4096 + 4 + true + + + 101 + 8 + 58 + 3 + 4096 + 4 + true + + + 105 + 8 + 56 + + + 3 + + + 4096 + 4 + true + + + 109 + 8 + 57 + 3 + 4096 + 4 + true + + + 113 + 8 + 63 + 3 + 4096 + 4 + true + + + 117 + 8 + 62 + 3 + 4096 + 4 + true + + + 121 + 8 + 60 + 3 + 4096 + 4 + true + + + 125 + 8 + 61 + 3 + 4096 + 4 + true + + + 129 + 8 + 29 + 3 + 4096 + 4 + true + + + 133 + 8 + 28 + 3 + 4096 + 4 + true + + + 137 + 8 + 30 + 3 + 4096 + 4 + true + + + 141 + 8 + 31 + 3 + 4096 + 4 + true + + + 145 + 8 + 25 + 3 + 4096 + 4 + true + + + 149 + 8 + 24 + 3 + 4096 + 4 + true + + + 153 + 8 + 26 + 3 + 4096 + 4 + true + + + 157 + 8 + 27 + 3 + 4096 + 4 + true + + + 161 + 8 + 21 + 3 + 4096 + 4 + true + + + 165 + 8 + 20 + 3 + 4096 + 4 + true + + + 169 + 8 + 22 + 3 + 4096 + 4 + true + + + 173 + 8 + 23 + 3 + 4096 + 4 + true + + + 177 + 8 + 17 + 3 + 4096 + 4 + true + + + 181 + 8 + 16 + 3 + 4096 + 4 + true + + + 185 + 8 + 18 + 3 + 4096 + 4 + true + + + 189 + 8 + 19 + 3 + 4096 + 4 + true + + + 193 + 8 + 12 + 3 + 4096 + 4 + true + + + 197 + 8 + 13 + 3 + 4096 + 4 + true + + + 201 + 8 + 15 + 3 + 4096 + 4 + true + + + 205 + 8 + 14 + 3 + 4096 + 4 + true + + + 209 + 8 + 8 + 3 + 4096 + 4 + true + + + 213 + 8 + 9 + 3 + 4096 + 4 + true + + + 217 + 8 + 11 + 3 + 4096 + 4 + true + + + 221 + 8 + 10 + 3 + 4096 + 4 + true + + + 225 + 8 + 4 + 3 + 4096 + 4 + true + + + 229 + 8 + 5 + 3 + 4096 + 4 + true + + + 233 + 8 + 7 + + + 3 + + + 4096 + 4 + true + + + 237 + 8 + 6 + 3 + 4096 + 4 + true + + + 241 + 8 + 0 + 3 + 4096 + 4 + true + + + 245 + 8 + 1 + 3 + 4096 + 4 + true + + + 249 + 8 + 3 + 3 + 4096 + 4 + true + + + 253 + 8 + 2 + 3 + 4096 + 4 + true + + + 257 + 1 + 64 + 0 + 64 + true + + + + + From c1b6154428e86c0c685bb3fc46b22bdd35ee4416 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Mon, 10 Jun 2024 03:58:07 -0700 Subject: [PATCH 254/282] [Mellanox] Updating SAI version to SAIBuild2405.28.0.33 (#19244) --- platform/mellanox/mlnx-sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index 8eae89f3a7ef..6e184f670328 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,6 +1,6 @@ # Mellanox SAI -MLNX_SAI_VERSION = SAIBuild2405.28.0.30 +MLNX_SAI_VERSION = SAIBuild2405.28.0.33 MLNX_SAI_ASSETS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins MLNX_SAI_ASSETS_RELEASE_TAG = sai-$(MLNX_SAI_VERSION)-$(BLDENV)-$(CONFIGURED_ARCH) MLNX_SAI_ASSETS_URL = $(MLNX_SAI_ASSETS_GITHUB_URL)/releases/download/$(MLNX_SAI_ASSETS_RELEASE_TAG) From 39658593cf399f6f19be98eae141df38d8512be8 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Mon, 10 Jun 2024 14:00:02 +0300 Subject: [PATCH 255/282] [Mellanox] Improve FW upgrade: add locking mechanism. (#18925) User implications: On cold/warm/fast reboot if there is a syncd service start ongoing, the target procedure will stay blocked until the original call is done. This may delay the action in time. - Why I did it Improve the upgrade fw script avoiding errors in the logs when cold reboot is executed during service restart Work item tracking - How I did it Added locking mechanism for Mellanox FW upgrade - How to verify it Run cold reboot after DUT first install Signed-off-by: Nazarii Hnydyn --- platform/mellanox/mlnx-fw-upgrade.j2 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/platform/mellanox/mlnx-fw-upgrade.j2 b/platform/mellanox/mlnx-fw-upgrade.j2 index eb288624982c..e4c567c1b76e 100755 --- a/platform/mellanox/mlnx-fw-upgrade.j2 +++ b/platform/mellanox/mlnx-fw-upgrade.j2 @@ -20,6 +20,8 @@ declare -r SCRIPT_NAME="$(basename "$0")" declare -r SCRIPT_PATH="$(readlink -f "$0")" declare -r SCRIPT_DIR="$(dirname "$SCRIPT_PATH")" +declare -r LOCKFILE="/tmp/mlxfwmanager-lock" + declare -r YES_PARAM="yes" declare -r NO_PARAM="no" @@ -163,6 +165,20 @@ function ExitSuccess() { exit "${EXIT_SUCCESS}" } +function LockStateChange() { + LogInfo "Locking ${LOCKFILE} from ${SCRIPT_NAME}" + + exec {LOCKFD}>${LOCKFILE} + /usr/bin/flock -x ${LOCKFD} + + LogInfo "Locked ${LOCKFILE} (${LOCKFD}) from ${SCRIPT_NAME}" +} + +function UnlockStateChange() { + LogInfo "Unlocking ${LOCKFILE} (${LOCKFD}) from ${SCRIPT_NAME}" + /usr/bin/flock -u ${LOCKFD} +} + function WaitForDevice() { local -i QUERY_RETRY_COUNT_MAX="10" local -i QUERY_RETRY_COUNT="0" @@ -372,10 +388,20 @@ function ExitIfQEMU() { fi } +function Cleanup() { + if [[ -n "${LOCKFD}" ]]; then + UnlockStateChange + fi +} + +trap Cleanup EXIT + ParseArguments "$@" ExitIfQEMU +LockStateChange + WaitForDevice if [ "${IMAGE_UPGRADE}" != "${YES_PARAM}" ]; then From 792aa2368df9d77ae131475dd4a072e915f34295 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:01:02 +0800 Subject: [PATCH 256/282] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#19260) #### Why I did it src/sonic-sairedis ``` * 1f2c861a - (HEAD -> master, origin/master, origin/HEAD) Update SAI submodule to latest master (#1388) (18 hours ago) [Kamil Cudnik] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 104835026159..1f2c861aafe7 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 104835026159093aca3438548dcb129dfd940441 +Subproject commit 1f2c861aafe751e62ad8510419a4da7c795f4bb5 From a9bd05c4f7105ef57cd546b160587bd8e6935c11 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:01:06 +0800 Subject: [PATCH 257/282] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#19241) #### Why I did it src/sonic-linux-kernel ``` * 93b8fe9 - (HEAD -> master, origin/master, origin/HEAD) [Mellanox] Integrate HW-MGMT 7.0030.4003 Changes (#396) (3 days ago) [Vivek] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index f9bfb90cefbd..93b8fe9a9f65 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit f9bfb90cefbd00e0a485a0ce4f7bd60134f3eabf +Subproject commit 93b8fe9a9f657eae2438c94b9625d2ae34274eb1 From b386af662c42bcfece3ea3d2fbcd697f0c3d5d88 Mon Sep 17 00:00:00 2001 From: Vivek Date: Mon, 10 Jun 2024 09:34:33 -0700 Subject: [PATCH 258/282] [Mellanox] Integrate HW-MGMT 7.0030.4003 Changes (#19184) - Why I did it Integrate HW-MGMT 7.0030.4003 Changes Requires sonic-net/sonic-linux-kernel#396 - How I did it Run make integrate-mlnx-hw-mgmt - How to verify it Build an image and run tests from "sonic-mgmt". --- platform/mellanox/hw-management.mk | 2 +- platform/mellanox/hw-management/hw-mgmt | 2 +- .../non-upstream-patches/external-changes.patch | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index e2de01b04b93..9664435a146d 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -16,7 +16,7 @@ # # Mellanox HW Management -MLNX_HW_MANAGEMENT_VERSION = 7.0030.3008 +MLNX_HW_MANAGEMENT_VERSION = 7.0030.4003 export MLNX_HW_MANAGEMENT_VERSION diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index 82a14a789e87..6cf13ac6000a 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit 82a14a789e8755cfe7be863833d41817a9b07ad9 +Subproject commit 6cf13ac6000ad7be68ef9b6b25261bbb0fd5d5a5 diff --git a/platform/mellanox/non-upstream-patches/external-changes.patch b/platform/mellanox/non-upstream-patches/external-changes.patch index 8b137891791f..ffc749cfc05a 100644 --- a/platform/mellanox/non-upstream-patches/external-changes.patch +++ b/platform/mellanox/non-upstream-patches/external-changes.patch @@ -1 +1,13 @@ +--- a/patch/kconfig-inclusions ++++ b/patch/kconfig-inclusions +@@ -117,6 +117,9 @@ + CONFIG_PINCTRL_AMD=y + CONFIG_EDAC_AMD64=m + CONFIG_AMD_XGBE_DCB=y ++CONFIG_USB_NET_DRIVERS=m ++CONFIG_USB_USBNET=m ++CONFIG_USB_NET_CDCETHER=m + ###-> mellanox_amd64-end + # For Cisco 8000 + CONFIG_PHYLIB=m From c57ac6894d4b22c0a34b965b06d4ec2c3dbb8aeb Mon Sep 17 00:00:00 2001 From: Yuanzhe <150663541+yuazhe@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:13:49 +0800 Subject: [PATCH 259/282] [Mellanox]PSU sensors dynamic configuration (#18528) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Why I did it Previously, the PSU sensor configuration inside sensors.conf is hardcoded for each platform, allowing no flexibility for other PSU combination possibilities. However, there exists a scenario that user has a second source of PSU which has different sensors compared to the original sensors.conf. Thereby it requires the system to have the ability to dynamically detect the PSU model in using and load relevant sensor’s configuration file. - How I did it This PR involves a new script and a corresponding data file which contains all PSU model’s sensor configuration info. The script reads the hardware PSU information through hw-management and determines its model. Based on that, it searches for the corresponding pre-defined PSU sensor data, integrate them into the sensors.conf, and let PMON copy it for further loading by lm-sensor. It also integrates the script inside the platform's get_model() API. Therefore, each time this API is called by the psud code, it checks whether there has been a change in the PSU model. If a change is detected, it updates the PSU sensors configuration by calling the script. - How to verify it use sensors command and check the psu section is rightly labeled. Signed-off-by: Yuanzhe, Liu --- .../x86_64-mlnx_msn2010-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn2010-r0/sensors.conf | 2 + .../x86_64-mlnx_msn2100-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn2100-r0/sensors.conf | 2 + .../x86_64-mlnx_msn2410-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn2410-r0/sensors.conf | 2 + .../x86_64-mlnx_msn2700-r0/psu_sensors.json | 418 ++++++++++++++++++ .../psu_sensors_conf_updater | 81 ++++ .../x86_64-mlnx_msn2700-r0/sensors.conf | 2 + .../x86_64-mlnx_msn2700a1-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn2700a1-r0/sensors.conf | 2 + .../x86_64-mlnx_msn2740-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn2740-r0/sensors.conf | 2 + .../x86_64-mlnx_msn3420-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn3420-r0/sensors.conf | 2 + .../x86_64-mlnx_msn3700-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn3700-r0/sensors.conf | 2 + .../sensors_respin.conf | 2 + .../sensors_swb_respin.conf | 2 + .../x86_64-mlnx_msn3700c-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn3700c-r0/sensors.conf | 2 + .../sensors_respin.conf | 2 + .../sensors_swb_respin.conf | 2 + .../x86_64-mlnx_msn3800-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn3800-r0/sensors.conf | 2 + .../x86_64-mlnx_msn4410-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn4600-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn4600-r0/sensors.conf | 2 + .../x86_64-mlnx_msn4600c-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn4600c-r0/sensors.conf | 2 + .../x86_64-mlnx_msn4600c-r0/sensors.conf.a1 | 2 + .../sensors_respin.conf | 2 + .../sensors_respin.conf.a1 | 2 + .../x86_64-mlnx_msn4700-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-mlnx_msn4700-r0/sensors.conf | 2 + .../x86_64-mlnx_msn4700-r0/sensors.conf.a1 | 2 + .../x86_64-nvidia_sn2201-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-nvidia_sn2201-r0/sensors.conf | 2 + .../x86_64-nvidia_sn4800-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-nvidia_sn4800-r0/sensors.conf | 2 + .../x86_64-nvidia_sn5400-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-nvidia_sn5400-r0/sensors.conf | 2 + .../x86_64-nvidia_sn5600-r0/psu_sensors.json | 1 + .../psu_sensors_conf_updater | 1 + .../x86_64-nvidia_sn5600-r0/sensors.conf | 2 + .../docker-platform-monitor/docker_init.j2 | 8 + .../mlnx-platform-api/sonic_platform/psu.py | 13 +- 63 files changed, 603 insertions(+), 1 deletion(-) create mode 120000 device/mellanox/x86_64-mlnx_msn2010-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn2010-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn2100-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn2100-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn2410-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn2410-r0/psu_sensors_conf_updater create mode 100644 device/mellanox/x86_64-mlnx_msn2700-r0/psu_sensors.json create mode 100644 device/mellanox/x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn2700a1-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn2700a1-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn2740-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn2740-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn3420-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn3420-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn3700-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn3700c-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn3800-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn3800-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn4410-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn4410-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn4600-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn4600-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn4600c-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn4600c-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-mlnx_msn4700-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-mlnx_msn4700-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-nvidia_sn2201-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-nvidia_sn2201-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-nvidia_sn4800-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-nvidia_sn4800-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-nvidia_sn5400-r0/psu_sensors_conf_updater create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/psu_sensors.json create mode 120000 device/mellanox/x86_64-nvidia_sn5600-r0/psu_sensors_conf_updater diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn2010-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn2010-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf index 92d742c18453..d3a0ab69b683 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN2010 ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn2100-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn2100-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2100-r0/sensors.conf index 22b8e4dd8c7d..bccc08540815 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN2100 ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn2410-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn2410-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2410-r0/sensors.conf index fa446832fef1..47ed0e33b4ff 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN2410 ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn2700-r0/psu_sensors.json new file mode 100644 index 000000000000..983325f1e733 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/psu_sensors.json @@ -0,0 +1,418 @@ +{ + "platform": { + "MSN2410": { + "default": { + "bus": [ + "i2c-10", + "i2c-1-mux (chan_id 10)" + ], + "chip": { + "dps460-i2c-*-58": ["2", "R"], + "dps460-i2c-*-59": ["1", "L"] + } + } + }, + "MSN2700": { + "default": { + "bus": [ + "i2c-10", + "i2c-1-mux (chan_id 10)" + ], + "chip": { + "dps460-i2c-*-58": ["2", "R"], + "dps460-i2c-*-59": ["1", "L"] + } + } + }, + "MSN2700-A1": { + "default": { + "bus": [], + "chip": { + "dps460-i2c-*-58": ["2", "R"], + "dps460-i2c-*-59": ["1", "L"] + } + } + }, + "MSN2740": { + "default": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["2", "R"], + "dps460-i2c-*-59": ["1", "L"] + } + } + }, + "MSN3420": { + "default": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["2"], + "dps460-i2c-*-59": ["1"] + } + } + }, + "MSN3700": { + "default": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["2"], + "dps460-i2c-*-59": ["1"] + } + }, + "respin": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["1"], + "dps460-i2c-*-59": ["2"] + } + }, + "swb_respin": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["1"], + "dps460-i2c-*-59": ["2"] + } + } + }, + "MSN3700C": { + "default": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["2"], + "dps460-i2c-*-59": ["1"] + } + }, + "respin": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["1"], + "dps460-i2c-*-59": ["2"] + } + }, + "swb_respin": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["1"], + "dps460-i2c-*-59": ["2"] + } + } + }, + "MSN3800": { + "default": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["2"], + "dps460-i2c-*-59": ["1"] + } + } + }, + "MSN4410": { + "default": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["1", "L"], + "dps460-i2c-*-59": ["2", "R"] + } + }, + "a1": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["1", "L"], + "dps460-i2c-*-59": ["2", "R"] + } + } + }, + "MSN4600": { + "default": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["2", "R"], + "dps460-i2c-*-59": ["1", "L"] + } + } + }, + "MSN4600C": { + "default": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["2", "R"], + "dps460-i2c-*-59": ["1", "L"] + } + }, + "a1": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["1", "L"], + "dps460-i2c-*-59": ["2", "R"] + } + }, + "respin": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["2", "R"], + "dps460-i2c-*-59": ["1", "L"] + } + }, + "respin_a1": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["1", "L"], + "dps460-i2c-*-59": ["2", "R"] + } + } + }, + "MSN4700": { + "default": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["1", "L"], + "dps460-i2c-*-59": ["2", "R"] + } + }, + "a1": { + "bus": [ + "i2c-4", + "i2c-1-mux (chan_id 3)" + ], + "chip": { + "dps460-i2c-*-58": ["1", "L"], + "dps460-i2c-*-59": ["2", "R"] + } + } + }, + "SN2201": { + "default": { + "bus": [ + "i2c-3", + "i2c-1-mux (chan_id 1)" + ], + "chip": { + "pmbus-i2c-3-58": ["1"], + "pmbus-i2c-4-58": ["2"] + } + } + }, + "SN5400": { + "default": { + "bus": [ + + ], + "chip": { + "dps460-i2c-*-59": ["1", "L"], + "dps460-i2c-*-5a": ["2", "R"] + } + } + }, + "SN5600": { + "default": { + "bus": [ + + ], + "chip": { + "dps460-i2c-*-59": ["1", "L"], + "dps460-i2c-*-5a": ["2", "R"] + } + } + } + }, + + "psu": { + "MTEF-AC-A": { + "label": [ + "in1 PSU 220V Rail (in)", + "in2 PSU 12V Rail (out)", + "fan1 PSU Fan 1", + "temp1 PSU Temp 1", + "temp2 PSU Temp 2", + "power1 PSU 220V Rail Pwr (in)", + "power2 PSU 12V Rail Pwr (out)", + "curr1 PSU 220V Rail Curr (in)", + "curr2 PSU 12V Rail Curr (out)" + ] + }, + "MTEF-AC-C": { + "label": [ + "in1 PSU 220V Rail (in)", + "in3 PSU 12V Rail (out)", + "fan1 PSU Fan 1", + "temp1 PSU Temp 1", + "temp2 PSU Temp 2", + "temp3 PSU Temp 3", + "power1 PSU 220V Rail Pwr (in)", + "power2 PSU 12V Rail Pwr (out)", + "curr1 PSU 220V Rail Curr (in)", + "curr2 PSU 12V Rail Curr (out)" + ], + "ignore": [ + "in2", + "fan2", + "fan3" + ], + "set": [ + "in3_lcrit in3_crit * 0.662", + "in3_min in3_crit * 0.745", + "in3_max in3_crit * 0.952" + ] + }, + "MTEF-AC-C-SS1": { + "label": [ + "in1 PSU 220V Rail (in)", + "in3 PSU 12V Rail (out)", + "fan1 PSU Fan 1", + "temp1 PSU Temp 1", + "temp2 PSU Temp 2", + "temp3 PSU Temp 3", + "power1 PSU 220V Rail Pwr (in)", + "power2 PSU 12V Rail Pwr (out)", + "curr1 PSU 220V Rail Curr (in)", + "curr2 PSU 12V Rail Curr (out)" + ], + "ignore": [ + "in2", + "fan2", + "fan3" + ], + "set": [ + "in3_lcrit in3_crit * 0.662", + "in3_min in3_crit * 0.745", + "in3_max in3_crit * 0.952" + ] + }, + "MTEF-AC-E": { + "label": [ + "in1 PSU 220V Rail (in)", + "in3 PSU 12V Rail (out)", + "fan1 PSU Fan 1", + "temp1 PSU Temp 1", + "temp2 PSU Temp 2", + "temp3 PSU Temp 3", + "power1 PSU 220V Rail Pwr (in)", + "power2 PSU 12V Rail Pwr (out)", + "curr1 PSU 220V Rail Curr (in)", + "curr2 PSU 12V Rail Curr (out)" + ] + }, + "MTEF-AC-F": { + "label": [ + "in1 PSU 220V Rail (in)", + "in3 PSU 12V Rail (out)", + "fan1 PSU Fan 1", + "temp1 PSU Temp 1", + "temp2 PSU Temp 2", + "temp3 PSU Temp 3", + "power1 PSU 220V Rail Pwr (in)", + "power2 PSU 12V Rail Pwr (out)", + "curr1 PSU 220V Rail Curr (in)", + "curr2 PSU 12V Rail Curr (out)" + ], + "ignore": [ + "in2" + ] + }, + "MTEF-AC-G-ACBEL": { + "label": [ + "in1 PSU 220V Rail (in)", + "in3 PSU 12V Rail (out)", + "fan1 PSU Fan 1", + "temp1 PSU Temp 1", + "temp2 PSU Temp 2", + "power1 PSU 220V Rail Pwr (in)", + "power2 PSU 12V Rail Pwr (out)", + "curr1 PSU 220V Rail Curr (in)", + "curr2 PSU 12V Rail Curr (out)" + ] + }, + "MTEF-AC-I": { + + }, + "MTEF-AC-M": { + "label": [ + "in1 PSU 220V Rail(in)", + "in2 PSU 12V Rail(out)", + "fan1 PSU Fan1", + "temp1 PSU Temp1", + "temp2 PSU Temp2", + "temp3 PSU Temp3", + "curr1 PSU 220V Rail Curr(in)", + "curr2 PSU 12V Rail Curr(out)", + "power1 PSU 220V Rail Pwr(in)", + "power2 PSU 12V Rail Pwr(out)" + ], + "ignore": [ + "in3", + "curr3", + "power3" + ] + }, + "930-9SPSU-00RA-00B" :{ + "label": [ + "in1 PSU 220V Rail (in)", + "in3 PSU 12V Rail (out)", + "fan1 PSU Fan 1", + "temp1 PSU Temp 1", + "temp2 PSU Temp 2", + "power1 PSU 220V Rail Pwr (in)", + "power2 PSU 12V Rail Pwr (out)", + "curr1 PSU 220V Rail Curr (in)", + "curr2 PSU 12V Rail Curr (out)" + ], + "ignore": [ + "in2" + ], + "set": [ + "power2_cap 0" + ] + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater new file mode 100644 index 000000000000..a548d7f985d8 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater @@ -0,0 +1,81 @@ +#!/bin/bash + +function update_psu_sensors_configuration() { + local SENSORS_CONFIG_FILE="/tmp/sensors.conf" + local PSU_SENSORS_CONFIG="/usr/share/sonic/platform/psu_sensors.json" + + if [ -f $SENSORS_CONFIG_FILE ]; then + rm $SENSORS_CONFIG_FILE + fi + + if [ -z "$1" ]; then + echo "psu_sensors_conf_updater ERROR: no sensors configuration file had been selected" + return + else + cp $1 $SENSORS_CONFIG_FILE + fi + + platform=$(jq -r '.chassis.name' /usr/share/sonic/platform/platform.json) + # built-in psu, no need for dynamic configruation + if [[ "$platform" == "MSN2100" || "$platform" == "MSN2010" ]]; then return; fi + # incase we don't have this platform's info + if [[ $(jq -r --arg platform "$platform" '.platform[$platform]' $PSU_SENSORS_CONFIG) == "null" ]]; then return; fi + + local rev=$(cat "$1" | grep "Hardware revision" | awk '{print $NF}') + # incase we don't find the revision number + if [ ! $rev ]; then return; fi + # incase we don't have that revision's data + if [[ $(jq -r --arg platform "$platform" --arg rev "$rev" '.platform[$platform][$rev]' $PSU_SENSORS_CONFIG) == "null" ]]; then return; fi + + start_marker_number=$(grep -n "Power supplies" $SENSORS_CONFIG_FILE | cut -f1 -d:) + end_marker_number=$(($(tail -n +$(($start_marker_number + 1)) $SENSORS_CONFIG_FILE | grep -n '^$' | head -n 1 | cut -d: -f1) + $start_marker_number)) + # In some cases, the PSU sensor section may be at the end of the file, + # so using grep alone may not match it. Let's set the end marker + # to the total number of lines in the file directly. + if [ "$end_marker_number" == "$start_marker_number" ]; then + end_marker_number=$(wc -l $SENSORS_CONFIG_FILE | cut -f1 -d' ') + fi + + sed -i "${start_marker_number},${end_marker_number}d" $SENSORS_CONFIG_FILE + + echo "" >> $SENSORS_CONFIG_FILE + echo "# Power supplies" >> $SENSORS_CONFIG_FILE + + bus=$(jq -r --arg platform "$platform" --arg rev "$rev" '.platform[$platform][$rev].bus | map("\"" + . + "\"") | join(" ")' $PSU_SENSORS_CONFIG) + if [ "$bus" ]; then echo "bus $bus" >> $SENSORS_CONFIG_FILE; fi + + mapfile -t chips < <(jq -r --arg platform "$platform" --arg rev "$rev" '.platform[$platform][$rev].chip | to_entries[] | .key' $PSU_SENSORS_CONFIG ) + + for chip in "${chips[@]}"; do + number=$(jq -r --arg platform "$platform" --arg rev "$rev" --arg chip "$chip" '.platform[$platform][$rev].chip[$chip] | to_entries | .[0].value' $PSU_SENSORS_CONFIG) + side=$(jq -r --arg platform "$platform" --arg rev "$rev" --arg chip "$chip" '.platform[$platform][$rev].chip[$chip] | to_entries | .[1].value' $PSU_SENSORS_CONFIG) + psu=$(cat /var/run/hw-management/eeprom/psu${number}_vpd | grep "PN_VPD_FIELD" | cut -d ' ' -f 2 2>&1) + if [ ! "$psu" ]; then + echo "psu_sensors_conf_updater ERROR: Failed to read from /var/run/hw-management/eeprom/psu${number}_vpd" + # keep looking for the rest psus + continue + else + if [ "$psu" == "MTEF-PSF-AC-G" ]; then + vendor=$(cat /var/run/hw-management/eeprom/psu${number}_vpd | grep "MFR_NAME:" | cut -d ' ' -f 2 2>&1) + psu="${psu}-${vendor}" + fi + psu=$(echo "$psu" | sed -r 's/-PSR|-PSF//g') + + echo " chip \""$chip"\"" >> $SENSORS_CONFIG_FILE + mapfile -t opers < <(jq -r --arg psu "$psu" '.psu[$psu] | keys[]' $PSU_SENSORS_CONFIG) + for oper in "${opers[@]}"; do + if [ "$oper" == "label" ]; then + section=$(jq -r --arg psu "$psu" --arg oper "$oper" '.psu[$psu][$oper] | map(" " + $oper + " " + . + "\"") | join("\n")' $PSU_SENSORS_CONFIG) + if [[ ! "$side" || "$side" == "null" ]]; then + echo "$section" | sed "s/PSU/\"PSU-$number/g" >> $SENSORS_CONFIG_FILE + else + echo "$section" | sed "s/PSU/\"PSU-$number($side)/g" >> $SENSORS_CONFIG_FILE + fi + else + jq -r --arg psu "$psu" --arg oper "$oper" '.psu[$psu][$oper] | map(" " + $oper + " " + .) | join("\n")' $PSU_SENSORS_CONFIG >> $SENSORS_CONFIG_FILE + fi + done + fi + done + +} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf index 8197e191b462..c04f4328dc29 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN2700 ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 2)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn2700a1-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn2700a1-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700a1-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700a1-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn2700a1-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700a1-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700a1-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2700a1-r0/sensors.conf index e8f5e1568106..495627c1b389 100644 --- a/device/mellanox/x86_64-mlnx_msn2700a1-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2700a1-r0/sensors.conf @@ -15,6 +15,8 @@ # limitations under the License. # +# Hardware revision default + # Bus names bus "i2c-17" "i2c-1-mux (chan_id 8)" diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn2740-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn2740-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2740-r0/sensors.conf index 2e60f6b451e1..80382cb836ec 100644 --- a/device/mellanox/x86_64-mlnx_msn2740-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN2740 ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn3420-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn3420-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf index 83a5c7ce4c77..6880f21b101b 100644 --- a/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN3420 ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn3700-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn3700-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ 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 index 37446268adab..e0a847aa3508 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN3700 ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf index db5cd3009294..81e22d59cc24 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf @@ -15,6 +15,8 @@ ## limitations under the License. ## +# Hardware revision respin + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_swb_respin.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_swb_respin.conf index 8c546c107cfa..f5cf3d5df658 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_swb_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_swb_respin.conf @@ -15,6 +15,8 @@ ## limitations under the License. ## +# Hardware revision swb_respin + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn3700c-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn3700c-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ 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 index ed6cebd1d102..b5105b871cf8 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN3700C ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf index fdc7bac39424..228c87fc1e19 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf @@ -15,6 +15,8 @@ ## limitations under the License. ## +# Hardware revision respin + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_swb_respin.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_swb_respin.conf index 2b0394f801f0..ecc6ba13ccf1 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_swb_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_swb_respin.conf @@ -15,6 +15,8 @@ ## limitations under the License. ## +# Hardware revision swb_respin + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn3800-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn3800-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf index 5400269b32e1..b40375a247d8 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN3800 ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn4410-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn4410-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn4600-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn4600-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf index 4c374a839be9..a5b03ba372ed 100644 --- a/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN4600 ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn4600c-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn4600c-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf index 4f60ceb02167..add442165a1e 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN4600C ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 index 4200febc3d1e..12f758a43346 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 @@ -15,6 +15,8 @@ ## limitations under the License. ## +# Hardware revision a1 + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf index 0e346b31e28f..b23cfc74bc56 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf @@ -15,6 +15,8 @@ ## limitations under the License. ## +# Hardware revision respin + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 index a959a7a2c3af..772cd455d14d 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 @@ -15,6 +15,8 @@ ## limitations under the License. ## +# Hardware revision respin_a1 + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/psu_sensors.json b/device/mellanox/x86_64-mlnx_msn4700-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-mlnx_msn4700-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf index e4c6724b618f..280118e43ef1 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN4700 ################################################################################ +# Hardware revision default + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 b/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 index d609b4321ce2..e85dca5aecba 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 @@ -5,6 +5,8 @@ # Platform specific sensors config for SN4700 A0/A1 ################################################################################ +# Hardware revision a1 + # Temperature sensors bus "i2c-2" "i2c-1-mux (chan_id 1)" chip "mlxsw-i2c-*-48" diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/psu_sensors.json b/device/mellanox/x86_64-nvidia_sn2201-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-nvidia_sn2201-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf index 5024abd70017..19624b1c92e5 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN2201 ################################################################################ +# Hardware revision default + # Fan Controller emc2305. bus "i2c-7" "i2c-1-mux (chan_id 5)" chip "emc2305-i2c-7-4d" diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/psu_sensors.json b/device/mellanox/x86_64-nvidia_sn4800-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn4800-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-nvidia_sn4800-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn4800-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn4800-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn4800-r0/sensors.conf index 3cf718641a81..669fbec4a895 100644 --- a/device/mellanox/x86_64-nvidia_sn4800-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn4800-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN4800 ################################################################################ +# Hardware revision default + # Line card power manager devices (bus is variable) bus "i2c-59" "i2c-34-mux (chan_id 4)" chip "mp2975-i2c-59-62" diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/psu_sensors.json b/device/mellanox/x86_64-nvidia_sn5400-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-nvidia_sn5400-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn5400-r0/sensors.conf index e858a0311c05..0b2b7c9c7e45 100644 --- a/device/mellanox/x86_64-nvidia_sn5400-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/sensors.conf @@ -15,6 +15,8 @@ ## limitations under the License. ## +# Hardware revision default + # Bus names bus "i2c-39" "i2c-1-mux (chan_id 6)" diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/psu_sensors.json b/device/mellanox/x86_64-nvidia_sn5600-r0/psu_sensors.json new file mode 120000 index 000000000000..5816694317d6 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/psu_sensors.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors.json \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/psu_sensors_conf_updater b/device/mellanox/x86_64-nvidia_sn5600-r0/psu_sensors_conf_updater new file mode 120000 index 000000000000..b9686d838e0f --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/psu_sensors_conf_updater @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/psu_sensors_conf_updater \ No newline at end of file diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf index e64aabae645f..fdd642edc77d 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/sensors.conf @@ -4,6 +4,8 @@ # Platform specific sensors config for SN5600 ################################################################################## +# Hardware revision default + # Bus names bus "i2c-39" "i2c-1-mux (chan_id 6)" diff --git a/dockers/docker-platform-monitor/docker_init.j2 b/dockers/docker-platform-monitor/docker_init.j2 index 765f7c863efc..ebef713e27f1 100755 --- a/dockers/docker-platform-monitor/docker_init.j2 +++ b/dockers/docker-platform-monitor/docker_init.j2 @@ -98,6 +98,14 @@ fi if [ -e $SENSORS_CONF_FILE ]; then HAVE_SENSORS_CONF=1 mkdir -p /etc/sensors.d + PSU_SENSORS_CONF_UPDATER="/usr/share/sonic/platform/psu_sensors_conf_updater" + if [ -e $PSU_SENSORS_CONF_UPDATER ]; then + source $PSU_SENSORS_CONF_UPDATER + update_psu_sensors_configuration $SENSORS_CONF_FILE + if [ -f /tmp/sensors.conf ]; then + SENSORS_CONF_FILE="/tmp/sensors.conf" + fi + fi /bin/cp -f $SENSORS_CONF_FILE /etc/sensors.d/sensors.conf fi diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py b/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py index 977ac5f862c1..92b43483914e 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py @@ -46,6 +46,7 @@ def __init__(self, psu_index): super(FixedPsu, self).__init__() self.index = psu_index + 1 self._name = "PSU {}".format(self.index) + self.model = 'N/A' self.psu_oper_status = os.path.join(PSU_PATH, "thermal/psu{}_pwr_status".format(self.index)) self._led = None @@ -256,6 +257,9 @@ def __init__(self, psu_index): from .thermal import initialize_psu_thermal self._thermal_list = initialize_psu_thermal(psu_index, self.get_power_available_status) + # initialize psu model + self.model = self.vpd_parser.get_model() + @property def psu_voltage(self): if not self._psu_voltage: @@ -304,7 +308,14 @@ def get_model(self): Returns: string: Model/part number of device """ - return self.vpd_parser.get_model() + current_model = self.vpd_parser.get_model() + if current_model != self.model and os.path.exists('/usr/share/sonic/platform/psu_sensors_conf_updater'): + utils.run_command(['cp', '-f', '/etc/sensors.d/sensors.conf', '/tmp/sensors.conf.orig']) + utils.run_command(['bash', '-c','source /usr/share/sonic/platform/psu_sensors_conf_updater && update_psu_sensors_configuration /tmp/sensors.conf.orig']) + utils.run_command(['cp', '-f', '/tmp/sensors.conf', '/etc/sensors.d/']) + utils.run_command(['service', 'sensord', 'restart']) + self.model = current_model + return current_model def get_serial(self): """ From 34a1143204d41754067057c6fa172de14438fada Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:02:25 +0800 Subject: [PATCH 260/282] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#19274) #### Why I did it src/sonic-utilities ``` * c2370f88 - (HEAD -> master, origin/master, origin/HEAD) [DPB]Fixing return code of breakout command on failure (#3357) (8 hours ago) [Sudharsan Dhamal Gopalarathnam] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index f96a132278fd..c2370f88d896 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit f96a132278fdc3545c3f6a609dc5a21149c49240 +Subproject commit c2370f88d896abbe9dc7b48acf66ebd2477ecdaa From 438df3877bfc275176d7144f53ed22a997bd56be Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:02:30 +0800 Subject: [PATCH 261/282] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#19273) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### Why I did it src/sonic-swss ``` * 70eb7663 - (HEAD -> master, origin/master, origin/HEAD) ADD VOQ COUNTERS(SAI_SWITCH_STAT_PACKET_INTEGRITY_DROP, SAI_QUEUE_ST…T_CREDIT_WD_DELETED_PACKETS) support for VOQ/Fabric switches (#3152) (10 hours ago) [saksarav-nokia] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index f497c4a0da2a..70eb7663280c 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit f497c4a0da2ac040e36dcf72433d5b20a93639fe +Subproject commit 70eb7663280c7b37a969d6305aa4a24e17e32fa3 From 0b9ff357b9506b643edb78e52ab23a31c1f0fb0c Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:02:37 +0800 Subject: [PATCH 262/282] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#19271) #### Why I did it src/sonic-platform-daemons ``` * efb4dbd - (HEAD -> master, origin/master, origin/HEAD) [CMIS] Skip re-init flow for SW-controlled ports in case of fastboot (#497) (11 hours ago) [Stepan Blyshchak] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 76cf1dc9fd8f..efb4dbd31006 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 76cf1dc9fd8fb609dbf071be7028c09b61c83815 +Subproject commit efb4dbd31006f7f0d44069b215c361ef0e1c2bc3 From 2a2f3bdcddcf4b0261f3f2b21ae495e12fb1ffea Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:02:42 +0800 Subject: [PATCH 263/282] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#19270) #### Why I did it src/sonic-linux-kernel ``` * 1f101c1 - (HEAD -> master, origin/master, origin/HEAD) Remove compiled artifact download and rename base url (#400) (83 minutes ago) [Vivek] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index 93b8fe9a9f65..1f101c13d3cc 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 93b8fe9a9f657eae2438c94b9625d2ae34274eb1 +Subproject commit 1f101c13d3ccd692638f0aa253b0097f38783a6d From 9bc9bb37271ab585712de9c27085cb2b571b0a03 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Wed, 12 Jun 2024 18:51:43 +0800 Subject: [PATCH 264/282] [build] Fix restapi debian package false dependency (#19246) Why I did it Fix build error when enable restapi and debug. the derived package function is not called correctly. Work item tracking Microsoft ADO (number only): 28376451 How I did it How to verify it --- rules/restapi.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/restapi.mk b/rules/restapi.mk index b603ecd7a591..2962cf604949 100644 --- a/rules/restapi.mk +++ b/rules/restapi.mk @@ -10,4 +10,4 @@ $(RESTAPI)_RDEPENDS += $(LIBNL3) $(LIBNL_GENL3) \ SONIC_DPKG_DEBS += $(RESTAPI) RESTAPI_DBG = sonic-rest-api-dbgsym_1.0.1_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(RESTAPI_DBG),$(RESTAPI_DBG))) +$(eval $(call add_derived_package,$(RESTAPI),$(RESTAPI_DBG))) From de2306850d7977d4dbd7ca3f975150d196503837 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Thu, 13 Jun 2024 01:01:14 +0800 Subject: [PATCH 265/282] [submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#19283) #### Why I did it src/sonic-swss-common ``` * e37bfea - (HEAD -> master, origin/master, origin/HEAD) Don't use unix socket on for redis_chassis.server (#873) (3 hours ago) [arista-nwolfe] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-swss-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 391e27bd6769..e37bfea64fb9 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 391e27bd6769fa64d483c2c67a1079c174f4975f +Subproject commit e37bfea64fb9e1f40f7c9b6ad759e92f5f15bec9 From 39b711c3805c0fa3c607ad5a079e77694bdfdbfb Mon Sep 17 00:00:00 2001 From: Vivek Verma <137406113+vivekverma-arista@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:56:14 +0530 Subject: [PATCH 266/282] Update sonic-mux-linkmgr yang model (#19275) Why I did it A new flag was introduced in sonic-net/sonic-linkmgrd#250 to disable mux oscillations but yang model wasn't updated. We are seeing multiple tests failing due to this, some of them are - generic_config_updater/test_dynamic_acl.py passw_hardening/test_passw_hardening.py dualtor_mgmt/test_toggle_mux.py --- .../tests/files/sample_config_db.json | 3 +++ .../yang_model_tests/tests/mux-linkmgr.json | 5 ++++- .../tests_config/mux-linkmgr.json | 12 +++++++++++- .../yang-models/sonic-mux-linkmgr.yang | 18 +++++++++++++++++- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index ed1f75c65795..8ebb1d655675 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2335,6 +2335,9 @@ "src_mac": "ToRMac", "interval_pck_loss_count_update": "3" }, + "TIMED_OSCILLATION": { + "oscillation_enabled": "false" + }, "MUXLOGGER": { "log_verbosity": "debug" }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/mux-linkmgr.json b/src/sonic-yang-models/tests/yang_model_tests/tests/mux-linkmgr.json index 7c4aeadffddc..050728cb944d 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/mux-linkmgr.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/mux-linkmgr.json @@ -5,10 +5,13 @@ "MUX_LINKMGR_LINK_PROBER_CHANGE_MAC_ADDR": { "desc": "Use well-known mac and vlan mac as dst/src in linkmgrd link prober. " }, + "MUX_LINKMGR_TIMED_OSCILLATION_DISABLE_OSCILLATION": { + "desc": "Disable timed oscillation." + }, "MUX_LINKMGR_MUXLOGGER_CHANGE_VERBOSITY_LEVEL": { "desc": "Consume verbosity level config changes. " }, "MUX_LINKMGR_SERVICE_MGMT_KILL_RADV_DISABLED": { "desc": "Disable feature to kill radv." } -} \ No newline at end of file +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux-linkmgr.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux-linkmgr.json index 1feff4f44038..8a9f9e01c22c 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux-linkmgr.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux-linkmgr.json @@ -23,6 +23,16 @@ } } }, + "MUX_LINKMGR_TIMED_OSCILLATION_DISABLE_OSCILLATION": { + "sonic-mux-linkmgr:sonic-mux-linkmgr": { + "sonic-mux-linkmgr:MUX_LINKMGR": { + "sonic-mux-linkmgr:TIMED_OSCILLATION": + { + "oscillation_enabled": "false" + } + } + } + }, "MUX_LINKMGR_MUXLOGGER_CHANGE_VERBOSITY_LEVEL": { "sonic-mux-linkmgr:sonic-mux-linkmgr": { "sonic-mux-linkmgr:MUX_LINKMGR": { @@ -43,4 +53,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/sonic-yang-models/yang-models/sonic-mux-linkmgr.yang b/src/sonic-yang-models/yang-models/sonic-mux-linkmgr.yang index d7b07ed7335b..001ec4298ed6 100644 --- a/src/sonic-yang-models/yang-models/sonic-mux-linkmgr.yang +++ b/src/sonic-yang-models/yang-models/sonic-mux-linkmgr.yang @@ -84,6 +84,22 @@ module sonic-mux-linkmgr { } } + container TIMED_OSCILLATION { + + leaf oscillation_enabled { + type boolean; + default true; + description "Flag to enable/disable timed oscillation. "; + } + + leaf interval_sec { + type uint32; + default 300; + units seconds; + description "Interval between MUX oscillations. "; + } + } + container MUXLOGGER { leaf log_verbosity { @@ -114,4 +130,4 @@ module sonic-mux-linkmgr { } } } -} \ No newline at end of file +} From e6192bf0fdba74e686e96f488217c37cc64a239e Mon Sep 17 00:00:00 2001 From: Tomer Shalvi <116184476+tshalvi@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:07:58 +0300 Subject: [PATCH 267/282] [Mellanox] Enhance is_module_host_management_mode to also check syncd's sai.profile (#19261) - Why I did it Two steps (among others) are required to enable the host CMIS management feature: enabling it in the switch's sai.profile and performing a config reload. During the timeframe between these two steps, the control sysfs might be accessed, but they will not be present on the system until the latter step, the config reload, is completed. The code should try to access the control sysfs only after the config reload step. A good indication that this has been done is to check if the relevant entry is included in syncd's sai.profile. In contrast to the switch's sai.profile, syncd's sai.profile is only updated with the Host CMIS management support flag after the reload is complete. - How I did it I updated the is_module_host_management_mode() implementation to first look for the Host CMIS management support flag in syncd's sai.profile, and only if it does not exist for some reason, look for it in the switch's sai.profile. - How to verify it Add the Host CMIS management support flag to the switch's sai.profile and verify that the following log does not appear: ERR pmon#xcvrd: Exception occured at DomInfoUpdateTask thread due to Exception('control sysfs for SFP 20 does not exist') --- .../mlnx-platform-api/sonic_platform/device_data.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py index 9ee37af9981d..35c40476b93a 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -267,12 +267,14 @@ def get_cpld_component_list(cls): @classmethod @utils.read_only_cache() def is_module_host_management_mode(cls): - from sonic_py_common import device_info - _, hwsku_dir = device_info.get_paths_to_platform_and_hwsku_dirs() - sai_profile_file = os.path.join(hwsku_dir, 'sai.profile') + sai_profile_file = '/tmp/sai.profile' + if not os.path.exists(sai_profile_file): + from sonic_py_common import device_info + _, hwsku_dir = device_info.get_paths_to_platform_and_hwsku_dirs() + sai_profile_file = os.path.join(hwsku_dir, 'sai.profile') data = utils.read_key_value_file(sai_profile_file, delimeter='=') return data.get('SAI_INDEPENDENT_MODULE_MODE') == '1' - + @classmethod def wait_platform_ready(cls): """ From a2b3ca87a34e2908177e25a2f5abe7b6cdc5d53c Mon Sep 17 00:00:00 2001 From: wenyiz2021 <91497961+wenyiz2021@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:09:54 -0700 Subject: [PATCH 268/282] [master] [DNX SAI] bump SAI version to 10.1.21.1 (#19304) Microsoft ADO (number only): 28321093 Loaded sonic image with this SAI version on chassis device, dockers are up, no crash --- platform/broadcom/sai-modules.mk | 2 +- platform/broadcom/sai.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/broadcom/sai-modules.mk b/platform/broadcom/sai-modules.mk index 6271942ccc44..f9fcef135d75 100644 --- a/platform/broadcom/sai-modules.mk +++ b/platform/broadcom/sai-modules.mk @@ -10,7 +10,7 @@ $(BRCM_OPENNSL_KERNEL)_MACHINE = broadcom SONIC_DPKG_DEBS += $(BRCM_OPENNSL_KERNEL) # SAI bcm modules for DNX family ASIC -BRCM_DNX_OPENNSL_KERNEL_VERSION = 10.1.13.0 +BRCM_DNX_OPENNSL_KERNEL_VERSION = 10.1.21.0 BRCM_DNX_OPENNSL_KERNEL = opennsl-modules-dnx_$(BRCM_DNX_OPENNSL_KERNEL_VERSION)_amd64.deb $(BRCM_DNX_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules-dnx diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 2512caad2901..78507f9a23b2 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,7 +1,7 @@ LIBSAIBCM_XGS_VERSION = 10.1.7.0 -LIBSAIBCM_DNX_VERSION = 10.1.13.0 +LIBSAIBCM_DNX_VERSION = 10.1.21.0 LIBSAIBCM_XGS_BRANCH_NAME = SAI_10.1.0_GA -LIBSAIBCM_DNX_BRANCH_NAME = SAI_10.1.0_GA +LIBSAIBCM_DNX_BRANCH_NAME = SAI_10.1.21.1 LIBSAIBCM_XGS_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/$(LIBSAIBCM_XGS_BRANCH_NAME)/$(LIBSAIBCM_XGS_VERSION)/xgs" LIBSAIBCM_DNX_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/$(LIBSAIBCM_DNX_BRANCH_NAME)/$(LIBSAIBCM_DNX_VERSION)/dnx" From 7f32712f4208f091a38224eb1809f242f2a10b79 Mon Sep 17 00:00:00 2001 From: zitingguo-ms Date: Fri, 14 Jun 2024 23:21:15 +0800 Subject: [PATCH 269/282] Upgrade xgs SAI version to 10.1.21.0 (#19302) Why I did it Upgrade the xgs SAI version to 10.1.21.0 to include the following changes: 10.1.8.0: Support _brcm_sai_port_unlos_set when external port_phy_addr is 0xff 10.1.9.0: [CS00012330893]With PFC test, egress drop observed for lossless queues 10.1.11.0: Include the bcmsim in the odp package 10.1.13.0: handle bind of egress and ingress groups to same lag 10.1.14.0: Backport SDK-381920 to rel_ocp_sai_10_1 High CPU due to SDK calling soc_dnxc_port_resource_get 10.1.16.0: [CSP CS00012336644] callback called twice with same event type 10.1.17.0: [CSP 00012320736][SAI_BRANCH rel_ocp_sai_10_1]Back port MMU related Fixes to 10.1 specific to LTSW/TH4 devices-HSDK 10.1.18.0: [CSP CS00012351984] Backport SONIC-81526 to 10.1 Fixes for rate class bound setting and UCQ stats 10.1.19.0: Reset EGR_L3_NEXT_HOP_2 for TH3 10.1.20.0: Sonic crash due to unsupported return from SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_OFFSET Work item tracking Microsoft ADO (number only): 28356083 How I did it Upgrade the SAI version in the sai.mk file. How to verify it Run the SONiC basic test in the SAI release pipeline: https://dev.azure.com/mssonic/internal/_build/results?buildId=570565&view=results --- platform/broadcom/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 78507f9a23b2..048d120e8640 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,4 +1,4 @@ -LIBSAIBCM_XGS_VERSION = 10.1.7.0 +LIBSAIBCM_XGS_VERSION = 10.1.21.0 LIBSAIBCM_DNX_VERSION = 10.1.21.0 LIBSAIBCM_XGS_BRANCH_NAME = SAI_10.1.0_GA LIBSAIBCM_DNX_BRANCH_NAME = SAI_10.1.21.1 From 911350550591ef33b886aa0a62222e2b70c564a3 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 15 Jun 2024 16:01:27 +0800 Subject: [PATCH 270/282] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#19296) #### Why I did it src/sonic-gnmi ``` * 5357f93 - (HEAD -> master, origin/master, origin/HEAD) Fix yang validation (#244) (19 hours ago) [ganglv] * 20aba13 - Improve GNMI incremental config and add unit test for BGP (#239) (2 days ago) [ganglv] * f0d0959 - Merge pull request #241 from liuh-80/dev/liuh/add_gnmi_cert_name (2 days ago) [Hua Liu] |\ | failure_prs.log 9b65bde - Merge branch 'master' into dev/liuh/add_gnmi_cert_name (2 days ago) [Hua Liu] | |\ | |/ |/| * | 424212b - Add aaa ut (#222) (2 days ago) [ganglv] / * 90322b3 - Revert unecessary change (10 days ago) [liuh-80] * b7abf5a - Fix comments (10 days ago) [liuh-80] * f47be1c - Update server_test.go (11 days ago) [Hua Liu] * 0ae9398 - Fix test case (12 days ago) [liuh-80] * d305bca - Fix build issue (12 days ago) [liuh-80] * 518b332 - Merge remote-tracking branch 'origin/master' into dev/liuh/add_gnmi_cert_name (12 days ago) [liuh-80] * 0d30cfc - Fix yang issue (12 days ago) [liuh-80] * f2882dd - Add cert role mapping (12 days ago) [liuh-80] * 3ee207a - Update server_test.go (2 weeks ago) [Hua Liu] * 0f211bf - Update server_test.go (2 weeks ago) [Hua Liu] * 6b85507 - Improve coverage (2 weeks ago) [liuh-80] * ec096c3 - Fix split method (2 weeks ago) [liuh-80] * 43e7a43 - Improve code (2 weeks ago) [liuh-80] * 7c4b830 - Improve code (3 weeks ago) [liuh-80] * b998f4e - Improve code (3 weeks ago) [liuh-80] * 795a52b - Improve code (3 weeks ago) [liuh-80] * 08571e3 - Add cert authorization with common name support (3 weeks ago) [liuh-80] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index 50817e697d3c..5357f932ad5f 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit 50817e697d3c85abc8aac7d4a1565e003bf5159a +Subproject commit 5357f932ad5fab01ad51684be08d3909b9f7eedf From 41cc4870e86388b7ec49ceac9e531bd8cc4e9bf0 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 15 Jun 2024 19:01:05 +0800 Subject: [PATCH 271/282] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#19321) #### Why I did it src/sonic-utilities ``` * d0856afa - (HEAD -> master, origin/master, origin/HEAD) Add Checkpoint and Rollback for Multi ASIC. (#3299) (19 hours ago) [Xincun Li] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index c2370f88d896..d0856afad1c6 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit c2370f88d896abbe9dc7b48acf66ebd2477ecdaa +Subproject commit d0856afad1c6f7ead6eeca70531c988fb448c335 From e25e755e33f32c608082b36f07eae1e29ea32564 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 15 Jun 2024 19:01:28 +0800 Subject: [PATCH 272/282] [submodule] Update submodule sonic-sairedis to the latest HEAD automatically (#19272) #### Why I did it src/sonic-sairedis ``` * a988dd1b - (HEAD -> master, origin/master, origin/HEAD) Sairedis support SAI api/object type extenstion range (#1390) (32 hours ago) [Kamil Cudnik] * fd8f890f - [saisubmodule] Update SAI submodule to latest master (#1395) (32 hours ago) [Kamil Cudnik] * 9574a3c6 - [proxy] Support notifications (#1393) (2 days ago) [Kamil Cudnik] * 4f0fcafe - [proxy] Support load profile map from file (#1389) (5 days ago) [Kamil Cudnik] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index 1f2c861aafe7..a988dd1b7b90 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit 1f2c861aafe751e62ad8510419a4da7c795f4bb5 +Subproject commit a988dd1b7b9044fd7ca859ecdfa1eb858cc3ea08 From 157818104e4a109421a72d4753b07a442c19e8be Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 17 Jun 2024 19:04:22 +0800 Subject: [PATCH 273/282] [submodule] Update submodule sonic-platform-daemons to the latest HEAD automatically (#19326) #### Why I did it src/sonic-platform-daemons ``` * 6694d3b - (HEAD -> master, origin/master, origin/HEAD) [xcvrd] Fix issue: do not print error log when module support non-ethernet application (#501) (16 minutes ago) [Junchao-Mellanox] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-platform-daemons | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index efb4dbd31006..6694d3b97c6d 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit efb4dbd31006f7f0d44069b215c361ef0e1c2bc3 +Subproject commit 6694d3b97c6d7d52c9f1544f22c5fd107bff3727 From 1fba66c5d41a19ce9b02f64cd2091c0783da0a78 Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:13:58 +0800 Subject: [PATCH 274/282] Improve service checker for gnmi/telemetry container (#19153) Why I did it Fix #19081 We have used gnmi container to replace telemetry container, and telemetry is still enabled after upgrade. service_checker script reads from features table and check if the container is running, telemetry is enabled but there's no telemetry container. It's difficult to disable telemetry in feature table for warm reboot and cold reboot, we need to check docker image in db migrator and minigraph.py. When we use warm reboot to upgrade from 202305 to 202311, config_db still has telemetry configuration, and we can't simply remove related configuration. Work item tracking Microsoft ADO (number only): How I did it I modify service_checker script: If there's docker-sonic-telemetry image, check telemetry container. If there's no docker-sonic-telemetry image, check gnmi container instead. If there's no docker-sonic-telemetry image and docker-sonic-gnmi image, do not check telemetry. How to verify it Run unit test and end to end test. --- .../health_checker/service_checker.py | 47 +++++++++++++++--- .../etc/supervisor/critical_processes | 1 + src/system-health/tests/test_system_health.py | 49 +++++++++++++++++++ 3 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 src/system-health/tests/telemetry/etc/supervisor/critical_processes diff --git a/src/system-health/health_checker/service_checker.py b/src/system-health/health_checker/service_checker.py index bc38bd43a929..10ec7e678595 100644 --- a/src/system-health/health_checker/service_checker.py +++ b/src/system-health/health_checker/service_checker.py @@ -15,6 +15,19 @@ EVENTS_PUBLISHER_SOURCE = "sonic-events-host" EVENTS_PUBLISHER_TAG = "process-not-running" +def check_docker_image(image_name): + """ + @summary: This function will check if docker image exists. + @return: True if the image exists, otherwise False. + """ + try: + DOCKER_CLIENT = docker.DockerClient(base_url='unix://var/run/docker.sock') + DOCKER_CLIENT.images.get(image_name) + return True + except (docker.errors.ImageNotFound, docker.errors.APIError) as err: + logger.log_warning("Failed to get image '{}'. Error: '{}'".format(image_name, err)) + return False + class ServiceChecker(HealthChecker): """ Checker that checks critical system service status via monit service. @@ -84,21 +97,39 @@ def get_expected_running_containers(self, feature_table): # it will be removed from exception list. run_all_instance_list = ['database', 'bgp'] - for feature_name, feature_entry in feature_table.items(): + container_list = [] + for container_name in feature_table.keys(): + # slim image does not have telemetry container and corresponding docker image + if container_name == "telemetry": + ret = check_docker_image("docker-sonic-telemetry") + if not ret: + # If telemetry container image is not present, check gnmi container image + # If gnmi container image is not present, ignore telemetry container check + # if gnmi container image is present, check gnmi container instead of telemetry + ret = check_docker_image("docker-sonic-gnmi") + if not ret: + logger.log_debug("Ignoring telemetry container check on image which has no corresponding docker image") + else: + container_list.append("gnmi") + continue + container_list.append(container_name) + + for container_name in container_list: + feature_entry = feature_table[container_name] if feature_entry["state"] not in ["disabled", "always_disabled"]: if multi_asic.is_multi_asic(): if feature_entry.get("has_global_scope", "True") == "True": - expected_running_containers.add(feature_name) - container_feature_dict[feature_name] = feature_name + expected_running_containers.add(container_name) + container_feature_dict[container_name] = container_name if feature_entry.get("has_per_asic_scope", "False") == "True": num_asics = multi_asic.get_num_asics() for asic_id in range(num_asics): - if asic_id in asics_id_presence or feature_name in run_all_instance_list: - expected_running_containers.add(feature_name + str(asic_id)) - container_feature_dict[feature_name + str(asic_id)] = feature_name + if asic_id in asics_id_presence or container_name in run_all_instance_list: + expected_running_containers.add(container_name + str(asic_id)) + container_feature_dict[container_name + str(asic_id)] = container_name else: - expected_running_containers.add(feature_name) - container_feature_dict[feature_name] = feature_name + expected_running_containers.add(container_name) + container_feature_dict[container_name] = container_name if device_info.is_supervisor(): expected_running_containers.add("database-chassis") diff --git a/src/system-health/tests/telemetry/etc/supervisor/critical_processes b/src/system-health/tests/telemetry/etc/supervisor/critical_processes new file mode 100644 index 000000000000..fd693f80070d --- /dev/null +++ b/src/system-health/tests/telemetry/etc/supervisor/critical_processes @@ -0,0 +1 @@ +program:gnmi-native diff --git a/src/system-health/tests/test_system_health.py b/src/system-health/tests/test_system_health.py index ab44fcd66c9d..4aeb3b18f041 100644 --- a/src/system-health/tests/test_system_health.py +++ b/src/system-health/tests/test_system_health.py @@ -12,6 +12,7 @@ import copy import os import sys +import docker from imp import load_source from swsscommon import swsscommon @@ -23,6 +24,7 @@ swsscommon.SonicV2Connector = MockConnector test_path = os.path.dirname(os.path.abspath(__file__)) +telemetry_path = os.path.join(test_path, 'telemetry') modules_path = os.path.dirname(test_path) scripts_path = os.path.join(modules_path, 'scripts') sys.path.insert(0, modules_path) @@ -166,6 +168,53 @@ def test_service_checker_single_asic(mock_config_db, mock_run, mock_docker_clien assert origin_container_critical_processes == checker.container_critical_processes +@patch('swsscommon.swsscommon.ConfigDBConnector.connect', MagicMock()) +@patch('health_checker.service_checker.ServiceChecker._get_container_folder', MagicMock(return_value=telemetry_path)) +@patch('sonic_py_common.multi_asic.is_multi_asic', MagicMock(return_value=False)) +@patch('docker.DockerClient') +@patch('health_checker.utils.run_command') +@patch('swsscommon.swsscommon.ConfigDBConnector') +def test_service_checker_telemetry(mock_config_db, mock_run, mock_docker_client): + setup() + mock_db_data = MagicMock() + mock_get_table = MagicMock() + mock_db_data.get_table = mock_get_table + mock_config_db.return_value = mock_db_data + mock_get_table.return_value = { + 'gnmi': { + 'state': 'enabled', + 'has_global_scope': 'True', + 'has_per_asic_scope': 'False', + + }, + 'telemetry': { + 'state': 'enabled', + 'has_global_scope': 'True', + 'has_per_asic_scope': 'False', + + } + } + mock_containers = MagicMock() + mock_gnmi_container = MagicMock() + mock_gnmi_container.name = 'gnmi' + mock_containers.list = MagicMock(return_value=[mock_gnmi_container]) + mock_docker_client_object = MagicMock() + mock_docker_client.return_value = mock_docker_client_object + mock_docker_client_object.containers = mock_containers + mock_docker_client_object.images = MagicMock() + mock_docker_client_object.images.get = MagicMock() + except_err = docker.errors.ImageNotFound("Unit test") + mock_docker_client_object.images.get.side_effect = [except_err, None] + + mock_run.return_value = "gnmi-native RUNNING pid 67, uptime 1:03:56" + + checker = ServiceChecker() + assert checker.get_category() == 'Services' + config = Config() + checker.check(config) + assert 'gnmi:gnmi-native' in checker._info + assert checker._info['gnmi:gnmi-native'][HealthChecker.INFO_FIELD_OBJECT_STATUS] == HealthChecker.STATUS_OK + @patch('swsscommon.swsscommon.ConfigDBConnector.connect', MagicMock()) @patch('health_checker.service_checker.ServiceChecker._get_container_folder', MagicMock(return_value=test_path)) From 44ae9e7a6d3fc5a3127835ca4ec72bfeaeda28ea Mon Sep 17 00:00:00 2001 From: zitingguo-ms Date: Tue, 18 Jun 2024 23:12:16 +0800 Subject: [PATCH 275/282] Revert "Upgrade xgs SAI version to 10.1.21.0 (#19302)" (#19337) This reverts commit 7f32712f4208f091a38224eb1809f242f2a10b79. --- platform/broadcom/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 048d120e8640..78507f9a23b2 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,4 +1,4 @@ -LIBSAIBCM_XGS_VERSION = 10.1.21.0 +LIBSAIBCM_XGS_VERSION = 10.1.7.0 LIBSAIBCM_DNX_VERSION = 10.1.21.0 LIBSAIBCM_XGS_BRANCH_NAME = SAI_10.1.0_GA LIBSAIBCM_DNX_BRANCH_NAME = SAI_10.1.21.1 From 0ffdf4e11942b0d2f90d1cc7ea2a4ee56a3c1d11 Mon Sep 17 00:00:00 2001 From: Zain Budhwani <99770260+zbud-msft@users.noreply.github.com> Date: Tue, 18 Jun 2024 18:13:41 -0700 Subject: [PATCH 276/282] Fix rsyslog plugin slim image logic (#19034) * Fix rsyslog plugin slim image logic * Remove asic check for broadcom when checking for eventd enabled and slim image --- dockers/docker-dhcp-relay/Dockerfile.j2 | 4 +--- dockers/docker-fpm-frr/Dockerfile.j2 | 4 +--- dockers/docker-orchagent/Dockerfile.j2 | 4 +--- files/build_templates/init_cfg.json.j2 | 2 +- files/build_templates/sonic_debian_extension.j2 | 4 +--- files/image_config/rsyslog/rsyslog.d/00-sonic.conf.j2 | 11 +++++++---- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/dockers/docker-dhcp-relay/Dockerfile.j2 b/dockers/docker-dhcp-relay/Dockerfile.j2 index 48375e214689..5b0dc82c314b 100644 --- a/dockers/docker-dhcp-relay/Dockerfile.j2 +++ b/dockers/docker-dhcp-relay/Dockerfile.j2 @@ -50,8 +50,7 @@ COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor"] COPY ["cli", "/cli/"] -{% if include_system_eventd == "y" %} -{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} +{% if include_system_eventd == "y" and build_reduce_image_size != "y" %} # Copy regex json and rsyslog_plugin.conf file into rsyslog.d COPY ["*.json", "/etc/rsyslog.d/"] COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] @@ -60,6 +59,5 @@ RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info. RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2 RUN rm -f /etc/rsyslog.d/events_info.json {% endif %} -{% endif %} ENTRYPOINT ["/usr/bin/docker_init.sh"] diff --git a/dockers/docker-fpm-frr/Dockerfile.j2 b/dockers/docker-fpm-frr/Dockerfile.j2 index b0dc413c8c89..98c4593811f7 100644 --- a/dockers/docker-fpm-frr/Dockerfile.j2 +++ b/dockers/docker-fpm-frr/Dockerfile.j2 @@ -59,14 +59,12 @@ RUN chmod a+x /usr/bin/TSA && \ chmod a+x /usr/bin/TSC && \ chmod a+x /usr/bin/zsocket.sh -{% if include_system_eventd == "y" %} -{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} +{% if include_system_eventd == "y" and build_reduce_image_size != "y" %} COPY ["*.json", "/etc/rsyslog.d/"] COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/bgp_events.conf RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2 RUN rm -f /etc/rsyslog.d/events_info.json {% endif %} -{% endif %} ENTRYPOINT ["/usr/bin/docker_init.sh"] diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index 3bc02a9d8fc4..fb90b4f09c22 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -80,8 +80,7 @@ RUN sonic-cfggen -a "{\"ENABLE_ASAN\":\"{{ENABLE_ASAN}}\"}" -t /usr/share/sonic/ RUN rm -f /usr/share/sonic/templates/docker-init.j2 RUN chmod 755 /usr/bin/docker-init.sh -{% if include_system_eventd == "y" %} -{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} +{% if include_system_eventd == "y" and build_reduce_image_size != "y" %} # Copy all regex json files and rsyslog_plugin.conf to rsyslog.d COPY ["*.json", "/etc/rsyslog.d/"] COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] @@ -90,6 +89,5 @@ RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info. RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2 RUN rm -f /etc/rsyslog.d/events_info.json {% endif %} -{% endif %} ENTRYPOINT ["/usr/bin/docker-init.sh"] diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 0a185680e690..dc7e4aab7e8e 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -61,7 +61,7 @@ {%- if include_macsec == "y" %}{% do features.append(("macsec", "{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'SpineRouter' and DEVICE_RUNTIME_METADATA['MACSEC_SUPPORTED'] %}enabled{% else %}disabled{% endif %}", false, "enabled")) %}{% endif %} {%- if include_system_gnmi == "y" %}{% do features.append(("gnmi", "enabled", true, "enabled")) %}{% endif %} {%- if include_system_telemetry == "y" %}{% do features.append(("telemetry", "enabled", true, "enabled")) %}{% endif %} -{%- if include_system_eventd == "y" and BUILD_REDUCE_IMAGE_SIZE == "y" and sonic_asic_platform == "broadcom" %} +{%- if include_system_eventd == "y" and BUILD_REDUCE_IMAGE_SIZE == "y" %} {% do features.append(("eventd","disabled", false, "enabled")) %} {%- elif include_system_eventd == "y" %} {% do features.append(("eventd", "enabled", false, "enabled")) %} diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index ece833119be6..52f12b4ef7c4 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -354,8 +354,7 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-db-cli_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f -{% if include_system_eventd == "y" %} -{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} +{% if include_system_eventd == "y" and build_reduce_image_size != "y" %} # Install sonic-rsyslog-plugin sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-rsyslog-plugin_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f @@ -375,7 +374,6 @@ sudo cp $BUILD_TEMPLATES/bgpd_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ j2 -f json $BUILD_TEMPLATES/rsyslog_plugin.conf.j2 $BUILD_TEMPLATES/syncd_events_info.json | sudo tee $FILESYSTEM_ROOT_ETC/rsyslog.d/syncd_events.conf sudo cp $BUILD_TEMPLATES/syncd_regex.json $FILESYSTEM_ROOT_ETC/rsyslog.d/ -{% endif %} {% endif %} # Install custom-built monit package and SONiC configuration files diff --git a/files/image_config/rsyslog/rsyslog.d/00-sonic.conf.j2 b/files/image_config/rsyslog/rsyslog.d/00-sonic.conf.j2 index 66eb1346362c..a5b4689741dc 100644 --- a/files/image_config/rsyslog/rsyslog.d/00-sonic.conf.j2 +++ b/files/image_config/rsyslog/rsyslog.d/00-sonic.conf.j2 @@ -5,31 +5,34 @@ template(name="prog_msg" type="list") { constant(value="\n") } -{% if include_system_eventd == "y" %} -{% if build_reduce_image_size != "y" or sonic_asic_platform != "broadcom" %} +{% if include_system_eventd == "y" and build_reduce_image_size != "y" %} $ModLoad omprog +{% endif %} + if re_match($programname, "bgp[0-9]*#(frr|zebra|staticd|watchfrr)") then { /var/log/frr/zebra.log + {% if include_system_eventd == "y" and build_reduce_image_size != "y" %} action(type="omprog" binary="/usr/bin/rsyslog_plugin -r /etc/rsyslog.d/zebra_regex.json -m sonic-events-bgp" output="/var/log/rsyslog_plugin.log" template="prog_msg") + {% endif %} stop } if re_match($programname, "bgp[0-9]*#bgpd") then { /var/log/frr/bgpd.log + {% if include_system_eventd == "y" and build_reduce_image_size != "y" %} action(type="omprog" binary="/usr/bin/rsyslog_plugin -r /etc/rsyslog.d/bgpd_regex.json -m sonic-events-bgp" output="/var/log/rsyslog_plugin.log" template="prog_msg") + {% endif %} stop } -{% endif %} -{% endif %} ## Teamd rules From 881bb40c62192e1a12752ed538a8a763391cbd2c Mon Sep 17 00:00:00 2001 From: Yuanzhe <150663541+yuazhe@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:33:40 +0800 Subject: [PATCH 277/282] [Mellanox] Enable get_tx_fault support in CMIS cable host mgmt mode (#18984) - Why I did it Enable get_tx_fault support in CMIS cable host mgmt mode on Mellanox platforms - How I did it Use community get_tx_fault implementation instead of the dummy one - How to verify it API call and run API Test Signed-off-by: Yuanzhe, Liu --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 58fe71b84c87..a457b7458072 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -1054,6 +1054,11 @@ def get_tx_fault(self): list: [False] * channels """ api = self.get_xcvr_api() + try: + if self.is_sw_control(): + return api.get_tx_fault() if api else None + except Exception as e: + print(e) return [False] * api.NUM_CHANNELS if api else None def get_temperature(self): @@ -1154,7 +1159,6 @@ def get_xcvr_api(self): self.refresh_xcvr_api() if self._xcvr_api is not None: self._xcvr_api.get_rx_los = self.get_rx_los - self._xcvr_api.get_tx_fault = self.get_tx_fault return self._xcvr_api def is_sw_control(self): From 76069eb1a58366522fc39f2e92b14b69b2359fd3 Mon Sep 17 00:00:00 2001 From: Song Yuan <64041228+ysmanman@users.noreply.github.com> Date: Wed, 19 Jun 2024 10:10:24 -0700 Subject: [PATCH 278/282] Add environs to test PFCWD on DNX (#19108) - Add ASIC_TYPE to force orchagent to run with the given ASIC. - Add PFC_DLR_INIT_ENABLE to allow test to override PfcDlrInitEnable for VS switch. This is required to test PfcWdAclHandler, instead of PfcWdDlrHandler. --- platform/vs/docker-sonic-vs/orchagent.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/platform/vs/docker-sonic-vs/orchagent.sh b/platform/vs/docker-sonic-vs/orchagent.sh index 8bd365e13230..f044bc922cda 100755 --- a/platform/vs/docker-sonic-vs/orchagent.sh +++ b/platform/vs/docker-sonic-vs/orchagent.sh @@ -8,6 +8,20 @@ else export platform=vs fi +# Force orchagent to run with the given ASIC. +if [ "$ASIC_TYPE" == "broadcom-dnx" ]; then + export platform="broadcom" + export sub_platform="broadcom-dnx" +fi + +# Allow test to override PfcDlrInitEnable for VS switch so that +# we can test PfcWdAclHandler, instead of PfcWdDlrHandler. +if [ "$PFC_DLR_INIT_ENABLE" == "1" ]; then + export pfcDlrInitEnable="1" +elif [ "$PFC_DLR_INIT_ENABLE" == "0" ]; then + export pfcDlrInitEnable="0" +fi + SWSS_VARS_FILE=/usr/share/sonic/templates/swss_vars.j2 # Retrieve SWSS vars from sonic-cfggen From 99e0e1ade0199b8660deb4fd49dd4903f4df9adb Mon Sep 17 00:00:00 2001 From: fountzou <169114916+fountzou@users.noreply.github.com> Date: Wed, 19 Jun 2024 20:53:28 +0300 Subject: [PATCH 279/282] [TSA] Reliable TSA: Addressing pizza box issues (#19217) * [TSA] Reliable TSA: Addressing pizza box issues - Why I did it Implement HLD https://github.com/skeesara-nokia/SONiC/blob/master/doc/voq/Reliable_TSA.md OB- How I did it A new attribute "tsa_enabled" has been added in CHASSIS_APP_DB the value of which changes whenever TSA/TSB is issued in the supervisor (default value is false). bgpcfgd subscribes to CHASSIS_APP_DB to receive updates on the newly added "tsa_enabled" attribute and in conjunction with the CONFIG_DB "tsa_enabled" attribute value, determine the BGP operational state is determined to be in TSA or TSB. Signed-off-by: fountzou --- dockers/docker-fpm-frr/base_image_files/TS | 22 ++- dockers/docker-fpm-frr/base_image_files/TSA | 13 +- dockers/docker-fpm-frr/base_image_files/TSB | 16 +- files/build_templates/docker_image_ctl.j2 | 12 ++ files/image_config/config-setup/config-setup | 13 ++ src/sonic-bgpcfgd/bgpcfgd/main.py | 6 + .../bgpcfgd/managers_chassis_app_db.py | 50 ++++++ .../bgpcfgd/managers_device_global.py | 32 +++- src/sonic-bgpcfgd/bgpcfgd/runner.py | 5 +- .../tests/test_chassis_app_db.py | 142 ++++++++++++++++++ src/sonic-bgpcfgd/tests/test_device_global.py | 73 ++++++++- 11 files changed, 365 insertions(+), 19 deletions(-) create mode 100644 src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py create mode 100644 src/sonic-bgpcfgd/tests/test_chassis_app_db.py diff --git a/dockers/docker-fpm-frr/base_image_files/TS b/dockers/docker-fpm-frr/base_image_files/TS index fcff1f80674c..0084bd5f27bd 100755 --- a/dockers/docker-fpm-frr/base_image_files/TS +++ b/dockers/docker-fpm-frr/base_image_files/TS @@ -4,17 +4,31 @@ [ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} +switch_type=`sonic-db-cli CONFIG_DB hget 'DEVICE_METADATA|localhost' 'switch_type'` +TSA_CHASSIS_STATE=false + +if [[ $switch_type == 'voq' ]]; then + TSA_CHASSIS_STATE="$(sonic-db-cli CHASSIS_APP_DB HGET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled)" +fi if [[ $1 == "TSA" ]]; then TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "true"}}}' - log_msg='System Mode: Normal -> Maintenance' + if [[ $TSA_CHASSIS_STATE == true ]]; then + log_msg='System Mode: Maintenance -> Maintenance' + else + log_msg='System Mode: Normal -> Maintenance' + fi err_msg='System is already in Maintenance' - desired_tsa_state=true + desired_tsa_state=true elif [[ $1 == "TSB" ]]; then TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "false"}}}' - log_msg='System Mode: Maintenance -> Normal' + if [[ $TSA_CHASSIS_STATE == true ]]; then + log_msg='System Mode: Maintenance -> Maintenance' + else + log_msg='System Mode: Maintenance -> Normal' + fi err_msg='System is already in Normal mode' - desired_tsa_state=false + desired_tsa_state=false fi # Parse the device specific asic conf file, if it exists diff --git a/dockers/docker-fpm-frr/base_image_files/TSA b/dockers/docker-fpm-frr/base_image_files/TSA index 4b26b2d430b5..2cd29e92afb1 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSA +++ b/dockers/docker-fpm-frr/base_image_files/TSA @@ -7,7 +7,18 @@ if [ "$EUID" -ne 0 ] ; then fi if [ -f /etc/sonic/chassisdb.conf ]; then - rexec all -c "sudo TSA chassis" + CHASSIS_TSA_STATE_UPDATE="CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL\|STATE" tsa_enabled "true"" + CONFIG_DB_TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "true"}}}' + current_tsa_state="$(sonic-cfggen -d -v BGP_DEVICE_GLOBAL.STATE.tsa_enabled)" + if [[ $current_tsa_state == true ]]; then + echo "Chassis is already in Maintenance" + logger -t TSA -p user.info "Chassis is already in Maintenance" + else + sonic-db-cli $CHASSIS_TSA_STATE_UPDATE + sonic-cfggen -a "$CONFIG_DB_TSA_STATE_UPDATE" -w + echo "Chassis Mode: Normal -> Maintenance" + logger -t TSA -p user.info "Chassis Mode: Normal -> Maintenance" + fi echo "Please execute \"rexec all -c 'sudo config save -y'\" to preserve System mode in Maintenance after reboot\ or config reload on all linecards" exit 0 diff --git a/dockers/docker-fpm-frr/base_image_files/TSB b/dockers/docker-fpm-frr/base_image_files/TSB index ec353148a72f..c09126e1d12d 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSB +++ b/dockers/docker-fpm-frr/base_image_files/TSB @@ -6,11 +6,21 @@ if [ "$EUID" -ne 0 ] ; then exit 1 fi -# If run on supervisor of chassis, trigger remote execution of TSB on all linecards if [ -f /etc/sonic/chassisdb.conf ]; then - rexec all -c "sudo TSB chassis" + CHASSIS_TSA_STATE_UPDATE="CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL\|STATE" tsa_enabled "false"" + CONFIG_DB_TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "false"}}}' + current_tsa_state="$(sonic-cfggen -d -v BGP_DEVICE_GLOBAL.STATE.tsa_enabled)" + if [[ $current_tsa_state == false ]]; then + echo "Chassis is already in Normal mode" + logger -t TSB -p user.info "Chassis is already in Normal mode" + else + sonic-db-cli $CHASSIS_TSA_STATE_UPDATE + sonic-cfggen -a "$CONFIG_DB_TSA_STATE_UPDATE" -w + echo "Chassis Mode: Maintenance -> Normal" + logger -t TSB -p user.info "Chassis Mode: Maintenance -> Normal" + fi echo "Please execute \"rexec all -c 'sudo config save -y'\" to preserve System mode in Normal state after reboot\ - or config reload on all linecards" + or config reload on all linecards" exit 0 fi diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index f0208d32f1e5..36cf32771ba1 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -269,6 +269,18 @@ function postStartAction() $SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" fi + # In SUP, enforce CHASSIS_APP_DB.tsa_enabled to be in sync with BGP_DEVICE_GLOBAL.STATE.tsa_enabled + if [[ -z "$DEV" ]] && [[ -f /etc/sonic/chassisdb.conf ]]; then + tsa_cfg="$($SONIC_DB_CLI CONFIG_DB HGET "BGP_DEVICE_GLOBAL|STATE" "tsa_enabled")" + if [[ -n "$tsa_cfg" ]]; then + docker exec -i ${DOCKERNAME} $SONIC_DB_CLI CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled ${tsa_cfg} + OP_CODE=$? + if [ $OP_CODE -ne 0 ]; then + echo "Err: Cmd failed (exit code $OP_CODE). CHASSIS_APP_DB and CONFIG_DB may be incosistent wrt tsa_enabled" + fi + fi + fi + # Add redis UDS to the redis group and give read/write access to the group REDIS_SOCK="/var/run/redis${DEV}/redis.sock" else diff --git a/files/image_config/config-setup/config-setup b/files/image_config/config-setup/config-setup index 21d56217c349..a823d84970bc 100755 --- a/files/image_config/config-setup/config-setup +++ b/files/image_config/config-setup/config-setup @@ -330,6 +330,19 @@ do_db_migration() /usr/local/bin/db_migrator.py -o migrate fi sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" + + #Enforce CHASSIS_APP_DB.tsa_enabled to be in sync with BGP_DEVICE_GLOBAL.STATE.tsa_enabled + if [[ -f /etc/sonic/chassisdb.conf ]]; then + tsa_cfg="$(sonic-db-cli CONFIG_DB HGET "BGP_DEVICE_GLOBAL|STATE" "tsa_enabled")" + sonic-db-cli CHASSIS_APP_DB HMSET "BGP_DEVICE_GLOBAL|STATE" tsa_enabled ${tsa_cfg} + OP_CODE=$? + + if [ $OP_CODE -ne 0 ]; then + err_msg="Cmd failed (exit code $OP_CODE). CHASSIS_APP_DB and CONFIG_DB may be incosistent wrt tsa_enabled." + echo "$err_msg" + logger -t CHASSIS_APP_DB -p user.info "$err_msg" + fi + fi } # Perform configuration migration from backup copy. diff --git a/src/sonic-bgpcfgd/bgpcfgd/main.py b/src/sonic-bgpcfgd/bgpcfgd/main.py index 624d311037ad..4b41e6825f95 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/main.py +++ b/src/sonic-bgpcfgd/bgpcfgd/main.py @@ -6,6 +6,7 @@ import traceback from swsscommon import swsscommon +from sonic_py_common import device_info from .config import ConfigMgr from .directory import Directory @@ -20,6 +21,7 @@ from .managers_static_rt import StaticRouteMgr from .managers_rm import RouteMapMgr from .managers_device_global import DeviceGlobalCfgMgr +from .managers_chassis_app_db import ChassisAppDbMgr from .static_rt_timer import StaticRouteTimer from .runner import Runner, signal_handler from .template import TemplateFabric @@ -74,6 +76,10 @@ def do_work(): # Device Global Manager DeviceGlobalCfgMgr(common_objs, "CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME), ] + + if device_info.is_chassis(): + managers.append(ChassisAppDbMgr(common_objs, "CHASSIS_APP_DB", "BGP_DEVICE_GLOBAL")) + runner = Runner(common_objs['cfg_mgr']) for mgr in managers: runner.add_manager(mgr) diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py b/src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py new file mode 100644 index 000000000000..7969ae828d80 --- /dev/null +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_chassis_app_db.py @@ -0,0 +1,50 @@ +from .manager import Manager +from .managers_device_global import DeviceGlobalCfgMgr +from .log import log_err, log_debug, log_notice +import re +from swsscommon import swsscommon + +class ChassisAppDbMgr(Manager): + """This class responds to change in tsa_enabled state of the supervisor""" + + def __init__(self, common_objs, db, table): + """ + Initialize the object + :param common_objs: common object dictionary + :param db: name of the db + :param table: name of the table in the db + """ + self.lc_tsa = "" + self.directory = common_objs['directory'] + self.dev_cfg_mgr = DeviceGlobalCfgMgr(common_objs, "CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME) + self.directory.subscribe([("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"),], self.on_lc_tsa_status_change) + super(ChassisAppDbMgr, self).__init__( + common_objs, + [], + db, + table, + ) + + def on_lc_tsa_status_change(self): + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"): + self.lc_tsa = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["tsa_enabled"] + log_debug("ChassisAppDbMgr:: LC TSA update handler status %s" % self.lc_tsa) + + def set_handler(self, key, data): + log_debug("ChassisAppDbMgr:: set handler") + + if not data: + log_err("ChassisAppDbMgr:: data is None") + return False + + if "tsa_enabled" in data: + if self.lc_tsa == "false": + self.dev_cfg_mgr.cfg_mgr.commit() + self.dev_cfg_mgr.cfg_mgr.update() + self.dev_cfg_mgr.isolate_unisolate_device(data["tsa_enabled"]) + return True + return False + + def del_handler(self, key): + log_debug("ChassisAppDbMgr:: del handler") + return True diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py index 1943dfa5d709..26c0a1ee69fc 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_device_global.py @@ -4,6 +4,7 @@ from .manager import Manager from .log import log_err, log_debug, log_notice from swsscommon import swsscommon +from sonic_py_common import device_info class DeviceGlobalCfgMgr(Manager): """This class responds to change in device-specific state""" @@ -20,6 +21,7 @@ def __init__(self, common_objs, db, table): :param table: name of the table in the db """ self.switch_type = "" + self.chassis_tsa = "" self.directory = common_objs['directory'] self.cfg_mgr = common_objs['cfg_mgr'] self.constants = common_objs['constants'] @@ -97,11 +99,16 @@ def configure_tsa(self, data=None): if "tsa_enabled" in data: state = data["tsa_enabled"] - if self.is_update_required("tsa_enabled", state): + self.chassis_tsa = self.get_chassis_tsa_status() + requires_update = self.is_update_required("tsa_enabled", state) + + if state in ["true", "false"] and self.directory.path_exist(self.db_name, self.table_name, "tsa_enabled"): + self.directory.put(self.db_name, self.table_name, "tsa_enabled", state) + + if requires_update and self.chassis_tsa == "false": self.cfg_mgr.commit() self.cfg_mgr.update() - if self.isolate_unisolate_device(state): - self.directory.put(self.db_name, self.table_name, "tsa_enabled", state) + self.isolate_unisolate_device(state) else: log_notice("DeviceGlobalCfgMgr:: TSA configuration is up-to-date") @@ -167,7 +174,9 @@ def check_state_and_get_tsa_routemaps(self, cfg): cmd = "" if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME, "tsa_enabled"): tsa_status = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_BGP_DEVICE_GLOBAL_TABLE_NAME)["tsa_enabled"] - if tsa_status == "true": + chassis_tsa = self.get_chassis_tsa_status() + + if tsa_status == "true" or chassis_tsa == "true": cmds = cfg.replace("#012", "\n").split("\n") log_notice("DeviceGlobalCfgMgr:: Device is isolated. Applying TSA route-maps") cmd = self.get_ts_routemaps(cmds, self.tsa_template) @@ -228,6 +237,21 @@ def __extract_out_route_map_names(self, cmds): route_map_names.add(result.group(1)) return route_map_names + def get_chassis_tsa_status(self): + chassis_tsa_status = "false" + + if not device_info.is_chassis(): + return chassis_tsa_status + + try: + ch = swsscommon.SonicV2Connector(use_unix_socket_path=False) + ch.connect(ch.CHASSIS_APP_DB, False) + chassis_tsa_status = ch.get(ch.CHASSIS_APP_DB, "BGP_DEVICE_GLOBAL|STATE", 'tsa_enabled') + except Exception as e: + log_err("Got an exception {}".format(e)) + + return chassis_tsa_status + def downstream_isolate_unisolate(self, idf_isolation_state): """ API to apply IDF configuration """ diff --git a/src/sonic-bgpcfgd/bgpcfgd/runner.py b/src/sonic-bgpcfgd/bgpcfgd/runner.py index 4c160e5967cf..75df6f902e9a 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/runner.py +++ b/src/sonic-bgpcfgd/bgpcfgd/runner.py @@ -39,7 +39,10 @@ def add_manager(self, manager): table_name = manager.get_table_name() db = swsscommon.SonicDBConfig.getDbId(db_name) if db not in self.db_connectors: - self.db_connectors[db] = swsscommon.DBConnector(db_name, 0) + if db_name == "CHASSIS_APP_DB": + self.db_connectors[db] = swsscommon.DBConnector(db_name, 0, True, '') + else: + self.db_connectors[db] = swsscommon.DBConnector(db_name, 0) if table_name not in self.callbacks[db]: conn = self.db_connectors[db] diff --git a/src/sonic-bgpcfgd/tests/test_chassis_app_db.py b/src/sonic-bgpcfgd/tests/test_chassis_app_db.py new file mode 100644 index 000000000000..edb08595ade1 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/test_chassis_app_db.py @@ -0,0 +1,142 @@ +from unittest.mock import MagicMock, patch + +import os +from bgpcfgd.directory import Directory +from bgpcfgd.template import TemplateFabric +from . import swsscommon_test +from .util import load_constants +import bgpcfgd.managers_chassis_app_db +import bgpcfgd.managers_device_global +from swsscommon import swsscommon +from copy import deepcopy + +TEMPLATE_PATH = os.path.abspath('../../dockers/docker-fpm-frr/frr') +BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/general/peer-group.conf/') +INTERNAL_BASE_PATH = os.path.abspath('../sonic-bgpcfgd/tests/data/internal/peer-group.conf/') +global_constants = { + "bgp": { + "traffic_shift_community" :"12345:12345", + "internal_community_match_tag" : "1001" + } +} + +def constructor(check_internal=False): + cfg_mgr = MagicMock() + def get_text(): + text = [] + for line in cfg_mgr.changes.split('\n'): + if line.lstrip().startswith('!'): + continue + text.append(line) + text += [" "] + return text + def update(): + if check_internal: + cfg_mgr.changes = get_string_from_file("/result_chasiss_packet.conf", INTERNAL_BASE_PATH) + else: + cfg_mgr.changes = get_string_from_file("/result_all.conf") + def push(cfg): + cfg_mgr.changes += cfg + "\n" + def get_config(): + return cfg_mgr.changes + cfg_mgr.get_text = get_text + cfg_mgr.update = update + cfg_mgr.push = push + cfg_mgr.get_config = get_config + + constants = deepcopy(global_constants) + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'tf': TemplateFabric(TEMPLATE_PATH), + 'constants': constants + } + mgr = bgpcfgd.managers_chassis_app_db.ChassisAppDbMgr(common_objs, "CHASSIS_APP_DB", "BGP_DEVICE_GLOBAL") + cfg_mgr.update() + return mgr + + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_isolate_device(mocked_log_info): + m = constructor() + + m.lc_tsa = "false" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_isolate.conf") + + curr_cfg = m.cfg_mgr.get_config() + m.lc_tsa = "true" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_isolate_device_internal_session(mocked_log_info): + m = constructor(check_internal=True) + + m.lc_tsa = "false" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_isolate.conf", INTERNAL_BASE_PATH) + + curr_cfg = m.cfg_mgr.get_config() + m.lc_tsa = "true" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_unisolate_device(mocked_log_info): + m = constructor() + + m.lc_tsa = "false" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_unisolate.conf") + + curr_cfg = m.cfg_mgr.get_config() + m.lc_tsa = "true" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + +@patch('bgpcfgd.managers_device_global.log_debug') +def test_unisolate_device_internal_session(mocked_log_info): + m = constructor(check_internal=True) + + m.lc_tsa = "false" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") + assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_unisolate.conf", INTERNAL_BASE_PATH) + + curr_cfg = m.cfg_mgr.get_config() + m.lc_tsa = "true" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + + +def get_string_from_file(filename, base_path=BASE_PATH): + fp = open(base_path + filename, "r") + cfg = fp.read() + fp.close() + + return cfg + +@patch('bgpcfgd.managers_chassis_app_db.log_err') +def test_set_handler_failure_case(mocked_log_info): + m = constructor() + res = m.set_handler("STATE", {}) + assert res == False, "Expect False return value for invalid data passed to set_handler" + mocked_log_info.assert_called_with("ChassisAppDbMgr:: data is None") + +def test_del_handler(): + m = constructor() + res = m.del_handler("STATE") + assert res, "Expect True return value for del_handler" diff --git a/src/sonic-bgpcfgd/tests/test_device_global.py b/src/sonic-bgpcfgd/tests/test_device_global.py index fc1c5e702d10..60c791bf5a8d 100644 --- a/src/sonic-bgpcfgd/tests/test_device_global.py +++ b/src/sonic-bgpcfgd/tests/test_device_global.py @@ -68,52 +68,111 @@ def get_config(): # TSA ----------------------------------------------------------------------------------------------------------------- # +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_isolate_device(mocked_log_info): +def test_isolate_device(mocked_log_info, mock_get_chassis_tsa_status): m = constructor() + + mock_get_chassis_tsa_status.return_value = "false" res = m.set_handler("STATE", {"tsa_enabled": "true"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_isolate.conf") + curr_cfg = m.cfg_mgr.get_config() + mock_get_chassis_tsa_status.return_value = "true" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + + +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_isolate_device_internal_session(mocked_log_info): +def test_isolate_device_internal_session(mocked_log_info, mock_get_chassis_tsa_status): m = constructor(check_internal=True) + + mock_get_chassis_tsa_status.return_value = "false" res = m.set_handler("STATE", {"tsa_enabled": "true"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_isolate.conf", INTERNAL_BASE_PATH) + curr_cfg = m.cfg_mgr.get_config() + mock_get_chassis_tsa_status.return_value = "true" + res = m.set_handler("STATE", {"tsa_enabled": "true"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + + +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_unisolate_device(mocked_log_info): +def test_unisolate_device(mocked_log_info, mock_get_chassis_tsa_status): m = constructor() + + mock_get_chassis_tsa_status.return_value = "false" + # By default feature is disabled. Simulate enabled state m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") + res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_all_unisolate.conf") + curr_cfg = m.cfg_mgr.get_config() + mock_get_chassis_tsa_status.return_value = "true" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + + +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') @patch('bgpcfgd.managers_device_global.log_debug') -def test_unisolate_device_internal_session(mocked_log_info): +def test_unisolate_device_internal_session(mocked_log_info, mock_get_chassis_tsa_status): m = constructor(check_internal=True) + + mock_get_chassis_tsa_status.return_value = "false" + # By default feature is disabled. Simulate enabled state m.directory.put(m.db_name, m.table_name, "tsa_enabled", "true") + res = m.set_handler("STATE", {"tsa_enabled": "false"}) assert res, "Expect True return value for set_handler" mocked_log_info.assert_called_with("DeviceGlobalCfgMgr::Done") assert m.cfg_mgr.get_config() == get_string_from_file("/result_chassis_packet_unisolate.conf", INTERNAL_BASE_PATH) -def test_check_state_and_get_tsa_routemaps(): + curr_cfg = m.cfg_mgr.get_config() + mock_get_chassis_tsa_status.return_value = "true" + res = m.set_handler("STATE", {"tsa_enabled": "false"}) + assert res, "Expect True return value for set_handler" + assert m.cfg_mgr.get_config() == curr_cfg + + +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') +def test_check_state_and_get_tsa_routemaps(mock_get_chassis_tsa_status): m = constructor() + + mock_get_chassis_tsa_status.return_value = "false" m.set_handler("STATE", {"tsa_enabled": "true"}) res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) assert res == get_string_from_file("/result_isolate.conf") + mock_get_chassis_tsa_status.return_value = "true" + m.set_handler("STATE", {"tsa_enabled": "true"}) + res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) + assert res == get_string_from_file("/result_isolate.conf") + + mock_get_chassis_tsa_status.return_value = "false" m.set_handler("STATE", {"tsa_enabled": "false"}) res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) assert res == "" + mock_get_chassis_tsa_status.return_value = "true" + m.set_handler("STATE", {"tsa_enabled": "false"}) + res = m.check_state_and_get_tsa_routemaps(m.cfg_mgr.get_config()) + assert res == get_string_from_file("/result_isolate.conf") + + def test_get_tsa_routemaps(): m = constructor() assert m.get_ts_routemaps([], m.tsa_template) == "" @@ -153,9 +212,11 @@ def test_del_handler(): "value", [ "invalid_value" ] ) @patch('bgpcfgd.managers_device_global.log_err') -def test_tsa_neg(mocked_log_err, value): +@patch('bgpcfgd.managers_device_global.DeviceGlobalCfgMgr.get_chassis_tsa_status') +def test_tsa_neg(mock_get_chassis_tsa_status, mocked_log_err, value): m = constructor() m.cfg_mgr.changes = "" + mock_get_chassis_tsa_status.return_value = "false" res = m.set_handler("STATE", {"tsa_enabled": value}) assert res, "Expect True return value for set_handler" mocked_log_err.assert_called_with("TSA: invalid value({}) is provided".format(value)) From 2d4f3f8d36f4968a105d1607c32dca10cdcb0f38 Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Fri, 21 Jun 2024 09:38:15 -0700 Subject: [PATCH 280/282] [dhcp_server] Fix the issue with "kea-dhcp4.conf" file generation for Smart Switch. (#19200) The configuration generated from the template for the Smart Switch contained incorrect data in the "subnet4:id" field. For regular cases, the subnet ID is deduced from the VLAN name. For the Smart Switch, there is always one subnet, and the ID is set to 0. --- .../dhcp_utilities/dhcpservd/dhcp_cfggen.py | 8 ++-- .../dhcp_utilities/dhcpservd/dhcp_lease.py | 16 ++++++- .../tests/test_data/kea-dhcp4.conf.j2 | 1 + .../test_data/kea-lease_smart_switch.csv | 5 ++ .../tests/test_dhcp_cfggen.py | 1 + .../tests/test_dhcp_lease.py | 46 ++++++++++--------- .../tests/test_dhcpservd.py | 5 +- .../tests/test_smart_switch.py | 35 ++++++++++++++ 8 files changed, 90 insertions(+), 27 deletions(-) create mode 100644 src/sonic-dhcp-utilities/tests/test_data/kea-lease_smart_switch.csv diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py index eb7ae34d852f..c41e61d5f9f8 100755 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_cfggen.py @@ -16,6 +16,7 @@ VLAN_MEMBER = "VLAN_MEMBER" DPUS = "DPUS" MID_PLANE_BRIDGE = "MID_PLANE_BRIDGE" +MID_PLANE_BRIDGE_SUBNET_ID = 10000 PORT_MODE_CHECKER = ["DhcpServerTableCfgChangeEventChecker", "DhcpPortTableEventChecker", "DhcpRangeTableEventChecker", "DhcpOptionTableEventChecker", "VlanTableEventChecker", "VlanIntfTableEventChecker", "VlanMemberTableEventChecker"] @@ -90,7 +91,7 @@ def generate(self): port_ips, used_ranges = self._parse_port(port_ipv4, dhcp_interfaces, dhcp_members, ranges) customized_options = self._parse_customized_options(customized_options_ipv4) render_obj, enabled_dhcp_interfaces, used_options, subscribe_table = \ - self._construct_obj_for_template(dhcp_server_ipv4, port_ips, hostname, customized_options) + self._construct_obj_for_template(dhcp_server_ipv4, port_ips, hostname, customized_options, smart_switch) if smart_switch: subscribe_table |= set(SMART_SWITCH_CHECKER) @@ -175,7 +176,7 @@ def _parse_port_map_alias(self): for pc_name in pc_table.keys(): self.port_alias_map[pc_name] = pc_name - def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, customized_options): + def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, customized_options, smart_switch=False): subnets = [] client_classes = [] enabled_dhcp_interfaces = set() @@ -223,8 +224,9 @@ def _construct_obj_for_template(self, dhcp_server_ipv4, port_ips, hostname, cust "condition": "substring(relay4[1].hex, -{}, {}) == '{}'".format(class_len, class_len, client_class) }) + subnet_obj = { - "id": dhcp_interface_name.replace("Vlan", ""), + "id": MID_PLANE_BRIDGE_SUBNET_ID if smart_switch else dhcp_interface_name.replace("Vlan", ""), "subnet": str(ipaddress.ip_network(dhcp_interface_ip, strict=False)), "pools": pools, "gateway": dhcp_config["gateway"], diff --git a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py index 6dda767287ca..e2e95fb7b532 100644 --- a/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py +++ b/src/sonic-dhcp-utilities/dhcp_utilities/dhcpservd/dhcp_lease.py @@ -5,6 +5,7 @@ from abc import abstractmethod from collections import deque from datetime import datetime +from dhcp_utilities.common.utils import is_smart_switch DHCP_SERVER_IPV4_LEASE = "DHCP_SERVER_IPV4_LEASE" KEA_LEASE_FILE_PATH = "/tmp/kea-lease.csv" @@ -29,6 +30,13 @@ def __init__(self, db_connector, lease_update_interval=DEFAULE_LEASE_UPDATE_INTE self.lease_update_interval = lease_update_interval self.last_update_time = None self.lock = threading.Lock() + device_metadata = self.db_connector.get_config_db_table("DEVICE_METADATA") + self.is_smart_switch = is_smart_switch(device_metadata) + + if self.is_smart_switch: + mid_plane_table = self.db_connector.get_config_db_table("MID_PLANE_BRIDGE") + if "GLOBAL" in mid_plane_table and mid_plane_table["GLOBAL"]: + self.midplane_bridge_name = mid_plane_table["GLOBAL"]["bridge"] @abstractmethod def _read(self): @@ -97,6 +105,12 @@ def register(self): """ signal.signal(signal.SIGUSR1, self._update_lease) + def _lease_key(self, subnet_id, mac_address): + if self.is_smart_switch: + return f"{self.midplane_bridge_name}|{mac_address}" + else: + return f"Vlan{subnet_id}|{mac_address}" + def _read(self): # Read lease file generated by kea-dhcp4 try: @@ -120,7 +134,7 @@ def _read(self): lease_end = splits[4] subnet_id = splits[5] - new_key = "{}|{}".format("Vlan" + subnet_id, mac_address) + new_key = self._lease_key(subnet_id, mac_address) if new_key in new_lease: continue new_lease[new_key] = { diff --git a/src/sonic-dhcp-utilities/tests/test_data/kea-dhcp4.conf.j2 b/src/sonic-dhcp-utilities/tests/test_data/kea-dhcp4.conf.j2 index 082cbca14dd5..f5f7a9b054f0 100644 --- a/src/sonic-dhcp-utilities/tests/test_data/kea-dhcp4.conf.j2 +++ b/src/sonic-dhcp-utilities/tests/test_data/kea-dhcp4.conf.j2 @@ -42,6 +42,7 @@ {%- if add_subnet_preceding_comma.flag -%},{%- endif -%} {%- set _dummy = add_subnet_preceding_comma.update({'flag': True}) %} { + "id": {{ subnet_info["id"] }}, "subnet": "{{ subnet_info["subnet"] }}", "pools": [ {%- set add_pool_preceding_comma = { 'flag': False } %} diff --git a/src/sonic-dhcp-utilities/tests/test_data/kea-lease_smart_switch.csv b/src/sonic-dhcp-utilities/tests/test_data/kea-lease_smart_switch.csv new file mode 100644 index 000000000000..ea7d4ed2cbc4 --- /dev/null +++ b/src/sonic-dhcp-utilities/tests/test_data/kea-lease_smart_switch.csv @@ -0,0 +1,5 @@ +address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state,user_context +169.254.200.4,aa:bb:cc:dd:ff:04,,900,1718053209,10000,0,0,sonic,0, +169.254.200.1,aa:bb:cc:dd:ff:01,,900,1718053209,10000,0,0,sonic,0, +169.254.200.3,aa:bb:cc:dd:ff:03,,900,1718053210,10000,0,0,sonic,0, +169.254.200.2,aa:bb:cc:dd:ff:02,,900,1718053210,10000,0,0,sonic,0, \ No newline at end of file diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py index 723731839649..3548e39c1435 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_cfggen.py @@ -42,6 +42,7 @@ }, "subnet4": [ { + "id": 1000, "subnet": "192.168.0.0/21", "pools": [ { diff --git a/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py b/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py index a831b2ad5a11..04009d2ee0f5 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcp_lease.py @@ -3,6 +3,7 @@ from freezegun import freeze_time from swsscommon import swsscommon from unittest.mock import patch, call, MagicMock +from common_utils import mock_get_config_db_table expected_lease = { "Vlan1000|10:70:fd:b6:13:00": { @@ -34,20 +35,22 @@ def test_read_kea_lease_with_file_not_found(mock_swsscommon_dbconnector_init): - db_connector = DhcpDbConnector() - kea_lease_handler = KeaDhcp4LeaseHandler(db_connector) - try: - kea_lease_handler._read() - except FileNotFoundError: - pass + with patch.object(DhcpDbConnector, "get_config_db_table", side_effect=mock_get_config_db_table): + db_connector = DhcpDbConnector() + kea_lease_handler = KeaDhcp4LeaseHandler(db_connector) + try: + kea_lease_handler._read() + except FileNotFoundError: + pass def test_read_kea_lease(mock_swsscommon_dbconnector_init): - db_connector = DhcpDbConnector() - kea_lease_handler = KeaDhcp4LeaseHandler(db_connector, lease_file="tests/test_data/kea-lease.csv") - # Verify whether lease information read is as expected - lease = kea_lease_handler._read() - assert lease == expected_lease + with patch.object(DhcpDbConnector, "get_config_db_table", side_effect=mock_get_config_db_table): + db_connector = DhcpDbConnector() + kea_lease_handler = KeaDhcp4LeaseHandler(db_connector, lease_file="tests/test_data/kea-lease.csv") + # Verify whether lease information read is as expected + lease = kea_lease_handler._read() + assert lease == expected_lease # Cannot mock built-in/extension type function(datetime.datetime.timestamp), need to free time @@ -88,13 +91,14 @@ def test_update_kea_lease(mock_swsscommon_dbconnector_init, mock_swsscommon_tabl def test_no_implement(mock_swsscommon_dbconnector_init): - db_connector = DhcpDbConnector() - lease_handler = LeaseHanlder(db_connector) - try: - lease_handler._read() - except NotImplementedError: - pass - try: - lease_handler.register() - except NotImplementedError: - pass + with patch.object(DhcpDbConnector, "get_config_db_table", side_effect=mock_get_config_db_table): + db_connector = DhcpDbConnector() + lease_handler = LeaseHanlder(db_connector) + try: + lease_handler._read() + except NotImplementedError: + pass + try: + lease_handler.register() + except NotImplementedError: + pass diff --git a/src/sonic-dhcp-utilities/tests/test_dhcpservd.py b/src/sonic-dhcp-utilities/tests/test_dhcpservd.py index f11ffdbba0b5..4c8175b7e0bc 100644 --- a/src/sonic-dhcp-utilities/tests/test_dhcpservd.py +++ b/src/sonic-dhcp-utilities/tests/test_dhcpservd.py @@ -4,7 +4,7 @@ import signal import sys import time -from common_utils import MockProc +from common_utils import MockProc, mock_get_config_db_table from dhcp_utilities.common.utils import DhcpDbConnector from dhcp_utilities.common.dhcp_db_monitor import DhcpServdDbMonitor from dhcp_utilities.dhcpservd.dhcp_cfggen import DhcpServCfgGenerator @@ -110,7 +110,8 @@ def test_update_dhcp_server_ip(mock_swsscommon_dbconnector_init, mock_parse_port def test_start(mock_swsscommon_dbconnector_init, mock_parse_port_map_alias, mock_get_render_template): with patch.object(DhcpServd, "dump_dhcp4_config") as mock_dump, \ patch.object(DhcpServd, "_update_dhcp_server_ip") as mock_update_dhcp_server_ip, \ - patch.object(DhcpServdDbMonitor, "enable_checkers"): + patch.object(DhcpServdDbMonitor, "enable_checkers"), \ + patch.object(DhcpDbConnector, "get_config_db_table", side_effect=mock_get_config_db_table): dhcp_db_connector = DhcpDbConnector() dhcp_cfg_generator = DhcpServCfgGenerator(dhcp_db_connector, "/usr/local/lib/kea/hooks/libdhcp_run_script.so") dhcpservd = DhcpServd(dhcp_cfg_generator, dhcp_db_connector, MagicMock()) diff --git a/src/sonic-dhcp-utilities/tests/test_smart_switch.py b/src/sonic-dhcp-utilities/tests/test_smart_switch.py index 0347d5df2f6d..a5c6be2fd273 100644 --- a/src/sonic-dhcp-utilities/tests/test_smart_switch.py +++ b/src/sonic-dhcp-utilities/tests/test_smart_switch.py @@ -1,6 +1,7 @@ import json import pytest from common_utils import MockConfigDb, dhcprelayd_refresh_dhcrelay_test, dhcprelayd_proceed_with_check_res_test +from dhcp_utilities.dhcpservd.dhcp_lease import KeaDhcp4LeaseHandler from dhcp_utilities.dhcprelayd.dhcprelayd import DHCP_SERVER_CHECKER, MID_PLANE_CHECKER from dhcp_utilities.dhcpservd.dhcp_cfggen import DhcpServCfgGenerator from dhcp_utilities.common.utils import DhcpDbConnector @@ -35,6 +36,7 @@ }, "subnet4": [ { + "id": 10000, "subnet": "169.254.200.0/24", "pools": [ { @@ -103,6 +105,30 @@ } +expected_lease = { + 'bridge_midplane|aa:bb:cc:dd:ff:01': { + 'ip': '169.254.200.1', + 'lease_end': '1718053209', + 'lease_start': '1718052309' + }, + 'bridge_midplane|aa:bb:cc:dd:ff:02': { + 'ip': '169.254.200.2', + 'lease_end': '1718053210', + 'lease_start': '1718052310' + }, + 'bridge_midplane|aa:bb:cc:dd:ff:03': { + 'ip': '169.254.200.3', + 'lease_end': '1718053210', + 'lease_start': '1718052310' + }, + 'bridge_midplane|aa:bb:cc:dd:ff:04': { + 'ip': '169.254.200.4', + 'lease_end': '1718053209', + 'lease_start': '1718052309' + } +} + + def test_dhcprelayd_refresh_dhcrelay(mock_swsscommon_dbconnector_init): expected_checkers = set(["MidPlaneTableEventChecker"]) dhcprelayd_refresh_dhcrelay_test(expected_checkers, True, mock_get_config_db_table) @@ -140,3 +166,12 @@ def test_dhcp_dhcp_cfggen_generate(mock_swsscommon_dbconnector_init, mock_parse_ def mock_get_config_db_table(table_name): mock_config_db = MockConfigDb(MOCK_CONFIG_DB_PATH_SMART_SWITCH) return mock_config_db.get_config_db_table(table_name) + + +def test_read_kea_lease(mock_swsscommon_dbconnector_init): + with patch.object(DhcpDbConnector, "get_config_db_table", side_effect=mock_get_config_db_table): + db_connector = DhcpDbConnector() + kea_lease_handler = KeaDhcp4LeaseHandler(db_connector, lease_file="tests/test_data/kea-lease_smart_switch.csv") + # Verify whether lease information read is as expected + lease = kea_lease_handler._read() + assert lease == expected_lease From 1e4789b289234526972d449d41622361704b94ad Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Mon, 24 Jun 2024 09:39:02 +0800 Subject: [PATCH 281/282] Create counters only for configured buffer objects on 5400 (#19152) Signed-off-by: Stephen Sun --- .../ACS-SN5400/create_only_config_db_buffers.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/create_only_config_db_buffers.json diff --git a/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/create_only_config_db_buffers.json b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/create_only_config_db_buffers.json new file mode 100644 index 000000000000..6feb156714fe --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5400-r0/ACS-SN5400/create_only_config_db_buffers.json @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "create_only_config_db_buffers": "true" + } + } +} From 63c78c2f0db4f382bec337b380aafd8d164080f0 Mon Sep 17 00:00:00 2001 From: Nonodark Huang Date: Mon, 24 Jun 2024 09:50:33 +0800 Subject: [PATCH 282/282] [UfiSpace][Bookworm][PDDF] Update UfiSpace platfrom codes to support bookworm and add new platforms support. (#18936) * Update old platform code. * s6301-56st * s7801-54xs * s8901-54xc * s9110-32x * s9300-32d * Update code to support Bookworm * s6301-56st * s7801-54xs * s8901-54dc * s9110-32x * s9300-32d * Add new ufispace platforms. * s9301-32d * s9301-32db * Update s9300-32d and s9301-32db bcm port config --- .../installer.conf | 2 +- .../pddf/pd-plugin.json | 24 +- .../pddf/pddf-device.json | 131 +- .../sensors.conf | 1 - .../installer.conf | 2 +- .../pddf/pd-plugin.json | 13 +- .../pddf/pddf-device.json | 47 +- .../sensors.conf | 1 - .../installer.conf | 2 +- .../pddf/pd-plugin.json | 13 +- .../pddf/pddf-device.json | 47 +- .../sensors.conf | 1 - .../UFISPACE-S9110-32X/sai.profile | 0 .../td3-x7-s9110-32x.config.bcm | 0 .../custom_led.bin | Bin .../installer.conf | 2 +- .../led_proc_init.soc | 0 .../pddf/pd-plugin.json | 8 +- .../pddf/pddf-device-beta.json | 139 +- .../pddf/pddf-device-pvt.json | 139 +- .../x86_64-ufispace_s9110_32x-r0/sensors.conf | 1 - .../td4-s9300-32x400G.config.yml | 11 +- .../custom_led.bin | Bin 356 -> 716 bytes .../installer.conf | 2 +- .../pddf/pd-plugin.json | 6 +- .../pddf/pddf-device.json | 200 +- .../platform_components.json | 13 + .../UFISPACE-S9301-32D/hwsku.json | 140 + .../UFISPACE-S9301-32D/port_config.ini | 35 + .../UFISPACE-S9301-32D/sai.profile | 1 + .../th3-s9301-32x400G.config.bcm | 284 + .../cmicx_customer_led.bin | Bin 0 -> 356 bytes .../x86_64-ufispace_s9301_32d-r0/default_sku | 1 + .../x86_64-ufispace_s9301_32d-r0/fancontrol | 10 + .../installer.conf | 4 + .../led_proc_init.soc | 3 + .../x86_64-ufispace_s9301_32d-r0/pcie.yaml | 742 +++ .../pddf/pd-plugin.json | 86 + .../pddf/pddf-device.json | 5092 +++++++++++++++++ .../x86_64-ufispace_s9301_32d-r0/pddf_support | 0 .../platform.json | 659 +++ .../platform_asic | 1 + .../platform_components.json | 13 + .../platform_env.conf | 1 + .../pmon_daemon_control.json | 9 + .../x86_64-ufispace_s9301_32d-r0/sensors.conf | 9 + .../system_health_monitoring_config.json | 15 + .../UFISPACE-S9301-32DB/hwsku.json | 101 + .../UFISPACE-S9301-32DB/port_config.ini | 33 + .../UFISPACE-S9301-32DB/sai.profile | 1 + .../td4-s9301-24x200G-8x400G.config.yml | 503 ++ .../custom_led.bin | Bin 0 -> 648 bytes .../x86_64-ufispace_s9301_32db-r0/default_sku | 1 + .../x86_64-ufispace_s9301_32db-r0/fancontrol | 10 + .../installer.conf | 4 + .../led_proc_init.soc | 4 + .../x86_64-ufispace_s9301_32db-r0/pcie.yaml | 741 +++ .../pddf/pd-plugin.json | 86 + .../pddf/pddf-device.json | 4886 ++++++++++++++++ .../pddf_support | 0 .../platform.json | 613 ++ .../platform_asic | 1 + .../platform_components.json | 13 + .../platform_env.conf | 2 + .../pmon_daemon_control.json | 9 + .../sensors.conf | 9 + .../system_health_monitoring_config.json | 15 + platform/broadcom/one-image.mk | 10 +- .../broadcom/platform-modules-ufispace.dep | 10 + .../broadcom/platform-modules-ufispace.mk | 12 + platform/broadcom/rules.dep | 1 + platform/broadcom/rules.mk | 3 +- .../debian/changelog | 7 + .../debian/control | 12 +- .../debian/rules | 4 +- .../sonic-platform-ufispace-s9300-32d.prerm | 2 + .../sonic-platform-ufispace-s9301-32d.install | 1 + ...sonic-platform-ufispace-s9301-32d.postinst | 3 + .../sonic-platform-ufispace-s9301-32d.prerm | 2 + ...sonic-platform-ufispace-s9301-32db.install | 1 + ...onic-platform-ufispace-s9301-32db.postinst | 3 + .../sonic-platform-ufispace-s9301-32db.prerm | 2 + .../s6301-56st/modules/Makefile | 2 +- .../s6301-56st/modules/pddf_custom_psu.c | 124 + .../modules/x86-64-ufispace-s6301-56st-lpc.c | 130 +- .../x86-64-ufispace-s6301-56st-sys-eeprom.c | 14 +- .../s6301-56st/sonic_platform/chassis.py | 36 +- .../s6301-56st/sonic_platform/fan.py | 58 +- .../s6301-56st/sonic_platform/psu.py | 42 +- .../utils/pddf_pre_driver_install.sh | 11 - .../modules/pddf_custom_sysstatus_module.c | 10 +- .../modules/x86-64-ufispace-s7801-54xs-cpld.c | 12 +- .../x86-64-ufispace-s7801-54xs-sys-eeprom.c | 14 +- .../s7801-54xs/sonic_platform/chassis.py | 11 + .../s7801-54xs/sonic_platform/component.py | 20 +- .../s7801-54xs/sonic_platform/psu.py | 29 + .../utils/pddf_post_device_create.sh | 2 +- .../utils/pddf_pre_driver_install.sh | 8 - .../s7801-54xs/utils/pre_pddf_init.sh | 5 - .../modules/pddf_custom_sysstatus_module.c | 10 +- .../modules/x86-64-ufispace-s8901-54xc-cpld.c | 12 +- .../x86-64-ufispace-s8901-54xc-sys-eeprom.c | 14 +- .../s8901-54xc/sonic_platform/chassis.py | 11 + .../s8901-54xc/sonic_platform/component.py | 20 +- .../s8901-54xc/sonic_platform/psu.py | 29 + .../utils/pddf_post_device_create.sh | 2 +- .../utils/pddf_pre_driver_install.sh | 8 - .../s8901-54xc/utils/pre_pddf_init.sh | 5 - .../modules/pddf_custom_sysstatus_module.c | 10 +- .../modules/x86-64-ufispace-s9110-32x-cpld.c | 14 +- .../x86-64-ufispace-s9110-32x-sys-eeprom.c | 14 +- .../s9110-32x/sonic_platform/chassis.py | 11 + .../s9110-32x/sonic_platform/component.py | 20 +- .../s9110-32x/sonic_platform/fan.py | 1 - .../s9110-32x/sonic_platform/psu.py | 31 +- .../utils/pddf_post_device_create.sh | 2 +- .../utils/pddf_pre_driver_install.sh | 11 - .../modules/pddf_custom_sysstatus_module.c | 9 +- .../modules/x86-64-ufispace-s9300-32d-cpld.c | 3284 +++++------ .../modules/x86-64-ufispace-s9300-32d-cpld.h | 502 +- .../modules/x86-64-ufispace-s9300-32d-lpc.c | 1666 +++--- .../x86-64-ufispace-s9300-32d-sys-eeprom.c | 556 +- .../s9300-32d/sonic_platform/chassis.py | 14 +- .../s9300-32d/sonic_platform/component.py | 20 +- .../s9300-32d/sonic_platform/fan.py | 6 +- .../s9300-32d/sonic_platform/psu.py | 20 +- .../s9300-32d/sonic_platform/sfp.py | 14 + .../utils/pddf_post_device_create.sh | 3 + .../utils/pddf_pre_driver_install.sh | 11 - .../s9301-32d/modules/Makefile | 6 + .../modules/pddf_custom_sysstatus_module.c | 266 + .../modules/x86-64-ufispace-s9301-32d-cpld.c | 1646 ++++++ .../modules/x86-64-ufispace-s9301-32d-cpld.h | 251 + .../modules/x86-64-ufispace-s9301-32d-lpc.c | 850 +++ .../x86-64-ufispace-s9301-32d-sys-eeprom.c | 283 + .../service/pddf-platform-init.service | 1 + .../s9301-32d/sonic_platform/__init__.py | 4 + .../s9301-32d/sonic_platform/chassis.py | 189 + .../s9301-32d/sonic_platform/component.py | 131 + .../s9301-32d/sonic_platform/eeprom.py | 21 + .../s9301-32d/sonic_platform/fan.py | 172 + .../s9301-32d/sonic_platform/fan_drawer.py | 17 + .../sonic_platform/platform.py} | 16 +- .../s9301-32d/sonic_platform/psu.py | 56 + .../s9301-32d/sonic_platform/sfp.py | 31 + .../s9301-32d/sonic_platform/thermal.py | 17 + .../s9301-32d/sonic_platform_setup.py | 27 + .../utils/pddf_post_device_create.sh | 6 + .../utils/pddf_post_driver_install.sh | 2 + .../s9301-32d/utils/pddf_switch_svc.py | 86 + .../s9301-32db/modules/Makefile | 6 + .../modules/pddf_custom_sysstatus_module.c | 266 + .../modules/x86-64-ufispace-s9301-32db-cpld.c | 1656 ++++++ .../modules/x86-64-ufispace-s9301-32db-cpld.h | 256 + .../modules/x86-64-ufispace-s9301-32db-lpc.c | 850 +++ .../x86-64-ufispace-s9301-32db-sys-eeprom.c | 283 + .../service/pddf-platform-init.service | 14 + .../s9301-32db/sonic_platform/__init__.py | 4 + .../s9301-32db/sonic_platform/chassis.py | 189 + .../s9301-32db/sonic_platform/component.py | 131 + .../s9301-32db/sonic_platform/eeprom.py | 21 + .../s9301-32db/sonic_platform/fan.py | 172 + .../s9301-32db/sonic_platform/fan_drawer.py | 17 + .../sonic_platform/platform.py} | 16 +- .../s9301-32db/sonic_platform/psu.py | 56 + .../s9301-32db/sonic_platform/sfp.py | 31 + .../s9301-32db/sonic_platform/thermal.py | 17 + .../s9301-32db/sonic_platform_setup.py | 27 + .../utils/pddf_post_device_create.sh | 6 + .../utils/pddf_post_driver_install.sh | 2 + .../s9301-32db/utils/pddf_switch_svc.py | 86 + 171 files changed, 26521 insertions(+), 3536 deletions(-) delete mode 100644 device/ufispace/x86_64-ufispace_s6301_56st-r0/sensors.conf delete mode 100644 device/ufispace/x86_64-ufispace_s7801_54xs-r0/sensors.conf delete mode 100644 device/ufispace/x86_64-ufispace_s8901_54xc-r0/sensors.conf mode change 100755 => 100644 device/ufispace/x86_64-ufispace_s9110_32x-r0/UFISPACE-S9110-32X/sai.profile mode change 100755 => 100644 device/ufispace/x86_64-ufispace_s9110_32x-r0/UFISPACE-S9110-32X/td3-x7-s9110-32x.config.bcm mode change 100755 => 100644 device/ufispace/x86_64-ufispace_s9110_32x-r0/custom_led.bin mode change 100755 => 100644 device/ufispace/x86_64-ufispace_s9110_32x-r0/led_proc_init.soc delete mode 100644 device/ufispace/x86_64-ufispace_s9110_32x-r0/sensors.conf mode change 100644 => 100755 device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/td4-s9300-32x400G.config.yml create mode 100644 device/ufispace/x86_64-ufispace_s9300_32d-r0/platform_components.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/hwsku.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/port_config.ini create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/sai.profile create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/th3-s9301-32x400G.config.bcm create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/cmicx_customer_led.bin create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/default_sku create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/fancontrol create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/installer.conf create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/led_proc_init.soc create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/pcie.yaml create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/pddf/pd-plugin.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/pddf/pddf-device.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/pddf_support create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/platform.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_asic create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_components.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_env.conf create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/pmon_daemon_control.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/sensors.conf create mode 100644 device/ufispace/x86_64-ufispace_s9301_32d-r0/system_health_monitoring_config.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/hwsku.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/port_config.ini create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/sai.profile create mode 100755 device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/td4-s9301-24x200G-8x400G.config.yml create mode 100755 device/ufispace/x86_64-ufispace_s9301_32db-r0/custom_led.bin create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/default_sku create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/fancontrol create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/installer.conf create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/led_proc_init.soc create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/pcie.yaml create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf/pd-plugin.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf/pddf-device.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf_support create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/platform.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_asic create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_components.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_env.conf create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/pmon_daemon_control.json create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/sensors.conf create mode 100644 device/ufispace/x86_64-ufispace_s9301_32db-r0/system_health_monitoring_config.json create mode 100644 platform/broadcom/platform-modules-ufispace.dep create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.prerm create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.install create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.postinst create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.prerm create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.install create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.postinst create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.prerm create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/pddf_custom_psu.c delete mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/utils/pddf_pre_driver_install.sh delete mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pddf_pre_driver_install.sh delete mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pre_pddf_init.sh delete mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pddf_pre_driver_install.sh delete mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pre_pddf_init.sh delete mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/utils/pddf_pre_driver_install.sh delete mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_pre_driver_install.sh create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/pddf_custom_sysstatus_module.c create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-cpld.c create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-cpld.h create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-lpc.c create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-sys-eeprom.c create mode 120000 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/service/pddf-platform-init.service create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/chassis.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/component.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/eeprom.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/fan.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/fan_drawer.py rename platform/broadcom/sonic-platform-modules-ufispace/{s6301-56st/sonic_platform/watchdog.py => s9301-32d/sonic_platform/platform.py} (58%) create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/psu.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/sfp.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/thermal.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform_setup.py create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_post_device_create.sh create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_post_driver_install.sh create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_switch_svc.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/Makefile create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/pddf_custom_sysstatus_module.c create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-cpld.c create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-cpld.h create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-lpc.c create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-sys-eeprom.c create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/service/pddf-platform-init.service create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/chassis.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/component.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/eeprom.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/fan.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/fan_drawer.py rename platform/broadcom/sonic-platform-modules-ufispace/{s9300-32d/sonic_platform/watchdog.py => s9301-32db/sonic_platform/platform.py} (58%) create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/psu.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/sfp.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/thermal.py create mode 100644 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform_setup.py create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_post_device_create.sh create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_post_driver_install.sh create mode 100755 platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_switch_svc.py diff --git a/device/ufispace/x86_64-ufispace_s6301_56st-r0/installer.conf b/device/ufispace/x86_64-ufispace_s6301_56st-r0/installer.conf index 8f9944da69a6..74b02f076689 100644 --- a/device/ufispace/x86_64-ufispace_s6301_56st-r0/installer.conf +++ b/device/ufispace/x86_64-ufispace_s6301_56st-r0/installer.conf @@ -1,4 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich nomodeset pcie_aspm=off" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="modprobe.blacklist=gpio_ich,qat_c3xxx nomodeset pcie_aspm=off" diff --git a/device/ufispace/x86_64-ufispace_s6301_56st-r0/pddf/pd-plugin.json b/device/ufispace/x86_64-ufispace_s6301_56st-r0/pddf/pd-plugin.json index 49c09b0a7888..eae9cd37952a 100644 --- a/device/ufispace/x86_64-ufispace_s6301_56st-r0/pddf/pd-plugin.json +++ b/device/ufispace/x86_64-ufispace_s6301_56st-r0/pddf/pd-plugin.json @@ -21,6 +21,10 @@ "psu_present": { "i2c": + { + "valmap": { "1":true, "0":false } + }, + "bmc": { "valmap": { "1":true, "0":false } } @@ -33,14 +37,15 @@ "valmap": { "1": true, "0":false } } }, + "psu_support_list": [ - {"Mfr_id": "ASPOWER","Model": "U1A-K10150-DRB-13", "Dir": "EXHAUST"}, - {"Mfr_id": "ASPOWER","Model": "U1A-K0150-B-13", "Dir": "INTAKE"}, - {"Mfr_id": "ASPOWER","Model": "U1D-K0150-A-13", "Dir": "EXHAUST"}, - {"Mfr_id": "ASPOWER","Model": "U1D-K0150-B-13", "Dir": "INTAKE"} + {"Manufacturer": "ASPOWER","Name": "U1A-K10150-DRB-13", "MaxSpd": "PSU_AC_FAN_MAX_SPEED", "Dir": "EXHAUST", "Type": "AC" }, + {"Manufacturer": "ASPOWER","Name": "U1A-K0150-B-13", "MaxSpd": "PSU_AC_FAN_MAX_SPEED", "Dir": "INTAKE", "Type": "AC"}, + {"Manufacturer": "ASPOWER","Name": "U1D-K0150-A-13", "MaxSpd": "PSU_DC_FAN_MAX_SPEED", "Dir": "EXHAUST", "Type": "DC"}, + {"Manufacturer": "ASPOWER","Name": "U1D-K0150-B-13", "MaxSpd": "PSU_DC_FAN_MAX_SPEED", "Dir": "INTAKE", "Type": "DC"} ], - "PSU_FAN_MAX_SPEED":"13000" + "valmap": {"PSU_FAN_MAX_SPEED": "13000", "PSU_AC_FAN_MAX_SPEED": "13000", "PSU_DC_FAN_MAX_SPEED":"13000", "DEFAULT_TYPE": "AC"} }, "FAN": @@ -63,15 +68,6 @@ "FAN_MAX_SPEED":"25000" }, - - "LED": - { - "capability": - { - "ro": ["SYS_LED", "FAN_LED", "PSU1_LED", "PSU2_LED"], - "rw": ["ID_LED"] - } - }, "REBOOT_CAUSE": { "reboot_cause_file": "/host/reboot-cause/reboot-cause.txt" diff --git a/device/ufispace/x86_64-ufispace_s6301_56st-r0/pddf/pddf-device.json b/device/ufispace/x86_64-ufispace_s6301_56st-r0/pddf/pddf-device.json index abf83dd93e48..5f906161fe21 100644 --- a/device/ufispace/x86_64-ufispace_s6301_56st-r0/pddf/pddf-device.json +++ b/device/ufispace/x86_64-ufispace_s6301_56st-r0/pddf/pddf-device.json @@ -24,9 +24,11 @@ "pddf_xcvr" ] }, + "std_perm_kos": [ + "i2c-i801", + "i2c-ismt" + ], "std_kos": [ - "i2c_i801", - "i2c-ismt", "i2c_dev", "i2c_mux_pca954x", "optoe", @@ -41,9 +43,12 @@ "pddf_cpld_driver", "pddf_mux_module", "pddf_xcvr_module", + "pddf_fpgapci_driver", "pddf_xcvr_driver_module", "pddf_psu_driver_module", "pddf_psu_module", + "pddf_fpgai2c_module", + "pddf_fpgai2c_driver", "pddf_fan_driver_module", "pddf_fan_module", "pddf_led_module", @@ -51,7 +56,8 @@ ], "custom_kos": [ "x86-64-ufispace-s6301-56st-lpc", - "x86-64-ufispace-s6301-56st-sys-eeprom" + "x86-64-ufispace-s6301-56st-sys-eeprom", + "pddf_custom_psu" ] }, "SYSTEM": { @@ -861,7 +867,19 @@ { "itf":"pmbus", "dev":"PSU1-PMBUS" }, { "itf":"eeprom", "dev":"PSU1-EEPROM" } ] - } + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "psu_present", + "bmc_cmd": "i2cget -y -f 2 0x58 0x0 > /dev/null 2>&1; [ $? -ne 0 ] && echo '0' || echo '1'", + "raw": "1", + "type": "raw" + } + ] + } + } }, "PSU1-PMBUS": { "dev_info": { @@ -877,16 +895,6 @@ "dev_type": "psu_pmbus" }, "attr_list": [ - { - "attr_name": "psu_present", - "attr_devaddr":"0x33", - "attr_devtype": "cpld", - "attr_devname":"CPLD1", - "attr_offset": "0x59", - "attr_mask": "0x1", - "attr_cmpval": "0x0", - "attr_len": "1" - }, { "attr_name": "psu_power_good", "attr_devaddr": "0x33", @@ -951,6 +959,24 @@ "attr_cmpval": "0xff", "attr_len": "2" }, + { + "attr_name": "psu_v_out_min", + "attr_devaddr": "0x58", + "attr_devtype": "pmbus", + "attr_offset": "0xa4", + "attr_mask": "0x0", + "attr_cmpval": "0xff", + "attr_len": "2" + }, + { + "attr_name": "psu_v_out_max", + "attr_devaddr": "0x58", + "attr_devtype": "pmbus", + "attr_offset": "0xa5", + "attr_mask": "0x0", + "attr_cmpval": "0xff", + "attr_len": "2" + }, { "attr_name": "psu_i_out", "attr_devaddr": "0x58", @@ -969,6 +995,15 @@ "attr_cmpval": "0xff", "attr_len": "2" }, + { + "attr_name": "psu_p_out_max", + "attr_devaddr": "0x58", + "attr_devtype": "pmbus", + "attr_offset": "0xa7", + "attr_mask": "0x0", + "attr_cmpval": "0xff", + "attr_len": "2" + }, { "attr_name": "psu_fan1_speed_rpm", "attr_devaddr": "0x58", @@ -1026,7 +1061,19 @@ { "itf":"pmbus", "dev":"PSU2-PMBUS" }, { "itf":"eeprom", "dev":"PSU2-EEPROM" } ] - } + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "psu_present", + "bmc_cmd": "i2cget -y -f 2 0x59 0x0 > /dev/null 2>&1; [ $? -ne 0 ] && echo '0' || echo '1'", + "raw": "1", + "type": "raw" + } + ] + } + } }, "PSU2-PMBUS": { "dev_info": { @@ -1042,16 +1089,6 @@ "dev_type": "psu_pmbus" }, "attr_list": [ - { - "attr_name": "psu_present", - "attr_devaddr":"0x33", - "attr_devtype": "cpld", - "attr_devname":"CPLD1", - "attr_offset": "0x59", - "attr_mask": "0x2", - "attr_cmpval": "0x0", - "attr_len": "1" - }, { "attr_name": "psu_power_good", "attr_devaddr": "0x33", @@ -1116,6 +1153,24 @@ "attr_cmpval": "0xff", "attr_len": "2" }, + { + "attr_name": "psu_v_out_min", + "attr_devaddr": "0x59", + "attr_devtype": "pmbus", + "attr_offset": "0xa4", + "attr_mask": "0x0", + "attr_cmpval": "0xff", + "attr_len": "2" + }, + { + "attr_name": "psu_v_out_max", + "attr_devaddr": "0x59", + "attr_devtype": "pmbus", + "attr_offset": "0xa5", + "attr_mask": "0x0", + "attr_cmpval": "0xff", + "attr_len": "2" + }, { "attr_name": "psu_i_out", "attr_devaddr": "0x59", @@ -1134,6 +1189,15 @@ "attr_cmpval": "0xff", "attr_len": "2" }, + { + "attr_name": "psu_p_out_max", + "attr_devaddr": "0x59", + "attr_devtype": "pmbus", + "attr_offset": "0xa7", + "attr_mask": "0x0", + "attr_cmpval": "0xff", + "attr_len": "2" + }, { "attr_name": "psu_fan1_speed_rpm", "attr_devaddr": "0x59", @@ -1239,7 +1303,8 @@ "device_name": "SYS_LED" }, "dev_attr": { - "index": "0" + "index": "0", + "flag": "ro" }, "i2c": { "attr_list": [ @@ -1286,13 +1351,14 @@ ] } }, - "ID_LED": { + "LOC_LED": { "dev_info": { "device_type": "LED", "device_name": "LOC_LED" }, "dev_attr": { - "index": "0" + "index": "0", + "flag": "rw" }, "i2c": { "attr_list": [ @@ -1329,7 +1395,8 @@ "device_name": "FAN_LED" }, "dev_attr": { - "index": "0" + "index": "0", + "flag": "ro" }, "i2c": { "attr_list": [ @@ -1382,7 +1449,8 @@ "device_name": "PSU_LED" }, "dev_attr": { - "index": "1" + "index": "1", + "flag": "ro" }, "i2c": { "attr_list": [ @@ -1435,7 +1503,8 @@ "device_name": "PSU_LED" }, "dev_attr": { - "index": "0" + "index": "0", + "flag": "ro" }, "i2c": { "attr_list": [ diff --git a/device/ufispace/x86_64-ufispace_s6301_56st-r0/sensors.conf b/device/ufispace/x86_64-ufispace_s6301_56st-r0/sensors.conf deleted file mode 100644 index b1a69433405b..000000000000 --- a/device/ufispace/x86_64-ufispace_s6301_56st-r0/sensors.conf +++ /dev/null @@ -1 +0,0 @@ -# libsensors configuration file diff --git a/device/ufispace/x86_64-ufispace_s7801_54xs-r0/installer.conf b/device/ufispace/x86_64-ufispace_s7801_54xs-r0/installer.conf index 8f9944da69a6..74b02f076689 100644 --- a/device/ufispace/x86_64-ufispace_s7801_54xs-r0/installer.conf +++ b/device/ufispace/x86_64-ufispace_s7801_54xs-r0/installer.conf @@ -1,4 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich nomodeset pcie_aspm=off" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="modprobe.blacklist=gpio_ich,qat_c3xxx nomodeset pcie_aspm=off" diff --git a/device/ufispace/x86_64-ufispace_s7801_54xs-r0/pddf/pd-plugin.json b/device/ufispace/x86_64-ufispace_s7801_54xs-r0/pddf/pd-plugin.json index 81ff5e283bc9..842d9996a0ba 100644 --- a/device/ufispace/x86_64-ufispace_s7801_54xs-r0/pddf/pd-plugin.json +++ b/device/ufispace/x86_64-ufispace_s7801_54xs-r0/pddf/pd-plugin.json @@ -55,16 +55,19 @@ "psu_support_list": [ - {"Manufacturer": "FSPGROUP", "Name": "YNEB0450BM", "MaxSpd": "PSU_FAN_MAX_SPEED_AC"}, - {"Manufacturer": "FSPGROUP", "Name": "YNEB0450AM", "MaxSpd": "PSU_FAN_MAX_SPEED_DC"}, - {"Manufacturer": "DELTA", "Name": "DPS-450AB-27", "MaxSpd": "PSU_FAN_MAX_SPEED_AC"}, - {"Manufacturer": "DELTA", "Name": "DPS-450AB-28", "MaxSpd": "PSU_FAN_MAX_SPEED_DC"} + {"Manufacturer": "FSPGROUP", "Name": "YNEB0450BM", "MaxSpd": "PSU_FAN_MAX_SPEED_AC", "Type": "AC"}, + {"Manufacturer": "FSPGROUP", "Name": "YNEB0450AM", "MaxSpd": "PSU_FAN_MAX_SPEED_DC", "Type": "DC"}, + {"Manufacturer": "DELTA", "Name": "DPS-450AB-27", "MaxSpd": "PSU_FAN_MAX_SPEED_AC", "Type": "AC"}, + {"Manufacturer": "DELTA", "Name": "DPS-450AB-28", "MaxSpd": "PSU_FAN_MAX_SPEED_DC", "Type": "DC"}, + {"Manufacturer": "DELTA", "Name": "DPS-450AB-32", "MaxSpd": "PSU_FAN_MAX_SPEED_DC", "Type": "DC"}, + {"Manufacturer": "DELTA", "Name": "DPS-450AB-33", "MaxSpd": "PSU_FAN_MAX_SPEED_AC", "Type": "AC"} ], "valmap": { "PSU_FAN_MAX_SPEED":"20000", "PSU_FAN_MAX_SPEED_AC":"20000", - "PSU_FAN_MAX_SPEED_DC":"18000" + "PSU_FAN_MAX_SPEED_DC":"18000", + "DEFAULT_TYPE": "AC" } }, "FAN": diff --git a/device/ufispace/x86_64-ufispace_s7801_54xs-r0/pddf/pddf-device.json b/device/ufispace/x86_64-ufispace_s7801_54xs-r0/pddf/pddf-device.json index 7110b2ed6cc3..640a61800ed4 100644 --- a/device/ufispace/x86_64-ufispace_s7801_54xs-r0/pddf/pddf-device.json +++ b/device/ufispace/x86_64-ufispace_s7801_54xs-r0/pddf/pddf-device.json @@ -18,9 +18,11 @@ "pddf_xcvr" ] }, + "std_perm_kos": [ + "i2c-i801", + "i2c-ismt" + ], "std_kos": [ - "i2c_i801", - "i2c_ismt", "i2c_dev", "i2c_mux_pca954x", "coretemp", @@ -33,9 +35,12 @@ "pddf_cpld_driver", "pddf_mux_module", "pddf_xcvr_module", + "pddf_fpgapci_driver", "pddf_xcvr_driver_module", "pddf_psu_driver_module", "pddf_psu_module", + "pddf_fpgai2c_module", + "pddf_fpgai2c_driver", "pddf_fan_driver_module", "pddf_fan_module", "pddf_led_module", @@ -1907,6 +1912,24 @@ "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f1", "raw": "1", "type": "raw" + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU0_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU0_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU0_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU0_IIN", + "field_pos": "2", + "mult": "1000" } ] } @@ -2030,6 +2053,24 @@ "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f2", "raw": "1", "type": "raw" + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_IIN", + "field_pos": "2", + "mult": "1000" } ] } @@ -2463,7 +2504,7 @@ ] } }, - "ID_LED": { + "LOC_LED": { "dev_info": { "device_type": "LED", "device_name": "LOC_LED" diff --git a/device/ufispace/x86_64-ufispace_s7801_54xs-r0/sensors.conf b/device/ufispace/x86_64-ufispace_s7801_54xs-r0/sensors.conf deleted file mode 100644 index b1a69433405b..000000000000 --- a/device/ufispace/x86_64-ufispace_s7801_54xs-r0/sensors.conf +++ /dev/null @@ -1 +0,0 @@ -# libsensors configuration file diff --git a/device/ufispace/x86_64-ufispace_s8901_54xc-r0/installer.conf b/device/ufispace/x86_64-ufispace_s8901_54xc-r0/installer.conf index 8f9944da69a6..74b02f076689 100644 --- a/device/ufispace/x86_64-ufispace_s8901_54xc-r0/installer.conf +++ b/device/ufispace/x86_64-ufispace_s8901_54xc-r0/installer.conf @@ -1,4 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich nomodeset pcie_aspm=off" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="modprobe.blacklist=gpio_ich,qat_c3xxx nomodeset pcie_aspm=off" diff --git a/device/ufispace/x86_64-ufispace_s8901_54xc-r0/pddf/pd-plugin.json b/device/ufispace/x86_64-ufispace_s8901_54xc-r0/pddf/pd-plugin.json index 81ff5e283bc9..842d9996a0ba 100644 --- a/device/ufispace/x86_64-ufispace_s8901_54xc-r0/pddf/pd-plugin.json +++ b/device/ufispace/x86_64-ufispace_s8901_54xc-r0/pddf/pd-plugin.json @@ -55,16 +55,19 @@ "psu_support_list": [ - {"Manufacturer": "FSPGROUP", "Name": "YNEB0450BM", "MaxSpd": "PSU_FAN_MAX_SPEED_AC"}, - {"Manufacturer": "FSPGROUP", "Name": "YNEB0450AM", "MaxSpd": "PSU_FAN_MAX_SPEED_DC"}, - {"Manufacturer": "DELTA", "Name": "DPS-450AB-27", "MaxSpd": "PSU_FAN_MAX_SPEED_AC"}, - {"Manufacturer": "DELTA", "Name": "DPS-450AB-28", "MaxSpd": "PSU_FAN_MAX_SPEED_DC"} + {"Manufacturer": "FSPGROUP", "Name": "YNEB0450BM", "MaxSpd": "PSU_FAN_MAX_SPEED_AC", "Type": "AC"}, + {"Manufacturer": "FSPGROUP", "Name": "YNEB0450AM", "MaxSpd": "PSU_FAN_MAX_SPEED_DC", "Type": "DC"}, + {"Manufacturer": "DELTA", "Name": "DPS-450AB-27", "MaxSpd": "PSU_FAN_MAX_SPEED_AC", "Type": "AC"}, + {"Manufacturer": "DELTA", "Name": "DPS-450AB-28", "MaxSpd": "PSU_FAN_MAX_SPEED_DC", "Type": "DC"}, + {"Manufacturer": "DELTA", "Name": "DPS-450AB-32", "MaxSpd": "PSU_FAN_MAX_SPEED_DC", "Type": "DC"}, + {"Manufacturer": "DELTA", "Name": "DPS-450AB-33", "MaxSpd": "PSU_FAN_MAX_SPEED_AC", "Type": "AC"} ], "valmap": { "PSU_FAN_MAX_SPEED":"20000", "PSU_FAN_MAX_SPEED_AC":"20000", - "PSU_FAN_MAX_SPEED_DC":"18000" + "PSU_FAN_MAX_SPEED_DC":"18000", + "DEFAULT_TYPE": "AC" } }, "FAN": diff --git a/device/ufispace/x86_64-ufispace_s8901_54xc-r0/pddf/pddf-device.json b/device/ufispace/x86_64-ufispace_s8901_54xc-r0/pddf/pddf-device.json index 18d0dd9abe2b..2fb21d277e57 100644 --- a/device/ufispace/x86_64-ufispace_s8901_54xc-r0/pddf/pddf-device.json +++ b/device/ufispace/x86_64-ufispace_s8901_54xc-r0/pddf/pddf-device.json @@ -18,9 +18,11 @@ "pddf_xcvr" ] }, + "std_perm_kos": [ + "i2c-i801", + "i2c-ismt" + ], "std_kos": [ - "i2c_i801", - "i2c_ismt", "i2c_dev", "i2c_mux_pca954x", "coretemp", @@ -33,9 +35,12 @@ "pddf_cpld_driver", "pddf_mux_module", "pddf_xcvr_module", + "pddf_fpgapci_driver", "pddf_xcvr_driver_module", "pddf_psu_driver_module", "pddf_psu_module", + "pddf_fpgai2c_module", + "pddf_fpgai2c_driver", "pddf_fan_driver_module", "pddf_fan_module", "pddf_led_module", @@ -1907,6 +1912,24 @@ "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f1", "raw": "1", "type": "raw" + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU0_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU0_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU0_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU0_IIN", + "field_pos": "2", + "mult": "1000" } ] } @@ -2030,6 +2053,24 @@ "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f2", "raw": "1", "type": "raw" + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_IIN", + "field_pos": "2", + "mult": "1000" } ] } @@ -2463,7 +2504,7 @@ ] } }, - "ID_LED": { + "LOC_LED": { "dev_info": { "device_type": "LED", "device_name": "LOC_LED" diff --git a/device/ufispace/x86_64-ufispace_s8901_54xc-r0/sensors.conf b/device/ufispace/x86_64-ufispace_s8901_54xc-r0/sensors.conf deleted file mode 100644 index b1a69433405b..000000000000 --- a/device/ufispace/x86_64-ufispace_s8901_54xc-r0/sensors.conf +++ /dev/null @@ -1 +0,0 @@ -# libsensors configuration file diff --git a/device/ufispace/x86_64-ufispace_s9110_32x-r0/UFISPACE-S9110-32X/sai.profile b/device/ufispace/x86_64-ufispace_s9110_32x-r0/UFISPACE-S9110-32X/sai.profile old mode 100755 new mode 100644 diff --git a/device/ufispace/x86_64-ufispace_s9110_32x-r0/UFISPACE-S9110-32X/td3-x7-s9110-32x.config.bcm b/device/ufispace/x86_64-ufispace_s9110_32x-r0/UFISPACE-S9110-32X/td3-x7-s9110-32x.config.bcm old mode 100755 new mode 100644 diff --git a/device/ufispace/x86_64-ufispace_s9110_32x-r0/custom_led.bin b/device/ufispace/x86_64-ufispace_s9110_32x-r0/custom_led.bin old mode 100755 new mode 100644 diff --git a/device/ufispace/x86_64-ufispace_s9110_32x-r0/installer.conf b/device/ufispace/x86_64-ufispace_s9110_32x-r0/installer.conf index 8f9944da69a6..74b02f076689 100644 --- a/device/ufispace/x86_64-ufispace_s9110_32x-r0/installer.conf +++ b/device/ufispace/x86_64-ufispace_s9110_32x-r0/installer.conf @@ -1,4 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich nomodeset pcie_aspm=off" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="modprobe.blacklist=gpio_ich,qat_c3xxx nomodeset pcie_aspm=off" diff --git a/device/ufispace/x86_64-ufispace_s9110_32x-r0/led_proc_init.soc b/device/ufispace/x86_64-ufispace_s9110_32x-r0/led_proc_init.soc old mode 100755 new mode 100644 diff --git a/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pd-plugin.json b/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pd-plugin.json index 775f0c934f05..99e551ed2845 100644 --- a/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pd-plugin.json +++ b/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pd-plugin.json @@ -45,12 +45,12 @@ }, "psu_support_list": [ - {"Manufacturer": "FSPGROUP","Name": "YNEE0750EM", "MaxSpd": "PSU_AC_FAN_MAX_SPEED"}, - {"Manufacturer": "FSPGROUP","Name": "YNEE0750BM", "MaxSpd": "PSU_AC_FAN_MAX_SPEED"}, - {"Manufacturer": "FSPGROUP","Name": "YNEE0750AM", "MaxSpd": "PSU_DC_FAN_MAX_SPEED"} + {"Manufacturer": "FSPGROUP","Name": "YNEE0750EM", "MaxSpd": "PSU_AC_FAN_MAX_SPEED", "Type":"AC"}, + {"Manufacturer": "FSPGROUP","Name": "YNEE0750BM", "MaxSpd": "PSU_AC_FAN_MAX_SPEED", "Type":"AC"}, + {"Manufacturer": "FSPGROUP","Name": "YNEE0750AM", "MaxSpd": "PSU_DC_FAN_MAX_SPEED", "Type":"DC"} ], - "valmap": {"PSU_AC_FAN_MAX_SPEED": "26500", "PSU_DC_FAN_MAX_SPEED":"29000"} + "valmap": {"PSU_AC_FAN_MAX_SPEED": "26500", "PSU_DC_FAN_MAX_SPEED":"29000", "DEFAULT_TYPE": "AC"} }, "FAN": diff --git a/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pddf-device-beta.json b/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pddf-device-beta.json index d55cf071f5c3..aafa6cc81447 100644 --- a/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pddf-device-beta.json +++ b/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pddf-device-beta.json @@ -18,9 +18,11 @@ "pddf_xcvr" ] }, + "std_perm_kos": [ + "i2c-i801", + "i2c-ismt" + ], "std_kos": [ - "i2c_i801", - "i2c-ismt", "i2c_dev", "i2c_mux_pca954x", "optoe" @@ -31,9 +33,12 @@ "pddf_cpld_driver", "pddf_mux_module", "pddf_xcvr_module", + "pddf_fpgapci_driver", "pddf_xcvr_driver_module", "pddf_psu_driver_module", "pddf_psu_module", + "pddf_fpgai2c_module", + "pddf_fpgai2c_driver", "pddf_fan_driver_module", "pddf_fan_module", "pddf_led_module" @@ -65,7 +70,7 @@ }, "SMBUS1": { "dev_info": { - "device_type": "SMBUS", "device_name": "SMBUS1", "device_parent": "SYSTEM" + "device_type": "SMBUS", "device_name": "SMBUS1", "device_parent": "SYSTEM" }, "i2c": { "topo_info": { @@ -752,6 +757,24 @@ "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f1", "raw": "1", "type": "raw" + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU0_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU0_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU0_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU0_IIN", + "field_pos": "2", + "mult": "1000" } ] } @@ -875,6 +898,24 @@ "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f2", "raw": "1", "type": "raw" + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_IIN", + "field_pos": "2", + "mult": "1000" } ] } @@ -1320,7 +1361,7 @@ ] } }, - "ID_LED": { + "LOC_LED": { "dev_info": { "device_type": "LED", "device_name": "LOC_LED" @@ -1360,7 +1401,7 @@ }, "PORT1": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT1", "device_parent": "MUX3" }, @@ -1459,7 +1500,7 @@ }, "PORT2": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT2", "device_parent": "MUX3" }, @@ -1558,7 +1599,7 @@ }, "PORT3": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT3", "device_parent": "MUX3" }, @@ -1657,7 +1698,7 @@ }, "PORT4": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT4", "device_parent": "MUX3" }, @@ -1756,7 +1797,7 @@ }, "PORT5": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT5", "device_parent": "MUX3" }, @@ -1855,7 +1896,7 @@ }, "PORT6": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT6", "device_parent": "MUX3" }, @@ -1954,7 +1995,7 @@ }, "PORT7": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT7", "device_parent": "MUX3" }, @@ -2053,7 +2094,7 @@ }, "PORT8": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT8", "device_parent": "MUX3" }, @@ -2152,7 +2193,7 @@ }, "PORT9": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT9", "device_parent": "MUX4" }, @@ -2251,7 +2292,7 @@ }, "PORT10": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT10", "device_parent": "MUX4" }, @@ -2350,7 +2391,7 @@ }, "PORT11": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT11", "device_parent": "MUX4" }, @@ -2449,7 +2490,7 @@ }, "PORT12": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT12", "device_parent": "MUX4" }, @@ -2548,7 +2589,7 @@ }, "PORT13": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT13", "device_parent": "MUX4" }, @@ -2647,7 +2688,7 @@ }, "PORT14": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT14", "device_parent": "MUX4" }, @@ -2746,7 +2787,7 @@ }, "PORT15": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT15", "device_parent": "MUX4" }, @@ -2845,7 +2886,7 @@ }, "PORT16": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT16", "device_parent": "MUX4" }, @@ -2944,7 +2985,7 @@ }, "PORT17": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT17", "device_parent": "MUX5" }, @@ -3043,7 +3084,7 @@ }, "PORT18": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT18", "device_parent": "MUX5" }, @@ -3142,7 +3183,7 @@ }, "PORT19": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT19", "device_parent": "MUX5" }, @@ -3241,7 +3282,7 @@ }, "PORT20": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT20", "device_parent": "MUX5" }, @@ -3340,7 +3381,7 @@ }, "PORT21": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT21", "device_parent": "MUX5" }, @@ -3439,7 +3480,7 @@ }, "PORT22": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT22", "device_parent": "MUX5" }, @@ -3538,7 +3579,7 @@ }, "PORT23": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT23", "device_parent": "MUX5" }, @@ -3635,17 +3676,17 @@ ] } }, - "PORT24": { - "dev_info": { - "device_type": "QSFP", - "device_name": "PORT24", - "device_parent": "MUX5" - }, - "dev_attr": { - "dev_idx": "24" - }, - "i2c": { - "interface": [ + "PORT24": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT24", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "24" + }, + "i2c": { + "interface": [ { "itf": "eeprom", "dev": "PORT24-EEPROM" @@ -3654,9 +3695,9 @@ "itf": "control", "dev": "PORT24-CTRL" } - ] - } - }, + ] + } + }, "PORT24-EEPROM": { "dev_info": { "device_type": "", @@ -3736,7 +3777,7 @@ }, "PORT25": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT25", "device_parent": "MUX6" }, @@ -3835,7 +3876,7 @@ }, "PORT26": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT26", "device_parent": "MUX6" }, @@ -3934,7 +3975,7 @@ }, "PORT27": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT27", "device_parent": "MUX6" }, @@ -4033,7 +4074,7 @@ }, "PORT28": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT28", "device_parent": "MUX6" }, @@ -4132,7 +4173,7 @@ }, "PORT29": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT29", "device_parent": "MUX6" }, @@ -4231,7 +4272,7 @@ }, "PORT30": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT30", "device_parent": "MUX6" }, @@ -4330,7 +4371,7 @@ }, "PORT31": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT31", "device_parent": "MUX6" }, @@ -4429,7 +4470,7 @@ }, "PORT32": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT32", "device_parent": "MUX6" }, diff --git a/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pddf-device-pvt.json b/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pddf-device-pvt.json index 4f86b045c858..dec149491308 100644 --- a/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pddf-device-pvt.json +++ b/device/ufispace/x86_64-ufispace_s9110_32x-r0/pddf/pddf-device-pvt.json @@ -18,9 +18,11 @@ "pddf_xcvr" ] }, + "std_perm_kos": [ + "i2c-i801", + "i2c-ismt" + ], "std_kos": [ - "i2c_i801", - "i2c-ismt", "i2c_dev", "i2c_mux_pca954x", "optoe" @@ -31,9 +33,12 @@ "pddf_cpld_driver", "pddf_mux_module", "pddf_xcvr_module", + "pddf_fpgapci_driver", "pddf_xcvr_driver_module", "pddf_psu_driver_module", "pddf_psu_module", + "pddf_fpgai2c_module", + "pddf_fpgai2c_driver", "pddf_fan_driver_module", "pddf_fan_module", "pddf_led_module" @@ -65,7 +70,7 @@ }, "SMBUS1": { "dev_info": { - "device_type": "SMBUS", "device_name": "SMBUS1", "device_parent": "SYSTEM" + "device_type": "SMBUS", "device_name": "SMBUS1", "device_parent": "SYSTEM" }, "i2c": { "topo_info": { @@ -752,6 +757,24 @@ "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f1", "raw": "1", "type": "raw" + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU0_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU0_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU0_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU0_IIN", + "field_pos": "2", + "mult": "1000" } ] } @@ -875,6 +898,24 @@ "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f2", "raw": "1", "type": "raw" + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_IIN", + "field_pos": "2", + "mult": "1000" } ] } @@ -1276,7 +1317,7 @@ ] } }, - "ID_LED": { + "LOC_LED": { "dev_info": { "device_type": "LED", "device_name": "LOC_LED" @@ -1316,7 +1357,7 @@ }, "PORT1": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT1", "device_parent": "MUX3" }, @@ -1415,7 +1456,7 @@ }, "PORT2": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT2", "device_parent": "MUX3" }, @@ -1514,7 +1555,7 @@ }, "PORT3": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT3", "device_parent": "MUX3" }, @@ -1613,7 +1654,7 @@ }, "PORT4": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT4", "device_parent": "MUX3" }, @@ -1712,7 +1753,7 @@ }, "PORT5": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT5", "device_parent": "MUX3" }, @@ -1811,7 +1852,7 @@ }, "PORT6": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT6", "device_parent": "MUX3" }, @@ -1910,7 +1951,7 @@ }, "PORT7": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT7", "device_parent": "MUX3" }, @@ -2009,7 +2050,7 @@ }, "PORT8": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT8", "device_parent": "MUX3" }, @@ -2108,7 +2149,7 @@ }, "PORT9": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT9", "device_parent": "MUX4" }, @@ -2207,7 +2248,7 @@ }, "PORT10": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT10", "device_parent": "MUX4" }, @@ -2306,7 +2347,7 @@ }, "PORT11": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT11", "device_parent": "MUX4" }, @@ -2405,7 +2446,7 @@ }, "PORT12": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT12", "device_parent": "MUX4" }, @@ -2504,7 +2545,7 @@ }, "PORT13": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT13", "device_parent": "MUX4" }, @@ -2603,7 +2644,7 @@ }, "PORT14": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT14", "device_parent": "MUX4" }, @@ -2702,7 +2743,7 @@ }, "PORT15": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT15", "device_parent": "MUX4" }, @@ -2801,7 +2842,7 @@ }, "PORT16": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT16", "device_parent": "MUX4" }, @@ -2900,7 +2941,7 @@ }, "PORT17": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT17", "device_parent": "MUX5" }, @@ -2999,7 +3040,7 @@ }, "PORT18": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT18", "device_parent": "MUX5" }, @@ -3098,7 +3139,7 @@ }, "PORT19": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT19", "device_parent": "MUX5" }, @@ -3197,7 +3238,7 @@ }, "PORT20": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT20", "device_parent": "MUX5" }, @@ -3296,7 +3337,7 @@ }, "PORT21": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT21", "device_parent": "MUX5" }, @@ -3395,7 +3436,7 @@ }, "PORT22": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT22", "device_parent": "MUX5" }, @@ -3494,7 +3535,7 @@ }, "PORT23": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT23", "device_parent": "MUX5" }, @@ -3591,17 +3632,17 @@ ] } }, - "PORT24": { - "dev_info": { - "device_type": "QSFP", - "device_name": "PORT24", - "device_parent": "MUX5" - }, - "dev_attr": { - "dev_idx": "24" - }, - "i2c": { - "interface": [ + "PORT24": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT24", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "24" + }, + "i2c": { + "interface": [ { "itf": "eeprom", "dev": "PORT24-EEPROM" @@ -3610,9 +3651,9 @@ "itf": "control", "dev": "PORT24-CTRL" } - ] - } - }, + ] + } + }, "PORT24-EEPROM": { "dev_info": { "device_type": "", @@ -3692,7 +3733,7 @@ }, "PORT25": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT25", "device_parent": "MUX6" }, @@ -3791,7 +3832,7 @@ }, "PORT26": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT26", "device_parent": "MUX6" }, @@ -3890,7 +3931,7 @@ }, "PORT27": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT27", "device_parent": "MUX6" }, @@ -3989,7 +4030,7 @@ }, "PORT28": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT28", "device_parent": "MUX6" }, @@ -4088,7 +4129,7 @@ }, "PORT29": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT29", "device_parent": "MUX6" }, @@ -4187,7 +4228,7 @@ }, "PORT30": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT30", "device_parent": "MUX6" }, @@ -4286,7 +4327,7 @@ }, "PORT31": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT31", "device_parent": "MUX6" }, @@ -4385,7 +4426,7 @@ }, "PORT32": { "dev_info": { - "device_type": "QSFP", + "device_type": "QSFP28", "device_name": "PORT32", "device_parent": "MUX6" }, diff --git a/device/ufispace/x86_64-ufispace_s9110_32x-r0/sensors.conf b/device/ufispace/x86_64-ufispace_s9110_32x-r0/sensors.conf deleted file mode 100644 index 29e3604b4127..000000000000 --- a/device/ufispace/x86_64-ufispace_s9110_32x-r0/sensors.conf +++ /dev/null @@ -1 +0,0 @@ -# libsensors configuration file \ No newline at end of file diff --git a/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/td4-s9300-32x400G.config.yml b/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/td4-s9300-32x400G.config.yml old mode 100644 new mode 100755 index a661adfdc4a4..a96a322940a5 --- a/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/td4-s9300-32x400G.config.yml +++ b/device/ufispace/x86_64-ufispace_s9300_32d-r0/UFISPACE-S9300-32D/td4-s9300-32x400G.config.yml @@ -1,4 +1,4 @@ -#r1.0.0 +#r1.0.2 # # BCM56880 32x400g port configuration. # @@ -26,7 +26,6 @@ device: CORE_CLK_FREQ: CLK_1350MHZ # PP CLOCK FREQUENCY PP_CLK_FREQ: CLK_1350MHZ - VARIANT: DNA_4_9_5_0 ... --- device: @@ -35,12 +34,6 @@ device: FP_ING_OPERMODE: GLOBAL_PIPE_AWARE ... --- -device: - 0: - TM_SCHEDULER_CONFIG: - NUM_MC_Q: NUM_MC_Q_4 -... ---- bcm_device: 0: global: @@ -249,7 +242,7 @@ device: SPEED: 400000 NUM_LANES: 8 FEC_MODE: PC_FEC_RS544_2XN - LINK_TRAINING: 1 + LINK_TRAINING: 0 MAX_FRAME_SIZE: 9416 ? PORT_ID: [38, # Management port 0 (Pipe 1) diff --git a/device/ufispace/x86_64-ufispace_s9300_32d-r0/custom_led.bin b/device/ufispace/x86_64-ufispace_s9300_32d-r0/custom_led.bin index 1cbd43d6a5f1d6e1da31a2b34dbe7888311c98b0..968e54a03e12a9bc347fef7dfde01c14da67b15b 100644 GIT binary patch literal 716 zcmYk(Ur1A70EY4N9W}8LA`%wM3`#Y#;E2cNak}M#UG$hWp4}m3i$7Es$lm(?s((b9Wun;Ln(EpYS=Xh1usUJ! z|21oK75TS@V-Hx_pCZB$u2(c+r08x#)h%Pv2%p)Z3A0jjnwA+hPiVs1t~tGyH|z~K zR9}a~<+FUYMKK^{iEAdJ>eJDGJx9NZs=?T2H{|NXb2(M0C_+(`7{nnS39w-s5|M;t zY)1-q!j4p=L4%GA>_HaxA{YCShXNeLArzq)hfxYA+&GGIRNxqnqY_o9#z~w)E$VO@ z9vCp;LjxMogtKVIIh@A@wBRBxp$+ZmfQ2jQL>Ibo4cBoKJ?KRr`Z0jpxP!YG#1QV` zJ|5s99^o;bU=&X=hH*?Fgh{->OT5BsOk)PKh+rOX@eUubfRFf$FId7?M6rx-_>L9) Tz)!5<7k=Xp{$d?M@IN*H$)APp literal 356 zcmYkyJxBs!9LMqJQG3y;cPONM?lMq`kP0dqx=a6H&`@FYLfE|sS6f?+*${0xN>fdB z(oob8*dVtQEnbsBgH6&9*w|#hwuaC0<=eQ=&?+rbf*N;$ARFd#JjF-6;Uam$HucV3 zQZ$%Wca<%&2lAw^r3bHBoAtFBigi?vtrF=8KGU_|r%t*}$yc+bB(YIeX-Y{;U-8%e z9}ygXm5-m@`X=O9)#b9Y%>>t4Bvosda#~q)^j5)*ZlM@C!!ddUH;05`=1j*7$=yA4P*i<#ZRw@HKp7fSU)^P@)MrblRGI_=Iox0nQoo!Y>}STr2

/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Manufacturer') && echo $_rv || echo 'Manufacturer : N/A'", "raw": "0", + "separator": ":", "field_name": "Manufacturer", - "field_pos": "3", - "delimiter": ":" + "field_pos": "2" }, { "attr_name": "psu_model_name", - "bmc_cmd": "ipmitool fru print 1 | tr -s ' ' | cut -d' ' -f3-5", + "bmc_cmd": "_rv=$(ipmitool fru print 1 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Name') && echo $_rv || echo 'Name : N/A'", "raw": "0", + "separator": ":", "field_name": "Name", - "field_pos": "3", - "delimiter": ":" + "field_pos": "2" }, { "attr_name": "psu_serial_num", - "bmc_cmd": "ipmitool fru print 1 | tr -s ' ' | cut -d' ' -f3-5", + "bmc_cmd": "_rv=$(ipmitool fru print 1 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Serial') && echo $_rv || echo 'Serial : N/A'", "raw": "0", + "separator": ":", "field_name": "Serial", - "field_pos": "3", - "delimiter": ":" + "field_pos": "2" }, { "attr_name": "psu_fan1_dir", @@ -1211,72 +1193,96 @@ "attr_list": [ { "attr_name": "psu_present", - "bmc_cmd": "ipmitool sensor", + "bmc_cmd": "ipmitool sdr -c get PSU1_PRSNT_L | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", "raw": "0", "field_name": "PSU1_PRSNT_L", - "field_pos": "7" + "field_pos": "5", + "separator": "," }, { "attr_name": "psu_power_good", - "bmc_cmd": "ipmitool sensor", + "bmc_cmd": "ipmitool sdr -c get PSU1_PWROK_H | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", "raw": "0", "field_name": "PSU1_PWROK_H", - "field_pos": "7" + "field_pos": "5", + "separator": "," }, { "attr_name": "psu_v_out", - "bmc_cmd": "ipmitool sensor", + "bmc_cmd": "ipmitool sdr -c get PSU1_VOUT | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", "raw": "0", "field_name": "PSU1_VOUT", - "field_pos": "3", - "mult": "1000" + "field_pos": "2", + "mult": "1000", + "separator": "," }, { "attr_name": "psu_i_out", - "bmc_cmd": "ipmitool sensor", + "bmc_cmd": "ipmitool sdr -c get PSU1_IOUT | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", "raw": "0", "field_name": "PSU1_IOUT", - "field_pos": "3", + "field_pos": "2", + "mult": "1000", + "separator": "," + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_IIN", + "field_pos": "2", "mult": "1000" }, { "attr_name": "psu_temp1_input", - "bmc_cmd": "ipmitool sensor", + "bmc_cmd": "ipmitool sdr -c get PSU1_TEMP | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", "raw": "0", "field_name": "PSU1_TEMP", - "field_pos": "3", - "mult": "1000" + "field_pos": "2", + "mult": "1000", + "separator": "," }, { "attr_name": "psu_fan1_speed_rpm", - "bmc_cmd": "ipmitool sensor", + "bmc_cmd": "ipmitool sdr -c get PSU1_FAN1 | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", "raw": "0", "field_name": "PSU1_FAN1", - "field_pos": "3" + "field_pos": "2", + "separator": "," }, { "attr_name": "psu_mfr_id", - "bmc_cmd": "ipmitool fru print 2 | tr -s ' ' | cut -d' ' -f3-5", + "bmc_cmd": "_rv=$(ipmitool fru print 2 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Manufacturer') && echo $_rv || echo 'Manufacturer : N/A'", "raw": "0", + "separator": ":", "field_name": "Manufacturer", - "field_pos": "3", - "delimiter": ":" + "field_pos": "2" }, { "attr_name": "psu_model_name", - "bmc_cmd": "ipmitool fru print 2 | tr -s ' ' | cut -d' ' -f3-5", + "bmc_cmd": "_rv=$(ipmitool fru print 2 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Name') && echo $_rv || echo 'Name : N/A'", "raw": "0", + "separator": ":", "field_name": "Name", - "field_pos": "3", - "delimiter": ":" + "field_pos": "2" }, { "attr_name": "psu_serial_num", - "bmc_cmd": "ipmitool fru print 2 | tr -s ' ' | cut -d' ' -f3-5", + "bmc_cmd": "_rv=$(ipmitool fru print 2 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Serial') && echo $_rv || echo 'Serial : N/A'", "raw": "0", + "separator": ":", "field_name": "Serial", - "field_pos": "3", - "delimiter": ":" + "field_pos": "2" }, { "attr_name": "psu_fan1_dir", @@ -1679,7 +1685,7 @@ ] } }, - "ID_LED": { + "LOC_LED": { "dev_info": { "device_type": "LED", "device_name": "LOC_LED" diff --git a/device/ufispace/x86_64-ufispace_s9300_32d-r0/platform_components.json b/device/ufispace/x86_64-ufispace_s9300_32d-r0/platform_components.json new file mode 100644 index 000000000000..30f8635ca822 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9300_32d-r0/platform_components.json @@ -0,0 +1,13 @@ +{ + "chassis": { + "x86_64-ufispace_s9300_32d-r0": { + "component": { + "CPLD1": { }, + "CPLD2": { }, + "CPLD3": { }, + "BIOS": { }, + "BMC": {} + } + } + } +} diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/hwsku.json b/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/hwsku.json new file mode 100644 index 000000000000..066985e74dd5 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/hwsku.json @@ -0,0 +1,140 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet8": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet16": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet24": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet32": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet40": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet48": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet56": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet64": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet72": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet80": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet88": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet96": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet104": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet112": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet120": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet128": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet136": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet144": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet152": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet160": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet168": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet176": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet184": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet192": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet200": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet208": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet216": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet224": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet232": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet240": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet248": { + "default_brkout_mode": "1x400G" + }, + + "Ethernet256": { + "default_brkout_mode": "1x10G" + }, + + "Ethernet257": { + "default_brkout_mode": "1x10G" + } + } +} + diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/port_config.ini b/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/port_config.ini new file mode 100644 index 000000000000..9bbc85e114fb --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/port_config.ini @@ -0,0 +1,35 @@ +# name lanes alias index speed +Ethernet0 1,2,3,4,5,6,7,8 Ethernet1/1 0 400000 +Ethernet8 9,10,11,12,13,14,15,16 Ethernet2/1 1 400000 +Ethernet16 17,18,19,20,21,22,23,24 Ethernet3/1 2 400000 +Ethernet24 25,26,27,28,29,30,31,32 Ethernet4/1 3 400000 +Ethernet32 33,34,35,36,37,38,39,40 Ethernet5/1 4 400000 +Ethernet40 41,42,43,44,45,46,47,48 Ethernet6/1 5 400000 +Ethernet48 49,50,51,52,53,54,55,56 Ethernet7/1 6 400000 +Ethernet56 57,58,59,60,61,62,63,64 Ethernet8/1 7 400000 +Ethernet64 65,66,67,68,69,70,71,72 Ethernet9/1 8 400000 +Ethernet72 73,74,75,76,77,78,79,80 Ethernet10/1 9 400000 +Ethernet80 81,82,83,84,85,86,87,88 Ethernet11/1 10 400000 +Ethernet88 89,90,91,92,93,94,95,96 Ethernet12/1 11 400000 +Ethernet96 97,98,99,100,101,102,103,104 Ethernet13/1 12 400000 +Ethernet104 105,106,107,108,109,110,111,112 Ethernet14/1 13 400000 +Ethernet112 113,114,115,116,117,118,119,120 Ethernet15/1 14 400000 +Ethernet120 121,122,123,124,125,126,127,128 Ethernet16/1 15 400000 +Ethernet128 129,130,131,132,133,134,135,136 Ethernet17/1 16 400000 +Ethernet136 137,138,139,140,141,142,143,144 Ethernet18/1 17 400000 +Ethernet144 145,146,147,148,149,150,151,152 Ethernet19/1 18 400000 +Ethernet152 153,154,155,156,157,158,159,160 Ethernet20/1 19 400000 +Ethernet160 161,162,163,164,165,166,167,168 Ethernet21/1 20 400000 +Ethernet168 169,170,171,172,173,174,175,176 Ethernet22/1 21 400000 +Ethernet176 177,178,179,180,181,182,183,184 Ethernet23/1 22 400000 +Ethernet184 185,186,187,188,189,190,191,192 Ethernet24/1 23 400000 +Ethernet192 193,194,195,196,197,198,199,200 Ethernet25/1 24 400000 +Ethernet200 201,202,203,204,205,206,207,208 Ethernet26/1 25 400000 +Ethernet208 209,210,211,212,213,214,215,216 Ethernet27/1 26 400000 +Ethernet216 217,218,219,220,221,222,223,224 Ethernet28/1 27 400000 +Ethernet224 225,226,227,228,229,230,231,232 Ethernet29/1 28 400000 +Ethernet232 233,234,235,236,237,238,239,240 Ethernet30/1 29 400000 +Ethernet240 241,242,243,244,245,246,247,248 Ethernet31/1 30 400000 +Ethernet248 249,250,251,252,253,254,255,256 Ethernet32/1 31 400000 +Ethernet256 257 Ethernet33 32 10000 +Ethernet257 258 Ethernet34 33 10000 diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/sai.profile b/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/sai.profile new file mode 100644 index 000000000000..19d521413bc9 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th3-s9301-32x400G.config.bcm diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/th3-s9301-32x400G.config.bcm b/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/th3-s9301-32x400G.config.bcm new file mode 100644 index 000000000000..6f6e84b4d20b --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/UFISPACE-S9301-32D/th3-s9301-32x400G.config.bcm @@ -0,0 +1,284 @@ +# r1.0.0 +sai_tunnel_global_sip_mask_enable=1 +bcm_tunnel_term_compatible_mode=1 +sai_tunnel_support=0 + +pbmp_xport_xe.0=0x8ffff8ffffcffff8ffff8ffff8ffffcffff9fffe + +ccm_dma_enable=0 +ccmdma_intr_enable=0 +mem_cache_enable=0 +parity_correction=0 +parity_enable=0 +phy_enable=0 +phy_null=1 + +core_clock_frequency=1325 +dpr_clock_frequency=1000 +device_clock_frequency=1325 +port_flex_enable=1 +load_firmware=0x2 + +portmap_1=1:400 +portmap_5=9:400 +portmap_9=17:400 +portmap_13=25:400 + +portmap_19=259:10 + +portmap_20=33:400 +portmap_24=41:400 +portmap_28=49:400 +portmap_32=57:400 + +portmap_38=257:10 +#portmap_38=257:10:1 + +portmap_39=260:10 + +portmap_40=65:400 +portmap_44=73:400 +portmap_48=81:400 +portmap_52=89:400 + +portmap_59=261:10 + +portmap_60=97:400 +portmap_64=105:400 +portmap_68=113:400 +portmap_72=121:400 + +portmap_79=262:10 + +portmap_80=129:400 +portmap_84=137:400 +portmap_88=145:400 +portmap_92=153:400 + +portmap_99=263:10 + +portmap_100=161:400 +portmap_104=169:400 +portmap_108=177:400 +portmap_112=185:400 + +portmap_118=258:10 +#portmap_118=258:10:1 + +portmap_119=264:10 + +portmap_120=193:400 +portmap_124=201:400 +portmap_128=209:400 +portmap_132=217:400 + +portmap_139=265:10 + +portmap_140=225:400 +portmap_144=233:400 +portmap_148=241:400 +portmap_152=249:400 + +portmap_159=266:10 + +port_fec_cd=9 + + +phy_chain_rx_lane_map_physical{1}=0x60357412 +phy_chain_tx_lane_map_physical{1}=0x02537164 +serdes_core_rx_polarity_flip_physical{1}=0x53 +serdes_core_tx_polarity_flip_physical{1}=0xa5 + +phy_chain_rx_lane_map_physical{9}=0x31472056 +phy_chain_tx_lane_map_physical{9}=0x51306274 +serdes_core_rx_polarity_flip_physical{9}=0x1e +serdes_core_tx_polarity_flip_physical{9}=0x7d + +phy_chain_rx_lane_map_physical{17}=0x21347065 +phy_chain_tx_lane_map_physical{17}=0x73046512 +serdes_core_rx_polarity_flip_physical{17}=0x78 +serdes_core_tx_polarity_flip_physical{17}=0x1d + +phy_chain_rx_lane_map_physical{25}=0x36507124 +phy_chain_tx_lane_map_physical{25}=0x45102736 +serdes_core_rx_polarity_flip_physical{25}=0xb0 +serdes_core_tx_polarity_flip_physical{25}=0x46 + +phy_chain_rx_lane_map_physical{33}=0x27603145 +phy_chain_tx_lane_map_physical{33}=0x06372514 +serdes_core_rx_polarity_flip_physical{33}=0x24 +serdes_core_tx_polarity_flip_physical{33}=0x66 + +phy_chain_rx_lane_map_physical{41}=0x20643175 +phy_chain_tx_lane_map_physical{41}=0x65107423 +serdes_core_rx_polarity_flip_physical{41}=0xc3 +serdes_core_tx_polarity_flip_physical{41}=0x5a + +phy_chain_rx_lane_map_physical{49}=0x20653174 +phy_chain_tx_lane_map_physical{49}=0x65217043 +serdes_core_rx_polarity_flip_physical{49}=0x27 +serdes_core_tx_polarity_flip_physical{49}=0x92 + +phy_chain_rx_lane_map_physical{57}=0x23417065 +phy_chain_tx_lane_map_physical{57}=0x46102735 +serdes_core_rx_polarity_flip_physical{57}=0x8d +serdes_core_tx_polarity_flip_physical{57}=0x17 + +phy_chain_rx_lane_map_physical{65}=0x32406175 +phy_chain_tx_lane_map_physical{65}=0x26073415 +serdes_core_rx_polarity_flip_physical{65}=0xa6 +serdes_core_tx_polarity_flip_physical{65}=0x4b + +phy_chain_rx_lane_map_physical{73}=0x30642175 +phy_chain_tx_lane_map_physical{73}=0x76415230 +serdes_core_rx_polarity_flip_physical{73}=0x4b +serdes_core_tx_polarity_flip_physical{73}=0x8f + +phy_chain_rx_lane_map_physical{81}=0x21743065 +phy_chain_tx_lane_map_physical{81}=0x42507361 +serdes_core_rx_polarity_flip_physical{81}=0x50 +serdes_core_tx_polarity_flip_physical{81}=0xb2 + +phy_chain_rx_lane_map_physical{89}=0x23407165 +phy_chain_tx_lane_map_physical{89}=0x30147625 +serdes_core_rx_polarity_flip_physical{89}=0x99 +serdes_core_tx_polarity_flip_physical{89}=0x0b + +phy_chain_rx_lane_map_physical{97}=0x10652437 +phy_chain_tx_lane_map_physical{97}=0x76352014 +serdes_core_rx_polarity_flip_physical{97}=0xac +serdes_core_tx_polarity_flip_physical{97}=0xe6 + +phy_chain_rx_lane_map_physical{105}=0x74306521 +phy_chain_tx_lane_map_physical{105}=0x73046215 +serdes_core_rx_polarity_flip_physical{105}=0x96 +serdes_core_tx_polarity_flip_physical{105}=0xaf + +phy_chain_rx_lane_map_physical{113}=0x02741365 +phy_chain_tx_lane_map_physical{113}=0x60425371 +serdes_core_rx_polarity_flip_physical{113}=0x14 +serdes_core_tx_polarity_flip_physical{113}=0xa5 + +phy_chain_rx_lane_map_physical{121}=0x76241503 +phy_chain_tx_lane_map_physical{121}=0x76541320 +serdes_core_rx_polarity_flip_physical{121}=0x59 +serdes_core_tx_polarity_flip_physical{121}=0x5f + +phy_chain_rx_lane_map_physical{129}=0x67351402 +phy_chain_tx_lane_map_physical{129}=0x61047253 +serdes_core_rx_polarity_flip_physical{129}=0x59 +serdes_core_tx_polarity_flip_physical{129}=0x63 + +phy_chain_rx_lane_map_physical{137}=0x21743065 +phy_chain_tx_lane_map_physical{137}=0x61405372 +serdes_core_rx_polarity_flip_physical{137}=0xa5 +serdes_core_tx_polarity_flip_physical{137}=0x31 + +phy_chain_rx_lane_map_physical{145}=0x21743065 +phy_chain_tx_lane_map_physical{145}=0x76503214 +serdes_core_rx_polarity_flip_physical{145}=0x50 +serdes_core_tx_polarity_flip_physical{145}=0x46 + +phy_chain_rx_lane_map_physical{153}=0x10652437 +phy_chain_tx_lane_map_physical{153}=0x42537160 +serdes_core_rx_polarity_flip_physical{153}=0x59 +serdes_core_tx_polarity_flip_physical{153}=0x63 + +phy_chain_rx_lane_map_physical{161}=0x76125340 +phy_chain_tx_lane_map_physical{161}=0x25043716 +serdes_core_rx_polarity_flip_physical{161}=0x6c +serdes_core_tx_polarity_flip_physical{161}=0x1e + +phy_chain_rx_lane_map_physical{169}=0x20743165 +phy_chain_tx_lane_map_physical{169}=0x41507263 +serdes_core_rx_polarity_flip_physical{169}=0xe1 +serdes_core_tx_polarity_flip_physical{169}=0x36 + +phy_chain_rx_lane_map_physical{177}=0x30742165 +phy_chain_tx_lane_map_physical{177}=0x74036125 +serdes_core_rx_polarity_flip_physical{177}=0x9c +serdes_core_tx_polarity_flip_physical{177}=0x58 + +phy_chain_rx_lane_map_physical{185}=0x23406175 +phy_chain_tx_lane_map_physical{185}=0x63127450 +serdes_core_rx_polarity_flip_physical{185}=0x93 +serdes_core_tx_polarity_flip_physical{185}=0x11 + +phy_chain_rx_lane_map_physical{193}=0x23507164 +phy_chain_tx_lane_map_physical{193}=0x75140326 +serdes_core_rx_polarity_flip_physical{193}=0x4d +serdes_core_tx_polarity_flip_physical{193}=0x30 + +phy_chain_rx_lane_map_physical{201}=0x20743165 +phy_chain_tx_lane_map_physical{201}=0x13640275 +serdes_core_rx_polarity_flip_physical{201}=0xe1 +serdes_core_tx_polarity_flip_physical{201}=0x05 + +phy_chain_rx_lane_map_physical{209}=0x30742165 +phy_chain_tx_lane_map_physical{209}=0x03645271 +serdes_core_rx_polarity_flip_physical{209}=0x9c +serdes_core_tx_polarity_flip_physical{209}=0x74 + +phy_chain_rx_lane_map_physical{217}=0x32604175 +phy_chain_tx_lane_map_physical{217}=0x46213750 +serdes_core_rx_polarity_flip_physical{217}=0x53 +serdes_core_tx_polarity_flip_physical{217}=0x2d + +phy_chain_rx_lane_map_physical{225}=0x23471605 +phy_chain_tx_lane_map_physical{225}=0x16304725 +serdes_core_rx_polarity_flip_physical{225}=0x66 +serdes_core_tx_polarity_flip_physical{225}=0xef + +phy_chain_rx_lane_map_physical{233}=0x63051274 +phy_chain_tx_lane_map_physical{233}=0x73046251 +serdes_core_rx_polarity_flip_physical{233}=0x9c +serdes_core_tx_polarity_flip_physical{233}=0xae + +phy_chain_rx_lane_map_physical{241}=0x21473056 +phy_chain_tx_lane_map_physical{241}=0x74503261 +serdes_core_rx_polarity_flip_physical{241}=0x63 +serdes_core_tx_polarity_flip_physical{241}=0x4e + +phy_chain_rx_lane_map_physical{249}=0x76341502 +phy_chain_tx_lane_map_physical{249}=0x45603271 +serdes_core_rx_polarity_flip_physical{249}=0x78 +serdes_core_tx_polarity_flip_physical{249}=0x03 + + +dport_map_enable=1 + +dport_map_port_1=0 +dport_map_port_5=1 +dport_map_port_9=2 +dport_map_port_13=3 +dport_map_port_20=4 +dport_map_port_24=5 +dport_map_port_28=6 +dport_map_port_32=7 +dport_map_port_40=8 +dport_map_port_44=9 +dport_map_port_48=10 +dport_map_port_52=11 +dport_map_port_60=12 +dport_map_port_64=13 +dport_map_port_68=14 +dport_map_port_72=15 +dport_map_port_80=16 +dport_map_port_84=17 +dport_map_port_88=18 +dport_map_port_92=19 +dport_map_port_100=20 +dport_map_port_104=21 +dport_map_port_108=22 +dport_map_port_112=23 +dport_map_port_120=24 +dport_map_port_124=25 +dport_map_port_128=26 +dport_map_port_132=27 +dport_map_port_140=28 +dport_map_port_144=29 +dport_map_port_148=30 +dport_map_port_152=31 + +dport_map_port_38=32 +dport_map_port_118=33 \ No newline at end of file diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/cmicx_customer_led.bin b/device/ufispace/x86_64-ufispace_s9301_32d-r0/cmicx_customer_led.bin new file mode 100644 index 0000000000000000000000000000000000000000..1cbd43d6a5f1d6e1da31a2b34dbe7888311c98b0 GIT binary patch literal 356 zcmYkyJxBs!9LMqJQG3y;cPONM?lMq`kP0dqx=a6H&`@FYLfE|sS6f?+*${0xN>fdB z(oob8*dVtQEnbsBgH6&9*w|#hwuaC0<=eQ=&?+rbf*N;$ARFd#JjF-6;Uam$HucV3 zQZ$%Wca<%&2lAw^r3bHBoAtFBigi?vtrF=8KGU_|r%t*}$yc+bB(YIeX-Y{;U-8%e z9}ygXm5-m@`X=O9)#b9Y%>>t4Bvosda#~q)^j5)*ZlM@C!!ddUH;05`=1j*7$=yA4P*i<#ZRw@HKp7fSU)^P@)MrblRGI_=Iox0nQoo!Y>}STr2

/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Manufacturer') && echo $_rv || echo 'Manufacturer : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Manufacturer", + "field_pos": "2" + }, + { + "attr_name": "psu_model_name", + "bmc_cmd": "_rv=$(ipmitool fru print 1 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Name') && echo $_rv || echo 'Name : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Name", + "field_pos": "2" + }, + { + "attr_name": "psu_serial_num", + "bmc_cmd": "_rv=$(ipmitool fru print 1 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Serial') && echo $_rv || echo 'Serial : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Serial", + "field_pos": "2" + }, + { + "attr_name": "psu_fan1_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f1", + "raw": "1", + "type": "raw" + } + ] + } + } + }, + "PSU2": { + "dev_info": { + "device_type": "PSU", + "device_name": "PSU2", + "device_parent": "SMBUS0" + }, + "dev_attr": { + "dev_idx": "2", + "num_psu_fans": "1" + }, + "i2c": { + "interface": [] + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "psu_present", + "bmc_cmd": "ipmitool sdr -c get PSU1_PRSNT_L | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_PRSNT_L", + "field_pos": "5", + "separator": "," + }, + { + "attr_name": "psu_power_good", + "bmc_cmd": "ipmitool sdr -c get PSU1_PWROK_H | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_PWROK_H", + "field_pos": "5", + "separator": "," + }, + { + "attr_name": "psu_v_out", + "bmc_cmd": "ipmitool sdr -c get PSU1_VOUT | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_VOUT", + "field_pos": "2", + "mult": "1000", + "separator": "," + }, + { + "attr_name": "psu_i_out", + "bmc_cmd": "ipmitool sdr -c get PSU1_IOUT | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_IOUT", + "field_pos": "2", + "mult": "1000", + "separator": "," + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_IIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_temp1_input", + "bmc_cmd": "ipmitool sdr -c get PSU1_TEMP | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_TEMP", + "field_pos": "2", + "mult": "1000", + "separator": "," + }, + { + "attr_name": "psu_fan1_speed_rpm", + "bmc_cmd": "ipmitool sdr -c get PSU1_FAN1 | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_FAN1", + "field_pos": "2", + "separator": "," + }, + { + "attr_name": "psu_mfr_id", + "bmc_cmd": "_rv=$(ipmitool fru print 2 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Manufacturer') && echo $_rv || echo 'Manufacturer : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Manufacturer", + "field_pos": "2" + }, + { + "attr_name": "psu_model_name", + "bmc_cmd": "_rv=$(ipmitool fru print 2 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Name') && echo $_rv || echo 'Name : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Name", + "field_pos": "2" + }, + { + "attr_name": "psu_serial_num", + "bmc_cmd": "_rv=$(ipmitool fru print 2 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Serial') && echo $_rv || echo 'Serial : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Serial", + "field_pos": "2" + }, + { + "attr_name": "psu_fan1_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f2", + "raw": "1", + "type": "raw" + } + ] + } + } + }, + "FAN-CTRL": { + "dev_info": { + "device_type": "FAN", + "device_name": "FAN-CTRL", + "device_parent": "" + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "fan1_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN0_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan2_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN1_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan3_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN2_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan4_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN3_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan5_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN4_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan6_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN5_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan1_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN0_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan1_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN0_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan2_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN1_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan2_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN1_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan3_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN2_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan3_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN2_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan4_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN3_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan4_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN3_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan5_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN4_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan5_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN4_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan6_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN5_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan6_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN5_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan1_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f1", + "raw": "1", + "type": "raw" + }, + { + "attr_name": "fan2_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f2", + "raw": "1", + "type": "raw" + }, + { + "attr_name": "fan3_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f3", + "raw": "1", + "type": "raw" + }, + { + "attr_name": "fan4_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f4", + "raw": "1", + "type": "raw" + }, + { + "attr_name": "fan5_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f5", + "raw": "1", + "type": "raw" + }, + { + "attr_name": "fan6_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f6", + "raw": "1", + "type": "raw" + } + ] + } + } + }, + "SYS_LED": { + "dev_info": { + "device_type": "LED", + "device_name": "SYS_LED" + }, + "dev_attr": { + "index": "0", + "flag": "ro" + }, + "i2c": { + "attr_list": [ + { + "attr_name": "green", + "bits": "7:4", + "descr": "Green", + "value": "0x09;0x0b", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "green_blink", + "bits": "7:4", + "descr": "Green Blinking", + "value": "0x0d;0x0f", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "yellow", + "bits": "7:4", + "descr": "Yellow", + "value": "0x08;0x0a", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "yellow_blink", + "bits": "7:4", + "descr": "Yellow Blinking", + "value": "0x0c;0x0e", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "off", + "bits": "7", + "descr": "Off", + "value": "0x0", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + } + ] + } + }, + "FAN_LED": { + "dev_info": { + "device_type": "LED", + "device_name": "FAN_LED" + }, + "dev_attr": { + "index": "0", + "flag": "ro" + }, + "i2c": { + "attr_list": [ + { + "attr_name": "green", + "bits": "3:0", + "descr": "Green", + "value": "0x09;0x0b", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "green_blink", + "bits": "3:0", + "descr": "Green Blinking", + "value": "0x0d;0x0f", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "yellow", + "bits": "3:0", + "descr": "Yellow", + "value": "0x08;0x0a", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "yellow_blink", + "bits": "3:0", + "descr": "Yellow Blinking", + "value": "0x0c;0x0e", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "off", + "bits": "3", + "descr": "Off", + "value": "0x0", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + } + ] + } + }, + "PSU1_LED": { + "dev_info": { + "device_type": "LED", + "device_name": "PSU_LED" + }, + "dev_attr": { + "index": "0", + "flag": "ro" + }, + "i2c": { + "attr_list": [ + { + "attr_name": "green", + "bits": "3:0", + "descr": "Green", + "value": "0x09;0x0b", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "green_blink", + "bits": "3:0", + "descr": "Green Blinking", + "value": "0x0d;0x0f", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "yellow", + "bits": "3:0", + "descr": "Yellow", + "value": "0x08;0x0a", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "yellow_blink", + "bits": "3:0", + "descr": "Yellow Blinking", + "value": "0x0c;0x0e", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "off", + "bits": "3", + "descr": "Off", + "value": "0x0", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + } + ] + } + }, + "PSU2_LED": { + "dev_info": { + "device_type": "LED", + "device_name": "PSU_LED" + }, + "dev_attr": { + "index": "1", + "flag": "ro" + }, + "i2c": { + "attr_list": [ + { + "attr_name": "green", + "bits": "7:4", + "descr": "Green", + "value": "0x09;0x0b", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "green_blink", + "bits": "7:4", + "descr": "Green Blinking", + "value": "0x0d;0x0f", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "yellow", + "bits": "7:4", + "descr": "Yellow", + "value": "0x08;0x0a", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "yellow_blink", + "bits": "7:4", + "descr": "Yellow Blinking", + "value": "0x0c;0x0e", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "off", + "bits": "7", + "descr": "Off", + "value": "0x0", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + } + ] + } + }, + "LOC_LED": { + "dev_info": { + "device_type": "LED", + "device_name": "LOC_LED" + }, + "dev_attr": { + "index": "0", + "flag": "rw" + }, + "i2c": { + "attr_list": [ + { + "attr_name": "blue", + "bits": "2:1", + "descr": "Blue", + "value": "0x02", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x84" + }, + { + "attr_name": "blue_blink", + "bits": "2:1", + "descr": "Blue Blinking", + "value": "0x03", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x84" + }, + { + "attr_name": "off", + "bits": "2", + "descr": "Off", + "value": "0x0", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x84" + } + ] + } + }, + "PORT1": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT1", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "1" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT1-EEPROM" + }, + { + "itf": "control", + "dev": "PORT1-CTRL" + } + ] + } + }, + "PORT1-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT1-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT1" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x11", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT1-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT1-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT1" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x11", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "0", + "attr_cmpval": "0x1", + "attr_len": "1" + } + ] + } + }, + "PORT2": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT2", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "2" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT2-EEPROM" + }, + { + "itf": "control", + "dev": "PORT2-CTRL" + } + ] + } + }, + "PORT2-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT2-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT2" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x12", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT2-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT2-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT2" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x12", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "1", + "attr_cmpval": "0x2", + "attr_len": "1" + } + ] + } + }, + "PORT3": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT3", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "3" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT3-EEPROM" + }, + { + "itf": "control", + "dev": "PORT3-CTRL" + } + ] + } + }, + "PORT3-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT3-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT3" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x13", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT3-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT3-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT3" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x13", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "2", + "attr_cmpval": "0x4", + "attr_len": "1" + } + ] + } + }, + "PORT4": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT4", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "4" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT4-EEPROM" + }, + { + "itf": "control", + "dev": "PORT4-CTRL" + } + ] + } + }, + "PORT4-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT4-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT4" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x14", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT4-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT4-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT4" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x14", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "3", + "attr_cmpval": "0x8", + "attr_len": "1" + } + ] + } + }, + "PORT5": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT5", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "5" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT5-EEPROM" + }, + { + "itf": "control", + "dev": "PORT5-CTRL" + } + ] + } + }, + "PORT5-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT5-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT5" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x15", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT5-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT5-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT5" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x15", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "4", + "attr_cmpval": "0x10", + "attr_len": "1" + } + ] + } + }, + "PORT6": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT6", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "6" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT6-EEPROM" + }, + { + "itf": "control", + "dev": "PORT6-CTRL" + } + ] + } + }, + "PORT6-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT6-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT6" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x16", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT6-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT6-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT6" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x16", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "5", + "attr_cmpval": "0x20", + "attr_len": "1" + } + ] + } + }, + "PORT7": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT7", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "7" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT7-EEPROM" + }, + { + "itf": "control", + "dev": "PORT7-CTRL" + } + ] + } + }, + "PORT7-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT7-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT7" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x17", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT7-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT7-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT7" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x17", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "6", + "attr_cmpval": "0x40", + "attr_len": "1" + } + ] + } + }, + "PORT8": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT8", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "8" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT8-EEPROM" + }, + { + "itf": "control", + "dev": "PORT8-CTRL" + } + ] + } + }, + "PORT8-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT8-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT8" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x18", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT8-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT8-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT8" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x18", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "7", + "attr_cmpval": "0x80", + "attr_len": "1" + } + ] + } + }, + "PORT9": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT9", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "9" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT9-EEPROM" + }, + { + "itf": "control", + "dev": "PORT9-CTRL" + } + ] + } + }, + "PORT9-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT9-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT9" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x19", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT9-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT9-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT9" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x19", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "0", + "attr_cmpval": "0x1", + "attr_len": "1" + } + ] + } + }, + "PORT10": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT10", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "10" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT10-EEPROM" + }, + { + "itf": "control", + "dev": "PORT10-CTRL" + } + ] + } + }, + "PORT10-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT10-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT10" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1a", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT10-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT10-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT10" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1a", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "1", + "attr_cmpval": "0x2", + "attr_len": "1" + } + ] + } + }, + "PORT11": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT11", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "11" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT11-EEPROM" + }, + { + "itf": "control", + "dev": "PORT11-CTRL" + } + ] + } + }, + "PORT11-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT11-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT11" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1b", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT11-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT11-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT11" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1b", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "2", + "attr_cmpval": "0x4", + "attr_len": "1" + } + ] + } + }, + "PORT12": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT12", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "12" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT12-EEPROM" + }, + { + "itf": "control", + "dev": "PORT12-CTRL" + } + ] + } + }, + "PORT12-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT12-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT12" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1c", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT12-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT12-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT12" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1c", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "3", + "attr_cmpval": "0x8", + "attr_len": "1" + } + ] + } + }, + "PORT13": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT13", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "13" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT13-EEPROM" + }, + { + "itf": "control", + "dev": "PORT13-CTRL" + } + ] + } + }, + "PORT13-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT13-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT13" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1d", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT13-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT13-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT13" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1d", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "4", + "attr_cmpval": "0x10", + "attr_len": "1" + } + ] + } + }, + "PORT14": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT14", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "14" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT14-EEPROM" + }, + { + "itf": "control", + "dev": "PORT14-CTRL" + } + ] + } + }, + "PORT14-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT14-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT14" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1e", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT14-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT14-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT14" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1e", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "5", + "attr_cmpval": "0x20", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "5", + "attr_cmpval": "0x20", + "attr_len": "1" + } + ] + } + }, + "PORT15": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT15", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "15" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT15-EEPROM" + }, + { + "itf": "control", + "dev": "PORT15-CTRL" + } + ] + } + }, + "PORT15-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT15-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT15" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1f", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT15-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT15-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT15" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1f", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "6", + "attr_cmpval": "0x40", + "attr_len": "1" + } + ] + } + }, + "PORT16": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT16", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "16" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT16-EEPROM" + }, + { + "itf": "control", + "dev": "PORT16-CTRL" + } + ] + } + }, + "PORT16-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT16-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT16" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x20", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT16-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT16-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT16" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x20", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "7", + "attr_cmpval": "0x80", + "attr_len": "1" + } + ] + } + }, + "PORT17": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT17", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "17" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT17-EEPROM" + }, + { + "itf": "control", + "dev": "PORT17-CTRL" + } + ] + } + }, + "PORT17-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT17-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT17" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x21", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT17-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT17-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT17" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x21", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "0", + "attr_cmpval": "0x1", + "attr_len": "1" + } + ] + } + }, + "PORT18": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT18", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "18" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT18-EEPROM" + }, + { + "itf": "control", + "dev": "PORT18-CTRL" + } + ] + } + }, + "PORT18-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT18-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT18" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x22", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT18-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT18-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT18" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x22", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "1", + "attr_cmpval": "0x2", + "attr_len": "1" + } + ] + } + }, + "PORT19": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT19", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "19" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT19-EEPROM" + }, + { + "itf": "control", + "dev": "PORT19-CTRL" + } + ] + } + }, + "PORT19-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT19-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT19" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x23", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT19-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT19-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT19" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x23", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "2", + "attr_cmpval": "0x4", + "attr_len": "1" + } + ] + } + }, + "PORT20": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT20", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "20" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT20-EEPROM" + }, + { + "itf": "control", + "dev": "PORT20-CTRL" + } + ] + } + }, + "PORT20-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT20-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT20" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x24", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT20-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT20-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT20" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x24", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "3", + "attr_cmpval": "0x8", + "attr_len": "1" + } + ] + } + }, + "PORT21": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT21", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "21" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT21-EEPROM" + }, + { + "itf": "control", + "dev": "PORT21-CTRL" + } + ] + } + }, + "PORT21-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT21-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT21" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x25", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT21-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT21-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT21" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x25", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "4", + "attr_cmpval": "0x10", + "attr_len": "1" + } + ] + } + }, + "PORT22": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT22", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "22" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT22-EEPROM" + }, + { + "itf": "control", + "dev": "PORT22-CTRL" + } + ] + } + }, + "PORT22-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT22-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT22" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x26", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT22-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT22-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT22" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x26", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "5", + "attr_cmpval": "0x20", + "attr_len": "1" + } + ] + } + }, + "PORT23": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT23", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "23" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT23-EEPROM" + }, + { + "itf": "control", + "dev": "PORT23-CTRL" + } + ] + } + }, + "PORT23-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT23-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT23" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x27", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT23-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT23-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT23" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x27", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "6", + "attr_cmpval": "0x40", + "attr_len": "1" + } + ] + } + }, + "PORT24": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT24", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "24" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT24-EEPROM" + }, + { + "itf": "control", + "dev": "PORT24-CTRL" + } + ] + } + }, + "PORT24-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT24-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT24" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x28", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT24-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT24-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT24" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x28", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "7", + "attr_cmpval": "0x80", + "attr_len": "1" + } + ] + } + }, + "PORT25": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT25", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "25" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT25-EEPROM" + }, + { + "itf": "control", + "dev": "PORT25-CTRL" + } + ] + } + }, + "PORT25-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT25-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT25" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x29", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT25-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT25-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT25" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x29", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "0", + "attr_cmpval": "0x1", + "attr_len": "1" + } + ] + } + }, + "PORT26": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT26", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "26" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT26-EEPROM" + }, + { + "itf": "control", + "dev": "PORT26-CTRL" + } + ] + } + }, + "PORT26-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT26-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT26" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2a", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT26-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT26-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT26" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2a", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "1", + "attr_cmpval": "0x2", + "attr_len": "1" + } + ] + } + }, + "PORT27": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT27", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "27" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT27-EEPROM" + }, + { + "itf": "control", + "dev": "PORT27-CTRL" + } + ] + } + }, + "PORT27-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT27-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT27" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2b", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT27-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT27-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT27" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2b", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "2", + "attr_cmpval": "0x4", + "attr_len": "1" + } + ] + } + }, + "PORT28": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT28", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "28" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT28-EEPROM" + }, + { + "itf": "control", + "dev": "PORT28-CTRL" + } + ] + } + }, + "PORT28-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT28-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT28" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2c", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT28-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT28-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT28" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2c", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "3", + "attr_cmpval": "0x8", + "attr_len": "1" + } + ] + } + }, + "PORT29": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT29", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "29" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT29-EEPROM" + }, + { + "itf": "control", + "dev": "PORT29-CTRL" + } + ] + } + }, + "PORT29-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT29-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT29" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2d", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT29-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT29-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT29" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2d", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "4", + "attr_cmpval": "0x10", + "attr_len": "1" + } + ] + } + }, + "PORT30": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT30", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "30" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT30-EEPROM" + }, + { + "itf": "control", + "dev": "PORT30-CTRL" + } + ] + } + }, + "PORT30-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT30-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT30" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2e", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT30-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT30-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT30" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2e", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "5", + "attr_cmpval": "0x20", + "attr_len": "1" + } + ] + } + }, + "PORT31": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT31", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "31" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT31-EEPROM" + }, + { + "itf": "control", + "dev": "PORT31-CTRL" + } + ] + } + }, + "PORT31-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT31-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT31" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2f", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT31-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT31-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT31" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2f", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "6", + "attr_cmpval": "0x40", + "attr_len": "1" + } + ] + } + }, + "PORT32": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT32", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "32" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT32-EEPROM" + }, + { + "itf": "control", + "dev": "PORT32-CTRL" + } + ] + } + }, + "PORT32-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT32-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT32" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x30", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT32-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT32-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT32" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x30", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "7", + "attr_cmpval": "0x80", + "attr_len": "1" + } + ] + } + }, + "PORT33": { + "dev_info": { + "device_type": "SFP", + "device_name": "PORT33", + "device_parent": "MUX2" + }, + "dev_attr": { + "dev_idx": "33" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT33-EEPROM" + }, + { + "itf": "control", + "dev": "PORT33-CTRL" + } + ] + } + }, + "PORT33-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT33", + "device_parent": "MUX2", + "virt_parent": "PORT33" + }, + "i2c": { + "topo_info": { + "parent_bus": "0xd", + "dev_addr": "0x50", + "dev_type": "optoe2" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT33-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT33-CTRL", + "device_parent": "MUX2", + "virt_parent": "PORT33" + }, + "i2c": { + "topo_info": { + "parent_bus": "0xd", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x1e", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_rxlos", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x1f", + "attr_mask": "2", + "attr_cmpval": "0x4", + "attr_len": "1" + }, + { + "attr_name": "xcvr_txfault", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x1d", + "attr_mask": "2", + "attr_cmpval": "0x4", + "attr_len": "1" + }, + { + "attr_name": "xcvr_txdisable", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x55", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + } + ] + } + }, + "PORT34": { + "dev_info": { + "device_type": "SFP", + "device_name": "PORT34", + "device_parent": "MUX2" + }, + "dev_attr": { + "dev_idx": "34" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT34-EEPROM" + }, + { + "itf": "control", + "dev": "PORT34-CTRL" + } + ] + } + }, + "PORT34-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT34", + "device_parent": "MUX2", + "virt_parent": "PORT34" + }, + "i2c": { + "topo_info": { + "parent_bus": "0xe", + "dev_addr": "0x50", + "dev_type": "optoe2" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT34-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT34-CTRL", + "device_parent": "MUX2", + "virt_parent": "PORT34" + }, + "i2c": { + "topo_info": { + "parent_bus": "0xe", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x1e", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_rxlos", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x1f", + "attr_mask": "3", + "attr_cmpval": "0x8", + "attr_len": "1" + }, + { + "attr_name": "xcvr_txfault", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x1d", + "attr_mask": "3", + "attr_cmpval": "0x8", + "attr_len": "1" + }, + { + "attr_name": "xcvr_txdisable", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x55", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + } + ] + } + } +} diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/pddf_support b/device/ufispace/x86_64-ufispace_s9301_32d-r0/pddf_support new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform.json b/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform.json new file mode 100644 index 000000000000..de873b4d5699 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform.json @@ -0,0 +1,659 @@ +{ + "chassis": { + "name": "S9301-32D", + "components": [ + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + }, + { + "name": "BIOS" + }, + { + "name": "BMC" + } + ], + "fans": [ + { + "name": "Fantray1_1" + }, + { + "name": "Fantray1_2" + }, + { + "name": "Fantray2_1" + }, + { + "name": "Fantray2_2" + }, + { + "name": "Fantray3_1" + }, + { + "name": "Fantray3_2" + }, + { + "name": "Fantray4_1" + }, + { + "name": "Fantray4_2" + }, + { + "name": "Fantray5_1" + }, + { + "name": "Fantray5_2" + }, + { + "name": "Fantray6_1" + }, + { + "name": "Fantray6_2" + } + ], + "fan_drawers":[ + { + "name": "Fantray1", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray1_1" + }, + { + "name": "Fantray1_2" + } + ] + }, + { + "name": "Fantray2", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray2_1" + }, + { + "name": "Fantray2_2" + } + ] + }, + { + "name": "Fantray3", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray3_1" + }, + { + "name": "Fantray3_2" + } + ] + }, + { + "name": "Fantray4", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray4_1" + }, + { + "name": "Fantray4_2" + } + ] + }, + { + "name": "Fantray5", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray5_1" + }, + { + "name": "Fantray5_2" + } + ] + }, + { + "name": "Fantray6", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray6_1" + }, + { + "name": "Fantray6_2" + } + ] + } + ], + "psus": [ + { + "name": "PSU1", + "fans": [ + { + "name": "PSU1_FAN1" + } + ], + "thermals": [ + { + "name": "PSU1_TEMP1" + } + ] + }, + { + "name": "PSU2", + "fans": [ + { + "name": "PSU2_FAN1" + } + ], + "thermals": [ + { + "name": "PSU2_TEMP1" + } + ] + } + ], + "thermals": [ + { + "name": "Temp_CPU_PECI" + }, + { + "name": "Temp_CPU_ENV" + }, + { + "name": "Temp_CPU_ENV2" + }, + { + "name": "Temp_CPU_PECI" + }, + { + "name": "Temp_MAC_DIE" + }, + { + "name": "Temp_MAC_ENV" + }, + { + "name": "Temp_PSU_CONNTOR" + } + ], + "sfps": [ + { + "name": "Ethernet0" + }, + { + "name": "Ethernet8" + }, + { + "name": "Ethernet16" + }, + { + "name": "Ethernet24" + }, + { + "name": "Ethernet32" + }, + { + "name": "Ethernet40" + }, + { + "name": "Ethernet48" + }, + { + "name": "Ethernet56" + }, + { + "name": "Ethernet64" + }, + { + "name": "Ethernet72" + }, + { + "name": "Ethernet80" + }, + { + "name": "Ethernet88" + }, + { + "name": "Ethernet96" + }, + { + "name": "Ethernet104" + }, + { + "name": "Ethernet112" + }, + { + "name": "Ethernet120" + }, + { + "name": "Ethernet128" + }, + { + "name": "Ethernet136" + }, + { + "name": "Ethernet144" + }, + { + "name": "Ethernet152" + }, + { + "name": "Ethernet160" + }, + { + "name": "Ethernet168" + }, + { + "name": "Ethernet176" + }, + { + "name": "Ethernet184" + }, + { + "name": "Ethernet192" + }, + { + "name": "Ethernet200" + }, + { + "name": "Ethernet208" + }, + { + "name": "Ethernet216" + }, + { + "name": "Ethernet224" + }, + { + "name": "Ethernet232" + }, + { + "name": "Ethernet240" + }, + { + "name": "Ethernet248" + }, + { + "name": "Ethernet256" + }, + { + "name": "Ethernet257" + } + ] + }, + "interfaces": { + "Ethernet0": { + "index": "0,0,0,0,0,0,0,0", + "lanes": "1,2,3,4,5,6,7,8", + "breakout_modes": { + "1x400G": ["Eth0(Port0)"], + "2x200G": ["Eth0/1(Port0)", "Eth0/2(Port0)"], + "4x100G": ["Eth0/1(Port0)", "Eth0/2(Port0)", "Eth0/3(Port0)", "Eth0/4(Port0)"], + "8x50G": ["Eth0/1(Port0)", "Eth0/2(Port0)", "Eth0/3(Port0)", "Eth0/4(Port0)", "Eth0/5(Port0)", "Eth0/6(Port0)", "Eth0/7(Port0)", "Eth0/8(Port0)"] + } + }, + + "Ethernet8": { + "index": "1,1,1,1,1,1,1,1", + "lanes": "9,10,11,12,13,14,15,16", + "breakout_modes": { + "1x400G": ["Eth1(Port1)"], + "2x200G": ["Eth1/1(Port1)", "Eth1/2(Port1)"], + "4x100G": ["Eth1/1(Port1)", "Eth1/2(Port1)", "Eth1/3(Port1)", "Eth1/4(Port1)"], + "8x50G": ["Eth1/1(Port1)", "Eth1/2(Port1)", "Eth1/3(Port1)", "Eth1/4(Port1)", "Eth1/5(Port1)", "Eth1/6(Port1)", "Eth1/7(Port1)", "Eth1/8(Port1)"] + } + }, + + "Ethernet16": { + "index": "2,2,2,2,2,2,2,2", + "lanes": "17,18,19,20,21,22,23,24", + "breakout_modes": { + "1x400G": ["Eth2(Port2)"], + "2x200G": ["Eth2/1(Port2)", "Eth2/2(Port2)"], + "4x100G": ["Eth2/1(Port2)", "Eth2/2(Port2)", "Eth2/3(Port2)", "Eth2/4(Port2)"], + "8x50G": ["Eth2/1(Port2)", "Eth2/2(Port2)", "Eth2/3(Port2)", "Eth2/4(Port2)", "Eth2/5(Port2)", "Eth2/6(Port2)", "Eth2/7(Port2)", "Eth2/8(Port2)"] + } + }, + + "Ethernet24": { + "index": "3,3,3,3,3,3,3,3", + "lanes": "25,26,27,28,29,30,31,32", + "breakout_modes": { + "1x400G": ["Eth3(Port3)"], + "2x200G": ["Eth3/1(Port3)", "Eth3/2(Port3)"], + "4x100G": ["Eth3/1(Port3)", "Eth3/2(Port3)", "Eth3/3(Port3)", "Eth3/4(Port3)"], + "8x50G": ["Eth3/1(Port3)", "Eth3/2(Port3)", "Eth3/3(Port3)", "Eth3/4(Port3)", "Eth3/5(Port3)", "Eth3/6(Port3)", "Eth3/7(Port3)", "Eth3/8(Port3)"] + } + }, + + "Ethernet32": { + "index": "4,4,4,4,4,4,4,4", + "lanes": "33,34,35,36,37,38,39,40", + "breakout_modes": { + "1x400G": ["Eth4(Port4)"], + "2x200G": ["Eth4/1(Port4)", "Eth4/2(Port4)"], + "4x100G": ["Eth4/1(Port4)", "Eth4/2(Port4)", "Eth4/3(Port4)", "Eth4/4(Port4)"], + "8x50G": ["Eth4/1(Port4)", "Eth4/2(Port4)", "Eth4/3(Port4)", "Eth4/4(Port4)", "Eth4/5(Port4)", "Eth4/6(Port4)", "Eth4/7(Port4)", "Eth4/8(Port4)"] + } + }, + + "Ethernet40": { + "index": "5,5,5,5,5,5,5,5", + "lanes": "41,42,43,44,45,46,47,48", + "breakout_modes": { + "1x400G": ["Eth5(Port5)"], + "2x200G": ["Eth5/1(Port5)", "Eth5/2(Port5)"], + "4x100G": ["Eth5/1(Port5)", "Eth5/2(Port5)", "Eth5/3(Port5)", "Eth5/4(Port5)"], + "8x50G": ["Eth5/1(Port5)", "Eth5/2(Port5)", "Eth5/3(Port5)", "Eth5/4(Port5)", "Eth5/5(Port5)", "Eth5/6(Port5)", "Eth5/7(Port5)", "Eth5/8(Port5)"] + } + }, + + "Ethernet48": { + "index": "6,6,6,6,6,6,6,6", + "lanes": "49,50,51,52,53,54,55,56", + "breakout_modes": { + "1x400G": ["Eth6(Port6)"], + "2x200G": ["Eth6/1(Port6)", "Eth6/2(Port6)"], + "4x100G": ["Eth6/1(Port6)", "Eth6/2(Port6)", "Eth6/3(Port6)", "Eth6/4(Port6)"], + "8x50G": ["Eth6/1(Port6)", "Eth6/2(Port6)", "Eth6/3(Port6)", "Eth6/4(Port6)", "Eth6/5(Port6)", "Eth6/6(Port6)", "Eth6/7(Port6)", "Eth6/8(Port6)"] + } + }, + + "Ethernet56": { + "index": "7,7,7,7,7,7,7,7", + "lanes": "57,58,59,60,61,62,63,64", + "breakout_modes": { + "1x400G": ["Eth7(Port7)"], + "2x200G": ["Eth7/1(Port7)", "Eth7/2(Port7)"], + "4x100G": ["Eth7/1(Port7)", "Eth7/2(Port7)", "Eth7/3(Port7)", "Eth7/4(Port7)"], + "8x50G": ["Eth7/1(Port7)", "Eth7/2(Port7)", "Eth7/3(Port7)", "Eth7/4(Port7)", "Eth7/5(Port7)", "Eth7/6(Port7)", "Eth7/7(Port7)", "Eth7/8(Port7)"] + } + }, + + "Ethernet64": { + "index": "8,8,8,8,8,8,8,8", + "lanes": "65,66,67,68,69,70,71,72", + "breakout_modes": { + "1x400G": ["Eth8(Port8)"], + "2x200G": ["Eth8/1(Port8)", "Eth8/2(Port8)"], + "4x100G": ["Eth8/1(Port8)", "Eth8/2(Port8)", "Eth8/3(Port8)", "Eth8/4(Port8)"], + "8x50G": ["Eth8/1(Port8)", "Eth8/2(Port8)", "Eth8/3(Port8)", "Eth8/4(Port8)", "Eth8/5(Port8)", "Eth8/6(Port8)", "Eth8/7(Port8)", "Eth8/8(Port8)"] + } + }, + + "Ethernet72": { + "index": "9,9,9,9,9,9,9,9", + "lanes": "73,74,75,76,77,78,79,80", + "breakout_modes": { + "1x400G": ["Eth9(Port9)"], + "2x200G": ["Eth9/1(Port9)", "Eth9/2(Port9)"], + "4x100G": ["Eth9/1(Port9)", "Eth9/2(Port9)", "Eth9/3(Port9)", "Eth9/4(Port9)"], + "8x50G": ["Eth9/1(Port9)", "Eth9/2(Port9)", "Eth9/3(Port9)", "Eth9/4(Port9)", "Eth9/5(Port9)", "Eth9/6(Port9)", "Eth9/7(Port9)", "Eth9/8(Port9)"] + } + }, + + "Ethernet80": { + "index": "10,10,10,10,10,10,10,10", + "lanes": "81,82,83,84,85,86,87,88", + "breakout_modes": { + "1x400G": ["Eth10(Port10)"], + "2x200G": ["Eth10/1(Port10)", "Eth10/2(Port10)"], + "4x100G": ["Eth10/1(Port10)", "Eth10/2(Port10)", "Eth10/3(Port10)", "Eth10/4(Port10)"], + "8x50G": ["Eth10/1(Port10)", "Eth10/2(Port10)", "Eth10/3(Port10)", "Eth10/4(Port10)", "Eth10/5(Port10)", "Eth10/6(Port10)", "Eth10/7(Port10)", "Eth10/8(Port10)"] + } + }, + + "Ethernet88": { + "index": "11,11,11,11,11,11,11,11", + "lanes": "89,90,91,92,93,94,95,96", + "breakout_modes": { + "1x400G": ["Eth11(Port11)"], + "2x200G": ["Eth11/1(Port11)", "Eth11/2(Port11)"], + "4x100G": ["Eth11/1(Port11)", "Eth11/2(Port11)", "Eth11/3(Port11)", "Eth11/4(Port11)"], + "8x50G": ["Eth11/1(Port11)", "Eth11/2(Port11)", "Eth11/3(Port11)", "Eth11/4(Port11)", "Eth11/5(Port11)", "Eth11/6(Port11)", "Eth11/7(Port11)", "Eth11/8(Port11)"] + } + }, + + "Ethernet96": { + "index": "12,12,12,12,12,12,12,12", + "lanes": "97,98,99,100,101,102,103,104", + "breakout_modes": { + "1x400G": ["Eth12(Port12)"], + "2x200G": ["Eth12/1(Port12)", "Eth12/2(Port12)"], + "4x100G": ["Eth12/1(Port12)", "Eth12/2(Port12)", "Eth12/3(Port12)", "Eth12/4(Port12)"], + "8x50G": ["Eth12/1(Port12)", "Eth12/2(Port12)", "Eth12/3(Port12)", "Eth12/4(Port12)", "Eth12/5(Port12)", "Eth12/6(Port12)", "Eth12/7(Port12)", "Eth12/8(Port12)"] + } + }, + + "Ethernet104": { + "index": "13,13,13,13,13,13,13,13", + "lanes": "105,106,107,108,109,110,111,112", + "breakout_modes": { + "1x400G": ["Eth13(Port13)"], + "2x200G": ["Eth13/1(Port13)", "Eth13/2(Port13)"], + "4x100G": ["Eth13/1(Port13)", "Eth13/2(Port13)", "Eth13/3(Port13)", "Eth13/4(Port13)"], + "8x50G": ["Eth13/1(Port13)", "Eth13/2(Port13)", "Eth13/3(Port13)", "Eth13/4(Port13)", "Eth13/5(Port13)", "Eth13/6(Port13)", "Eth13/7(Port13)", "Eth13/8(Port13)"] + } + }, + + "Ethernet112": { + "index": "14,14,14,14,14,14,14,14", + "lanes": "113,114,115,116,117,118,119,120", + "breakout_modes": { + "1x400G": ["Eth14(Port14)"], + "2x200G": ["Eth14/1(Port14)", "Eth14/2(Port14)"], + "4x100G": ["Eth14/1(Port14)", "Eth14/2(Port14)", "Eth14/3(Port14)", "Eth14/4(Port14)"], + "8x50G": ["Eth14/1(Port14)", "Eth14/2(Port14)", "Eth14/3(Port14)", "Eth14/4(Port14)", "Eth14/5(Port14)", "Eth14/6(Port14)", "Eth14/7(Port14)", "Eth14/8(Port14)"] + } + }, + + "Ethernet120": { + "index": "15,15,15,15,15,15,15,15", + "lanes": "121,122,123,124,125,126,127,128", + "breakout_modes": { + "1x400G": ["Eth15(Port15)"], + "2x200G": ["Eth15/1(Port15)", "Eth15/2(Port15)"], + "4x100G": ["Eth15/1(Port15)", "Eth15/2(Port15)", "Eth15/3(Port15)", "Eth15/4(Port15)"], + "8x50G": ["Eth15/1(Port15)", "Eth15/2(Port15)", "Eth15/3(Port15)", "Eth15/4(Port15)", "Eth15/5(Port15)", "Eth15/6(Port15)", "Eth15/7(Port15)", "Eth15/8(Port15)"] + } + }, + + "Ethernet128": { + "index": "16,16,16,16,16,16,16,16", + "lanes": "129,130,131,132,133,134,135,136", + "breakout_modes": { + "1x400G": ["Eth16(Port16)"], + "2x200G": ["Eth16/1(Port16)", "Eth16/2(Port16)"], + "4x100G": ["Eth16/1(Port16)", "Eth16/2(Port16)", "Eth16/3(Port16)", "Eth16/4(Port16)"], + "8x50G": ["Eth16/1(Port16)", "Eth16/2(Port16)", "Eth16/3(Port16)", "Eth16/4(Port16)", "Eth16/5(Port16)", "Eth16/6(Port16)", "Eth16/7(Port16)", "Eth16/8(Port16)"] + } + }, + + "Ethernet136": { + "index": "17,17,17,17,17,17,17,17", + "lanes": "137,138,139,140,141,142,143,144", + "breakout_modes": { + "1x400G": ["Eth17(Port17)"], + "2x200G": ["Eth17/1(Port17)", "Eth17/2(Port17)"], + "4x100G": ["Eth17/1(Port17)", "Eth17/2(Port17)", "Eth17/3(Port17)", "Eth17/4(Port17)"], + "8x50G": ["Eth17/1(Port17)", "Eth17/2(Port17)", "Eth17/3(Port17)", "Eth17/4(Port17)", "Eth17/5(Port17)", "Eth17/6(Port17)", "Eth17/7(Port17)", "Eth17/8(Port17)"] + } + }, + + "Ethernet144": { + "index": "18,18,18,18,18,18,18,18", + "lanes": "145,146,147,148,149,150,151,152", + "breakout_modes": { + "1x400G": ["Eth18(Port18)"], + "2x200G": ["Eth18/1(Port18)", "Eth18/2(Port18)"], + "4x100G": ["Eth18/1(Port18)", "Eth18/2(Port18)", "Eth18/3(Port18)", "Eth18/4(Port18)"], + "8x50G": ["Eth18/1(Port18)", "Eth18/2(Port18)", "Eth18/3(Port18)", "Eth18/4(Port18)", "Eth18/5(Port18)", "Eth18/6(Port18)", "Eth18/7(Port18)", "Eth18/8(Port18)"] + } + }, + + "Ethernet152": { + "index": "19,19,19,19,19,19,19,19", + "lanes": "153,154,155,156,157,158,159,160", + "breakout_modes": { + "1x400G": ["Eth19(Port19)"], + "2x200G": ["Eth19/1(Port19)", "Eth19/2(Port19)"], + "4x100G": ["Eth19/1(Port19)", "Eth19/2(Port19)", "Eth19/3(Port19)", "Eth19/4(Port19)"], + "8x50G": ["Eth19/1(Port19)", "Eth19/2(Port19)", "Eth19/3(Port19)", "Eth19/4(Port19)", "Eth19/5(Port19)", "Eth19/6(Port19)", "Eth19/7(Port19)", "Eth19/8(Port19)"] + } + }, + + "Ethernet160": { + "index": "20,20,20,20,20,20,20,20", + "lanes": "161,162,163,164,165,166,167,168", + "breakout_modes": { + "1x400G": ["Eth20(Port20)"], + "2x200G": ["Eth20/1(Port20)", "Eth20/2(Port20)"], + "4x100G": ["Eth20/1(Port20)", "Eth20/2(Port20)", "Eth20/3(Port20)", "Eth20/4(Port20)"], + "8x50G": ["Eth20/1(Port20)", "Eth20/2(Port20)", "Eth20/3(Port20)", "Eth20/4(Port20)", "Eth20/5(Port20)", "Eth20/6(Port20)", "Eth20/7(Port20)", "Eth20/8(Port20)"] + } + }, + + "Ethernet168": { + "index": "21,21,21,21,21,21,21,21", + "lanes": "169,170,171,172,173,174,175,176", + "breakout_modes": { + "1x400G": ["Eth21(Port21)"], + "2x200G": ["Eth21/1(Port21)", "Eth21/2(Port21)"], + "4x100G": ["Eth21/1(Port21)", "Eth21/2(Port21)", "Eth21/3(Port21)", "Eth21/4(Port21)"], + "8x50G": ["Eth21/1(Port21)", "Eth21/2(Port21)", "Eth21/3(Port21)", "Eth21/4(Port21)", "Eth21/5(Port21)", "Eth21/6(Port21)", "Eth21/7(Port21)", "Eth21/8(Port21)"] + } + }, + + "Ethernet176": { + "index": "22,22,22,22,22,22,22,22", + "lanes": "177,178,179,180,181,182,183,184", + "breakout_modes": { + "1x400G": ["Eth22(Port22)"], + "2x200G": ["Eth22/1(Port22)", "Eth22/2(Port22)"], + "4x100G": ["Eth22/1(Port22)", "Eth22/2(Port22)", "Eth22/3(Port22)", "Eth22/4(Port22)"], + "8x50G": ["Eth22/1(Port22)", "Eth22/2(Port22)", "Eth22/3(Port22)", "Eth22/4(Port22)", "Eth22/5(Port22)", "Eth22/6(Port22)", "Eth22/7(Port22)", "Eth22/8(Port22)"] + } + }, + + "Ethernet184": { + "index": "23,23,23,23,23,23,23,23", + "lanes": "185,186,187,188,189,190,191,192", + "breakout_modes": { + "1x400G": ["Eth23(Port23)"], + "2x200G": ["Eth23/1(Port23)", "Eth23/2(Port23)"], + "4x100G": ["Eth23/1(Port23)", "Eth23/2(Port23)", "Eth23/3(Port23)", "Eth23/4(Port23)"], + "8x50G": ["Eth23/1(Port23)", "Eth23/2(Port23)", "Eth23/3(Port23)", "Eth23/4(Port23)", "Eth23/5(Port23)", "Eth23/6(Port23)", "Eth23/7(Port23)", "Eth23/8(Port23)"] + } + }, + + "Ethernet192": { + "index": "24,24,24,24,24,24,24,24", + "lanes": "193,194,195,196,197,198,199,200", + "breakout_modes": { + "1x400G": ["Eth24(Port24)"], + "2x200G": ["Eth24/1(Port24)", "Eth24/2(Port24)"], + "4x100G": ["Eth24/1(Port24)", "Eth24/2(Port24)", "Eth24/3(Port24)", "Eth24/4(Port24)"], + "8x50G": ["Eth24/1(Port24)", "Eth24/2(Port24)", "Eth24/3(Port24)", "Eth24/4(Port24)", "Eth24/5(Port24)", "Eth24/6(Port24)", "Eth24/7(Port24)", "Eth24/8(Port24)"] + } + }, + + "Ethernet200": { + "index": "25,25,25,25,25,25,25,25", + "lanes": "201,202,203,204,205,206,207,208", + "breakout_modes": { + "1x400G": ["Eth25(Port25)"], + "2x200G": ["Eth25/1(Port25)", "Eth25/2(Port25)"], + "4x100G": ["Eth25/1(Port25)", "Eth25/2(Port25)", "Eth25/3(Port25)", "Eth25/4(Port25)"], + "8x50G": ["Eth25/1(Port25)", "Eth25/2(Port25)", "Eth25/3(Port25)", "Eth25/4(Port25)", "Eth25/5(Port25)", "Eth25/6(Port25)", "Eth25/7(Port25)", "Eth25/8(Port25)"] + } + }, + + "Ethernet208": { + "index": "26,26,26,26,26,26,26,26", + "lanes": "209,210,211,212,213,214,215,216", + "breakout_modes": { + "1x400G": ["Eth26(Port26)"], + "2x200G": ["Eth26/1(Port26)", "Eth26/2(Port26)"], + "4x100G": ["Eth26/1(Port26)", "Eth26/2(Port26)", "Eth26/3(Port26)", "Eth26/4(Port26)"], + "8x50G": ["Eth26/1(Port26)", "Eth26/2(Port26)", "Eth26/3(Port26)", "Eth26/4(Port26)", "Eth26/5(Port26)", "Eth26/6(Port26)", "Eth26/7(Port26)", "Eth26/8(Port26)"] + } + }, + + "Ethernet216": { + "index": "27,27,27,27,27,27,27,27", + "lanes": "217,218,219,220,221,222,223,224", + "breakout_modes": { + "1x400G": ["Eth27(Port27)"], + "2x200G": ["Eth27/1(Port27)", "Eth27/2(Port27)"], + "4x100G": ["Eth27/1(Port27)", "Eth27/2(Port27)", "Eth27/3(Port27)", "Eth27/4(Port27)"], + "8x50G": ["Eth27/1(Port27)", "Eth27/2(Port27)", "Eth27/3(Port27)", "Eth27/4(Port27)", "Eth27/5(Port27)", "Eth27/6(Port27)", "Eth27/7(Port27)", "Eth27/8(Port27)"] + } + }, + + "Ethernet224": { + "index": "28,28,28,28,28,28,28,28", + "lanes": "225,226,227,228,229,230,231,232", + "breakout_modes": { + "1x400G": ["Eth28(Port28)"], + "2x200G": ["Eth28/1(Port28)", "Eth28/2(Port28)"], + "4x100G": ["Eth28/1(Port28)", "Eth28/2(Port28)", "Eth28/3(Port28)", "Eth28/4(Port28)"], + "8x50G": ["Eth28/1(Port28)", "Eth28/2(Port28)", "Eth28/3(Port28)", "Eth28/4(Port28)", "Eth28/5(Port28)", "Eth28/6(Port28)", "Eth28/7(Port28)", "Eth28/8(Port28)"] + } + }, + + "Ethernet232": { + "index": "29,29,29,29,29,29,29,29", + "lanes": "233,234,235,236,237,238,239,240", + "breakout_modes": { + "1x400G": ["Eth29(Port29)"], + "2x200G": ["Eth29/1(Port29)", "Eth29/2(Port29)"], + "4x100G": ["Eth29/1(Port29)", "Eth29/2(Port29)", "Eth29/3(Port29)", "Eth29/4(Port29)"], + "8x50G": ["Eth29/1(Port29)", "Eth29/2(Port29)", "Eth29/3(Port29)", "Eth29/4(Port29)", "Eth29/5(Port29)", "Eth29/6(Port29)", "Eth29/7(Port29)", "Eth29/8(Port29)"] + } + }, + + "Ethernet240": { + "index": "30,30,30,30,30,30,30,30", + "lanes": "241,242,243,244,245,246,247,248", + "breakout_modes": { + "1x400G": ["Eth30(Port30)"], + "2x200G": ["Eth30/1(Port30)", "Eth30/2(Port30)"], + "4x100G": ["Eth30/1(Port30)", "Eth30/2(Port30)", "Eth30/3(Port30)", "Eth30/4(Port30)"], + "8x50G": ["Eth30/1(Port30)", "Eth30/2(Port30)", "Eth30/3(Port30)", "Eth30/4(Port30)", "Eth30/5(Port30)", "Eth30/6(Port30)", "Eth30/7(Port30)", "Eth30/8(Port30)"] + } + }, + + "Ethernet248": { + "index": "31,31,31,31,31,31,31,31", + "lanes": "249,250,251,252,253,254,255,256", + "breakout_modes": { + "1x400G": ["Eth31(Port31)"], + "2x200G": ["Eth31/1(Port31)", "Eth31/2(Port31)"], + "4x100G": ["Eth31/1(Port31)", "Eth31/2(Port31)", "Eth31/3(Port31)", "Eth31/4(Port31)"], + "8x50G": ["Eth31/1(Port31)", "Eth31/2(Port31)", "Eth31/3(Port31)", "Eth31/4(Port31)", "Eth31/5(Port31)", "Eth31/6(Port31)", "Eth31/7(Port31)", "Eth31/8(Port31)"] + } + }, + + "Ethernet256": { + "index": "32", + "lanes": "257", + "breakout_modes": { + "1x10G": ["Eth32(Port32)"] + } + }, + + "Ethernet257": { + "index": "33", + "lanes": "258", + "breakout_modes": { + "1x10G": ["Eth33(Port33)"] + } + } + } +} + diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_asic b/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_asic new file mode 100644 index 000000000000..960467652765 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_asic @@ -0,0 +1 @@ +broadcom diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_components.json b/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_components.json new file mode 100644 index 000000000000..af225f80ccee --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_components.json @@ -0,0 +1,13 @@ +{ + "chassis": { + "x86_64-ufispace_s9301_32d-r0": { + "component": { + "CPLD1": { }, + "CPLD2": { }, + "CPLD3": { }, + "BIOS": { }, + "BMC": {} + } + } + } +} diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_env.conf b/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_env.conf new file mode 100644 index 000000000000..03a43af978aa --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/platform_env.conf @@ -0,0 +1 @@ +SYNCD_SHM_SIZE=512m diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/pmon_daemon_control.json b/device/ufispace/x86_64-ufispace_s9301_32d-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..e348e0168fa5 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/pmon_daemon_control.json @@ -0,0 +1,9 @@ +{ + "skip_pcied": false, + "skip_fancontrol": false, + "skip_thermalctld": false, + "skip_ledd": true, + "skip_xcvrd": false, + "skip_psud": false, + "skip_syseepromd": false +} diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/sensors.conf b/device/ufispace/x86_64-ufispace_s9301_32d-r0/sensors.conf new file mode 100644 index 000000000000..7a1c0408810f --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/sensors.conf @@ -0,0 +1,9 @@ +# libsensors configuration file + +bus "i2c-0" "I2C I801" +chip "tmp75-i2c-*-4f" + label temp1 "CPU Board Temp" + set temp1_max 70 + set temp1_max_hyst 75 + set temp1_crit 85 + diff --git a/device/ufispace/x86_64-ufispace_s9301_32d-r0/system_health_monitoring_config.json b/device/ufispace/x86_64-ufispace_s9301_32d-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..6291e81a0621 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32d-r0/system_health_monitoring_config.json @@ -0,0 +1,15 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu", + "fan" + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "yellow", + "normal": "green", + "booting": "blinking_green" + } +} \ No newline at end of file diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/hwsku.json b/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/hwsku.json new file mode 100644 index 000000000000..c104b8d8c5ec --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/hwsku.json @@ -0,0 +1,101 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x200G" + }, + "Ethernet4": { + "default_brkout_mode": "1x200G" + }, + "Ethernet8": { + "default_brkout_mode": "1x200G" + }, + "Ethernet12": { + "default_brkout_mode": "1x200G" + }, + "Ethernet16": { + "default_brkout_mode": "1x200G" + }, + "Ethernet20": { + "default_brkout_mode": "1x200G" + }, + "Ethernet24": { + "default_brkout_mode": "1x200G" + }, + "Ethernet28": { + "default_brkout_mode": "1x200G" + }, + "Ethernet32": { + "default_brkout_mode": "1x200G" + }, + "Ethernet36": { + "default_brkout_mode": "1x200G" + }, + "Ethernet40": { + "default_brkout_mode": "1x200G" + }, + "Ethernet44": { + "default_brkout_mode": "1x200G" + }, + "Ethernet48": { + "default_brkout_mode": "1x200G" + }, + "Ethernet52": { + "default_brkout_mode": "1x200G" + }, + "Ethernet56": { + "default_brkout_mode": "1x200G" + }, + "Ethernet60": { + "default_brkout_mode": "1x200G" + }, + "Ethernet64": { + "default_brkout_mode": "1x200G" + }, + "Ethernet68": { + "default_brkout_mode": "1x200G" + }, + "Ethernet72": { + "default_brkout_mode": "1x200G" + }, + "Ethernet76": { + "default_brkout_mode": "1x200G" + }, + "Ethernet80": { + "default_brkout_mode": "1x200G" + }, + "Ethernet84": { + "default_brkout_mode": "1x200G" + }, + "Ethernet88": { + "default_brkout_mode": "1x200G" + }, + "Ethernet92": { + "default_brkout_mode": "1x200G" + }, + "Ethernet96": { + "default_brkout_mode": "1x400G" + }, + "Ethernet104": { + "default_brkout_mode": "1x400G" + }, + "Ethernet112": { + "default_brkout_mode": "1x400G" + }, + "Ethernet120": { + "default_brkout_mode": "1x400G" + }, + "Ethernet128": { + "default_brkout_mode": "1x400G" + }, + "Ethernet136": { + "default_brkout_mode": "1x400G" + }, + "Ethernet144": { + "default_brkout_mode": "1x400G" + }, + "Ethernet152": { + "default_brkout_mode": "1x400G" + } + } +} + diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/port_config.ini b/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/port_config.ini new file mode 100644 index 000000000000..ad745c44db11 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/port_config.ini @@ -0,0 +1,33 @@ +# name lanes alias index speed +Ethernet0 1,2,3,4 Ethernet1/1 0 200000 +Ethernet4 5,6,7,8 Ethernet2/1 1 200000 +Ethernet8 9,10,11,12 Ethernet3/1 2 200000 +Ethernet12 13,14,15,16 Ethernet4/1 3 200000 +Ethernet16 17,18,19,20 Ethernet5/1 4 200000 +Ethernet20 21,22,23,24 Ethernet6/1 5 200000 +Ethernet24 25,26,27,28 Ethernet7/1 6 200000 +Ethernet28 29,30,31,32 Ethernet8/1 7 200000 +Ethernet32 33,34,35,36 Ethernet9/1 8 200000 +Ethernet36 37,38,39,40 Ethernet10/1 9 200000 +Ethernet40 41,42,43,44 Ethernet11/1 10 200000 +Ethernet44 45,46,47,48 Ethernet12/1 11 200000 +Ethernet48 49,50,51,52 Ethernet13/1 12 200000 +Ethernet52 53,54,55,56 Ethernet14/1 13 200000 +Ethernet56 57,58,59,60 Ethernet15/1 14 200000 +Ethernet60 61,62,63,64 Ethernet16/1 15 200000 +Ethernet64 65,66,67,68 Ethernet17/1 16 200000 +Ethernet68 69,70,71,72 Ethernet18/1 17 200000 +Ethernet72 73,74,75,76 Ethernet19/1 18 200000 +Ethernet76 77,78,79,80 Ethernet20/1 19 200000 +Ethernet80 81,82,83,84 Ethernet21/1 20 200000 +Ethernet84 85,86,87,88 Ethernet22/1 21 200000 +Ethernet88 89,90,91,92 Ethernet23/1 22 200000 +Ethernet92 93,94,95,96 Ethernet24/1 23 200000 +Ethernet96 97,98,99,100,101,102,103,104 Ethernet25/1 24 400000 +Ethernet104 105,106,107,108,109,110,111,112 Ethernet26/1 25 400000 +Ethernet112 113,114,115,116,117,118,119,120 Ethernet27/1 26 400000 +Ethernet120 121,122,123,124,125,126,127,128 Ethernet28/1 27 400000 +Ethernet128 129,130,131,132,133,134,135,136 Ethernet29/1 28 400000 +Ethernet136 137,138,139,140,141,142,143,144 Ethernet30/1 29 400000 +Ethernet144 145,146,147,148,149,150,151,152 Ethernet31/1 30 400000 +Ethernet152 153,154,155,156,157,158,159,160 Ethernet32/1 31 400000 diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/sai.profile b/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/sai.profile new file mode 100644 index 000000000000..f0f476720805 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/sai.profile @@ -0,0 +1 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td4-s9301-24x200G-8x400G.config.yml diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/td4-s9301-24x200G-8x400G.config.yml b/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/td4-s9301-24x200G-8x400G.config.yml new file mode 100755 index 000000000000..149e549bbf6e --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/UFISPACE-S9301-32DB/td4-s9301-24x200G-8x400G.config.yml @@ -0,0 +1,503 @@ +#r1.0.2 +# +# BCM56780 24x200g 8x400g port configuration. +# +# configuration yaml file +# device: +# : +#

: +# ? +# : +# : +# ... +# : +# : +# : +# : +# ... +# : +# + +--- +device: + 0: + DEVICE_CONFIG: + # CORE CLOCK FREQUENCY + CORE_CLK_FREQ: CLK_1350MHZ + # PP CLOCK FREQUENCY + PP_CLK_FREQ: CLK_1350MHZ +... +--- +device: + 0: + FP_CONFIG: + FP_ING_OPERMODE: GLOBAL_PIPE_AWARE +... +--- +bcm_device: + 0: + global: + sai_remap_prio_on_tnl_egress: 1 + global_flexctr_ing_action_num_reserved: 32 + global_flexctr_ing_group_num_reserved: 2 + global_flexctr_ing_pool_num_reserved: 12 + global_flexctr_ing_quant_num_reserved: 2 + global_flexctr_ing_op_profile_num_reserved: 32 + l3_intf_vlan_split_egress: 1 + pktio_mode: 1 + bcm_tunnel_term_compatible_mode: 1 + vlan_flooding_l2mc_num_reserved: 0 + l3_alpm_template: 1 + l3_alpm2_bnk_threshold: 100 + l2_hitbit_enable: 0 + uft_mode: 1 + l3_enable: 1 + ipv6_lpm_128b_enable: 1 + shared_block_mask_section: uc_bc + skip_protocol_default_entries: 1 + sai_tunnel_support: 0 + flexctr_action_reserved_ipmc_hitbit: 1 + sai_nbr_bcast_ifp_optimized: 1 + use_all_splithorizon_groups: 1 + riot_enable: 1 + riot_overlay_l3_intf_mem_size: 8192 + riot_overlay_l3_egress_mem_size: 32768 + l3_ecmp_levels: 2 + riot_overlay_ecmp_resilient_hash_size: 16384 + sai_feat_tail_timestamp: 1 + sai_port_queue_ecn_counter: 1 + sai_field_group_auto_prioritize: 1 +... +--- +device: + 0: + PC_PORT_PHYS_MAP: + ? + # CPU port + PORT_ID: 0 + : + PC_PHYS_PORT_ID: 0 + ? + # pipe 0 + PORT_ID: 1 + : + PC_PHYS_PORT_ID: 1 + ? + PORT_ID: 2 + : + PC_PHYS_PORT_ID: 5 + ? + PORT_ID: 3 + : + PC_PHYS_PORT_ID: 9 + ? + PORT_ID: 4 + : + PC_PHYS_PORT_ID: 13 + ? + PORT_ID: 5 + : + PC_PHYS_PORT_ID: 17 + ? + PORT_ID: 6 + : + PC_PHYS_PORT_ID: 21 + ? + PORT_ID: 7 + : + PC_PHYS_PORT_ID: 25 + ? + PORT_ID: 8 + : + PC_PHYS_PORT_ID: 29 + ? + PORT_ID: 9 + : + PC_PHYS_PORT_ID: 33 + ? + PORT_ID: 10 + : + PC_PHYS_PORT_ID: 37 + ? + # pipe 1 + PORT_ID: 20 + : + PC_PHYS_PORT_ID: 41 + ? + PORT_ID: 21 + : + PC_PHYS_PORT_ID: 45 + ? + PORT_ID: 22 + : + PC_PHYS_PORT_ID: 49 + ? + PORT_ID: 23 + : + PC_PHYS_PORT_ID: 53 + ? + PORT_ID: 24 + : + PC_PHYS_PORT_ID: 57 + ? + PORT_ID: 25 + : + PC_PHYS_PORT_ID: 61 + ? + PORT_ID: 26 + : + PC_PHYS_PORT_ID: 65 + ? + PORT_ID: 27 + : + PC_PHYS_PORT_ID: 69 + ? + PORT_ID: 28 + : + PC_PHYS_PORT_ID: 73 + ? + PORT_ID: 29 + : + PC_PHYS_PORT_ID: 77 + ? + # pipe 2 + PORT_ID: 40 + : + PC_PHYS_PORT_ID: 81 + ? + PORT_ID: 41 + : + PC_PHYS_PORT_ID: 85 + ? + PORT_ID: 42 + : + PC_PHYS_PORT_ID: 89 + ? + PORT_ID: 43 + : + PC_PHYS_PORT_ID: 93 + ? + # BC12 400G + PORT_ID: 44 + : + PC_PHYS_PORT_ID: 97 + ? + PORT_ID: 45 + : + PC_PHYS_PORT_ID: 105 + ? + PORT_ID: 46 + : + PC_PHYS_PORT_ID: 113 + ? + # pipe 3 + PORT_ID: 60 + : + PC_PHYS_PORT_ID: 121 + ? + PORT_ID: 61 + : + PC_PHYS_PORT_ID: 129 + ? + PORT_ID: 62 + : + PC_PHYS_PORT_ID: 137 + ? + PORT_ID: 63 + : + PC_PHYS_PORT_ID: 145 + ? + PORT_ID: 64 + : + PC_PHYS_PORT_ID: 153 +... +--- +device: + 0: + PC_PORT: + ? + PORT_ID: 0 + : + &port_mode_10g + ENABLE: 1 + SPEED: 10000 + NUM_LANES: 1 + ? + PORT_ID: [[1, 10], + [20, 29], + [40, 43]] + : + &port_mode_200g + ENABLE: 0 + SPEED: 200000 + NUM_LANES: 4 + FEC_MODE: PC_FEC_RS544_2XN + LINK_TRAINING: 0 + MAX_FRAME_SIZE: 9416 + ? + PORT_ID: [[44, 46], + [60, 64]] + : + &port_mode_400g + ENABLE: 0 + SPEED: 400000 + NUM_LANES: 8 + FEC_MODE: PC_FEC_RS544_2XN + LINK_TRAINING: 0 + MAX_FRAME_SIZE: 9416 +... +--- +device: + 0: + # Per pipe flex counter configuration + CTR_EFLEX_CONFIG: + CTR_ING_EFLEX_OPERMODE_PIPEUNIQUE: 0 + CTR_EGR_EFLEX_OPERMODE_PIPEUNIQUE: 0 +... +--- +device: + 0: + PC_PM_CORE: + ? + PC_PM_ID: 1 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32105476 + TX_LANE_MAP: 0x54763210 + RX_POLARITY_FLIP: 0x0f + TX_POLARITY_FLIP: 0xfa + ? + PC_PM_ID: 2 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x75043216 + TX_LANE_MAP: 0x32107456 + RX_POLARITY_FLIP: 0x53 + TX_POLARITY_FLIP: 0x5e + ? + PC_PM_ID: 3 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54763210 + TX_LANE_MAP: 0x23104567 + RX_POLARITY_FLIP: 0x4c + TX_POLARITY_FLIP: 0x03 + ? + PC_PM_ID: 4 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54763210 + TX_LANE_MAP: 0x23104756 + RX_POLARITY_FLIP: 0x14 + TX_POLARITY_FLIP: 0xa6 + ? + PC_PM_ID: 5 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x54763210 + TX_LANE_MAP: 0x23104576 + RX_POLARITY_FLIP: 0x0c + TX_POLARITY_FLIP: 0x80 + ? + PC_PM_ID: 6 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13206475 + TX_LANE_MAP: 0x46573210 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0xc0 + ? + PC_PM_ID: 7 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13206475 + TX_LANE_MAP: 0x46573210 + RX_POLARITY_FLIP: 0x10 + TX_POLARITY_FLIP: 0xc0 + ? + PC_PM_ID: 8 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x13206475 + TX_LANE_MAP: 0x46573210 + RX_POLARITY_FLIP: 0x00 + TX_POLARITY_FLIP: 0xc0 + ? + PC_PM_ID: 9 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x05674123 + TX_LANE_MAP: 0x76543210 + RX_POLARITY_FLIP: 0xb5 + TX_POLARITY_FLIP: 0x0e + ? + PC_PM_ID: 10 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x45763210 + TX_LANE_MAP: 0x32105476 + RX_POLARITY_FLIP: 0x60 + TX_POLARITY_FLIP: 0x50 + ? + PC_PM_ID: 11 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x32105476 + TX_LANE_MAP: 0x54763210 + RX_POLARITY_FLIP: 0x4f + TX_POLARITY_FLIP: 0x2f + ? + PC_PM_ID: 12 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x41230567 + TX_LANE_MAP: 0x31207564 + RX_POLARITY_FLIP: 0xa + TX_POLARITY_FLIP: 0x2a + ? + PC_PM_ID: 13 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x67243501 + TX_LANE_MAP: 0x53426170 + RX_POLARITY_FLIP: 0x3f + TX_POLARITY_FLIP: 0xC3 + ? + PC_PM_ID: 14 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x12743065 + TX_LANE_MAP: 0x42537061 + RX_POLARITY_FLIP: 0xd1 + TX_POLARITY_FLIP: 0x33 + ? + PC_PM_ID: 15 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x74126530 + TX_LANE_MAP: 0x02136574 + RX_POLARITY_FLIP: 0x7e + TX_POLARITY_FLIP: 0x33 + ? + PC_PM_ID: 16 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x46352701 + TX_LANE_MAP: 0x27360514 + RX_POLARITY_FLIP: 0x36 + TX_POLARITY_FLIP: 0x61 + ? + PC_PM_ID: 17 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x20534167 + TX_LANE_MAP: 0x34250617 + RX_POLARITY_FLIP: 0x7b + TX_POLARITY_FLIP: 0xcc + ? + PC_PM_ID: 18 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x65034721 + TX_LANE_MAP: 0x24351607 + RX_POLARITY_FLIP: 0x74 + TX_POLARITY_FLIP: 0x63 + ? + PC_PM_ID: 19 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x15473620 + TX_LANE_MAP: 0x57640213 + RX_POLARITY_FLIP: 0xf9 + TX_POLARITY_FLIP: 0x56 + ? + PC_PM_ID: 20 + CORE_INDEX: 0 + : + RX_LANE_MAP_AUTO: 0 + TX_LANE_MAP_AUTO: 0 + RX_POLARITY_FLIP_AUTO: 0 + TX_POLARITY_FLIP_AUTO: 0 + RX_LANE_MAP: 0x23504167 + TX_LANE_MAP: 0x32056714 + RX_POLARITY_FLIP: 0x65 + TX_POLARITY_FLIP: 0x02 +... + + diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/custom_led.bin b/device/ufispace/x86_64-ufispace_s9301_32db-r0/custom_led.bin new file mode 100755 index 0000000000000000000000000000000000000000..6d45222731c47014555a2404c044e2f9226ddf4e GIT binary patch literal 648 zcmWO1+b>&j0KoCz={e>)_j^&Nr(!$7!P?A|ir_ptT^2EFvN_ zvX}hDcS@l^h5q zm^i*0{OdMdQk!+nrmL|h%^CC#DYe^LM4amnF-eV13r#li?7CsGhm0E|I+O2E%mIhX z44F}LP?h{!s?#6x-}vP~XCNF<{!5Wm{VrzFZtvyG$A8!E{bnH~A%q1o6vW{L;*o$v zBq13oc!^Y`AsrdWL>97oHhjQGd_p@q;DnA&xbPWnbfFtP=tUnq=*JffU=Uw11TTg$ zf>Dg&8+`bVaZF$mQ}}^t7%&mQEaote1uS9-%UHoG*0F(2Y+(ms{KOs(@C%3djUyc6 M1gAJd1Q+;&XQS^=TL1t6 literal 0 HcmV?d00001 diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/default_sku b/device/ufispace/x86_64-ufispace_s9301_32db-r0/default_sku new file mode 100644 index 000000000000..0125446bfe48 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/default_sku @@ -0,0 +1 @@ +UFISPACE-S9301-32DB t1 diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/fancontrol b/device/ufispace/x86_64-ufispace_s9301_32db-r0/fancontrol new file mode 100644 index 000000000000..1234cd994f3f --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/fancontrol @@ -0,0 +1,10 @@ +# Configuration file generated by pwmconfig, changes will be lost +INTERVAL=10 +DEVPATH= +DEVNAME= +FCTEMPS= +FCFANS= +MINTEMP= +MAXTEMP= +MINSTART= +MINSTOP= diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/installer.conf b/device/ufispace/x86_64-ufispace_s9301_32db-r0/installer.conf new file mode 100644 index 000000000000..81844d3a8259 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/installer.conf @@ -0,0 +1,4 @@ +CONSOLE_PORT=0x3f8 +CONSOLE_DEV=0 +CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="modprobe.blacklist=i40e,gpio_ich,qat_c3xxx nomodeset pcie_aspm=off" diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/led_proc_init.soc b/device/ufispace/x86_64-ufispace_s9301_32db-r0/led_proc_init.soc new file mode 100644 index 000000000000..eda09a0dd1f2 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/led_proc_init.soc @@ -0,0 +1,4 @@ +led stop +led load /usr/share/sonic/platform/custom_led.bin +led auto on +led start diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/pcie.yaml b/device/ufispace/x86_64-ufispace_s9301_32db-r0/pcie.yaml new file mode 100644 index 000000000000..131d55222657 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/pcie.yaml @@ -0,0 +1,741 @@ +- bus: '00' + dev: '00' + fn: '0' + id: '2020' + name: 'Host bridge: Intel Corporation Sky Lake-E DMI3 Registers (rev 04)' +- bus: '00' + dev: '04' + fn: '0' + id: '2021' + name: 'System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)' +- bus: '00' + dev: '04' + fn: '1' + id: '2021' + name: 'System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)' +- bus: '00' + dev: '04' + fn: '2' + id: '2021' + name: 'System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)' +- bus: '00' + dev: '04' + fn: '3' + id: '2021' + name: 'System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)' +- bus: '00' + dev: '04' + fn: '4' + id: '2021' + name: 'System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)' +- bus: '00' + dev: '04' + fn: '5' + id: '2021' + name: 'System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)' +- bus: '00' + dev: '04' + fn: '6' + id: '2021' + name: 'System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)' +- bus: '00' + dev: '04' + fn: '7' + id: '2021' + name: 'System peripheral: Intel Corporation Sky Lake-E CBDMA Registers (rev 04)' +- bus: '00' + dev: '05' + fn: '0' + id: '2024' + name: 'System peripheral: Intel Corporation Sky Lake-E MM/Vt-d Configuration Registers + (rev 04)' +- bus: '00' + dev: '05' + fn: '2' + id: '2025' + name: 'System peripheral: Intel Corporation Sky Lake-E RAS (rev 04)' +- bus: '00' + dev: '05' + fn: '4' + id: '2026' + name: 'PIC: Intel Corporation Sky Lake-E IOAPIC (rev 04)' +- bus: '00' + dev: 08 + fn: '0' + id: '2014' + name: 'System peripheral: Intel Corporation Sky Lake-E Ubox Registers (rev 04)' +- bus: '00' + dev: 08 + fn: '1' + id: '2015' + name: 'Performance counters: Intel Corporation Sky Lake-E Ubox Registers (rev 04)' +- bus: '00' + dev: 08 + fn: '2' + id: '2016' + name: 'System peripheral: Intel Corporation Sky Lake-E Ubox Registers (rev 04)' +- bus: '00' + dev: '11' + fn: '0' + id: a1ec + name: 'Unassigned class [ff00]: Intel Corporation C620 Series Chipset Family MROM + 0 (rev 04)' +- bus: '00' + dev: '11' + fn: '1' + id: a1ed + name: 'Unassigned class [ff00]: Intel Corporation C620 Series Chipset Family MROM + 1 (rev 04)' +- bus: '00' + dev: '14' + fn: '0' + id: a1af + name: 'USB controller: Intel Corporation C620 Series Chipset Family USB 3.0 xHCI + Controller (rev 04)' +- bus: '00' + dev: '14' + fn: '2' + id: a1b1 + name: 'Signal processing controller: Intel Corporation C620 Series Chipset Family + Thermal Subsystem (rev 04)' +- bus: '00' + dev: '16' + fn: '0' + id: a1ba + name: 'Communication controller: Intel Corporation C620 Series Chipset Family MEI + Controller #1 (rev 04)' +- bus: '00' + dev: '16' + fn: '4' + id: a1be + name: 'Communication controller: Intel Corporation C620 Series Chipset Family MEI + Controller #3 (rev 04)' +- bus: '00' + dev: 1c + fn: '0' + id: a190 + name: 'PCI bridge: Intel Corporation C620 Series Chipset Family PCI Express Root + Port #1 (rev f4)' +- bus: '00' + dev: 1c + fn: '4' + id: a194 + name: 'PCI bridge: Intel Corporation C620 Series Chipset Family PCI Express Root + Port #5 (rev f4)' +- bus: '00' + dev: 1c + fn: '5' + id: a195 + name: 'PCI bridge: Intel Corporation C620 Series Chipset Family PCI Express Root + Port #6 (rev f4)' +- bus: '00' + dev: 1d + fn: '0' + id: a198 + name: 'PCI bridge: Intel Corporation C620 Series Chipset Family PCI Express Root + Port #9 (rev f4)' +- bus: '00' + dev: 1d + fn: '2' + id: a19a + name: 'PCI bridge: Intel Corporation C620 Series Chipset Family PCI Express Root + Port #11 (rev f4)' +- bus: '00' + dev: 1f + fn: '0' + id: a1c8 + name: 'ISA bridge: Intel Corporation Device a1c8 (rev 04)' +- bus: '00' + dev: 1f + fn: '2' + id: a1a1 + name: 'Memory controller: Intel Corporation C620 Series Chipset Family Power Management + Controller (rev 04)' +- bus: '00' + dev: 1f + fn: '4' + id: a1a3 + name: 'SMBus: Intel Corporation C620 Series Chipset Family SMBus (rev 04)' +- bus: '00' + dev: 1f + fn: '5' + id: a1a4 + name: 'Serial bus controller [0c80]: Intel Corporation C620 Series Chipset Family + SPI Controller (rev 04)' +- bus: '02' + dev: '00' + fn: '0' + id: '1533' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 03)' +- bus: '03' + dev: '00' + fn: '0' + id: '1150' + name: 'PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge (rev 03)' +- bus: '04' + dev: '00' + fn: '0' + id: '2000' + name: 'VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family + (rev 30)' +- bus: '06' + dev: '00' + fn: '0' + id: '0625' + name: 'SATA controller: ASMedia Technology Inc. Device 0625 (rev 01)' +- bus: '16' + dev: '00' + fn: '0' + id: '2030' + name: 'PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port A (rev 04)' +- bus: '16' + dev: '01' + fn: '0' + id: '2031' + name: 'PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port B (rev 04)' +- bus: '16' + dev: '02' + fn: '0' + id: '2032' + name: 'PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port C (rev 04)' +- bus: '16' + dev: '03' + fn: '0' + id: '2033' + name: 'PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port D (rev 04)' +- bus: '16' + dev: '05' + fn: '0' + id: '2034' + name: 'System peripheral: Intel Corporation Sky Lake-E VT-d (rev 04)' +- bus: '16' + dev: '05' + fn: '2' + id: '2035' + name: 'System peripheral: Intel Corporation Sky Lake-E RAS Configuration Registers + (rev 04)' +- bus: '16' + dev: '05' + fn: '4' + id: '2036' + name: 'PIC: Intel Corporation Sky Lake-E IOxAPIC Configuration Registers (rev 04)' +- bus: '16' + dev: 08 + fn: '0' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 08 + fn: '1' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 08 + fn: '2' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 08 + fn: '3' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 08 + fn: '4' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 08 + fn: '5' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 08 + fn: '6' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 08 + fn: '7' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 09 + fn: '0' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 09 + fn: '1' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 09 + fn: '2' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 09 + fn: '3' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 09 + fn: '4' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 09 + fn: '5' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 09 + fn: '6' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 09 + fn: '7' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0a + fn: '0' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0a + fn: '1' + id: 208d + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0e + fn: '0' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0e + fn: '1' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0e + fn: '2' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0e + fn: '3' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0e + fn: '4' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0e + fn: '5' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0e + fn: '6' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0e + fn: '7' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0f + fn: '0' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0f + fn: '1' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0f + fn: '2' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0f + fn: '3' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0f + fn: '4' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0f + fn: '5' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0f + fn: '6' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 0f + fn: '7' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: '10' + fn: '0' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: '10' + fn: '1' + id: 208e + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 1d + fn: '0' + id: '2054' + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 1d + fn: '1' + id: '2055' + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 1d + fn: '2' + id: '2056' + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 1d + fn: '3' + id: '2057' + name: 'System peripheral: Intel Corporation Sky Lake-E CHA Registers (rev 04)' +- bus: '16' + dev: 1e + fn: '0' + id: '2080' + name: 'System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04)' +- bus: '16' + dev: 1e + fn: '1' + id: '2081' + name: 'System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04)' +- bus: '16' + dev: 1e + fn: '2' + id: '2082' + name: 'System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04)' +- bus: '16' + dev: 1e + fn: '3' + id: '2083' + name: 'System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04)' +- bus: '16' + dev: 1e + fn: '4' + id: '2084' + name: 'System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04)' +- bus: '16' + dev: 1e + fn: '5' + id: '2085' + name: 'System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04)' +- bus: '16' + dev: 1e + fn: '6' + id: '2086' + name: 'System peripheral: Intel Corporation Sky Lake-E PCU Registers (rev 04)' +- bus: '17' + dev: '00' + fn: '0' + id: b780 + name: 'Ethernet controller: Broadcom Inc. and subsidiaries Device b780 (rev 01)' +- bus: '64' + dev: '00' + fn: '0' + id: '2030' + name: 'PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port A (rev 04)' +- bus: '64' + dev: '01' + fn: '0' + id: '2031' + name: 'PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port B (rev 04)' +- bus: '64' + dev: '02' + fn: '0' + id: '2032' + name: 'PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port C (rev 04)' +- bus: '64' + dev: '03' + fn: '0' + id: '2033' + name: 'PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port D (rev 04)' +- bus: '64' + dev: '05' + fn: '0' + id: '2034' + name: 'System peripheral: Intel Corporation Sky Lake-E VT-d (rev 04)' +- bus: '64' + dev: '05' + fn: '2' + id: '2035' + name: 'System peripheral: Intel Corporation Sky Lake-E RAS Configuration Registers + (rev 04)' +- bus: '64' + dev: '05' + fn: '4' + id: '2036' + name: 'PIC: Intel Corporation Sky Lake-E IOxAPIC Configuration Registers (rev 04)' +- bus: '64' + dev: 08 + fn: '0' + id: '2066' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 09 + fn: '0' + id: '2066' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0a + fn: '0' + id: '2040' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0a + fn: '1' + id: '2041' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0a + fn: '2' + id: '2042' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0a + fn: '3' + id: '2043' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0a + fn: '4' + id: '2044' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0a + fn: '5' + id: '2045' + name: 'System peripheral: Intel Corporation Sky Lake-E LM Channel 1 (rev 04)' +- bus: '64' + dev: 0a + fn: '6' + id: '2046' + name: 'System peripheral: Intel Corporation Sky Lake-E LMS Channel 1 (rev 04)' +- bus: '64' + dev: 0a + fn: '7' + id: '2047' + name: 'System peripheral: Intel Corporation Sky Lake-E LMDP Channel 1 (rev 04)' +- bus: '64' + dev: 0b + fn: '0' + id: '2048' + name: 'System peripheral: Intel Corporation Sky Lake-E DECS Channel 2 (rev 04)' +- bus: '64' + dev: 0b + fn: '1' + id: '2049' + name: 'System peripheral: Intel Corporation Sky Lake-E LM Channel 2 (rev 04)' +- bus: '64' + dev: 0b + fn: '2' + id: 204a + name: 'System peripheral: Intel Corporation Sky Lake-E LMS Channel 2 (rev 04)' +- bus: '64' + dev: 0b + fn: '3' + id: 204b + name: 'System peripheral: Intel Corporation Sky Lake-E LMDP Channel 2 (rev 04)' +- bus: '64' + dev: 0c + fn: '0' + id: '2040' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0c + fn: '1' + id: '2041' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0c + fn: '2' + id: '2042' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0c + fn: '3' + id: '2043' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0c + fn: '4' + id: '2044' + name: 'System peripheral: Intel Corporation Sky Lake-E Integrated Memory Controller + (rev 04)' +- bus: '64' + dev: 0c + fn: '5' + id: '2045' + name: 'System peripheral: Intel Corporation Sky Lake-E LM Channel 1 (rev 04)' +- bus: '64' + dev: 0c + fn: '6' + id: '2046' + name: 'System peripheral: Intel Corporation Sky Lake-E LMS Channel 1 (rev 04)' +- bus: '64' + dev: 0c + fn: '7' + id: '2047' + name: 'System peripheral: Intel Corporation Sky Lake-E LMDP Channel 1 (rev 04)' +- bus: '64' + dev: 0d + fn: '0' + id: '2048' + name: 'System peripheral: Intel Corporation Sky Lake-E DECS Channel 2 (rev 04)' +- bus: '64' + dev: 0d + fn: '1' + id: '2049' + name: 'System peripheral: Intel Corporation Sky Lake-E LM Channel 2 (rev 04)' +- bus: '64' + dev: 0d + fn: '2' + id: 204a + name: 'System peripheral: Intel Corporation Sky Lake-E LMS Channel 2 (rev 04)' +- bus: '64' + dev: 0d + fn: '3' + id: 204b + name: 'System peripheral: Intel Corporation Sky Lake-E LMDP Channel 2 (rev 04)' +- bus: b2 + dev: '00' + fn: '0' + id: '2030' + name: 'PCI bridge: Intel Corporation Sky Lake-E PCI Express Root Port A (rev 04)' +- bus: b2 + dev: '05' + fn: '0' + id: '2034' + name: 'System peripheral: Intel Corporation Sky Lake-E VT-d (rev 04)' +- bus: b2 + dev: '05' + fn: '2' + id: '2035' + name: 'System peripheral: Intel Corporation Sky Lake-E RAS Configuration Registers + (rev 04)' +- bus: b2 + dev: '05' + fn: '4' + id: '2036' + name: 'PIC: Intel Corporation Sky Lake-E IOxAPIC Configuration Registers (rev 04)' +- bus: b2 + dev: '12' + fn: '0' + id: 204c + name: 'Performance counters: Intel Corporation Sky Lake-E M3KTI Registers (rev 04)' +- bus: b2 + dev: '12' + fn: '1' + id: 204d + name: 'Performance counters: Intel Corporation Sky Lake-E M3KTI Registers (rev 04)' +- bus: b2 + dev: '12' + fn: '2' + id: 204e + name: 'System peripheral: Intel Corporation Sky Lake-E M3KTI Registers (rev 04)' +- bus: b2 + dev: '15' + fn: '0' + id: '2018' + name: 'System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04)' +- bus: b2 + dev: '16' + fn: '0' + id: '2018' + name: 'System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04)' +- bus: b2 + dev: '16' + fn: '4' + id: '2018' + name: 'System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04)' +- bus: b2 + dev: '17' + fn: '0' + id: '2018' + name: 'System peripheral: Intel Corporation Sky Lake-E M2PCI Registers (rev 04)' +- bus: b3 + dev: '00' + fn: '0' + id: 37c0 + name: 'PCI bridge: Intel Corporation Device 37c0 (rev 04)' +- bus: b4 + dev: '02' + fn: '0' + id: 37c4 + name: 'PCI bridge: Intel Corporation Device 37c4 (rev 04)' +- bus: b4 + dev: '03' + fn: '0' + id: 37c5 + name: 'PCI bridge: Intel Corporation Device 37c5 (rev 04)' +- bus: b5 + dev: '00' + fn: '0' + id: 37c8 + name: 'Co-processor: Intel Corporation C62x Chipset QuickAssist Technology (rev + 04)' +- bus: b6 + dev: '00' + fn: '0' + id: 37d3 + name: 'Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE + SFP+ (rev 04)' +- bus: b6 + dev: '00' + fn: '1' + id: 37d3 + name: 'Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE + SFP+ (rev 04)' +- bus: b6 + dev: '00' + fn: '2' + id: 37ce + name: 'Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE + backplane (rev 04)' +- bus: b6 + dev: '00' + fn: '3' + id: 37ce + name: 'Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GbE + backplane (rev 04)' diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf/pd-plugin.json b/device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf/pd-plugin.json new file mode 100644 index 000000000000..76096d82e35b --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf/pd-plugin.json @@ -0,0 +1,86 @@ +{ + + "XCVR": + { + "xcvr_present": + { + "i2c": + { + "valmap-QSFP28": {"1":true, "0":false }, + "valmap-QSFP-DD": {"1":true, "0":false} + } + + }, + "plug_status": + { + "inserted": "1", + "removed": "0" + } + }, + "PSU": + { + "psu_present": + { + "i2c": + { + "valmap": { "1":true, "0":false } + }, + "bmc": + { + "valmap": { "Device Present":true, "Device Absent":false } + } + }, + + "psu_power_good": + { + "i2c": + { + "valmap": { "1": true, "0":false } + }, + "bmc": + { + "valmap": { "State Asserted":true, "State Deasserted":false } + } + }, + + "psu_fan_dir": + { + "i2c": + { + "valmap": { "F2B":"EXHAUST", "B2F":"INTAKE" } + } + }, + "DEFAULT_TYPE": "AC", + "PSU_FAN_MAX_SPEED":"30000" + }, + + "FAN": + { + "direction": + { + "bmc": + { + "valmap": {"0": "UNKNOW", "1":"INTAKE", "2":"EXHAUST"} + } + }, + + "present": + { + "i2c": + { + "valmap": {"1":true, "0":false} + }, + "bmc": + { + "valmap": { "0x0280|":true, "0x0180|":false } + } + }, + "FAN_R_MAX_SPEED":"32000", + "FAN_F_MAX_SPEED":"36200" + }, + + "REBOOT_CAUSE": + { + "reboot_cause_file": "/host/reboot-cause/reboot-cause.txt" + } +} diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf/pddf-device.json b/device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf/pddf-device.json new file mode 100644 index 000000000000..a7b4bf73d10e --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf/pddf-device.json @@ -0,0 +1,4886 @@ +{ + "PLATFORM": { + "num_psus": 2, + "num_fantrays": 6, + "num_fans_pertray": 2, + "num_ports": 32, + "num_temps": 7, + "pddf_dev_types": { + "description": "PDDF supported devices", + "CPLD": [ + "i2c_cpld" + ], + "PSU": [ + "psu_eeprom", + "psu_pmbus" + ], + "PORT_MODULE": [ + "pddf_xcvr" + ] + }, + "std_perm_kos": [ + "igb", + "i40e" + ], + "std_kos": [ + "i2c_i801", + "i2c_dev", + "i2c_mux_pca954x", + "optoe", + "lm75", + "gpio-pca953x" + ], + "pddf_kos": [ + "pddf_client_module", + "pddf_cpld_module", + "pddf_cpld_driver", + "pddf_mux_module", + "pddf_xcvr_module", + "pddf_fpgapci_driver", + "pddf_xcvr_driver_module", + "pddf_psu_driver_module", + "pddf_psu_module", + "pddf_fpgai2c_module", + "pddf_fpgai2c_driver", + "pddf_fan_driver_module", + "pddf_fan_module", + "pddf_led_module", + "pddf_gpio_module" + ], + "custom_kos": [ + "x86-64-ufispace-s9301-32db-lpc", + "x86-64-ufispace-s9301-32db-sys-eeprom", + "pddf_custom_sysstatus_module" + ] + }, + "SYSTEM": { + "dev_info": { + "device_type": "CPU", + "device_name": "ROOT_COMPLEX", + "device_parent": null + }, + "i2c": { + "CONTROLLERS": [ + { + "dev_name": "i2c-0", + "dev": "SMBUS0" + } + ] + } + }, + "SMBUS0": { + "dev_info": { + "device_type": "SMBUS", + "device_name": "SMBUS0", + "device_parent": "SYSTEM" + }, + "i2c": { + "topo_info": { + "dev_addr": "0x0" + }, + "DEVICES": [ + { + "dev": "EEPROM1" + }, + { + "dev": "MUX1" + }, + { + "dev": "MUX2" + }, + { + "dev": "GPIO1" + } + ] + } + }, + "EEPROM1": { + "dev_info": { + "device_type": "EEPROM", + "device_name": "EEPROM1", + "device_parent": "SMBUS0" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x0", + "dev_addr": "0x57", + "dev_type": "sys_eeprom" + }, + "dev_attr": { + "access_mode": "BLOCK" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "TEMP1": { + "dev_info": { + "device_type": "TEMP_SENSOR", + "device_name": "TEMP1", + "device_parent": "SMBUS0" + }, + "dev_attr": { + "display_name": "Temp_CPU_PECI" + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "temp1_input", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CPU_PECI", + "field_pos": "3" + }, + { + "attr_name": "temp1_high_crit_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CPU_PECI", + "field_pos": "20" + }, + { + "attr_name": "temp1_high_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CPU_PECI", + "field_pos": "18" + } + ] + } + } + }, + "TEMP2": { + "dev_info": { + "device_type": "TEMP_SENSOR", + "device_name": "TEMP2", + "device_parent": "SMBUS0" + }, + "dev_attr": { + "display_name": "Temp_CPU_ENV" + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "temp1_input", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CPU_ENV", + "field_pos": "3" + }, + { + "attr_name": "temp1_high_crit_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CPU_ENV", + "field_pos": "20" + }, + { + "attr_name": "temp1_high_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CPU_ENV", + "field_pos": "18" + } + ] + } + } + }, + "TEMP3": { + "dev_info": { + "device_type": "TEMP_SENSOR", + "device_name": "TEMP3", + "device_parent": "SMBUS0" + }, + "dev_attr": { + "display_name": "Temp_CPU_ENV2" + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "temp1_input", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CPU_ENV_2", + "field_pos": "3" + }, + { + "attr_name": "temp1_high_crit_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CPU_ENV_2", + "field_pos": "20" + }, + { + "attr_name": "temp1_high_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CPU_ENV_2", + "field_pos": "18" + } + ] + } + } + }, + "TEMP4": { + "dev_info": { + "device_type": "TEMP_SENSOR", + "device_name": "TEMP4", + "device_parent": "SMBUS0" + }, + "dev_attr": { + "display_name": "Temp_MAC_ENV" + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "temp1_input", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_MAC_ENV", + "field_pos": "3" + }, + { + "attr_name": "temp1_high_crit_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_MAC_ENV", + "field_pos": "20" + }, + { + "attr_name": "temp1_high_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_MAC_ENV", + "field_pos": "18" + } + ] + } + } + }, + "TEMP5": { + "dev_info": { + "device_type": "TEMP_SENSOR", + "device_name": "TEMP5", + "device_parent": "SMBUS0" + }, + "dev_attr": { + "display_name": "Temp_MAC_DIE" + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "temp1_input", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_MAC_DIE", + "field_pos": "3" + }, + { + "attr_name": "temp1_high_crit_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_MAC_DIE", + "field_pos": "20" + }, + { + "attr_name": "temp1_high_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_MAC_DIE", + "field_pos": "18" + } + ] + } + } + }, + "TEMP6": { + "dev_info": { + "device_type": "TEMP_SENSOR", + "device_name": "TEMP6", + "device_parent": "SMBUS0" + }, + "dev_attr": { + "display_name": "Temp_CAGE" + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "temp1_input", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CAGE", + "field_pos": "3" + }, + { + "attr_name": "temp1_high_crit_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CAGE", + "field_pos": "20" + }, + { + "attr_name": "temp1_high_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_CAGE", + "field_pos": "18" + } + ] + } + } + }, + "TEMP7": { + "dev_info": { + "device_type": "TEMP_SENSOR", + "device_name": "TEMP7", + "device_parent": "SMBUS0" + }, + "dev_attr": { + "display_name": "Temp_PSU_CONNTOR" + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "temp1_input", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_PSU_CONN", + "field_pos": "3" + }, + { + "attr_name": "temp1_high_crit_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_PSU_CONN", + "field_pos": "20" + }, + { + "attr_name": "temp1_high_threshold", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "TEMP_PSU_CONN", + "field_pos": "18" + } + ] + } + } + }, + "MUX1": { + "dev_info": { + "device_type": "MUX", + "device_name": "MUX1", + "device_parent": "SMBUS0" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x0", + "dev_addr": "0x73", + "dev_type": "pca9548" + }, + "dev_attr": { + "virt_bus": "0x1", + "idle_state": "-2" + }, + "channel": [ + { + "chn": "1", + "dev": "CPLD1" + }, + { + "chn": "1", + "dev": "CPLD2" + }, + { + "chn": "1", + "dev": "CPLD3" + }, + { + "chn": "4", + "dev": "GPIO2" + } + ] + } + }, + "MUX2": { + "dev_info": { + "device_type": "MUX", + "device_name": "MUX2", + "device_parent": "SMBUS0" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x0", + "dev_addr": "0x72", + "dev_type": "pca9548" + }, + "dev_attr": { + "virt_bus": "0x9", + "idle_state": "-2" + }, + "channel": [ + { + "chn": "0", + "dev": "MUX3" + }, + { + "chn": "1", + "dev": "MUX4" + }, + { + "chn": "2", + "dev": "MUX5" + }, + { + "chn": "3", + "dev": "MUX6" + } + ] + } + }, + "MUX3": { + "dev_info": { + "device_type": "MUX", + "device_name": "MUX3", + "device_parent": "MUX2" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x9", + "dev_addr": "0x76", + "dev_type": "pca9548" + }, + "dev_attr": { + "virt_bus": "0x11", + "idle_state": "-2" + }, + "channel": [ + { + "chn": "0", + "dev": "PORT1" + }, + { + "chn": "1", + "dev": "PORT2" + }, + { + "chn": "2", + "dev": "PORT3" + }, + { + "chn": "3", + "dev": "PORT4" + }, + { + "chn": "4", + "dev": "PORT5" + }, + { + "chn": "5", + "dev": "PORT6" + }, + { + "chn": "6", + "dev": "PORT7" + }, + { + "chn": "7", + "dev": "PORT8" + } + ] + } + }, + "MUX4": { + "dev_info": { + "device_type": "MUX", + "device_name": "MUX4", + "device_parent": "MUX2" + }, + "i2c": { + "topo_info": { + "parent_bus": "0xa", + "dev_addr": "0x76", + "dev_type": "pca9548" + }, + "dev_attr": { + "virt_bus": "0x19", + "idle_state": "-2" + }, + "channel": [ + { + "chn": "0", + "dev": "PORT9" + }, + { + "chn": "1", + "dev": "PORT10" + }, + { + "chn": "2", + "dev": "PORT11" + }, + { + "chn": "3", + "dev": "PORT12" + }, + { + "chn": "4", + "dev": "PORT13" + }, + { + "chn": "5", + "dev": "PORT14" + }, + { + "chn": "6", + "dev": "PORT15" + }, + { + "chn": "7", + "dev": "PORT16" + } + ] + } + }, + "MUX5": { + "dev_info": { + "device_type": "MUX", + "device_name": "MUX5", + "device_parent": "MUX2" + }, + "i2c": { + "topo_info": { + "parent_bus": "0xb", + "dev_addr": "0x76", + "dev_type": "pca9548" + }, + "dev_attr": { + "virt_bus": "0x21", + "idle_state": "-2" + }, + "channel": [ + { + "chn": "0", + "dev": "PORT17" + }, + { + "chn": "1", + "dev": "PORT18" + }, + { + "chn": "2", + "dev": "PORT19" + }, + { + "chn": "3", + "dev": "PORT20" + }, + { + "chn": "4", + "dev": "PORT21" + }, + { + "chn": "5", + "dev": "PORT22" + }, + { + "chn": "6", + "dev": "PORT23" + }, + { + "chn": "7", + "dev": "PORT24" + } + ] + } + }, + "MUX6": { + "dev_info": { + "device_type": "MUX", + "device_name": "MUX6", + "device_parent": "MUX2" + }, + "i2c": { + "topo_info": { + "parent_bus": "0xc", + "dev_addr": "0x76", + "dev_type": "pca9548" + }, + "dev_attr": { + "virt_bus": "0x29", + "idle_state": "-2" + }, + "channel": [ + { + "chn": "0", + "dev": "PORT25" + }, + { + "chn": "1", + "dev": "PORT26" + }, + { + "chn": "2", + "dev": "PORT27" + }, + { + "chn": "3", + "dev": "PORT28" + }, + { + "chn": "4", + "dev": "PORT29" + }, + { + "chn": "5", + "dev": "PORT30" + }, + { + "chn": "6", + "dev": "PORT31" + }, + { + "chn": "7", + "dev": "PORT32" + } + ] + } + }, + "GPIO1": { + "dev_info": { + "device_type": "GPIO", + "device_name": "GPIO1", + "device_parent": "SMBUS0" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x0", + "dev_addr": "0x77", + "dev_type": "pca9539" + }, + "dev_attr": { + "gpio_base": "0x1f0" + }, + "ports": [ + { + "port_num": "0", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "1", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "2", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "3", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "4", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "5", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "6", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "7", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "8", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "9", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "10", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "11", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "12", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "13", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "14", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "15", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + } + ] + } + }, + "GPIO2": { + "dev_info": { + "device_type": "GPIO", + "device_name": "GPIO2", + "device_parent": "MUX1" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x6", + "dev_addr": "0x76", + "dev_type": "pca9539" + }, + "dev_attr": { + "gpio_base": "0x1e0" + }, + "ports": [ + { + "port_num": "0", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "1", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "2", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "3", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "4", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "5", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "6", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "7", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "8", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "9", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "10", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "11", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "12", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "13", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "14", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + }, + { + "port_num": "15", + "direction": "in", + "value": "", + "edge": "", + "active_low": "" + } + ] + } + }, + "CPLD1": { + "dev_info": { + "device_type": "CPLD", + "device_name": "CPLD1", + "device_parent": "MUX1" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2", + "dev_addr": "0x30", + "dev_type": "i2c_cpld" + }, + "dev_attr": {} + } + }, + "CPLD2": { + "dev_info": { + "device_type": "CPLD", + "device_name": "CPLD2", + "device_parent": "MUX1" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2", + "dev_addr": "0x31", + "dev_type": "i2c_cpld" + }, + "dev_attr": {} + } + }, + "CPLD3": { + "dev_info": { + "device_type": "CPLD", + "device_name": "CPLD3", + "device_parent": "MUX1" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2", + "dev_addr": "0x32", + "dev_type": "i2c_cpld" + }, + "dev_attr": {} + } + }, + "SYSSTATUS": { + "dev_info": { + "device_type": "SYSSTAT", + "device_name": "SYSSTATUS" + }, + "dev_attr": {}, + "attr_list": [ + { + "attr_name": "board_info", + "attr_devaddr": "0x30", + "attr_offset": "0x0", + "attr_mask": "0xff", + "attr_len": "0x1" + }, + { + "attr_name": "cpld1_version", + "attr_devaddr": "0x30", + "attr_offset": "0x2", + "attr_mask": "0xff", + "attr_len": "0x1" + }, + { + "attr_name": "cpld2_version", + "attr_devaddr": "0x31", + "attr_offset": "0x2", + "attr_mask": "0xff", + "attr_len": "0x1" + }, + { + "attr_name": "cpld3_version", + "attr_devaddr": "0x32", + "attr_offset": "0x2", + "attr_mask": "0xff", + "attr_len": "0x1" + }, + { + "attr_name": "mac_reset", + "attr_devaddr": "0x30", + "attr_offset": "0x40", + "attr_mask": "0xff", + "attr_len": "0x1" + }, + { + "attr_name": "mux_reset", + "attr_devaddr": "0x30", + "attr_offset": "0x46", + "attr_mask": "0xff", + "attr_len": "0x1" + }, + { + "attr_name": "psu_status", + "attr_devaddr": "0x30", + "attr_offset": "0x51", + "attr_mask": "0xff", + "attr_len": "0x1" + }, + { + "attr_name": "system_led_0", + "attr_devaddr": "0x30", + "attr_offset": "0x80", + "attr_mask": "0xff", + "attr_len": "0x1" + }, + { + "attr_name": "system_led_1", + "attr_devaddr": "0x30", + "attr_offset": "0x81", + "attr_mask": "0xff", + "attr_len": "0x1" + }, + { + "attr_name": "beacon_led", + "attr_devaddr": "0x30", + "attr_offset": "0x84", + "attr_mask": "0xff", + "attr_len": "0x1" + }, + { + "attr_name": "port_led_clr_ctrl", + "attr_devaddr": "0x30", + "attr_offset": "0x85", + "attr_mask": "0xff", + "attr_len": "0x1" + } + ] + }, + "PSU1": { + "dev_info": { + "device_type": "PSU", + "device_name": "PSU1", + "device_parent": "SMBUS0" + }, + "dev_attr": { + "dev_idx": "1", + "num_psu_fans": "1" + }, + "i2c": { + "interface": [] + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "psu_present", + "bmc_cmd": "ipmitool sdr -c get PSU0_PRSNT_L | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU0_PRSNT_L", + "field_pos": "5", + "separator": "," + }, + { + "attr_name": "psu_power_good", + "bmc_cmd": "ipmitool sdr -c get PSU0_PWROK_H | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU0_PWROK_H", + "field_pos": "5", + "separator": "," + }, + { + "attr_name": "psu_v_out", + "bmc_cmd": "ipmitool sdr -c get PSU0_VOUT | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU0_VOUT", + "field_pos": "2", + "mult": "1000", + "separator": "," + }, + { + "attr_name": "psu_i_out", + "bmc_cmd": "ipmitool sdr -c get PSU0_IOUT | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU0_IOUT", + "field_pos": "2", + "mult": "1000", + "separator": "," + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU0_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU0_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU0_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU0_IIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_temp1_input", + "bmc_cmd": "ipmitool sdr -c get PSU0_TEMP | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU0_TEMP", + "field_pos": "2", + "mult": "1000", + "separator": "," + }, + { + "attr_name": "psu_fan1_speed_rpm", + "bmc_cmd": "ipmitool sdr -c get PSU0_FAN1 | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU0_FAN1", + "field_pos": "2", + "separator": "," + }, + { + "attr_name": "psu_mfr_id", + "bmc_cmd": "_rv=$(ipmitool fru print 1 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Manufacturer') && echo $_rv || echo 'Manufacturer : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Manufacturer", + "field_pos": "2" + }, + { + "attr_name": "psu_model_name", + "bmc_cmd": "_rv=$(ipmitool fru print 1 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Name') && echo $_rv || echo 'Name : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Name", + "field_pos": "2" + }, + { + "attr_name": "psu_serial_num", + "bmc_cmd": "_rv=$(ipmitool fru print 1 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Serial') && echo $_rv || echo 'Serial : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Serial", + "field_pos": "2" + }, + { + "attr_name": "psu_fan1_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f1", + "raw": "1", + "type": "raw" + } + ] + } + } + }, + "PSU2": { + "dev_info": { + "device_type": "PSU", + "device_name": "PSU2", + "device_parent": "SMBUS0" + }, + "dev_attr": { + "dev_idx": "2", + "num_psu_fans": "1" + }, + "i2c": { + "interface": [] + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "psu_present", + "bmc_cmd": "ipmitool sdr -c get PSU1_PRSNT_L | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_PRSNT_L", + "field_pos": "5", + "separator": "," + }, + { + "attr_name": "psu_power_good", + "bmc_cmd": "ipmitool sdr -c get PSU1_PWROK_H | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_PWROK_H", + "field_pos": "5", + "separator": "," + }, + { + "attr_name": "psu_v_out", + "bmc_cmd": "ipmitool sdr -c get PSU1_VOUT | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_VOUT", + "field_pos": "2", + "mult": "1000", + "separator": "," + }, + { + "attr_name": "psu_i_out", + "bmc_cmd": "ipmitool sdr -c get PSU1_IOUT | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_IOUT", + "field_pos": "2", + "mult": "1000", + "separator": "," + }, + { + "attr_name": "psu_v_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_VIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_VIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_i_in", + "bmc_cmd": "ipmitool sdr get -c PSU1_IIN | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "separator": ",", + "field_name": "PSU1_IIN", + "field_pos": "2", + "mult": "1000" + }, + { + "attr_name": "psu_temp1_input", + "bmc_cmd": "ipmitool sdr -c get PSU1_TEMP | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_TEMP", + "field_pos": "2", + "mult": "1000", + "separator": "," + }, + { + "attr_name": "psu_fan1_speed_rpm", + "bmc_cmd": "ipmitool sdr -c get PSU1_FAN1 | sed -e 's/,,/,N\\/A,/g' -e 's/,,/,N\\/A,/g'", + "raw": "0", + "field_name": "PSU1_FAN1", + "field_pos": "2", + "separator": "," + }, + { + "attr_name": "psu_mfr_id", + "bmc_cmd": "_rv=$(ipmitool fru print 2 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Manufacturer') && echo $_rv || echo 'Manufacturer : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Manufacturer", + "field_pos": "2" + }, + { + "attr_name": "psu_model_name", + "bmc_cmd": "_rv=$(ipmitool fru print 2 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Name') && echo $_rv || echo 'Name : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Name", + "field_pos": "2" + }, + { + "attr_name": "psu_serial_num", + "bmc_cmd": "_rv=$(ipmitool fru print 2 2>/dev/null | tr -s ' ' | cut -d' ' -f3-5 | grep 'Serial') && echo $_rv || echo 'Serial : N/A'", + "raw": "0", + "separator": ":", + "field_name": "Serial", + "field_pos": "2" + }, + { + "attr_name": "psu_fan1_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x30 0x0 | xargs | cut -d' ' -f2", + "raw": "1", + "type": "raw" + } + ] + } + } + }, + "FAN-CTRL": { + "dev_info": { + "device_type": "FAN", + "device_name": "FAN-CTRL", + "device_parent": "" + }, + "bmc": { + "ipmitool": { + "attr_list": [ + { + "attr_name": "fan1_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN0_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan2_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN1_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan3_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN2_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan4_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN3_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan5_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN4_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan6_present", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN5_PSNT_L", + "field_pos": "7" + }, + { + "attr_name": "fan1_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN0_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan1_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN0_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan2_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN1_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan2_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN1_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan3_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN2_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan3_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN2_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan4_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN3_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan4_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN3_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan5_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN4_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan5_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN4_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan6_f_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN5_RPM_F", + "field_pos": "3" + }, + { + "attr_name": "fan6_r_speed_rpm", + "bmc_cmd": "ipmitool sensor", + "raw": "0", + "field_name": "FAN5_RPM_R", + "field_pos": "3" + }, + { + "attr_name": "fan1_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f1", + "raw": "1", + "type": "raw" + }, + { + "attr_name": "fan2_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f2", + "raw": "1", + "type": "raw" + }, + { + "attr_name": "fan3_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f3", + "raw": "1", + "type": "raw" + }, + { + "attr_name": "fan4_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f4", + "raw": "1", + "type": "raw" + }, + { + "attr_name": "fan5_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f5", + "raw": "1", + "type": "raw" + }, + { + "attr_name": "fan6_dir", + "bmc_cmd": "ipmitool raw 0x3c 0x31 0x0 | xargs | cut -d' ' -f6", + "raw": "1", + "type": "raw" + } + ] + } + } + }, + "SYS_LED": { + "dev_info": { + "device_type": "LED", + "device_name": "SYS_LED" + }, + "dev_attr": { + "index": "0", + "flag": "ro" + }, + "i2c": { + "attr_list": [ + { + "attr_name": "green", + "bits": "7:4", + "descr": "Green", + "value": "0x09;0x0b", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "green_blink", + "bits": "7:4", + "descr": "Green Blinking", + "value": "0x0d;0x0f", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "yellow", + "bits": "7:4", + "descr": "Yellow", + "value": "0x08;0x0a", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "yellow_blink", + "bits": "7:4", + "descr": "Yellow Blinking", + "value": "0x0c;0x0e", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "off", + "bits": "7", + "descr": "Off", + "value": "0x0", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + } + ] + } + }, + "FAN_LED": { + "dev_info": { + "device_type": "LED", + "device_name": "FAN_LED" + }, + "dev_attr": { + "index": "0", + "flag": "ro" + }, + "i2c": { + "attr_list": [ + { + "attr_name": "green", + "bits": "3:0", + "descr": "Green", + "value": "0x09;0x0b", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "green_blink", + "bits": "3:0", + "descr": "Green Blinking", + "value": "0x0d;0x0f", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "yellow", + "bits": "3:0", + "descr": "Yellow", + "value": "0x08;0x0a", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "yellow_blink", + "bits": "3:0", + "descr": "Yellow Blinking", + "value": "0x0c;0x0e", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + }, + { + "attr_name": "off", + "bits": "3", + "descr": "Off", + "value": "0x0", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x80" + } + ] + } + }, + "PSU1_LED": { + "dev_info": { + "device_type": "LED", + "device_name": "PSU_LED" + }, + "dev_attr": { + "index": "0", + "flag": "ro" + }, + "i2c": { + "attr_list": [ + { + "attr_name": "green", + "bits": "3:0", + "descr": "Green", + "value": "0x09;0x0b", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "green_blink", + "bits": "3:0", + "descr": "Green Blinking", + "value": "0x0d;0x0f", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "yellow", + "bits": "3:0", + "descr": "Yellow", + "value": "0x08;0x0a", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "yellow_blink", + "bits": "3:0", + "descr": "Yellow Blinking", + "value": "0x0c;0x0e", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "off", + "bits": "3", + "descr": "Off", + "value": "0x0", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + } + ] + } + }, + "PSU2_LED": { + "dev_info": { + "device_type": "LED", + "device_name": "PSU_LED" + }, + "dev_attr": { + "index": "1", + "flag": "ro" + }, + "i2c": { + "attr_list": [ + { + "attr_name": "green", + "bits": "7:4", + "descr": "Green", + "value": "0x09;0x0b", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "green_blink", + "bits": "7:4", + "descr": "Green Blinking", + "value": "0x0d;0x0f", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "yellow", + "bits": "7:4", + "descr": "Yellow", + "value": "0x08;0x0a", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "yellow_blink", + "bits": "7:4", + "descr": "Yellow Blinking", + "value": "0x0c;0x0e", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + }, + { + "attr_name": "off", + "bits": "7", + "descr": "Off", + "value": "0x0", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x81" + } + ] + } + }, + "LOC_LED": { + "dev_info": { + "device_type": "LED", + "device_name": "LOC_LED" + }, + "dev_attr": { + "index": "0", + "flag": "rw" + }, + "i2c": { + "attr_list": [ + { + "attr_name": "blue", + "bits": "2:1", + "descr": "Blue", + "value": "0x02", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x84" + }, + { + "attr_name": "blue_blink", + "bits": "2:1", + "descr": "Blue Blinking", + "value": "0x03", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x84" + }, + { + "attr_name": "off", + "bits": "2", + "descr": "Off", + "value": "0x0", + "swpld_addr": "0x30", + "swpld_addr_offset": "0x84" + } + ] + } + }, + "PORT1": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT1", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "1" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT1-EEPROM" + }, + { + "itf": "control", + "dev": "PORT1-CTRL" + } + ] + } + }, + "PORT1-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT1-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT1" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x11", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT1-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT1-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT1" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x11", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "0", + "attr_cmpval": "0x1", + "attr_len": "1" + } + ] + } + }, + "PORT2": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT2", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "2" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT2-EEPROM" + }, + { + "itf": "control", + "dev": "PORT2-CTRL" + } + ] + } + }, + "PORT2-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT2-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT2" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x12", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT2-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT2-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT2" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x12", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "1", + "attr_cmpval": "0x2", + "attr_len": "1" + } + ] + } + }, + "PORT3": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT3", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "3" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT3-EEPROM" + }, + { + "itf": "control", + "dev": "PORT3-CTRL" + } + ] + } + }, + "PORT3-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT3-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT3" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x13", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT3-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT3-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT3" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x13", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "2", + "attr_cmpval": "0x4", + "attr_len": "1" + } + ] + } + }, + "PORT4": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT4", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "4" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT4-EEPROM" + }, + { + "itf": "control", + "dev": "PORT4-CTRL" + } + ] + } + }, + "PORT4-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT4-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT4" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x14", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT4-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT4-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT4" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x14", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "3", + "attr_cmpval": "0x8", + "attr_len": "1" + } + ] + } + }, + "PORT5": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT5", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "5" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT5-EEPROM" + }, + { + "itf": "control", + "dev": "PORT5-CTRL" + } + ] + } + }, + "PORT5-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT5-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT5" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x15", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT5-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT5-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT5" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x15", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "4", + "attr_cmpval": "0x10", + "attr_len": "1" + } + ] + } + }, + "PORT6": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT6", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "6" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT6-EEPROM" + }, + { + "itf": "control", + "dev": "PORT6-CTRL" + } + ] + } + }, + "PORT6-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT6-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT6" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x16", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT6-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT6-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT6" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x16", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "5", + "attr_cmpval": "0x20", + "attr_len": "1" + } + ] + } + }, + "PORT7": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT7", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "7" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT7-EEPROM" + }, + { + "itf": "control", + "dev": "PORT7-CTRL" + } + ] + } + }, + "PORT7-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT7-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT7" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x17", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT7-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT7-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT7" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x17", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "6", + "attr_cmpval": "0x40", + "attr_len": "1" + } + ] + } + }, + "PORT8": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT8", + "device_parent": "MUX3" + }, + "dev_attr": { + "dev_idx": "8" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT8-EEPROM" + }, + { + "itf": "control", + "dev": "PORT8-CTRL" + } + ] + } + }, + "PORT8-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT8-EEPROM", + "device_parent": "MUX3", + "virt_parent": "PORT8" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x18", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT8-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT8-CTRL", + "device_parent": "MUX3", + "virt_parent": "PORT8" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x18", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x10", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x14", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x40", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x44", + "attr_mask": "7", + "attr_cmpval": "0x80", + "attr_len": "1" + } + ] + } + }, + "PORT9": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT9", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "9" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT9-EEPROM" + }, + { + "itf": "control", + "dev": "PORT9-CTRL" + } + ] + } + }, + "PORT9-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT9-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT9" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x19", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT9-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT9-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT9" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x19", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "0", + "attr_cmpval": "0x1", + "attr_len": "1" + } + ] + } + }, + "PORT10": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT10", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "10" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT10-EEPROM" + }, + { + "itf": "control", + "dev": "PORT10-CTRL" + } + ] + } + }, + "PORT10-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT10-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT10" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1a", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT10-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT10-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT10" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1a", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "1", + "attr_cmpval": "0x2", + "attr_len": "1" + } + ] + } + }, + "PORT11": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT11", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "11" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT11-EEPROM" + }, + { + "itf": "control", + "dev": "PORT11-CTRL" + } + ] + } + }, + "PORT11-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT11-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT11" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1b", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT11-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT11-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT11" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1b", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "2", + "attr_cmpval": "0x4", + "attr_len": "1" + } + ] + } + }, + "PORT12": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT12", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "12" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT12-EEPROM" + }, + { + "itf": "control", + "dev": "PORT12-CTRL" + } + ] + } + }, + "PORT12-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT12-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT12" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1c", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT12-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT12-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT12" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1c", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "3", + "attr_cmpval": "0x8", + "attr_len": "1" + } + ] + } + }, + "PORT13": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT13", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "13" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT13-EEPROM" + }, + { + "itf": "control", + "dev": "PORT13-CTRL" + } + ] + } + }, + "PORT13-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT13-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT13" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1d", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT13-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT13-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT13" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1d", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "4", + "attr_cmpval": "0x10", + "attr_len": "1" + } + ] + } + }, + "PORT14": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT14", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "14" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT14-EEPROM" + }, + { + "itf": "control", + "dev": "PORT14-CTRL" + } + ] + } + }, + "PORT14-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT14-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT14" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1e", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT14-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT14-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT14" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1e", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "5", + "attr_cmpval": "0x20", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "5", + "attr_cmpval": "0x20", + "attr_len": "1" + } + ] + } + }, + "PORT15": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT15", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "15" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT15-EEPROM" + }, + { + "itf": "control", + "dev": "PORT15-CTRL" + } + ] + } + }, + "PORT15-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT15-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT15" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1f", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT15-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT15-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT15" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x1f", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "6", + "attr_cmpval": "0x40", + "attr_len": "1" + } + ] + } + }, + "PORT16": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT16", + "device_parent": "MUX4" + }, + "dev_attr": { + "dev_idx": "16" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT16-EEPROM" + }, + { + "itf": "control", + "dev": "PORT16-CTRL" + } + ] + } + }, + "PORT16-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT16-EEPROM", + "device_parent": "MUX4", + "virt_parent": "PORT16" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x20", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT16-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT16-CTRL", + "device_parent": "MUX4", + "virt_parent": "PORT16" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x20", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x11", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x15", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x41", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x45", + "attr_mask": "7", + "attr_cmpval": "0x80", + "attr_len": "1" + } + ] + } + }, + "PORT17": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT17", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "17" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT17-EEPROM" + }, + { + "itf": "control", + "dev": "PORT17-CTRL" + } + ] + } + }, + "PORT17-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT17-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT17" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x21", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT17-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT17-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT17" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x21", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "0", + "attr_cmpval": "0x1", + "attr_len": "1" + } + ] + } + }, + "PORT18": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT18", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "18" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT18-EEPROM" + }, + { + "itf": "control", + "dev": "PORT18-CTRL" + } + ] + } + }, + "PORT18-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT18-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT18" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x22", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT18-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT18-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT18" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x22", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "1", + "attr_cmpval": "0x2", + "attr_len": "1" + } + ] + } + }, + "PORT19": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT19", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "19" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT19-EEPROM" + }, + { + "itf": "control", + "dev": "PORT19-CTRL" + } + ] + } + }, + "PORT19-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT19-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT19" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x23", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT19-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT19-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT19" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x23", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "2", + "attr_cmpval": "0x4", + "attr_len": "1" + } + ] + } + }, + "PORT20": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT20", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "20" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT20-EEPROM" + }, + { + "itf": "control", + "dev": "PORT20-CTRL" + } + ] + } + }, + "PORT20-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT20-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT20" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x24", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT20-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT20-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT20" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x24", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "3", + "attr_cmpval": "0x8", + "attr_len": "1" + } + ] + } + }, + "PORT21": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT21", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "21" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT21-EEPROM" + }, + { + "itf": "control", + "dev": "PORT21-CTRL" + } + ] + } + }, + "PORT21-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT21-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT21" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x25", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT21-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT21-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT21" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x25", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "4", + "attr_cmpval": "0x10", + "attr_len": "1" + } + ] + } + }, + "PORT22": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT22", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "22" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT22-EEPROM" + }, + { + "itf": "control", + "dev": "PORT22-CTRL" + } + ] + } + }, + "PORT22-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT22-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT22" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x26", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT22-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT22-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT22" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x26", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "5", + "attr_cmpval": "0x20", + "attr_len": "1" + } + ] + } + }, + "PORT23": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT23", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "23" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT23-EEPROM" + }, + { + "itf": "control", + "dev": "PORT23-CTRL" + } + ] + } + }, + "PORT23-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT23-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT23" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x27", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT23-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT23-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT23" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x27", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "6", + "attr_cmpval": "0x40", + "attr_len": "1" + } + ] + } + }, + "PORT24": { + "dev_info": { + "device_type": "QSFP28", + "device_name": "PORT24", + "device_parent": "MUX5" + }, + "dev_attr": { + "dev_idx": "24" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT24-EEPROM" + }, + { + "itf": "control", + "dev": "PORT24-CTRL" + } + ] + } + }, + "PORT24-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT24-EEPROM", + "device_parent": "MUX5", + "virt_parent": "PORT24" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x28", + "dev_addr": "0x50", + "dev_type": "optoe1" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT24-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT24-CTRL", + "device_parent": "MUX5", + "virt_parent": "PORT24" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x28", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x12", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x16", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x42", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x46", + "attr_mask": "7", + "attr_cmpval": "0x80", + "attr_len": "1" + } + ] + } + }, + "PORT25": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT25", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "25" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT25-EEPROM" + }, + { + "itf": "control", + "dev": "PORT25-CTRL" + } + ] + } + }, + "PORT25-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT25-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT25" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x29", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT25-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT25-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT25" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x29", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "0", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "0", + "attr_cmpval": "0x1", + "attr_len": "1" + } + ] + } + }, + "PORT26": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT26", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "26" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT26-EEPROM" + }, + { + "itf": "control", + "dev": "PORT26-CTRL" + } + ] + } + }, + "PORT26-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT26-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT26" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2a", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT26-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT26-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT26" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2a", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "1", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "1", + "attr_cmpval": "0x2", + "attr_len": "1" + } + ] + } + }, + "PORT27": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT27", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "27" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT27-EEPROM" + }, + { + "itf": "control", + "dev": "PORT27-CTRL" + } + ] + } + }, + "PORT27-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT27-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT27" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2b", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT27-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT27-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT27" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2b", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "2", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "2", + "attr_cmpval": "0x4", + "attr_len": "1" + } + ] + } + }, + "PORT28": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT28", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "28" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT28-EEPROM" + }, + { + "itf": "control", + "dev": "PORT28-CTRL" + } + ] + } + }, + "PORT28-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT28-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT28" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2c", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT28-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT28-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT28" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2c", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "3", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "3", + "attr_cmpval": "0x8", + "attr_len": "1" + } + ] + } + }, + "PORT29": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT29", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "29" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT29-EEPROM" + }, + { + "itf": "control", + "dev": "PORT29-CTRL" + } + ] + } + }, + "PORT29-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT29-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT29" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2d", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT29-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT29-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT29" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2d", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "4", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "4", + "attr_cmpval": "0x10", + "attr_len": "1" + } + ] + } + }, + "PORT30": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT30", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "30" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT30-EEPROM" + }, + { + "itf": "control", + "dev": "PORT30-CTRL" + } + ] + } + }, + "PORT30-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT30-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT30" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2e", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT30-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT30-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT30" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2e", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "5", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "5", + "attr_cmpval": "0x20", + "attr_len": "1" + } + ] + } + }, + "PORT31": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT31", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "31" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT31-EEPROM" + }, + { + "itf": "control", + "dev": "PORT31-CTRL" + } + ] + } + }, + "PORT31-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT31-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT31" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2f", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT31-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT31-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT31" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x2f", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "6", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "6", + "attr_cmpval": "0x40", + "attr_len": "1" + } + ] + } + }, + "PORT32": { + "dev_info": { + "device_type": "QSFP-DD", + "device_name": "PORT32", + "device_parent": "MUX6" + }, + "dev_attr": { + "dev_idx": "32" + }, + "i2c": { + "interface": [ + { + "itf": "eeprom", + "dev": "PORT32-EEPROM" + }, + { + "itf": "control", + "dev": "PORT32-CTRL" + } + ] + } + }, + "PORT32-EEPROM": { + "dev_info": { + "device_type": "", + "device_name": "PORT32-EEPROM", + "device_parent": "MUX6", + "virt_parent": "PORT32" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x30", + "dev_addr": "0x50", + "dev_type": "optoe3" + }, + "attr_list": [ + { + "attr_name": "eeprom" + } + ] + } + }, + "PORT32-CTRL": { + "dev_info": { + "device_type": "", + "device_name": "PORT32-CTRL", + "device_parent": "MUX6", + "virt_parent": "PORT32" + }, + "i2c": { + "topo_info": { + "parent_bus": "0x30", + "dev_addr": "0x53", + "dev_type": "pddf_xcvr" + }, + "attr_list": [ + { + "attr_name": "xcvr_intr_status", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x13", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_present", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x17", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_reset", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x43", + "attr_mask": "7", + "attr_cmpval": "0x0", + "attr_len": "1" + }, + { + "attr_name": "xcvr_lpmode", + "attr_devaddr": "0x31", + "attr_devname": "CPLD2", + "attr_devtype": "cpld", + "attr_offset": "0x47", + "attr_mask": "7", + "attr_cmpval": "0x80", + "attr_len": "1" + } + ] + } + } +} diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf_support b/device/ufispace/x86_64-ufispace_s9301_32db-r0/pddf_support new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform.json b/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform.json new file mode 100644 index 000000000000..65a45fd2414c --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform.json @@ -0,0 +1,613 @@ +{ + "chassis": { + "name": "S9301-32DB", + "components": [ + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + }, + { + "name": "BIOS" + }, + { + "name": "BMC" + } + ], + "fans": [ + { + "name": "Fantray1_1" + }, + { + "name": "Fantray1_2" + }, + { + "name": "Fantray2_1" + }, + { + "name": "Fantray2_2" + }, + { + "name": "Fantray3_1" + }, + { + "name": "Fantray3_2" + }, + { + "name": "Fantray4_1" + }, + { + "name": "Fantray4_2" + }, + { + "name": "Fantray5_1" + }, + { + "name": "Fantray5_2" + }, + { + "name": "Fantray6_1" + }, + { + "name": "Fantray6_2" + } + ], + "fan_drawers":[ + { + "name": "Fantray1", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray1_1" + }, + { + "name": "Fantray1_2" + } + ] + }, + { + "name": "Fantray2", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray2_1" + }, + { + "name": "Fantray2_2" + } + ] + }, + { + "name": "Fantray3", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray3_1" + }, + { + "name": "Fantray3_2" + } + ] + }, + { + "name": "Fantray4", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray4_1" + }, + { + "name": "Fantray4_2" + } + ] + }, + { + "name": "Fantray5", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray5_1" + }, + { + "name": "Fantray5_2" + } + ] + }, + { + "name": "Fantray6", + "num_fans" : 2, + "fans": [ + { + "name": "Fantray6_1" + }, + { + "name": "Fantray6_2" + } + ] + } + ], + "psus": [ + { + "name": "PSU1", + "fans": [ + { + "name": "PSU1_FAN1" + } + ], + "thermals": [ + { + "name": "PSU1_TEMP1" + } + ] + }, + { + "name": "PSU2", + "fans": [ + { + "name": "PSU2_FAN1" + } + ], + "thermals": [ + { + "name": "PSU2_TEMP1" + } + ] + } + ], + "thermals": [ + { + "name": "Temp_CPU_PECI" + }, + { + "name": "Temp_CPU_ENV" + }, + { + "name": "Temp_CPU_ENV2" + }, + { + "name": "Temp_CPU_PECI" + }, + { + "name": "Temp_MAC_DIE" + }, + { + "name": "Temp_MAC_ENV" + }, + { + "name": "Temp_PSU_CONNTOR" + } + ], + "sfps": [ + { + "name": "Ethernet0" + }, + { + "name": "Ethernet4" + }, + { + "name": "Ethernet8" + }, + { + "name": "Ethernet12" + }, + { + "name": "Ethernet16" + }, + { + "name": "Ethernet20" + }, + { + "name": "Ethernet24" + }, + { + "name": "Ethernet28" + }, + { + "name": "Ethernet32" + }, + { + "name": "Ethernet36" + }, + { + "name": "Ethernet40" + }, + { + "name": "Ethernet44" + }, + { + "name": "Ethernet48" + }, + { + "name": "Ethernet52" + }, + { + "name": "Ethernet56" + }, + { + "name": "Ethernet60" + }, + { + "name": "Ethernet64" + }, + { + "name": "Ethernet68" + }, + { + "name": "Ethernet72" + }, + { + "name": "Ethernet76" + }, + { + "name": "Ethernet80" + }, + { + "name": "Ethernet84" + }, + { + "name": "Ethernet88" + }, + { + "name": "Ethernet92" + }, + { + "name": "Ethernet96" + }, + { + "name": "Ethernet104" + }, + { + "name": "Ethernet112" + }, + { + "name": "Ethernet120" + }, + { + "name": "Ethernet128" + }, + { + "name": "Ethernet136" + }, + { + "name": "Ethernet144" + }, + { + "name": "Ethernet152" + } + ] + }, + "interfaces": { + "Ethernet0": { + "index": "0,0,0,0", + "lanes": "1,2,3,4", + "breakout_modes": { + "1x200G": ["Eth0(Port0)"], + "2x100G": ["Eth0/1(Port0)", "Eth0/2(Port0)"], + "4x50G": ["Eth0/1(Port0)", "Eth0/2(Port0)", "Eth0/3(Port0)", "Eth0/4(Port0)"] + } + }, + + "Ethernet4": { + "index": "1,1,1,1", + "lanes": "5,6,7,8", + "breakout_modes": { + "1x200G": ["Eth1(Port1)"], + "2x100G": ["Eth1/1(Port1)", "Eth1/2(Port1)"], + "4x50G": ["Eth1/1(Port1)", "Eth1/2(Port1)", "Eth1/3(Port1)", "Eth1/4(Port1)"] + } + }, + + "Ethernet8": { + "index": "2,2,2,2", + "lanes": "9,10,11,12", + "breakout_modes": { + "1x200G": ["Eth2(Port2)"], + "2x100G": ["Eth2/1(Port2)", "Eth2/2(Port2)"], + "4x50G": ["Eth2/1(Port2)", "Eth2/2(Port2)", "Eth2/3(Port2)", "Eth2/4(Port2)"] + } + }, + + "Ethernet12": { + "index": "3,3,3,3", + "lanes": "13,14,15,16", + "breakout_modes": { + "1x200G": ["Eth3(Port3)"], + "2x100G": ["Eth3/1(Port3)", "Eth3/2(Port3)"], + "4x50G": ["Eth3/1(Port3)", "Eth3/2(Port3)", "Eth3/3(Port3)", "Eth3/4(Port3)"] + } + }, + + "Ethernet16": { + "index": "4,4,4,4", + "lanes": "17,18,19,20", + "breakout_modes": { + "1x200G": ["Eth4(Port4)"], + "2x100G": ["Eth4/1(Port4)", "Eth4/2(Port4)"], + "4x50G": ["Eth4/1(Port4)", "Eth4/2(Port4)", "Eth4/3(Port4)", "Eth4/4(Port4)"] + } + }, + + "Ethernet20": { + "index": "5,5,5,5", + "lanes": "21,22,23,24", + "breakout_modes": { + "1x200G": ["Eth5(Port5)"], + "2x100G": ["Eth5/1(Port5)", "Eth5/2(Port5)"], + "4x50G": ["Eth5/1(Port5)", "Eth5/2(Port5)", "Eth5/3(Port5)", "Eth5/4(Port5)"] + } + }, + + "Ethernet24": { + "index": "6,6,6,6", + "lanes": "25,26,27,28", + "breakout_modes": { + "1x200G": ["Eth6(Port6)"], + "2x100G": ["Eth6/1(Port6)", "Eth6/2(Port6)"], + "4x50G": ["Eth6/1(Port6)", "Eth6/2(Port6)", "Eth6/3(Port6)", "Eth6/4(Port6)"] + } + }, + + "Ethernet28": { + "index": "7,7,7,7", + "lanes": "29,30,31,32", + "breakout_modes": { + "1x200G": ["Eth7(Port7)"], + "2x100G": ["Eth7/1(Port7)", "Eth7/2(Port7)"], + "4x50G": ["Eth7/1(Port7)", "Eth7/2(Port7)", "Eth7/3(Port7)", "Eth7/4(Port7)"] + } + }, + + "Ethernet32": { + "index": "8,8,8,8", + "lanes": "33,34,35,36", + "breakout_modes": { + "1x200G": ["Eth8(Port8)"], + "2x100G": ["Eth8/1(Port8)", "Eth8/2(Port8)"], + "4x50G": ["Eth8/1(Port8)", "Eth8/2(Port8)", "Eth8/3(Port8)", "Eth8/4(Port8)"] + } + }, + + "Ethernet36": { + "index": "9,9,9,9", + "lanes": "37,38,39,40", + "breakout_modes": { + "1x200G": ["Eth9(Port9)"], + "2x100G": ["Eth9/1(Port9)", "Eth9/2(Port9)"], + "4x50G": ["Eth9/1(Port9)", "Eth9/2(Port9)", "Eth9/3(Port9)", "Eth9/4(Port9)"] + } + }, + + "Ethernet40": { + "index": "10,10,10,10", + "lanes": "41,42,43,44", + "breakout_modes": { + "1x200G": ["Eth10(Port10)"], + "2x100G": ["Eth10/1(Port10)", "Eth10/2(Port10)"], + "4x50G": ["Eth10/1(Port10)", "Eth10/2(Port10)", "Eth10/3(Port10)", "Eth10/4(Port10)"] + } + }, + + "Ethernet44": { + "index": "11,11,11,11", + "lanes": "45,46,47,48", + "breakout_modes": { + "1x200G": ["Eth11(Port11)"], + "2x100G": ["Eth11/1(Port11)", "Eth11/2(Port11)"], + "4x50G": ["Eth11/1(Port11)", "Eth11/2(Port11)", "Eth11/3(Port11)", "Eth11/4(Port11)"] + } + }, + + "Ethernet48": { + "index": "12,12,12,12", + "lanes": "49,50,51,52", + "breakout_modes": { + "1x200G": ["Eth12(Port12)"], + "2x100G": ["Eth12/1(Port12)", "Eth12/2(Port12)"], + "4x50G": ["Eth12/1(Port12)", "Eth12/2(Port12)", "Eth12/3(Port12)", "Eth12/4(Port12)"] + } + }, + + "Ethernet52": { + "index": "13,13,13,13", + "lanes": "53,54,55,56", + "breakout_modes": { + "1x200G": ["Eth13(Port13)"], + "2x100G": ["Eth13/1(Port13)", "Eth13/2(Port13)"], + "4x50G": ["Eth13/1(Port13)", "Eth13/2(Port13)", "Eth13/3(Port13)", "Eth13/4(Port13)"] + } + }, + + "Ethernet56": { + "index": "14,14,14,14", + "lanes": "57,58,59,60", + "breakout_modes": { + "1x200G": ["Eth14(Port14)"], + "2x100G": ["Eth14/1(Port14)", "Eth14/2(Port14)"], + "4x50G": ["Eth14/1(Port14)", "Eth14/2(Port14)", "Eth14/3(Port14)", "Eth14/4(Port14)"] + } + }, + + "Ethernet60": { + "index": "15,15,15,15", + "lanes": "61,62,63,64", + "breakout_modes": { + "1x200G": ["Eth15(Port15)"], + "2x100G": ["Eth15/1(Port15)", "Eth15/2(Port15)"], + "4x50G": ["Eth15/1(Port15)", "Eth15/2(Port15)", "Eth15/3(Port15)", "Eth15/4(Port15)"] + } + }, + + "Ethernet64": { + "index": "16,16,16,16", + "lanes": "65,66,67,68", + "breakout_modes": { + "1x200G": ["Eth16(Port16)"], + "2x100G": ["Eth16/1(Port16)", "Eth16/2(Port16)"], + "4x50G": ["Eth16/1(Port16)", "Eth16/2(Port16)", "Eth16/3(Port16)", "Eth16/4(Port16)"] + } + }, + + "Ethernet68": { + "index": "17,17,17,17", + "lanes": "69,70,71,72", + "breakout_modes": { + "1x200G": ["Eth17(Port17)"], + "2x100G": ["Eth17/1(Port17)", "Eth17/2(Port17)"], + "4x50G": ["Eth17/1(Port17)", "Eth17/2(Port17)", "Eth17/3(Port17)", "Eth17/4(Port17)"] + } + }, + + "Ethernet72": { + "index": "18,18,18,18", + "lanes": "73,74,75,76", + "breakout_modes": { + "1x200G": ["Eth18(Port18)"], + "2x100G": ["Eth18/1(Port18)", "Eth18/2(Port18)"], + "4x50G": ["Eth18/1(Port18)", "Eth18/2(Port18)", "Eth18/3(Port18)", "Eth18/4(Port18)"] + } + }, + + "Ethernet76": { + "index": "19,19,19,19", + "lanes": "77,78,79,80", + "breakout_modes": { + "1x200G": ["Eth19(Port19)"], + "2x100G": ["Eth19/1(Port19)", "Eth19/2(Port19)"], + "4x50G": ["Eth19/1(Port19)", "Eth19/2(Port19)", "Eth19/3(Port19)", "Eth19/4(Port19)"] + } + }, + + "Ethernet80": { + "index": "20,20,20,20", + "lanes": "81,82,83,84", + "breakout_modes": { + "1x200G": ["Eth20(Port20)"], + "2x100G": ["Eth20/1(Port20)", "Eth20/2(Port20)"], + "4x50G": ["Eth20/1(Port20)", "Eth20/2(Port20)", "Eth20/3(Port20)", "Eth20/4(Port20)"] + } + }, + + "Ethernet84": { + "index": "21,21,21,21", + "lanes": "85,86,87,88", + "breakout_modes": { + "1x200G": ["Eth21(Port21)"], + "2x100G": ["Eth21/1(Port21)", "Eth21/2(Port21)"], + "4x50G": ["Eth21/1(Port21)", "Eth21/2(Port21)", "Eth21/3(Port21)", "Eth21/4(Port21)"] + } + }, + + "Ethernet88": { + "index": "22,22,22,22", + "lanes": "89,90,91,92", + "breakout_modes": { + "1x200G": ["Eth22(Port22)"], + "2x100G": ["Eth22/1(Port22)", "Eth22/2(Port22)"], + "4x50G": ["Eth22/1(Port22)", "Eth22/2(Port22)", "Eth22/3(Port22)", "Eth22/4(Port22)"] + } + }, + + "Ethernet92": { + "index": "23,23,23,23", + "lanes": "93,94,95,96", + "breakout_modes": { + "1x200G": ["Eth23(Port23)"], + "2x100G": ["Eth23/1(Port23)", "Eth23/2(Port23)"], + "4x50G": ["Eth23/1(Port23)", "Eth23/2(Port23)", "Eth23/3(Port23)", "Eth23/4(Port23)"] + } + }, + + "Ethernet96": { + "index": "24,24,24,24,24,24,24,24", + "lanes": "97,98,99,100,101,102,103,104", + "breakout_modes": { + "1x400G": ["Eth24(Port24)"], + "2x200G": ["Eth24/1(Port24)", "Eth24/2(Port24)"], + "4x100G": ["Eth24/1(Port24)", "Eth24/2(Port24)", "Eth24/3(Port24)", "Eth24/4(Port24)"], + "8x50G": ["Eth24/1(Port24)", "Eth24/2(Port24)", "Eth24/3(Port24)", "Eth24/4(Port24)", "Eth24/5(Port24)", "Eth24/6(Port24)", "Eth24/7(Port24)", "Eth24/8(Port24)"] + } + }, + + "Ethernet104": { + "index": "25,25,25,25,25,25,25,25", + "lanes": "105,106,107,108,109,110,111,112", + "breakout_modes": { + "1x400G": ["Eth25(Port25)"], + "2x200G": ["Eth25/1(Port25)", "Eth25/2(Port25)"], + "4x100G": ["Eth25/1(Port25)", "Eth25/2(Port25)", "Eth25/3(Port25)", "Eth25/4(Port25)"], + "8x50G": ["Eth25/1(Port25)", "Eth25/2(Port25)", "Eth25/3(Port25)", "Eth25/4(Port25)", "Eth25/5(Port25)", "Eth25/6(Port25)", "Eth25/7(Port25)", "Eth25/8(Port25)"] + } + }, + + "Ethernet112": { + "index": "26,26,26,26,26,26,26,26", + "lanes": "113,114,115,116,117,118,119,120", + "breakout_modes": { + "1x400G": ["Eth26(Port26)"], + "2x200G": ["Eth26/1(Port26)", "Eth26/2(Port26)"], + "4x100G": ["Eth26/1(Port26)", "Eth26/2(Port26)", "Eth26/3(Port26)", "Eth26/4(Port26)"], + "8x50G": ["Eth26/1(Port26)", "Eth26/2(Port26)", "Eth26/3(Port26)", "Eth26/4(Port26)", "Eth26/5(Port26)", "Eth26/6(Port26)", "Eth26/7(Port26)", "Eth26/8(Port26)"] + } + }, + + "Ethernet120": { + "index": "27,27,27,27,27,27,27,27", + "lanes": "121,122,123,124,125,126,127,128", + "breakout_modes": { + "1x400G": ["Eth27(Port27)"], + "2x200G": ["Eth27/1(Port27)", "Eth27/2(Port27)"], + "4x100G": ["Eth27/1(Port27)", "Eth27/2(Port27)", "Eth27/3(Port27)", "Eth27/4(Port27)"], + "8x50G": ["Eth27/1(Port27)", "Eth27/2(Port27)", "Eth27/3(Port27)", "Eth27/4(Port27)", "Eth27/5(Port27)", "Eth27/6(Port27)", "Eth27/7(Port27)", "Eth27/8(Port27)"] + } + }, + + "Ethernet128": { + "index": "28,28,28,28,28,28,28,28", + "lanes": "129,130,131,132,133,134,135,136", + "breakout_modes": { + "1x400G": ["Eth28(Port28)"], + "2x200G": ["Eth28/1(Port28)", "Eth28/2(Port28)"], + "4x100G": ["Eth28/1(Port28)", "Eth28/2(Port28)", "Eth28/3(Port28)", "Eth28/4(Port28)"], + "8x50G": ["Eth28/1(Port28)", "Eth28/2(Port28)", "Eth28/3(Port28)", "Eth28/4(Port28)", "Eth28/5(Port28)", "Eth28/6(Port28)", "Eth28/7(Port28)", "Eth28/8(Port28)"] + } + }, + + "Ethernet136": { + "index": "29,29,29,29,29,29,29,29", + "lanes": "137,138,139,140,141,142,143,144", + "breakout_modes": { + "1x400G": ["Eth29(Port29)"], + "2x200G": ["Eth29/1(Port29)", "Eth29/2(Port29)"], + "4x100G": ["Eth29/1(Port29)", "Eth29/2(Port29)", "Eth29/3(Port29)", "Eth29/4(Port29)"], + "8x50G": ["Eth29/1(Port29)", "Eth29/2(Port29)", "Eth29/3(Port29)", "Eth29/4(Port29)", "Eth29/5(Port29)", "Eth29/6(Port29)", "Eth29/7(Port29)", "Eth29/8(Port29)"] + } + }, + + "Ethernet144": { + "index": "30,30,30,30,30,30,30,30", + "lanes": "145,146,147,148,149,150,151,152", + "breakout_modes": { + "1x400G": ["Eth30(Port30)"], + "2x200G": ["Eth30/1(Port30)", "Eth30/2(Port30)"], + "4x100G": ["Eth30/1(Port30)", "Eth30/2(Port30)", "Eth30/3(Port30)", "Eth30/4(Port30)"], + "8x50G": ["Eth30/1(Port30)", "Eth30/2(Port30)", "Eth30/3(Port30)", "Eth30/4(Port30)", "Eth30/5(Port30)", "Eth30/6(Port30)", "Eth30/7(Port30)", "Eth30/8(Port30)"] + } + }, + + "Ethernet152": { + "index": "31,31,31,31,31,31,31,31", + "lanes": "153,154,155,156,157,158,159,160", + "breakout_modes": { + "1x400G": ["Eth31(Port31)"], + "2x200G": ["Eth31/1(Port31)", "Eth31/2(Port31)"], + "4x100G": ["Eth31/1(Port31)", "Eth31/2(Port31)", "Eth31/3(Port31)", "Eth31/4(Port31)"], + "8x50G": ["Eth31/1(Port31)", "Eth31/2(Port31)", "Eth31/3(Port31)", "Eth31/4(Port31)", "Eth31/5(Port31)", "Eth31/6(Port31)", "Eth31/7(Port31)", "Eth31/8(Port31)"] + } + } + } +} + diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_asic b/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_asic new file mode 100644 index 000000000000..960467652765 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_asic @@ -0,0 +1 @@ +broadcom diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_components.json b/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_components.json new file mode 100644 index 000000000000..4274a79774ed --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_components.json @@ -0,0 +1,13 @@ +{ + "chassis": { + "x86_64-ufispace_s9301_32db-r0": { + "component": { + "CPLD1": { }, + "CPLD2": { }, + "CPLD3": { }, + "BIOS": { }, + "BMC": {} + } + } + } +} diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_env.conf b/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_env.conf new file mode 100644 index 000000000000..dd7cf4fe01c5 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/platform_env.conf @@ -0,0 +1,2 @@ +SYNCD_SHM_SIZE=512m +is_ltsw_chip=1 diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/pmon_daemon_control.json b/device/ufispace/x86_64-ufispace_s9301_32db-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..e348e0168fa5 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/pmon_daemon_control.json @@ -0,0 +1,9 @@ +{ + "skip_pcied": false, + "skip_fancontrol": false, + "skip_thermalctld": false, + "skip_ledd": true, + "skip_xcvrd": false, + "skip_psud": false, + "skip_syseepromd": false +} diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/sensors.conf b/device/ufispace/x86_64-ufispace_s9301_32db-r0/sensors.conf new file mode 100644 index 000000000000..7a1c0408810f --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/sensors.conf @@ -0,0 +1,9 @@ +# libsensors configuration file + +bus "i2c-0" "I2C I801" +chip "tmp75-i2c-*-4f" + label temp1 "CPU Board Temp" + set temp1_max 70 + set temp1_max_hyst 75 + set temp1_crit 85 + diff --git a/device/ufispace/x86_64-ufispace_s9301_32db-r0/system_health_monitoring_config.json b/device/ufispace/x86_64-ufispace_s9301_32db-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..6291e81a0621 --- /dev/null +++ b/device/ufispace/x86_64-ufispace_s9301_32db-r0/system_health_monitoring_config.json @@ -0,0 +1,15 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu", + "fan" + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "yellow", + "normal": "green", + "booting": "blinking_green" + } +} \ No newline at end of file diff --git a/platform/broadcom/one-image.mk b/platform/broadcom/one-image.mk index 4e86423bd7e8..0b93b3b2b165 100755 --- a/platform/broadcom/one-image.mk +++ b/platform/broadcom/one-image.mk @@ -85,11 +85,13 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \ $(NOKIA_IXR7220H5_64D_PLATFORM_MODULE) \ $(TENCENT_TCS8400_PLATFORM_MODULE) \ $(TENCENT_TCS9400_PLATFORM_MODULE) \ - $(UFISPACE_S9300_32D_PLATFORM_MODULE) \ - $(UFISPACE_S9110_32X_PLATFORM_MODULE) \ - $(UFISPACE_S8901_54XC_PLATFORM_MODULE) \ - $(UFISPACE_S7801_54XS_PLATFORM_MODULE) \ $(UFISPACE_S6301_56ST_PLATFORM_MODULE) \ + $(UFISPACE_S7801_54XS_PLATFORM_MODULE) \ + $(UFISPACE_S8901_54XC_PLATFORM_MODULE) \ + $(UFISPACE_S9110_32X_PLATFORM_MODULE) \ + $(UFISPACE_S9300_32D_PLATFORM_MODULE) \ + $(UFISPACE_S9301_32D_PLATFORM_MODULE) \ + $(UFISPACE_S9301_32DB_PLATFORM_MODULE) \ $(MICAS_M2_W6510_48V8C_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_BUILD_INSTALLS = $(BRCM_OPENNSL_KERNEL) $(BRCM_DNX_OPENNSL_KERNEL) diff --git a/platform/broadcom/platform-modules-ufispace.dep b/platform/broadcom/platform-modules-ufispace.dep new file mode 100644 index 000000000000..a6609b3c6f2b --- /dev/null +++ b/platform/broadcom/platform-modules-ufispace.dep @@ -0,0 +1,10 @@ + +MPATH := $($(UFISPACE_S9300_32D_PLATFORM_MODULE)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/platform-modules-ufispace.mk platform/broadcom/platform-modules-ufispace.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(MPATH)) + +$(UFISPACE_S9300_32D_PLATFORM_MODULE)_CACHE_MODE := GIT_CONTENT_SHA +$(UFISPACE_S9300_32D_PLATFORM_MODULE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(UFISPACE_S9300_32D_PLATFORM_MODULE)_DEP_FILES := $(DEP_FILES) + diff --git a/platform/broadcom/platform-modules-ufispace.mk b/platform/broadcom/platform-modules-ufispace.mk index 2c202cbbaa0c..18bba6f50883 100644 --- a/platform/broadcom/platform-modules-ufispace.mk +++ b/platform/broadcom/platform-modules-ufispace.mk @@ -1,12 +1,16 @@ # UfiSpace Platform modules UFISPACE_S9300_32D_PLATFORM_MODULE_VERSION = 1.0.0 +UFISPACE_S9301_32D_PLATFORM_MODULE_VERSION = 1.0.0 +UFISPACE_S9301_32DB_PLATFORM_MODULE_VERSION = 1.0.0 UFISPACE_S9110_32X_PLATFORM_MODULE_VERSION = 1.0.0 UFISPACE_S8901_54XC_PLATFORM_MODULE_VERSION = 1.0.0 UFISPACE_S7801_54XS_PLATFORM_MODULE_VERSION = 1.0.0 UFISPACE_S6301_56ST_PLATFORM_MODULE_VERSION = 1.0.0 export UFISPACE_S9300_32D_PLATFORM_MODULE_VERSION +export UFISPACE_S9301_32D_PLATFORM_MODULE_VERSION +export UFISPACE_S9301_32DB_PLATFORM_MODULE_VERSION export UFISPACE_S9110_32X_PLATFORM_MODULE_VERSION export UFISPACE_S8901_54XC_PLATFORM_MODULE_VERSION export UFISPACE_S7801_54XS_PLATFORM_MODULE_VERSION @@ -18,6 +22,14 @@ $(UFISPACE_S9300_32D_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADER $(UFISPACE_S9300_32D_PLATFORM_MODULE)_PLATFORM = x86_64-ufispace_s9300_32d-r0 SONIC_DPKG_DEBS += $(UFISPACE_S9300_32D_PLATFORM_MODULE) +UFISPACE_S9301_32D_PLATFORM_MODULE = sonic-platform-ufispace-s9301-32d_$(UFISPACE_S9301_32D_PLATFORM_MODULE_VERSION)_amd64.deb +$(UFISPACE_S9301_32D_PLATFORM_MODULE)_PLATFORM = x86_64-ufispace_s9301_32d-r0 +$(eval $(call add_extra_package,$(UFISPACE_S9300_32D_PLATFORM_MODULE),$(UFISPACE_S9301_32D_PLATFORM_MODULE))) + +UFISPACE_S9301_32DB_PLATFORM_MODULE = sonic-platform-ufispace-s9301-32db_$(UFISPACE_S9301_32DB_PLATFORM_MODULE_VERSION)_amd64.deb +$(UFISPACE_S9301_32DB_PLATFORM_MODULE)_PLATFORM = x86_64-ufispace_s9301_32db-r0 +$(eval $(call add_extra_package,$(UFISPACE_S9300_32D_PLATFORM_MODULE),$(UFISPACE_S9301_32DB_PLATFORM_MODULE))) + UFISPACE_S9110_32X_PLATFORM_MODULE = sonic-platform-ufispace-s9110-32x_$(UFISPACE_S9110_32X_PLATFORM_MODULE_VERSION)_amd64.deb $(UFISPACE_S9110_32X_PLATFORM_MODULE)_PLATFORM = x86_64-ufispace_s9110_32x-r0 $(eval $(call add_extra_package,$(UFISPACE_S9300_32D_PLATFORM_MODULE),$(UFISPACE_S9110_32X_PLATFORM_MODULE))) diff --git a/platform/broadcom/rules.dep b/platform/broadcom/rules.dep index 51cca1baacce..fbdbb865e4d6 100644 --- a/platform/broadcom/rules.dep +++ b/platform/broadcom/rules.dep @@ -20,6 +20,7 @@ include $(PLATFORM_PATH)/platform-modules-quanta.dep #include $(PLATFORM_PATH)/platform-modules-ragile.dep include $(PLATFORM_PATH)/platform-modules-ruijie.dep include $(PLATFORM_PATH)/platform-modules-brcm-xlr-gts.dep +include $(PLATFORM_PATH)/platform-modules-ufispace.dep include $(PLATFORM_PATH)/platform-modules-micas.dep include $(PLATFORM_PATH)/docker-syncd-brcm.dep include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.dep diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index 3349e6717074..4070f7be06ae 100755 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -4,7 +4,6 @@ include $(PLATFORM_PATH)/sai.mk # * Nokia # * Juniper # * Ragile -# * Ufispace include $(PLATFORM_PATH)/platform-modules-nokia.mk include $(PLATFORM_PATH)/platform-modules-dell.mk include $(PLATFORM_PATH)/platform-modules-arista.mk @@ -21,7 +20,7 @@ include $(PLATFORM_PATH)/platform-modules-quanta.mk #include $(PLATFORM_PATH)/platform-modules-ruijie.mk #include $(PLATFORM_PATH)/platform-modules-ragile.mk #include $(PLATFORM_PATH)/platform-modules-tencent.mk -#include $(PLATFORM_PATH)/platform-modules-ufispace.mk +include $(PLATFORM_PATH)/platform-modules-ufispace.mk include $(PLATFORM_PATH)/platform-modules-micas.mk include $(PLATFORM_PATH)/docker-syncd-brcm.mk include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.mk diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/changelog b/platform/broadcom/sonic-platform-modules-ufispace/debian/changelog index 029c0374df67..f6a51fb47237 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/debian/changelog +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/changelog @@ -1,3 +1,10 @@ +sonic-ufispace-platform-modules (1.0.0) unstable; urgency=low + + * Add support for S9301-32D + * Add support for S9301-32DB + + -- ufispace Mon, 06 May 2024 17:54:25 +0800 + sonic-ufispace-platform-modules (1.0.0) unstable; urgency=low * Add support for S6301-56ST diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/control b/platform/broadcom/sonic-platform-modules-ufispace/debian/control index 798179f6e394..2c39dd2f4850 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/debian/control +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/control @@ -6,9 +6,17 @@ Build-Depends: debhelper (>= 9), bzip2 Standards-Version: 1.0.0 Package: sonic-platform-ufispace-s9300-32d -Architecture: amd64 +Architecture: amd64 Description: This package contains s9300-32d platform driver utility for SONiC project. +Package: sonic-platform-ufispace-s9301-32d +Architecture: amd64 +Description: This package contains s9301-32d platform driver utility for SONiC project. + +Package: sonic-platform-ufispace-s9301-32db +Architecture: amd64 +Description: This package contains s9301-32db platform driver utility for SONiC project. + Package: sonic-platform-ufispace-s9110-32x Architecture: amd64 Description: This package contains s9110-32x platform driver utility for SONiC project. @@ -23,4 +31,4 @@ Description: This package contains s7801-54xs platform driver utility for SONiC Package: sonic-platform-ufispace-s6301-56st Architecture: amd64 -Description: This package contains s6301-56st platform driver utility for SONiC project. \ No newline at end of file +Description: This package contains s6301-56st platform driver utility for SONiC project. diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/rules b/platform/broadcom/sonic-platform-modules-ufispace/debian/rules index d36b48dbc53c..092bbb5bbc89 100755 --- a/platform/broadcom/sonic-platform-modules-ufispace/debian/rules +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/rules @@ -19,7 +19,9 @@ PACKAGE_PRE_NAME := sonic-platform-ufispace KVERSION ?= $(shell uname -r) KERNEL_SRC := /lib/modules/$(KVERSION) MOD_SRC_DIR:= $(shell pwd) -MODULE_DIRS:= s9300-32d +MODULE_DIRS := s9300-32d +MODULE_DIRS += s9301-32d +MODULE_DIRS += s9301-32db MODULE_DIRS += s9110-32x MODULE_DIRS += s8901-54xc MODULE_DIRS += s7801-54xs diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.prerm b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.prerm new file mode 100644 index 000000000000..f9fe8c017ab0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9300-32d.prerm @@ -0,0 +1,2 @@ +systemctl stop pddf-platform-init.service +systemctl disable pddf-platform-init.service diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.install b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.install new file mode 100644 index 000000000000..fa71db5eccfd --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.install @@ -0,0 +1 @@ +s9301-32d/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-ufispace_s9301_32d-r0/pddf diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.postinst b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.postinst new file mode 100644 index 000000000000..01666039ca26 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.postinst @@ -0,0 +1,3 @@ +depmod -a +systemctl enable pddf-platform-init.service +systemctl start pddf-platform-init.service diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.prerm b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.prerm new file mode 100644 index 000000000000..f9fe8c017ab0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32d.prerm @@ -0,0 +1,2 @@ +systemctl stop pddf-platform-init.service +systemctl disable pddf-platform-init.service diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.install b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.install new file mode 100644 index 000000000000..64349db9aab6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.install @@ -0,0 +1 @@ +s9301-32db/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-ufispace_s9301_32db-r0/pddf diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.postinst b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.postinst new file mode 100644 index 000000000000..01666039ca26 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.postinst @@ -0,0 +1,3 @@ +depmod -a +systemctl enable pddf-platform-init.service +systemctl start pddf-platform-init.service diff --git a/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.prerm b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.prerm new file mode 100644 index 000000000000..f9fe8c017ab0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/debian/sonic-platform-ufispace-s9301-32db.prerm @@ -0,0 +1,2 @@ +systemctl stop pddf-platform-init.service +systemctl disable pddf-platform-init.service diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/Makefile b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/Makefile index 7c2273d0063b..e27865a9be3d 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/Makefile @@ -1,5 +1,5 @@ -MODULE_NAME = x86-64-ufispace-s6301-56st-sys-eeprom.o x86-64-ufispace-s6301-56st-lpc.o +MODULE_NAME = x86-64-ufispace-s6301-56st-sys-eeprom.o x86-64-ufispace-s6301-56st-lpc.o pddf_custom_psu.o obj-m := $(MODULE_NAME) CFLAGS_pddf_custom_sysstatus_module.o := -I$(M)/../../../../pddf/i2c/modules/include diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/pddf_custom_psu.c b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/pddf_custom_psu.c new file mode 100644 index 000000000000..b71f0b90b0cf --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/pddf_custom_psu.c @@ -0,0 +1,124 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../../../../pddf/i2c/modules/include/pddf_psu_defs.h" + +#define PSU_REG_VOUT_MODE 0x20 +#define PSU_REG_READ_VOUT 0x8b + +ssize_t pddf_show_custom_psu_v_out(struct device *dev, struct device_attribute *da, char *buf); +extern PSU_SYSFS_ATTR_DATA access_psu_v_out; + +static int two_complement_to_int(u16 data, u8 valid_bit, int mask) +{ + u16 valid_data = data & mask; + bool is_negative = valid_data >> (valid_bit - 1); + + return is_negative ? (-(((~valid_data) & mask) + 1)) : valid_data; +} + +static u8 psu_get_vout_mode(struct i2c_client *client) +{ + u8 status = 0, retry = 10; + uint8_t offset = PSU_REG_VOUT_MODE; + + while (retry) { + status = i2c_smbus_read_byte_data((struct i2c_client *)client, offset); + if (unlikely(status < 0)) { + msleep(60); + retry--; + continue; + } + break; + } + + if (status < 0) + { + printk(KERN_ERR "%s: Get PSU Vout mode failed\n", __func__); + return 0; + } + else + { + /*printk(KERN_ERR "%s: vout_mode reg value 0x%x\n", __func__, status);*/ + return status; + } +} + +static u16 psu_get_v_out(struct i2c_client *client) +{ + u16 status = 0, retry = 10; + uint8_t offset = PSU_REG_READ_VOUT; + + while (retry) { + status = i2c_smbus_read_word_data((struct i2c_client *)client, offset); + if (unlikely(status < 0)) { + msleep(60); + retry--; + continue; + } + break; + } + + if (status < 0) + { + printk(KERN_ERR "%s: Get PSU Vout failed\n", __func__); + return 0; + } + else + { + /*printk(KERN_ERR "%s: vout reg value 0x%x\n", __func__, status);*/ + return status; + } +} + +ssize_t pddf_show_custom_psu_v_out(struct device *dev, struct device_attribute *da, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int exponent, mantissa; + int multiplier = 1000; + + u16 value = psu_get_v_out(client); + u8 vout_mode = psu_get_vout_mode(client); + + if ((vout_mode >> 5) == 0) + exponent = two_complement_to_int(vout_mode & 0x1f, 5, 0x1f); + else + { + /*printk(KERN_ERR "%s: Only support linear mode for vout mode\n", __func__);*/ + exponent = 0; + } + mantissa = value; + if (exponent >= 0) + return sprintf(buf, "%d\n", (mantissa << exponent) * multiplier); + else + return sprintf(buf, "%d\n", (mantissa * multiplier) / (1 << -exponent)); +} + +static int __init pddf_custom_psu_init(void) +{ + access_psu_v_out.show = pddf_show_custom_psu_v_out; + access_psu_v_out.do_get = NULL; + return 0; +} + +static void __exit pddf_custom_psu_exit(void) +{ + return; +} + +MODULE_AUTHOR("Broadcom"); +MODULE_DESCRIPTION("pddf custom psu api"); +MODULE_LICENSE("GPL"); + +module_init(pddf_custom_psu_init); +module_exit(pddf_custom_psu_exit); + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/x86-64-ufispace-s6301-56st-lpc.c b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/x86-64-ufispace-s6301-56st-lpc.c index 9b42c8f2b88f..5858d989af50 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/x86-64-ufispace-s6301-56st-lpc.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/x86-64-ufispace-s6301-56st-lpc.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -44,6 +44,7 @@ #define REG_BASE_CPU 0x600 #define REG_BASE_MB 0x700 +#define REG_BASE_EC 0xe000 //MB CPLD #define REG_MB_BRD_ID_0 (REG_BASE_MB + 0x00) @@ -59,6 +60,10 @@ #define REG_MB_SYS_LED_STATUS_1 (REG_BASE_MB + 0x82) #define REG_MB_SYS_LED_STATUS_2 (REG_BASE_MB + 0x83) #define REG_MB_SYS_LED_STATUS_3 (REG_BASE_MB + 0x84) +#define REG_MB_POWER_EN (REG_BASE_MB + 0x95) +//EC +#define REG_EC_SEL (REG_BASE_EC + 0x394) +#define REG_EC_PSU_RST (REG_BASE_EC + 0x392) #define MASK_ALL (0xFF) @@ -94,6 +99,9 @@ enum lpc_sysfs_attributes { ATT_MB_LED_LNK, ATT_MB_LED_PWR0, ATT_MB_LED_PWR1, + ATT_MB_POWER_EN, + //EC + ATT_EC_PSU_RESET, //BSP ATT_BSP_VERSION, ATT_BSP_DEBUG, @@ -477,6 +485,10 @@ static ssize_t read_lpc_callback(struct device *dev, mask = 0xF; base = BASE_HEX; break; + case ATT_MB_POWER_EN: + reg = REG_MB_POWER_EN; + base = BASE_HEX; + break; //BSP case ATT_BSP_REG_VALUE: if (kstrtou16(bsp_reg, 0, ®) < 0) @@ -511,6 +523,9 @@ static ssize_t write_lpc_callback(struct device *dev, reg = REG_MB_SYS_LED_CTRL_1; mask = 0xF; break; + case ATT_MB_POWER_EN: + reg = REG_MB_POWER_EN; + break; default: return -EINVAL; } @@ -557,18 +572,18 @@ static ssize_t write_bsp_callback(struct device *dev, switch (attr->index) { case ATT_BSP_VERSION: str = bsp_version; - str_len = sizeof(str); + str_len = sizeof(bsp_version); break; case ATT_BSP_DEBUG: str = bsp_debug; - str_len = sizeof(str); + str_len = sizeof(bsp_debug); break; case ATT_BSP_REG: if(kstrtou16(buf, 0, ®) < 0) return -EINVAL; str = bsp_reg; - str_len = sizeof(str); + str_len = sizeof(bsp_reg); break; default: return -EINVAL; @@ -621,6 +636,41 @@ static ssize_t read_gpio_max_callback(struct device *dev, return -1; } +/* set psu_reset register value */ +static ssize_t write_ec_psu_reset(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + u8 val = 0; + u8 reg_val = 0; + static int psu_reset_flag = 0; + + if (kstrtou8(buf, 0, &val) < 0) + return -EINVAL; + + if (psu_reset_flag == 0) { + if (val == 0) { + mutex_lock(&lpc_data->access_lock); + psu_reset_flag = 1; + reg_val = 0x1; + outb(reg_val, REG_EC_SEL); + BSP_LOG_W("reg=0x%04x, reg_val=0x%02x", REG_EC_SEL, reg_val); + reg_val = 0x21; + outb(reg_val, REG_EC_PSU_RST); + BSP_LOG_W("reg=0x%04x, reg_val=0x%02x", REG_EC_PSU_RST, reg_val); + psu_reset_flag = 0; + mutex_unlock(&lpc_data->access_lock); + } else { + return -EINVAL; + } + } else { + printk(KERN_INFO "PSU is resetting... (ignore)\n"); + mutex_lock(&lpc_data->access_lock); + mutex_unlock(&lpc_data->access_lock); + } + + return count; +} + //SENSOR_DEVICE_ATTR - MB static SENSOR_DEVICE_ATTR(board_id_0, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_0); static SENSOR_DEVICE_ATTR(board_id_1, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_1); @@ -644,7 +694,9 @@ static SENSOR_DEVICE_ATTR(led_fan, S_IRUGO, read_lpc_callback, NULL, A static SENSOR_DEVICE_ATTR(led_lnk, S_IRUGO, read_lpc_callback, NULL, ATT_MB_LED_LNK); static SENSOR_DEVICE_ATTR(led_pwr1, S_IRUGO, read_lpc_callback, NULL, ATT_MB_LED_PWR1); static SENSOR_DEVICE_ATTR(led_pwr0, S_IRUGO, read_lpc_callback, NULL, ATT_MB_LED_PWR0); - +static SENSOR_DEVICE_ATTR(power_en, S_IRUGO | S_IWUSR, read_lpc_callback, write_lpc_callback, ATT_MB_POWER_EN); +//SENSOR_DEVICE_ATTR - EC +static SENSOR_DEVICE_ATTR(psu_reset, S_IRUGO | S_IWUSR, NULL, write_ec_psu_reset, ATT_EC_PSU_RESET); //SENSOR_DEVICE_ATTR - BSP static SENSOR_DEVICE_ATTR(bsp_version , S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_VERSION); static SENSOR_DEVICE_ATTR(bsp_debug , S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_DEBUG); @@ -659,25 +711,31 @@ static struct attribute *mb_cpld_attrs[] = { &sensor_dev_attr_board_id_0.dev_attr.attr, &sensor_dev_attr_board_id_1.dev_attr.attr, &sensor_dev_attr_mb_cpld_1_version.dev_attr.attr, - &sensor_dev_attr_mb_cpld_1_version_h.dev_attr.attr, - &sensor_dev_attr_board_sku_id.dev_attr.attr, - &sensor_dev_attr_board_hw_id.dev_attr.attr, - &sensor_dev_attr_board_id_type.dev_attr.attr, - &sensor_dev_attr_board_build_id.dev_attr.attr, - &sensor_dev_attr_board_deph_id.dev_attr.attr, - &sensor_dev_attr_board_ext_id.dev_attr.attr, - &sensor_dev_attr_mux_reset.dev_attr.attr, - &sensor_dev_attr_fan_status.dev_attr.attr, - &sensor_dev_attr_psu_status.dev_attr.attr, - &sensor_dev_attr_port_led_clear.dev_attr.attr, - &sensor_dev_attr_led_sys.dev_attr.attr, - &sensor_dev_attr_led_id.dev_attr.attr, - &sensor_dev_attr_led_poe.dev_attr.attr, - &sensor_dev_attr_led_spd.dev_attr.attr, - &sensor_dev_attr_led_fan.dev_attr.attr, - &sensor_dev_attr_led_lnk.dev_attr.attr, - &sensor_dev_attr_led_pwr0.dev_attr.attr, - &sensor_dev_attr_led_pwr1.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_version_h.dev_attr.attr, + &sensor_dev_attr_board_sku_id.dev_attr.attr, + &sensor_dev_attr_board_hw_id.dev_attr.attr, + &sensor_dev_attr_board_id_type.dev_attr.attr, + &sensor_dev_attr_board_build_id.dev_attr.attr, + &sensor_dev_attr_board_deph_id.dev_attr.attr, + &sensor_dev_attr_board_ext_id.dev_attr.attr, + &sensor_dev_attr_mux_reset.dev_attr.attr, + &sensor_dev_attr_fan_status.dev_attr.attr, + &sensor_dev_attr_psu_status.dev_attr.attr, + &sensor_dev_attr_port_led_clear.dev_attr.attr, + &sensor_dev_attr_led_sys.dev_attr.attr, + &sensor_dev_attr_led_id.dev_attr.attr, + &sensor_dev_attr_led_poe.dev_attr.attr, + &sensor_dev_attr_led_spd.dev_attr.attr, + &sensor_dev_attr_led_fan.dev_attr.attr, + &sensor_dev_attr_led_lnk.dev_attr.attr, + &sensor_dev_attr_led_pwr0.dev_attr.attr, + &sensor_dev_attr_led_pwr1.dev_attr.attr, + &sensor_dev_attr_power_en.dev_attr.attr, + NULL, +}; + +static struct attribute *ec_attrs[] = { + &sensor_dev_attr_psu_reset.dev_attr.attr, NULL, }; @@ -697,6 +755,11 @@ static struct attribute_group mb_cpld_attr_grp = { .attrs = mb_cpld_attrs, }; +static struct attribute_group ec_attr_grp = { + .name = "ec", + .attrs = ec_attrs, +}; + static struct attribute_group bsp_attr_grp = { .name = "bsp", .attrs = bsp_attrs, @@ -717,7 +780,7 @@ static struct platform_device lpc_dev = { static int lpc_drv_probe(struct platform_device *pdev) { - int i = 0, grp_num = 2; + int i = 0, grp_num = 3; int err[5] = {0}; struct attribute_group *grp; @@ -734,6 +797,9 @@ static int lpc_drv_probe(struct platform_device *pdev) grp = &mb_cpld_attr_grp; break; case 1: + grp = &ec_attr_grp; + break; + case 2: grp = &bsp_attr_grp; break; default: @@ -758,6 +824,9 @@ static int lpc_drv_probe(struct platform_device *pdev) grp = &mb_cpld_attr_grp; break; case 1: + grp = &ec_attr_grp; + break; + case 2: grp = &bsp_attr_grp; break; default: @@ -779,6 +848,7 @@ static int lpc_drv_probe(struct platform_device *pdev) static int lpc_drv_remove(struct platform_device *pdev) { sysfs_remove_group(&pdev->dev.kobj, &mb_cpld_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &ec_attr_grp); sysfs_remove_group(&pdev->dev.kobj, &bsp_attr_grp); return 0; @@ -798,18 +868,18 @@ int lpc_init(void) err = platform_driver_register(&lpc_drv); if(err) { - printk(KERN_ERR "%s(#%d): platform_driver_register failed(%d)\n", + printk(KERN_ERR "%s(#%d): platform_driver_register failed(%d)\n", __func__, __LINE__, err); - return err; + return err; } err = platform_device_register(&lpc_dev); if(err) { - printk(KERN_ERR "%s(#%d): platform_device_register failed(%d)\n", + printk(KERN_ERR "%s(#%d): platform_device_register failed(%d)\n", __func__, __LINE__, err); - platform_driver_unregister(&lpc_drv); - return err; + platform_driver_unregister(&lpc_drv); + return err; } return err; diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/x86-64-ufispace-s6301-56st-sys-eeprom.c b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/x86-64-ufispace-s6301-56st-sys-eeprom.c index 5c6dec193ef6..f1d0bbc45087 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/x86-64-ufispace-s6301-56st-sys-eeprom.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/modules/x86-64-ufispace-s6301-56st-sys-eeprom.c @@ -27,6 +27,9 @@ #include #include #include +#include + +#define _memset(s, c, n) memset(s, c, n) /* Addresses to scan */ static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54, @@ -220,7 +223,7 @@ static int sys_eeprom_probe(struct i2c_client *client, #ifdef __STDC_LIB_EXT1__ memset_s(data->data, EEPROM_SIZE, 0xff, EEPROM_SIZE); #else - memset(data->data, 0xff, EEPROM_SIZE); + _memset(data->data, 0xff, EEPROM_SIZE); #endif i2c_set_clientdata(client, data); @@ -240,12 +243,19 @@ static int sys_eeprom_probe(struct i2c_client *client, return err; } -static int sys_eeprom_remove(struct i2c_client *client) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +sys_eeprom_remove(struct i2c_client *client) { sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr); kfree(i2c_get_clientdata(client)); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) return 0; +#endif } static const struct i2c_device_id sys_eeprom_id[] = { diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/chassis.py index ab3e44f74432..585ecdbe197c 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/chassis.py @@ -39,7 +39,7 @@ def get_name(self): Returns: string: The name of the chassis """ - return device_info.get_platform() + return self._eeprom.platform_name_str() def initizalize_system_led(self): return True @@ -175,26 +175,7 @@ def get_sfp(self, index): except IndexError: sys.stderr.write("SFP index {} out of range (1-{})\n".format( index, len(self._sfp_list))) - return sfp - - def set_system_led(self, led_device_name, color): - """ - Sets the color of an System LED device - Args: - led_device_name: a pre-defined LED device name list used in pddf-device.json. - color: A string representing the color with which to set a LED - Returns: - bool: True if the LED state is set successfully, False if not - """ - - if led_device_name in self.plugin_data['LED']['capability']['rw']: - result, msg = self.pddf_obj.set_system_led_color(led_device_name, color) - if not result and msg: - print(msg) - return (result) - else: - print("Not Support") - return False + return sfp def get_reboot_cause(self): """ @@ -217,4 +198,15 @@ def get_reboot_cause(self): except IOError: sw_reboot_cause = "Unknown" - return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) \ No newline at end of file + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this + chassis. + """ + + return self.get_serial() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/fan.py index 2eadfd0a465a..6685e8c8961a 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/fan.py @@ -19,6 +19,25 @@ def __init__(self, tray_idx, fan_idx=0, pddf_data=None, pddf_plugin_data=None, i # Provide the functions/variables below for which implementation is to be overwritten # Since psu_fan airflow direction cant be read from sysfs, it is fixed as 'F2B' or 'intake' + def get_max_speed(self): + """ + Retrieves the max speed + + Returns: + An Integer, the max speed + """ + if self.is_psu_fan: + psu_fru = PsuFru(self.fans_psu_index) + max_speed = int(self.plugin_data['PSU']['valmap']['PSU_FAN_MAX_SPEED']) + for dev in self.plugin_data['PSU']['psu_support_list']: + if dev['Manufacturer'] == psu_fru.mfr_id and dev['Name'] == psu_fru.model: + max_speed = int(self.plugin_data['PSU']['valmap'][dev['MaxSpd']]) + break + else: + max_speed = int(self.plugin_data['FAN']['FAN_MAX_SPEED']) + + return max_speed + def get_speed(self): """ Retrieves the speed of fan as a percentage of full speed @@ -28,15 +47,12 @@ def get_speed(self): to 100 (full speed) """ speed_percentage = 0 - if self.is_psu_fan: - max_speed = int(self.plugin_data['PSU']['PSU_FAN_MAX_SPEED']) - else: - max_speed = int(self.plugin_data['FAN']['FAN_MAX_SPEED']) + max_speed = self.get_max_speed() speed = int(self.get_speed_rpm()) - speed_percentage = round((speed*100)/max_speed) + return min(speed_percentage, 100) def get_speed_rpm(self): @@ -63,7 +79,7 @@ def get_speed_rpm(self): ucd_path = "/sys/bus/i2c/devices/5-0034/hwmon/" if os.path.exists(ucd_path): hwmon_dir = os.listdir(ucd_path) - with open("{}/{}/temp{}_input".format(ucd_path, hwmon_dir[0], self.fantray_index), "rb") as f: + with open("{}/{}/fan{}_input".format(ucd_path, hwmon_dir[0], self.fantray_index), "rb") as f: rpm_speed = int(f.read().strip()) return rpm_speed @@ -81,7 +97,7 @@ def get_direction(self): if psu_fru.mfr_id == "not available": return direction for dev in self.plugin_data['PSU']['psu_support_list']: - if dev['Mfr_id'] == psu_fru.mfr_id and dev['Model'] == psu_fru.model: + if dev['Manufacturer'] == psu_fru.mfr_id and dev['Name'] == psu_fru.model: dir = dev['Dir'] break else: @@ -98,34 +114,6 @@ def get_direction(self): return dir - def get_presence(self): - """ - Retrieves the presence of the device - Returns: - bool: True if device is present, False if not - """ - presence = False - if self.is_psu_fan: - attr = "psu_present" - device = "PSU{}".format(self.fans_psu_index) - else: - attr = "fan{}_present".format(self.fantray_index) - device = "FAN-CTRL" - - output = self.pddf_obj.get_attr_name_output(device, attr) - if not output: - return presence - - - mode = output['mode'] - val = output['status'].strip() - vmap = self.plugin_data['FAN']['present'][mode]['valmap'] - - if val in vmap: - presence = vmap[val] - - return presence - def get_target_speed(self): """ Retrieves the target (expected) speed of the fan diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/psu.py index 008aa600cdf8..fff8de4aa953 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/psu.py @@ -10,23 +10,12 @@ class Psu(PddfPsu): """PDDF Platform-Specific PSU class""" - - PLATFORM_PSU_CAPACITY = 750 def __init__(self, index, pddf_data=None, pddf_plugin_data=None): PddfPsu.__init__(self, index, pddf_data, pddf_plugin_data) self.psu_fru = PsuFru(self.psu_index) # Provide the functions/variables below for which implementation is to be overwritten - def get_maximum_supplied_power(self): - """ - Retrieves the maximum supplied power by PSU (or PSU capacity) - Returns: - A float number, the maximum power output in Watts. - e.g. 1200.1 - """ - return float(self.PLATFORM_PSU_CAPACITY) - def get_power(self): """ Retrieves current energy supplied by PSU @@ -65,3 +54,34 @@ def get_serial(self): string: Serial number of device """ return self.psu_fru.serial.rstrip() + + def get_capacity(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return self.get_maximum_supplied_power() + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + mfr = self.get_mfr_id() + model = self.get_model() + ptype = self.plugin_data['PSU']['valmap']['DEFAULT_TYPE'] + + if mfr and model : + for dev in self.plugin_data['PSU']['psu_support_list']: + if dev['Manufacturer'] == mfr and dev['Name'] == model: + ptype = dev['Type'] + break + + + return ptype + + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/utils/pddf_pre_driver_install.sh b/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/utils/pddf_pre_driver_install.sh deleted file mode 100755 index 187943061e6c..000000000000 --- a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/utils/pddf_pre_driver_install.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -#rmmod gpio_ich -if [ ! -f /tmp/._pddf_pre_driver_init_completion ]; then - # make sure igb/i40e init in correct order - rmmod i2c-i801 - rmmod i2c_ismt - modprobe -r i2c-i801 - modprobe -r i2c_ismt - date > /tmp/._pddf_pre_driver_init_completion -fi -echo "PDDF driver pre-install completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/pddf_custom_sysstatus_module.c b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/pddf_custom_sysstatus_module.c index b50bb428000a..d68f85670a10 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/pddf_custom_sysstatus_module.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/pddf_custom_sysstatus_module.c @@ -1,6 +1,6 @@ /* * Copyright 2019 Broadcom. - * The term ��Broadcom�� refers to Broadcom Inc. and/or its subsidiaries. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * 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 @@ -33,6 +33,7 @@ #include "../../../../pddf/i2c/modules/include/pddf_client_defs.h" #include "../../../../pddf/i2c/modules/include/pddf_sysstatus_defs.h" +#define _memset(s, c, n) memset(s, c, n) SYSSTATUS_DATA sysstatus_data = {0}; @@ -142,8 +143,9 @@ ssize_t show_sysstatus_data(struct device *dev, struct device_attribute *da, cha if (sysstatus_addr_attrs==NULL ) { - printk(KERN_DEBUG "%s is not supported attribute for this client\n",data->sysstatus_addr_attrs[i].aname); + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); status = 0; + return sprintf(buf, "0x%x\n", status); } else { @@ -173,7 +175,7 @@ ssize_t store_sysstatus_data(struct device *dev, struct device_attribute *da, co if (sysstatus_addr_attrs==NULL) { - printk(KERN_DEBUG "%s is not supported attribute for this client\n",data->sysstatus_addr_attrs[i].aname); + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); return -EINVAL; } else @@ -207,7 +209,7 @@ static ssize_t do_attr_operation(struct device *dev, struct device_attribute *da #ifdef __STDC_LIB_EXT1__ memset_s(&pdata->sysstatus_addr_attr, sizeof(pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); #else - memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); + _memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); #endif return count; diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/x86-64-ufispace-s7801-54xs-cpld.c b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/x86-64-ufispace-s7801-54xs-cpld.c index 0cefcb8aac5f..28dfdce93abd 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/x86-64-ufispace-s7801-54xs-cpld.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/x86-64-ufispace-s7801-54xs-cpld.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "x86-64-ufispace-s7801-54xs-cpld.h" #ifdef DEBUG @@ -1050,7 +1051,7 @@ static ssize_t write_bsp_callback(struct device *dev, switch (attr->index) { case BSP_DEBUG: str = bsp_debug; - str_len = sizeof(str); + str_len = sizeof(bsp_debug); ret = write_bsp(buf, str, str_len, count); if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { @@ -1332,7 +1333,12 @@ static int cpld_probe(struct i2c_client *client, } /* cpld drvier remove */ -static int cpld_remove(struct i2c_client *client) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +cpld_remove(struct i2c_client *client) { struct cpld_data *data = i2c_get_clientdata(client); @@ -1346,7 +1352,9 @@ static int cpld_remove(struct i2c_client *client) } cpld_remove_client(client); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) return 0; +#endif } static int s7801_54xs_cpld_read_internal(struct i2c_client *client, u8 reg) diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/x86-64-ufispace-s7801-54xs-sys-eeprom.c b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/x86-64-ufispace-s7801-54xs-sys-eeprom.c index f9f7728deb3d..f2f27cb0ae5b 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/x86-64-ufispace-s7801-54xs-sys-eeprom.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/modules/x86-64-ufispace-s7801-54xs-sys-eeprom.c @@ -27,6 +27,9 @@ #include #include #include +#include + +#define _memset(s, c, n) memset(s, c, n) /* Addresses to scan */ static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54, @@ -220,7 +223,7 @@ static int sys_eeprom_probe(struct i2c_client *client, #ifdef __STDC_LIB_EXT1__ memset_s(data->data, EEPROM_SIZE, 0xff, EEPROM_SIZE); #else - memset(data->data, 0xff, EEPROM_SIZE); + _memset(data->data, 0xff, EEPROM_SIZE); #endif i2c_set_clientdata(client, data); mutex_init(&data->update_lock); @@ -239,12 +242,19 @@ static int sys_eeprom_probe(struct i2c_client *client, return err; } -static int sys_eeprom_remove(struct i2c_client *client) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +sys_eeprom_remove(struct i2c_client *client) { sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr); kfree(i2c_get_clientdata(client)); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) return 0; +#endif } static const struct i2c_device_id sys_eeprom_id[] = { diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/chassis.py index 085f2af2ff85..0b02f9a834c2 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/chassis.py @@ -191,3 +191,14 @@ def get_reboot_cause(self): sw_reboot_cause = "Unknown" return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this + chassis. + """ + + return self.get_serial() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/component.py index 1c583079f8c2..d5d8d8226fd8 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/component.py @@ -18,9 +18,7 @@ } BMC_CMDS = { - "VER1": "ipmitool mc info | grep 'Firmware Revision' | cut -d':' -f2 | cut -d'.' -f1", - "VER2": "ipmitool mc info | grep 'Firmware Revision' | cut -d':' -f2 | cut -d'.' -f2", - "VER3": "echo $((`ipmitool mc info | grep 'Aux Firmware Rev Info' -A 2 | sed -n '2p'` + 0))", + "BMC": "bash -c 'tmp=$(ipmitool raw 0x6 0x1) && r=($(echo \"$tmp\" | cut -d \" \" -f 4,5,16,15,14)) && echo ${r[0]}.${r[1]}.${r[4]}.${r[3]}${r[2]}'", } BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" @@ -69,17 +67,11 @@ def _get_cpld_version(self): def _get_bmc_version(self): # Retrieves the BMC firmware version - bmc_ver = dict() - for ver in BMC_CMDS: - status, value = subprocess.getstatusoutput(BMC_CMDS[ver]) - if not status: - bmc_ver[ver] = int(value.rstrip()) - else: - return None - - bmc_version = "{}.{}.{}".format(bmc_ver["VER1"], bmc_ver["VER2"], bmc_ver["VER3"]) - - return bmc_version + status, value = subprocess.getstatusoutput(BMC_CMDS["BMC"]) + if not status: + return value + else: + return None def get_name(self): """ diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/psu.py index 38b32412d024..cae583254015 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/sonic_platform/psu.py @@ -36,3 +36,32 @@ def get_power(self): # power is returned in micro watts return round(float(self.get_voltage()*self.get_current()), 2) + + def get_capacity(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return self.get_maximum_supplied_power() + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + mfr = self.get_mfr_id() + model = self.get_model() + ptype = self.plugin_data['PSU']['valmap']['DEFAULT_TYPE'] + + if mfr and model : + for dev in self.plugin_data['PSU']['psu_support_list']: + if dev['Manufacturer'] == mfr and dev['Name'] == model: + ptype = dev['Type'] + break + + + return ptype \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pddf_post_device_create.sh b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pddf_post_device_create.sh index 4a55252ea936..c6fe10aba368 100755 --- a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pddf_post_device_create.sh +++ b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pddf_post_device_create.sh @@ -6,7 +6,7 @@ timeout 3 ipmitool mc watchdog off pddf_ledutil setstatusled SYNC_LED off pddf_ledutil setstatusled SYS_LED off -pddf_ledutil setstatusled ID_LED off +pddf_ledutil setstatusled LOC_LED off #set status led to green to indicate platform init done curr_led=$(pddf_ledutil getstatusled SYS_LED) diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pddf_pre_driver_install.sh b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pddf_pre_driver_install.sh deleted file mode 100755 index 9ada6c235c48..000000000000 --- a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pddf_pre_driver_install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -#rmmod gpio_ich -if [ ! -f /tmp/._pddf_pre_driver_init_completion ]; then - rmmod i2c_i801 - rmmod i2c_ismt - date > /tmp/._pddf_pre_driver_init_completion -fi -echo "PDDF driver pre-install completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pre_pddf_init.sh b/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pre_pddf_init.sh deleted file mode 100755 index 63a2e205808e..000000000000 --- a/platform/broadcom/sonic-platform-modules-ufispace/s7801-54xs/utils/pre_pddf_init.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -#rmmod gpio_ich -modprobe -rq i2c_i801 -modprobe -rq i2c_smbus -echo "Pre PDDF init steps completed successully" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/pddf_custom_sysstatus_module.c b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/pddf_custom_sysstatus_module.c index b50bb428000a..d68f85670a10 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/pddf_custom_sysstatus_module.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/pddf_custom_sysstatus_module.c @@ -1,6 +1,6 @@ /* * Copyright 2019 Broadcom. - * The term ��Broadcom�� refers to Broadcom Inc. and/or its subsidiaries. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * 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 @@ -33,6 +33,7 @@ #include "../../../../pddf/i2c/modules/include/pddf_client_defs.h" #include "../../../../pddf/i2c/modules/include/pddf_sysstatus_defs.h" +#define _memset(s, c, n) memset(s, c, n) SYSSTATUS_DATA sysstatus_data = {0}; @@ -142,8 +143,9 @@ ssize_t show_sysstatus_data(struct device *dev, struct device_attribute *da, cha if (sysstatus_addr_attrs==NULL ) { - printk(KERN_DEBUG "%s is not supported attribute for this client\n",data->sysstatus_addr_attrs[i].aname); + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); status = 0; + return sprintf(buf, "0x%x\n", status); } else { @@ -173,7 +175,7 @@ ssize_t store_sysstatus_data(struct device *dev, struct device_attribute *da, co if (sysstatus_addr_attrs==NULL) { - printk(KERN_DEBUG "%s is not supported attribute for this client\n",data->sysstatus_addr_attrs[i].aname); + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); return -EINVAL; } else @@ -207,7 +209,7 @@ static ssize_t do_attr_operation(struct device *dev, struct device_attribute *da #ifdef __STDC_LIB_EXT1__ memset_s(&pdata->sysstatus_addr_attr, sizeof(pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); #else - memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); + _memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); #endif return count; diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/x86-64-ufispace-s8901-54xc-cpld.c b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/x86-64-ufispace-s8901-54xc-cpld.c index 63eec91d4819..cff824efdb19 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/x86-64-ufispace-s8901-54xc-cpld.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/x86-64-ufispace-s8901-54xc-cpld.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "x86-64-ufispace-s8901-54xc-cpld.h" #ifdef DEBUG @@ -1050,7 +1051,7 @@ static ssize_t write_bsp_callback(struct device *dev, switch (attr->index) { case BSP_DEBUG: str = bsp_debug; - str_len = sizeof(str); + str_len = sizeof(bsp_debug); ret = write_bsp(buf, str, str_len, count); if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { @@ -1332,7 +1333,12 @@ static int cpld_probe(struct i2c_client *client, } /* cpld drvier remove */ -static int cpld_remove(struct i2c_client *client) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +cpld_remove(struct i2c_client *client) { struct cpld_data *data = i2c_get_clientdata(client); @@ -1346,7 +1352,9 @@ static int cpld_remove(struct i2c_client *client) } cpld_remove_client(client); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) return 0; +#endif } static int s8901_54xc_cpld_read_internal(struct i2c_client *client, u8 reg) diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/x86-64-ufispace-s8901-54xc-sys-eeprom.c b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/x86-64-ufispace-s8901-54xc-sys-eeprom.c index f9f7728deb3d..f2f27cb0ae5b 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/x86-64-ufispace-s8901-54xc-sys-eeprom.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/modules/x86-64-ufispace-s8901-54xc-sys-eeprom.c @@ -27,6 +27,9 @@ #include #include #include +#include + +#define _memset(s, c, n) memset(s, c, n) /* Addresses to scan */ static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54, @@ -220,7 +223,7 @@ static int sys_eeprom_probe(struct i2c_client *client, #ifdef __STDC_LIB_EXT1__ memset_s(data->data, EEPROM_SIZE, 0xff, EEPROM_SIZE); #else - memset(data->data, 0xff, EEPROM_SIZE); + _memset(data->data, 0xff, EEPROM_SIZE); #endif i2c_set_clientdata(client, data); mutex_init(&data->update_lock); @@ -239,12 +242,19 @@ static int sys_eeprom_probe(struct i2c_client *client, return err; } -static int sys_eeprom_remove(struct i2c_client *client) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +sys_eeprom_remove(struct i2c_client *client) { sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr); kfree(i2c_get_clientdata(client)); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) return 0; +#endif } static const struct i2c_device_id sys_eeprom_id[] = { diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/chassis.py index 085f2af2ff85..0b02f9a834c2 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/chassis.py @@ -191,3 +191,14 @@ def get_reboot_cause(self): sw_reboot_cause = "Unknown" return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this + chassis. + """ + + return self.get_serial() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/component.py index 1c583079f8c2..d5d8d8226fd8 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/component.py @@ -18,9 +18,7 @@ } BMC_CMDS = { - "VER1": "ipmitool mc info | grep 'Firmware Revision' | cut -d':' -f2 | cut -d'.' -f1", - "VER2": "ipmitool mc info | grep 'Firmware Revision' | cut -d':' -f2 | cut -d'.' -f2", - "VER3": "echo $((`ipmitool mc info | grep 'Aux Firmware Rev Info' -A 2 | sed -n '2p'` + 0))", + "BMC": "bash -c 'tmp=$(ipmitool raw 0x6 0x1) && r=($(echo \"$tmp\" | cut -d \" \" -f 4,5,16,15,14)) && echo ${r[0]}.${r[1]}.${r[4]}.${r[3]}${r[2]}'", } BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" @@ -69,17 +67,11 @@ def _get_cpld_version(self): def _get_bmc_version(self): # Retrieves the BMC firmware version - bmc_ver = dict() - for ver in BMC_CMDS: - status, value = subprocess.getstatusoutput(BMC_CMDS[ver]) - if not status: - bmc_ver[ver] = int(value.rstrip()) - else: - return None - - bmc_version = "{}.{}.{}".format(bmc_ver["VER1"], bmc_ver["VER2"], bmc_ver["VER3"]) - - return bmc_version + status, value = subprocess.getstatusoutput(BMC_CMDS["BMC"]) + if not status: + return value + else: + return None def get_name(self): """ diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/psu.py index 38b32412d024..cae583254015 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/sonic_platform/psu.py @@ -36,3 +36,32 @@ def get_power(self): # power is returned in micro watts return round(float(self.get_voltage()*self.get_current()), 2) + + def get_capacity(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return self.get_maximum_supplied_power() + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + mfr = self.get_mfr_id() + model = self.get_model() + ptype = self.plugin_data['PSU']['valmap']['DEFAULT_TYPE'] + + if mfr and model : + for dev in self.plugin_data['PSU']['psu_support_list']: + if dev['Manufacturer'] == mfr and dev['Name'] == model: + ptype = dev['Type'] + break + + + return ptype \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pddf_post_device_create.sh b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pddf_post_device_create.sh index 4a55252ea936..c6fe10aba368 100755 --- a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pddf_post_device_create.sh +++ b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pddf_post_device_create.sh @@ -6,7 +6,7 @@ timeout 3 ipmitool mc watchdog off pddf_ledutil setstatusled SYNC_LED off pddf_ledutil setstatusled SYS_LED off -pddf_ledutil setstatusled ID_LED off +pddf_ledutil setstatusled LOC_LED off #set status led to green to indicate platform init done curr_led=$(pddf_ledutil getstatusled SYS_LED) diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pddf_pre_driver_install.sh b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pddf_pre_driver_install.sh deleted file mode 100755 index 9ada6c235c48..000000000000 --- a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pddf_pre_driver_install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -#rmmod gpio_ich -if [ ! -f /tmp/._pddf_pre_driver_init_completion ]; then - rmmod i2c_i801 - rmmod i2c_ismt - date > /tmp/._pddf_pre_driver_init_completion -fi -echo "PDDF driver pre-install completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pre_pddf_init.sh b/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pre_pddf_init.sh deleted file mode 100755 index 63a2e205808e..000000000000 --- a/platform/broadcom/sonic-platform-modules-ufispace/s8901-54xc/utils/pre_pddf_init.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -#rmmod gpio_ich -modprobe -rq i2c_i801 -modprobe -rq i2c_smbus -echo "Pre PDDF init steps completed successully" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/pddf_custom_sysstatus_module.c b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/pddf_custom_sysstatus_module.c index 35a032f4277e..ace5c9d8cbe0 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/pddf_custom_sysstatus_module.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/pddf_custom_sysstatus_module.c @@ -1,6 +1,6 @@ /* * Copyright 2019 Broadcom. - * The term ��Broadcom�� refers to Broadcom Inc. and/or its subsidiaries. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * 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 @@ -33,6 +33,7 @@ #include "../../../../pddf/i2c/modules/include/pddf_client_defs.h" #include "../../../../pddf/i2c/modules/include/pddf_sysstatus_defs.h" +#define _memset(s, c, n) memset(s, c, n) SYSSTATUS_DATA sysstatus_data = {0}; @@ -140,8 +141,9 @@ ssize_t show_sysstatus_data(struct device *dev, struct device_attribute *da, cha if (sysstatus_addr_attrs==NULL ) { - printk(KERN_DEBUG "%s is not supported attribute for this client\n",data->sysstatus_addr_attrs[i].aname); + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); status = 0; + return sprintf(buf, "0x%x\n", status); } else { @@ -171,7 +173,7 @@ ssize_t store_sysstatus_data(struct device *dev, struct device_attribute *da, co if (sysstatus_addr_attrs==NULL) { - printk(KERN_DEBUG "%s is not supported attribute for this client\n",data->sysstatus_addr_attrs[i].aname); + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); return -EINVAL; } else @@ -205,7 +207,7 @@ static ssize_t do_attr_operation(struct device *dev, struct device_attribute *da #ifdef __STDC_LIB_EXT1__ memset_s(&pdata->sysstatus_addr_attr, sizeof(pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); #else - memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); + _memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); #endif return count; diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/x86-64-ufispace-s9110-32x-cpld.c b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/x86-64-ufispace-s9110-32x-cpld.c index af54108ee1b3..9d0d359ea118 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/x86-64-ufispace-s9110-32x-cpld.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/x86-64-ufispace-s9110-32x-cpld.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "x86-64-ufispace-s9110-32x-cpld.h" #if !defined(SENSOR_DEVICE_ATTR_RO) @@ -863,7 +864,7 @@ static ssize_t bsp_callback_store(struct device *dev, switch (attr->index) { case BSP_DEBUG: str = bsp_debug; - str_len = sizeof(str); + str_len = sizeof(bsp_debug); ret = bsp_write(buf, str, str_len, count); if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { @@ -1272,8 +1273,6 @@ static int cpld_probe(struct i2c_client *client, if (INVALID(ret, cpld1, cpld2)) { dev_info(&client->dev, "cpld id %d(device) not valid\n", ret); - //status = -EPERM; - //goto exit; } data->index = dev_id->driver_data; @@ -1317,7 +1316,12 @@ static int cpld_probe(struct i2c_client *client, } /* cpld drvier remove */ -static int cpld_remove(struct i2c_client *client) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +cpld_remove(struct i2c_client *client) { struct cpld_data *data = i2c_get_clientdata(client); @@ -1331,7 +1335,9 @@ static int cpld_remove(struct i2c_client *client) } cpld_remove_client(client); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) return 0; +#endif } #if 0 /* FIXME */ diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/x86-64-ufispace-s9110-32x-sys-eeprom.c b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/x86-64-ufispace-s9110-32x-sys-eeprom.c index 976ba05052e7..c0b3ac20f0f1 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/x86-64-ufispace-s9110-32x-sys-eeprom.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/modules/x86-64-ufispace-s9110-32x-sys-eeprom.c @@ -27,6 +27,9 @@ #include #include #include +#include + +#define _memset(s, c, n) memset(s, c, n) /* Addresses to scan */ static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54, @@ -220,7 +223,7 @@ static int sys_eeprom_probe(struct i2c_client *client, #ifdef __STDC_LIB_EXT1__ memset_s(data->data, EEPROM_SIZE, 0xff, EEPROM_SIZE); #else - memset(data->data, 0xff, EEPROM_SIZE); + _memset(data->data, 0xff, EEPROM_SIZE); #endif i2c_set_clientdata(client, data); mutex_init(&data->update_lock); @@ -239,12 +242,19 @@ static int sys_eeprom_probe(struct i2c_client *client, return err; } -static int sys_eeprom_remove(struct i2c_client *client) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +sys_eeprom_remove(struct i2c_client *client) { sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr); kfree(i2c_get_clientdata(client)); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) return 0; +#endif } static const struct i2c_device_id sys_eeprom_id[] = { diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/chassis.py index 530332cf1506..78a3d9d4106a 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/chassis.py @@ -189,3 +189,14 @@ def get_reboot_cause(self): sw_reboot_cause = "Unknown" return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this + chassis. + """ + + return self.get_serial() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/component.py index 1c583079f8c2..d5d8d8226fd8 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/component.py @@ -18,9 +18,7 @@ } BMC_CMDS = { - "VER1": "ipmitool mc info | grep 'Firmware Revision' | cut -d':' -f2 | cut -d'.' -f1", - "VER2": "ipmitool mc info | grep 'Firmware Revision' | cut -d':' -f2 | cut -d'.' -f2", - "VER3": "echo $((`ipmitool mc info | grep 'Aux Firmware Rev Info' -A 2 | sed -n '2p'` + 0))", + "BMC": "bash -c 'tmp=$(ipmitool raw 0x6 0x1) && r=($(echo \"$tmp\" | cut -d \" \" -f 4,5,16,15,14)) && echo ${r[0]}.${r[1]}.${r[4]}.${r[3]}${r[2]}'", } BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" @@ -69,17 +67,11 @@ def _get_cpld_version(self): def _get_bmc_version(self): # Retrieves the BMC firmware version - bmc_ver = dict() - for ver in BMC_CMDS: - status, value = subprocess.getstatusoutput(BMC_CMDS[ver]) - if not status: - bmc_ver[ver] = int(value.rstrip()) - else: - return None - - bmc_version = "{}.{}.{}".format(bmc_ver["VER1"], bmc_ver["VER2"], bmc_ver["VER3"]) - - return bmc_version + status, value = subprocess.getstatusoutput(BMC_CMDS["BMC"]) + if not status: + return value + else: + return None def get_name(self): """ diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/fan.py index c38ebdedea5b..3705fae2bf7c 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/fan.py @@ -108,7 +108,6 @@ def get_presence(self): if not output: return False - mode = output['mode'] presence = output['status'].rstrip() vmap = self.plugin_data['FAN']['present'][mode]['valmap'] diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/psu.py index 4f7e843361d4..091926788328 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/sonic_platform/psu.py @@ -35,4 +35,33 @@ def get_maximum_supplied_power(self): A float number, the maximum power output in Watts. e.g. 1200.1 """ - return float(self.PLATFORM_PSU_CAPACITY) \ No newline at end of file + return float(self.PLATFORM_PSU_CAPACITY) + + def get_capacity(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return self.get_maximum_supplied_power() + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + mfr = self.get_mfr_id() + model = self.get_model() + ptype = self.plugin_data['PSU']['valmap']['DEFAULT_TYPE'] + + if mfr and model : + for dev in self.plugin_data['PSU']['psu_support_list']: + if dev['Manufacturer'] == mfr and dev['Name'] == model: + ptype = dev['Type'] + break + + + return ptype \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/utils/pddf_post_device_create.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/utils/pddf_post_device_create.sh index 47076d99c4ca..f38d420267d2 100755 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/utils/pddf_post_device_create.sh +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/utils/pddf_post_device_create.sh @@ -5,7 +5,7 @@ echo "Disable BMC watchdog" timeout 3 ipmitool mc watchdog off pddf_ledutil setstatusled SYS_LED off -pddf_ledutil setstatusled ID_LED off +pddf_ledutil setstatusled LOC_LED off curr_led=$(pddf_ledutil getstatusled SYS_LED) pddf_ledutil setstatusled SYS_LED green diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/utils/pddf_pre_driver_install.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/utils/pddf_pre_driver_install.sh deleted file mode 100755 index 187943061e6c..000000000000 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9110-32x/utils/pddf_pre_driver_install.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -#rmmod gpio_ich -if [ ! -f /tmp/._pddf_pre_driver_init_completion ]; then - # make sure igb/i40e init in correct order - rmmod i2c-i801 - rmmod i2c_ismt - modprobe -r i2c-i801 - modprobe -r i2c_ismt - date > /tmp/._pddf_pre_driver_init_completion -fi -echo "PDDF driver pre-install completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/pddf_custom_sysstatus_module.c b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/pddf_custom_sysstatus_module.c index 7a0b03a70d65..b61219c0088d 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/pddf_custom_sysstatus_module.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/pddf_custom_sysstatus_module.c @@ -1,6 +1,6 @@ /* * Copyright 2019 Broadcom. - * The term ¡§Broadcom¡¨ refers to Broadcom Inc. and/or its subsidiaries. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * 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 @@ -33,6 +33,7 @@ #include "../../../../pddf/i2c/modules/include/pddf_client_defs.h" #include "../../../../pddf/i2c/modules/include/pddf_sysstatus_defs.h" +#define _memset(s, c, n) memset(s, c, n) SYSSTATUS_DATA sysstatus_data = {0}; @@ -132,7 +133,7 @@ ssize_t show_sysstatus_data(struct device *dev, struct device_attribute *da, cha if (sysstatus_addr_attrs==NULL ) { - printk(KERN_DEBUG "%s is not supported attribute for this client\n",data->sysstatus_addr_attrs[i].aname); + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); status = 0; } else @@ -163,7 +164,7 @@ ssize_t store_sysstatus_data(struct device *dev, struct device_attribute *da, co if (sysstatus_addr_attrs==NULL) { - printk(KERN_DEBUG "%s is not supported attribute for this client\n",data->sysstatus_addr_attrs[i].aname); + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); return -EINVAL; } else @@ -196,7 +197,7 @@ static ssize_t do_attr_operation(struct device *dev, struct device_attribute *da #ifdef __STDC_LIB_EXT1__ memset_s(&pdata->sysstatus_addr_attr, sizeof(pdata->sysstatus_addr_attr), 0, sizeof(pdata->sysstatus_addr_attr)); #else - memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); + _memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); #endif return count; diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.c b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.c index 39f6694140e2..3ff229710d9d 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.c @@ -1,1638 +1,1646 @@ -/* - * A i2c cpld driver for the ufispace_s9300_32d - * - * Copyright (C) 2017-2019 UfiSpace Technology Corporation. - * Jason Tsai - * - * Based on ad7414.c - * Copyright 2006 Stefan Roese , DENX Software Engineering - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "x86-64-ufispace-s9300-32d-cpld.h" - -#ifdef DEBUG -#define DEBUG_PRINT(fmt, args...) \ - printk(KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ - __FILE__, __func__, __LINE__, ##args) -#else -#define DEBUG_PRINT(fmt, args...) -#endif - -#define BSP_LOG_R(fmt, args...) \ - _bsp_log (LOG_READ, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ - __FILE__, __func__, __LINE__, ##args) -#define BSP_LOG_W(fmt, args...) \ - _bsp_log (LOG_WRITE, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ - __FILE__, __func__, __LINE__, ##args) - -#define I2C_READ_BYTE_DATA(ret, lock, i2c_client, reg) \ -{ \ - mutex_lock(lock); \ - ret = i2c_smbus_read_byte_data(i2c_client, reg); \ - mutex_unlock(lock); \ - BSP_LOG_R("cpld[%d], reg=0x%03x, reg_val=0x%02x", data->index, reg, ret); \ -} -#define I2C_WRITE_BYTE_DATA(ret, lock, i2c_client, reg, val) \ -{ \ - mutex_lock(lock); \ - ret = i2c_smbus_write_byte_data(i2c_client, reg, val); \ - mutex_unlock(lock); \ - BSP_LOG_W("cpld[%d], reg=0x%03x, reg_val=0x%02x", data->index, reg, val); \ -} - -/* CPLD sysfs attributes index */ -enum s9300_cpld_sysfs_attributes { - /* CPLD1 */ - CPLD_ACCESS_REG, - CPLD_REGISTER_VAL, - CPLD_SKU_ID, - CPLD_HW_REV, - CPLD_DEPH_REV, - CPLD_BUILD_REV, - CPLD_ID_TYPE, - CPLD_MAJOR_VER, - CPLD_MINOR_VER, - CPLD_BUILD_VER, - CPLD_VERION_H, - CPLD_ID, - CPLD_MAC_INTR, - CPLD_10G_PHY_INTR, - CPLD_CPLD_FRU_INTR, - CPLD_THERMAL_ALERT_INTR, - CPLD_MISC_INTR, - CPLD_SYSTEM_INTR, - CPLD_MAC_INTR_MASK, - CPLD_10G_PHY_INTR_MASK, - CPLD_CPLD_FRU_INTR_MASK, - CPLD_THERMAL_ALERT_INTR_MASK, - CPLD_MISC_INTR_MASK, - CPLD_MAC_INTR_EVENT, - CPLD_10G_PHY_INTR_EVENT, - CPLD_CPLD_FRU_INTR_EVENT, - CPLD_THERMAL_ALERT_INTR_EVENT, - CPLD_MISC_INTR_EVENT, - CPLD_MAC_RST, - CPLD_10G_PHY_RST, - CPLD_BMC_RST, - CPLD_USB_RST, - CPLD_MUX_RST, - CPLD_MISC_RST, - CPLD_BMC_WATCHDOG, - CPLD_DAU_BD_PRES, - CPLD_PSU_STATUS, - CPLD_SYS_PW_STATUS, - CPLD_MISC, - CPLD_MUX_CTRL, - CPLD_MAC_QSFP_SEL_CTRL, - CPLD_SYS_LED_CTRL_1, - CPLD_SYS_LED_CTRL_2, - CPLD_BEACON_LED_CTRL, - CPLD_PORT_LED_CLR_CTRL, - CPLD_EVENT_DETECT_CTRL, - /* CPLD2 */ - CPLD_QSFPDD_MOD_INT_G0, - CPLD_QSFPDD_MOD_INT_G1, - CPLD_QSFPDD_MOD_INT_G2, - CPLD_QSFPDD_MOD_INT_G3, - CPLD_QSFPDD_PRES_G0, - CPLD_QSFPDD_PRES_G1, - CPLD_QSFPDD_PRES_G2, - CPLD_QSFPDD_PRES_G3, - CPLD_QSFPDD_FUSE_INT_G0, - CPLD_QSFPDD_FUSE_INT_G1, - CPLD_QSFPDD_FUSE_INT_G2, - CPLD_QSFPDD_FUSE_INT_G3, - CPLD_SFP_TXFAULT, - CPLD_SFP_ABS, - CPLD_SFP_RXLOS, - CPLD_QSFPDD_MOD_INT_MASK_G0, - CPLD_QSFPDD_MOD_INT_MASK_G1, - CPLD_QSFPDD_MOD_INT_MASK_G2, - CPLD_QSFPDD_MOD_INT_MASK_G3, - CPLD_QSFPDD_PRES_MASK_G0, - CPLD_QSFPDD_PRES_MASK_G1, - CPLD_QSFPDD_PRES_MASK_G2, - CPLD_QSFPDD_PRES_MASK_G3, - CPLD_QSFPDD_FUSE_INT_MASK_G0, - CPLD_QSFPDD_FUSE_INT_MASK_G1, - CPLD_QSFPDD_FUSE_INT_MASK_G2, - CPLD_QSFPDD_FUSE_INT_MASK_G3, - CPLD_SFP_TXFAULT_MASK, - CPLD_SFP_ABS_MASK, - CPLD_SFP_RXLOS_MASK, - CPLD_QSFPDD_MOD_INT_EVENT_G0, - CPLD_QSFPDD_MOD_INT_EVENT_G1, - CPLD_QSFPDD_MOD_INT_EVENT_G2, - CPLD_QSFPDD_MOD_INT_EVENT_G3, - CPLD_QSFPDD_PRES_EVENT_G0, - CPLD_QSFPDD_PRES_EVENT_G1, - CPLD_QSFPDD_PRES_EVENT_G2, - CPLD_QSFPDD_PRES_EVENT_G3, - CPLD_QSFPDD_FUSE_INT_EVENT_G0, - CPLD_QSFPDD_FUSE_INT_EVENT_G1, - CPLD_QSFPDD_FUSE_INT_EVENT_G2, - CPLD_QSFPDD_FUSE_INT_EVENT_G3, - CPLD_SFP_TXFAULT_EVENT, - CPLD_SFP_ABS_EVENT, - CPLD_SFP_RXLOS_EVENT, - CPLD_QSFPDD_RESET_CTRL_G0, - CPLD_QSFPDD_RESET_CTRL_G1, - CPLD_QSFPDD_RESET_CTRL_G2, - CPLD_QSFPDD_RESET_CTRL_G3, - CPLD_QSFPDD_LP_MODE_G0, - CPLD_QSFPDD_LP_MODE_G1, - CPLD_QSFPDD_LP_MODE_G2, - CPLD_QSFPDD_LP_MODE_G3, - CPLD_SFP_TX_DIS, - CPLD_SFP_RS, - CPLD_SFP_TS, - CPLD_PORT_INT_STATUS, - - //BSP DEBUG - BSP_DEBUG -}; - -enum bsp_log_types { - LOG_NONE, - LOG_RW, - LOG_READ, - LOG_WRITE -}; - -enum bsp_log_ctrl { - LOG_DISABLE, - LOG_ENABLE -}; - -/* CPLD sysfs attributes hook functions */ -static ssize_t read_access_register(struct device *dev, - struct device_attribute *da, char *buf); -static ssize_t write_access_register(struct device *dev, - struct device_attribute *da, const char *buf, size_t count); -static ssize_t read_register_value(struct device *dev, - struct device_attribute *da, char *buf); -static ssize_t write_register_value(struct device *dev, - struct device_attribute *da, const char *buf, size_t count); -static ssize_t read_hw_rev_cb(struct device *dev, - struct device_attribute *da, char *buf); -static ssize_t read_cpld_version_cb(struct device *dev, - struct device_attribute *da, char *buf); -static ssize_t read_cpld_callback(struct device *dev, - struct device_attribute *da, char *buf); -static ssize_t write_cpld_callback(struct device *dev, - struct device_attribute *da, const char *buf, size_t count); -static ssize_t read_cpld_version_h_cb(struct device *dev, - struct device_attribute *da, char *buf); -// cpld access api -static ssize_t read_cpld_reg(struct device *dev, char *buf, u8 reg); -static ssize_t write_cpld_reg(struct device *dev, const char *buf, size_t count, u8 reg); -static bool read_cpld_reg_raw_byte(struct device *dev, u8 reg, u8 *val, int *errno); -static bool read_cpld_reg_raw_int(struct device *dev, u8 reg, int *val); -// bsp debug api -static ssize_t read_bsp(char *buf, char *str); -static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count); -static ssize_t read_bsp_callback(struct device *dev, - struct device_attribute *da, char *buf); -static ssize_t write_bsp_callback(struct device *dev, - struct device_attribute *da, const char *buf, size_t count); - -static LIST_HEAD(cpld_client_list); /* client list for cpld */ -static struct mutex list_lock; /* mutex for client list */ - -struct cpld_client_node { - struct i2c_client *client; - struct list_head list; -}; - -struct cpld_data { - int index; /* CPLD index */ - struct mutex access_lock; /* mutex for cpld access */ - u8 access_reg; /* register to access */ -}; - -/* CPLD device id and data */ -static const struct i2c_device_id s9300_cpld_id[] = { - { "s9300_32d_cpld1", cpld1 }, - { "s9300_32d_cpld2", cpld2 }, - { "s9300_32d_cpld3", cpld3 }, - {} -}; - -char bsp_debug[2]="0"; -u8 enable_log_read=LOG_DISABLE; -u8 enable_log_write=LOG_DISABLE; - -/* Addresses scanned for s9300_cpld */ -static const unsigned short cpld_i2c_addr[] = { 0x30, 0x31, 0x32, I2C_CLIENT_END }; - -/* define all support register access of cpld in attribute */ -/* CPLD1 */ -static SENSOR_DEVICE_ATTR(cpld_access_register, S_IWUSR | S_IRUGO, \ - read_access_register, write_access_register, CPLD_ACCESS_REG); -static SENSOR_DEVICE_ATTR(cpld_register_value, S_IWUSR | S_IRUGO, \ - read_register_value, write_register_value, CPLD_REGISTER_VAL); -static SENSOR_DEVICE_ATTR(cpld_sku_id, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SKU_ID); -static SENSOR_DEVICE_ATTR(cpld_hw_rev, S_IRUGO, \ - read_hw_rev_cb, NULL, CPLD_HW_REV); -static SENSOR_DEVICE_ATTR(cpld_deph_rev, S_IRUGO, \ - read_hw_rev_cb, NULL, CPLD_DEPH_REV); -static SENSOR_DEVICE_ATTR(cpld_build_rev, S_IRUGO, \ - read_hw_rev_cb, NULL, CPLD_BUILD_REV); -static SENSOR_DEVICE_ATTR(cpld_id_type, S_IRUGO, \ - read_hw_rev_cb, NULL, CPLD_ID_TYPE); -static SENSOR_DEVICE_ATTR(cpld_major_ver, S_IRUGO, \ - read_cpld_version_cb, NULL, CPLD_MAJOR_VER); -static SENSOR_DEVICE_ATTR(cpld_minor_ver, S_IRUGO, \ - read_cpld_version_cb, NULL, CPLD_MINOR_VER); -static SENSOR_DEVICE_ATTR(cpld_build_ver, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_BUILD_VER); -static SENSOR_DEVICE_ATTR(cpld_version_h, S_IRUGO, \ - read_cpld_version_h_cb, NULL, CPLD_VERION_H); -static SENSOR_DEVICE_ATTR(cpld_id, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_ID); -static SENSOR_DEVICE_ATTR(cpld_mac_intr, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_MAC_INTR); -static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_10G_PHY_INTR); -static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_CPLD_FRU_INTR); -static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_THERMAL_ALERT_INTR); -static SENSOR_DEVICE_ATTR(cpld_misc_intr, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_MISC_INTR); -static SENSOR_DEVICE_ATTR(cpld_system_intr, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SYSTEM_INTR); -static SENSOR_DEVICE_ATTR(cpld_mac_intr_mask, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_MAC_INTR_MASK); -static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr_mask, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_10G_PHY_INTR_MASK); -static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr_mask, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_CPLD_FRU_INTR_MASK); -static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr_mask, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_THERMAL_ALERT_INTR_MASK); -static SENSOR_DEVICE_ATTR(cpld_misc_intr_mask, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_MISC_INTR_MASK); -static SENSOR_DEVICE_ATTR(cpld_mac_intr_event, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_MAC_INTR_EVENT); -static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr_event, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_10G_PHY_INTR_EVENT); -static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr_event, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_CPLD_FRU_INTR_EVENT); -static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr_event, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_THERMAL_ALERT_INTR_EVENT); -static SENSOR_DEVICE_ATTR(cpld_misc_intr_event, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_MISC_INTR_EVENT); -static SENSOR_DEVICE_ATTR(cpld_mac_rst, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_MAC_RST); -static SENSOR_DEVICE_ATTR(cpld_10g_phy_rst, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_10G_PHY_RST); -static SENSOR_DEVICE_ATTR(cpld_bmc_rst, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_BMC_RST); -static SENSOR_DEVICE_ATTR(cpld_usb_rst, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_USB_RST); -static SENSOR_DEVICE_ATTR(cpld_mux_rst, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_MUX_RST); -static SENSOR_DEVICE_ATTR(cpld_misc_rst, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_MISC_RST); -static SENSOR_DEVICE_ATTR(cpld_bmc_watchdog, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_BMC_WATCHDOG); -static SENSOR_DEVICE_ATTR(cpld_dau_bd_pres, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_DAU_BD_PRES); -static SENSOR_DEVICE_ATTR(cpld_psu_status, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_PSU_STATUS); -static SENSOR_DEVICE_ATTR(cpld_sys_pw_status, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SYS_PW_STATUS); -static SENSOR_DEVICE_ATTR(cpld_misc, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_MISC); -static SENSOR_DEVICE_ATTR(cpld_mux_ctrl, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_MUX_CTRL); -static SENSOR_DEVICE_ATTR(cpld_mac_qsfp_sel_ctrl, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_MAC_QSFP_SEL_CTRL); -static SENSOR_DEVICE_ATTR(cpld_sys_led_ctrl_1, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SYS_LED_CTRL_1); -static SENSOR_DEVICE_ATTR(cpld_sys_led_ctrl_2, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SYS_LED_CTRL_2); -static SENSOR_DEVICE_ATTR(cpld_beacon_led_ctrl, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_BEACON_LED_CTRL); -static SENSOR_DEVICE_ATTR(cpld_port_led_clr_ctrl, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_PORT_LED_CLR_CTRL); -static SENSOR_DEVICE_ATTR(cpld_event_detect_ctrl, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_EVENT_DETECT_CTRL); -/* CPLD2 */ -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g0, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g1, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g2, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g3, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G3); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g0, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g1, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g2, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g3, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G3); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g0, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g1, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g2, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g3, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G3); -static SENSOR_DEVICE_ATTR(cpld_sfp_txfault, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SFP_TXFAULT); -static SENSOR_DEVICE_ATTR(cpld_sfp_abs, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SFP_ABS); -static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SFP_RXLOS); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g0, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g1, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g2, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g3, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G3); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g0, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g1, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g2, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g3, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G3); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g0, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g1, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g2, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g3, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G3); -static SENSOR_DEVICE_ATTR(cpld_sfp_txfault_mask, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_SFP_TXFAULT_MASK); -static SENSOR_DEVICE_ATTR(cpld_sfp_abs_mask, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_SFP_ABS_MASK); -static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos_mask, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_SFP_RXLOS_MASK); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g0, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g1, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g2, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g3, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G3); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g0, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g1, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g2, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g3, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G3); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g0, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g1, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g2, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g3, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G3); -static SENSOR_DEVICE_ATTR(cpld_sfp_txfault_event, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SFP_TXFAULT_EVENT); -static SENSOR_DEVICE_ATTR(cpld_sfp_abs_event, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SFP_ABS_EVENT); -static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos_event, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_SFP_RXLOS_EVENT); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g0, \ - S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, \ - CPLD_QSFPDD_RESET_CTRL_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g1, \ - S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, \ - CPLD_QSFPDD_RESET_CTRL_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g2, \ - S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, \ - CPLD_QSFPDD_RESET_CTRL_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g3, \ - S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, \ - CPLD_QSFPDD_RESET_CTRL_G3); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g0, \ - S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, \ - CPLD_QSFPDD_LP_MODE_G0); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g1, \ - S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, \ - CPLD_QSFPDD_LP_MODE_G1); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g2, \ - S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, \ - CPLD_QSFPDD_LP_MODE_G2); -static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g3, \ - S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, \ - CPLD_QSFPDD_LP_MODE_G3); -static SENSOR_DEVICE_ATTR(cpld_sfp_tx_dis, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_SFP_TX_DIS); -static SENSOR_DEVICE_ATTR(cpld_sfp_rs, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_SFP_RS); -static SENSOR_DEVICE_ATTR(cpld_sfp_ts, S_IWUSR | S_IRUGO, \ - read_cpld_callback, write_cpld_callback, CPLD_SFP_TS); -static SENSOR_DEVICE_ATTR(cpld_port_int_status, S_IRUGO, \ - read_cpld_callback, NULL, CPLD_PORT_INT_STATUS); -//BSP DEBUG -static SENSOR_DEVICE_ATTR(bsp_debug, S_IRUGO | S_IWUSR, \ - read_bsp_callback, write_bsp_callback, BSP_DEBUG); - -/* define support attributes of cpldx , total 3 */ -/* cpld 1 */ -static struct attribute *s9300_cpld1_attributes[] = { - &sensor_dev_attr_cpld_access_register.dev_attr.attr, - &sensor_dev_attr_cpld_register_value.dev_attr.attr, - &sensor_dev_attr_cpld_sku_id.dev_attr.attr, - &sensor_dev_attr_cpld_hw_rev.dev_attr.attr, - &sensor_dev_attr_cpld_deph_rev.dev_attr.attr, - &sensor_dev_attr_cpld_build_rev.dev_attr.attr, - &sensor_dev_attr_cpld_id_type.dev_attr.attr, - &sensor_dev_attr_cpld_major_ver.dev_attr.attr, - &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, - &sensor_dev_attr_cpld_build_ver.dev_attr.attr, - &sensor_dev_attr_cpld_version_h.dev_attr.attr, - &sensor_dev_attr_cpld_id.dev_attr.attr, - &sensor_dev_attr_cpld_mac_intr.dev_attr.attr, - &sensor_dev_attr_cpld_10g_phy_intr.dev_attr.attr, - &sensor_dev_attr_cpld_cpld_fru_intr.dev_attr.attr, - &sensor_dev_attr_cpld_thermal_alert_intr.dev_attr.attr, - &sensor_dev_attr_cpld_misc_intr.dev_attr.attr, - &sensor_dev_attr_cpld_system_intr.dev_attr.attr, - &sensor_dev_attr_cpld_mac_intr_mask.dev_attr.attr, - &sensor_dev_attr_cpld_10g_phy_intr_mask.dev_attr.attr, - &sensor_dev_attr_cpld_cpld_fru_intr_mask.dev_attr.attr, - &sensor_dev_attr_cpld_thermal_alert_intr_mask.dev_attr.attr, - &sensor_dev_attr_cpld_misc_intr_mask.dev_attr.attr, - &sensor_dev_attr_cpld_mac_intr_event.dev_attr.attr, - &sensor_dev_attr_cpld_10g_phy_intr_event.dev_attr.attr, - &sensor_dev_attr_cpld_cpld_fru_intr_event.dev_attr.attr, - &sensor_dev_attr_cpld_thermal_alert_intr_event.dev_attr.attr, - &sensor_dev_attr_cpld_misc_intr_event.dev_attr.attr, - &sensor_dev_attr_cpld_mac_rst.dev_attr.attr, - &sensor_dev_attr_cpld_10g_phy_rst.dev_attr.attr, - &sensor_dev_attr_cpld_bmc_rst.dev_attr.attr, - &sensor_dev_attr_cpld_usb_rst.dev_attr.attr, - &sensor_dev_attr_cpld_mux_rst.dev_attr.attr, - &sensor_dev_attr_cpld_misc_rst.dev_attr.attr, - &sensor_dev_attr_cpld_bmc_watchdog.dev_attr.attr, - &sensor_dev_attr_cpld_dau_bd_pres.dev_attr.attr, - &sensor_dev_attr_cpld_psu_status.dev_attr.attr, - &sensor_dev_attr_cpld_sys_pw_status.dev_attr.attr, - &sensor_dev_attr_cpld_misc.dev_attr.attr, - &sensor_dev_attr_cpld_mux_ctrl.dev_attr.attr, - &sensor_dev_attr_cpld_mac_qsfp_sel_ctrl.dev_attr.attr, - &sensor_dev_attr_cpld_sys_led_ctrl_1.dev_attr.attr, - &sensor_dev_attr_cpld_sys_led_ctrl_2.dev_attr.attr, - &sensor_dev_attr_cpld_beacon_led_ctrl.dev_attr.attr, - &sensor_dev_attr_cpld_port_led_clr_ctrl.dev_attr.attr, - &sensor_dev_attr_cpld_event_detect_ctrl.dev_attr.attr, - &sensor_dev_attr_bsp_debug.dev_attr.attr, - NULL -}; - -/* cpld 2 */ -static struct attribute *s9300_cpld2_attributes[] = { - &sensor_dev_attr_cpld_access_register.dev_attr.attr, - &sensor_dev_attr_cpld_register_value.dev_attr.attr, - &sensor_dev_attr_cpld_major_ver.dev_attr.attr, - &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, - &sensor_dev_attr_cpld_build_ver.dev_attr.attr, - &sensor_dev_attr_cpld_version_h.dev_attr.attr, - &sensor_dev_attr_cpld_id.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_g3.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_g3.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_g3.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_txfault.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_abs.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_rxlos.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g3.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_mask_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_mask_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_mask_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_mask_g3.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g3.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_txfault_mask.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_abs_mask.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_rxlos_mask.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g3.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_event_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_event_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_event_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_pres_event_g3.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g3.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_txfault_event.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_abs_event.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_rxlos_event.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g3.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_lp_mode_g0.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_lp_mode_g1.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_lp_mode_g2.dev_attr.attr, - &sensor_dev_attr_cpld_qsfpdd_lp_mode_g3.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_tx_dis.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_rs.dev_attr.attr, - &sensor_dev_attr_cpld_sfp_ts.dev_attr.attr, - &sensor_dev_attr_cpld_port_int_status.dev_attr.attr, - NULL -}; - -/* cpld 3 */ -static struct attribute *s9300_cpld3_attributes[] = { - &sensor_dev_attr_cpld_access_register.dev_attr.attr, - &sensor_dev_attr_cpld_register_value.dev_attr.attr, - &sensor_dev_attr_cpld_major_ver.dev_attr.attr, - &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, - &sensor_dev_attr_cpld_build_ver.dev_attr.attr, - &sensor_dev_attr_cpld_version_h.dev_attr.attr, - &sensor_dev_attr_cpld_id.dev_attr.attr, - NULL -}; - -/* cpld 1 attributes group */ -static const struct attribute_group s9300_cpld1_group = { - .attrs = s9300_cpld1_attributes, -}; -/* cpld 2 attributes group */ -static const struct attribute_group s9300_cpld2_group = { - .attrs = s9300_cpld2_attributes, -}; -/* cpld 3 attributes group */ -static const struct attribute_group s9300_cpld3_group = { - .attrs = s9300_cpld3_attributes, -}; - -static int _bsp_log(u8 log_type, char *fmt, ...) -{ - if ((log_type==LOG_READ && enable_log_read) || - (log_type==LOG_WRITE && enable_log_write)) { - va_list args; - int r; - - va_start(args, fmt); - r = vprintk(fmt, args); - va_end(args); - - return r; - } else { - return 0; - } -} - -static int _config_bsp_log(u8 log_type) -{ - switch(log_type) { - case LOG_NONE: - enable_log_read = LOG_DISABLE; - enable_log_write = LOG_DISABLE; - break; - case LOG_RW: - enable_log_read = LOG_ENABLE; - enable_log_write = LOG_ENABLE; - break; - case LOG_READ: - enable_log_read = LOG_ENABLE; - enable_log_write = LOG_DISABLE; - break; - case LOG_WRITE: - enable_log_read = LOG_DISABLE; - enable_log_write = LOG_ENABLE; - break; - default: - return -EINVAL; - } - return 0; -} - -/* get bsp value */ -static ssize_t read_bsp(char *buf, char *str) -{ - ssize_t len=0; - - len=sprintf(buf, "%s", str); - BSP_LOG_R("reg_val=%s", str); - - return len; -} - -/* set bsp value */ -static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count) -{ - snprintf(str, str_len, "%s", buf); - BSP_LOG_W("reg_val=%s", str); - - return count; -} - -/* get bsp parameter value */ -static ssize_t read_bsp_callback(struct device *dev, - struct device_attribute *da, char *buf) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - int str_len=0; - char *str=NULL; - - switch (attr->index) { - case BSP_DEBUG: - str = bsp_debug; - str_len = sizeof(bsp_debug); - break; - default: - return -EINVAL; - } - return read_bsp(buf, str); -} - -/* set bsp parameter value */ -static ssize_t write_bsp_callback(struct device *dev, - struct device_attribute *da, const char *buf, size_t count) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - int str_len=0; - char *str=NULL; - ssize_t ret = 0; - u8 bsp_debug_u8 = 0; - - switch (attr->index) { - case BSP_DEBUG: - str = bsp_debug; - str_len = sizeof(str); - ret = write_bsp(buf, str, str_len, count); - - if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { - return -EINVAL; - } else if (_config_bsp_log(bsp_debug_u8) < 0) { - return -EINVAL; - } - return ret; - default: - return -EINVAL; - } - return 0; -} - -/* read access register from cpld data */ -static ssize_t read_access_register(struct device *dev, - struct device_attribute *da, - char *buf) -{ - struct i2c_client *client = to_i2c_client(dev); - struct cpld_data *data = i2c_get_clientdata(client); - u8 reg = data->access_reg; - - return sprintf(buf, "0x%x\n", reg); -} - -/* write access register to cpld data */ -static ssize_t write_access_register(struct device *dev, - struct device_attribute *da, - const char *buf, - size_t count) -{ - struct i2c_client *client = to_i2c_client(dev); - struct cpld_data *data = i2c_get_clientdata(client); - u8 reg; - - if (kstrtou8(buf, 0, ®) < 0) - return -EINVAL; - - data->access_reg = reg; - return count; -} - -/* read the value of access register in cpld data */ -static ssize_t read_register_value(struct device *dev, - struct device_attribute *da, - char *buf) -{ - struct i2c_client *client = to_i2c_client(dev); - struct cpld_data *data = i2c_get_clientdata(client); - u8 reg = data->access_reg; - int reg_val; - - I2C_READ_BYTE_DATA(reg_val, &data->access_lock, client, reg); - - if (reg_val < 0) - return reg_val; - - return sprintf(buf, "0x%x\n", reg_val); -} - -/* wrtie the value to access register in cpld data */ -static ssize_t write_register_value(struct device *dev, - struct device_attribute *da, - const char *buf, - size_t count) -{ - struct i2c_client *client = to_i2c_client(dev); - struct cpld_data *data = i2c_get_clientdata(client); - int ret = -EIO; - u8 reg = data->access_reg; - u8 reg_val; - - if (kstrtou8(buf, 0, ®_val) < 0) - return -EINVAL; - - I2C_WRITE_BYTE_DATA(ret, &data->access_lock, client, reg, reg_val); - - if (unlikely(ret < 0)) { - dev_err(dev, "I2C_WRITE_BYTE_DATA error, return=%d\n", ret); - return ret; - } - - return count; -} - -/* get cpld register value */ -static ssize_t read_cpld_reg(struct device *dev, - char *buf, - u8 reg) -{ - int reg_val; - - if (read_cpld_reg_raw_int(dev, reg, ®_val)) - return sprintf(buf, "0x%02x\n", reg_val); - else - return reg_val; -} - -static bool read_cpld_reg_raw_int(struct device *dev, u8 reg, int *val) -{ - struct i2c_client *client = to_i2c_client(dev); - struct cpld_data *data = i2c_get_clientdata(client); - I2C_READ_BYTE_DATA(*val, &data->access_lock, client, reg); - if (unlikely(*val < 0)) { - dev_err(dev, "read_cpld_reg_raw_int() error, return=%d\n", *val); - return false; - } - return true; -} - -static bool read_cpld_reg_raw_byte(struct device *dev, u8 reg, u8 *val, int *errno) -{ - int reg_val; - - if (read_cpld_reg_raw_int(dev, reg, ®_val)) { - *val = (u8)reg_val; - return true; - } else { - *errno = reg_val; - return false; - } -} - -/* handle read for attributes */ -static ssize_t read_cpld_callback(struct device *dev, - struct device_attribute *da, char *buf) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - u8 reg = 0; - - switch (attr->index) { - case CPLD_SKU_ID: - reg = CPLD_SKU_ID_REG; - break; - case CPLD_ID: - reg = CPLD_ID_REG; - break; - case CPLD_BUILD_VER: - reg = CPLD_BUILD_VER_REG; - break; - case CPLD_MAC_INTR: - reg = CPLD_MAC_INTR_REG; - break; - case CPLD_10G_PHY_INTR: - reg = CPLD_10G_PHY_INTR_REG; - break; - case CPLD_CPLD_FRU_INTR: - reg = CPLD_CPLD_FRU_INTR_REG; - break; - case CPLD_THERMAL_ALERT_INTR: - reg = CPLD_THERMAL_ALERT_INTR_REG; - break; - case CPLD_MISC_INTR: - reg = CPLD_MISC_INTR_REG; - break; - case CPLD_SYSTEM_INTR: - reg = CPLD_SYSTEM_INTR_REG; - break; - case CPLD_MAC_INTR_MASK: - reg = CPLD_MAC_INTR_MASK_REG; - break; - case CPLD_10G_PHY_INTR_MASK: - reg = CPLD_10G_PHY_INTR_MASK_REG; - break; - case CPLD_CPLD_FRU_INTR_MASK: - reg = CPLD_CPLD_FRU_INTR_MASK_REG; - break; - case CPLD_THERMAL_ALERT_INTR_MASK: - reg = CPLD_THERMAL_ALERT_INTR_MASK_REG; - break; - case CPLD_MISC_INTR_MASK: - reg = CPLD_MISC_INTR_MASK_REG; - break; - case CPLD_MAC_INTR_EVENT: - reg = CPLD_MAC_INTR_EVENT_REG; - break; - case CPLD_10G_PHY_INTR_EVENT: - reg = CPLD_10G_PHY_INTR_EVENT_REG; - break; - case CPLD_CPLD_FRU_INTR_EVENT: - reg = CPLD_CPLD_FRU_INTR_EVENT_REG; - break; - case CPLD_THERMAL_ALERT_INTR_EVENT: - reg = CPLD_THERMAL_ALERT_INTR_EVENT_REG; - break; - case CPLD_MISC_INTR_EVENT: - reg = CPLD_MISC_INTR_EVENT_REG; - break; - case CPLD_MAC_RST: - reg = CPLD_MAC_RST_REG; - break; - case CPLD_10G_PHY_RST: - reg = CPLD_10G_PHY_RST_REG; - break; - case CPLD_BMC_RST: - reg = CPLD_BMC_RST_REG; - break; - case CPLD_USB_RST: - reg = CPLD_USB_RST_REG; - break; - case CPLD_MUX_RST: - reg = CPLD_MUX_RST_REG; - break; - case CPLD_MISC_RST: - reg = CPLD_MISC_RST_REG; - break; - case CPLD_BMC_WATCHDOG: - reg = CPLD_BMC_WATCHDOG_REG; - break; - case CPLD_DAU_BD_PRES: - reg = CPLD_DAU_BD_PRES_REG; - break; - case CPLD_PSU_STATUS: - reg = CPLD_PSU_STATUS_REG; - break; - case CPLD_SYS_PW_STATUS: - reg = CPLD_SYS_PW_STATUS_REG; - break; - case CPLD_MISC: - reg = CPLD_MISC_REG; - break; - case CPLD_MUX_CTRL: - reg = CPLD_MUX_CTRL_REG; - break; - case CPLD_MAC_QSFP_SEL_CTRL: - reg = CPLD_MAC_QSFP_SEL_CTRL_REG; - break; - case CPLD_SYS_LED_CTRL_1: - reg = CPLD_SYS_LED_CTRL_1_REG; - break; - case CPLD_SYS_LED_CTRL_2: - reg = CPLD_SYS_LED_CTRL_2_REG; - break; - case CPLD_BEACON_LED_CTRL: - reg = CPLD_BEACON_LED_CTRL_REG; - break; - case CPLD_PORT_LED_CLR_CTRL: - reg = CPLD_PORT_LED_CLR_CTRL_REG; - break; - case CPLD_EVENT_DETECT_CTRL: - reg = CPLD_EVENT_DETECT_CTRL_REG; - break; - case CPLD_QSFPDD_MOD_INT_G0: - reg = CPLD_QSFPDD_MOD_INT_G0_REG; - break; - case CPLD_QSFPDD_MOD_INT_G1: - reg = CPLD_QSFPDD_MOD_INT_G1_REG; - break; - case CPLD_QSFPDD_MOD_INT_G2: - reg = CPLD_QSFPDD_MOD_INT_G2_REG; - break; - case CPLD_QSFPDD_MOD_INT_G3: - reg = CPLD_QSFPDD_MOD_INT_G3_REG; - break; - case CPLD_QSFPDD_PRES_G0: - reg = CPLD_QSFPDD_PRES_G0_REG; - break; - case CPLD_QSFPDD_PRES_G1: - reg = CPLD_QSFPDD_PRES_G1_REG; - break; - case CPLD_QSFPDD_PRES_G2: - reg = CPLD_QSFPDD_PRES_G2_REG; - break; - case CPLD_QSFPDD_PRES_G3: - reg = CPLD_QSFPDD_PRES_G3_REG; - break; - case CPLD_QSFPDD_FUSE_INT_G0: - reg = CPLD_QSFPDD_FUSE_INT_G0_REG; - break; - case CPLD_QSFPDD_FUSE_INT_G1: - reg = CPLD_QSFPDD_FUSE_INT_G1_REG; - break; - case CPLD_QSFPDD_FUSE_INT_G2: - reg = CPLD_QSFPDD_FUSE_INT_G2_REG; - break; - case CPLD_QSFPDD_FUSE_INT_G3: - reg = CPLD_QSFPDD_FUSE_INT_G3_REG; - break; - case CPLD_SFP_TXFAULT: - reg = CPLD_SFP_TXFAULT_REG; - break; - case CPLD_SFP_ABS: - reg = CPLD_SFP_ABS_REG; - break; - case CPLD_SFP_RXLOS: - reg = CPLD_SFP_RXLOS_REG; - break; - case CPLD_QSFPDD_MOD_INT_MASK_G0: - reg = CPLD_QSFPDD_MOD_INT_MASK_G0_REG; - break; - case CPLD_QSFPDD_MOD_INT_MASK_G1: - reg = CPLD_QSFPDD_MOD_INT_MASK_G1_REG; - break; - case CPLD_QSFPDD_MOD_INT_MASK_G2: - reg = CPLD_QSFPDD_MOD_INT_MASK_G2_REG; - break; - case CPLD_QSFPDD_MOD_INT_MASK_G3: - reg = CPLD_QSFPDD_MOD_INT_MASK_G3_REG; - break; - case CPLD_QSFPDD_PRES_MASK_G0: - reg = CPLD_QSFPDD_PRES_MASK_G0_REG; - break; - case CPLD_QSFPDD_PRES_MASK_G1: - reg = CPLD_QSFPDD_PRES_MASK_G1_REG; - break; - case CPLD_QSFPDD_PRES_MASK_G2: - reg = CPLD_QSFPDD_PRES_MASK_G2_REG; - break; - case CPLD_QSFPDD_PRES_MASK_G3: - reg = CPLD_QSFPDD_PRES_MASK_G3_REG; - break; - case CPLD_QSFPDD_FUSE_INT_MASK_G0: - reg = CPLD_QSFPDD_FUSE_INT_MASK_G0_REG; - break; - case CPLD_QSFPDD_FUSE_INT_MASK_G1: - reg = CPLD_QSFPDD_FUSE_INT_MASK_G1_REG; - break; - case CPLD_QSFPDD_FUSE_INT_MASK_G2: - reg = CPLD_QSFPDD_FUSE_INT_MASK_G2_REG; - break; - case CPLD_QSFPDD_FUSE_INT_MASK_G3: - reg = CPLD_QSFPDD_FUSE_INT_MASK_G3_REG; - break; - case CPLD_SFP_TXFAULT_MASK: - reg = CPLD_SFP_TXFAULT_MASK_REG; - break; - case CPLD_SFP_ABS_MASK: - reg = CPLD_SFP_ABS_MASK_REG; - break; - case CPLD_SFP_RXLOS_MASK: - reg = CPLD_SFP_RXLOS_MASK_REG; - break; - case CPLD_QSFPDD_MOD_INT_EVENT_G0: - reg = CPLD_QSFPDD_MOD_INT_EVENT_G0_REG; - break; - case CPLD_QSFPDD_MOD_INT_EVENT_G1: - reg = CPLD_QSFPDD_MOD_INT_EVENT_G1_REG; - break; - case CPLD_QSFPDD_MOD_INT_EVENT_G2: - reg = CPLD_QSFPDD_MOD_INT_EVENT_G2_REG; - break; - case CPLD_QSFPDD_MOD_INT_EVENT_G3: - reg = CPLD_QSFPDD_MOD_INT_EVENT_G3_REG; - break; - case CPLD_QSFPDD_PRES_EVENT_G0: - reg = CPLD_QSFPDD_PRES_EVENT_G0_REG; - break; - case CPLD_QSFPDD_PRES_EVENT_G1: - reg = CPLD_QSFPDD_PRES_EVENT_G1_REG; - break; - case CPLD_QSFPDD_PRES_EVENT_G2: - reg = CPLD_QSFPDD_PRES_EVENT_G2_REG; - break; - case CPLD_QSFPDD_PRES_EVENT_G3: - reg = CPLD_QSFPDD_PRES_EVENT_G3_REG; - break; - case CPLD_QSFPDD_FUSE_INT_EVENT_G0: - reg = CPLD_QSFPDD_FUSE_INT_EVENT_G0_REG; - break; - case CPLD_QSFPDD_FUSE_INT_EVENT_G1: - reg = CPLD_QSFPDD_FUSE_INT_EVENT_G1_REG; - break; - case CPLD_QSFPDD_FUSE_INT_EVENT_G2: - reg = CPLD_QSFPDD_FUSE_INT_EVENT_G2_REG; - break; - case CPLD_QSFPDD_FUSE_INT_EVENT_G3: - reg = CPLD_QSFPDD_FUSE_INT_EVENT_G3_REG; - break; - case CPLD_SFP_TXFAULT_EVENT: - reg = CPLD_SFP_TXFAULT_EVENT_REG; - break; - case CPLD_SFP_ABS_EVENT: - reg = CPLD_SFP_ABS_EVENT_REG; - break; - case CPLD_SFP_RXLOS_EVENT: - reg = CPLD_SFP_RXLOS_EVENT_REG; - break; - case CPLD_QSFPDD_RESET_CTRL_G0: - reg = CPLD_QSFPDD_RESET_CTRL_G0_REG; - break; - case CPLD_QSFPDD_RESET_CTRL_G1: - reg = CPLD_QSFPDD_RESET_CTRL_G1_REG; - break; - case CPLD_QSFPDD_RESET_CTRL_G2: - reg = CPLD_QSFPDD_RESET_CTRL_G2_REG; - break; - case CPLD_QSFPDD_RESET_CTRL_G3: - reg = CPLD_QSFPDD_RESET_CTRL_G3_REG; - break; - case CPLD_QSFPDD_LP_MODE_G0: - reg = CPLD_QSFPDD_LP_MODE_G0_REG; - break; - case CPLD_QSFPDD_LP_MODE_G1: - reg = CPLD_QSFPDD_LP_MODE_G1_REG; - break; - case CPLD_QSFPDD_LP_MODE_G2: - reg = CPLD_QSFPDD_LP_MODE_G2_REG; - break; - case CPLD_QSFPDD_LP_MODE_G3: - reg = CPLD_QSFPDD_LP_MODE_G3_REG; - break; - case CPLD_SFP_TX_DIS: - reg = CPLD_SFP_TX_DIS_REG; - break; - case CPLD_SFP_RS: - reg = CPLD_SFP_RS_REG; - break; - case CPLD_SFP_TS: - reg = CPLD_SFP_TS_REG; - break; - case CPLD_PORT_INT_STATUS: - reg = CPLD_PORT_INT_STATUS_REG; - break; - default: - return -EINVAL; - } - return read_cpld_reg(dev, buf, reg); -} - -/* handle read for hw_rev attributes */ -static ssize_t read_hw_rev_cb(struct device *dev, - struct device_attribute *da, char *buf) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - u8 reg = CPLD_HW_REV_REG; - u8 reg_val = 0; - int errno = 0; - u8 res; - - if (!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) - return errno; - - switch (attr->index) { - case CPLD_HW_REV: - HW_REV_GET(reg_val, res); - break; - case CPLD_DEPH_REV: - DEPH_REV_GET(reg_val, res); - break; - case CPLD_BUILD_REV: - BUILD_REV_GET(reg_val, res); - break; - case CPLD_ID_TYPE: - ID_TYPE_GET(reg_val, res); - break; - default: - return -EINVAL; - } - return sprintf(buf, "0x%02x\n", res); -} - -/* handle read for cpld_version attributes */ -static ssize_t read_cpld_version_cb(struct device *dev, - struct device_attribute *da, char *buf) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - u8 reg = CPLD_VERSION_REG; - u8 reg_val = 0; - int errno = 0; - u8 res; - - if (!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) - return errno; - - switch (attr->index) { - case CPLD_MAJOR_VER: - CPLD_MAJOR_VERSION_GET(reg_val, res); - break; - case CPLD_MINOR_VER: - CPLD_MINOR_VERSION_GET(reg_val, res); - break; - default: - return -EINVAL; - } - return sprintf(buf, "0x%02x\n", res); -} - -/* handle read human-readable string for cpld_version attributes */ -static ssize_t read_cpld_version_h_cb(struct device *dev, - struct device_attribute *da, char *buf) -{ - u8 reg = CPLD_VERSION_REG; - u8 reg_val = 0; - int errno = 0; - u8 major, minor, build; - - //get major/minor register value - if(!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) - return errno; - CPLD_MAJOR_VERSION_GET(reg_val, major); - CPLD_MINOR_VERSION_GET(reg_val, minor); - - //get build register value - reg = CPLD_BUILD_VER_REG; - if(!read_cpld_reg_raw_byte(dev, reg, &build, &errno)) - return errno; - - //version string format : xx.xx.xxx - return sprintf(buf, "%d.%02d.%03d\n", major, minor, build); -} - -/* handle write for attributes */ -static ssize_t write_cpld_callback(struct device *dev, - struct device_attribute *da, const char *buf, size_t count) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - u8 reg = 0; - - switch (attr->index) { - case CPLD_MAC_INTR_MASK: - reg = CPLD_MAC_INTR_MASK_REG; - break; - case CPLD_10G_PHY_INTR_MASK: - reg = CPLD_10G_PHY_INTR_MASK_REG; - break; - case CPLD_CPLD_FRU_INTR_MASK: - reg = CPLD_CPLD_FRU_INTR_MASK_REG; - break; - case CPLD_THERMAL_ALERT_INTR_MASK: - reg = CPLD_THERMAL_ALERT_INTR_MASK_REG; - break; - case CPLD_MISC_INTR_MASK: - reg = CPLD_MISC_INTR_MASK_REG; - break; - case CPLD_MAC_RST: - reg = CPLD_MAC_RST_REG; - break; - case CPLD_10G_PHY_RST: - reg = CPLD_10G_PHY_RST_REG; - break; - case CPLD_BMC_RST: - reg = CPLD_BMC_RST_REG; - break; - case CPLD_USB_RST: - reg = CPLD_USB_RST_REG; - break; - case CPLD_MUX_RST: - reg = CPLD_MUX_RST_REG; - break; - case CPLD_MISC_RST: - reg = CPLD_MISC_RST_REG; - break; - case CPLD_BMC_WATCHDOG: - reg = CPLD_BMC_WATCHDOG_REG; - break; - case CPLD_MUX_CTRL: - reg = CPLD_MUX_CTRL_REG; - break; - case CPLD_MAC_QSFP_SEL_CTRL: - reg = CPLD_MAC_QSFP_SEL_CTRL_REG; - break; - case CPLD_BEACON_LED_CTRL: - reg = CPLD_BEACON_LED_CTRL_REG; - break; - case CPLD_PORT_LED_CLR_CTRL: - reg = CPLD_PORT_LED_CLR_CTRL_REG; - break; - case CPLD_EVENT_DETECT_CTRL: - reg = CPLD_EVENT_DETECT_CTRL_REG; - break; - case CPLD_QSFPDD_MOD_INT_MASK_G0: - reg = CPLD_QSFPDD_MOD_INT_MASK_G0_REG; - break; - case CPLD_QSFPDD_MOD_INT_MASK_G1: - reg = CPLD_QSFPDD_MOD_INT_MASK_G1_REG; - break; - case CPLD_QSFPDD_MOD_INT_MASK_G2: - reg = CPLD_QSFPDD_MOD_INT_MASK_G2_REG; - break; - case CPLD_QSFPDD_MOD_INT_MASK_G3: - reg = CPLD_QSFPDD_MOD_INT_MASK_G3_REG; - break; - case CPLD_QSFPDD_PRES_MASK_G0: - reg = CPLD_QSFPDD_PRES_MASK_G0_REG; - break; - case CPLD_QSFPDD_PRES_MASK_G1: - reg = CPLD_QSFPDD_PRES_MASK_G1_REG; - break; - case CPLD_QSFPDD_PRES_MASK_G2: - reg = CPLD_QSFPDD_PRES_MASK_G2_REG; - break; - case CPLD_QSFPDD_PRES_MASK_G3: - reg = CPLD_QSFPDD_PRES_MASK_G3_REG; - break; - case CPLD_QSFPDD_FUSE_INT_MASK_G0: - reg = CPLD_QSFPDD_FUSE_INT_MASK_G0_REG; - break; - case CPLD_QSFPDD_FUSE_INT_MASK_G1: - reg = CPLD_QSFPDD_FUSE_INT_MASK_G1_REG; - break; - case CPLD_QSFPDD_FUSE_INT_MASK_G2: - reg = CPLD_QSFPDD_FUSE_INT_MASK_G2_REG; - break; - case CPLD_QSFPDD_FUSE_INT_MASK_G3: - reg = CPLD_QSFPDD_FUSE_INT_MASK_G3_REG; - break; - case CPLD_SFP_TXFAULT_MASK: - reg = CPLD_SFP_TXFAULT_MASK_REG; - break; - case CPLD_SFP_ABS_MASK: - reg = CPLD_SFP_ABS_MASK_REG; - break; - case CPLD_SFP_RXLOS_MASK: - reg = CPLD_SFP_RXLOS_MASK_REG; - break; - case CPLD_QSFPDD_RESET_CTRL_G0: - reg = CPLD_QSFPDD_RESET_CTRL_G0_REG; - break; - case CPLD_QSFPDD_RESET_CTRL_G1: - reg = CPLD_QSFPDD_RESET_CTRL_G1_REG; - break; - case CPLD_QSFPDD_RESET_CTRL_G2: - reg = CPLD_QSFPDD_RESET_CTRL_G2_REG; - break; - case CPLD_QSFPDD_RESET_CTRL_G3: - reg = CPLD_QSFPDD_RESET_CTRL_G3_REG; - break; - case CPLD_QSFPDD_LP_MODE_G0: - reg = CPLD_QSFPDD_LP_MODE_G0_REG; - break; - case CPLD_QSFPDD_LP_MODE_G1: - reg = CPLD_QSFPDD_LP_MODE_G1_REG; - break; - case CPLD_QSFPDD_LP_MODE_G2: - reg = CPLD_QSFPDD_LP_MODE_G2_REG; - break; - case CPLD_QSFPDD_LP_MODE_G3: - reg = CPLD_QSFPDD_LP_MODE_G3_REG; - break; - case CPLD_SFP_TX_DIS: - reg = CPLD_SFP_TX_DIS_REG; - break; - case CPLD_SFP_RS: - reg = CPLD_SFP_RS_REG; - break; - case CPLD_SFP_TS: - reg = CPLD_SFP_TS_REG; - break; - default: - return -EINVAL; - } - return write_cpld_reg(dev, buf, count, reg); -} - -/* set cpld register value */ -static ssize_t write_cpld_reg(struct device *dev, - const char *buf, - size_t count, - u8 reg) -{ - struct i2c_client *client = to_i2c_client(dev); - struct cpld_data *data = i2c_get_clientdata(client); - u8 reg_val; - int ret; - - if (kstrtou8(buf, 0, ®_val) < 0) - return -EINVAL; - - I2C_WRITE_BYTE_DATA(ret, &data->access_lock, - client, reg, reg_val); - - if (unlikely(ret < 0)) { - dev_err(dev, "I2C_WRITE_BYTE_DATA error, return=%d\n", ret); - return ret; - } - - return count; -} - -/* add valid cpld client to list */ -static void s9300_cpld_add_client(struct i2c_client *client) -{ - struct cpld_client_node *node = NULL; - - node = kzalloc(sizeof(struct cpld_client_node), GFP_KERNEL); - if (!node) { - dev_info(&client->dev, - "Can't allocate cpld_client_node for index %d\n", - client->addr); - return; - } - - node->client = client; - - mutex_lock(&list_lock); - list_add(&node->list, &cpld_client_list); - mutex_unlock(&list_lock); -} - -/* remove exist cpld client in list */ -static void s9300_cpld_remove_client(struct i2c_client *client) -{ - struct list_head *list_node = NULL; - struct cpld_client_node *cpld_node = NULL; - int found = 0; - - mutex_lock(&list_lock); - list_for_each(list_node, &cpld_client_list) { - cpld_node = list_entry(list_node, - struct cpld_client_node, list); - - if (cpld_node->client == client) { - found = 1; - break; - } - } - - if (found) { - list_del(list_node); - kfree(cpld_node); - } - mutex_unlock(&list_lock); -} - -/* cpld drvier probe */ -static int s9300_cpld_probe(struct i2c_client *client, - const struct i2c_device_id *dev_id) -{ - int status; - struct cpld_data *data = NULL; - int ret = -EPERM; - int idx; - - data = kzalloc(sizeof(struct cpld_data), GFP_KERNEL); - if (!data) - return -ENOMEM; - - /* init cpld data for client */ - i2c_set_clientdata(client, data); - mutex_init(&data->access_lock); - - if (!i2c_check_functionality(client->adapter, - I2C_FUNC_SMBUS_BYTE_DATA)) { - dev_info(&client->dev, - "i2c_check_functionality failed (0x%x)\n", - client->addr); - status = -EIO; - goto exit; - } - - /* get cpld id from device */ - ret = i2c_smbus_read_byte_data(client, CPLD_ID_REG); - - if (ret < 0) { - dev_info(&client->dev, - "fail to get cpld id (0x%x) at addr (0x%x)\n", - CPLD_ID_REG, client->addr); - status = -EIO; - goto exit; - } - - CPLD_ID_ID_GET(ret, idx); - - if (INVALID(idx, cpld1, cpld3)) { - dev_info(&client->dev, - "cpld id %d(device) not valid\n", idx); - //status = -EPERM; - //goto exit; - } - - data->index = dev_id->driver_data; - - /* register sysfs hooks for different cpld group */ - dev_info(&client->dev, "probe cpld with index %d\n", data->index); - switch (data->index) { - case cpld1: - status = sysfs_create_group(&client->dev.kobj, - &s9300_cpld1_group); - break; - case cpld2: - status = sysfs_create_group(&client->dev.kobj, - &s9300_cpld2_group); - break; - case cpld3: - status = sysfs_create_group(&client->dev.kobj, - &s9300_cpld3_group); - break; - default: - status = -EINVAL; - } - - if (status) - goto exit; - - dev_info(&client->dev, "chip found\n"); - - /* add probe chip to client list */ - s9300_cpld_add_client(client); - - return 0; -exit: - switch (data->index) { - case cpld1: - sysfs_remove_group(&client->dev.kobj, &s9300_cpld1_group); - break; - case cpld2: - sysfs_remove_group(&client->dev.kobj, &s9300_cpld2_group); - break; - case cpld3: - sysfs_remove_group(&client->dev.kobj, &s9300_cpld3_group); - break; - default: - break; - } - return status; -} - -/* cpld drvier remove */ -static int s9300_cpld_remove(struct i2c_client *client) -{ - struct cpld_data *data = i2c_get_clientdata(client); - - switch (data->index) { - case cpld1: - sysfs_remove_group(&client->dev.kobj, &s9300_cpld1_group); - break; - case cpld2: - sysfs_remove_group(&client->dev.kobj, &s9300_cpld2_group); - break; - case cpld3: - sysfs_remove_group(&client->dev.kobj, &s9300_cpld3_group); - break; - } - - s9300_cpld_remove_client(client); - return 0; -} - -MODULE_DEVICE_TABLE(i2c, s9300_cpld_id); - -static struct i2c_driver s9300_cpld_driver = { - .class = I2C_CLASS_HWMON, - .driver = { - .name = "x86_64_ufispace_s9300_32d_cpld", - }, - .probe = s9300_cpld_probe, - .remove = s9300_cpld_remove, - .id_table = s9300_cpld_id, - .address_list = cpld_i2c_addr, -}; - -/* provide cpld register read */ -/* cpld_idx indicate the index of cpld device */ -int s9300_cpld_read(u8 cpld_idx, - u8 reg) -{ - struct list_head *list_node = NULL; - struct cpld_client_node *cpld_node = NULL; - int ret = -EPERM; - struct cpld_data *data; - - list_for_each(list_node, &cpld_client_list) { - cpld_node = list_entry(list_node, - struct cpld_client_node, list); - data = i2c_get_clientdata(cpld_node->client); - if (data->index == cpld_idx) { - DEBUG_PRINT("cpld_idx=%d, read reg 0x%02x", - cpld_idx, reg); - I2C_READ_BYTE_DATA(ret, &data->access_lock, - cpld_node->client, reg); - DEBUG_PRINT("cpld_idx=%d, read reg 0x%02x = 0x%02x", - cpld_idx, reg, ret); - break; - } - } - - return ret; -} -EXPORT_SYMBOL(s9300_cpld_read); - -/* provide cpld register write */ -/* cpld_idx indicate the index of cpld device */ -int s9300_cpld_write(u8 cpld_idx, - u8 reg, - u8 value) -{ - struct list_head *list_node = NULL; - struct cpld_client_node *cpld_node = NULL; - int ret = -EIO; - struct cpld_data *data; - - list_for_each(list_node, &cpld_client_list) { - cpld_node = list_entry(list_node, - struct cpld_client_node, list); - data = i2c_get_clientdata(cpld_node->client); - - if (data->index == cpld_idx) { - I2C_WRITE_BYTE_DATA(ret, &data->access_lock, - cpld_node->client, - reg, value); - DEBUG_PRINT("cpld_idx=%d, write reg 0x%02x val 0x%02x, ret=%d", - cpld_idx, reg, value, ret); - break; - } - } - - return ret; -} -EXPORT_SYMBOL(s9300_cpld_write); - -static int __init s9300_cpld_init(void) -{ - mutex_init(&list_lock); - return i2c_add_driver(&s9300_cpld_driver); -} - -static void __exit s9300_cpld_exit(void) -{ - i2c_del_driver(&s9300_cpld_driver); -} - -MODULE_AUTHOR("Leo Lin "); -MODULE_DESCRIPTION("x86_64_ufispace_s9300_cpld driver"); -MODULE_LICENSE("GPL"); - -module_init(s9300_cpld_init); -module_exit(s9300_cpld_exit); +/* + * A i2c cpld driver for the ufispace_s9300_32d + * + * Copyright (C) 2017-2019 UfiSpace Technology Corporation. + * Jason Tsai + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "x86-64-ufispace-s9300-32d-cpld.h" + +#ifdef DEBUG +#define DEBUG_PRINT(fmt, args...) \ + printk(KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#else +#define DEBUG_PRINT(fmt, args...) +#endif + +#define BSP_LOG_R(fmt, args...) \ + _bsp_log (LOG_READ, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#define BSP_LOG_W(fmt, args...) \ + _bsp_log (LOG_WRITE, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) + +#define I2C_READ_BYTE_DATA(ret, lock, i2c_client, reg) \ +{ \ + mutex_lock(lock); \ + ret = i2c_smbus_read_byte_data(i2c_client, reg); \ + mutex_unlock(lock); \ + BSP_LOG_R("cpld[%d], reg=0x%03x, reg_val=0x%02x", data->index, reg, ret); \ +} +#define I2C_WRITE_BYTE_DATA(ret, lock, i2c_client, reg, val) \ +{ \ + mutex_lock(lock); \ + ret = i2c_smbus_write_byte_data(i2c_client, reg, val); \ + mutex_unlock(lock); \ + BSP_LOG_W("cpld[%d], reg=0x%03x, reg_val=0x%02x", data->index, reg, val); \ +} + +/* CPLD sysfs attributes index */ +enum s9300_cpld_sysfs_attributes { + /* CPLD1 */ + CPLD_ACCESS_REG, + CPLD_REGISTER_VAL, + CPLD_SKU_ID, + CPLD_HW_REV, + CPLD_DEPH_REV, + CPLD_BUILD_REV, + CPLD_ID_TYPE, + CPLD_MAJOR_VER, + CPLD_MINOR_VER, + CPLD_BUILD_VER, + CPLD_VERION_H, + CPLD_ID, + CPLD_MAC_INTR, + CPLD_10G_PHY_INTR, + CPLD_CPLD_FRU_INTR, + CPLD_THERMAL_ALERT_INTR, + CPLD_MISC_INTR, + CPLD_SYSTEM_INTR, + CPLD_MAC_INTR_MASK, + CPLD_10G_PHY_INTR_MASK, + CPLD_CPLD_FRU_INTR_MASK, + CPLD_THERMAL_ALERT_INTR_MASK, + CPLD_MISC_INTR_MASK, + CPLD_MAC_INTR_EVENT, + CPLD_10G_PHY_INTR_EVENT, + CPLD_CPLD_FRU_INTR_EVENT, + CPLD_THERMAL_ALERT_INTR_EVENT, + CPLD_MISC_INTR_EVENT, + CPLD_MAC_RST, + CPLD_10G_PHY_RST, + CPLD_BMC_RST, + CPLD_USB_RST, + CPLD_MUX_RST, + CPLD_MISC_RST, + CPLD_BMC_WATCHDOG, + CPLD_DAU_BD_PRES, + CPLD_PSU_STATUS, + CPLD_SYS_PW_STATUS, + CPLD_MISC, + CPLD_MUX_CTRL, + CPLD_MAC_QSFP_SEL_CTRL, + CPLD_SYS_LED_CTRL_1, + CPLD_SYS_LED_CTRL_2, + CPLD_BEACON_LED_CTRL, + CPLD_PORT_LED_CLR_CTRL, + CPLD_EVENT_DETECT_CTRL, + /* CPLD2 */ + CPLD_QSFPDD_MOD_INT_G0, + CPLD_QSFPDD_MOD_INT_G1, + CPLD_QSFPDD_MOD_INT_G2, + CPLD_QSFPDD_MOD_INT_G3, + CPLD_QSFPDD_PRES_G0, + CPLD_QSFPDD_PRES_G1, + CPLD_QSFPDD_PRES_G2, + CPLD_QSFPDD_PRES_G3, + CPLD_QSFPDD_FUSE_INT_G0, + CPLD_QSFPDD_FUSE_INT_G1, + CPLD_QSFPDD_FUSE_INT_G2, + CPLD_QSFPDD_FUSE_INT_G3, + CPLD_SFP_TXFAULT, + CPLD_SFP_ABS, + CPLD_SFP_RXLOS, + CPLD_QSFPDD_MOD_INT_MASK_G0, + CPLD_QSFPDD_MOD_INT_MASK_G1, + CPLD_QSFPDD_MOD_INT_MASK_G2, + CPLD_QSFPDD_MOD_INT_MASK_G3, + CPLD_QSFPDD_PRES_MASK_G0, + CPLD_QSFPDD_PRES_MASK_G1, + CPLD_QSFPDD_PRES_MASK_G2, + CPLD_QSFPDD_PRES_MASK_G3, + CPLD_QSFPDD_FUSE_INT_MASK_G0, + CPLD_QSFPDD_FUSE_INT_MASK_G1, + CPLD_QSFPDD_FUSE_INT_MASK_G2, + CPLD_QSFPDD_FUSE_INT_MASK_G3, + CPLD_SFP_TXFAULT_MASK, + CPLD_SFP_ABS_MASK, + CPLD_SFP_RXLOS_MASK, + CPLD_QSFPDD_MOD_INT_EVENT_G0, + CPLD_QSFPDD_MOD_INT_EVENT_G1, + CPLD_QSFPDD_MOD_INT_EVENT_G2, + CPLD_QSFPDD_MOD_INT_EVENT_G3, + CPLD_QSFPDD_PRES_EVENT_G0, + CPLD_QSFPDD_PRES_EVENT_G1, + CPLD_QSFPDD_PRES_EVENT_G2, + CPLD_QSFPDD_PRES_EVENT_G3, + CPLD_QSFPDD_FUSE_INT_EVENT_G0, + CPLD_QSFPDD_FUSE_INT_EVENT_G1, + CPLD_QSFPDD_FUSE_INT_EVENT_G2, + CPLD_QSFPDD_FUSE_INT_EVENT_G3, + CPLD_SFP_TXFAULT_EVENT, + CPLD_SFP_ABS_EVENT, + CPLD_SFP_RXLOS_EVENT, + CPLD_QSFPDD_RESET_CTRL_G0, + CPLD_QSFPDD_RESET_CTRL_G1, + CPLD_QSFPDD_RESET_CTRL_G2, + CPLD_QSFPDD_RESET_CTRL_G3, + CPLD_QSFPDD_LP_MODE_G0, + CPLD_QSFPDD_LP_MODE_G1, + CPLD_QSFPDD_LP_MODE_G2, + CPLD_QSFPDD_LP_MODE_G3, + CPLD_SFP_TX_DIS, + CPLD_SFP_RS, + CPLD_SFP_TS, + CPLD_PORT_INT_STATUS, + + //BSP DEBUG + BSP_DEBUG +}; + +enum bsp_log_types { + LOG_NONE, + LOG_RW, + LOG_READ, + LOG_WRITE +}; + +enum bsp_log_ctrl { + LOG_DISABLE, + LOG_ENABLE +}; + +/* CPLD sysfs attributes hook functions */ +static ssize_t read_access_register(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_access_register(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_register_value(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_register_value(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_hw_rev_cb(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t read_cpld_version_cb(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t read_cpld_callback(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_cpld_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_cpld_version_h_cb(struct device *dev, + struct device_attribute *da, char *buf); +// cpld access api +static ssize_t read_cpld_reg(struct device *dev, char *buf, u8 reg); +static ssize_t write_cpld_reg(struct device *dev, const char *buf, size_t count, u8 reg); +static bool read_cpld_reg_raw_byte(struct device *dev, u8 reg, u8 *val, int *errno); +static bool read_cpld_reg_raw_int(struct device *dev, u8 reg, int *val); +// bsp debug api +static ssize_t read_bsp(char *buf, char *str); +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count); +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); + +static LIST_HEAD(cpld_client_list); /* client list for cpld */ +static struct mutex list_lock; /* mutex for client list */ + +struct cpld_client_node { + struct i2c_client *client; + struct list_head list; +}; + +struct cpld_data { + int index; /* CPLD index */ + struct mutex access_lock; /* mutex for cpld access */ + u8 access_reg; /* register to access */ +}; + +/* CPLD device id and data */ +static const struct i2c_device_id s9300_cpld_id[] = { + { "s9300_32d_cpld1", cpld1 }, + { "s9300_32d_cpld2", cpld2 }, + { "s9300_32d_cpld3", cpld3 }, + {} +}; + +char bsp_debug[2]="0"; +u8 enable_log_read=LOG_DISABLE; +u8 enable_log_write=LOG_DISABLE; + +/* Addresses scanned for s9300_cpld */ +static const unsigned short cpld_i2c_addr[] = { 0x30, 0x31, 0x32, I2C_CLIENT_END }; + +/* define all support register access of cpld in attribute */ +/* CPLD1 */ +static SENSOR_DEVICE_ATTR(cpld_access_register, S_IWUSR | S_IRUGO, \ + read_access_register, write_access_register, CPLD_ACCESS_REG); +static SENSOR_DEVICE_ATTR(cpld_register_value, S_IWUSR | S_IRUGO, \ + read_register_value, write_register_value, CPLD_REGISTER_VAL); +static SENSOR_DEVICE_ATTR(cpld_sku_id, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SKU_ID); +static SENSOR_DEVICE_ATTR(cpld_hw_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_HW_REV); +static SENSOR_DEVICE_ATTR(cpld_deph_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_DEPH_REV); +static SENSOR_DEVICE_ATTR(cpld_build_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_BUILD_REV); +static SENSOR_DEVICE_ATTR(cpld_id_type, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_ID_TYPE); +static SENSOR_DEVICE_ATTR(cpld_major_ver, S_IRUGO, \ + read_cpld_version_cb, NULL, CPLD_MAJOR_VER); +static SENSOR_DEVICE_ATTR(cpld_minor_ver, S_IRUGO, \ + read_cpld_version_cb, NULL, CPLD_MINOR_VER); +static SENSOR_DEVICE_ATTR(cpld_build_ver, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_BUILD_VER); +static SENSOR_DEVICE_ATTR(cpld_version_h, S_IRUGO, \ + read_cpld_version_h_cb, NULL, CPLD_VERION_H); +static SENSOR_DEVICE_ATTR(cpld_id, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_ID); +static SENSOR_DEVICE_ATTR(cpld_mac_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MAC_INTR); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_10G_PHY_INTR); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_CPLD_FRU_INTR); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_THERMAL_ALERT_INTR); +static SENSOR_DEVICE_ATTR(cpld_misc_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC_INTR); +static SENSOR_DEVICE_ATTR(cpld_system_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYSTEM_INTR); +static SENSOR_DEVICE_ATTR(cpld_mac_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_10G_PHY_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_CPLD_FRU_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_THERMAL_ALERT_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_misc_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MISC_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_mac_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MAC_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_10G_PHY_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_CPLD_FRU_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_THERMAL_ALERT_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_misc_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_mac_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_RST); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_10G_PHY_RST); +static SENSOR_DEVICE_ATTR(cpld_bmc_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BMC_RST); +static SENSOR_DEVICE_ATTR(cpld_usb_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_USB_RST); +static SENSOR_DEVICE_ATTR(cpld_mux_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MUX_RST); +static SENSOR_DEVICE_ATTR(cpld_misc_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MISC_RST); +static SENSOR_DEVICE_ATTR(cpld_bmc_watchdog, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BMC_WATCHDOG); +static SENSOR_DEVICE_ATTR(cpld_dau_bd_pres, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_DAU_BD_PRES); +static SENSOR_DEVICE_ATTR(cpld_psu_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_PSU_STATUS); +static SENSOR_DEVICE_ATTR(cpld_sys_pw_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_PW_STATUS); +static SENSOR_DEVICE_ATTR(cpld_misc, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC); +static SENSOR_DEVICE_ATTR(cpld_mux_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MUX_CTRL); +static SENSOR_DEVICE_ATTR(cpld_mac_qsfp_sel_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_QSFP_SEL_CTRL); +static SENSOR_DEVICE_ATTR(cpld_sys_led_ctrl_1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_LED_CTRL_1); +static SENSOR_DEVICE_ATTR(cpld_sys_led_ctrl_2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_LED_CTRL_2); +static SENSOR_DEVICE_ATTR(cpld_beacon_led_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BEACON_LED_CTRL); +static SENSOR_DEVICE_ATTR(cpld_port_led_clr_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_PORT_LED_CLR_CTRL); +static SENSOR_DEVICE_ATTR(cpld_event_detect_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_EVENT_DETECT_CTRL); +/* CPLD2 */ +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_TXFAULT); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_ABS); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_RXLOS); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g3, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g3, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g3, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TXFAULT_MASK); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_ABS_MASK); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_RXLOS_MASK); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_TXFAULT_EVENT); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_ABS_EVENT); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_RXLOS_EVENT); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g0, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g1, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g2, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g3, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g0, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g1, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g2, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g3, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_tx_dis, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TX_DIS); +static SENSOR_DEVICE_ATTR(cpld_sfp_rs, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_RS); +static SENSOR_DEVICE_ATTR(cpld_sfp_ts, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TS); +static SENSOR_DEVICE_ATTR(cpld_port_int_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_PORT_INT_STATUS); +//BSP DEBUG +static SENSOR_DEVICE_ATTR(bsp_debug, S_IRUGO | S_IWUSR, \ + read_bsp_callback, write_bsp_callback, BSP_DEBUG); + +/* define support attributes of cpldx , total 3 */ +/* cpld 1 */ +static struct attribute *s9300_cpld1_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_sku_id.dev_attr.attr, + &sensor_dev_attr_cpld_hw_rev.dev_attr.attr, + &sensor_dev_attr_cpld_deph_rev.dev_attr.attr, + &sensor_dev_attr_cpld_build_rev.dev_attr.attr, + &sensor_dev_attr_cpld_id_type.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr.dev_attr.attr, + &sensor_dev_attr_cpld_system_intr.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_mac_rst.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_rst.dev_attr.attr, + &sensor_dev_attr_cpld_bmc_rst.dev_attr.attr, + &sensor_dev_attr_cpld_usb_rst.dev_attr.attr, + &sensor_dev_attr_cpld_mux_rst.dev_attr.attr, + &sensor_dev_attr_cpld_misc_rst.dev_attr.attr, + &sensor_dev_attr_cpld_bmc_watchdog.dev_attr.attr, + &sensor_dev_attr_cpld_dau_bd_pres.dev_attr.attr, + &sensor_dev_attr_cpld_psu_status.dev_attr.attr, + &sensor_dev_attr_cpld_sys_pw_status.dev_attr.attr, + &sensor_dev_attr_cpld_misc.dev_attr.attr, + &sensor_dev_attr_cpld_mux_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_mac_qsfp_sel_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_sys_led_ctrl_1.dev_attr.attr, + &sensor_dev_attr_cpld_sys_led_ctrl_2.dev_attr.attr, + &sensor_dev_attr_cpld_beacon_led_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_port_led_clr_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_event_detect_ctrl.dev_attr.attr, + &sensor_dev_attr_bsp_debug.dev_attr.attr, + NULL +}; + +/* cpld 2 */ +static struct attribute *s9300_cpld2_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault_mask.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs_mask.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos_mask.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault_event.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs_event.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos_event.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_tx_dis.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rs.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_ts.dev_attr.attr, + &sensor_dev_attr_cpld_port_int_status.dev_attr.attr, + NULL +}; + +/* cpld 3 */ +static struct attribute *s9300_cpld3_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + NULL +}; + +/* cpld 1 attributes group */ +static const struct attribute_group s9300_cpld1_group = { + .attrs = s9300_cpld1_attributes, +}; +/* cpld 2 attributes group */ +static const struct attribute_group s9300_cpld2_group = { + .attrs = s9300_cpld2_attributes, +}; +/* cpld 3 attributes group */ +static const struct attribute_group s9300_cpld3_group = { + .attrs = s9300_cpld3_attributes, +}; + +static int _bsp_log(u8 log_type, char *fmt, ...) +{ + if ((log_type==LOG_READ && enable_log_read) || + (log_type==LOG_WRITE && enable_log_write)) { + va_list args; + int r; + + va_start(args, fmt); + r = vprintk(fmt, args); + va_end(args); + + return r; + } else { + return 0; + } +} + +static int _config_bsp_log(u8 log_type) +{ + switch(log_type) { + case LOG_NONE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_RW: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_ENABLE; + break; + case LOG_READ: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_WRITE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_ENABLE; + break; + default: + return -EINVAL; + } + return 0; +} + +/* get bsp value */ +static ssize_t read_bsp(char *buf, char *str) +{ + ssize_t len=0; + + len=sprintf(buf, "%s", str); + BSP_LOG_R("reg_val=%s", str); + + return len; +} + +/* set bsp value */ +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count) +{ + snprintf(str, str_len, "%s", buf); + BSP_LOG_W("reg_val=%s", str); + + return count; +} + +/* get bsp parameter value */ +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + + switch (attr->index) { + case BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + default: + return -EINVAL; + } + return read_bsp(buf, str); +} + +/* set bsp parameter value */ +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + ssize_t ret = 0; + u8 bsp_debug_u8 = 0; + + switch (attr->index) { + case BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + ret = write_bsp(buf, str, str_len, count); + + if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { + return -EINVAL; + } else if (_config_bsp_log(bsp_debug_u8) < 0) { + return -EINVAL; + } + return ret; + default: + return -EINVAL; + } + return 0; +} + +/* read access register from cpld data */ +static ssize_t read_access_register(struct device *dev, + struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg = data->access_reg; + + return sprintf(buf, "0x%x\n", reg); +} + +/* write access register to cpld data */ +static ssize_t write_access_register(struct device *dev, + struct device_attribute *da, + const char *buf, + size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg; + + if (kstrtou8(buf, 0, ®) < 0) + return -EINVAL; + + data->access_reg = reg; + return count; +} + +/* read the value of access register in cpld data */ +static ssize_t read_register_value(struct device *dev, + struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg = data->access_reg; + int reg_val; + + I2C_READ_BYTE_DATA(reg_val, &data->access_lock, client, reg); + + if (reg_val < 0) + return reg_val; + + return sprintf(buf, "0x%x\n", reg_val); +} + +/* wrtie the value to access register in cpld data */ +static ssize_t write_register_value(struct device *dev, + struct device_attribute *da, + const char *buf, + size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + int ret = -EIO; + u8 reg = data->access_reg; + u8 reg_val; + + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, client, reg, reg_val); + + if (unlikely(ret < 0)) { + dev_err(dev, "I2C_WRITE_BYTE_DATA error, return=%d\n", ret); + return ret; + } + + return count; +} + +/* get cpld register value */ +static ssize_t read_cpld_reg(struct device *dev, + char *buf, + u8 reg) +{ + int reg_val; + + if (read_cpld_reg_raw_int(dev, reg, ®_val)) + return sprintf(buf, "0x%02x\n", reg_val); + else + return reg_val; +} + +static bool read_cpld_reg_raw_int(struct device *dev, u8 reg, int *val) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + I2C_READ_BYTE_DATA(*val, &data->access_lock, client, reg); + if (unlikely(*val < 0)) { + dev_err(dev, "read_cpld_reg_raw_int() error, return=%d\n", *val); + return false; + } + return true; +} + +static bool read_cpld_reg_raw_byte(struct device *dev, u8 reg, u8 *val, int *errno) +{ + int reg_val; + + if (read_cpld_reg_raw_int(dev, reg, ®_val)) { + *val = (u8)reg_val; + return true; + } else { + *errno = reg_val; + return false; + } +} + +/* handle read for attributes */ +static ssize_t read_cpld_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = 0; + + switch (attr->index) { + case CPLD_SKU_ID: + reg = CPLD_SKU_ID_REG; + break; + case CPLD_ID: + reg = CPLD_ID_REG; + break; + case CPLD_BUILD_VER: + reg = CPLD_BUILD_VER_REG; + break; + case CPLD_MAC_INTR: + reg = CPLD_MAC_INTR_REG; + break; + case CPLD_10G_PHY_INTR: + reg = CPLD_10G_PHY_INTR_REG; + break; + case CPLD_CPLD_FRU_INTR: + reg = CPLD_CPLD_FRU_INTR_REG; + break; + case CPLD_THERMAL_ALERT_INTR: + reg = CPLD_THERMAL_ALERT_INTR_REG; + break; + case CPLD_MISC_INTR: + reg = CPLD_MISC_INTR_REG; + break; + case CPLD_SYSTEM_INTR: + reg = CPLD_SYSTEM_INTR_REG; + break; + case CPLD_MAC_INTR_MASK: + reg = CPLD_MAC_INTR_MASK_REG; + break; + case CPLD_10G_PHY_INTR_MASK: + reg = CPLD_10G_PHY_INTR_MASK_REG; + break; + case CPLD_CPLD_FRU_INTR_MASK: + reg = CPLD_CPLD_FRU_INTR_MASK_REG; + break; + case CPLD_THERMAL_ALERT_INTR_MASK: + reg = CPLD_THERMAL_ALERT_INTR_MASK_REG; + break; + case CPLD_MISC_INTR_MASK: + reg = CPLD_MISC_INTR_MASK_REG; + break; + case CPLD_MAC_INTR_EVENT: + reg = CPLD_MAC_INTR_EVENT_REG; + break; + case CPLD_10G_PHY_INTR_EVENT: + reg = CPLD_10G_PHY_INTR_EVENT_REG; + break; + case CPLD_CPLD_FRU_INTR_EVENT: + reg = CPLD_CPLD_FRU_INTR_EVENT_REG; + break; + case CPLD_THERMAL_ALERT_INTR_EVENT: + reg = CPLD_THERMAL_ALERT_INTR_EVENT_REG; + break; + case CPLD_MISC_INTR_EVENT: + reg = CPLD_MISC_INTR_EVENT_REG; + break; + case CPLD_MAC_RST: + reg = CPLD_MAC_RST_REG; + break; + case CPLD_10G_PHY_RST: + reg = CPLD_10G_PHY_RST_REG; + break; + case CPLD_BMC_RST: + reg = CPLD_BMC_RST_REG; + break; + case CPLD_USB_RST: + reg = CPLD_USB_RST_REG; + break; + case CPLD_MUX_RST: + reg = CPLD_MUX_RST_REG; + break; + case CPLD_MISC_RST: + reg = CPLD_MISC_RST_REG; + break; + case CPLD_BMC_WATCHDOG: + reg = CPLD_BMC_WATCHDOG_REG; + break; + case CPLD_DAU_BD_PRES: + reg = CPLD_DAU_BD_PRES_REG; + break; + case CPLD_PSU_STATUS: + reg = CPLD_PSU_STATUS_REG; + break; + case CPLD_SYS_PW_STATUS: + reg = CPLD_SYS_PW_STATUS_REG; + break; + case CPLD_MISC: + reg = CPLD_MISC_REG; + break; + case CPLD_MUX_CTRL: + reg = CPLD_MUX_CTRL_REG; + break; + case CPLD_MAC_QSFP_SEL_CTRL: + reg = CPLD_MAC_QSFP_SEL_CTRL_REG; + break; + case CPLD_SYS_LED_CTRL_1: + reg = CPLD_SYS_LED_CTRL_1_REG; + break; + case CPLD_SYS_LED_CTRL_2: + reg = CPLD_SYS_LED_CTRL_2_REG; + break; + case CPLD_BEACON_LED_CTRL: + reg = CPLD_BEACON_LED_CTRL_REG; + break; + case CPLD_PORT_LED_CLR_CTRL: + reg = CPLD_PORT_LED_CLR_CTRL_REG; + break; + case CPLD_EVENT_DETECT_CTRL: + reg = CPLD_EVENT_DETECT_CTRL_REG; + break; + case CPLD_QSFPDD_MOD_INT_G0: + reg = CPLD_QSFPDD_MOD_INT_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_G1: + reg = CPLD_QSFPDD_MOD_INT_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_G2: + reg = CPLD_QSFPDD_MOD_INT_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_G3: + reg = CPLD_QSFPDD_MOD_INT_G3_REG; + break; + case CPLD_QSFPDD_PRES_G0: + reg = CPLD_QSFPDD_PRES_G0_REG; + break; + case CPLD_QSFPDD_PRES_G1: + reg = CPLD_QSFPDD_PRES_G1_REG; + break; + case CPLD_QSFPDD_PRES_G2: + reg = CPLD_QSFPDD_PRES_G2_REG; + break; + case CPLD_QSFPDD_PRES_G3: + reg = CPLD_QSFPDD_PRES_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G0: + reg = CPLD_QSFPDD_FUSE_INT_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G1: + reg = CPLD_QSFPDD_FUSE_INT_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G2: + reg = CPLD_QSFPDD_FUSE_INT_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G3: + reg = CPLD_QSFPDD_FUSE_INT_G3_REG; + break; + case CPLD_SFP_TXFAULT: + reg = CPLD_SFP_TXFAULT_REG; + break; + case CPLD_SFP_ABS: + reg = CPLD_SFP_ABS_REG; + break; + case CPLD_SFP_RXLOS: + reg = CPLD_SFP_RXLOS_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G0: + reg = CPLD_QSFPDD_MOD_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G1: + reg = CPLD_QSFPDD_MOD_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G2: + reg = CPLD_QSFPDD_MOD_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G3: + reg = CPLD_QSFPDD_MOD_INT_MASK_G3_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G0: + reg = CPLD_QSFPDD_PRES_MASK_G0_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G1: + reg = CPLD_QSFPDD_PRES_MASK_G1_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G2: + reg = CPLD_QSFPDD_PRES_MASK_G2_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G3: + reg = CPLD_QSFPDD_PRES_MASK_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G0: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G1: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G2: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G3: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G3_REG; + break; + case CPLD_SFP_TXFAULT_MASK: + reg = CPLD_SFP_TXFAULT_MASK_REG; + break; + case CPLD_SFP_ABS_MASK: + reg = CPLD_SFP_ABS_MASK_REG; + break; + case CPLD_SFP_RXLOS_MASK: + reg = CPLD_SFP_RXLOS_MASK_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G0: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G1: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G2: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G3: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G3_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G0: + reg = CPLD_QSFPDD_PRES_EVENT_G0_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G1: + reg = CPLD_QSFPDD_PRES_EVENT_G1_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G2: + reg = CPLD_QSFPDD_PRES_EVENT_G2_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G3: + reg = CPLD_QSFPDD_PRES_EVENT_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G0: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G1: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G2: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G3: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G3_REG; + break; + case CPLD_SFP_TXFAULT_EVENT: + reg = CPLD_SFP_TXFAULT_EVENT_REG; + break; + case CPLD_SFP_ABS_EVENT: + reg = CPLD_SFP_ABS_EVENT_REG; + break; + case CPLD_SFP_RXLOS_EVENT: + reg = CPLD_SFP_RXLOS_EVENT_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G0: + reg = CPLD_QSFPDD_RESET_CTRL_G0_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G1: + reg = CPLD_QSFPDD_RESET_CTRL_G1_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G2: + reg = CPLD_QSFPDD_RESET_CTRL_G2_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G3: + reg = CPLD_QSFPDD_RESET_CTRL_G3_REG; + break; + case CPLD_QSFPDD_LP_MODE_G0: + reg = CPLD_QSFPDD_LP_MODE_G0_REG; + break; + case CPLD_QSFPDD_LP_MODE_G1: + reg = CPLD_QSFPDD_LP_MODE_G1_REG; + break; + case CPLD_QSFPDD_LP_MODE_G2: + reg = CPLD_QSFPDD_LP_MODE_G2_REG; + break; + case CPLD_QSFPDD_LP_MODE_G3: + reg = CPLD_QSFPDD_LP_MODE_G3_REG; + break; + case CPLD_SFP_TX_DIS: + reg = CPLD_SFP_TX_DIS_REG; + break; + case CPLD_SFP_RS: + reg = CPLD_SFP_RS_REG; + break; + case CPLD_SFP_TS: + reg = CPLD_SFP_TS_REG; + break; + case CPLD_PORT_INT_STATUS: + reg = CPLD_PORT_INT_STATUS_REG; + break; + default: + return -EINVAL; + } + return read_cpld_reg(dev, buf, reg); +} + +/* handle read for hw_rev attributes */ +static ssize_t read_hw_rev_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = CPLD_HW_REV_REG; + u8 reg_val = 0; + int errno = 0; + u8 res; + + if (!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + + switch (attr->index) { + case CPLD_HW_REV: + HW_REV_GET(reg_val, res); + break; + case CPLD_DEPH_REV: + DEPH_REV_GET(reg_val, res); + break; + case CPLD_BUILD_REV: + BUILD_REV_GET(reg_val, res); + break; + case CPLD_ID_TYPE: + ID_TYPE_GET(reg_val, res); + break; + default: + return -EINVAL; + } + return sprintf(buf, "0x%02x\n", res); +} + +/* handle read for cpld_version attributes */ +static ssize_t read_cpld_version_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = CPLD_VERSION_REG; + u8 reg_val = 0; + int errno = 0; + u8 res; + + if (!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + + switch (attr->index) { + case CPLD_MAJOR_VER: + CPLD_MAJOR_VERSION_GET(reg_val, res); + break; + case CPLD_MINOR_VER: + CPLD_MINOR_VERSION_GET(reg_val, res); + break; + default: + return -EINVAL; + } + return sprintf(buf, "0x%02x\n", res); +} + +/* handle read human-readable string for cpld_version attributes */ +static ssize_t read_cpld_version_h_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + u8 reg = CPLD_VERSION_REG; + u8 reg_val = 0; + int errno = 0; + u8 major, minor, build; + + //get major/minor register value + if(!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + CPLD_MAJOR_VERSION_GET(reg_val, major); + CPLD_MINOR_VERSION_GET(reg_val, minor); + + //get build register value + reg = CPLD_BUILD_VER_REG; + if(!read_cpld_reg_raw_byte(dev, reg, &build, &errno)) + return errno; + + //version string format : xx.xx.xxx + return sprintf(buf, "%d.%02d.%03d\n", major, minor, build); +} + +/* handle write for attributes */ +static ssize_t write_cpld_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = 0; + + switch (attr->index) { + case CPLD_MAC_INTR_MASK: + reg = CPLD_MAC_INTR_MASK_REG; + break; + case CPLD_10G_PHY_INTR_MASK: + reg = CPLD_10G_PHY_INTR_MASK_REG; + break; + case CPLD_CPLD_FRU_INTR_MASK: + reg = CPLD_CPLD_FRU_INTR_MASK_REG; + break; + case CPLD_THERMAL_ALERT_INTR_MASK: + reg = CPLD_THERMAL_ALERT_INTR_MASK_REG; + break; + case CPLD_MISC_INTR_MASK: + reg = CPLD_MISC_INTR_MASK_REG; + break; + case CPLD_MAC_RST: + reg = CPLD_MAC_RST_REG; + break; + case CPLD_10G_PHY_RST: + reg = CPLD_10G_PHY_RST_REG; + break; + case CPLD_BMC_RST: + reg = CPLD_BMC_RST_REG; + break; + case CPLD_USB_RST: + reg = CPLD_USB_RST_REG; + break; + case CPLD_MUX_RST: + reg = CPLD_MUX_RST_REG; + break; + case CPLD_MISC_RST: + reg = CPLD_MISC_RST_REG; + break; + case CPLD_BMC_WATCHDOG: + reg = CPLD_BMC_WATCHDOG_REG; + break; + case CPLD_MUX_CTRL: + reg = CPLD_MUX_CTRL_REG; + break; + case CPLD_MAC_QSFP_SEL_CTRL: + reg = CPLD_MAC_QSFP_SEL_CTRL_REG; + break; + case CPLD_BEACON_LED_CTRL: + reg = CPLD_BEACON_LED_CTRL_REG; + break; + case CPLD_PORT_LED_CLR_CTRL: + reg = CPLD_PORT_LED_CLR_CTRL_REG; + break; + case CPLD_EVENT_DETECT_CTRL: + reg = CPLD_EVENT_DETECT_CTRL_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G0: + reg = CPLD_QSFPDD_MOD_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G1: + reg = CPLD_QSFPDD_MOD_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G2: + reg = CPLD_QSFPDD_MOD_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G3: + reg = CPLD_QSFPDD_MOD_INT_MASK_G3_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G0: + reg = CPLD_QSFPDD_PRES_MASK_G0_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G1: + reg = CPLD_QSFPDD_PRES_MASK_G1_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G2: + reg = CPLD_QSFPDD_PRES_MASK_G2_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G3: + reg = CPLD_QSFPDD_PRES_MASK_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G0: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G1: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G2: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G3: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G3_REG; + break; + case CPLD_SFP_TXFAULT_MASK: + reg = CPLD_SFP_TXFAULT_MASK_REG; + break; + case CPLD_SFP_ABS_MASK: + reg = CPLD_SFP_ABS_MASK_REG; + break; + case CPLD_SFP_RXLOS_MASK: + reg = CPLD_SFP_RXLOS_MASK_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G0: + reg = CPLD_QSFPDD_RESET_CTRL_G0_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G1: + reg = CPLD_QSFPDD_RESET_CTRL_G1_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G2: + reg = CPLD_QSFPDD_RESET_CTRL_G2_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G3: + reg = CPLD_QSFPDD_RESET_CTRL_G3_REG; + break; + case CPLD_QSFPDD_LP_MODE_G0: + reg = CPLD_QSFPDD_LP_MODE_G0_REG; + break; + case CPLD_QSFPDD_LP_MODE_G1: + reg = CPLD_QSFPDD_LP_MODE_G1_REG; + break; + case CPLD_QSFPDD_LP_MODE_G2: + reg = CPLD_QSFPDD_LP_MODE_G2_REG; + break; + case CPLD_QSFPDD_LP_MODE_G3: + reg = CPLD_QSFPDD_LP_MODE_G3_REG; + break; + case CPLD_SFP_TX_DIS: + reg = CPLD_SFP_TX_DIS_REG; + break; + case CPLD_SFP_RS: + reg = CPLD_SFP_RS_REG; + break; + case CPLD_SFP_TS: + reg = CPLD_SFP_TS_REG; + break; + default: + return -EINVAL; + } + return write_cpld_reg(dev, buf, count, reg); +} + +/* set cpld register value */ +static ssize_t write_cpld_reg(struct device *dev, + const char *buf, + size_t count, + u8 reg) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg_val; + int ret; + + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, + client, reg, reg_val); + + if (unlikely(ret < 0)) { + dev_err(dev, "I2C_WRITE_BYTE_DATA error, return=%d\n", ret); + return ret; + } + + return count; +} + +/* add valid cpld client to list */ +static void s9300_cpld_add_client(struct i2c_client *client) +{ + struct cpld_client_node *node = NULL; + + node = kzalloc(sizeof(struct cpld_client_node), GFP_KERNEL); + if (!node) { + dev_info(&client->dev, + "Can't allocate cpld_client_node for index %d\n", + client->addr); + return; + } + + node->client = client; + + mutex_lock(&list_lock); + list_add(&node->list, &cpld_client_list); + mutex_unlock(&list_lock); +} + +/* remove exist cpld client in list */ +static void s9300_cpld_remove_client(struct i2c_client *client) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int found = 0; + + mutex_lock(&list_lock); + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + + if (cpld_node->client == client) { + found = 1; + break; + } + } + + if (found) { + list_del(list_node); + kfree(cpld_node); + } + mutex_unlock(&list_lock); +} + +/* cpld drvier probe */ +static int s9300_cpld_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + int status; + struct cpld_data *data = NULL; + int ret = -EPERM; + int idx; + + data = kzalloc(sizeof(struct cpld_data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + /* init cpld data for client */ + i2c_set_clientdata(client, data); + mutex_init(&data->access_lock); + + if (!i2c_check_functionality(client->adapter, + I2C_FUNC_SMBUS_BYTE_DATA)) { + dev_info(&client->dev, + "i2c_check_functionality failed (0x%x)\n", + client->addr); + status = -EIO; + goto exit; + } + + /* get cpld id from device */ + ret = i2c_smbus_read_byte_data(client, CPLD_ID_REG); + + if (ret < 0) { + dev_info(&client->dev, + "fail to get cpld id (0x%x) at addr (0x%x)\n", + CPLD_ID_REG, client->addr); + status = -EIO; + goto exit; + } + + CPLD_ID_ID_GET(ret, idx); + + if (INVALID(idx, cpld1, cpld3)) { + dev_info(&client->dev, + "cpld id %d(device) not valid\n", idx); + //status = -EPERM; + //goto exit; + } + + data->index = dev_id->driver_data; + + /* register sysfs hooks for different cpld group */ + dev_info(&client->dev, "probe cpld with index %d\n", data->index); + switch (data->index) { + case cpld1: + status = sysfs_create_group(&client->dev.kobj, + &s9300_cpld1_group); + break; + case cpld2: + status = sysfs_create_group(&client->dev.kobj, + &s9300_cpld2_group); + break; + case cpld3: + status = sysfs_create_group(&client->dev.kobj, + &s9300_cpld3_group); + break; + default: + status = -EINVAL; + } + + if (status) + goto exit; + + dev_info(&client->dev, "chip found\n"); + + /* add probe chip to client list */ + s9300_cpld_add_client(client); + + return 0; +exit: + switch (data->index) { + case cpld1: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld1_group); + break; + case cpld2: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld2_group); + break; + case cpld3: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld3_group); + break; + default: + break; + } + return status; +} + +/* cpld drvier remove */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +s9300_cpld_remove(struct i2c_client *client) +{ + struct cpld_data *data = i2c_get_clientdata(client); + + switch (data->index) { + case cpld1: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld1_group); + break; + case cpld2: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld2_group); + break; + case cpld3: + sysfs_remove_group(&client->dev.kobj, &s9300_cpld3_group); + break; + } + + s9300_cpld_remove_client(client); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) + return 0; +#endif +} + +MODULE_DEVICE_TABLE(i2c, s9300_cpld_id); + +static struct i2c_driver s9300_cpld_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "x86_64_ufispace_s9300_32d_cpld", + }, + .probe = s9300_cpld_probe, + .remove = s9300_cpld_remove, + .id_table = s9300_cpld_id, + .address_list = cpld_i2c_addr, +}; + +/* provide cpld register read */ +/* cpld_idx indicate the index of cpld device */ +int s9300_cpld_read(u8 cpld_idx, + u8 reg) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EPERM; + struct cpld_data *data; + + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + data = i2c_get_clientdata(cpld_node->client); + if (data->index == cpld_idx) { + DEBUG_PRINT("cpld_idx=%d, read reg 0x%02x", + cpld_idx, reg); + I2C_READ_BYTE_DATA(ret, &data->access_lock, + cpld_node->client, reg); + DEBUG_PRINT("cpld_idx=%d, read reg 0x%02x = 0x%02x", + cpld_idx, reg, ret); + break; + } + } + + return ret; +} +EXPORT_SYMBOL(s9300_cpld_read); + +/* provide cpld register write */ +/* cpld_idx indicate the index of cpld device */ +int s9300_cpld_write(u8 cpld_idx, + u8 reg, + u8 value) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EIO; + struct cpld_data *data; + + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + data = i2c_get_clientdata(cpld_node->client); + + if (data->index == cpld_idx) { + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, + cpld_node->client, + reg, value); + DEBUG_PRINT("cpld_idx=%d, write reg 0x%02x val 0x%02x, ret=%d", + cpld_idx, reg, value, ret); + break; + } + } + + return ret; +} +EXPORT_SYMBOL(s9300_cpld_write); + +static int __init s9300_cpld_init(void) +{ + mutex_init(&list_lock); + return i2c_add_driver(&s9300_cpld_driver); +} + +static void __exit s9300_cpld_exit(void) +{ + i2c_del_driver(&s9300_cpld_driver); +} + +MODULE_AUTHOR("Leo Lin "); +MODULE_DESCRIPTION("x86_64_ufispace_s9300_cpld driver"); +MODULE_LICENSE("GPL"); + +module_init(s9300_cpld_init); +module_exit(s9300_cpld_exit); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.h b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.h index d135e476e8cd..e2fd7e44a7fc 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.h +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-cpld.h @@ -1,251 +1,251 @@ -/* header file for i2c cpld driver of ufispace_s9300_32d - * - * Copyright (C) 2017 UfiSpace Technology Corporation. - * Leo Lin - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef UFISPACE_S9300_I2C_CPLD_H -#define UFISPACE_S9300_I2C_CPLD_H - -/* CPLD device index value */ -enum cpld_id { - cpld1, - cpld2, - cpld3, -}; - -enum LED_BLINK { - NOBLINK, - BLINK, -}; - -enum LED_BLINK_SPEED { - BLINK_1X, // 0.5hz - BLINK_4X, // 2hz -}; - -enum LED_STATUS { - OFF, - ON, -}; - -enum LED_YELLOW { - YELLOW_OFF, - YELLOW_ON, -}; - -enum LED_GREEN { - GREEN_OFF, - GREEN_ON, -}; - -/* QSFPDD port number */ -#define QSFPDD_MAX_PORT_NUM 32 -#define QSFPDD_MIN_PORT_NUM 1 - -/* SFP+ port number */ -#define SFP_MAX_PORT_NUM 4 -#define SFP_MIN_PORT_NUM 1 - - -/* CPLD registers */ -/* CPLD 1 */ -#define CPLD_SKU_ID_REG 0x00 -#define CPLD_HW_REV_REG 0x01 -#define CPLD_VERSION_REG 0x02 -#define CPLD_ID_REG 0x03 -#define CPLD_BUILD_VER_REG 0x04 -// Interrupt status -#define CPLD_MAC_INTR_REG 0x10 -#define CPLD_10G_PHY_INTR_REG 0x13 -#define CPLD_CPLD_FRU_INTR_REG 0x14 -#define CPLD_THERMAL_ALERT_INTR_REG 0x16 -#define CPLD_MISC_INTR_REG 0x1B -#define CPLD_SYSTEM_INTR_REG 0x1D -// Interrupt mask -#define CPLD_MAC_INTR_MASK_REG 0x20 -#define CPLD_10G_PHY_INTR_MASK_REG 0x23 -#define CPLD_CPLD_FRU_INTR_MASK_REG 0x24 -#define CPLD_THERMAL_ALERT_INTR_MASK_REG 0x26 -#define CPLD_MISC_INTR_MASK_REG 0x2B -// Interrupt event -#define CPLD_MAC_INTR_EVENT_REG 0x30 -#define CPLD_10G_PHY_INTR_EVENT_REG 0x33 -#define CPLD_CPLD_FRU_INTR_EVENT_REG 0x14 -#define CPLD_THERMAL_ALERT_INTR_EVENT_REG 0x16 -#define CPLD_MISC_INTR_EVENT_REG 0x1B -// Reset ctrl -#define CPLD_MAC_RST_REG 0x40 -#define CPLD_10G_PHY_RST_REG 0x42 -#define CPLD_BMC_RST_REG 0x43 -#define CPLD_USB_RST_REG 0x44 -#define CPLD_MUX_RST_REG 0x46 -#define CPLD_MISC_RST_REG 0x48 -#define CPLD_BMC_WATCHDOG_REG 0x4D -// Sys status -#define CPLD_DAU_BD_PRES_REG 0x50 -#define CPLD_PSU_STATUS_REG 0x51 -#define CPLD_SYS_PW_STATUS_REG 0x52 -#define CPLD_MISC_REG 0x5B -// Mux ctrl -#define CPLD_MUX_CTRL_REG 0x5C -#define CPLD_MAC_QSFP_SEL_CTRL_REG 0x5F -// Led ctrl -#define CPLD_SYS_LED_CTRL_1_REG 0x80 -#define CPLD_SYS_LED_CTRL_2_REG 0x81 -#define CPLD_BEACON_LED_CTRL_REG 0x84 -#define CPLD_PORT_LED_CLR_CTRL_REG 0x85 -// Event Detect Ctrl -#define CPLD_EVENT_DETECT_CTRL_REG 0x5D - -/* CPLD 2 */ -/* G0 - port 0 ~ 7 - G1 - port 8 ~ 15 - G2 - port 16 ~ 23 - G3 - port 24 ~ 31 - */ -// Interrupt status -#define CPLD_QSFPDD_MOD_INT_G0_REG 0x10 -#define CPLD_QSFPDD_MOD_INT_G1_REG 0x11 -#define CPLD_QSFPDD_MOD_INT_G2_REG 0x12 -#define CPLD_QSFPDD_MOD_INT_G3_REG 0x13 -#define CPLD_QSFPDD_PRES_G0_REG 0x14 -#define CPLD_QSFPDD_PRES_G1_REG 0x15 -#define CPLD_QSFPDD_PRES_G2_REG 0x16 -#define CPLD_QSFPDD_PRES_G3_REG 0x17 -#define CPLD_QSFPDD_FUSE_INT_G0_REG 0x18 -#define CPLD_QSFPDD_FUSE_INT_G1_REG 0x19 -#define CPLD_QSFPDD_FUSE_INT_G2_REG 0x1A -#define CPLD_QSFPDD_FUSE_INT_G3_REG 0x1B -#define CPLD_SFP_TXFAULT_REG 0x1D -#define CPLD_SFP_ABS_REG 0x1E -#define CPLD_SFP_RXLOS_REG 0x1F -// Interrupt mask -#define CPLD_QSFPDD_MOD_INT_MASK_G0_REG 0x20 -#define CPLD_QSFPDD_MOD_INT_MASK_G1_REG 0x21 -#define CPLD_QSFPDD_MOD_INT_MASK_G2_REG 0x22 -#define CPLD_QSFPDD_MOD_INT_MASK_G3_REG 0x23 -#define CPLD_QSFPDD_PRES_MASK_G0_REG 0x24 -#define CPLD_QSFPDD_PRES_MASK_G1_REG 0x25 -#define CPLD_QSFPDD_PRES_MASK_G2_REG 0x26 -#define CPLD_QSFPDD_PRES_MASK_G3_REG 0x27 -#define CPLD_QSFPDD_FUSE_INT_MASK_G0_REG 0x28 -#define CPLD_QSFPDD_FUSE_INT_MASK_G1_REG 0x29 -#define CPLD_QSFPDD_FUSE_INT_MASK_G2_REG 0x2A -#define CPLD_QSFPDD_FUSE_INT_MASK_G3_REG 0x2B -#define CPLD_SFP_TXFAULT_MASK_REG 0x2D -#define CPLD_SFP_ABS_MASK_REG 0x2E -#define CPLD_SFP_RXLOS_MASK_REG 0x2F -// Interrupt event -#define CPLD_QSFPDD_MOD_INT_EVENT_G0_REG 0x30 -#define CPLD_QSFPDD_MOD_INT_EVENT_G1_REG 0x31 -#define CPLD_QSFPDD_MOD_INT_EVENT_G2_REG 0x32 -#define CPLD_QSFPDD_MOD_INT_EVENT_G3_REG 0x33 -#define CPLD_QSFPDD_PRES_EVENT_G0_REG 0x34 -#define CPLD_QSFPDD_PRES_EVENT_G1_REG 0x35 -#define CPLD_QSFPDD_PRES_EVENT_G2_REG 0x36 -#define CPLD_QSFPDD_PRES_EVENT_G3_REG 0x37 -#define CPLD_QSFPDD_FUSE_INT_EVENT_G0_REG 0x38 -#define CPLD_QSFPDD_FUSE_INT_EVENT_G1_REG 0x39 -#define CPLD_QSFPDD_FUSE_INT_EVENT_G2_REG 0x3A -#define CPLD_QSFPDD_FUSE_INT_EVENT_G3_REG 0x3B -#define CPLD_SFP_TXFAULT_EVENT_REG 0x3D -#define CPLD_SFP_ABS_EVENT_REG 0x3E -#define CPLD_SFP_RXLOS_EVENT_REG 0x3F -// Port ctrl -#define CPLD_QSFPDD_RESET_CTRL_G0_REG 0x40 -#define CPLD_QSFPDD_RESET_CTRL_G1_REG 0x41 -#define CPLD_QSFPDD_RESET_CTRL_G2_REG 0x42 -#define CPLD_QSFPDD_RESET_CTRL_G3_REG 0x43 -#define CPLD_QSFPDD_LP_MODE_G0_REG 0x44 -#define CPLD_QSFPDD_LP_MODE_G1_REG 0x45 -#define CPLD_QSFPDD_LP_MODE_G2_REG 0x46 -#define CPLD_QSFPDD_LP_MODE_G3_REG 0x47 -#define CPLD_SFP_TX_DIS_REG 0x55 -#define CPLD_SFP_RS_REG 0x56 -#define CPLD_SFP_TS_REG 0x57 -// Port status -#define CPLD_PORT_INT_STATUS_REG 0x58 - - -/* bit field structure for register value */ -struct cpld_reg_sku_id_t { - u8 model_id:8; -}; - -struct cpld_reg_hw_rev_t { - u8 hw_rev:2; - u8 deph_rev:1; - u8 build_rev:3; - u8 reserved:1; - u8 id_type:1; -}; - -struct cpld_reg_version_t { - u8 minor:6; - u8 major:2; -}; - -struct cpld_reg_id_t { - u8 id:3; - u8 release:5; -}; - -struct cpld_reg_beacon_led_ctrl_t { - u8 reserve:5; - u8 speed:1; - u8 blink:1; - u8 onoff:1; -}; - -/* common manipulation */ -#define INVALID(i, min, max) ((i < min) || (i > max) ? 1u : 0u) -#define READ_BIT(val, bit) ((0u == (val & (1<bf_name) -#define READ_BF_1(bf_struct, val, bf_name, bf_value) \ - bf_struct bf; \ - bf.data = val; \ - bf_value = bf.bf_name -#define HW_REV_GET(val, res) \ - READ_BF(cpld_reg_hw_rev_t, val, hw_rev, res) -#define DEPH_REV_GET(val, res) \ - READ_BF(cpld_reg_hw_rev_t, val, deph_rev, res) -#define BUILD_REV_GET(val, res) \ - READ_BF(cpld_reg_hw_rev_t, val, build_rev, res) -#define ID_TYPE_GET(val, res) \ - READ_BF(cpld_reg_hw_rev_t, val, id_type, res) -#define CPLD_MAJOR_VERSION_GET(val, res) \ - READ_BF(cpld_reg_version_t, val, major, res) -#define CPLD_MINOR_VERSION_GET(val, res) \ - READ_BF(cpld_reg_version_t, val, minor, res) -#define CPLD_ID_ID_GET(val, res) \ - READ_BF(cpld_reg_id_t, val, id, res) - -/* CPLD access functions */ -extern int s9300_cpld_read(u8 cpld_idx, u8 reg); -extern int s9300_cpld_write(u8 cpld_idx, u8 reg, u8 value); - -#endif - +/* header file for i2c cpld driver of ufispace_s9300_32d + * + * Copyright (C) 2017 UfiSpace Technology Corporation. + * Leo Lin + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef UFISPACE_S9300_I2C_CPLD_H +#define UFISPACE_S9300_I2C_CPLD_H + +/* CPLD device index value */ +enum cpld_id { + cpld1, + cpld2, + cpld3, +}; + +enum LED_BLINK { + NOBLINK, + BLINK, +}; + +enum LED_BLINK_SPEED { + BLINK_1X, // 0.5hz + BLINK_4X, // 2hz +}; + +enum LED_STATUS { + OFF, + ON, +}; + +enum LED_YELLOW { + YELLOW_OFF, + YELLOW_ON, +}; + +enum LED_GREEN { + GREEN_OFF, + GREEN_ON, +}; + +/* QSFPDD port number */ +#define QSFPDD_MAX_PORT_NUM 32 +#define QSFPDD_MIN_PORT_NUM 1 + +/* SFP+ port number */ +#define SFP_MAX_PORT_NUM 4 +#define SFP_MIN_PORT_NUM 1 + + +/* CPLD registers */ +/* CPLD 1 */ +#define CPLD_SKU_ID_REG 0x00 +#define CPLD_HW_REV_REG 0x01 +#define CPLD_VERSION_REG 0x02 +#define CPLD_ID_REG 0x03 +#define CPLD_BUILD_VER_REG 0x04 +// Interrupt status +#define CPLD_MAC_INTR_REG 0x10 +#define CPLD_10G_PHY_INTR_REG 0x13 +#define CPLD_CPLD_FRU_INTR_REG 0x14 +#define CPLD_THERMAL_ALERT_INTR_REG 0x16 +#define CPLD_MISC_INTR_REG 0x1B +#define CPLD_SYSTEM_INTR_REG 0x1D +// Interrupt mask +#define CPLD_MAC_INTR_MASK_REG 0x20 +#define CPLD_10G_PHY_INTR_MASK_REG 0x23 +#define CPLD_CPLD_FRU_INTR_MASK_REG 0x24 +#define CPLD_THERMAL_ALERT_INTR_MASK_REG 0x26 +#define CPLD_MISC_INTR_MASK_REG 0x2B +// Interrupt event +#define CPLD_MAC_INTR_EVENT_REG 0x30 +#define CPLD_10G_PHY_INTR_EVENT_REG 0x33 +#define CPLD_CPLD_FRU_INTR_EVENT_REG 0x14 +#define CPLD_THERMAL_ALERT_INTR_EVENT_REG 0x16 +#define CPLD_MISC_INTR_EVENT_REG 0x1B +// Reset ctrl +#define CPLD_MAC_RST_REG 0x40 +#define CPLD_10G_PHY_RST_REG 0x42 +#define CPLD_BMC_RST_REG 0x43 +#define CPLD_USB_RST_REG 0x44 +#define CPLD_MUX_RST_REG 0x46 +#define CPLD_MISC_RST_REG 0x48 +#define CPLD_BMC_WATCHDOG_REG 0x4D +// Sys status +#define CPLD_DAU_BD_PRES_REG 0x50 +#define CPLD_PSU_STATUS_REG 0x51 +#define CPLD_SYS_PW_STATUS_REG 0x52 +#define CPLD_MISC_REG 0x5B +// Mux ctrl +#define CPLD_MUX_CTRL_REG 0x5C +#define CPLD_MAC_QSFP_SEL_CTRL_REG 0x5F +// Led ctrl +#define CPLD_SYS_LED_CTRL_1_REG 0x80 +#define CPLD_SYS_LED_CTRL_2_REG 0x81 +#define CPLD_BEACON_LED_CTRL_REG 0x84 +#define CPLD_PORT_LED_CLR_CTRL_REG 0x85 +// Event Detect Ctrl +#define CPLD_EVENT_DETECT_CTRL_REG 0x5D + +/* CPLD 2 */ +/* G0 - port 0 ~ 7 + G1 - port 8 ~ 15 + G2 - port 16 ~ 23 + G3 - port 24 ~ 31 + */ +// Interrupt status +#define CPLD_QSFPDD_MOD_INT_G0_REG 0x10 +#define CPLD_QSFPDD_MOD_INT_G1_REG 0x11 +#define CPLD_QSFPDD_MOD_INT_G2_REG 0x12 +#define CPLD_QSFPDD_MOD_INT_G3_REG 0x13 +#define CPLD_QSFPDD_PRES_G0_REG 0x14 +#define CPLD_QSFPDD_PRES_G1_REG 0x15 +#define CPLD_QSFPDD_PRES_G2_REG 0x16 +#define CPLD_QSFPDD_PRES_G3_REG 0x17 +#define CPLD_QSFPDD_FUSE_INT_G0_REG 0x18 +#define CPLD_QSFPDD_FUSE_INT_G1_REG 0x19 +#define CPLD_QSFPDD_FUSE_INT_G2_REG 0x1A +#define CPLD_QSFPDD_FUSE_INT_G3_REG 0x1B +#define CPLD_SFP_TXFAULT_REG 0x1D +#define CPLD_SFP_ABS_REG 0x1E +#define CPLD_SFP_RXLOS_REG 0x1F +// Interrupt mask +#define CPLD_QSFPDD_MOD_INT_MASK_G0_REG 0x20 +#define CPLD_QSFPDD_MOD_INT_MASK_G1_REG 0x21 +#define CPLD_QSFPDD_MOD_INT_MASK_G2_REG 0x22 +#define CPLD_QSFPDD_MOD_INT_MASK_G3_REG 0x23 +#define CPLD_QSFPDD_PRES_MASK_G0_REG 0x24 +#define CPLD_QSFPDD_PRES_MASK_G1_REG 0x25 +#define CPLD_QSFPDD_PRES_MASK_G2_REG 0x26 +#define CPLD_QSFPDD_PRES_MASK_G3_REG 0x27 +#define CPLD_QSFPDD_FUSE_INT_MASK_G0_REG 0x28 +#define CPLD_QSFPDD_FUSE_INT_MASK_G1_REG 0x29 +#define CPLD_QSFPDD_FUSE_INT_MASK_G2_REG 0x2A +#define CPLD_QSFPDD_FUSE_INT_MASK_G3_REG 0x2B +#define CPLD_SFP_TXFAULT_MASK_REG 0x2D +#define CPLD_SFP_ABS_MASK_REG 0x2E +#define CPLD_SFP_RXLOS_MASK_REG 0x2F +// Interrupt event +#define CPLD_QSFPDD_MOD_INT_EVENT_G0_REG 0x30 +#define CPLD_QSFPDD_MOD_INT_EVENT_G1_REG 0x31 +#define CPLD_QSFPDD_MOD_INT_EVENT_G2_REG 0x32 +#define CPLD_QSFPDD_MOD_INT_EVENT_G3_REG 0x33 +#define CPLD_QSFPDD_PRES_EVENT_G0_REG 0x34 +#define CPLD_QSFPDD_PRES_EVENT_G1_REG 0x35 +#define CPLD_QSFPDD_PRES_EVENT_G2_REG 0x36 +#define CPLD_QSFPDD_PRES_EVENT_G3_REG 0x37 +#define CPLD_QSFPDD_FUSE_INT_EVENT_G0_REG 0x38 +#define CPLD_QSFPDD_FUSE_INT_EVENT_G1_REG 0x39 +#define CPLD_QSFPDD_FUSE_INT_EVENT_G2_REG 0x3A +#define CPLD_QSFPDD_FUSE_INT_EVENT_G3_REG 0x3B +#define CPLD_SFP_TXFAULT_EVENT_REG 0x3D +#define CPLD_SFP_ABS_EVENT_REG 0x3E +#define CPLD_SFP_RXLOS_EVENT_REG 0x3F +// Port ctrl +#define CPLD_QSFPDD_RESET_CTRL_G0_REG 0x40 +#define CPLD_QSFPDD_RESET_CTRL_G1_REG 0x41 +#define CPLD_QSFPDD_RESET_CTRL_G2_REG 0x42 +#define CPLD_QSFPDD_RESET_CTRL_G3_REG 0x43 +#define CPLD_QSFPDD_LP_MODE_G0_REG 0x44 +#define CPLD_QSFPDD_LP_MODE_G1_REG 0x45 +#define CPLD_QSFPDD_LP_MODE_G2_REG 0x46 +#define CPLD_QSFPDD_LP_MODE_G3_REG 0x47 +#define CPLD_SFP_TX_DIS_REG 0x55 +#define CPLD_SFP_RS_REG 0x56 +#define CPLD_SFP_TS_REG 0x57 +// Port status +#define CPLD_PORT_INT_STATUS_REG 0x58 + + +/* bit field structure for register value */ +struct cpld_reg_sku_id_t { + u8 model_id:8; +}; + +struct cpld_reg_hw_rev_t { + u8 hw_rev:2; + u8 deph_rev:1; + u8 build_rev:3; + u8 reserved:1; + u8 id_type:1; +}; + +struct cpld_reg_version_t { + u8 minor:6; + u8 major:2; +}; + +struct cpld_reg_id_t { + u8 id:3; + u8 release:5; +}; + +struct cpld_reg_beacon_led_ctrl_t { + u8 reserve:5; + u8 speed:1; + u8 blink:1; + u8 onoff:1; +}; + +/* common manipulation */ +#define INVALID(i, min, max) ((i < min) || (i > max) ? 1u : 0u) +#define READ_BIT(val, bit) ((0u == (val & (1<bf_name) +#define READ_BF_1(bf_struct, val, bf_name, bf_value) \ + bf_struct bf; \ + bf.data = val; \ + bf_value = bf.bf_name +#define HW_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, hw_rev, res) +#define DEPH_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, deph_rev, res) +#define BUILD_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, build_rev, res) +#define ID_TYPE_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, id_type, res) +#define CPLD_MAJOR_VERSION_GET(val, res) \ + READ_BF(cpld_reg_version_t, val, major, res) +#define CPLD_MINOR_VERSION_GET(val, res) \ + READ_BF(cpld_reg_version_t, val, minor, res) +#define CPLD_ID_ID_GET(val, res) \ + READ_BF(cpld_reg_id_t, val, id, res) + +/* CPLD access functions */ +extern int s9300_cpld_read(u8 cpld_idx, u8 reg); +extern int s9300_cpld_write(u8 cpld_idx, u8 reg, u8 value); + +#endif + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-lpc.c b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-lpc.c index a00d8320221b..d227f631748b 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-lpc.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-lpc.c @@ -1,816 +1,850 @@ -/* - * A lpc driver for the ufispace_s9300_32d - * - * Copyright (C) 2017-2020 UfiSpace Technology Corporation. - * Jason Tsai - * - * Based on ad7414.c - * Copyright 2006 Stefan Roese , DENX Software Engineering - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#include -#include -#include -#include -#include - -#define BSP_LOG_R(fmt, args...) \ - _bsp_log (LOG_READ, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ - __FILE__, __func__, __LINE__, ##args) -#define BSP_LOG_W(fmt, args...) \ - _bsp_log (LOG_WRITE, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ - __FILE__, __func__, __LINE__, ##args) - -#define DRIVER_NAME "x86_64_ufispace_s9300_32d_lpc" -#define CPU_BDE 0 -#define CPU_SKY 1 -#define CPU_TYPE CPU_SKY - -/* LPC registers */ - -#define REG_BASE_CPU 0x600 - -#if CPU_TYPE == CPU_SKY -#define REG_BASE_MB 0xE00 -#define REG_BASE_I2C_ALERT 0x700 -#else -#define REG_BASE_MB 0x700 -#define REG_BASE_I2C_ALERT 0xF000 -#endif - -//CPU CPLD -#define REG_CPU_CPLD_VERSION (REG_BASE_CPU + 0x00) -#define REG_CPU_STATUS_0 (REG_BASE_CPU + 0x01) -#define REG_CPU_STATUS_1 (REG_BASE_CPU + 0x02) -#define REG_CPU_CTRL_0 (REG_BASE_CPU + 0x03) -#define REG_CPU_CTRL_1 (REG_BASE_CPU + 0x04) -#define REG_CPU_CPLD_BUILD (REG_BASE_CPU + 0xE0) - -//MB CPLD -//TBD, need to change after CPLD spec release -#define REG_MB_BRD_ID_0 (REG_BASE_MB + 0x00) -#define REG_MB_BRD_ID_1 (REG_BASE_MB + 0x01) -#define REG_MB_CPLD_VERSION (REG_BASE_MB + 0x02) -#define REG_MB_CPLD_BUILD (REG_BASE_MB + 0x04) -#define REG_MB_MUX_RESET (REG_BASE_MB + 0x46) -#define REG_MB_MUX_CTRL (REG_BASE_MB + 0x5c) - -//I2C Alert -#if CPU_TYPE == CPU_SKY -#define REG_ALERT_STATUS (REG_BASE_I2C_ALERT + 0x80) -#else -#define REG_ALERT_STATUS (REG_BASE_I2C_ALERT + 0x00) -#define REG_ALERT_DISABLE (REG_BASE_I2C_ALERT + 0x11) -#endif - -#define MASK_ALL (0xFF) -#define LPC_MDELAY (5) - -/* LPC sysfs attributes index */ -enum lpc_sysfs_attributes { - //CPU CPLD - ATT_CPU_CPLD_VERSION, - ATT_CPU_CPLD_VERSION_H, - ATT_CPU_BIOS_BOOT_ROM, - ATT_CPU_BIOS_BOOT_CFG, - ATT_CPU_CPLD_BUILD, - //MB CPLD - ATT_MB_BRD_ID_0, - ATT_MB_BRD_ID_1, - ATT_MB_CPLD_1_VERSION, - ATT_MB_CPLD_1_VERSION_H, - ATT_MB_CPLD_1_BUILD, - ATT_MB_MUX_CTRL, - ATT_MB_MUX_RESET, - ATT_MB_BRD_SKU_ID, - ATT_MB_BRD_HW_ID, - ATT_MB_BRD_ID_TYPE, - ATT_MB_BRD_BUILD_ID, - ATT_MB_BRD_DEPH_ID, - //I2C Alert - ATT_ALERT_STATUS, -#if CPU_TYPE == CPU_BDE - ATT_ALERT_DISABLE, -#endif - //BSP - ATT_BSP_VERSION, - ATT_BSP_DEBUG, - ATT_BSP_REG, - ATT_MAX -}; - -enum bsp_log_types { - LOG_NONE, - LOG_RW, - LOG_READ, - LOG_WRITE -}; - -enum bsp_log_ctrl { - LOG_DISABLE, - LOG_ENABLE -}; - -struct lpc_data_s { - struct mutex access_lock; -}; - -struct lpc_data_s *lpc_data; -char bsp_version[16]=""; -char bsp_debug[2]="0"; -char bsp_reg[8]="0x0"; -u8 enable_log_read=LOG_DISABLE; -u8 enable_log_write=LOG_DISABLE; - -/* reg shift */ -static u8 _shift(u8 mask) -{ - int i=0, mask_one=1; - - for(i=0; i<8; ++i) { - if ((mask & mask_one) == 1) - return i; - else - mask >>= 1; - } - - return -1; -} - -/* reg mask and shift */ -static u8 _mask_shift(u8 val, u8 mask) -{ - int shift=0; - - shift = _shift(mask); - - return (val & mask) >> shift; -} - -static u8 _bit_operation(u8 reg_val, u8 bit, u8 bit_val) -{ - if (bit_val == 0) - reg_val = reg_val & ~(1 << bit); - else - reg_val = reg_val | (1 << bit); - return reg_val; -} - -static int _bsp_log(u8 log_type, char *fmt, ...) -{ - if ((log_type==LOG_READ && enable_log_read) || - (log_type==LOG_WRITE && enable_log_write)) { - va_list args; - int r; - - va_start(args, fmt); - r = vprintk(fmt, args); - va_end(args); - - return r; - } else { - return 0; - } -} - -static int _config_bsp_log(u8 log_type) -{ - switch(log_type) { - case LOG_NONE: - enable_log_read = LOG_DISABLE; - enable_log_write = LOG_DISABLE; - break; - case LOG_RW: - enable_log_read = LOG_ENABLE; - enable_log_write = LOG_ENABLE; - break; - case LOG_READ: - enable_log_read = LOG_ENABLE; - enable_log_write = LOG_DISABLE; - break; - case LOG_WRITE: - enable_log_read = LOG_DISABLE; - enable_log_write = LOG_ENABLE; - break; - default: - return -EINVAL; - } - return 0; -} - -/* get lpc register value */ -static u8 _read_lpc_reg(u16 reg, u8 mask) -{ - u8 reg_val; - - mutex_lock(&lpc_data->access_lock); - reg_val=_mask_shift(inb(reg), mask); - mutex_unlock(&lpc_data->access_lock); - - BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); - - return reg_val; -} - -/* get lpc register value */ -static ssize_t read_lpc_reg(u16 reg, u8 mask, char *buf) -{ - u8 reg_val; - int len=0; - - reg_val = _read_lpc_reg(reg, mask); - len=sprintf(buf,"0x%x\n", reg_val); - - return len; -} - -/* set lpc register value */ -static ssize_t write_lpc_reg(u16 reg, u8 mask, const char *buf, size_t count) -{ - u8 reg_val, reg_val_now, shift; - - if (kstrtou8(buf, 0, ®_val) < 0) - return -EINVAL; - - //apply SINGLE BIT operation if mask is specified, multiple bits are not supported - if (mask != MASK_ALL) { - reg_val_now = _read_lpc_reg(reg, 0x0); - shift = _shift(mask); - reg_val = _bit_operation(reg_val_now, shift, reg_val); - } - - mutex_lock(&lpc_data->access_lock); - - outb(reg_val, reg); - mdelay(LPC_MDELAY); - - mutex_unlock(&lpc_data->access_lock); - - BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val); - - return count; -} - -/* get bsp value */ -static ssize_t read_bsp(char *buf, char *str) -{ - ssize_t len=0; - - mutex_lock(&lpc_data->access_lock); - len=sprintf(buf, "%s", str); - mutex_unlock(&lpc_data->access_lock); - - BSP_LOG_R("reg_val=%s", str); - - return len; -} - -/* set bsp value */ -static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count) -{ - mutex_lock(&lpc_data->access_lock); - snprintf(str, str_len, "%s", buf); - mutex_unlock(&lpc_data->access_lock); - - BSP_LOG_W("reg_val=%s", str); - - return count; -} - -/* get cpu cpld version in human readable format */ -static ssize_t read_cpu_cpld_version_h(struct device *dev, - struct device_attribute *da, char *buf) -{ - ssize_t len=0; - u16 reg = REG_CPU_CPLD_VERSION; - u8 mask = MASK_ALL; - u8 mask_major = 0b11000000; - u8 mask_minor = 0b00111111; - u8 reg_val; - u8 major, minor, build; - - mutex_lock(&lpc_data->access_lock); - reg_val = _mask_shift(inb(reg), mask); - major = _mask_shift(reg_val, mask_major); - minor = _mask_shift(reg_val, mask_minor); - reg = REG_CPU_CPLD_BUILD; - build = _mask_shift(inb(reg), mask); - len = sprintf(buf, "%d.%02d.%03d\n", major, minor, build); - mutex_unlock(&lpc_data->access_lock); - - BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); - - return len; -} - -/* get mb cpld version in human readable format */ -static ssize_t read_mb_cpld_1_version_h(struct device *dev, - struct device_attribute *da, char *buf) -{ - ssize_t len=0; - u16 reg = REG_MB_CPLD_VERSION; - u8 mask = MASK_ALL; - u8 mask_major = 0b11000000; - u8 mask_minor = 0b00111111; - u8 reg_val; - u8 major, minor, build; - - mutex_lock(&lpc_data->access_lock); - reg_val = _mask_shift(inb(reg), mask); - major = _mask_shift(reg_val, mask_major); - minor = _mask_shift(reg_val, mask_minor); - reg = REG_MB_CPLD_BUILD; - build = _mask_shift(inb(reg), mask); - len = sprintf(buf, "%d.%02d.%03d\n", major, minor, build); - mutex_unlock(&lpc_data->access_lock); - - BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); - - return len; -} - -/* get mux_reset register value */ -static ssize_t read_mux_reset_callback(struct device *dev, - struct device_attribute *da, char *buf) -{ - int len = 0; - u16 reg = REG_MB_MUX_RESET; - u8 mask = 0b00011111; - u8 reg_val; - - mutex_lock(&lpc_data->access_lock); - reg_val=_mask_shift(inb(reg), mask); - BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); - len=sprintf(buf, "%d\n", reg_val); - mutex_unlock(&lpc_data->access_lock); - - return len; -} - -/* set mux_reset register value */ -static ssize_t write_mux_reset_callback(struct device *dev, - struct device_attribute *da, const char *buf, size_t count) -{ - u8 val = 0; - u16 reg = REG_MB_MUX_RESET; - u8 reg_val = 0; - u8 mask = 0b00011111; - static int mux_reset_flag = 0; - - if (kstrtou8(buf, 0, &val) < 0) - return -EINVAL; - - if (mux_reset_flag == 0) { - if (val == 0) { - mutex_lock(&lpc_data->access_lock); - mux_reset_flag = 1; - BSP_LOG_W("i2c mux reset is triggered..."); - - reg_val = inb(reg); - outb((reg_val & ~mask), reg); - mdelay(LPC_MDELAY); - BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val & ~mask); - mdelay(500); - outb((reg_val | mask), reg); - mdelay(LPC_MDELAY); - BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val | mask); - mdelay(500); - mux_reset_flag = 0; - mutex_unlock(&lpc_data->access_lock); - } else { - return -EINVAL; - } - } else { - BSP_LOG_W("i2c mux is resetting... (ignore)"); - mutex_lock(&lpc_data->access_lock); - mutex_unlock(&lpc_data->access_lock); - } - - return count; -} - -/* get lpc register value */ -static ssize_t read_lpc_callback(struct device *dev, - struct device_attribute *da, char *buf) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - u16 reg = 0; - u8 mask = MASK_ALL; - - switch (attr->index) { - //CPU CPLD - case ATT_CPU_CPLD_VERSION: - reg = REG_CPU_CPLD_VERSION; - break; - case ATT_CPU_BIOS_BOOT_ROM: - reg = REG_CPU_STATUS_1; - mask = 0x80; - break; - case ATT_CPU_BIOS_BOOT_CFG: - reg = REG_CPU_CTRL_1; - mask = 0x80; - break; - case ATT_CPU_CPLD_BUILD: - reg = REG_CPU_CPLD_BUILD; - break; - //MB CPLD - case ATT_MB_BRD_ID_0: - reg = REG_MB_BRD_ID_0; - break; - case ATT_MB_BRD_ID_1: - reg = REG_MB_BRD_ID_1; - break; - case ATT_MB_CPLD_1_VERSION: - reg = REG_MB_CPLD_VERSION; - break; - case ATT_MB_CPLD_1_BUILD: - reg = REG_MB_CPLD_BUILD; - break; - case ATT_MB_BRD_SKU_ID: - reg = REG_MB_BRD_ID_0; - mask = 0xFF; - break; - case ATT_MB_BRD_HW_ID: - reg = REG_MB_BRD_ID_1; - mask = 0x03; - break; - case ATT_MB_BRD_ID_TYPE: - reg = REG_MB_BRD_ID_1; - mask = 0x80; - break; - case ATT_MB_BRD_BUILD_ID: - reg = REG_MB_BRD_ID_1; - mask = 0x38; - break; - case ATT_MB_BRD_DEPH_ID: - reg = REG_MB_BRD_ID_1; - mask = 0x04; - break; - case ATT_MB_MUX_CTRL: - reg = REG_MB_MUX_CTRL; - break; - //I2C Alert - case ATT_ALERT_STATUS: - reg = REG_ALERT_STATUS; - mask = 0x20; - break; -#if CPU_TYPE == CPU_BDE - case ATT_ALERT_DISABLE: - reg = REG_ALERT_DISABLE; - mask = 0x04; - break; -#endif - //BSP - case ATT_BSP_REG: - if (kstrtou16(bsp_reg, 0, ®) < 0) - return -EINVAL; - break; - default: - return -EINVAL; - } - return read_lpc_reg(reg, mask, buf); -} - -/* set lpc register value */ -static ssize_t write_lpc_callback(struct device *dev, - struct device_attribute *da, const char *buf, size_t count) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - u16 reg = 0; - u8 mask = MASK_ALL; - - switch (attr->index) { - case ATT_MB_MUX_CTRL: - reg = REG_MB_MUX_CTRL; - break; - default: - return -EINVAL; - } - return write_lpc_reg(reg, mask, buf, count); -} - -/* get bsp parameter value */ -static ssize_t read_bsp_callback(struct device *dev, - struct device_attribute *da, char *buf) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - int str_len=0; - char *str=NULL; - - switch (attr->index) { - case ATT_BSP_VERSION: - str = bsp_version; - str_len = sizeof(bsp_version); - break; - case ATT_BSP_DEBUG: - str = bsp_debug; - str_len = sizeof(bsp_debug); - break; - case ATT_BSP_REG: - str = bsp_reg; - str_len = sizeof(bsp_reg); - break; - default: - return -EINVAL; - } - return read_bsp(buf, str); -} - -/* set bsp parameter value */ -static ssize_t write_bsp_callback(struct device *dev, - struct device_attribute *da, const char *buf, size_t count) -{ - struct sensor_device_attribute *attr = to_sensor_dev_attr(da); - int str_len=0; - char *str=NULL; - u16 reg = 0; - u8 bsp_debug_u8 = 0; - - switch (attr->index) { - case ATT_BSP_VERSION: - str = bsp_version; - str_len = sizeof(str); - break; - case ATT_BSP_DEBUG: - str = bsp_debug; - str_len = sizeof(str); - break; - case ATT_BSP_REG: - if (kstrtou16(buf, 0, ®) < 0) - return -EINVAL; - - str = bsp_reg; - str_len = sizeof(str); - break; - default: - return -EINVAL; - } - - if (attr->index == ATT_BSP_DEBUG) { - if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { - return -EINVAL; - } else if (_config_bsp_log(bsp_debug_u8) < 0) { - return -EINVAL; - } - } - - return write_bsp(buf, str, str_len, count); -} - -//SENSOR_DEVICE_ATTR - CPU -static SENSOR_DEVICE_ATTR(cpu_cpld_version, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_CPLD_VERSION); -static SENSOR_DEVICE_ATTR(cpu_cpld_version_h, S_IRUGO, read_cpu_cpld_version_h, NULL, ATT_CPU_CPLD_VERSION_H); -static SENSOR_DEVICE_ATTR(boot_rom, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_BIOS_BOOT_ROM); -static SENSOR_DEVICE_ATTR(boot_cfg, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_BIOS_BOOT_CFG); -static SENSOR_DEVICE_ATTR(cpu_cpld_build, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_CPLD_BUILD); -//SENSOR_DEVICE_ATTR - MB -static SENSOR_DEVICE_ATTR(board_id_0, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_0); -static SENSOR_DEVICE_ATTR(board_id_1, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_1); -static SENSOR_DEVICE_ATTR(mb_cpld_1_version, S_IRUGO, read_lpc_callback, NULL, ATT_MB_CPLD_1_VERSION); -static SENSOR_DEVICE_ATTR(mb_cpld_1_version_h, S_IRUGO, read_mb_cpld_1_version_h, NULL, ATT_MB_CPLD_1_VERSION_H); -static SENSOR_DEVICE_ATTR(mb_cpld_1_build, S_IRUGO, read_lpc_callback, NULL, ATT_MB_CPLD_1_BUILD); -static SENSOR_DEVICE_ATTR(mux_ctrl, S_IRUGO | S_IWUSR, read_lpc_callback, write_lpc_callback, ATT_MB_MUX_CTRL); -static SENSOR_DEVICE_ATTR(mux_reset, S_IRUGO | S_IWUSR, read_mux_reset_callback, write_mux_reset_callback, ATT_MB_MUX_RESET); -static SENSOR_DEVICE_ATTR(board_sku_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_SKU_ID); -static SENSOR_DEVICE_ATTR(board_hw_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_HW_ID); -static SENSOR_DEVICE_ATTR(board_id_type, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_TYPE); -static SENSOR_DEVICE_ATTR(board_build_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_BUILD_ID); -static SENSOR_DEVICE_ATTR(board_deph_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_DEPH_ID); -//SENSOR_DEVICE_ATTR - I2C Alert -static SENSOR_DEVICE_ATTR(alert_status, S_IRUGO, read_lpc_callback, NULL, ATT_ALERT_STATUS); -#if CPU_TYPE == CPU_BDE -static SENSOR_DEVICE_ATTR(alert_disable, S_IRUGO, read_lpc_callback, NULL, ATT_ALERT_DISABLE); -#endif -//SENSOR_DEVICE_ATTR - BSP -static SENSOR_DEVICE_ATTR(bsp_version, S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_VERSION); -static SENSOR_DEVICE_ATTR(bsp_debug, S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_DEBUG); -static SENSOR_DEVICE_ATTR(bsp_reg, S_IRUGO | S_IWUSR, read_lpc_callback, write_bsp_callback, ATT_BSP_REG); - -static struct attribute *cpu_cpld_attrs[] = { - &sensor_dev_attr_cpu_cpld_version.dev_attr.attr, - &sensor_dev_attr_cpu_cpld_version_h.dev_attr.attr, - &sensor_dev_attr_cpu_cpld_build.dev_attr.attr, - NULL, -}; - -static struct attribute *mb_cpld_attrs[] = { - &sensor_dev_attr_board_id_0.dev_attr.attr, - &sensor_dev_attr_board_id_1.dev_attr.attr, - &sensor_dev_attr_mb_cpld_1_version.dev_attr.attr, - &sensor_dev_attr_mb_cpld_1_version_h.dev_attr.attr, - &sensor_dev_attr_mb_cpld_1_build.dev_attr.attr, - &sensor_dev_attr_board_sku_id.dev_attr.attr, - &sensor_dev_attr_board_hw_id.dev_attr.attr, - &sensor_dev_attr_board_id_type.dev_attr.attr, - &sensor_dev_attr_board_build_id.dev_attr.attr, - &sensor_dev_attr_board_deph_id.dev_attr.attr, - &sensor_dev_attr_mux_ctrl.dev_attr.attr, - &sensor_dev_attr_mux_reset.dev_attr.attr, - NULL, -}; - -static struct attribute *bios_attrs[] = { - &sensor_dev_attr_boot_rom.dev_attr.attr, - &sensor_dev_attr_boot_cfg.dev_attr.attr, - NULL, -}; - -static struct attribute *i2c_alert_attrs[] = { - &sensor_dev_attr_alert_status.dev_attr.attr, -#if CPU_TYPE == CPU_BDE - &sensor_dev_attr_alert_disable.dev_attr.attr, -#endif - NULL, -}; - -static struct attribute *bsp_attrs[] = { - &sensor_dev_attr_bsp_version.dev_attr.attr, - &sensor_dev_attr_bsp_debug.dev_attr.attr, - &sensor_dev_attr_bsp_reg.dev_attr.attr, - NULL, -}; - -static struct attribute_group cpu_cpld_attr_grp = { - .name = "cpu_cpld", - .attrs = cpu_cpld_attrs, -}; - -static struct attribute_group mb_cpld_attr_grp = { - .name = "mb_cpld", - .attrs = mb_cpld_attrs, -}; - -static struct attribute_group bios_attr_grp = { - .name = "bios", - .attrs = bios_attrs, -}; - -static struct attribute_group i2c_alert_attr_grp = { - .name = "i2c_alert", - .attrs = i2c_alert_attrs, -}; - -static struct attribute_group bsp_attr_grp = { - .name = "bsp", - .attrs = bsp_attrs, -}; - -static void lpc_dev_release( struct device * dev) -{ - return; -} - -static struct platform_device lpc_dev = { - .name = DRIVER_NAME, - .id = -1, - .dev = { - .release = lpc_dev_release, - } -}; - -static int lpc_drv_probe(struct platform_device *pdev) -{ - int i = 0, grp_num = 5; - int err[5] = {0}; - struct attribute_group *grp; - - lpc_data = devm_kzalloc(&pdev->dev, sizeof(struct lpc_data_s), - GFP_KERNEL); - if (!lpc_data) - return -ENOMEM; - - mutex_init(&lpc_data->access_lock); - - for (i=0; idev.kobj, grp); - if (err[i]) { - printk(KERN_ERR "Cannot create sysfs for group %s\n", grp->name); - goto exit; - } else { - continue; - } - } - - return 0; - -exit: - for (i=0; idev.kobj, grp); - if (!err[i]) { - //remove previous successful cases - continue; - } else { - //remove first failed case, then return - return err[i]; - } - } - return 0; -} - -static int lpc_drv_remove(struct platform_device *pdev) -{ - sysfs_remove_group(&pdev->dev.kobj, &cpu_cpld_attr_grp); - sysfs_remove_group(&pdev->dev.kobj, &mb_cpld_attr_grp); - sysfs_remove_group(&pdev->dev.kobj, &bios_attr_grp); - sysfs_remove_group(&pdev->dev.kobj, &i2c_alert_attr_grp); - sysfs_remove_group(&pdev->dev.kobj, &bsp_attr_grp); - - return 0; -} - -static struct platform_driver lpc_drv = { - .probe = lpc_drv_probe, - .remove = __exit_p(lpc_drv_remove), - .driver = { - .name = DRIVER_NAME, - }, -}; - -int lpc_init(void) -{ - int err = 0; - - err = platform_driver_register(&lpc_drv); - if (err) { - printk(KERN_ERR "%s(#%d): platform_driver_register failed(%d)\n", - __func__, __LINE__, err); - - return err; - } - - err = platform_device_register(&lpc_dev); - if (err) { - printk(KERN_ERR "%s(#%d): platform_device_register failed(%d)\n", - __func__, __LINE__, err); - platform_driver_unregister(&lpc_drv); - return err; - } - - return err; -} - -void lpc_exit(void) -{ - platform_driver_unregister(&lpc_drv); - platform_device_unregister(&lpc_dev); -} - -MODULE_AUTHOR("Leo Lin "); -MODULE_DESCRIPTION("x86_64_ufispace_s9300_32d_lpc driver"); -MODULE_LICENSE("GPL"); - -module_init(lpc_init); -module_exit(lpc_exit); +/* + * A lpc driver for the ufispace_s9300_32d + * + * Copyright (C) 2017-2020 UfiSpace Technology Corporation. + * Jason Tsai + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include + +#define BSP_LOG_R(fmt, args...) \ + _bsp_log (LOG_READ, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#define BSP_LOG_W(fmt, args...) \ + _bsp_log (LOG_WRITE, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) + +#define BSP_PR(level, fmt, args...) _bsp_log (LOG_SYS, level "[BSP]" fmt "\r\n", ##args) + +#define DRIVER_NAME "x86_64_ufispace_s9300_32d_lpc" +#define CPU_BDE 0 +#define CPU_SKY 1 +#define CPU_TYPE CPU_SKY + +/* LPC registers */ + +#define REG_BASE_CPU 0x600 + +#if CPU_TYPE == CPU_SKY +#define REG_BASE_MB 0xE00 +#define REG_BASE_I2C_ALERT 0x700 +#else +#define REG_BASE_MB 0x700 +#define REG_BASE_I2C_ALERT 0xF000 +#endif + +//CPU CPLD +#define REG_CPU_CPLD_VERSION (REG_BASE_CPU + 0x00) +#define REG_CPU_STATUS_0 (REG_BASE_CPU + 0x01) +#define REG_CPU_STATUS_1 (REG_BASE_CPU + 0x02) +#define REG_CPU_CTRL_0 (REG_BASE_CPU + 0x03) +#define REG_CPU_CTRL_1 (REG_BASE_CPU + 0x04) +#define REG_CPU_CPLD_BUILD (REG_BASE_CPU + 0xE0) + +//MB CPLD +//TBD, need to change after CPLD spec release +#define REG_MB_BRD_ID_0 (REG_BASE_MB + 0x00) +#define REG_MB_BRD_ID_1 (REG_BASE_MB + 0x01) +#define REG_MB_CPLD_VERSION (REG_BASE_MB + 0x02) +#define REG_MB_CPLD_BUILD (REG_BASE_MB + 0x04) +#define REG_MB_MUX_RESET (REG_BASE_MB + 0x46) +#define REG_MB_MUX_CTRL (REG_BASE_MB + 0x5c) + +//I2C Alert +#if CPU_TYPE == CPU_SKY +#define REG_ALERT_STATUS (REG_BASE_I2C_ALERT + 0x80) +#else +#define REG_ALERT_STATUS (REG_BASE_I2C_ALERT + 0x00) +#define REG_ALERT_DISABLE (REG_BASE_I2C_ALERT + 0x11) +#endif + +#define MASK_ALL (0xFF) +#define LPC_MDELAY (5) + +/* LPC sysfs attributes index */ +enum lpc_sysfs_attributes { + //CPU CPLD + ATT_CPU_CPLD_VERSION, + ATT_CPU_CPLD_VERSION_H, + ATT_CPU_BIOS_BOOT_ROM, + ATT_CPU_BIOS_BOOT_CFG, + ATT_CPU_CPLD_BUILD, + //MB CPLD + ATT_MB_BRD_ID_0, + ATT_MB_BRD_ID_1, + ATT_MB_CPLD_1_VERSION, + ATT_MB_CPLD_1_VERSION_H, + ATT_MB_CPLD_1_BUILD, + ATT_MB_MUX_CTRL, + ATT_MB_MUX_RESET, + ATT_MB_BRD_SKU_ID, + ATT_MB_BRD_HW_ID, + ATT_MB_BRD_ID_TYPE, + ATT_MB_BRD_BUILD_ID, + ATT_MB_BRD_DEPH_ID, + //I2C Alert + ATT_ALERT_STATUS, +#if CPU_TYPE == CPU_BDE + ATT_ALERT_DISABLE, +#endif + //BSP + ATT_BSP_VERSION, + ATT_BSP_DEBUG, + ATT_BSP_PR_INFO, + ATT_BSP_PR_ERR, + ATT_BSP_REG, + ATT_MAX +}; + +enum bsp_log_types { + LOG_NONE, + LOG_RW, + LOG_READ, + LOG_WRITE, + LOG_SYS +}; + +enum bsp_log_ctrl { + LOG_DISABLE, + LOG_ENABLE +}; + +struct lpc_data_s { + struct mutex access_lock; +}; + +struct lpc_data_s *lpc_data; +char bsp_version[16]=""; +char bsp_debug[2]="0"; +char bsp_reg[8]="0x0"; +u8 enable_log_read=LOG_DISABLE; +u8 enable_log_write=LOG_DISABLE; +u8 enable_log_sys=LOG_ENABLE; + +/* reg shift */ +static u8 _shift(u8 mask) +{ + int i=0, mask_one=1; + + for(i=0; i<8; ++i) { + if ((mask & mask_one) == 1) + return i; + else + mask >>= 1; + } + + return -1; +} + +/* reg mask and shift */ +static u8 _mask_shift(u8 val, u8 mask) +{ + int shift=0; + + shift = _shift(mask); + + return (val & mask) >> shift; +} + +static u8 _bit_operation(u8 reg_val, u8 bit, u8 bit_val) +{ + if (bit_val == 0) + reg_val = reg_val & ~(1 << bit); + else + reg_val = reg_val | (1 << bit); + return reg_val; +} + +static int _bsp_log(u8 log_type, char *fmt, ...) +{ + if ((log_type==LOG_READ && enable_log_read) || + (log_type==LOG_WRITE && enable_log_write) || + (log_type==LOG_SYS && enable_log_sys) ) { + va_list args; + int r; + + va_start(args, fmt); + r = vprintk(fmt, args); + va_end(args); + + return r; + } else { + return 0; + } +} + +static int _config_bsp_log(u8 log_type) +{ + switch(log_type) { + case LOG_NONE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_RW: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_ENABLE; + break; + case LOG_READ: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_WRITE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_ENABLE; + break; + default: + return -EINVAL; + } + return 0; +} + +/* get lpc register value */ +static u8 _read_lpc_reg(u16 reg, u8 mask) +{ + u8 reg_val; + + mutex_lock(&lpc_data->access_lock); + reg_val=_mask_shift(inb(reg), mask); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return reg_val; +} + +/* get lpc register value */ +static ssize_t read_lpc_reg(u16 reg, u8 mask, char *buf) +{ + u8 reg_val; + int len=0; + + reg_val = _read_lpc_reg(reg, mask); + len=sprintf(buf,"0x%x\n", reg_val); + + return len; +} + +/* set lpc register value */ +static ssize_t write_lpc_reg(u16 reg, u8 mask, const char *buf, size_t count) +{ + u8 reg_val, reg_val_now, shift; + + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + //apply SINGLE BIT operation if mask is specified, multiple bits are not supported + if (mask != MASK_ALL) { + reg_val_now = _read_lpc_reg(reg, 0x0); + shift = _shift(mask); + reg_val = _bit_operation(reg_val_now, shift, reg_val); + } + + mutex_lock(&lpc_data->access_lock); + + outb(reg_val, reg); + mdelay(LPC_MDELAY); + + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return count; +} + +/* get bsp value */ +static ssize_t read_bsp(char *buf, char *str) +{ + ssize_t len=0; + + mutex_lock(&lpc_data->access_lock); + len=sprintf(buf, "%s", str); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg_val=%s", str); + + return len; +} + +/* set bsp value */ +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count) +{ + mutex_lock(&lpc_data->access_lock); + snprintf(str, str_len, "%s", buf); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_W("reg_val=%s", str); + + return count; +} + +/* get cpu cpld version in human readable format */ +static ssize_t read_cpu_cpld_version_h(struct device *dev, + struct device_attribute *da, char *buf) +{ + ssize_t len=0; + u16 reg = REG_CPU_CPLD_VERSION; + u8 mask = MASK_ALL; + u8 mask_major = 0b11000000; + u8 mask_minor = 0b00111111; + u8 reg_val; + u8 major, minor, build; + + mutex_lock(&lpc_data->access_lock); + reg_val = _mask_shift(inb(reg), mask); + major = _mask_shift(reg_val, mask_major); + minor = _mask_shift(reg_val, mask_minor); + reg = REG_CPU_CPLD_BUILD; + build = _mask_shift(inb(reg), mask); + len = sprintf(buf, "%d.%02d.%03d\n", major, minor, build); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return len; +} + +/* get mb cpld version in human readable format */ +static ssize_t read_mb_cpld_1_version_h(struct device *dev, + struct device_attribute *da, char *buf) +{ + ssize_t len=0; + u16 reg = REG_MB_CPLD_VERSION; + u8 mask = MASK_ALL; + u8 mask_major = 0b11000000; + u8 mask_minor = 0b00111111; + u8 reg_val; + u8 major, minor, build; + + mutex_lock(&lpc_data->access_lock); + reg_val = _mask_shift(inb(reg), mask); + major = _mask_shift(reg_val, mask_major); + minor = _mask_shift(reg_val, mask_minor); + reg = REG_MB_CPLD_BUILD; + build = _mask_shift(inb(reg), mask); + len = sprintf(buf, "%d.%02d.%03d\n", major, minor, build); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return len; +} + +/* get mux_reset register value */ +static ssize_t read_mux_reset_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + int len = 0; + u16 reg = REG_MB_MUX_RESET; + u8 mask = 0b00011111; + u8 reg_val; + + mutex_lock(&lpc_data->access_lock); + reg_val=_mask_shift(inb(reg), mask); + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + len=sprintf(buf, "%d\n", reg_val); + mutex_unlock(&lpc_data->access_lock); + + return len; +} + +/* set mux_reset register value */ +static ssize_t write_mux_reset_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + u8 val = 0; + u16 reg = REG_MB_MUX_RESET; + u8 reg_val = 0; + u8 mask = 0b00011111; + static int mux_reset_flag = 0; + + if (kstrtou8(buf, 0, &val) < 0) + return -EINVAL; + + if (mux_reset_flag == 0) { + if (val == 0) { + mutex_lock(&lpc_data->access_lock); + mux_reset_flag = 1; + BSP_LOG_W("i2c mux reset is triggered..."); + + reg_val = inb(reg); + outb((reg_val & ~mask), reg); + mdelay(LPC_MDELAY); + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val & ~mask); + mdelay(500); + outb((reg_val | mask), reg); + mdelay(LPC_MDELAY); + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val | mask); + mdelay(500); + mux_reset_flag = 0; + mutex_unlock(&lpc_data->access_lock); + } else { + return -EINVAL; + } + } else { + BSP_LOG_W("i2c mux is resetting... (ignore)"); + mutex_lock(&lpc_data->access_lock); + mutex_unlock(&lpc_data->access_lock); + } + + return count; +} + +/* get lpc register value */ +static ssize_t read_lpc_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u16 reg = 0; + u8 mask = MASK_ALL; + + switch (attr->index) { + //CPU CPLD + case ATT_CPU_CPLD_VERSION: + reg = REG_CPU_CPLD_VERSION; + break; + case ATT_CPU_BIOS_BOOT_ROM: + reg = REG_CPU_STATUS_1; + mask = 0x80; + break; + case ATT_CPU_BIOS_BOOT_CFG: + reg = REG_CPU_CTRL_1; + mask = 0x80; + break; + case ATT_CPU_CPLD_BUILD: + reg = REG_CPU_CPLD_BUILD; + break; + //MB CPLD + case ATT_MB_BRD_ID_0: + reg = REG_MB_BRD_ID_0; + break; + case ATT_MB_BRD_ID_1: + reg = REG_MB_BRD_ID_1; + break; + case ATT_MB_CPLD_1_VERSION: + reg = REG_MB_CPLD_VERSION; + break; + case ATT_MB_CPLD_1_BUILD: + reg = REG_MB_CPLD_BUILD; + break; + case ATT_MB_BRD_SKU_ID: + reg = REG_MB_BRD_ID_0; + mask = 0xFF; + break; + case ATT_MB_BRD_HW_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x03; + break; + case ATT_MB_BRD_ID_TYPE: + reg = REG_MB_BRD_ID_1; + mask = 0x80; + break; + case ATT_MB_BRD_BUILD_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x38; + break; + case ATT_MB_BRD_DEPH_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x04; + break; + case ATT_MB_MUX_CTRL: + reg = REG_MB_MUX_CTRL; + break; + //I2C Alert + case ATT_ALERT_STATUS: + reg = REG_ALERT_STATUS; + mask = 0x20; + break; +#if CPU_TYPE == CPU_BDE + case ATT_ALERT_DISABLE: + reg = REG_ALERT_DISABLE; + mask = 0x04; + break; +#endif + //BSP + case ATT_BSP_REG: + if (kstrtou16(bsp_reg, 0, ®) < 0) + return -EINVAL; + break; + default: + return -EINVAL; + } + return read_lpc_reg(reg, mask, buf); +} + +/* set lpc register value */ +static ssize_t write_lpc_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u16 reg = 0; + u8 mask = MASK_ALL; + + switch (attr->index) { + case ATT_MB_MUX_CTRL: + reg = REG_MB_MUX_CTRL; + break; + default: + return -EINVAL; + } + return write_lpc_reg(reg, mask, buf, count); +} + +/* get bsp parameter value */ +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + + switch (attr->index) { + case ATT_BSP_VERSION: + str = bsp_version; + str_len = sizeof(bsp_version); + break; + case ATT_BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + case ATT_BSP_REG: + str = bsp_reg; + str_len = sizeof(bsp_reg); + break; + default: + return -EINVAL; + } + return read_bsp(buf, str); +} + +/* set bsp parameter value */ +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + u16 reg = 0; + u8 bsp_debug_u8 = 0; + + switch (attr->index) { + case ATT_BSP_VERSION: + str = bsp_version; + str_len = sizeof(bsp_version); + break; + case ATT_BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + case ATT_BSP_REG: + if (kstrtou16(buf, 0, ®) < 0) + return -EINVAL; + + str = bsp_reg; + str_len = sizeof(bsp_reg); + break; + default: + return -EINVAL; + } + + if (attr->index == ATT_BSP_DEBUG) { + if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { + return -EINVAL; + } else if (_config_bsp_log(bsp_debug_u8) < 0) { + return -EINVAL; + } + } + + return write_bsp(buf, str, str_len, count); +} + +static ssize_t write_bsp_pr_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len = strlen(buf); + + if(str_len <= 0) + return str_len; + + switch (attr->index) { + case ATT_BSP_PR_INFO: + BSP_PR(KERN_INFO, "%s", buf); + break; + case ATT_BSP_PR_ERR: + BSP_PR(KERN_ERR, "%s", buf); + break; + default: + return -EINVAL; + } + + return str_len; +} + +//SENSOR_DEVICE_ATTR - CPU +static SENSOR_DEVICE_ATTR(cpu_cpld_version, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_CPLD_VERSION); +static SENSOR_DEVICE_ATTR(cpu_cpld_version_h, S_IRUGO, read_cpu_cpld_version_h, NULL, ATT_CPU_CPLD_VERSION_H); +static SENSOR_DEVICE_ATTR(boot_rom, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_BIOS_BOOT_ROM); +static SENSOR_DEVICE_ATTR(boot_cfg, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_BIOS_BOOT_CFG); +static SENSOR_DEVICE_ATTR(cpu_cpld_build, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_CPLD_BUILD); +//SENSOR_DEVICE_ATTR - MB +static SENSOR_DEVICE_ATTR(board_id_0, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_0); +static SENSOR_DEVICE_ATTR(board_id_1, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_1); +static SENSOR_DEVICE_ATTR(mb_cpld_1_version, S_IRUGO, read_lpc_callback, NULL, ATT_MB_CPLD_1_VERSION); +static SENSOR_DEVICE_ATTR(mb_cpld_1_version_h, S_IRUGO, read_mb_cpld_1_version_h, NULL, ATT_MB_CPLD_1_VERSION_H); +static SENSOR_DEVICE_ATTR(mb_cpld_1_build, S_IRUGO, read_lpc_callback, NULL, ATT_MB_CPLD_1_BUILD); +static SENSOR_DEVICE_ATTR(mux_ctrl, S_IRUGO | S_IWUSR, read_lpc_callback, write_lpc_callback, ATT_MB_MUX_CTRL); +static SENSOR_DEVICE_ATTR(mux_reset, S_IRUGO | S_IWUSR, read_mux_reset_callback, write_mux_reset_callback, ATT_MB_MUX_RESET); +static SENSOR_DEVICE_ATTR(board_sku_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_SKU_ID); +static SENSOR_DEVICE_ATTR(board_hw_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_HW_ID); +static SENSOR_DEVICE_ATTR(board_id_type, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_TYPE); +static SENSOR_DEVICE_ATTR(board_build_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_BUILD_ID); +static SENSOR_DEVICE_ATTR(board_deph_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_DEPH_ID); +//SENSOR_DEVICE_ATTR - I2C Alert +static SENSOR_DEVICE_ATTR(alert_status, S_IRUGO, read_lpc_callback, NULL, ATT_ALERT_STATUS); +#if CPU_TYPE == CPU_BDE +static SENSOR_DEVICE_ATTR(alert_disable, S_IRUGO, read_lpc_callback, NULL, ATT_ALERT_DISABLE); +#endif +//SENSOR_DEVICE_ATTR - BSP +static SENSOR_DEVICE_ATTR(bsp_version, S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_VERSION); +static SENSOR_DEVICE_ATTR(bsp_debug, S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_DEBUG); +static SENSOR_DEVICE_ATTR(bsp_pr_info, S_IWUSR, NULL, write_bsp_pr_callback, ATT_BSP_PR_INFO); +static SENSOR_DEVICE_ATTR(bsp_pr_err, S_IWUSR, NULL, write_bsp_pr_callback, ATT_BSP_PR_ERR); +static SENSOR_DEVICE_ATTR(bsp_reg, S_IRUGO | S_IWUSR, read_lpc_callback, write_bsp_callback, ATT_BSP_REG); + +static struct attribute *cpu_cpld_attrs[] = { + &sensor_dev_attr_cpu_cpld_version.dev_attr.attr, + &sensor_dev_attr_cpu_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpu_cpld_build.dev_attr.attr, + NULL, +}; + +static struct attribute *mb_cpld_attrs[] = { + &sensor_dev_attr_board_id_0.dev_attr.attr, + &sensor_dev_attr_board_id_1.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_version.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_version_h.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_build.dev_attr.attr, + &sensor_dev_attr_board_sku_id.dev_attr.attr, + &sensor_dev_attr_board_hw_id.dev_attr.attr, + &sensor_dev_attr_board_id_type.dev_attr.attr, + &sensor_dev_attr_board_build_id.dev_attr.attr, + &sensor_dev_attr_board_deph_id.dev_attr.attr, + &sensor_dev_attr_mux_ctrl.dev_attr.attr, + &sensor_dev_attr_mux_reset.dev_attr.attr, + NULL, +}; + +static struct attribute *bios_attrs[] = { + &sensor_dev_attr_boot_rom.dev_attr.attr, + &sensor_dev_attr_boot_cfg.dev_attr.attr, + NULL, +}; + +static struct attribute *i2c_alert_attrs[] = { + &sensor_dev_attr_alert_status.dev_attr.attr, +#if CPU_TYPE == CPU_BDE + &sensor_dev_attr_alert_disable.dev_attr.attr, +#endif + NULL, +}; + +static struct attribute *bsp_attrs[] = { + &sensor_dev_attr_bsp_version.dev_attr.attr, + &sensor_dev_attr_bsp_debug.dev_attr.attr, + &sensor_dev_attr_bsp_pr_info.dev_attr.attr, + &sensor_dev_attr_bsp_pr_err.dev_attr.attr, + &sensor_dev_attr_bsp_reg.dev_attr.attr, + NULL, +}; + +static struct attribute_group cpu_cpld_attr_grp = { + .name = "cpu_cpld", + .attrs = cpu_cpld_attrs, +}; + +static struct attribute_group mb_cpld_attr_grp = { + .name = "mb_cpld", + .attrs = mb_cpld_attrs, +}; + +static struct attribute_group bios_attr_grp = { + .name = "bios", + .attrs = bios_attrs, +}; + +static struct attribute_group i2c_alert_attr_grp = { + .name = "i2c_alert", + .attrs = i2c_alert_attrs, +}; + +static struct attribute_group bsp_attr_grp = { + .name = "bsp", + .attrs = bsp_attrs, +}; + +static void lpc_dev_release( struct device * dev) +{ + return; +} + +static struct platform_device lpc_dev = { + .name = DRIVER_NAME, + .id = -1, + .dev = { + .release = lpc_dev_release, + } +}; + +static int lpc_drv_probe(struct platform_device *pdev) +{ + int i = 0, grp_num = 5; + int err[5] = {0}; + struct attribute_group *grp; + + lpc_data = devm_kzalloc(&pdev->dev, sizeof(struct lpc_data_s), + GFP_KERNEL); + if (!lpc_data) + return -ENOMEM; + + mutex_init(&lpc_data->access_lock); + + for (i=0; idev.kobj, grp); + if (err[i]) { + printk(KERN_ERR "Cannot create sysfs for group %s\n", grp->name); + goto exit; + } else { + continue; + } + } + + return 0; + +exit: + for (i=0; idev.kobj, grp); + if (!err[i]) { + //remove previous successful cases + continue; + } else { + //remove first failed case, then return + return err[i]; + } + } + return 0; +} + +static int lpc_drv_remove(struct platform_device *pdev) +{ + sysfs_remove_group(&pdev->dev.kobj, &cpu_cpld_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &mb_cpld_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &bios_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &i2c_alert_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &bsp_attr_grp); + + return 0; +} + +static struct platform_driver lpc_drv = { + .probe = lpc_drv_probe, + .remove = __exit_p(lpc_drv_remove), + .driver = { + .name = DRIVER_NAME, + }, +}; + +int lpc_init(void) +{ + int err = 0; + + err = platform_driver_register(&lpc_drv); + if (err) { + printk(KERN_ERR "%s(#%d): platform_driver_register failed(%d)\n", + __func__, __LINE__, err); + + return err; + } + + err = platform_device_register(&lpc_dev); + if (err) { + printk(KERN_ERR "%s(#%d): platform_device_register failed(%d)\n", + __func__, __LINE__, err); + platform_driver_unregister(&lpc_drv); + return err; + } + + return err; +} + +void lpc_exit(void) +{ + platform_driver_unregister(&lpc_drv); + platform_device_unregister(&lpc_dev); +} + +MODULE_AUTHOR("Leo Lin "); +MODULE_DESCRIPTION("x86_64_ufispace_s9300_32d_lpc driver"); +MODULE_LICENSE("GPL"); + +module_init(lpc_init); +module_exit(lpc_exit); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-sys-eeprom.c b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-sys-eeprom.c index 225a8c50d636..fae50d0b0e46 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-sys-eeprom.c +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/modules/x86-64-ufispace-s9300-32d-sys-eeprom.c @@ -1,273 +1,283 @@ -/* - * Copyright (C) 1998, 1999 Frodo Looijaard and - * Philip Edelbrock - * Copyright (C) 2003 Greg Kroah-Hartman - * Copyright (C) 2003 IBM Corp. - * Copyright (C) 2004 Jean Delvare - * - * 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. - */ - -/* enable dev_dbg print out */ -//#define DEBUG - -#define __STDC_WANT_LIB_EXT1__ 1 -#include -#include -#include -#include -#include -#include -#include - -/* Addresses to scan */ -static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54, - 0x55, 0x56, 0x57,*/ I2C_CLIENT_END }; - -/* Size of EEPROM in bytes */ -#define EEPROM_SIZE 512 - -#define SLICE_BITS (6) -#define SLICE_SIZE (1 << SLICE_BITS) -#define SLICE_NUM (EEPROM_SIZE/SLICE_SIZE) - -/* Each client has this additional data */ -struct eeprom_data { - struct mutex update_lock; - u8 valid; /* bitfield, bit!=0 if slice is valid */ - unsigned long last_updated[SLICE_NUM]; /* In jiffies, 8 slices */ - u8 data[EEPROM_SIZE]; /* Register values */ -}; - - -static void sys_eeprom_update_client(struct i2c_client *client, u8 slice) -{ - struct eeprom_data *data = i2c_get_clientdata(client); - int i, j; - int ret; - int addr; - - mutex_lock(&data->update_lock); - - if (!(data->valid & (1 << slice)) || - time_after(jiffies, data->last_updated[slice] + 300 * HZ)) { - dev_dbg(&client->dev, "Starting eeprom update, slice %u\n", slice); - - addr = slice << SLICE_BITS; - - ret = i2c_smbus_write_byte_data(client, (u8)((addr >> 8) & 0xFF), (u8)(addr & 0xFF)); - /* select the eeprom address */ - if (ret < 0) { - dev_err(&client->dev, "address set failed\n"); - goto exit; - } - - if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_BYTE)) { - goto exit; - } - - for (i = slice << SLICE_BITS; i < (slice + 1) << SLICE_BITS; i+= SLICE_SIZE) { - for (j = i; j < (i+SLICE_SIZE); j++) { - int res; - - res = i2c_smbus_read_byte(client); - if (res < 0) { - goto exit; - } - - data->data[j] = res & 0xFF; - } - } - - data->last_updated[slice] = jiffies; - data->valid |= (1 << slice); - } -exit: - mutex_unlock(&data->update_lock); -} - -static ssize_t sys_eeprom_read(struct file *filp, struct kobject *kobj, - struct bin_attribute *bin_attr, - char *buf, loff_t off, size_t count) -{ - struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); - struct eeprom_data *data = i2c_get_clientdata(client); - u8 slice; - - if (off > EEPROM_SIZE) { - return 0; - } - if (off + count > EEPROM_SIZE) { - count = EEPROM_SIZE - off; - } - if (count == 0) { - return 0; - } - - /* Only refresh slices which contain requested bytes */ - for (slice = off >> SLICE_BITS; slice <= (off + count - 1) >> SLICE_BITS; slice++) { - sys_eeprom_update_client(client, slice); - } - - memcpy(buf, &data->data[off], count); - - return count; -} - -static ssize_t sys_eeprom_write(struct file *filp, struct kobject *kobj, - struct bin_attribute *bin_attr, - char *buf, loff_t off, size_t count) -{ - struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); - struct eeprom_data *data = i2c_get_clientdata(client); - int ret; - int i; - u8 cmd; - u16 value16; - - dev_dbg(&client->dev, "sys_eeprom_write off=%d, count=%d\n", (int)off, (int)count); - - if (off > EEPROM_SIZE) { - return 0; - } - if (off + count > EEPROM_SIZE) { - count = EEPROM_SIZE - off; - } - if (count == 0) { - return 0; - } - - mutex_lock(&data->update_lock); - - for(i=0; i < count; i++) { - /* write command */ - cmd = (off >> 8) & 0xff; - value16 = off & 0xff; - value16 |= buf[i] << 8; - ret = i2c_smbus_write_word_data(client, cmd, value16); - - if (ret < 0) { - dev_err(&client->dev, "write address failed at %d \n", (int)off); - goto exit; - } - - off++; - - /* need to wait for write complete */ - udelay(10000); - } -exit: - mutex_unlock(&data->update_lock); - /* force to update client when reading */ - for(i=0; i < SLICE_NUM; i++) { - data->last_updated[i] = 0; - } - - return count; -} - -static struct bin_attribute sys_eeprom_attr = { - .attr = { - .name = "eeprom", - .mode = S_IRUGO | S_IWUSR, - }, - .size = EEPROM_SIZE, - .read = sys_eeprom_read, - .write = sys_eeprom_write, -}; - -/* Return 0 if detection is successful, -ENODEV otherwise */ -static int sys_eeprom_detect(struct i2c_client *client, struct i2c_board_info *info) -{ - struct i2c_adapter *adapter = client->adapter; - - /* EDID EEPROMs are often 24C00 EEPROMs, which answer to all - addresses 0x50-0x57, but we only care about 0x51 and 0x55. So decline - attaching to addresses >= 0x56 on DDC buses */ - if (!(adapter->class & I2C_CLASS_SPD) && client->addr >= 0x56) { - return -ENODEV; - } - - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE) - && !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { - return -ENODEV; - } - - strlcpy(info->type, "eeprom", I2C_NAME_SIZE); - - return 0; -} - -static int sys_eeprom_probe(struct i2c_client *client, - const struct i2c_device_id *id) -{ - struct eeprom_data *data; - int err; - - if (!(data = kzalloc(sizeof(struct eeprom_data), GFP_KERNEL))) { - err = -ENOMEM; - goto exit; - } - -#ifdef __STDC_LIB_EXT1__ - memset_s(data->data, EEPROM_SIZE, 0xff, EEPROM_SIZE); -#else - memset(data->data, 0xff, EEPROM_SIZE); -#endif - - i2c_set_clientdata(client, data); - mutex_init(&data->update_lock); - - /* create the sysfs eeprom file */ - err = sysfs_create_bin_file(&client->dev.kobj, &sys_eeprom_attr); - if (err) { - goto exit_kfree; - } - - return 0; - -exit_kfree: - kfree(data); -exit: - return err; -} - -static int sys_eeprom_remove(struct i2c_client *client) -{ - sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr); - kfree(i2c_get_clientdata(client)); - - return 0; -} - -static const struct i2c_device_id sys_eeprom_id[] = { - { "sys_eeprom", 0 }, - { } -}; - -static struct i2c_driver sys_eeprom_driver = { - .driver = { - .name = "sys_eeprom", - }, - .probe = sys_eeprom_probe, - .remove = sys_eeprom_remove, - .id_table = sys_eeprom_id, - - .class = I2C_CLASS_DDC | I2C_CLASS_SPD, - .detect = sys_eeprom_detect, - .address_list = normal_i2c, -}; - -module_i2c_driver(sys_eeprom_driver); - -MODULE_AUTHOR("Wade "); -MODULE_DESCRIPTION("UfiSpace Mother Board EEPROM driver"); -MODULE_LICENSE("GPL"); +/* + * Copyright (C) 1998, 1999 Frodo Looijaard and + * Philip Edelbrock + * Copyright (C) 2003 Greg Kroah-Hartman + * Copyright (C) 2003 IBM Corp. + * Copyright (C) 2004 Jean Delvare + * + * 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. + */ + +/* enable dev_dbg print out */ +//#define DEBUG + +#define __STDC_WANT_LIB_EXT1__ 1 +#include +#include +#include +#include +#include +#include +#include +#include + +#define _memset(s, c, n) memset(s, c, n) + +/* Addresses to scan */ +static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54, + 0x55, 0x56, 0x57,*/ I2C_CLIENT_END }; + +/* Size of EEPROM in bytes */ +#define EEPROM_SIZE 512 + +#define SLICE_BITS (6) +#define SLICE_SIZE (1 << SLICE_BITS) +#define SLICE_NUM (EEPROM_SIZE/SLICE_SIZE) + +/* Each client has this additional data */ +struct eeprom_data { + struct mutex update_lock; + u8 valid; /* bitfield, bit!=0 if slice is valid */ + unsigned long last_updated[SLICE_NUM]; /* In jiffies, 8 slices */ + u8 data[EEPROM_SIZE]; /* Register values */ +}; + + +static void sys_eeprom_update_client(struct i2c_client *client, u8 slice) +{ + struct eeprom_data *data = i2c_get_clientdata(client); + int i, j; + int ret; + int addr; + + mutex_lock(&data->update_lock); + + if (!(data->valid & (1 << slice)) || + time_after(jiffies, data->last_updated[slice] + 300 * HZ)) { + dev_dbg(&client->dev, "Starting eeprom update, slice %u\n", slice); + + addr = slice << SLICE_BITS; + + ret = i2c_smbus_write_byte_data(client, (u8)((addr >> 8) & 0xFF), (u8)(addr & 0xFF)); + /* select the eeprom address */ + if (ret < 0) { + dev_err(&client->dev, "address set failed\n"); + goto exit; + } + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_BYTE)) { + goto exit; + } + + for (i = slice << SLICE_BITS; i < (slice + 1) << SLICE_BITS; i+= SLICE_SIZE) { + for (j = i; j < (i+SLICE_SIZE); j++) { + int res; + + res = i2c_smbus_read_byte(client); + if (res < 0) { + goto exit; + } + + data->data[j] = res & 0xFF; + } + } + + data->last_updated[slice] = jiffies; + data->valid |= (1 << slice); + } +exit: + mutex_unlock(&data->update_lock); +} + +static ssize_t sys_eeprom_read(struct file *filp, struct kobject *kobj, + struct bin_attribute *bin_attr, + char *buf, loff_t off, size_t count) +{ + struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); + struct eeprom_data *data = i2c_get_clientdata(client); + u8 slice; + + if (off > EEPROM_SIZE) { + return 0; + } + if (off + count > EEPROM_SIZE) { + count = EEPROM_SIZE - off; + } + if (count == 0) { + return 0; + } + + /* Only refresh slices which contain requested bytes */ + for (slice = off >> SLICE_BITS; slice <= (off + count - 1) >> SLICE_BITS; slice++) { + sys_eeprom_update_client(client, slice); + } + + memcpy(buf, &data->data[off], count); + + return count; +} + +static ssize_t sys_eeprom_write(struct file *filp, struct kobject *kobj, + struct bin_attribute *bin_attr, + char *buf, loff_t off, size_t count) +{ + struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); + struct eeprom_data *data = i2c_get_clientdata(client); + int ret; + int i; + u8 cmd; + u16 value16; + + dev_dbg(&client->dev, "sys_eeprom_write off=%d, count=%d\n", (int)off, (int)count); + + if (off > EEPROM_SIZE) { + return 0; + } + if (off + count > EEPROM_SIZE) { + count = EEPROM_SIZE - off; + } + if (count == 0) { + return 0; + } + + mutex_lock(&data->update_lock); + + for(i=0; i < count; i++) { + /* write command */ + cmd = (off >> 8) & 0xff; + value16 = off & 0xff; + value16 |= buf[i] << 8; + ret = i2c_smbus_write_word_data(client, cmd, value16); + + if (ret < 0) { + dev_err(&client->dev, "write address failed at %d \n", (int)off); + goto exit; + } + + off++; + + /* need to wait for write complete */ + udelay(10000); + } +exit: + mutex_unlock(&data->update_lock); + /* force to update client when reading */ + for(i=0; i < SLICE_NUM; i++) { + data->last_updated[i] = 0; + } + + return count; +} + +static struct bin_attribute sys_eeprom_attr = { + .attr = { + .name = "eeprom", + .mode = S_IRUGO | S_IWUSR, + }, + .size = EEPROM_SIZE, + .read = sys_eeprom_read, + .write = sys_eeprom_write, +}; + +/* Return 0 if detection is successful, -ENODEV otherwise */ +static int sys_eeprom_detect(struct i2c_client *client, struct i2c_board_info *info) +{ + struct i2c_adapter *adapter = client->adapter; + + /* EDID EEPROMs are often 24C00 EEPROMs, which answer to all + addresses 0x50-0x57, but we only care about 0x51 and 0x55. So decline + attaching to addresses >= 0x56 on DDC buses */ + if (!(adapter->class & I2C_CLASS_SPD) && client->addr >= 0x56) { + return -ENODEV; + } + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE) + && !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { + return -ENODEV; + } + + strlcpy(info->type, "eeprom", I2C_NAME_SIZE); + + return 0; +} + +static int sys_eeprom_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct eeprom_data *data; + int err; + + if (!(data = kzalloc(sizeof(struct eeprom_data), GFP_KERNEL))) { + err = -ENOMEM; + goto exit; + } + +#ifdef __STDC_LIB_EXT1__ + memset_s(data->data, EEPROM_SIZE, 0xff, EEPROM_SIZE); +#else + _memset(data->data, 0xff, EEPROM_SIZE); +#endif + + i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + + /* create the sysfs eeprom file */ + err = sysfs_create_bin_file(&client->dev.kobj, &sys_eeprom_attr); + if (err) { + goto exit_kfree; + } + + return 0; + +exit_kfree: + kfree(data); +exit: + return err; +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +sys_eeprom_remove(struct i2c_client *client) +{ + sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr); + kfree(i2c_get_clientdata(client)); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) + return 0; +#endif +} + +static const struct i2c_device_id sys_eeprom_id[] = { + { "sys_eeprom", 0 }, + { } +}; + +static struct i2c_driver sys_eeprom_driver = { + .driver = { + .name = "sys_eeprom", + }, + .probe = sys_eeprom_probe, + .remove = sys_eeprom_remove, + .id_table = sys_eeprom_id, + + .class = I2C_CLASS_DDC | I2C_CLASS_SPD, + .detect = sys_eeprom_detect, + .address_list = normal_i2c, +}; + +module_i2c_driver(sys_eeprom_driver); + +MODULE_AUTHOR("Wade "); +MODULE_DESCRIPTION("UfiSpace Mother Board EEPROM driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/chassis.py index 267add0756d1..3f02f73daa8a 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/chassis.py @@ -9,6 +9,7 @@ try: import time from sonic_platform_pddf_base.pddf_chassis import PddfChassis + from sonic_py_common import device_info except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -174,4 +175,15 @@ def get_reboot_cause(self): except IOError: sw_reboot_cause = "Unknown" - return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) \ No newline at end of file + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this + chassis. + """ + + return self.get_serial() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/component.py index f3346725c667..b94a10d616d6 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/component.py @@ -18,9 +18,7 @@ } BMC_CMDS = { - "VER1": "ipmitool mc info | grep 'Firmware Revision' | cut -d':' -f2 | cut -d'.' -f1", - "VER2": "ipmitool mc info | grep 'Firmware Revision' | cut -d':' -f2 | cut -d'.' -f2", - "VER3": "echo $((`ipmitool mc info | grep 'Aux Firmware Rev Info' -A 2 | sed -n '2p'` + 0))", + "BMC": "bash -c 'tmp=$(ipmitool raw 0x6 0x1) && r=($(echo \"$tmp\" | cut -d \" \" -f 4,5,16,15,14)) && echo ${r[0]}.${r[1]}.${r[4]}.${r[3]}${r[2]}'", } BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" @@ -83,17 +81,11 @@ def _get_cpld_version(self): def _get_bmc_version(self): # Retrieves the BMC firmware version - bmc_ver = dict() - for ver in BMC_CMDS: - status, value = subprocess.getstatusoutput(BMC_CMDS[ver]) - if not status: - bmc_ver[ver] = int(value.rstrip()) - else: - return None - - bmc_version = "{}.{}.{}".format(bmc_ver["VER1"], bmc_ver["VER2"], bmc_ver["VER3"]) - - return bmc_version + status, value = subprocess.getstatusoutput(BMC_CMDS["BMC"]) + if not status: + return value + else: + return None def get_name(self): """ diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan.py index 6b99493ecb41..a2ef7be03721 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/fan.py @@ -135,7 +135,11 @@ def get_presence(self): mode = output['mode'] val = output['status'].strip() - vmap = self.plugin_data['FAN']['present'][mode]['valmap'] + + if self.is_psu_fan: + vmap = self.plugin_data['PSU']['psu_present'][mode]['valmap'] + else: + vmap = self.plugin_data['FAN']['present'][mode]['valmap'] if val in vmap: presence = vmap[val] diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/psu.py index 29319e424b4d..3e213415f314 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/psu.py @@ -10,7 +10,7 @@ class Psu(PddfPsu): """PDDF Platform-Specific PSU class""" - PLATFORM_PSU_CAPACITY = 2000 + PLATFORM_PSU_CAPACITY = 1300 def __init__(self, index, pddf_data=None, pddf_plugin_data=None): PddfPsu.__init__(self, index, pddf_data, pddf_plugin_data) @@ -36,3 +36,21 @@ def get_power(self): # power is returned in micro watts return round(float(self.get_voltage()*self.get_current()), 2) + + def get_capacity(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return self.get_maximum_supplied_power() + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + return self.plugin_data['PSU']['DEFAULT_TYPE'] \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/sfp.py index d9b6e491bef4..c7919482f69c 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/sfp.py @@ -13,5 +13,19 @@ class Sfp(PddfSfp): def __init__(self, index, pddf_data=None, pddf_plugin_data=None): PddfSfp.__init__(self, index, pddf_data, pddf_plugin_data) + self.index = index # Provide the functions/variables below for which implementation is to be overwritten + + def get_error_description(self): + """ + Retrives the error descriptions of the SFP module + Returns: + String that represents the current error descriptions of vendor specific errors + In case there are multiple errors, they should be joined by '|', + like: "Bad EEPROM|Unsupported cable" + """ + if not self.get_presence(): + return self.SFP_STATUS_UNPLUGGED + + return self.SFP_STATUS_OK diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_device_create.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_device_create.sh index 69e75aeef28d..e4de7ae3669e 100755 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_device_create.sh +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_post_device_create.sh @@ -1,3 +1,6 @@ #!/bin/bash +#disable bmc watchdog +timeout 3 ipmitool mc watchdog off + echo 1 > /sys/kernel/pddf/devices/sysstatus/sysstatus_data/port_led_clr_ctrl echo "PDDF device post-create completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_pre_driver_install.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_pre_driver_install.sh deleted file mode 100755 index 52bcb3962ea3..000000000000 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/utils/pddf_pre_driver_install.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -#rmmod gpio_ich -if [ ! -f /tmp/._pddf_pre_driver_init_completion ]; then - # make sure igb/i40e init in correct order - rmmod i40e - rmmod igb - modprobe igb - modprobe i40e - date > /tmp/._pddf_pre_driver_init_completion -fi -echo "PDDF driver pre-install completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/Makefile b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/Makefile new file mode 100644 index 000000000000..0f44e14f033b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/Makefile @@ -0,0 +1,6 @@ + +MODULE_NAME = x86-64-ufispace-s9301-32d-cpld.o x86-64-ufispace-s9301-32d-sys-eeprom.o x86-64-ufispace-s9301-32d-lpc.o pddf_custom_sysstatus_module.o +obj-m := $(MODULE_NAME) + +CFLAGS_pddf_custom_sysstatus_module.o := -I$(M)/../../../../pddf/i2c/modules/include +KBUILD_EXTRA_SYMBOLS := $(M)/../../../../pddf/i2c/Module.symvers.PDDF diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/pddf_custom_sysstatus_module.c b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/pddf_custom_sysstatus_module.c new file mode 100644 index 000000000000..b61219c0088d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/pddf_custom_sysstatus_module.c @@ -0,0 +1,266 @@ +/* + * Copyright 2019 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * 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. + * + * + * A pddf kernel module for system status registers + */ + +#define __STDC_WANT_LIB_EXT1__ 1 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../../../../pddf/i2c/modules/include/pddf_client_defs.h" +#include "../../../../pddf/i2c/modules/include/pddf_sysstatus_defs.h" + +#define _memset(s, c, n) memset(s, c, n) + +SYSSTATUS_DATA sysstatus_data = {0}; + +extern int board_i2c_cpld_read(unsigned short cpld_addr, u8 reg); +extern int board_i2c_cpld_write(unsigned short cpld_addr, u8 reg, u8 value); + +static ssize_t do_attr_operation(struct device *dev, struct device_attribute *da, const char *buf, size_t count); +ssize_t show_sysstatus_data(struct device *dev, struct device_attribute *da, char *buf); +ssize_t store_sysstatus_data(struct device *dev, struct device_attribute *da, const char *buf, size_t count); + + +PDDF_DATA_ATTR(attr_name, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_CHAR, 32, + (void*)&sysstatus_data.sysstatus_addr_attr.aname, NULL); +PDDF_DATA_ATTR(attr_devaddr, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.devaddr , NULL); +PDDF_DATA_ATTR(attr_offset, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.offset, NULL); +PDDF_DATA_ATTR(attr_mask, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.mask , NULL); +PDDF_DATA_ATTR(attr_len, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.len , NULL); +PDDF_DATA_ATTR(attr_ops, S_IWUSR, NULL, do_attr_operation, PDDF_CHAR, 8, (void*)&sysstatus_data, NULL); + + + +static struct attribute *sysstatus_addr_attributes[] = { + &attr_attr_name.dev_attr.attr, + &attr_attr_devaddr.dev_attr.attr, + &attr_attr_offset.dev_attr.attr, + &attr_attr_mask.dev_attr.attr, + &attr_attr_len.dev_attr.attr, + &attr_attr_ops.dev_attr.attr, + NULL +}; + +PDDF_DATA_ATTR(board_info, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(cpld1_version, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(cpld2_version, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(cpld3_version, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(mac_reset, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(mux_reset, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(psu_status, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(system_led_0, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(system_led_1, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(beacon_led, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(port_led_clr_ctrl, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); + +static struct attribute *sysstatus_data_attributes[] = { + &attr_board_info.dev_attr.attr, + &attr_cpld1_version.dev_attr.attr, + &attr_cpld2_version.dev_attr.attr, + &attr_cpld3_version.dev_attr.attr, + &attr_mac_reset.dev_attr.attr, + &attr_mux_reset.dev_attr.attr, + &attr_psu_status.dev_attr.attr, + &attr_system_led_0.dev_attr.attr, + &attr_system_led_1.dev_attr.attr, + &attr_beacon_led.dev_attr.attr, + &attr_port_led_clr_ctrl.dev_attr.attr, + NULL +}; + + +static const struct attribute_group pddf_sysstatus_addr_group = { + .attrs = sysstatus_addr_attributes, +}; + + +static const struct attribute_group pddf_sysstatus_data_group = { + .attrs = sysstatus_data_attributes, +}; + + +static struct kobject *sysstatus_addr_kobj; +static struct kobject *sysstatus_data_kobj; + + + +ssize_t show_sysstatus_data(struct device *dev, struct device_attribute *da, char *buf) +{ + + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + + SYSSTATUS_DATA *data = &sysstatus_data; + struct SYSSTATUS_ADDR_ATTR *sysstatus_addr_attrs = NULL; + int i, status ; + + + for (i=0;isysstatus_addr_attrs[i].aname, attr->dev_attr.attr.name) == 0 ) + { + sysstatus_addr_attrs = &data->sysstatus_addr_attrs[i]; + + } + } + + if (sysstatus_addr_attrs==NULL ) + { + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); + status = 0; + } + else + { + status = board_i2c_cpld_read( sysstatus_addr_attrs->devaddr, sysstatus_addr_attrs->offset); + } + + return sprintf(buf, "0x%x\n", (status&sysstatus_addr_attrs->mask)); + +} + +ssize_t store_sysstatus_data(struct device *dev, struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + + SYSSTATUS_DATA *data = &sysstatus_data; + struct SYSSTATUS_ADDR_ATTR *sysstatus_addr_attrs = NULL; + int i, status ; + u8 reg_val; + + for (i=0;isysstatus_addr_attrs[i].aname, attr->dev_attr.attr.name) == 0 ) + { + sysstatus_addr_attrs = &data->sysstatus_addr_attrs[i]; + } + } + + if (sysstatus_addr_attrs==NULL) + { + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); + return -EINVAL; + } + else + { + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + status = board_i2c_cpld_write(sysstatus_addr_attrs->devaddr, sysstatus_addr_attrs->offset, reg_val); + + if (status!=0) + { + printk(KERN_DEBUG "store_sysstatus_data() %s failed, status=%d\n",data->sysstatus_addr_attrs[i].aname, status); + return status; + } + } + + return count; +} + + + +static ssize_t do_attr_operation(struct device *dev, struct device_attribute *da, const char *buf, size_t count) +{ + PDDF_ATTR *ptr = (PDDF_ATTR *)da; + SYSSTATUS_DATA *pdata = (SYSSTATUS_DATA *)(ptr->addr); + + pdata->sysstatus_addr_attrs[pdata->len] = pdata->sysstatus_addr_attr; + pdata->len++; + pddf_dbg(SYSSTATUS, KERN_ERR "%s: Populating the data for %s\n", __FUNCTION__, pdata->sysstatus_addr_attr.aname); +#ifdef __STDC_LIB_EXT1__ + memset_s(&pdata->sysstatus_addr_attr, sizeof(pdata->sysstatus_addr_attr), 0, sizeof(pdata->sysstatus_addr_attr)); +#else + _memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); +#endif + + return count; +} + + + + +int __init sysstatus_data_init(void) +{ + struct kobject *device_kobj; + int ret = 0; + + + pddf_dbg(SYSSTATUS, "PDDF SYSSTATUS MODULE.. init\n"); + + device_kobj = get_device_i2c_kobj(); + if(!device_kobj) + return -ENOMEM; + + sysstatus_addr_kobj = kobject_create_and_add("sysstatus", device_kobj); + if(!sysstatus_addr_kobj) + return -ENOMEM; + + sysstatus_data_kobj = kobject_create_and_add("sysstatus_data", sysstatus_addr_kobj); + if(!sysstatus_data_kobj) + return -ENOMEM; + + + ret = sysfs_create_group(sysstatus_addr_kobj, &pddf_sysstatus_addr_group); + if (ret) + { + kobject_put(sysstatus_addr_kobj); + return ret; + } + + ret = sysfs_create_group(sysstatus_data_kobj, &pddf_sysstatus_data_group); + if (ret) + { + sysfs_remove_group(sysstatus_addr_kobj, &pddf_sysstatus_addr_group); + kobject_put(sysstatus_data_kobj); + kobject_put(sysstatus_addr_kobj); + return ret; + } + + + return ret; +} + +void __exit sysstatus_data_exit(void) +{ + pddf_dbg(SYSSTATUS, "PDDF SYSSTATUS MODULE.. exit\n"); + sysfs_remove_group(sysstatus_data_kobj, &pddf_sysstatus_data_group); + sysfs_remove_group(sysstatus_addr_kobj, &pddf_sysstatus_addr_group); + kobject_put(sysstatus_data_kobj); + kobject_put(sysstatus_addr_kobj); + pddf_dbg(SYSSTATUS, KERN_ERR "%s: Removed the kobjects for 'SYSSTATUS'\n",__FUNCTION__); + return; +} + +module_init(sysstatus_data_init); +module_exit(sysstatus_data_exit); + +MODULE_AUTHOR("Broadcom"); +MODULE_DESCRIPTION("SYSSTATUS platform data"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-cpld.c b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-cpld.c new file mode 100644 index 000000000000..39e85e880b86 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-cpld.c @@ -0,0 +1,1646 @@ +/* + * A i2c cpld driver for the ufispace_s9301_32d + * + * Copyright (C) 2017-2019 UfiSpace Technology Corporation. + * Jason Tsai + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "x86-64-ufispace-s9301-32d-cpld.h" + +#ifdef DEBUG +#define DEBUG_PRINT(fmt, args...) \ + printk(KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#else +#define DEBUG_PRINT(fmt, args...) +#endif + +#define BSP_LOG_R(fmt, args...) \ + _bsp_log (LOG_READ, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#define BSP_LOG_W(fmt, args...) \ + _bsp_log (LOG_WRITE, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) + +#define I2C_READ_BYTE_DATA(ret, lock, i2c_client, reg) \ +{ \ + mutex_lock(lock); \ + ret = i2c_smbus_read_byte_data(i2c_client, reg); \ + mutex_unlock(lock); \ + BSP_LOG_R("cpld[%d], reg=0x%03x, reg_val=0x%02x", data->index, reg, ret); \ +} +#define I2C_WRITE_BYTE_DATA(ret, lock, i2c_client, reg, val) \ +{ \ + mutex_lock(lock); \ + ret = i2c_smbus_write_byte_data(i2c_client, reg, val); \ + mutex_unlock(lock); \ + BSP_LOG_W("cpld[%d], reg=0x%03x, reg_val=0x%02x", data->index, reg, val); \ +} + +/* CPLD sysfs attributes index */ +enum s9301_cpld_sysfs_attributes { + /* CPLD1 */ + CPLD_ACCESS_REG, + CPLD_REGISTER_VAL, + CPLD_SKU_ID, + CPLD_HW_REV, + CPLD_DEPH_REV, + CPLD_BUILD_REV, + CPLD_ID_TYPE, + CPLD_MAJOR_VER, + CPLD_MINOR_VER, + CPLD_BUILD_VER, + CPLD_VERION_H, + CPLD_ID, + CPLD_MAC_INTR, + CPLD_10G_PHY_INTR, + CPLD_CPLD_FRU_INTR, + CPLD_THERMAL_ALERT_INTR, + CPLD_MISC_INTR, + CPLD_SYSTEM_INTR, + CPLD_MAC_INTR_MASK, + CPLD_10G_PHY_INTR_MASK, + CPLD_CPLD_FRU_INTR_MASK, + CPLD_THERMAL_ALERT_INTR_MASK, + CPLD_MISC_INTR_MASK, + CPLD_MAC_INTR_EVENT, + CPLD_10G_PHY_INTR_EVENT, + CPLD_CPLD_FRU_INTR_EVENT, + CPLD_THERMAL_ALERT_INTR_EVENT, + CPLD_MISC_INTR_EVENT, + CPLD_MAC_RST, + CPLD_10G_PHY_RST, + CPLD_BMC_RST, + CPLD_USB_RST, + CPLD_MUX_RST, + CPLD_MISC_RST, + CPLD_BMC_WATCHDOG, + CPLD_DAU_BD_PRES, + CPLD_PSU_STATUS, + CPLD_SYS_PW_STATUS, + CPLD_MISC, + CPLD_MUX_CTRL, + CPLD_MAC_QSFP_SEL_CTRL, + CPLD_SYS_LED_CTRL_1, + CPLD_SYS_LED_CTRL_2, + CPLD_BEACON_LED_CTRL, + CPLD_PORT_LED_CLR_CTRL, + CPLD_EVENT_DETECT_CTRL, + /* CPLD2 */ + CPLD_QSFPDD_MOD_INT_G0, + CPLD_QSFPDD_MOD_INT_G1, + CPLD_QSFPDD_MOD_INT_G2, + CPLD_QSFPDD_MOD_INT_G3, + CPLD_QSFPDD_PRES_G0, + CPLD_QSFPDD_PRES_G1, + CPLD_QSFPDD_PRES_G2, + CPLD_QSFPDD_PRES_G3, + CPLD_QSFPDD_FUSE_INT_G0, + CPLD_QSFPDD_FUSE_INT_G1, + CPLD_QSFPDD_FUSE_INT_G2, + CPLD_QSFPDD_FUSE_INT_G3, + CPLD_SFP_TXFAULT, + CPLD_SFP_ABS, + CPLD_SFP_RXLOS, + CPLD_QSFPDD_MOD_INT_MASK_G0, + CPLD_QSFPDD_MOD_INT_MASK_G1, + CPLD_QSFPDD_MOD_INT_MASK_G2, + CPLD_QSFPDD_MOD_INT_MASK_G3, + CPLD_QSFPDD_PRES_MASK_G0, + CPLD_QSFPDD_PRES_MASK_G1, + CPLD_QSFPDD_PRES_MASK_G2, + CPLD_QSFPDD_PRES_MASK_G3, + CPLD_QSFPDD_FUSE_INT_MASK_G0, + CPLD_QSFPDD_FUSE_INT_MASK_G1, + CPLD_QSFPDD_FUSE_INT_MASK_G2, + CPLD_QSFPDD_FUSE_INT_MASK_G3, + CPLD_SFP_TXFAULT_MASK, + CPLD_SFP_ABS_MASK, + CPLD_SFP_RXLOS_MASK, + CPLD_QSFPDD_MOD_INT_EVENT_G0, + CPLD_QSFPDD_MOD_INT_EVENT_G1, + CPLD_QSFPDD_MOD_INT_EVENT_G2, + CPLD_QSFPDD_MOD_INT_EVENT_G3, + CPLD_QSFPDD_PRES_EVENT_G0, + CPLD_QSFPDD_PRES_EVENT_G1, + CPLD_QSFPDD_PRES_EVENT_G2, + CPLD_QSFPDD_PRES_EVENT_G3, + CPLD_QSFPDD_FUSE_INT_EVENT_G0, + CPLD_QSFPDD_FUSE_INT_EVENT_G1, + CPLD_QSFPDD_FUSE_INT_EVENT_G2, + CPLD_QSFPDD_FUSE_INT_EVENT_G3, + CPLD_SFP_TXFAULT_EVENT, + CPLD_SFP_ABS_EVENT, + CPLD_SFP_RXLOS_EVENT, + CPLD_QSFPDD_RESET_CTRL_G0, + CPLD_QSFPDD_RESET_CTRL_G1, + CPLD_QSFPDD_RESET_CTRL_G2, + CPLD_QSFPDD_RESET_CTRL_G3, + CPLD_QSFPDD_LP_MODE_G0, + CPLD_QSFPDD_LP_MODE_G1, + CPLD_QSFPDD_LP_MODE_G2, + CPLD_QSFPDD_LP_MODE_G3, + CPLD_SFP_TX_DIS, + CPLD_SFP_RS, + CPLD_SFP_TS, + CPLD_PORT_INT_STATUS, + + //BSP DEBUG + BSP_DEBUG +}; + +enum bsp_log_types { + LOG_NONE, + LOG_RW, + LOG_READ, + LOG_WRITE +}; + +enum bsp_log_ctrl { + LOG_DISABLE, + LOG_ENABLE +}; + +/* CPLD sysfs attributes hook functions */ +static ssize_t read_access_register(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_access_register(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_register_value(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_register_value(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_hw_rev_cb(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t read_cpld_version_cb(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t read_cpld_callback(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_cpld_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_cpld_version_h_cb(struct device *dev, + struct device_attribute *da, char *buf); +// cpld access api +static ssize_t read_cpld_reg(struct device *dev, char *buf, u8 reg); +static ssize_t write_cpld_reg(struct device *dev, const char *buf, size_t count, u8 reg); +static bool read_cpld_reg_raw_byte(struct device *dev, u8 reg, u8 *val, int *errno); +static bool read_cpld_reg_raw_int(struct device *dev, u8 reg, int *val); +// bsp debug api +static ssize_t read_bsp(char *buf, char *str); +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count); +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); + +static LIST_HEAD(cpld_client_list); /* client list for cpld */ +static struct mutex list_lock; /* mutex for client list */ + +struct cpld_client_node { + struct i2c_client *client; + struct list_head list; +}; + +struct cpld_data { + int index; /* CPLD index */ + struct mutex access_lock; /* mutex for cpld access */ + u8 access_reg; /* register to access */ +}; + +/* CPLD device id and data */ +static const struct i2c_device_id s9301_cpld_id[] = { + { "s9301_32d_cpld1", cpld1 }, + { "s9301_32d_cpld2", cpld2 }, + { "s9301_32d_cpld3", cpld3 }, + {} +}; + +char bsp_debug[2]="0"; +u8 enable_log_read=LOG_DISABLE; +u8 enable_log_write=LOG_DISABLE; + +/* Addresses scanned for s9301_cpld */ +static const unsigned short cpld_i2c_addr[] = { 0x30, 0x31, 0x32, I2C_CLIENT_END }; + +/* define all support register access of cpld in attribute */ +/* CPLD1 */ +static SENSOR_DEVICE_ATTR(cpld_access_register, S_IWUSR | S_IRUGO, \ + read_access_register, write_access_register, CPLD_ACCESS_REG); +static SENSOR_DEVICE_ATTR(cpld_register_value, S_IWUSR | S_IRUGO, \ + read_register_value, write_register_value, CPLD_REGISTER_VAL); +static SENSOR_DEVICE_ATTR(cpld_sku_id, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SKU_ID); +static SENSOR_DEVICE_ATTR(cpld_hw_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_HW_REV); +static SENSOR_DEVICE_ATTR(cpld_deph_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_DEPH_REV); +static SENSOR_DEVICE_ATTR(cpld_build_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_BUILD_REV); +static SENSOR_DEVICE_ATTR(cpld_id_type, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_ID_TYPE); +static SENSOR_DEVICE_ATTR(cpld_major_ver, S_IRUGO, \ + read_cpld_version_cb, NULL, CPLD_MAJOR_VER); +static SENSOR_DEVICE_ATTR(cpld_minor_ver, S_IRUGO, \ + read_cpld_version_cb, NULL, CPLD_MINOR_VER); +static SENSOR_DEVICE_ATTR(cpld_build_ver, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_BUILD_VER); +static SENSOR_DEVICE_ATTR(cpld_version_h, S_IRUGO, \ + read_cpld_version_h_cb, NULL, CPLD_VERION_H); +static SENSOR_DEVICE_ATTR(cpld_id, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_ID); +static SENSOR_DEVICE_ATTR(cpld_mac_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MAC_INTR); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_10G_PHY_INTR); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_CPLD_FRU_INTR); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_THERMAL_ALERT_INTR); +static SENSOR_DEVICE_ATTR(cpld_misc_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC_INTR); +static SENSOR_DEVICE_ATTR(cpld_system_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYSTEM_INTR); +static SENSOR_DEVICE_ATTR(cpld_mac_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_10G_PHY_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_CPLD_FRU_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_THERMAL_ALERT_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_misc_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MISC_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_mac_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MAC_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_10G_PHY_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_CPLD_FRU_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_THERMAL_ALERT_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_misc_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_mac_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_RST); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_10G_PHY_RST); +static SENSOR_DEVICE_ATTR(cpld_bmc_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BMC_RST); +static SENSOR_DEVICE_ATTR(cpld_usb_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_USB_RST); +static SENSOR_DEVICE_ATTR(cpld_mux_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MUX_RST); +static SENSOR_DEVICE_ATTR(cpld_misc_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MISC_RST); +static SENSOR_DEVICE_ATTR(cpld_bmc_watchdog, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BMC_WATCHDOG); +static SENSOR_DEVICE_ATTR(cpld_dau_bd_pres, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_DAU_BD_PRES); +static SENSOR_DEVICE_ATTR(cpld_psu_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_PSU_STATUS); +static SENSOR_DEVICE_ATTR(cpld_sys_pw_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_PW_STATUS); +static SENSOR_DEVICE_ATTR(cpld_misc, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC); +static SENSOR_DEVICE_ATTR(cpld_mux_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MUX_CTRL); +static SENSOR_DEVICE_ATTR(cpld_mac_qsfp_sel_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_QSFP_SEL_CTRL); +static SENSOR_DEVICE_ATTR(cpld_sys_led_ctrl_1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_LED_CTRL_1); +static SENSOR_DEVICE_ATTR(cpld_sys_led_ctrl_2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_LED_CTRL_2); +static SENSOR_DEVICE_ATTR(cpld_beacon_led_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BEACON_LED_CTRL); +static SENSOR_DEVICE_ATTR(cpld_port_led_clr_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_PORT_LED_CLR_CTRL); +static SENSOR_DEVICE_ATTR(cpld_event_detect_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_EVENT_DETECT_CTRL); +/* CPLD2 */ +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_TXFAULT); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_ABS); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_RXLOS); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask_g3, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask_g3, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask_g3, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TXFAULT_MASK); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_ABS_MASK); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_RXLOS_MASK); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event_g3, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_TXFAULT_EVENT); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_ABS_EVENT); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_RXLOS_EVENT); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g0, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g1, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g2, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl_g3, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL_G3); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g0, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g1, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g2, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode_g3, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE_G3); +static SENSOR_DEVICE_ATTR(cpld_sfp_tx_dis, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TX_DIS); +static SENSOR_DEVICE_ATTR(cpld_sfp_rs, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_RS); +static SENSOR_DEVICE_ATTR(cpld_sfp_ts, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TS); +static SENSOR_DEVICE_ATTR(cpld_port_int_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_PORT_INT_STATUS); +//BSP DEBUG +static SENSOR_DEVICE_ATTR(bsp_debug, S_IRUGO | S_IWUSR, \ + read_bsp_callback, write_bsp_callback, BSP_DEBUG); + +/* define support attributes of cpldx , total 3 */ +/* cpld 1 */ +static struct attribute *s9301_cpld1_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_sku_id.dev_attr.attr, + &sensor_dev_attr_cpld_hw_rev.dev_attr.attr, + &sensor_dev_attr_cpld_deph_rev.dev_attr.attr, + &sensor_dev_attr_cpld_build_rev.dev_attr.attr, + &sensor_dev_attr_cpld_id_type.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr.dev_attr.attr, + &sensor_dev_attr_cpld_system_intr.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_mac_rst.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_rst.dev_attr.attr, + &sensor_dev_attr_cpld_bmc_rst.dev_attr.attr, + &sensor_dev_attr_cpld_usb_rst.dev_attr.attr, + &sensor_dev_attr_cpld_mux_rst.dev_attr.attr, + &sensor_dev_attr_cpld_misc_rst.dev_attr.attr, + &sensor_dev_attr_cpld_bmc_watchdog.dev_attr.attr, + &sensor_dev_attr_cpld_dau_bd_pres.dev_attr.attr, + &sensor_dev_attr_cpld_psu_status.dev_attr.attr, + &sensor_dev_attr_cpld_sys_pw_status.dev_attr.attr, + &sensor_dev_attr_cpld_misc.dev_attr.attr, + &sensor_dev_attr_cpld_mux_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_mac_qsfp_sel_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_sys_led_ctrl_1.dev_attr.attr, + &sensor_dev_attr_cpld_sys_led_ctrl_2.dev_attr.attr, + &sensor_dev_attr_cpld_beacon_led_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_port_led_clr_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_event_detect_ctrl.dev_attr.attr, + &sensor_dev_attr_bsp_debug.dev_attr.attr, + NULL +}; + +/* cpld 2 */ +static struct attribute *s9301_cpld2_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault_mask.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs_mask.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos_mask.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault_event.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs_event.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos_event.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl_g3.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode_g3.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_tx_dis.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rs.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_ts.dev_attr.attr, + &sensor_dev_attr_cpld_port_int_status.dev_attr.attr, + NULL +}; + +/* cpld 3 */ +static struct attribute *s9301_cpld3_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + NULL +}; + +/* cpld 1 attributes group */ +static const struct attribute_group s9301_cpld1_group = { + .attrs = s9301_cpld1_attributes, +}; +/* cpld 2 attributes group */ +static const struct attribute_group s9301_cpld2_group = { + .attrs = s9301_cpld2_attributes, +}; +/* cpld 3 attributes group */ +static const struct attribute_group s9301_cpld3_group = { + .attrs = s9301_cpld3_attributes, +}; + +static int _bsp_log(u8 log_type, char *fmt, ...) +{ + if ((log_type==LOG_READ && enable_log_read) || + (log_type==LOG_WRITE && enable_log_write)) { + va_list args; + int r; + + va_start(args, fmt); + r = vprintk(fmt, args); + va_end(args); + + return r; + } else { + return 0; + } +} + +static int _config_bsp_log(u8 log_type) +{ + switch(log_type) { + case LOG_NONE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_RW: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_ENABLE; + break; + case LOG_READ: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_WRITE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_ENABLE; + break; + default: + return -EINVAL; + } + return 0; +} + +/* get bsp value */ +static ssize_t read_bsp(char *buf, char *str) +{ + ssize_t len=0; + + len=sprintf(buf, "%s", str); + BSP_LOG_R("reg_val=%s", str); + + return len; +} + +/* set bsp value */ +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count) +{ + snprintf(str, str_len, "%s", buf); + BSP_LOG_W("reg_val=%s", str); + + return count; +} + +/* get bsp parameter value */ +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + + switch (attr->index) { + case BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + default: + return -EINVAL; + } + return read_bsp(buf, str); +} + +/* set bsp parameter value */ +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + ssize_t ret = 0; + u8 bsp_debug_u8 = 0; + + switch (attr->index) { + case BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + ret = write_bsp(buf, str, str_len, count); + + if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { + return -EINVAL; + } else if (_config_bsp_log(bsp_debug_u8) < 0) { + return -EINVAL; + } + return ret; + default: + return -EINVAL; + } + return 0; +} + +/* read access register from cpld data */ +static ssize_t read_access_register(struct device *dev, + struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg = data->access_reg; + + return sprintf(buf, "0x%x\n", reg); +} + +/* write access register to cpld data */ +static ssize_t write_access_register(struct device *dev, + struct device_attribute *da, + const char *buf, + size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg; + + if (kstrtou8(buf, 0, ®) < 0) + return -EINVAL; + + data->access_reg = reg; + return count; +} + +/* read the value of access register in cpld data */ +static ssize_t read_register_value(struct device *dev, + struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg = data->access_reg; + int reg_val; + + I2C_READ_BYTE_DATA(reg_val, &data->access_lock, client, reg); + + if (reg_val < 0) + return reg_val; + + return sprintf(buf, "0x%x\n", reg_val); +} + +/* wrtie the value to access register in cpld data */ +static ssize_t write_register_value(struct device *dev, + struct device_attribute *da, + const char *buf, + size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + int ret = -EIO; + u8 reg = data->access_reg; + u8 reg_val; + + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, client, reg, reg_val); + + if (unlikely(ret < 0)) { + dev_err(dev, "I2C_WRITE_BYTE_DATA error, return=%d\n", ret); + return ret; + } + + return count; +} + +/* get cpld register value */ +static ssize_t read_cpld_reg(struct device *dev, + char *buf, + u8 reg) +{ + int reg_val; + + if (read_cpld_reg_raw_int(dev, reg, ®_val)) + return sprintf(buf, "0x%02x\n", reg_val); + else + return reg_val; +} + +static bool read_cpld_reg_raw_int(struct device *dev, u8 reg, int *val) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + I2C_READ_BYTE_DATA(*val, &data->access_lock, client, reg); + if (unlikely(*val < 0)) { + dev_err(dev, "read_cpld_reg_raw_int() error, return=%d\n", *val); + return false; + } + return true; +} + +static bool read_cpld_reg_raw_byte(struct device *dev, u8 reg, u8 *val, int *errno) +{ + int reg_val; + + if (read_cpld_reg_raw_int(dev, reg, ®_val)) { + *val = (u8)reg_val; + return true; + } else { + *errno = reg_val; + return false; + } +} + +/* handle read for attributes */ +static ssize_t read_cpld_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = 0; + + switch (attr->index) { + case CPLD_SKU_ID: + reg = CPLD_SKU_ID_REG; + break; + case CPLD_ID: + reg = CPLD_ID_REG; + break; + case CPLD_BUILD_VER: + reg = CPLD_BUILD_VER_REG; + break; + case CPLD_MAC_INTR: + reg = CPLD_MAC_INTR_REG; + break; + case CPLD_10G_PHY_INTR: + reg = CPLD_10G_PHY_INTR_REG; + break; + case CPLD_CPLD_FRU_INTR: + reg = CPLD_CPLD_FRU_INTR_REG; + break; + case CPLD_THERMAL_ALERT_INTR: + reg = CPLD_THERMAL_ALERT_INTR_REG; + break; + case CPLD_MISC_INTR: + reg = CPLD_MISC_INTR_REG; + break; + case CPLD_SYSTEM_INTR: + reg = CPLD_SYSTEM_INTR_REG; + break; + case CPLD_MAC_INTR_MASK: + reg = CPLD_MAC_INTR_MASK_REG; + break; + case CPLD_10G_PHY_INTR_MASK: + reg = CPLD_10G_PHY_INTR_MASK_REG; + break; + case CPLD_CPLD_FRU_INTR_MASK: + reg = CPLD_CPLD_FRU_INTR_MASK_REG; + break; + case CPLD_THERMAL_ALERT_INTR_MASK: + reg = CPLD_THERMAL_ALERT_INTR_MASK_REG; + break; + case CPLD_MISC_INTR_MASK: + reg = CPLD_MISC_INTR_MASK_REG; + break; + case CPLD_MAC_INTR_EVENT: + reg = CPLD_MAC_INTR_EVENT_REG; + break; + case CPLD_10G_PHY_INTR_EVENT: + reg = CPLD_10G_PHY_INTR_EVENT_REG; + break; + case CPLD_CPLD_FRU_INTR_EVENT: + reg = CPLD_CPLD_FRU_INTR_EVENT_REG; + break; + case CPLD_THERMAL_ALERT_INTR_EVENT: + reg = CPLD_THERMAL_ALERT_INTR_EVENT_REG; + break; + case CPLD_MISC_INTR_EVENT: + reg = CPLD_MISC_INTR_EVENT_REG; + break; + case CPLD_MAC_RST: + reg = CPLD_MAC_RST_REG; + break; + case CPLD_10G_PHY_RST: + reg = CPLD_10G_PHY_RST_REG; + break; + case CPLD_BMC_RST: + reg = CPLD_BMC_RST_REG; + break; + case CPLD_USB_RST: + reg = CPLD_USB_RST_REG; + break; + case CPLD_MUX_RST: + reg = CPLD_MUX_RST_REG; + break; + case CPLD_MISC_RST: + reg = CPLD_MISC_RST_REG; + break; + case CPLD_BMC_WATCHDOG: + reg = CPLD_BMC_WATCHDOG_REG; + break; + case CPLD_DAU_BD_PRES: + reg = CPLD_DAU_BD_PRES_REG; + break; + case CPLD_PSU_STATUS: + reg = CPLD_PSU_STATUS_REG; + break; + case CPLD_SYS_PW_STATUS: + reg = CPLD_SYS_PW_STATUS_REG; + break; + case CPLD_MISC: + reg = CPLD_MISC_REG; + break; + case CPLD_MUX_CTRL: + reg = CPLD_MUX_CTRL_REG; + break; + case CPLD_MAC_QSFP_SEL_CTRL: + reg = CPLD_MAC_QSFP_SEL_CTRL_REG; + break; + case CPLD_SYS_LED_CTRL_1: + reg = CPLD_SYS_LED_CTRL_1_REG; + break; + case CPLD_SYS_LED_CTRL_2: + reg = CPLD_SYS_LED_CTRL_2_REG; + break; + case CPLD_BEACON_LED_CTRL: + reg = CPLD_BEACON_LED_CTRL_REG; + break; + case CPLD_PORT_LED_CLR_CTRL: + reg = CPLD_PORT_LED_CLR_CTRL_REG; + break; + case CPLD_EVENT_DETECT_CTRL: + reg = CPLD_EVENT_DETECT_CTRL_REG; + break; + case CPLD_QSFPDD_MOD_INT_G0: + reg = CPLD_QSFPDD_MOD_INT_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_G1: + reg = CPLD_QSFPDD_MOD_INT_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_G2: + reg = CPLD_QSFPDD_MOD_INT_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_G3: + reg = CPLD_QSFPDD_MOD_INT_G3_REG; + break; + case CPLD_QSFPDD_PRES_G0: + reg = CPLD_QSFPDD_PRES_G0_REG; + break; + case CPLD_QSFPDD_PRES_G1: + reg = CPLD_QSFPDD_PRES_G1_REG; + break; + case CPLD_QSFPDD_PRES_G2: + reg = CPLD_QSFPDD_PRES_G2_REG; + break; + case CPLD_QSFPDD_PRES_G3: + reg = CPLD_QSFPDD_PRES_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G0: + reg = CPLD_QSFPDD_FUSE_INT_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G1: + reg = CPLD_QSFPDD_FUSE_INT_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G2: + reg = CPLD_QSFPDD_FUSE_INT_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_G3: + reg = CPLD_QSFPDD_FUSE_INT_G3_REG; + break; + case CPLD_SFP_TXFAULT: + reg = CPLD_SFP_TXFAULT_REG; + break; + case CPLD_SFP_ABS: + reg = CPLD_SFP_ABS_REG; + break; + case CPLD_SFP_RXLOS: + reg = CPLD_SFP_RXLOS_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G0: + reg = CPLD_QSFPDD_MOD_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G1: + reg = CPLD_QSFPDD_MOD_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G2: + reg = CPLD_QSFPDD_MOD_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G3: + reg = CPLD_QSFPDD_MOD_INT_MASK_G3_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G0: + reg = CPLD_QSFPDD_PRES_MASK_G0_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G1: + reg = CPLD_QSFPDD_PRES_MASK_G1_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G2: + reg = CPLD_QSFPDD_PRES_MASK_G2_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G3: + reg = CPLD_QSFPDD_PRES_MASK_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G0: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G1: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G2: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G3: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G3_REG; + break; + case CPLD_SFP_TXFAULT_MASK: + reg = CPLD_SFP_TXFAULT_MASK_REG; + break; + case CPLD_SFP_ABS_MASK: + reg = CPLD_SFP_ABS_MASK_REG; + break; + case CPLD_SFP_RXLOS_MASK: + reg = CPLD_SFP_RXLOS_MASK_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G0: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G1: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G2: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT_G3: + reg = CPLD_QSFPDD_MOD_INT_EVENT_G3_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G0: + reg = CPLD_QSFPDD_PRES_EVENT_G0_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G1: + reg = CPLD_QSFPDD_PRES_EVENT_G1_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G2: + reg = CPLD_QSFPDD_PRES_EVENT_G2_REG; + break; + case CPLD_QSFPDD_PRES_EVENT_G3: + reg = CPLD_QSFPDD_PRES_EVENT_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G0: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G1: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G2: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT_G3: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_G3_REG; + break; + case CPLD_SFP_TXFAULT_EVENT: + reg = CPLD_SFP_TXFAULT_EVENT_REG; + break; + case CPLD_SFP_ABS_EVENT: + reg = CPLD_SFP_ABS_EVENT_REG; + break; + case CPLD_SFP_RXLOS_EVENT: + reg = CPLD_SFP_RXLOS_EVENT_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G0: + reg = CPLD_QSFPDD_RESET_CTRL_G0_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G1: + reg = CPLD_QSFPDD_RESET_CTRL_G1_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G2: + reg = CPLD_QSFPDD_RESET_CTRL_G2_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G3: + reg = CPLD_QSFPDD_RESET_CTRL_G3_REG; + break; + case CPLD_QSFPDD_LP_MODE_G0: + reg = CPLD_QSFPDD_LP_MODE_G0_REG; + break; + case CPLD_QSFPDD_LP_MODE_G1: + reg = CPLD_QSFPDD_LP_MODE_G1_REG; + break; + case CPLD_QSFPDD_LP_MODE_G2: + reg = CPLD_QSFPDD_LP_MODE_G2_REG; + break; + case CPLD_QSFPDD_LP_MODE_G3: + reg = CPLD_QSFPDD_LP_MODE_G3_REG; + break; + case CPLD_SFP_TX_DIS: + reg = CPLD_SFP_TX_DIS_REG; + break; + case CPLD_SFP_RS: + reg = CPLD_SFP_RS_REG; + break; + case CPLD_SFP_TS: + reg = CPLD_SFP_TS_REG; + break; + case CPLD_PORT_INT_STATUS: + reg = CPLD_PORT_INT_STATUS_REG; + break; + default: + return -EINVAL; + } + return read_cpld_reg(dev, buf, reg); +} + +/* handle read for hw_rev attributes */ +static ssize_t read_hw_rev_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = CPLD_HW_REV_REG; + u8 reg_val = 0; + int errno = 0; + u8 res; + + if (!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + + switch (attr->index) { + case CPLD_HW_REV: + HW_REV_GET(reg_val, res); + break; + case CPLD_DEPH_REV: + DEPH_REV_GET(reg_val, res); + break; + case CPLD_BUILD_REV: + BUILD_REV_GET(reg_val, res); + break; + case CPLD_ID_TYPE: + ID_TYPE_GET(reg_val, res); + break; + default: + return -EINVAL; + } + return sprintf(buf, "0x%02x\n", res); +} + +/* handle read for cpld_version attributes */ +static ssize_t read_cpld_version_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = CPLD_VERSION_REG; + u8 reg_val = 0; + int errno = 0; + u8 res; + + if (!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + + switch (attr->index) { + case CPLD_MAJOR_VER: + CPLD_MAJOR_VERSION_GET(reg_val, res); + break; + case CPLD_MINOR_VER: + CPLD_MINOR_VERSION_GET(reg_val, res); + break; + default: + return -EINVAL; + } + return sprintf(buf, "0x%02x\n", res); +} + +/* handle read human-readable string for cpld_version attributes */ +static ssize_t read_cpld_version_h_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + u8 reg = CPLD_VERSION_REG; + u8 reg_val = 0; + int errno = 0; + u8 major, minor, build; + + //get major/minor register value + if(!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + CPLD_MAJOR_VERSION_GET(reg_val, major); + CPLD_MINOR_VERSION_GET(reg_val, minor); + + //get build register value + reg = CPLD_BUILD_VER_REG; + if(!read_cpld_reg_raw_byte(dev, reg, &build, &errno)) + return errno; + + //version string format : xx.xx.xxx + return sprintf(buf, "%d.%02d.%03d\n", major, minor, build); +} + +/* handle write for attributes */ +static ssize_t write_cpld_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = 0; + + switch (attr->index) { + case CPLD_MAC_INTR_MASK: + reg = CPLD_MAC_INTR_MASK_REG; + break; + case CPLD_10G_PHY_INTR_MASK: + reg = CPLD_10G_PHY_INTR_MASK_REG; + break; + case CPLD_CPLD_FRU_INTR_MASK: + reg = CPLD_CPLD_FRU_INTR_MASK_REG; + break; + case CPLD_THERMAL_ALERT_INTR_MASK: + reg = CPLD_THERMAL_ALERT_INTR_MASK_REG; + break; + case CPLD_MISC_INTR_MASK: + reg = CPLD_MISC_INTR_MASK_REG; + break; + case CPLD_MAC_RST: + reg = CPLD_MAC_RST_REG; + break; + case CPLD_10G_PHY_RST: + reg = CPLD_10G_PHY_RST_REG; + break; + case CPLD_BMC_RST: + reg = CPLD_BMC_RST_REG; + break; + case CPLD_USB_RST: + reg = CPLD_USB_RST_REG; + break; + case CPLD_MUX_RST: + reg = CPLD_MUX_RST_REG; + break; + case CPLD_MISC_RST: + reg = CPLD_MISC_RST_REG; + break; + case CPLD_BMC_WATCHDOG: + reg = CPLD_BMC_WATCHDOG_REG; + break; + case CPLD_MUX_CTRL: + reg = CPLD_MUX_CTRL_REG; + break; + case CPLD_MAC_QSFP_SEL_CTRL: + reg = CPLD_MAC_QSFP_SEL_CTRL_REG; + break; + case CPLD_BEACON_LED_CTRL: + reg = CPLD_BEACON_LED_CTRL_REG; + break; + case CPLD_PORT_LED_CLR_CTRL: + reg = CPLD_PORT_LED_CLR_CTRL_REG; + break; + case CPLD_EVENT_DETECT_CTRL: + reg = CPLD_EVENT_DETECT_CTRL_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G0: + reg = CPLD_QSFPDD_MOD_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G1: + reg = CPLD_QSFPDD_MOD_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G2: + reg = CPLD_QSFPDD_MOD_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK_G3: + reg = CPLD_QSFPDD_MOD_INT_MASK_G3_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G0: + reg = CPLD_QSFPDD_PRES_MASK_G0_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G1: + reg = CPLD_QSFPDD_PRES_MASK_G1_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G2: + reg = CPLD_QSFPDD_PRES_MASK_G2_REG; + break; + case CPLD_QSFPDD_PRES_MASK_G3: + reg = CPLD_QSFPDD_PRES_MASK_G3_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G0: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G0_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G1: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G1_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G2: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK_G3: + reg = CPLD_QSFPDD_FUSE_INT_MASK_G3_REG; + break; + case CPLD_SFP_TXFAULT_MASK: + reg = CPLD_SFP_TXFAULT_MASK_REG; + break; + case CPLD_SFP_ABS_MASK: + reg = CPLD_SFP_ABS_MASK_REG; + break; + case CPLD_SFP_RXLOS_MASK: + reg = CPLD_SFP_RXLOS_MASK_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G0: + reg = CPLD_QSFPDD_RESET_CTRL_G0_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G1: + reg = CPLD_QSFPDD_RESET_CTRL_G1_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G2: + reg = CPLD_QSFPDD_RESET_CTRL_G2_REG; + break; + case CPLD_QSFPDD_RESET_CTRL_G3: + reg = CPLD_QSFPDD_RESET_CTRL_G3_REG; + break; + case CPLD_QSFPDD_LP_MODE_G0: + reg = CPLD_QSFPDD_LP_MODE_G0_REG; + break; + case CPLD_QSFPDD_LP_MODE_G1: + reg = CPLD_QSFPDD_LP_MODE_G1_REG; + break; + case CPLD_QSFPDD_LP_MODE_G2: + reg = CPLD_QSFPDD_LP_MODE_G2_REG; + break; + case CPLD_QSFPDD_LP_MODE_G3: + reg = CPLD_QSFPDD_LP_MODE_G3_REG; + break; + case CPLD_SFP_TX_DIS: + reg = CPLD_SFP_TX_DIS_REG; + break; + case CPLD_SFP_RS: + reg = CPLD_SFP_RS_REG; + break; + case CPLD_SFP_TS: + reg = CPLD_SFP_TS_REG; + break; + default: + return -EINVAL; + } + return write_cpld_reg(dev, buf, count, reg); +} + +/* set cpld register value */ +static ssize_t write_cpld_reg(struct device *dev, + const char *buf, + size_t count, + u8 reg) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg_val; + int ret; + + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, + client, reg, reg_val); + + if (unlikely(ret < 0)) { + dev_err(dev, "I2C_WRITE_BYTE_DATA error, return=%d\n", ret); + return ret; + } + + return count; +} + +/* add valid cpld client to list */ +static void s9301_cpld_add_client(struct i2c_client *client) +{ + struct cpld_client_node *node = NULL; + + node = kzalloc(sizeof(struct cpld_client_node), GFP_KERNEL); + if (!node) { + dev_info(&client->dev, + "Can't allocate cpld_client_node for index %d\n", + client->addr); + return; + } + + node->client = client; + + mutex_lock(&list_lock); + list_add(&node->list, &cpld_client_list); + mutex_unlock(&list_lock); +} + +/* remove exist cpld client in list */ +static void s9301_cpld_remove_client(struct i2c_client *client) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int found = 0; + + mutex_lock(&list_lock); + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + + if (cpld_node->client == client) { + found = 1; + break; + } + } + + if (found) { + list_del(list_node); + kfree(cpld_node); + } + mutex_unlock(&list_lock); +} + +/* cpld drvier probe */ +static int s9301_cpld_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + int status; + struct cpld_data *data = NULL; + int ret = -EPERM; + int idx; + + data = kzalloc(sizeof(struct cpld_data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + /* init cpld data for client */ + i2c_set_clientdata(client, data); + mutex_init(&data->access_lock); + + if (!i2c_check_functionality(client->adapter, + I2C_FUNC_SMBUS_BYTE_DATA)) { + dev_info(&client->dev, + "i2c_check_functionality failed (0x%x)\n", + client->addr); + status = -EIO; + goto exit; + } + + /* get cpld id from device */ + ret = i2c_smbus_read_byte_data(client, CPLD_ID_REG); + + if (ret < 0) { + dev_info(&client->dev, + "fail to get cpld id (0x%x) at addr (0x%x)\n", + CPLD_ID_REG, client->addr); + status = -EIO; + goto exit; + } + + CPLD_ID_ID_GET(ret, idx); + + if (INVALID(idx, cpld1, cpld3)) { + dev_info(&client->dev, + "cpld id %d(device) not valid\n", idx); + //status = -EPERM; + //goto exit; + } + + data->index = dev_id->driver_data; + + /* register sysfs hooks for different cpld group */ + dev_info(&client->dev, "probe cpld with index %d\n", data->index); + switch (data->index) { + case cpld1: + status = sysfs_create_group(&client->dev.kobj, + &s9301_cpld1_group); + break; + case cpld2: + status = sysfs_create_group(&client->dev.kobj, + &s9301_cpld2_group); + break; + case cpld3: + status = sysfs_create_group(&client->dev.kobj, + &s9301_cpld3_group); + break; + default: + status = -EINVAL; + } + + if (status) + goto exit; + + dev_info(&client->dev, "chip found\n"); + + /* add probe chip to client list */ + s9301_cpld_add_client(client); + + return 0; +exit: + switch (data->index) { + case cpld1: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld1_group); + break; + case cpld2: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld2_group); + break; + case cpld3: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld3_group); + break; + default: + break; + } + return status; +} + +/* cpld drvier remove */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +s9301_cpld_remove(struct i2c_client *client) +{ + struct cpld_data *data = i2c_get_clientdata(client); + + switch (data->index) { + case cpld1: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld1_group); + break; + case cpld2: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld2_group); + break; + case cpld3: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld3_group); + break; + } + + s9301_cpld_remove_client(client); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) + return 0; +#endif +} + +MODULE_DEVICE_TABLE(i2c, s9301_cpld_id); + +static struct i2c_driver s9301_cpld_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "x86_64_ufispace_s9301_32d_cpld", + }, + .probe = s9301_cpld_probe, + .remove = s9301_cpld_remove, + .id_table = s9301_cpld_id, + .address_list = cpld_i2c_addr, +}; + +/* provide cpld register read */ +/* cpld_idx indicate the index of cpld device */ +int s9301_cpld_read(u8 cpld_idx, + u8 reg) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EPERM; + struct cpld_data *data; + + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + data = i2c_get_clientdata(cpld_node->client); + if (data->index == cpld_idx) { + DEBUG_PRINT("cpld_idx=%d, read reg 0x%02x", + cpld_idx, reg); + I2C_READ_BYTE_DATA(ret, &data->access_lock, + cpld_node->client, reg); + DEBUG_PRINT("cpld_idx=%d, read reg 0x%02x = 0x%02x", + cpld_idx, reg, ret); + break; + } + } + + return ret; +} +EXPORT_SYMBOL(s9301_cpld_read); + +/* provide cpld register write */ +/* cpld_idx indicate the index of cpld device */ +int s9301_cpld_write(u8 cpld_idx, + u8 reg, + u8 value) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EIO; + struct cpld_data *data; + + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + data = i2c_get_clientdata(cpld_node->client); + + if (data->index == cpld_idx) { + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, + cpld_node->client, + reg, value); + DEBUG_PRINT("cpld_idx=%d, write reg 0x%02x val 0x%02x, ret=%d", + cpld_idx, reg, value, ret); + break; + } + } + + return ret; +} +EXPORT_SYMBOL(s9301_cpld_write); + +static int __init s9301_cpld_init(void) +{ + mutex_init(&list_lock); + return i2c_add_driver(&s9301_cpld_driver); +} + +static void __exit s9301_cpld_exit(void) +{ + i2c_del_driver(&s9301_cpld_driver); +} + +MODULE_AUTHOR("Leo Lin "); +MODULE_DESCRIPTION("x86_64_ufispace_s9301_cpld driver"); +MODULE_LICENSE("GPL"); + +module_init(s9301_cpld_init); +module_exit(s9301_cpld_exit); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-cpld.h b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-cpld.h new file mode 100644 index 000000000000..9eca44006455 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-cpld.h @@ -0,0 +1,251 @@ +/* header file for i2c cpld driver of ufispace_s9301_32d + * + * Copyright (C) 2017 UfiSpace Technology Corporation. + * Leo Lin + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef UFISPACE_S9301_I2C_CPLD_H +#define UFISPACE_S9301_I2C_CPLD_H + +/* CPLD device index value */ +enum cpld_id { + cpld1, + cpld2, + cpld3, +}; + +enum LED_BLINK { + NOBLINK, + BLINK, +}; + +enum LED_BLINK_SPEED { + BLINK_1X, // 0.5hz + BLINK_4X, // 2hz +}; + +enum LED_STATUS { + OFF, + ON, +}; + +enum LED_YELLOW { + YELLOW_OFF, + YELLOW_ON, +}; + +enum LED_GREEN { + GREEN_OFF, + GREEN_ON, +}; + +/* QSFPDD port number */ +#define QSFPDD_MAX_PORT_NUM 32 +#define QSFPDD_MIN_PORT_NUM 1 + +/* SFP+ port number */ +#define SFP_MAX_PORT_NUM 4 +#define SFP_MIN_PORT_NUM 1 + + +/* CPLD registers */ +/* CPLD 1 */ +#define CPLD_SKU_ID_REG 0x00 +#define CPLD_HW_REV_REG 0x01 +#define CPLD_VERSION_REG 0x02 +#define CPLD_ID_REG 0x03 +#define CPLD_BUILD_VER_REG 0x04 +// Interrupt status +#define CPLD_MAC_INTR_REG 0x10 +#define CPLD_10G_PHY_INTR_REG 0x13 +#define CPLD_CPLD_FRU_INTR_REG 0x14 +#define CPLD_THERMAL_ALERT_INTR_REG 0x16 +#define CPLD_MISC_INTR_REG 0x1B +#define CPLD_SYSTEM_INTR_REG 0x1D +// Interrupt mask +#define CPLD_MAC_INTR_MASK_REG 0x20 +#define CPLD_10G_PHY_INTR_MASK_REG 0x23 +#define CPLD_CPLD_FRU_INTR_MASK_REG 0x24 +#define CPLD_THERMAL_ALERT_INTR_MASK_REG 0x26 +#define CPLD_MISC_INTR_MASK_REG 0x2B +// Interrupt event +#define CPLD_MAC_INTR_EVENT_REG 0x30 +#define CPLD_10G_PHY_INTR_EVENT_REG 0x33 +#define CPLD_CPLD_FRU_INTR_EVENT_REG 0x14 +#define CPLD_THERMAL_ALERT_INTR_EVENT_REG 0x16 +#define CPLD_MISC_INTR_EVENT_REG 0x1B +// Reset ctrl +#define CPLD_MAC_RST_REG 0x40 +#define CPLD_10G_PHY_RST_REG 0x42 +#define CPLD_BMC_RST_REG 0x43 +#define CPLD_USB_RST_REG 0x44 +#define CPLD_MUX_RST_REG 0x46 +#define CPLD_MISC_RST_REG 0x48 +#define CPLD_BMC_WATCHDOG_REG 0x4D +// Sys status +#define CPLD_DAU_BD_PRES_REG 0x50 +#define CPLD_PSU_STATUS_REG 0x51 +#define CPLD_SYS_PW_STATUS_REG 0x52 +#define CPLD_MISC_REG 0x5B +// Mux ctrl +#define CPLD_MUX_CTRL_REG 0x5C +#define CPLD_MAC_QSFP_SEL_CTRL_REG 0x5F +// Led ctrl +#define CPLD_SYS_LED_CTRL_1_REG 0x80 +#define CPLD_SYS_LED_CTRL_2_REG 0x81 +#define CPLD_BEACON_LED_CTRL_REG 0x84 +#define CPLD_PORT_LED_CLR_CTRL_REG 0x85 +// Event Detect Ctrl +#define CPLD_EVENT_DETECT_CTRL_REG 0x5D + +/* CPLD 2 */ +/* G0 - port 0 ~ 7 + G1 - port 8 ~ 15 + G2 - port 16 ~ 23 + G3 - port 24 ~ 31 + */ +// Interrupt status +#define CPLD_QSFPDD_MOD_INT_G0_REG 0x10 +#define CPLD_QSFPDD_MOD_INT_G1_REG 0x11 +#define CPLD_QSFPDD_MOD_INT_G2_REG 0x12 +#define CPLD_QSFPDD_MOD_INT_G3_REG 0x13 +#define CPLD_QSFPDD_PRES_G0_REG 0x14 +#define CPLD_QSFPDD_PRES_G1_REG 0x15 +#define CPLD_QSFPDD_PRES_G2_REG 0x16 +#define CPLD_QSFPDD_PRES_G3_REG 0x17 +#define CPLD_QSFPDD_FUSE_INT_G0_REG 0x18 +#define CPLD_QSFPDD_FUSE_INT_G1_REG 0x19 +#define CPLD_QSFPDD_FUSE_INT_G2_REG 0x1A +#define CPLD_QSFPDD_FUSE_INT_G3_REG 0x1B +#define CPLD_SFP_TXFAULT_REG 0x1D +#define CPLD_SFP_ABS_REG 0x1E +#define CPLD_SFP_RXLOS_REG 0x1F +// Interrupt mask +#define CPLD_QSFPDD_MOD_INT_MASK_G0_REG 0x20 +#define CPLD_QSFPDD_MOD_INT_MASK_G1_REG 0x21 +#define CPLD_QSFPDD_MOD_INT_MASK_G2_REG 0x22 +#define CPLD_QSFPDD_MOD_INT_MASK_G3_REG 0x23 +#define CPLD_QSFPDD_PRES_MASK_G0_REG 0x24 +#define CPLD_QSFPDD_PRES_MASK_G1_REG 0x25 +#define CPLD_QSFPDD_PRES_MASK_G2_REG 0x26 +#define CPLD_QSFPDD_PRES_MASK_G3_REG 0x27 +#define CPLD_QSFPDD_FUSE_INT_MASK_G0_REG 0x28 +#define CPLD_QSFPDD_FUSE_INT_MASK_G1_REG 0x29 +#define CPLD_QSFPDD_FUSE_INT_MASK_G2_REG 0x2A +#define CPLD_QSFPDD_FUSE_INT_MASK_G3_REG 0x2B +#define CPLD_SFP_TXFAULT_MASK_REG 0x2D +#define CPLD_SFP_ABS_MASK_REG 0x2E +#define CPLD_SFP_RXLOS_MASK_REG 0x2F +// Interrupt event +#define CPLD_QSFPDD_MOD_INT_EVENT_G0_REG 0x30 +#define CPLD_QSFPDD_MOD_INT_EVENT_G1_REG 0x31 +#define CPLD_QSFPDD_MOD_INT_EVENT_G2_REG 0x32 +#define CPLD_QSFPDD_MOD_INT_EVENT_G3_REG 0x33 +#define CPLD_QSFPDD_PRES_EVENT_G0_REG 0x34 +#define CPLD_QSFPDD_PRES_EVENT_G1_REG 0x35 +#define CPLD_QSFPDD_PRES_EVENT_G2_REG 0x36 +#define CPLD_QSFPDD_PRES_EVENT_G3_REG 0x37 +#define CPLD_QSFPDD_FUSE_INT_EVENT_G0_REG 0x38 +#define CPLD_QSFPDD_FUSE_INT_EVENT_G1_REG 0x39 +#define CPLD_QSFPDD_FUSE_INT_EVENT_G2_REG 0x3A +#define CPLD_QSFPDD_FUSE_INT_EVENT_G3_REG 0x3B +#define CPLD_SFP_TXFAULT_EVENT_REG 0x3D +#define CPLD_SFP_ABS_EVENT_REG 0x3E +#define CPLD_SFP_RXLOS_EVENT_REG 0x3F +// Port ctrl +#define CPLD_QSFPDD_RESET_CTRL_G0_REG 0x40 +#define CPLD_QSFPDD_RESET_CTRL_G1_REG 0x41 +#define CPLD_QSFPDD_RESET_CTRL_G2_REG 0x42 +#define CPLD_QSFPDD_RESET_CTRL_G3_REG 0x43 +#define CPLD_QSFPDD_LP_MODE_G0_REG 0x44 +#define CPLD_QSFPDD_LP_MODE_G1_REG 0x45 +#define CPLD_QSFPDD_LP_MODE_G2_REG 0x46 +#define CPLD_QSFPDD_LP_MODE_G3_REG 0x47 +#define CPLD_SFP_TX_DIS_REG 0x55 +#define CPLD_SFP_RS_REG 0x56 +#define CPLD_SFP_TS_REG 0x57 +// Port status +#define CPLD_PORT_INT_STATUS_REG 0x58 + + +/* bit field structure for register value */ +struct cpld_reg_sku_id_t { + u8 model_id:8; +}; + +struct cpld_reg_hw_rev_t { + u8 hw_rev:2; + u8 deph_rev:1; + u8 build_rev:3; + u8 reserved:1; + u8 id_type:1; +}; + +struct cpld_reg_version_t { + u8 minor:6; + u8 major:2; +}; + +struct cpld_reg_id_t { + u8 id:3; + u8 release:5; +}; + +struct cpld_reg_beacon_led_ctrl_t { + u8 reserve:5; + u8 speed:1; + u8 blink:1; + u8 onoff:1; +}; + +/* common manipulation */ +#define INVALID(i, min, max) ((i < min) || (i > max) ? 1u : 0u) +#define READ_BIT(val, bit) ((0u == (val & (1<bf_name) +#define READ_BF_1(bf_struct, val, bf_name, bf_value) \ + bf_struct bf; \ + bf.data = val; \ + bf_value = bf.bf_name +#define HW_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, hw_rev, res) +#define DEPH_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, deph_rev, res) +#define BUILD_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, build_rev, res) +#define ID_TYPE_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, id_type, res) +#define CPLD_MAJOR_VERSION_GET(val, res) \ + READ_BF(cpld_reg_version_t, val, major, res) +#define CPLD_MINOR_VERSION_GET(val, res) \ + READ_BF(cpld_reg_version_t, val, minor, res) +#define CPLD_ID_ID_GET(val, res) \ + READ_BF(cpld_reg_id_t, val, id, res) + +/* CPLD access functions */ +extern int s9301_cpld_read(u8 cpld_idx, u8 reg); +extern int s9301_cpld_write(u8 cpld_idx, u8 reg, u8 value); + +#endif + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-lpc.c b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-lpc.c new file mode 100644 index 000000000000..23245ebc96ec --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-lpc.c @@ -0,0 +1,850 @@ +/* + * A lpc driver for the ufispace_s9301_32d + * + * Copyright (C) 2017-2020 UfiSpace Technology Corporation. + * Jason Tsai + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include + +#define BSP_LOG_R(fmt, args...) \ + _bsp_log (LOG_READ, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#define BSP_LOG_W(fmt, args...) \ + _bsp_log (LOG_WRITE, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) + +#define BSP_PR(level, fmt, args...) _bsp_log (LOG_SYS, level "[BSP]" fmt "\r\n", ##args) + +#define DRIVER_NAME "x86_64_ufispace_s9301_32d_lpc" +#define CPU_BDE 0 +#define CPU_SKY 1 +#define CPU_TYPE CPU_SKY + +/* LPC registers */ + +#define REG_BASE_CPU 0x600 + +#if CPU_TYPE == CPU_SKY +#define REG_BASE_MB 0xE00 +#define REG_BASE_I2C_ALERT 0x700 +#else +#define REG_BASE_MB 0x700 +#define REG_BASE_I2C_ALERT 0xF000 +#endif + +//CPU CPLD +#define REG_CPU_CPLD_VERSION (REG_BASE_CPU + 0x00) +#define REG_CPU_STATUS_0 (REG_BASE_CPU + 0x01) +#define REG_CPU_STATUS_1 (REG_BASE_CPU + 0x02) +#define REG_CPU_CTRL_0 (REG_BASE_CPU + 0x03) +#define REG_CPU_CTRL_1 (REG_BASE_CPU + 0x04) +#define REG_CPU_CPLD_BUILD (REG_BASE_CPU + 0xE0) + +//MB CPLD +//TBD, need to change after CPLD spec release +#define REG_MB_BRD_ID_0 (REG_BASE_MB + 0x00) +#define REG_MB_BRD_ID_1 (REG_BASE_MB + 0x01) +#define REG_MB_CPLD_VERSION (REG_BASE_MB + 0x02) +#define REG_MB_CPLD_BUILD (REG_BASE_MB + 0x04) +#define REG_MB_MUX_RESET (REG_BASE_MB + 0x46) +#define REG_MB_MUX_CTRL (REG_BASE_MB + 0x5c) + +//I2C Alert +#if CPU_TYPE == CPU_SKY +#define REG_ALERT_STATUS (REG_BASE_I2C_ALERT + 0x80) +#else +#define REG_ALERT_STATUS (REG_BASE_I2C_ALERT + 0x00) +#define REG_ALERT_DISABLE (REG_BASE_I2C_ALERT + 0x11) +#endif + +#define MASK_ALL (0xFF) +#define LPC_MDELAY (5) + +/* LPC sysfs attributes index */ +enum lpc_sysfs_attributes { + //CPU CPLD + ATT_CPU_CPLD_VERSION, + ATT_CPU_CPLD_VERSION_H, + ATT_CPU_BIOS_BOOT_ROM, + ATT_CPU_BIOS_BOOT_CFG, + ATT_CPU_CPLD_BUILD, + //MB CPLD + ATT_MB_BRD_ID_0, + ATT_MB_BRD_ID_1, + ATT_MB_CPLD_1_VERSION, + ATT_MB_CPLD_1_VERSION_H, + ATT_MB_CPLD_1_BUILD, + ATT_MB_MUX_CTRL, + ATT_MB_MUX_RESET, + ATT_MB_BRD_SKU_ID, + ATT_MB_BRD_HW_ID, + ATT_MB_BRD_ID_TYPE, + ATT_MB_BRD_BUILD_ID, + ATT_MB_BRD_DEPH_ID, + //I2C Alert + ATT_ALERT_STATUS, +#if CPU_TYPE == CPU_BDE + ATT_ALERT_DISABLE, +#endif + //BSP + ATT_BSP_VERSION, + ATT_BSP_DEBUG, + ATT_BSP_PR_INFO, + ATT_BSP_PR_ERR, + ATT_BSP_REG, + ATT_MAX +}; + +enum bsp_log_types { + LOG_NONE, + LOG_RW, + LOG_READ, + LOG_WRITE, + LOG_SYS +}; + +enum bsp_log_ctrl { + LOG_DISABLE, + LOG_ENABLE +}; + +struct lpc_data_s { + struct mutex access_lock; +}; + +struct lpc_data_s *lpc_data; +char bsp_version[16]=""; +char bsp_debug[2]="0"; +char bsp_reg[8]="0x0"; +u8 enable_log_read=LOG_DISABLE; +u8 enable_log_write=LOG_DISABLE; +u8 enable_log_sys=LOG_ENABLE; + +/* reg shift */ +static u8 _shift(u8 mask) +{ + int i=0, mask_one=1; + + for(i=0; i<8; ++i) { + if ((mask & mask_one) == 1) + return i; + else + mask >>= 1; + } + + return -1; +} + +/* reg mask and shift */ +static u8 _mask_shift(u8 val, u8 mask) +{ + int shift=0; + + shift = _shift(mask); + + return (val & mask) >> shift; +} + +static u8 _bit_operation(u8 reg_val, u8 bit, u8 bit_val) +{ + if (bit_val == 0) + reg_val = reg_val & ~(1 << bit); + else + reg_val = reg_val | (1 << bit); + return reg_val; +} + +static int _bsp_log(u8 log_type, char *fmt, ...) +{ + if ((log_type==LOG_READ && enable_log_read) || + (log_type==LOG_WRITE && enable_log_write) || + (log_type==LOG_SYS && enable_log_sys) ) { + va_list args; + int r; + + va_start(args, fmt); + r = vprintk(fmt, args); + va_end(args); + + return r; + } else { + return 0; + } +} + +static int _config_bsp_log(u8 log_type) +{ + switch(log_type) { + case LOG_NONE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_RW: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_ENABLE; + break; + case LOG_READ: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_WRITE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_ENABLE; + break; + default: + return -EINVAL; + } + return 0; +} + +/* get lpc register value */ +static u8 _read_lpc_reg(u16 reg, u8 mask) +{ + u8 reg_val; + + mutex_lock(&lpc_data->access_lock); + reg_val=_mask_shift(inb(reg), mask); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return reg_val; +} + +/* get lpc register value */ +static ssize_t read_lpc_reg(u16 reg, u8 mask, char *buf) +{ + u8 reg_val; + int len=0; + + reg_val = _read_lpc_reg(reg, mask); + len=sprintf(buf,"0x%x\n", reg_val); + + return len; +} + +/* set lpc register value */ +static ssize_t write_lpc_reg(u16 reg, u8 mask, const char *buf, size_t count) +{ + u8 reg_val, reg_val_now, shift; + + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + //apply SINGLE BIT operation if mask is specified, multiple bits are not supported + if (mask != MASK_ALL) { + reg_val_now = _read_lpc_reg(reg, 0x0); + shift = _shift(mask); + reg_val = _bit_operation(reg_val_now, shift, reg_val); + } + + mutex_lock(&lpc_data->access_lock); + + outb(reg_val, reg); + mdelay(LPC_MDELAY); + + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return count; +} + +/* get bsp value */ +static ssize_t read_bsp(char *buf, char *str) +{ + ssize_t len=0; + + mutex_lock(&lpc_data->access_lock); + len=sprintf(buf, "%s", str); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg_val=%s", str); + + return len; +} + +/* set bsp value */ +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count) +{ + mutex_lock(&lpc_data->access_lock); + snprintf(str, str_len, "%s", buf); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_W("reg_val=%s", str); + + return count; +} + +/* get cpu cpld version in human readable format */ +static ssize_t read_cpu_cpld_version_h(struct device *dev, + struct device_attribute *da, char *buf) +{ + ssize_t len=0; + u16 reg = REG_CPU_CPLD_VERSION; + u8 mask = MASK_ALL; + u8 mask_major = 0b11000000; + u8 mask_minor = 0b00111111; + u8 reg_val; + u8 major, minor, build; + + mutex_lock(&lpc_data->access_lock); + reg_val = _mask_shift(inb(reg), mask); + major = _mask_shift(reg_val, mask_major); + minor = _mask_shift(reg_val, mask_minor); + reg = REG_CPU_CPLD_BUILD; + build = _mask_shift(inb(reg), mask); + len = sprintf(buf, "%d.%02d.%03d\n", major, minor, build); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return len; +} + +/* get mb cpld version in human readable format */ +static ssize_t read_mb_cpld_1_version_h(struct device *dev, + struct device_attribute *da, char *buf) +{ + ssize_t len=0; + u16 reg = REG_MB_CPLD_VERSION; + u8 mask = MASK_ALL; + u8 mask_major = 0b11000000; + u8 mask_minor = 0b00111111; + u8 reg_val; + u8 major, minor, build; + + mutex_lock(&lpc_data->access_lock); + reg_val = _mask_shift(inb(reg), mask); + major = _mask_shift(reg_val, mask_major); + minor = _mask_shift(reg_val, mask_minor); + reg = REG_MB_CPLD_BUILD; + build = _mask_shift(inb(reg), mask); + len = sprintf(buf, "%d.%02d.%03d\n", major, minor, build); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return len; +} + +/* get mux_reset register value */ +static ssize_t read_mux_reset_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + int len = 0; + u16 reg = REG_MB_MUX_RESET; + u8 mask = 0b00011111; + u8 reg_val; + + mutex_lock(&lpc_data->access_lock); + reg_val=_mask_shift(inb(reg), mask); + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + len=sprintf(buf, "%d\n", reg_val); + mutex_unlock(&lpc_data->access_lock); + + return len; +} + +/* set mux_reset register value */ +static ssize_t write_mux_reset_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + u8 val = 0; + u16 reg = REG_MB_MUX_RESET; + u8 reg_val = 0; + u8 mask = 0b00011111; + static int mux_reset_flag = 0; + + if (kstrtou8(buf, 0, &val) < 0) + return -EINVAL; + + if (mux_reset_flag == 0) { + if (val == 0) { + mutex_lock(&lpc_data->access_lock); + mux_reset_flag = 1; + BSP_LOG_W("i2c mux reset is triggered..."); + + reg_val = inb(reg); + outb((reg_val & ~mask), reg); + mdelay(LPC_MDELAY); + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val & ~mask); + mdelay(500); + outb((reg_val | mask), reg); + mdelay(LPC_MDELAY); + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val | mask); + mdelay(500); + mux_reset_flag = 0; + mutex_unlock(&lpc_data->access_lock); + } else { + return -EINVAL; + } + } else { + BSP_LOG_W("i2c mux is resetting... (ignore)"); + mutex_lock(&lpc_data->access_lock); + mutex_unlock(&lpc_data->access_lock); + } + + return count; +} + +/* get lpc register value */ +static ssize_t read_lpc_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u16 reg = 0; + u8 mask = MASK_ALL; + + switch (attr->index) { + //CPU CPLD + case ATT_CPU_CPLD_VERSION: + reg = REG_CPU_CPLD_VERSION; + break; + case ATT_CPU_BIOS_BOOT_ROM: + reg = REG_CPU_STATUS_1; + mask = 0x80; + break; + case ATT_CPU_BIOS_BOOT_CFG: + reg = REG_CPU_CTRL_1; + mask = 0x80; + break; + case ATT_CPU_CPLD_BUILD: + reg = REG_CPU_CPLD_BUILD; + break; + //MB CPLD + case ATT_MB_BRD_ID_0: + reg = REG_MB_BRD_ID_0; + break; + case ATT_MB_BRD_ID_1: + reg = REG_MB_BRD_ID_1; + break; + case ATT_MB_CPLD_1_VERSION: + reg = REG_MB_CPLD_VERSION; + break; + case ATT_MB_CPLD_1_BUILD: + reg = REG_MB_CPLD_BUILD; + break; + case ATT_MB_BRD_SKU_ID: + reg = REG_MB_BRD_ID_0; + mask = 0xFF; + break; + case ATT_MB_BRD_HW_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x03; + break; + case ATT_MB_BRD_ID_TYPE: + reg = REG_MB_BRD_ID_1; + mask = 0x80; + break; + case ATT_MB_BRD_BUILD_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x38; + break; + case ATT_MB_BRD_DEPH_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x04; + break; + case ATT_MB_MUX_CTRL: + reg = REG_MB_MUX_CTRL; + break; + //I2C Alert + case ATT_ALERT_STATUS: + reg = REG_ALERT_STATUS; + mask = 0x20; + break; +#if CPU_TYPE == CPU_BDE + case ATT_ALERT_DISABLE: + reg = REG_ALERT_DISABLE; + mask = 0x04; + break; +#endif + //BSP + case ATT_BSP_REG: + if (kstrtou16(bsp_reg, 0, ®) < 0) + return -EINVAL; + break; + default: + return -EINVAL; + } + return read_lpc_reg(reg, mask, buf); +} + +/* set lpc register value */ +static ssize_t write_lpc_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u16 reg = 0; + u8 mask = MASK_ALL; + + switch (attr->index) { + case ATT_MB_MUX_CTRL: + reg = REG_MB_MUX_CTRL; + break; + default: + return -EINVAL; + } + return write_lpc_reg(reg, mask, buf, count); +} + +/* get bsp parameter value */ +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + + switch (attr->index) { + case ATT_BSP_VERSION: + str = bsp_version; + str_len = sizeof(bsp_version); + break; + case ATT_BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + case ATT_BSP_REG: + str = bsp_reg; + str_len = sizeof(bsp_reg); + break; + default: + return -EINVAL; + } + return read_bsp(buf, str); +} + +/* set bsp parameter value */ +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + u16 reg = 0; + u8 bsp_debug_u8 = 0; + + switch (attr->index) { + case ATT_BSP_VERSION: + str = bsp_version; + str_len = sizeof(bsp_version); + break; + case ATT_BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + case ATT_BSP_REG: + if (kstrtou16(buf, 0, ®) < 0) + return -EINVAL; + + str = bsp_reg; + str_len = sizeof(bsp_reg); + break; + default: + return -EINVAL; + } + + if (attr->index == ATT_BSP_DEBUG) { + if (kstrtou8(buf, 0, &bsp_debug_u8) < 0) { + return -EINVAL; + } else if (_config_bsp_log(bsp_debug_u8) < 0) { + return -EINVAL; + } + } + + return write_bsp(buf, str, str_len, count); +} + +static ssize_t write_bsp_pr_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len = strlen(buf); + + if(str_len <= 0) + return str_len; + + switch (attr->index) { + case ATT_BSP_PR_INFO: + BSP_PR(KERN_INFO, "%s", buf); + break; + case ATT_BSP_PR_ERR: + BSP_PR(KERN_ERR, "%s", buf); + break; + default: + return -EINVAL; + } + + return str_len; +} + +//SENSOR_DEVICE_ATTR - CPU +static SENSOR_DEVICE_ATTR(cpu_cpld_version, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_CPLD_VERSION); +static SENSOR_DEVICE_ATTR(cpu_cpld_version_h, S_IRUGO, read_cpu_cpld_version_h, NULL, ATT_CPU_CPLD_VERSION_H); +static SENSOR_DEVICE_ATTR(boot_rom, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_BIOS_BOOT_ROM); +static SENSOR_DEVICE_ATTR(boot_cfg, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_BIOS_BOOT_CFG); +static SENSOR_DEVICE_ATTR(cpu_cpld_build, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_CPLD_BUILD); +//SENSOR_DEVICE_ATTR - MB +static SENSOR_DEVICE_ATTR(board_id_0, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_0); +static SENSOR_DEVICE_ATTR(board_id_1, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_1); +static SENSOR_DEVICE_ATTR(mb_cpld_1_version, S_IRUGO, read_lpc_callback, NULL, ATT_MB_CPLD_1_VERSION); +static SENSOR_DEVICE_ATTR(mb_cpld_1_version_h, S_IRUGO, read_mb_cpld_1_version_h, NULL, ATT_MB_CPLD_1_VERSION_H); +static SENSOR_DEVICE_ATTR(mb_cpld_1_build, S_IRUGO, read_lpc_callback, NULL, ATT_MB_CPLD_1_BUILD); +static SENSOR_DEVICE_ATTR(mux_ctrl, S_IRUGO | S_IWUSR, read_lpc_callback, write_lpc_callback, ATT_MB_MUX_CTRL); +static SENSOR_DEVICE_ATTR(mux_reset, S_IRUGO | S_IWUSR, read_mux_reset_callback, write_mux_reset_callback, ATT_MB_MUX_RESET); +static SENSOR_DEVICE_ATTR(board_sku_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_SKU_ID); +static SENSOR_DEVICE_ATTR(board_hw_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_HW_ID); +static SENSOR_DEVICE_ATTR(board_id_type, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_TYPE); +static SENSOR_DEVICE_ATTR(board_build_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_BUILD_ID); +static SENSOR_DEVICE_ATTR(board_deph_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_DEPH_ID); +//SENSOR_DEVICE_ATTR - I2C Alert +static SENSOR_DEVICE_ATTR(alert_status, S_IRUGO, read_lpc_callback, NULL, ATT_ALERT_STATUS); +#if CPU_TYPE == CPU_BDE +static SENSOR_DEVICE_ATTR(alert_disable, S_IRUGO, read_lpc_callback, NULL, ATT_ALERT_DISABLE); +#endif +//SENSOR_DEVICE_ATTR - BSP +static SENSOR_DEVICE_ATTR(bsp_version, S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_VERSION); +static SENSOR_DEVICE_ATTR(bsp_debug, S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_DEBUG); +static SENSOR_DEVICE_ATTR(bsp_pr_info, S_IWUSR, NULL, write_bsp_pr_callback, ATT_BSP_PR_INFO); +static SENSOR_DEVICE_ATTR(bsp_pr_err, S_IWUSR, NULL, write_bsp_pr_callback, ATT_BSP_PR_ERR); +static SENSOR_DEVICE_ATTR(bsp_reg, S_IRUGO | S_IWUSR, read_lpc_callback, write_bsp_callback, ATT_BSP_REG); + +static struct attribute *cpu_cpld_attrs[] = { + &sensor_dev_attr_cpu_cpld_version.dev_attr.attr, + &sensor_dev_attr_cpu_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpu_cpld_build.dev_attr.attr, + NULL, +}; + +static struct attribute *mb_cpld_attrs[] = { + &sensor_dev_attr_board_id_0.dev_attr.attr, + &sensor_dev_attr_board_id_1.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_version.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_version_h.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_build.dev_attr.attr, + &sensor_dev_attr_board_sku_id.dev_attr.attr, + &sensor_dev_attr_board_hw_id.dev_attr.attr, + &sensor_dev_attr_board_id_type.dev_attr.attr, + &sensor_dev_attr_board_build_id.dev_attr.attr, + &sensor_dev_attr_board_deph_id.dev_attr.attr, + &sensor_dev_attr_mux_ctrl.dev_attr.attr, + &sensor_dev_attr_mux_reset.dev_attr.attr, + NULL, +}; + +static struct attribute *bios_attrs[] = { + &sensor_dev_attr_boot_rom.dev_attr.attr, + &sensor_dev_attr_boot_cfg.dev_attr.attr, + NULL, +}; + +static struct attribute *i2c_alert_attrs[] = { + &sensor_dev_attr_alert_status.dev_attr.attr, +#if CPU_TYPE == CPU_BDE + &sensor_dev_attr_alert_disable.dev_attr.attr, +#endif + NULL, +}; + +static struct attribute *bsp_attrs[] = { + &sensor_dev_attr_bsp_version.dev_attr.attr, + &sensor_dev_attr_bsp_debug.dev_attr.attr, + &sensor_dev_attr_bsp_pr_info.dev_attr.attr, + &sensor_dev_attr_bsp_pr_err.dev_attr.attr, + &sensor_dev_attr_bsp_reg.dev_attr.attr, + NULL, +}; + +static struct attribute_group cpu_cpld_attr_grp = { + .name = "cpu_cpld", + .attrs = cpu_cpld_attrs, +}; + +static struct attribute_group mb_cpld_attr_grp = { + .name = "mb_cpld", + .attrs = mb_cpld_attrs, +}; + +static struct attribute_group bios_attr_grp = { + .name = "bios", + .attrs = bios_attrs, +}; + +static struct attribute_group i2c_alert_attr_grp = { + .name = "i2c_alert", + .attrs = i2c_alert_attrs, +}; + +static struct attribute_group bsp_attr_grp = { + .name = "bsp", + .attrs = bsp_attrs, +}; + +static void lpc_dev_release( struct device * dev) +{ + return; +} + +static struct platform_device lpc_dev = { + .name = DRIVER_NAME, + .id = -1, + .dev = { + .release = lpc_dev_release, + } +}; + +static int lpc_drv_probe(struct platform_device *pdev) +{ + int i = 0, grp_num = 5; + int err[5] = {0}; + struct attribute_group *grp; + + lpc_data = devm_kzalloc(&pdev->dev, sizeof(struct lpc_data_s), + GFP_KERNEL); + if (!lpc_data) + return -ENOMEM; + + mutex_init(&lpc_data->access_lock); + + for (i=0; idev.kobj, grp); + if (err[i]) { + printk(KERN_ERR "Cannot create sysfs for group %s\n", grp->name); + goto exit; + } else { + continue; + } + } + + return 0; + +exit: + for (i=0; idev.kobj, grp); + if (!err[i]) { + //remove previous successful cases + continue; + } else { + //remove first failed case, then return + return err[i]; + } + } + return 0; +} + +static int lpc_drv_remove(struct platform_device *pdev) +{ + sysfs_remove_group(&pdev->dev.kobj, &cpu_cpld_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &mb_cpld_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &bios_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &i2c_alert_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &bsp_attr_grp); + + return 0; +} + +static struct platform_driver lpc_drv = { + .probe = lpc_drv_probe, + .remove = __exit_p(lpc_drv_remove), + .driver = { + .name = DRIVER_NAME, + }, +}; + +int lpc_init(void) +{ + int err = 0; + + err = platform_driver_register(&lpc_drv); + if (err) { + printk(KERN_ERR "%s(#%d): platform_driver_register failed(%d)\n", + __func__, __LINE__, err); + + return err; + } + + err = platform_device_register(&lpc_dev); + if (err) { + printk(KERN_ERR "%s(#%d): platform_device_register failed(%d)\n", + __func__, __LINE__, err); + platform_driver_unregister(&lpc_drv); + return err; + } + + return err; +} + +void lpc_exit(void) +{ + platform_driver_unregister(&lpc_drv); + platform_device_unregister(&lpc_dev); +} + +MODULE_AUTHOR("Leo Lin "); +MODULE_DESCRIPTION("x86_64_ufispace_s9301_32d_lpc driver"); +MODULE_LICENSE("GPL"); + +module_init(lpc_init); +module_exit(lpc_exit); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-sys-eeprom.c b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-sys-eeprom.c new file mode 100644 index 000000000000..3fa3ae4c9681 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/modules/x86-64-ufispace-s9301-32d-sys-eeprom.c @@ -0,0 +1,283 @@ +/* + * Copyright (C) 1998, 1999 Frodo Looijaard and + * Philip Edelbrock + * Copyright (C) 2003 Greg Kroah-Hartman + * Copyright (C) 2003 IBM Corp. + * Copyright (C) 2004 Jean Delvare + * + * 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. + */ + +/* enable dev_dbg print out */ +//#define DEBUG + +#define __STDC_WANT_LIB_EXT1__ 1 +#include +#include +#include +#include +#include +#include +#include +#include + +#define _memset(s, c, n) memset(s, c, n) + +/* Addresses to scan */ +static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54, + 0x55, 0x56, 0x57,*/ I2C_CLIENT_END }; + +/* Size of EEPROM in bytes */ +#define EEPROM_SIZE 512 + +#define SLICE_BITS (6) +#define SLICE_SIZE (1 << SLICE_BITS) +#define SLICE_NUM (EEPROM_SIZE/SLICE_SIZE) + +/* Each client has this additional data */ +struct eeprom_data { + struct mutex update_lock; + u8 valid; /* bitfield, bit!=0 if slice is valid */ + unsigned long last_updated[SLICE_NUM]; /* In jiffies, 8 slices */ + u8 data[EEPROM_SIZE]; /* Register values */ +}; + + +static void sys_eeprom_update_client(struct i2c_client *client, u8 slice) +{ + struct eeprom_data *data = i2c_get_clientdata(client); + int i, j; + int ret; + int addr; + + mutex_lock(&data->update_lock); + + if (!(data->valid & (1 << slice)) || + time_after(jiffies, data->last_updated[slice] + 300 * HZ)) { + dev_dbg(&client->dev, "Starting eeprom update, slice %u\n", slice); + + addr = slice << SLICE_BITS; + + ret = i2c_smbus_write_byte_data(client, (u8)((addr >> 8) & 0xFF), (u8)(addr & 0xFF)); + /* select the eeprom address */ + if (ret < 0) { + dev_err(&client->dev, "address set failed\n"); + goto exit; + } + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_BYTE)) { + goto exit; + } + + for (i = slice << SLICE_BITS; i < (slice + 1) << SLICE_BITS; i+= SLICE_SIZE) { + for (j = i; j < (i+SLICE_SIZE); j++) { + int res; + + res = i2c_smbus_read_byte(client); + if (res < 0) { + goto exit; + } + + data->data[j] = res & 0xFF; + } + } + + data->last_updated[slice] = jiffies; + data->valid |= (1 << slice); + } +exit: + mutex_unlock(&data->update_lock); +} + +static ssize_t sys_eeprom_read(struct file *filp, struct kobject *kobj, + struct bin_attribute *bin_attr, + char *buf, loff_t off, size_t count) +{ + struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); + struct eeprom_data *data = i2c_get_clientdata(client); + u8 slice; + + if (off > EEPROM_SIZE) { + return 0; + } + if (off + count > EEPROM_SIZE) { + count = EEPROM_SIZE - off; + } + if (count == 0) { + return 0; + } + + /* Only refresh slices which contain requested bytes */ + for (slice = off >> SLICE_BITS; slice <= (off + count - 1) >> SLICE_BITS; slice++) { + sys_eeprom_update_client(client, slice); + } + + memcpy(buf, &data->data[off], count); + + return count; +} + +static ssize_t sys_eeprom_write(struct file *filp, struct kobject *kobj, + struct bin_attribute *bin_attr, + char *buf, loff_t off, size_t count) +{ + struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); + struct eeprom_data *data = i2c_get_clientdata(client); + int ret; + int i; + u8 cmd; + u16 value16; + + dev_dbg(&client->dev, "sys_eeprom_write off=%d, count=%d\n", (int)off, (int)count); + + if (off > EEPROM_SIZE) { + return 0; + } + if (off + count > EEPROM_SIZE) { + count = EEPROM_SIZE - off; + } + if (count == 0) { + return 0; + } + + mutex_lock(&data->update_lock); + + for(i=0; i < count; i++) { + /* write command */ + cmd = (off >> 8) & 0xff; + value16 = off & 0xff; + value16 |= buf[i] << 8; + ret = i2c_smbus_write_word_data(client, cmd, value16); + + if (ret < 0) { + dev_err(&client->dev, "write address failed at %d \n", (int)off); + goto exit; + } + + off++; + + /* need to wait for write complete */ + udelay(10000); + } +exit: + mutex_unlock(&data->update_lock); + /* force to update client when reading */ + for(i=0; i < SLICE_NUM; i++) { + data->last_updated[i] = 0; + } + + return count; +} + +static struct bin_attribute sys_eeprom_attr = { + .attr = { + .name = "eeprom", + .mode = S_IRUGO | S_IWUSR, + }, + .size = EEPROM_SIZE, + .read = sys_eeprom_read, + .write = sys_eeprom_write, +}; + +/* Return 0 if detection is successful, -ENODEV otherwise */ +static int sys_eeprom_detect(struct i2c_client *client, struct i2c_board_info *info) +{ + struct i2c_adapter *adapter = client->adapter; + + /* EDID EEPROMs are often 24C00 EEPROMs, which answer to all + addresses 0x50-0x57, but we only care about 0x51 and 0x55. So decline + attaching to addresses >= 0x56 on DDC buses */ + if (!(adapter->class & I2C_CLASS_SPD) && client->addr >= 0x56) { + return -ENODEV; + } + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE) + && !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { + return -ENODEV; + } + + strlcpy(info->type, "eeprom", I2C_NAME_SIZE); + + return 0; +} + +static int sys_eeprom_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct eeprom_data *data; + int err; + + if (!(data = kzalloc(sizeof(struct eeprom_data), GFP_KERNEL))) { + err = -ENOMEM; + goto exit; + } + +#ifdef __STDC_LIB_EXT1__ + memset_s(data->data, EEPROM_SIZE, 0xff, EEPROM_SIZE); +#else + _memset(data->data, 0xff, EEPROM_SIZE); +#endif + + i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + + /* create the sysfs eeprom file */ + err = sysfs_create_bin_file(&client->dev.kobj, &sys_eeprom_attr); + if (err) { + goto exit_kfree; + } + + return 0; + +exit_kfree: + kfree(data); +exit: + return err; +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +sys_eeprom_remove(struct i2c_client *client) +{ + sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr); + kfree(i2c_get_clientdata(client)); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) + return 0; +#endif +} + +static const struct i2c_device_id sys_eeprom_id[] = { + { "sys_eeprom", 0 }, + { } +}; + +static struct i2c_driver sys_eeprom_driver = { + .driver = { + .name = "sys_eeprom", + }, + .probe = sys_eeprom_probe, + .remove = sys_eeprom_remove, + .id_table = sys_eeprom_id, + + .class = I2C_CLASS_DDC | I2C_CLASS_SPD, + .detect = sys_eeprom_detect, + .address_list = normal_i2c, +}; + +module_i2c_driver(sys_eeprom_driver); + +MODULE_AUTHOR("Wade "); +MODULE_DESCRIPTION("UfiSpace Mother Board EEPROM driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/service/pddf-platform-init.service new file mode 120000 index 000000000000..0fd9f25b6c5e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/service/pddf-platform-init.service @@ -0,0 +1 @@ +../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/__init__.py new file mode 100644 index 000000000000..593867d31c9d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/__init__.py @@ -0,0 +1,4 @@ +# All the derived classes for PDDF +__all__ = ["platform", "chassis", "sfp", "psu", "thermal", "fan"] +from . import platform + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/chassis.py new file mode 100644 index 000000000000..6c77e2424b89 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/chassis.py @@ -0,0 +1,189 @@ +#!/usr/bin/env python + +############################################################################# +# PDDF +# Module contains an implementation of SONiC Chassis API +# +############################################################################# + +try: + import time + from sonic_platform_pddf_base.pddf_chassis import PddfChassis + from sonic_py_common import device_info +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_COMPONENT = 5 + +class Chassis(PddfChassis): + """ + PDDF Platform-specific Chassis class + """ + + port_dict = {} + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfChassis.__init__(self, pddf_data, pddf_plugin_data) + self._initialize_components() + + def _initialize_components(self): + from sonic_platform.component import Component + for index in range(NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + # Provide the functions/variables below for which implementation is to be overwritten + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.platform_name_str() + + def initizalize_system_led(self): + return True + + def get_status_led(self): + return self.get_system_led("SYS_LED") + + def get_change_event(self, timeout=0): + """ + Returns a nested dictionary containing all devices which have + experienced a change at chassis level + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + Returns: + (bool, dict): + - bool: True if call successful, False if not; + - dict: A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, where device_id is the device ID + for this device and device_event. + The known devices's device_id and device_event was defined as table below. + ----------------------------------------------------------------- + device | device_id | device_event | annotate + ----------------------------------------------------------------- + 'sfp' '' '0' Sfp removed + '1' Sfp inserted + '2' I2C bus stuck + '3' Bad eeprom + '4' Unsupported cable + '5' High Temperature + '6' Bad cable + -------------------------------------------------------------------- + Ex. 'sfp':{'11':'0', '12':'1'}, + Indicates that: + sfp 11 has been removed, sfp 12 has been inserted. + Note: For sfp, when event 3-6 happened, the module will not be avalaible, + XCVRD shall stop to read eeprom before SFP recovered from error status. + """ + + change_event_dict = {"sfp": {}} + + start_time = time.time() + forever = False + + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + print("get_change_event:Invalid timeout value", timeout) + return False, change_event_dict + + end_time = start_time + timeout + if start_time > end_time: + print( + "get_change_event:" "time wrap / invalid timeout value", + timeout, + ) + return False, change_event_dict # Time wrap or possibly incorrect timeout + try: + while timeout >= 0: + # check for sfp + sfp_change_dict = self.get_transceiver_change_event() + + if sfp_change_dict: + change_event_dict["sfp"] = sfp_change_dict + return True, change_event_dict + if forever: + time.sleep(1) + else: + timeout = end_time - time.time() + if timeout >= 1: + time.sleep(1) # We poll at 1 second granularity + else: + if timeout > 0: + time.sleep(timeout) + return True, change_event_dict + except Exception as e: + print(e) + print("get_change_event: Should not reach here.") + return False, change_event_dict + + def get_transceiver_change_event(self, timeout=0): + current_port_dict = {} + ret_dict = {} + + # Check for OIR events and return ret_dict + for index in range(self.platform_inventory['num_ports']): + if self._sfp_list[index].get_presence(): + current_port_dict[index] = self.plugin_data['XCVR']['plug_status']['inserted'] + else: + current_port_dict[index] = self.plugin_data['XCVR']['plug_status']['removed'] + + if len(self.port_dict) == 0: # first time + self.port_dict = current_port_dict + return {} + + if current_port_dict == self.port_dict: + return {} + + # Update reg value + for index, status in current_port_dict.items(): + if self.port_dict[index] != status: + ret_dict[index] = status + #ret_dict[str(index)] = status + self.port_dict = current_port_dict + for index, status in ret_dict.items(): + if int(status) == 1: + pass + #self._sfp_list[int(index)].check_sfp_optoe_type() + return ret_dict + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + + reboot_cause_path = self.plugin_data['REBOOT_CAUSE']['reboot_cause_file'] + + try: + with open(reboot_cause_path, 'r', errors='replace') as fd: + data = fd.read() + sw_reboot_cause = data.strip() + except IOError: + sw_reboot_cause = "Unknown" + + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this + chassis. + """ + + return self.get_serial() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/component.py new file mode 100644 index 000000000000..b94a10d616d6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/component.py @@ -0,0 +1,131 @@ +############################################################################# +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +try: + import subprocess + from sonic_platform_base.component_base import ComponentBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_SYSFS = { + "CPLD1": "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/cpld1_version", + "CPLD2": "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/cpld2_version", + "CPLD3": "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/cpld3_version", +} + +BMC_CMDS = { + "BMC": "bash -c 'tmp=$(ipmitool raw 0x6 0x1) && r=($(echo \"$tmp\" | cut -d \" \" -f 4,5,16,15,14)) && echo ${r[0]}.${r[1]}.${r[4]}.${r[3]}${r[2]}'", +} + +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_LIST= [ + ("CPLD1", "CPLD 1"), + ("CPLD2", "CPLD 2"), + ("CPLD3", "CPLD 3"), + ("BIOS", "Basic Input/Output System"), + ("BMC", "BMC"), + +] + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + self.index = component_index + self.name = self.get_name() + + def _run_command(self, command): + # Run bash command and print output to stdout + try: + process = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + rc = process.poll() + if rc != 0: + return False + except Exception: + return False + return True + + def _get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + return None + + def _get_cpld_version(self): + # Retrieves the CPLD firmware version + cpld_version = dict() + for cpld_name in CPLD_SYSFS: + cmd = "cat {}".format(CPLD_SYSFS[cpld_name]) + status, value = subprocess.getstatusoutput(cmd) + if not status: + cpld_version_raw = value.rstrip() + cpld_version_int = int(cpld_version_raw,16) + cpld_version[cpld_name] = "{}.{:02d}".format(cpld_version_int >> 6, + cpld_version_int & 0b00111111) + + return cpld_version + + def _get_bmc_version(self): + # Retrieves the BMC firmware version + status, value = subprocess.getstatusoutput(BMC_CMDS["BMC"]) + if not status: + return value + else: + return None + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + + if self.name == "BIOS": + fw_version = self._get_bios_version() + elif "CPLD" in self.name: + cpld_version = self._get_cpld_version() + fw_version = cpld_version.get(self.name) + elif self.name == "BMC": + fw_version = self._get_bmc_version() + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/eeprom.py new file mode 100644 index 000000000000..90ab1c779a48 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/eeprom.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_eeprom import PddfEeprom +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Eeprom(PddfEeprom): + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfEeprom.__init__(self, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + + def platform_name_str(self): + (is_valid, results) = self.get_tlv_field(self.eeprom_data, self._TLV_CODE_PLATFORM_NAME) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/fan.py new file mode 100644 index 000000000000..3082de54a140 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/fan.py @@ -0,0 +1,172 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan import PddfFan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Fan(PddfFan): + """PDDF Platform-Specific Fan class""" + + def __init__(self, tray_idx, fan_idx=0, pddf_data=None, pddf_plugin_data=None, is_psu_fan=False, psu_index=0): + # idx is 0-based + PddfFan.__init__(self, tray_idx, fan_idx, pddf_data, pddf_plugin_data, is_psu_fan, psu_index) + + # Provide the functions/variables below for which implementation is to be overwritten + # Since psu_fan airflow direction cant be read from sysfs, it is fixed as 'F2B' or 'intake' + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + speed_percentage = 0 + if self.is_psu_fan: + attr = "psu_fan{}_speed_rpm".format(self.fan_index) + device = "PSU{}".format(self.fans_psu_index) + max_speed = int(self.plugin_data['PSU']['PSU_FAN_MAX_SPEED']) + else: + if self.fan_index == 1: + pos = "f" + max_speed = int(self.plugin_data['FAN']['FAN_F_MAX_SPEED']) + else: + pos = "r" + max_speed = int(self.plugin_data['FAN']['FAN_R_MAX_SPEED']) + attr = "fan{}_{}_speed_rpm".format(self.fantray_index, pos) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + if not output: + return speed_percentage + + output['status'] = output['status'].rstrip() + if output['status'].isalpha(): + return speed_percentage + else: + speed = int(float(output['status'])) + + speed_percentage = round((speed*100)/max_speed) + + return min(speed_percentage, 100) + + def get_speed_rpm(self): + """ + Retrieves the speed of fan in RPM + + Returns: + An integer, Speed of fan in RPM + """ + rpm_speed = 0 + if self.is_psu_fan: + attr = "psu_fan{}_speed_rpm".format(self.fan_index) + device = "PSU{}".format(self.fans_psu_index) + else: + if self.fan_index == 1: + pos = "f" + else: + pos = "r" + attr = "fan{}_{}_speed_rpm".format(self.fantray_index, pos) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + + if output is None: + return rpm_speed + + output['status'] = output['status'].rstrip() + if output['status'].isalpha(): + return rpm_speed + else: + rpm_speed = int(float(output['status'])) + + return rpm_speed + + def get_direction(self): + """ + Retrieves the direction of fan + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + direction = self.FAN_DIRECTION_INTAKE + if self.is_psu_fan: + attr = "psu_fan{}_dir".format(self.fan_index) + device = "PSU{}".format(self.fans_psu_index) + else: + attr = "fan{}_dir".format(self.fantray_index) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + if not output: + return direction + + mode = output['mode'] + val = output['status'].strip() + vmap = self.plugin_data['FAN']['direction'][mode]['valmap'] + + if val in vmap: + direction = vmap[val] + + return direction + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + presence = False + if self.is_psu_fan: + attr = "psu_present" + device = "PSU{}".format(self.fans_psu_index) + else: + attr = "fan{}_present".format(self.fantray_index) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + if not output: + return presence + + + mode = output['mode'] + val = output['status'].strip() + + if self.is_psu_fan: + vmap = self.plugin_data['PSU']['psu_present'][mode]['valmap'] + else: + vmap = self.plugin_data['FAN']['present'][mode]['valmap'] + + if val in vmap: + presence = vmap[val] + + return presence + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + return self.get_speed() + + def set_speed(self, speed): + """ + Sets the fan speed + + Args: + speed: An integer, the percentage of full fan speed to set fan to, + in the range 0 (off) to 100 (full speed) + + Returns: + A boolean, True if speed is set successfully, False if not + """ + + print("Setting Fan speed is not allowed") + return False + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..3b9bb607f632 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/fan_drawer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(PddfFanDrawer): + """PDDF Platform-Specific Fan-Drawer class""" + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + # idx is 0-based + PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/platform.py similarity index 58% rename from platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/watchdog.py rename to platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/platform.py index 88660b1a1faa..406b1179ae1b 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s6301-56st/sonic_platform/watchdog.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/platform.py @@ -1,23 +1,25 @@ #!/usr/bin/env python ############################################################################# -# -# Module contains an implementation of platform specific watchdog API's +# PDDF +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information # ############################################################################# + try: - from sonic_platform_pddf_base.pddf_watchdog import PddfWatchdog + from sonic_platform_pddf_base.pddf_platform import PddfPlatform except ImportError as e: raise ImportError(str(e) + "- required module not found") -class Watchdog(PddfWatchdog): + +class Platform(PddfPlatform): """ - PDDF Platform-specific Chassis class + PDDF Platform-Specific Platform Class """ def __init__(self): - PddfWatchdog.__init__(self) - self.timeout= 180 + PddfPlatform.__init__(self) # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/psu.py new file mode 100644 index 000000000000..3e213415f314 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/psu.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_psu import PddfPsu +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Psu(PddfPsu): + """PDDF Platform-Specific PSU class""" + + PLATFORM_PSU_CAPACITY = 1300 + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfPsu.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return float(self.PLATFORM_PSU_CAPACITY) + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, + e.g. 302.6 + """ + + # power is returned in micro watts + return round(float(self.get_voltage()*self.get_current()), 2) + + def get_capacity(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return self.get_maximum_supplied_power() + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + return self.plugin_data['PSU']['DEFAULT_TYPE'] \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/sfp.py new file mode 100644 index 000000000000..c7919482f69c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/sfp.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_sfp import PddfSfp +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Sfp(PddfSfp): + """ + PDDF Platform-Specific Sfp class + """ + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfSfp.__init__(self, index, pddf_data, pddf_plugin_data) + self.index = index + + # Provide the functions/variables below for which implementation is to be overwritten + + def get_error_description(self): + """ + Retrives the error descriptions of the SFP module + Returns: + String that represents the current error descriptions of vendor specific errors + In case there are multiple errors, they should be joined by '|', + like: "Bad EEPROM|Unsupported cable" + """ + if not self.get_presence(): + return self.SFP_STATUS_UNPLUGGED + + return self.SFP_STATUS_OK diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/thermal.py new file mode 100644 index 000000000000..77d6ec7ae886 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform/thermal.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_thermal import PddfThermal +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + + +class Thermal(PddfThermal): + """PDDF Platform-Specific Thermal class""" + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform_setup.py new file mode 100644 index 000000000000..3661c84a0cd6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/sonic_platform_setup.py @@ -0,0 +1,27 @@ +from setuptools import setup + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on ufispace platform', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + maintainer='Leo Lin', + maintainer_email='leo.yt.lin@ufispace.com', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_post_device_create.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_post_device_create.sh new file mode 100755 index 000000000000..e4de7ae3669e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_post_device_create.sh @@ -0,0 +1,6 @@ +#!/bin/bash +#disable bmc watchdog +timeout 3 ipmitool mc watchdog off + +echo 1 > /sys/kernel/pddf/devices/sysstatus/sysstatus_data/port_led_clr_ctrl +echo "PDDF device post-create completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_post_driver_install.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_post_driver_install.sh new file mode 100755 index 000000000000..ed2559977e42 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_post_driver_install.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "PDDF driver post-install completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_switch_svc.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_switch_svc.py new file mode 100755 index 000000000000..3be0d61b5a4b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32d/utils/pddf_switch_svc.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# Script to stop and start the respective platforms default services. +# This will be used while switching the pddf->non-pddf mode and vice versa +import commands + +def check_pddf_support(): + return True + +def stop_platform_svc(): + + ''' + status, output = commands.getstatusoutput("systemctl stop s9301-32d-platform-monitor-fan.service") + if status: + print "Stop s9301-32d-platform-fan.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl stop s9301-32d-platform-monitor-psu.service") + if status: + print "Stop s9301-32d-platform-psu.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl stop s9301-32d-platform-monitor.service") + if status: + print "Stop s9301-32d-platform-init.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl disable s9301-32d-platform-monitor.service") + if status: + print "Disable s9301-32d-platform-monitor.service failed %d"%status + return False + ''' + + status, output = commands.getstatusoutput("/usr/local/bin/platform_utility.py deinit") + if status: + print "platform_utility.py deinit command failed %d"%status + return False + + # HACK , stop the pddf-platform-init service if it is active + status, output = commands.getstatusoutput("systemctl stop pddf-platform-init.service") + if status: + print "Stop pddf-platform-init.service along with other platform serives failed %d"%status + return False + + return True + +def start_platform_svc(): + + status, output = commands.getstatusoutput("/usr/local/bin/platform_utility.py init") + if status: + print "platform_utility.py init command failed %d"%status + return False + + ''' + status, output = commands.getstatusoutput("systemctl enable s9301-32d-platform-monitor.service") + if status: + print "Enable s9301-32d-platform-monitor.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl start s9301-32d-platform-monitor-fan.service") + if status: + print "Start s9301-32d-platform-monitor-fan.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl start s9301-32d-platform-monitor-psu.service") + if status: + print "Start s9301-32d-platform-monitor-psu.service failed %d"%status + return False + ''' + return True + +def start_platform_pddf(): + + status, output = commands.getstatusoutput("systemctl start pddf-platform-init.service") + if status: + print "Start pddf-platform-init.service failed %d"%status + return False + + return True + +def stop_platform_pddf(): + + status, output = commands.getstatusoutput("systemctl stop pddf-platform-init.service") + if status: + print "Stop pddf-platform-init.service failed %d"%status + return False + + return True + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/Makefile b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/Makefile new file mode 100644 index 000000000000..2f8a4deb8bfe --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/Makefile @@ -0,0 +1,6 @@ + +MODULE_NAME = x86-64-ufispace-s9301-32db-cpld.o x86-64-ufispace-s9301-32db-sys-eeprom.o x86-64-ufispace-s9301-32db-lpc.o pddf_custom_sysstatus_module.o +obj-m := $(MODULE_NAME) + +CFLAGS_pddf_custom_sysstatus_module.o := -I$(M)/../../../../pddf/i2c/modules/include +KBUILD_EXTRA_SYMBOLS := $(M)/../../../../pddf/i2c/Module.symvers.PDDF diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/pddf_custom_sysstatus_module.c b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/pddf_custom_sysstatus_module.c new file mode 100644 index 000000000000..b61219c0088d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/pddf_custom_sysstatus_module.c @@ -0,0 +1,266 @@ +/* + * Copyright 2019 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * 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. + * + * + * A pddf kernel module for system status registers + */ + +#define __STDC_WANT_LIB_EXT1__ 1 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../../../../pddf/i2c/modules/include/pddf_client_defs.h" +#include "../../../../pddf/i2c/modules/include/pddf_sysstatus_defs.h" + +#define _memset(s, c, n) memset(s, c, n) + +SYSSTATUS_DATA sysstatus_data = {0}; + +extern int board_i2c_cpld_read(unsigned short cpld_addr, u8 reg); +extern int board_i2c_cpld_write(unsigned short cpld_addr, u8 reg, u8 value); + +static ssize_t do_attr_operation(struct device *dev, struct device_attribute *da, const char *buf, size_t count); +ssize_t show_sysstatus_data(struct device *dev, struct device_attribute *da, char *buf); +ssize_t store_sysstatus_data(struct device *dev, struct device_attribute *da, const char *buf, size_t count); + + +PDDF_DATA_ATTR(attr_name, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_CHAR, 32, + (void*)&sysstatus_data.sysstatus_addr_attr.aname, NULL); +PDDF_DATA_ATTR(attr_devaddr, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.devaddr , NULL); +PDDF_DATA_ATTR(attr_offset, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.offset, NULL); +PDDF_DATA_ATTR(attr_mask, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.mask , NULL); +PDDF_DATA_ATTR(attr_len, S_IWUSR|S_IRUGO, show_pddf_data, store_pddf_data, PDDF_UINT32, + sizeof(uint32_t), (void*)&sysstatus_data.sysstatus_addr_attr.len , NULL); +PDDF_DATA_ATTR(attr_ops, S_IWUSR, NULL, do_attr_operation, PDDF_CHAR, 8, (void*)&sysstatus_data, NULL); + + + +static struct attribute *sysstatus_addr_attributes[] = { + &attr_attr_name.dev_attr.attr, + &attr_attr_devaddr.dev_attr.attr, + &attr_attr_offset.dev_attr.attr, + &attr_attr_mask.dev_attr.attr, + &attr_attr_len.dev_attr.attr, + &attr_attr_ops.dev_attr.attr, + NULL +}; + +PDDF_DATA_ATTR(board_info, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(cpld1_version, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(cpld2_version, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(cpld3_version, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(mac_reset, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(mux_reset, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(psu_status, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(system_led_0, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(system_led_1, S_IRUGO, show_sysstatus_data, NULL, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(beacon_led, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); +PDDF_DATA_ATTR(port_led_clr_ctrl, S_IWUSR|S_IRUGO, show_sysstatus_data, store_sysstatus_data, PDDF_UCHAR, sizeof(u8), NULL, NULL); + +static struct attribute *sysstatus_data_attributes[] = { + &attr_board_info.dev_attr.attr, + &attr_cpld1_version.dev_attr.attr, + &attr_cpld2_version.dev_attr.attr, + &attr_cpld3_version.dev_attr.attr, + &attr_mac_reset.dev_attr.attr, + &attr_mux_reset.dev_attr.attr, + &attr_psu_status.dev_attr.attr, + &attr_system_led_0.dev_attr.attr, + &attr_system_led_1.dev_attr.attr, + &attr_beacon_led.dev_attr.attr, + &attr_port_led_clr_ctrl.dev_attr.attr, + NULL +}; + + +static const struct attribute_group pddf_sysstatus_addr_group = { + .attrs = sysstatus_addr_attributes, +}; + + +static const struct attribute_group pddf_sysstatus_data_group = { + .attrs = sysstatus_data_attributes, +}; + + +static struct kobject *sysstatus_addr_kobj; +static struct kobject *sysstatus_data_kobj; + + + +ssize_t show_sysstatus_data(struct device *dev, struct device_attribute *da, char *buf) +{ + + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + + SYSSTATUS_DATA *data = &sysstatus_data; + struct SYSSTATUS_ADDR_ATTR *sysstatus_addr_attrs = NULL; + int i, status ; + + + for (i=0;isysstatus_addr_attrs[i].aname, attr->dev_attr.attr.name) == 0 ) + { + sysstatus_addr_attrs = &data->sysstatus_addr_attrs[i]; + + } + } + + if (sysstatus_addr_attrs==NULL ) + { + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); + status = 0; + } + else + { + status = board_i2c_cpld_read( sysstatus_addr_attrs->devaddr, sysstatus_addr_attrs->offset); + } + + return sprintf(buf, "0x%x\n", (status&sysstatus_addr_attrs->mask)); + +} + +ssize_t store_sysstatus_data(struct device *dev, struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + + SYSSTATUS_DATA *data = &sysstatus_data; + struct SYSSTATUS_ADDR_ATTR *sysstatus_addr_attrs = NULL; + int i, status ; + u8 reg_val; + + for (i=0;isysstatus_addr_attrs[i].aname, attr->dev_attr.attr.name) == 0 ) + { + sysstatus_addr_attrs = &data->sysstatus_addr_attrs[i]; + } + } + + if (sysstatus_addr_attrs==NULL) + { + printk(KERN_DEBUG "%s is not supported attribute for this client\n",attr->dev_attr.attr.name); + return -EINVAL; + } + else + { + if (kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + status = board_i2c_cpld_write(sysstatus_addr_attrs->devaddr, sysstatus_addr_attrs->offset, reg_val); + + if (status!=0) + { + printk(KERN_DEBUG "store_sysstatus_data() %s failed, status=%d\n",data->sysstatus_addr_attrs[i].aname, status); + return status; + } + } + + return count; +} + + + +static ssize_t do_attr_operation(struct device *dev, struct device_attribute *da, const char *buf, size_t count) +{ + PDDF_ATTR *ptr = (PDDF_ATTR *)da; + SYSSTATUS_DATA *pdata = (SYSSTATUS_DATA *)(ptr->addr); + + pdata->sysstatus_addr_attrs[pdata->len] = pdata->sysstatus_addr_attr; + pdata->len++; + pddf_dbg(SYSSTATUS, KERN_ERR "%s: Populating the data for %s\n", __FUNCTION__, pdata->sysstatus_addr_attr.aname); +#ifdef __STDC_LIB_EXT1__ + memset_s(&pdata->sysstatus_addr_attr, sizeof(pdata->sysstatus_addr_attr), 0, sizeof(pdata->sysstatus_addr_attr)); +#else + _memset(&pdata->sysstatus_addr_attr, 0, sizeof(pdata->sysstatus_addr_attr)); +#endif + + return count; +} + + + + +int __init sysstatus_data_init(void) +{ + struct kobject *device_kobj; + int ret = 0; + + + pddf_dbg(SYSSTATUS, "PDDF SYSSTATUS MODULE.. init\n"); + + device_kobj = get_device_i2c_kobj(); + if(!device_kobj) + return -ENOMEM; + + sysstatus_addr_kobj = kobject_create_and_add("sysstatus", device_kobj); + if(!sysstatus_addr_kobj) + return -ENOMEM; + + sysstatus_data_kobj = kobject_create_and_add("sysstatus_data", sysstatus_addr_kobj); + if(!sysstatus_data_kobj) + return -ENOMEM; + + + ret = sysfs_create_group(sysstatus_addr_kobj, &pddf_sysstatus_addr_group); + if (ret) + { + kobject_put(sysstatus_addr_kobj); + return ret; + } + + ret = sysfs_create_group(sysstatus_data_kobj, &pddf_sysstatus_data_group); + if (ret) + { + sysfs_remove_group(sysstatus_addr_kobj, &pddf_sysstatus_addr_group); + kobject_put(sysstatus_data_kobj); + kobject_put(sysstatus_addr_kobj); + return ret; + } + + + return ret; +} + +void __exit sysstatus_data_exit(void) +{ + pddf_dbg(SYSSTATUS, "PDDF SYSSTATUS MODULE.. exit\n"); + sysfs_remove_group(sysstatus_data_kobj, &pddf_sysstatus_data_group); + sysfs_remove_group(sysstatus_addr_kobj, &pddf_sysstatus_addr_group); + kobject_put(sysstatus_data_kobj); + kobject_put(sysstatus_addr_kobj); + pddf_dbg(SYSSTATUS, KERN_ERR "%s: Removed the kobjects for 'SYSSTATUS'\n",__FUNCTION__); + return; +} + +module_init(sysstatus_data_init); +module_exit(sysstatus_data_exit); + +MODULE_AUTHOR("Broadcom"); +MODULE_DESCRIPTION("SYSSTATUS platform data"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-cpld.c b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-cpld.c new file mode 100644 index 000000000000..e18e1f39cb4e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-cpld.c @@ -0,0 +1,1656 @@ +/* + * A i2c cpld driver for the ufispace_s9301_32db + * + * Copyright (C) 2017-2019 UfiSpace Technology Corporation. + * Jason Tsai + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "x86-64-ufispace-s9301-32db-cpld.h" + +#ifdef DEBUG +#define DEBUG_PRINT(fmt, args...) \ + printk(KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#else +#define DEBUG_PRINT(fmt, args...) +#endif + +#define BSP_LOG_R(fmt, args...) \ + _bsp_log (LOG_READ, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#define BSP_LOG_W(fmt, args...) \ + _bsp_log (LOG_WRITE, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) + +#define I2C_READ_BYTE_DATA(ret, lock, i2c_client, reg) \ +{ \ + mutex_lock(lock); \ + ret = i2c_smbus_read_byte_data(i2c_client, reg); \ + mutex_unlock(lock); \ + BSP_LOG_R("cpld[%d], reg=0x%03x, reg_val=0x%02x", data->index, reg, ret); \ +} +#define I2C_WRITE_BYTE_DATA(ret, lock, i2c_client, reg, val) \ +{ \ + mutex_lock(lock); \ + ret = i2c_smbus_write_byte_data(i2c_client, reg, val); \ + mutex_unlock(lock); \ + BSP_LOG_W("cpld[%d], reg=0x%03x, reg_val=0x%02x", data->index, reg, val); \ +} + +/* CPLD sysfs attributes index */ +enum s9301_cpld_sysfs_attributes { + /* CPLD1 */ + CPLD_ACCESS_REG, + CPLD_REGISTER_VAL, + CPLD_SKU_ID, + CPLD_HW_REV, + CPLD_DEPH_REV, + CPLD_BUILD_REV, + CPLD_ID_TYPE, + CPLD_MAJOR_VER, + CPLD_MINOR_VER, + CPLD_BUILD_VER, + CPLD_VERION_H, + CPLD_ID, + CPLD_MAC_INTR, + CPLD_10G_PHY_INTR, + CPLD_CPLD_FRU_INTR, + CPLD_THERMAL_ALERT_INTR, + CPLD_MISC_INTR, + CPLD_SYSTEM_INTR, + CPLD_MAC_INTR_MASK, + CPLD_10G_PHY_INTR_MASK, + CPLD_CPLD_FRU_INTR_MASK, + CPLD_THERMAL_ALERT_INTR_MASK, + CPLD_MISC_INTR_MASK, + CPLD_MAC_INTR_EVENT, + CPLD_10G_PHY_INTR_EVENT, + CPLD_CPLD_FRU_INTR_EVENT, + CPLD_THERMAL_ALERT_INTR_EVENT, + CPLD_MISC_INTR_EVENT, + CPLD_MAC_RST, + CPLD_10G_PHY_RST, + CPLD_BMC_RST, + CPLD_USB_RST, + CPLD_MUX_RST, + CPLD_MISC_RST, + CPLD_BMC_WATCHDOG, + CPLD_DAU_BD_PRES, + CPLD_PSU_STATUS, + CPLD_SYS_PW_STATUS, + CPLD_MISC, + CPLD_MUX_CTRL, + CPLD_10GMUX_SEL, + CPLD_MAC_QSFP_SEL_CTRL, + CPLD_SYS_LED_CTRL_1, + CPLD_SYS_LED_CTRL_2, + CPLD_BEACON_LED_CTRL, + CPLD_PORT_LED_CLR_CTRL, + CPLD_EVENT_DETECT_CTRL, + /* CPLD2 */ + CPLD_QSFP56_MOD_INT_G0, + CPLD_QSFP56_MOD_INT_G1, + CPLD_QSFP56_MOD_INT_G2, + CPLD_QSFPDD_MOD_INT, + CPLD_QSFP56_PRES_G0, + CPLD_QSFP56_PRES_G1, + CPLD_QSFP56_PRES_G2, + CPLD_QSFPDD_PRES, + CPLD_QSFP56_FUSE_INT_G0, + CPLD_QSFP56_FUSE_INT_G1, + CPLD_QSFP56_FUSE_INT_G2, + CPLD_QSFPDD_FUSE_INT, + CPLD_SFP_TXFAULT, + CPLD_SFP_ABS, + CPLD_SFP_RXLOS, + CPLD_QSFP56_MOD_INT_MASK_G0, + CPLD_QSFP56_MOD_INT_MASK_G1, + CPLD_QSFP56_MOD_INT_MASK_G2, + CPLD_QSFPDD_MOD_INT_MASK, + CPLD_QSFP56_PRES_MASK_G0, + CPLD_QSFP56_PRES_MASK_G1, + CPLD_QSFP56_PRES_MASK_G2, + CPLD_QSFPDD_PRES_MASK, + CPLD_QSFP56_FUSE_INT_MASK_G0, + CPLD_QSFP56_FUSE_INT_MASK_G1, + CPLD_QSFP56_FUSE_INT_MASK_G2, + CPLD_QSFPDD_FUSE_INT_MASK, + CPLD_SFP_TXFAULT_MASK, + CPLD_SFP_ABS_MASK, + CPLD_SFP_RXLOS_MASK, + CPLD_QSFP56_MOD_INT_EVENT_G0, + CPLD_QSFP56_MOD_INT_EVENT_G1, + CPLD_QSFP56_MOD_INT_EVENT_G2, + CPLD_QSFPDD_MOD_INT_EVENT, + CPLD_QSFP56_PRES_EVENT_G0, + CPLD_QSFP56_PRES_EVENT_G1, + CPLD_QSFP56_PRES_EVENT_G2, + CPLD_QSFPDD_PRES_EVENT, + CPLD_QSFP56_FUSE_INT_EVENT_G0, + CPLD_QSFP56_FUSE_INT_EVENT_G1, + CPLD_QSFP56_FUSE_INT_EVENT_G2, + CPLD_QSFPDD_FUSE_INT_EVENT, + CPLD_SFP_TXFAULT_EVENT, + CPLD_SFP_ABS_EVENT, + CPLD_SFP_RXLOS_EVENT, + CPLD_QSFP56_RESET_CTRL_G0, + CPLD_QSFP56_RESET_CTRL_G1, + CPLD_QSFP56_RESET_CTRL_G2, + CPLD_QSFPDD_RESET_CTRL, + CPLD_QSFP56_LP_MODE_G0, + CPLD_QSFP56_LP_MODE_G1, + CPLD_QSFP56_LP_MODE_G2, + CPLD_QSFPDD_LP_MODE, + CPLD_SFP_TX_DIS, + CPLD_SFP_RS, + CPLD_SFP_TS, + CPLD_PORT_INT_STATUS, + + //BSP DEBUG + BSP_DEBUG +}; + +enum bsp_log_types { + LOG_NONE, + LOG_RW, + LOG_READ, + LOG_WRITE +}; + +enum bsp_log_ctrl { + LOG_DISABLE, + LOG_ENABLE +}; + +/* CPLD sysfs attributes hook functions */ +static ssize_t read_access_register(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_access_register(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_register_value(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_register_value(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_hw_rev_cb(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t read_cpld_version_cb(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t read_cpld_callback(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_cpld_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); +static ssize_t read_cpld_version_h_cb(struct device *dev, + struct device_attribute *da, char *buf); +// cpld access api +static ssize_t read_cpld_reg(struct device *dev, char *buf, u8 reg); +static ssize_t write_cpld_reg(struct device *dev, const char *buf, size_t count, u8 reg); +static bool read_cpld_reg_raw_byte(struct device *dev, u8 reg, u8 *val, int *errno); +static bool read_cpld_reg_raw_int(struct device *dev, u8 reg, int *val); +// bsp debug api +static ssize_t read_bsp(char *buf, char *str); +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count); +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf); +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count); + +static LIST_HEAD(cpld_client_list); /* client list for cpld */ +static struct mutex list_lock; /* mutex for client list */ + +struct cpld_client_node { + struct i2c_client *client; + struct list_head list; +}; + +struct cpld_data { + int index; /* CPLD index */ + struct mutex access_lock; /* mutex for cpld access */ + u8 access_reg; /* register to access */ +}; + +/* CPLD device id and data */ +static const struct i2c_device_id s9301_cpld_id[] = { + { "s9301_32db_cpld1", cpld1 }, + { "s9301_32db_cpld2", cpld2 }, + { "s9301_32db_cpld3", cpld3 }, + {} +}; + +char bsp_debug[2]="0"; +u8 enable_log_read=LOG_DISABLE; +u8 enable_log_write=LOG_DISABLE; + +/* Addresses scanned for s9301_cpld */ +static const unsigned short cpld_i2c_addr[] = { 0x30, 0x31, 0x32, I2C_CLIENT_END }; + +/* define all support register access of cpld in attribute */ +/* CPLD1 */ +static SENSOR_DEVICE_ATTR(cpld_access_register, S_IWUSR | S_IRUGO, \ + read_access_register, write_access_register, CPLD_ACCESS_REG); +static SENSOR_DEVICE_ATTR(cpld_register_value, S_IWUSR | S_IRUGO, \ + read_register_value, write_register_value, CPLD_REGISTER_VAL); +static SENSOR_DEVICE_ATTR(cpld_sku_id, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SKU_ID); +static SENSOR_DEVICE_ATTR(cpld_hw_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_HW_REV); +static SENSOR_DEVICE_ATTR(cpld_deph_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_DEPH_REV); +static SENSOR_DEVICE_ATTR(cpld_build_rev, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_BUILD_REV); +static SENSOR_DEVICE_ATTR(cpld_id_type, S_IRUGO, \ + read_hw_rev_cb, NULL, CPLD_ID_TYPE); +static SENSOR_DEVICE_ATTR(cpld_major_ver, S_IRUGO, \ + read_cpld_version_cb, NULL, CPLD_MAJOR_VER); +static SENSOR_DEVICE_ATTR(cpld_minor_ver, S_IRUGO, \ + read_cpld_version_cb, NULL, CPLD_MINOR_VER); +static SENSOR_DEVICE_ATTR(cpld_build_ver, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_BUILD_VER); +static SENSOR_DEVICE_ATTR(cpld_version_h, S_IRUGO, \ + read_cpld_version_h_cb, NULL, CPLD_VERION_H); +static SENSOR_DEVICE_ATTR(cpld_id, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_ID); +static SENSOR_DEVICE_ATTR(cpld_mac_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MAC_INTR); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_10G_PHY_INTR); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_CPLD_FRU_INTR); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_THERMAL_ALERT_INTR); +static SENSOR_DEVICE_ATTR(cpld_misc_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC_INTR); +static SENSOR_DEVICE_ATTR(cpld_system_intr, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYSTEM_INTR); +static SENSOR_DEVICE_ATTR(cpld_mac_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_10G_PHY_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_CPLD_FRU_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_THERMAL_ALERT_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_misc_intr_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MISC_INTR_MASK); +static SENSOR_DEVICE_ATTR(cpld_mac_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MAC_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_10G_PHY_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_cpld_fru_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_CPLD_FRU_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_thermal_alert_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_THERMAL_ALERT_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_misc_intr_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC_INTR_EVENT); +static SENSOR_DEVICE_ATTR(cpld_mac_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_RST); +static SENSOR_DEVICE_ATTR(cpld_10g_phy_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_10G_PHY_RST); +static SENSOR_DEVICE_ATTR(cpld_bmc_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BMC_RST); +static SENSOR_DEVICE_ATTR(cpld_usb_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_USB_RST); +static SENSOR_DEVICE_ATTR(cpld_mux_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MUX_RST); +static SENSOR_DEVICE_ATTR(cpld_misc_rst, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MISC_RST); +static SENSOR_DEVICE_ATTR(cpld_bmc_watchdog, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BMC_WATCHDOG); +static SENSOR_DEVICE_ATTR(cpld_dau_bd_pres, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_DAU_BD_PRES); +static SENSOR_DEVICE_ATTR(cpld_psu_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_PSU_STATUS); +static SENSOR_DEVICE_ATTR(cpld_sys_pw_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_PW_STATUS); +static SENSOR_DEVICE_ATTR(cpld_misc, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_MISC); +static SENSOR_DEVICE_ATTR(cpld_mux_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MUX_CTRL); +static SENSOR_DEVICE_ATTR(cpld_10gmux_sel, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_10GMUX_SEL); +static SENSOR_DEVICE_ATTR(cpld_mac_qsfp_sel_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_MAC_QSFP_SEL_CTRL); +static SENSOR_DEVICE_ATTR(cpld_sys_led_ctrl_1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_LED_CTRL_1); +static SENSOR_DEVICE_ATTR(cpld_sys_led_ctrl_2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SYS_LED_CTRL_2); +static SENSOR_DEVICE_ATTR(cpld_beacon_led_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_BEACON_LED_CTRL); +static SENSOR_DEVICE_ATTR(cpld_port_led_clr_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_PORT_LED_CLR_CTRL); +static SENSOR_DEVICE_ATTR(cpld_event_detect_ctrl, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_EVENT_DETECT_CTRL); +/* CPLD2 */ +static SENSOR_DEVICE_ATTR(cpld_qsfp56_mod_int_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_MOD_INT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_mod_int_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_MOD_INT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_mod_int_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_MOD_INT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_pres_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_PRES_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_pres_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_PRES_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_pres_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_PRES_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_fuse_int_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_FUSE_INT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_fuse_int_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_FUSE_INT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_fuse_int_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_FUSE_INT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_TXFAULT); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_ABS); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_RXLOS); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_mod_int_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFP56_MOD_INT_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_mod_int_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFP56_MOD_INT_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_mod_int_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFP56_MOD_INT_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_MOD_INT_MASK); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_pres_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFP56_PRES_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_pres_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFP56_PRES_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_pres_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFP56_PRES_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_PRES_MASK); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_fuse_int_mask_g0, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFP56_FUSE_INT_MASK_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_fuse_int_mask_g1, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFP56_FUSE_INT_MASK_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_fuse_int_mask_g2, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFP56_FUSE_INT_MASK_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_QSFPDD_FUSE_INT_MASK); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TXFAULT_MASK); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_ABS_MASK); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos_mask, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_RXLOS_MASK); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_mod_int_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_MOD_INT_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_mod_int_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_MOD_INT_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_mod_int_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_MOD_INT_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_mod_int_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_MOD_INT_EVENT); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_pres_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_PRES_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_pres_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_PRES_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_pres_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_PRES_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_pres_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_PRES_EVENT); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_fuse_int_event_g0, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_FUSE_INT_EVENT_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_fuse_int_event_g1, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_FUSE_INT_EVENT_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_fuse_int_event_g2, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFP56_FUSE_INT_EVENT_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_fuse_int_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_QSFPDD_FUSE_INT_EVENT); +static SENSOR_DEVICE_ATTR(cpld_sfp_txfault_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_TXFAULT_EVENT); +static SENSOR_DEVICE_ATTR(cpld_sfp_abs_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_ABS_EVENT); +static SENSOR_DEVICE_ATTR(cpld_sfp_rxlos_event, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_SFP_RXLOS_EVENT); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_reset_ctrl_g0, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFP56_RESET_CTRL_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_reset_ctrl_g1, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFP56_RESET_CTRL_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_reset_ctrl_g2, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFP56_RESET_CTRL_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_reset_ctrl, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_RESET_CTRL); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_lp_mode_g0, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFP56_LP_MODE_G0); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_lp_mode_g1, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFP56_LP_MODE_G1); +static SENSOR_DEVICE_ATTR(cpld_qsfp56_lp_mode_g2, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFP56_LP_MODE_G2); +static SENSOR_DEVICE_ATTR(cpld_qsfpdd_lp_mode, \ + S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, \ + CPLD_QSFPDD_LP_MODE); +static SENSOR_DEVICE_ATTR(cpld_sfp_tx_dis, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TX_DIS); +static SENSOR_DEVICE_ATTR(cpld_sfp_rs, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_RS); +static SENSOR_DEVICE_ATTR(cpld_sfp_ts, S_IWUSR | S_IRUGO, \ + read_cpld_callback, write_cpld_callback, CPLD_SFP_TS); +static SENSOR_DEVICE_ATTR(cpld_port_int_status, S_IRUGO, \ + read_cpld_callback, NULL, CPLD_PORT_INT_STATUS); +//BSP DEBUG +static SENSOR_DEVICE_ATTR(bsp_debug, S_IRUGO | S_IWUSR, \ + read_bsp_callback, write_bsp_callback, BSP_DEBUG); + +/* define support attributes of cpldx , total 3 */ +/* cpld 1 */ +static struct attribute *s9301_cpld1_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_sku_id.dev_attr.attr, + &sensor_dev_attr_cpld_hw_rev.dev_attr.attr, + &sensor_dev_attr_cpld_deph_rev.dev_attr.attr, + &sensor_dev_attr_cpld_build_rev.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id_type.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr.dev_attr.attr, + &sensor_dev_attr_cpld_system_intr.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr_mask.dev_attr.attr, + &sensor_dev_attr_cpld_mac_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_cpld_fru_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_thermal_alert_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_misc_intr_event.dev_attr.attr, + &sensor_dev_attr_cpld_mac_rst.dev_attr.attr, + &sensor_dev_attr_cpld_10g_phy_rst.dev_attr.attr, + &sensor_dev_attr_cpld_bmc_rst.dev_attr.attr, + &sensor_dev_attr_cpld_usb_rst.dev_attr.attr, + &sensor_dev_attr_cpld_mux_rst.dev_attr.attr, + &sensor_dev_attr_cpld_misc_rst.dev_attr.attr, + &sensor_dev_attr_cpld_bmc_watchdog.dev_attr.attr, + &sensor_dev_attr_cpld_dau_bd_pres.dev_attr.attr, + &sensor_dev_attr_cpld_psu_status.dev_attr.attr, + &sensor_dev_attr_cpld_sys_pw_status.dev_attr.attr, + &sensor_dev_attr_cpld_misc.dev_attr.attr, + &sensor_dev_attr_cpld_mux_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_10gmux_sel.dev_attr.attr, + &sensor_dev_attr_cpld_mac_qsfp_sel_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_sys_led_ctrl_1.dev_attr.attr, + &sensor_dev_attr_cpld_sys_led_ctrl_2.dev_attr.attr, + &sensor_dev_attr_cpld_beacon_led_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_port_led_clr_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_event_detect_ctrl.dev_attr.attr, + &sensor_dev_attr_bsp_debug.dev_attr.attr, + NULL +}; + +/* cpld 2 */ +static struct attribute *s9301_cpld2_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_mod_int_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_mod_int_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_mod_int_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_pres_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_pres_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_pres_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_fuse_int_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_fuse_int_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_fuse_int_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_mod_int_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_mod_int_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_mod_int_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_mask.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_pres_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_pres_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_pres_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_mask.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_fuse_int_mask_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_fuse_int_mask_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_fuse_int_mask_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_mask.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault_mask.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs_mask.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos_mask.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_mod_int_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_mod_int_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_mod_int_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_mod_int_event.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_pres_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_pres_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_pres_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_pres_event.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_fuse_int_event_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_fuse_int_event_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_fuse_int_event_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_fuse_int_event.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_txfault_event.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_abs_event.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rxlos_event.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_reset_ctrl_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_reset_ctrl_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_reset_ctrl_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_reset_ctrl.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_lp_mode_g0.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_lp_mode_g1.dev_attr.attr, + &sensor_dev_attr_cpld_qsfp56_lp_mode_g2.dev_attr.attr, + &sensor_dev_attr_cpld_qsfpdd_lp_mode.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_tx_dis.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_rs.dev_attr.attr, + &sensor_dev_attr_cpld_sfp_ts.dev_attr.attr, + &sensor_dev_attr_cpld_port_int_status.dev_attr.attr, + NULL +}; + +/* cpld 3 */ +static struct attribute *s9301_cpld3_attributes[] = { + &sensor_dev_attr_cpld_access_register.dev_attr.attr, + &sensor_dev_attr_cpld_register_value.dev_attr.attr, + &sensor_dev_attr_cpld_major_ver.dev_attr.attr, + &sensor_dev_attr_cpld_minor_ver.dev_attr.attr, + &sensor_dev_attr_cpld_build_ver.dev_attr.attr, + &sensor_dev_attr_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpld_id.dev_attr.attr, + NULL +}; + +/* cpld 1 attributes group */ +static const struct attribute_group s9301_cpld1_group = { + .attrs = s9301_cpld1_attributes, +}; +/* cpld 2 attributes group */ +static const struct attribute_group s9301_cpld2_group = { + .attrs = s9301_cpld2_attributes, +}; +/* cpld 3 attributes group */ +static const struct attribute_group s9301_cpld3_group = { + .attrs = s9301_cpld3_attributes, +}; + +static int _bsp_log(u8 log_type, char *fmt, ...) +{ + if((log_type==LOG_READ && enable_log_read) || + (log_type==LOG_WRITE && enable_log_write)) { + va_list args; + int r; + + va_start(args, fmt); + r = vprintk(fmt, args); + va_end(args); + + return r; + } else { + return 0; + } +} + +static int _config_bsp_log(u8 log_type) +{ + switch(log_type) { + case LOG_NONE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_RW: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_ENABLE; + break; + case LOG_READ: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_WRITE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_ENABLE; + break; + default: + return -EINVAL; + } + return 0; +} + +/* get bsp value */ +static ssize_t read_bsp(char *buf, char *str) +{ + ssize_t len=0; + + len=sprintf(buf, "%s", str); + BSP_LOG_R("reg_val=%s", str); + + return len; +} + +/* set bsp value */ +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count) +{ + snprintf(str, str_len, "%s", buf); + BSP_LOG_W("reg_val=%s", str); + + return count; +} + +/* get bsp parameter value */ +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + + switch(attr->index) { + case BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + default: + return -EINVAL; + } + return read_bsp(buf, str); +} + +/* set bsp parameter value */ +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + ssize_t ret = 0; + u8 bsp_debug_u8 = 0; + + switch(attr->index) { + case BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + ret = write_bsp(buf, str, str_len, count); + + if(kstrtou8(buf, 0, &bsp_debug_u8) < 0) { + return -EINVAL; + } else if(_config_bsp_log(bsp_debug_u8) < 0) { + return -EINVAL; + } + return ret; + default: + return -EINVAL; + } + return 0; +} + +/* read access register from cpld data */ +static ssize_t read_access_register(struct device *dev, + struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg = data->access_reg; + + return sprintf(buf, "0x%x\n", reg); +} + +/* write access register to cpld data */ +static ssize_t write_access_register(struct device *dev, + struct device_attribute *da, + const char *buf, + size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg; + + if(kstrtou8(buf, 0, ®) < 0) + return -EINVAL; + + data->access_reg = reg; + return count; +} + +/* read the value of access register in cpld data */ +static ssize_t read_register_value(struct device *dev, + struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg = data->access_reg; + int reg_val; + + I2C_READ_BYTE_DATA(reg_val, &data->access_lock, client, reg); + + if(reg_val < 0) + return reg_val; + + return sprintf(buf, "0x%x\n", reg_val); +} + +/* wrtie the value to access register in cpld data */ +static ssize_t write_register_value(struct device *dev, + struct device_attribute *da, + const char *buf, + size_t count) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + int ret = -EIO; + u8 reg = data->access_reg; + u8 reg_val; + + if(kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, client, reg, reg_val); + + if(unlikely(ret < 0)) { + dev_err(dev, "I2C_WRITE_BYTE_DATA error, return=%d\n", ret); + return ret; + } + + return count; +} + +/* get cpld register value */ +static ssize_t read_cpld_reg(struct device *dev, + char *buf, + u8 reg) +{ + int reg_val; + + if(read_cpld_reg_raw_int(dev, reg, ®_val)) + return sprintf(buf, "0x%02x\n", reg_val); + else + return reg_val; +} + +static bool read_cpld_reg_raw_int(struct device *dev, u8 reg, int *val) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + I2C_READ_BYTE_DATA(*val, &data->access_lock, client, reg); + if(unlikely(*val < 0)) { + dev_err(dev, "read_cpld_reg_raw_int() error, return=%d\n", *val); + return false; + } + return true; +} + +static bool read_cpld_reg_raw_byte(struct device *dev, u8 reg, u8 *val, int *errno) +{ + int reg_val; + + if(read_cpld_reg_raw_int(dev, reg, ®_val)) { + *val = (u8)reg_val; + return true; + } else { + *errno = reg_val; + return false; + } +} + +/* handle read for attributes */ +static ssize_t read_cpld_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = 0; + + switch(attr->index) { + case CPLD_SKU_ID: + reg = CPLD_SKU_ID_REG; + break; + case CPLD_ID: + reg = CPLD_ID_REG; + break; + case CPLD_BUILD_VER: + reg = CPLD_BUILD_VER_REG; + break; + case CPLD_MAC_INTR: + reg = CPLD_MAC_INTR_REG; + break; + case CPLD_10G_PHY_INTR: + reg = CPLD_10G_PHY_INTR_REG; + break; + case CPLD_CPLD_FRU_INTR: + reg = CPLD_CPLD_FRU_INTR_REG; + break; + case CPLD_THERMAL_ALERT_INTR: + reg = CPLD_THERMAL_ALERT_INTR_REG; + break; + case CPLD_MISC_INTR: + reg = CPLD_MISC_INTR_REG; + break; + case CPLD_SYSTEM_INTR: + reg = CPLD_SYSTEM_INTR_REG; + break; + case CPLD_MAC_INTR_MASK: + reg = CPLD_MAC_INTR_MASK_REG; + break; + case CPLD_10G_PHY_INTR_MASK: + reg = CPLD_10G_PHY_INTR_MASK_REG; + break; + case CPLD_CPLD_FRU_INTR_MASK: + reg = CPLD_CPLD_FRU_INTR_MASK_REG; + break; + case CPLD_THERMAL_ALERT_INTR_MASK: + reg = CPLD_THERMAL_ALERT_INTR_MASK_REG; + break; + case CPLD_MISC_INTR_MASK: + reg = CPLD_MISC_INTR_MASK_REG; + break; + case CPLD_MAC_INTR_EVENT: + reg = CPLD_MAC_INTR_EVENT_REG; + break; + case CPLD_10G_PHY_INTR_EVENT: + reg = CPLD_10G_PHY_INTR_EVENT_REG; + break; + case CPLD_CPLD_FRU_INTR_EVENT: + reg = CPLD_CPLD_FRU_INTR_EVENT_REG; + break; + case CPLD_THERMAL_ALERT_INTR_EVENT: + reg = CPLD_THERMAL_ALERT_INTR_EVENT_REG; + break; + case CPLD_MISC_INTR_EVENT: + reg = CPLD_MISC_INTR_EVENT_REG; + break; + case CPLD_MAC_RST: + reg = CPLD_MAC_RST_REG; + break; + case CPLD_10G_PHY_RST: + reg = CPLD_10G_PHY_RST_REG; + break; + case CPLD_BMC_RST: + reg = CPLD_BMC_RST_REG; + break; + case CPLD_USB_RST: + reg = CPLD_USB_RST_REG; + break; + case CPLD_MUX_RST: + reg = CPLD_MUX_RST_REG; + break; + case CPLD_MISC_RST: + reg = CPLD_MISC_RST_REG; + break; + case CPLD_BMC_WATCHDOG: + reg = CPLD_BMC_WATCHDOG_REG; + break; + case CPLD_DAU_BD_PRES: + reg = CPLD_DAU_BD_PRES_REG; + break; + case CPLD_PSU_STATUS: + reg = CPLD_PSU_STATUS_REG; + break; + case CPLD_SYS_PW_STATUS: + reg = CPLD_SYS_PW_STATUS_REG; + break; + case CPLD_MISC: + reg = CPLD_MISC_REG; + break; + case CPLD_MUX_CTRL: + reg = CPLD_MUX_CTRL_REG; + break; + case CPLD_10GMUX_SEL: + reg = CPLD_10GMUX_SEL_REG; + break; + case CPLD_MAC_QSFP_SEL_CTRL: + reg = CPLD_MAC_QSFP_SEL_CTRL_REG; + break; + case CPLD_SYS_LED_CTRL_1: + reg = CPLD_SYS_LED_CTRL_1_REG; + break; + case CPLD_SYS_LED_CTRL_2: + reg = CPLD_SYS_LED_CTRL_2_REG; + break; + case CPLD_BEACON_LED_CTRL: + reg = CPLD_BEACON_LED_CTRL_REG; + break; + case CPLD_PORT_LED_CLR_CTRL: + reg = CPLD_PORT_LED_CLR_CTRL_REG; + break; + case CPLD_EVENT_DETECT_CTRL: + reg = CPLD_EVENT_DETECT_CTRL_REG; + break; + case CPLD_QSFP56_MOD_INT_G0: + reg = CPLD_QSFP56_MOD_INT_G0_REG; + break; + case CPLD_QSFP56_MOD_INT_G1: + reg = CPLD_QSFP56_MOD_INT_G1_REG; + break; + case CPLD_QSFP56_MOD_INT_G2: + reg = CPLD_QSFP56_MOD_INT_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT: + reg = CPLD_QSFPDD_MOD_INT_REG; + break; + case CPLD_QSFP56_PRES_G0: + reg = CPLD_QSFP56_PRES_G0_REG; + break; + case CPLD_QSFP56_PRES_G1: + reg = CPLD_QSFP56_PRES_G1_REG; + break; + case CPLD_QSFP56_PRES_G2: + reg = CPLD_QSFP56_PRES_G2_REG; + break; + case CPLD_QSFPDD_PRES: + reg = CPLD_QSFPDD_PRES_REG; + break; + case CPLD_QSFP56_FUSE_INT_G0: + reg = CPLD_QSFP56_FUSE_INT_G0_REG; + break; + case CPLD_QSFP56_FUSE_INT_G1: + reg = CPLD_QSFP56_FUSE_INT_G1_REG; + break; + case CPLD_QSFP56_FUSE_INT_G2: + reg = CPLD_QSFP56_FUSE_INT_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT: + reg = CPLD_QSFPDD_FUSE_INT_REG; + break; + case CPLD_SFP_TXFAULT: + reg = CPLD_SFP_TXFAULT_REG; + break; + case CPLD_SFP_ABS: + reg = CPLD_SFP_ABS_REG; + break; + case CPLD_SFP_RXLOS: + reg = CPLD_SFP_RXLOS_REG; + break; + case CPLD_QSFP56_MOD_INT_MASK_G0: + reg = CPLD_QSFP56_MOD_INT_MASK_G0_REG; + break; + case CPLD_QSFP56_MOD_INT_MASK_G1: + reg = CPLD_QSFP56_MOD_INT_MASK_G1_REG; + break; + case CPLD_QSFP56_MOD_INT_MASK_G2: + reg = CPLD_QSFP56_MOD_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK: + reg = CPLD_QSFPDD_MOD_INT_MASK_REG; + break; + case CPLD_QSFP56_PRES_MASK_G0: + reg = CPLD_QSFP56_PRES_MASK_G0_REG; + break; + case CPLD_QSFP56_PRES_MASK_G1: + reg = CPLD_QSFP56_PRES_MASK_G1_REG; + break; + case CPLD_QSFP56_PRES_MASK_G2: + reg = CPLD_QSFP56_PRES_MASK_G2_REG; + break; + case CPLD_QSFPDD_PRES_MASK: + reg = CPLD_QSFPDD_PRES_MASK_REG; + break; + case CPLD_QSFP56_FUSE_INT_MASK_G0: + reg = CPLD_QSFP56_FUSE_INT_MASK_G0_REG; + break; + case CPLD_QSFP56_FUSE_INT_MASK_G1: + reg = CPLD_QSFP56_FUSE_INT_MASK_G1_REG; + break; + case CPLD_QSFP56_FUSE_INT_MASK_G2: + reg = CPLD_QSFP56_FUSE_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK: + reg = CPLD_QSFPDD_FUSE_INT_MASK_REG; + break; + case CPLD_SFP_TXFAULT_MASK: + reg = CPLD_SFP_TXFAULT_MASK_REG; + break; + case CPLD_SFP_ABS_MASK: + reg = CPLD_SFP_ABS_MASK_REG; + break; + case CPLD_SFP_RXLOS_MASK: + reg = CPLD_SFP_RXLOS_MASK_REG; + break; + case CPLD_QSFP56_MOD_INT_EVENT_G0: + reg = CPLD_QSFP56_MOD_INT_EVENT_G0_REG; + break; + case CPLD_QSFP56_MOD_INT_EVENT_G1: + reg = CPLD_QSFP56_MOD_INT_EVENT_G1_REG; + break; + case CPLD_QSFP56_MOD_INT_EVENT_G2: + reg = CPLD_QSFP56_MOD_INT_EVENT_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_EVENT: + reg = CPLD_QSFPDD_MOD_INT_EVENT_REG; + break; + case CPLD_QSFP56_PRES_EVENT_G0: + reg = CPLD_QSFP56_PRES_EVENT_G0_REG; + break; + case CPLD_QSFP56_PRES_EVENT_G1: + reg = CPLD_QSFP56_PRES_EVENT_G1_REG; + break; + case CPLD_QSFP56_PRES_EVENT_G2: + reg = CPLD_QSFP56_PRES_EVENT_G2_REG; + break; + case CPLD_QSFPDD_PRES_EVENT: + reg = CPLD_QSFPDD_PRES_EVENT_REG; + break; + case CPLD_QSFP56_FUSE_INT_EVENT_G0: + reg = CPLD_QSFP56_FUSE_INT_EVENT_G0_REG; + break; + case CPLD_QSFP56_FUSE_INT_EVENT_G1: + reg = CPLD_QSFP56_FUSE_INT_EVENT_G1_REG; + break; + case CPLD_QSFP56_FUSE_INT_EVENT_G2: + reg = CPLD_QSFP56_FUSE_INT_EVENT_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_EVENT: + reg = CPLD_QSFPDD_FUSE_INT_EVENT_REG; + break; + case CPLD_SFP_TXFAULT_EVENT: + reg = CPLD_SFP_TXFAULT_EVENT_REG; + break; + case CPLD_SFP_ABS_EVENT: + reg = CPLD_SFP_ABS_EVENT_REG; + break; + case CPLD_SFP_RXLOS_EVENT: + reg = CPLD_SFP_RXLOS_EVENT_REG; + break; + case CPLD_QSFP56_RESET_CTRL_G0: + reg = CPLD_QSFP56_RESET_CTRL_G0_REG; + break; + case CPLD_QSFP56_RESET_CTRL_G1: + reg = CPLD_QSFP56_RESET_CTRL_G1_REG; + break; + case CPLD_QSFP56_RESET_CTRL_G2: + reg = CPLD_QSFP56_RESET_CTRL_G2_REG; + break; + case CPLD_QSFPDD_RESET_CTRL: + reg = CPLD_QSFPDD_RESET_CTRL_REG; + break; + case CPLD_QSFP56_LP_MODE_G0: + reg = CPLD_QSFP56_LP_MODE_G0_REG; + break; + case CPLD_QSFP56_LP_MODE_G1: + reg = CPLD_QSFP56_LP_MODE_G1_REG; + break; + case CPLD_QSFP56_LP_MODE_G2: + reg = CPLD_QSFP56_LP_MODE_G2_REG; + break; + case CPLD_QSFPDD_LP_MODE: + reg = CPLD_QSFPDD_LP_MODE_REG; + break; + case CPLD_SFP_TX_DIS: + reg = CPLD_SFP_TX_DIS_REG; + break; + case CPLD_SFP_RS: + reg = CPLD_SFP_RS_REG; + break; + case CPLD_SFP_TS: + reg = CPLD_SFP_TS_REG; + break; + case CPLD_PORT_INT_STATUS: + reg = CPLD_PORT_INT_STATUS_REG; + break; + default: + return -EINVAL; + } + return read_cpld_reg(dev, buf, reg); +} + +/* handle read for hw_rev attributes */ +static ssize_t read_hw_rev_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = CPLD_HW_REV_REG; + u8 reg_val = 0; + int errno = 0; + u8 res; + + if(!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + + switch(attr->index) { + case CPLD_HW_REV: + HW_REV_GET(reg_val, res); + break; + case CPLD_DEPH_REV: + DEPH_REV_GET(reg_val, res); + break; + case CPLD_BUILD_REV: + BUILD_REV_GET(reg_val, res); + break; + case CPLD_ID_TYPE: + ID_TYPE_GET(reg_val, res); + break; + default: + return -EINVAL; + } + return sprintf(buf, "0x%02x\n", res); +} + +/* handle read for cpld_version attributes */ +static ssize_t read_cpld_version_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = CPLD_VERSION_REG; + u8 reg_val = 0; + int errno = 0; + u8 res; + + if(!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + + switch(attr->index) { + case CPLD_MAJOR_VER: + CPLD_MAJOR_VERSION_GET(reg_val, res); + break; + case CPLD_MINOR_VER: + CPLD_MINOR_VERSION_GET(reg_val, res); + break; + default: + return -EINVAL; + } + return sprintf(buf, "0x%02x\n", res); +} + +/* handle read human-readable string for cpld_version attributes */ +static ssize_t read_cpld_version_h_cb(struct device *dev, + struct device_attribute *da, char *buf) +{ + u8 reg = CPLD_VERSION_REG; + u8 reg_val = 0; + int errno = 0; + u8 major, minor, build; + + //get major/minor register value + if(!read_cpld_reg_raw_byte(dev, reg, ®_val, &errno)) + return errno; + CPLD_MAJOR_VERSION_GET(reg_val, major); + CPLD_MINOR_VERSION_GET(reg_val, minor); + + //get build register value + reg = CPLD_BUILD_VER_REG; + if(!read_cpld_reg_raw_byte(dev, reg, &build, &errno)) + return errno; + + //version string format : xx.xx.xxx + return sprintf(buf, "%d.%02d.%03d\n", major, minor, build); +} + +/* handle write for attributes */ +static ssize_t write_cpld_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u8 reg = 0; + + switch(attr->index) { + case CPLD_MAC_INTR_MASK: + reg = CPLD_MAC_INTR_MASK_REG; + break; + case CPLD_10G_PHY_INTR_MASK: + reg = CPLD_10G_PHY_INTR_MASK_REG; + break; + case CPLD_CPLD_FRU_INTR_MASK: + reg = CPLD_CPLD_FRU_INTR_MASK_REG; + break; + case CPLD_THERMAL_ALERT_INTR_MASK: + reg = CPLD_THERMAL_ALERT_INTR_MASK_REG; + break; + case CPLD_MISC_INTR_MASK: + reg = CPLD_MISC_INTR_MASK_REG; + break; + case CPLD_MAC_RST: + reg = CPLD_MAC_RST_REG; + break; + case CPLD_10G_PHY_RST: + reg = CPLD_10G_PHY_RST_REG; + break; + case CPLD_BMC_RST: + reg = CPLD_BMC_RST_REG; + break; + case CPLD_USB_RST: + reg = CPLD_USB_RST_REG; + break; + case CPLD_MUX_RST: + reg = CPLD_MUX_RST_REG; + break; + case CPLD_MISC_RST: + reg = CPLD_MISC_RST_REG; + break; + case CPLD_BMC_WATCHDOG: + reg = CPLD_BMC_WATCHDOG_REG; + break; + case CPLD_MUX_CTRL: + reg = CPLD_MUX_CTRL_REG; + break; + case CPLD_10GMUX_SEL: + reg = CPLD_10GMUX_SEL_REG; + break; + case CPLD_MAC_QSFP_SEL_CTRL: + reg = CPLD_MAC_QSFP_SEL_CTRL_REG; + break; + case CPLD_BEACON_LED_CTRL: + reg = CPLD_BEACON_LED_CTRL_REG; + break; + case CPLD_PORT_LED_CLR_CTRL: + reg = CPLD_PORT_LED_CLR_CTRL_REG; + break; + case CPLD_EVENT_DETECT_CTRL: + reg = CPLD_EVENT_DETECT_CTRL_REG; + break; + case CPLD_QSFP56_MOD_INT_MASK_G0: + reg = CPLD_QSFP56_MOD_INT_MASK_G0_REG; + break; + case CPLD_QSFP56_MOD_INT_MASK_G1: + reg = CPLD_QSFP56_MOD_INT_MASK_G1_REG; + break; + case CPLD_QSFP56_MOD_INT_MASK_G2: + reg = CPLD_QSFP56_MOD_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_MOD_INT_MASK: + reg = CPLD_QSFPDD_MOD_INT_MASK_REG; + break; + case CPLD_QSFP56_PRES_MASK_G0: + reg = CPLD_QSFP56_PRES_MASK_G0_REG; + break; + case CPLD_QSFP56_PRES_MASK_G1: + reg = CPLD_QSFP56_PRES_MASK_G1_REG; + break; + case CPLD_QSFP56_PRES_MASK_G2: + reg = CPLD_QSFP56_PRES_MASK_G2_REG; + break; + case CPLD_QSFPDD_PRES_MASK: + reg = CPLD_QSFPDD_PRES_MASK_REG; + break; + case CPLD_QSFP56_FUSE_INT_MASK_G0: + reg = CPLD_QSFP56_FUSE_INT_MASK_G0_REG; + break; + case CPLD_QSFP56_FUSE_INT_MASK_G1: + reg = CPLD_QSFP56_FUSE_INT_MASK_G1_REG; + break; + case CPLD_QSFP56_FUSE_INT_MASK_G2: + reg = CPLD_QSFP56_FUSE_INT_MASK_G2_REG; + break; + case CPLD_QSFPDD_FUSE_INT_MASK: + reg = CPLD_QSFPDD_FUSE_INT_MASK_REG; + break; + case CPLD_SFP_TXFAULT_MASK: + reg = CPLD_SFP_TXFAULT_MASK_REG; + break; + case CPLD_SFP_ABS_MASK: + reg = CPLD_SFP_ABS_MASK_REG; + break; + case CPLD_SFP_RXLOS_MASK: + reg = CPLD_SFP_RXLOS_MASK_REG; + break; + case CPLD_QSFP56_RESET_CTRL_G0: + reg = CPLD_QSFP56_RESET_CTRL_G0_REG; + break; + case CPLD_QSFP56_RESET_CTRL_G1: + reg = CPLD_QSFP56_RESET_CTRL_G1_REG; + break; + case CPLD_QSFP56_RESET_CTRL_G2: + reg = CPLD_QSFP56_RESET_CTRL_G2_REG; + break; + case CPLD_QSFPDD_RESET_CTRL: + reg = CPLD_QSFPDD_RESET_CTRL_REG; + break; + case CPLD_QSFP56_LP_MODE_G0: + reg = CPLD_QSFP56_LP_MODE_G0_REG; + break; + case CPLD_QSFP56_LP_MODE_G1: + reg = CPLD_QSFP56_LP_MODE_G1_REG; + break; + case CPLD_QSFP56_LP_MODE_G2: + reg = CPLD_QSFP56_LP_MODE_G2_REG; + break; + case CPLD_QSFPDD_LP_MODE: + reg = CPLD_QSFPDD_LP_MODE_REG; + break; + case CPLD_SFP_TX_DIS: + reg = CPLD_SFP_TX_DIS_REG; + break; + case CPLD_SFP_RS: + reg = CPLD_SFP_RS_REG; + break; + case CPLD_SFP_TS: + reg = CPLD_SFP_TS_REG; + break; + default: + return -EINVAL; + } + return write_cpld_reg(dev, buf, count, reg); +} + +/* set cpld register value */ +static ssize_t write_cpld_reg(struct device *dev, + const char *buf, + size_t count, + u8 reg) +{ + struct i2c_client *client = to_i2c_client(dev); + struct cpld_data *data = i2c_get_clientdata(client); + u8 reg_val; + int ret; + + if(kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, + client, reg, reg_val); + + if(unlikely(ret < 0)) { + dev_err(dev, "I2C_WRITE_BYTE_DATA error, return=%d\n", ret); + return ret; + } + + return count; +} + +/* add valid cpld client to list */ +static void s9301_cpld_add_client(struct i2c_client *client) +{ + struct cpld_client_node *node = NULL; + + node = kzalloc(sizeof(struct cpld_client_node), GFP_KERNEL); + if(!node) { + dev_info(&client->dev, + "Can't allocate cpld_client_node for index %d\n", + client->addr); + return; + } + + node->client = client; + + mutex_lock(&list_lock); + list_add(&node->list, &cpld_client_list); + mutex_unlock(&list_lock); +} + +/* remove exist cpld client in list */ +static void s9301_cpld_remove_client(struct i2c_client *client) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int found = 0; + + mutex_lock(&list_lock); + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + + if(cpld_node->client == client) { + found = 1; + break; + } + } + + if(found) { + list_del(list_node); + kfree(cpld_node); + } + mutex_unlock(&list_lock); +} + +/* cpld drvier probe */ +static int s9301_cpld_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + int status; + struct cpld_data *data = NULL; + int ret = -EPERM; + int idx; + + data = kzalloc(sizeof(struct cpld_data), GFP_KERNEL); + if(!data) + return -ENOMEM; + + /* init cpld data for client */ + i2c_set_clientdata(client, data); + mutex_init(&data->access_lock); + + if(!i2c_check_functionality(client->adapter, + I2C_FUNC_SMBUS_BYTE_DATA)) { + dev_info(&client->dev, + "i2c_check_functionality failed (0x%x)\n", + client->addr); + status = -EIO; + goto exit; + } + + /* get cpld id from device */ + ret = i2c_smbus_read_byte_data(client, CPLD_ID_REG); + + if(ret < 0) { + dev_info(&client->dev, + "fail to get cpld id (0x%x) at addr (0x%x)\n", + CPLD_ID_REG, client->addr); + status = -EIO; + goto exit; + } + + CPLD_ID_ID_GET(ret, idx); + + if(INVALID(idx, cpld1, cpld3)) { + dev_info(&client->dev, + "cpld id %d(device) not valid\n", idx); + //status = -EPERM; + //goto exit; + } + + data->index = dev_id->driver_data; + + /* register sysfs hooks for different cpld group */ + dev_info(&client->dev, "probe cpld with index %d\n", data->index); + switch(data->index) { + case cpld1: + status = sysfs_create_group(&client->dev.kobj, + &s9301_cpld1_group); + break; + case cpld2: + status = sysfs_create_group(&client->dev.kobj, + &s9301_cpld2_group); + break; + case cpld3: + status = sysfs_create_group(&client->dev.kobj, + &s9301_cpld3_group); + break; + default: + status = -EINVAL; + } + + if(status) + goto exit; + + dev_info(&client->dev, "chip found\n"); + + /* add probe chip to client list */ + s9301_cpld_add_client(client); + + return 0; +exit: + switch(data->index) { + case cpld1: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld1_group); + break; + case cpld2: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld2_group); + break; + case cpld3: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld3_group); + break; + default: + break; + } + return status; +} + +/* cpld drvier remove */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +s9301_cpld_remove(struct i2c_client *client) +{ + struct cpld_data *data = i2c_get_clientdata(client); + + switch(data->index) { + case cpld1: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld1_group); + break; + case cpld2: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld2_group); + break; + case cpld3: + sysfs_remove_group(&client->dev.kobj, &s9301_cpld3_group); + break; + } + + s9301_cpld_remove_client(client); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) + return 0; +#endif +} + +MODULE_DEVICE_TABLE(i2c, s9301_cpld_id); + +static struct i2c_driver s9301_cpld_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "x86_64_ufispace_s9301_32db_cpld", + }, + .probe = s9301_cpld_probe, + .remove = s9301_cpld_remove, + .id_table = s9301_cpld_id, + .address_list = cpld_i2c_addr, +}; + +/* provide cpld register read */ +/* cpld_idx indicate the index of cpld device */ +int s9301_cpld_read(u8 cpld_idx, + u8 reg) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EPERM; + struct cpld_data *data; + + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + data = i2c_get_clientdata(cpld_node->client); + if(data->index == cpld_idx) { + DEBUG_PRINT("cpld_idx=%d, read reg 0x%02x", + cpld_idx, reg); + I2C_READ_BYTE_DATA(ret, &data->access_lock, + cpld_node->client, reg); + DEBUG_PRINT("cpld_idx=%d, read reg 0x%02x = 0x%02x", + cpld_idx, reg, ret); + break; + } + } + + return ret; +} +EXPORT_SYMBOL(s9301_cpld_read); + +/* provide cpld register write */ +/* cpld_idx indicate the index of cpld device */ +int s9301_cpld_write(u8 cpld_idx, + u8 reg, + u8 value) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EIO; + struct cpld_data *data; + + list_for_each(list_node, &cpld_client_list) { + cpld_node = list_entry(list_node, + struct cpld_client_node, list); + data = i2c_get_clientdata(cpld_node->client); + + if(data->index == cpld_idx) { + I2C_WRITE_BYTE_DATA(ret, &data->access_lock, + cpld_node->client, + reg, value); + DEBUG_PRINT("cpld_idx=%d, write reg 0x%02x val 0x%02x, ret=%d", + cpld_idx, reg, value, ret); + break; + } + } + + return ret; +} +EXPORT_SYMBOL(s9301_cpld_write); + +static int __init s9301_cpld_init(void) +{ + mutex_init(&list_lock); + return i2c_add_driver(&s9301_cpld_driver); +} + +static void __exit s9301_cpld_exit(void) +{ + i2c_del_driver(&s9301_cpld_driver); +} + +MODULE_AUTHOR("Leo Lin "); +MODULE_DESCRIPTION("x86_64_ufispace_s9301_cpld driver"); +MODULE_LICENSE("GPL"); + +module_init(s9301_cpld_init); +module_exit(s9301_cpld_exit); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-cpld.h b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-cpld.h new file mode 100644 index 000000000000..2022a1301709 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-cpld.h @@ -0,0 +1,256 @@ +/* header file for i2c cpld driver of ufispace_s9301_32db + * + * Copyright (C) 2017 UfiSpace Technology Corporation. + * Leo Lin + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef UFISPACE_S9301_I2C_CPLD_H +#define UFISPACE_S9301_I2C_CPLD_H + +/* CPLD device index value */ +enum cpld_id { + cpld1, + cpld2, + cpld3, +}; + +enum LED_BLINK { + NOBLINK, + BLINK, +}; + +enum LED_BLINK_SPEED { + BLINK_1X, //0.5hz + BLINK_4X, //2hz +}; + +enum LED_STATUS { + OFF, + ON, +}; + +enum LED_YELLOW { + YELLOW_OFF, + YELLOW_ON, +}; + +enum LED_GREEN { + GREEN_OFF, + GREEN_ON, +}; + +/* QSFP56 port number */ +#define QSFP56_MAX_PORT_NUM 24 +#define QSFP56_MIN_PORT_NUM 1 + +/* QSFPDD port number */ +#define QSFPDD_MAX_PORT_NUM 8 +#define QSFPDD_MIN_PORT_NUM 1 + +/* SFP+ port number */ +#define SFP_MAX_PORT_NUM 4 +#define SFP_MIN_PORT_NUM 1 + + +/* CPLD registers */ +/* CPLD 1 */ +#define CPLD_SKU_ID_REG 0x00 +#define CPLD_HW_REV_REG 0x01 +#define CPLD_VERSION_REG 0x02 +#define CPLD_ID_REG 0x03 +#define CPLD_BUILD_VER_REG 0x04 +//Interrupt status +#define CPLD_MAC_INTR_REG 0x10 +#define CPLD_10G_PHY_INTR_REG 0x13 +#define CPLD_CPLD_FRU_INTR_REG 0x14 +#define CPLD_THERMAL_ALERT_INTR_REG 0x16 +#define CPLD_MISC_INTR_REG 0x1B +#define CPLD_SYSTEM_INTR_REG 0x1D +//Interrupt mask +#define CPLD_MAC_INTR_MASK_REG 0x20 +#define CPLD_10G_PHY_INTR_MASK_REG 0x23 +#define CPLD_CPLD_FRU_INTR_MASK_REG 0x24 +#define CPLD_THERMAL_ALERT_INTR_MASK_REG 0x26 +#define CPLD_MISC_INTR_MASK_REG 0x2B +//Interrupt event +#define CPLD_MAC_INTR_EVENT_REG 0x30 +#define CPLD_10G_PHY_INTR_EVENT_REG 0x33 +#define CPLD_CPLD_FRU_INTR_EVENT_REG 0x14 +#define CPLD_THERMAL_ALERT_INTR_EVENT_REG 0x16 +#define CPLD_MISC_INTR_EVENT_REG 0x1B +//Reset ctrl +#define CPLD_MAC_RST_REG 0x40 +#define CPLD_10G_PHY_RST_REG 0x42 +#define CPLD_BMC_RST_REG 0x43 +#define CPLD_USB_RST_REG 0x44 +#define CPLD_MUX_RST_REG 0x46 +#define CPLD_MISC_RST_REG 0x48 +#define CPLD_BMC_WATCHDOG_REG 0x4D +//Sys status +#define CPLD_DAU_BD_PRES_REG 0x50 +#define CPLD_PSU_STATUS_REG 0x51 +#define CPLD_SYS_PW_STATUS_REG 0x52 +#define CPLD_MISC_REG 0x5B +//Mux ctrl +#define CPLD_MUX_CTRL_REG 0x5C +#define CPLD_10GMUX_SEL_REG 0x5E +#define CPLD_MAC_QSFP_SEL_CTRL_REG 0x5F +//Led ctrl +#define CPLD_SYS_LED_CTRL_1_REG 0x80 +#define CPLD_SYS_LED_CTRL_2_REG 0x81 +#define CPLD_BEACON_LED_CTRL_REG 0x84 +#define CPLD_PORT_LED_CLR_CTRL_REG 0x85 +//Event Detect Ctrl +#define CPLD_EVENT_DETECT_CTRL_REG 0x5D + +/* CPLD 2 */ +/* QSFP56 G0 - port 0 ~ 7 + QSFP56 G1 - port 8 ~ 15 + QSFP56 G2 - port 16 ~ 23 + QSFPDD - port 24 ~ 31 + */ +//Interrupt status +#define CPLD_QSFP56_MOD_INT_G0_REG 0x10 +#define CPLD_QSFP56_MOD_INT_G1_REG 0x11 +#define CPLD_QSFP56_MOD_INT_G2_REG 0x12 +#define CPLD_QSFPDD_MOD_INT_REG 0x13 +#define CPLD_QSFP56_PRES_G0_REG 0x14 +#define CPLD_QSFP56_PRES_G1_REG 0x15 +#define CPLD_QSFP56_PRES_G2_REG 0x16 +#define CPLD_QSFPDD_PRES_REG 0x17 +#define CPLD_QSFP56_FUSE_INT_G0_REG 0x18 +#define CPLD_QSFP56_FUSE_INT_G1_REG 0x19 +#define CPLD_QSFP56_FUSE_INT_G2_REG 0x1A +#define CPLD_QSFPDD_FUSE_INT_REG 0x1B +#define CPLD_SFP_TXFAULT_REG 0x1D +#define CPLD_SFP_ABS_REG 0x1E +#define CPLD_SFP_RXLOS_REG 0x1F +//Interrupt mask +#define CPLD_QSFP56_MOD_INT_MASK_G0_REG 0x20 +#define CPLD_QSFP56_MOD_INT_MASK_G1_REG 0x21 +#define CPLD_QSFP56_MOD_INT_MASK_G2_REG 0x22 +#define CPLD_QSFPDD_MOD_INT_MASK_REG 0x23 +#define CPLD_QSFP56_PRES_MASK_G0_REG 0x24 +#define CPLD_QSFP56_PRES_MASK_G1_REG 0x25 +#define CPLD_QSFP56_PRES_MASK_G2_REG 0x26 +#define CPLD_QSFPDD_PRES_MASK_REG 0x27 +#define CPLD_QSFP56_FUSE_INT_MASK_G0_REG 0x28 +#define CPLD_QSFP56_FUSE_INT_MASK_G1_REG 0x29 +#define CPLD_QSFP56_FUSE_INT_MASK_G2_REG 0x2A +#define CPLD_QSFPDD_FUSE_INT_MASK_REG 0x2B +#define CPLD_SFP_TXFAULT_MASK_REG 0x2D +#define CPLD_SFP_ABS_MASK_REG 0x2E +#define CPLD_SFP_RXLOS_MASK_REG 0x2F +//Interrupt event +#define CPLD_QSFP56_MOD_INT_EVENT_G0_REG 0x30 +#define CPLD_QSFP56_MOD_INT_EVENT_G1_REG 0x31 +#define CPLD_QSFP56_MOD_INT_EVENT_G2_REG 0x32 +#define CPLD_QSFPDD_MOD_INT_EVENT_REG 0x33 +#define CPLD_QSFP56_PRES_EVENT_G0_REG 0x34 +#define CPLD_QSFP56_PRES_EVENT_G1_REG 0x35 +#define CPLD_QSFP56_PRES_EVENT_G2_REG 0x36 +#define CPLD_QSFPDD_PRES_EVENT_REG 0x37 +#define CPLD_QSFP56_FUSE_INT_EVENT_G0_REG 0x38 +#define CPLD_QSFP56_FUSE_INT_EVENT_G1_REG 0x39 +#define CPLD_QSFP56_FUSE_INT_EVENT_G2_REG 0x3A +#define CPLD_QSFPDD_FUSE_INT_EVENT_REG 0x3B +#define CPLD_SFP_TXFAULT_EVENT_REG 0x3D +#define CPLD_SFP_ABS_EVENT_REG 0x3E +#define CPLD_SFP_RXLOS_EVENT_REG 0x3F +//Port ctrl +#define CPLD_QSFP56_RESET_CTRL_G0_REG 0x40 +#define CPLD_QSFP56_RESET_CTRL_G1_REG 0x41 +#define CPLD_QSFP56_RESET_CTRL_G2_REG 0x42 +#define CPLD_QSFPDD_RESET_CTRL_REG 0x43 +#define CPLD_QSFP56_LP_MODE_G0_REG 0x44 +#define CPLD_QSFP56_LP_MODE_G1_REG 0x45 +#define CPLD_QSFP56_LP_MODE_G2_REG 0x46 +#define CPLD_QSFPDD_LP_MODE_REG 0x47 +#define CPLD_SFP_TX_DIS_REG 0x55 +#define CPLD_SFP_RS_REG 0x56 +#define CPLD_SFP_TS_REG 0x57 +//Port status +#define CPLD_PORT_INT_STATUS_REG 0x58 + + +/* bit field structure for register value */ +struct cpld_reg_sku_id_t { + u8 model_id:8; +}; + +struct cpld_reg_hw_rev_t { + u8 hw_rev:2; + u8 deph_rev:1; + u8 build_rev:3; + u8 reserved:1; + u8 id_type:1; +}; + +struct cpld_reg_version_t { + u8 minor:6; + u8 major:2; +}; + +struct cpld_reg_id_t { + u8 id:3; + u8 release:5; +}; + +struct cpld_reg_beacon_led_ctrl_t { + u8 reserve:5; + u8 speed:1; + u8 blink:1; + u8 onoff:1; +}; + +/* common manipulation */ +#define INVALID(i, min, max) ((i < min) || (i > max) ? 1u : 0u) +#define READ_BIT(val, bit) ((0u == (val & (1<bf_name) +#define READ_BF_1(bf_struct, val, bf_name, bf_value) \ + bf_struct bf; \ + bf.data = val; \ + bf_value = bf.bf_name +#define HW_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, hw_rev, res) +#define DEPH_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, deph_rev, res) +#define BUILD_REV_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, build_rev, res) +#define ID_TYPE_GET(val, res) \ + READ_BF(cpld_reg_hw_rev_t, val, id_type, res) +#define CPLD_MAJOR_VERSION_GET(val, res) \ + READ_BF(cpld_reg_version_t, val, major, res) +#define CPLD_MINOR_VERSION_GET(val, res) \ + READ_BF(cpld_reg_version_t, val, minor, res) +#define CPLD_ID_ID_GET(val, res) \ + READ_BF(cpld_reg_id_t, val, id, res) + +/* CPLD access functions */ +extern int s9301_cpld_read(u8 cpld_idx, u8 reg); +extern int s9301_cpld_write(u8 cpld_idx, u8 reg, u8 value); + +#endif + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-lpc.c b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-lpc.c new file mode 100644 index 000000000000..01801b6c81bd --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-lpc.c @@ -0,0 +1,850 @@ +/* + * A lpc driver for the ufispace_s9301_32db + * + * Copyright (C) 2017-2020 UfiSpace Technology Corporation. + * Jason Tsai + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include + +#define BSP_LOG_R(fmt, args...) \ + _bsp_log (LOG_READ, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) +#define BSP_LOG_W(fmt, args...) \ + _bsp_log (LOG_WRITE, KERN_INFO "%s:%s[%d]: " fmt "\r\n", \ + __FILE__, __func__, __LINE__, ##args) + +#define BSP_PR(level, fmt, args...) _bsp_log (LOG_SYS, level "[BSP]" fmt "\r\n", ##args) + +#define DRIVER_NAME "x86_64_ufispace_s9301_32db_lpc" +#define CPU_BDE 0 +#define CPU_SKY 1 +#define CPU_TYPE CPU_SKY + +/* LPC registers */ + +#define REG_BASE_CPU 0x600 + +#if CPU_TYPE == CPU_SKY +#define REG_BASE_MB 0xE00 +#define REG_BASE_I2C_ALERT 0x700 +#else +#define REG_BASE_MB 0x700 +#define REG_BASE_I2C_ALERT 0xF000 +#endif + +//CPU CPLD +#define REG_CPU_CPLD_VERSION (REG_BASE_CPU + 0x00) +#define REG_CPU_STATUS_0 (REG_BASE_CPU + 0x01) +#define REG_CPU_STATUS_1 (REG_BASE_CPU + 0x02) +#define REG_CPU_CTRL_0 (REG_BASE_CPU + 0x03) +#define REG_CPU_CTRL_1 (REG_BASE_CPU + 0x04) +#define REG_CPU_CPLD_BUILD (REG_BASE_CPU + 0xE0) + +//MB CPLD +//TBD, need to change after CPLD spec release +#define REG_MB_BRD_ID_0 (REG_BASE_MB + 0x00) +#define REG_MB_BRD_ID_1 (REG_BASE_MB + 0x01) +#define REG_MB_CPLD_VERSION (REG_BASE_MB + 0x02) +#define REG_MB_CPLD_BUILD (REG_BASE_MB + 0x04) +#define REG_MB_MUX_RESET (REG_BASE_MB + 0x46) +#define REG_MB_MUX_CTRL (REG_BASE_MB + 0x5c) + +//I2C Alert +#if CPU_TYPE == CPU_SKY +#define REG_ALERT_STATUS (REG_BASE_I2C_ALERT + 0x80) +#else +#define REG_ALERT_STATUS (REG_BASE_I2C_ALERT + 0x00) +#define REG_ALERT_DISABLE (REG_BASE_I2C_ALERT + 0x11) +#endif + +#define MASK_ALL (0xFF) +#define LPC_MDELAY (5) + +/* LPC sysfs attributes index */ +enum lpc_sysfs_attributes { + //CPU CPLD + ATT_CPU_CPLD_VERSION, + ATT_CPU_CPLD_VERSION_H, + ATT_CPU_BIOS_BOOT_ROM, + ATT_CPU_BIOS_BOOT_CFG, + ATT_CPU_CPLD_BUILD, + //MB CPLD + ATT_MB_BRD_ID_0, + ATT_MB_BRD_ID_1, + ATT_MB_CPLD_1_VERSION, + ATT_MB_CPLD_1_VERSION_H, + ATT_MB_CPLD_1_BUILD, + ATT_MB_MUX_CTRL, + ATT_MB_MUX_RESET, + ATT_MB_BRD_SKU_ID, + ATT_MB_BRD_HW_ID, + ATT_MB_BRD_ID_TYPE, + ATT_MB_BRD_BUILD_ID, + ATT_MB_BRD_DEPH_ID, + //I2C Alert + ATT_ALERT_STATUS, +#if CPU_TYPE == CPU_BDE + ATT_ALERT_DISABLE, +#endif + //BSP + ATT_BSP_VERSION, + ATT_BSP_DEBUG, + ATT_BSP_PR_INFO, + ATT_BSP_PR_ERR, + ATT_BSP_REG, + ATT_MAX +}; + +enum bsp_log_types { + LOG_NONE, + LOG_RW, + LOG_READ, + LOG_WRITE, + LOG_SYS +}; + +enum bsp_log_ctrl { + LOG_DISABLE, + LOG_ENABLE +}; + +struct lpc_data_s { + struct mutex access_lock; +}; + +struct lpc_data_s *lpc_data; +char bsp_version[16]=""; +char bsp_debug[2]="0"; +char bsp_reg[8]="0x0"; +u8 enable_log_read=LOG_DISABLE; +u8 enable_log_write=LOG_DISABLE; +u8 enable_log_sys=LOG_ENABLE; + +/* reg shift */ +static u8 _shift(u8 mask) +{ + int i=0, mask_one=1; + + for(i=0; i<8; ++i) { + if((mask & mask_one) == 1) + return i; + else + mask >>= 1; + } + + return -1; +} + +/* reg mask and shift */ +static u8 _mask_shift(u8 val, u8 mask) +{ + int shift=0; + + shift = _shift(mask); + + return (val & mask) >> shift; +} + +static u8 _bit_operation(u8 reg_val, u8 bit, u8 bit_val) +{ + if(bit_val == 0) + reg_val = reg_val & ~(1 << bit); + else + reg_val = reg_val | (1 << bit); + return reg_val; +} + +static int _bsp_log(u8 log_type, char *fmt, ...) +{ + if((log_type==LOG_READ && enable_log_read) || + (log_type==LOG_WRITE && enable_log_write) || + (log_type==LOG_SYS && enable_log_sys) ) { + va_list args; + int r; + + va_start(args, fmt); + r = vprintk(fmt, args); + va_end(args); + + return r; + } else { + return 0; + } +} + +static int _config_bsp_log(u8 log_type) +{ + switch(log_type) { + case LOG_NONE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_RW: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_ENABLE; + break; + case LOG_READ: + enable_log_read = LOG_ENABLE; + enable_log_write = LOG_DISABLE; + break; + case LOG_WRITE: + enable_log_read = LOG_DISABLE; + enable_log_write = LOG_ENABLE; + break; + default: + return -EINVAL; + } + return 0; +} + +/* get lpc register value */ +static u8 _read_lpc_reg(u16 reg, u8 mask) +{ + u8 reg_val; + + mutex_lock(&lpc_data->access_lock); + reg_val=_mask_shift(inb(reg), mask); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return reg_val; +} + +/* get lpc register value */ +static ssize_t read_lpc_reg(u16 reg, u8 mask, char *buf) +{ + u8 reg_val; + int len=0; + + reg_val = _read_lpc_reg(reg, mask); + len=sprintf(buf,"0x%x\n", reg_val); + + return len; +} + +/* set lpc register value */ +static ssize_t write_lpc_reg(u16 reg, u8 mask, const char *buf, size_t count) +{ + u8 reg_val, reg_val_now, shift; + + if(kstrtou8(buf, 0, ®_val) < 0) + return -EINVAL; + + //apply SINGLE BIT operation if mask is specified, multiple bits are not supported + if(mask != MASK_ALL) { + reg_val_now = _read_lpc_reg(reg, 0x0); + shift = _shift(mask); + reg_val = _bit_operation(reg_val_now, shift, reg_val); + } + + mutex_lock(&lpc_data->access_lock); + + outb(reg_val, reg); + mdelay(LPC_MDELAY); + + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return count; +} + +/* get bsp value */ +static ssize_t read_bsp(char *buf, char *str) +{ + ssize_t len=0; + + mutex_lock(&lpc_data->access_lock); + len=sprintf(buf, "%s", str); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg_val=%s", str); + + return len; +} + +/* set bsp value */ +static ssize_t write_bsp(const char *buf, char *str, size_t str_len, size_t count) +{ + mutex_lock(&lpc_data->access_lock); + snprintf(str, str_len, "%s", buf); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_W("reg_val=%s", str); + + return count; +} + +/* get cpu cpld version in human readable format */ +static ssize_t read_cpu_cpld_version_h(struct device *dev, + struct device_attribute *da, char *buf) +{ + ssize_t len=0; + u16 reg = REG_CPU_CPLD_VERSION; + u8 mask = MASK_ALL; + u8 mask_major = 0b11000000; + u8 mask_minor = 0b00111111; + u8 reg_val; + u8 major, minor, build; + + mutex_lock(&lpc_data->access_lock); + reg_val = _mask_shift(inb(reg), mask); + major = _mask_shift(reg_val, mask_major); + minor = _mask_shift(reg_val, mask_minor); + reg = REG_CPU_CPLD_BUILD; + build = _mask_shift(inb(reg), mask); + len = sprintf(buf, "%d.%02d.%03d\n", major, minor, build); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return len; +} + +/* get mb cpld version in human readable format */ +static ssize_t read_mb_cpld_1_version_h(struct device *dev, + struct device_attribute *da, char *buf) +{ + ssize_t len=0; + u16 reg = REG_MB_CPLD_VERSION; + u8 mask = MASK_ALL; + u8 mask_major = 0b11000000; + u8 mask_minor = 0b00111111; + u8 reg_val; + u8 major, minor, build; + + mutex_lock(&lpc_data->access_lock); + reg_val = _mask_shift(inb(reg), mask); + major = _mask_shift(reg_val, mask_major); + minor = _mask_shift(reg_val, mask_minor); + reg = REG_MB_CPLD_BUILD; + build = _mask_shift(inb(reg), mask); + len = sprintf(buf, "%d.%02d.%03d\n", major, minor, build); + mutex_unlock(&lpc_data->access_lock); + + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + + return len; +} + +/* get mux_reset register value */ +static ssize_t read_mux_reset_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + int len = 0; + u16 reg = REG_MB_MUX_RESET; + u8 mask = 0b00011111; + u8 reg_val; + + mutex_lock(&lpc_data->access_lock); + reg_val=_mask_shift(inb(reg), mask); + BSP_LOG_R("reg=0x%03x, reg_val=0x%02x", reg, reg_val); + len=sprintf(buf, "%d\n", reg_val); + mutex_unlock(&lpc_data->access_lock); + + return len; +} + +/* set mux_reset register value */ +static ssize_t write_mux_reset_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + u8 val = 0; + u16 reg = REG_MB_MUX_RESET; + u8 reg_val = 0; + u8 mask = 0b00011111; + static int mux_reset_flag = 0; + + if(kstrtou8(buf, 0, &val) < 0) + return -EINVAL; + + if(mux_reset_flag == 0) { + if(val == 0) { + mutex_lock(&lpc_data->access_lock); + mux_reset_flag = 1; + BSP_LOG_W("i2c mux reset is triggered..."); + + reg_val = inb(reg); + outb((reg_val & ~mask), reg); + mdelay(LPC_MDELAY); + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val & ~mask); + mdelay(500); + outb((reg_val | mask), reg); + mdelay(LPC_MDELAY); + BSP_LOG_W("reg=0x%03x, reg_val=0x%02x", reg, reg_val | mask); + mdelay(500); + mux_reset_flag = 0; + mutex_unlock(&lpc_data->access_lock); + } else { + return -EINVAL; + } + } else { + BSP_LOG_W("i2c mux is resetting... (ignore)"); + mutex_lock(&lpc_data->access_lock); + mutex_unlock(&lpc_data->access_lock); + } + + return count; +} + +/* get lpc register value */ +static ssize_t read_lpc_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u16 reg = 0; + u8 mask = MASK_ALL; + + switch(attr->index) { + //CPU CPLD + case ATT_CPU_CPLD_VERSION: + reg = REG_CPU_CPLD_VERSION; + break; + case ATT_CPU_BIOS_BOOT_ROM: + reg = REG_CPU_STATUS_1; + mask = 0x80; + break; + case ATT_CPU_BIOS_BOOT_CFG: + reg = REG_CPU_CTRL_1; + mask = 0x80; + break; + case ATT_CPU_CPLD_BUILD: + reg = REG_CPU_CPLD_BUILD; + break; + //MB CPLD + case ATT_MB_BRD_ID_0: + reg = REG_MB_BRD_ID_0; + break; + case ATT_MB_BRD_ID_1: + reg = REG_MB_BRD_ID_1; + break; + case ATT_MB_CPLD_1_VERSION: + reg = REG_MB_CPLD_VERSION; + break; + case ATT_MB_CPLD_1_BUILD: + reg = REG_MB_CPLD_BUILD; + break; + case ATT_MB_BRD_SKU_ID: + reg = REG_MB_BRD_ID_0; + mask = 0xFF; + break; + case ATT_MB_BRD_HW_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x03; + break; + case ATT_MB_BRD_ID_TYPE: + reg = REG_MB_BRD_ID_1; + mask = 0x80; + break; + case ATT_MB_BRD_BUILD_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x38; + break; + case ATT_MB_BRD_DEPH_ID: + reg = REG_MB_BRD_ID_1; + mask = 0x04; + break; + case ATT_MB_MUX_CTRL: + reg = REG_MB_MUX_CTRL; + break; + //I2C Alert + case ATT_ALERT_STATUS: + reg = REG_ALERT_STATUS; + mask = 0x20; + break; +#if CPU_TYPE == CPU_BDE + case ATT_ALERT_DISABLE: + reg = REG_ALERT_DISABLE; + mask = 0x04; + break; +#endif + //BSP + case ATT_BSP_REG: + if(kstrtou16(bsp_reg, 0, ®) < 0) + return -EINVAL; + break; + default: + return -EINVAL; + } + return read_lpc_reg(reg, mask, buf); +} + +/* set lpc register value */ +static ssize_t write_lpc_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + u16 reg = 0; + u8 mask = MASK_ALL; + + switch(attr->index) { + case ATT_MB_MUX_CTRL: + reg = REG_MB_MUX_CTRL; + break; + default: + return -EINVAL; + } + return write_lpc_reg(reg, mask, buf, count); +} + +/* get bsp parameter value */ +static ssize_t read_bsp_callback(struct device *dev, + struct device_attribute *da, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + + switch(attr->index) { + case ATT_BSP_VERSION: + str = bsp_version; + str_len = sizeof(bsp_version); + break; + case ATT_BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + case ATT_BSP_REG: + str = bsp_reg; + str_len = sizeof(bsp_reg); + break; + default: + return -EINVAL; + } + return read_bsp(buf, str); +} + +/* set bsp parameter value */ +static ssize_t write_bsp_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len=0; + char *str=NULL; + u16 reg = 0; + u8 bsp_debug_u8 = 0; + + switch(attr->index) { + case ATT_BSP_VERSION: + str = bsp_version; + str_len = sizeof(bsp_version); + break; + case ATT_BSP_DEBUG: + str = bsp_debug; + str_len = sizeof(bsp_debug); + break; + case ATT_BSP_REG: + if(kstrtou16(buf, 0, ®) < 0) + return -EINVAL; + + str = bsp_reg; + str_len = sizeof(bsp_reg); + break; + default: + return -EINVAL; + } + + if(attr->index == ATT_BSP_DEBUG) { + if(kstrtou8(buf, 0, &bsp_debug_u8) < 0) { + return -EINVAL; + } else if(_config_bsp_log(bsp_debug_u8) < 0) { + return -EINVAL; + } + } + + return write_bsp(buf, str, str_len, count); +} + +static ssize_t write_bsp_pr_callback(struct device *dev, + struct device_attribute *da, const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + int str_len = strlen(buf); + + if(str_len <= 0) + return str_len; + + switch (attr->index) { + case ATT_BSP_PR_INFO: + BSP_PR(KERN_INFO, "%s", buf); + break; + case ATT_BSP_PR_ERR: + BSP_PR(KERN_ERR, "%s", buf); + break; + default: + return -EINVAL; + } + + return str_len; +} + +//SENSOR_DEVICE_ATTR - CPU +static SENSOR_DEVICE_ATTR(cpu_cpld_version, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_CPLD_VERSION); +static SENSOR_DEVICE_ATTR(cpu_cpld_version_h, S_IRUGO, read_cpu_cpld_version_h, NULL, ATT_CPU_CPLD_VERSION_H); +static SENSOR_DEVICE_ATTR(boot_rom, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_BIOS_BOOT_ROM); +static SENSOR_DEVICE_ATTR(boot_cfg, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_BIOS_BOOT_CFG); +static SENSOR_DEVICE_ATTR(cpu_cpld_build, S_IRUGO, read_lpc_callback, NULL, ATT_CPU_CPLD_BUILD); +//SENSOR_DEVICE_ATTR - MB +static SENSOR_DEVICE_ATTR(board_id_0, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_0); +static SENSOR_DEVICE_ATTR(board_id_1, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_1); +static SENSOR_DEVICE_ATTR(mb_cpld_1_version, S_IRUGO, read_lpc_callback, NULL, ATT_MB_CPLD_1_VERSION); +static SENSOR_DEVICE_ATTR(mb_cpld_1_version_h, S_IRUGO, read_mb_cpld_1_version_h, NULL, ATT_MB_CPLD_1_VERSION_H); +static SENSOR_DEVICE_ATTR(mb_cpld_1_build, S_IRUGO, read_lpc_callback, NULL, ATT_MB_CPLD_1_BUILD); +static SENSOR_DEVICE_ATTR(mux_ctrl, S_IRUGO | S_IWUSR, read_lpc_callback, write_lpc_callback, ATT_MB_MUX_CTRL); +static SENSOR_DEVICE_ATTR(mux_reset, S_IRUGO | S_IWUSR, read_mux_reset_callback, write_mux_reset_callback, ATT_MB_MUX_RESET); +static SENSOR_DEVICE_ATTR(board_sku_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_SKU_ID); +static SENSOR_DEVICE_ATTR(board_hw_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_HW_ID); +static SENSOR_DEVICE_ATTR(board_id_type, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_ID_TYPE); +static SENSOR_DEVICE_ATTR(board_build_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_BUILD_ID); +static SENSOR_DEVICE_ATTR(board_deph_id, S_IRUGO, read_lpc_callback, NULL, ATT_MB_BRD_DEPH_ID); +//SENSOR_DEVICE_ATTR - I2C Alert +static SENSOR_DEVICE_ATTR(alert_status, S_IRUGO, read_lpc_callback, NULL, ATT_ALERT_STATUS); +#if CPU_TYPE == CPU_BDE +static SENSOR_DEVICE_ATTR(alert_disable, S_IRUGO, read_lpc_callback, NULL, ATT_ALERT_DISABLE); +#endif +//SENSOR_DEVICE_ATTR - BSP +static SENSOR_DEVICE_ATTR(bsp_version, S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_VERSION); +static SENSOR_DEVICE_ATTR(bsp_debug, S_IRUGO | S_IWUSR, read_bsp_callback, write_bsp_callback, ATT_BSP_DEBUG); +static SENSOR_DEVICE_ATTR(bsp_pr_info, S_IWUSR, NULL, write_bsp_pr_callback, ATT_BSP_PR_INFO); +static SENSOR_DEVICE_ATTR(bsp_pr_err, S_IWUSR, NULL, write_bsp_pr_callback, ATT_BSP_PR_ERR); +static SENSOR_DEVICE_ATTR(bsp_reg, S_IRUGO | S_IWUSR, read_lpc_callback, write_bsp_callback, ATT_BSP_REG); + +static struct attribute *cpu_cpld_attrs[] = { + &sensor_dev_attr_cpu_cpld_version.dev_attr.attr, + &sensor_dev_attr_cpu_cpld_version_h.dev_attr.attr, + &sensor_dev_attr_cpu_cpld_build.dev_attr.attr, + NULL, +}; + +static struct attribute *mb_cpld_attrs[] = { + &sensor_dev_attr_board_id_0.dev_attr.attr, + &sensor_dev_attr_board_id_1.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_version.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_version_h.dev_attr.attr, + &sensor_dev_attr_mb_cpld_1_build.dev_attr.attr, + &sensor_dev_attr_board_sku_id.dev_attr.attr, + &sensor_dev_attr_board_hw_id.dev_attr.attr, + &sensor_dev_attr_board_id_type.dev_attr.attr, + &sensor_dev_attr_board_build_id.dev_attr.attr, + &sensor_dev_attr_board_deph_id.dev_attr.attr, + &sensor_dev_attr_mux_ctrl.dev_attr.attr, + &sensor_dev_attr_mux_reset.dev_attr.attr, + NULL, +}; + +static struct attribute *bios_attrs[] = { + &sensor_dev_attr_boot_rom.dev_attr.attr, + &sensor_dev_attr_boot_cfg.dev_attr.attr, + NULL, +}; + +static struct attribute *i2c_alert_attrs[] = { + &sensor_dev_attr_alert_status.dev_attr.attr, +#if CPU_TYPE == CPU_BDE + &sensor_dev_attr_alert_disable.dev_attr.attr, +#endif + NULL, +}; + +static struct attribute *bsp_attrs[] = { + &sensor_dev_attr_bsp_version.dev_attr.attr, + &sensor_dev_attr_bsp_debug.dev_attr.attr, + &sensor_dev_attr_bsp_pr_info.dev_attr.attr, + &sensor_dev_attr_bsp_pr_err.dev_attr.attr, + &sensor_dev_attr_bsp_reg.dev_attr.attr, + NULL, +}; + +static struct attribute_group cpu_cpld_attr_grp = { + .name = "cpu_cpld", + .attrs = cpu_cpld_attrs, +}; + +static struct attribute_group mb_cpld_attr_grp = { + .name = "mb_cpld", + .attrs = mb_cpld_attrs, +}; + +static struct attribute_group bios_attr_grp = { + .name = "bios", + .attrs = bios_attrs, +}; + +static struct attribute_group i2c_alert_attr_grp = { + .name = "i2c_alert", + .attrs = i2c_alert_attrs, +}; + +static struct attribute_group bsp_attr_grp = { + .name = "bsp", + .attrs = bsp_attrs, +}; + +static void lpc_dev_release( struct device * dev) +{ + return; +} + +static struct platform_device lpc_dev = { + .name = DRIVER_NAME, + .id = -1, + .dev = { + .release = lpc_dev_release, + } +}; + +static int lpc_drv_probe(struct platform_device *pdev) +{ + int i = 0, grp_num = 5; + int err[5] = {0}; + struct attribute_group *grp; + + lpc_data = devm_kzalloc(&pdev->dev, sizeof(struct lpc_data_s), + GFP_KERNEL); + if(!lpc_data) + return -ENOMEM; + + mutex_init(&lpc_data->access_lock); + + for (i=0; idev.kobj, grp); + if(err[i]) { + printk(KERN_ERR "Cannot create sysfs for group %s\n", grp->name); + goto exit; + } else { + continue; + } + } + + return 0; + +exit: + for (i=0; idev.kobj, grp); + if(!err[i]) { + //remove previous successful cases + continue; + } else { + //remove first failed case, then return + return err[i]; + } + } + return 0; +} + +static int lpc_drv_remove(struct platform_device *pdev) +{ + sysfs_remove_group(&pdev->dev.kobj, &cpu_cpld_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &mb_cpld_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &bios_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &i2c_alert_attr_grp); + sysfs_remove_group(&pdev->dev.kobj, &bsp_attr_grp); + + return 0; +} + +static struct platform_driver lpc_drv = { + .probe = lpc_drv_probe, + .remove = __exit_p(lpc_drv_remove), + .driver = { + .name = DRIVER_NAME, + }, +}; + +int lpc_init(void) +{ + int err = 0; + + err = platform_driver_register(&lpc_drv); + if(err) { + printk(KERN_ERR "%s(#%d): platform_driver_register failed(%d)\n", + __func__, __LINE__, err); + + return err; + } + + err = platform_device_register(&lpc_dev); + if(err) { + printk(KERN_ERR "%s(#%d): platform_device_register failed(%d)\n", + __func__, __LINE__, err); + platform_driver_unregister(&lpc_drv); + return err; + } + + return err; +} + +void lpc_exit(void) +{ + platform_driver_unregister(&lpc_drv); + platform_device_unregister(&lpc_dev); +} + +MODULE_AUTHOR("Leo Lin "); +MODULE_DESCRIPTION("x86_64_ufispace_s9301_32db_lpc driver"); +MODULE_LICENSE("GPL"); + +module_init(lpc_init); +module_exit(lpc_exit); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-sys-eeprom.c b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-sys-eeprom.c new file mode 100644 index 000000000000..3fa3ae4c9681 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/modules/x86-64-ufispace-s9301-32db-sys-eeprom.c @@ -0,0 +1,283 @@ +/* + * Copyright (C) 1998, 1999 Frodo Looijaard and + * Philip Edelbrock + * Copyright (C) 2003 Greg Kroah-Hartman + * Copyright (C) 2003 IBM Corp. + * Copyright (C) 2004 Jean Delvare + * + * 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. + */ + +/* enable dev_dbg print out */ +//#define DEBUG + +#define __STDC_WANT_LIB_EXT1__ 1 +#include +#include +#include +#include +#include +#include +#include +#include + +#define _memset(s, c, n) memset(s, c, n) + +/* Addresses to scan */ +static const unsigned short normal_i2c[] = { /*0x50, 0x51, 0x52, 0x53, 0x54, + 0x55, 0x56, 0x57,*/ I2C_CLIENT_END }; + +/* Size of EEPROM in bytes */ +#define EEPROM_SIZE 512 + +#define SLICE_BITS (6) +#define SLICE_SIZE (1 << SLICE_BITS) +#define SLICE_NUM (EEPROM_SIZE/SLICE_SIZE) + +/* Each client has this additional data */ +struct eeprom_data { + struct mutex update_lock; + u8 valid; /* bitfield, bit!=0 if slice is valid */ + unsigned long last_updated[SLICE_NUM]; /* In jiffies, 8 slices */ + u8 data[EEPROM_SIZE]; /* Register values */ +}; + + +static void sys_eeprom_update_client(struct i2c_client *client, u8 slice) +{ + struct eeprom_data *data = i2c_get_clientdata(client); + int i, j; + int ret; + int addr; + + mutex_lock(&data->update_lock); + + if (!(data->valid & (1 << slice)) || + time_after(jiffies, data->last_updated[slice] + 300 * HZ)) { + dev_dbg(&client->dev, "Starting eeprom update, slice %u\n", slice); + + addr = slice << SLICE_BITS; + + ret = i2c_smbus_write_byte_data(client, (u8)((addr >> 8) & 0xFF), (u8)(addr & 0xFF)); + /* select the eeprom address */ + if (ret < 0) { + dev_err(&client->dev, "address set failed\n"); + goto exit; + } + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_BYTE)) { + goto exit; + } + + for (i = slice << SLICE_BITS; i < (slice + 1) << SLICE_BITS; i+= SLICE_SIZE) { + for (j = i; j < (i+SLICE_SIZE); j++) { + int res; + + res = i2c_smbus_read_byte(client); + if (res < 0) { + goto exit; + } + + data->data[j] = res & 0xFF; + } + } + + data->last_updated[slice] = jiffies; + data->valid |= (1 << slice); + } +exit: + mutex_unlock(&data->update_lock); +} + +static ssize_t sys_eeprom_read(struct file *filp, struct kobject *kobj, + struct bin_attribute *bin_attr, + char *buf, loff_t off, size_t count) +{ + struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); + struct eeprom_data *data = i2c_get_clientdata(client); + u8 slice; + + if (off > EEPROM_SIZE) { + return 0; + } + if (off + count > EEPROM_SIZE) { + count = EEPROM_SIZE - off; + } + if (count == 0) { + return 0; + } + + /* Only refresh slices which contain requested bytes */ + for (slice = off >> SLICE_BITS; slice <= (off + count - 1) >> SLICE_BITS; slice++) { + sys_eeprom_update_client(client, slice); + } + + memcpy(buf, &data->data[off], count); + + return count; +} + +static ssize_t sys_eeprom_write(struct file *filp, struct kobject *kobj, + struct bin_attribute *bin_attr, + char *buf, loff_t off, size_t count) +{ + struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); + struct eeprom_data *data = i2c_get_clientdata(client); + int ret; + int i; + u8 cmd; + u16 value16; + + dev_dbg(&client->dev, "sys_eeprom_write off=%d, count=%d\n", (int)off, (int)count); + + if (off > EEPROM_SIZE) { + return 0; + } + if (off + count > EEPROM_SIZE) { + count = EEPROM_SIZE - off; + } + if (count == 0) { + return 0; + } + + mutex_lock(&data->update_lock); + + for(i=0; i < count; i++) { + /* write command */ + cmd = (off >> 8) & 0xff; + value16 = off & 0xff; + value16 |= buf[i] << 8; + ret = i2c_smbus_write_word_data(client, cmd, value16); + + if (ret < 0) { + dev_err(&client->dev, "write address failed at %d \n", (int)off); + goto exit; + } + + off++; + + /* need to wait for write complete */ + udelay(10000); + } +exit: + mutex_unlock(&data->update_lock); + /* force to update client when reading */ + for(i=0; i < SLICE_NUM; i++) { + data->last_updated[i] = 0; + } + + return count; +} + +static struct bin_attribute sys_eeprom_attr = { + .attr = { + .name = "eeprom", + .mode = S_IRUGO | S_IWUSR, + }, + .size = EEPROM_SIZE, + .read = sys_eeprom_read, + .write = sys_eeprom_write, +}; + +/* Return 0 if detection is successful, -ENODEV otherwise */ +static int sys_eeprom_detect(struct i2c_client *client, struct i2c_board_info *info) +{ + struct i2c_adapter *adapter = client->adapter; + + /* EDID EEPROMs are often 24C00 EEPROMs, which answer to all + addresses 0x50-0x57, but we only care about 0x51 and 0x55. So decline + attaching to addresses >= 0x56 on DDC buses */ + if (!(adapter->class & I2C_CLASS_SPD) && client->addr >= 0x56) { + return -ENODEV; + } + + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE) + && !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { + return -ENODEV; + } + + strlcpy(info->type, "eeprom", I2C_NAME_SIZE); + + return 0; +} + +static int sys_eeprom_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct eeprom_data *data; + int err; + + if (!(data = kzalloc(sizeof(struct eeprom_data), GFP_KERNEL))) { + err = -ENOMEM; + goto exit; + } + +#ifdef __STDC_LIB_EXT1__ + memset_s(data->data, EEPROM_SIZE, 0xff, EEPROM_SIZE); +#else + _memset(data->data, 0xff, EEPROM_SIZE); +#endif + + i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + + /* create the sysfs eeprom file */ + err = sysfs_create_bin_file(&client->dev.kobj, &sys_eeprom_attr); + if (err) { + goto exit_kfree; + } + + return 0; + +exit_kfree: + kfree(data); +exit: + return err; +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +static int +#else +static void +#endif +sys_eeprom_remove(struct i2c_client *client) +{ + sysfs_remove_bin_file(&client->dev.kobj, &sys_eeprom_attr); + kfree(i2c_get_clientdata(client)); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) + return 0; +#endif +} + +static const struct i2c_device_id sys_eeprom_id[] = { + { "sys_eeprom", 0 }, + { } +}; + +static struct i2c_driver sys_eeprom_driver = { + .driver = { + .name = "sys_eeprom", + }, + .probe = sys_eeprom_probe, + .remove = sys_eeprom_remove, + .id_table = sys_eeprom_id, + + .class = I2C_CLASS_DDC | I2C_CLASS_SPD, + .detect = sys_eeprom_detect, + .address_list = normal_i2c, +}; + +module_i2c_driver(sys_eeprom_driver); + +MODULE_AUTHOR("Wade "); +MODULE_DESCRIPTION("UfiSpace Mother Board EEPROM driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/service/pddf-platform-init.service new file mode 100644 index 000000000000..41fa67214fc8 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/service/pddf-platform-init.service @@ -0,0 +1,14 @@ +[Unit] +Description=PDDF module and device initialization service +Before=pmon.service +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStartPre=-/usr/local/bin/pre_pddf_init.sh +ExecStart=/usr/local/bin/pddf_util.py install +ExecStop=/usr/local/bin/pddf_util.py clean +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/__init__.py new file mode 100644 index 000000000000..593867d31c9d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/__init__.py @@ -0,0 +1,4 @@ +# All the derived classes for PDDF +__all__ = ["platform", "chassis", "sfp", "psu", "thermal", "fan"] +from . import platform + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/chassis.py new file mode 100644 index 000000000000..6c77e2424b89 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/chassis.py @@ -0,0 +1,189 @@ +#!/usr/bin/env python + +############################################################################# +# PDDF +# Module contains an implementation of SONiC Chassis API +# +############################################################################# + +try: + import time + from sonic_platform_pddf_base.pddf_chassis import PddfChassis + from sonic_py_common import device_info +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_COMPONENT = 5 + +class Chassis(PddfChassis): + """ + PDDF Platform-specific Chassis class + """ + + port_dict = {} + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfChassis.__init__(self, pddf_data, pddf_plugin_data) + self._initialize_components() + + def _initialize_components(self): + from sonic_platform.component import Component + for index in range(NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + # Provide the functions/variables below for which implementation is to be overwritten + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.platform_name_str() + + def initizalize_system_led(self): + return True + + def get_status_led(self): + return self.get_system_led("SYS_LED") + + def get_change_event(self, timeout=0): + """ + Returns a nested dictionary containing all devices which have + experienced a change at chassis level + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + Returns: + (bool, dict): + - bool: True if call successful, False if not; + - dict: A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, where device_id is the device ID + for this device and device_event. + The known devices's device_id and device_event was defined as table below. + ----------------------------------------------------------------- + device | device_id | device_event | annotate + ----------------------------------------------------------------- + 'sfp' '' '0' Sfp removed + '1' Sfp inserted + '2' I2C bus stuck + '3' Bad eeprom + '4' Unsupported cable + '5' High Temperature + '6' Bad cable + -------------------------------------------------------------------- + Ex. 'sfp':{'11':'0', '12':'1'}, + Indicates that: + sfp 11 has been removed, sfp 12 has been inserted. + Note: For sfp, when event 3-6 happened, the module will not be avalaible, + XCVRD shall stop to read eeprom before SFP recovered from error status. + """ + + change_event_dict = {"sfp": {}} + + start_time = time.time() + forever = False + + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + print("get_change_event:Invalid timeout value", timeout) + return False, change_event_dict + + end_time = start_time + timeout + if start_time > end_time: + print( + "get_change_event:" "time wrap / invalid timeout value", + timeout, + ) + return False, change_event_dict # Time wrap or possibly incorrect timeout + try: + while timeout >= 0: + # check for sfp + sfp_change_dict = self.get_transceiver_change_event() + + if sfp_change_dict: + change_event_dict["sfp"] = sfp_change_dict + return True, change_event_dict + if forever: + time.sleep(1) + else: + timeout = end_time - time.time() + if timeout >= 1: + time.sleep(1) # We poll at 1 second granularity + else: + if timeout > 0: + time.sleep(timeout) + return True, change_event_dict + except Exception as e: + print(e) + print("get_change_event: Should not reach here.") + return False, change_event_dict + + def get_transceiver_change_event(self, timeout=0): + current_port_dict = {} + ret_dict = {} + + # Check for OIR events and return ret_dict + for index in range(self.platform_inventory['num_ports']): + if self._sfp_list[index].get_presence(): + current_port_dict[index] = self.plugin_data['XCVR']['plug_status']['inserted'] + else: + current_port_dict[index] = self.plugin_data['XCVR']['plug_status']['removed'] + + if len(self.port_dict) == 0: # first time + self.port_dict = current_port_dict + return {} + + if current_port_dict == self.port_dict: + return {} + + # Update reg value + for index, status in current_port_dict.items(): + if self.port_dict[index] != status: + ret_dict[index] = status + #ret_dict[str(index)] = status + self.port_dict = current_port_dict + for index, status in ret_dict.items(): + if int(status) == 1: + pass + #self._sfp_list[int(index)].check_sfp_optoe_type() + return ret_dict + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + + reboot_cause_path = self.plugin_data['REBOOT_CAUSE']['reboot_cause_file'] + + try: + with open(reboot_cause_path, 'r', errors='replace') as fd: + data = fd.read() + sw_reboot_cause = data.strip() + except IOError: + sw_reboot_cause = "Unknown" + + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this + chassis. + """ + + return self.get_serial() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/component.py new file mode 100644 index 000000000000..b94a10d616d6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/component.py @@ -0,0 +1,131 @@ +############################################################################# +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +try: + import subprocess + from sonic_platform_base.component_base import ComponentBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_SYSFS = { + "CPLD1": "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/cpld1_version", + "CPLD2": "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/cpld2_version", + "CPLD3": "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/cpld3_version", +} + +BMC_CMDS = { + "BMC": "bash -c 'tmp=$(ipmitool raw 0x6 0x1) && r=($(echo \"$tmp\" | cut -d \" \" -f 4,5,16,15,14)) && echo ${r[0]}.${r[1]}.${r[4]}.${r[3]}${r[2]}'", +} + +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_LIST= [ + ("CPLD1", "CPLD 1"), + ("CPLD2", "CPLD 2"), + ("CPLD3", "CPLD 3"), + ("BIOS", "Basic Input/Output System"), + ("BMC", "BMC"), + +] + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + self.index = component_index + self.name = self.get_name() + + def _run_command(self, command): + # Run bash command and print output to stdout + try: + process = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + rc = process.poll() + if rc != 0: + return False + except Exception: + return False + return True + + def _get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + return None + + def _get_cpld_version(self): + # Retrieves the CPLD firmware version + cpld_version = dict() + for cpld_name in CPLD_SYSFS: + cmd = "cat {}".format(CPLD_SYSFS[cpld_name]) + status, value = subprocess.getstatusoutput(cmd) + if not status: + cpld_version_raw = value.rstrip() + cpld_version_int = int(cpld_version_raw,16) + cpld_version[cpld_name] = "{}.{:02d}".format(cpld_version_int >> 6, + cpld_version_int & 0b00111111) + + return cpld_version + + def _get_bmc_version(self): + # Retrieves the BMC firmware version + status, value = subprocess.getstatusoutput(BMC_CMDS["BMC"]) + if not status: + return value + else: + return None + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + + if self.name == "BIOS": + fw_version = self._get_bios_version() + elif "CPLD" in self.name: + cpld_version = self._get_cpld_version() + fw_version = cpld_version.get(self.name) + elif self.name == "BMC": + fw_version = self._get_bmc_version() + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/eeprom.py new file mode 100644 index 000000000000..90ab1c779a48 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/eeprom.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_eeprom import PddfEeprom +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Eeprom(PddfEeprom): + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfEeprom.__init__(self, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + + def platform_name_str(self): + (is_valid, results) = self.get_tlv_field(self.eeprom_data, self._TLV_CODE_PLATFORM_NAME) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/fan.py new file mode 100644 index 000000000000..3082de54a140 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/fan.py @@ -0,0 +1,172 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan import PddfFan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Fan(PddfFan): + """PDDF Platform-Specific Fan class""" + + def __init__(self, tray_idx, fan_idx=0, pddf_data=None, pddf_plugin_data=None, is_psu_fan=False, psu_index=0): + # idx is 0-based + PddfFan.__init__(self, tray_idx, fan_idx, pddf_data, pddf_plugin_data, is_psu_fan, psu_index) + + # Provide the functions/variables below for which implementation is to be overwritten + # Since psu_fan airflow direction cant be read from sysfs, it is fixed as 'F2B' or 'intake' + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + speed_percentage = 0 + if self.is_psu_fan: + attr = "psu_fan{}_speed_rpm".format(self.fan_index) + device = "PSU{}".format(self.fans_psu_index) + max_speed = int(self.plugin_data['PSU']['PSU_FAN_MAX_SPEED']) + else: + if self.fan_index == 1: + pos = "f" + max_speed = int(self.plugin_data['FAN']['FAN_F_MAX_SPEED']) + else: + pos = "r" + max_speed = int(self.plugin_data['FAN']['FAN_R_MAX_SPEED']) + attr = "fan{}_{}_speed_rpm".format(self.fantray_index, pos) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + if not output: + return speed_percentage + + output['status'] = output['status'].rstrip() + if output['status'].isalpha(): + return speed_percentage + else: + speed = int(float(output['status'])) + + speed_percentage = round((speed*100)/max_speed) + + return min(speed_percentage, 100) + + def get_speed_rpm(self): + """ + Retrieves the speed of fan in RPM + + Returns: + An integer, Speed of fan in RPM + """ + rpm_speed = 0 + if self.is_psu_fan: + attr = "psu_fan{}_speed_rpm".format(self.fan_index) + device = "PSU{}".format(self.fans_psu_index) + else: + if self.fan_index == 1: + pos = "f" + else: + pos = "r" + attr = "fan{}_{}_speed_rpm".format(self.fantray_index, pos) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + + if output is None: + return rpm_speed + + output['status'] = output['status'].rstrip() + if output['status'].isalpha(): + return rpm_speed + else: + rpm_speed = int(float(output['status'])) + + return rpm_speed + + def get_direction(self): + """ + Retrieves the direction of fan + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + direction = self.FAN_DIRECTION_INTAKE + if self.is_psu_fan: + attr = "psu_fan{}_dir".format(self.fan_index) + device = "PSU{}".format(self.fans_psu_index) + else: + attr = "fan{}_dir".format(self.fantray_index) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + if not output: + return direction + + mode = output['mode'] + val = output['status'].strip() + vmap = self.plugin_data['FAN']['direction'][mode]['valmap'] + + if val in vmap: + direction = vmap[val] + + return direction + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + presence = False + if self.is_psu_fan: + attr = "psu_present" + device = "PSU{}".format(self.fans_psu_index) + else: + attr = "fan{}_present".format(self.fantray_index) + device = "FAN-CTRL" + + output = self.pddf_obj.get_attr_name_output(device, attr) + if not output: + return presence + + + mode = output['mode'] + val = output['status'].strip() + + if self.is_psu_fan: + vmap = self.plugin_data['PSU']['psu_present'][mode]['valmap'] + else: + vmap = self.plugin_data['FAN']['present'][mode]['valmap'] + + if val in vmap: + presence = vmap[val] + + return presence + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + return self.get_speed() + + def set_speed(self, speed): + """ + Sets the fan speed + + Args: + speed: An integer, the percentage of full fan speed to set fan to, + in the range 0 (off) to 100 (full speed) + + Returns: + A boolean, True if speed is set successfully, False if not + """ + + print("Setting Fan speed is not allowed") + return False + diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..3b9bb607f632 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/fan_drawer.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(PddfFanDrawer): + """PDDF Platform-Specific Fan-Drawer class""" + + def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None): + # idx is 0-based + PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/platform.py similarity index 58% rename from platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/watchdog.py rename to platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/platform.py index 88660b1a1faa..406b1179ae1b 100644 --- a/platform/broadcom/sonic-platform-modules-ufispace/s9300-32d/sonic_platform/watchdog.py +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/platform.py @@ -1,23 +1,25 @@ #!/usr/bin/env python ############################################################################# -# -# Module contains an implementation of platform specific watchdog API's +# PDDF +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information # ############################################################################# + try: - from sonic_platform_pddf_base.pddf_watchdog import PddfWatchdog + from sonic_platform_pddf_base.pddf_platform import PddfPlatform except ImportError as e: raise ImportError(str(e) + "- required module not found") -class Watchdog(PddfWatchdog): + +class Platform(PddfPlatform): """ - PDDF Platform-specific Chassis class + PDDF Platform-Specific Platform Class """ def __init__(self): - PddfWatchdog.__init__(self) - self.timeout= 180 + PddfPlatform.__init__(self) # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/psu.py new file mode 100644 index 000000000000..3e213415f314 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/psu.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_psu import PddfPsu +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Psu(PddfPsu): + """PDDF Platform-Specific PSU class""" + + PLATFORM_PSU_CAPACITY = 1300 + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfPsu.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return float(self.PLATFORM_PSU_CAPACITY) + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, + e.g. 302.6 + """ + + # power is returned in micro watts + return round(float(self.get_voltage()*self.get_current()), 2) + + def get_capacity(self): + """ + Retrieves the maximum supplied power by PSU (or PSU capacity) + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return self.get_maximum_supplied_power() + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + return self.plugin_data['PSU']['DEFAULT_TYPE'] \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/sfp.py new file mode 100644 index 000000000000..c7919482f69c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/sfp.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_sfp import PddfSfp +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Sfp(PddfSfp): + """ + PDDF Platform-Specific Sfp class + """ + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfSfp.__init__(self, index, pddf_data, pddf_plugin_data) + self.index = index + + # Provide the functions/variables below for which implementation is to be overwritten + + def get_error_description(self): + """ + Retrives the error descriptions of the SFP module + Returns: + String that represents the current error descriptions of vendor specific errors + In case there are multiple errors, they should be joined by '|', + like: "Bad EEPROM|Unsupported cable" + """ + if not self.get_presence(): + return self.SFP_STATUS_UNPLUGGED + + return self.SFP_STATUS_OK diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/thermal.py new file mode 100644 index 000000000000..77d6ec7ae886 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform/thermal.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_thermal import PddfThermal +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + + +class Thermal(PddfThermal): + """PDDF Platform-Specific Thermal class""" + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform_setup.py new file mode 100644 index 000000000000..3661c84a0cd6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/sonic_platform_setup.py @@ -0,0 +1,27 @@ +from setuptools import setup + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on ufispace platform', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + maintainer='Leo Lin', + maintainer_email='leo.yt.lin@ufispace.com', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_post_device_create.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_post_device_create.sh new file mode 100755 index 000000000000..e4de7ae3669e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_post_device_create.sh @@ -0,0 +1,6 @@ +#!/bin/bash +#disable bmc watchdog +timeout 3 ipmitool mc watchdog off + +echo 1 > /sys/kernel/pddf/devices/sysstatus/sysstatus_data/port_led_clr_ctrl +echo "PDDF device post-create completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_post_driver_install.sh b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_post_driver_install.sh new file mode 100755 index 000000000000..ed2559977e42 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_post_driver_install.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "PDDF driver post-install completed" diff --git a/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_switch_svc.py b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_switch_svc.py new file mode 100755 index 000000000000..f5e45045fc12 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-ufispace/s9301-32db/utils/pddf_switch_svc.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# Script to stop and start the respective platforms default services. +# This will be used while switching the pddf->non-pddf mode and vice versa +import commands + +def check_pddf_support(): + return True + +def stop_platform_svc(): + + ''' + status, output = commands.getstatusoutput("systemctl stop s9301-32db-platform-monitor-fan.service") + if status: + print "Stop s9301-32db-platform-fan.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl stop s9301-32db-platform-monitor-psu.service") + if status: + print "Stop s9301-32db-platform-psu.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl stop s9301-32db-platform-monitor.service") + if status: + print "Stop s9301-32db-platform-init.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl disable s9301-32db-platform-monitor.service") + if status: + print "Disable s9301-32db-platform-monitor.service failed %d"%status + return False + ''' + + status, output = commands.getstatusoutput("/usr/local/bin/platform_utility.py deinit") + if status: + print "platform_utility.py deinit command failed %d"%status + return False + + # HACK , stop the pddf-platform-init service if it is active + status, output = commands.getstatusoutput("systemctl stop pddf-platform-init.service") + if status: + print "Stop pddf-platform-init.service along with other platform serives failed %d"%status + return False + + return True + +def start_platform_svc(): + + status, output = commands.getstatusoutput("/usr/local/bin/platform_utility.py init") + if status: + print "platform_utility.py init command failed %d"%status + return False + + ''' + status, output = commands.getstatusoutput("systemctl enable s9301-32db-platform-monitor.service") + if status: + print "Enable s9301-32db-platform-monitor.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl start s9301-32db-platform-monitor-fan.service") + if status: + print "Start s9301-32db-platform-monitor-fan.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl start s9301-32db-platform-monitor-psu.service") + if status: + print "Start s9301-32db-platform-monitor-psu.service failed %d"%status + return False + ''' + return True + +def start_platform_pddf(): + + status, output = commands.getstatusoutput("systemctl start pddf-platform-init.service") + if status: + print "Start pddf-platform-init.service failed %d"%status + return False + + return True + +def stop_platform_pddf(): + + status, output = commands.getstatusoutput("systemctl stop pddf-platform-init.service") + if status: + print "Stop pddf-platform-init.service failed %d"%status + return False + + return True +