From 7b844f2df1c63ccdf3240c4ead34edbf7356254c Mon Sep 17 00:00:00 2001 From: Oleksandr Shamray Date: Tue, 9 Oct 2018 10:47:47 +0000 Subject: [PATCH] add: MSN3800 (Tigris) system support Signed-off-by: Oleksandr Shamray --- .../mlnx_common/module/src/mlnx_common_int.h | 2 +- .../mlnx_common/module/src/mlnx_common_sysi.c | 6 +- .../x86-64/x86-64-mlnx-msn3800/.project | 27 ++++ .../x86-64/x86-64-mlnx-msn3800/Makefile | 1 + .../x86-64-mlnx-msn3800/modules/Makefile | 1 + .../x86-64-mlnx-msn3800/modules/PKG.yml | 1 + .../x86-64/x86-64-mlnx-msn3800/onlp/Makefile | 1 + .../x86-64/x86-64-mlnx-msn3800/onlp/PKG.yml | 1 + .../x86-64-mlnx-msn3800/onlp/builds/Makefile | 2 + .../onlp/builds/lib/Makefile | 46 ++++++ .../lib/libonlp-x86-64-mlnx-msn3800-r0.mk | 10 ++ .../builds/lib/libonlp-x86-64-mlnx-msn3800.mk | 10 ++ .../onlp/builds/lib/x86_64_mlnx_msn3800.mk | 10 ++ .../onlp/builds/onlpdump/Makefile | 46 ++++++ .../onlp/builds/onlpdump/onlpdump.mk | 10 ++ .../onlp/builds/src/.module | 1 + .../onlp/builds/src/Makefile | 9 ++ .../onlp/builds/src/README | 6 + .../onlp/builds/src/module/auto/make.mk | 9 ++ .../src/module/auto/x86_64_mlnx_msn3800.yml | 50 +++++++ .../x86_64_mlnx_msn3800/x86_64_mlnx_msn3800.x | 14 ++ .../x86_64_mlnx_msn3800_config.h | 137 ++++++++++++++++++ .../x86_64_mlnx_msn3800_dox.h | 26 ++++ .../x86_64_mlnx_msn3800_porting.h | 107 ++++++++++++++ .../onlp/builds/src/module/make.mk | 10 ++ .../onlp/builds/src/module/src/Makefile | 9 ++ .../onlp/builds/src/module/src/fani.c | 80 ++++++++++ .../onlp/builds/src/module/src/ledi.c | 96 ++++++++++++ .../onlp/builds/src/module/src/make.mk | 9 ++ .../onlp/builds/src/module/src/platform_lib.h | 39 +++++ .../onlp/builds/src/module/src/sysi.c | 64 ++++++++ .../onlp/builds/src/module/src/thermali.c | 109 ++++++++++++++ .../module/src/x86_64_mlnx_msn3800_config.c | 81 +++++++++++ .../module/src/x86_64_mlnx_msn3800_enums.c | 10 ++ .../src/module/src/x86_64_mlnx_msn3800_int.h | 12 ++ .../src/module/src/x86_64_mlnx_msn3800_log.c | 18 +++ .../src/module/src/x86_64_mlnx_msn3800_log.h | 12 ++ .../module/src/x86_64_mlnx_msn3800_module.c | 24 +++ .../src/module/src/x86_64_mlnx_msn3800_ucli.c | 50 +++++++ .../onlp/builds/src/x86_64_mlnx_msn3800.mk | 13 ++ .../platform-config/Makefile | 1 + .../platform-config/r0/Makefile | 1 + .../platform-config/r0/PKG.yml | 1 + .../r0/src/lib/x86-64-mlnx-msn3800-r0.yml | 36 +++++ .../python/x86_64_mlnx_msn3800_r0/__init__.py | 17 +++ 45 files changed, 1223 insertions(+), 2 deletions(-) create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/.project create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/modules/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/modules/PKG.yml create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/PKG.yml create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/libonlp-x86-64-mlnx-msn3800-r0.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/libonlp-x86-64-mlnx-msn3800.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/x86_64_mlnx_msn3800.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/onlpdump/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/onlpdump/onlpdump.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/.module create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/README create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/auto/make.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/auto/x86_64_mlnx_msn3800.yml create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800.x create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_dox.h create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_porting.h create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/make.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/fani.c create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/ledi.c create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/make.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/platform_lib.h create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/sysi.c create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/thermali.c create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_config.c create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_enums.c create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_int.h create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_log.c create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_log.h create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_module.c create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_ucli.c create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/x86_64_mlnx_msn3800.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/PKG.yml create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/src/lib/x86-64-mlnx-msn3800-r0.yml create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/src/python/x86_64_mlnx_msn3800_r0/__init__.py diff --git a/packages/platforms/mellanox/any/src/mlnx_common/module/src/mlnx_common_int.h b/packages/platforms/mellanox/any/src/mlnx_common/module/src/mlnx_common_int.h index 50ca7729..4137447b 100644 --- a/packages/platforms/mellanox/any/src/mlnx_common/module/src/mlnx_common_int.h +++ b/packages/platforms/mellanox/any/src/mlnx_common/module/src/mlnx_common_int.h @@ -9,7 +9,7 @@ #include #include -#define MAX_NUM_OF_CPLD 3 +#define MAX_NUM_OF_CPLD 4 #define PREFIX_PATH_ON_CPLD_DEV HW_MANAGEMENT_PATH"/system" mlnx_platform_info_t* get_platform_info(void); diff --git a/packages/platforms/mellanox/any/src/mlnx_common/module/src/mlnx_common_sysi.c b/packages/platforms/mellanox/any/src/mlnx_common/module/src/mlnx_common_sysi.c index 64fd6985..a2d5db70 100644 --- a/packages/platforms/mellanox/any/src/mlnx_common/module/src/mlnx_common_sysi.c +++ b/packages/platforms/mellanox/any/src/mlnx_common/module/src/mlnx_common_sysi.c @@ -42,7 +42,8 @@ static char arr_cplddev_name[MAX_NUM_OF_CPLD][30] = { "cpld_brd_version", "cpld_mgmt_version", - "cpld_port_version" + "cpld_port_version", + "cpld_gearbox_version", }; mlnx_platform_info_t* get_platform_info() @@ -82,6 +83,9 @@ onlp_sysi_platform_info_get(onlp_platform_info_t* pi) case 3: pi->cpld_versions = aim_fstrdup("brd=%d, mgmt=%d, port=%d", v[0], v[1], v[2]); break; + case 4: + pi->cpld_versions = aim_fstrdup("brd=%d, mgmt=%d, port=%d", v[0], v[1], v[2]); + break; case 0: default: AIM_LOG_ERROR("Incorrect CPLD Number %d\n", platform_info->cpld_num); diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/.project b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/.project new file mode 100644 index 00000000..2382047c --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/.project @@ -0,0 +1,27 @@ + + + x86-64-mlnx-msn3800 + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/modules/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/modules/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/modules/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/modules/PKG.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/modules/PKG.yml new file mode 100644 index 00000000..b16b3e3f --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/modules/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/no-platform-modules.yml ARCH=amd64 VENDOR=mellanox BASENAME=x86-64-mlnx-msn3800 diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/PKG.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/PKG.yml new file mode 100644 index 00000000..9ee5b6b5 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=x86-64-mlnx-msn3800 ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/Makefile new file mode 100644 index 00000000..e7437cb2 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/Makefile @@ -0,0 +1,2 @@ +FILTER=src +include $(ONL)/make/subdirs.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/Makefile new file mode 100644 index 00000000..990f0f90 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/Makefile @@ -0,0 +1,46 @@ +############################################################ +# +# +# Copyright 2014 BigSwitch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html +# +# 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 $(ONL)/make/config.amd64.mk + +MODULE := libonlp-x86-64-mlnx-msn3800 +include $(BUILDER)/standardinit.mk + +DEPENDMODULES := AIM IOF mlnx_common x86_64_mlnx_msn3800 onlplib +DEPENDMODULE_HEADERS := sff + +include $(BUILDER)/dependmodules.mk + +SHAREDLIB := libonlp-x86-64-mlnx-msn3800.so +$(SHAREDLIB)_TARGETS := $(ALL_TARGETS) +include $(BUILDER)/so.mk +.DEFAULT_GOAL := $(SHAREDLIB) + +GLOBAL_CFLAGS += -I$(onlp_BASEDIR)/module/inc +GLOBAL_CFLAGS += -I$(mlnx_common_BASEDIR)/module/inc +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1 +GLOBAL_CFLAGS += -fPIC +GLOBAL_LINK_LIBS += -lpthread + +include $(BUILDER)/targets.mk + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/libonlp-x86-64-mlnx-msn3800-r0.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/libonlp-x86-64-mlnx-msn3800-r0.mk new file mode 100644 index 00000000..c41ca6e6 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/libonlp-x86-64-mlnx-msn3800-r0.mk @@ -0,0 +1,10 @@ + +############################################################################### +# +# Inclusive Makefile for the libonlp-x86-64-mlnx-msn3800-r0 module. +# +# Autogenerated 2015-12-23 23:45:22.249911 +# +############################################################################### +libonlp-x86-64-mlnx-msn3800-r0_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/libonlp-x86-64-mlnx-msn3800.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/libonlp-x86-64-mlnx-msn3800.mk new file mode 100644 index 00000000..96f36164 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/libonlp-x86-64-mlnx-msn3800.mk @@ -0,0 +1,10 @@ + +############################################################################### +# +# Inclusive Makefile for the libonlp-x86-64-mlnx-msn3800 module. +# +# Autogenerated 2016-10-13 22:58:39.095824 +# +############################################################################### +libonlp-x86-64-mlnx-msn3800_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/x86_64_mlnx_msn3800.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/x86_64_mlnx_msn3800.mk new file mode 100644 index 00000000..f3b03eb3 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/lib/x86_64_mlnx_msn3800.mk @@ -0,0 +1,10 @@ + +############################################################################### +# +# Inclusive Makefile for the x86_64_mlnx_msn3800 module. +# +# Autogenerated 2015-12-23 23:45:22.262891 +# +############################################################################### +x86_64_mlnx_msn3800_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/onlpdump/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/onlpdump/Makefile new file mode 100644 index 00000000..ffe612f2 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/onlpdump/Makefile @@ -0,0 +1,46 @@ +############################################################ +# +# +# Copyright 2014 BigSwitch Networks, Inc. +# +# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html +# +# 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 $(ONL)/make/config.amd64.mk + +.DEFAULT_GOAL := onlpdump + +MODULE := onlpdump +include $(BUILDER)/standardinit.mk + +DEPENDMODULES := AIM IOF onlp mlnx_common x86_64_mlnx_msn3800 onlplib onlp_platform_defaults sff cjson cjson_util timer_wheel OS + +include $(BUILDER)/dependmodules.mk + +BINARY := onlpdump +$(BINARY)_LIBRARIES := $(LIBRARY_TARGETS) +include $(BUILDER)/bin.mk + +GLOBAL_CFLAGS += -DAIM_CONFIG_AIM_MAIN_FUNCTION=onlpdump_main +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1 +GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MAIN=1 +GLOBAL_LINK_LIBS += -lpthread -lm + +include $(BUILDER)/targets.mk + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/onlpdump/onlpdump.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/onlpdump/onlpdump.mk new file mode 100644 index 00000000..77d7d005 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/onlpdump/onlpdump.mk @@ -0,0 +1,10 @@ + +############################################################################### +# +# Inclusive Makefile for the onlpdump module. +# +# Autogenerated 2016-10-13 22:58:37.393320 +# +############################################################################### +onlpdump_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/.module b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/.module new file mode 100644 index 00000000..3c2df5a1 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/.module @@ -0,0 +1 @@ +name: x86_64_mlnx_msn3800 diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/Makefile new file mode 100644 index 00000000..c4aeca78 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/Makefile @@ -0,0 +1,9 @@ +############################################################################### +# +# +# +############################################################################### +include ../../init.mk +MODULE := x86_64_mlnx_msn3800 +AUTOMODULE := x86_64_mlnx_msn3800 +include $(BUILDER)/definemodule.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/README b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/README new file mode 100644 index 00000000..7871648b --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/README @@ -0,0 +1,6 @@ +############################################################################### +# +# x86_64_mlnx_msn3800 README +# +############################################################################### + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/auto/make.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/auto/make.mk new file mode 100644 index 00000000..77cce842 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/auto/make.mk @@ -0,0 +1,9 @@ +############################################################################### +# +# x86_64_mlnx_msn3800 Autogeneration +# +############################################################################### +x86_64_mlnx_msn3800_AUTO_DEFS := module/auto/x86_64_mlnx_msn3800.yml +x86_64_mlnx_msn3800_AUTO_DIRS := module/inc/x86_64_mlnx_msn3800 module/src +include $(BUILDER)/auto.mk + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/auto/x86_64_mlnx_msn3800.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/auto/x86_64_mlnx_msn3800.yml new file mode 100644 index 00000000..7635801b --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/auto/x86_64_mlnx_msn3800.yml @@ -0,0 +1,50 @@ +############################################################################### +# +# x86_64_mlnx_msn3800 Autogeneration Definitions. +# +############################################################################### + +cdefs: &cdefs +- X86_64_MLNX_MSN3800_CONFIG_INCLUDE_LOGGING: + doc: "Include or exclude logging." + default: 1 +- X86_64_MLNX_MSN3800_CONFIG_LOG_OPTIONS_DEFAULT: + doc: "Default enabled log options." + default: AIM_LOG_OPTIONS_DEFAULT +- X86_64_MLNX_MSN3800_CONFIG_LOG_BITS_DEFAULT: + doc: "Default enabled log bits." + default: AIM_LOG_BITS_DEFAULT +- X86_64_MLNX_MSN3800_CONFIG_LOG_CUSTOM_BITS_DEFAULT: + doc: "Default enabled custom log bits." + default: 0 +- X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB: + doc: "Default all porting macros to use the C standard libraries." + default: 1 +- X86_64_MLNX_MSN3800_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS: + doc: "Include standard library headers for stdlib porting macros." + default: x86_64_mlnx_msn3800_CONFIG_PORTING_STDLIB +- X86_64_MLNX_MSN3800_CONFIG_INCLUDE_UCLI: + doc: "Include generic uCli support." + default: 0 +- X86_64_MLNX_MSN3800_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION: + doc: "Assume chassis fan direction is the same as the PSU fan direction." + default: 0 + + +definitions: + cdefs: + X86_64_MLNX_MSN3800_CONFIG_HEADER: + defs: *cdefs + basename: x86_64_mlnx_msn3800_config + + portingmacro: + x86_64_mlnx_msn3800: + macros: + - malloc + - free + - memset + - memcpy + - strncpy + - vsnprintf + - snprintf + - strlen diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800.x b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800.x new file mode 100644 index 00000000..99a10434 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800.x @@ -0,0 +1,14 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +/* <--auto.start.xmacro(ALL).define> */ +/* */ + +/* <--auto.start.xenum(ALL).define> */ +/* */ + + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h new file mode 100644 index 00000000..54e767eb --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h @@ -0,0 +1,137 @@ +/**************************************************************************//** + * + * @file + * @brief x86_64_mlnx_msn3800 Configuration Header + * + * @addtogroup x86_64_mlnx_msn3800-config + * @{ + * + *****************************************************************************/ +#ifndef __X86_64_MLNX_MSN3800_CONFIG_H__ +#define __X86_64_MLNX_MSN3800_CONFIG_H__ + +#ifdef GLOBAL_INCLUDE_CUSTOM_CONFIG +#include +#endif +#ifdef X86_64_MLNX_MSN3800_INCLUDE_CUSTOM_CONFIG +#include +#endif + +/* */ +#include +/** + * X86_64_MLNX_MSN3800_CONFIG_INCLUDE_LOGGING + * + * Include or exclude logging. */ + + +#ifndef X86_64_MLNX_MSN3800_CONFIG_INCLUDE_LOGGING +#define X86_64_MLNX_MSN3800_CONFIG_INCLUDE_LOGGING 1 +#endif + +/** + * X86_64_MLNX_MSN3800_CONFIG_LOG_OPTIONS_DEFAULT + * + * Default enabled log options. */ + + +#ifndef X86_64_MLNX_MSN3800_CONFIG_LOG_OPTIONS_DEFAULT +#define X86_64_MLNX_MSN3800_CONFIG_LOG_OPTIONS_DEFAULT AIM_LOG_OPTIONS_DEFAULT +#endif + +/** + * X86_64_MLNX_MSN3800_CONFIG_LOG_BITS_DEFAULT + * + * Default enabled log bits. */ + + +#ifndef X86_64_MLNX_MSN3800_CONFIG_LOG_BITS_DEFAULT +#define X86_64_MLNX_MSN3800_CONFIG_LOG_BITS_DEFAULT AIM_LOG_BITS_DEFAULT +#endif + +/** + * X86_64_MLNX_MSN3800_CONFIG_LOG_CUSTOM_BITS_DEFAULT + * + * Default enabled custom log bits. */ + + +#ifndef X86_64_MLNX_MSN3800_CONFIG_LOG_CUSTOM_BITS_DEFAULT +#define X86_64_MLNX_MSN3800_CONFIG_LOG_CUSTOM_BITS_DEFAULT 0 +#endif + +/** + * X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB + * + * Default all porting macros to use the C standard libraries. */ + + +#ifndef X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB +#define X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB 1 +#endif + +/** + * X86_64_MLNX_MSN3800_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS + * + * Include standard library headers for stdlib porting macros. */ + + +#ifndef X86_64_MLNX_MSN3800_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS +#define X86_64_MLNX_MSN3800_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB +#endif + +/** + * X86_64_MLNX_MSN3800_CONFIG_INCLUDE_UCLI + * + * Include generic uCli support. */ + + +#ifndef X86_64_MLNX_MSN3800_CONFIG_INCLUDE_UCLI +#define X86_64_MLNX_MSN3800_CONFIG_INCLUDE_UCLI 0 +#endif + +/** + * X86_64_MLNX_MSN3800_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION + * + * Assume chassis fan direction is the same as the PSU fan direction. */ + + +#ifndef X86_64_MLNX_MSN3800_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION +#define X86_64_MLNX_MSN3800_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0 +#endif + + + +/** + * All compile time options can be queried or displayed + */ + +/** Configuration settings structure. */ +typedef struct x86_64_mlnx_msn3800_config_settings_s { + /** name */ + const char* name; + /** value */ + const char* value; +} x86_64_mlnx_msn3800_config_settings_t; + +/** Configuration settings table. */ +/** x86_64_mlnx_msn3800_config_settings table. */ +extern x86_64_mlnx_msn3800_config_settings_t x86_64_mlnx_msn3800_config_settings[]; + +/** + * @brief Lookup a configuration setting. + * @param setting The name of the configuration option to lookup. + */ +const char* x86_64_mlnx_msn3800_config_lookup(const char* setting); + +/** + * @brief Show the compile-time configuration. + * @param pvs The output stream. + */ +int x86_64_mlnx_msn3800_config_show(struct aim_pvs_s* pvs); + +/* */ + +#include "x86_64_mlnx_msn3800_porting.h" + +#endif /* __X86_64_MLNX_MSN3800_CONFIG_H__ */ +/* @} */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_dox.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_dox.h new file mode 100644 index 00000000..0337d85d --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_dox.h @@ -0,0 +1,26 @@ +/**************************************************************************//** + * + * x86_64_mlnx_msn3800 Doxygen Header + * + *****************************************************************************/ +#ifndef __X86_64_MLNX_MSN3800_DOX_H__ +#define __X86_64_MLNX_MSN3800_DOX_H__ + +/** + * @defgroup x86_64_mlnx_msn3800 x86_64_mlnx_msn3800 - x86_64_mlnx_msn3800 Description + * + +The documentation overview for this module should go here. + + * + * @{ + * + * @defgroup x86_64_mlnx_msn3800-x86_64_mlnx_msn3800 Public Interface + * @defgroup x86_64_mlnx_msn3800-config Compile Time Configuration + * @defgroup x86_64_mlnx_msn3800-porting Porting Macros + * + * @} + * + */ + +#endif /* __X86_64_MLNX_MSN3800_DOX_H__ */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_porting.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_porting.h new file mode 100644 index 00000000..9a34dafd --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/inc/x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_porting.h @@ -0,0 +1,107 @@ +/**************************************************************************//** + * + * @file + * @brief x86_64_mlnx_msn3800 Porting Macros. + * + * @addtogroup x86_64_mlnx_msn3800-porting + * @{ + * + *****************************************************************************/ +#ifndef __X86_64_MLNX_MSN3800_PORTING_H__ +#define __X86_64_MLNX_MSN3800_PORTING_H__ + + +/* */ +#if X86_64_MLNX_MSN3800_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS == 1 +#include +#include +#include +#include +#include +#endif + +#ifndef X86_64_MLNX_MSN3800_MALLOC + #if defined(GLOBAL_MALLOC) + #define X86_64_MLNX_MSN3800_MALLOC GLOBAL_MALLOC + #elif X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN3800_MALLOC malloc + #else + #error The macro X86_64_MLNX_MSN3800_MALLOC is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN3800_FREE + #if defined(GLOBAL_FREE) + #define X86_64_MLNX_MSN3800_FREE GLOBAL_FREE + #elif X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN3800_FREE free + #else + #error The macro X86_64_MLNX_MSN3800_FREE is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN3800_MEMSET + #if defined(GLOBAL_MEMSET) + #define X86_64_MLNX_MSN3800_MEMSET GLOBAL_MEMSET + #elif X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN3800_MEMSET memset + #else + #error The macro X86_64_MLNX_MSN3800_MEMSET is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN3800_MEMCPY + #if defined(GLOBAL_MEMCPY) + #define X86_64_MLNX_MSN3800_MEMCPY GLOBAL_MEMCPY + #elif X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN3800_MEMCPY memcpy + #else + #error The macro X86_64_MLNX_MSN3800_MEMCPY is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN3800_STRNCPY + #if defined(GLOBAL_STRNCPY) + #define X86_64_MLNX_MSN3800_STRNCPY GLOBAL_STRNCPY + #elif X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN3800_STRNCPY strncpy + #else + #error The macro X86_64_MLNX_MSN3800_STRNCPY is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN3800_VSNPRINTF + #if defined(GLOBAL_VSNPRINTF) + #define X86_64_MLNX_MSN3800_VSNPRINTF GLOBAL_VSNPRINTF + #elif X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN3800_VSNPRINTF vsnprintf + #else + #error The macro X86_64_MLNX_MSN3800_VSNPRINTF is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN3800_SNPRINTF + #if defined(GLOBAL_SNPRINTF) + #define X86_64_MLNX_MSN3800_SNPRINTF GLOBAL_SNPRINTF + #elif X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN3800_SNPRINTF snprintf + #else + #error The macro X86_64_MLNX_MSN3800_SNPRINTF is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN3800_STRLEN + #if defined(GLOBAL_STRLEN) + #define X86_64_MLNX_MSN3800_STRLEN GLOBAL_STRLEN + #elif X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN3800_STRLEN strlen + #else + #error The macro X86_64_MLNX_MSN3800_STRLEN is required but cannot be defined. + #endif +#endif + +/* */ + + +#endif /* __X86_64_MLNX_MSN3800_PORTING_H__ */ +/* @} */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/make.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/make.mk new file mode 100644 index 00000000..1a4e0f61 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/make.mk @@ -0,0 +1,10 @@ +############################################################################### +# +# +# +############################################################################### +THIS_DIR := $(dir $(lastword $(MAKEFILE_LIST))) +x86_64_mlnx_msn3800_INCLUDES := -I $(THIS_DIR)inc +x86_64_mlnx_msn3800_INTERNAL_INCLUDES := -I $(THIS_DIR)src +x86_64_mlnx_msn3800_DEPENDMODULE_ENTRIES := init:x86_64_mlnx_msn3800 ucli:x86_64_mlnx_msn3800 + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/Makefile new file mode 100644 index 00000000..187fe100 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/Makefile @@ -0,0 +1,9 @@ +############################################################################### +# +# Local source generation targets. +# +############################################################################### + +ucli: + @../../../../tools/uclihandlers.py x86_64_mlnx_msn3800_ucli.c + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/fani.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/fani.c new file mode 100644 index 00000000..1763b01a --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/fani.c @@ -0,0 +1,80 @@ +/************************************************************ + * + * + * Copyright 2014 Big Switch Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html + * + * 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. + * + * + ************************************************************ + * + * Fan Platform Implementation Defaults. + * + ***********************************************************/ +#include +#include +#include +#include +#include "platform_lib.h" +#include "mlnx_common/mlnx_common.h" + +#define FAN_RESERVED 0 +#define FAN_1_ON_MAIN_BOARD 1 +#define FAN_2_ON_MAIN_BOARD 2 +#define FAN_3_ON_MAIN_BOARD 3 +#define FAN_1_ON_PSU1 4 +#define FAN_1_ON_PSU2 5 + +#define FIRST_PSU_FAN_ID 4 + +static int min_fan_speed[CHASSIS_FAN_COUNT+1] = {0}; +static int max_fan_speed[CHASSIS_FAN_COUNT+1] = {0}; + +static fan_path_T fan_path[] = /* must map with onlp_fan_id */ +{ + MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_RESERVED), + MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_1_ON_MAIN_BOARD), + MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_2_ON_MAIN_BOARD), + MAKE_FAN_PATH_ON_MAIN_BOARD(PROJECT_NAME, FAN_3_ON_MAIN_BOARD), + MAKE_FAN_PATH_ON_PSU(1 ,1), + MAKE_FAN_PATH_ON_PSU(2, 1) +}; + +/* Static fan information */ +onlp_fan_info_t finfo[] = { + { }, /* Not used */ + MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(1), + MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(2), + MAKE_FAN_INFO_NODE_ON_MAIN_BOARD(3), + MAKE_FAN_INFO_NODE_ON_PSU(1,1), + MAKE_FAN_INFO_NODE_ON_PSU(2,1) +}; + +/* + * This function will be called prior to all of onlp_fani_* functions. + */ +int +onlp_fani_init(void) +{ + mlnx_platform_info_t* mlnx_platform_info = get_platform_info(); + mlnx_platform_info->min_fan_speed = min_fan_speed; + mlnx_platform_info->max_fan_speed = max_fan_speed; + mlnx_platform_info->finfo = finfo; + mlnx_platform_info->fan_fnames = fan_path; + mlnx_platform_info->fan_type = FAN_TYPE_EEPROM; + mlnx_platform_info->fan_per_module = 1; + mlnx_platform_info->first_psu_fan_id = FIRST_PSU_FAN_ID; + return ONLP_STATUS_OK; +} + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/ledi.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/ledi.c new file mode 100644 index 00000000..6014a2c7 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/ledi.c @@ -0,0 +1,96 @@ +/************************************************************ + * + * + * Copyright 2014 Big Switch Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html + * + * 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 +#include +#include +#include +#include +#include +#include "platform_lib.h" +#include + +static char* file_names[] = /* must map with onlp_led_id */ +{ + "reserved", + "status", + "fan1", + "fan2", + "fan3", + "psu", +}; + +/* + * Get the information for the given LED OID. + */ +static onlp_led_info_t linfo[] = +{ + { }, /* Not used */ + { + { ONLP_LED_ID_CREATE(LED_SYSTEM), "Chassis LED 1 (SYSTEM LED)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_GREEN_BLINKING | + ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_ORANGE_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_FAN1), "Chassis LED 2 (FAN1)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_GREEN_BLINKING | + ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_ORANGE_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_FAN2), "Chassis LED 3 (FAN2)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_GREEN_BLINKING | + ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_ORANGE_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_FAN3), "Chassis LED 4 (FAN3)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_GREEN_BLINKING | + ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_ORANGE_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_PSU_T3), "Chassis LED 8 (PSU LED)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_GREEN_BLINKING | + ONLP_LED_CAPS_ORANGE | ONLP_LED_CAPS_ORANGE_BLINKING | ONLP_LED_CAPS_AUTO, + }, +}; + +/* + * This function will be called prior to any other onlp_ledi_* functions. + */ +int +onlp_ledi_init(void) +{ + /* + * ONLPD calls it too early before all BSP insfrastructure is set + */ + mlnx_platform_info_t* mlnx_platform_info = get_platform_info(); + mlnx_platform_info->linfo = linfo; + mlnx_platform_info->led_fnames = file_names; + return ONLP_STATUS_OK; +} diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/make.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/make.mk new file mode 100644 index 00000000..0f794d7d --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/make.mk @@ -0,0 +1,9 @@ +############################################################################### +# +# +# +############################################################################### + +LIBRARY := x86_64_mlnx_msn3800 +$(LIBRARY)_SUBDIR := $(dir $(lastword $(MAKEFILE_LIST))) +include $(BUILDER)/lib.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/platform_lib.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/platform_lib.h new file mode 100644 index 00000000..90fc69e7 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/platform_lib.h @@ -0,0 +1,39 @@ +/************************************************************ + * + * + * Copyright 2014 Big Switch Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html + * + * 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. + * + * + ************************************************************ + * + * + * + ***********************************************************/ +#ifndef __PLATFORM_LIB_H__ +#define __PLATFORM_LIB_H__ + +#include "x86_64_mlnx_msn3800_log.h" + +#define CHASSIS_PSU_COUNT 2 +#define CHASSIS_TOTAL_FAN_COUNT 5 +#define CHASSIS_TOTAL_THERMAL_COUNT 8 +#define CHASSIS_FAN_COUNT (CHASSIS_TOTAL_FAN_COUNT - CHASSIS_PSU_COUNT) +#define CHASSIS_THERMAL_COUNT (CHASSIS_TOTAL_THERMAL_COUNT - CHASSIS_PSU_COUNT) +#define CPLD_COUNT 4 +#define SFP_PORT_COUNT 32 +#define CHASSIS_LED_COUNT 5 + +#endif /* __PLATFORM_LIB_H__ */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/sysi.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/sysi.c new file mode 100644 index 00000000..be6c2266 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/sysi.c @@ -0,0 +1,64 @@ +/************************************************************ + * + * + * Copyright 2014 Big Switch Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html + * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include "platform_lib.h" +#include +#include "x86_64_mlnx_msn3800_int.h" +#include "x86_64_mlnx_msn3800_log.h" + +#define ONL_PLATFORM_NAME "x86-64-mlnx-msn3800-r0" + +int mc_get_platform_info(mlnx_platform_info_t* mlnx_platform) +{ + strncpy(mlnx_platform->onl_platform_name, ONL_PLATFORM_NAME, PLATFORM_NAME_MAX_LEN); + mlnx_platform->sfp_num = SFP_PORT_COUNT; + mlnx_platform->led_num = CHASSIS_LED_COUNT; + mlnx_platform->psu_num = CHASSIS_PSU_COUNT; + mlnx_platform->fan_num = CHASSIS_FAN_COUNT; + mlnx_platform->thermal_num = CHASSIS_THERMAL_COUNT; + mlnx_platform->cpld_num = CPLD_COUNT; + mlnx_platform->psu_fixed = false; + mlnx_platform->fan_fixed = false; + mlnx_platform->psu_type = PSU_TYPE_2; + mlnx_platform->led_type = LED_TYPE_3; + + return ONLP_STATUS_OK; +} + +int +onlp_sysi_init(void) +{ + return ONLP_STATUS_OK; +} + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/thermali.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/thermali.c new file mode 100644 index 00000000..fedbf1b3 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/thermali.c @@ -0,0 +1,109 @@ +/************************************************************ + * + * + * Copyright 2014 Big Switch Networks, Inc. + * + * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html + * + * 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. + * + * + ************************************************************ + * + * Thermal Sensor Platform Implementation. + * + ***********************************************************/ +#include +#include +#include +#include +#include +#include +#include "platform_lib.h" +#include "mlnx_common/mlnx_common.h" + +enum onlp_thermal_id +{ + THERMAL_RESERVED = 0, + THERMAL_CPU_CORE_0, + THERMAL_CPU_CORE_1, + THERMAL_CPU_PACK, + THERMAL_ASIC, + THERMAL_BOARD_AMB, + THERMAL_PORT, + THERMAL_ON_PSU1, + THERMAL_ON_PSU2, +}; + +static char* thermal_fnames[] = /* must map with onlp_thermal_id */ +{ + "reserved", + "cpu_core0", + "cpu_core1", + "cpu_pack", + "asic", + "board_amb", + "port_amb", + "psu1", + "psu2" +}; + +/* Static values */ +static onlp_thermal_info_t tinfo[] = { + { }, /* Not used */ + { { ONLP_THERMAL_ID_CREATE(THERMAL_CPU_CORE_0), "CPU Core 0", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_ALL, 0, CPU_THERMAL_THRESHOLD_INIT_DEFAULTS + }, + { { ONLP_THERMAL_ID_CREATE(THERMAL_CPU_CORE_1), "CPU Core 1", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_ALL, 0, CPU_THERMAL_THRESHOLD_INIT_DEFAULTS + }, + + { { ONLP_THERMAL_ID_CREATE(THERMAL_CPU_PACK), "CPU pack", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_ALL, 0, CPU_THERMAL_THRESHOLD_INIT_DEFAULTS + }, + + { { ONLP_THERMAL_ID_CREATE(THERMAL_ASIC), "Asic Thermal Sensor", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_ALL, 0, ASIC_THERMAL_THRESHOLD_INIT_DEFAULTS + }, + { { ONLP_THERMAL_ID_CREATE(THERMAL_BOARD_AMB), "Board AMB Thermal Sensor", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_GET_TEMPERATURE, 0, {0,0,0} + }, + { { ONLP_THERMAL_ID_CREATE(THERMAL_PORT), "Port AMB Thermal Sensor", 0}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_GET_TEMPERATURE, 0, {0,0,0} + }, + { { ONLP_THERMAL_ID_CREATE(THERMAL_ON_PSU1), "PSU-1 Thermal Sensor 1", ONLP_PSU_ID_CREATE(PSU1_ID)}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_GET_TEMPERATURE, 0, {0,0,0} + }, + { { ONLP_THERMAL_ID_CREATE(THERMAL_ON_PSU2), "PSU-2 Thermal Sensor 1", ONLP_PSU_ID_CREATE(PSU2_ID)}, + ONLP_THERMAL_STATUS_PRESENT, + ONLP_THERMAL_CAPS_GET_TEMPERATURE, 0, {0,0,0} + } +}; + +/* + * This will be called to intiialize the thermali subsystem. + */ +int +onlp_thermali_init(void) +{ + mlnx_platform_info_t* mlnx_platform_info = get_platform_info(); + mlnx_platform_info->tinfo=tinfo; + mlnx_platform_info->thermal_fnames=thermal_fnames; + return ONLP_STATUS_OK; +} diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_config.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_config.c new file mode 100644 index 00000000..3c1a87b6 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_config.c @@ -0,0 +1,81 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +/* */ +#define __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME(_x) #_x +#define __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_VALUE(_x) __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME(_x) +x86_64_mlnx_msn3800_config_settings_t x86_64_mlnx_msn3800_config_settings[] = +{ +#ifdef X86_64_MLNX_MSN3800_CONFIG_INCLUDE_LOGGING + { __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3800_CONFIG_INCLUDE_LOGGING), __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3800_CONFIG_INCLUDE_LOGGING) }, +#else +{ X86_64_MLNX_MSN3800_CONFIG_INCLUDE_LOGGING(__X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN3800_CONFIG_LOG_OPTIONS_DEFAULT + { __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3800_CONFIG_LOG_OPTIONS_DEFAULT), __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3800_CONFIG_LOG_OPTIONS_DEFAULT) }, +#else +{ X86_64_MLNX_MSN3800_CONFIG_LOG_OPTIONS_DEFAULT(__X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN3800_CONFIG_LOG_BITS_DEFAULT + { __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3800_CONFIG_LOG_BITS_DEFAULT), __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3800_CONFIG_LOG_BITS_DEFAULT) }, +#else +{ X86_64_MLNX_MSN3800_CONFIG_LOG_BITS_DEFAULT(__X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN3800_CONFIG_LOG_CUSTOM_BITS_DEFAULT + { __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3800_CONFIG_LOG_CUSTOM_BITS_DEFAULT), __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3800_CONFIG_LOG_CUSTOM_BITS_DEFAULT) }, +#else +{ X86_64_MLNX_MSN3800_CONFIG_LOG_CUSTOM_BITS_DEFAULT(__X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB + { __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB), __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB) }, +#else +{ X86_64_MLNX_MSN3800_CONFIG_PORTING_STDLIB(__X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN3800_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS + { __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3800_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS), __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3800_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS) }, +#else +{ X86_64_MLNX_MSN3800_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS(__X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN3800_CONFIG_INCLUDE_UCLI + { __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3800_CONFIG_INCLUDE_UCLI), __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3800_CONFIG_INCLUDE_UCLI) }, +#else +{ X86_64_MLNX_MSN3800_CONFIG_INCLUDE_UCLI(__X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN3800_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION + { __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN3800_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION), __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN3800_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION) }, +#else +{ X86_64_MLNX_MSN3800_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION(__X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif + { NULL, NULL } +}; +#undef __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_VALUE +#undef __X86_64_MLNX_MSN3800_CONFIG_STRINGIFY_NAME + +const char* +x86_64_mlnx_msn3800_config_lookup(const char* setting) +{ + int i; + for(i = 0; x86_64_mlnx_msn3800_config_settings[i].name; i++) { + if(strcmp(x86_64_mlnx_msn3800_config_settings[i].name, setting)) { + return x86_64_mlnx_msn3800_config_settings[i].value; + } + } + return NULL; +} + +int +x86_64_mlnx_msn3800_config_show(struct aim_pvs_s* pvs) +{ + int i; + for(i = 0; x86_64_mlnx_msn3800_config_settings[i].name; i++) { + aim_printf(pvs, "%s = %s\n", x86_64_mlnx_msn3800_config_settings[i].name, x86_64_mlnx_msn3800_config_settings[i].value); + } + return i; +} + +/* */ + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_enums.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_enums.c new file mode 100644 index 00000000..5d8e1acf --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_enums.c @@ -0,0 +1,10 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +/* <--auto.start.enum(ALL).source> */ +/* */ + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_int.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_int.h new file mode 100644 index 00000000..42487bc9 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_int.h @@ -0,0 +1,12 @@ +/**************************************************************************//** + * + * x86_64_mlnx_msn3800 Internal Header + * + *****************************************************************************/ +#ifndef __X86_64_MLNX_MSN3800_INT_H__ +#define __X86_64_MLNX_MSN3800_INT_H__ + +#include + + +#endif /* __X86_64_MLNX_MSN3800_INT_H__ */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_log.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_log.c new file mode 100644 index 00000000..109708a3 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_log.c @@ -0,0 +1,18 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +#include "x86_64_mlnx_msn3800_log.h" +/* + * x86_64_mlnx_msn3800 log struct. + */ +AIM_LOG_STRUCT_DEFINE( + X86_64_MLNX_MSN3800_CONFIG_LOG_OPTIONS_DEFAULT, + X86_64_MLNX_MSN3800_CONFIG_LOG_BITS_DEFAULT, + NULL, /* Custom log map */ + X86_64_MLNX_MSN3800_CONFIG_LOG_CUSTOM_BITS_DEFAULT + ); + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_log.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_log.h new file mode 100644 index 00000000..5fc525f0 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_log.h @@ -0,0 +1,12 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#ifndef __X86_64_MLNX_MSN3800_LOG_H__ +#define __X86_64_MLNX_MSN3800_LOG_H__ + +#define AIM_LOG_MODULE_NAME x86_64_mlnx_msn3800 +#include + +#endif /* __X86_64_MLNX_MSN3800_LOG_H__ */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_module.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_module.c new file mode 100644 index 00000000..fcf6eda4 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_module.c @@ -0,0 +1,24 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +#include "x86_64_mlnx_msn3800_log.h" + +static int +datatypes_init__(void) +{ +#define x86_64_mlnx_msn3800_ENUMERATION_ENTRY(_enum_name, _desc) AIM_DATATYPE_MAP_REGISTER(_enum_name, _enum_name##_map, _desc, AIM_LOG_INTERNAL); +#include + return 0; +} + +void __x86_64_mlnx_msn3800_module_init__(void) +{ + AIM_LOG_STRUCT_REGISTER(); + datatypes_init__(); +} + +int __onlp_platform_version__ = 1; diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_ucli.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_ucli.c new file mode 100644 index 00000000..54d255db --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/module/src/x86_64_mlnx_msn3800_ucli.c @@ -0,0 +1,50 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +#if x86_64_mlnx_msn3800_CONFIG_INCLUDE_UCLI == 1 + +#include +#include +#include + +static ucli_status_t +x86_64_mlnx_msn3800_ucli_ucli__config__(ucli_context_t* uc) +{ + UCLI_HANDLER_MACRO_MODULE_CONFIG(x86_64_mlnx_msn3800) +} + +/* */ +/* */ + +static ucli_module_t +x86_64_mlnx_msn3800_ucli_module__ = + { + "x86_64_mlnx_msn3800_ucli", + NULL, + x86_64_mlnx_msn3800_ucli_ucli_handlers__, + NULL, + NULL, + }; + +ucli_node_t* +x86_64_mlnx_msn3800_ucli_node_create(void) +{ + ucli_node_t* n; + ucli_module_init(&x86_64_mlnx_msn3800_ucli_module__); + n = ucli_node_create("x86_64_mlnx_msn3800", NULL, &x86_64_mlnx_msn3800_ucli_module__); + ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_mlnx_msn3800")); + return n; +} + +#else +void* +x86_64_mlnx_msn3800_ucli_node_create(void) +{ + return NULL; +} +#endif + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/x86_64_mlnx_msn3800.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/x86_64_mlnx_msn3800.mk new file mode 100644 index 00000000..97f6d1f5 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/onlp/builds/src/x86_64_mlnx_msn3800.mk @@ -0,0 +1,13 @@ + +############################################################################### +# +# Inclusive Makefile for the x86_64_mlnx_msn3800 module. +# +# Autogenerated 2015-12-23 23:45:56.754200 +# +############################################################################### +x86_64_mlnx_msn3800_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(x86_64_mlnx_msn3800_BASEDIR)/module/make.mk +include $(x86_64_mlnx_msn3800_BASEDIR)/module/auto/make.mk +include $(x86_64_mlnx_msn3800_BASEDIR)/module/src/make.mk + diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/PKG.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/PKG.yml new file mode 100644 index 00000000..18a355e7 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=amd64 VENDOR=mellanox BASENAME=x86-64-mlnx-msn3800 REVISION=r0 diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/src/lib/x86-64-mlnx-msn3800-r0.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/src/lib/x86-64-mlnx-msn3800-r0.yml new file mode 100644 index 00000000..d52fbfff --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/src/lib/x86-64-mlnx-msn3800-r0.yml @@ -0,0 +1,36 @@ +--- + +###################################################################### +# +# platform-config for Mellanox msn3800 +# +###################################################################### + +x86-64-mlnx-msn3800-r0: + + grub: + + serial: >- + --unit=0 + --speed=115200 + --word=8 + --parity=0 + --stop=1 + + kernel: + <<: *kernel-4-9 + + args: >- + nopat + console=ttyS0,115200n8 + rd_NO_MD + rd_NO_LUKS + acpi_enforce_resources=lax + acpi=noirq + i2c-ismt.enable=0 + + ##network + ## interfaces: + ## ma1: + ## name: ~ + ## syspath: pci0000:00/0000:00:14.0 diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/src/python/x86_64_mlnx_msn3800_r0/__init__.py b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/src/python/x86_64_mlnx_msn3800_r0/__init__.py new file mode 100644 index 00000000..dfedb5f4 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn3800/platform-config/r0/src/python/x86_64_mlnx_msn3800_r0/__init__.py @@ -0,0 +1,17 @@ +from onl.platform.base import * +from onl.platform.mellanox import * + +class OnlPlatform_x86_64_mlnx_msn3800_r0(OnlPlatformMellanox, + OnlPlatformPortConfig_32x100): + PLATFORM='x86-64-mlnx-msn3800-r0' + MODEL="MSN3800" + SYS_OBJECT_ID=".3800.1" + + def baseconfig(self): + # load modules + import os + # necessary if there are issues with the install + # os.system("/usr/bin/apt-get install") + os.system("/etc/mlnx/mlnx-hw-management start") + self.syseeprom_export(); + return True