From f4fad36ecaabebeb20554641f5745a48edea8e59 Mon Sep 17 00:00:00 2001 From: Nataliya Yakuts Date: Mon, 26 Mar 2018 15:00:26 +0000 Subject: [PATCH] MSN2740 platform support Signed-off-by: Nataliya Yakuts Reviewed-by: Michael Shych --- .../x86-64/x86-64-mlnx-msn2740/Makefile | 1 + .../x86-64-mlnx-msn2740/modules/Makefile | 1 + .../x86-64-mlnx-msn2740/modules/PKG.yml | 1 + .../x86-64/x86-64-mlnx-msn2740/onlp/Makefile | 1 + .../x86-64/x86-64-mlnx-msn2740/onlp/PKG.yml | 1 + .../x86-64-mlnx-msn2740/onlp/builds/Makefile | 2 + .../onlp/builds/lib/Makefile | 45 ++++++ .../lib/libonlp-x86-64-mlnx-msn2740-r0.mk | 9 ++ .../builds/lib/libonlp-x86-64-mlnx-msn2740.mk | 9 ++ .../onlp/builds/lib/x86_64_mlnx_msn2740.mk | 9 ++ .../onlp/builds/onlpdump/Makefile | 45 ++++++ .../onlp/builds/onlpdump/onlpdump.mk | 9 ++ .../onlp/builds/src/.module | 1 + .../onlp/builds/src/Makefile | 9 ++ .../onlp/builds/src/README | 5 + .../onlp/builds/src/module/auto/make.mk | 8 + .../src/module/auto/x86_64_mlnx_msn2740.yml | 50 +++++++ .../x86_64_mlnx_msn2740/x86_64_mlnx_msn2740.x | 12 ++ .../x86_64_mlnx_msn2740_config.h | 137 ++++++++++++++++++ .../x86_64_mlnx_msn2740_dox.h | 26 ++++ .../x86_64_mlnx_msn2740_porting.h | 107 ++++++++++++++ .../onlp/builds/src/module/make.mk | 9 ++ .../onlp/builds/src/module/src/Makefile | 8 + .../onlp/builds/src/module/src/fani.c | 81 +++++++++++ .../onlp/builds/src/module/src/ledi.c | 97 +++++++++++++ .../onlp/builds/src/module/src/make.mk | 9 ++ .../onlp/builds/src/module/src/platform_lib.h | 39 +++++ .../onlp/builds/src/module/src/sysi.c | 88 +++++++++++ .../onlp/builds/src/module/src/thermali.c | 116 +++++++++++++++ .../module/src/x86_64_mlnx_msn2740_config.c | 80 ++++++++++ .../module/src/x86_64_mlnx_msn2740_enums.c | 9 ++ .../src/module/src/x86_64_mlnx_msn2740_int.h | 12 ++ .../src/module/src/x86_64_mlnx_msn2740_log.c | 17 +++ .../src/module/src/x86_64_mlnx_msn2740_log.h | 12 ++ .../module/src/x86_64_mlnx_msn2740_module.c | 24 +++ .../src/module/src/x86_64_mlnx_msn2740_ucli.c | 49 +++++++ .../onlp/builds/src/x86_64_mlnx_msn2740.mk | 12 ++ .../platform-config/Makefile | 1 + .../platform-config/r0/Makefile | 1 + .../platform-config/r0/PKG.yml | 1 + .../r0/src/lib/x86-64-mlnx-msn2740-r0.yml | 36 +++++ .../python/x86_64_mlnx_msn2740_r0/__init__.py | 17 +++ 42 files changed, 1206 insertions(+) create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/modules/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/modules/PKG.yml create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/PKG.yml create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/libonlp-x86-64-mlnx-msn2740-r0.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/libonlp-x86-64-mlnx-msn2740.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/x86_64_mlnx_msn2740.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/onlpdump/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/onlpdump/onlpdump.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/.module create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/README create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/auto/make.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/auto/x86_64_mlnx_msn2740.yml create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740.x create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_config.h create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_dox.h create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_porting.h create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/make.mk create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/Makefile create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/fani.c create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/ledi.c create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/make.mk create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/platform_lib.h create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/sysi.c create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/thermali.c create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_config.c create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_enums.c create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_int.h create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_log.c create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_log.h create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_module.c create mode 100755 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_ucli.c create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/x86_64_mlnx_msn2740.mk create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/Makefile create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/PKG.yml create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/src/lib/x86-64-mlnx-msn2740-r0.yml create mode 100644 packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/src/python/x86_64_mlnx_msn2740_r0/__init__.py diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/modules/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/modules/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/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-msn2740/modules/PKG.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/modules/PKG.yml new file mode 100644 index 00000000..f1575509 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/modules/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/no-platform-modules.yml ARCH=amd64 VENDOR=mellanox BASENAME=x86-64-mlnx-msn2740 diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/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-msn2740/onlp/PKG.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/PKG.yml new file mode 100644 index 00000000..84fd2de2 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=x86-64-mlnx-msn2740 ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/Makefile new file mode 100644 index 00000000..e7437cb2 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/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-msn2740/onlp/builds/lib/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/Makefile new file mode 100644 index 00000000..41006cf5 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/Makefile @@ -0,0 +1,45 @@ +############################################################ +# +# +# 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-msn2740 +include $(BUILDER)/standardinit.mk + +DEPENDMODULES := AIM IOF mlnx_common x86_64_mlnx_msn2740 onlplib +DEPENDMODULE_HEADERS := sff + +include $(BUILDER)/dependmodules.mk + +SHAREDLIB := libonlp-x86-64-mlnx-msn2740.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-msn2740/onlp/builds/lib/libonlp-x86-64-mlnx-msn2740-r0.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/libonlp-x86-64-mlnx-msn2740-r0.mk new file mode 100644 index 00000000..9544b21f --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/libonlp-x86-64-mlnx-msn2740-r0.mk @@ -0,0 +1,9 @@ + +############################################################################### +# +# Inclusive Makefile for the libonlp-x86-64-mlnx-msn2740-r0 module. +# +# Autogenerated 2015-12-23 23:45:22.249911 +# +############################################################################### +libonlp-x86-64-mlnx-msn2740-r0_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/libonlp-x86-64-mlnx-msn2740.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/libonlp-x86-64-mlnx-msn2740.mk new file mode 100644 index 00000000..fea561f3 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/libonlp-x86-64-mlnx-msn2740.mk @@ -0,0 +1,9 @@ + +############################################################################### +# +# Inclusive Makefile for the libonlp-x86-64-mlnx-msn2740 module. +# +# Autogenerated 2016-10-13 22:58:39.095824 +# +############################################################################### +libonlp-x86-64-mlnx-msn2740_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/x86_64_mlnx_msn2740.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/x86_64_mlnx_msn2740.mk new file mode 100644 index 00000000..3d1837c4 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/lib/x86_64_mlnx_msn2740.mk @@ -0,0 +1,9 @@ + +############################################################################### +# +# Inclusive Makefile for the x86_64_mlnx_msn2740 module. +# +# Autogenerated 2015-12-23 23:45:22.262891 +# +############################################################################### +x86_64_mlnx_msn2740_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/onlpdump/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/onlpdump/Makefile new file mode 100644 index 00000000..174fe7e1 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/onlpdump/Makefile @@ -0,0 +1,45 @@ +############################################################ +# +# +# 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_msn2740 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-msn2740/onlp/builds/onlpdump/onlpdump.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/onlpdump/onlpdump.mk new file mode 100644 index 00000000..106c5270 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/onlpdump/onlpdump.mk @@ -0,0 +1,9 @@ + +############################################################################### +# +# 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-msn2740/onlp/builds/src/.module b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/.module new file mode 100644 index 00000000..acb589d6 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/.module @@ -0,0 +1 @@ +name: x86_64_mlnx_msn2740 diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/Makefile new file mode 100644 index 00000000..694d205e --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/Makefile @@ -0,0 +1,9 @@ +############################################################################### +# +# +# +############################################################################### +include ../../init.mk +MODULE := x86_64_mlnx_msn2740 +AUTOMODULE := x86_64_mlnx_msn2740 +include $(BUILDER)/definemodule.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/README b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/README new file mode 100644 index 00000000..9b10af05 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/README @@ -0,0 +1,5 @@ +############################################################################### +# +# x86_64_mlnx_msn2740 README +# +############################################################################### diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/auto/make.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/auto/make.mk new file mode 100644 index 00000000..6eb0710b --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/auto/make.mk @@ -0,0 +1,8 @@ +############################################################################### +# +# x86_64_mlnx_msn2740 Autogeneration +# +############################################################################### +x86_64_mlnx_msn2740_AUTO_DEFS := module/auto/x86_64_mlnx_msn2740.yml +x86_64_mlnx_msn2740_AUTO_DIRS := module/inc/x86_64_mlnx_msn2740 module/src +include $(BUILDER)/auto.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/auto/x86_64_mlnx_msn2740.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/auto/x86_64_mlnx_msn2740.yml new file mode 100644 index 00000000..351b604f --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/auto/x86_64_mlnx_msn2740.yml @@ -0,0 +1,50 @@ +############################################################################### +# +# x86_64_mlnx_msn2740 Autogeneration Definitions. +# +############################################################################### + +cdefs: &cdefs +- X86_64_MLNX_MSN2740_CONFIG_INCLUDE_LOGGING: + doc: "Include or exclude logging." + default: 1 +- X86_64_MLNX_MSN2740_CONFIG_LOG_OPTIONS_DEFAULT: + doc: "Default enabled log options." + default: AIM_LOG_OPTIONS_DEFAULT +- X86_64_MLNX_MSN2740_CONFIG_LOG_BITS_DEFAULT: + doc: "Default enabled log bits." + default: AIM_LOG_BITS_DEFAULT +- X86_64_MLNX_MSN2740_CONFIG_LOG_CUSTOM_BITS_DEFAULT: + doc: "Default enabled custom log bits." + default: 0 +- X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB: + doc: "Default all porting macros to use the C standard libraries." + default: 1 +- X86_64_MLNX_MSN2740_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS: + doc: "Include standard library headers for stdlib porting macros." + default: x86_64_mlnx_msn2740_CONFIG_PORTING_STDLIB +- X86_64_MLNX_MSN2740_CONFIG_INCLUDE_UCLI: + doc: "Include generic uCli support." + default: 0 +- X86_64_MLNX_MSN2740_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_MSN2740_CONFIG_HEADER: + defs: *cdefs + basename: x86_64_mlnx_msn2740_config + + portingmacro: + x86_64_mlnx_msn2740: + macros: + - malloc + - free + - memset + - memcpy + - strncpy + - vsnprintf + - snprintf + - strlen diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740.x b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740.x new file mode 100644 index 00000000..6afa4de3 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740.x @@ -0,0 +1,12 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +/* <--auto.start.xmacro(ALL).define> */ +/* */ + +/* <--auto.start.xenum(ALL).define> */ +/* */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_config.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_config.h new file mode 100644 index 00000000..b5355e36 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_config.h @@ -0,0 +1,137 @@ +/**************************************************************************//** + * + * @file + * @brief x86_64_mlnx_msn2740 Configuration Header + * + * @addtogroup x86_64_mlnx_msn2740-config + * @{ + * + *****************************************************************************/ +#ifndef __X86_64_MLNX_MSN2740_CONFIG_H__ +#define __X86_64_MLNX_MSN2740_CONFIG_H__ + +#ifdef GLOBAL_INCLUDE_CUSTOM_CONFIG +#include +#endif +#ifdef X86_64_MLNX_MSN2740_INCLUDE_CUSTOM_CONFIG +#include +#endif + +/* */ +#include +/** + * X86_64_MLNX_MSN2740_CONFIG_INCLUDE_LOGGING + * + * Include or exclude logging. */ + + +#ifndef X86_64_MLNX_MSN2740_CONFIG_INCLUDE_LOGGING +#define X86_64_MLNX_MSN2740_CONFIG_INCLUDE_LOGGING 1 +#endif + +/** + * X86_64_MLNX_MSN2740_CONFIG_LOG_OPTIONS_DEFAULT + * + * Default enabled log options. */ + + +#ifndef X86_64_MLNX_MSN2740_CONFIG_LOG_OPTIONS_DEFAULT +#define X86_64_MLNX_MSN2740_CONFIG_LOG_OPTIONS_DEFAULT AIM_LOG_OPTIONS_DEFAULT +#endif + +/** + * X86_64_MLNX_MSN2740_CONFIG_LOG_BITS_DEFAULT + * + * Default enabled log bits. */ + + +#ifndef X86_64_MLNX_MSN2740_CONFIG_LOG_BITS_DEFAULT +#define X86_64_MLNX_MSN2740_CONFIG_LOG_BITS_DEFAULT AIM_LOG_BITS_DEFAULT +#endif + +/** + * X86_64_MLNX_MSN2740_CONFIG_LOG_CUSTOM_BITS_DEFAULT + * + * Default enabled custom log bits. */ + + +#ifndef X86_64_MLNX_MSN2740_CONFIG_LOG_CUSTOM_BITS_DEFAULT +#define X86_64_MLNX_MSN2740_CONFIG_LOG_CUSTOM_BITS_DEFAULT 0 +#endif + +/** + * X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB + * + * Default all porting macros to use the C standard libraries. */ + + +#ifndef X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB +#define X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB 1 +#endif + +/** + * X86_64_MLNX_MSN2740_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS + * + * Include standard library headers for stdlib porting macros. */ + + +#ifndef X86_64_MLNX_MSN2740_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS +#define X86_64_MLNX_MSN2740_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB +#endif + +/** + * X86_64_MLNX_MSN2740_CONFIG_INCLUDE_UCLI + * + * Include generic uCli support. */ + + +#ifndef X86_64_MLNX_MSN2740_CONFIG_INCLUDE_UCLI +#define X86_64_MLNX_MSN2740_CONFIG_INCLUDE_UCLI 0 +#endif + +/** + * X86_64_MLNX_MSN2740_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION + * + * Assume chassis fan direction is the same as the PSU fan direction. */ + + +#ifndef X86_64_MLNX_MSN2740_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION +#define X86_64_MLNX_MSN2740_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0 +#endif + + + +/** + * All compile time options can be queried or displayed + */ + +/** Configuration settings structure. */ +typedef struct x86_64_mlnx_msn2740_config_settings_s { + /** name */ + const char* name; + /** value */ + const char* value; +} x86_64_mlnx_msn2740_config_settings_t; + +/** Configuration settings table. */ +/** x86_64_mlnx_msn2740_config_settings table. */ +extern x86_64_mlnx_msn2740_config_settings_t x86_64_mlnx_msn2740_config_settings[]; + +/** + * @brief Lookup a configuration setting. + * @param setting The name of the configuration option to lookup. + */ +const char* x86_64_mlnx_msn2740_config_lookup(const char* setting); + +/** + * @brief Show the compile-time configuration. + * @param pvs The output stream. + */ +int x86_64_mlnx_msn2740_config_show(struct aim_pvs_s* pvs); + +/* */ + +#include "x86_64_mlnx_msn2740_porting.h" + +#endif /* __X86_64_MLNX_MSN2740_CONFIG_H__ */ +/* @} */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_dox.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_dox.h new file mode 100644 index 00000000..98d6fdce --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_dox.h @@ -0,0 +1,26 @@ +/**************************************************************************//** + * + * x86_64_mlnx_msn2740 Doxygen Header + * + *****************************************************************************/ +#ifndef __X86_64_MLNX_MSN2740_DOX_H__ +#define __X86_64_MLNX_MSN2740_DOX_H__ + +/** + * @defgroup x86_64_mlnx_msn2740 x86_64_mlnx_msn2740 - x86_64_mlnx_msn2740 Description + * + +The documentation overview for this module should go here. + + * + * @{ + * + * @defgroup x86_64_mlnx_msn2740-x86_64_mlnx_msn2740 Public Interface + * @defgroup x86_64_mlnx_msn2740-config Compile Time Configuration + * @defgroup x86_64_mlnx_msn2740-porting Porting Macros + * + * @} + * + */ + +#endif /* __X86_64_MLNX_MSN2740_DOX_H__ */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_porting.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_porting.h new file mode 100644 index 00000000..877af460 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/inc/x86_64_mlnx_msn2740/x86_64_mlnx_msn2740_porting.h @@ -0,0 +1,107 @@ +/**************************************************************************//** + * + * @file + * @brief x86_64_mlnx_msn2740 Porting Macros. + * + * @addtogroup x86_64_mlnx_msn2740-porting + * @{ + * + *****************************************************************************/ +#ifndef __X86_64_MLNX_MSN2740_PORTING_H__ +#define __X86_64_MLNX_MSN2740_PORTING_H__ + + +/* */ +#if X86_64_MLNX_MSN2740_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS == 1 +#include +#include +#include +#include +#include +#endif + +#ifndef X86_64_MLNX_MSN2740_MALLOC + #if defined(GLOBAL_MALLOC) + #define X86_64_MLNX_MSN2740_MALLOC GLOBAL_MALLOC + #elif X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN2740_MALLOC malloc + #else + #error The macro X86_64_MLNX_MSN2740_MALLOC is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN2740_FREE + #if defined(GLOBAL_FREE) + #define X86_64_MLNX_MSN2740_FREE GLOBAL_FREE + #elif X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN2740_FREE free + #else + #error The macro X86_64_MLNX_MSN2740_FREE is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN2740_MEMSET + #if defined(GLOBAL_MEMSET) + #define X86_64_MLNX_MSN2740_MEMSET GLOBAL_MEMSET + #elif X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN2740_MEMSET memset + #else + #error The macro X86_64_MLNX_MSN2740_MEMSET is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN2740_MEMCPY + #if defined(GLOBAL_MEMCPY) + #define X86_64_MLNX_MSN2740_MEMCPY GLOBAL_MEMCPY + #elif X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN2740_MEMCPY memcpy + #else + #error The macro X86_64_MLNX_MSN2740_MEMCPY is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN2740_STRNCPY + #if defined(GLOBAL_STRNCPY) + #define X86_64_MLNX_MSN2740_STRNCPY GLOBAL_STRNCPY + #elif X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN2740_STRNCPY strncpy + #else + #error The macro X86_64_MLNX_MSN2740_STRNCPY is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN2740_VSNPRINTF + #if defined(GLOBAL_VSNPRINTF) + #define X86_64_MLNX_MSN2740_VSNPRINTF GLOBAL_VSNPRINTF + #elif X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN2740_VSNPRINTF vsnprintf + #else + #error The macro X86_64_MLNX_MSN2740_VSNPRINTF is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN2740_SNPRINTF + #if defined(GLOBAL_SNPRINTF) + #define X86_64_MLNX_MSN2740_SNPRINTF GLOBAL_SNPRINTF + #elif X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN2740_SNPRINTF snprintf + #else + #error The macro X86_64_MLNX_MSN2740_SNPRINTF is required but cannot be defined. + #endif +#endif + +#ifndef X86_64_MLNX_MSN2740_STRLEN + #if defined(GLOBAL_STRLEN) + #define X86_64_MLNX_MSN2740_STRLEN GLOBAL_STRLEN + #elif X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB == 1 + #define X86_64_MLNX_MSN2740_STRLEN strlen + #else + #error The macro X86_64_MLNX_MSN2740_STRLEN is required but cannot be defined. + #endif +#endif + +/* */ + + +#endif /* __X86_64_MLNX_MSN2740_PORTING_H__ */ +/* @} */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/make.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/make.mk new file mode 100644 index 00000000..3e6697a9 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/make.mk @@ -0,0 +1,9 @@ +############################################################################### +# +# +# +############################################################################### +THIS_DIR := $(dir $(lastword $(MAKEFILE_LIST))) +x86_64_mlnx_msn2740_INCLUDES := -I $(THIS_DIR)inc +x86_64_mlnx_msn2740_INTERNAL_INCLUDES := -I $(THIS_DIR)src +x86_64_mlnx_msn2740_DEPENDMODULE_ENTRIES := init:x86_64_mlnx_msn2740 ucli:x86_64_mlnx_msn2740 diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/Makefile new file mode 100755 index 00000000..6fdb0564 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/Makefile @@ -0,0 +1,8 @@ +############################################################################### +# +# Local source generation targets. +# +############################################################################### + +ucli: + @../../../../tools/uclihandlers.py x86_64_mlnx_msn2740_ucli.c diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/fani.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/fani.c new file mode 100755 index 00000000..7e57fcb6 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/fani.c @@ -0,0 +1,81 @@ +/************************************************************ + * + * + * 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_4_ON_MAIN_BOARD 4 +#define FAN_1_ON_PSU1 5 +#define FAN_1_ON_PSU2 6 + +#define FIRST_PSU_FAN_ID 5 + +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_MAIN_BOARD(PROJECT_NAME, FAN_4_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_MAIN_BOARD(4), + 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_NO_EEPROM; + 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-msn2740/onlp/builds/src/module/src/ledi.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/ledi.c new file mode 100755 index 00000000..7fdb1f37 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/ledi.c @@ -0,0 +1,97 @@ +/************************************************************ + * + * + * 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", + "fan4", + "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_RED | ONLP_LED_CAPS_RED_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_FAN1), "Chassis LED 2 (FAN1 LED)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_GREEN_BLINKING | + ONLP_LED_CAPS_RED | ONLP_LED_CAPS_RED_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_FAN2), "Chassis LED 3 (FAN2 LED)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_GREEN_BLINKING | + ONLP_LED_CAPS_RED | ONLP_LED_CAPS_RED_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_FAN3), "Chassis LED 4 (FAN3 LED)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_GREEN_BLINKING | + ONLP_LED_CAPS_RED | ONLP_LED_CAPS_RED_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_FAN4), "Chassis LED 5 (FAN4 LED)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_GREEN_BLINKING | + ONLP_LED_CAPS_RED | ONLP_LED_CAPS_RED_BLINKING | ONLP_LED_CAPS_AUTO, + }, + { + { ONLP_LED_ID_CREATE(LED_PSU), "Chassis LED 6 (PSU LED)", 0 }, + ONLP_LED_STATUS_PRESENT, + ONLP_LED_CAPS_ON_OFF | ONLP_LED_CAPS_GREEN | ONLP_LED_CAPS_GREEN_BLINKING | + ONLP_LED_CAPS_RED | ONLP_LED_CAPS_RED_BLINKING | ONLP_LED_CAPS_AUTO, + } +}; + +int +onlp_ledi_init(void) +{ + 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-msn2740/onlp/builds/src/module/src/make.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/make.mk new file mode 100755 index 00000000..700f8d78 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/make.mk @@ -0,0 +1,9 @@ +############################################################################### +# +# +# +############################################################################### + +LIBRARY := x86_64_mlnx_msn2740 +$(LIBRARY)_SUBDIR := $(dir $(lastword $(MAKEFILE_LIST))) +include $(BUILDER)/lib.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/platform_lib.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/platform_lib.h new file mode 100755 index 00000000..e09b220b --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/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_msn2740_log.h" + +#define CHASSIS_PSU_COUNT 2 +#define CHASSIS_TOTAL_FAN_COUNT 6 +#define CHASSIS_TOTAL_THERMAL_COUNT 9 +#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 2 +#define SFP_PORT_COUNT 32 +#define CHASSIS_LED_COUNT 6 + +#endif /* __PLATFORM_LIB_H__ */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/sysi.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/sysi.c new file mode 100755 index 00000000..3e806c26 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/sysi.c @@ -0,0 +1,88 @@ +/************************************************************ + * + * + * 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 "x86_64_mlnx_msn2740_int.h" +#include "x86_64_mlnx_msn2740_log.h" +#include + +static const char* __ONL_PLATFORM_NAME = NULL; + +#define COMMAND_OUTPUT_BUFFER 256 + +int mc_get_platform_info(mlnx_platform_info_t* mlnx_platform) +{ + if (!__ONL_PLATFORM_NAME) { + strncpy(mlnx_platform->onl_platform_name, "x86-64-mlnx-msn2740-all", PLATFORM_NAME_MAX_LEN); + } + else { + 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_2; + + return ONLP_STATUS_OK; +} + +int +onlp_sysi_platform_set(const char* platform) +{ + mlnx_platform_info_t* mlnx_platform; + + if(!strcmp(platform, "x86-64-mlnx-msn2740-r0")) { + __ONL_PLATFORM_NAME = "x86-64-mlnx_msn2740-r0"; + mlnx_platform = get_platform_info(); + mc_get_platform_info(mlnx_platform); + return ONLP_STATUS_OK; + } + if(!strcmp(platform, "x86-64-mlnx-msn2740-all")) { + __ONL_PLATFORM_NAME = "x86-64-mlnx-msn2740-all"; + return ONLP_STATUS_OK; + } + return ONLP_STATUS_E_UNSUPPORTED; +} + +int +onlp_sysi_init(void) +{ + return ONLP_STATUS_OK; +} diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/thermali.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/thermali.c new file mode 100755 index 00000000..7011410d --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/thermali.c @@ -0,0 +1,116 @@ +/************************************************************ + * + * + * 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_CORE_2, + THERMAL_CPU_CORE_3, + 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_core2", + "cpu_core3", + "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_CORE_0), "CPU Core 2", 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 3", 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-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_config.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_config.c new file mode 100755 index 00000000..0e36b019 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_config.c @@ -0,0 +1,80 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +/* */ +#define __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME(_x) #_x +#define __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_VALUE(_x) __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME(_x) +x86_64_mlnx_msn2740_config_settings_t x86_64_mlnx_msn2740_config_settings[] = +{ +#ifdef X86_64_MLNX_MSN2740_CONFIG_INCLUDE_LOGGING + { __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN2740_CONFIG_INCLUDE_LOGGING), __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN2740_CONFIG_INCLUDE_LOGGING) }, +#else +{ X86_64_MLNX_MSN2740_CONFIG_INCLUDE_LOGGING(__X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN2740_CONFIG_LOG_OPTIONS_DEFAULT + { __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN2740_CONFIG_LOG_OPTIONS_DEFAULT), __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN2740_CONFIG_LOG_OPTIONS_DEFAULT) }, +#else +{ X86_64_MLNX_MSN2740_CONFIG_LOG_OPTIONS_DEFAULT(__X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN2740_CONFIG_LOG_BITS_DEFAULT + { __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN2740_CONFIG_LOG_BITS_DEFAULT), __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN2740_CONFIG_LOG_BITS_DEFAULT) }, +#else +{ X86_64_MLNX_MSN2740_CONFIG_LOG_BITS_DEFAULT(__X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN2740_CONFIG_LOG_CUSTOM_BITS_DEFAULT + { __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN2740_CONFIG_LOG_CUSTOM_BITS_DEFAULT), __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN2740_CONFIG_LOG_CUSTOM_BITS_DEFAULT) }, +#else +{ X86_64_MLNX_MSN2740_CONFIG_LOG_CUSTOM_BITS_DEFAULT(__X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB + { __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB), __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB) }, +#else +{ X86_64_MLNX_MSN2740_CONFIG_PORTING_STDLIB(__X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN2740_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS + { __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN2740_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS), __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN2740_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS) }, +#else +{ X86_64_MLNX_MSN2740_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS(__X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN2740_CONFIG_INCLUDE_UCLI + { __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN2740_CONFIG_INCLUDE_UCLI), __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN2740_CONFIG_INCLUDE_UCLI) }, +#else +{ X86_64_MLNX_MSN2740_CONFIG_INCLUDE_UCLI(__X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif +#ifdef X86_64_MLNX_MSN2740_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION + { __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME(X86_64_MLNX_MSN2740_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION), __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_VALUE(X86_64_MLNX_MSN2740_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION) }, +#else +{ X86_64_MLNX_MSN2740_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION(__X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME), "__undefined__" }, +#endif + { NULL, NULL } +}; +#undef __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_VALUE +#undef __X86_64_MLNX_MSN2740_CONFIG_STRINGIFY_NAME + +const char* +x86_64_mlnx_msn2740_config_lookup(const char* setting) +{ + int i; + for(i = 0; x86_64_mlnx_msn2740_config_settings[i].name; i++) { + if(strcmp(x86_64_mlnx_msn2740_config_settings[i].name, setting)) { + return x86_64_mlnx_msn2740_config_settings[i].value; + } + } + return NULL; +} + +int +x86_64_mlnx_msn2740_config_show(struct aim_pvs_s* pvs) +{ + int i; + for(i = 0; x86_64_mlnx_msn2740_config_settings[i].name; i++) { + aim_printf(pvs, "%s = %s\n", x86_64_mlnx_msn2740_config_settings[i].name, x86_64_mlnx_msn2740_config_settings[i].value); + } + return i; +} + +/* */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_enums.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_enums.c new file mode 100755 index 00000000..c3941c2e --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_enums.c @@ -0,0 +1,9 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +/* <--auto.start.enum(ALL).source> */ +/* */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_int.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_int.h new file mode 100755 index 00000000..af3aad73 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_int.h @@ -0,0 +1,12 @@ +/**************************************************************************//** + * + * x86_64_mlnx_msn2740 Internal Header + * + *****************************************************************************/ +#ifndef __X86_64_MLNX_MSN2740_INT_H__ +#define __X86_64_MLNX_MSN2740_INT_H__ + +#include + + +#endif /* __X86_64_MLNX_MSN2740_INT_H__ */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_log.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_log.c new file mode 100755 index 00000000..84e8bb16 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_log.c @@ -0,0 +1,17 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +#include "x86_64_mlnx_msn2740_log.h" +/* + * x86_64_mlnx_msn2740 log struct. + */ +AIM_LOG_STRUCT_DEFINE( + X86_64_MLNX_MSN2740_CONFIG_LOG_OPTIONS_DEFAULT, + X86_64_MLNX_MSN2740_CONFIG_LOG_BITS_DEFAULT, + NULL, /* Custom log map */ + X86_64_MLNX_MSN2740_CONFIG_LOG_CUSTOM_BITS_DEFAULT + ); diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_log.h b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_log.h new file mode 100755 index 00000000..63666c33 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_log.h @@ -0,0 +1,12 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#ifndef __X86_64_MLNX_MSN2740_LOG_H__ +#define __X86_64_MLNX_MSN2740_LOG_H__ + +#define AIM_LOG_MODULE_NAME x86_64_mlnx_msn2740 +#include + +#endif /* __X86_64_MLNX_MSN2740_LOG_H__ */ diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_module.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_module.c new file mode 100755 index 00000000..b930872a --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_module.c @@ -0,0 +1,24 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +#include "x86_64_mlnx_msn2740_log.h" + +static int +datatypes_init__(void) +{ +#define x86_64_mlnx_msn2740_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_msn2740_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-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_ucli.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_ucli.c new file mode 100755 index 00000000..e0fc13bb --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/module/src/x86_64_mlnx_msn2740_ucli.c @@ -0,0 +1,49 @@ +/**************************************************************************//** + * + * + * + *****************************************************************************/ +#include + +#if x86_64_mlnx_msn2740_CONFIG_INCLUDE_UCLI == 1 + +#include +#include +#include + +static ucli_status_t +x86_64_mlnx_msn2740_ucli_ucli__config__(ucli_context_t* uc) +{ + UCLI_HANDLER_MACRO_MODULE_CONFIG(x86_64_mlnx_msn2740) +} + +/* */ +/* */ + +static ucli_module_t +x86_64_mlnx_msn2740_ucli_module__ = + { + "x86_64_mlnx_msn2740_ucli", + NULL, + x86_64_mlnx_msn2740_ucli_ucli_handlers__, + NULL, + NULL, + }; + +ucli_node_t* +x86_64_mlnx_msn2740_ucli_node_create(void) +{ + ucli_node_t* n; + ucli_module_init(&x86_64_mlnx_msn2740_ucli_module__); + n = ucli_node_create("x86_64_mlnx_msn2740", NULL, &x86_64_mlnx_msn2740_ucli_module__); + ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_mlnx_msn2740")); + return n; +} + +#else +void* +x86_64_mlnx_msn2740_ucli_node_create(void) +{ + return NULL; +} +#endif diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/x86_64_mlnx_msn2740.mk b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/x86_64_mlnx_msn2740.mk new file mode 100644 index 00000000..8e7f42b3 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/onlp/builds/src/x86_64_mlnx_msn2740.mk @@ -0,0 +1,12 @@ + +############################################################################### +# +# Inclusive Makefile for the x86_64_mlnx_msn2740 module. +# +# Autogenerated 2015-12-23 23:45:56.754200 +# +############################################################################### +x86_64_mlnx_msn2740_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +include $(x86_64_mlnx_msn2740_BASEDIR)/module/make.mk +include $(x86_64_mlnx_msn2740_BASEDIR)/module/auto/make.mk +include $(x86_64_mlnx_msn2740_BASEDIR)/module/src/make.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/PKG.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/PKG.yml new file mode 100644 index 00000000..c2a7179f --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=amd64 VENDOR=mellanox BASENAME=x86-64-mlnx-msn2740 REVISION=r0 diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/src/lib/x86-64-mlnx-msn2740-r0.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/src/lib/x86-64-mlnx-msn2740-r0.yml new file mode 100644 index 00000000..f5c24ef2 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/src/lib/x86-64-mlnx-msn2740-r0.yml @@ -0,0 +1,36 @@ +--- + +###################################################################### +# +# platform-config for Mellanox 2740 +# +###################################################################### + +x86-64-mlnx-msn2740-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-msn2740/platform-config/r0/src/python/x86_64_mlnx_msn2740_r0/__init__.py b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/src/python/x86_64_mlnx_msn2740_r0/__init__.py new file mode 100644 index 00000000..5e2bc914 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2740/platform-config/r0/src/python/x86_64_mlnx_msn2740_r0/__init__.py @@ -0,0 +1,17 @@ +from onl.platform.base import * +from onl.platform.mellanox import * + +class OnlPlatform_x86_64_mlnx_msn2740_r0(OnlPlatformMellanox, + OnlPlatformPortConfig_32x100): + PLATFORM='x86-64-mlnx-msn2740-r0' + MODEL="MSN2740" + SYS_OBJECT_ID=".2740.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