mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
Add: MSN2100-b system support
Signed-off-by: Oleksandr Shamray <oleksandrs@mellanox.com>
This commit is contained in:
@@ -37,13 +37,20 @@
|
||||
#include "x86_64_mlnx_msn2100_log.h"
|
||||
#include <mlnx_common/mlnx_common.h>
|
||||
|
||||
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)
|
||||
|
||||
3
packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/.gitignore
vendored
Normal file
3
packages/platforms/mellanox/x86-64/x86-64-mlnx-msn2100b/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*x86-64*.mk
|
||||
*x86_64*.mk
|
||||
onlpdump.mk
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>x86-64-mlnx-msn2100b</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
!include $ONL_TEMPLATES/no-platform-modules.yml ARCH=amd64 VENDOR=mellanox BASENAME=x86-64-mlnx-msn2100b
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=x86-64-mlnx-msn2100b ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu
|
||||
@@ -0,0 +1,2 @@
|
||||
FILTER=src
|
||||
include $(ONL)/make/subdirs.mk
|
||||
@@ -0,0 +1,45 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2014 v=onl>
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
#
|
||||
############################################################
|
||||
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
|
||||
@@ -0,0 +1,46 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2014 v=onl>
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
#
|
||||
#
|
||||
############################################################
|
||||
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
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=amd64 VENDOR=mellanox BASENAME=x86-64-mlnx-msn2100b REVISION=r0
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user