diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100/onlp/builds/src/module/src/sysi.c b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100/onlp/builds/src/module/src/sysi.c index d0c181e4..20703dd9 100644 --- a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100/onlp/builds/src/module/src/sysi.c +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100/onlp/builds/src/module/src/sysi.c @@ -37,13 +37,20 @@ #include "x86_64_mlnx_msn2100_log.h" #include +static const char* __ONL_PLATFORM_NAME = NULL; + #define ONL_PLATFORM_NAME "x86-64-mlnx-msn2100-r0" #define COMMAND_OUTPUT_BUFFER 256 int mc_get_platform_info(mlnx_platform_info_t* mlnx_platform) { - strncpy(mlnx_platform->onl_platform_name, ONL_PLATFORM_NAME, PLATFORM_NAME_MAX_LEN); + if (!__ONL_PLATFORM_NAME) { + strncpy(mlnx_platform->onl_platform_name, "x86-64-mlnx-msn2100-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; @@ -58,6 +65,29 @@ int mc_get_platform_info(mlnx_platform_info_t* mlnx_platform) return ONLP_STATUS_OK; } +int +onlp_sysi_platform_set(const char* platform) +{ + mlnx_platform_info_t* mlnx_platform; + + if(!strcmp(platform, "x86-64-mlnx-msn2100-r0")) { + __ONL_PLATFORM_NAME = "x86-64-mlnx_msn2100-r0"; + mlnx_platform = get_platform_info(); + mc_get_platform_info(mlnx_platform); + return ONLP_STATUS_OK; + } + if(!strcmp(platform, "x86-64-mlnx-msn2100b-r0")) { + __ONL_PLATFORM_NAME = "x86-64-mlnx_msn2100b-r0"; + mlnx_platform = get_platform_info(); + mc_get_platform_info(mlnx_platform); + return ONLP_STATUS_OK; + } + if(!strcmp(platform, "x86-64-mlnx-msn2100-all")) { + __ONL_PLATFORM_NAME = "x86-64-mlnx-msn2100-all"; + return ONLP_STATUS_OK; + } + return ONLP_STATUS_E_UNSUPPORTED; +} int onlp_sysi_init(void) diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/.gitignore b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/.gitignore new file mode 100644 index 00000000..3edba0a7 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/.gitignore @@ -0,0 +1,3 @@ +*x86-64*.mk +*x86_64*.mk +onlpdump.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/modules/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/modules/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/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-msn2100b/modules/PKG.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/modules/PKG.yml new file mode 100644 index 00000000..19bf5927 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/modules/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/no-platform-modules.yml ARCH=amd64 VENDOR=mellanox BASENAME=x86-64-mlnx-msn2100b diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/onlp/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/onlp/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/onlp/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/onlp/PKG.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/onlp/PKG.yml new file mode 100644 index 00000000..50f9595b --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/onlp/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=x86-64-mlnx-msn2100b ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/onlp/builds/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/onlp/builds/Makefile new file mode 100644 index 00000000..e7437cb2 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/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-msn2100b/onlp/builds/lib/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/onlp/builds/lib/Makefile new file mode 100644 index 00000000..c20febe4 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/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-msn2100b +include $(BUILDER)/standardinit.mk + +DEPENDMODULES := AIM IOF mlnx_common x86_64_mlnx_msn2100 onlplib +DEPENDMODULE_HEADERS := sff + +include $(BUILDER)/dependmodules.mk + +SHAREDLIB := libonlp-x86-64-mlnx-msn2100b.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-msn2100b/onlp/builds/onlpdump/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/onlp/builds/onlpdump/Makefile new file mode 100644 index 00000000..e913e64a --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/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_msn2100 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_CFLAGS += -I$(mlnx_common_BASEDIR)/module/inc +GLOBAL_LINK_LIBS += -lpthread -lm + +include $(BUILDER)/targets.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/Makefile b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/Makefile new file mode 100644 index 00000000..dc1e7b86 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/PKG.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/PKG.yml new file mode 100644 index 00000000..03b0a322 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=amd64 VENDOR=mellanox BASENAME=x86-64-mlnx-msn2100b REVISION=r0 diff --git a/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/src/lib/x86-64-mlnx-msn2100b-r0.yml b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/src/lib/x86-64-mlnx-msn2100b-r0.yml new file mode 100644 index 00000000..a94740c0 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/src/lib/x86-64-mlnx-msn2100b-r0.yml @@ -0,0 +1,36 @@ +--- + +###################################################################### +# +# platform-config for Mellanox 2100B +# +###################################################################### + +x86-64-mlnx-msn2100b-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-msn2100b/platform-config/r0/src/python/x86_64_mlnx_msn2000b_r0/__init__.py b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/src/python/x86_64_mlnx_msn2000b_r0/__init__.py new file mode 100644 index 00000000..16824352 --- /dev/null +++ b/packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/platform-config/r0/src/python/x86_64_mlnx_msn2000b_r0/__init__.py @@ -0,0 +1,17 @@ +from onl.platform.base import * +from onl.platform.mellanox import * + +class OnlPlatform_x86_64_mlnx_msn2100b_r0(OnlPlatformMellanox, + OnlPlatformPortConfig_32x40): + PLATFORM='x86-64-mlnx-msn2100b-r0' + MODEL="MSN2100B" + SYS_OBJECT_ID=".2100.2" + + 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