mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 01:07:01 +00:00
add: MSN3800 (Tigris) system support
Signed-off-by: Oleksandr Shamray <oleksandrs@mellanox.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include <mlnx_common/mlnx_common_config.h>
|
||||
#include <mlnx_common/mlnx_common.h>
|
||||
|
||||
#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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>x86-64-mlnx-msn3800</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||
<triggers>clean,full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</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-msn3800
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=x86-64-mlnx-msn3800 ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu
|
||||
@@ -0,0 +1,2 @@
|
||||
FILTER=src
|
||||
include $(ONL)/make/subdirs.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
|
||||
|
||||
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
|
||||
|
||||
@@ -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))))
|
||||
|
||||
@@ -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))))
|
||||
|
||||
@@ -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))))
|
||||
|
||||
@@ -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_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
|
||||
|
||||
@@ -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))))
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
name: x86_64_mlnx_msn3800
|
||||
@@ -0,0 +1,9 @@
|
||||
###############################################################################
|
||||
#
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
include ../../init.mk
|
||||
MODULE := x86_64_mlnx_msn3800
|
||||
AUTOMODULE := x86_64_mlnx_msn3800
|
||||
include $(BUILDER)/definemodule.mk
|
||||
@@ -0,0 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# x86_64_mlnx_msn3800 README
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,14 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h>
|
||||
|
||||
/* <--auto.start.xmacro(ALL).define> */
|
||||
/* <auto.end.xmacro(ALL).define> */
|
||||
|
||||
/* <--auto.start.xenum(ALL).define> */
|
||||
/* <auto.end.xenum(ALL).define> */
|
||||
|
||||
|
||||
@@ -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 <global_custom_config.h>
|
||||
#endif
|
||||
#ifdef X86_64_MLNX_MSN3800_INCLUDE_CUSTOM_CONFIG
|
||||
#include <x86_64_mlnx_msn3800_custom_config.h>
|
||||
#endif
|
||||
|
||||
/* <auto.start.cdefs(X86_64_MLNX_MSN3800_CONFIG_HEADER).header> */
|
||||
#include <AIM/aim.h>
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/* <auto.end.cdefs(X86_64_MLNX_MSN3800_CONFIG_HEADER).header> */
|
||||
|
||||
#include "x86_64_mlnx_msn3800_porting.h"
|
||||
|
||||
#endif /* __X86_64_MLNX_MSN3800_CONFIG_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__ */
|
||||
@@ -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__
|
||||
|
||||
|
||||
/* <auto.start.portingmacro(ALL).define> */
|
||||
#if X86_64_MLNX_MSN3800_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS == 1
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <memory.h>
|
||||
#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
|
||||
|
||||
/* <auto.end.portingmacro(ALL).define> */
|
||||
|
||||
|
||||
#endif /* __X86_64_MLNX_MSN3800_PORTING_H__ */
|
||||
/* @} */
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Local source generation targets.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
ucli:
|
||||
@../../../../tools/uclihandlers.py x86_64_mlnx_msn3800_ucli.c
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
* Fan Platform Implementation Defaults.
|
||||
*
|
||||
***********************************************************/
|
||||
#include <fcntl.h>
|
||||
#include <onlplib/file.h>
|
||||
#include <onlplib/mmap.h>
|
||||
#include <onlp/platformi/fani.h>
|
||||
#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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <onlplib/mmap.h>
|
||||
#include <onlplib/file.h>
|
||||
#include <onlp/platformi/ledi.h>
|
||||
#include "platform_lib.h"
|
||||
#include <mlnx_common/mlnx_common.h>
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
###############################################################################
|
||||
#
|
||||
#
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
LIBRARY := x86_64_mlnx_msn3800
|
||||
$(LIBRARY)_SUBDIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
include $(BUILDER)/lib.mk
|
||||
@@ -0,0 +1,39 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
#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__ */
|
||||
@@ -0,0 +1,64 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <onlplib/file.h>
|
||||
#include <onlp/platformi/fani.h>
|
||||
#include <onlp/platformi/ledi.h>
|
||||
#include <onlp/platformi/psui.h>
|
||||
#include <onlp/platformi/sysi.h>
|
||||
#include <onlp/platformi/thermali.h>
|
||||
#include "platform_lib.h"
|
||||
#include <mlnx_common/mlnx_common.h>
|
||||
#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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
* Thermal Sensor Platform Implementation.
|
||||
*
|
||||
***********************************************************/
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <AIM/aim_log.h>
|
||||
#include <onlplib/file.h>
|
||||
#include <onlplib/mmap.h>
|
||||
#include <onlp/platformi/thermali.h>
|
||||
#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;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h>
|
||||
|
||||
/* <auto.start.cdefs(X86_64_MLNX_MSN3800_CONFIG_HEADER).source> */
|
||||
#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;
|
||||
}
|
||||
|
||||
/* <auto.end.cdefs(x86_64_mlnx_msn3800_CONFIG_HEADER).source> */
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h>
|
||||
|
||||
/* <--auto.start.enum(ALL).source> */
|
||||
/* <auto.end.enum(ALL).source> */
|
||||
|
||||
@@ -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 <x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h>
|
||||
|
||||
|
||||
#endif /* __X86_64_MLNX_MSN3800_INT_H__ */
|
||||
@@ -0,0 +1,18 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h>
|
||||
|
||||
#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
|
||||
);
|
||||
|
||||
@@ -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 <AIM/aim_log.h>
|
||||
|
||||
#endif /* __X86_64_MLNX_MSN3800_LOG_H__ */
|
||||
@@ -0,0 +1,24 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h>
|
||||
|
||||
#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 <x86_64_mlnx_msn3800/x86_64_mlnx_msn3800.x>
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __x86_64_mlnx_msn3800_module_init__(void)
|
||||
{
|
||||
AIM_LOG_STRUCT_REGISTER();
|
||||
datatypes_init__();
|
||||
}
|
||||
|
||||
int __onlp_platform_version__ = 1;
|
||||
@@ -0,0 +1,50 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_mlnx_msn3800/x86_64_mlnx_msn3800_config.h>
|
||||
|
||||
#if x86_64_mlnx_msn3800_CONFIG_INCLUDE_UCLI == 1
|
||||
|
||||
#include <uCli/ucli.h>
|
||||
#include <uCli/ucli_argparse.h>
|
||||
#include <uCli/ucli_handler_macros.h>
|
||||
|
||||
static ucli_status_t
|
||||
x86_64_mlnx_msn3800_ucli_ucli__config__(ucli_context_t* uc)
|
||||
{
|
||||
UCLI_HANDLER_MACRO_MODULE_CONFIG(x86_64_mlnx_msn3800)
|
||||
}
|
||||
|
||||
/* <auto.ucli.handlers.start> */
|
||||
/* <auto.ucli.handlers.end> */
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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-msn3800 REVISION=r0
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user